@Override public boolean generate(World worldIn, Random rand, BlockPos position) { BlockPos cur = NeoHellGenerators.findSurface(worldIn, position); if (cur==null) return false; IBlockState norfairite = TWBlocks.NORFAIRITE_CLEAR.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.GREEN); ArrayList<BlockPos> bushArea = new ArrayList<BlockPos>(); NeoHellGenerators.sphereAround(cur.up(), 1.5f + rand.nextFloat(), bushArea); for(BlockPos leaf : bushArea) { IBlockState state = worldIn.getBlockState(leaf); if (state.getBlock().canBeReplacedByLeaves(state, worldIn, leaf)) { worldIn.setBlockState(leaf, norfairite); } } return true; }
/** Recolour the Minecraft block * @param state The block to be recoloured * @param colour The new colour * @return A new blockstate which is a recoloured version of the original */ static IBlockState applyColour(IBlockState state, Colour colour) { for (IProperty prop : (java.util.Set<IProperty>)state.getProperties().keySet()) { if (prop.getName().equals("color") && prop.getValueClass() == net.minecraft.item.EnumDyeColor.class) { net.minecraft.item.EnumDyeColor current = (net.minecraft.item.EnumDyeColor)state.getValue(prop); if (!current.getName().equalsIgnoreCase(colour.name())) { return state.withProperty(prop, EnumDyeColor.valueOf(colour.name())); } } } return state; }
@Override protected void initializeInventories() { super.initializeInventories(); modeList = new LinkedHashMap<>(); EnumDyeColor[] colors = new EnumDyeColor[]{EnumDyeColor.YELLOW, EnumDyeColor.BLUE, EnumDyeColor.GREEN, EnumDyeColor.ORANGE, EnumDyeColor.PURPLE}; for (int i = 0; i < 5; ++i) { ItemStackHandler item = new ItemStackHandler(2); this.addInventory(new CustomColoredItemHandler(item, colors[i], "Material process", 50 + 24 * i, 25, 1, 2) { @Override public boolean canInsertItem(int slot, ItemStack stack) { return false; } }); this.addInventoryToStorage(item, "item" + i); modeList.put(item, Mode.NONE); } }
@Override public void preInit() { super.preInit(); ClientRegistry.bindTileEntitySpecialRenderer(TileTube.class, new TubeItemRenderer()); // Register textures TextureRegistry.registerTexture(ModelTube.TUBE_TEX); TextureRegistry.registerTexture(ModelTube.TUBE_TEX_COL); // Register block models ModelRegistry.registerBlockModel(blockTube, new ModelTube()); // Register item models ModelRegistry.registerItemResourceLoc(blockDisplacer, new ResourceLocation("simpletubes:block_displacer"), 0); ModelRegistry.registerItemModel(blockTube, new ModelTube.TubeItemModel()); ModelRegistry.registerItemResourceLoc(itemPaintbrush, new ResourceLocation("simpletubes:item_paintbrush"), 0); for (int i = 0; i < 16; i++) ModelRegistry.registerItemResourceLoc(itemPaintbrush, new ResourceLocation("simpletubes:item_paintbrush_" + EnumDyeColor.byMetadata(i).getUnlocalizedName()), i + 1); ModelRegistry.registerItemResourceLoc(itemUpgrade, new ResourceLocation("simpletubes:item_upgrade_filter"), 0); MinecraftForge.EVENT_BUS.register(new TextureRegistry()); MinecraftForge.EVENT_BUS.register(new ModelRegistry()); }
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) { if (this.field_143015_k < 0) { this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); if (this.field_143015_k < 0) { return true; } this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); } this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 2, 3, 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 0, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 1, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 2, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.wool.getStateFromMeta(EnumDyeColor.WHITE.getDyeDamage()), 1, 3, 0, structureBoundingBoxIn); boolean flag = this.coordBaseMode == EnumFacing.EAST || this.coordBaseMode == EnumFacing.NORTH; this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), flag ? 2 : 0, 3, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 1, 3, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), flag ? 0 : 2, 3, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 1, 3, -1, structureBoundingBoxIn); return true; }
/** * Attempts to mix both parent sheep to come up with a mixed dye color. */ private EnumDyeColor getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother) { int i = ((EntitySheep)father).getFleeceColor().getDyeDamage(); int j = ((EntitySheep)mother).getFleeceColor().getDyeDamage(); this.inventoryCrafting.getStackInSlot(0).setItemDamage(i); this.inventoryCrafting.getStackInSlot(1).setItemDamage(j); ItemStack itemstack = CraftingManager.getInstance().findMatchingRecipe(this.inventoryCrafting, ((EntitySheep)father).worldObj); int k; if (itemstack != null && itemstack.getItem() == Items.dye) { k = itemstack.getMetadata(); } else { k = this.worldObj.rand.nextBoolean() ? i : j; } return EnumDyeColor.byDyeDamage(k); }
/** * Attempts to mix both parent sheep to come up with a mixed dye color. */ private EnumDyeColor getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother) { int i = ((EntitySheep)father).getFleeceColor().getDyeDamage(); int j = ((EntitySheep)mother).getFleeceColor().getDyeDamage(); this.inventoryCrafting.getStackInSlot(0).setItemDamage(i); this.inventoryCrafting.getStackInSlot(1).setItemDamage(j); ItemStack itemstack = CraftingManager.getInstance().findMatchingRecipe(this.inventoryCrafting, ((EntitySheep)father).world); int k; if (itemstack.getItem() == Items.DYE) { k = itemstack.getMetadata(); } else { k = this.world.rand.nextBoolean() ? i : j; } return EnumDyeColor.byDyeDamage(k); }
/** * Spawns this Block's drops into the World as EntityItems. */ public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { int i = ((Integer)state.getValue(AGE)).intValue(); int j = 1; if (i >= 2) { j = 3; } for (int k = 0; k < j; ++k) { spawnAsEntity(worldIn, pos, new ItemStack(Items.DYE, 1, EnumDyeColor.BROWN.getDyeDamage())); } }
/** * Adds the food recipes to the CraftingManager. */ public void addRecipes(CraftingManager manager) { manager.addShapelessRecipe(new ItemStack(Items.MUSHROOM_STEW), new Object[] {Blocks.BROWN_MUSHROOM, Blocks.RED_MUSHROOM, Items.BOWL}); manager.addRecipe(new ItemStack(Items.COOKIE, 8), new Object[] {"#X#", 'X', new ItemStack(Items.DYE, 1, EnumDyeColor.BROWN.getDyeDamage()), '#', Items.WHEAT}); manager.addRecipe(new ItemStack(Items.RABBIT_STEW), new Object[] {" R ", "CPM", " B ", 'R', new ItemStack(Items.COOKED_RABBIT), 'C', Items.CARROT, 'P', Items.BAKED_POTATO, 'M', Blocks.BROWN_MUSHROOM, 'B', Items.BOWL}); manager.addRecipe(new ItemStack(Items.RABBIT_STEW), new Object[] {" R ", "CPD", " B ", 'R', new ItemStack(Items.COOKED_RABBIT), 'C', Items.CARROT, 'P', Items.BAKED_POTATO, 'D', Blocks.RED_MUSHROOM, 'B', Items.BOWL}); manager.addRecipe(new ItemStack(Blocks.MELON_BLOCK), new Object[] {"MMM", "MMM", "MMM", 'M', Items.MELON}); manager.addRecipe(new ItemStack(Items.BEETROOT_SOUP), new Object[] {"OOO", "OOO", " B ", 'O', Items.BEETROOT, 'B', Items.BOWL}); manager.addRecipe(new ItemStack(Items.MELON_SEEDS), new Object[] {"M", 'M', Items.MELON}); manager.addRecipe(new ItemStack(Items.PUMPKIN_SEEDS, 4), new Object[] {"M", 'M', Blocks.PUMPKIN}); manager.addShapelessRecipe(new ItemStack(Items.PUMPKIN_PIE), new Object[] {Blocks.PUMPKIN, Items.SUGAR, Items.EGG}); manager.addShapelessRecipe(new ItemStack(Items.FERMENTED_SPIDER_EYE), new Object[] {Items.SPIDER_EYE, Blocks.BROWN_MUSHROOM, Items.SUGAR}); manager.addShapelessRecipe(new ItemStack(Items.BLAZE_POWDER, 2), new Object[] {Items.BLAZE_ROD}); manager.addShapelessRecipe(new ItemStack(Items.MAGMA_CREAM), new Object[] {Items.BLAZE_POWDER, Items.SLIME_BALL}); }
public void doRenderLayer(EntityWolf entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) { if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible()) { this.wolfRenderer.bindTexture(WOLF_COLLAR); EnumDyeColor enumdyecolor = EnumDyeColor.byMetadata(entitylivingbaseIn.getCollarColor().getMetadata()); float[] afloat = EntitySheep.func_175513_a(enumdyecolor); GlStateManager.color(afloat[0], afloat[1], afloat[2]); this.wolfRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); } }
@Nullable public ResourceLocation getResourceLocation(String id, List<BannerPattern> patternList, List<EnumDyeColor> colorList) { if (id.isEmpty()) { return null; } else { id = this.cacheId + id; BannerTextures.CacheEntry bannertextures$cacheentry = (BannerTextures.CacheEntry)this.cacheMap.get(id); if (bannertextures$cacheentry == null) { if (this.cacheMap.size() >= 256 && !this.freeCacheSlot()) { return BannerTextures.BANNER_BASE_TEXTURE; } List<String> list = Lists.<String>newArrayList(); for (BannerPattern bannerpattern : patternList) { list.add(this.cacheResourceBase + bannerpattern.func_190997_a() + ".png"); } bannertextures$cacheentry = new BannerTextures.CacheEntry(); bannertextures$cacheentry.textureLocation = new ResourceLocation(id); Minecraft.getMinecraft().getTextureManager().loadTexture(bannertextures$cacheentry.textureLocation, new LayeredColorMaskTexture(this.cacheResourceLocation, list, colorList)); this.cacheMap.put(id, bannertextures$cacheentry); } bannertextures$cacheentry.lastUseMillis = System.currentTimeMillis(); return bannertextures$cacheentry.textureLocation; } }
public TextElementFormat(String fmt) { if (!fmt.isEmpty()) { String[] split = StringUtils.split(fmt, ','); for (String s : split) { if (s.length() == 1 && Character.isDigit(s.charAt(0))) { scale = 0.5f + ((fmt.charAt(0) - '0')) * .4f; } else if ("left".equals(s) || "l".equals(s)) { align = -1; } else if ("center".equals(s) || "c".equals(s)) { align = 0; } else if ("right".equals(s) || "r".equals(s)) { align = 1; } else if ("top".equals(s) || "t".equals(s)) { valign = -1; } else if ("vcenter".equals(s) || "vc".equals(s)) { valign = 0; } else if ("bottom".equals(s) || "b".equals(s)) { valign = 1; } else if ("bold".equals(s)) { bold = true; } else if ("italic".equals(s)) { italic = true; } else { try { color = EnumDyeColor.valueOf(s.toUpperCase()); } catch (IllegalArgumentException e) { Lector.logger.log(Level.WARN, "Bad format for text: '" + fmt + "'!"); } } } } }
/** * Adds the food recipes to the CraftingManager. */ public void addRecipes(CraftingManager p_77608_1_) { p_77608_1_.addShapelessRecipe(new ItemStack(Items.mushroom_stew), new Object[] {Blocks.brown_mushroom, Blocks.red_mushroom, Items.bowl}); p_77608_1_.addRecipe(new ItemStack(Items.cookie, 8), new Object[] {"#X#", 'X', new ItemStack(Items.dye, 1, EnumDyeColor.BROWN.getDyeDamage()), '#', Items.wheat}); p_77608_1_.addRecipe(new ItemStack(Items.rabbit_stew), new Object[] {" R ", "CPM", " B ", 'R', new ItemStack(Items.cooked_rabbit), 'C', Items.carrot, 'P', Items.baked_potato, 'M', Blocks.brown_mushroom, 'B', Items.bowl}); p_77608_1_.addRecipe(new ItemStack(Items.rabbit_stew), new Object[] {" R ", "CPD", " B ", 'R', new ItemStack(Items.cooked_rabbit), 'C', Items.carrot, 'P', Items.baked_potato, 'D', Blocks.red_mushroom, 'B', Items.bowl}); p_77608_1_.addRecipe(new ItemStack(Blocks.melon_block), new Object[] {"MMM", "MMM", "MMM", 'M', Items.melon}); p_77608_1_.addRecipe(new ItemStack(Items.melon_seeds), new Object[] {"M", 'M', Items.melon}); p_77608_1_.addRecipe(new ItemStack(Items.pumpkin_seeds, 4), new Object[] {"M", 'M', Blocks.pumpkin}); p_77608_1_.addShapelessRecipe(new ItemStack(Items.pumpkin_pie), new Object[] {Blocks.pumpkin, Items.sugar, Items.egg}); p_77608_1_.addShapelessRecipe(new ItemStack(Items.fermented_spider_eye), new Object[] {Items.spider_eye, Blocks.brown_mushroom, Items.sugar}); p_77608_1_.addShapelessRecipe(new ItemStack(Items.blaze_powder, 2), new Object[] {Items.blaze_rod}); p_77608_1_.addShapelessRecipe(new ItemStack(Items.magma_cream), new Object[] {Items.blaze_powder, Items.slime_ball}); }
private void func_190702_g(ItemStack p_190702_1_) { if (this.func_190682_f(p_190702_1_)) { this.func_190711_a(EnumDyeColor.byMetadata(p_190702_1_.getMetadata())); } else { this.func_190711_a((EnumDyeColor)null); } }
@Override public List<IGuiContainerPiece> getGuiContainerPieces(BasicTeslaGuiContainer container) { List<IGuiContainerPiece> pieces = super.getGuiContainerPieces(container); pieces.add(new BioreactorEfficiencyInfoPiece(this, 149, 25)); pieces.add(1, new LockedInventoryTogglePiece(18 * 7 + 9, 83, this, EnumDyeColor.BLUE)); return pieces; }
public static List<BlockShulkerBox> getShulkerBoxes() { if (SHULKER_BOXES.isEmpty()) { for (EnumDyeColor color : EnumDyeColor.values()) { SHULKER_BOXES.add((BlockShulkerBox) BlockShulkerBox.getBlockByColor(color)); } } return SHULKER_BOXES; }
@Override protected void initializeInventories() { super.initializeInventories(); List<EnumFacing> facings = new ArrayList<>(); facings.addAll(Arrays.asList(EnumFacing.values())); Arrays.stream(EnumDyeColor.values()).forEach(enumDyeColor -> this.getSideConfig().setSidesForColor(enumDyeColor, facings)); }
@Override protected void innerUpdate() { if (this.world.isRemote) return; if (++tick <= 4) return; for (EnumFacing facing : this.getSideConfig().getSidesForColor(EnumDyeColor.ORANGE)) { facing = this.orientFacing(facing).getOpposite(); BlockPos side = this.pos.offset(facing); if (this.world.getTileEntity(side) != null && this.world.getTileEntity(side).hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing.getOpposite())) { TileEntity tileEntity = this.world.getTileEntity(side); IItemHandler handler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing.getOpposite()); for (int i = 0; i < handler.getSlots(); ++i) { if (!handler.getStackInSlot(i).isEmpty() && (handler.getStackInSlot(i).getCount() >= size || handler.getStackInSlot(i).getCount() >= handler.getStackInSlot(i).getMaxStackSize())) continue; ItemStack handlerStack = handler.getStackInSlot(i); ItemStack posible = ItemStack.EMPTY; boolean hasWorked = false; for (int x = 0; x < input.getSlots(); ++x) { if (!input.getStackInSlot(x).isEmpty() && (handlerStack.isEmpty() || input.getStackInSlot(x).isItemEqual(handlerStack))) { posible = input.getStackInSlot(x); if (!posible.isEmpty()) { ItemStack def = posible.copy(); def.setCount(1); def = handler.insertItem(i, def, false); if (def.isEmpty()) posible.shrink(1); else continue; hasWorked = true; break; } } } if (hasWorked) break; } } } tick = 0; }
@Override protected void initializeInventories() { super.initializeInventories(); tank = this.addSimpleFluidTank(8000, "tank", EnumDyeColor.BLUE, 18, 25, FluidTankType.BOTH, fluidStack -> true, fluidStack -> true); crafting = (LockableItemHandler) this.addSimpleInventory(9, "crafting", EnumDyeColor.GREEN, "crafting", new BoundingRectangle(58, 25, 18 * 3, 18 * 3), (stack, integer) -> true, (stack, integer) -> false, true, null); output = (ItemStackHandler) this.addSimpleInventory(1, "output", EnumDyeColor.ORANGE, "output", new BoundingRectangle(58 + 18 * 5, 25 + 18, 18, 18), (stack, integer) -> false, (stack, integer) -> true, false, null); tick = 0; }
/** * (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); this.setSheared(compound.getBoolean("Sheared")); this.setFleeceColor(EnumDyeColor.byMetadata(compound.getByte("Color"))); }
public static Optional<EnumDyeColor> getDyeColor(ItemStack stack) { for (int oreId : OreDictionary.getOreIDs(stack)) { String name = OreDictionary.getOreName(oreId); if (name.startsWith("blockWool")) { name = name.substring(9, name.length()); return Optional.of(EnumDyeColor.valueOf(name)); } } return Optional.empty(); }
/** * Establishes all of the basic properties for the banner. This will also apply the data from the tile entities nbt * tag compounds. */ private void initializeBannerData() { if (this.patternList == null || this.colorList == null || this.patternResourceLocation == null) { if (!this.field_175119_g) { this.patternResourceLocation = ""; } else { this.patternList = Lists.<TileEntityBanner.EnumBannerPattern>newArrayList(); this.colorList = Lists.<EnumDyeColor>newArrayList(); this.patternList.add(TileEntityBanner.EnumBannerPattern.BASE); this.colorList.add(EnumDyeColor.byDyeDamage(this.baseColor)); this.patternResourceLocation = "b" + this.baseColor; if (this.patterns != null) { for (int i = 0; i < this.patterns.tagCount(); ++i) { NBTTagCompound nbttagcompound = this.patterns.getCompoundTagAt(i); TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound.getString("Pattern")); if (tileentitybanner$enumbannerpattern != null) { this.patternList.add(tileentitybanner$enumbannerpattern); int j = nbttagcompound.getInteger("Color"); this.colorList.add(EnumDyeColor.byDyeDamage(j)); this.patternResourceLocation = this.patternResourceLocation + tileentitybanner$enumbannerpattern.getPatternID() + j; } } } } } }
/** * (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); this.setAngry(compound.getBoolean("Angry")); if (compound.hasKey("CollarColor", 99)) { this.setCollarColor(EnumDyeColor.byDyeDamage(compound.getByte("CollarColor"))); } }
/** * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */ public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) { for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { list.add(new ItemStack(itemIn, 1, enumdyecolor.getMetadata())); } }
/** * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */ public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) { for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { list.add(new ItemStack(itemIn, 1, enumdyecolor.getMetadata())); } }
protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(18, new Float(this.getHealth())); this.dataWatcher.addObject(19, new Byte((byte)0)); this.dataWatcher.addObject(20, new Byte((byte)EnumDyeColor.RED.getMetadata())); }
/** * Adds the crafting recipes to the CraftingManager. */ public void addRecipes(CraftingManager p_77589_1_) { p_77589_1_.addRecipe(new ItemStack(Blocks.chest), new Object[] {"###", "# #", "###", '#', Blocks.planks}); p_77589_1_.addRecipe(new ItemStack(Blocks.trapped_chest), new Object[] {"#-", '#', Blocks.chest, '-', Blocks.tripwire_hook}); p_77589_1_.addRecipe(new ItemStack(Blocks.ender_chest), new Object[] {"###", "#E#", "###", '#', Blocks.obsidian, 'E', Items.ender_eye}); p_77589_1_.addRecipe(new ItemStack(Blocks.furnace), new Object[] {"###", "# #", "###", '#', Blocks.cobblestone}); p_77589_1_.addRecipe(new ItemStack(Blocks.crafting_table), new Object[] {"##", "##", '#', Blocks.planks}); p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.SAND.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.RED_SAND.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 4, BlockSandStone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.DEFAULT.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 4, BlockRedSandstone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.DEFAULT.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SAND.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab2, 1, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.QUARTZ.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 2, BlockQuartz.EnumType.LINES_Y.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.DEFAULT.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 4), new Object[] {"##", "##", '#', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.CHISELED_META), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata())}); p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.MOSSY_META), new Object[] {Blocks.stonebrick, Blocks.vine}); p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.mossy_cobblestone, 1), new Object[] {Blocks.cobblestone, Blocks.vine}); p_77589_1_.addRecipe(new ItemStack(Blocks.iron_bars, 16), new Object[] {"###", "###", '#', Items.iron_ingot}); p_77589_1_.addRecipe(new ItemStack(Blocks.glass_pane, 16), new Object[] {"###", "###", '#', Blocks.glass}); p_77589_1_.addRecipe(new ItemStack(Blocks.redstone_lamp, 1), new Object[] {" R ", "RGR", " R ", 'R', Items.redstone, 'G', Blocks.glowstone}); p_77589_1_.addRecipe(new ItemStack(Blocks.beacon, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Blocks.glass, 'S', Items.nether_star, 'O', Blocks.obsidian}); p_77589_1_.addRecipe(new ItemStack(Blocks.nether_brick, 1), new Object[] {"NN", "NN", 'N', Items.netherbrick}); p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.DIORITE.getMetadata()), new Object[] {"CQ", "QC", 'C', Blocks.cobblestone, 'Q', Items.quartz}); p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Items.quartz}); p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.ANDESITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Blocks.cobblestone}); p_77589_1_.addRecipe(new ItemStack(Blocks.dirt, 4, BlockDirt.DirtType.COARSE_DIRT.getMetadata()), new Object[] {"DG", "GD", 'D', new ItemStack(Blocks.dirt, 1, BlockDirt.DirtType.DIRT.getMetadata()), 'G', Blocks.gravel}); p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.DIORITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.GRANITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.ANDESITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.ANDESITE.getMetadata())}); p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.ROUGH_META), new Object[] {"SS", "SS", 'S', Items.prismarine_shard}); p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.BRICKS_META), new Object[] {"SSS", "SSS", "SSS", 'S', Items.prismarine_shard}); p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.DARK_META), new Object[] {"SSS", "SIS", "SSS", 'S', Items.prismarine_shard, 'I', new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage())}); p_77589_1_.addRecipe(new ItemStack(Blocks.sea_lantern, 1, 0), new Object[] {"SCS", "CCC", "SCS", 'S', Items.prismarine_shard, 'C', Items.prismarine_crystals}); }
/** * (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound tagCompund) { super.readEntityFromNBT(tagCompund); this.setSheared(tagCompund.getBoolean("Sheared")); this.setFleeceColor(EnumDyeColor.byMetadata(tagCompund.getByte("Color"))); }
private FurnaceRecipes() { this.addSmeltingRecipeForBlock(Blocks.iron_ore, new ItemStack(Items.iron_ingot), 0.7F); this.addSmeltingRecipeForBlock(Blocks.gold_ore, new ItemStack(Items.gold_ingot), 1.0F); this.addSmeltingRecipeForBlock(Blocks.diamond_ore, new ItemStack(Items.diamond), 1.0F); this.addSmeltingRecipeForBlock(Blocks.sand, new ItemStack(Blocks.glass), 0.1F); this.addSmelting(Items.porkchop, new ItemStack(Items.cooked_porkchop), 0.35F); this.addSmelting(Items.beef, new ItemStack(Items.cooked_beef), 0.35F); this.addSmelting(Items.chicken, new ItemStack(Items.cooked_chicken), 0.35F); this.addSmelting(Items.rabbit, new ItemStack(Items.cooked_rabbit), 0.35F); this.addSmelting(Items.mutton, new ItemStack(Items.cooked_mutton), 0.35F); this.addSmeltingRecipeForBlock(Blocks.cobblestone, new ItemStack(Blocks.stone), 0.1F); this.addSmeltingRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.DEFAULT_META), new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.CRACKED_META), 0.1F); this.addSmelting(Items.clay_ball, new ItemStack(Items.brick), 0.3F); this.addSmeltingRecipeForBlock(Blocks.clay, new ItemStack(Blocks.hardened_clay), 0.35F); this.addSmeltingRecipeForBlock(Blocks.cactus, new ItemStack(Items.dye, 1, EnumDyeColor.GREEN.getDyeDamage()), 0.2F); this.addSmeltingRecipeForBlock(Blocks.log, new ItemStack(Items.coal, 1, 1), 0.15F); this.addSmeltingRecipeForBlock(Blocks.log2, new ItemStack(Items.coal, 1, 1), 0.15F); this.addSmeltingRecipeForBlock(Blocks.emerald_ore, new ItemStack(Items.emerald), 1.0F); this.addSmelting(Items.potato, new ItemStack(Items.baked_potato), 0.35F); this.addSmeltingRecipeForBlock(Blocks.netherrack, new ItemStack(Items.netherbrick), 0.1F); this.addSmeltingRecipe(new ItemStack(Blocks.sponge, 1, 1), new ItemStack(Blocks.sponge, 1, 0), 0.15F); for (ItemFishFood.FishType itemfishfood$fishtype : ItemFishFood.FishType.values()) { if (itemfishfood$fishtype.canCook()) { this.addSmeltingRecipe(new ItemStack(Items.fish, 1, itemfishfood$fishtype.getMetadata()), new ItemStack(Items.cooked_fish, 1, itemfishfood$fishtype.getMetadata()), 0.35F); } } this.addSmeltingRecipeForBlock(Blocks.coal_ore, new ItemStack(Items.coal), 0.1F); this.addSmeltingRecipeForBlock(Blocks.redstone_ore, new ItemStack(Items.redstone), 0.7F); this.addSmeltingRecipeForBlock(Blocks.lapis_ore, new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), 0.2F); this.addSmeltingRecipeForBlock(Blocks.quartz_ore, new ItemStack(Items.quartz), 0.2F); }
/** * Adds the banner recipes to the CraftingManager. */ void addRecipes(CraftingManager p_179534_1_) { for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) { p_179534_1_.addRecipe(new ItemStack(Items.banner, 1, enumdyecolor.getDyeDamage()), new Object[] {"###", "###", " | ", '#', new ItemStack(Blocks.wool, 1, enumdyecolor.getMetadata()), '|', Items.stick}); } p_179534_1_.addRecipe(new RecipesBanners.RecipeDuplicatePattern()); p_179534_1_.addRecipe(new RecipesBanners.RecipeAddPattern()); }
protected void func_190868_j() { EntitySheep entitysheep = EntityEvoker.this.func_190751_dj(); if (entitysheep != null && entitysheep.isEntityAlive()) { entitysheep.setFleeceColor(EnumDyeColor.RED); } }
/** * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */ public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) { for (int i = 0; i < EnumDyeColor.values().length; ++i) { list.add(new ItemStack(itemIn, 1, i)); } }
public void doRenderLayer(EntitySheep entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) { if (!entitylivingbaseIn.getSheared() && !entitylivingbaseIn.isInvisible()) { this.sheepRenderer.bindTexture(TEXTURE); if (entitylivingbaseIn.hasCustomName() && "jeb_".equals(entitylivingbaseIn.getCustomNameTag())) { int i1 = 25; int i = entitylivingbaseIn.ticksExisted / 25 + entitylivingbaseIn.getEntityId(); int j = EnumDyeColor.values().length; int k = i % j; int l = (i + 1) % j; float f = ((float)(entitylivingbaseIn.ticksExisted % 25) + partialTicks) / 25.0F; float[] afloat1 = EntitySheep.func_175513_a(EnumDyeColor.byMetadata(k)); float[] afloat2 = EntitySheep.func_175513_a(EnumDyeColor.byMetadata(l)); GlStateManager.color(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f); } else { float[] afloat = EntitySheep.func_175513_a(entitylivingbaseIn.getFleeceColor()); GlStateManager.color(afloat[0], afloat[1], afloat[2]); } this.sheepModel.setModelAttributes(this.sheepRenderer.getMainModel()); this.sheepModel.setLivingAnimations(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks); this.sheepModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); } }