use of net.minecraft.item.EnumDyeColor in project BetterWithAddons by DaedalusGame.
the class ItemStainedBrick method getVariantModels.
@Override
public List<ModelResourceLocation> getVariantModels() {
ArrayList<ModelResourceLocation> rlist = new ArrayList<ModelResourceLocation>();
EnumDyeColor[] dyes = EnumDyeColor.values();
int len = dyes.length;
for (int i = 0; i < len; ++i) {
EnumDyeColor dye = dyes[i];
rlist.add(new ModelResourceLocation(getRegistryName() + "_" + dye.getName(), "inventory"));
}
return rlist;
}
use of net.minecraft.item.EnumDyeColor in project BetterWithAddons by DaedalusGame.
the class InteractionBTWTweak method init.
@Override
public void init() {
if (ASH_FERTILIZER) {
HCBonemeal.registerFertilzier(ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.POTASH));
HCBonemeal.registerFertilzier(ModItems.materialTweak.getMaterial("ash"));
}
if (REPLACE_WRITABLE_BOOK_RECIPE) {
// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.WRITABLE_BOOK),new ItemStack(Items.BOOK),ModItems.materialTweak.getMaterial("ink_and_quill")));
}
if (WOOL_RECYCLING && InteractionBWM.HARDCORE_SHEARING) {
for (EnumDyeColor color : EnumDyeColor.values()) {
StokedCauldronManager.getInstance().addRecipe(new ItemStack(BWMBlocks.AESTHETIC, 1, BlockAesthetic.EnumType.WICKER.getMeta()), ModItems.wool.getByColor(color, 4), new Object[] { new ItemStack(Blocks.WOOL, 1, color.getMetadata()) }).setPriority(-1);
}
}
if (SAW_RECYCLING) {
SawManager.WOOD_SAW.addRecipe(Blocks.BOOKSHELF, 0, new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(Items.BOOK, 3));
SawManager.WOOD_SAW.addRecipe(Blocks.CHEST, 0, new ItemStack(BWMBlocks.WOOD_SIDING, 6, BlockPlanks.EnumType.OAK.getMetadata()));
SawManager.WOOD_SAW.addRecipe(Blocks.JUKEBOX, 0, new ItemStack(BWMBlocks.WOOD_SIDING, 6, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(Items.DIAMOND, 1));
SawManager.WOOD_SAW.addRecipe(Blocks.LADDER, 0, new ItemStack(Items.STICK, 2));
SawManager.WOOD_SAW.addRecipe(Blocks.NOTEBLOCK, 0, new ItemStack(BWMBlocks.WOOD_SIDING, 6, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(Items.REDSTONE, 1));
SawManager.WOOD_SAW.addRecipe(Blocks.TRAPDOOR, 0, new ItemStack(BWMBlocks.WOOD_SIDING, 2, BlockPlanks.EnumType.OAK.getMetadata()));
SawManager.WOOD_SAW.addRecipe(BWMBlocks.WOODEN_AXLE, 0, new ItemStack(BWMBlocks.WOOD_CORNER, 2, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(BWMBlocks.ROPE, 1));
SawManager.WOOD_SAW.addRecipe(BWMBlocks.BELLOWS, 0, new ItemStack(BWMBlocks.WOOD_SIDING, 2, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.LEATHER_BELT), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.TANNED_LEATHER_CUT, 3));
SawManager.WOOD_SAW.addRecipe(BWMBlocks.WOODEN_GEARBOX, 0, new ItemStack(BWMBlocks.WOOD_SIDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR, 3), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.REDSTONE_LATCH));
SawManager.WOOD_SAW.addRecipe(BWMBlocks.SINGLE_MACHINES, BlockMechMachines.EnumType.HOPPER.getMeta(), new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR, 1), new ItemStack(Blocks.WOODEN_PRESSURE_PLATE, 1));
SawManager.WOOD_SAW.addRecipe(BWMBlocks.PLATFORM, 0, new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(BWMBlocks.WICKER, 2));
SawManager.WOOD_SAW.addRecipe(BWMBlocks.SINGLE_MACHINES, BlockMechMachines.EnumType.PULLEY.getMeta(), new ItemStack(BWMBlocks.WOOD_SIDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), new ItemStack(Items.IRON_INGOT), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.REDSTONE_LATCH));
SawManager.WOOD_SAW.addRecipe(BWMBlocks.SAW, 0, new ItemStack(BWMBlocks.WOOD_SIDING, 1, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.LEATHER_BELT), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.GEAR), new ItemStack(Items.IRON_INGOT, 2));
SawManager.WOOD_SAW.addRecipe(BWMBlocks.PUMP, 0, new ItemStack(BWMBlocks.WOOD_SIDING, 3, BlockPlanks.EnumType.OAK.getMetadata()), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SCREW), new ItemStack(BWMBlocks.GRATE, 1, BlockPlanks.EnumType.OAK.getMetadata()));
BlockPlanks.EnumType[] woodtypes = BlockPlanks.EnumType.values();
int len = woodtypes.length;
for (int i = 0; i < len; ++i) {
BlockPlanks.EnumType woodtype = woodtypes[i];
SawManager.WOOD_SAW.addRecipe(BWMBlocks.WOOD_BENCH, woodtype.getMetadata(), new ItemStack(BWMBlocks.WOOD_CORNER, 2, woodtype.getMetadata()));
SawManager.WOOD_SAW.addRecipe(BWMBlocks.WOOD_TABLE, woodtype.getMetadata(), new ItemStack(BWMBlocks.WOOD_CORNER, 3, woodtype.getMetadata()));
}
SawManager.WOOD_SAW.addRecipe(new DisplaySawRecipe(Blocks.OAK_DOOR, 0, Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.OAK.getMetadata())), new ItemStack(Items.OAK_DOOR)));
SawManager.WOOD_SAW.addRecipe(new DisplaySawRecipe(Blocks.BIRCH_DOOR, 0, Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.BIRCH.getMetadata())), new ItemStack(Items.BIRCH_DOOR)));
SawManager.WOOD_SAW.addRecipe(new DisplaySawRecipe(Blocks.SPRUCE_DOOR, 0, Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.SPRUCE.getMetadata())), new ItemStack(Items.SPRUCE_DOOR)));
SawManager.WOOD_SAW.addRecipe(new DisplaySawRecipe(Blocks.JUNGLE_DOOR, 0, Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.JUNGLE.getMetadata())), new ItemStack(Items.JUNGLE_DOOR)));
SawManager.WOOD_SAW.addRecipe(new DisplaySawRecipe(Blocks.ACACIA_DOOR, 0, Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.ACACIA.getMetadata())), new ItemStack(Items.ACACIA_DOOR)));
SawManager.WOOD_SAW.addRecipe(new DisplaySawRecipe(Blocks.DARK_OAK_DOOR, 0, Arrays.asList(new ItemStack(BWMBlocks.WOOD_SIDING, 4, BlockPlanks.EnumType.DARK_OAK.getMetadata())), new ItemStack(Items.DARK_OAK_DOOR)));
SawManager.WOOD_SAW.addRecipe(Blocks.OAK_FENCE_GATE, 0, new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.OAK.getMetadata()));
SawManager.WOOD_SAW.addRecipe(Blocks.BIRCH_FENCE_GATE, 0, new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.BIRCH.getMetadata()));
SawManager.WOOD_SAW.addRecipe(Blocks.SPRUCE_FENCE_GATE, 0, new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.SPRUCE.getMetadata()));
SawManager.WOOD_SAW.addRecipe(Blocks.JUNGLE_FENCE_GATE, 0, new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.JUNGLE.getMetadata()));
SawManager.WOOD_SAW.addRecipe(Blocks.ACACIA_FENCE_GATE, 0, new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.ACACIA.getMetadata()));
SawManager.WOOD_SAW.addRecipe(Blocks.DARK_OAK_FENCE_GATE, 0, new ItemStack(BWMBlocks.WOOD_MOULDING, 3, BlockPlanks.EnumType.DARK_OAK.getMetadata()));
}
}
use of net.minecraft.item.EnumDyeColor in project MorePlanets by SteveKunG.
the class EntityEventHandler method onInteractEntity.
@SubscribeEvent
public void onInteractEntity(EntityInteract event) {
ItemStack itemStack = event.getItemStack();
Entity entity = event.getTarget();
if (!itemStack.isEmpty() && itemStack.getItem() == Items.DYE) {
EnumDyeColor color = EnumDyeColor.byDyeDamage(itemStack.getItemDamage() & 15);
if (entity instanceof EntityShlime) {
EntityShlime shlime = (EntityShlime) entity;
if (!shlime.getSheared() && shlime.getFleeceColor() != color) {
shlime.setFleeceColor(color);
if (!event.getEntityPlayer().capabilities.isCreativeMode) {
itemStack.shrink(1);
}
}
event.setResult(Result.ALLOW);
}
}
}
use of net.minecraft.item.EnumDyeColor in project MorePlanets by SteveKunG.
the class ItemDyeMP method itemInteractionForEntity.
@Override
public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer player, EntityLivingBase target, EnumHand hand) {
if (target instanceof EntitySheep) {
EntitySheep entitysheep = (EntitySheep) target;
EnumDyeColor enumdyecolor = EnumDyeColor.BLUE;
if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor) {
entitysheep.setFleeceColor(enumdyecolor);
itemStack.shrink(1);
}
return true;
}
if (target instanceof EntityShlime) {
EntityShlime entitysheep = (EntityShlime) target;
EnumDyeColor enumdyecolor = EnumDyeColor.BLUE;
if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor) {
entitysheep.setFleeceColor(enumdyecolor);
itemStack.shrink(1);
}
return true;
} else {
return false;
}
}
Aggregations