Update mappoings snapshot to 20160518

This commit is contained in:
LexManos 2016-05-18 05:11:56 -07:00
parent b9ac73b0f1
commit cdc86e9af6
60 changed files with 514 additions and 810 deletions

View file

@ -27,8 +27,7 @@ apply plugin: "net.minecraftforge.gradle.launch4j"
minecraft { minecraft {
version = "1.9.4" version = "1.9.4"
mappings = 'snapshot_nodoc_20160312' mappings = 'snapshot_nodoc_20160518'
//mappings = "snapshot_nodoc_20151122"
workspaceDir = "projects" workspaceDir = "projects"
versionJson = "jsons/1.9.4-dev.json" versionJson = "jsons/1.9.4-dev.json"
buildUserdev = true buildUserdev = true
@ -377,6 +376,7 @@ task setupForge { dependsOn 'setup' }
task buildPackages { dependsOn 'build' } task buildPackages { dependsOn 'build' }
//Temporary hack to fix compile errors caused by mappings shading in Bootstrap //Temporary hack to fix compile errors caused by mappings shading in Bootstrap
/*
task fixParams << { task fixParams << {
logger.lifecycle('Fixing param names!') logger.lifecycle('Fixing param names!')
def params = new File(extractMcpMappings.destinationDir, 'params.csv') def params = new File(extractMcpMappings.destinationDir, 'params.csv')
@ -386,3 +386,4 @@ task fixParams << {
} }
fixParams.dependsOn('extractMcpMappings') fixParams.dependsOn('extractMcpMappings')
extractMcpMappings.finalizedBy('fixParams') extractMcpMappings.finalizedBy('fixParams')
*/

View file

@ -9,7 +9,7 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
} }
} }
apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'net.minecraftforge.gradle.forge'

View file

@ -162,3 +162,10 @@
this.func_175552_ct(); this.func_175552_ct();
return p_180482_2_; return p_180482_2_;
} }
@@ -1030,4 +1077,6 @@
return ((Integer)this.func_76341_a()).intValue() >= ((Integer)this.func_76340_b()).intValue() ? ((Integer)this.func_76341_a()).intValue() : ((Integer)this.func_76341_a()).intValue() + p_179412_1_.nextInt(((Integer)this.func_76340_b()).intValue() - ((Integer)this.func_76341_a()).intValue() + 1);
}
}
+ //MODDERS DO NOT USE OR EDIT THIS IN ANY WAY IT WILL HAVE NO EFFECT, THIS IS JUST IN HERE TO ALLOW FORGE TO ACCESS IT
+ public static ITradeList[][][][] GET_TRADES_DONT_USE(){ return field_175561_bA; }
}

View file

@ -8,4 +8,4 @@
+ if (p_180614_6_ == EnumFacing.UP && iblockstate.func_177230_c() instanceof BlockFence) //Forge: Fix Vanilla bug comparing state instead of block + if (p_180614_6_ == EnumFacing.UP && iblockstate.func_177230_c() instanceof BlockFence) //Forge: Fix Vanilla bug comparing state instead of block
{ {
d0 = 0.5D; d0 = 0.5D;
} }

View file

@ -585,7 +585,7 @@
{ {
j = 1; j = 1;
} }
@@ -2692,7 +2867,7 @@ @@ -2691,7 +2866,7 @@
int j4 = j2 + enumfacing.func_96559_d(); int j4 = j2 + enumfacing.func_96559_d();
int k4 = k2 + enumfacing.func_82599_e(); int k4 = k2 + enumfacing.func_82599_e();
blockpos$pooledmutableblockpos.func_185343_d(i4, j4, k4); blockpos$pooledmutableblockpos.func_185343_d(i4, j4, k4);

View file

@ -99,7 +99,7 @@ public class ClientCommandHandler extends CommandHandler
private TextComponentTranslation format(TextFormatting color, String str, Object... args) private TextComponentTranslation format(TextFormatting color, String str, Object... args)
{ {
TextComponentTranslation ret = new TextComponentTranslation(str, args); TextComponentTranslation ret = new TextComponentTranslation(str, args);
ret.getChatStyle().setColor(color); ret.getStyle().setColor(color);
return ret; return ret;
} }

View file

@ -113,7 +113,7 @@ public class GuiIngameForge extends GuiIngame
if (renderHelmet) renderHelmet(res, partialTicks); if (renderHelmet) renderHelmet(res, partialTicks);
if (renderPortal && !mc.thePlayer.isPotionActive(MobEffects.confusion)) if (renderPortal && !mc.thePlayer.isPotionActive(MobEffects.NAUSEA))
{ {
renderPortal(res, partialTicks); renderPortal(res, partialTicks);
} }
@ -193,7 +193,7 @@ public class GuiIngameForge extends GuiIngame
protected void renderCrosshairs(float partialTicks) protected void renderCrosshairs(float partialTicks)
{ {
if (pre(CROSSHAIRS)) return; if (pre(CROSSHAIRS)) return;
bind(Gui.icons); bind(Gui.ICONS);
GlStateManager.enableBlend(); GlStateManager.enableBlend();
super.renderAttackIndicator(partialTicks, res); super.renderAttackIndicator(partialTicks, res);
post(CROSSHAIRS); post(CROSSHAIRS);
@ -217,7 +217,7 @@ public class GuiIngameForge extends GuiIngame
protected void renderBossHealth() protected void renderBossHealth()
{ {
if (pre(BOSSHEALTH)) return; if (pre(BOSSHEALTH)) return;
bind(Gui.icons); bind(Gui.ICONS);
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
mc.mcProfiler.startSection("bossHealth"); mc.mcProfiler.startSection("bossHealth");
GlStateManager.enableBlend(); GlStateManager.enableBlend();
@ -235,7 +235,7 @@ public class GuiIngameForge extends GuiIngame
if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() != null) if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() != null)
{ {
if (itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) if (itemstack.getItem() == Item.getItemFromBlock(Blocks.PUMPKIN))
{ {
renderPumpkinOverlay(res); renderPumpkinOverlay(res);
} }
@ -321,7 +321,7 @@ public class GuiIngameForge extends GuiIngame
int left = width / 2 + 91; int left = width / 2 + 91;
int top = height - right_height; int top = height - right_height;
if (player.isInsideOfMaterial(Material.water)) if (player.isInsideOfMaterial(Material.WATER))
{ {
int air = player.getAir(); int air = player.getAir();
int full = MathHelper.ceiling_double_int((double)(air - 2) * 10.0D / 300.0D); int full = MathHelper.ceiling_double_int((double)(air - 2) * 10.0D / 300.0D);
@ -341,7 +341,7 @@ public class GuiIngameForge extends GuiIngame
public void renderHealth(int width, int height) public void renderHealth(int width, int height)
{ {
bind(icons); bind(ICONS);
if (pre(HEALTH)) return; if (pre(HEALTH)) return;
mc.mcProfiler.startSection("health"); mc.mcProfiler.startSection("health");
GlStateManager.enableBlend(); GlStateManager.enableBlend();
@ -386,7 +386,7 @@ public class GuiIngameForge extends GuiIngame
if (rowHeight != 10) left_height += 10 - rowHeight; if (rowHeight != 10) left_height += 10 - rowHeight;
int regen = -1; int regen = -1;
if (player.isPotionActive(MobEffects.regeneration)) if (player.isPotionActive(MobEffects.REGENERATION))
{ {
regen = updateCounter % 25; regen = updateCounter % 25;
} }
@ -394,8 +394,8 @@ public class GuiIngameForge extends GuiIngame
final int TOP = 9 * (mc.theWorld.getWorldInfo().isHardcoreModeEnabled() ? 5 : 0); final int TOP = 9 * (mc.theWorld.getWorldInfo().isHardcoreModeEnabled() ? 5 : 0);
final int BACKGROUND = (highlight ? 25 : 16); final int BACKGROUND = (highlight ? 25 : 16);
int MARGIN = 16; int MARGIN = 16;
if (player.isPotionActive(MobEffects.poison)) MARGIN += 36; if (player.isPotionActive(MobEffects.POISON)) MARGIN += 36;
else if (player.isPotionActive(MobEffects.wither)) MARGIN += 72; else if (player.isPotionActive(MobEffects.WITHER)) MARGIN += 72;
float absorbRemaining = absorb; float absorbRemaining = absorb;
for (int i = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F) - 1; i >= 0; --i) for (int i = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F) - 1; i >= 0; --i)
@ -469,7 +469,7 @@ public class GuiIngameForge extends GuiIngame
int icon = 16; int icon = 16;
byte background = 0; byte background = 0;
if (mc.thePlayer.isPotionActive(MobEffects.hunger)) if (mc.thePlayer.isPotionActive(MobEffects.HUNGER))
{ {
icon += 36; icon += 36;
background = 13; background = 13;
@ -526,7 +526,7 @@ public class GuiIngameForge extends GuiIngame
protected void renderExperience(int width, int height) protected void renderExperience(int width, int height)
{ {
bind(icons); bind(ICONS);
if (pre(EXPERIENCE)) return; if (pre(EXPERIENCE)) return;
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend(); GlStateManager.disableBlend();
@ -577,7 +577,7 @@ public class GuiIngameForge extends GuiIngame
protected void renderJumpBar(int width, int height) protected void renderJumpBar(int width, int height)
{ {
bind(icons); bind(ICONS);
if (pre(JUMPBAR)) return; if (pre(JUMPBAR)) return;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend(); GlStateManager.disableBlend();
@ -792,7 +792,7 @@ public class GuiIngameForge extends GuiIngame
protected void renderPlayerList(int width, int height) protected void renderPlayerList(int width, int height)
{ {
ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(0); ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(0);
NetHandlerPlayClient handler = mc.thePlayer.sendQueue; NetHandlerPlayClient handler = mc.thePlayer.connection;
if (mc.gameSettings.keyBindPlayerList.isKeyDown() && (!mc.isIntegratedServerRunning() || handler.getPlayerInfoMap().size() > 1 || scoreobjective != null)) if (mc.gameSettings.keyBindPlayerList.isKeyDown() && (!mc.isIntegratedServerRunning() || handler.getPlayerInfoMap().size() > 1 || scoreobjective != null))
{ {
@ -813,7 +813,7 @@ public class GuiIngameForge extends GuiIngame
Entity tmp = player.getRidingEntity(); Entity tmp = player.getRidingEntity();
if (!(tmp instanceof EntityLivingBase)) return; if (!(tmp instanceof EntityLivingBase)) return;
bind(icons); bind(ICONS);
if (pre(HEALTHMOUNT)) return; if (pre(HEALTHMOUNT)) return;

View file

@ -182,7 +182,7 @@ public final class ModelLoader extends ModelBakery
@Override @Override
protected void loadBlocks() protected void loadBlocks()
{ {
List<Block> blocks = Lists.newArrayList(Iterables.filter(Block.blockRegistry, new Predicate<Block>() List<Block> blocks = Lists.newArrayList(Iterables.filter(Block.REGISTRY, new Predicate<Block>()
{ {
public boolean apply(Block block) public boolean apply(Block block)
{ {
@ -266,7 +266,7 @@ public final class ModelLoader extends ModelBakery
registerVariantNames(); registerVariantNames();
List<Item> items = Lists.newArrayList(Iterables.filter(Item.itemRegistry, new Predicate<Item>() List<Item> items = Lists.newArrayList(Iterables.filter(Item.REGISTRY, new Predicate<Item>()
{ {
public boolean apply(Item item) public boolean apply(Item item)
{ {
@ -336,7 +336,7 @@ public final class ModelLoader extends ModelBakery
} }
// empty bucket // empty bucket
for(String s : getVariantNames(Items.bucket)) for(String s : getVariantNames(Items.BUCKET))
{ {
ModelResourceLocation memory = getInventoryVariant(s); ModelResourceLocation memory = getInventoryVariant(s);
IModel model = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation("forge", "item/bucket")); IModel model = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation("forge", "item/bucket"));
@ -347,23 +347,23 @@ public final class ModelLoader extends ModelBakery
} }
} }
setBucketModel(Items.water_bucket); setBucketModel(Items.WATER_BUCKET);
setBucketModel(Items.lava_bucket); setBucketModel(Items.LAVA_BUCKET);
// milk bucket only replaced if some mod adds milk // milk bucket only replaced if some mod adds milk
if(FluidRegistry.isFluidRegistered("milk")) if(FluidRegistry.isFluidRegistered("milk"))
{ {
// can the milk be put into a bucket? // can the milk be put into a bucket?
Fluid milk = FluidRegistry.getFluid("milk"); Fluid milk = FluidRegistry.getFluid("milk");
FluidStack milkStack = new FluidStack(milk, FluidContainerRegistry.BUCKET_VOLUME); FluidStack milkStack = new FluidStack(milk, FluidContainerRegistry.BUCKET_VOLUME);
if(FluidContainerRegistry.getContainerCapacity(milkStack, new ItemStack(Items.bucket)) == FluidContainerRegistry.BUCKET_VOLUME) if(FluidContainerRegistry.getContainerCapacity(milkStack, new ItemStack(Items.BUCKET)) == FluidContainerRegistry.BUCKET_VOLUME)
{ {
setBucketModel(Items.milk_bucket); setBucketModel(Items.MILK_BUCKET);
} }
} }
else else
{ {
// milk bucket if no milk fluid is present // milk bucket if no milk fluid is present
for(String s : getVariantNames(Items.milk_bucket)) for(String s : getVariantNames(Items.MILK_BUCKET))
{ {
ModelResourceLocation memory = getInventoryVariant(s); ModelResourceLocation memory = getInventoryVariant(s);
IModel model = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation("forge", "item/bucket_milk")); IModel model = ModelLoaderRegistry.getModelOrMissing(new ResourceLocation("forge", "item/bucket_milk"));

View file

@ -70,7 +70,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
lighter.setParent(new VertexBufferConsumer(VertexBuffer)); lighter.setParent(new VertexBufferConsumer(VertexBuffer));
lighter.setWorld(entity.worldObj); lighter.setWorld(entity.worldObj);
lighter.setState(Blocks.air.getDefaultState()); lighter.setState(Blocks.AIR.getDefaultState());
lighter.setBlockPos(pos); lighter.setBlockPos(pos);
boolean empty = true; boolean empty = true;
List<BakedQuad> quads = bakedModel.getQuads(null, null, 0); List<BakedQuad> quads = bakedModel.getQuads(null, null, 0);

View file

@ -19,7 +19,7 @@ public abstract class FastTESR<T extends TileEntity> extends TileEntitySpecialRe
{ {
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
VertexBuffer VertexBuffer = tessellator.getBuffer(); VertexBuffer VertexBuffer = tessellator.getBuffer();
this.bindTexture(TextureMap.locationBlocksTexture); this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.enableBlend(); GlStateManager.enableBlend();

View file

@ -11,7 +11,7 @@ public enum KeyModifier {
@Override @Override
public boolean matches(int keyCode) public boolean matches(int keyCode)
{ {
if (Minecraft.isRunningOnMac) if (Minecraft.IS_RUNNING_ON_MAC)
{ {
return keyCode == Keyboard.KEY_LMETA || keyCode == Keyboard.KEY_RMETA; return keyCode == Keyboard.KEY_LMETA || keyCode == Keyboard.KEY_RMETA;
} }
@ -31,7 +31,7 @@ public enum KeyModifier {
public String getLocalizedComboName(int keyCode) public String getLocalizedComboName(int keyCode)
{ {
String keyName = GameSettings.getKeyDisplayString(keyCode); String keyName = GameSettings.getKeyDisplayString(keyCode);
String localizationFormatKey = Minecraft.isRunningOnMac ? "forge.controlsgui.control.mac" : "forge.controlsgui.control"; String localizationFormatKey = Minecraft.IS_RUNNING_ON_MAC ? "forge.controlsgui.control.mac" : "forge.controlsgui.control";
return I18n.format(localizationFormatKey, keyName); return I18n.format(localizationFormatKey, keyName);
} }
}, },

View file

@ -147,7 +147,7 @@ public class BiomeDictionary
{ {
types = listSubTags(types); types = listSubTags(types);
if(Biome.biomeRegistry.getNameForObject(biome) != null) if(Biome.REGISTRY.getNameForObject(biome) != null)
{ {
for(Type type : types) for(Type type : types)
{ {
@ -161,7 +161,7 @@ public class BiomeDictionary
if(!isBiomeRegistered(biome)) if(!isBiomeRegistered(biome))
{ {
ResourceLocation location = Biome.biomeRegistry.getNameForObject(biome); ResourceLocation location = Biome.REGISTRY.getNameForObject(biome);
biomeInfoMap.put(location, new BiomeInfo(types)); biomeInfoMap.put(location, new BiomeInfo(types));
} }
else else
@ -249,7 +249,7 @@ public class BiomeDictionary
*/ */
public static boolean isBiomeRegistered(Biome biome) public static boolean isBiomeRegistered(Biome biome)
{ {
return biomeInfoMap.containsKey(Biome.biomeRegistry.getNameForObject(biome)); return biomeInfoMap.containsKey(Biome.REGISTRY.getNameForObject(biome));
} }
public static void registerAllBiomes() public static void registerAllBiomes()
@ -265,9 +265,9 @@ public class BiomeDictionary
*/ */
public static void registerAllBiomesAndGenerateEvents() public static void registerAllBiomesAndGenerateEvents()
{ {
for (ResourceLocation biomeResource : Biome.biomeRegistry.getKeys()) for (ResourceLocation biomeResource : Biome.REGISTRY.getKeys())
{ {
Biome biome = Biome.biomeRegistry.getObject(biomeResource); Biome biome = Biome.REGISTRY.getObject(biomeResource);
if (biome.theBiomeDecorator instanceof DeferredBiomeDecorator) if (biome.theBiomeDecorator instanceof DeferredBiomeDecorator)
{ {
@ -373,20 +373,20 @@ public class BiomeDictionary
BiomeDictionary.registerBiomeType(biome, SNOWY); BiomeDictionary.registerBiomeType(biome, SNOWY);
} }
if (biome.topBlock != Blocks.sand && biome.getTemperature() >= 1.0f && biome.getRainfall() < 0.2f) if (biome.topBlock != Blocks.SAND && biome.getTemperature() >= 1.0f && biome.getRainfall() < 0.2f)
{ {
BiomeDictionary.registerBiomeType(biome, SAVANNA); BiomeDictionary.registerBiomeType(biome, SAVANNA);
} }
if (biome.topBlock == Blocks.sand ) if (biome.topBlock == Blocks.SAND)
{ {
BiomeDictionary.registerBiomeType(biome, SANDY); BiomeDictionary.registerBiomeType(biome, SANDY);
} }
else if (biome.topBlock == Blocks.mycelium) else if (biome.topBlock == Blocks.MYCELIUM)
{ {
BiomeDictionary.registerBiomeType(biome, MUSHROOM); BiomeDictionary.registerBiomeType(biome, MUSHROOM);
} }
if (biome.fillerBlock == Blocks.hardened_clay) if (biome.fillerBlock == Blocks.HARDENED_CLAY)
{ {
BiomeDictionary.registerBiomeType(biome, MESA); BiomeDictionary.registerBiomeType(biome, MESA);
} }
@ -395,7 +395,7 @@ public class BiomeDictionary
//Internal implementation //Internal implementation
private static BiomeInfo getBiomeInfo(Biome biome) private static BiomeInfo getBiomeInfo(Biome biome)
{ {
return biomeInfoMap.get(Biome.biomeRegistry.getNameForObject(biome)); return biomeInfoMap.get(Biome.REGISTRY.getNameForObject(biome));
} }
private static void checkRegistration(Biome biome) private static void checkRegistration(Biome biome)
@ -436,45 +436,45 @@ public class BiomeDictionary
private static void registerVanillaBiomes() private static void registerVanillaBiomes()
{ {
registerBiomeType(Biomes.ocean, OCEAN ); registerBiomeType(Biomes.OCEAN, OCEAN );
registerBiomeType(Biomes.plains, PLAINS ); registerBiomeType(Biomes.PLAINS, PLAINS );
registerBiomeType(Biomes.desert, HOT, DRY, SANDY ); registerBiomeType(Biomes.DESERT, HOT, DRY, SANDY );
registerBiomeType(Biomes.extremeHills, MOUNTAIN, HILLS ); registerBiomeType(Biomes.EXTREME_HILLS, MOUNTAIN, HILLS );
registerBiomeType(Biomes.forest, FOREST ); registerBiomeType(Biomes.FOREST, FOREST );
registerBiomeType(Biomes.taiga, COLD, CONIFEROUS, FOREST ); registerBiomeType(Biomes.TAIGA, COLD, CONIFEROUS, FOREST );
registerBiomeType(Biomes.taigaHills, COLD, CONIFEROUS, FOREST, HILLS ); registerBiomeType(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
registerBiomeType(Biomes.swampland, WET, SWAMP ); registerBiomeType(Biomes.SWAMPLAND, WET, SWAMP );
registerBiomeType(Biomes.river, RIVER ); registerBiomeType(Biomes.RIVER, RIVER );
registerBiomeType(Biomes.frozenOcean, COLD, OCEAN, SNOWY ); registerBiomeType(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY );
registerBiomeType(Biomes.frozenRiver, COLD, RIVER, SNOWY ); registerBiomeType(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY );
registerBiomeType(Biomes.icePlains, COLD, SNOWY, WASTELAND ); registerBiomeType(Biomes.ICE_PLAINS, COLD, SNOWY, WASTELAND );
registerBiomeType(Biomes.iceMountains, COLD, SNOWY, MOUNTAIN ); registerBiomeType(Biomes.ICE_MOUNTAINS, COLD, SNOWY, MOUNTAIN );
registerBiomeType(Biomes.beach, BEACH ); registerBiomeType(Biomes.BEACH, BEACH );
registerBiomeType(Biomes.desertHills, HOT, DRY, SANDY, HILLS ); registerBiomeType(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS );
registerBiomeType(Biomes.jungle, HOT, WET, DENSE, JUNGLE ); registerBiomeType(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE );
registerBiomeType(Biomes.jungleHills, HOT, WET, DENSE, JUNGLE, HILLS); registerBiomeType(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS);
registerBiomeType(Biomes.forestHills, FOREST, HILLS ); registerBiomeType(Biomes.FOREST_HILLS, FOREST, HILLS );
registerBiomeType(Biomes.sky, COLD, DRY, END ); registerBiomeType(Biomes.SKY, COLD, DRY, END );
registerBiomeType(Biomes.hell, HOT, DRY, NETHER ); registerBiomeType(Biomes.HELL, HOT, DRY, NETHER );
registerBiomeType(Biomes.mushroomIsland, MUSHROOM ); registerBiomeType(Biomes.MUSHROOM_ISLAND, MUSHROOM );
registerBiomeType(Biomes.extremeHillsEdge, MOUNTAIN ); registerBiomeType(Biomes.EXTREME_HILLS_EDGE, MOUNTAIN );
registerBiomeType(Biomes.mushroomIslandShore, MUSHROOM, BEACH ); registerBiomeType(Biomes.MUSHROOM_ISLAND_SHORE, MUSHROOM, BEACH );
registerBiomeType(Biomes.jungleEdge, HOT, WET, JUNGLE, FOREST ); registerBiomeType(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST );
registerBiomeType(Biomes.deepOcean, OCEAN ); registerBiomeType(Biomes.DEEP_OCEAN, OCEAN );
registerBiomeType(Biomes.stoneBeach, BEACH ); registerBiomeType(Biomes.STONE_BEACH, BEACH );
registerBiomeType(Biomes.coldBeach, COLD, BEACH, SNOWY ); registerBiomeType(Biomes.COLD_BEACH, COLD, BEACH, SNOWY );
registerBiomeType(Biomes.birchForest, FOREST ); registerBiomeType(Biomes.BIRCH_FOREST, FOREST );
registerBiomeType(Biomes.birchForestHills, FOREST, HILLS ); registerBiomeType(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS );
registerBiomeType(Biomes.roofedForest, SPOOKY, DENSE, FOREST ); registerBiomeType(Biomes.ROOFED_FOREST, SPOOKY, DENSE, FOREST );
registerBiomeType(Biomes.coldTaiga, COLD, CONIFEROUS, FOREST, SNOWY ); registerBiomeType(Biomes.COLD_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY );
registerBiomeType(Biomes.coldTaigaHills, COLD, CONIFEROUS, FOREST, SNOWY, HILLS); registerBiomeType(Biomes.COLD_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS);
registerBiomeType(Biomes.megaTaiga, COLD, CONIFEROUS, FOREST ); registerBiomeType(Biomes.REDWOOD_TAIGA, COLD, CONIFEROUS, FOREST );
registerBiomeType(Biomes.megaTaigaHills, COLD, CONIFEROUS, FOREST, HILLS ); registerBiomeType(Biomes.REDWOOD_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
registerBiomeType(Biomes.extremeHillsPlus, MOUNTAIN, FOREST, SPARSE ); registerBiomeType(Biomes.EXTREME_HILLS_WITH_TREES, MOUNTAIN, FOREST, SPARSE );
registerBiomeType(Biomes.savanna, HOT, SAVANNA, PLAINS, SPARSE ); registerBiomeType(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE );
registerBiomeType(Biomes.savannaPlateau, HOT, SAVANNA, PLAINS, SPARSE ); registerBiomeType(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE );
registerBiomeType(Biomes.mesa, MESA, SANDY ); registerBiomeType(Biomes.MESA, MESA, SANDY );
registerBiomeType(Biomes.mesaPlateau_F, MESA, SPARSE, SANDY ); registerBiomeType(Biomes.MESA_ROCK, MESA, SPARSE, SANDY );
registerBiomeType(Biomes.mesaPlateau, MESA, SANDY ); registerBiomeType(Biomes.MESA_CLEAR_ROCK, MESA, SANDY );
} }
} }

View file

@ -25,9 +25,9 @@ public class BiomeManager
static static
{ {
oceanBiomes.add(Biomes.ocean); oceanBiomes.add(Biomes.OCEAN);
oceanBiomes.add(Biomes.deepOcean); oceanBiomes.add(Biomes.DEEP_OCEAN);
oceanBiomes.add(Biomes.frozenOcean); oceanBiomes.add(Biomes.FROZEN_OCEAN);
} }
private static TrackedList<BiomeEntry>[] setupBiomes() private static TrackedList<BiomeEntry>[] setupBiomes()
@ -36,26 +36,26 @@ public class BiomeManager
TrackedList<BiomeEntry>[] currentBiomes = new TrackedList[BiomeType.values().length]; TrackedList<BiomeEntry>[] currentBiomes = new TrackedList[BiomeType.values().length];
List<BiomeEntry> list = new ArrayList<BiomeEntry>(); List<BiomeEntry> list = new ArrayList<BiomeEntry>();
list.add(new BiomeEntry(Biomes.forest, 10)); list.add(new BiomeEntry(Biomes.FOREST, 10));
list.add(new BiomeEntry(Biomes.roofedForest, 10)); list.add(new BiomeEntry(Biomes.ROOFED_FOREST, 10));
list.add(new BiomeEntry(Biomes.extremeHills, 10)); list.add(new BiomeEntry(Biomes.EXTREME_HILLS, 10));
list.add(new BiomeEntry(Biomes.plains, 10)); list.add(new BiomeEntry(Biomes.PLAINS, 10));
list.add(new BiomeEntry(Biomes.birchForest, 10)); list.add(new BiomeEntry(Biomes.BIRCH_FOREST, 10));
list.add(new BiomeEntry(Biomes.swampland, 10)); list.add(new BiomeEntry(Biomes.SWAMPLAND, 10));
currentBiomes[BiomeType.WARM.ordinal()] = new TrackedList<BiomeEntry>(list); currentBiomes[BiomeType.WARM.ordinal()] = new TrackedList<BiomeEntry>(list);
list.clear(); list.clear();
list.add(new BiomeEntry(Biomes.forest, 10)); list.add(new BiomeEntry(Biomes.FOREST, 10));
list.add(new BiomeEntry(Biomes.extremeHills, 10)); list.add(new BiomeEntry(Biomes.EXTREME_HILLS, 10));
list.add(new BiomeEntry(Biomes.taiga, 10)); list.add(new BiomeEntry(Biomes.TAIGA, 10));
list.add(new BiomeEntry(Biomes.plains, 10)); list.add(new BiomeEntry(Biomes.PLAINS, 10));
currentBiomes[BiomeType.COOL.ordinal()] = new TrackedList<BiomeEntry>(list); currentBiomes[BiomeType.COOL.ordinal()] = new TrackedList<BiomeEntry>(list);
list.clear(); list.clear();
list.add(new BiomeEntry(Biomes.icePlains, 30)); list.add(new BiomeEntry(Biomes.ICE_PLAINS, 30));
list.add(new BiomeEntry(Biomes.coldTaiga, 10)); list.add(new BiomeEntry(Biomes.COLD_TAIGA, 10));
currentBiomes[BiomeType.ICY.ordinal()] = new TrackedList<BiomeEntry>(list); currentBiomes[BiomeType.ICY.ordinal()] = new TrackedList<BiomeEntry>(list);
list.clear(); list.clear();
@ -67,21 +67,21 @@ public class BiomeManager
public static void addVillageBiome(Biome biome, boolean canSpawn) public static void addVillageBiome(Biome biome, boolean canSpawn)
{ {
if (!MapGenVillage.villageSpawnBiomes.contains(biome)) if (!MapGenVillage.VILLAGE_SPAWN_BIOMES.contains(biome))
{ {
ArrayList<Biome> biomes = new ArrayList<Biome>(MapGenVillage.villageSpawnBiomes); ArrayList<Biome> biomes = new ArrayList<Biome>(MapGenVillage.VILLAGE_SPAWN_BIOMES);
biomes.add(biome); biomes.add(biome);
MapGenVillage.villageSpawnBiomes = biomes; MapGenVillage.VILLAGE_SPAWN_BIOMES = biomes;
} }
} }
public static void removeVillageBiome(Biome biome) public static void removeVillageBiome(Biome biome)
{ {
if (MapGenVillage.villageSpawnBiomes.contains(biome)) if (MapGenVillage.VILLAGE_SPAWN_BIOMES.contains(biome))
{ {
ArrayList<Biome> biomes = new ArrayList<Biome>(MapGenVillage.villageSpawnBiomes); ArrayList<Biome> biomes = new ArrayList<Biome>(MapGenVillage.VILLAGE_SPAWN_BIOMES);
biomes.remove(biome); biomes.remove(biome);
MapGenVillage.villageSpawnBiomes = biomes; MapGenVillage.VILLAGE_SPAWN_BIOMES = biomes;
} }
} }

View file

@ -222,20 +222,20 @@ public class ForgeHooks
block.setHarvestLevel("axe", 0); block.setHarvestLevel("axe", 0);
} }
Blocks.obsidian.setHarvestLevel("pickaxe", 3); Blocks.OBSIDIAN.setHarvestLevel("pickaxe", 3);
Block[] oreBlocks = new Block[] { Block[] oreBlocks = new Block[] {
Blocks.emerald_ore, Blocks.emerald_block, Blocks.diamond_ore, Blocks.diamond_block, Blocks.EMERALD_ORE, Blocks.EMERALD_BLOCK, Blocks.DIAMOND_ORE, Blocks.DIAMOND_BLOCK,
Blocks.gold_ore, Blocks.gold_block, Blocks.redstone_ore, Blocks.lit_redstone_ore Blocks.GOLD_ORE, Blocks.GOLD_BLOCK, Blocks.REDSTONE_ORE, Blocks.LIT_REDSTONE_ORE
}; };
for (Block block : oreBlocks) for (Block block : oreBlocks)
{ {
block.setHarvestLevel("pickaxe", 2); block.setHarvestLevel("pickaxe", 2);
} }
Blocks.iron_ore.setHarvestLevel("pickaxe", 1); Blocks.IRON_ORE.setHarvestLevel("pickaxe", 1);
Blocks.iron_block.setHarvestLevel("pickaxe", 1); Blocks.IRON_BLOCK.setHarvestLevel("pickaxe", 1);
Blocks.lapis_ore.setHarvestLevel("pickaxe", 1); Blocks.LAPIS_ORE.setHarvestLevel("pickaxe", 1);
Blocks.lapis_block.setHarvestLevel("pickaxe", 1); Blocks.LAPIS_BLOCK.setHarvestLevel("pickaxe", 1);
Blocks.quartz_ore.setHarvestLevel("pickaxe", 0); Blocks.QUARTZ_ORE.setHarvestLevel("pickaxe", 0);
} }
public static int getTotalArmorValue(EntityPlayer player) public static int getTotalArmorValue(EntityPlayer player)
@ -258,11 +258,11 @@ public class ForgeHooks
static static
{ {
seedList.add(new SeedEntry(new ItemStack(Items.wheat_seeds), 10) seedList.add(new SeedEntry(new ItemStack(Items.WHEAT_SEEDS), 10)
{ {
public ItemStack getStack(Random rand, int fortune) public ItemStack getStack(Random rand, int fortune)
{ {
return new ItemStack(Items.wheat_seeds, 1 + rand.nextInt(fortune * 2 + 1)); return new ItemStack(Items.WHEAT_SEEDS, 1 + rand.nextInt(fortune * 2 + 1));
} }
}); });
initTools(); initTools();
@ -422,7 +422,7 @@ public class ForgeHooks
if (target.typeOfHit == RayTraceResult.Type.BLOCK) if (target.typeOfHit == RayTraceResult.Type.BLOCK)
{ {
s1 = Block.blockRegistry.getNameForObject(world.getBlockState(target.getBlockPos()).getBlock()).toString(); s1 = Block.REGISTRY.getNameForObject(world.getBlockState(target.getBlockPos()).getBlock()).toString();
} }
else if (target.typeOfHit == RayTraceResult.Type.ENTITY) else if (target.typeOfHit == RayTraceResult.Type.ENTITY)
{ {
@ -440,7 +440,7 @@ public class ForgeHooks
if (isCreative) if (isCreative)
{ {
player.inventory.func_184434_a(result); player.inventory.setPickedItemStack(result);
Minecraft.getMinecraft().playerController.sendSlotPacket(player.getHeldItem(EnumHand.MAIN_HAND), 36 + player.inventory.currentItem); Minecraft.getMinecraft().playerController.sendSlotPacket(player.getHeldItem(EnumHand.MAIN_HAND), 36 + player.inventory.currentItem);
return true; return true;
} }
@ -636,9 +636,9 @@ public class ForgeHooks
// Set the click event and append the link. // Set the click event and append the link.
ClickEvent click = new ClickEvent(ClickEvent.Action.OPEN_URL, url); ClickEvent click = new ClickEvent(ClickEvent.Action.OPEN_URL, url);
link.getChatStyle().setChatClickEvent(click); link.getStyle().setClickEvent(click);
link.getChatStyle().setUnderlined(true); link.getStyle().setUnderlined(true);
link.getChatStyle().setColor(TextFormatting.BLUE); link.getStyle().setColor(TextFormatting.BLUE);
if (ichat == null) if (ichat == null)
ichat = link; ichat = link;
else else
@ -685,8 +685,8 @@ public class ForgeHooks
if (world.getTileEntity(pos) == null) if (world.getTileEntity(pos) == null)
{ {
SPacketBlockChange packet = new SPacketBlockChange(world, pos); SPacketBlockChange packet = new SPacketBlockChange(world, pos);
packet.blockState = Blocks.air.getDefaultState(); packet.blockState = Blocks.AIR.getDefaultState();
entityPlayer.playerNetServerHandler.sendPacket(packet); entityPlayer.connection.sendPacket(packet);
} }
// Post the block break event // Post the block break event
@ -699,16 +699,16 @@ public class ForgeHooks
if (event.isCanceled()) if (event.isCanceled())
{ {
// Let the client know the block still exists // Let the client know the block still exists
entityPlayer.playerNetServerHandler.sendPacket(new SPacketBlockChange(world, pos)); entityPlayer.connection.sendPacket(new SPacketBlockChange(world, pos));
// Update any tile entity data for this block // Update any tile entity data for this block
TileEntity tileentity = world.getTileEntity(pos); TileEntity tileentity = world.getTileEntity(pos);
if (tileentity != null) if (tileentity != null)
{ {
Packet<?> pkt = tileentity.func_189518_D_(); Packet<?> pkt = tileentity.getUpdatePacket();
if (pkt != null) if (pkt != null)
{ {
entityPlayer.playerNetServerHandler.sendPacket(pkt); entityPlayer.connection.sendPacket(pkt);
} }
} }
} }
@ -798,7 +798,7 @@ public class ForgeHooks
world.markAndNotifyBlock(snap.getPos(), null, oldBlock, newBlock, updateFlag); world.markAndNotifyBlock(snap.getPos(), null, oldBlock, newBlock, updateFlag);
} }
player.addStat(StatList.func_188060_a(itemstack.getItem())); player.addStat(StatList.getCraftStats(itemstack.getItem()));
} }
} }
world.capturedBlockSnapshots.clear(); world.capturedBlockSnapshots.clear();

View file

@ -19,7 +19,7 @@ public class VanillaBrewingRecipe implements IBrewingRecipe {
public boolean isInput(ItemStack stack) public boolean isInput(ItemStack stack)
{ {
Item item = stack.getItem(); Item item = stack.getItem();
return item == Items.potionitem || item == Items.splash_potion || item == Items.lingering_potion || item == Items.glass_bottle; return item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
} }
/** /**

View file

@ -78,7 +78,7 @@ public class ExtendedBlockState extends BlockStateContainer
{ {
if (!property.getAllowedValues().contains(value)) if (!property.getAllowedValues().contains(value))
{ {
throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on block " + Block.blockRegistry.getNameForObject(getBlock()) + ", it is not an allowed value"); throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on block " + Block.REGISTRY.getNameForObject(getBlock()) + ", it is not an allowed value");
} else } else
{ {
if (this.getProperties().get(property) == value) if (this.getProperties().get(property) == value)
@ -106,7 +106,7 @@ public class ExtendedBlockState extends BlockStateContainer
} }
if(!property.isValid(value)) if(!property.isValid(value))
{ {
throw new IllegalArgumentException("Cannot set unlisted property " + property + " to " + value + " on block " + Block.blockRegistry.getNameForObject(getBlock()) + ", it is not an allowed value"); throw new IllegalArgumentException("Cannot set unlisted property " + property + " to " + value + " on block " + Block.REGISTRY.getNameForObject(getBlock()) + ", it is not an allowed value");
} }
Map<IUnlistedProperty<?>, Optional<?>> newMap = new HashMap<IUnlistedProperty<?>, Optional<?>>(unlistedProperties); Map<IUnlistedProperty<?>, Optional<?>> newMap = new HashMap<IUnlistedProperty<?>, Optional<?>>(unlistedProperties);
newMap.put(property, Optional.fromNullable(value)); newMap.put(property, Optional.fromNullable(value));

View file

@ -45,7 +45,7 @@ public class BlockSnapshot implements Serializable
if (te != null) if (te != null)
{ {
nbt = new NBTTagCompound(); nbt = new NBTTagCompound();
te.func_189515_b(getNbt()); te.writeToNBT(getNbt());
} }
else nbt = null; else nbt = null;
if (DEBUG) if (DEBUG)
@ -139,7 +139,7 @@ public class BlockSnapshot implements Serializable
public TileEntity getTileEntity() public TileEntity getTileEntity()
{ {
if (getNbt() != null) if (getNbt() != null)
return TileEntity.func_189514_c(getNbt()); return TileEntity.create(getNbt());
else return null; else return null;
} }

View file

@ -308,7 +308,7 @@ public class ForgeEventFactory
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, event.getFilledBucket()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, event.getFilledBucket());
if (!player.inventory.addItemStackToInventory(event.getFilledBucket())) if (!player.inventory.addItemStackToInventory(event.getFilledBucket()))
player.dropPlayerItemWithRandomChoice(event.getFilledBucket(), false); player.dropItem(event.getFilledBucket(), false);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
} }
@ -456,12 +456,12 @@ public class ForgeEventFactory
public static boolean renderFireOverlay(EntityPlayer player, float renderPartialTicks) public static boolean renderFireOverlay(EntityPlayer player, float renderPartialTicks)
{ {
return renderBlockOverlay(player, renderPartialTicks, OverlayType.FIRE, Blocks.fire.getDefaultState(), new BlockPos(player)); return renderBlockOverlay(player, renderPartialTicks, OverlayType.FIRE, Blocks.FIRE.getDefaultState(), new BlockPos(player));
} }
public static boolean renderWaterOverlay(EntityPlayer player, float renderPartialTicks) public static boolean renderWaterOverlay(EntityPlayer player, float renderPartialTicks)
{ {
return renderBlockOverlay(player, renderPartialTicks, OverlayType.WATER, Blocks.water.getDefaultState(), new BlockPos(player)); return renderBlockOverlay(player, renderPartialTicks, OverlayType.WATER, Blocks.WATER.getDefaultState(), new BlockPos(player));
} }
public static boolean renderBlockOverlay(EntityPlayer player, float renderPartialTicks, OverlayType type, IBlockState block, BlockPos pos) public static boolean renderBlockOverlay(EntityPlayer player, float renderPartialTicks, OverlayType type, IBlockState block, BlockPos pos)

View file

@ -101,13 +101,13 @@ public class BlockEvent extends Event
this.player = player; this.player = player;
if (state == null || !ForgeHooks.canHarvestBlock(state.getBlock(), player, world, pos) || // Handle empty block or player unable to break block scenario if (state == null || !ForgeHooks.canHarvestBlock(state.getBlock(), player, world, pos) || // Handle empty block or player unable to break block scenario
(state.getBlock().canSilkHarvest(world, pos, world.getBlockState(pos), player) && EnchantmentHelper.getEnchantmentLevel(Enchantments.silkTouch, player.getHeldItemMainhand()) > 0)) // If the block is being silk harvested, the exp dropped is 0 (state.getBlock().canSilkHarvest(world, pos, world.getBlockState(pos), player) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, player.getHeldItemMainhand()) > 0)) // If the block is being silk harvested, the exp dropped is 0
{ {
this.exp = 0; this.exp = 0;
} }
else else
{ {
int bonusLevel = EnchantmentHelper.getEnchantmentLevel(Enchantments.fortune, player.getHeldItemMainhand()); int bonusLevel = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, player.getHeldItemMainhand());
this.exp = state.getBlock().getExpDrop(state, world, pos, bonusLevel); this.exp = state.getBlock().getExpDrop(state, world, pos, bonusLevel);
} }
} }

View file

@ -41,47 +41,47 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
static static
{ {
defaultDisplacements.put(Blocks.oak_door, false); defaultDisplacements.put(Blocks.OAK_DOOR, false);
defaultDisplacements.put(Blocks.spruce_door, false); defaultDisplacements.put(Blocks.SPRUCE_DOOR, false);
defaultDisplacements.put(Blocks.birch_door, false); defaultDisplacements.put(Blocks.BIRCH_DOOR, false);
defaultDisplacements.put(Blocks.jungle_door, false); defaultDisplacements.put(Blocks.JUNGLE_DOOR, false);
defaultDisplacements.put(Blocks.acacia_door, false); defaultDisplacements.put(Blocks.ACACIA_DOOR, false);
defaultDisplacements.put(Blocks.dark_oak_door, false); defaultDisplacements.put(Blocks.DARK_OAK_DOOR, false);
defaultDisplacements.put(Blocks.trapdoor, false); defaultDisplacements.put(Blocks.TRAPDOOR, false);
defaultDisplacements.put(Blocks.iron_trapdoor, false); defaultDisplacements.put(Blocks.IRON_TRAPDOOR, false);
defaultDisplacements.put(Blocks.oak_fence, false); defaultDisplacements.put(Blocks.OAK_FENCE, false);
defaultDisplacements.put(Blocks.spruce_fence, false); defaultDisplacements.put(Blocks.SPRUCE_FENCE, false);
defaultDisplacements.put(Blocks.birch_fence, false); defaultDisplacements.put(Blocks.BIRCH_FENCE, false);
defaultDisplacements.put(Blocks.jungle_fence, false); defaultDisplacements.put(Blocks.JUNGLE_FENCE, false);
defaultDisplacements.put(Blocks.dark_oak_fence, false); defaultDisplacements.put(Blocks.DARK_OAK_FENCE, false);
defaultDisplacements.put(Blocks.acacia_fence, false); defaultDisplacements.put(Blocks.ACACIA_FENCE, false);
defaultDisplacements.put(Blocks.nether_brick_fence, false); defaultDisplacements.put(Blocks.NETHER_BRICK_FENCE, false);
defaultDisplacements.put(Blocks.oak_fence_gate, false); defaultDisplacements.put(Blocks.OAK_FENCE_GATE, false);
defaultDisplacements.put(Blocks.spruce_fence_gate, false); defaultDisplacements.put(Blocks.SPRUCE_FENCE_GATE, false);
defaultDisplacements.put(Blocks.birch_fence_gate, false); defaultDisplacements.put(Blocks.BIRCH_FENCE_GATE, false);
defaultDisplacements.put(Blocks.jungle_fence_gate, false); defaultDisplacements.put(Blocks.JUNGLE_FENCE_GATE, false);
defaultDisplacements.put(Blocks.dark_oak_fence_gate, false); defaultDisplacements.put(Blocks.DARK_OAK_FENCE_GATE, false);
defaultDisplacements.put(Blocks.acacia_fence_gate, false); defaultDisplacements.put(Blocks.ACACIA_FENCE_GATE, false);
defaultDisplacements.put(Blocks.wooden_pressure_plate, false); defaultDisplacements.put(Blocks.WOODEN_PRESSURE_PLATE, false);
defaultDisplacements.put(Blocks.stone_pressure_plate, false); defaultDisplacements.put(Blocks.STONE_PRESSURE_PLATE, false);
defaultDisplacements.put(Blocks.light_weighted_pressure_plate, false); defaultDisplacements.put(Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE, false);
defaultDisplacements.put(Blocks.heavy_weighted_pressure_plate, false); defaultDisplacements.put(Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE, false);
defaultDisplacements.put(Blocks.ladder, false); defaultDisplacements.put(Blocks.LADDER, false);
defaultDisplacements.put(Blocks.iron_bars, false); defaultDisplacements.put(Blocks.IRON_BARS, false);
defaultDisplacements.put(Blocks.glass_pane, false); defaultDisplacements.put(Blocks.GLASS_PANE, false);
defaultDisplacements.put(Blocks.stained_glass_pane, false); defaultDisplacements.put(Blocks.STAINED_GLASS_PANE, false);
defaultDisplacements.put(Blocks.portal, false); defaultDisplacements.put(Blocks.PORTAL, false);
defaultDisplacements.put(Blocks.end_portal, false); defaultDisplacements.put(Blocks.END_PORTAL, false);
defaultDisplacements.put(Blocks.cobblestone_wall, false); defaultDisplacements.put(Blocks.COBBLESTONE_WALL, false);
defaultDisplacements.put(Blocks.barrier, false); defaultDisplacements.put(Blocks.BARRIER, false);
defaultDisplacements.put(Blocks.standing_banner, false); defaultDisplacements.put(Blocks.STANDING_BANNER, false);
defaultDisplacements.put(Blocks.wall_banner, false); defaultDisplacements.put(Blocks.WALL_BANNER, false);
defaultDisplacements.put(Blocks.cake, false); defaultDisplacements.put(Blocks.CAKE, false);
defaultDisplacements.put(Blocks.iron_door, false); defaultDisplacements.put(Blocks.IRON_DOOR, false);
defaultDisplacements.put(Blocks.standing_sign, false); defaultDisplacements.put(Blocks.STANDING_SIGN, false);
defaultDisplacements.put(Blocks.wall_sign, false); defaultDisplacements.put(Blocks.WALL_SIGN, false);
defaultDisplacements.put(Blocks.reeds, false); defaultDisplacements.put(Blocks.REEDS, false);
} }
protected Map<Block, Boolean> displacements = Maps.newHashMap(); protected Map<Block, Boolean> displacements = Maps.newHashMap();
@ -212,7 +212,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
} }
Material material = state.getMaterial(); Material material = state.getMaterial();
if (material.blocksMovement() || material == Material.portal) if (material.blocksMovement() || material == Material.PORTAL)
{ {
return false; return false;
} }
@ -261,7 +261,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
} }
Material material = state.getMaterial(); Material material = state.getMaterial();
if (material.blocksMovement() || material == Material.portal) if (material.blocksMovement() || material == Material.PORTAL)
{ {
return false; return false;
} }
@ -298,7 +298,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
} }
@Override @Override
public void func_189540_a(IBlockState state, World world, BlockPos pos, Block neighborBlock) public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock)
{ {
world.scheduleUpdate(pos, this, tickRate); world.scheduleUpdate(pos, this, tickRate);
} }

View file

@ -43,7 +43,7 @@ public class BlockFluidClassic extends BlockFluidBase
public int getQuantaValue(IBlockAccess world, BlockPos pos) public int getQuantaValue(IBlockAccess world, BlockPos pos)
{ {
IBlockState state = world.getBlockState(pos); IBlockState state = world.getBlockState(pos);
if (state.getBlock() == Blocks.air) if (state.getBlock() == Blocks.AIR)
{ {
return 0; return 0;
} }
@ -291,9 +291,9 @@ public class BlockFluidClassic extends BlockFluidBase
Material material = state.getMaterial(); Material material = state.getMaterial();
if (material.blocksMovement() || if (material.blocksMovement() ||
material == Material.water || material == Material.WATER ||
material == Material.lava || material == Material.LAVA ||
material == Material.portal) material == Material.PORTAL)
{ {
return false; return false;
} }

View file

@ -266,13 +266,13 @@ public class Fluid
{ {
if(fillSound == null) if(fillSound == null)
{ {
if(getBlock() != null && getBlock().getDefaultState().getMaterial() == Material.lava) if(getBlock() != null && getBlock().getDefaultState().getMaterial() == Material.LAVA)
{ {
fillSound = SoundEvents.item_bucket_fill_lava; fillSound = SoundEvents.ITEM_BUCKET_FILL_LAVA;
} }
else else
{ {
fillSound = SoundEvents.item_bucket_fill; fillSound = SoundEvents.ITEM_BUCKET_FILL;
} }
} }
@ -283,13 +283,13 @@ public class Fluid
{ {
if(emptySound == null) if(emptySound == null)
{ {
if(getBlock() != null && getBlock().getDefaultState().getMaterial() == Material.lava) if(getBlock() != null && getBlock().getDefaultState().getMaterial() == Material.LAVA)
{ {
emptySound = SoundEvents.item_bucket_empty_lava; emptySound = SoundEvents.ITEM_BUCKET_EMPTY_LAVA;
} }
else else
{ {
emptySound = SoundEvents.item_bucket_empty; emptySound = SoundEvents.ITEM_BUCKET_EMPTY;
} }
} }

View file

@ -71,15 +71,15 @@ public abstract class FluidContainerRegistry
private static Set<ContainerKey> emptyContainers = Sets.newHashSet(); private static Set<ContainerKey> emptyContainers = Sets.newHashSet();
public static final int BUCKET_VOLUME = 1000; public static final int BUCKET_VOLUME = 1000;
public static final ItemStack EMPTY_BUCKET = new ItemStack(Items.bucket); public static final ItemStack EMPTY_BUCKET = new ItemStack(Items.BUCKET);
public static final ItemStack EMPTY_BOTTLE = new ItemStack(Items.glass_bottle); public static final ItemStack EMPTY_BOTTLE = new ItemStack(Items.GLASS_BOTTLE);
private static final ItemStack NULL_EMPTYCONTAINER = new ItemStack(Items.bucket); private static final ItemStack NULL_EMPTYCONTAINER = new ItemStack(Items.BUCKET);
static static
{ {
registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.water_bucket), EMPTY_BUCKET); registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.WATER_BUCKET), EMPTY_BUCKET);
registerFluidContainer(FluidRegistry.LAVA, new ItemStack(Items.lava_bucket), EMPTY_BUCKET); registerFluidContainer(FluidRegistry.LAVA, new ItemStack(Items.LAVA_BUCKET), EMPTY_BUCKET);
registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.potionitem), EMPTY_BOTTLE); registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.POTIONITEM), EMPTY_BOTTLE);
} }
private FluidContainerRegistry(){} private FluidContainerRegistry(){}

View file

@ -55,14 +55,14 @@ public abstract class FluidRegistry
public String getLocalizedName(FluidStack fs) { public String getLocalizedName(FluidStack fs) {
return I18n.translateToLocal("tile.water.name"); return I18n.translateToLocal("tile.water.name");
} }
}.setBlock(Blocks.water).setUnlocalizedName(Blocks.water.getUnlocalizedName()); }.setBlock(Blocks.WATER).setUnlocalizedName(Blocks.WATER.getUnlocalizedName());
public static final Fluid LAVA = new Fluid("lava", new ResourceLocation("blocks/lava_still"), new ResourceLocation("blocks/lava_flow")) { public static final Fluid LAVA = new Fluid("lava", new ResourceLocation("blocks/lava_still"), new ResourceLocation("blocks/lava_flow")) {
@Override @Override
public String getLocalizedName(FluidStack fs) { public String getLocalizedName(FluidStack fs) {
return I18n.translateToLocal("tile.lava.name"); return I18n.translateToLocal("tile.lava.name");
} }
}.setBlock(Blocks.lava).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Blocks.lava.getUnlocalizedName()); }.setBlock(Blocks.LAVA).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Blocks.LAVA.getUnlocalizedName());
static static
{ {

View file

@ -20,9 +20,9 @@ public class TileFluidHandler extends TileEntity implements IFluidHandler
} }
@Override @Override
public NBTTagCompound func_189515_b(NBTTagCompound tag) public NBTTagCompound writeToNBT(NBTTagCompound tag)
{ {
tag = super.func_189515_b(tag); tag = super.writeToNBT(tag);
tank.writeToNBT(tag); tank.writeToNBT(tag);
return tag; return tag;
} }

View file

@ -54,7 +54,7 @@ public class UniversalBucket extends Item implements IFluidContainerItem
this.setMaxStackSize(1); this.setMaxStackSize(1);
this.setCreativeTab(CreativeTabs.tabMisc); this.setCreativeTab(CreativeTabs.MISC);
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@ -107,7 +107,7 @@ public class UniversalBucket extends Item implements IFluidContainerItem
} }
// clicked on a block? // clicked on a block?
RayTraceResult mop = this.getMovingObjectPositionFromPlayer(world, player, false); RayTraceResult mop = this.rayTrace(world, player, false);
if(mop == null || mop.typeOfHit != RayTraceResult.Type.BLOCK) if(mop == null || mop.typeOfHit != RayTraceResult.Type.BLOCK)
{ {
@ -129,7 +129,7 @@ public class UniversalBucket extends Item implements IFluidContainerItem
&& !player.capabilities.isCreativeMode) && !player.capabilities.isCreativeMode)
{ {
// success! // success!
player.addStat(StatList.func_188057_b(this)); player.addStat(StatList.getObjectUseStats(this));
itemstack.stackSize--; itemstack.stackSize--;
ItemStack emptyStack = getEmpty() != null ? getEmpty().copy() : new ItemStack(this); ItemStack emptyStack = getEmpty() != null ? getEmpty().copy() : new ItemStack(this);
@ -181,12 +181,12 @@ public class UniversalBucket extends Item implements IFluidContainerItem
} }
// water goes poof? // water goes poof?
if (worldIn.provider.doesWaterVaporize() && (block == Blocks.flowing_water || block == Blocks.water)) if (worldIn.provider.doesWaterVaporize() && (block == Blocks.FLOWING_WATER || block == Blocks.WATER))
{ {
int i = pos.getX(); int i = pos.getX();
int j = pos.getY(); int j = pos.getY();
int k = pos.getZ(); int k = pos.getZ();
worldIn.playSound(null, pos, SoundEvents.block_fire_extinguish, SoundCategory.BLOCKS, 0.5F, worldIn.playSound(null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F,
2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F); 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F);
for (int l = 0; l < 8; ++l) for (int l = 0; l < 8; ++l)

View file

@ -662,7 +662,7 @@ public class FMLClientHandler implements IFMLSidedHandler
@Override @Override
public NetworkManager getClientToServerNetworkManager() public NetworkManager getClientToServerNetworkManager()
{ {
return this.client.getNetHandler()!=null ? this.client.getNetHandler().getNetworkManager() : null; return this.client.getConnection()!=null ? this.client.getConnection().getNetworkManager() : null;
} }
public void handleClientWorldClosing(WorldClient world) public void handleClientWorldClosing(WorldClient world)

View file

@ -584,7 +584,7 @@ public class GuiModList extends GuiScreen
for (ITextComponent part : line) { for (ITextComponent part : line) {
if (!(part instanceof TextComponentString)) if (!(part instanceof TextComponentString))
continue; continue;
k += GuiModList.this.fontRendererObj.getStringWidth(((TextComponentString)part).getChatComponentText_TextValue()); k += GuiModList.this.fontRendererObj.getStringWidth(((TextComponentString)part).getText());
if (k >= x) if (k >= x)
{ {
GuiModList.this.handleComponentClick(part); GuiModList.this.handleComponentClick(part);

View file

@ -287,7 +287,7 @@ public abstract class GuiScrollingList
{ {
GlStateManager.disableLighting(); GlStateManager.disableLighting();
GlStateManager.disableFog(); GlStateManager.disableFog();
this.client.renderEngine.bindTexture(Gui.optionsBackground); this.client.renderEngine.bindTexture(Gui.OPTIONS_BACKGROUND);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float scale = 32.0F; float scale = 32.0F;
worldr.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); worldr.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);

View file

@ -47,7 +47,7 @@ public class GuiButtonExt extends GuiButton
{ {
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
int k = this.getHoverState(this.hovered); int k = this.getHoverState(this.hovered);
GuiUtils.drawContinuousTexturedBox(buttonTextures, this.xPosition, this.yPosition, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel); GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.xPosition, this.yPosition, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
this.mouseDragged(mc, mouseX, mouseY); this.mouseDragged(mc, mouseX, mouseY);
int color = 14737632; int color = 14737632;

View file

@ -40,7 +40,7 @@ public class GuiCheckBox extends GuiButton
if (this.visible) if (this.visible)
{ {
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.boxWidth && mouseY < this.yPosition + this.height; this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.boxWidth && mouseY < this.yPosition + this.height;
GuiUtils.drawContinuousTexturedBox(buttonTextures, this.xPosition, this.yPosition, 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2, 2, this.zLevel); GuiUtils.drawContinuousTexturedBox(BUTTON_TEXTURES, this.xPosition, this.yPosition, 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
this.mouseDragged(mc, mouseX, mouseY); this.mouseDragged(mc, mouseX, mouseY);
int color = 14737632; int color = 14737632;

View file

@ -13,6 +13,7 @@
package net.minecraftforge.fml.client.config; package net.minecraftforge.fml.client.config;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
/** /**
@ -39,7 +40,7 @@ public class GuiUnicodeGlyphButton extends GuiButtonExt
{ {
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
int k = this.getHoverState(this.hovered); int k = this.getHoverState(this.hovered);
GuiUtils.drawContinuousTexturedBox(buttonTextures, this.xPosition, this.yPosition, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel); GuiUtils.drawContinuousTexturedBox(GuiButton.BUTTON_TEXTURES, this.xPosition, this.yPosition, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel);
this.mouseDragged(mc, mouseX, mouseY); this.mouseDragged(mc, mouseX, mouseY);
int color = 14737632; int color = 14737632;

View file

@ -366,7 +366,7 @@ public class FMLCommonHandler
{ {
for (ICrashCallable call: crashCallables) for (ICrashCallable call: crashCallables)
{ {
category.func_189529_a(call.getLabel(), call); category.setDetail(call.getLabel(), call);
} }
} }

View file

@ -109,7 +109,7 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) public List<NetworkDispatcher> selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet)
{ {
EntityPlayerMP player = (EntityPlayerMP) args; EntityPlayerMP player = (EntityPlayerMP) args;
NetworkDispatcher dispatcher = player == null ? null : player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); NetworkDispatcher dispatcher = player == null ? null : player.connection.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
return dispatcher == null ? ImmutableList.<NetworkDispatcher>of() : ImmutableList.of(dispatcher); return dispatcher == null ? ImmutableList.<NetworkDispatcher>of() : ImmutableList.of(dispatcher);
} }
}, },
@ -130,7 +130,7 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.builder(); ImmutableList.Builder<NetworkDispatcher> builder = ImmutableList.builder();
for (EntityPlayerMP player : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList()) for (EntityPlayerMP player : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList())
{ {
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); NetworkDispatcher dispatcher = player.connection.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
if (dispatcher != null) builder.add(dispatcher); if (dispatcher != null) builder.add(dispatcher);
} }
return builder.build(); return builder.build();
@ -160,7 +160,7 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
{ {
if (dimension == player.dimension) if (dimension == player.dimension)
{ {
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); NetworkDispatcher dispatcher = player.connection.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
// Null dispatchers may exist for fake players - skip them // Null dispatchers may exist for fake players - skip them
if (dispatcher != null) builder.add(dispatcher); if (dispatcher != null) builder.add(dispatcher);
} }
@ -200,7 +200,7 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
if (d4 * d4 + d5 * d5 + d6 * d6 < tp.range * tp.range) if (d4 * d4 + d5 * d5 + d6 * d6 < tp.range * tp.range)
{ {
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); NetworkDispatcher dispatcher = player.connection.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
if (dispatcher != null) builder.add(dispatcher); if (dispatcher != null) builder.add(dispatcher);
} }
} }

View file

@ -189,13 +189,13 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet<?>> im
completeServerSideConnection(ConnectionType.MODDED); completeServerSideConnection(ConnectionType.MODDED);
} }
// FORGE: sometimes the netqueue will tick while login is occurring, causing an NPE. We shouldn't tick until the connection is complete // FORGE: sometimes the netqueue will tick while login is occurring, causing an NPE. We shouldn't tick until the connection is complete
if (this.playerEntity.playerNetServerHandler != this) return; if (this.playerEntity.connection != this) return;
super.update(); super.update();
} }
}; };
this.netHandler = serverHandler; this.netHandler = serverHandler;
// NULL the play server here - we restore it further on. If not, there are packets sent before the login // NULL the play server here - we restore it further on. If not, there are packets sent before the login
player.playerNetServerHandler = null; player.connection = null;
// manually for the manager into the PLAY state, so we can send packets later // manually for the manager into the PLAY state, so we can send packets later
this.manager.setConnectionState(EnumConnectionState.PLAY); this.manager.setConnectionState(EnumConnectionState.PLAY);

View file

@ -95,7 +95,7 @@ public class EntitySpawnHandler extends SimpleChannelInboundHandler<FMLMessage.E
} }
} }
EntityTracker.func_187254_a(entity, spawnMsg.rawX, spawnMsg.rawY, spawnMsg.rawZ); EntityTracker.updateServerPosition(entity, spawnMsg.rawX, spawnMsg.rawY, spawnMsg.rawZ);
EntityPlayerSP clientPlayer = FMLClientHandler.instance().getClientPlayerEntity(); EntityPlayerSP clientPlayer = FMLClientHandler.instance().getClientPlayerEntity();
if (entity instanceof IThrowableEntity) if (entity instanceof IThrowableEntity)

View file

@ -90,7 +90,7 @@ public class FMLNetworkHandler
embeddedChannel.writeOutbound(openGui); embeddedChannel.writeOutbound(openGui);
entityPlayerMP.openContainer = remoteGuiContainer; entityPlayerMP.openContainer = remoteGuiContainer;
entityPlayerMP.openContainer.windowId = windowId; entityPlayerMP.openContainer.windowId = windowId;
entityPlayerMP.openContainer.onCraftGuiOpened(entityPlayerMP); entityPlayerMP.openContainer.addListener(entityPlayerMP);
} }
} }
else if (entityPlayer instanceof FakePlayer) else if (entityPlayer instanceof FakePlayer)

View file

@ -113,7 +113,6 @@ public class EntityRegistry
private static final EntityRegistry INSTANCE = new EntityRegistry(); private static final EntityRegistry INSTANCE = new EntityRegistry();
private BitSet availableIndices;
private ListMultimap<ModContainer, EntityRegistration> entityRegistrations = ArrayListMultimap.create(); private ListMultimap<ModContainer, EntityRegistration> entityRegistrations = ArrayListMultimap.create();
private Map<String,ModContainer> entityNames = Maps.newHashMap(); private Map<String,ModContainer> entityNames = Maps.newHashMap();
private BiMap<Class<? extends Entity>, EntityRegistration> entityClassRegistrations = HashBiMap.create(); private BiMap<Class<? extends Entity>, EntityRegistration> entityClassRegistrations = HashBiMap.create();
@ -125,12 +124,6 @@ public class EntityRegistry
private EntityRegistry() private EntityRegistry()
{ {
availableIndices = new BitSet(256);
availableIndices.set(1,255);
for (Object id : EntityList.idToClassMapping.keySet())
{
availableIndices.clear((Integer)id);
}
} }
/** /**
@ -177,11 +170,11 @@ public class EntityRegistry
{ {
entityClassRegistrations.put(entityClass, er); entityClassRegistrations.put(entityClass, er);
entityNames.put(entityName, mc); entityNames.put(entityName, mc);
if (!EntityList.classToStringMapping.containsKey(entityClass)) if (!EntityList.CLASS_TO_NAME.containsKey(entityClass))
{ {
String entityModName = String.format("%s.%s", mc.getModId(), entityName); String entityModName = String.format("%s.%s", mc.getModId(), entityName);
EntityList.classToStringMapping.put(entityClass, entityModName); EntityList.CLASS_TO_NAME.put(entityClass, entityModName);
EntityList.stringToClassMapping.put(entityModName, entityClass); EntityList.NAME_TO_CLASS.put(entityModName, entityClass);
FMLLog.finer("Automatically registered mod %s entity %s as %s", mc.getModId(), entityName, entityModName); FMLLog.finer("Automatically registered mod %s entity %s as %s", mc.getModId(), entityName, entityModName);
} }
else else
@ -214,10 +207,10 @@ public class EntityRegistry
public static void registerEgg(Class<? extends Entity> entityClass, int primary, int secondary) public static void registerEgg(Class<? extends Entity> entityClass, int primary, int secondary)
{ {
if (EntityList.classToStringMapping.containsKey(entityClass)) if (EntityList.CLASS_TO_NAME.containsKey(entityClass))
{ {
String name = EntityList.classToStringMapping.get(entityClass); String name = EntityList.CLASS_TO_NAME.get(entityClass);
EntityList.entityEggs.put(name, new EntityList.EntityEggInfo(name, primary, secondary)); EntityList.ENTITY_EGGS.put(name, new EntityList.EntityEggInfo(name, primary, secondary));
FMLLog.fine("Registering entity egg '%s' for %s", name, entityClass); FMLLog.fine("Registering entity egg '%s' for %s", name, entityClass);
} }
else else
@ -225,97 +218,6 @@ public class EntityRegistry
FMLLog.fine("Failed registering entity egg %s (No entity found)", entityClass.getName()); FMLLog.fine("Failed registering entity egg %s (No entity found)", entityClass.getName());
} }
} }
/**
* Registers in the minecraft Entity ID list. This is generally not a good idea and shouldn't be used.
* Simply use {@link #registerModEntity(Class, String, int, Object, int, int, boolean, int, int)} instead.
*
* @param entityClass Class of the entity being registered
* @param entityName Name for the entity being registered
* @param id A globally unique ID for the entity
*/
@Deprecated
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id)
{
if (EntityList.classToStringMapping.containsKey(entityClass))
{
ModContainer activeModContainer = Loader.instance().activeModContainer();
String modId = "unknown";
if (activeModContainer != null)
{
modId = activeModContainer.getModId();
}
else
{
FMLLog.severe("There is a rogue mod failing to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped.");
}
FMLLog.warning("The mod %s tried to register the entity class %s which was already registered - if you wish to override default naming for FML mod entities, register it here first", modId, entityClass);
return;
}
id = instance().validateAndClaimId(id);
EntityList.addMapping(entityClass, entityName, id);
}
/**
* Registers in the minecraft Entity ID list. This is generally not a good idea, and shouldn't be used.
* Simply use {@link #registerModEntity(Class, String, int, Object, int, int, boolean)} instead.
* @param entityClass The class of the entity being registered
* @param entityName The name of the entity being registered
* @param id The globally unique ID of the entity
* @param backgroundEggColour An RGB colour value for the spawn egg background colour
* @param foregroundEggColour An RGB colour value for the spawn egg foreground colour
*/
@Deprecated
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
{
if (EntityList.classToStringMapping.containsKey(entityClass))
{
ModContainer activeModContainer = Loader.instance().activeModContainer();
String modId = "unknown";
if (activeModContainer != null)
{
modId = activeModContainer.getModId();
}
else
{
FMLLog.severe("There is a rogue mod failing to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped.");
}
FMLLog.warning("The mod %s tried to register the entity class %s which was already registered - if you wish to override default naming for FML mod entities, register it here first", modId, entityClass);
return;
}
instance().validateAndClaimId(id);
EntityList.addMapping(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
}
private int validateAndClaimId(int id)
{
// workaround for broken ML
int realId = id;
if (id < Byte.MIN_VALUE)
{
FMLLog.warning("Compensating for modloader out of range compensation by mod : entityId %d for mod %s is now %d", id, Loader.instance().activeModContainer().getModId(), realId);
realId += 3000;
}
if (realId < 0)
{
realId += Byte.MAX_VALUE;
}
try
{
UnsignedBytes.checkedCast(realId);
}
catch (IllegalArgumentException e)
{
FMLLog.log(Level.ERROR, "The entity ID %d for mod %s is not an unsigned byte and may not work", id, Loader.instance().activeModContainer().getModId());
}
if (!availableIndices.get(realId))
{
FMLLog.severe("The mod %s has attempted to register an entity ID %d which is already reserved. This could cause severe problems", Loader.instance().activeModContainer().getModId(), id);
}
availableIndices.clear(realId);
return realId;
}
/** /**
* Add a spawn entry for the supplied entity in the supplied {@link BiomeGenBase} list * Add a spawn entry for the supplied entity in the supplied {@link BiomeGenBase} list
@ -360,7 +262,7 @@ public class EntityRegistry
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, Biome... biomes) public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, Biome... biomes)
{ {
Class <? extends Entity > entityClazz = EntityList.stringToClassMapping.get(entityName); Class <? extends Entity > entityClazz = EntityList.NAME_TO_CLASS.get(entityName);
if (EntityLiving.class.isAssignableFrom(entityClazz)) if (EntityLiving.class.isAssignableFrom(entityClazz))
{ {
@ -400,7 +302,7 @@ public class EntityRegistry
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static void removeSpawn(String entityName, EnumCreatureType typeOfCreature, Biome... biomes) public static void removeSpawn(String entityName, EnumCreatureType typeOfCreature, Biome... biomes)
{ {
Class <? extends Entity > entityClazz = EntityList.stringToClassMapping.get(entityName); Class <? extends Entity > entityClazz = EntityList.NAME_TO_CLASS.get(entityName);
if (EntityLiving.class.isAssignableFrom(entityClazz)) if (EntityLiving.class.isAssignableFrom(entityClazz))
{ {
@ -408,23 +310,6 @@ public class EntityRegistry
} }
} }
/**
* Utility function to try and obtain a globally unique entity ID. Not useful as it requires syncing between
* client and server. Use {@link #registerModEntity(Class, String, int, Object, int, int, boolean)} instead,
* for a much better experience.
* @return A theoretically globally unique ID
*/
@Deprecated
public static int findGlobalUniqueEntityId()
{
int res = instance().availableIndices.nextSetBit(0);
if (res < 0)
{
throw new RuntimeException("No more entity indices left");
}
return res;
}
public EntityRegistration lookupModSpawn(Class<? extends Entity> clazz, boolean keepLooking) public EntityRegistration lookupModSpawn(Class<? extends Entity> clazz, boolean keepLooking)
{ {
Class<?> localClazz = clazz; Class<?> localClazz = clazz;

View file

@ -157,7 +157,7 @@ public class FMLControlledNamespacedRegistry<I extends IForgeRegistryEntry<I>> e
this.dummiedLocations.clear(); this.dummiedLocations.clear();
this.dummiedLocations.addAll(otherRegistry.dummiedLocations); this.dummiedLocations.addAll(otherRegistry.dummiedLocations);
underlyingIntegerMap.func_186812_a(); underlyingIntegerMap.clear();
registryObjects.clear(); registryObjects.clear();
for (I thing : otherRegistry.typeSafeIterable()) for (I thing : otherRegistry.typeSafeIterable())

View file

@ -50,8 +50,8 @@ class ObjectHolderRef {
} }
else else
{ {
ResourceLocation tmp = isBlock ? GameData.getBlockRegistry().getNameForObject((Block)existing) : ResourceLocation tmp = isBlock ? ForgeRegistries.BLOCKS.getKey((Block)existing) :
isItem ? GameData.getItemRegistry().getNameForObject((Item)existing) : null; isItem ? ForgeRegistries.ITEMS.getKey((Item)existing) : null;
this.injectedObject = tmp; this.injectedObject = tmp;
} }
} catch (Exception e) } catch (Exception e)
@ -104,15 +104,15 @@ class ObjectHolderRef {
Object thing; Object thing;
if (isBlock) if (isBlock)
{ {
thing = GameData.getBlockRegistry().getObject(injectedObject); thing = ForgeRegistries.BLOCKS.getValue(injectedObject);
if (thing == Blocks.air) if (thing == Blocks.AIR)
{ {
thing = null; thing = null;
} }
} }
else if (isItem) else if (isItem)
{ {
thing = GameData.getItemRegistry().getObject(injectedObject); thing = ForgeRegistries.ITEMS.getValue(injectedObject);
} }
else else
{ {

View file

@ -336,196 +336,6 @@ public class VillagerRegistry
//This field is moved from EntityVillager over to here. //This field is moved from EntityVillager over to here.
//Moved to inner class to stop static initializer issues. //Moved to inner class to stop static initializer issues.
//It is nasty I know but it's vanilla. //It is nasty I know but it's vanilla.
private static final ITradeList[][][][] trades = private static final ITradeList[][][][] trades = EntityVillager.GET_TRADES_DONT_USE();
{
{
{
{
new EmeraldForItems(Items.wheat, new PriceInfo(18, 22)),
new EmeraldForItems(Items.potato, new PriceInfo(15, 19)),
new EmeraldForItems(Items.carrot, new PriceInfo(15, 19)),
new ListItemForEmeralds(Items.bread, new PriceInfo(-4, -2))
},
{
new EmeraldForItems(Item.getItemFromBlock(Blocks.pumpkin), new PriceInfo(8, 13)),
new ListItemForEmeralds(Items.pumpkin_pie, new PriceInfo(-3, -2))
},
{
new EmeraldForItems(Item.getItemFromBlock(Blocks.melon_block), new PriceInfo(7, 12)),
new ListItemForEmeralds(Items.apple, new PriceInfo(-5, -7))
},
{
new ListItemForEmeralds(Items.cookie, new PriceInfo(-6, -10)),
new ListItemForEmeralds(Items.cake, new PriceInfo(1, 1))
}
},
{
{
new EmeraldForItems(Items.string, new PriceInfo(15, 20)),
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
new ItemAndEmeraldToItem(Items.fish, new PriceInfo(6, 6), Items.cooked_fish, new PriceInfo(6, 6))
},
{
new ListEnchantedItemForEmeralds(Items.fishing_rod, new PriceInfo(7, 8))
}
},
{
{
new EmeraldForItems(Item.getItemFromBlock(Blocks.wool), new PriceInfo(16, 22)),
new ListItemForEmeralds(Items.shears, new PriceInfo(3, 4))
},
{
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 0), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 1), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 2), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 3), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 4), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 5), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 6), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 7), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 8), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 9), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 10), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 11), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 12), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 13), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 14), new PriceInfo(1, 2)),
new ListItemForEmeralds(new ItemStack(Blocks.wool, 1, 15), new PriceInfo(1, 2))
}
},
{
{
new EmeraldForItems(Items.string, new PriceInfo(15, 20)),
new ListItemForEmeralds(Items.arrow, new PriceInfo(-12, -8))
},
{
new ListItemForEmeralds(Items.bow, new PriceInfo(2, 3)),
new ItemAndEmeraldToItem(Item.getItemFromBlock(Blocks.gravel), new PriceInfo(10, 10), Items.flint, new PriceInfo(6, 10))
}
}
},
{
{
{
new EmeraldForItems(Items.paper, new PriceInfo(24, 36)),
new ListEnchantedBookForEmeralds()
},
{
new EmeraldForItems(Items.book, new PriceInfo(8, 10)),
new ListItemForEmeralds(Items.compass, new PriceInfo(10, 12)),
new ListItemForEmeralds(Item.getItemFromBlock(Blocks.bookshelf), new PriceInfo(3, 4))
},
{
new EmeraldForItems(Items.written_book, new PriceInfo(2, 2)),
new ListItemForEmeralds(Items.clock, new PriceInfo(10, 12)),
new ListItemForEmeralds(Item.getItemFromBlock(Blocks.glass), new PriceInfo(-5, -3))
},
{
new ListEnchantedBookForEmeralds()
},
{
new ListEnchantedBookForEmeralds()
},
{
new ListItemForEmeralds(Items.name_tag, new PriceInfo(20, 22))
}
}
},
{
{
{
new EmeraldForItems(Items.rotten_flesh, new PriceInfo(36, 40)),
new EmeraldForItems(Items.gold_ingot, new PriceInfo(8, 10))
},
{
new ListItemForEmeralds(Items.redstone, new PriceInfo(-4, -1)),
new ListItemForEmeralds(new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), new PriceInfo(-2, -1))
},
{
new ListItemForEmeralds(Items.ender_pearl, new PriceInfo(4, 7)),
new ListItemForEmeralds(Item.getItemFromBlock(Blocks.glowstone), new PriceInfo(-3, -1))
},
{
new ListItemForEmeralds(Items.experience_bottle, new PriceInfo(3, 11))
}
}
},
{
{
{
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
new ListItemForEmeralds(Items.iron_helmet, new PriceInfo(4, 6))
},
{
new EmeraldForItems(Items.iron_ingot, new PriceInfo(7, 9)),
new ListItemForEmeralds(Items.iron_chestplate, new PriceInfo(10, 14))
},
{
new EmeraldForItems(Items.diamond, new PriceInfo(3, 4)),
new ListEnchantedItemForEmeralds(Items.diamond_chestplate, new PriceInfo(16, 19))
},
{
new ListItemForEmeralds(Items.chainmail_boots, new PriceInfo(5, 7)),
new ListItemForEmeralds(Items.chainmail_leggings, new PriceInfo(9, 11)),
new ListItemForEmeralds(Items.chainmail_helmet, new PriceInfo(5, 7)),
new ListItemForEmeralds(Items.chainmail_chestplate, new PriceInfo(11, 15))
}
},
{
{
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
new ListItemForEmeralds(Items.iron_axe, new PriceInfo(6, 8))
},
{
new EmeraldForItems(Items.iron_ingot, new PriceInfo(7, 9)),
new ListEnchantedItemForEmeralds(Items.iron_sword, new PriceInfo(9, 10))
},
{
new EmeraldForItems(Items.diamond, new PriceInfo(3, 4)),
new ListEnchantedItemForEmeralds(Items.diamond_sword, new PriceInfo(12, 15)),
new ListEnchantedItemForEmeralds(Items.diamond_axe, new PriceInfo(9, 12))
}
},
{
{
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
new ListEnchantedItemForEmeralds(Items.iron_shovel, new PriceInfo(5, 7))
},
{
new EmeraldForItems(Items.iron_ingot, new PriceInfo(7, 9)),
new ListEnchantedItemForEmeralds(Items.iron_pickaxe, new PriceInfo(9, 11))
},
{
new EmeraldForItems(Items.diamond, new PriceInfo(3, 4)),
new ListEnchantedItemForEmeralds(Items.diamond_pickaxe, new PriceInfo(12, 15))
}
}
},
{
{
{
new EmeraldForItems(Items.porkchop, new PriceInfo(14, 18)),
new EmeraldForItems(Items.chicken, new PriceInfo(14, 18))
},
{
new EmeraldForItems(Items.coal, new PriceInfo(16, 24)),
new ListItemForEmeralds(Items.cooked_porkchop, new PriceInfo(-7, -5)),
new ListItemForEmeralds(Items.cooked_chicken, new PriceInfo(-8, -6))
}
},
{
{
new EmeraldForItems(Items.leather, new PriceInfo(9, 12)),
new ListItemForEmeralds(Items.leather_leggings, new PriceInfo(2, 4))
},
{
new ListEnchantedItemForEmeralds(Items.leather_chestplate, new PriceInfo(7, 12))
},
{
new ListItemForEmeralds(Items.saddle, new PriceInfo(8, 10))
}
}
}
};
} }
} }

View file

@ -158,7 +158,7 @@ public class ItemHandlerHelper
if (remainder == null || remainder.stackSize != stack.stackSize) if (remainder == null || remainder.stackSize != stack.stackSize)
{ {
world.playSound(player, player.posX, player.posY, player.posZ, world.playSound(player, player.posX, player.posY, player.posZ,
SoundEvents.entity_item_pickup, SoundCategory.PLAYERS, 0.2F, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
} }
// drop remaining itemstack into the world // drop remaining itemstack into the world

View file

@ -57,196 +57,196 @@ public class OreDictionary
if (!hasInit) if (!hasInit)
{ {
// tree- and wood-related things // tree- and wood-related things
registerOre("logWood", new ItemStack(Blocks.log, 1, WILDCARD_VALUE)); registerOre("logWood", new ItemStack(Blocks.LOG, 1, WILDCARD_VALUE));
registerOre("logWood", new ItemStack(Blocks.log2, 1, WILDCARD_VALUE)); registerOre("logWood", new ItemStack(Blocks.LOG2, 1, WILDCARD_VALUE));
registerOre("plankWood", new ItemStack(Blocks.planks, 1, WILDCARD_VALUE)); registerOre("plankWood", new ItemStack(Blocks.PLANKS, 1, WILDCARD_VALUE));
registerOre("slabWood", new ItemStack(Blocks.wooden_slab, 1, WILDCARD_VALUE)); registerOre("slabWood", new ItemStack(Blocks.WOODEN_SLAB, 1, WILDCARD_VALUE));
registerOre("stairWood", Blocks.oak_stairs); registerOre("stairWood", Blocks.OAK_STAIRS);
registerOre("stairWood", Blocks.spruce_stairs); registerOre("stairWood", Blocks.SPRUCE_STAIRS);
registerOre("stairWood", Blocks.birch_stairs); registerOre("stairWood", Blocks.BIRCH_STAIRS);
registerOre("stairWood", Blocks.jungle_stairs); registerOre("stairWood", Blocks.JUNGLE_STAIRS);
registerOre("stairWood", Blocks.acacia_stairs); registerOre("stairWood", Blocks.ACACIA_STAIRS);
registerOre("stairWood", Blocks.dark_oak_stairs); registerOre("stairWood", Blocks.DARK_OAK_STAIRS);
registerOre("stickWood", Items.stick); registerOre("stickWood", Items.STICK);
registerOre("treeSapling", new ItemStack(Blocks.sapling, 1, WILDCARD_VALUE)); registerOre("treeSapling", new ItemStack(Blocks.SAPLING, 1, WILDCARD_VALUE));
registerOre("treeLeaves", new ItemStack(Blocks.leaves, 1, WILDCARD_VALUE)); registerOre("treeLeaves", new ItemStack(Blocks.LEAVES, 1, WILDCARD_VALUE));
registerOre("treeLeaves", new ItemStack(Blocks.leaves2, 1, WILDCARD_VALUE)); registerOre("treeLeaves", new ItemStack(Blocks.LEAVES2, 1, WILDCARD_VALUE));
registerOre("vine", Blocks.vine); registerOre("vine", Blocks.VINE);
// Ores // Ores
registerOre("oreGold", Blocks.gold_ore); registerOre("oreGold", Blocks.GOLD_ORE);
registerOre("oreIron", Blocks.iron_ore); registerOre("oreIron", Blocks.IRON_ORE);
registerOre("oreLapis", Blocks.lapis_ore); registerOre("oreLapis", Blocks.LAPIS_ORE);
registerOre("oreDiamond", Blocks.diamond_ore); registerOre("oreDiamond", Blocks.DIAMOND_ORE);
registerOre("oreRedstone", Blocks.redstone_ore); registerOre("oreRedstone", Blocks.REDSTONE_ORE);
registerOre("oreEmerald", Blocks.emerald_ore); registerOre("oreEmerald", Blocks.EMERALD_ORE);
registerOre("oreQuartz", Blocks.quartz_ore); registerOre("oreQuartz", Blocks.QUARTZ_ORE);
registerOre("oreCoal", Blocks.coal_ore); registerOre("oreCoal", Blocks.COAL_ORE);
// ingots/nuggets // ingots/nuggets
registerOre("ingotIron", Items.iron_ingot); registerOre("ingotIron", Items.IRON_INGOT);
registerOre("ingotGold", Items.gold_ingot); registerOre("ingotGold", Items.GOLD_INGOT);
registerOre("ingotBrick", Items.brick); registerOre("ingotBrick", Items.BRICK);
registerOre("ingotBrickNether", Items.netherbrick); registerOre("ingotBrickNether", Items.NETHERBRICK);
registerOre("nuggetGold", Items.gold_nugget); registerOre("nuggetGold", Items.GOLD_NUGGET);
// gems and dusts // gems and dusts
registerOre("gemDiamond", Items.diamond); registerOre("gemDiamond", Items.DIAMOND);
registerOre("gemEmerald", Items.emerald); registerOre("gemEmerald", Items.EMERALD);
registerOre("gemQuartz", Items.quartz); registerOre("gemQuartz", Items.QUARTZ);
registerOre("gemPrismarine", Items.prismarine_shard); registerOre("gemPrismarine", Items.PRISMARINE_SHARD);
registerOre("dustPrismarine", Items.prismarine_crystals); registerOre("dustPrismarine", Items.PRISMARINE_CRYSTALS);
registerOre("dustRedstone", Items.redstone); registerOre("dustRedstone", Items.REDSTONE);
registerOre("dustGlowstone", Items.glowstone_dust); registerOre("dustGlowstone", Items.GLOWSTONE_DUST);
registerOre("gemLapis", new ItemStack(Items.dye, 1, 4)); registerOre("gemLapis", new ItemStack(Items.DYE, 1, 4));
// storage blocks // storage blocks
registerOre("blockGold", Blocks.gold_block); registerOre("blockGold", Blocks.GOLD_BLOCK);
registerOre("blockIron", Blocks.iron_block); registerOre("blockIron", Blocks.IRON_BLOCK);
registerOre("blockLapis", Blocks.lapis_block); registerOre("blockLapis", Blocks.LAPIS_BLOCK);
registerOre("blockDiamond", Blocks.diamond_block); registerOre("blockDiamond", Blocks.DIAMOND_BLOCK);
registerOre("blockRedstone", Blocks.redstone_block); registerOre("blockRedstone", Blocks.REDSTONE_BLOCK);
registerOre("blockEmerald", Blocks.emerald_block); registerOre("blockEmerald", Blocks.EMERALD_BLOCK);
registerOre("blockQuartz", Blocks.quartz_block); registerOre("blockQuartz", Blocks.QUARTZ_BLOCK);
registerOre("blockCoal", Blocks.coal_block); registerOre("blockCoal", Blocks.COAL_BLOCK);
// crops // crops
registerOre("cropWheat", Items.wheat); registerOre("cropWheat", Items.WHEAT);
registerOre("cropPotato", Items.potato); registerOre("cropPotato", Items.POTATO);
registerOre("cropCarrot", Items.carrot); registerOre("cropCarrot", Items.CARROT);
registerOre("cropNetherWart", Items.nether_wart); registerOre("cropNetherWart", Items.NETHER_WART);
registerOre("sugarcane", Items.reeds); registerOre("sugarcane", Items.REEDS);
registerOre("blockCactus", Blocks.cactus); registerOre("blockCactus", Blocks.CACTUS);
// misc materials // misc materials
registerOre("dye", new ItemStack(Items.dye, 1, WILDCARD_VALUE)); registerOre("dye", new ItemStack(Items.DYE, 1, WILDCARD_VALUE));
registerOre("paper", new ItemStack(Items.paper)); registerOre("paper", new ItemStack(Items.PAPER));
// mob drops // mob drops
registerOre("slimeball", Items.slime_ball); registerOre("slimeball", Items.SLIME_BALL);
registerOre("enderpearl", Items.ender_pearl); registerOre("enderpearl", Items.ENDER_PEARL);
registerOre("bone", Items.bone); registerOre("bone", Items.BONE);
registerOre("gunpowder", Items.gunpowder); registerOre("gunpowder", Items.GUNPOWDER);
registerOre("string", Items.string); registerOre("string", Items.STRING);
registerOre("netherStar", Items.nether_star); registerOre("netherStar", Items.NETHER_STAR);
registerOre("leather", Items.leather); registerOre("leather", Items.LEATHER);
registerOre("feather", Items.feather); registerOre("feather", Items.FEATHER);
registerOre("egg", Items.egg); registerOre("egg", Items.EGG);
// records // records
registerOre("record", Items.record_13); registerOre("record", Items.RECORD_13);
registerOre("record", Items.record_cat); registerOre("record", Items.RECORD_CAT);
registerOre("record", Items.record_blocks); registerOre("record", Items.RECORD_BLOCKS);
registerOre("record", Items.record_chirp); registerOre("record", Items.RECORD_CHIRP);
registerOre("record", Items.record_far); registerOre("record", Items.RECORD_FAR);
registerOre("record", Items.record_mall); registerOre("record", Items.RECORD_MALL);
registerOre("record", Items.record_mellohi); registerOre("record", Items.RECORD_MELLOHI);
registerOre("record", Items.record_stal); registerOre("record", Items.RECORD_STAL);
registerOre("record", Items.record_strad); registerOre("record", Items.RECORD_STRAD);
registerOre("record", Items.record_ward); registerOre("record", Items.RECORD_WARD);
registerOre("record", Items.record_11); registerOre("record", Items.RECORD_11);
registerOre("record", Items.record_wait); registerOre("record", Items.RECORD_WAIT);
// blocks // blocks
registerOre("dirt", Blocks.dirt); registerOre("dirt", Blocks.DIRT);
registerOre("grass", Blocks.grass); registerOre("grass", Blocks.GRASS);
registerOre("stone", Blocks.stone); registerOre("stone", Blocks.STONE);
registerOre("cobblestone", Blocks.cobblestone); registerOre("cobblestone", Blocks.COBBLESTONE);
registerOre("gravel", Blocks.gravel); registerOre("gravel", Blocks.GRAVEL);
registerOre("sand", new ItemStack(Blocks.sand, 1, WILDCARD_VALUE)); registerOre("sand", new ItemStack(Blocks.SAND, 1, WILDCARD_VALUE));
registerOre("sandstone", new ItemStack(Blocks.sandstone, 1, WILDCARD_VALUE)); registerOre("sandstone", new ItemStack(Blocks.SANDSTONE, 1, WILDCARD_VALUE));
registerOre("sandstone", new ItemStack(Blocks.red_sandstone, 1, WILDCARD_VALUE)); registerOre("sandstone", new ItemStack(Blocks.RED_SANDSTONE, 1, WILDCARD_VALUE));
registerOre("netherrack", Blocks.netherrack); registerOre("netherrack", Blocks.NETHERRACK);
registerOre("obsidian", Blocks.obsidian); registerOre("obsidian", Blocks.OBSIDIAN);
registerOre("glowstone", Blocks.glowstone); registerOre("glowstone", Blocks.GLOWSTONE);
registerOre("endstone", Blocks.end_stone); registerOre("endstone", Blocks.END_STONE);
registerOre("torch", Blocks.torch); registerOre("torch", Blocks.TORCH);
registerOre("workbench", Blocks.crafting_table); registerOre("workbench", Blocks.CRAFTING_TABLE);
registerOre("blockSlime", Blocks.slime_block); registerOre("blockSlime", Blocks.SLIME_BLOCK);
registerOre("blockPrismarine", new ItemStack(Blocks.prismarine, 1, BlockPrismarine.EnumType.ROUGH.getMetadata())); registerOre("blockPrismarine", new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.EnumType.ROUGH.getMetadata()));
registerOre("blockPrismarineBrick", new ItemStack(Blocks.prismarine, 1, BlockPrismarine.EnumType.BRICKS.getMetadata())); registerOre("blockPrismarineBrick", new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.EnumType.BRICKS.getMetadata()));
registerOre("blockPrismarineDark", new ItemStack(Blocks.prismarine, 1, BlockPrismarine.EnumType.DARK.getMetadata())); registerOre("blockPrismarineDark", new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.EnumType.DARK.getMetadata()));
registerOre("stoneGranite", new ItemStack(Blocks.stone, 1, 1)); registerOre("stoneGranite", new ItemStack(Blocks.STONE, 1, 1));
registerOre("stoneGranitePolished", new ItemStack(Blocks.stone, 1, 2)); registerOre("stoneGranitePolished", new ItemStack(Blocks.STONE, 1, 2));
registerOre("stoneDiorite", new ItemStack(Blocks.stone, 1, 3)); registerOre("stoneDiorite", new ItemStack(Blocks.STONE, 1, 3));
registerOre("stoneDioritePolished", new ItemStack(Blocks.stone, 1, 4)); registerOre("stoneDioritePolished", new ItemStack(Blocks.STONE, 1, 4));
registerOre("stoneAndesite", new ItemStack(Blocks.stone, 1, 5)); registerOre("stoneAndesite", new ItemStack(Blocks.STONE, 1, 5));
registerOre("stoneAndesitePolished", new ItemStack(Blocks.stone, 1, 6)); registerOre("stoneAndesitePolished", new ItemStack(Blocks.STONE, 1, 6));
registerOre("blockGlassColorless", Blocks.glass); registerOre("blockGlassColorless", Blocks.GLASS);
registerOre("blockGlass", Blocks.glass); registerOre("blockGlass", Blocks.GLASS);
registerOre("blockGlass", new ItemStack(Blocks.stained_glass, 1, WILDCARD_VALUE)); registerOre("blockGlass", new ItemStack(Blocks.STAINED_GLASS, 1, WILDCARD_VALUE));
//blockGlass{Color} is added below with dyes //blockGlass{Color} is added below with dyes
registerOre("paneGlassColorless", Blocks.glass_pane); registerOre("paneGlassColorless", Blocks.GLASS_PANE);
registerOre("paneGlass", Blocks.glass_pane); registerOre("paneGlass", Blocks.GLASS_PANE);
registerOre("paneGlass", new ItemStack(Blocks.stained_glass_pane, 1, WILDCARD_VALUE)); registerOre("paneGlass", new ItemStack(Blocks.STAINED_GLASS_PANE, 1, WILDCARD_VALUE));
//paneGlass{Color} is added below with dyes //paneGlass{Color} is added below with dyes
// chests // chests
registerOre("chest", Blocks.chest); registerOre("chest", Blocks.CHEST);
registerOre("chest", Blocks.ender_chest); registerOre("chest", Blocks.ENDER_CHEST);
registerOre("chest", Blocks.trapped_chest); registerOre("chest", Blocks.TRAPPED_CHEST);
registerOre("chestWood", Blocks.chest); registerOre("chestWood", Blocks.CHEST);
registerOre("chestEnder", Blocks.ender_chest); registerOre("chestEnder", Blocks.ENDER_CHEST);
registerOre("chestTrapped", Blocks.trapped_chest); registerOre("chestTrapped", Blocks.TRAPPED_CHEST);
} }
// Build our list of items to replace with ore tags // Build our list of items to replace with ore tags
Map<ItemStack, String> replacements = new HashMap<ItemStack, String>(); Map<ItemStack, String> replacements = new HashMap<ItemStack, String>();
// wood-related things // wood-related things
replacements.put(new ItemStack(Items.stick), "stickWood"); replacements.put(new ItemStack(Items.STICK), "stickWood");
replacements.put(new ItemStack(Blocks.planks), "plankWood"); replacements.put(new ItemStack(Blocks.PLANKS), "plankWood");
replacements.put(new ItemStack(Blocks.planks, 1, WILDCARD_VALUE), "plankWood"); replacements.put(new ItemStack(Blocks.PLANKS, 1, WILDCARD_VALUE), "plankWood");
replacements.put(new ItemStack(Blocks.wooden_slab, 1, WILDCARD_VALUE), "slabWood"); replacements.put(new ItemStack(Blocks.WOODEN_SLAB, 1, WILDCARD_VALUE), "slabWood");
// ingots/nuggets // ingots/nuggets
replacements.put(new ItemStack(Items.gold_ingot), "ingotGold"); replacements.put(new ItemStack(Items.GOLD_INGOT), "ingotGold");
replacements.put(new ItemStack(Items.iron_ingot), "ingotIron"); replacements.put(new ItemStack(Items.IRON_INGOT), "ingotIron");
// gems and dusts // gems and dusts
replacements.put(new ItemStack(Items.diamond), "gemDiamond"); replacements.put(new ItemStack(Items.DIAMOND), "gemDiamond");
replacements.put(new ItemStack(Items.emerald), "gemEmerald"); replacements.put(new ItemStack(Items.EMERALD), "gemEmerald");
replacements.put(new ItemStack(Items.prismarine_shard), "gemPrismarine"); replacements.put(new ItemStack(Items.PRISMARINE_SHARD), "gemPrismarine");
replacements.put(new ItemStack(Items.prismarine_crystals), "dustPrismarine"); replacements.put(new ItemStack(Items.PRISMARINE_CRYSTALS), "dustPrismarine");
replacements.put(new ItemStack(Items.redstone), "dustRedstone"); replacements.put(new ItemStack(Items.REDSTONE), "dustRedstone");
replacements.put(new ItemStack(Items.glowstone_dust), "dustGlowstone"); replacements.put(new ItemStack(Items.GLOWSTONE_DUST), "dustGlowstone");
// crops // crops
replacements.put(new ItemStack(Items.reeds), "sugarcane"); replacements.put(new ItemStack(Items.REEDS), "sugarcane");
replacements.put(new ItemStack(Blocks.cactus), "blockCactus"); replacements.put(new ItemStack(Blocks.CACTUS), "blockCactus");
// misc materials // misc materials
replacements.put(new ItemStack(Items.paper), "paper"); replacements.put(new ItemStack(Items.PAPER), "paper");
// mob drops // mob drops
replacements.put(new ItemStack(Items.slime_ball), "slimeball"); replacements.put(new ItemStack(Items.SLIME_BALL), "slimeball");
replacements.put(new ItemStack(Items.string), "string"); replacements.put(new ItemStack(Items.STRING), "string");
replacements.put(new ItemStack(Items.leather), "leather"); replacements.put(new ItemStack(Items.LEATHER), "leather");
replacements.put(new ItemStack(Items.ender_pearl), "enderpearl"); replacements.put(new ItemStack(Items.ENDER_PEARL), "enderpearl");
replacements.put(new ItemStack(Items.gunpowder), "gunpowder"); replacements.put(new ItemStack(Items.GUNPOWDER), "gunpowder");
replacements.put(new ItemStack(Items.nether_star), "netherStar"); replacements.put(new ItemStack(Items.NETHER_STAR), "netherStar");
replacements.put(new ItemStack(Items.feather), "feather"); replacements.put(new ItemStack(Items.FEATHER), "feather");
replacements.put(new ItemStack(Items.bone), "bone"); replacements.put(new ItemStack(Items.BONE), "bone");
replacements.put(new ItemStack(Items.egg), "egg"); replacements.put(new ItemStack(Items.EGG), "egg");
// blocks // blocks
replacements.put(new ItemStack(Blocks.stone), "stone"); replacements.put(new ItemStack(Blocks.STONE), "stone");
replacements.put(new ItemStack(Blocks.cobblestone), "cobblestone"); replacements.put(new ItemStack(Blocks.COBBLESTONE), "cobblestone");
replacements.put(new ItemStack(Blocks.cobblestone, 1, WILDCARD_VALUE), "cobblestone"); replacements.put(new ItemStack(Blocks.COBBLESTONE, 1, WILDCARD_VALUE), "cobblestone");
replacements.put(new ItemStack(Blocks.glowstone), "glowstone"); replacements.put(new ItemStack(Blocks.GLOWSTONE), "glowstone");
replacements.put(new ItemStack(Blocks.glass), "blockGlassColorless"); replacements.put(new ItemStack(Blocks.GLASS), "blockGlassColorless");
replacements.put(new ItemStack(Blocks.prismarine), "prismarine"); replacements.put(new ItemStack(Blocks.PRISMARINE), "prismarine");
replacements.put(new ItemStack(Blocks.stone, 1, 1), "stoneGranite"); replacements.put(new ItemStack(Blocks.STONE, 1, 1), "stoneGranite");
replacements.put(new ItemStack(Blocks.stone, 1, 2), "stoneGranitePolished"); replacements.put(new ItemStack(Blocks.STONE, 1, 2), "stoneGranitePolished");
replacements.put(new ItemStack(Blocks.stone, 1, 3), "stoneDiorite"); replacements.put(new ItemStack(Blocks.STONE, 1, 3), "stoneDiorite");
replacements.put(new ItemStack(Blocks.stone, 1, 4), "stoneDioritePolished"); replacements.put(new ItemStack(Blocks.STONE, 1, 4), "stoneDioritePolished");
replacements.put(new ItemStack(Blocks.stone, 1, 5), "stoneAndesite"); replacements.put(new ItemStack(Blocks.STONE, 1, 5), "stoneAndesite");
replacements.put(new ItemStack(Blocks.stone, 1, 6), "stoneAndesitePolished"); replacements.put(new ItemStack(Blocks.STONE, 1, 6), "stoneAndesitePolished");
// chests // chests
replacements.put(new ItemStack(Blocks.chest), "chestWood"); replacements.put(new ItemStack(Blocks.CHEST), "chestWood");
replacements.put(new ItemStack(Blocks.ender_chest), "chestEnder"); replacements.put(new ItemStack(Blocks.ENDER_CHEST), "chestEnder");
replacements.put(new ItemStack(Blocks.trapped_chest), "chestTrapped"); replacements.put(new ItemStack(Blocks.TRAPPED_CHEST), "chestTrapped");
// Register dyes // Register dyes
String[] dyes = String[] dyes =
@ -271,9 +271,9 @@ public class OreDictionary
for(int i = 0; i < 16; i++) for(int i = 0; i < 16; i++)
{ {
ItemStack dye = new ItemStack(Items.dye, 1, i); ItemStack dye = new ItemStack(Items.DYE, 1, i);
ItemStack block = new ItemStack(Blocks.stained_glass, 1, 15 - i); ItemStack block = new ItemStack(Blocks.STAINED_GLASS, 1, 15 - i);
ItemStack pane = new ItemStack(Blocks.stained_glass_pane, 1, 15 - i); ItemStack pane = new ItemStack(Blocks.STAINED_GLASS_PANE, 1, 15 - i);
if (!hasInit) if (!hasInit)
{ {
registerOre("dye" + dyes[i], dye); registerOre("dye" + dyes[i], dye);
@ -291,32 +291,32 @@ public class OreDictionary
// Ignore recipes for the following items // Ignore recipes for the following items
ItemStack[] exclusions = new ItemStack[] ItemStack[] exclusions = new ItemStack[]
{ {
new ItemStack(Blocks.lapis_block), new ItemStack(Blocks.LAPIS_BLOCK),
new ItemStack(Items.cookie), new ItemStack(Items.COOKIE),
new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.STONEBRICK),
new ItemStack(Blocks.stone_slab, 1, WILDCARD_VALUE), new ItemStack(Blocks.STONE_SLAB, 1, WILDCARD_VALUE),
new ItemStack(Blocks.stone_stairs), new ItemStack(Blocks.STONE_STAIRS),
new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.COBBLESTONE_WALL),
new ItemStack(Blocks.oak_fence), new ItemStack(Blocks.OAK_FENCE),
new ItemStack(Blocks.oak_fence_gate), new ItemStack(Blocks.OAK_FENCE_GATE),
new ItemStack(Blocks.oak_stairs), new ItemStack(Blocks.OAK_STAIRS),
new ItemStack(Blocks.spruce_fence), new ItemStack(Blocks.SPRUCE_FENCE),
new ItemStack(Blocks.spruce_fence_gate), new ItemStack(Blocks.SPRUCE_FENCE_GATE),
new ItemStack(Blocks.spruce_stairs), new ItemStack(Blocks.SPRUCE_STAIRS),
new ItemStack(Blocks.birch_fence), new ItemStack(Blocks.BIRCH_STAIRS),
new ItemStack(Blocks.birch_fence_gate), new ItemStack(Blocks.BIRCH_FENCE_GATE),
new ItemStack(Blocks.birch_stairs), new ItemStack(Blocks.BIRCH_STAIRS),
new ItemStack(Blocks.jungle_fence), new ItemStack(Blocks.JUNGLE_FENCE),
new ItemStack(Blocks.jungle_fence_gate), new ItemStack(Blocks.JUNGLE_FENCE_GATE),
new ItemStack(Blocks.jungle_stairs), new ItemStack(Blocks.JUNGLE_STAIRS),
new ItemStack(Blocks.acacia_fence), new ItemStack(Blocks.ACACIA_FENCE),
new ItemStack(Blocks.acacia_fence_gate), new ItemStack(Blocks.ACACIA_FENCE_GATE),
new ItemStack(Blocks.acacia_stairs), new ItemStack(Blocks.ACACIA_STAIRS),
new ItemStack(Blocks.dark_oak_fence), new ItemStack(Blocks.DARK_OAK_FENCE),
new ItemStack(Blocks.dark_oak_fence_gate), new ItemStack(Blocks.DARK_OAK_FENCE_GATE),
new ItemStack(Blocks.dark_oak_stairs), new ItemStack(Blocks.DARK_OAK_STAIRS),
new ItemStack(Blocks.wooden_slab), new ItemStack(Blocks.WOODEN_SLAB),
new ItemStack(Blocks.glass_pane), new ItemStack(Blocks.GLASS_PANE),
null //So the above can have a comma and we don't have to keep editing extra lines. null //So the above can have a comma and we don't have to keep editing extra lines.
}; };

View file

@ -42,8 +42,8 @@ net/minecraft/client/renderer/block/model/FaceBakery.rotateVertex(Lorg/lwjgl/uti
net/minecraft/item/ItemBlock.setTileEntityNBT(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/EntityPlayer;)Z=|p_179224_0_,p_179224_1_,p_179224_2_,player net/minecraft/item/ItemBlock.setTileEntityNBT(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/EntityPlayer;)Z=|p_179224_0_,p_179224_1_,p_179224_2_,player
net/minecraft/server/management/PlayerList.initializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V=|p_72355_1_,p_72355_2_,nethandlerplayserver net/minecraft/server/management/PlayerList.initializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V=|p_72355_1_,p_72355_2_,nethandlerplayserver
net/minecraft/item/ItemMonsterPlacer.spawnCreature(Lnet/minecraft/world/World;Ljava/lang/String;DDD)Lnet/minecraft/entity/Entity;=|p_77840_0_,name,p_77840_2_,p_77840_4_,p_77840_6_
net/minecraft/stats/StatList.replaceAllSimilarBlocks([Lnet/minecraft/stats/StatBase;Z)V=|p_75924_0_,useItemIds
net/minecraft/stats/StatList.mergeStatBases([Lnet/minecraft/stats/StatBase;Lnet/minecraft/block/Block;Lnet/minecraft/block/Block;Z)V=|p_151180_0_,p_151180_1_,p_151180_2_,useItemIds net/minecraft/stats/StatList.mergeStatBases([Lnet/minecraft/stats/StatBase;Lnet/minecraft/block/Block;Lnet/minecraft/block/Block;Z)V=|p_151180_0_,p_151180_1_,p_151180_2_,useItemIds
net/minecraft/item/ItemStack.<init>(Lnet/minecraft/item/Item;IILnet/minecraft/nbt/NBTTagCompound;)V=|p_i1881_1_,p_i1881_2_,p_i1881_3_,capNBT net/minecraft/item/ItemStack.<init>(Lnet/minecraft/item/Item;IILnet/minecraft/nbt/NBTTagCompound;)V=|p_i1881_1_,p_i1881_2_,p_i1881_3_,capNBT

View file

@ -90,8 +90,8 @@ public class DynBucketTest
} }
}); });
ModelBakery.registerItemVariants(dynBottle, bottle); ModelBakery.registerItemVariants(dynBottle, bottle);
ModelLoader.setCustomModelResourceLocation(Item.itemRegistry.getObject(simpleTankName), 0, new ModelResourceLocation(simpleTankName, "normal")); ModelLoader.setCustomModelResourceLocation(Item.REGISTRY.getObject(simpleTankName), 0, new ModelResourceLocation(simpleTankName, "normal"));
ModelLoader.setCustomModelResourceLocation(Item.itemRegistry.getObject(testItemName), 0, new ModelResourceLocation(new ResourceLocation("minecraft", "stick"), "inventory")); ModelLoader.setCustomModelResourceLocation(Item.REGISTRY.getObject(testItemName), 0, new ModelResourceLocation(new ResourceLocation("minecraft", "stick"), "inventory"));
} }
} }
@ -125,7 +125,7 @@ public class DynBucketTest
//registerFluidContainer2(FluidRegistry.getFluid(TestGas.name), i++); //registerFluidContainer2(FluidRegistry.getFluid(TestGas.name), i++);
// Set TestFluidBlocks blockstate to use milk instead of testfluid for the texture to be loaded // Set TestFluidBlocks blockstate to use milk instead of testfluid for the texture to be loaded
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid("milk"), new ItemStack(Items.milk_bucket), FluidContainerRegistry.EMPTY_BUCKET); FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid("milk"), new ItemStack(Items.MILK_BUCKET), FluidContainerRegistry.EMPTY_BUCKET);
proxy.setupModels(); proxy.setupModels();
//MinecraftForge.EVENT_BUS.register(this); //MinecraftForge.EVENT_BUS.register(this);
@ -139,7 +139,7 @@ public class DynBucketTest
FluidStack fs = new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME); FluidStack fs = new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME);
ItemStack stack = new ItemStack(dynBucket, 1, meta); ItemStack stack = new ItemStack(dynBucket, 1, meta);
FluidContainerRegistry.registerFluidContainer(fs, stack, new ItemStack(Items.bucket)); FluidContainerRegistry.registerFluidContainer(fs, stack, new ItemStack(Items.BUCKET));
} }
@SuppressWarnings("unused") @SuppressWarnings("unused")
@ -150,7 +150,7 @@ public class DynBucketTest
FluidStack fs = new FluidStack(fluid, 250); FluidStack fs = new FluidStack(fluid, 250);
ItemStack stack = new ItemStack(dynBottle, 1, meta); ItemStack stack = new ItemStack(dynBottle, 1, meta);
FluidContainerRegistry.registerFluidContainer(fs, stack, new ItemStack(Items.glass_bottle)); FluidContainerRegistry.registerFluidContainer(fs, stack, new ItemStack(Items.GLASS_BOTTLE));
} }
@SubscribeEvent @SubscribeEvent
@ -182,17 +182,17 @@ public class DynBucketTest
ItemStackHandler handler2 = new ItemStackHandler(5); ItemStackHandler handler2 = new ItemStackHandler(5);
IItemHandler joined = new CombinedInvWrapper(handler, handler2); IItemHandler joined = new CombinedInvWrapper(handler, handler2);
handler.setStackInSlot(0, new ItemStack(Blocks.stone)); handler.setStackInSlot(0, new ItemStack(Blocks.STONE));
handler.setStackInSlot(1, new ItemStack(Blocks.grass)); handler.setStackInSlot(1, new ItemStack(Blocks.GRASS));
handler.setStackInSlot(2, new ItemStack(Blocks.dirt)); handler.setStackInSlot(2, new ItemStack(Blocks.DIRT));
handler.setStackInSlot(3, new ItemStack(Blocks.glass)); handler.setStackInSlot(3, new ItemStack(Blocks.GLASS));
handler.setStackInSlot(4, new ItemStack(Blocks.sand)); handler.setStackInSlot(4, new ItemStack(Blocks.SAND));
handler2.setStackInSlot(0, new ItemStack(Blocks.slime_block)); handler2.setStackInSlot(0, new ItemStack(Blocks.SLIME_BLOCK));
handler2.setStackInSlot(1, new ItemStack(Blocks.tnt)); handler2.setStackInSlot(1, new ItemStack(Blocks.TNT));
handler2.setStackInSlot(2, new ItemStack(Blocks.planks)); handler2.setStackInSlot(2, new ItemStack(Blocks.PLANKS));
handler2.setStackInSlot(3, new ItemStack(Blocks.log)); handler2.setStackInSlot(3, new ItemStack(Blocks.LOG));
handler2.setStackInSlot(4, new ItemStack(Blocks.diamond_block)); handler2.setStackInSlot(4, new ItemStack(Blocks.DIAMOND_BLOCK));
for (int i = 0; i < handler.getSlots(); i++) { for (int i = 0; i < handler.getSlots(); i++) {
System.out.println("Expected 1: " + handler.getStackInSlot(i)); System.out.println("Expected 1: " + handler.getStackInSlot(i));
@ -217,7 +217,7 @@ public class DynBucketTest
setUnlocalizedName("dynbucket"); setUnlocalizedName("dynbucket");
setMaxStackSize(1); setMaxStackSize(1);
setHasSubtypes(true); setHasSubtypes(true);
setCreativeTab(CreativeTabs.tabMisc); setCreativeTab(CreativeTabs.MISC);
} }
@Override @Override
@ -236,12 +236,12 @@ public class DynBucketTest
{ {
public DynBottle() public DynBottle()
{ {
super(250, new ItemStack(Items.glass_bottle), true); super(250, new ItemStack(Items.GLASS_BOTTLE), true);
setUnlocalizedName("dynbottle"); setUnlocalizedName("dynbottle");
setRegistryName(new ResourceLocation(MODID, "dynbottle")); setRegistryName(new ResourceLocation(MODID, "dynbottle"));
setMaxStackSize(16); setMaxStackSize(16);
setHasSubtypes(true); setHasSubtypes(true);
setCreativeTab(CreativeTabs.tabMisc); setCreativeTab(CreativeTabs.MISC);
} }
} }
@ -251,8 +251,8 @@ public class DynBucketTest
protected BlockSimpleTank() protected BlockSimpleTank()
{ {
super(Material.rock); super(Material.ROCK);
setCreativeTab(CreativeTabs.tabMisc); setCreativeTab(CreativeTabs.MISC);
} }
@Override @Override
@ -369,17 +369,17 @@ public class DynBucketTest
} }
@Override @Override
public NBTTagCompound func_189515_b(NBTTagCompound tags) public NBTTagCompound writeToNBT(NBTTagCompound tags)
{ {
tags = super.func_189515_b(tags); tags = super.writeToNBT(tags);
tank.writeToNBT(tags); tank.writeToNBT(tags);
return tags; return tags;
} }
@Override @Override
public SPacketUpdateTileEntity func_189518_D_() { public SPacketUpdateTileEntity getUpdatePacket() {
NBTTagCompound tag = new NBTTagCompound(); NBTTagCompound tag = new NBTTagCompound();
func_189515_b(tag); tag = writeToNBT(tag);
return new SPacketUpdateTileEntity(this.getPos(), this.getBlockMetadata(), tag); return new SPacketUpdateTileEntity(this.getPos(), this.getBlockMetadata(), tag);
} }

View file

@ -37,7 +37,7 @@ public class ForgeBlockStatesLoaderDebug {
//public static final Block blockCustom = new CustomMappedBlock(); //public static final Block blockCustom = new CustomMappedBlock();
public static final String nameCustomWall = "custom_wall"; public static final String nameCustomWall = "custom_wall";
public static final BlockWall blockCustomWall = new BlockWall(Blocks.cobblestone); public static final BlockWall blockCustomWall = new BlockWall(Blocks.COBBLESTONE);
public static final ItemMultiTexture itemCustomWall = (ItemMultiTexture)new ItemMultiTexture(blockCustomWall, blockCustomWall, new Function<ItemStack, String>() public static final ItemMultiTexture itemCustomWall = (ItemMultiTexture)new ItemMultiTexture(blockCustomWall, blockCustomWall, new Function<ItemStack, String>()
{ {
@Override @Override

View file

@ -51,7 +51,7 @@ public class ItemLayerModelDebug
private TestItem() private TestItem()
{ {
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }

View file

@ -123,8 +123,8 @@ public class ItemTileDebug
private TestBlock() private TestBlock()
{ {
super(Material.iron); super(Material.IRON);
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }

View file

@ -34,7 +34,7 @@ public class LootTablesDebug {
LootPool main = event.getTable().getPool("main"); //Note: This CAN NPE if another mod removes things LootPool main = event.getTable().getPool("main"); //Note: This CAN NPE if another mod removes things
main.removeEntry("minecraft:wooden_axe"); main.removeEntry("minecraft:wooden_axe");
main.removeEntry("minecraft:stone_axe"); main.removeEntry("minecraft:stone_axe");
main.addEntry(new LootEntryItem(Items.diamond_chestplate, 1, 0, new LootFunction[0], new LootCondition[0], MODID + ":diamond_chestplate")); main.addEntry(new LootEntryItem(Items.DIAMOND_CHESTPLATE, 1, 0, new LootFunction[0], new LootCondition[0], MODID + ":diamond_chestplate"));
// Get rid of all building mats. Which is pool #3, index starts at 0, but 0 is named "main" // Get rid of all building mats. Which is pool #3, index starts at 0, but 0 is named "main"
event.getTable().removePool("pool3"); event.getTable().removePool("pool3");

View file

@ -77,10 +77,10 @@ public class ModelAnimationDebug
{ {
public void preInit(FMLPreInitializationEvent event) public void preInit(FMLPreInitializationEvent event)
{ {
GameRegistry.register(new Block(Material.wood) GameRegistry.register(new Block(Material.WOOD)
{ {
{ {
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + "." + blockName); setUnlocalizedName(MODID + "." + blockName);
setRegistryName(blockId); setRegistryName(blockId);
} }
@ -152,7 +152,7 @@ public class ModelAnimationDebug
return true; return true;
} }
}); });
GameRegistry.register(new ItemBlock(Block.blockRegistry.getObject(blockId)) GameRegistry.register(new ItemBlock(Block.REGISTRY.getObject(blockId))
{ {
@Override @Override
public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt) public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt)
@ -181,7 +181,7 @@ public class ModelAnimationDebug
{ {
super.preInit(event); super.preInit(event);
B3DLoader.INSTANCE.addDomain(MODID); B3DLoader.INSTANCE.addDomain(MODID);
ModelLoader.setCustomModelResourceLocation(Item.itemRegistry.getObject(blockId), 0, new ModelResourceLocation(blockId, "inventory")); ModelLoader.setCustomModelResourceLocation(Item.REGISTRY.getObject(blockId), 0, new ModelResourceLocation(blockId, "inventory"));
ClientRegistry.bindTileEntitySpecialRenderer(Chest.class, new AnimationTESR<Chest>() ClientRegistry.bindTileEntitySpecialRenderer(Chest.class, new AnimationTESR<Chest>()
{ {
@Override @Override
@ -219,7 +219,7 @@ public class ModelAnimationDebug
{ {
protected ResourceLocation getEntityTexture(EntityChest entity) protected ResourceLocation getEntityTexture(EntityChest entity)
{ {
return TextureMap.locationBlocksTexture; return TextureMap.LOCATION_BLOCKS_TEXTURE;
} }
}; };
} }

View file

@ -132,8 +132,8 @@ public class ModelBakeEventDebug
private CustomModelBlock() private CustomModelBlock()
{ {
super(Material.iron); super(Material.IRON);
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(blockName); setRegistryName(blockName);
} }

View file

@ -158,8 +158,8 @@ public class ModelFluidDebug
private TestFluidBlock() private TestFluidBlock()
{ {
super(TestFluid.instance, Material.water); super(TestFluid.instance, Material.WATER);
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }
@ -172,8 +172,8 @@ public class ModelFluidDebug
private MilkFluidBlock() private MilkFluidBlock()
{ {
super(milkFluid, Material.water); super(milkFluid, Material.WATER);
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }
@ -186,8 +186,8 @@ public class ModelFluidDebug
private TestGasBlock() private TestGasBlock()
{ {
super(TestGas.instance, Material.lava); super(TestGas.instance, Material.LAVA);
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }

View file

@ -124,9 +124,9 @@ public class ModelLoaderRegistryDebug
private CustomModelBlock() private CustomModelBlock()
{ {
super(Material.iron); super(Material.IRON);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }
@ -225,8 +225,8 @@ public class ModelLoaderRegistryDebug
private OBJTesseractBlock() private OBJTesseractBlock()
{ {
super(Material.iron); super(Material.IRON);
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }
@ -371,8 +371,8 @@ public class ModelLoaderRegistryDebug
private OBJVertexColoring1() private OBJVertexColoring1()
{ {
super(Material.iron); super(Material.IRON);
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(name); setUnlocalizedName(name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }
@ -403,9 +403,9 @@ public class ModelLoaderRegistryDebug
private OBJDirectionEye() private OBJDirectionEye()
{ {
super(Material.iron); super(Material.IRON);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(name); setUnlocalizedName(name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }
@ -487,8 +487,8 @@ public class ModelLoaderRegistryDebug
private OBJVertexColoring2() private OBJVertexColoring2()
{ {
super(Material.iron); super(Material.IRON);
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(name); setUnlocalizedName(name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }
@ -590,9 +590,9 @@ public class ModelLoaderRegistryDebug
private OBJDirectionBlock() private OBJDirectionBlock()
{ {
super(Material.iron); super(Material.IRON);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }
@ -678,9 +678,9 @@ public class ModelLoaderRegistryDebug
private OBJCustomDataBlock() private OBJCustomDataBlock()
{ {
super(Material.iron); super(Material.IRON);
this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, false).withProperty(SOUTH, false).withProperty(WEST, false).withProperty(EAST, false)); this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, false).withProperty(SOUTH, false).withProperty(WEST, false).withProperty(EAST, false));
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }
@ -735,8 +735,8 @@ public class ModelLoaderRegistryDebug
public ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {OBJModel.OBJProperty.INSTANCE}); public ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {OBJModel.OBJProperty.INSTANCE});
private OBJDynamicEye() private OBJDynamicEye()
{ {
super(Material.iron); super(Material.IRON);
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }

View file

@ -32,10 +32,10 @@ public class MultiLayerModelDebug
{ {
public void preInit(FMLPreInitializationEvent event) public void preInit(FMLPreInitializationEvent event)
{ {
GameRegistry.register(new Block(Material.wood) GameRegistry.register(new Block(Material.WOOD)
{ {
{ {
setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + "." + blockName); setUnlocalizedName(MODID + "." + blockName);
setRegistryName(blockId); setRegistryName(blockId);
} }
@ -52,7 +52,7 @@ public class MultiLayerModelDebug
return layer == BlockRenderLayer.SOLID || layer == BlockRenderLayer.TRANSLUCENT; return layer == BlockRenderLayer.SOLID || layer == BlockRenderLayer.TRANSLUCENT;
} }
}); });
GameRegistry.register(new ItemBlock(Block.blockRegistry.getObject(blockId)).setRegistryName(blockId)); GameRegistry.register(new ItemBlock(Block.REGISTRY.getObject(blockId)).setRegistryName(blockId));
} }
} }
@ -64,7 +64,7 @@ public class MultiLayerModelDebug
public void preInit(FMLPreInitializationEvent event) public void preInit(FMLPreInitializationEvent event)
{ {
super.preInit(event); super.preInit(event);
ModelLoader.setCustomModelResourceLocation(Item.itemRegistry.getObject(blockId), 0, new ModelResourceLocation(blockId, "inventory")); ModelLoader.setCustomModelResourceLocation(Item.REGISTRY.getObject(blockId), 0, new ModelResourceLocation(blockId, "inventory"));
} }
} }

View file

@ -60,7 +60,7 @@ public class PotionRegistryDebug {
public void renderInventoryEffect(int x, int y, PotionEffect effect, Minecraft mc) { public void renderInventoryEffect(int x, int y, PotionEffect effect, Minecraft mc) {
Potion potion = effect.getPotion(); Potion potion = effect.getPotion();
mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite("minecraft:blocks/fire_layer_0"); TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite("minecraft:blocks/fire_layer_0");
x += 6; x += 6;
@ -89,7 +89,7 @@ public class PotionRegistryDebug {
public void renderHUDEffect(int x, int y, PotionEffect effect, Minecraft mc, float alpha) { public void renderHUDEffect(int x, int y, PotionEffect effect, Minecraft mc, float alpha) {
Potion potion = effect.getPotion(); Potion potion = effect.getPotion();
mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite("minecraft:blocks/tnt_side"); TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite("minecraft:blocks/tnt_side");
x += 3; x += 3;

View file

@ -8,33 +8,33 @@ import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent;
@Mod(modid="BrewingRecipeRegistryTest", name="BrewingRecipeRegistryTest", version="0.0.0") @Mod(modid="BrewingRecipeRegistryTest", name="BrewingRecipeRegistryTest", version="0.0.0")
public class BrewingRecipeRegistryTest public class BrewingRecipeRegistryTest
{ {
public static final boolean ENABLE = false; public static final boolean ENABLE = false;
@EventHandler @EventHandler
public void init(FMLInitializationEvent event) public void init(FMLInitializationEvent event)
{ {
if(!ENABLE) return; if(!ENABLE) return;
// The following adds a recipe that brews a piece of rotten flesh "into" a diamond sword resulting in a diamond hoe
BrewingRecipeRegistry.addRecipe(new ItemStack(Items.diamond_sword), new ItemStack(Items.rotten_flesh), new ItemStack(Items.diamond_hoe));
ItemStack output0 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.diamond_sword), new ItemStack(Items.rotten_flesh)); // The following adds a recipe that brews a piece of rotten flesh "into" a diamond sword resulting in a diamond hoe
if(output0.getItem() == Items.diamond_hoe) BrewingRecipeRegistry.addRecipe(new ItemStack(Items.DIAMOND_SWORD), new ItemStack(Items.ROTTEN_FLESH), new ItemStack(Items.DIAMOND_HOE));
ItemStack output0 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.DIAMOND_SWORD), new ItemStack(Items.ROTTEN_FLESH));
if(output0.getItem() == Items.DIAMOND_HOE)
System.out.println("Recipe succefully registered and working. Diamond Hoe obtained."); System.out.println("Recipe succefully registered and working. Diamond Hoe obtained.");
// Testing if OreDictionary support is working. Register a recipe that brews a gemDiamond into a gold sword resulting in a diamond sword // Testing if OreDictionary support is working. Register a recipe that brews a gemDiamond into a gold sword resulting in a diamond sword
BrewingRecipeRegistry.addRecipe(new ItemStack(Items.golden_sword), "gemDiamond", new ItemStack(Items.diamond_sword)); BrewingRecipeRegistry.addRecipe(new ItemStack(Items.GOLDEN_SWORD), "gemDiamond", new ItemStack(Items.DIAMOND_SWORD));
ItemStack output1 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.golden_sword), new ItemStack(Items.diamond)); ItemStack output1 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.GOLDEN_SWORD), new ItemStack(Items.DIAMOND));
if(output1.getItem() == Items.diamond_sword) if(output1.getItem() == Items.DIAMOND_SWORD)
System.out.println("Recipe succefully registered and working. Diamond Sword obtained."); System.out.println("Recipe succefully registered and working. Diamond Sword obtained.");
// In vanilla, brewing netherwart into a water bottle results in an awkward potion (with metadata 16). The following tests if that still happens // In vanilla, brewing netherwart into a water bottle results in an awkward potion (with metadata 16). The following tests if that still happens
ItemStack output2 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.potionitem, 1, 0), new ItemStack(Items.nether_wart)); ItemStack output2 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.POTIONITEM, 1, 0), new ItemStack(Items.NETHER_WART));
if(output2 != null && output2.getItem() == Items.potionitem && output2.getItemDamage() == 16) if(output2 != null && output2.getItem() == Items.POTIONITEM && output2.getItemDamage() == 16)
System.out.println("Vanilla behaviour still in place. Brewed Water Bottle with Nether Wart and got Awkward Potion"); System.out.println("Vanilla behaviour still in place. Brewed Water Bottle with Nether Wart and got Awkward Potion");
} }
} }

View file

@ -15,12 +15,12 @@ public class FOVModifierTest {
@EventHandler @EventHandler
public void init(FMLInitializationEvent event) public void init(FMLInitializationEvent event)
{ {
MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(this);
} }
@SubscribeEvent @SubscribeEvent
public void getFOVModifier(EntityViewRenderEvent.FOVModifier event) { public void getFOVModifier(EntityViewRenderEvent.FOVModifier event) {
if(event.getState().getMaterial() == Material.water) if(event.getState().getMaterial() == Material.WATER)
event.setFOV(event.getFOV() / 60.0f * 50.0f); event.setFOV(event.getFOV() / 60.0f * 50.0f);
} }
} }

View file

@ -152,7 +152,7 @@ public class NoBedSleepingTest
private ItemSleepingPill() private ItemSleepingPill()
{ {
setCreativeTab(CreativeTabs.tabMisc); setCreativeTab(CreativeTabs.MISC);
setUnlocalizedName(MODID + ":" + name); setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name)); setRegistryName(new ResourceLocation(MODID, name));
} }

View file

@ -50,11 +50,11 @@ public class PlayerInteractEventTest
if (evt.getItemStack() != null) if (evt.getItemStack() != null)
{ {
if (evt.getItemStack().getItem() == Items.golden_pickaxe) if (evt.getItemStack().getItem() == Items.GOLDEN_PICKAXE)
evt.setCanceled(true); // Redstone should not activate and pick should not be able to dig anything evt.setCanceled(true); // Redstone should not activate and pick should not be able to dig anything
if (evt.getItemStack().getItem() == Items.diamond_pickaxe) if (evt.getItemStack().getItem() == Items.DIAMOND_PICKAXE)
evt.setUseBlock(Event.Result.DENY); // Redstone should not activate, pick should still dig evt.setUseBlock(Event.Result.DENY); // Redstone should not activate, pick should still dig
if (evt.getItemStack().getItem() == Items.iron_pickaxe) if (evt.getItemStack().getItem() == Items.IRON_PICKAXE)
evt.setUseItem(Event.Result.DENY); // Pick should not dig, Redstone should still activate evt.setUseItem(Event.Result.DENY); // Pick should not dig, Redstone should still activate
} }
@ -88,18 +88,18 @@ public class PlayerInteractEventTest
// Case: Flint and steel in main hand on top of a TE will light a fire, not open the TE. // Case: Flint and steel in main hand on top of a TE will light a fire, not open the TE.
// Note that if you do this on a chest, the f+s will fail, but then your off hand will open the chest // Note that if you do this on a chest, the f+s will fail, but then your off hand will open the chest
// If you dual wield flints and steels and right click a chest nothing should happen // If you dual wield flints and steels and right click a chest nothing should happen
if (evt.getItemStack() != null && evt.getItemStack().getItem() == Items.flint_and_steel) if (evt.getItemStack() != null && evt.getItemStack().getItem() == Items.FLINT_AND_STEEL)
evt.setUseBlock(Event.Result.DENY); evt.setUseBlock(Event.Result.DENY);
// Case: Painting in main hand // Case: Painting in main hand
// Opening a TE will also place a painting on the TE if possible // Opening a TE will also place a painting on the TE if possible
if (evt.getHand() == EnumHand.MAIN_HAND && evt.getItemStack() != null && evt.getItemStack().getItem() == Items.painting) { if (evt.getHand() == EnumHand.MAIN_HAND && evt.getItemStack() != null && evt.getItemStack().getItem() == Items.PAINTING) {
evt.setUseItem(Event.Result.ALLOW); evt.setUseItem(Event.Result.ALLOW);
} }
// Spawn egg in main hand, block in offhand -> block should be placed // Spawn egg in main hand, block in offhand -> block should be placed
// Sword in main hand, spawn egg in offhand -> nothing should happen // Sword in main hand, spawn egg in offhand -> nothing should happen
if (evt.getItemStack() != null && evt.getItemStack().getItem() == Items.spawn_egg) { if (evt.getItemStack() != null && evt.getItemStack().getItem() == Items.SPAWN_EGG) {
evt.setCanceled(true); evt.setCanceled(true);
} }
@ -115,7 +115,7 @@ public class PlayerInteractEventTest
// Case: Ender pearl in main hand, bow in offhand with arrows in inv -> Bow should trigger // Case: Ender pearl in main hand, bow in offhand with arrows in inv -> Bow should trigger
// Case: Sword in main hand, ender pearl in offhand -> Nothing should happen // Case: Sword in main hand, ender pearl in offhand -> Nothing should happen
if (evt.getItemStack() != null && evt.getItemStack().getItem() == Items.ender_pearl) if (evt.getItemStack() != null && evt.getItemStack().getItem() == Items.ENDER_PEARL)
evt.setCanceled(true); evt.setCanceled(true);
} }
@ -127,7 +127,7 @@ public class PlayerInteractEventTest
if (evt.getItemStack() != null if (evt.getItemStack() != null
&& evt.getTarget() instanceof EntityArmorStand && evt.getTarget() instanceof EntityArmorStand
&& evt.getItemStack().getItem() == Items.iron_helmet) && evt.getItemStack().getItem() == Items.IRON_HELMET)
evt.setCanceled(true); // Should not be able to place iron helmet onto armor stand (you will put it on instead) evt.setCanceled(true); // Should not be able to place iron helmet onto armor stand (you will put it on instead)
if (evt.getWorld().isRemote if (evt.getWorld().isRemote

View file

@ -45,7 +45,7 @@ public class TestCapabilityMod
public void onInteract(PlayerInteractEvent.LeftClickBlock event) public void onInteract(PlayerInteractEvent.LeftClickBlock event)
{ {
if (event.getItemStack() == null) return; if (event.getItemStack() == null) return;
if (event.getItemStack().getItem() != Items.stick) return; if (event.getItemStack().getItem() != Items.STICK) return;
// This is just a example of how to interact with the TE, note the strong type binding that getCapability has // This is just a example of how to interact with the TE, note the strong type binding that getCapability has
TileEntity te = event.getWorld().getTileEntity(event.getPos()); TileEntity te = event.getWorld().getTileEntity(event.getPos());
@ -55,7 +55,7 @@ public class TestCapabilityMod
IExampleCapability inv = te.getCapability(TEST_CAP, event.getFace()); IExampleCapability inv = te.getCapability(TEST_CAP, event.getFace());
System.out.println("Hi I'm a " + inv.getOwnerType()); System.out.println("Hi I'm a " + inv.getOwnerType());
} }
if (event.getWorld().getBlockState(event.getPos()).getBlock() == Blocks.dirt) if (event.getWorld().getBlockState(event.getPos()).getBlock() == Blocks.DIRT)
{ {
event.getEntityPlayer().addChatMessage(new TextComponentString(TextFormatting.RED + "" + TextFormatting.ITALIC + "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST")); event.getEntityPlayer().addChatMessage(new TextComponentString(TextFormatting.RED + "" + TextFormatting.ITALIC + "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST"));
event.setCanceled(true); event.setCanceled(true);