case SLAB: case STAIRS: String textureLocation = type.getPlankTexture(); textures.put("particle", textureLocation); textures.put("side", textureLocation); break; case PLANKS: textures.put("particle", type.getPlankTexture()); textures.put("all", type.getPlankTexture()); break; case FENCE_GATE: case FENCE: textures.put("particle", type.getPlankTexture()); textures.put("side", type.getPlankTexture()); textures.put("texture", type.getPlankTexture()); break; case DOOR: textures.put("particle", type.getDoorLowerTexture()); textures.put("bottom", type.getDoorLowerTexture()); textures.put("top", type.getDoorUpperTexture()); break; case LOG: textures.put("particle", type.getBarkTexture()); textures.put("side", type.getBarkTexture()); textures.put("all", type.getBarkTexture()); textures.put("end", type.getHeartTexture()); break; default:
@Override public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { int meta = getMetaFromState(blockState); T woodType = getWoodType(meta); return woodType.getHardness(); }
@Override public boolean apply(@Nullable IWoodType woodType) { return woodType != null && woodType.getMetadata() >= minWoodTypeMeta && woodType.getMetadata() <= maxWoodTypeMeta; } }
@Override @SideOnly(Side.CLIENT) public void registerSprites(Item item, ITextureManager manager) { TextureMap textureMap = FMLClientHandler.instance().getClient().getTextureMapBlocks(); trunk = textureMap.registerSprite(new ResourceLocation(type.getHeartTexture())); bark = textureMap.registerSprite(new ResourceLocation(type.getBarkTexture())); }
@Nullable private static WoodTexture getTexture(IWoodType woodType) { String woodName = woodType.getName(); woodName = woodName.toLowerCase(Locale.ENGLISH); return WOOD_TEXTURES.get(woodName); }
planks.setCount(4); logs.setCount(1); RecipeUtil.addShapelessRecipe("planks_" + woodType.getName(), planks.copy(), logs.copy()); RecipeUtil.addRecipe("slabs_" + woodType.getName(), slabs.copy(), "###", '#', planks.copy()); RecipeUtil.addRecipe("fences_" + woodType.getName(), fences.copy(), "#X#", "#X#", RecipeUtil.addRecipe("fence_gates_" + woodType.getName(), fenceGates.copy(), "X#X", "X#X", RecipeUtil.addRecipe("stairs_" + woodType.getName(), stairs.copy(), "# ", "## ", RecipeUtil.addRecipe("doors_" + woodType.getName(), doors.copy(), "## ", "## ", RecipeUtil.addShapelessRecipe("fireproof_planks_" + woodType.getName(), fireproofPlanks.copy(), fireproofLogs.copy()); RecipeUtil.addRecipe("fireproof_slabs_" + woodType.getName(), fireproofSlabs.copy(), "###", '#', fireproofPlanks.copy()); RecipeUtil.addRecipe("fireproof_fences_" + woodType.getName(), fireproofFences.copy(),
switch (texture) { case "plank": texture = woodType.getPlankTexture(); break; case "bark": texture = woodType.getBarkTexture(); break; case "heart": texture = woodType.getHeartTexture(); break; case "doorUp": texture = woodType.getDoorUpperTexture(); break; case "doorLow": texture = woodType.getDoorLowerTexture(); break; default: texuresBuilder.put(location.getKey(), texture.replace("%woodType", woodType.getName().toLowerCase(Locale.ENGLISH))); continue;
@Override public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { int meta = getMetaFromState(blockState); T woodType = getWoodType(meta); return woodType.getHardness(); }
@Override public int damageDropped(IBlockState state) { T woodType = state.getValue(getVariant()); return woodType.getMetadata() - blockNumber * VARIANTS_PER_BLOCK; }
@SubscribeEvent @SideOnly(Side.CLIENT) public void registerSprites(TextureStitchEvent.Pre event) { TextureLeaves.registerAllSprites(); WoodTextureManager.parseFile(); for (IAlleleFruit alleleFruit : AlleleFruits.getFruitAlleles()) { alleleFruit.getProvider().registerSprites(); } List<ResourceLocation> textures = new ArrayList<>(); for (IWoodType type : TreeManager.woodAccess.getRegisteredWoodTypes()) { textures.add(new ResourceLocation(type.getHeartTexture())); textures.add(new ResourceLocation(type.getBarkTexture())); textures.add(new ResourceLocation(type.getDoorLowerTexture())); textures.add(new ResourceLocation(type.getDoorUpperTexture())); textures.add(new ResourceLocation(type.getPlankTexture())); for (WoodBlockKind kind : WoodBlockKind.values()) { for (Entry<String, String> loc : WoodTextureManager.getTextures(type, kind).entrySet()) { textures.add(new ResourceLocation(loc.getValue())); } } } for (ResourceLocation loc : textures) { TextureManagerForestry.registerSprite(loc); } }
@Override public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { int meta = getMetaFromState(blockState); T woodType = getWoodType(meta); return woodType.getHardness(); }
@Override public int damageDropped(IBlockState state) { return state.getValue(getVariant()).getMetadata() - blockNumber * VARIANTS_PER_BLOCK; }
@Override public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { int meta = getMetaFromState(blockState); T woodType = getWoodType(meta); return woodType.getHardness(); }
@Override public int damageDropped(IBlockState state) { return state.getValue(getVariant()).getMetadata() - blockNumber * VARIANTS_PER_BLOCK; }
@Override public final float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { int meta = getMetaFromState(blockState); T woodType = getWoodType(meta); return woodType.getHardness(); }
@Override public final int damageDropped(IBlockState state) { return state.getValue(getVariant()).getMetadata() - blockNumber * VARIANTS_PER_BLOCK; }
@Override public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { int meta = getMetaFromState(blockState); T woodType = getWoodType(meta); return woodType.getHardness(); }