mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-17 11:05:32 +00:00
Improve wood blocks
This commit is contained in:
1 parent
3ed915f9d5
commit
a990ce3dc9
33 files changed
+465
-1604
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ mcversion=1.10.2
|
||||
forgeversion=12.18.2.2114
|
||||
mcp_mappings=snapshot_20160525
|
||||
|
||||
forestry_version=5.2.17.353
|
||||
forestry_version=5.2.17.355
|
||||
|
||||
version_major=2
|
||||
version_minor=0
|
||||
|
||||
@@ -7,7 +7,7 @@ import binnie.botany.api.IFlower;
|
||||
import binnie.botany.api.gardening.IBlockSoil;
|
||||
import binnie.botany.ceramic.BlockCeramic;
|
||||
import binnie.botany.ceramic.BlockCeramicPatterned;
|
||||
import binnie.botany.ceramic.BlockStained;
|
||||
import binnie.botany.ceramic.BlockStainedGlass;
|
||||
import binnie.botany.ceramic.brick.BlockCeramicBrick;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.core.BotanyGUI;
|
||||
@@ -90,7 +90,7 @@ public class Botany extends AbstractMod {
|
||||
public static ItemClay clay;
|
||||
public static BlockCeramic ceramic;
|
||||
public static BlockCeramicPatterned ceramicTile;
|
||||
public static BlockStained stained;
|
||||
public static BlockStainedGlass stained;
|
||||
public static BlockCeramicBrick ceramicBrick;
|
||||
|
||||
public static final float AGE_CHANCE = 0.2f;
|
||||
|
||||
+26
-6
@@ -2,10 +2,11 @@ package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.core.util.TileUtil;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -24,11 +25,13 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockStained extends Block implements IBlockMetadata, IColoredBlock {
|
||||
public BlockStained() {
|
||||
public class BlockStainedGlass extends Block implements IBlockMetadata, IColoredBlock {
|
||||
public BlockStainedGlass() {
|
||||
super(Material.GLASS);
|
||||
this.setCreativeTab(CreativeTabBotany.instance);
|
||||
this.setRegistryName("stained");
|
||||
@@ -55,17 +58,34 @@ public class BlockStained extends Block implements IBlockMetadata, IColoredBlock
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
Block block2 = blockAccess.getBlockState(pos.offset(side)).getBlock();
|
||||
Block block3 = blockAccess.getBlockState(pos).getBlock();
|
||||
return block3 != this && block3 != ExtraTrees.blockStained && super.shouldSideBeRendered(blockState, blockAccess, pos, side);
|
||||
return true/*block3 != this && block3 != ExtraTrees.blockStained && super.shouldSideBeRendered(blockState, blockAccess, pos, side)*/;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, pos);
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, pos);
|
||||
if (tile != null && !tile.hasDroppedBlock()) {
|
||||
int meta = getDroppedMeta(getMetaFromState(state), tile.getTileMetadata());
|
||||
list.add(TileEntityMetadata.getItemStack(this, meta));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, pos);
|
||||
List<ItemStack> drops = new ArrayList<>();
|
||||
TileCeramic ceramic = TileUtil.getTile(world, pos, TileCeramic.class);
|
||||
if (ceramic != null) {
|
||||
drops = Collections.singletonList(ceramic.getStack());
|
||||
}
|
||||
boolean hasBeenBroken = world.setBlockToAir(pos);
|
||||
if (hasBeenBroken && BinnieCore.proxy.isSimulating(world) && drops.size() > 0 && (player == null || !player.capabilities.isCreativeMode)) {
|
||||
for (ItemStack drop : drops) {
|
||||
spawnAsEntity(world, pos, drop);
|
||||
}
|
||||
}
|
||||
return hasBeenBroken;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -10,9 +10,6 @@ import binnie.botany.api.gardening.IBlockSoil;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDirt;
|
||||
import net.minecraft.block.BlockGrass;
|
||||
import net.minecraft.block.BlockGrassPath;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
@@ -57,7 +54,8 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
switch (side){
|
||||
case UP:
|
||||
@@ -77,11 +75,13 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister {
|
||||
/**
|
||||
* Used to determine ambient occlusion and culling when rebuilding chunks for render
|
||||
*/
|
||||
public boolean isOpaqueCube(IBlockState state){
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state){
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isFullCube(IBlockState state){
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.ceramic.BlockCeramic;
|
||||
import binnie.botany.ceramic.BlockCeramicPatterned;
|
||||
import binnie.botany.ceramic.BlockStained;
|
||||
import binnie.botany.ceramic.BlockStainedGlass;
|
||||
import binnie.botany.ceramic.CeramicTileRecipe;
|
||||
import binnie.botany.ceramic.ItemCeramic;
|
||||
import binnie.botany.ceramic.PigmentRecipe;
|
||||
@@ -47,26 +47,20 @@ public class ModuleGardening implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
Botany.proxy.registerBlock(Botany.plant = new BlockPlant());
|
||||
Botany.proxy.registerItem(new ItemWeed(Botany.plant).setRegistryName(Botany.plant.getRegistryName()));
|
||||
Botany.plant = new BlockPlant();
|
||||
Botany.proxy.registerBlock(Botany.plant, new ItemWeed(Botany.plant));
|
||||
Botany.soil = new BlockSoil(EnumSoilType.SOIL, "soil", false);
|
||||
Botany.proxy.registerBlock(Botany.soil);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.soil).setRegistryName(Botany.soil.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.soil, new ItemSoil(Botany.soil));
|
||||
Botany.loam = new BlockSoil(EnumSoilType.LOAM, "loam", false);
|
||||
Botany.proxy.registerBlock(Botany.loam);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.loam).setRegistryName(Botany.loam.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.loam, new ItemSoil(Botany.loam));
|
||||
Botany.flowerbed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbed", false);
|
||||
Botany.proxy.registerBlock(Botany.flowerbed);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.flowerbed).setRegistryName(Botany.flowerbed.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.flowerbed, new ItemSoil(Botany.flowerbed));
|
||||
Botany.soilNoWeed = new BlockSoil(EnumSoilType.SOIL, "soilNoWeed", true);
|
||||
Botany.proxy.registerBlock(Botany.soilNoWeed);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.soilNoWeed).setRegistryName(Botany.soilNoWeed.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.soilNoWeed, new ItemSoil(Botany.soilNoWeed));
|
||||
Botany.loamNoWeed = new BlockSoil(EnumSoilType.LOAM, "loamNoWeed", true);
|
||||
Botany.proxy.registerBlock(Botany.loamNoWeed);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.loamNoWeed).setRegistryName(Botany.loamNoWeed.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.loamNoWeed, new ItemSoil(Botany.loamNoWeed));
|
||||
Botany.flowerbedNoWeed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbedNoWeed", true);
|
||||
Botany.proxy.registerBlock(Botany.flowerbedNoWeed);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.flowerbedNoWeed).setRegistryName(Botany.flowerbedNoWeed.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.flowerbedNoWeed, new ItemSoil(Botany.flowerbedNoWeed));
|
||||
Botany.soilMeter = new ItemSoilMeter();
|
||||
Botany.proxy.registerItem(Botany.soilMeter);
|
||||
Botany.insulatedTube = new ItemInsulatedTube();
|
||||
@@ -88,20 +82,16 @@ public class ModuleGardening implements IInitializable {
|
||||
Botany.clay = new ItemClay();
|
||||
Botany.proxy.registerItem(Botany.clay);
|
||||
Botany.ceramic = new BlockCeramic();
|
||||
Botany.proxy.registerBlock(Botany.ceramic);
|
||||
Botany.proxy.registerItem(new ItemCeramic(Botany.ceramic).setRegistryName(Botany.ceramic.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.ceramic, new ItemCeramic(Botany.ceramic));
|
||||
BinnieCore.proxy.registerTileEntity(TileCeramic.class, "botany.tile.ceramic");
|
||||
// BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramic), new ItemMetadataRenderer());
|
||||
Botany.stained = new BlockStained();
|
||||
Botany.proxy.registerBlock(Botany.stained);
|
||||
Botany.proxy.registerItem(new ItemMetadata(Botany.stained).setRegistryName(Botany.stained.getRegistryName()));
|
||||
Botany.stained = new BlockStainedGlass();
|
||||
Botany.proxy.registerBlock(Botany.stained, new ItemMetadata(Botany.stained));
|
||||
// BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.stained), new ItemMetadataRenderer());
|
||||
Botany.ceramicTile = new BlockCeramicPatterned();
|
||||
Botany.proxy.registerBlock(Botany.ceramicTile);
|
||||
Botany.proxy.registerItem(new ItemMetadata(Botany.ceramicTile).setRegistryName(Botany.ceramicTile.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.ceramicTile, new ItemMetadata(Botany.ceramicTile));
|
||||
Botany.ceramicBrick = new BlockCeramicBrick();
|
||||
Botany.proxy.registerBlock(Botany.ceramicBrick);
|
||||
Botany.proxy.registerItem(new ItemCeramicBrick(Botany.ceramicBrick).setRegistryName(Botany.ceramicBrick.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.ceramicBrick, new ItemCeramicBrick(Botany.ceramicBrick));
|
||||
GameRegistry.registerTileEntity(TileCeramicBrick.class, "");
|
||||
BinnieCore.proxy.registerTileEntity(TileCeramicBrick.class, "botany.tile.ceramicBrick");
|
||||
// BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramicTile), new MultipassItemRenderer());
|
||||
|
||||
@@ -15,6 +15,8 @@ import net.minecraft.world.World;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
|
||||
public class BlockMetadata extends BlockContainer implements IBlockMetadata {
|
||||
static int temporyMeta = -1;
|
||||
|
||||
@@ -91,17 +93,16 @@ public class BlockMetadata extends BlockContainer implements IBlockMetadata {
|
||||
final Block block2 = (Block) block;
|
||||
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, pos);
|
||||
if (tile != null && !tile.hasDroppedBlock()) {
|
||||
final int tileMeta = TileEntityMetadata.getTileMetadata(world, pos);
|
||||
//drops = block2.getDrops(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
|
||||
drops = block2.getDrops(world, pos, world.getBlockState(pos), 0);
|
||||
}
|
||||
//final boolean hasBeenBroken = world.setBlockToAir(i, j, k);
|
||||
// if (hasBeenBroken && BinnieCore.proxy.isSimulating(world) && drops.size() > 0 && (player == null || !player.capabilities.isCreativeMode)) {
|
||||
// for (final ItemStack drop : drops) {
|
||||
// //block.dropAsStack(world, i, j, k, drop);
|
||||
// }
|
||||
// tile.dropBlock();
|
||||
// }
|
||||
return false; //hasBeenBroken;
|
||||
final boolean hasBeenBroken = world.setBlockToAir(pos);
|
||||
if (hasBeenBroken && BinnieCore.proxy.isSimulating(world) && drops.size() > 0 && (player == null || !player.capabilities.isCreativeMode)) {
|
||||
for (final ItemStack drop : drops) {
|
||||
block.dropAsStack(world, pos, drop);
|
||||
}
|
||||
tile.dropBlock();
|
||||
}
|
||||
return hasBeenBroken;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,21 +7,17 @@ import binnie.extratrees.alcohol.drink.IDrinkLiquid;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.core.items.IColoredItem;
|
||||
import forestry.core.items.ItemFluidContainerForestry;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import scala.collection.parallel.BucketCombiner;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
@@ -33,6 +34,16 @@ public class BinnieModProxy implements IBinnieModProxy {
|
||||
public Block registerBlock(Block block) {
|
||||
return GameRegistry.register(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Block> void registerBlock(T block, ItemBlock itemBlock) {
|
||||
registerBlock(block);
|
||||
|
||||
if(itemBlock.getRegistryName() == null){
|
||||
itemBlock.setRegistryName(block.getRegistryName());
|
||||
}
|
||||
registerItem(itemBlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerModels() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import binnie.core.AbstractMod;
|
||||
import binnie.core.IInitializable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
public interface IProxyCore extends IInitializable {
|
||||
|
||||
@@ -12,6 +13,8 @@ public interface IProxyCore extends IInitializable {
|
||||
Item registerItem(Item item);
|
||||
|
||||
Block registerBlock(Block block);
|
||||
|
||||
<B extends Block> void registerBlock(B block, ItemBlock itemBlock);
|
||||
|
||||
public void registerModels();
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ import binnie.extratrees.alcohol.drink.ItemDrink;
|
||||
import binnie.extratrees.block.ModuleBlocks;
|
||||
import binnie.extratrees.block.decor.BlockHedge;
|
||||
import binnie.extratrees.block.decor.BlockMultiFence;
|
||||
import binnie.extratrees.block.log.BlockETLog;
|
||||
import binnie.extratrees.block.plank.BlockETPlank;
|
||||
import binnie.extratrees.block.slab.BlockETSlab;
|
||||
import binnie.extratrees.carpentry.BlockCarpentry;
|
||||
import binnie.extratrees.carpentry.BlockStainedDesign;
|
||||
import binnie.extratrees.carpentry.ModuleCarpentry;
|
||||
@@ -26,6 +29,7 @@ import binnie.extratrees.proxy.Proxy;
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
|
||||
import forestry.arboriculture.blocks.BlockForestryStairs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -55,6 +59,16 @@ public class ExtraTrees extends AbstractMod {
|
||||
public static Item itemDictionaryLepi;
|
||||
public static Item itemMisc;
|
||||
public static Item itemFood;
|
||||
public static List<BlockETLog> logs;
|
||||
public static List<BlockETLog> logsFireproof;
|
||||
public static List<BlockETPlank> planks;
|
||||
public static List<BlockETPlank> planksFireproof;
|
||||
public static List<BlockETSlab> slabs;
|
||||
public static List<BlockETSlab> slabsDouble;
|
||||
public static List<BlockETSlab> slabsFireproof;
|
||||
public static List<BlockETSlab> slabsDoubleFireproof;
|
||||
public static List<BlockForestryStairs> stairs;
|
||||
public static List<BlockForestryStairs> stairsFireproof;
|
||||
public static Block blockStairs;
|
||||
public static BlockCarpentry blockCarpentry;
|
||||
public static Block blockMachine;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import binnie.Constants;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
|
||||
@@ -46,6 +48,8 @@ public enum EnumExtraTreeLog implements IWoodType {
|
||||
PinkIvory("Pink Ivory", PlankType.ExtraTreePlanks.PinkIvory),
|
||||
EMPTY("EMPTY", PlankType.VanillaPlanks.OAK);//TODO change name/create wood for SHRUBS
|
||||
|
||||
public static final EnumExtraTreeLog[] VALUES = values();
|
||||
|
||||
String name;
|
||||
IPlankType plank;
|
||||
|
||||
@@ -118,5 +122,13 @@ public enum EnumExtraTreeLog implements IWoodType {
|
||||
public int getMetadata() {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static EnumExtraTreeLog byMetadata(int meta) {
|
||||
if (meta < 0 || meta >= VALUES.length) {
|
||||
meta = 0;
|
||||
}
|
||||
return VALUES[meta];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.block.ItemMetadata;
|
||||
@@ -7,18 +10,32 @@ import binnie.core.liquid.ILiquidType;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.decor.*;
|
||||
import binnie.extratrees.block.log.BlockETLog;
|
||||
import binnie.extratrees.block.log.ItemETLog;
|
||||
import binnie.extratrees.block.plank.BlockETPlank;
|
||||
import binnie.extratrees.block.plank.ItemETPlank;
|
||||
import binnie.extratrees.block.slab.BlockETSlab;
|
||||
import binnie.extratrees.block.stairs.BlockETStairs;
|
||||
import binnie.extratrees.genetics.WoodAccess;
|
||||
import binnie.extratrees.block.slab.ItemETSlab;
|
||||
import binnie.extratrees.block.stairs.ItemETStairs;
|
||||
import binnie.extratrees.item.ExtraTreeLiquid;
|
||||
import forestry.api.arboriculture.EnumVanillaWoodType;
|
||||
import forestry.api.arboriculture.IWoodAccess;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.arboriculture.WoodAccess;
|
||||
import forestry.arboriculture.blocks.BlockForestryStairs;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
@@ -31,10 +48,93 @@ public class ModuleBlocks implements IInitializable {
|
||||
public void preInit() {
|
||||
PlankType.setup();
|
||||
|
||||
BlockETLog.init();
|
||||
BlockETPlank.init();
|
||||
BlockETSlab.init();
|
||||
BlockETStairs.init();
|
||||
//TODO: clean up
|
||||
ExtraTrees.logs = BlockETLog.create(false);
|
||||
for (BlockETLog block : ExtraTrees.logs) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemETLog(block));
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
}
|
||||
|
||||
ExtraTrees.logsFireproof = BlockETLog.create(true);
|
||||
for (BlockETLog block : ExtraTrees.logsFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemETLog(block));
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
}
|
||||
|
||||
WoodAccess.registerLogs(ExtraTrees.logs);
|
||||
WoodAccess.registerLogs(ExtraTrees.logsFireproof);
|
||||
|
||||
ExtraTrees.planks = BlockETPlank.create(false);
|
||||
for (BlockETPlank block : ExtraTrees.planks) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemETPlank(block));
|
||||
registerOreDictWildcard(OreDictUtil.PLANK_WOOD, block);
|
||||
}
|
||||
|
||||
ExtraTrees.planksFireproof = BlockETPlank.create(true);
|
||||
for (BlockETPlank block : ExtraTrees.planksFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemETPlank(block));
|
||||
registerOreDictWildcard(OreDictUtil.PLANK_WOOD, block);
|
||||
}
|
||||
|
||||
WoodAccess.registerPlanks(ExtraTrees.planks);
|
||||
WoodAccess.registerPlanks(ExtraTrees.planksFireproof);
|
||||
|
||||
ExtraTrees.slabs = BlockETSlab.create(false, false);
|
||||
ExtraTrees.slabsDouble = BlockETSlab.create(false, true);
|
||||
for (int i = 0; i < ExtraTrees.slabs.size(); i++) {
|
||||
BlockETSlab slab = ExtraTrees.slabs.get(i);
|
||||
BlockETSlab slabDouble = ExtraTrees.slabsDouble.get(i);
|
||||
ExtraTrees.proxy.registerBlock(slab, new ItemETSlab(slab, slab, slabDouble));
|
||||
ExtraTrees.proxy.registerBlock(slabDouble, new ItemETSlab(slabDouble, slab, slabDouble));
|
||||
registerOreDictWildcard(OreDictUtil.SLAB_WOOD, slab);
|
||||
}
|
||||
|
||||
ExtraTrees.slabsFireproof = BlockETSlab.create(true, false);
|
||||
ExtraTrees.slabsDoubleFireproof = BlockETSlab.create(true, true);
|
||||
for (int i = 0; i < ExtraTrees.slabsFireproof.size(); i++) {
|
||||
BlockETSlab slab = ExtraTrees.slabsFireproof.get(i);
|
||||
BlockETSlab slabDouble = ExtraTrees.slabsDoubleFireproof.get(i);
|
||||
ExtraTrees.proxy.registerBlock(slab, new ItemETSlab(slab, slab, slabDouble));
|
||||
ExtraTrees.proxy.registerBlock(slabDouble, new ItemETSlab(slabDouble, slab, slabDouble));
|
||||
registerOreDictWildcard(OreDictUtil.SLAB_WOOD, slab);
|
||||
}
|
||||
WoodAccess.registerSlabs(ExtraTrees.slabs);
|
||||
WoodAccess.registerSlabs(ExtraTrees.slabsFireproof);
|
||||
|
||||
ExtraTrees.stairs = new ArrayList<>();
|
||||
for (BlockETPlank plank : ExtraTrees.planks) {
|
||||
for (IBlockState blockState : plank.getBlockState().getValidStates()) {
|
||||
int meta = plank.getMetaFromState(blockState);
|
||||
EnumExtraTreeLog woodType = plank.getWoodType(meta);
|
||||
|
||||
BlockForestryStairs stair = new BlockForestryStairs(false, blockState, woodType);
|
||||
String name = "stairs." + woodType;
|
||||
stair.setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
stair.setUnlocalizedName(name);
|
||||
ExtraTrees.proxy.registerBlock(stair, new ItemETStairs(stair));
|
||||
ExtraTrees.stairs.add(stair);
|
||||
registerOreDictWildcard(OreDictUtil.STAIR_WOOD, stair);
|
||||
}
|
||||
}
|
||||
|
||||
ExtraTrees.stairsFireproof = new ArrayList<>();
|
||||
for (BlockETPlank plank : ExtraTrees.planksFireproof) {
|
||||
for (IBlockState blockState : plank.getBlockState().getValidStates()) {
|
||||
int meta = plank.getMetaFromState(blockState);
|
||||
EnumExtraTreeLog woodType = plank.getWoodType(meta);
|
||||
|
||||
BlockForestryStairs stair = new BlockForestryStairs(true, blockState, woodType);
|
||||
String name = "stairs.fireproof." + woodType;
|
||||
stair.setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, "stairs.fireproof." + woodType));
|
||||
stair.setUnlocalizedName(name);
|
||||
ExtraTrees.proxy.registerBlock(stair, new ItemETStairs(stair));
|
||||
ExtraTrees.stairsFireproof.add(stair);
|
||||
registerOreDictWildcard(OreDictUtil.STAIR_WOOD, stair);
|
||||
}
|
||||
}
|
||||
|
||||
WoodAccess.registerStairs(ExtraTrees.stairs);
|
||||
WoodAccess.registerStairs(ExtraTrees.stairsFireproof);
|
||||
|
||||
ExtraTrees.blockFence = new BlockFence("fence");
|
||||
ExtraTrees.blockGate = new BlockGate();
|
||||
@@ -54,16 +154,14 @@ public class ModuleBlocks implements IInitializable {
|
||||
// GameRegistry.register(new ItemETStairs(ExtraTrees.blockStairs).setRegistryName(ExtraTrees.blockStairs.getRegistryName()));
|
||||
//BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStairs), new StairItemRenderer());
|
||||
//BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockGate), new GateItemRenderer());
|
||||
for (final EnumExtraTreeLog plank : EnumExtraTreeLog.values()) {
|
||||
OreDictionary.registerOre("logWood", WoodAccess.getInstance().getStack(plank, WoodBlockKind.LOG, false));
|
||||
OreDictionary.registerOre("plankWood", WoodAccess.getInstance().getStack(plank, WoodBlockKind.PLANKS, false));
|
||||
for (BlockETLog log : ExtraTrees.logs) {
|
||||
ItemStack logInput = new ItemStack(log, 1, OreDictionary.WILDCARD_VALUE);
|
||||
ItemStack coalOutput = new ItemStack(Items.COAL, 1, 1);
|
||||
RecipeUtil.addSmelting(logInput, coalOutput, 0.15F);
|
||||
}
|
||||
// GameRegistry.addSmelting(ExtraTrees.blockLog, new ItemStack(Items.COAL, 1, 1), 0.15f);
|
||||
// FMLInterModComms.sendMessage("forestry", "add-fence-block", "ExtraTrees:fence");
|
||||
// FMLInterModComms.sendMessage("forestry", "add-fence-block", "ExtraTrees:gate");
|
||||
// FMLInterModComms.sendMessage("Forestry", "add-alveary-slab",
|
||||
// "ExtraTrees:slab");
|
||||
// FMLInterModComms.sendMessage("forestry", "add-fence-block", "ExtraTrees:multifence");
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", "ExtraTrees:fence");
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", "ExtraTrees:gate");
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", "ExtraTrees:multifence");
|
||||
//ModuleBlocks.hedgeRenderID = BinnieCore.proxy.getUniqueRenderID();
|
||||
}
|
||||
|
||||
@@ -83,14 +181,21 @@ public class ModuleBlocks implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (final PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
|
||||
final ItemStack planks = plank.getStack();
|
||||
//final ItemStack slabs = TileEntityMetadata.getItemStack(ExtraTrees.blockSlab, plank.ordinal());
|
||||
//final ItemStack stairs = TileEntityMetadata.getItemStack(ExtraTrees.blockStairs, plank.ordinal());
|
||||
//stairs.stackSize = 4;
|
||||
//GameRegistry.addRecipe(stairs.copy(), "# ", "## ", "###", '#', planks.copy());
|
||||
//slabs.stackSize = 6;
|
||||
//CraftingManager.getInstance().getRecipeList().add(0, new ShapedOreRecipe(slabs.copy(), "###", '#', planks.copy()));
|
||||
IWoodAccess woodAccess = TreeManager.woodAccess;
|
||||
for(EnumExtraTreeLog woodType : EnumExtraTreeLog.VALUES){
|
||||
for(boolean fireproof : new boolean[]{false, true}){
|
||||
ItemStack planks = woodAccess.getStack(woodType, WoodBlockKind.PLANKS, fireproof);
|
||||
ItemStack slabs = woodAccess.getStack(woodType, WoodBlockKind.SLAB, fireproof);
|
||||
ItemStack stairs = woodAccess.getStack(woodType, WoodBlockKind.STAIRS, fireproof);
|
||||
stairs.stackSize = 4;
|
||||
RecipeUtil.addPriorityRecipe(stairs.copy(),
|
||||
"# ",
|
||||
"## ",
|
||||
"###",
|
||||
'#', planks.copy());
|
||||
slabs.stackSize = 6;
|
||||
RecipeUtil.addPriorityRecipe(slabs.copy(), "###", '#', planks.copy());
|
||||
}
|
||||
}
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeSize());
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeEmbedded());
|
||||
@@ -128,4 +233,13 @@ public class ModuleBlocks implements IInitializable {
|
||||
public void addSqueezer(final IWoodType log, final ILiquidType liquid, final int amount) {
|
||||
this.addSqueezer(log, liquid, amount, 0.5f);
|
||||
}
|
||||
|
||||
private static void addRecipeAtPosition(int position, IRecipe recipe){
|
||||
CraftingManager manager = CraftingManager.getInstance();
|
||||
manager.getRecipeList().add(position, recipe);
|
||||
}
|
||||
|
||||
private static void registerOreDictWildcard(String oreDictName, Block block) {
|
||||
OreDictionary.registerOre(oreDictName, new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forestry.arboriculture.blocks.WoodTypePredicate;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
|
||||
public class PropertyExtraTreeWoodType extends PropertyWoodType<EnumExtraTreeLog> {
|
||||
public static PropertyExtraTreeWoodType[] create(@Nonnull String name, int variantsPerBlock) {
|
||||
final int variantCount = (int) Math.ceil((float) EnumExtraTreeLog.VALUES.length / variantsPerBlock);
|
||||
PropertyExtraTreeWoodType[] variants = new PropertyExtraTreeWoodType[variantCount];
|
||||
for (int variantNumber = 0; variantNumber < variantCount; variantNumber++) {
|
||||
WoodTypePredicate filter = new WoodTypePredicate(variantNumber, variantsPerBlock);
|
||||
Collection<EnumExtraTreeLog> allowedValues = Collections2.filter(Lists.newArrayList(EnumExtraTreeLog.class.getEnumConstants()), filter);
|
||||
variants[variantNumber] = new PropertyExtraTreeWoodType(name, EnumExtraTreeLog.class, allowedValues);
|
||||
}
|
||||
return variants;
|
||||
}
|
||||
|
||||
protected PropertyExtraTreeWoodType(String name, Class<EnumExtraTreeLog> valueClass, Collection<EnumExtraTreeLog> allowedValues) {
|
||||
super(name, valueClass, allowedValues);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,10 @@ import binnie.extratrees.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import binnie.extratrees.block.decor.FenceDescription;
|
||||
import binnie.extratrees.block.decor.FenceType;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.core.utils.Translator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -14,7 +18,36 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class WoodManager {
|
||||
@Nonnull
|
||||
public static String getDisplayName(IWoodTyped wood, IWoodType woodType) {
|
||||
WoodBlockKind blockKind = wood.getBlockKind();
|
||||
|
||||
String displayName;
|
||||
|
||||
if (woodType instanceof EnumExtraTreeLog) {
|
||||
String customUnlocalizedName = "tile.et." + blockKind + "." + woodType + ".name";
|
||||
if (Translator.canTranslateToLocal(customUnlocalizedName)) {
|
||||
displayName = Translator.translateToLocal(customUnlocalizedName);
|
||||
} else {
|
||||
String woodGrammar = Translator.translateToLocal("for." + blockKind + ".grammar");
|
||||
String woodTypeName = Translator.translateToLocal("et.trees.woodType." + woodType);
|
||||
|
||||
displayName = woodGrammar.replaceAll("%TYPE", woodTypeName);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown wood type: " + woodType);
|
||||
}
|
||||
|
||||
if (wood.isFireproof()) {
|
||||
displayName = Translator.translateToLocalFormatted("tile.for.fireproof", displayName);
|
||||
}
|
||||
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public static IPlankType getPlankType(final int index) {
|
||||
final IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
|
||||
if (wood instanceof IPlankType) {
|
||||
|
||||
@@ -1,205 +1,50 @@
|
||||
package binnie.extratrees.block.log;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import binnie.extratrees.block.IWoodKind;
|
||||
import binnie.extratrees.block.PropertyEnumWoodType;
|
||||
import binnie.extratrees.genetics.WoodAccess;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.BlockLog;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Arrays;
|
||||
import binnie.extratrees.block.PropertyExtraTreeWoodType;
|
||||
import forestry.arboriculture.blocks.log.BlockForestryLog;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public abstract class BlockETLog extends BlockLog implements IWoodKind, IStateMapperRegister, IItemModelRegister {
|
||||
protected static final int VARIANTS_PER_BLOCK = 4;
|
||||
protected static final int VARIANTS_META_MASK = VARIANTS_PER_BLOCK - 1;
|
||||
public static final String BLOCK_NAME = "log";
|
||||
protected int offset = -1;
|
||||
protected boolean fireproof;
|
||||
protected static PropertyEnumWoodType[] types = PropertyEnumWoodType.create(VARIANTS_PER_BLOCK);
|
||||
|
||||
public BlockETLog(int offset, boolean fireproof) {
|
||||
this.setCreativeTab(Tabs.tabArboriculture);
|
||||
this.setRegistryName(BLOCK_NAME + "." + (fireproof ? "fireproof." : "") + offset);
|
||||
this.setResistance(5.0f);
|
||||
this.setHardness(2.0f);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
this.setUnlocalizedName(BLOCK_NAME + "." + (fireproof ? "fireproof." : "") + offset);
|
||||
this.offset = offset;
|
||||
this.fireproof = fireproof;
|
||||
setDefaultState(this.blockState.getBaseState().withProperty(types[offset], types[offset].getFirstValue()).withProperty(LOG_AXIS, EnumAxis.Y));
|
||||
public abstract class BlockETLog extends BlockForestryLog<EnumExtraTreeLog> {
|
||||
public static List<BlockETLog> create(boolean fireproof) {
|
||||
List<BlockETLog> blocks = new ArrayList<>();
|
||||
PropertyExtraTreeWoodType[] variants = PropertyExtraTreeWoodType.create("variant", VARIANTS_PER_BLOCK);
|
||||
for (int i = 0; i < variants.length; i++) {
|
||||
PropertyExtraTreeWoodType variant = variants[i];
|
||||
BlockETLog block = new BlockETLog(fireproof, i) {
|
||||
@Nonnull
|
||||
@Override
|
||||
public PropertyWoodType<EnumExtraTreeLog> getVariant() {
|
||||
return variant;
|
||||
}
|
||||
};
|
||||
blocks.add(block);
|
||||
}
|
||||
return blocks;
|
||||
}
|
||||
|
||||
private BlockETLog(boolean fireproof, int blockNumber) {
|
||||
super(fireproof, blockNumber);
|
||||
String name = "logs.";
|
||||
if(fireproof){
|
||||
name+="fireproof.";
|
||||
}
|
||||
name+=blockNumber;
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract PropertyEnum<EnumExtraTreeLog> getVariant();
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumExtraTreeLog getWoodType(int meta) {
|
||||
return EnumExtraTreeLog.values()[offset * VARIANTS_PER_BLOCK + (meta & VARIANTS_META_MASK)];
|
||||
}
|
||||
|
||||
private static EnumAxis getAxis(int meta) {
|
||||
switch (meta & 12) {
|
||||
case 0:
|
||||
return EnumAxis.Y;
|
||||
case 4:
|
||||
return EnumAxis.X;
|
||||
case 8:
|
||||
return EnumAxis.Z;
|
||||
default:
|
||||
return EnumAxis.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final IBlockState getStateFromMeta(int meta) {
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
EnumAxis axis = getAxis(meta);
|
||||
return getDefaultState().withProperty(getVariant(), woodType).withProperty(LOG_AXIS, axis);
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
@Override
|
||||
public final int getMetaFromState(IBlockState state) {
|
||||
int i = 0;
|
||||
try {
|
||||
i = damageDropped(state);
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
switch (state.getValue(LOG_AXIS)) {
|
||||
case X:
|
||||
i |= 4;
|
||||
break;
|
||||
case Z:
|
||||
i |= 8;
|
||||
break;
|
||||
case NONE:
|
||||
i |= 12;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, getVariant(), LOG_AXIS);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final int damageDropped(IBlockState state) {
|
||||
return state.getValue(getVariant()).getMetadata() % VARIANTS_PER_BLOCK;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final ItemStack createStackedBlock(IBlockState state) {
|
||||
int meta = damageDropped(state);
|
||||
Item item = Item.getItemFromBlock(this);
|
||||
return new ItemStack(item, 1, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
|
||||
EnumAxis axis = EnumAxis.fromFacingAxis(facing.getAxis());
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
return getDefaultState().withProperty(getVariant(), woodType).withProperty(LOG_AXIS, axis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
list.addAll(getVariant().getAllowedValues().stream().map(woodType -> new ItemStack(this, 1, woodType.getMetadata() % VARIANTS_PER_BLOCK)).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public final float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) {
|
||||
int meta = getMetaFromState(blockState);
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
return woodType.getHardness();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
if (fireproof) {
|
||||
return 0;
|
||||
} else if (face == EnumFacing.DOWN) {
|
||||
return 20;
|
||||
} else if (face != EnumFacing.UP) {
|
||||
return 10;
|
||||
} else {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
if (fireproof) {
|
||||
return 0;
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WoodBlockKind getWoodKind() {
|
||||
return WoodBlockKind.LOG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, stack -> new ModelResourceLocation(Constants.EXTRA_TREES_MOD_ID + ":" + BLOCK_NAME, "axis=y,wood_type=" + getWoodType(stack.getMetadata()).getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerStateMapper() {
|
||||
ExtraTrees.proxy.setCustomStateMapper(BLOCK_NAME, this);
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
Arrays.stream(types).forEach(type -> {
|
||||
BlockETLog log = new BlockETLog(type.getGroup(), false) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
};
|
||||
|
||||
BlockETLog log_fireproof = new BlockETLog(type.getGroup(), true) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
};
|
||||
|
||||
ExtraTrees.proxy.registerItem(new ItemETLog<>(log));
|
||||
ExtraTrees.proxy.registerItem(new ItemETLog<>(log_fireproof));
|
||||
ExtraTrees.proxy.registerBlock(log);
|
||||
ExtraTrees.proxy.registerBlock(log_fireproof);
|
||||
|
||||
WoodAccess.getInstance().registerWithVariants(log, log.getWoodKind(), type, true);
|
||||
WoodAccess.getInstance().registerWithVariants(log_fireproof, log.getWoodKind(), type, false);
|
||||
});
|
||||
|
||||
int variantCount = getVariant().getAllowedValues().size();
|
||||
int variantMeta = (meta % variantCount) + getBlockNumber() * VARIANTS_PER_BLOCK;
|
||||
return EnumExtraTreeLog.byMetadata(variantMeta);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +1,26 @@
|
||||
package binnie.extratrees.block.log;
|
||||
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.items.ItemBlockWood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemETLog <V extends BlockETLog> extends ItemBlock {
|
||||
EnumExtraTreeLog[] values;
|
||||
public class ItemETLog <V extends BlockETLog> extends ItemBlockWood<V> {
|
||||
|
||||
public ItemETLog(V block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setRegistryName(block.getRegistryName());
|
||||
values = block.getVariant().getAllowedValues().toArray(new EnumExtraTreeLog[]{});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return "tile." + BlockETLog.BLOCK_NAME + "." + values[stack.getMetadata()].getName();
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
IWoodTyped wood = getBlock();
|
||||
int meta = itemstack.getMetadata();
|
||||
IWoodType woodType = wood.getWoodType(meta);
|
||||
return WoodManager.getDisplayName(wood, woodType);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,157 +1,50 @@
|
||||
package binnie.extratrees.block.plank;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import binnie.extratrees.block.IWoodKind;
|
||||
import binnie.extratrees.block.PropertyEnumWoodType;
|
||||
import binnie.extratrees.genetics.WoodAccess;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Arrays;
|
||||
import binnie.extratrees.block.PropertyExtraTreeWoodType;
|
||||
import forestry.arboriculture.blocks.planks.BlockForestryPlanks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public abstract class BlockETPlank extends Block implements IWoodKind, IItemModelRegister, IStateMapperRegister {
|
||||
protected static final int VARIANTS_PER_BLOCK = 16;
|
||||
protected static final int VARIANTS_META_MASK = VARIANTS_PER_BLOCK - 1;
|
||||
public abstract class BlockETPlank extends BlockForestryPlanks<EnumExtraTreeLog> {
|
||||
public static final String BLOCK_NAME = "plank";
|
||||
private final boolean fireproof;
|
||||
protected int offset = -1;
|
||||
protected static PropertyEnumWoodType[] types = PropertyEnumWoodType.create(VARIANTS_PER_BLOCK);
|
||||
|
||||
public BlockETPlank(int offset, boolean fireproof) {
|
||||
super(Material.WOOD);
|
||||
this.fireproof = fireproof;
|
||||
this.offset = offset;
|
||||
this.setRegistryName(BLOCK_NAME + "." + (fireproof ? "fireproof." : "") + offset);
|
||||
this.setCreativeTab(Tabs.tabArboriculture);
|
||||
this.setResistance(5.0f);
|
||||
this.setHardness(2.0f);
|
||||
this.setHarvestLevel("axe", 0);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) {
|
||||
int meta = getMetaFromState(blockState);
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
return woodType.getHardness();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
if (fireproof) {
|
||||
return 0;
|
||||
|
||||
public static List<BlockETPlank> create(boolean fireproof) {
|
||||
List<BlockETPlank> blocks = new ArrayList<>();
|
||||
PropertyExtraTreeWoodType[] variants = PropertyExtraTreeWoodType.create("variant", VARIANTS_PER_BLOCK);
|
||||
for (int i = 0; i < variants.length; i++) {
|
||||
PropertyExtraTreeWoodType variant = variants[i];
|
||||
BlockETPlank block = new BlockETPlank(fireproof, i) {
|
||||
@Nonnull
|
||||
@Override
|
||||
public PropertyExtraTreeWoodType getVariant() {
|
||||
return variant;
|
||||
}
|
||||
};
|
||||
blocks.add(block);
|
||||
}
|
||||
return 20;
|
||||
return blocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
if (fireproof) {
|
||||
return 0;
|
||||
private BlockETPlank(boolean fireproof, int blockNumber) {
|
||||
super(fireproof, blockNumber);
|
||||
String name = "planks.";
|
||||
if(fireproof){
|
||||
name+="fireproof.";
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return damageDropped(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
return getDefaultState().withProperty(getVariant(), woodType);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, getVariant());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
list.addAll(getVariant().getAllowedValues().stream().map(woodType -> new ItemStack(this, 1, woodType.getMetadata() % VARIANTS_PER_BLOCK)).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int damageDropped(IBlockState state) {
|
||||
return state.getValue(getVariant()).getMetadata() % VARIANTS_PER_BLOCK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
return getDefaultState().withProperty(getVariant(), woodType);
|
||||
name+=blockNumber;
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumExtraTreeLog getWoodType(int meta) {
|
||||
return EnumExtraTreeLog.values()[offset * VARIANTS_PER_BLOCK + (meta & VARIANTS_META_MASK)];
|
||||
int variantCount = getVariant().getAllowedValues().size();
|
||||
int variantMeta = (meta % variantCount) + getBlockNumber() * VARIANTS_PER_BLOCK;
|
||||
return EnumExtraTreeLog.byMetadata(variantMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WoodBlockKind getWoodKind() {
|
||||
return WoodBlockKind.PLANKS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerStateMapper() {
|
||||
ExtraTrees.proxy.setCustomStateMapper(BLOCK_NAME, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, stack -> new ModelResourceLocation(Constants.EXTRA_TREES_MOD_ID + ":" + BLOCK_NAME, "wood_type=" + getWoodType(stack.getMetadata()).getName()));
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
Arrays.stream(types).forEach(type -> {
|
||||
BlockETPlank plank = new BlockETPlank(type.getGroup(), false) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
};
|
||||
|
||||
BlockETPlank plank_fireproof = new BlockETPlank(type.getGroup(), true) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
};
|
||||
|
||||
ExtraTrees.proxy.registerItem(new ItemETPlank<>(plank));
|
||||
ExtraTrees.proxy.registerItem(new ItemETPlank<>(plank_fireproof));
|
||||
ExtraTrees.proxy.registerBlock(plank);
|
||||
ExtraTrees.proxy.registerBlock(plank_fireproof);
|
||||
|
||||
WoodAccess.getInstance().registerWithVariants(plank, plank.getWoodKind(), type, true);
|
||||
WoodAccess.getInstance().registerWithVariants(plank_fireproof, plank.getWoodKind(), type, false);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +1,26 @@
|
||||
package binnie.extratrees.block.plank;
|
||||
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.items.ItemBlockWood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Created by Marcin on 03.11.2016.
|
||||
*/
|
||||
public class ItemETPlank<V extends BlockETPlank> extends ItemBlock {
|
||||
EnumExtraTreeLog[] values;
|
||||
public class ItemETPlank<V extends BlockETPlank> extends ItemBlockWood<V> {
|
||||
|
||||
public ItemETPlank(V block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setRegistryName(block.getRegistryName());
|
||||
values = block.getVariant().getAllowedValues().toArray(new EnumExtraTreeLog[]{});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return "tile." + BlockETPlank.BLOCK_NAME + "." + values[stack.getMetadata()].getName();
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
IWoodTyped wood = getBlock();
|
||||
int meta = itemstack.getMetadata();
|
||||
IWoodType woodType = wood.getWoodType(meta);
|
||||
return WoodManager.getDisplayName(wood, woodType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,229 +1,58 @@
|
||||
package binnie.extratrees.block.slab;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import binnie.extratrees.block.IWoodKind;
|
||||
import binnie.extratrees.block.PropertyEnumWoodType;
|
||||
import binnie.extratrees.block.plank.BlockETPlank;
|
||||
import binnie.extratrees.genetics.WoodAccess;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.extratrees.block.PropertyExtraTreeWoodType;
|
||||
import forestry.arboriculture.blocks.slab.BlockForestrySlab;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class BlockETSlab extends BlockSlab implements IWoodKind, IItemModelRegister, IStateMapperRegister{
|
||||
protected static final int VARIANTS_PER_BLOCK = 8;
|
||||
protected static final int VARIANTS_META_MASK = VARIANTS_PER_BLOCK - 1;
|
||||
public static final String BLOCK_NAME = "slab";
|
||||
private final boolean fireproof;
|
||||
private final int offset;
|
||||
protected static final PropertyEnumWoodType[] types = PropertyEnumWoodType.create(VARIANTS_PER_BLOCK);
|
||||
public abstract class BlockETSlab extends BlockForestrySlab<EnumExtraTreeLog> {
|
||||
public static List<BlockETSlab> create(boolean fireproof, final boolean doubleSlab) {
|
||||
List<BlockETSlab> blocks = new ArrayList<>();
|
||||
PropertyExtraTreeWoodType[] variants = PropertyExtraTreeWoodType.create("variant", VARIANTS_PER_BLOCK);
|
||||
for (int i = 0; i < variants.length; i++) {
|
||||
PropertyExtraTreeWoodType variant = variants[i];
|
||||
BlockETSlab block = new BlockETSlab(fireproof, i) {
|
||||
@Nonnull
|
||||
@Override
|
||||
public PropertyExtraTreeWoodType getVariant() {
|
||||
return variant;
|
||||
}
|
||||
|
||||
public BlockETSlab(int offset, boolean fireproof) {
|
||||
super(Material.WOOD);
|
||||
this.fireproof = fireproof;
|
||||
this.offset = offset;
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setHardness(2.0f);
|
||||
setResistance(5.0f);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setLightOpacity(0);
|
||||
setRegistryName(BLOCK_NAME + "." + (fireproof ? "fireproof." : "") + (isDouble()?"double.":"") + offset);
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return doubleSlab;
|
||||
}
|
||||
};
|
||||
blocks.add(block);
|
||||
}
|
||||
return blocks;
|
||||
}
|
||||
|
||||
private BlockETSlab(boolean fireproof, int blockNumber) {
|
||||
super(fireproof, blockNumber);
|
||||
String name = "slabs.";
|
||||
if(fireproof){
|
||||
name+="fireproof.";
|
||||
}
|
||||
if(isDouble()){
|
||||
name+="double.";
|
||||
}
|
||||
name+=blockNumber;
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumExtraTreeLog getWoodType(int meta) {
|
||||
return EnumExtraTreeLog.values()[offset * VARIANTS_PER_BLOCK + (meta & VARIANTS_META_MASK)];
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return this.isDouble() ? new BlockStateContainer(this, getVariant()) : new BlockStateContainer(this, HALF, getVariant());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
IBlockState iblockstate = this.getDefaultState().withProperty(getVariant(), woodType);
|
||||
|
||||
if (!this.isDouble()) {
|
||||
iblockstate = iblockstate.withProperty(HALF, (meta & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP);
|
||||
}
|
||||
|
||||
return iblockstate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
int meta = damageDropped(state);
|
||||
|
||||
if (!this.isDouble() && state.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) {
|
||||
meta |= 8;
|
||||
}
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
EnumExtraTreeLog woodType = state.getValue(getVariant());
|
||||
return woodType.getMetadata() - offset * VARIANTS_PER_BLOCK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
EnumExtraTreeLog woodType = state.getValue(getVariant());
|
||||
ItemStack slab = WoodAccess.getInstance().getStack(woodType, WoodBlockKind.SLAB, fireproof);
|
||||
return slab.getItem();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // this is the way the vanilla slabs work
|
||||
@Override
|
||||
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) {
|
||||
EnumExtraTreeLog woodType = state.getValue(getVariant());
|
||||
ItemStack slab = WoodAccess.getInstance().getStack(woodType, WoodBlockKind.SLAB, fireproof);
|
||||
return new ItemStack(slab.getItem(), 1, getMetaFromState(state));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> list) {
|
||||
if (!isDouble()) {
|
||||
list.addAll(getVariant().getAllowedValues().stream().map(woodType -> new ItemStack(this, 1, woodType.getMetadata() % VARIANTS_PER_BLOCK)).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) {
|
||||
int meta = getMetaFromState(blockState);
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
return woodType.getHardness();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
return fireproof ? 0 : 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
return fireproof ? 0 : 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(int meta) {
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
return woodType.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IProperty<?> getVariantProperty() {
|
||||
return getVariant();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comparable<?> getTypeForItem(ItemStack stack) {
|
||||
return getWoodType(stack.getMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
public WoodBlockKind getWoodKind() {
|
||||
return WoodBlockKind.SLAB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
if(!isDouble())
|
||||
manager.registerItemModel(item, stack -> new ModelResourceLocation(Constants.EXTRA_TREES_MOD_ID + ":" + BLOCK_NAME, "half=bottom,wood_type=" + getWoodType(stack.getMetadata()).getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerStateMapper() {
|
||||
if(isDouble())
|
||||
ExtraTrees.proxy.setCustomStateMapper(BlockETPlank.BLOCK_NAME, this);
|
||||
else
|
||||
ExtraTrees.proxy.setCustomStateMapper(BLOCK_NAME, this);
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
Arrays.stream(types).forEach(type -> {
|
||||
BlockETSlab slab = new BlockETSlab(type.getGroup(), false) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
};
|
||||
|
||||
BlockETSlab slab_double = new BlockETSlab(type.getGroup(), false) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
BlockETSlab slab_fireproof = new BlockETSlab(type.getGroup(), true) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
};
|
||||
|
||||
BlockETSlab slab_double_fireproof = new BlockETSlab(type.getGroup(), true) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
ExtraTrees.proxy.registerItem(new ItemETSlab<>(slab, slab_double));
|
||||
ExtraTrees.proxy.registerItem(new ItemETSlab<>(slab_fireproof, slab_double_fireproof));
|
||||
ExtraTrees.proxy.registerBlock(slab);
|
||||
ExtraTrees.proxy.registerBlock(slab_fireproof);
|
||||
ExtraTrees.proxy.registerBlock(slab_double);
|
||||
ExtraTrees.proxy.registerBlock(slab_double_fireproof);
|
||||
|
||||
WoodAccess.getInstance().registerWithVariants(slab, slab.getWoodKind(), type, true);
|
||||
WoodAccess.getInstance().registerWithVariants(slab_fireproof, slab.getWoodKind(), type, false);
|
||||
});
|
||||
|
||||
meta &= ~8; // unset the top/bottom slab bit
|
||||
int variantCount = getVariant().getAllowedValues().size();
|
||||
int variantMeta = (meta % variantCount) + getBlockNumber() * VARIANTS_PER_BLOCK;
|
||||
return EnumExtraTreeLog.byMetadata(variantMeta);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,22 @@
|
||||
package binnie.extratrees.block.slab;
|
||||
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemETSlab<V extends BlockETSlab> extends ItemSlab {
|
||||
EnumExtraTreeLog[] values;
|
||||
|
||||
public ItemETSlab(V block, V doubleBlock) {
|
||||
super(block, block, doubleBlock);
|
||||
public class ItemETSlab extends ItemSlab {
|
||||
|
||||
public ItemETSlab(BlockETSlab block, BlockETSlab slab, BlockETSlab doubleSlab) {
|
||||
super(block, slab, doubleSlab);
|
||||
setRegistryName(block.getRegistryName());
|
||||
values = block.getVariant().getAllowedValues().toArray(new EnumExtraTreeLog[]{});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return "tile." + BlockETSlab.BLOCK_NAME + "." + values[stack.getMetadata()].getName();
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
BlockETSlab wood = (BlockETSlab) getBlock();
|
||||
int meta = itemstack.getMetadata();
|
||||
IWoodType woodType = wood.getWoodType(meta);
|
||||
return WoodManager.getDisplayName(wood, woodType);
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
package binnie.extratrees.block.stairs;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.*;
|
||||
import binnie.extratrees.genetics.WoodAccess;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import java.util.Arrays;
|
||||
|
||||
public abstract class BlockETStairs extends BlockStairs implements IWoodKind, IItemModelRegister, IStateMapperRegister {
|
||||
private final boolean fireproof;
|
||||
protected static final int VARIANTS_PER_BLOCK = 1;
|
||||
protected static final PropertyEnumWoodType[] types = PropertyEnumWoodType.create(VARIANTS_PER_BLOCK);
|
||||
public static final String BLOCK_NAME = "stairs";
|
||||
private final int offset;
|
||||
|
||||
public BlockETStairs(int offset, boolean fireproof) {
|
||||
super(WoodAccess.getInstance().getBlock(types[offset].getFirstValue(), WoodBlockKind.PLANKS, fireproof));
|
||||
this.setCreativeTab(Tabs.tabArboriculture);
|
||||
this.setRegistryName(BLOCK_NAME + "." + (fireproof ? "fireproof." : "") + offset);
|
||||
this.offset = offset;
|
||||
this.fireproof = fireproof;
|
||||
this.setUnlocalizedName(types[offset].getFirstValue().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumExtraTreeLog getWoodType(int meta) {
|
||||
return types[offset].getFirstValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public WoodBlockKind getWoodKind() {
|
||||
return WoodBlockKind.STAIRS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) {
|
||||
int meta = getMetaFromState(blockState);
|
||||
EnumExtraTreeLog woodType = getWoodType(meta);
|
||||
return woodType.getHardness();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
if (fireproof) {
|
||||
return 0;
|
||||
}
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
if (fireproof) {
|
||||
return 0;
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, stack -> new ModelResourceLocation(Constants.EXTRA_TREES_MOD_ID + ":" + BLOCK_NAME + "." + getWoodType(0).getMetadata(), "facing=east,half=bottom,shape=straight"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerStateMapper() {
|
||||
ExtraTrees.proxy.setCustomStateMapper(BLOCK_NAME + "." + getWoodType(0).getMetadata(), this);
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
Arrays.stream(types).forEach(type -> {
|
||||
BlockETStairs stairs = new BlockETStairs(type.getGroup(), false) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
};
|
||||
|
||||
BlockETStairs stairs_fireproof = new BlockETStairs(type.getGroup(), true) {
|
||||
@Override
|
||||
public PropertyEnum<EnumExtraTreeLog> getVariant() {
|
||||
return type;
|
||||
}
|
||||
};
|
||||
|
||||
ExtraTrees.proxy.registerItem(new ItemETStairs<>(stairs));
|
||||
ExtraTrees.proxy.registerItem(new ItemETStairs<>(stairs_fireproof));
|
||||
ExtraTrees.proxy.registerBlock(stairs);
|
||||
ExtraTrees.proxy.registerBlock(stairs_fireproof);
|
||||
|
||||
WoodAccess.getInstance().registerWithBlockState(stairs.getDefaultState(), stairs.getWoodKind(), type.getFirstValue(), true);
|
||||
WoodAccess.getInstance().registerWithBlockState(stairs_fireproof.getDefaultState(), stairs.getWoodKind(), type.getFirstValue(), false);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,25 @@
|
||||
package binnie.extratrees.block.stairs;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.arboriculture.blocks.BlockForestryStairs;
|
||||
import forestry.arboriculture.items.ItemBlockWood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemETStairs<V extends BlockETStairs> extends ItemBlock{
|
||||
public class ItemETStairs<B extends BlockForestryStairs<EnumExtraTreeLog>> extends ItemBlockWood<B>{
|
||||
|
||||
public ItemETStairs(final V block) {
|
||||
public ItemETStairs(B block) {
|
||||
super(block);
|
||||
setRegistryName(block.getRegistryName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
B wood = getBlock();
|
||||
int meta = itemstack.getMetadata();
|
||||
IWoodType woodType = wood.getWoodType(meta);
|
||||
return WoodManager.getDisplayName(wood, woodType);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,11 +54,7 @@ public class WoodProvider implements IWoodProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWoodStack() {
|
||||
if (type instanceof EnumExtraTreeLog) {
|
||||
return WoodAccess.getInstance().getStack(type, WoodBlockKind.LOG, false);
|
||||
} else {
|
||||
return TreeManager.woodAccess.getStack(type, WoodBlockKind.LOG, false);
|
||||
}
|
||||
return TreeManager.woodAccess.getStack(type, WoodBlockKind.LOG, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package binnie.extratrees.item;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.item.IItemMiscProvider;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.alcohol.Juice;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -121,15 +121,15 @@ public enum Food implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
public void addJuice(final Juice juice, final int time, final int amount, final int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(time, new ItemStack[]{this.get(1)}, Binnie.Liquid.getFluidStack("juice", amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
RecipeManagers.squeezerManager.addRecipe(time, new ItemStack[]{this.get(1)}, Fluids.JUICE.getFluid(amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
}
|
||||
|
||||
public void addJuice(final int time, final int amount, final int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(time, new ItemStack[]{this.get(1)}, Binnie.Liquid.getFluidStack("juice", amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
RecipeManagers.squeezerManager.addRecipe(time, new ItemStack[]{this.get(1)}, Fluids.JUICE.getFluid(amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
}
|
||||
|
||||
public void addOil(final int time, final int amount, final int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(time, new ItemStack[]{this.get(1)}, Binnie.Liquid.getFluidStack("seedoil", amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
RecipeManagers.squeezerManager.addRecipe(time, new ItemStack[]{this.get(1)}, Fluids.SEED_OIL.getFluid(amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
}
|
||||
|
||||
public static void registerOreDictionary() {
|
||||
|
||||
@@ -1,273 +0,0 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "cube_column"
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
"variants": {
|
||||
"normal":[{}],
|
||||
"inventory":[{}],
|
||||
"axis":{
|
||||
"x":{
|
||||
"x":90,
|
||||
"y":90
|
||||
},
|
||||
"y":{},
|
||||
"z":{
|
||||
"x":90
|
||||
},
|
||||
"none":{}
|
||||
},
|
||||
"wood_type":{
|
||||
"apple":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/appleTrunk",
|
||||
"side": "extratrees:blocks/logs/appleBark"
|
||||
}
|
||||
},
|
||||
"fig": {
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/figTrunk",
|
||||
"side": "extratrees:blocks/logs/figBark"
|
||||
}
|
||||
},
|
||||
"butternut":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/butternutTrunk",
|
||||
"side": "extratrees:blocks/logs/butternutBark"
|
||||
}
|
||||
},
|
||||
"cherry":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/cherryTrunk",
|
||||
"side": "extratrees:blocks/logs/cherryBark"
|
||||
}
|
||||
},
|
||||
"whitebeam":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/whitebeamTrunk",
|
||||
"side": "extratrees:blocks/logs/whitebeamBark"
|
||||
}
|
||||
},
|
||||
"rowan":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/rowanTrunk",
|
||||
"side": "extratrees:blocks/logs/rowanBark"
|
||||
}
|
||||
},
|
||||
"hemlock":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/hemlockTrunk",
|
||||
"side": "extratrees:blocks/logs/hemlockBark"
|
||||
}
|
||||
},
|
||||
"ash":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/ashTrunk",
|
||||
"side": "extratrees:blocks/logs/ashBark"
|
||||
}
|
||||
},
|
||||
"alder":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/alderTrunk",
|
||||
"side": "extratrees:blocks/logs/alderBark"
|
||||
}
|
||||
},
|
||||
"beech":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/beechTrunk",
|
||||
"side": "extratrees:blocks/logs/beechBark"
|
||||
}
|
||||
},
|
||||
"hawthorn":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/hawthornTrunk",
|
||||
"side": "extratrees:blocks/logs/hawthornBark"
|
||||
}
|
||||
},
|
||||
"banana":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/bananaTrunk",
|
||||
"side": "extratrees:blocks/logs/bananaBark"
|
||||
}
|
||||
},
|
||||
"yew":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/yewTrunk",
|
||||
"side": "extratrees:blocks/logs/yewBark"
|
||||
}
|
||||
},
|
||||
"cypress":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/cypressTrunk",
|
||||
"side": "extratrees:blocks/logs/cypressBark"
|
||||
}
|
||||
},
|
||||
"fir":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/firTrunk",
|
||||
"side": "extratrees:blocks/logs/firBark"
|
||||
}
|
||||
},
|
||||
"hazel":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/hazelTrunk",
|
||||
"side": "extratrees:blocks/logs/hazelBark"
|
||||
}
|
||||
},
|
||||
"hickory":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/hickoryTrunk",
|
||||
"side": "extratrees:blocks/logs/hickoryBark"
|
||||
}
|
||||
},
|
||||
"elm":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/elmTrunk",
|
||||
"side": "extratrees:blocks/logs/elmBark"
|
||||
}
|
||||
},
|
||||
"elder":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/elderTrunk",
|
||||
"side": "extratrees:blocks/logs/elderBark"
|
||||
}
|
||||
},
|
||||
"holly":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/hollyTrunk",
|
||||
"side": "extratrees:blocks/logs/hollyBark"
|
||||
}
|
||||
},
|
||||
"hornbeam":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/hornbeamTrunk",
|
||||
"side": "extratrees:blocks/logs/hornbeamBark"
|
||||
}
|
||||
},
|
||||
"cedar":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/cedarTrunk",
|
||||
"side": "extratrees:blocks/logs/cedarBark"
|
||||
}
|
||||
},
|
||||
"olive":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/oliveTrunk",
|
||||
"side": "extratrees:blocks/logs/oliveBark"
|
||||
}
|
||||
},
|
||||
"sweetgum":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/sweetgumTrunk",
|
||||
"side": "extratrees:blocks/logs/sweetgumBark"
|
||||
}
|
||||
},
|
||||
"locust":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/locustTrunk",
|
||||
"side": "extratrees:blocks/logs/locustBark"
|
||||
}
|
||||
},
|
||||
"pear":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/pearTrunk",
|
||||
"side": "extratrees:blocks/logs/pearBark"
|
||||
}
|
||||
},
|
||||
"maclura":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/macluraTrunk",
|
||||
"side": "extratrees:blocks/logs/macluraBark"
|
||||
}
|
||||
},
|
||||
"brazilwood":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/brazilwoodTrunk",
|
||||
"side": "extratrees:blocks/logs/brazilwoodBark"
|
||||
}
|
||||
},
|
||||
"logwood":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/logwoodTrunk",
|
||||
"side": "extratrees:blocks/logs/logwoodBark"
|
||||
}
|
||||
},
|
||||
"rosewood":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/rosewoodTrunk",
|
||||
"side": "extratrees:blocks/logs/rosewoodBark"
|
||||
}
|
||||
},
|
||||
"purpleheart":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/purpleheartTrunk",
|
||||
"side": "extratrees:blocks/logs/purpleheartBark"
|
||||
}
|
||||
},
|
||||
"iroko":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/irokoTrunk",
|
||||
"side": "extratrees:blocks/logs/irokoBark"
|
||||
}
|
||||
},
|
||||
"gingko":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/gingkoTrunk",
|
||||
"side": "extratrees:blocks/logs/gingkoBark"
|
||||
}
|
||||
},
|
||||
"eucalyptus":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/eucalyptusTrunk",
|
||||
"side": "extratrees:blocks/logs/eucalyptusBark"
|
||||
}
|
||||
},
|
||||
"eucalyptus2":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/eucalyptus2Trunk",
|
||||
"side": "extratrees:blocks/logs/eucalyptus2Bark"
|
||||
}
|
||||
},
|
||||
"box":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/boxTrunk",
|
||||
"side": "extratrees:blocks/logs/boxBark"
|
||||
}
|
||||
},
|
||||
"syzgium":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/syzgiumTrunk",
|
||||
"side": "extratrees:blocks/logs/syzgiumBark"
|
||||
}
|
||||
},
|
||||
"eucalyptus3":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/eucalyptus3Trunk",
|
||||
"side": "extratrees:blocks/logs/eucalyptus3Bark"
|
||||
}
|
||||
},
|
||||
"cinnamon": {
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/cinnamonTrunk",
|
||||
"side": "extratrees:blocks/logs/cinnamonBark"
|
||||
}
|
||||
},
|
||||
"pinkivory":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/pinkivoryTrunk",
|
||||
"side": "extratrees:blocks/logs/pinkivoryBark"
|
||||
}
|
||||
},
|
||||
"empty":{
|
||||
"textures": {
|
||||
"end": "extratrees:blocks/logs/emptyTrunk",
|
||||
"side": "extratrees:blocks/logs/emptyBark"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "cube_all"
|
||||
},
|
||||
|
||||
"variants": {
|
||||
"wood_type":{
|
||||
"apple":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Apple"
|
||||
}
|
||||
},
|
||||
"fig": {
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Fig"
|
||||
}
|
||||
},
|
||||
"butternut":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Butternut"
|
||||
}
|
||||
},
|
||||
"cherry":{
|
||||
"textures": {
|
||||
"all": "forestry:blocks/wood/planks.cherry"
|
||||
}
|
||||
},
|
||||
"whitebeam":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Whitebeam"
|
||||
}
|
||||
},
|
||||
"rowan":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Rowan"
|
||||
}
|
||||
},
|
||||
"hemlock":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hemlock"
|
||||
}
|
||||
},
|
||||
"ash":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Ash"
|
||||
}
|
||||
},
|
||||
"alder":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Alder"
|
||||
}
|
||||
},
|
||||
"beech":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Beech"
|
||||
}
|
||||
},
|
||||
"hawthorn":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hawthorn"
|
||||
}
|
||||
},
|
||||
"banana":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Banana"
|
||||
}
|
||||
},
|
||||
"yew":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Yew"
|
||||
}
|
||||
},
|
||||
"cypress":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Cypress"
|
||||
}
|
||||
},
|
||||
"fir":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Fir"
|
||||
}
|
||||
},
|
||||
"hazel":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hazel"
|
||||
}
|
||||
},
|
||||
"hickory":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hickory"
|
||||
}
|
||||
},
|
||||
"elm":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Elm"
|
||||
}
|
||||
},
|
||||
"elder":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Elder"
|
||||
}
|
||||
},
|
||||
"holly":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Holly"
|
||||
}
|
||||
},
|
||||
"hornbeam":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hornbeam"
|
||||
}
|
||||
},
|
||||
"cedar":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Cedar"
|
||||
}
|
||||
},
|
||||
"olive":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Olive"
|
||||
}
|
||||
},
|
||||
"sweetgum":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Sweetgum"
|
||||
}
|
||||
},
|
||||
"locust":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Locust"
|
||||
}
|
||||
},
|
||||
"pear":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Pear"
|
||||
}
|
||||
},
|
||||
"maclura":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Maclura"
|
||||
}
|
||||
},
|
||||
"brazilwood":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Brazilwood"
|
||||
}
|
||||
},
|
||||
"logwood":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Logwood"
|
||||
}
|
||||
},
|
||||
"rosewood":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Rosewood"
|
||||
}
|
||||
},
|
||||
"purpleheart":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Purpleheart"
|
||||
}
|
||||
},
|
||||
"iroko":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Iroko"
|
||||
}
|
||||
},
|
||||
"gingko":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Gingko"
|
||||
}
|
||||
},
|
||||
"eucalyptus":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Eucalyptus"
|
||||
}
|
||||
},
|
||||
"eucalyptus2":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Eucalyptus"
|
||||
}
|
||||
},
|
||||
"box":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Box"
|
||||
}
|
||||
},
|
||||
"syzgium":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Syzgium"
|
||||
}
|
||||
},
|
||||
"eucalyptus3":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Eucalyptus"
|
||||
}
|
||||
},
|
||||
"cinnamon": {
|
||||
"textures": {
|
||||
"all": "minecraft:blocks/planks_jungle"
|
||||
}
|
||||
},
|
||||
"pinkivory":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Pinkivory"
|
||||
}
|
||||
},
|
||||
"empty":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Empty"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,223 +0,0 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "extratrees:half_slab"
|
||||
},
|
||||
"variants": {
|
||||
"half": {
|
||||
"bottom": {
|
||||
"model": "extratrees:half_slab"
|
||||
},
|
||||
"top": {
|
||||
"model": "extratrees:upper_slab"
|
||||
}
|
||||
},
|
||||
"wood_type":{
|
||||
"apple":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Apple"
|
||||
}
|
||||
},
|
||||
"fig": {
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Fig"
|
||||
}
|
||||
},
|
||||
"butternut":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Butternut"
|
||||
}
|
||||
},
|
||||
"cherry":{
|
||||
"textures": {
|
||||
"all": "forestry:blocks/wood/planks.cherry"
|
||||
}
|
||||
},
|
||||
"whitebeam":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Whitebeam"
|
||||
}
|
||||
},
|
||||
"rowan":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Rowan"
|
||||
}
|
||||
},
|
||||
"hemlock":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hemlock"
|
||||
}
|
||||
},
|
||||
"ash":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Ash"
|
||||
}
|
||||
},
|
||||
"alder":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Alder"
|
||||
}
|
||||
},
|
||||
"beech":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Beech"
|
||||
}
|
||||
},
|
||||
"hawthorn":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hawthorn"
|
||||
}
|
||||
},
|
||||
"banana":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Banana"
|
||||
}
|
||||
},
|
||||
"yew":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Yew"
|
||||
}
|
||||
},
|
||||
"cypress":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Cypress"
|
||||
}
|
||||
},
|
||||
"fir":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Fir"
|
||||
}
|
||||
},
|
||||
"hazel":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hazel"
|
||||
}
|
||||
},
|
||||
"hickory":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hickory"
|
||||
}
|
||||
},
|
||||
"elm":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Elm"
|
||||
}
|
||||
},
|
||||
"elder":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Elder"
|
||||
}
|
||||
},
|
||||
"holly":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Holly"
|
||||
}
|
||||
},
|
||||
"hornbeam":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Hornbeam"
|
||||
}
|
||||
},
|
||||
"cedar":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Cedar"
|
||||
}
|
||||
},
|
||||
"olive":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Olive"
|
||||
}
|
||||
},
|
||||
"sweetgum":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Sweetgum"
|
||||
}
|
||||
},
|
||||
"locust":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Locust"
|
||||
}
|
||||
},
|
||||
"pear":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Pear"
|
||||
}
|
||||
},
|
||||
"maclura":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Maclura"
|
||||
}
|
||||
},
|
||||
"brazilwood":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Brazilwood"
|
||||
}
|
||||
},
|
||||
"logwood":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Logwood"
|
||||
}
|
||||
},
|
||||
"rosewood":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Rosewood"
|
||||
}
|
||||
},
|
||||
"purpleheart":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Purpleheart"
|
||||
}
|
||||
},
|
||||
"iroko":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Iroko"
|
||||
}
|
||||
},
|
||||
"gingko":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Gingko"
|
||||
}
|
||||
},
|
||||
"eucalyptus":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Eucalyptus"
|
||||
}
|
||||
},
|
||||
"eucalyptus2":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Eucalyptus"
|
||||
}
|
||||
},
|
||||
"box":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Box"
|
||||
}
|
||||
},
|
||||
"syzgium":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Syzgium"
|
||||
}
|
||||
},
|
||||
"eucalyptus3":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Eucalyptus"
|
||||
}
|
||||
},
|
||||
"cinnamon": {
|
||||
"textures": {
|
||||
"all": "minecraft:blocks/planks_jungle"
|
||||
}
|
||||
},
|
||||
"pinkivory":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Pinkivory"
|
||||
}
|
||||
},
|
||||
"empty":{
|
||||
"textures": {
|
||||
"all": "extratrees:blocks/planks/Empty"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"variants": {
|
||||
"facing=east,half=bottom,shape=straight": { "model": "extratrees:stairs" },
|
||||
"facing=west,half=bottom,shape=straight": { "model": "extratrees:stairs", "y": 180, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=straight": { "model": "extratrees:stairs", "y": 90, "uvlock": true },
|
||||
"facing=north,half=bottom,shape=straight": { "model": "extratrees:stairs", "y": 270, "uvlock": true },
|
||||
"facing=east,half=bottom,shape=outer_right": { "model": "extratrees:stairs_outer" },
|
||||
"facing=west,half=bottom,shape=outer_right": { "model": "extratrees:stairs_outer", "y": 180, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=outer_right": { "model": "extratrees:stairs_outer", "y": 90, "uvlock": true },
|
||||
"facing=north,half=bottom,shape=outer_right": { "model": "extratrees:stairs_outer", "y": 270, "uvlock": true },
|
||||
"facing=east,half=bottom,shape=outer_left": { "model": "extratrees:stairs_outer", "y": 270, "uvlock": true },
|
||||
"facing=west,half=bottom,shape=outer_left": { "model": "extratrees:stairs_outer", "y": 90, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=outer_left": { "model": "extratrees:stairs_outer" },
|
||||
"facing=north,half=bottom,shape=outer_left": { "model": "extratrees:stairs_outer", "y": 180, "uvlock": true },
|
||||
"facing=east,half=bottom,shape=inner_right": { "model": "extratrees:stairs_inner" },
|
||||
"facing=west,half=bottom,shape=inner_right": { "model": "extratrees:stairs_inner", "y": 180, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=inner_right": { "model": "extratrees:stairs_inner", "y": 90, "uvlock": true },
|
||||
"facing=north,half=bottom,shape=inner_right": { "model": "extratrees:stairs_inner", "y": 270, "uvlock": true },
|
||||
"facing=east,half=bottom,shape=inner_left": { "model": "extratrees:stairs_inner", "y": 270, "uvlock": true },
|
||||
"facing=west,half=bottom,shape=inner_left": { "model": "extratrees:stairs_inner", "y": 90, "uvlock": true },
|
||||
"facing=south,half=bottom,shape=inner_left": { "model": "extratrees:stairs_inner" },
|
||||
"facing=north,half=bottom,shape=inner_left": { "model": "extratrees:stairs_inner", "y": 180, "uvlock": true },
|
||||
"facing=east,half=top,shape=straight": { "model": "extratrees:stairs", "x": 180, "uvlock": true },
|
||||
"facing=west,half=top,shape=straight": { "model": "extratrees:stairs", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=south,half=top,shape=straight": { "model": "extratrees:stairs", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=north,half=top,shape=straight": { "model": "extratrees:stairs", "x": 180, "y": 270, "uvlock": true },
|
||||
"facing=east,half=top,shape=outer_right": { "model": "extratrees:stairs_outer", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=west,half=top,shape=outer_right": { "model": "extratrees:stairs_outer", "x": 180, "y": 270, "uvlock": true },
|
||||
"facing=south,half=top,shape=outer_right": { "model": "extratrees:stairs_outer", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=north,half=top,shape=outer_right": { "model": "extratrees:stairs_outer", "x": 180, "uvlock": true },
|
||||
"facing=east,half=top,shape=outer_left": { "model": "extratrees:stairs_outer", "x": 180, "uvlock": true },
|
||||
"facing=west,half=top,shape=outer_left": { "model": "extratrees:stairs_outer", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=south,half=top,shape=outer_left": { "model": "extratrees:stairs_outer", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=north,half=top,shape=outer_left": { "model": "extratrees:stairs_outer", "x": 180, "y": 270, "uvlock": true },
|
||||
"facing=east,half=top,shape=inner_right": { "model": "extratrees:stairs_inner", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=west,half=top,shape=inner_right": { "model": "extratrees:stairs_inner", "x": 180, "y": 270, "uvlock": true },
|
||||
"facing=south,half=top,shape=inner_right": { "model": "extratrees:stairs_inner", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=north,half=top,shape=inner_right": { "model": "extratrees:stairs_inner", "x": 180, "uvlock": true },
|
||||
"facing=east,half=top,shape=inner_left": { "model": "extratrees:stairs_inner", "x": 180, "uvlock": true },
|
||||
"facing=west,half=top,shape=inner_left": { "model": "extratrees:stairs_inner", "x": 180, "y": 180, "uvlock": true },
|
||||
"facing=south,half=top,shape=inner_left": { "model": "extratrees:stairs_inner", "x": 180, "y": 90, "uvlock": true },
|
||||
"facing=north,half=top,shape=inner_left": { "model": "extratrees:stairs_inner", "x": 180, "y": 270, "uvlock": true }
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{ "parent": "block/block",
|
||||
"textures": {
|
||||
"particle": "#all"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [ 0, 0, 0 ],
|
||||
"to": [ 16, 8, 16 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "down" },
|
||||
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#all" },
|
||||
"north": { "uv": [ 0, 8, 16, 16 ], "texture": "#all", "cullface": "north" },
|
||||
"south": { "uv": [ 0, 8, 16, 16 ], "texture": "#all", "cullface": "south" },
|
||||
"west": { "uv": [ 0, 8, 16, 16 ], "texture": "#all", "cullface": "west" },
|
||||
"east": { "uv": [ 0, 8, 16, 16 ], "texture": "#all", "cullface": "east" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"parent": "block/stairs",
|
||||
"textures": {
|
||||
"particle": "extratrees:blocks/planks/Apple",
|
||||
"side": "extratrees:blocks/planks/Apple",
|
||||
"top": "extratrees:blocks/planks/Apple",
|
||||
"bottom": "extratrees:blocks/planks/Apple"
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"parent": "block/inner_stairs",
|
||||
"textures": {
|
||||
"particle": "extratrees:blocks/planks/Apple",
|
||||
"side": "extratrees:blocks/planks/Apple",
|
||||
"top": "extratrees:blocks/planks/Apple",
|
||||
"bottom": "extratrees:blocks/planks/Apple"
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"parent": "block/outer_stairs",
|
||||
"textures": {
|
||||
"particle": "extratrees:blocks/planks/Apple",
|
||||
"side": "extratrees:blocks/planks/Apple",
|
||||
"top": "extratrees:blocks/planks/Apple",
|
||||
"bottom": "extratrees:blocks/planks/Apple"
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"textures": {
|
||||
"particle": "#all"
|
||||
},
|
||||
"elements": [
|
||||
{ "from": [ 0, 8, 0 ],
|
||||
"to": [ 16, 16, 16 ],
|
||||
"faces": {
|
||||
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#all" },
|
||||
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "up" },
|
||||
"north": { "uv": [ 0, 0, 16, 8 ], "texture": "#all", "cullface": "north" },
|
||||
"south": { "uv": [ 0, 0, 16, 8 ], "texture": "#all", "cullface": "south" },
|
||||
"west": { "uv": [ 0, 0, 16, 8 ], "texture": "#all", "cullface": "west" },
|
||||
"east": { "uv": [ 0, 0, 16, 8 ], "texture": "#all", "cullface": "east" }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user