mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-28 16:06:04 +00:00
Clean Up extra tree modules and add wood fences and fence gates
This commit is contained in:
1 parent
1276bd4b18
commit
7666e96542
182 files changed
+990
-1096
No files matched your search
@@ -4,23 +4,13 @@ import binnie.Constants;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.item.ItemMisc;
|
||||
import binnie.core.models.DoublePassBakedModel;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.proxy.IProxyCore;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extratrees.alcohol.ModuleAlcohol;
|
||||
import binnie.extratrees.alcohol.drink.ItemDrink;
|
||||
import binnie.extratrees.block.BlockETDecorativeLeaves;
|
||||
import binnie.extratrees.block.ModuleBlocks;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
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;
|
||||
import binnie.extratrees.config.ConfigurationMain;
|
||||
import binnie.extratrees.core.ExtraTreesGUID;
|
||||
@@ -32,11 +22,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;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
@@ -52,6 +38,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
@Mod(modid = Constants.EXTRA_TREES_MOD_ID, name = "Binnie's Extra Trees", useMetadata = true, dependencies = "required-after:" + Constants.CORE_MOD_ID)
|
||||
public class ExtraTrees extends AbstractMod {
|
||||
|
||||
@@ -59,43 +49,6 @@ public class ExtraTrees extends AbstractMod {
|
||||
public static ExtraTrees instance;
|
||||
@SidedProxy(clientSide = "binnie.extratrees.proxy.ProxyClient", serverSide = "binnie.extratrees.proxy.ProxyServer")
|
||||
public static Proxy proxy;
|
||||
public static Item itemDictionary;
|
||||
public static Item itemDictionaryLepi;
|
||||
public static ItemMisc 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 List<BlockETDecorativeLeaves> leavesDecorative;
|
||||
public static Map<String, ItemStack> speciesToLeavesDecorative;
|
||||
public static Block blockStairs;
|
||||
public static BlockCarpentry blockCarpentry;
|
||||
public static Block blockMachine;
|
||||
public static Block blockFence;
|
||||
public static BlockCarpentry blockPanel;
|
||||
public static Block blockKitchen;
|
||||
public static Item itemHammer;
|
||||
public static Item itemDurableHammer;
|
||||
public static Block blockGate;
|
||||
public static Block blockDoor;
|
||||
public static Block blockBranch;
|
||||
public static ItemDrink drink;
|
||||
public static BlockMultiFence blockMultiFence;
|
||||
public static Block blockDrink;
|
||||
public static BlockHedge blockHedge;
|
||||
public static BlockStainedDesign blockStained;
|
||||
public static int fruitPodRenderId;
|
||||
public static int doorRenderId;
|
||||
public static int branchRenderId;
|
||||
public static int fenceID;
|
||||
public static int stairsID;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onConstruction(FMLConstructionEvent e) {
|
||||
@@ -116,15 +69,52 @@ public class ExtraTrees extends AbstractMod {
|
||||
public void postInit(final FMLPostInitializationEvent evt) {
|
||||
this.postInit();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static ModuleBlocks blocks;
|
||||
@Nullable
|
||||
private static ModuleItems items;
|
||||
@Nullable
|
||||
private static ModuleAlcohol alcohol;
|
||||
@Nullable
|
||||
private static ModuleCarpentry carpentry;
|
||||
@Nullable
|
||||
private static ModuleMachine machine;
|
||||
|
||||
public static ModuleItems items() {
|
||||
Preconditions.checkState(items != null);
|
||||
return items;
|
||||
}
|
||||
|
||||
public static ModuleBlocks blocks() {
|
||||
Preconditions.checkState(blocks != null);
|
||||
return blocks;
|
||||
}
|
||||
|
||||
public static ModuleAlcohol alcohol() {
|
||||
Preconditions.checkState(alcohol != null);
|
||||
return alcohol;
|
||||
}
|
||||
|
||||
|
||||
public static ModuleCarpentry carpentry() {
|
||||
Preconditions.checkState(carpentry != null);
|
||||
return carpentry;
|
||||
}
|
||||
|
||||
public static ModuleMachine machine() {
|
||||
Preconditions.checkState(machine != null);
|
||||
return machine;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerModules() {
|
||||
this.addModule(new ModuleBlocks());
|
||||
this.addModule(new ModuleItems());
|
||||
this.addModule(new ModuleAlcohol());
|
||||
this.addModule(blocks = new ModuleBlocks());
|
||||
this.addModule(items = new ModuleItems());
|
||||
this.addModule(alcohol = new ModuleAlcohol());
|
||||
this.addModule(new ModuleGenetics());
|
||||
this.addModule(new ModuleCarpentry());
|
||||
this.addModule(new ModuleMachine());
|
||||
this.addModule(carpentry = new ModuleCarpentry());
|
||||
this.addModule(machine = new ModuleMachine());
|
||||
this.addModule(new ModuleCore());
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ public enum Alcohol implements IFluidType, ICocktailLiquid {
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getFluidStack(this.getIdentifier(), amount);
|
||||
return Binnie.LIQUID.getFluidStack(this.getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,7 +32,7 @@ public enum Glassware {
|
||||
if (liquid == null) {
|
||||
return ExtraTrees.proxy.localise("item.glassware." + this.name().toLowerCase());
|
||||
}
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "item.glassware." + this.name().toLowerCase() + ".usage", liquid);
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "item.glassware." + this.name().toLowerCase() + ".usage", liquid);
|
||||
}
|
||||
|
||||
public int getCapacity() {
|
||||
|
||||
@@ -90,7 +90,7 @@ public enum Juice implements IFluidType, ICocktailLiquid {
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getFluidStack(this.getIdentifier(), amount);
|
||||
return Binnie.LIQUID.getFluidStack(this.getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,7 +89,7 @@ public enum Liqueur implements IFluidType, ICocktailLiquid {
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getFluidStack(this.getIdentifier(), amount);
|
||||
return Binnie.LIQUID.getFluidStack(this.getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,7 +72,7 @@ public enum MiscFluid implements IFluidType, ICocktailLiquid {
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getFluidStack(this.getIdentifier(), amount);
|
||||
return Binnie.LIQUID.getFluidStack(this.getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ import binnie.extratrees.machines.distillery.DistilleryRecipes;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressRecipes;
|
||||
import forestry.api.recipes.ISqueezerRecipe;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -29,20 +29,22 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ModuleAlcohol implements IInitializable {
|
||||
public static ItemDrink drink;
|
||||
public static Block blockDrink;
|
||||
public static int drinkRendererID;
|
||||
public static BinnieIcon liquid;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
ModuleAlcohol.liquid = Binnie.Resource.getBlockIcon(ExtraTrees.instance, "liquids/liquid");
|
||||
ModuleAlcohol.liquid = Binnie.RESOURCE.getBlockIcon(ExtraTrees.instance, "liquids/liquid");
|
||||
//ModuleAlcohol.drinkRendererID = BinnieCore.proxy.getUniqueRenderID();
|
||||
ExtraTrees.drink = new ItemDrink();
|
||||
ExtraTrees.proxy.registerItem(ExtraTrees.drink);
|
||||
drink = new ItemDrink();
|
||||
ExtraTrees.proxy.registerItem(drink);
|
||||
//BinnieCore.proxy.registerCustomItemRenderer(ExtraTrees.drink, new CocktailRenderer());
|
||||
Binnie.Liquid.createLiquids(Juice.values(), ItemFluidContainer.LiquidJuice);
|
||||
Binnie.Liquid.createLiquids(Alcohol.values(), ItemFluidContainer.LiquidAlcohol);
|
||||
Binnie.Liquid.createLiquids(Spirit.values(), ItemFluidContainer.LiquidSpirit);
|
||||
Binnie.Liquid.createLiquids(Liqueur.values(), ItemFluidContainer.LiquidLiqueuer);
|
||||
Binnie.LIQUID.createLiquids(Juice.values(), ItemFluidContainer.LiquidJuice);
|
||||
Binnie.LIQUID.createLiquids(Alcohol.values(), ItemFluidContainer.LiquidAlcohol);
|
||||
Binnie.LIQUID.createLiquids(Spirit.values(), ItemFluidContainer.LiquidSpirit);
|
||||
Binnie.LIQUID.createLiquids(Liqueur.values(), ItemFluidContainer.LiquidLiqueuer);
|
||||
for (final Juice juice : Juice.values()) {
|
||||
Cocktail.registerIngredient(juice);
|
||||
}
|
||||
@@ -90,7 +92,7 @@ public class ModuleAlcohol implements IInitializable {
|
||||
}
|
||||
for (final Alcohol alcohol : Alcohol.values()) {
|
||||
for (final String fermentLiquid : alcohol.fermentationLiquid) {
|
||||
final FluidStack fluid = Binnie.Liquid.getFluidStack(fermentLiquid, Fluid.BUCKET_VOLUME);
|
||||
final FluidStack fluid = Binnie.LIQUID.getFluidStack(fermentLiquid, Fluid.BUCKET_VOLUME);
|
||||
if (fluid != null) {
|
||||
BreweryRecipes.addRecipe(fluid, alcohol.get(Fluid.BUCKET_VOLUME));
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public enum Spirit implements IFluidType, ICocktailLiquid {
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getFluidStack(this.getIdentifier(), amount);
|
||||
return Binnie.LIQUID.getFluidStack(this.getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,6 +54,6 @@ public class DrinkLiquid implements IDrinkLiquid {
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getFluidStack(this.ident, amount);
|
||||
return Binnie.LIQUID.getFluidStack(this.ident, amount);
|
||||
}
|
||||
}
|
||||
@@ -210,42 +210,32 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
// public boolean hasTileEntity(final int meta) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
|
||||
// super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
|
||||
// final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
|
||||
// return tileentity != null && tileentity.receiveClientEvent(par5, par6);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int id, int param) {
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
return tileentity != null && tileentity.receiveClientEvent(id, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack stack, final World world, final BlockPos pos, final EnumFacing clickedBlock) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
return tileMeta;
|
||||
public int getDroppedMeta(IBlockState state, int tileMetadata) {
|
||||
return tileMetadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack par1ItemStack) {
|
||||
public String getDisplayName(ItemStack par1ItemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
|
||||
final String typeName = getDoorType(meta).getName();
|
||||
final String woodName = WoodManager.getPlankType(meta & 0xFF).getName();
|
||||
if (typeName.equals("")) {
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.door.name", woodName);
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.door.name", woodName);
|
||||
}
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.door.name.adv", woodName, typeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(final World world, final BlockPos pos, final ItemStack drop) {
|
||||
//this.dropBlockAsItem(world, x, y, z, drop);
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.door.name.adv", woodName, typeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -256,11 +246,12 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
for (final IPlankType type : PlankType.ForestryPlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
}
|
||||
for (final IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
//TODO: extrabiomes 1.10.2
|
||||
/*for (final IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
for (final IPlankType type : PlankType.VanillaPlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
|
||||
public interface IPlankType extends IDesignMaterial {
|
||||
// IIcon getIcon();
|
||||
String getPlankTextureName();
|
||||
String getDescription();
|
||||
|
||||
IWoodType getWoodType();
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package binnie.extratrees.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.IInitializable;
|
||||
@@ -10,13 +12,12 @@ import binnie.core.block.ItemMetadata;
|
||||
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.slab.ItemETSlab;
|
||||
import binnie.extratrees.block.stairs.ItemETStairs;
|
||||
import binnie.extratrees.block.wood.BlockETFence;
|
||||
import binnie.extratrees.block.wood.BlockETLog;
|
||||
import binnie.extratrees.block.wood.BlockETPlank;
|
||||
import binnie.extratrees.block.wood.BlockETSlab;
|
||||
import binnie.extratrees.block.wood.ItemBlockETWood;
|
||||
import binnie.extratrees.block.wood.ItemETSlab;
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import binnie.extratrees.item.ExtraTreeLiquid;
|
||||
import forestry.api.arboriculture.EnumVanillaWoodType;
|
||||
@@ -26,6 +27,7 @@ import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.arboriculture.WoodAccess;
|
||||
import forestry.arboriculture.blocks.BlockForestryFenceGate;
|
||||
import forestry.arboriculture.blocks.BlockForestryStairs;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
@@ -46,67 +48,89 @@ import net.minecraftforge.oredict.RecipeSorter;
|
||||
public class ModuleBlocks implements IInitializable {
|
||||
// public static int hedgeRenderID;
|
||||
|
||||
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 List<BlockETFence> fences;
|
||||
public static List<BlockETFence> fencesFireproof;
|
||||
public static List<BlockForestryFenceGate> fenceGates;
|
||||
public static List<BlockForestryFenceGate> fenceGatesFireproof;
|
||||
public static List<BlockETDecorativeLeaves> leavesDecorative;
|
||||
public static Map<String, ItemStack> speciesToLeavesDecorative;
|
||||
public static Block blockDoor;
|
||||
public static BlockMultiFence blockMultiFence;
|
||||
public static BlockHedge blockHedge;
|
||||
//????
|
||||
public static Block blockBranch;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
PlankType.setup();
|
||||
|
||||
//TODO: clean up
|
||||
ExtraTrees.logs = BlockETLog.create(false);
|
||||
for (BlockETLog block : ExtraTrees.logs) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemETLog(block));
|
||||
logs = BlockETLog.create(false);
|
||||
for (BlockETLog block : logs) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
}
|
||||
|
||||
ExtraTrees.logsFireproof = BlockETLog.create(true);
|
||||
for (BlockETLog block : ExtraTrees.logsFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemETLog(block));
|
||||
logsFireproof = BlockETLog.create(true);
|
||||
for (BlockETLog block : logsFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
}
|
||||
|
||||
WoodAccess woodAccess = WoodAccess.getInstance();
|
||||
|
||||
woodAccess.registerLogs(ExtraTrees.logs);
|
||||
woodAccess.registerLogs(ExtraTrees.logsFireproof);
|
||||
woodAccess.registerLogs(logs);
|
||||
woodAccess.registerLogs(logsFireproof);
|
||||
|
||||
ExtraTrees.planks = BlockETPlank.create(false);
|
||||
for (BlockETPlank block : ExtraTrees.planks) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemETPlank(block));
|
||||
planks = BlockETPlank.create(false);
|
||||
for (BlockETPlank block : planks) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
registerOreDictWildcard(OreDictUtil.PLANK_WOOD, block);
|
||||
}
|
||||
|
||||
ExtraTrees.planksFireproof = BlockETPlank.create(true);
|
||||
for (BlockETPlank block : ExtraTrees.planksFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemETPlank(block));
|
||||
planksFireproof = BlockETPlank.create(true);
|
||||
for (BlockETPlank block : planksFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
registerOreDictWildcard(OreDictUtil.PLANK_WOOD, block);
|
||||
}
|
||||
|
||||
woodAccess.registerPlanks(ExtraTrees.planks);
|
||||
woodAccess.registerPlanks(ExtraTrees.planksFireproof);
|
||||
woodAccess.registerPlanks(planks);
|
||||
woodAccess.registerPlanks(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);
|
||||
slabs = BlockETSlab.create(false, false);
|
||||
slabsDouble = BlockETSlab.create(false, true);
|
||||
for (int i = 0; i < slabs.size(); i++) {
|
||||
BlockETSlab slab = slabs.get(i);
|
||||
BlockETSlab slabDouble = 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);
|
||||
slabsFireproof = BlockETSlab.create(true, false);
|
||||
slabsDoubleFireproof = BlockETSlab.create(true, true);
|
||||
for (int i = 0; i < slabsFireproof.size(); i++) {
|
||||
BlockETSlab slab = slabsFireproof.get(i);
|
||||
BlockETSlab slabDouble = 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);
|
||||
woodAccess.registerSlabs(slabs);
|
||||
woodAccess.registerSlabs(slabsFireproof);
|
||||
|
||||
ExtraTrees.stairs = new ArrayList<>();
|
||||
for (BlockETPlank plank : ExtraTrees.planks) {
|
||||
stairs = new ArrayList<>();
|
||||
for (BlockETPlank plank : planks) {
|
||||
for (IBlockState blockState : plank.getBlockState().getValidStates()) {
|
||||
int meta = plank.getMetaFromState(blockState);
|
||||
EnumExtraTreeLog woodType = plank.getWoodType(meta);
|
||||
@@ -115,61 +139,92 @@ public class ModuleBlocks implements IInitializable {
|
||||
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);
|
||||
ExtraTrees.proxy.registerBlock(stair, new ItemBlockETWood(stair));
|
||||
stairs.add(stair);
|
||||
registerOreDictWildcard(OreDictUtil.STAIR_WOOD, stair);
|
||||
}
|
||||
}
|
||||
|
||||
ExtraTrees.stairsFireproof = new ArrayList<>();
|
||||
for (BlockETPlank plank : ExtraTrees.planksFireproof) {
|
||||
stairsFireproof = new ArrayList<>();
|
||||
for (BlockETPlank plank : 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.setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
stair.setUnlocalizedName(name);
|
||||
ExtraTrees.proxy.registerBlock(stair, new ItemETStairs(stair));
|
||||
ExtraTrees.stairsFireproof.add(stair);
|
||||
ExtraTrees.proxy.registerBlock(stair, new ItemBlockETWood(stair));
|
||||
stairsFireproof.add(stair);
|
||||
registerOreDictWildcard(OreDictUtil.STAIR_WOOD, stair);
|
||||
}
|
||||
}
|
||||
|
||||
woodAccess.registerStairs(stairs);
|
||||
woodAccess.registerStairs(stairsFireproof);
|
||||
|
||||
fences = BlockETFence.create(false);
|
||||
for (BlockETFence block : fences) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_WOOD, block);
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", block.getRegistryName().toString());
|
||||
}
|
||||
|
||||
woodAccess.registerStairs(ExtraTrees.stairs);
|
||||
woodAccess.registerStairs(ExtraTrees.stairsFireproof);
|
||||
fencesFireproof = BlockETFence.create(true);
|
||||
for (BlockETFence block : fencesFireproof) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood(block));
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_WOOD, block);
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", block.getRegistryName().toString());
|
||||
}
|
||||
|
||||
woodAccess.registerFences(fences);
|
||||
woodAccess.registerFences(fencesFireproof);
|
||||
|
||||
fenceGates = new ArrayList<>();
|
||||
fenceGatesFireproof = new ArrayList<>();
|
||||
for (EnumExtraTreeLog woodType : EnumExtraTreeLog.VALUES) {
|
||||
BlockForestryFenceGate fenceGate = new BlockForestryFenceGate<>(false, woodType);
|
||||
String name = "fence.gates." + woodType;
|
||||
fenceGate.setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
fenceGate.setUnlocalizedName(name);
|
||||
ExtraTrees.proxy.registerBlock(fenceGate, new ItemBlockETWood(fenceGate));
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_GATE_WOOD, fenceGate);
|
||||
fenceGates.add(fenceGate);
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", fenceGate.getRegistryName().toString());
|
||||
|
||||
ExtraTrees.blockFence = new BlockFence("fence");
|
||||
ExtraTrees.blockGate = new BlockGate();
|
||||
ExtraTrees.blockDoor = new BlockETDoor();
|
||||
ExtraTrees.blockMultiFence = new BlockMultiFence();
|
||||
GameRegistry.register(ExtraTrees.blockFence);
|
||||
GameRegistry.register(new ItemMetadata(ExtraTrees.blockFence).setRegistryName(ExtraTrees.blockFence.getRegistryName()));
|
||||
GameRegistry.register(ExtraTrees.blockMultiFence);
|
||||
GameRegistry.register(new ItemMetadata(ExtraTrees.blockMultiFence).setRegistryName(ExtraTrees.blockMultiFence.getRegistryName()));
|
||||
BlockForestryFenceGate fenceGateFireproof = new BlockForestryFenceGate<>(true, woodType);
|
||||
String nameFireproof = "fence.gates.fireproof." + woodType;
|
||||
fenceGateFireproof.setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, nameFireproof));
|
||||
fenceGateFireproof.setUnlocalizedName(nameFireproof);
|
||||
ExtraTrees.proxy.registerBlock(fenceGateFireproof, new ItemBlockETWood(fenceGateFireproof));
|
||||
registerOreDictWildcard(OreDictUtil.FENCE_GATE_WOOD, fenceGateFireproof);
|
||||
fenceGatesFireproof.add(fenceGateFireproof);
|
||||
FMLInterModComms.sendMessage("forestry", "add-fence-block", fenceGateFireproof.getRegistryName().toString());
|
||||
}
|
||||
|
||||
woodAccess.registerFenceGates(fenceGates);
|
||||
woodAccess.registerFenceGates(fenceGatesFireproof);
|
||||
|
||||
blockMultiFence = new BlockMultiFence();
|
||||
GameRegistry.register(blockMultiFence);
|
||||
GameRegistry.register(new ItemMetadata(blockMultiFence).setRegistryName(blockMultiFence.getRegistryName()));
|
||||
//BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockMultiFence), new ItemMetadataRenderer());
|
||||
|
||||
GameRegistry.register(ExtraTrees.blockGate);
|
||||
GameRegistry.register(new ItemMetadata(ExtraTrees.blockGate).setRegistryName(ExtraTrees.blockGate.getRegistryName()));
|
||||
GameRegistry.register(ExtraTrees.blockDoor);
|
||||
GameRegistry.register(new ItemETDoor(ExtraTrees.blockDoor).setRegistryName(ExtraTrees.blockDoor.getRegistryName()));
|
||||
// GameRegistry.register(ExtraTrees.blockStairs);
|
||||
// GameRegistry.register(new ItemETStairs(ExtraTrees.blockStairs).setRegistryName(ExtraTrees.blockStairs.getRegistryName()));
|
||||
blockDoor = new BlockETDoor();
|
||||
GameRegistry.register(blockDoor);
|
||||
GameRegistry.register(new ItemETDoor(blockDoor).setRegistryName(blockDoor.getRegistryName()));
|
||||
//BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStairs), new StairItemRenderer());
|
||||
//BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockGate), new GateItemRenderer());
|
||||
for (BlockETLog log : ExtraTrees.logs) {
|
||||
for (BlockETLog log : logs) {
|
||||
ItemStack logInput = new ItemStack(log, 1, OreDictionary.WILDCARD_VALUE);
|
||||
ItemStack coalOutput = new ItemStack(Items.COAL, 1, 1);
|
||||
RecipeUtil.addSmelting(logInput, coalOutput, 0.15F);
|
||||
}
|
||||
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();
|
||||
ExtraTrees.leavesDecorative = BlockETDecorativeLeaves.create();
|
||||
ExtraTrees.speciesToLeavesDecorative = new HashMap<>();
|
||||
for (BlockETDecorativeLeaves leaves : ExtraTrees.leavesDecorative) {
|
||||
leavesDecorative = BlockETDecorativeLeaves.create();
|
||||
speciesToLeavesDecorative = new HashMap<>();
|
||||
for (BlockETDecorativeLeaves leaves : leavesDecorative) {
|
||||
ExtraTrees.proxy.registerBlock(leaves, new ItemBlockETDecorativeLeaves(leaves));
|
||||
registerOreDictWildcard(OreDictUtil.TREE_LEAVES, leaves);
|
||||
|
||||
@@ -177,7 +232,7 @@ public class ModuleBlocks implements IInitializable {
|
||||
ETTreeDefinition treeDefinition = state.getValue(leaves.getVariant());
|
||||
String speciesUid = treeDefinition.getUID();
|
||||
int meta = leaves.getMetaFromState(state);
|
||||
ExtraTrees.speciesToLeavesDecorative.put(speciesUid, new ItemStack(leaves, 1, meta));
|
||||
speciesToLeavesDecorative.put(speciesUid, new ItemStack(leaves, 1, meta));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,7 +318,8 @@ public class ModuleBlocks implements IInitializable {
|
||||
}
|
||||
|
||||
public static ItemStack getDecorativeLeaves(String speciesUid) {
|
||||
ItemStack itemStack = ExtraTrees.speciesToLeavesDecorative.get(speciesUid);
|
||||
ExtraTrees.blocks();
|
||||
ItemStack itemStack = ModuleBlocks.speciesToLeavesDecorative.get(speciesUid);
|
||||
if (itemStack == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.api.CarpentryManager;
|
||||
import com.google.common.base.Optional;
|
||||
import forestry.api.arboriculture.EnumForestryWoodType;
|
||||
import forestry.api.arboriculture.EnumVanillaWoodType;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
@@ -27,9 +24,9 @@ public class PlankType {
|
||||
for (final ForestryPlanks plank3 : ForestryPlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank3.ordinal() + 128, plank3);
|
||||
}
|
||||
for (final ExtraBiomesPlank plank4 : ExtraBiomesPlank.values()) {
|
||||
/*for (final ExtraBiomesPlank plank4 : ExtraBiomesPlank.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank4.ordinal() + 192, plank4);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public enum ExtraTreePlanks implements IPlankType, IFenceProvider, IStringSerializable {
|
||||
@@ -123,6 +120,7 @@ public class PlankType {
|
||||
this.woodType = woodType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWoodType getWoodType() {
|
||||
return woodType;
|
||||
}
|
||||
@@ -168,7 +166,7 @@ public class PlankType {
|
||||
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockFence, WoodManager.getPlankTypeIndex(this));
|
||||
return TreeManager.woodAccess.getStack(woodType, WoodBlockKind.FENCE, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,6 +210,11 @@ public class PlankType {
|
||||
public ItemStack getStack() {
|
||||
return getStack(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWoodType getWoodType() {
|
||||
return woodType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack(boolean fireproof) {
|
||||
@@ -288,6 +291,11 @@ public class PlankType {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWoodType getWoodType() {
|
||||
return woodType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack(boolean fireproof) {
|
||||
return TreeManager.woodAccess.getStack(woodType, WoodBlockKind.PLANKS, fireproof);
|
||||
@@ -314,7 +322,9 @@ public class PlankType {
|
||||
}
|
||||
}
|
||||
|
||||
public enum ExtraBiomesPlank implements IPlankType {
|
||||
|
||||
//TODO: extrabiomes 1.10.2
|
||||
/*public enum ExtraBiomesPlank implements IPlankType {
|
||||
Redwood(10185538),
|
||||
Fir(8288074),
|
||||
Acacia(12561022);
|
||||
@@ -377,5 +387,5 @@ public class PlankType {
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
//import net.minecraft.util.IIcon;
|
||||
|
||||
public class StairItemRenderer// implements IItemRenderer
|
||||
{
|
||||
// private void renderStairBlock(final RenderBlocks renderBlocks, final ItemStack item, final float f, final float g, final float h) {
|
||||
// final Tessellator tessellator = Tessellator.instance;
|
||||
// final Block block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
// final IIcon textureIndex = PlankType.ExtraTreePlanks.values()[item.getItemDamage()].getIcon();
|
||||
// for (int i = 0; i < 2; ++i) {
|
||||
// if (i == 0) {
|
||||
// renderBlocks.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 0.5);
|
||||
// }
|
||||
// if (i == 1) {
|
||||
// renderBlocks.setRenderBounds(0.0, 0.0, 0.5, 1.0, 0.5, 1.0);
|
||||
// }
|
||||
// GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(0.0f, -1.0f, 0.0f);
|
||||
// renderBlocks.renderFaceYNeg(block, 0.0, 0.0, 0.0, textureIndex);
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(0.0f, 1.0f, 0.0f);
|
||||
// renderBlocks.renderFaceYPos(block, 0.0, 0.0, 0.0, textureIndex);
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(0.0f, 0.0f, -1.0f);
|
||||
// renderBlocks.renderFaceXNeg(block, 0.0, 0.0, 0.0, textureIndex);
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(0.0f, 0.0f, 1.0f);
|
||||
// renderBlocks.renderFaceXPos(block, 0.0, 0.0, 0.0, textureIndex);
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(-1.0f, 0.0f, 0.0f);
|
||||
// renderBlocks.renderFaceZNeg(block, 0.0, 0.0, 0.0, textureIndex);
|
||||
// tessellator.draw();
|
||||
// tessellator.startDrawingQuads();
|
||||
// tessellator.setNormal(1.0f, 0.0f, 0.0f);
|
||||
// renderBlocks.renderFaceZPos(block, 0.0, 0.0, 0.0, textureIndex);
|
||||
// tessellator.draw();
|
||||
// GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean handleRenderType(final ItemStack item, final IItemRenderer.ItemRenderType type) {
|
||||
// switch (type) {
|
||||
// case ENTITY: {
|
||||
// return true;
|
||||
// }
|
||||
// case EQUIPPED: {
|
||||
// return true;
|
||||
// }
|
||||
// case INVENTORY: {
|
||||
// return true;
|
||||
// }
|
||||
// default: {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean shouldUseRenderHelper(final IItemRenderer.ItemRenderType type, final ItemStack item, final IItemRenderer.ItemRendererHelper helper) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
|
||||
// switch (type) {
|
||||
// case ENTITY: {
|
||||
// this.renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
// break;
|
||||
// }
|
||||
// case EQUIPPED: {
|
||||
// this.renderStairBlock((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
|
||||
// break;
|
||||
// }
|
||||
// case INVENTORY: {
|
||||
// this.renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
public class StairsRenderer //implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
// @Override
|
||||
// public void renderInventoryBlock(final Block par1Block, final int metadata, final int modelID, final RenderBlocks renderer) {
|
||||
// final Tessellator var4 = Tessellator.instance;
|
||||
// for (int var5 = 0; var5 < 2; ++var5) {
|
||||
// if (var5 == 0) {
|
||||
// renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 0.5);
|
||||
// }
|
||||
// if (var5 == 1) {
|
||||
// renderer.setRenderBounds(0.0, 0.0, 0.5, 1.0, 0.5, 1.0);
|
||||
// }
|
||||
// GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
// var4.startDrawingQuads();
|
||||
// var4.setNormal(0.0f, -1.0f, 0.0f);
|
||||
// renderer.renderFaceYNeg(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(0, metadata));
|
||||
// var4.draw();
|
||||
// var4.startDrawingQuads();
|
||||
// var4.setNormal(0.0f, 1.0f, 0.0f);
|
||||
// renderer.renderFaceYPos(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(1, metadata));
|
||||
// var4.draw();
|
||||
// var4.startDrawingQuads();
|
||||
// var4.setNormal(0.0f, 0.0f, -1.0f);
|
||||
// renderer.renderFaceXPos(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(2, metadata));
|
||||
// var4.draw();
|
||||
// var4.startDrawingQuads();
|
||||
// var4.setNormal(0.0f, 0.0f, 1.0f);
|
||||
// renderer.renderFaceXNeg(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(3, metadata));
|
||||
// var4.draw();
|
||||
// var4.startDrawingQuads();
|
||||
// var4.setNormal(-1.0f, 0.0f, 0.0f);
|
||||
// renderer.renderFaceZNeg(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(4, metadata));
|
||||
// var4.draw();
|
||||
// var4.startDrawingQuads();
|
||||
// var4.setNormal(1.0f, 0.0f, 0.0f);
|
||||
// renderer.renderFaceZPos(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(5, metadata));
|
||||
// var4.draw();
|
||||
// GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block block, final int modelId, final RenderBlocks renderer) {
|
||||
// final BlockETStairs blockStairs = (BlockETStairs) block;
|
||||
// blockStairs.func_150147_e(renderer.blockAccess, par2, par3, par4);
|
||||
// renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
// renderer.renderStandardBlock(blockStairs, par2, par3, par4);
|
||||
// final boolean var5 = blockStairs.func_150145_f(renderer.blockAccess, par2, par3, par4);
|
||||
// renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
// renderer.renderStandardBlock(blockStairs, par2, par3, par4);
|
||||
// if (var5 && blockStairs.func_150144_g(renderer.blockAccess, par2, par3, par4)) {
|
||||
// renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
// renderer.renderStandardBlock(blockStairs, par2, par3, par4);
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean shouldRender3DInInventory(final int i) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getRenderId() {
|
||||
// return ExtraTrees.stairsID;
|
||||
// }
|
||||
}
|
||||
@@ -7,6 +7,7 @@ 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.TreeManager;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.core.utils.Translator;
|
||||
@@ -70,7 +71,8 @@ public class WoodManager {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
if (stack.getItem() == Item.getItemFromBlock(ExtraTrees.blockMultiFence)) {
|
||||
ExtraTrees.blocks();
|
||||
if (stack.getItem() == Item.getItemFromBlock(ModuleBlocks.blockMultiFence)) {
|
||||
final int damage = TileEntityMetadata.getItemDamage(stack);
|
||||
return getFenceDescription(damage);
|
||||
}
|
||||
@@ -98,7 +100,7 @@ public class WoodManager {
|
||||
if (plank == PlankType.VanillaPlanks.OAK) {
|
||||
return new ItemStack(Blocks.OAK_FENCE_GATE);
|
||||
}
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockGate, getPlankTypeIndex(plank));
|
||||
return TreeManager.woodAccess.getStack(plank.getWoodType(), WoodBlockKind.FENCE_GATE, false);
|
||||
}
|
||||
|
||||
public static ItemStack getFence(final IPlankType plank, final FenceType type, final int amount) {
|
||||
@@ -115,24 +117,27 @@ public class WoodManager {
|
||||
}
|
||||
final int ord = type.ordinal();
|
||||
final int i = getPlankTypeIndex(plank) + 256 * ord;
|
||||
final ItemStack stack = TileEntityMetadata.getItemStack(ExtraTrees.blockMultiFence, i + 65536 * getPlankTypeIndex(plank2));
|
||||
ExtraTrees.blocks();
|
||||
final ItemStack stack = TileEntityMetadata.getItemStack(ModuleBlocks.blockMultiFence, i + 65536 * getPlankTypeIndex(plank2));
|
||||
stack.stackSize = amount;
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ItemStack getDoor(final IPlankType plank, final DoorType type) {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockDoor, type.ordinal() * 256 + getPlankTypeIndex(plank));
|
||||
ExtraTrees.blocks();
|
||||
return TileEntityMetadata.getItemStack(ModuleBlocks.blockDoor, type.ordinal() * 256 + getPlankTypeIndex(plank));
|
||||
}
|
||||
|
||||
public static List<IPlankType> getAllPlankTypes() {
|
||||
final List<IPlankType> list = new ArrayList<>();
|
||||
Collections.addAll(list, PlankType.ExtraTreePlanks.values());
|
||||
Collections.addAll(list, PlankType.ForestryPlanks.values());
|
||||
for (final IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
//TODO: extrabiomes 1.10.2
|
||||
/*for (final IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
list.add(type);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
Collections.addAll(list, PlankType.VanillaPlanks.values());
|
||||
return list;
|
||||
}
|
||||
|
||||
+37
-38
@@ -1,6 +1,7 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
@@ -10,25 +11,28 @@ import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.block.BlockPlanks;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockGate extends BlockFenceGate implements IBlockMetadata {
|
||||
public BlockGate() {
|
||||
public class BlockETFenceGate extends BlockFenceGate implements IBlockMetadata {
|
||||
public BlockETFenceGate() {
|
||||
super(BlockPlanks.EnumType.OAK);
|
||||
this.setCreativeTab(Tabs.tabArboriculture);
|
||||
this.setResistance(5.0f);
|
||||
this.setHardness(2.0f);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
setRegistryName("blockGate");
|
||||
setRegistryName("gate");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,11 +60,6 @@ public class BlockGate extends BlockFenceGate implements IBlockMetadata {
|
||||
// return WoodManager.getPlankType(meta).getIcon();
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void dropAsStack(final World world, final BlockPos pos, final ItemStack drop) {
|
||||
//this.dropBlockAsItem(world, x, y, z, drop);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
||||
// return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
@@ -76,44 +75,39 @@ public class BlockGate extends BlockFenceGate implements IBlockMetadata {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean hasTileEntity(final int meta) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
|
||||
// super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
|
||||
// final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
|
||||
// return tileentity != null && tileentity.receiveClientEvent(par5, par6);
|
||||
// }
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int id, int param) {
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
return tileentity != null && tileentity.receiveClientEvent(id, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack stack, final World world, final BlockPos pos, final EnumFacing clickedBlock) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
return tileMeta;
|
||||
public int getDroppedMeta(IBlockState state, int tileMetadata) {
|
||||
return tileMetadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack par1ItemStack) {
|
||||
public String getDisplayName(final ItemStack par1ItemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
super.breakBlock(world, pos, state);
|
||||
world.removeTileEntity(pos);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
|
||||
// super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
// par1World.removeTileEntity(par2, par3, par4);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
@@ -133,14 +127,19 @@ public class BlockGate extends BlockFenceGate implements IBlockMetadata {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, pos);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
||||
// return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public boolean getBlocksMovement(final IBlockAccess p_149655_1_, final int p_149655_2_, final int p_149655_3_, final int p_149655_4_) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean isPassable(IBlockAccess worldIn, BlockPos pos){
|
||||
return worldIn.getBlockState(pos).getValue(OPEN).booleanValue();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
@@ -8,16 +9,22 @@ import binnie.extratrees.block.IFenceProvider;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -63,38 +70,32 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
// public int getRenderType() {
|
||||
// return ExtraTrees.fenceID;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void dropAsStack(final World world, final BlockPos pos, final ItemStack drop) {
|
||||
//this.dropBlockAsItem(world, x, y, z, drop);
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int id, int param) {
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
return tileentity != null && tileentity.receiveClientEvent(id, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
return BlockMetadata.getBlockDroppedAsList(this, world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, pos);
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
// public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
||||
// return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
// return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean hasTileEntity(final int meta) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
|
||||
// super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
|
||||
// final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
|
||||
// return tileentity != null && tileentity.receiveClientEvent(par5, par6);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack stack, final World world, final BlockPos pos, final EnumFacing clickedBlock) {
|
||||
@@ -102,50 +103,47 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
public int getDroppedMeta(IBlockState state, final int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack par1ItemStack) {
|
||||
public String getDisplayName(final ItemStack par1ItemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodfence.name", this.getDescription(meta).getPlankType().getName());
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.woodfence.name", this.getDescription(meta).getPlankType().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if (PluginArboriculture.validFences.contains(block)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
|
||||
// if (!this.isFence(world, x, y, z)) {
|
||||
// final Block block = world.getBlock(x, y, z);
|
||||
// return block != null && block.getMaterial().isOpaque() && block.renderAsNormalBlock();
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// public boolean isFence(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
// final Block block = world.getBlock(x, y, z);
|
||||
// return canConnect(block);
|
||||
// }
|
||||
|
||||
// public static boolean canConnect(final Block block) {
|
||||
// return block == ((ItemBlock) Mods.Forestry.item("fences")).field_150939_a || block == Blocks.fence || block == Blocks.fence_gate || block == Blocks.nether_brick_fence || block instanceof IBlockFence || block == ExtraTrees.blockGate;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
|
||||
// super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
// par1World.removeTileEntity(par2, par3, par4);
|
||||
// }
|
||||
if (block != Blocks.BARRIER) {
|
||||
Material blockMaterial = block.getMaterial(state);
|
||||
if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof IBlockFence) {
|
||||
return blockMaterial == this.blockMaterial;
|
||||
}
|
||||
if (blockMaterial.isOpaque() && state.isFullCube() && blockMaterial != Material.GOURD) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
super.breakBlock(world, pos, state);
|
||||
world.removeTileEntity(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(final IBlockAccess world, final BlockPos pos) {
|
||||
return true;
|
||||
@@ -170,11 +168,10 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerBlockIcons(final IIconRegister p_149651_1_) {
|
||||
// }
|
||||
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
// return BlockMetadata.getPickBlock(state, target, world, pos, player);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, pos);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,144 +1,165 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import forestry.api.arboriculture.EnumLeafType;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockHedge extends Block implements IBlockFence {
|
||||
public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
public BlockHedge() {
|
||||
super(Material.LEAVES);
|
||||
this.setCreativeTab(Tabs.tabArboriculture);
|
||||
this.setRegistryName("hedge");
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void addCollisionBoxesToList(final World world, final int x, final int y, final int z, final AxisAlignedBB aabb, final List list, final Entity p_149743_7_) {
|
||||
// final boolean connectNegZ = this.canConnectFenceTo(world, x, y, z - 1);
|
||||
// final boolean connectPosZ = this.canConnectFenceTo(world, x, y, z + 1);
|
||||
// final boolean connectNegX = this.canConnectFenceTo(world, x - 1, y, z);
|
||||
// final boolean connectPosX = this.canConnectFenceTo(world, x + 1, y, z);
|
||||
// float f = 0.25f;
|
||||
// float f2 = 0.75f;
|
||||
// float f3 = 0.25f;
|
||||
// float f4 = 0.75f;
|
||||
// if (connectNegZ) {
|
||||
// f3 = 0.0f;
|
||||
// }
|
||||
// if (connectPosZ) {
|
||||
// f4 = 1.0f;
|
||||
// }
|
||||
// if (connectNegZ || connectPosZ) {
|
||||
// this.setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
|
||||
// super.addCollisionBoxesToList(world, x, y, z, aabb, list, p_149743_7_);
|
||||
// }
|
||||
// f3 = 0.25f;
|
||||
// f4 = 0.75f;
|
||||
// if (connectNegX) {
|
||||
// f = 0.0f;
|
||||
// }
|
||||
// if (connectPosX) {
|
||||
// f2 = 1.0f;
|
||||
// }
|
||||
// if (connectNegX || connectPosX || (!connectNegZ && !connectPosZ)) {
|
||||
// this.setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
|
||||
// super.addCollisionBoxesToList(world, x, y, z, aabb, list, p_149743_7_);
|
||||
// }
|
||||
// if (connectNegZ) {
|
||||
// f3 = 0.0f;
|
||||
// }
|
||||
// if (connectPosZ) {
|
||||
// f4 = 1.0f;
|
||||
// }
|
||||
// this.setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
// }
|
||||
@Override
|
||||
public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn) {
|
||||
final boolean connectNegZ = this.canConnectFenceTo(world, pos.north());
|
||||
final boolean connectPosZ = this.canConnectFenceTo(world, pos.south());
|
||||
final boolean connectNegX = this.canConnectFenceTo(world, pos.west());
|
||||
final boolean connectPosX = this.canConnectFenceTo(world, pos.east());
|
||||
float f = 0.25f;
|
||||
float f2 = 0.75f;
|
||||
float f3 = 0.25f;
|
||||
float f4 = 0.75f;
|
||||
if (connectNegZ) {
|
||||
f3 = 0.0f;
|
||||
}
|
||||
if (connectPosZ) {
|
||||
f4 = 1.0f;
|
||||
}
|
||||
if (connectNegZ || connectPosZ) {
|
||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, 0.0f, f3, f2, 1.5f, f4));
|
||||
}
|
||||
f3 = 0.25f;
|
||||
f4 = 0.75f;
|
||||
if (connectNegX) {
|
||||
f = 0.0f;
|
||||
}
|
||||
if (connectPosX) {
|
||||
f2 = 1.0f;
|
||||
}
|
||||
if (connectNegX || connectPosX || (!connectNegZ && !connectPosZ)) {
|
||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, 0.0f, f3, f2, 1.5f, f4));
|
||||
}
|
||||
if (connectNegZ) {
|
||||
f3 = 0.0f;
|
||||
}
|
||||
if (connectPosZ) {
|
||||
f4 = 1.0f;
|
||||
}
|
||||
addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, 0.0f, f3, f2, 1.0f, f4));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
final boolean connectNegZ = this.canConnectFenceTo(world, pos.north());
|
||||
final boolean connectPosZ = this.canConnectFenceTo(world, pos.south());
|
||||
final boolean connectNegX = this.canConnectFenceTo(world, pos.west());
|
||||
final boolean connectPosX = this.canConnectFenceTo(world, pos.east());
|
||||
float f = 0.25f;
|
||||
float f2 = 0.75f;
|
||||
float f3 = 0.25f;
|
||||
float f4 = 0.75f;
|
||||
if (connectNegZ) {
|
||||
f3 = 0.0f;
|
||||
}
|
||||
if (connectPosZ) {
|
||||
f4 = 1.0f;
|
||||
}
|
||||
if (connectNegX) {
|
||||
f = 0.0f;
|
||||
}
|
||||
if (connectPosX) {
|
||||
f2 = 1.0f;
|
||||
}
|
||||
return new AxisAlignedBB(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPassable(IBlockAccess worldIn, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void setBlockBoundsBasedOnState(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
// final boolean connectNegZ = this.canConnectFenceTo(world, x, y, z - 1);
|
||||
// final boolean connectPosZ = this.canConnectFenceTo(world, x, y, z + 1);
|
||||
// final boolean connectNegX = this.canConnectFenceTo(world, x - 1, y, z);
|
||||
// final boolean connectPosX = this.canConnectFenceTo(world, x + 1, y, z);
|
||||
// float f = 0.25f;
|
||||
// float f2 = 0.75f;
|
||||
// float f3 = 0.25f;
|
||||
// float f4 = 0.75f;
|
||||
// if (connectNegZ) {
|
||||
// f3 = 0.0f;
|
||||
// }
|
||||
// if (connectPosZ) {
|
||||
// f4 = 1.0f;
|
||||
// }
|
||||
// if (connectNegX) {
|
||||
// f = 0.0f;
|
||||
// }
|
||||
// if (connectPosX) {
|
||||
// f2 = 1.0f;
|
||||
// }
|
||||
// this.setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
// }
|
||||
/*@Override
|
||||
public int getRenderType() {
|
||||
return ModuleBlocks.hedgeRenderID;
|
||||
}*/
|
||||
|
||||
// @Override
|
||||
// public boolean isOpaqueCube() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean renderAsNormalBlock() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean getBlocksMovement(final IBlockAccess p_149655_1_, final int p_149655_2_, final int p_149655_3_, final int p_149655_4_) {
|
||||
// return false;
|
||||
// }
|
||||
public boolean canConnectFenceTo(IBlockAccess world, BlockPos pos) {
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
return block == this || canConnectTo(world, pos) || block.isLeaves(state, world, pos) || (state.getMaterial().isOpaque() && state.isFullCube() && state.getMaterial() != Material.GOURD);
|
||||
}
|
||||
|
||||
private boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if (PluginArboriculture.validFences.contains(block)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int getRenderType() {
|
||||
// return ModuleBlocks.hedgeRenderID;
|
||||
// }
|
||||
//
|
||||
// public boolean canConnectFenceTo(final IBlockAccess p_149826_1_, final int p_149826_2_, final int p_149826_3_, final int p_149826_4_) {
|
||||
// final Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_);
|
||||
// return block == this || block == Blocks.fence_gate || func_149825_a(block) || block.isLeaves(p_149826_1_, p_149826_2_, p_149826_3_, p_149826_4_) || (block.getMaterial().isOpaque() && block.renderAsNormalBlock() && block.getMaterial() != Material.gourd);
|
||||
// }
|
||||
//
|
||||
// public static boolean func_149825_a(final Block p_149825_0_) {
|
||||
// return BlockFence.canConnect(p_149825_0_);
|
||||
// }
|
||||
if (block != Blocks.BARRIER) {
|
||||
Material blockMaterial = block.getMaterial(state);
|
||||
if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof IBlockFence) {
|
||||
return blockMaterial == this.blockMaterial;
|
||||
}
|
||||
if (blockMaterial.isOpaque() && state.isFullCube() && blockMaterial != Material.GOURD) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public boolean shouldSideBeRendered(final IBlockAccess p_149646_1_, final int p_149646_2_, final int p_149646_3_, final int p_149646_4_, final int p_149646_5_) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerBlockIcons(final IIconRegister p_149651_1_) {
|
||||
// }
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// private ExtraTreeSpecies.LeafType getType(final int meta) {
|
||||
// return ExtraTreeSpecies.LeafType.values()[meta % 8];
|
||||
// }
|
||||
private EnumLeafType getType(int meta) {
|
||||
return EnumLeafType.values()[meta % 8];
|
||||
}
|
||||
|
||||
private boolean isFull(final int meta) {
|
||||
return meta / 8 > 0;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public IIcon getIcon(final int p_149691_1_, final int meta) {
|
||||
// final ExtraTreeSpecies.LeafType type = this.getType(meta);
|
||||
// return ForestryAPI.textureManager.getIcon(this.isFull(meta) ? type.plainUID : type.fancyUID);
|
||||
// }
|
||||
/*@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(final int p_149691_1_, final int meta) {
|
||||
final ExtraTreeSpecies.LeafType type = this.getType(meta);
|
||||
return ForestryAPI.textureManager.getIcon(this.isFull(meta) ? type.plainUID : type.fancyUID);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -150,18 +171,18 @@ public class BlockHedge extends Block implements IBlockFence {
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public int colorMultiplier(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
// return getColor(world.getBlockMetadata(x, y, z));
|
||||
// }
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex) {
|
||||
return getColor(getMetaFromState(state));
|
||||
}
|
||||
|
||||
public static int getColor(final int meta) {
|
||||
//TODO fix color
|
||||
// final ExtraTreeSpecies.LeafType type = ExtraTreeSpecies.LeafType.values()[meta % 6];
|
||||
// if (type == ExtraTreeSpecies.LeafType.Conifer) {
|
||||
// return ColorizerFoliage.getFoliageColorPine();
|
||||
// }
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static int getColor(int meta) {
|
||||
EnumLeafType type = EnumLeafType.values()[meta % 6];
|
||||
if (type == EnumLeafType.CONIFERS) {
|
||||
return ColorizerFoliage.getFoliageColorPine();
|
||||
}
|
||||
final double d0 = 0.5;
|
||||
final double d2 = 1.0;
|
||||
return ColorizerFoliage.getFoliageColor(d0, d2);
|
||||
|
||||
@@ -32,12 +32,12 @@ public class BlockMultiFence extends BlockFence implements IBlockMetadata {
|
||||
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack par1ItemStack) {
|
||||
public String getDisplayName(final ItemStack par1ItemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
|
||||
final IPlankType type1 = this.getDescription(meta).getPlankType();
|
||||
final IPlankType type2 = this.getDescription(meta).getSecondaryPlankType();
|
||||
final boolean twoTypes = type1 != type2;
|
||||
final FenceType type3 = this.getDescription(meta).getFenceType();
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodslab.name" + (twoTypes ? "2" : ""), type3.getPrefix(), type1.getName(), type2.getName());
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.woodslab.name" + (twoTypes ? "2" : ""), type3.getPrefix(), type1.getName(), type2.getName());
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package binnie.extratrees.block.plank;
|
||||
|
||||
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 ItemETPlank<V extends BlockETPlank> extends ItemBlockWood<V> {
|
||||
|
||||
public ItemETPlank(V block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setRegistryName(block.getRegistryName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
IWoodTyped wood = getBlock();
|
||||
int meta = itemstack.getMetadata();
|
||||
IWoodType woodType = wood.getWoodType(meta);
|
||||
return WoodManager.getDisplayName(wood, woodType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.google.common.base.Predicate;
|
||||
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
|
||||
public class ETWoodTypePredicate implements Predicate<EnumExtraTreeLog> {
|
||||
private final int minWoodTypeMeta;
|
||||
|
||||
@@ -9,10 +9,13 @@ import com.google.common.collect.Lists;
|
||||
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import forestry.arboriculture.blocks.WoodTypePredicate;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
|
||||
public class PropertyETWoodType extends PropertyWoodType<EnumExtraTreeLog> {
|
||||
|
||||
public static PropertyETWoodType[] create(@Nonnull String name, int variantsPerBlock) {
|
||||
return create(name, variantsPerBlock, false);
|
||||
}
|
||||
public static PropertyETWoodType[] create(@Nonnull String name, int variantsPerBlock, boolean isLog) {
|
||||
int length;
|
||||
if(isLog){
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package binnie.extratrees.block.stairs;
|
||||
|
||||
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<B extends BlockForestryStairs<EnumExtraTreeLog>> extends ItemBlockWood<B>{
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package binnie.extratrees.block.wood;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import binnie.extratrees.block.property.PropertyETWoodType;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.blocks.fence.BlockForestryFence;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public abstract class BlockETFence extends BlockForestryFence<EnumExtraTreeLog> implements IWoodTyped, IItemModelRegister, IStateMapperRegister {
|
||||
public static List<BlockETFence> create(boolean fireproof) {
|
||||
List<BlockETFence> blocks = new ArrayList<>();
|
||||
|
||||
PropertyETWoodType[] variants = PropertyETWoodType.create("variant", VARIANTS_PER_BLOCK);
|
||||
for (int i = 0; i < variants.length; i++) {
|
||||
PropertyETWoodType variant = variants[i];
|
||||
BlockETFence block = new BlockETFence(fireproof, i) {
|
||||
@Nonnull
|
||||
@Override
|
||||
public PropertyETWoodType getVariant() {
|
||||
return variant;
|
||||
}
|
||||
};
|
||||
blocks.add(block);
|
||||
}
|
||||
return blocks;
|
||||
}
|
||||
|
||||
private BlockETFence(boolean fireproof, int blockNumber) {
|
||||
super(fireproof, blockNumber);
|
||||
String name = "fences.";
|
||||
if(fireproof){
|
||||
name+="fireproof.";
|
||||
}
|
||||
name+=blockNumber;
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumExtraTreeLog getWoodType(int meta) {
|
||||
int variantCount = getVariant().getAllowedValues().size();
|
||||
int variantMeta = (meta % variantCount) + getBlockNumber() * VARIANTS_PER_BLOCK;
|
||||
return EnumExtraTreeLog.byMetadata(variantMeta);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.block.log;
|
||||
package binnie.extratrees.block.wood;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.block.plank;
|
||||
package binnie.extratrees.block.wood;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.block.slab;
|
||||
package binnie.extratrees.block.wood;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
+4
-5
@@ -1,17 +1,16 @@
|
||||
package binnie.extratrees.block.log;
|
||||
package binnie.extratrees.block.wood;
|
||||
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.items.ItemBlockWood;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemETLog <V extends BlockETLog> extends ItemBlockWood<V> {
|
||||
public class ItemBlockETWood<V extends Block & IWoodTyped> extends ItemBlockWood<V> {
|
||||
|
||||
public ItemETLog(V block) {
|
||||
public ItemBlockETWood(V block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setRegistryName(block.getRegistryName());
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.block.slab;
|
||||
package binnie.extratrees.block.wood;
|
||||
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
@@ -26,6 +26,6 @@ public class BlockCarpentry extends BlockDesign {
|
||||
|
||||
@Override
|
||||
public String getBlockName(final DesignBlock design) {
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodentile.name", design.getDesign().getName());
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.woodentile.name", design.getDesign().getName());
|
||||
}
|
||||
}
|
||||
@@ -65,9 +65,9 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack stack) {
|
||||
public String getDisplayName(final ItemStack stack) {
|
||||
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodenpanel.name", block.getDesign().getName());
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.woodenpanel.name", block.getDesign().getName());
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
||||
@@ -80,7 +80,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack stack) {
|
||||
public String getDisplayName(final ItemStack stack) {
|
||||
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
return this.getBlockName(block);
|
||||
}
|
||||
@@ -111,14 +111,14 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
// final IIcon icon = (MultipassBlockRenderer.getLayer() > 0) ? block.getSecondaryIcon(this.getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[side]) : block.getPrimaryIcon(this.getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[side]);
|
||||
// return icon;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack stack, final List par3List) {
|
||||
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
par3List.add(block.getPrimaryMaterial().getName() + " and " + block.getSecondaryMaterial().getName());
|
||||
tooltip.add(block.getPrimaryMaterial().getName() + " and " + block.getSecondaryMaterial().getName());
|
||||
} else {
|
||||
par3List.add(block.getPrimaryMaterial().getName());
|
||||
tooltip.add(block.getPrimaryMaterial().getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,11 +149,10 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
// }
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), tileMeta);
|
||||
public int getDroppedMeta(IBlockState state, int tileMetadata) {
|
||||
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), tileMetadata);
|
||||
return block.getItemMetadata(this.getDesignSystem());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderPasses() {
|
||||
return 2;
|
||||
|
||||
@@ -52,6 +52,6 @@ public class BlockStainedDesign extends BlockDesign {
|
||||
|
||||
@Override
|
||||
public String getBlockName(final DesignBlock design) {
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.stainedglass.name", design.getDesign().getName());
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.stainedglass.name", design.getDesign().getName());
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package binnie.extratrees.carpentry;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.block.ItemMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
@@ -14,21 +13,26 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ModuleCarpentry implements IInitializable {
|
||||
|
||||
public static BlockCarpentry blockCarpentry;
|
||||
public static BlockCarpentry blockPanel;
|
||||
public static BlockStainedDesign blockStained;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraTrees.blockCarpentry = new BlockCarpentry("carpentry");
|
||||
ExtraTrees.blockPanel = new BlockCarpentryPanel();
|
||||
ExtraTrees.blockStained = new BlockStainedDesign();
|
||||
GameRegistry.register(ExtraTrees.blockCarpentry);
|
||||
GameRegistry.register(new ItemMetadata(ExtraTrees.blockCarpentry).setRegistryName(ExtraTrees.blockCarpentry.getRegistryName()));
|
||||
GameRegistry.register(ExtraTrees.blockPanel);
|
||||
GameRegistry.register(new ItemMetadata(ExtraTrees.blockPanel).setRegistryName(ExtraTrees.blockPanel.getRegistryName()));
|
||||
GameRegistry.register(ExtraTrees.blockStained);
|
||||
GameRegistry.register(new ItemMetadata(ExtraTrees.blockStained).setRegistryName(ExtraTrees.blockStained.getRegistryName()));
|
||||
blockCarpentry = new BlockCarpentry("carpentry");
|
||||
blockPanel = new BlockCarpentryPanel();
|
||||
blockStained = new BlockStainedDesign();
|
||||
GameRegistry.register(blockCarpentry);
|
||||
GameRegistry.register(new ItemMetadata(blockCarpentry).setRegistryName(blockCarpentry.getRegistryName()));
|
||||
GameRegistry.register(blockPanel);
|
||||
GameRegistry.register(new ItemMetadata(blockPanel).setRegistryName(blockPanel.getRegistryName()));
|
||||
GameRegistry.register(blockStained);
|
||||
GameRegistry.register(new ItemMetadata(blockStained).setRegistryName(blockStained.getRegistryName()));
|
||||
|
||||
//BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockCarpentry), new MultipassItemRenderer());
|
||||
//BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStained), new MultipassItemRenderer());
|
||||
MinecraftForge.EVENT_BUS.register(ExtraTrees.blockCarpentry);
|
||||
MinecraftForge.EVENT_BUS.register(blockCarpentry);
|
||||
//BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockPanel), new MultipassItemRenderer());
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public enum ExtraTreeTexture implements IBinnieTexture {
|
||||
|
||||
@Override
|
||||
public BinnieResource getTexture() {
|
||||
return Binnie.Resource.getPNG(ExtraTrees.instance, this.type, this.texture);
|
||||
return Binnie.RESOURCE.getPNG(ExtraTrees.instance, this.type, this.texture);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -304,7 +304,7 @@ public class AlleleETFruit extends AlleleCategorized implements IAlleleFruit, IF
|
||||
throw Throwables.propagate(e);
|
||||
}
|
||||
}
|
||||
for (final IAlleleSpecies tree : Binnie.Genetics.treeBreedingSystem.getAllSpecies()) {
|
||||
for (final IAlleleSpecies tree : Binnie.GENETICS.treeBreedingSystem.getAllSpecies()) {
|
||||
if (tree instanceof AlleleTreeSpecies && ((IAlleleTreeSpecies) tree).getSuitableFruit().contains(familyPrune)) {
|
||||
((AlleleTreeSpecies) tree).addFruitFamily(familyCitrus);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
this.name = name;
|
||||
this.branchName = scientific.split(" ")[0].toLowerCase();
|
||||
this.scientific = scientific.split(" ")[1];
|
||||
this.texture = Binnie.Resource.getPNG(ExtraTrees.instance, ResourceType.Entity, this.toString());
|
||||
this.texture = Binnie.RESOURCE.getPNG(ExtraTrees.instance, ResourceType.Entity, this.toString());
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
|
||||
@Override
|
||||
public IButterflyRoot getRoot() {
|
||||
return Binnie.Genetics.getButterflyRoot();
|
||||
return Binnie.GENETICS.getButterflyRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -137,7 +137,7 @@ public class ExtraTreeMutation implements ITreeMutation {
|
||||
}
|
||||
|
||||
public ExtraTreeMutation(final IAllele allele0, final IAllele allele1, final IAllele result, final int chance) {
|
||||
this(allele0, allele1, Binnie.Genetics.getTreeRoot().getTemplate(result.getUID()), chance);
|
||||
this(allele0, allele1, Binnie.GENETICS.getTreeRoot().getTemplate(result.getUID()), chance);
|
||||
}
|
||||
|
||||
public ExtraTreeMutation(final IAllele allele0, final IAllele allele1, final IAllele[] template, final int chance) {
|
||||
@@ -151,7 +151,7 @@ public class ExtraTreeMutation implements ITreeMutation {
|
||||
this.allele1 = (IAlleleTreeSpecies) allele1;
|
||||
this.template = template;
|
||||
this.chance = chance;
|
||||
Binnie.Genetics.getTreeRoot().registerMutation(this);
|
||||
Binnie.GENETICS.getTreeRoot().registerMutation(this);
|
||||
}
|
||||
|
||||
public ExtraTreeMutation setIsSecret() {
|
||||
@@ -233,7 +233,7 @@ public class ExtraTreeMutation implements ITreeMutation {
|
||||
|
||||
@Override
|
||||
public ITreeRoot getRoot() {
|
||||
return Binnie.Genetics.getTreeRoot();
|
||||
return Binnie.GENETICS.getTreeRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ModuleGenetics implements IInitializable {
|
||||
if (BinnieCore.isLepidopteryActive()) {
|
||||
for (final ButterflySpecies species2 : ButterflySpecies.values()) {
|
||||
//AlleleManager.alleleRegistry.registerAllele(species2);
|
||||
Binnie.Genetics.getButterflyRoot().registerTemplate(species2.getTemplate());
|
||||
Binnie.GENETICS.getButterflyRoot().registerTemplate(species2.getTemplate());
|
||||
final String scientific = species2.branchName.substring(0, 1).toUpperCase() + species2.branchName.substring(1).toLowerCase();
|
||||
final String uid = "trees." + species2.branchName.toLowerCase();
|
||||
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
|
||||
|
||||
@@ -2,12 +2,7 @@ package binnie.extratrees.integration.jei.brewery;
|
||||
|
||||
import binnie.extratrees.machines.brewery.BreweryRecipes;
|
||||
import binnie.extratrees.machines.brewery.IBreweryRecipe;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillRecipes;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class BreweryRecipeMaker {
|
||||
|
||||
-5
@@ -4,20 +4,15 @@ import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.extratrees.dictionary.ControlDistilleryProgress;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.integration.jei.ExtraTreesJeiPlugin;
|
||||
import binnie.extratrees.integration.jei.RecipeUids;
|
||||
import binnie.extratrees.machines.brewery.BreweryMachine;
|
||||
import binnie.extratrees.machines.distillery.DistilleryLogic;
|
||||
import binnie.extratrees.machines.distillery.DistilleryMachine;
|
||||
import forestry.core.tiles.ITitled;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
|
||||
+5
-2
@@ -2,6 +2,7 @@ package binnie.extratrees.integration.jei.lumbermill;
|
||||
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.item.ExtraTreeItems;
|
||||
import binnie.extratrees.item.ModuleItems;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillLogic;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
@@ -27,10 +28,12 @@ public class LumbermillRecipeWrapper extends BlankRecipeWrapper {
|
||||
ingredients.setInput(ItemStack.class, inputLog);
|
||||
ingredients.setInput(FluidStack.class, WATER);
|
||||
|
||||
ExtraTrees.items();
|
||||
ExtraTrees.items();
|
||||
ingredients.setOutputs(ItemStack.class, Arrays.asList(
|
||||
ExtraTrees.itemMisc.getStack(ExtraTreeItems.Bark, 1),
|
||||
ModuleItems.itemMisc.getStack(ExtraTreeItems.Bark, 1),
|
||||
outputPlanks,
|
||||
ExtraTrees.itemMisc.getStack(ExtraTreeItems.Sawdust, 1)
|
||||
ModuleItems.itemMisc.getStack(ExtraTreeItems.Sawdust, 1)
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ public enum ExtraTreeItems implements IItemMiscProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int i) {
|
||||
return new ItemStack(ExtraTrees.itemMisc, i, this.ordinal());
|
||||
ExtraTrees.items();
|
||||
return new ItemStack(ModuleItems.itemMisc, i, this.ordinal());
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public enum ExtraTreeLiquid implements ILiquidType {
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int i) {
|
||||
return Binnie.Liquid.getFluidStack(this.ident, i);
|
||||
return Binnie.LIQUID.getFluidStack(this.ident, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -110,7 +110,8 @@ public enum Food implements IItemMiscProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int i) {
|
||||
return new ItemStack(ExtraTrees.itemFood, i, this.ordinal());
|
||||
ExtraTrees.items();
|
||||
return new ItemStack(ModuleItems.itemFood, i, this.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,26 +25,34 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
public class ModuleItems implements IInitializable {
|
||||
|
||||
public static Item itemDictionary;
|
||||
public static Item itemDictionaryLepi;
|
||||
public static ItemMisc itemMisc;
|
||||
public static Item itemFood;
|
||||
public static Item itemHammer;
|
||||
public static Item itemDurableHammer;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraTrees.itemMisc = new ItemMisc(Tabs.tabArboriculture, (IItemMiscProvider[]) ExtraTreeItems.values());
|
||||
ExtraTrees.proxy.registerItem(ExtraTrees.itemMisc);
|
||||
itemMisc = new ItemMisc(Tabs.tabArboriculture, ExtraTreeItems.values());
|
||||
ExtraTrees.proxy.registerItem(itemMisc);
|
||||
|
||||
ExtraTrees.itemDictionary = new ItemDictionary();
|
||||
ExtraTrees.proxy.registerItem(ExtraTrees.itemDictionary);
|
||||
itemDictionary = new ItemDictionary();
|
||||
ExtraTrees.proxy.registerItem(itemDictionary);
|
||||
|
||||
if (BinnieCore.isLepidopteryActive()) {
|
||||
ExtraTrees.itemDictionaryLepi = new ItemMothDatabase();
|
||||
ExtraTrees.proxy.registerItem(ExtraTrees.itemDictionaryLepi);
|
||||
itemDictionaryLepi = new ItemMothDatabase();
|
||||
ExtraTrees.proxy.registerItem(itemDictionaryLepi);
|
||||
}
|
||||
Binnie.Liquid.createLiquids(ExtraTreeLiquid.values(), ItemFluidContainer.LiquidExtraTree);
|
||||
ExtraTrees.itemFood = new ItemETFood();
|
||||
ExtraTrees.proxy.registerItem(ExtraTrees.itemFood);
|
||||
Binnie.LIQUID.createLiquids(ExtraTreeLiquid.values(), ItemFluidContainer.LiquidExtraTree);
|
||||
itemFood = new ItemETFood();
|
||||
ExtraTrees.proxy.registerItem(itemFood);
|
||||
|
||||
ExtraTrees.itemHammer = new ItemHammer(false);
|
||||
ExtraTrees.proxy.registerItem(ExtraTrees.itemHammer);
|
||||
ExtraTrees.itemDurableHammer = new ItemHammer(true);
|
||||
ExtraTrees.proxy.registerItem(ExtraTrees.itemDurableHammer);
|
||||
itemHammer = new ItemHammer(false);
|
||||
ExtraTrees.proxy.registerItem(itemHammer);
|
||||
itemDurableHammer = new ItemHammer(true);
|
||||
ExtraTrees.proxy.registerItem(itemDurableHammer);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -117,8 +125,10 @@ public class ModuleItems implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ExtraTrees.itemDurableHammer, 1, 0), "wiw", " s ", " s ", 'w', Blocks.OBSIDIAN, 'i', Items.GOLD_INGOT, 's', Items.STICK));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ExtraTrees.itemHammer, 1, 0), "wiw", " s ", " s ", 'w', "plankWood", 'i', Items.IRON_INGOT, 's', Items.STICK));
|
||||
ModuleItems items = ExtraTrees.items();
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ModuleItems.itemDurableHammer, 1, 0), "wiw", " s ", " s ", 'w', Blocks.OBSIDIAN, 'i', Items.GOLD_INGOT, 's', Items.STICK));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ModuleItems.itemHammer, 1, 0), "wiw", " s ", " s ", 'w', "plankWood", 'i', Items.IRON_INGOT, 's', Items.STICK));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeItems.Yeast.get(8), " m ", "mbm", 'b', Items.BREAD, 'm', Blocks.BROWN_MUSHROOM));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeItems.LagerYeast.get(8), "mbm", " m ", 'b', Items.BREAD, 'm', Blocks.BROWN_MUSHROOM));
|
||||
GameRegistry.addRecipe(ExtraTreeItems.GrainWheat.get(5), " s ", "sss", " s ", 's', Items.WHEAT_SEEDS);
|
||||
@@ -137,15 +147,15 @@ public class ModuleItems implements IInitializable {
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(Food.PAPAYIMAR.get(1), minium, "cropPapaya"));
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getFluidStack("water", 2000), null, new ItemStack(ExtraTrees.itemDictionary), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotCopper", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getFluidStack("water", 2000), null, new ItemStack(ExtraTrees.itemDictionaryLepi), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotBronze", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.LIQUID.getFluidStack("water", 2000), null, new ItemStack(ModuleItems.itemDictionary), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotCopper", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.LIQUID.getFluidStack("water", 2000), null, new ItemStack(ModuleItems.itemDictionaryLepi), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotBronze", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
|
||||
RecipeManagers.stillManager.addRecipe(25, ExtraTreeLiquid.Resin.get(5), ExtraTreeLiquid.Turpentine.get(3));
|
||||
RecipeManagers.carpenterManager.addRecipe(25, ExtraTreeLiquid.Turpentine.get(50), null, ExtraTrees.itemMisc.getStack(ExtraTreeItems.WoodWax, 4), "x", 'x', Mods.Forestry.stack("beeswax"));
|
||||
if (Binnie.Liquid.getFluidStack("Creosote Oil", 100) != null) {
|
||||
RecipeManagers.carpenterManager.addRecipe(25, Binnie.Liquid.getFluidStack("Creosote Oil", 50), null, ExtraTrees.itemMisc.getStack(ExtraTreeItems.WoodWax, 1), "x", 'x', Mods.Forestry.stack("beeswax"));
|
||||
RecipeManagers.carpenterManager.addRecipe(25, ExtraTreeLiquid.Turpentine.get(50), null, ModuleItems.itemMisc.getStack(ExtraTreeItems.WoodWax, 4), "x", 'x', Mods.Forestry.stack("beeswax"));
|
||||
if (Binnie.LIQUID.getFluidStack("Creosote Oil", 100) != null) {
|
||||
RecipeManagers.carpenterManager.addRecipe(25, Binnie.LIQUID.getFluidStack("Creosote Oil", 50), null, ModuleItems.itemMisc.getStack(ExtraTreeItems.WoodWax, 1), "x", 'x', Mods.Forestry.stack("beeswax"));
|
||||
}
|
||||
for (final FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
|
||||
if (data.fluid.isFluidEqual(Binnie.Liquid.getFluidStack("water", 0)) && data.fluid.amount == 1000) {
|
||||
if (data.fluid.isFluidEqual(Binnie.LIQUID.getFluidStack("water", 0)) && data.fluid.amount == 1000) {
|
||||
CraftingManager.getInstance().addRecipe(Mods.Forestry.stack("mulch"), " b ", "bwb", " b ", 'b', ExtraTreeItems.Bark.get(1), 'w', data.filledContainer.copy());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public enum KitchenMachine implements IMachineType {
|
||||
|
||||
protected PackageKitchenMachine(final String uid, final String textureName) {
|
||||
super(uid, false);
|
||||
this.textureName = Binnie.Resource.getFile(ExtraTrees.instance, ResourceType.Tile, textureName);
|
||||
this.textureName = Binnie.RESOURCE.getFile(ExtraTrees.instance, ResourceType.Tile, textureName);
|
||||
}
|
||||
|
||||
protected PackageKitchenMachine(final String uid, final BinnieResource textureName) {
|
||||
|
||||
@@ -4,14 +4,18 @@ import binnie.core.IInitializable;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class ModuleKitchen implements IInitializable {
|
||||
|
||||
public static Block blockKitchen;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
final MachineGroup machineGroup = new MachineGroup(ExtraTrees.instance, "kitchen", "kitchen", KitchenMachine.values());
|
||||
machineGroup.setCreativeTab(Tabs.tabArboriculture);
|
||||
machineGroup.customRenderer = false;
|
||||
ExtraTrees.blockKitchen = machineGroup.getBlock();
|
||||
blockKitchen = machineGroup.getBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,16 +55,19 @@ public enum DesignerType {
|
||||
private BlockDesign getBlock() {
|
||||
switch (this) {
|
||||
case GlassWorker: {
|
||||
return ExtraTrees.blockStained;
|
||||
ExtraTrees.carpentry();
|
||||
return ModuleCarpentry.blockStained;
|
||||
}
|
||||
case Panelworker: {
|
||||
return ExtraTrees.blockPanel;
|
||||
ExtraTrees.carpentry();
|
||||
return ModuleCarpentry.blockPanel;
|
||||
}
|
||||
case Tileworker: {
|
||||
return Botany.ceramicTile;
|
||||
}
|
||||
default: {
|
||||
return ExtraTrees.blockCarpentry;
|
||||
ExtraTrees.carpentry();
|
||||
return ModuleCarpentry.blockCarpentry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,8 @@ public enum ExtraTreeMachine implements IMachineType {
|
||||
}
|
||||
|
||||
public ItemStack get(final int i) {
|
||||
return new ItemStack(ExtraTrees.blockMachine, i, this.ordinal());
|
||||
ExtraTrees.machine();
|
||||
return new ItemStack(ModuleMachine.blockMachine, i, this.ordinal());
|
||||
}
|
||||
|
||||
public static class ComponentExtraTreeGUI extends MachineComponent implements IInteraction.RightClick {
|
||||
@@ -76,7 +77,7 @@ public enum ExtraTreeMachine implements IMachineType {
|
||||
|
||||
protected PackageExtraTreeMachine(final String uid, final String textureName, final boolean powered) {
|
||||
super(uid, powered);
|
||||
this.textureName = Binnie.Resource.getFile(ExtraTrees.instance, ResourceType.Tile, textureName);
|
||||
this.textureName = Binnie.RESOURCE.getFile(ExtraTrees.instance, ResourceType.Tile, textureName);
|
||||
}
|
||||
|
||||
protected PackageExtraTreeMachine(final String uid, final BinnieResource textureName, final boolean powered) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import binnie.core.machines.MachineGroup;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.item.ExtraTreeItems;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
@@ -14,11 +15,14 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ModuleMachine implements IInitializable {
|
||||
|
||||
public static Block blockMachine;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
final MachineGroup machineGroup = new MachineGroup(ExtraTrees.instance, "machine", "machine", ExtraTreeMachine.values());
|
||||
machineGroup.setCreativeTab(Tabs.tabArboriculture);
|
||||
ExtraTrees.blockMachine = machineGroup.getBlock();
|
||||
blockMachine = machineGroup.getBlock();
|
||||
// TODO fix rendering
|
||||
Object rendererMachine = null;// BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine");
|
||||
BinnieCore.proxy.registerTileEntity(TileEntityNursery.class, "binnie.tile.nursery", rendererMachine);
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class BrewedGrainRecipe implements IBreweryRecipe {
|
||||
public static final FluidStack WATER = Binnie.Liquid.getFluidStack("water", Fluid.BUCKET_VOLUME);
|
||||
public static final FluidStack WATER = Binnie.LIQUID.getFluidStack("water", Fluid.BUCKET_VOLUME);
|
||||
|
||||
private final FluidStack output;
|
||||
private final int grainOreId;
|
||||
@@ -90,6 +90,7 @@ public class BrewedGrainRecipe implements IBreweryRecipe {
|
||||
return ingredientOreId != null && OreDictionaryUtil.hasOreId(itemstack, ingredientOreId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getIngredients() {
|
||||
if (ingredientOreId == null) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -6,7 +6,8 @@ import binnie.Constants;
|
||||
import binnie.core.models.ModelManager;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.BlockETDecorativeLeaves;
|
||||
import binnie.extratrees.block.slab.BlockETSlab;
|
||||
import binnie.extratrees.block.ModuleBlocks;
|
||||
import binnie.extratrees.block.wood.BlockETSlab;
|
||||
import binnie.extratrees.models.ModelETDecorativeLeaves;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.core.models.BlockModelEntry;
|
||||
@@ -64,7 +65,8 @@ public class ProxyClient extends Proxy implements IExtraTreeProxy {
|
||||
|
||||
@Override
|
||||
public void registerModels() {
|
||||
for (BlockETDecorativeLeaves leaves : ExtraTrees.leavesDecorative) {
|
||||
ExtraTrees.blocks();
|
||||
for (BlockETDecorativeLeaves leaves : ModuleBlocks.leavesDecorative) {
|
||||
String resourceName = leaves.getRegistryName().toString();
|
||||
ModelResourceLocation blockModelLocation = new ModelResourceLocation(resourceName);
|
||||
ModelResourceLocation itemModeLocation = new ModelResourceLocation(resourceName, "inventory");
|
||||
@@ -72,10 +74,12 @@ public class ProxyClient extends Proxy implements IExtraTreeProxy {
|
||||
registerBlockModel(blockModelIndex);
|
||||
}
|
||||
|
||||
for(BlockETSlab slab : ExtraTrees.slabsDouble){
|
||||
ExtraTrees.blocks();
|
||||
for(BlockETSlab slab : ModuleBlocks.slabsDouble){
|
||||
PluginArboriculture.proxy.registerWoodModel(slab, true);
|
||||
}
|
||||
for(BlockETSlab slab : ExtraTrees.slabsDoubleFireproof){
|
||||
ExtraTrees.blocks();
|
||||
for(BlockETSlab slab : ModuleBlocks.slabsDoubleFireproof){
|
||||
PluginArboriculture.proxy.registerWoodModel(slab, true);
|
||||
}
|
||||
getModelManager().registerModels();
|
||||
|
||||
Reference in new issue
Block a user