Update mappoings snapshot to 20160518

This commit is contained in:
LexManos committed 2016-05-18 05:23:30 -07:00
1 parent b9ac73b0f1
commit cdc86e9af6
60 files changed
+514 -810

No files matched your search

@@ -90,8 +90,8 @@ public class DynBucketTest
}
});
ModelBakery.registerItemVariants(dynBottle, bottle);
ModelLoader.setCustomModelResourceLocation(Item.itemRegistry.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(simpleTankName), 0, new ModelResourceLocation(simpleTankName, "normal"));
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++);
// 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();
//MinecraftForge.EVENT_BUS.register(this);
@@ -139,7 +139,7 @@ public class DynBucketTest
FluidStack fs = new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME);
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")
@@ -150,7 +150,7 @@ public class DynBucketTest
FluidStack fs = new FluidStack(fluid, 250);
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
@@ -182,17 +182,17 @@ public class DynBucketTest
ItemStackHandler handler2 = new ItemStackHandler(5);
IItemHandler joined = new CombinedInvWrapper(handler, handler2);
handler.setStackInSlot(0, new ItemStack(Blocks.stone));
handler.setStackInSlot(1, new ItemStack(Blocks.grass));
handler.setStackInSlot(2, new ItemStack(Blocks.dirt));
handler.setStackInSlot(3, new ItemStack(Blocks.glass));
handler.setStackInSlot(4, new ItemStack(Blocks.sand));
handler.setStackInSlot(0, new ItemStack(Blocks.STONE));
handler.setStackInSlot(1, new ItemStack(Blocks.GRASS));
handler.setStackInSlot(2, new ItemStack(Blocks.DIRT));
handler.setStackInSlot(3, new ItemStack(Blocks.GLASS));
handler.setStackInSlot(4, new ItemStack(Blocks.SAND));
handler2.setStackInSlot(0, new ItemStack(Blocks.slime_block));
handler2.setStackInSlot(1, new ItemStack(Blocks.tnt));
handler2.setStackInSlot(2, new ItemStack(Blocks.planks));
handler2.setStackInSlot(3, new ItemStack(Blocks.log));
handler2.setStackInSlot(4, new ItemStack(Blocks.diamond_block));
handler2.setStackInSlot(0, new ItemStack(Blocks.SLIME_BLOCK));
handler2.setStackInSlot(1, new ItemStack(Blocks.TNT));
handler2.setStackInSlot(2, new ItemStack(Blocks.PLANKS));
handler2.setStackInSlot(3, new ItemStack(Blocks.LOG));
handler2.setStackInSlot(4, new ItemStack(Blocks.DIAMOND_BLOCK));
for (int i = 0; i < handler.getSlots(); i++) {
System.out.println("Expected 1: " + handler.getStackInSlot(i));
@@ -217,7 +217,7 @@ public class DynBucketTest
setUnlocalizedName("dynbucket");
setMaxStackSize(1);
setHasSubtypes(true);
setCreativeTab(CreativeTabs.tabMisc);
setCreativeTab(CreativeTabs.MISC);
}
@Override
@@ -236,12 +236,12 @@ public class DynBucketTest
{
public DynBottle()
{
super(250, new ItemStack(Items.glass_bottle), true);
super(250, new ItemStack(Items.GLASS_BOTTLE), true);
setUnlocalizedName("dynbottle");
setRegistryName(new ResourceLocation(MODID, "dynbottle"));
setMaxStackSize(16);
setHasSubtypes(true);
setCreativeTab(CreativeTabs.tabMisc);
setCreativeTab(CreativeTabs.MISC);
}
}
@@ -251,8 +251,8 @@ public class DynBucketTest
protected BlockSimpleTank()
{
super(Material.rock);
setCreativeTab(CreativeTabs.tabMisc);
super(Material.ROCK);
setCreativeTab(CreativeTabs.MISC);
}
@Override
@@ -369,17 +369,17 @@ public class DynBucketTest
}
@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);
return tags;
}
@Override
public SPacketUpdateTileEntity func_189518_D_() {
public SPacketUpdateTileEntity getUpdatePacket() {
NBTTagCompound tag = new NBTTagCompound();
func_189515_b(tag);
tag = writeToNBT(tag);
return new SPacketUpdateTileEntity(this.getPos(), this.getBlockMetadata(), tag);
}
@@ -37,7 +37,7 @@ public class ForgeBlockStatesLoaderDebug {
//public static final Block blockCustom = new CustomMappedBlock();
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>()
{
@Override
@@ -51,7 +51,7 @@ public class ItemLayerModelDebug
private TestItem()
{
setCreativeTab(CreativeTabs.tabBlock);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -123,8 +123,8 @@ public class ItemTileDebug
private TestBlock()
{
super(Material.iron);
setCreativeTab(CreativeTabs.tabBlock);
super(Material.IRON);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -34,7 +34,7 @@ public class LootTablesDebug {
LootPool main = event.getTable().getPool("main"); //Note: This CAN NPE if another mod removes things
main.removeEntry("minecraft:wooden_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"
event.getTable().removePool("pool3");
@@ -77,10 +77,10 @@ public class ModelAnimationDebug
{
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);
setRegistryName(blockId);
}
@@ -152,7 +152,7 @@ public class ModelAnimationDebug
return true;
}
});
GameRegistry.register(new ItemBlock(Block.blockRegistry.getObject(blockId))
GameRegistry.register(new ItemBlock(Block.REGISTRY.getObject(blockId))
{
@Override
public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt)
@@ -181,7 +181,7 @@ public class ModelAnimationDebug
{
super.preInit(event);
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>()
{
@Override
@@ -219,7 +219,7 @@ public class ModelAnimationDebug
{
protected ResourceLocation getEntityTexture(EntityChest entity)
{
return TextureMap.locationBlocksTexture;
return TextureMap.LOCATION_BLOCKS_TEXTURE;
}
};
}
@@ -132,8 +132,8 @@ public class ModelBakeEventDebug
private CustomModelBlock()
{
super(Material.iron);
setCreativeTab(CreativeTabs.tabBlock);
super(Material.IRON);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(blockName);
}
@@ -158,8 +158,8 @@ public class ModelFluidDebug
private TestFluidBlock()
{
super(TestFluid.instance, Material.water);
setCreativeTab(CreativeTabs.tabBlock);
super(TestFluid.instance, Material.WATER);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -172,8 +172,8 @@ public class ModelFluidDebug
private MilkFluidBlock()
{
super(milkFluid, Material.water);
setCreativeTab(CreativeTabs.tabBlock);
super(milkFluid, Material.WATER);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -186,8 +186,8 @@ public class ModelFluidDebug
private TestGasBlock()
{
super(TestGas.instance, Material.lava);
setCreativeTab(CreativeTabs.tabBlock);
super(TestGas.instance, Material.LAVA);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -124,9 +124,9 @@ public class ModelLoaderRegistryDebug
private CustomModelBlock()
{
super(Material.iron);
super(Material.IRON);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
setCreativeTab(CreativeTabs.tabBlock);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -225,8 +225,8 @@ public class ModelLoaderRegistryDebug
private OBJTesseractBlock()
{
super(Material.iron);
setCreativeTab(CreativeTabs.tabBlock);
super(Material.IRON);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -371,8 +371,8 @@ public class ModelLoaderRegistryDebug
private OBJVertexColoring1()
{
super(Material.iron);
setCreativeTab(CreativeTabs.tabBlock);
super(Material.IRON);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -403,9 +403,9 @@ public class ModelLoaderRegistryDebug
private OBJDirectionEye()
{
super(Material.iron);
super(Material.IRON);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
setCreativeTab(CreativeTabs.tabBlock);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -487,8 +487,8 @@ public class ModelLoaderRegistryDebug
private OBJVertexColoring2()
{
super(Material.iron);
setCreativeTab(CreativeTabs.tabBlock);
super(Material.IRON);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -590,9 +590,9 @@ public class ModelLoaderRegistryDebug
private OBJDirectionBlock()
{
super(Material.iron);
super(Material.IRON);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
setCreativeTab(CreativeTabs.tabBlock);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -678,9 +678,9 @@ public class ModelLoaderRegistryDebug
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));
setCreativeTab(CreativeTabs.tabBlock);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(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});
private OBJDynamicEye()
{
super(Material.iron);
setCreativeTab(CreativeTabs.tabBlock);
super(Material.IRON);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -32,10 +32,10 @@ public class MultiLayerModelDebug
{
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);
setRegistryName(blockId);
}
@@ -52,7 +52,7 @@ public class MultiLayerModelDebug
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)
{
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"));
}
}
@@ -60,7 +60,7 @@ public class PotionRegistryDebug {
public void renderInventoryEffect(int x, int y, PotionEffect effect, Minecraft mc) {
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");
x += 6;
@@ -89,7 +89,7 @@ public class PotionRegistryDebug {
public void renderHUDEffect(int x, int y, PotionEffect effect, Minecraft mc, float alpha) {
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");
x += 3;
@@ -8,33 +8,33 @@ import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
@Mod(modid="BrewingRecipeRegistryTest", name="BrewingRecipeRegistryTest", version="0.0.0")
public class BrewingRecipeRegistryTest
public class BrewingRecipeRegistryTest
{
public static final boolean ENABLE = false;
@EventHandler
public void init(FMLInitializationEvent event)
public void init(FMLInitializationEvent event)
{
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));
if(output0.getItem() == Items.diamond_hoe)
// 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));
if(output0.getItem() == Items.DIAMOND_HOE)
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
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));
if(output1.getItem() == 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));
if(output1.getItem() == Items.DIAMOND_SWORD)
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
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)
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)
System.out.println("Vanilla behaviour still in place. Brewed Water Bottle with Nether Wart and got Awkward Potion");
}
}
@@ -15,12 +15,12 @@ public class FOVModifierTest {
@EventHandler
public void init(FMLInitializationEvent event)
{
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
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);
}
}
@@ -152,7 +152,7 @@ public class NoBedSleepingTest
private ItemSleepingPill()
{
setCreativeTab(CreativeTabs.tabMisc);
setCreativeTab(CreativeTabs.MISC);
setUnlocalizedName(MODID + ":" + name);
setRegistryName(new ResourceLocation(MODID, name));
}
@@ -50,11 +50,11 @@ public class PlayerInteractEventTest
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
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
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
}
@@ -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.
// 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 (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);
// Case: Painting in main hand
// 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);
}
// Spawn egg in main hand, block in offhand -> block should be placed
// 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);
}
@@ -115,7 +115,7 @@ public class PlayerInteractEventTest
// 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
if (evt.getItemStack() != null && evt.getItemStack().getItem() == Items.ender_pearl)
if (evt.getItemStack() != null && evt.getItemStack().getItem() == Items.ENDER_PEARL)
evt.setCanceled(true);
}
@@ -127,7 +127,7 @@ public class PlayerInteractEventTest
if (evt.getItemStack() != null
&& 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)
if (evt.getWorld().isRemote
@@ -45,7 +45,7 @@ public class TestCapabilityMod
public void onInteract(PlayerInteractEvent.LeftClickBlock event)
{
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
TileEntity te = event.getWorld().getTileEntity(event.getPos());
@@ -55,7 +55,7 @@ public class TestCapabilityMod
IExampleCapability inv = te.getCapability(TEST_CAP, event.getFace());
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.setCanceled(true);