@Override public String getHeartTexture() { return "forestry:blocks/wood/heart." + getName(); } }
@Override public int getMetadata() { return ordinal(); }
@Override public String getName() { return toString(); }
@Override public EnumForestryWoodType getWoodType(int meta) { int variantCount = getVariant().getAllowedValues().size(); int variantMeta = (meta % variantCount) + getBlockNumber() * VARIANTS_PER_BLOCK; return EnumForestryWoodType.byMetadata(variantMeta); } }
@Override public void addMerchantRecipe(IMerchant p_190888_1_, MerchantRecipeList recipeList, Random random) { int i = 1; if (this.sellInfo != null) { i = this.sellInfo.getPrice(random); } int j = 1; if (this.emeraldPriceInfo != null) { j = this.emeraldPriceInfo.getPrice(random); } EnumForestryWoodType woodType = EnumForestryWoodType.getRandom(random); ItemStack sellStack = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, false); sellStack.setCount(i); ItemStack emeralds = new ItemStack(Items.EMERALD, j); recipeList.add(new MerchantRecipe(emeralds, sellStack)); } }
@Override public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { int meta = getMetaFromState(blockState); EnumForestryWoodType woodType = getWoodType(meta); return woodType.getHardness(); }
@Override public EnumForestryWoodType getWoodType(int meta) { int variantCount = getVariant().getAllowedValues().size(); int variantMeta = (meta % variantCount) + getBlockNumber() * VARIANTS_PER_BLOCK; return EnumForestryWoodType.byMetadata(variantMeta); } }
@Override public void addMerchantRecipe(IMerchant p_190888_1_, MerchantRecipeList recipeList, Random random) { int i = 1; if (this.sellInfo != null) { i = this.sellInfo.getPrice(random); } int j = 1; if (this.emeraldPriceInfo != null) { j = this.emeraldPriceInfo.getPrice(random); } EnumForestryWoodType woodType = EnumForestryWoodType.getRandom(random); ItemStack sellStack = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.PLANKS, false); sellStack.setCount(i); ItemStack emeralds = new ItemStack(Items.EMERALD, j); recipeList.add(new MerchantRecipe(emeralds, sellStack)); } }
@Override public String getDoorUpperTexture() { return "forestry:blocks/doors/" + getName() + "_upper"; }
@Override public EnumForestryWoodType getWoodType(int meta) { int variantCount = getVariant().getAllowedValues().size(); int variantMeta = (meta % variantCount) + getBlockNumber() * VARIANTS_PER_BLOCK; return EnumForestryWoodType.byMetadata(variantMeta); } }
public Materials(Random random) { IWoodType woodType; boolean fireproof; if (ModuleHelper.isEnabled(ForestryModuleUids.ARBORICULTURE)) { woodType = EnumForestryWoodType.getRandom(random); fireproof = random.nextInt(4) == 0; } else { woodType = EnumVanillaWoodType.getRandom(random); fireproof = false; } IWoodAccess woodAccess = TreeManager.woodAccess; this.logs = woodAccess.getBlock(woodType, WoodBlockKind.LOG, fireproof).withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X); this.planks = woodAccess.getBlock(woodType, WoodBlockKind.PLANKS, fireproof); this.slabs = woodAccess.getBlock(woodType, WoodBlockKind.SLAB, fireproof); this.stairs = woodAccess.getBlock(woodType, WoodBlockKind.STAIRS, fireproof); this.fence = woodAccess.getBlock(woodType, WoodBlockKind.FENCE, fireproof); this.door = woodAccess.getBlock(woodType, WoodBlockKind.DOOR, false); this.fenceGate = woodAccess.getBlock(woodType, WoodBlockKind.FENCE_GATE, fireproof); } }
public WoodProvider(EnumForestryWoodType woodType) { this.name = woodType.toString().toLowerCase(Locale.ENGLISH); this.woodType = woodType; }
@Override public String getPlankTexture() { return "forestry:blocks/wood/planks." + getName(); }
@Override public EnumForestryWoodType getWoodType(int meta) { meta &= ~8; // unset the top/bottom slab bit int variantCount = getVariant().getAllowedValues().size(); int variantMeta = (meta % variantCount) + getBlockNumber() * VARIANTS_PER_BLOCK; return EnumForestryWoodType.byMetadata(variantMeta); } }
@Override public String getDoorLowerTexture() { return "forestry:blocks/doors/" + getName() + "_lower"; }
@Override public String getBarkTexture() { return "forestry:blocks/wood/bark." + getName(); }