Clean up, and realizing I don't have to send custom sound packets

This commit is contained in:
pahimar 2012-11-26 13:30:01 -05:00
parent 0b8413ec67
commit aa0b4219f6
4 changed files with 22 additions and 16 deletions

View file

@ -40,32 +40,38 @@ public class ClientProxy extends CommonProxy {
@Override
public void registerKeyBindingHandler() {
KeyBindingRegistry.registerKeyBinding(new KeyBindingHandler());
}
@Override
public void registerRenderTickHandler() {
TickRegistry.registerTickHandler(new RenderTickHandler(), Side.CLIENT);
}
@Override
public void registerDrawBlockHighlightHandler() {
MinecraftForge.EVENT_BUS.register(new DrawBlockHighlightHandler());
}
@Override
public void setKeyBinding(String name, int value) {
KeyBindingHelper.addKeyBinding(name, value);
KeyBindingHelper.addIsRepeating(false);
}
@Override
public void registerSoundHandler() {
MinecraftForge.EVENT_BUS.register(new SoundHandler());
}
@Override
public void initCustomRarityTypes() {
EnumHelperClient.addRarity(JUNK, COLOR_JUNK, DISPLAY_NAME_JUNK);
EnumHelperClient.addRarity(NORMAL, COLOR_NORMAL, DISPLAY_NAME_NORMAL);
EnumHelperClient.addRarity(UNCOMMON, COLOR_UNCOMMON, DISPLAY_NAME_UNCOMMON);
@ -77,31 +83,34 @@ public class ClientProxy extends CommonProxy {
@Override
public EnumRarity getCustomRarityType(String customRarity) {
for (EnumRarity rarity : EnumRarity.class.getEnumConstants()) {
if (rarity.name().equals(customRarity))
return rarity;
}
return EnumRarity.common;
}
@Override
public void initRenderingAndTextures() {
RenderIds.calcinatorRenderId = RenderingRegistry.getNextAvailableRenderId();
MinecraftForgeClient.preloadTexture(Reference.SPRITE_SHEET_LOCATION + Reference.BLOCK_SPRITE_SHEET);
RenderIds.calcinatorRenderId = RenderingRegistry.getNextAvailableRenderId();
MinecraftForgeClient.preloadTexture(Reference.SPRITE_SHEET_LOCATION + Reference.BLOCK_SPRITE_SHEET);
MinecraftForgeClient.preloadTexture(Reference.SPRITE_SHEET_LOCATION + Reference.ITEM_SPRITE_SHEET);
FMLClientHandler.instance().getClient().renderEngine.registerTextureFX(new TextureRedWaterFX());
FMLClientHandler.instance().getClient().renderEngine.registerTextureFX(new TextureRedWaterFlowFX());
MinecraftForgeClient.registerItemRenderer(BlockIds.CALCINATOR, new RenderItemCalcinator());
}
@Override
public void initTileEntities() {
super.initTileEntities();
ClientRegistry.bindTileEntitySpecialRenderer(TileCalcinator.class, new RenderCalcinator());
super.initTileEntities();
ClientRegistry.bindTileEntitySpecialRenderer(TileCalcinator.class, new RenderCalcinator());
}
}

View file

@ -38,7 +38,6 @@ public class TransmutationHelper {
if (nextItem != null) {
if (Block.blocksList[nextItem.itemID] != null) {
world.setBlockAndMetadataWithNotify(x, y, z, nextItem.itemID, nextItem.getItemDamage());
// TODO Send the sound event to everyone around the player, and not just play the sound on the current client
world.playSoundAtEntity(player, Sounds.TRANSMUTE, 0.5F, 1.0F);
return true;
}

View file

@ -38,7 +38,6 @@ public class PacketKeyPressed extends PacketEE {
this.key = key;
}
@Override
public void writeData(DataOutputStream data) throws IOException {
data.writeUTF(key);
}

View file

@ -52,7 +52,6 @@ public class PacketTileUpdate extends PacketEE {
this.player = player;
}
@Override
public void writeData(DataOutputStream data) throws IOException {
data.writeInt(x);
data.writeInt(y);