mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 12:42:53 +00:00
Update buildscript & spotlessApply
This commit is contained in:
1 parent
e4329e2b8f
commit
8683a345c3
818 files changed
+51123
-49403
No files matched your search
@@ -29,112 +29,108 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
@Mod(
|
||||
modid = "ExtraTrees",
|
||||
name = "Extra Trees",
|
||||
version = BinnieCore.VERSION,
|
||||
useMetadata = true,
|
||||
dependencies = "after:BinnieCore"
|
||||
)
|
||||
modid = "ExtraTrees",
|
||||
name = "Extra Trees",
|
||||
version = BinnieCore.VERSION,
|
||||
useMetadata = true,
|
||||
dependencies = "after:BinnieCore")
|
||||
public class ExtraTrees extends AbstractMod {
|
||||
@Mod.Instance("ExtraTrees")
|
||||
public static ExtraTrees instance;
|
||||
@Mod.Instance("ExtraTrees")
|
||||
public static ExtraTrees instance;
|
||||
|
||||
@SidedProxy(
|
||||
clientSide = "binnie.extratrees.proxy.ProxyClient",
|
||||
serverSide = "binnie.extratrees.proxy.ProxyServer"
|
||||
)
|
||||
public static Proxy proxy;
|
||||
@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 Item itemMisc;
|
||||
public static Item itemFood;
|
||||
public static Block blockStairs;
|
||||
public static Block blockLog;
|
||||
public static BlockCarpentry blockCarpentry;
|
||||
public static Block blockPlanks;
|
||||
public static Block blockShrubLeaves;
|
||||
public static Block blockMachine;
|
||||
public static Block blockFence;
|
||||
public static BlockCarpentry blockPanel;
|
||||
public static Block blockSlab;
|
||||
public static Block blockDoubleSlab;
|
||||
public static Item itemHammer;
|
||||
public static Item itemDurableHammer;
|
||||
public static Block blockGate;
|
||||
public static Block blockDoor;
|
||||
public static BlockMultiFence blockMultiFence;
|
||||
public static BlockHedge blockHedge;
|
||||
public static BlockStainedDesign blockStained;
|
||||
public static int doorRenderId;
|
||||
public static int branchRenderId;
|
||||
public static int fenceID;
|
||||
public static int stairsID;
|
||||
public static Item itemDictionary;
|
||||
public static Item itemDictionaryLepi;
|
||||
public static Item itemMisc;
|
||||
public static Item itemFood;
|
||||
public static Block blockStairs;
|
||||
public static Block blockLog;
|
||||
public static BlockCarpentry blockCarpentry;
|
||||
public static Block blockPlanks;
|
||||
public static Block blockShrubLeaves;
|
||||
public static Block blockMachine;
|
||||
public static Block blockFence;
|
||||
public static BlockCarpentry blockPanel;
|
||||
public static Block blockSlab;
|
||||
public static Block blockDoubleSlab;
|
||||
public static Item itemHammer;
|
||||
public static Item itemDurableHammer;
|
||||
public static Block blockGate;
|
||||
public static Block blockDoor;
|
||||
public static BlockMultiFence blockMultiFence;
|
||||
public static BlockHedge blockHedge;
|
||||
public static BlockStainedDesign blockStained;
|
||||
public static int doorRenderId;
|
||||
public static int branchRenderId;
|
||||
public static int fenceID;
|
||||
public static int stairsID;
|
||||
|
||||
public ExtraTrees() {
|
||||
ExtraTrees.instance = this;
|
||||
}
|
||||
public ExtraTrees() {
|
||||
ExtraTrees.instance = this;
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
addModule(new ModuleBlocks());
|
||||
addModule(new ModuleItems());
|
||||
addModule(new ModuleGenetics());
|
||||
addModule(new ModuleCarpentry());
|
||||
addModule(new ModuleMachine());
|
||||
addModule(new ModuleCore());
|
||||
IMCForNEI.IMCSender();
|
||||
preInit();
|
||||
}
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
addModule(new ModuleBlocks());
|
||||
addModule(new ModuleItems());
|
||||
addModule(new ModuleGenetics());
|
||||
addModule(new ModuleCarpentry());
|
||||
addModule(new ModuleMachine());
|
||||
addModule(new ModuleCore());
|
||||
IMCForNEI.IMCSender();
|
||||
preInit();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
init();
|
||||
}
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
postInit();
|
||||
}
|
||||
@Mod.EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
postInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinnieGUID[] getGUIDs() {
|
||||
return ExtraTreesGUID.values();
|
||||
}
|
||||
@Override
|
||||
public IBinnieGUID[] getGUIDs() {
|
||||
return ExtraTreesGUID.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class[] getConfigs() {
|
||||
return new Class[]{ConfigurationMain.class};
|
||||
}
|
||||
@Override
|
||||
public Class[] getConfigs() {
|
||||
return new Class[] {ConfigurationMain.class};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getChannel() {
|
||||
return "ET";
|
||||
}
|
||||
@Override
|
||||
public String getChannel() {
|
||||
return "ET";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IProxyCore getProxy() {
|
||||
return ExtraTrees.proxy;
|
||||
}
|
||||
@Override
|
||||
public IProxyCore getProxy() {
|
||||
return ExtraTrees.proxy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModID() {
|
||||
return "extratrees";
|
||||
}
|
||||
@Override
|
||||
public String getModID() {
|
||||
return "extratrees";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BinniePacketHandler> getPacketHandler() {
|
||||
return PacketHandler.class;
|
||||
}
|
||||
@Override
|
||||
protected Class<? extends BinniePacketHandler> getPacketHandler() {
|
||||
return PacketHandler.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return BinnieCore.isExtraTreesActive();
|
||||
}
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return BinnieCore.isExtraTreesActive();
|
||||
}
|
||||
|
||||
public static class PacketHandler extends BinniePacketHandler {
|
||||
public PacketHandler() {
|
||||
super(ExtraBees.instance);
|
||||
}
|
||||
}
|
||||
public static class PacketHandler extends BinniePacketHandler {
|
||||
public PacketHandler() {
|
||||
super(ExtraBees.instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package binnie.extratrees;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.arboriculture.tiles.TileWood;
|
||||
import java.lang.reflect.Constructor;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -15,117 +16,113 @@ import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import sun.reflect.ReflectionFactory;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
public class FakeWorld extends World {
|
||||
public static FakeWorld instance = SilentObjectCreator.create(FakeWorld.class);
|
||||
public static FakeWorld instance = SilentObjectCreator.create(FakeWorld.class);
|
||||
|
||||
protected Block block;
|
||||
protected int metadata;
|
||||
protected TileEntity te;
|
||||
protected Block block;
|
||||
protected int metadata;
|
||||
protected TileEntity te;
|
||||
|
||||
//It is never called.
|
||||
private FakeWorld() {
|
||||
super(null, "", null, new WorldSettings(Long.MAX_VALUE, GameType.NOT_SET, false, false, WorldType.FLAT), null);
|
||||
}
|
||||
// It is never called.
|
||||
private FakeWorld() {
|
||||
super(null, "", null, new WorldSettings(Long.MAX_VALUE, GameType.NOT_SET, false, false, WorldType.FLAT), null);
|
||||
}
|
||||
|
||||
public ItemStack getWooLog() {
|
||||
if (te instanceof TileWood) {
|
||||
return TileWood.getPickBlock(block, this, 0, 0, 0);
|
||||
} else if (te instanceof TileEntityMetadata) {
|
||||
return new ItemStack(block, 1, ((TileEntityMetadata) te).getTileMetadata());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public ItemStack getWooLog() {
|
||||
if (te instanceof TileWood) {
|
||||
return TileWood.getPickBlock(block, this, 0, 0, 0);
|
||||
} else if (te instanceof TileEntityMetadata) {
|
||||
return new ItemStack(block, 1, ((TileEntityMetadata) te).getTileMetadata());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, Block block) {
|
||||
this.block = block;
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, Block block) {
|
||||
this.block = block;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, Block block, int metadata, int update) {
|
||||
this.block = block;
|
||||
this.metadata = metadata;
|
||||
if (block.hasTileEntity(metadata)) {
|
||||
te = block.createTileEntity(this, metadata);
|
||||
} else {
|
||||
TileWood wood = new TileWood();
|
||||
wood.setWoodType(EnumWoodType.VALUES[metadata]);
|
||||
te = wood;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, Block block, int metadata, int update) {
|
||||
this.block = block;
|
||||
this.metadata = metadata;
|
||||
if (block.hasTileEntity(metadata)) {
|
||||
te = block.createTileEntity(this, metadata);
|
||||
} else {
|
||||
TileWood wood = new TileWood();
|
||||
wood.setWoodType(EnumWoodType.VALUES[metadata]);
|
||||
te = wood;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlockToAir(int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean setBlockToAir(int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTileEntity(int x, int y, int z) {
|
||||
return te;
|
||||
}
|
||||
@Override
|
||||
public TileEntity getTileEntity(int x, int y, int z) {
|
||||
return te;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTileEntity(int x, int y, int z, TileEntity tileEntity) {
|
||||
@Override
|
||||
public void setTileEntity(int x, int y, int z, TileEntity tileEntity) {}
|
||||
|
||||
}
|
||||
@Override
|
||||
public Block getBlock(int x, int y, int z) {
|
||||
return block != null ? block : Blocks.air;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock(int x, int y, int z) {
|
||||
return block != null ? block : Blocks.air;
|
||||
}
|
||||
@Override
|
||||
public int getBlockMetadata(int x, int y, int z) {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockMetadata(int x, int y, int z) {
|
||||
return metadata;
|
||||
}
|
||||
@Override
|
||||
public boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int delay) {
|
||||
this.metadata = metadata;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int delay) {
|
||||
this.metadata = metadata;
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected IChunkProvider createChunkProvider() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IChunkProvider createChunkProvider() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
protected int func_152379_p() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int func_152379_p() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public Entity getEntityByID(int id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity getEntityByID(int id) {
|
||||
return null;
|
||||
}
|
||||
public static class SilentObjectCreator {
|
||||
/**
|
||||
* Creating objects without calling constructors.
|
||||
*/
|
||||
public static <T> T create(Class<T> clazz) {
|
||||
return create(clazz, Object.class);
|
||||
}
|
||||
|
||||
public static class SilentObjectCreator {
|
||||
/**
|
||||
* Creating objects without calling constructors.
|
||||
*/
|
||||
public static <T> T create(Class<T> clazz) {
|
||||
return create(clazz, Object.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creating objects without calling constructors.
|
||||
*/
|
||||
public static <T> T create(Class<T> clazz, Class<? super T> parent) {
|
||||
try {
|
||||
ReflectionFactory rf = ReflectionFactory.getReflectionFactory();
|
||||
Constructor objDef = parent.getDeclaredConstructor();
|
||||
Constructor intConstr = rf.newConstructorForSerialization(clazz, objDef);
|
||||
return clazz.cast(intConstr.newInstance());
|
||||
} catch (RuntimeException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Cannot create object", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creating objects without calling constructors.
|
||||
*/
|
||||
public static <T> T create(Class<T> clazz, Class<? super T> parent) {
|
||||
try {
|
||||
ReflectionFactory rf = ReflectionFactory.getReflectionFactory();
|
||||
Constructor objDef = parent.getDeclaredConstructor();
|
||||
Constructor intConstr = rf.newConstructorForSerialization(clazz, objDef);
|
||||
return clazz.cast(intConstr.newInstance());
|
||||
} catch (RuntimeException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Cannot create object", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package binnie.extratrees.api;
|
||||
|
||||
public class CarpentryManager {
|
||||
public static ICarpentryInterface carpentryInterface;
|
||||
public static ICarpentryInterface carpentryInterface;
|
||||
}
|
||||
@@ -1,32 +1,31 @@
|
||||
package binnie.extratrees.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ICarpentryInterface {
|
||||
boolean registerCarpentryWood(int index, IDesignMaterial wood);
|
||||
boolean registerCarpentryWood(int index, IDesignMaterial wood);
|
||||
|
||||
int getCarpentryWoodIndex(IDesignMaterial wood);
|
||||
int getCarpentryWoodIndex(IDesignMaterial wood);
|
||||
|
||||
IDesignMaterial getWoodMaterial(int index);
|
||||
IDesignMaterial getWoodMaterial(int index);
|
||||
|
||||
boolean registerDesign(int index, IDesign wood);
|
||||
boolean registerDesign(int index, IDesign wood);
|
||||
|
||||
int getDesignIndex(IDesign wood);
|
||||
int getDesignIndex(IDesign wood);
|
||||
|
||||
IDesign getDesign(int p0);
|
||||
IDesign getDesign(int p0);
|
||||
|
||||
ILayout getLayout(IPattern pattern, boolean inverted);
|
||||
ILayout getLayout(IPattern pattern, boolean inverted);
|
||||
|
||||
IDesignMaterial getWoodMaterial(ItemStack stack);
|
||||
IDesignMaterial getWoodMaterial(ItemStack stack);
|
||||
|
||||
boolean registerDesignCategory(IDesignCategory category);
|
||||
boolean registerDesignCategory(IDesignCategory category);
|
||||
|
||||
IDesignCategory getDesignCategory(String id);
|
||||
IDesignCategory getDesignCategory(String id);
|
||||
|
||||
Collection<IDesignCategory> getAllDesignCategories();
|
||||
Collection<IDesignCategory> getAllDesignCategories();
|
||||
|
||||
List<IDesign> getSortedDesigns();
|
||||
List<IDesign> getSortedDesigns();
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
package binnie.extratrees.api;
|
||||
|
||||
public interface IDesign {
|
||||
String getName();
|
||||
String getName();
|
||||
|
||||
ILayout getTopPattern();
|
||||
ILayout getTopPattern();
|
||||
|
||||
ILayout getBottomPattern();
|
||||
ILayout getBottomPattern();
|
||||
|
||||
ILayout getNorthPattern();
|
||||
ILayout getNorthPattern();
|
||||
|
||||
ILayout getEastPattern();
|
||||
ILayout getEastPattern();
|
||||
|
||||
ILayout getSouthPattern();
|
||||
ILayout getSouthPattern();
|
||||
|
||||
ILayout getWestPattern();
|
||||
ILayout getWestPattern();
|
||||
}
|
||||
@@ -3,11 +3,11 @@ package binnie.extratrees.api;
|
||||
import java.util.List;
|
||||
|
||||
public interface IDesignCategory {
|
||||
String getName();
|
||||
String getName();
|
||||
|
||||
List<IDesign> getDesigns();
|
||||
List<IDesign> getDesigns();
|
||||
|
||||
void addDesign(IDesign design);
|
||||
void addDesign(IDesign design);
|
||||
|
||||
String getId();
|
||||
String getId();
|
||||
}
|
||||
@@ -3,9 +3,9 @@ package binnie.extratrees.api;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IDesignMaterial {
|
||||
ItemStack getStack();
|
||||
ItemStack getStack();
|
||||
|
||||
String getName();
|
||||
String getName();
|
||||
|
||||
int getColor();
|
||||
int getColor();
|
||||
}
|
||||
@@ -5,21 +5,21 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public interface IDesignSystem {
|
||||
IIcon getPrimaryIcon(IPattern pattern);
|
||||
IIcon getPrimaryIcon(IPattern pattern);
|
||||
|
||||
IIcon getSecondaryIcon(IPattern pattern);
|
||||
IIcon getSecondaryIcon(IPattern pattern);
|
||||
|
||||
void registerIcons(IIconRegister register);
|
||||
void registerIcons(IIconRegister register);
|
||||
|
||||
IDesignMaterial getDefaultMaterial();
|
||||
IDesignMaterial getDefaultMaterial();
|
||||
|
||||
IDesignMaterial getMaterial(int id);
|
||||
IDesignMaterial getMaterial(int id);
|
||||
|
||||
int getMaterialIndex(IDesignMaterial wood);
|
||||
int getMaterialIndex(IDesignMaterial wood);
|
||||
|
||||
IDesignMaterial getDefaultMaterial2();
|
||||
IDesignMaterial getDefaultMaterial2();
|
||||
|
||||
ItemStack getAdhesive();
|
||||
ItemStack getAdhesive();
|
||||
|
||||
IDesignMaterial getMaterial(ItemStack stack);
|
||||
IDesignMaterial getMaterial(ItemStack stack);
|
||||
}
|
||||
@@ -3,21 +3,21 @@ package binnie.extratrees.api;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public interface ILayout {
|
||||
IPattern getPattern();
|
||||
IPattern getPattern();
|
||||
|
||||
boolean isInverted();
|
||||
boolean isInverted();
|
||||
|
||||
ILayout rotateRight();
|
||||
ILayout rotateRight();
|
||||
|
||||
ILayout rotateLeft();
|
||||
ILayout rotateLeft();
|
||||
|
||||
ILayout flipHorizontal();
|
||||
ILayout flipHorizontal();
|
||||
|
||||
ILayout flipVertical();
|
||||
ILayout flipVertical();
|
||||
|
||||
ILayout invert();
|
||||
ILayout invert();
|
||||
|
||||
IIcon getPrimaryIcon(IDesignSystem system);
|
||||
IIcon getPrimaryIcon(IDesignSystem system);
|
||||
|
||||
IIcon getSecondaryIcon(IDesignSystem system);
|
||||
IIcon getSecondaryIcon(IDesignSystem system);
|
||||
}
|
||||
@@ -4,13 +4,13 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public interface IPattern {
|
||||
IIcon getPrimaryIcon(IDesignSystem system);
|
||||
IIcon getPrimaryIcon(IDesignSystem system);
|
||||
|
||||
IIcon getSecondaryIcon(IDesignSystem system);
|
||||
IIcon getSecondaryIcon(IDesignSystem system);
|
||||
|
||||
ILayout getRotation();
|
||||
ILayout getRotation();
|
||||
|
||||
ILayout getHorizontalFlip();
|
||||
ILayout getHorizontalFlip();
|
||||
|
||||
void registerIcons(IIconRegister register);
|
||||
void registerIcons(IIconRegister register);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IToolHammer {
|
||||
boolean isActive(ItemStack stack);
|
||||
boolean isActive(ItemStack stack);
|
||||
|
||||
void onHammerUsed(ItemStack stack, EntityPlayer player);
|
||||
void onHammerUsed(ItemStack stack, EntityPlayer player);
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import binnie.extratrees.ExtraTrees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -24,251 +26,249 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
protected BlockETDoor() {
|
||||
super(Material.wood);
|
||||
setHardness(3.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("door");
|
||||
}
|
||||
protected BlockETDoor() {
|
||||
super(Material.wood);
|
||||
setHardness(3.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("door");
|
||||
}
|
||||
|
||||
public static DoorType getDoorType(int tileMeta) {
|
||||
int type = (tileMeta & 0xF00) >> 8;
|
||||
if (type >= 0 && type < DoorType.values().length) {
|
||||
return DoorType.values()[type];
|
||||
}
|
||||
return DoorType.STANDARD;
|
||||
}
|
||||
public static DoorType getDoorType(int tileMeta) {
|
||||
int type = (tileMeta & 0xF00) >> 8;
|
||||
if (type >= 0 && type < DoorType.values().length) {
|
||||
return DoorType.values()[type];
|
||||
}
|
||||
return DoorType.STANDARD;
|
||||
}
|
||||
|
||||
private IIcon getFlippedIcon(boolean upper, boolean flip, int tileMeta) {
|
||||
DoorType type = getDoorType(tileMeta);
|
||||
if (upper) {
|
||||
return flip ? type.iconDoorUpperFlip : type.iconDoorUpper;
|
||||
}
|
||||
return flip ? type.iconDoorLowerFlip : type.iconDoorLower;
|
||||
}
|
||||
private IIcon getFlippedIcon(boolean upper, boolean flip, int tileMeta) {
|
||||
DoorType type = getDoorType(tileMeta);
|
||||
if (upper) {
|
||||
return flip ? type.iconDoorUpperFlip : type.iconDoorUpper;
|
||||
}
|
||||
return flip ? type.iconDoorLowerFlip : type.iconDoorLower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return DoorType.STANDARD.iconDoorLower;
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return DoorType.STANDARD.iconDoorLower;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int meta) {
|
||||
if (meta != 1 && meta != 0) {
|
||||
int i1 = getFullMetadata(blockAccess, x, y, z);
|
||||
int j1 = i1 & 0x3;
|
||||
boolean flag = (i1 & 0x4) != 0;
|
||||
boolean flag2;
|
||||
boolean flag3 = (i1 & 0x8) != 0;
|
||||
if (flag) {
|
||||
flag2 = (j1 == 0 && meta == 2)
|
||||
|| (j1 == 1 && meta == 5)
|
||||
|| (j1 == 2 && meta == 3)
|
||||
|| (j1 == 3 && meta == 4);
|
||||
} else {
|
||||
flag2 = (j1 == 0 && meta == 5)
|
||||
|| (j1 == 1 && meta == 3)
|
||||
|| (j1 == 2 && meta == 4)
|
||||
|| (j1 == 3 && meta == 2);
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int meta) {
|
||||
if (meta != 1 && meta != 0) {
|
||||
int i1 = getFullMetadata(blockAccess, x, y, z);
|
||||
int j1 = i1 & 0x3;
|
||||
boolean flag = (i1 & 0x4) != 0;
|
||||
boolean flag2;
|
||||
boolean flag3 = (i1 & 0x8) != 0;
|
||||
if (flag) {
|
||||
flag2 = (j1 == 0 && meta == 2)
|
||||
|| (j1 == 1 && meta == 5)
|
||||
|| (j1 == 2 && meta == 3)
|
||||
|| (j1 == 3 && meta == 4);
|
||||
} else {
|
||||
flag2 = (j1 == 0 && meta == 5)
|
||||
|| (j1 == 1 && meta == 3)
|
||||
|| (j1 == 2 && meta == 4)
|
||||
|| (j1 == 3 && meta == 2);
|
||||
|
||||
if ((i1 & 0x10) != 0) {
|
||||
flag2 = !flag2;
|
||||
}
|
||||
}
|
||||
if ((i1 & 0x10) != 0) {
|
||||
flag2 = !flag2;
|
||||
}
|
||||
}
|
||||
|
||||
int tileMeta;
|
||||
if (flag3) {
|
||||
tileMeta = TileEntityMetadata.getTileMetadata(blockAccess, x, y - 1, z);
|
||||
} else {
|
||||
tileMeta = TileEntityMetadata.getTileMetadata(blockAccess, x, y, z);
|
||||
}
|
||||
return getFlippedIcon(flag3, flag2, tileMeta);
|
||||
}
|
||||
return DoorType.STANDARD.iconDoorLower;
|
||||
}
|
||||
int tileMeta;
|
||||
if (flag3) {
|
||||
tileMeta = TileEntityMetadata.getTileMetadata(blockAccess, x, y - 1, z);
|
||||
} else {
|
||||
tileMeta = TileEntityMetadata.getTileMetadata(blockAccess, x, y, z);
|
||||
}
|
||||
return getFlippedIcon(flag3, flag2, tileMeta);
|
||||
}
|
||||
return DoorType.STANDARD.iconDoorLower;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (DoorType type : DoorType.values()) {
|
||||
type.iconDoorLower = ExtraTrees.proxy.getIcon(register, "door." + type.id + ".lower");
|
||||
type.iconDoorUpper = ExtraTrees.proxy.getIcon(register, "door." + type.id + ".upper");
|
||||
type.iconDoorLowerFlip = new IconFlipped(type.iconDoorLower, true, false);
|
||||
type.iconDoorUpperFlip = new IconFlipped(type.iconDoorUpper, true, false);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (DoorType type : DoorType.values()) {
|
||||
type.iconDoorLower = ExtraTrees.proxy.getIcon(register, "door." + type.id + ".lower");
|
||||
type.iconDoorUpper = ExtraTrees.proxy.getIcon(register, "door." + type.id + ".upper");
|
||||
type.iconDoorLowerFlip = new IconFlipped(type.iconDoorLower, true, false);
|
||||
type.iconDoorUpperFlip = new IconFlipped(type.iconDoorUpper, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return ExtraTrees.doorRenderId;
|
||||
}
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return ExtraTrees.doorRenderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
int i1 = getFullMetadata(blockAccess, x, y, z);
|
||||
if ((i1 & 0x8) != 0) {
|
||||
int meta = TileEntityMetadata.getTileMetadata(blockAccess, x, y - 1, z);
|
||||
return WoodManager.getPlankType(meta & 0xFF).getColor();
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
int i1 = getFullMetadata(blockAccess, x, y, z);
|
||||
if ((i1 & 0x8) != 0) {
|
||||
int meta = TileEntityMetadata.getTileMetadata(blockAccess, x, y - 1, z);
|
||||
return WoodManager.getPlankType(meta & 0xFF).getColor();
|
||||
}
|
||||
|
||||
int meta = TileEntityMetadata.getTileMetadata(blockAccess, x, y, z);
|
||||
return WoodManager.getPlankType(meta & 0xFF).getColor();
|
||||
}
|
||||
int meta = TileEntityMetadata.getTileMetadata(blockAccess, x, y, z);
|
||||
return WoodManager.getPlankType(meta & 0xFF).getColor();
|
||||
}
|
||||
|
||||
public int getFullMetadata(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
int l = blockAccess.getBlockMetadata(x, y, z);
|
||||
boolean flag = (l & 0x8) != 0x0;
|
||||
int i1;
|
||||
int j1;
|
||||
if (flag) {
|
||||
i1 = blockAccess.getBlockMetadata(x, y - 1, z);
|
||||
j1 = l;
|
||||
} else {
|
||||
i1 = l;
|
||||
j1 = blockAccess.getBlockMetadata(x, y + 1, z);
|
||||
}
|
||||
public int getFullMetadata(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
int l = blockAccess.getBlockMetadata(x, y, z);
|
||||
boolean flag = (l & 0x8) != 0x0;
|
||||
int i1;
|
||||
int j1;
|
||||
if (flag) {
|
||||
i1 = blockAccess.getBlockMetadata(x, y - 1, z);
|
||||
j1 = l;
|
||||
} else {
|
||||
i1 = l;
|
||||
j1 = blockAccess.getBlockMetadata(x, y + 1, z);
|
||||
}
|
||||
|
||||
boolean flag2 = (j1 & 0x1) != 0x0;
|
||||
return (i1 & 0x7) | (flag ? 8 : 0) | (flag2 ? 16 : 0);
|
||||
}
|
||||
boolean flag2 = (j1 & 0x1) != 0x0;
|
||||
return (i1 & 0x7) | (flag ? 8 : 0) | (flag2 ? 16 : 0);
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if ((meta & 8) == 0) {
|
||||
boolean flag = false;
|
||||
if (world.getBlock(x, y + 1, z) != this) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
flag = true;
|
||||
}
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if ((meta & 8) == 0) {
|
||||
boolean flag = false;
|
||||
if (world.getBlock(x, y + 1, z) != this) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
if (!world.isRemote) {
|
||||
dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
}
|
||||
} else {
|
||||
boolean flag1 = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z);
|
||||
if ((flag1 || block.canProvidePower()) && block != this) {
|
||||
func_150014_a(world, x, y, z, flag1);
|
||||
}
|
||||
}
|
||||
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
if (world.getBlock(x, y + 1, z) == this) {
|
||||
world.setBlockToAir(x, y + 1, z);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (world.getBlock(x, y - 1, z) != this) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
if (flag) {
|
||||
if (!world.isRemote) {
|
||||
dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
}
|
||||
} else {
|
||||
boolean flag1 = world.isBlockIndirectlyGettingPowered(x, y, z)
|
||||
|| world.isBlockIndirectlyGettingPowered(x, y + 1, z);
|
||||
if ((flag1 || block.canProvidePower()) && block != this) {
|
||||
func_150014_a(world, x, y, z, flag1);
|
||||
}
|
||||
}
|
||||
|
||||
if (block != this) {
|
||||
onNeighborBlockChange(world, x, y - 1, z, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
if (world.getBlock(x, y + 1, z) == this) {
|
||||
world.setBlockToAir(x, y + 1, z);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (world.getBlock(x, y - 1, z) != this) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune) {
|
||||
if ((meta & 0x08) != 0) {
|
||||
y -= 1;
|
||||
}
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, meta);
|
||||
}
|
||||
if (block != this) {
|
||||
onNeighborBlockChange(world, x, y - 1, z, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune) {
|
||||
if ((meta & 0x08) != 0) {
|
||||
y -= 1;
|
||||
}
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int k) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int k) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack stack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack stack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack stack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(stack);
|
||||
String typeName = getDoorType(meta).getName();
|
||||
String woodName = WoodManager.getPlankType(meta & 0xFF).getName();
|
||||
if (typeName.isEmpty()) {
|
||||
return I18N.localise("extratrees.block.door.name", woodName);
|
||||
}
|
||||
return I18N.localise("extratrees.block.door.name.adv", woodName, typeName);
|
||||
}
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack stack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(stack);
|
||||
String typeName = getDoorType(meta).getName();
|
||||
String woodName = WoodManager.getPlankType(meta & 0xFF).getName();
|
||||
if (typeName.isEmpty()) {
|
||||
return I18N.localise("extratrees.block.door.name", woodName);
|
||||
}
|
||||
return I18N.localise("extratrees.block.door.name.adv", woodName, typeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack stack) {
|
||||
dropBlockAsItem(world, x, y, z, stack);
|
||||
}
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List itemList) {
|
||||
for (IPlankType type : PlankType.ExtraTreePlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
for (IPlankType type : PlankType.ForestryPlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
}
|
||||
for (IPlankType type : PlankType.VanillaPlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack stack) {
|
||||
dropBlockAsItem(world, x, y, z, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List itemList) {
|
||||
for (IPlankType type : PlankType.ExtraTreePlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
for (IPlankType type : PlankType.ForestryPlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
}
|
||||
for (IPlankType type : PlankType.VanillaPlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLog;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -21,185 +23,182 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETLog extends BlockLog implements IBlockMetadata {
|
||||
public BlockETLog() {
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("log");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
public BlockETLog() {
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("log");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < ILogType.ExtraTreeLog.values().length; ++i) {
|
||||
list.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < ILogType.ExtraTreeLog.values().length; ++i) {
|
||||
list.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata(), world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata(), world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
public IIcon getIcon(int side, int tileMeta, int blockMeta) {
|
||||
int oriented = blockMeta & 0xC;
|
||||
ILogType.ExtraTreeLog log = ILogType.ExtraTreeLog.values()[tileMeta];
|
||||
switch (oriented) {
|
||||
case 4:
|
||||
if (side > 3) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
public IIcon getIcon(int side, int tileMeta, int blockMeta) {
|
||||
int oriented = blockMeta & 0xC;
|
||||
ILogType.ExtraTreeLog log = ILogType.ExtraTreeLog.values()[tileMeta];
|
||||
switch (oriented) {
|
||||
case 4:
|
||||
if (side > 3) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
|
||||
case 8:
|
||||
if (side == 2 || side == 3) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
}
|
||||
if (side < 2) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
}
|
||||
case 8:
|
||||
if (side == 2 || side == 3) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
}
|
||||
if (side < 2) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int tileMeta) {
|
||||
return getIcon(side, tileMeta, 0);
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int tileMeta) {
|
||||
return getIcon(side, tileMeta, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
ILogType.ExtraTreeLog.registerIcons(register);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
ILogType.ExtraTreeLog.registerIcons(register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 31;
|
||||
}
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 31;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
ILogType.ExtraTreeLog[] logs= ILogType.ExtraTreeLog.values();
|
||||
if(meta < 0 || meta >= logs.length) {
|
||||
meta = 0;
|
||||
}
|
||||
return I18N.localise("extratrees.block.log.name", logs[meta].getName());
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
ILogType.ExtraTreeLog[] logs = ILogType.ExtraTreeLog.values();
|
||||
if (meta < 0 || meta >= logs.length) {
|
||||
meta = 0;
|
||||
}
|
||||
return I18N.localise("extratrees.block.log.name", logs[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float par6, float par7, float par8, int meta) {
|
||||
byte b0 = 0;
|
||||
switch (side) {
|
||||
case 0:
|
||||
case 1:
|
||||
b0 = 0;
|
||||
break;
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float par6, float par7, float par8, int meta) {
|
||||
byte b0 = 0;
|
||||
switch (side) {
|
||||
case 0:
|
||||
case 1:
|
||||
b0 = 0;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
b0 = 8;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
b0 = 8;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
b0 = 4;
|
||||
break;
|
||||
}
|
||||
return b0;
|
||||
}
|
||||
case 4:
|
||||
case 5:
|
||||
b0 = 4;
|
||||
break;
|
||||
}
|
||||
return b0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockWood;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -21,129 +23,126 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETPlanks extends BlockWood implements IBlockMetadata {
|
||||
public BlockETPlanks() {
|
||||
setBlockName("planks");
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
public BlockETPlanks() {
|
||||
setBlockName("planks");
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int i) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int i) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.plank.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.plank.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
list.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
list.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return PlankType.ExtraTreePlanks.values()[meta].getIcon();
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return PlankType.ExtraTreePlanks.values()[meta].getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
|
||||
plank.loadIcon(register);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
|
||||
plank.loadIcon(register);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import binnie.extratrees.ExtraTrees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockWoodSlab;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -21,141 +23,139 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
public BlockETSlab(boolean isDouble) {
|
||||
super(isDouble);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setHardness(2.0f);
|
||||
setResistance(5.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
public BlockETSlab(boolean isDouble) {
|
||||
super(isDouble);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setHardness(2.0f);
|
||||
setResistance(5.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
|
||||
if (!field_150004_a) {
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
if (!field_150004_a) {
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
setLightOpacity(0);
|
||||
setBlockName("slabs");
|
||||
}
|
||||
setLightOpacity(0);
|
||||
setBlockName("slabs");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
drops.addAll(BlockMetadata.getBlockDropped((IBlockMetadata) ExtraTrees.blockSlab, world, x, y, z, blockMeta));
|
||||
if (field_150004_a) {
|
||||
drops.addAll(BlockMetadata.getBlockDropped((IBlockMetadata) ExtraTrees.blockSlab, world, x, y, z, blockMeta));
|
||||
}
|
||||
return drops;
|
||||
}
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
drops.addAll(BlockMetadata.getBlockDropped((IBlockMetadata) ExtraTrees.blockSlab, world, x, y, z, blockMeta));
|
||||
if (field_150004_a) {
|
||||
drops.addAll(
|
||||
BlockMetadata.getBlockDropped((IBlockMetadata) ExtraTrees.blockSlab, world, x, y, z, blockMeta));
|
||||
}
|
||||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.woodslab.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.woodslab.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
if (field_150004_a) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
list.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
if (field_150004_a) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
list.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return PlankType.ExtraTreePlanks.values()[meta].getIcon();
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return PlankType.ExtraTreePlanks.values()[meta].getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import binnie.extratrees.ExtraTrees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -20,123 +22,122 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETStairs extends BlockStairs implements IBlockMetadata {
|
||||
public BlockETStairs(Block par2Block) {
|
||||
super(par2Block, 0);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("stairs");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
public BlockETStairs(Block par2Block) {
|
||||
super(par2Block, 0);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("stairs");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return ExtraTrees.stairsID;
|
||||
}
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return ExtraTrees.stairsID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return WoodManager.getPlankType(meta + 32).getIcon();
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return WoodManager.getPlankType(meta + 32).getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.woodstairs.name", WoodManager.getPlankType(meta + 32).getName());
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise(
|
||||
"extratrees.block.woodstairs.name",
|
||||
WoodManager.getPlankType(meta + 32).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,12 @@ import forestry.arboriculture.blocks.BlockForestryLeaves;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockShrubLeaves extends BlockForestryLeaves {
|
||||
public BlockShrubLeaves() {
|
||||
super();
|
||||
}
|
||||
public BlockShrubLeaves() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginLeavesDecay(World world, int x, int y, int z) {
|
||||
// ignored, no able decay
|
||||
}
|
||||
@Override
|
||||
public void beginLeavesDecay(World world, int x, int y, int z) {
|
||||
// ignored, no able decay
|
||||
}
|
||||
}
|
||||
@@ -7,24 +7,25 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BranchBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ExtraTrees.branchRenderId;
|
||||
}
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ExtraTrees.branchRenderId;
|
||||
}
|
||||
}
|
||||
@@ -9,74 +9,81 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class DoorBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
int c = block.colorMultiplier(renderer.blockAccess, x, y, z);
|
||||
float c2 = (c >> 16 & 0xFF) / 255.0f;
|
||||
float c3 = (c >> 8 & 0xFF) / 255.0f;
|
||||
float c4 = (c & 0xFF) / 255.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int l = renderer.blockAccess.getBlockMetadata(x, y, z);
|
||||
if ((l & 0x8) != 0x0) {
|
||||
if (renderer.blockAccess.getBlock(x, y - 1, z) != block) {
|
||||
return false;
|
||||
}
|
||||
} else if (renderer.blockAccess.getBlock(x, y + 1, z) != block) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
int c = block.colorMultiplier(renderer.blockAccess, x, y, z);
|
||||
float c2 = (c >> 16 & 0xFF) / 255.0f;
|
||||
float c3 = (c >> 8 & 0xFF) / 255.0f;
|
||||
float c4 = (c & 0xFF) / 255.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int l = renderer.blockAccess.getBlockMetadata(x, y, z);
|
||||
if ((l & 0x8) != 0x0) {
|
||||
if (renderer.blockAccess.getBlock(x, y - 1, z) != block) {
|
||||
return false;
|
||||
}
|
||||
} else if (renderer.blockAccess.getBlock(x, y + 1, z) != block) {
|
||||
return false;
|
||||
}
|
||||
|
||||
float f = 0.5f;
|
||||
float f2 = 1.0f;
|
||||
float f3 = 0.8f;
|
||||
float f4 = 0.6f;
|
||||
float f = 0.5f;
|
||||
float f2 = 1.0f;
|
||||
float f3 = 0.8f;
|
||||
float f4 = 0.6f;
|
||||
|
||||
int i1 = block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z);
|
||||
tessellator.setBrightness((renderer.renderMinY > 0.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y - 1, z));
|
||||
tessellator.setColorOpaque_F(f * c2, f * c3, f * c4);
|
||||
renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 0));
|
||||
int i1 = block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z);
|
||||
tessellator.setBrightness(
|
||||
(renderer.renderMinY > 0.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y - 1, z));
|
||||
tessellator.setColorOpaque_F(f * c2, f * c3, f * c4);
|
||||
renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 0));
|
||||
|
||||
tessellator.setBrightness((renderer.renderMaxY < 1.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y + 1, z));
|
||||
tessellator.setColorOpaque_F(f2 * c2, f2 * c3, f2 * c4);
|
||||
renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 1));
|
||||
tessellator.setBrightness(
|
||||
(renderer.renderMaxY < 1.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y + 1, z));
|
||||
tessellator.setColorOpaque_F(f2 * c2, f2 * c3, f2 * c4);
|
||||
renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 1));
|
||||
|
||||
tessellator.setBrightness((renderer.renderMinZ > 0.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z - 1));
|
||||
tessellator.setColorOpaque_F(f3 * c2, f3 * c3, f3 * c4);
|
||||
IIcon icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 2);
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
tessellator.setBrightness(
|
||||
(renderer.renderMinZ > 0.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z - 1));
|
||||
tessellator.setColorOpaque_F(f3 * c2, f3 * c3, f3 * c4);
|
||||
IIcon icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 2);
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
|
||||
renderer.flipTexture = false;
|
||||
tessellator.setBrightness((renderer.renderMaxZ < 1.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z + 1));
|
||||
tessellator.setColorOpaque_F(f3 * c2, f3 * c3, f3 * c4);
|
||||
icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 3);
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
renderer.flipTexture = false;
|
||||
tessellator.setBrightness(
|
||||
(renderer.renderMaxZ < 1.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z + 1));
|
||||
tessellator.setColorOpaque_F(f3 * c2, f3 * c3, f3 * c4);
|
||||
icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 3);
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
|
||||
renderer.flipTexture = false;
|
||||
tessellator.setBrightness((renderer.renderMinX > 0.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x - 1, y, z));
|
||||
tessellator.setColorOpaque_F(f4 * c2, f4 * c3, f4 * c4);
|
||||
icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 4);
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
renderer.flipTexture = false;
|
||||
tessellator.setBrightness(
|
||||
(renderer.renderMinX > 0.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x - 1, y, z));
|
||||
tessellator.setColorOpaque_F(f4 * c2, f4 * c3, f4 * c4);
|
||||
icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 4);
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
|
||||
renderer.flipTexture = false;
|
||||
tessellator.setBrightness((renderer.renderMaxX < 1.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x + 1, y, z));
|
||||
tessellator.setColorOpaque_F(f4 * c2, f4 * c3, f4 * c4);
|
||||
icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 5);
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
renderer.flipTexture = false;
|
||||
return true;
|
||||
}
|
||||
renderer.flipTexture = false;
|
||||
tessellator.setBrightness(
|
||||
(renderer.renderMaxX < 1.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x + 1, y, z));
|
||||
tessellator.setColorOpaque_F(f4 * c2, f4 * c3, f4 * c4);
|
||||
icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 5);
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
renderer.flipTexture = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ExtraTrees.doorRenderId;
|
||||
}
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ExtraTrees.doorRenderId;
|
||||
}
|
||||
}
|
||||
@@ -4,23 +4,23 @@ import binnie.core.util.I18N;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum DoorType {
|
||||
STANDARD("standard"),
|
||||
SOLID("solid"),
|
||||
DOUBLE("double"),
|
||||
FULL("full");
|
||||
STANDARD("standard"),
|
||||
SOLID("solid"),
|
||||
DOUBLE("double"),
|
||||
FULL("full");
|
||||
|
||||
protected String id;
|
||||
protected IIcon iconDoorLower;
|
||||
protected IIcon iconDoorUpper;
|
||||
protected IIcon iconDoorLowerFlip;
|
||||
protected IIcon iconDoorUpperFlip;
|
||||
protected IIcon iconItem;
|
||||
protected String id;
|
||||
protected IIcon iconDoorLower;
|
||||
protected IIcon iconDoorUpper;
|
||||
protected IIcon iconDoorLowerFlip;
|
||||
protected IIcon iconDoorUpperFlip;
|
||||
protected IIcon iconItem;
|
||||
|
||||
DoorType(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
DoorType(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.door.type." + id);
|
||||
}
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.door.type." + id);
|
||||
}
|
||||
}
|
||||
@@ -9,44 +9,44 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum FruitPod implements IIconProvider {
|
||||
Cocoa,
|
||||
Banana,
|
||||
Coconut,
|
||||
Plantain,
|
||||
RedBanana,
|
||||
Papayimar;
|
||||
Cocoa,
|
||||
Banana,
|
||||
Coconut,
|
||||
Plantain,
|
||||
RedBanana,
|
||||
Papayimar;
|
||||
|
||||
protected short[] textures;
|
||||
protected IIcon[] icons;
|
||||
protected short[] textures;
|
||||
protected IIcon[] icons;
|
||||
|
||||
FruitPod() {
|
||||
textures = new short[]{
|
||||
BinnieCore.proxy.getUniqueTextureUID(),
|
||||
BinnieCore.proxy.getUniqueTextureUID(),
|
||||
BinnieCore.proxy.getUniqueTextureUID(),
|
||||
};
|
||||
icons = new IIcon[3];
|
||||
}
|
||||
FruitPod() {
|
||||
textures = new short[] {
|
||||
BinnieCore.proxy.getUniqueTextureUID(),
|
||||
BinnieCore.proxy.getUniqueTextureUID(),
|
||||
BinnieCore.proxy.getUniqueTextureUID(),
|
||||
};
|
||||
icons = new IIcon[3];
|
||||
}
|
||||
|
||||
public short[] getTextures() {
|
||||
return textures;
|
||||
}
|
||||
public short[] getTextures() {
|
||||
return textures;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(short texUID) {
|
||||
int index = textures[0] - texUID;
|
||||
if (index >= 0 && index < 3) {
|
||||
return icons[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(short texUID) {
|
||||
int index = textures[0] - texUID;
|
||||
if (index >= 0 && index < 3) {
|
||||
return icons[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icons[0] = ExtraTrees.proxy.getIcon(register, "pods/" + toString().toLowerCase() + ".0");
|
||||
icons[1] = ExtraTrees.proxy.getIcon(register, "pods/" + toString().toLowerCase() + ".1");
|
||||
icons[2] = ExtraTrees.proxy.getIcon(register, "pods/" + toString().toLowerCase() + ".2");
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icons[0] = ExtraTrees.proxy.getIcon(register, "pods/" + toString().toLowerCase() + ".0");
|
||||
icons[1] = ExtraTrees.proxy.getIcon(register, "pods/" + toString().toLowerCase() + ".1");
|
||||
icons[2] = ExtraTrees.proxy.getIcon(register, "pods/" + toString().toLowerCase() + ".2");
|
||||
}
|
||||
}
|
||||
@@ -9,81 +9,87 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GateItemRenderer implements IItemRenderer {
|
||||
private void renderStairBlock(RenderBlocks renderBlocks, ItemStack item, float f, float g, float h) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
for (int k = 0; k < 3; ++k) {
|
||||
float f2 = 0.0625f;
|
||||
if (k == 0) {
|
||||
renderBlocks.setRenderBounds(0.5f - f2, 0.30000001192092896, 0.0, 0.5f + f2, 1.0, f2 * 2.0f);
|
||||
}
|
||||
if (k == 1) {
|
||||
renderBlocks.setRenderBounds(0.5f - f2, 0.30000001192092896, 1.0f - f2 * 2.0f, 0.5f + f2, 1.0, 1.0);
|
||||
}
|
||||
f2 = 0.0625f;
|
||||
if (k == 2) {
|
||||
renderBlocks.setRenderBounds(0.5f - f2, 0.5, 0.0, 0.5f + f2, 1.0f - f2, 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, renderBlocks.getBlockIconFromSideAndMetadata(block, 0, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0f, 1.0f, 0.0f);
|
||||
renderBlocks.renderFaceYPos(block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 1, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0f, 0.0f, -1.0f);
|
||||
renderBlocks.renderFaceZNeg(block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 2, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0f, 0.0f, 1.0f);
|
||||
renderBlocks.renderFaceZPos(block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 3, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1.0f, 0.0f, 0.0f);
|
||||
renderBlocks.renderFaceXNeg(block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 4, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0f, 0.0f, 0.0f);
|
||||
renderBlocks.renderFaceXPos(block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 5, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
private void renderStairBlock(RenderBlocks renderBlocks, ItemStack item, float f, float g, float h) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
for (int k = 0; k < 3; ++k) {
|
||||
float f2 = 0.0625f;
|
||||
if (k == 0) {
|
||||
renderBlocks.setRenderBounds(0.5f - f2, 0.30000001192092896, 0.0, 0.5f + f2, 1.0, f2 * 2.0f);
|
||||
}
|
||||
if (k == 1) {
|
||||
renderBlocks.setRenderBounds(0.5f - f2, 0.30000001192092896, 1.0f - f2 * 2.0f, 0.5f + f2, 1.0, 1.0);
|
||||
}
|
||||
f2 = 0.0625f;
|
||||
if (k == 2) {
|
||||
renderBlocks.setRenderBounds(0.5f - f2, 0.5, 0.0, 0.5f + f2, 1.0f - f2, 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, renderBlocks.getBlockIconFromSideAndMetadata(block, 0, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0f, 1.0f, 0.0f);
|
||||
renderBlocks.renderFaceYPos(
|
||||
block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 1, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0f, 0.0f, -1.0f);
|
||||
renderBlocks.renderFaceZNeg(
|
||||
block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 2, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0f, 0.0f, 1.0f);
|
||||
renderBlocks.renderFaceZPos(
|
||||
block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 3, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1.0f, 0.0f, 0.0f);
|
||||
renderBlocks.renderFaceXNeg(
|
||||
block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 4, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0f, 0.0f, 0.0f);
|
||||
renderBlocks.renderFaceXPos(
|
||||
block, 0.0, 0.0, 0.0, renderBlocks.getBlockIconFromSideAndMetadata(block, 5, item.getItemDamage()));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
case EQUIPPED:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
case EQUIPPED:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(
|
||||
IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
@Override
|
||||
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
renderStairBlock((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderStairBlock((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
case INVENTORY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,5 +3,5 @@ package binnie.extratrees.block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IFenceProvider {
|
||||
ItemStack getFence();
|
||||
ItemStack getFence();
|
||||
}
|
||||
@@ -1,219 +1,219 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.arboriculture.worldgen.BlockTypeLog;
|
||||
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.arboriculture.worldgen.BlockTypeLog;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface ILogType {
|
||||
void placeBlock(World p0, int p1, int p2, int p3);
|
||||
void placeBlock(World p0, int p1, int p2, int p3);
|
||||
|
||||
ItemStack getItemStack();
|
||||
ItemStack getItemStack();
|
||||
|
||||
int getColour();
|
||||
int getColour();
|
||||
|
||||
enum ExtraTreeLog implements ILogType {
|
||||
Apple("apple", 0x7b7a7b, PlankType.ExtraTreePlanks.Apple),
|
||||
Fig("fig", 0x807357, PlankType.ExtraTreePlanks.Fig),
|
||||
Butternut("butternut", 0xb7ada0, PlankType.ExtraTreePlanks.Butternut),
|
||||
Cherry("cherry", 0x716850, PlankType.ForestryPlanks.CHERRY),
|
||||
Whitebeam("whitebeam", 0x786a6d, PlankType.ExtraTreePlanks.Whitebeam),
|
||||
Rowan("rowan", 0xb6b09b, PlankType.ExtraTreePlanks.Rowan),
|
||||
Hemlock("hemlock", 0xada39b, PlankType.ExtraTreePlanks.Hemlock),
|
||||
Ash("ash", 0x898982, PlankType.ExtraTreePlanks.Ash),
|
||||
Alder("alder", 0xc6c0b8, PlankType.ExtraTreePlanks.Alder),
|
||||
Beech("beech", 0xb2917e, PlankType.ExtraTreePlanks.Beech),
|
||||
Hawthorn("hawthorn", 0x5f5745, PlankType.ExtraTreePlanks.Hawthorn),
|
||||
Banana("banana", 0x85924f),
|
||||
Yew("yew", 0xd1bbc1, PlankType.ExtraTreePlanks.Yew),
|
||||
Cypress("cypress", 0x9a8483, PlankType.ExtraTreePlanks.Cypress),
|
||||
Fir("fir", 0x828382, PlankType.ExtraTreePlanks.Fir),
|
||||
Hazel("hazel", 0xaa986f, PlankType.ExtraTreePlanks.Hazel),
|
||||
Hickory("hickory", 0x3e3530, PlankType.ExtraTreePlanks.Hickory),
|
||||
Elm("elm", 0x848386, PlankType.ExtraTreePlanks.Elm),
|
||||
Elder("elder", 0xd8b874, PlankType.ExtraTreePlanks.Elder),
|
||||
Holly("holly", 0xb5aa85, PlankType.ExtraTreePlanks.Holly),
|
||||
Hornbeam("hornbeam", 0xa39276, PlankType.ExtraTreePlanks.Hornbeam),
|
||||
Cedar("cedar", 0xad764f, PlankType.ExtraTreePlanks.Cedar),
|
||||
Olive("olive", 0x7b706a, PlankType.ExtraTreePlanks.Olive),
|
||||
Sweetgum("sweetgum", 0xa1a19c, PlankType.ExtraTreePlanks.Sweetgum),
|
||||
Locust("locust", 0xadacbc, PlankType.ExtraTreePlanks.Locust),
|
||||
Pear("pear", 0xa89779, PlankType.ExtraTreePlanks.Pear),
|
||||
Maclura("maclura", 0x8b5734, PlankType.ExtraTreePlanks.Maclura),
|
||||
Brazilwood("brazilwood", 0x9e8068, PlankType.ExtraTreePlanks.Brazilwood),
|
||||
Logwood("logwood", 0xf9e2d2, PlankType.ExtraTreePlanks.Logwood),
|
||||
Rosewood("rosewood", 0x998666, PlankType.ExtraTreePlanks.Rosewood),
|
||||
Purpleheart("purpleheart", 0x9392a2, PlankType.ExtraTreePlanks.Purpleheart),
|
||||
Iroko("iroko", 0x605c5b, PlankType.ExtraTreePlanks.Iroko),
|
||||
Gingko("gingko", 0xadae9c, PlankType.ExtraTreePlanks.Gingko),
|
||||
Eucalyptus("eucalyptus", 0xeadeda, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Eucalyptus2("eucalyptus", 0x867e65, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Box("box", 0xab6f57, PlankType.ExtraTreePlanks.Box),
|
||||
Syzgium("syzgium", 0xab6f57, PlankType.ExtraTreePlanks.Syzgium),
|
||||
Eucalyptus3("eucalyptus", 0x6cb03f, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Cinnamon("cinnamon", 0x86583c, PlankType.VanillaPlanks.JUNGLE),
|
||||
PinkIvory("pinkivory", 0x7f6554, PlankType.ExtraTreePlanks.PinkIvory);
|
||||
enum ExtraTreeLog implements ILogType {
|
||||
Apple("apple", 0x7b7a7b, PlankType.ExtraTreePlanks.Apple),
|
||||
Fig("fig", 0x807357, PlankType.ExtraTreePlanks.Fig),
|
||||
Butternut("butternut", 0xb7ada0, PlankType.ExtraTreePlanks.Butternut),
|
||||
Cherry("cherry", 0x716850, PlankType.ForestryPlanks.CHERRY),
|
||||
Whitebeam("whitebeam", 0x786a6d, PlankType.ExtraTreePlanks.Whitebeam),
|
||||
Rowan("rowan", 0xb6b09b, PlankType.ExtraTreePlanks.Rowan),
|
||||
Hemlock("hemlock", 0xada39b, PlankType.ExtraTreePlanks.Hemlock),
|
||||
Ash("ash", 0x898982, PlankType.ExtraTreePlanks.Ash),
|
||||
Alder("alder", 0xc6c0b8, PlankType.ExtraTreePlanks.Alder),
|
||||
Beech("beech", 0xb2917e, PlankType.ExtraTreePlanks.Beech),
|
||||
Hawthorn("hawthorn", 0x5f5745, PlankType.ExtraTreePlanks.Hawthorn),
|
||||
Banana("banana", 0x85924f),
|
||||
Yew("yew", 0xd1bbc1, PlankType.ExtraTreePlanks.Yew),
|
||||
Cypress("cypress", 0x9a8483, PlankType.ExtraTreePlanks.Cypress),
|
||||
Fir("fir", 0x828382, PlankType.ExtraTreePlanks.Fir),
|
||||
Hazel("hazel", 0xaa986f, PlankType.ExtraTreePlanks.Hazel),
|
||||
Hickory("hickory", 0x3e3530, PlankType.ExtraTreePlanks.Hickory),
|
||||
Elm("elm", 0x848386, PlankType.ExtraTreePlanks.Elm),
|
||||
Elder("elder", 0xd8b874, PlankType.ExtraTreePlanks.Elder),
|
||||
Holly("holly", 0xb5aa85, PlankType.ExtraTreePlanks.Holly),
|
||||
Hornbeam("hornbeam", 0xa39276, PlankType.ExtraTreePlanks.Hornbeam),
|
||||
Cedar("cedar", 0xad764f, PlankType.ExtraTreePlanks.Cedar),
|
||||
Olive("olive", 0x7b706a, PlankType.ExtraTreePlanks.Olive),
|
||||
Sweetgum("sweetgum", 0xa1a19c, PlankType.ExtraTreePlanks.Sweetgum),
|
||||
Locust("locust", 0xadacbc, PlankType.ExtraTreePlanks.Locust),
|
||||
Pear("pear", 0xa89779, PlankType.ExtraTreePlanks.Pear),
|
||||
Maclura("maclura", 0x8b5734, PlankType.ExtraTreePlanks.Maclura),
|
||||
Brazilwood("brazilwood", 0x9e8068, PlankType.ExtraTreePlanks.Brazilwood),
|
||||
Logwood("logwood", 0xf9e2d2, PlankType.ExtraTreePlanks.Logwood),
|
||||
Rosewood("rosewood", 0x998666, PlankType.ExtraTreePlanks.Rosewood),
|
||||
Purpleheart("purpleheart", 0x9392a2, PlankType.ExtraTreePlanks.Purpleheart),
|
||||
Iroko("iroko", 0x605c5b, PlankType.ExtraTreePlanks.Iroko),
|
||||
Gingko("gingko", 0xadae9c, PlankType.ExtraTreePlanks.Gingko),
|
||||
Eucalyptus("eucalyptus", 0xeadeda, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Eucalyptus2("eucalyptus", 0x867e65, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Box("box", 0xab6f57, PlankType.ExtraTreePlanks.Box),
|
||||
Syzgium("syzgium", 0xab6f57, PlankType.ExtraTreePlanks.Syzgium),
|
||||
Eucalyptus3("eucalyptus", 0x6cb03f, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Cinnamon("cinnamon", 0x86583c, PlankType.VanillaPlanks.JUNGLE),
|
||||
PinkIvory("pinkivory", 0x7f6554, PlankType.ExtraTreePlanks.PinkIvory);
|
||||
|
||||
protected String name;
|
||||
protected int color;
|
||||
protected IDesignMaterial plank;
|
||||
protected IIcon trunk;
|
||||
protected IIcon bark;
|
||||
protected String name;
|
||||
protected int color;
|
||||
protected IDesignMaterial plank;
|
||||
protected IIcon trunk;
|
||||
protected IIcon bark;
|
||||
|
||||
ExtraTreeLog(String name, int color) {
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
plank = null;
|
||||
}
|
||||
ExtraTreeLog(String name, int color) {
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
plank = null;
|
||||
}
|
||||
|
||||
ExtraTreeLog(String name, int color, IDesignMaterial plank) {
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
this.plank = plank;
|
||||
}
|
||||
ExtraTreeLog(String name, int color, IDesignMaterial plank) {
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
this.plank = plank;
|
||||
}
|
||||
|
||||
public static void registerIcons(IIconRegister register) {
|
||||
for (ExtraTreeLog log : values()) {
|
||||
log.trunk = ExtraTrees.proxy.getIcon(register, "logs/" + log.toString().toLowerCase() + "Trunk");
|
||||
log.bark = ExtraTrees.proxy.getIcon(register, "logs/" + log.toString().toLowerCase() + "Bark");
|
||||
}
|
||||
}
|
||||
public static void registerIcons(IIconRegister register) {
|
||||
for (ExtraTreeLog log : values()) {
|
||||
log.trunk = ExtraTrees.proxy.getIcon(
|
||||
register, "logs/" + log.toString().toLowerCase() + "Trunk");
|
||||
log.bark = ExtraTrees.proxy.getIcon(
|
||||
register, "logs/" + log.toString().toLowerCase() + "Bark");
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.planks." + name);
|
||||
}
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.planks." + name);
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
if (plank == null) {
|
||||
return;
|
||||
}
|
||||
public void addRecipe() {
|
||||
if (plank == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack log = getItemStack();
|
||||
ItemStack result = plank.getStack();
|
||||
result.stackSize = 4;
|
||||
GameRegistry.addShapelessRecipe(result, log);
|
||||
}
|
||||
ItemStack log = getItemStack();
|
||||
ItemStack result = plank.getStack();
|
||||
result.stackSize = 4;
|
||||
GameRegistry.addShapelessRecipe(result, log);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void placeBlock(World world, int x, int y, int z) {
|
||||
world.setBlock(x, y, z, ExtraTrees.blockLog, 0, 2);
|
||||
if (world.getTileEntity(x, y, z) != null) {
|
||||
((TileEntityMetadata) world.getTileEntity(x, y, z)).setTileMetadata(ordinal(), false);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void placeBlock(World world, int x, int y, int z) {
|
||||
world.setBlock(x, y, z, ExtraTrees.blockLog, 0, 2);
|
||||
if (world.getTileEntity(x, y, z) != null) {
|
||||
((TileEntityMetadata) world.getTileEntity(x, y, z)).setTileMetadata(ordinal(), false);
|
||||
}
|
||||
}
|
||||
|
||||
public IIcon getTrunk() {
|
||||
return trunk;
|
||||
}
|
||||
public IIcon getTrunk() {
|
||||
return trunk;
|
||||
}
|
||||
|
||||
public IIcon getBark() {
|
||||
return bark;
|
||||
}
|
||||
public IIcon getBark() {
|
||||
return bark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockLog, ordinal()).copy();
|
||||
}
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockLog, ordinal())
|
||||
.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return color;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getColour() {
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
||||
enum ForestryLog implements ILogType {
|
||||
LARCH(1, 0, 6376529),
|
||||
TEAK(1, 1, 3486249),
|
||||
ACACIA(1, 2, 7565906),
|
||||
LIME(1, 3, 7431512),
|
||||
CHESTNUT(2, 0, 6183484),
|
||||
WENGE(2, 1, 6444875),
|
||||
BAOBAB(2, 2, 14326376),
|
||||
SEQUOIA(2, 3, 11563861),
|
||||
KAPOK(3, 0, 5396559),
|
||||
EBONY(3, 1, 10453073),
|
||||
MAHOGANY(3, 2, 9403501),
|
||||
BALSA(3, 3, 8551285),
|
||||
WILLOW(4, 0, 10590869),
|
||||
WALNUT(4, 1, 9474682),
|
||||
GREENHEART(4, 2, 7956050),
|
||||
CHERRY(4, 3, 6296064),
|
||||
MAHOE(5, 0, 6382152),
|
||||
POPLAR(5, 1, 9217671),
|
||||
PALM(5, 2, 8941379),
|
||||
PAPAYA(5, 3, 9069862),
|
||||
PINE(6, 0, 7558729),
|
||||
PLUM(6, 1, 11961953),
|
||||
MAPLE(6, 2, 9078657),
|
||||
CITRUS(6, 3, 5983033);
|
||||
enum ForestryLog implements ILogType {
|
||||
LARCH(1, 0, 6376529),
|
||||
TEAK(1, 1, 3486249),
|
||||
ACACIA(1, 2, 7565906),
|
||||
LIME(1, 3, 7431512),
|
||||
CHESTNUT(2, 0, 6183484),
|
||||
WENGE(2, 1, 6444875),
|
||||
BAOBAB(2, 2, 14326376),
|
||||
SEQUOIA(2, 3, 11563861),
|
||||
KAPOK(3, 0, 5396559),
|
||||
EBONY(3, 1, 10453073),
|
||||
MAHOGANY(3, 2, 9403501),
|
||||
BALSA(3, 3, 8551285),
|
||||
WILLOW(4, 0, 10590869),
|
||||
WALNUT(4, 1, 9474682),
|
||||
GREENHEART(4, 2, 7956050),
|
||||
CHERRY(4, 3, 6296064),
|
||||
MAHOE(5, 0, 6382152),
|
||||
POPLAR(5, 1, 9217671),
|
||||
PALM(5, 2, 8941379),
|
||||
PAPAYA(5, 3, 9069862),
|
||||
PINE(6, 0, 7558729),
|
||||
PLUM(6, 1, 11961953),
|
||||
MAPLE(6, 2, 9078657),
|
||||
CITRUS(6, 3, 5983033);
|
||||
|
||||
protected int block;
|
||||
protected int metadata;
|
||||
protected int colour;
|
||||
protected int block;
|
||||
protected int metadata;
|
||||
protected int colour;
|
||||
|
||||
ForestryLog(int blockOffset, int meta, int colour) {
|
||||
block = blockOffset;
|
||||
metadata = meta;
|
||||
this.colour = colour;
|
||||
}
|
||||
ForestryLog(int blockOffset, int meta, int colour) {
|
||||
block = blockOffset;
|
||||
metadata = meta;
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void placeBlock(World world, int x, int y, int z) {
|
||||
BlockTypeLog logBlock = new BlockTypeLog(TreeManager.woodItemAccess.getLog(EnumWoodType.valueOf(name().toUpperCase()), false));
|
||||
logBlock.setDirection(ForgeDirection.UP);
|
||||
logBlock.setBlock(world, x, y, z);
|
||||
@Override
|
||||
public void placeBlock(World world, int x, int y, int z) {
|
||||
BlockTypeLog logBlock = new BlockTypeLog(
|
||||
TreeManager.woodItemAccess.getLog(EnumWoodType.valueOf(name().toUpperCase()), false));
|
||||
logBlock.setDirection(ForgeDirection.UP);
|
||||
logBlock.setBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return TreeManager.woodItemAccess.getLog(EnumWoodType.valueOf(name().toUpperCase()), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return TreeManager.woodItemAccess.getLog(EnumWoodType.valueOf(name().toUpperCase()), false);
|
||||
}
|
||||
@Override
|
||||
public int getColour() {
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
enum VanillaLog implements ILogType {
|
||||
Oak(6376752),
|
||||
Spruce(2759179),
|
||||
Birch(6376752),
|
||||
Jungle(5456154);
|
||||
|
||||
enum VanillaLog implements ILogType {
|
||||
Oak(6376752),
|
||||
Spruce(2759179),
|
||||
Birch(6376752),
|
||||
Jungle(5456154);
|
||||
protected int colour;
|
||||
|
||||
protected int colour;
|
||||
VanillaLog(int colour) {
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
VanillaLog(int colour) {
|
||||
this.colour = colour;
|
||||
}
|
||||
@Override
|
||||
public void placeBlock(World world, int x, int y, int z) {
|
||||
world.setBlock(x, y, z, Blocks.log, ordinal(), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void placeBlock(World world, int x, int y, int z) {
|
||||
world.setBlock(x, y, z, Blocks.log, ordinal(), 2);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return new ItemStack(Blocks.log, 1, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return new ItemStack(Blocks.log, 1, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getColour() {
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import binnie.extratrees.api.IDesignMaterial;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public interface IPlankType extends IDesignMaterial {
|
||||
IIcon getIcon();
|
||||
IIcon getIcon();
|
||||
|
||||
String getDescription();
|
||||
String getDescription();
|
||||
}
|
||||
@@ -15,97 +15,111 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemETDoor extends ItemMetadata {
|
||||
public ItemETDoor(Block block) {
|
||||
super(block);
|
||||
maxStackSize = 8;
|
||||
setCreativeTab(CreativeTabs.tabRedstone);
|
||||
}
|
||||
public ItemETDoor(Block block) {
|
||||
super(block);
|
||||
maxStackSize = 8;
|
||||
setCreativeTab(CreativeTabs.tabRedstone);
|
||||
}
|
||||
|
||||
public static void placeDoorBlock(World world, int x, int y, int z, int meta, Block block, ItemStack item, EntityPlayer player) {
|
||||
byte b0 = 0;
|
||||
byte b2 = 0;
|
||||
if (meta == 0) {
|
||||
b2 = 1;
|
||||
}
|
||||
if (meta == 1) {
|
||||
b0 = -1;
|
||||
}
|
||||
if (meta == 2) {
|
||||
b2 = -1;
|
||||
}
|
||||
if (meta == 3) {
|
||||
b0 = 1;
|
||||
}
|
||||
public static void placeDoorBlock(
|
||||
World world, int x, int y, int z, int meta, Block block, ItemStack item, EntityPlayer player) {
|
||||
byte b0 = 0;
|
||||
byte b2 = 0;
|
||||
if (meta == 0) {
|
||||
b2 = 1;
|
||||
}
|
||||
if (meta == 1) {
|
||||
b0 = -1;
|
||||
}
|
||||
if (meta == 2) {
|
||||
b2 = -1;
|
||||
}
|
||||
if (meta == 3) {
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
int i1 = (world.isBlockNormalCubeDefault(x - b0, y, z - b2, false) ? 1 : 0) + (world.isBlockNormalCubeDefault(x - b0, y + 1, z - b2, false) ? 1 : 0);
|
||||
int j1 = (world.isBlockNormalCubeDefault(x + b0, y, z + b2, false) ? 1 : 0) + (world.isBlockNormalCubeDefault(x + b0, y + 1, z + b2, false) ? 1 : 0);
|
||||
boolean flag = world.getBlock(x - b0, y, z - b2) == block || world.getBlock(x - b0, y + 1, z - b2) == block;
|
||||
boolean flag2 = world.getBlock(x + b0, y, z + b2) == block || world.getBlock(x + b0, y + 1, z + b2) == block;
|
||||
boolean flag3 = false;
|
||||
if (flag && !flag2 || j1 > i1) {
|
||||
flag3 = true;
|
||||
}
|
||||
int i1 = (world.isBlockNormalCubeDefault(x - b0, y, z - b2, false) ? 1 : 0)
|
||||
+ (world.isBlockNormalCubeDefault(x - b0, y + 1, z - b2, false) ? 1 : 0);
|
||||
int j1 = (world.isBlockNormalCubeDefault(x + b0, y, z + b2, false) ? 1 : 0)
|
||||
+ (world.isBlockNormalCubeDefault(x + b0, y + 1, z + b2, false) ? 1 : 0);
|
||||
boolean flag = world.getBlock(x - b0, y, z - b2) == block || world.getBlock(x - b0, y + 1, z - b2) == block;
|
||||
boolean flag2 = world.getBlock(x + b0, y, z + b2) == block || world.getBlock(x + b0, y + 1, z + b2) == block;
|
||||
boolean flag3 = false;
|
||||
if (flag && !flag2 || j1 > i1) {
|
||||
flag3 = true;
|
||||
}
|
||||
|
||||
world.setBlock(x, y, z, block, meta, 2);
|
||||
world.setBlock(x, y + 1, z, block, 0x8 | (flag3 ? 1 : 0), 2);
|
||||
if (world.getBlock(x, y, z) == block) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(TileEntityMetadata.getItemDamage(item), false);
|
||||
}
|
||||
block.onBlockPlacedBy(world, x, y, z, player, item);
|
||||
block.onPostBlockPlaced(world, x, y, z, meta);
|
||||
}
|
||||
world.setBlock(x, y, z, block, meta, 2);
|
||||
world.setBlock(x, y + 1, z, block, 0x8 | (flag3 ? 1 : 0), 2);
|
||||
if (world.getBlock(x, y, z) == block) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(TileEntityMetadata.getItemDamage(item), false);
|
||||
}
|
||||
block.onBlockPlacedBy(world, x, y, z, player, item);
|
||||
block.onPostBlockPlaced(world, x, y, z, meta);
|
||||
}
|
||||
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, block);
|
||||
world.notifyBlocksOfNeighborChange(x, y + 1, z, block);
|
||||
}
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, block);
|
||||
world.notifyBlocksOfNeighborChange(x, y + 1, z, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (DoorType type : DoorType.values()) {
|
||||
type.iconItem = ExtraTrees.proxy.getIcon(register, "door." + type.id);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (DoorType type : DoorType.values()) {
|
||||
type.iconItem = ExtraTrees.proxy.getIcon(register, "door." + type.id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int meta, float hitX, float hitY, float hitZ) {
|
||||
if (meta != 1) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int meta,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ) {
|
||||
if (meta != 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
y++;
|
||||
Block block = ExtraTrees.blockDoor;
|
||||
if (!player.canPlayerEdit(x, y, z, meta, stack) || !player.canPlayerEdit(x, y + 1, z, meta, stack)) {
|
||||
return false;
|
||||
}
|
||||
if (!block.canPlaceBlockAt(world, x, y, z)) {
|
||||
return false;
|
||||
}
|
||||
y++;
|
||||
Block block = ExtraTrees.blockDoor;
|
||||
if (!player.canPlayerEdit(x, y, z, meta, stack) || !player.canPlayerEdit(x, y + 1, z, meta, stack)) {
|
||||
return false;
|
||||
}
|
||||
if (!block.canPlaceBlockAt(world, x, y, z)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int newMeta = MathHelper.floor_double((player.rotationYaw + 180.0f) * 4.0f / 360.0f - 0.5) & 0x3;
|
||||
placeDoorBlock(world, x, y, z, newMeta, block, stack, player);
|
||||
stack.stackSize--;
|
||||
return true;
|
||||
}
|
||||
int newMeta = MathHelper.floor_double((player.rotationYaw + 180.0f) * 4.0f / 360.0f - 0.5) & 0x3;
|
||||
placeDoorBlock(world, x, y, z, newMeta, block, stack, player);
|
||||
stack.stackSize--;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getSpriteNumber() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getSpriteNumber() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
DoorType type = BlockETDoor.getDoorType(damage);
|
||||
return type.iconItem;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
DoorType type = BlockETDoor.getDoorType(damage);
|
||||
return type.iconItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int meta) {
|
||||
return WoodManager.getPlankType((stack == null) ? 0 : (stack.getItemDamage() & 0xFF)).getColor();
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int meta) {
|
||||
return WoodManager.getPlankType((stack == null) ? 0 : (stack.getItemDamage() & 0xFF))
|
||||
.getColor();
|
||||
}
|
||||
}
|
||||
@@ -11,80 +11,92 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemETSlab extends ItemMetadata {
|
||||
private boolean isFullBlock;
|
||||
private BlockETSlab theHalfSlab;
|
||||
private BlockETSlab doubleSlab;
|
||||
private boolean isFullBlock;
|
||||
private BlockETSlab theHalfSlab;
|
||||
private BlockETSlab doubleSlab;
|
||||
|
||||
public ItemETSlab(Block block) {
|
||||
super(block);
|
||||
theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
|
||||
doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
|
||||
isFullBlock = (block != theHalfSlab);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
public ItemETSlab(Block block) {
|
||||
super(block);
|
||||
theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
|
||||
doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
|
||||
isFullBlock = (block != theHalfSlab);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int meta, float hitX, float hitY, float hitZ) {
|
||||
if (isFullBlock) {
|
||||
return super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
if (stack.stackSize == 0 || !player.canPlayerEdit(x, y, z, meta, stack)) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int meta,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ) {
|
||||
if (isFullBlock) {
|
||||
return super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
if (stack.stackSize == 0 || !player.canPlayerEdit(x, y, z, meta, stack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
boolean flag = (j1 & 0x8) != 0x0;
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
boolean flag = (j1 & 0x8) != 0x0;
|
||||
|
||||
if (((meta == 1 && !flag) || (meta == 0 && flag)) && i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z)) && world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, true);
|
||||
}
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return func_77888_a(stack, player, world, x, y, z, meta)
|
||||
|| super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
if (((meta == 1 && !flag) || (meta == 0 && flag)) && i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z))
|
||||
&& world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, true);
|
||||
}
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return func_77888_a(stack, player, world, x, y, z, meta)
|
||||
|| super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
private boolean func_77888_a(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
if (side == 0) {
|
||||
y--;
|
||||
} else if (side == 1) {
|
||||
y++;
|
||||
} else if (side == 2) {
|
||||
z--;
|
||||
} else if (side == 3) {
|
||||
z++;
|
||||
} else if (side == 4) {
|
||||
x--;
|
||||
} else if (side == 5) {
|
||||
x++;
|
||||
}
|
||||
private boolean func_77888_a(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
if (side == 0) {
|
||||
y--;
|
||||
} else if (side == 1) {
|
||||
y++;
|
||||
} else if (side == 2) {
|
||||
z--;
|
||||
} else if (side == 3) {
|
||||
z++;
|
||||
} else if (side == 4) {
|
||||
x--;
|
||||
} else if (side == 5) {
|
||||
x++;
|
||||
}
|
||||
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
|
||||
if (i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z)) && world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, false);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z))
|
||||
&& world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, false);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -13,31 +13,42 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemETStairs extends ItemBlock {
|
||||
public ItemETStairs(Block block) {
|
||||
super(block);
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName("stairs");
|
||||
}
|
||||
public ItemETStairs(Block block) {
|
||||
super(block);
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName("stairs");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return PlankType.ExtraTreePlanks.values()[par1].getIcon();
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return PlankType.ExtraTreePlanks.values()[par1].getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
|
||||
boolean done = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);
|
||||
TileEntityMetadata tile = (TileEntityMetadata) world.getTileEntity(x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(stack.getItemDamage(), false);
|
||||
}
|
||||
return done;
|
||||
}
|
||||
@Override
|
||||
public boolean placeBlockAt(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ,
|
||||
int metadata) {
|
||||
boolean done = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);
|
||||
TileEntityMetadata tile = (TileEntityMetadata) world.getTileEntity(x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(stack.getItemDamage(), false);
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
return ((IBlockMetadata) field_150939_a).getBlockName(par1ItemStack);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
return ((IBlockMetadata) field_150939_a).getBlockName(par1ItemStack);
|
||||
}
|
||||
}
|
||||
@@ -32,113 +32,121 @@ import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ModuleBlocks implements IInitializable {
|
||||
public static int hedgeRenderID;
|
||||
public static int hedgeRenderID;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
PlankType.setup();
|
||||
ExtraTrees.blockPlanks = new BlockETPlanks();
|
||||
ExtraTrees.blockFence = new BlockFence();
|
||||
ExtraTrees.blockLog = new BlockETLog();
|
||||
ExtraTrees.blockShrubLeaves = new BlockShrubLeaves();
|
||||
ExtraTrees.blockGate = new BlockGate();
|
||||
ExtraTrees.blockDoor = new BlockETDoor();
|
||||
ExtraTrees.blockMultiFence = new BlockMultiFence();
|
||||
ExtraTrees.blockSlab = new BlockETSlab(false);
|
||||
ExtraTrees.blockDoubleSlab = new BlockETSlab(true);
|
||||
ExtraTrees.blockStairs = new BlockETStairs(ExtraTrees.blockPlanks);
|
||||
@Override
|
||||
public void preInit() {
|
||||
PlankType.setup();
|
||||
ExtraTrees.blockPlanks = new BlockETPlanks();
|
||||
ExtraTrees.blockFence = new BlockFence();
|
||||
ExtraTrees.blockLog = new BlockETLog();
|
||||
ExtraTrees.blockShrubLeaves = new BlockShrubLeaves();
|
||||
ExtraTrees.blockGate = new BlockGate();
|
||||
ExtraTrees.blockDoor = new BlockETDoor();
|
||||
ExtraTrees.blockMultiFence = new BlockMultiFence();
|
||||
ExtraTrees.blockSlab = new BlockETSlab(false);
|
||||
ExtraTrees.blockDoubleSlab = new BlockETSlab(true);
|
||||
ExtraTrees.blockStairs = new BlockETStairs(ExtraTrees.blockPlanks);
|
||||
|
||||
GameRegistry.registerBlock(ExtraTrees.blockPlanks, ItemMetadata.class, "planks");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockFence, ItemMetadata.class, "fence");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockMultiFence, ItemMetadata.class, "multifence");
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockMultiFence), new ItemMetadataRenderer());
|
||||
GameRegistry.registerBlock(ExtraTrees.blockLog, ItemMetadata.class, "log");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockGate, ItemMetadata.class, "gate");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockSlab, ItemETSlab.class, "slab");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockDoubleSlab, ItemETSlab.class, "doubleSlab");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockDoor, ItemETDoor.class, "door");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockStairs, ItemETStairs.class, "stairs");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockPlanks, ItemMetadata.class, "planks");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockFence, ItemMetadata.class, "fence");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockMultiFence, ItemMetadata.class, "multifence");
|
||||
BinnieCore.proxy.registerCustomItemRenderer(
|
||||
Item.getItemFromBlock(ExtraTrees.blockMultiFence), new ItemMetadataRenderer());
|
||||
GameRegistry.registerBlock(ExtraTrees.blockLog, ItemMetadata.class, "log");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockGate, ItemMetadata.class, "gate");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockSlab, ItemETSlab.class, "slab");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockDoubleSlab, ItemETSlab.class, "doubleSlab");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockDoor, ItemETDoor.class, "door");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockStairs, ItemETStairs.class, "stairs");
|
||||
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStairs), new StairItemRenderer());
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockGate), new GateItemRenderer());
|
||||
for (ILogType plank : ILogType.ExtraTreeLog.values()) {
|
||||
OreDictionary.registerOre("logWood", plank.getItemStack());
|
||||
}
|
||||
BinnieCore.proxy.registerCustomItemRenderer(
|
||||
Item.getItemFromBlock(ExtraTrees.blockStairs), new StairItemRenderer());
|
||||
BinnieCore.proxy.registerCustomItemRenderer(
|
||||
Item.getItemFromBlock(ExtraTrees.blockGate), new GateItemRenderer());
|
||||
for (ILogType plank : ILogType.ExtraTreeLog.values()) {
|
||||
OreDictionary.registerOre("logWood", plank.getItemStack());
|
||||
}
|
||||
|
||||
GameRegistry.addSmelting(ExtraTrees.blockLog, new ItemStack(Items.coal, 1, 1), 0.15f);
|
||||
for (IPlankType plank2 : PlankType.ExtraTreePlanks.values()) {
|
||||
OreDictionary.registerOre("plankWood", plank2.getStack());
|
||||
}
|
||||
GameRegistry.addSmelting(ExtraTrees.blockLog, new ItemStack(Items.coal, 1, 1), 0.15f);
|
||||
for (IPlankType plank2 : PlankType.ExtraTreePlanks.values()) {
|
||||
OreDictionary.registerOre("plankWood", plank2.getStack());
|
||||
}
|
||||
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:fence");
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:gate");
|
||||
// FMLInterModComms.sendMessage("Forestry", "add-alveary-slab", "ExtraTrees:slab");
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:multifence");
|
||||
ModuleBlocks.hedgeRenderID = BinnieCore.proxy.getUniqueRenderID();
|
||||
}
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:fence");
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:gate");
|
||||
// FMLInterModComms.sendMessage("Forestry", "add-alveary-slab", "ExtraTrees:slab");
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:multifence");
|
||||
ModuleBlocks.hedgeRenderID = BinnieCore.proxy.getUniqueRenderID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
ExtraTrees.fenceID = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new FenceRenderer());
|
||||
ExtraTrees.stairsID = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new StairsRenderer());
|
||||
ExtraTrees.doorRenderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new DoorBlockRenderer());
|
||||
ExtraTrees.branchRenderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new BranchBlockRenderer());
|
||||
RenderingRegistry.registerBlockHandler(new HedgeRenderer());
|
||||
RecipeSorter.register("extratrees:multifence", MultiFenceRecipeSize.class, RecipeSorter.Category.SHAPED, "");
|
||||
RecipeSorter.register("extratrees:multifence2", MultiFenceRecipeEmbedded.class, RecipeSorter.Category.SHAPED, "");
|
||||
RecipeSorter.register("extratrees:multifence3", MultiFenceRecipeSolid.class, RecipeSorter.Category.SHAPED, "");
|
||||
}
|
||||
@Override
|
||||
public void init() {
|
||||
ExtraTrees.fenceID = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new FenceRenderer());
|
||||
ExtraTrees.stairsID = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new StairsRenderer());
|
||||
ExtraTrees.doorRenderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new DoorBlockRenderer());
|
||||
ExtraTrees.branchRenderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new BranchBlockRenderer());
|
||||
RenderingRegistry.registerBlockHandler(new HedgeRenderer());
|
||||
RecipeSorter.register("extratrees:multifence", MultiFenceRecipeSize.class, RecipeSorter.Category.SHAPED, "");
|
||||
RecipeSorter.register(
|
||||
"extratrees:multifence2", MultiFenceRecipeEmbedded.class, RecipeSorter.Category.SHAPED, "");
|
||||
RecipeSorter.register("extratrees:multifence3", MultiFenceRecipeSolid.class, RecipeSorter.Category.SHAPED, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
|
||||
ItemStack planks = plank.getStack();
|
||||
ItemStack slabs = TileEntityMetadata.getItemStack(ExtraTrees.blockSlab, plank.ordinal());
|
||||
ItemStack stairs = TileEntityMetadata.getItemStack(ExtraTrees.blockStairs, plank.ordinal());
|
||||
stairs.stackSize = 4;
|
||||
GameRegistry.addRecipe(stairs.copy(), "# ", "## ", "###", '#', planks.copy());
|
||||
slabs.stackSize = 6;
|
||||
CraftingManager.getInstance().getRecipeList().add(0, new ShapedOreRecipe(slabs.copy(), "###", '#', planks.copy()));
|
||||
}
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
|
||||
ItemStack planks = plank.getStack();
|
||||
ItemStack slabs = TileEntityMetadata.getItemStack(ExtraTrees.blockSlab, plank.ordinal());
|
||||
ItemStack stairs = TileEntityMetadata.getItemStack(ExtraTrees.blockStairs, plank.ordinal());
|
||||
stairs.stackSize = 4;
|
||||
GameRegistry.addRecipe(stairs.copy(), "# ", "## ", "###", '#', planks.copy());
|
||||
slabs.stackSize = 6;
|
||||
CraftingManager.getInstance()
|
||||
.getRecipeList()
|
||||
.add(0, new ShapedOreRecipe(slabs.copy(), "###", '#', planks.copy()));
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeSize());
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeEmbedded());
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeSolid());
|
||||
for (IPlankType plank2 : WoodManager.getAllPlankTypes()) {
|
||||
ItemStack planks2 = plank2.getStack();
|
||||
ItemStack fenceNormal = WoodManager.getFence(plank2, new FenceType(0), 1);
|
||||
ItemStack gate = WoodManager.getGate(plank2);
|
||||
ItemStack doorStandard = WoodManager.getDoor(plank2, DoorType.STANDARD);
|
||||
ItemStack doorSolid = WoodManager.getDoor(plank2, DoorType.SOLID);
|
||||
ItemStack doorSplit = WoodManager.getDoor(plank2, DoorType.DOUBLE);
|
||||
ItemStack doorFull = WoodManager.getDoor(plank2, DoorType.FULL);
|
||||
if (planks2 != null) {
|
||||
if (gate == null) {
|
||||
continue;
|
||||
}
|
||||
gate.stackSize = 1;
|
||||
GameRegistry.addRecipe(gate.copy(), "fpf", 'f', fenceNormal.copy(), 'p', planks2.copy());
|
||||
fenceNormal.stackSize = 4;
|
||||
GameRegistry.addRecipe(fenceNormal.copy(), "###", "# #", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorSolid.copy(), "###", "###", "###", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorStandard.copy(), "# #", "###", "###", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorSplit.copy(), "# #", "###", "# #", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorFull.copy(), "# #", "# #", "# #", '#', planks2.copy());
|
||||
}
|
||||
}
|
||||
addSqueezer(ILogType.VanillaLog.Spruce, ExtraTreeLiquid.Resin, 50);
|
||||
}
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeSize());
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeEmbedded());
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeSolid());
|
||||
for (IPlankType plank2 : WoodManager.getAllPlankTypes()) {
|
||||
ItemStack planks2 = plank2.getStack();
|
||||
ItemStack fenceNormal = WoodManager.getFence(plank2, new FenceType(0), 1);
|
||||
ItemStack gate = WoodManager.getGate(plank2);
|
||||
ItemStack doorStandard = WoodManager.getDoor(plank2, DoorType.STANDARD);
|
||||
ItemStack doorSolid = WoodManager.getDoor(plank2, DoorType.SOLID);
|
||||
ItemStack doorSplit = WoodManager.getDoor(plank2, DoorType.DOUBLE);
|
||||
ItemStack doorFull = WoodManager.getDoor(plank2, DoorType.FULL);
|
||||
if (planks2 != null) {
|
||||
if (gate == null) {
|
||||
continue;
|
||||
}
|
||||
gate.stackSize = 1;
|
||||
GameRegistry.addRecipe(gate.copy(), "fpf", 'f', fenceNormal.copy(), 'p', planks2.copy());
|
||||
fenceNormal.stackSize = 4;
|
||||
GameRegistry.addRecipe(fenceNormal.copy(), "###", "# #", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorSolid.copy(), "###", "###", "###", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorStandard.copy(), "# #", "###", "###", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorSplit.copy(), "# #", "###", "# #", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorFull.copy(), "# #", "# #", "# #", '#', planks2.copy());
|
||||
}
|
||||
}
|
||||
addSqueezer(ILogType.VanillaLog.Spruce, ExtraTreeLiquid.Resin, 50);
|
||||
}
|
||||
|
||||
public void addSqueezer(ILogType log, ILiquidType liquid, int amount, float pulpChance) {
|
||||
FluidStack liquidStack = liquid.get(amount);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{log.getItemStack()}, liquidStack, Mods.forestry.stack("woodPulp"), (int) (100.0f * pulpChance));
|
||||
}
|
||||
public void addSqueezer(ILogType log, ILiquidType liquid, int amount, float pulpChance) {
|
||||
FluidStack liquidStack = liquid.get(amount);
|
||||
RecipeManagers.squeezerManager.addRecipe(
|
||||
10, new ItemStack[] {log.getItemStack()}, liquidStack, Mods.forestry.stack("woodPulp"), (int)
|
||||
(100.0f * pulpChance));
|
||||
}
|
||||
|
||||
public void addSqueezer(ILogType log, ILiquidType liquid, int amount) {
|
||||
addSqueezer(log, liquid, amount, 0.5f);
|
||||
}
|
||||
public void addSqueezer(ILogType log, ILiquidType liquid, int amount) {
|
||||
addSqueezer(log, liquid, amount, 0.5f);
|
||||
}
|
||||
}
|
||||
@@ -15,268 +15,270 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class PlankType {
|
||||
public static void setup() {
|
||||
for (VanillaPlanks plank : VanillaPlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank.ordinal(), plank);
|
||||
}
|
||||
for (ExtraTreePlanks plank2 : ExtraTreePlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank2.ordinal() + 32, plank2);
|
||||
}
|
||||
for (ForestryPlanks plank3 : ForestryPlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank3.ordinal() + 128, plank3);
|
||||
}
|
||||
for (ExtraBiomesPlank plank4 : ExtraBiomesPlank.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank4.ordinal() + 192, plank4);
|
||||
}
|
||||
}
|
||||
public static void setup() {
|
||||
for (VanillaPlanks plank : VanillaPlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank.ordinal(), plank);
|
||||
}
|
||||
for (ExtraTreePlanks plank2 : ExtraTreePlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank2.ordinal() + 32, plank2);
|
||||
}
|
||||
for (ForestryPlanks plank3 : ForestryPlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank3.ordinal() + 128, plank3);
|
||||
}
|
||||
for (ExtraBiomesPlank plank4 : ExtraBiomesPlank.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank4.ordinal() + 192, plank4);
|
||||
}
|
||||
}
|
||||
|
||||
public enum ExtraTreePlanks implements IPlankType, IFenceProvider {
|
||||
Fir(0xc38c54),
|
||||
Cedar(0xd86634),
|
||||
Hemlock(0xc7b56c),
|
||||
Cypress(0xf6b85c),
|
||||
Fig(0xc8882a),
|
||||
Beech(0xe19951),
|
||||
Alder(0xb88553),
|
||||
Hazel(0xcdb195),
|
||||
Hornbeam(0xc39860),
|
||||
Box(0xfbf1c6),
|
||||
Butternut(0xecaa7a),
|
||||
Hickory(0xdab48e),
|
||||
Whitebeam(0xc9c2b9),
|
||||
Elm(0xf0a964),
|
||||
Apple(0x603528),
|
||||
Yew(0xe0a57a),
|
||||
Pear(0xb8896d),
|
||||
Hawthorn(0xcc8362),
|
||||
Rowan(0xcfad9a),
|
||||
Elder(0xbe9279),
|
||||
Maclura(0xf3b22e),
|
||||
Syzgium(0xe6c3c1),
|
||||
Brazilwood(0x723e57),
|
||||
Logwood(0xa4372c),
|
||||
Iroko(0x753400),
|
||||
Locust(0xc39160),
|
||||
Eucalyptus(0xf6ab8b),
|
||||
Purpleheart(0x5b1c2f),
|
||||
Ash(0xf5c768),
|
||||
Holly(0xfbf6e7),
|
||||
Olive(0xb0ad88),
|
||||
Sweetgum(0xd59658),
|
||||
Rosewood(0x761500),
|
||||
Gingko(0xf4e7ba),
|
||||
PinkIvory(0xec8ca0);
|
||||
public enum ExtraTreePlanks implements IPlankType, IFenceProvider {
|
||||
Fir(0xc38c54),
|
||||
Cedar(0xd86634),
|
||||
Hemlock(0xc7b56c),
|
||||
Cypress(0xf6b85c),
|
||||
Fig(0xc8882a),
|
||||
Beech(0xe19951),
|
||||
Alder(0xb88553),
|
||||
Hazel(0xcdb195),
|
||||
Hornbeam(0xc39860),
|
||||
Box(0xfbf1c6),
|
||||
Butternut(0xecaa7a),
|
||||
Hickory(0xdab48e),
|
||||
Whitebeam(0xc9c2b9),
|
||||
Elm(0xf0a964),
|
||||
Apple(0x603528),
|
||||
Yew(0xe0a57a),
|
||||
Pear(0xb8896d),
|
||||
Hawthorn(0xcc8362),
|
||||
Rowan(0xcfad9a),
|
||||
Elder(0xbe9279),
|
||||
Maclura(0xf3b22e),
|
||||
Syzgium(0xe6c3c1),
|
||||
Brazilwood(0x723e57),
|
||||
Logwood(0xa4372c),
|
||||
Iroko(0x753400),
|
||||
Locust(0xc39160),
|
||||
Eucalyptus(0xf6ab8b),
|
||||
Purpleheart(0x5b1c2f),
|
||||
Ash(0xf5c768),
|
||||
Holly(0xfbf6e7),
|
||||
Olive(0xb0ad88),
|
||||
Sweetgum(0xd59658),
|
||||
Rosewood(0x761500),
|
||||
Gingko(0xf4e7ba),
|
||||
PinkIvory(0xec8ca0);
|
||||
|
||||
protected int color;
|
||||
protected IIcon icon;
|
||||
protected int color;
|
||||
protected IIcon icon;
|
||||
|
||||
ExtraTreePlanks(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
ExtraTreePlanks(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.planks." + toString().toLowerCase());
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.planks." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise("extratrees.block.planks." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise("extratrees.block.planks." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockPlanks, ordinal());
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockPlanks, ordinal());
|
||||
}
|
||||
|
||||
public IIcon loadIcon(IIconRegister register) {
|
||||
return icon = ExtraTrees.proxy.getIcon(register, "planks/" + toString());
|
||||
}
|
||||
public IIcon loadIcon(IIconRegister register) {
|
||||
return icon = ExtraTrees.proxy.getIcon(register, "planks/" + toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockFence, WoodManager.getPlankTypeIndex(this));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockFence, WoodManager.getPlankTypeIndex(this));
|
||||
}
|
||||
}
|
||||
|
||||
public enum VanillaPlanks implements IPlankType, IFenceProvider {
|
||||
OAK(0xb4905a),
|
||||
SPRUCE(0x805e36),
|
||||
BIRCH(0xd7c185),
|
||||
JUNGLE(0xb1805c),
|
||||
ACACIA(0xba6337),
|
||||
DARKOAK(0x462d15);
|
||||
public enum VanillaPlanks implements IPlankType, IFenceProvider {
|
||||
OAK(0xb4905a),
|
||||
SPRUCE(0x805e36),
|
||||
BIRCH(0xd7c185),
|
||||
JUNGLE(0xb1805c),
|
||||
ACACIA(0xba6337),
|
||||
DARKOAK(0x462d15);
|
||||
|
||||
protected int color;
|
||||
protected int color;
|
||||
|
||||
VanillaPlanks(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
VanillaPlanks(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.planks.vanilla." + toString().toLowerCase());
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.planks.vanilla." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise("extratrees.block.planks.vanilla." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise("extratrees.block.planks.vanilla." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return new ItemStack(Blocks.planks, 1, ordinal());
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return new ItemStack(Blocks.planks, 1, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
int meta = getStack().getItemDamage();
|
||||
Block block = Blocks.planks;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
int meta = getStack().getItemDamage();
|
||||
Block block = Blocks.planks;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockFence, WoodManager.getPlankTypeIndex(this));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockFence, WoodManager.getPlankTypeIndex(this));
|
||||
}
|
||||
}
|
||||
|
||||
public enum ForestryPlanks implements IPlankType, IFenceProvider {
|
||||
LARCH(0xd79f8d),
|
||||
TEAK(0x7d7963),
|
||||
ACACIA(0x94b387),
|
||||
LIME(0xceaa70),
|
||||
CHESTNUT(0xbbaa5d),
|
||||
WENGE(0x5e564a),
|
||||
BAOBAB(0x929c62),
|
||||
SEQUOIA(0x995a57),
|
||||
KAPOK(0x7c7434),
|
||||
EBONY(0x3c3730),
|
||||
MAHOGANY(0x763f38),
|
||||
BALSA(0xa9a299),
|
||||
WILLOW(0xb2b162),
|
||||
WALNUT(0x685242),
|
||||
GREENHEART(0x4e7e5c),
|
||||
CHERRY(0xb58234),
|
||||
MAHOE(0x7f98aa),
|
||||
POPLAR(0xcfcf82),
|
||||
PALM(0xca804b),
|
||||
PAPAYA(0xdccb75),
|
||||
PINE(0xc49e51),
|
||||
PLUM(0xad687f),
|
||||
MAPLE(0xae6d2b),
|
||||
CITRUS(0x9ca81d),
|
||||
GIGANTEUM(0x4f241e),
|
||||
IPE(0x4d2d1e),
|
||||
PADAUK(0xb36335),
|
||||
COCOBOLO(0x731302),
|
||||
ZEBRAWOOD(0xa6824e);
|
||||
public enum ForestryPlanks implements IPlankType, IFenceProvider {
|
||||
LARCH(0xd79f8d),
|
||||
TEAK(0x7d7963),
|
||||
ACACIA(0x94b387),
|
||||
LIME(0xceaa70),
|
||||
CHESTNUT(0xbbaa5d),
|
||||
WENGE(0x5e564a),
|
||||
BAOBAB(0x929c62),
|
||||
SEQUOIA(0x995a57),
|
||||
KAPOK(0x7c7434),
|
||||
EBONY(0x3c3730),
|
||||
MAHOGANY(0x763f38),
|
||||
BALSA(0xa9a299),
|
||||
WILLOW(0xb2b162),
|
||||
WALNUT(0x685242),
|
||||
GREENHEART(0x4e7e5c),
|
||||
CHERRY(0xb58234),
|
||||
MAHOE(0x7f98aa),
|
||||
POPLAR(0xcfcf82),
|
||||
PALM(0xca804b),
|
||||
PAPAYA(0xdccb75),
|
||||
PINE(0xc49e51),
|
||||
PLUM(0xad687f),
|
||||
MAPLE(0xae6d2b),
|
||||
CITRUS(0x9ca81d),
|
||||
GIGANTEUM(0x4f241e),
|
||||
IPE(0x4d2d1e),
|
||||
PADAUK(0xb36335),
|
||||
COCOBOLO(0x731302),
|
||||
ZEBRAWOOD(0xa6824e);
|
||||
|
||||
protected int color;
|
||||
protected int color;
|
||||
|
||||
ForestryPlanks(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
ForestryPlanks(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.planks.forestry." + toString().toLowerCase());
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise(
|
||||
"extratrees.block.planks.forestry." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise("extratrees.block.planks.forestry." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise(
|
||||
"extratrees.block.planks.forestry." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
Item stack = Mods.forestry.item("planks");
|
||||
return new ItemStack(stack, 1, ordinal());
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
Item stack = Mods.forestry.item("planks");
|
||||
return new ItemStack(stack, 1, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
if (getStack() != null) {
|
||||
int meta = getStack().getItemDamage();
|
||||
Block block = ((ItemBlock) getStack().getItem()).field_150939_a;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
if (getStack() != null) {
|
||||
int meta = getStack().getItemDamage();
|
||||
Block block = ((ItemBlock) getStack().getItem()).field_150939_a;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
ItemStack fence = Mods.forestry.stack("fences");
|
||||
fence.setItemDamage(ordinal());
|
||||
return fence;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
ItemStack fence = Mods.forestry.stack("fences");
|
||||
fence.setItemDamage(ordinal());
|
||||
return fence;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ExtraBiomesPlank implements IPlankType {
|
||||
Redwood(0x9b6b42),
|
||||
Fir(0x7e774a),
|
||||
Acacia(0xbfaa7e);
|
||||
public enum ExtraBiomesPlank implements IPlankType {
|
||||
Redwood(0x9b6b42),
|
||||
Fir(0x7e774a),
|
||||
Acacia(0xbfaa7e);
|
||||
|
||||
protected int color;
|
||||
protected int color;
|
||||
|
||||
ExtraBiomesPlank(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
ExtraBiomesPlank(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.planks.ebxl." + toString().toLowerCase());
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.block.planks.ebxl." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise("extratrees.block.planks.ebxl." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise("extratrees.block.planks.ebxl." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
try {
|
||||
Class clss = Class.forName("extrabiomes.api.Stuff");
|
||||
Block block = (Block) ((Optional) clss.getField("planks").get(null)).get();
|
||||
return new ItemStack(block, 1, ordinal());
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
try {
|
||||
Class clss = Class.forName("extrabiomes.api.Stuff");
|
||||
Block block = (Block) ((Optional) clss.getField("planks").get(null)).get();
|
||||
return new ItemStack(block, 1, ordinal());
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
if (getStack() != null) {
|
||||
int meta = getStack().getItemDamage();
|
||||
Block block = ((ItemBlock) getStack().getItem()).field_150939_a;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
if (getStack() != null) {
|
||||
int meta = getStack().getItemDamage();
|
||||
Block block = ((ItemBlock) getStack().getItem()).field_150939_a;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,78 +10,79 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class StairItemRenderer implements IItemRenderer {
|
||||
private void renderStairBlock(RenderBlocks renderBlocks, ItemStack item, float f, float g, float h) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
IIcon textureIndex = PlankType.ExtraTreePlanks.values()[item.getItemDamage()].getIcon();
|
||||
private void renderStairBlock(RenderBlocks renderBlocks, ItemStack item, float f, float g, float h) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
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(ItemStack item, IItemRenderer.ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
case EQUIPPED:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
case EQUIPPED:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(
|
||||
IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
@Override
|
||||
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
renderStairBlock((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderStairBlock((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case INVENTORY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,69 +9,70 @@ import net.minecraft.world.IBlockAccess;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class StairsRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(Block par1Block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
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);
|
||||
}
|
||||
@Override
|
||||
public void renderInventoryBlock(Block par1Block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
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(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
BlockETStairs blockStairs = (BlockETStairs) block;
|
||||
blockStairs.func_150147_e(renderer.blockAccess, x, y, z);
|
||||
renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
renderer.renderStandardBlock(blockStairs, x, y, z);
|
||||
boolean var5 = blockStairs.func_150145_f(renderer.blockAccess, x, y, z);
|
||||
renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
renderer.renderStandardBlock(blockStairs, x, y, z);
|
||||
if (var5 && blockStairs.func_150144_g(renderer.blockAccess, x, y, z)) {
|
||||
renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
renderer.renderStandardBlock(blockStairs, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
BlockETStairs blockStairs = (BlockETStairs) block;
|
||||
blockStairs.func_150147_e(renderer.blockAccess, x, y, z);
|
||||
renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
renderer.renderStandardBlock(blockStairs, x, y, z);
|
||||
boolean var5 = blockStairs.func_150145_f(renderer.blockAccess, x, y, z);
|
||||
renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
renderer.renderStandardBlock(blockStairs, x, y, z);
|
||||
if (var5 && blockStairs.func_150144_g(renderer.blockAccess, x, y, z)) {
|
||||
renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
renderer.renderStandardBlock(blockStairs, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ExtraTrees.stairsID;
|
||||
}
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ExtraTrees.stairsID;
|
||||
}
|
||||
}
|
||||
@@ -6,113 +6,113 @@ import binnie.extratrees.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import binnie.extratrees.block.decor.FenceDescription;
|
||||
import binnie.extratrees.block.decor.FenceType;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class WoodManager {
|
||||
public static IPlankType getPlankType(int index) {
|
||||
IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
|
||||
if (wood instanceof IPlankType) {
|
||||
return (IPlankType) wood;
|
||||
}
|
||||
return PlankType.ExtraTreePlanks.Fir;
|
||||
}
|
||||
public static IPlankType getPlankType(int index) {
|
||||
IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
|
||||
if (wood instanceof IPlankType) {
|
||||
return (IPlankType) wood;
|
||||
}
|
||||
return PlankType.ExtraTreePlanks.Fir;
|
||||
}
|
||||
|
||||
public static int getPlankTypeIndex(IPlankType type) {
|
||||
int index = CarpentryManager.carpentryInterface.getCarpentryWoodIndex(type);
|
||||
return (index < 0) ? 0 : index;
|
||||
}
|
||||
public static int getPlankTypeIndex(IPlankType type) {
|
||||
int index = CarpentryManager.carpentryInterface.getCarpentryWoodIndex(type);
|
||||
return (index < 0) ? 0 : index;
|
||||
}
|
||||
|
||||
public static FenceType getFenceType(ItemStack stack) {
|
||||
FenceDescription desc = getFenceDescription(stack);
|
||||
return (desc == null) ? null : desc.getFenceType();
|
||||
}
|
||||
public static FenceType getFenceType(ItemStack stack) {
|
||||
FenceDescription desc = getFenceDescription(stack);
|
||||
return (desc == null) ? null : desc.getFenceType();
|
||||
}
|
||||
|
||||
public static FenceDescription getFenceDescription(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
public static FenceDescription getFenceDescription(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (stack.getItem() == Item.getItemFromBlock(ExtraTrees.blockMultiFence)) {
|
||||
int damage = TileEntityMetadata.getItemDamage(stack);
|
||||
return getFenceDescription(damage);
|
||||
}
|
||||
if (stack.getItem() == Item.getItemFromBlock(ExtraTrees.blockMultiFence)) {
|
||||
int damage = TileEntityMetadata.getItemDamage(stack);
|
||||
return getFenceDescription(damage);
|
||||
}
|
||||
|
||||
for (IPlankType type : getAllPlankTypes()) {
|
||||
if (type instanceof IFenceProvider) {
|
||||
ItemStack f = ((IFenceProvider) type).getFence();
|
||||
if (f != null && ItemStack.areItemStacksEqual(stack, f)) {
|
||||
return new FenceDescription(new FenceType(0), type, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
for (IPlankType type : getAllPlankTypes()) {
|
||||
if (type instanceof IFenceProvider) {
|
||||
ItemStack f = ((IFenceProvider) type).getFence();
|
||||
if (f != null && ItemStack.areItemStacksEqual(stack, f)) {
|
||||
return new FenceDescription(new FenceType(0), type, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static FenceDescription getFenceDescription(int meta) {
|
||||
return new FenceDescription(meta);
|
||||
}
|
||||
public static FenceDescription getFenceDescription(int meta) {
|
||||
return new FenceDescription(meta);
|
||||
}
|
||||
|
||||
public static FenceType getFenceType(int meta) {
|
||||
return getFenceDescription(meta).getFenceType();
|
||||
}
|
||||
public static FenceType getFenceType(int meta) {
|
||||
return getFenceDescription(meta).getFenceType();
|
||||
}
|
||||
|
||||
public static ItemStack getGate(IPlankType plank) {
|
||||
if (plank == PlankType.VanillaPlanks.OAK) {
|
||||
return new ItemStack(Blocks.fence_gate);
|
||||
}
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockGate, getPlankTypeIndex(plank));
|
||||
}
|
||||
public static ItemStack getGate(IPlankType plank) {
|
||||
if (plank == PlankType.VanillaPlanks.OAK) {
|
||||
return new ItemStack(Blocks.fence_gate);
|
||||
}
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockGate, getPlankTypeIndex(plank));
|
||||
}
|
||||
|
||||
public static ItemStack getFence(IPlankType plank, FenceType type, int amount) {
|
||||
return getFence(plank, plank, type, amount);
|
||||
}
|
||||
public static ItemStack getFence(IPlankType plank, FenceType type, int amount) {
|
||||
return getFence(plank, plank, type, amount);
|
||||
}
|
||||
|
||||
public static ItemStack getFence(IPlankType plank, IPlankType plank2, FenceType type, int amount) {
|
||||
if (plank instanceof IFenceProvider && plank == plank2 && type.isPlain()) {
|
||||
ItemStack original = ((IFenceProvider) plank).getFence();
|
||||
if (original != null) {
|
||||
original.stackSize = amount;
|
||||
return original;
|
||||
}
|
||||
}
|
||||
public static ItemStack getFence(IPlankType plank, IPlankType plank2, FenceType type, int amount) {
|
||||
if (plank instanceof IFenceProvider && plank == plank2 && type.isPlain()) {
|
||||
ItemStack original = ((IFenceProvider) plank).getFence();
|
||||
if (original != null) {
|
||||
original.stackSize = amount;
|
||||
return original;
|
||||
}
|
||||
}
|
||||
|
||||
int ord = type.ordinal();
|
||||
int i = getPlankTypeIndex(plank) + 256 * ord;
|
||||
ItemStack stack = TileEntityMetadata.getItemStack(ExtraTrees.blockMultiFence, i + 65536 * getPlankTypeIndex(plank2));
|
||||
stack.stackSize = amount;
|
||||
return stack;
|
||||
}
|
||||
int ord = type.ordinal();
|
||||
int i = getPlankTypeIndex(plank) + 256 * ord;
|
||||
ItemStack stack =
|
||||
TileEntityMetadata.getItemStack(ExtraTrees.blockMultiFence, i + 65536 * getPlankTypeIndex(plank2));
|
||||
stack.stackSize = amount;
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ItemStack getDoor(IPlankType plank, DoorType type) {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockDoor, type.ordinal() * 256 + getPlankTypeIndex(plank));
|
||||
}
|
||||
public static ItemStack getDoor(IPlankType plank, DoorType type) {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockDoor, type.ordinal() * 256 + getPlankTypeIndex(plank));
|
||||
}
|
||||
|
||||
public static List<IPlankType> getAllPlankTypes() {
|
||||
List<IPlankType> list = new ArrayList<>();
|
||||
Collections.addAll(list, PlankType.ExtraTreePlanks.values());
|
||||
Collections.addAll(list, PlankType.ForestryPlanks.values());
|
||||
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
list.add(type);
|
||||
}
|
||||
}
|
||||
public static List<IPlankType> getAllPlankTypes() {
|
||||
List<IPlankType> list = new ArrayList<>();
|
||||
Collections.addAll(list, PlankType.ExtraTreePlanks.values());
|
||||
Collections.addAll(list, PlankType.ForestryPlanks.values());
|
||||
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
list.add(type);
|
||||
}
|
||||
}
|
||||
|
||||
Collections.addAll(list, PlankType.VanillaPlanks.values());
|
||||
return list;
|
||||
}
|
||||
Collections.addAll(list, PlankType.VanillaPlanks.values());
|
||||
return list;
|
||||
}
|
||||
|
||||
public static IPlankType get(ItemStack species) {
|
||||
for (IPlankType type : getAllPlankTypes()) {
|
||||
if (type.getStack() != null && type.getStack().isItemEqual(species)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static IPlankType get(ItemStack species) {
|
||||
for (IPlankType type : getAllPlankTypes()) {
|
||||
if (type.getStack() != null && type.getStack().isItemEqual(species)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,13 @@ import binnie.extratrees.block.WoodManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
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;
|
||||
@@ -26,162 +27,160 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockFence extends net.minecraft.block.BlockFence implements IBlockMetadata, IBlockFence {
|
||||
public BlockFence() {
|
||||
super("", Material.wood);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("fence");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
public BlockFence() {
|
||||
super("", Material.wood);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("fence");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
|
||||
for (IFenceProvider type : PlankType.VanillaPlanks.values()) {
|
||||
if (type != PlankType.VanillaPlanks.OAK) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (IFenceProvider type : PlankType.VanillaPlanks.values()) {
|
||||
if (type != PlankType.VanillaPlanks.OAK) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
public FenceDescription getDescription(int meta) {
|
||||
return WoodManager.getFenceDescription(meta);
|
||||
}
|
||||
public FenceDescription getDescription(int meta) {
|
||||
return WoodManager.getFenceDescription(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return getDescription(meta).getPlankType().getIcon();
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return getDescription(meta).getPlankType().getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return ExtraTrees.fenceID;
|
||||
}
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return ExtraTrees.fenceID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.woodfence.name", getDescription(meta).getPlankType().getName());
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise(
|
||||
"extratrees.block.woodfence.name",
|
||||
getDescription(meta).getPlankType().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
Material material = block.getMaterial();
|
||||
return IBlockFence.isFence(block) && material == this.blockMaterial
|
||||
|| material.isOpaque() && block.renderAsNormalBlock() && material != Material.gourd;
|
||||
}
|
||||
@Override
|
||||
public boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
Material material = block.getMaterial();
|
||||
return IBlockFence.isFence(block) && material == this.blockMaterial
|
||||
|| material.isOpaque() && block.renderAsNormalBlock() && material != Material.gourd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import binnie.extratrees.block.WoodManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -22,134 +24,131 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockGate extends BlockFenceGate implements IBlockMetadata {
|
||||
public BlockGate() {
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
public BlockGate() {
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
for (IPlankType type : WoodManager.getAllPlankTypes()) {
|
||||
ItemStack gate = WoodManager.getGate(type);
|
||||
if (gate != null) {
|
||||
itemList.add(gate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
for (IPlankType type : WoodManager.getAllPlankTypes()) {
|
||||
ItemStack gate = WoodManager.getGate(type);
|
||||
if (gate != null) {
|
||||
itemList.add(gate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return WoodManager.getPlankType(meta).getIcon();
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return WoodManager.getPlankType(meta).getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
@Override
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise(
|
||||
"extratrees.block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,12 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
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.AxisAlignedBB;
|
||||
@@ -20,161 +20,162 @@ import net.minecraft.world.ColorizerFoliage;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockHedge extends Block implements IBlockFence {
|
||||
public BlockHedge() {
|
||||
super(Material.leaves);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("hedge");
|
||||
}
|
||||
public BlockHedge() {
|
||||
super(Material.leaves);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("hedge");
|
||||
}
|
||||
|
||||
public static int getColor(int meta) {
|
||||
LeafType type = LeafType.values()[meta % 6];
|
||||
if (type == LeafType.CONIFER) {
|
||||
return ColorizerFoliage.getFoliageColorPine();
|
||||
}
|
||||
double d0 = 0.5;
|
||||
double d2 = 1.0;
|
||||
return ColorizerFoliage.getFoliageColor(d0, d2);
|
||||
}
|
||||
public static int getColor(int meta) {
|
||||
LeafType type = LeafType.values()[meta % 6];
|
||||
if (type == LeafType.CONIFER) {
|
||||
return ColorizerFoliage.getFoliageColorPine();
|
||||
}
|
||||
double d0 = 0.5;
|
||||
double d2 = 1.0;
|
||||
return ColorizerFoliage.getFoliageColor(d0, d2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) {
|
||||
boolean connectNegZ = canConnectFenceTo(world, x, y, z - 1);
|
||||
boolean connectPosZ = canConnectFenceTo(world, x, y, z + 1);
|
||||
boolean connectNegX = canConnectFenceTo(world, x - 1, y, z);
|
||||
boolean connectPosX = 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) {
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
|
||||
super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
|
||||
}
|
||||
@Override
|
||||
public void addCollisionBoxesToList(
|
||||
World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) {
|
||||
boolean connectNegZ = canConnectFenceTo(world, x, y, z - 1);
|
||||
boolean connectPosZ = canConnectFenceTo(world, x, y, z + 1);
|
||||
boolean connectNegX = canConnectFenceTo(world, x - 1, y, z);
|
||||
boolean connectPosX = 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) {
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
|
||||
super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
|
||||
}
|
||||
|
||||
f3 = 0.25f;
|
||||
f4 = 0.75f;
|
||||
if (connectNegX) {
|
||||
f = 0.0f;
|
||||
}
|
||||
if (connectPosX) {
|
||||
f2 = 1.0f;
|
||||
}
|
||||
if (connectNegX || connectPosX || (!connectNegZ && !connectPosZ)) {
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
|
||||
super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
|
||||
}
|
||||
if (connectNegZ) {
|
||||
f3 = 0.0f;
|
||||
}
|
||||
if (connectPosZ) {
|
||||
f4 = 1.0f;
|
||||
}
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
}
|
||||
f3 = 0.25f;
|
||||
f4 = 0.75f;
|
||||
if (connectNegX) {
|
||||
f = 0.0f;
|
||||
}
|
||||
if (connectPosX) {
|
||||
f2 = 1.0f;
|
||||
}
|
||||
if (connectNegX || connectPosX || (!connectNegZ && !connectPosZ)) {
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
|
||||
super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
|
||||
}
|
||||
if (connectNegZ) {
|
||||
f3 = 0.0f;
|
||||
}
|
||||
if (connectPosZ) {
|
||||
f4 = 1.0f;
|
||||
}
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
boolean connectNegZ = canConnectFenceTo(world, x, y, z - 1);
|
||||
boolean connectPosZ = canConnectFenceTo(world, x, y, z + 1);
|
||||
boolean connectNegX = canConnectFenceTo(world, x - 1, y, z);
|
||||
boolean connectPosX = 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;
|
||||
}
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
}
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
boolean connectNegZ = canConnectFenceTo(world, x, y, z - 1);
|
||||
boolean connectPosZ = canConnectFenceTo(world, x, y, z + 1);
|
||||
boolean connectNegX = canConnectFenceTo(world, x - 1, y, z);
|
||||
boolean connectPosX = 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;
|
||||
}
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return ModuleBlocks.hedgeRenderID;
|
||||
}
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return ModuleBlocks.hedgeRenderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block == this
|
||||
|| IBlockFence.isFence(block)
|
||||
|| block.isLeaves(world, x, y, z)
|
||||
|| (block.getMaterial().isOpaque() && block.renderAsNormalBlock() && block.getMaterial() != Material.gourd);
|
||||
}
|
||||
@Override
|
||||
public boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block == this
|
||||
|| IBlockFence.isFence(block)
|
||||
|| block.isLeaves(world, x, y, z)
|
||||
|| (block.getMaterial().isOpaque()
|
||||
&& block.renderAsNormalBlock()
|
||||
&& block.getMaterial() != Material.gourd);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
private LeafType getType(int meta) {
|
||||
return LeafType.values()[meta % 8];
|
||||
}
|
||||
private LeafType getType(int meta) {
|
||||
return LeafType.values()[meta % 8];
|
||||
}
|
||||
|
||||
private boolean isFull(int meta) {
|
||||
return meta / 8 > 0;
|
||||
}
|
||||
private boolean isFull(int meta) {
|
||||
return meta / 8 > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
LeafType type = getType(meta);
|
||||
return ForestryAPI.textureManager.getIcon(isFull(meta) ? type.plainUID : type.fancyUID);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
LeafType type = getType(meta);
|
||||
return ForestryAPI.textureManager.getIcon(isFull(meta) ? type.plainUID : type.fancyUID);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
for (int f = 0; f < 2; ++f) {
|
||||
list.add(new ItemStack(item, 1, i + f * 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
for (int f = 0; f < 2; ++f) {
|
||||
list.add(new ItemStack(item, 1, i + f * 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
return getColor(world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
return getColor(world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
}
|
||||
@@ -6,39 +6,42 @@ import binnie.core.util.I18N;
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockMultiFence extends BlockFence implements IBlockMetadata {
|
||||
public BlockMultiFence() {
|
||||
setBlockName("multifence");
|
||||
}
|
||||
public BlockMultiFence() {
|
||||
setBlockName("multifence");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (FenceType type : FenceType.values()) {
|
||||
list.add(WoodManager.getFence(PlankType.VanillaPlanks.SPRUCE, PlankType.VanillaPlanks.BIRCH, type, 1));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (FenceType type : FenceType.values()) {
|
||||
list.add(WoodManager.getFence(PlankType.VanillaPlanks.SPRUCE, PlankType.VanillaPlanks.BIRCH, type, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return (FenceRenderer.layer == 0)
|
||||
? getDescription(meta).getPlankType().getIcon()
|
||||
: getDescription(meta).getSecondaryPlankType().getIcon();
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return (FenceRenderer.layer == 0)
|
||||
? getDescription(meta).getPlankType().getIcon()
|
||||
: getDescription(meta).getSecondaryPlankType().getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
IPlankType type1 = getDescription(meta).getPlankType();
|
||||
IPlankType type2 = getDescription(meta).getSecondaryPlankType();
|
||||
FenceType type3 = getDescription(meta).getFenceType();
|
||||
boolean twoTypes = type1 != type2;
|
||||
return I18N.localise("extratrees.block.woodslab.name" + (twoTypes ? "2" : ""), type3.getPrefix(), type1.getName(), type2.getName());
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
IPlankType type1 = getDescription(meta).getPlankType();
|
||||
IPlankType type2 = getDescription(meta).getSecondaryPlankType();
|
||||
FenceType type3 = getDescription(meta).getFenceType();
|
||||
boolean twoTypes = type1 != type2;
|
||||
return I18N.localise(
|
||||
"extratrees.block.woodslab.name" + (twoTypes ? "2" : ""),
|
||||
type3.getPrefix(),
|
||||
type1.getName(),
|
||||
type2.getName());
|
||||
}
|
||||
}
|
||||
@@ -4,31 +4,31 @@ import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
|
||||
public class FenceDescription {
|
||||
protected FenceType fenceType;
|
||||
protected IPlankType plankType;
|
||||
protected IPlankType secondaryPlankType;
|
||||
protected FenceType fenceType;
|
||||
protected IPlankType plankType;
|
||||
protected IPlankType secondaryPlankType;
|
||||
|
||||
public FenceDescription(FenceType fenceType, IPlankType plankType, IPlankType secondaryPlankType) {
|
||||
this.fenceType = fenceType;
|
||||
this.plankType = plankType;
|
||||
this.secondaryPlankType = secondaryPlankType;
|
||||
}
|
||||
public FenceDescription(FenceType fenceType, IPlankType plankType, IPlankType secondaryPlankType) {
|
||||
this.fenceType = fenceType;
|
||||
this.plankType = plankType;
|
||||
this.secondaryPlankType = secondaryPlankType;
|
||||
}
|
||||
|
||||
public FenceDescription(int meta) {
|
||||
fenceType = new FenceType(meta >> 8 & 0xFF);
|
||||
plankType = WoodManager.getPlankType(meta & 0xFF);
|
||||
secondaryPlankType = WoodManager.getPlankType(meta >> 16 & 0xFF);
|
||||
}
|
||||
public FenceDescription(int meta) {
|
||||
fenceType = new FenceType(meta >> 8 & 0xFF);
|
||||
plankType = WoodManager.getPlankType(meta & 0xFF);
|
||||
secondaryPlankType = WoodManager.getPlankType(meta >> 16 & 0xFF);
|
||||
}
|
||||
|
||||
public FenceType getFenceType() {
|
||||
return fenceType;
|
||||
}
|
||||
public FenceType getFenceType() {
|
||||
return fenceType;
|
||||
}
|
||||
|
||||
public IPlankType getPlankType() {
|
||||
return plankType;
|
||||
}
|
||||
public IPlankType getPlankType() {
|
||||
return plankType;
|
||||
}
|
||||
|
||||
public IPlankType getSecondaryPlankType() {
|
||||
return secondaryPlankType;
|
||||
}
|
||||
public IPlankType getSecondaryPlankType() {
|
||||
return secondaryPlankType;
|
||||
}
|
||||
}
|
||||
@@ -12,272 +12,276 @@ import net.minecraft.world.IBlockAccess;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class FenceRenderer implements ISimpleBlockRenderingHandler {
|
||||
public static int layer;
|
||||
public static int layer;
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
Tessellator tess = Tessellator.instance;
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
float thickness = 0.125f;
|
||||
FenceRenderer.layer = 0;
|
||||
if (i == 0) {
|
||||
block.setBlockBounds(0.5f - thickness, 0.0f, 0.0f, 0.5f + thickness, 1.0f, thickness * 2.0f);
|
||||
}
|
||||
if (i == 1) {
|
||||
block.setBlockBounds(0.5f - thickness, 0.0f, 1.0f - thickness * 2.0f, 0.5f + thickness, 1.0f, 1.0f);
|
||||
}
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
Tessellator tess = Tessellator.instance;
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
float thickness = 0.125f;
|
||||
FenceRenderer.layer = 0;
|
||||
if (i == 0) {
|
||||
block.setBlockBounds(0.5f - thickness, 0.0f, 0.0f, 0.5f + thickness, 1.0f, thickness * 2.0f);
|
||||
}
|
||||
if (i == 1) {
|
||||
block.setBlockBounds(0.5f - thickness, 0.0f, 1.0f - thickness * 2.0f, 0.5f + thickness, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
float s = 0.0625f;
|
||||
FenceType fenceType = (block == ExtraTrees.blockMultiFence) ? WoodManager.getFenceType(metadata) : new FenceType(0);
|
||||
boolean bottomBar = !fenceType.solid;
|
||||
float topBarMaxY = 1.0f - s;
|
||||
float topBarMinY = 1.0f - s * 3.0f;
|
||||
float bottomBarMaxY = 0.5f - s;
|
||||
float bottomBarMinY = 0.5f - s * 3.0f;
|
||||
if (fenceType.size == 2) {
|
||||
bottomBarMinY -= 4.0f * s;
|
||||
bottomBarMaxY -= 4.0f * s;
|
||||
topBarMinY -= 4.0f * s;
|
||||
topBarMaxY -= 4.0f * s;
|
||||
}
|
||||
float s = 0.0625f;
|
||||
FenceType fenceType =
|
||||
(block == ExtraTrees.blockMultiFence) ? WoodManager.getFenceType(metadata) : new FenceType(0);
|
||||
boolean bottomBar = !fenceType.solid;
|
||||
float topBarMaxY = 1.0f - s;
|
||||
float topBarMinY = 1.0f - s * 3.0f;
|
||||
float bottomBarMaxY = 0.5f - s;
|
||||
float bottomBarMinY = 0.5f - s * 3.0f;
|
||||
if (fenceType.size == 2) {
|
||||
bottomBarMinY -= 4.0f * s;
|
||||
bottomBarMaxY -= 4.0f * s;
|
||||
topBarMinY -= 4.0f * s;
|
||||
topBarMaxY -= 4.0f * s;
|
||||
}
|
||||
|
||||
if (fenceType.size == 1) {
|
||||
bottomBarMinY -= 4.0f * s;
|
||||
bottomBarMaxY -= 4.0f * s;
|
||||
}
|
||||
if (fenceType.size == 1) {
|
||||
bottomBarMinY -= 4.0f * s;
|
||||
bottomBarMaxY -= 4.0f * s;
|
||||
}
|
||||
|
||||
if (fenceType.solid) {
|
||||
topBarMinY = bottomBarMinY;
|
||||
}
|
||||
if (fenceType.solid) {
|
||||
topBarMinY = bottomBarMinY;
|
||||
}
|
||||
|
||||
float minX = 0.5f - s;
|
||||
float maxX = 0.5f + s;
|
||||
float minZ = -s * 2.0f;
|
||||
float maxZ = 1.0f + s * 2.0f;
|
||||
if (i == 2) {
|
||||
block.setBlockBounds(minX, topBarMinY, minZ, maxX, topBarMaxY, maxZ);
|
||||
FenceRenderer.layer = 1;
|
||||
} else if (i == 3) {
|
||||
if (!bottomBar) {
|
||||
continue;
|
||||
}
|
||||
block.setBlockBounds(minX, bottomBarMinY, minZ, maxX, bottomBarMaxY, maxZ);
|
||||
FenceRenderer.layer = 1;
|
||||
} else if (i == 4) {
|
||||
if (fenceType.embossed) {
|
||||
minX -= s * 0.9f;
|
||||
maxX += s * 0.9f;
|
||||
minZ -= s;
|
||||
maxZ += s;
|
||||
float minY;
|
||||
float maxY;
|
||||
float minX = 0.5f - s;
|
||||
float maxX = 0.5f + s;
|
||||
float minZ = -s * 2.0f;
|
||||
float maxZ = 1.0f + s * 2.0f;
|
||||
if (i == 2) {
|
||||
block.setBlockBounds(minX, topBarMinY, minZ, maxX, topBarMaxY, maxZ);
|
||||
FenceRenderer.layer = 1;
|
||||
} else if (i == 3) {
|
||||
if (!bottomBar) {
|
||||
continue;
|
||||
}
|
||||
block.setBlockBounds(minX, bottomBarMinY, minZ, maxX, bottomBarMaxY, maxZ);
|
||||
FenceRenderer.layer = 1;
|
||||
} else if (i == 4) {
|
||||
if (fenceType.embossed) {
|
||||
minX -= s * 0.9f;
|
||||
maxX += s * 0.9f;
|
||||
minZ -= s;
|
||||
maxZ += s;
|
||||
float minY;
|
||||
float maxY;
|
||||
|
||||
if (fenceType.size != 1 && !fenceType.solid) {
|
||||
minY = bottomBarMinY + 2.0f * s;
|
||||
maxY = topBarMaxY - 2.0f * s;
|
||||
} else if (fenceType.size == 1 && fenceType.solid) {
|
||||
minY = bottomBarMinY + 2.0f * s;
|
||||
maxY = topBarMaxY - 2.0f * s;
|
||||
} else {
|
||||
minY = 0.5f - 2.0f * s;
|
||||
maxY = 0.5f + 2.0f * s;
|
||||
}
|
||||
if (fenceType.solid && fenceType.size == 0) {
|
||||
minY -= s;
|
||||
maxY -= s;
|
||||
}
|
||||
if (fenceType.solid && fenceType.size == 2) {
|
||||
minY += s;
|
||||
maxY += s;
|
||||
}
|
||||
block.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
FenceRenderer.layer = 0;
|
||||
} else {
|
||||
if (fenceType.size != 1 || fenceType.solid) {
|
||||
continue;
|
||||
}
|
||||
block.setBlockBounds(minX, 0.5f - s, minZ, maxX, 0.5f + s, maxZ);
|
||||
FenceRenderer.layer = 1;
|
||||
}
|
||||
}
|
||||
if (fenceType.size != 1 && !fenceType.solid) {
|
||||
minY = bottomBarMinY + 2.0f * s;
|
||||
maxY = topBarMaxY - 2.0f * s;
|
||||
} else if (fenceType.size == 1 && fenceType.solid) {
|
||||
minY = bottomBarMinY + 2.0f * s;
|
||||
maxY = topBarMaxY - 2.0f * s;
|
||||
} else {
|
||||
minY = 0.5f - 2.0f * s;
|
||||
maxY = 0.5f + 2.0f * s;
|
||||
}
|
||||
if (fenceType.solid && fenceType.size == 0) {
|
||||
minY -= s;
|
||||
maxY -= s;
|
||||
}
|
||||
if (fenceType.solid && fenceType.size == 2) {
|
||||
minY += s;
|
||||
maxY += s;
|
||||
}
|
||||
block.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
FenceRenderer.layer = 0;
|
||||
} else {
|
||||
if (fenceType.size != 1 || fenceType.solid) {
|
||||
continue;
|
||||
}
|
||||
block.setBlockBounds(minX, 0.5f - s, minZ, maxX, 0.5f + s, maxZ);
|
||||
FenceRenderer.layer = 1;
|
||||
}
|
||||
}
|
||||
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, -1.0f, 0.0f);
|
||||
renderer.renderFaceYNeg(block, 0.0, 0.0, 0.0, block.getIcon(0, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 1.0f, 0.0f);
|
||||
renderer.renderFaceYPos(block, 0.0, 0.0, 0.0, block.getIcon(1, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 0.0f, -1.0f);
|
||||
renderer.renderFaceXPos(block, 0.0, 0.0, 0.0, block.getIcon(2, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 0.0f, 1.0f);
|
||||
renderer.renderFaceXNeg(block, 0.0, 0.0, 0.0, block.getIcon(3, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(-1.0f, 0.0f, 0.0f);
|
||||
renderer.renderFaceZNeg(block, 0.0, 0.0, 0.0, block.getIcon(4, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(1.0f, 0.0f, 0.0f);
|
||||
renderer.renderFaceZPos(block, 0.0, 0.0, 0.0, block.getIcon(5, metadata));
|
||||
tess.draw();
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
block.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
}
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, -1.0f, 0.0f);
|
||||
renderer.renderFaceYNeg(block, 0.0, 0.0, 0.0, block.getIcon(0, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 1.0f, 0.0f);
|
||||
renderer.renderFaceYPos(block, 0.0, 0.0, 0.0, block.getIcon(1, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 0.0f, -1.0f);
|
||||
renderer.renderFaceXPos(block, 0.0, 0.0, 0.0, block.getIcon(2, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 0.0f, 1.0f);
|
||||
renderer.renderFaceXNeg(block, 0.0, 0.0, 0.0, block.getIcon(3, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(-1.0f, 0.0f, 0.0f);
|
||||
renderer.renderFaceZNeg(block, 0.0, 0.0, 0.0, block.getIcon(4, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(1.0f, 0.0f, 0.0f);
|
||||
renderer.renderFaceZPos(block, 0.0, 0.0, 0.0, block.getIcon(5, metadata));
|
||||
tess.draw();
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
block.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
FenceRenderer.layer = 0;
|
||||
BlockFence blockFence = (BlockFence) block;
|
||||
float i = 0.0625f;
|
||||
FenceType fenceType = new FenceType(0);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile != null && tile instanceof TileEntityMetadata && block instanceof BlockMultiFence) {
|
||||
fenceType = WoodManager.getFenceType(((TileEntityMetadata) tile).getTileMetadata());
|
||||
}
|
||||
@Override
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
FenceRenderer.layer = 0;
|
||||
BlockFence blockFence = (BlockFence) block;
|
||||
float i = 0.0625f;
|
||||
FenceType fenceType = new FenceType(0);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile != null && tile instanceof TileEntityMetadata && block instanceof BlockMultiFence) {
|
||||
fenceType = WoodManager.getFenceType(((TileEntityMetadata) tile).getTileMetadata());
|
||||
}
|
||||
|
||||
boolean rendered;
|
||||
float postWidth = 0.25f;
|
||||
float postHeight = 1.0f;
|
||||
float minPostPos = 0.5f - postWidth / 2.0f;
|
||||
float maxPostPos = 0.5f + postWidth / 2.0f;
|
||||
renderer.setRenderBounds(minPostPos, 0.0, minPostPos, maxPostPos, postHeight, maxPostPos);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
rendered = true;
|
||||
boolean connectAnyX = false;
|
||||
boolean connectAnyZ = false;
|
||||
if (blockFence.canConnectFenceTo(renderer.blockAccess, x - 1, y, z) || blockFence.canConnectFenceTo(renderer.blockAccess, x + 1, y, z)) {
|
||||
connectAnyX = true;
|
||||
}
|
||||
if (blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z - 1) || blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z + 1)) {
|
||||
connectAnyZ = true;
|
||||
}
|
||||
boolean rendered;
|
||||
float postWidth = 0.25f;
|
||||
float postHeight = 1.0f;
|
||||
float minPostPos = 0.5f - postWidth / 2.0f;
|
||||
float maxPostPos = 0.5f + postWidth / 2.0f;
|
||||
renderer.setRenderBounds(minPostPos, 0.0, minPostPos, maxPostPos, postHeight, maxPostPos);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
rendered = true;
|
||||
boolean connectAnyX = false;
|
||||
boolean connectAnyZ = false;
|
||||
if (blockFence.canConnectFenceTo(renderer.blockAccess, x - 1, y, z)
|
||||
|| blockFence.canConnectFenceTo(renderer.blockAccess, x + 1, y, z)) {
|
||||
connectAnyX = true;
|
||||
}
|
||||
if (blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z - 1)
|
||||
|| blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z + 1)) {
|
||||
connectAnyZ = true;
|
||||
}
|
||||
|
||||
boolean connectNegX = blockFence.canConnectFenceTo(renderer.blockAccess, x - 1, y, z);
|
||||
boolean connectPosX = blockFence.canConnectFenceTo(renderer.blockAccess, x + 1, y, z);
|
||||
boolean connectNegZ = blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z - 1);
|
||||
boolean connectPosZ = blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z + 1);
|
||||
if (!connectAnyX && !connectAnyZ) {
|
||||
connectAnyX = true;
|
||||
}
|
||||
boolean connectNegX = blockFence.canConnectFenceTo(renderer.blockAccess, x - 1, y, z);
|
||||
boolean connectPosX = blockFence.canConnectFenceTo(renderer.blockAccess, x + 1, y, z);
|
||||
boolean connectNegZ = blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z - 1);
|
||||
boolean connectPosZ = blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z + 1);
|
||||
if (!connectAnyX && !connectAnyZ) {
|
||||
connectAnyX = true;
|
||||
}
|
||||
|
||||
minPostPos = 7.0f * i;
|
||||
maxPostPos = 9.0f * i;
|
||||
float barMinY = 12.0f * i;
|
||||
float barMaxY = 15.0f * i;
|
||||
float minX = connectNegX ? 0.0f : minPostPos;
|
||||
float maxX = connectPosX ? 1.0f : maxPostPos;
|
||||
float minZ = connectNegZ ? 0.0f : minPostPos;
|
||||
float maxZ = connectPosZ ? 1.0f : maxPostPos;
|
||||
boolean renderBottom = true;
|
||||
if (fenceType.size == 2) {
|
||||
barMaxY -= 5.0f * i;
|
||||
barMinY -= 5.0f * i;
|
||||
}
|
||||
if (fenceType.solid) {
|
||||
renderBottom = false;
|
||||
if (fenceType.size == 0) {
|
||||
barMinY = 6.0f * i;
|
||||
} else {
|
||||
barMinY = i;
|
||||
}
|
||||
}
|
||||
minPostPos = 7.0f * i;
|
||||
maxPostPos = 9.0f * i;
|
||||
float barMinY = 12.0f * i;
|
||||
float barMaxY = 15.0f * i;
|
||||
float minX = connectNegX ? 0.0f : minPostPos;
|
||||
float maxX = connectPosX ? 1.0f : maxPostPos;
|
||||
float minZ = connectNegZ ? 0.0f : minPostPos;
|
||||
float maxZ = connectPosZ ? 1.0f : maxPostPos;
|
||||
boolean renderBottom = true;
|
||||
if (fenceType.size == 2) {
|
||||
barMaxY -= 5.0f * i;
|
||||
barMinY -= 5.0f * i;
|
||||
}
|
||||
if (fenceType.solid) {
|
||||
renderBottom = false;
|
||||
if (fenceType.size == 0) {
|
||||
barMinY = 6.0f * i;
|
||||
} else {
|
||||
barMinY = i;
|
||||
}
|
||||
}
|
||||
|
||||
float totalMaxY = barMaxY;
|
||||
FenceRenderer.layer = 1;
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
float totalMaxY = barMaxY;
|
||||
FenceRenderer.layer = 1;
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
|
||||
if (renderBottom) {
|
||||
barMinY -= 6.0f * i;
|
||||
barMaxY -= 6.0f * i;
|
||||
if (fenceType.size == 1) {
|
||||
barMinY += i;
|
||||
}
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
}
|
||||
if (renderBottom) {
|
||||
barMinY -= 6.0f * i;
|
||||
barMaxY -= 6.0f * i;
|
||||
if (fenceType.size == 1) {
|
||||
barMinY += i;
|
||||
}
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (renderBottom && fenceType.size == 1) {
|
||||
barMinY -= 6.0f * i;
|
||||
barMaxY -= 6.0f * i;
|
||||
barMaxY += i;
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
}
|
||||
if (renderBottom && fenceType.size == 1) {
|
||||
barMinY -= 6.0f * i;
|
||||
barMaxY -= 6.0f * i;
|
||||
barMaxY += i;
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
}
|
||||
|
||||
float totalMinY = barMinY;
|
||||
FenceRenderer.layer = 0;
|
||||
if (fenceType.embossed) {
|
||||
minPostPos -= (float) (i - 0.25 * i);
|
||||
maxPostPos += (float) (i - 0.25 * i);
|
||||
float minY = totalMinY + 2.0f * i;
|
||||
float maxY = totalMaxY - 2.0f * i;
|
||||
if (fenceType.size == 1 && !fenceType.solid) {
|
||||
minY = 6.0f * i;
|
||||
maxY = 10.0f * i;
|
||||
} else if (fenceType.size == 0 && fenceType.solid) {
|
||||
minY -= 4.0f * i;
|
||||
maxY -= 4.0f * i;
|
||||
} else if (fenceType.size == 2 && fenceType.solid) {
|
||||
minY += 4.0f * i;
|
||||
maxY += 4.0f * i;
|
||||
}
|
||||
float totalMinY = barMinY;
|
||||
FenceRenderer.layer = 0;
|
||||
if (fenceType.embossed) {
|
||||
minPostPos -= (float) (i - 0.25 * i);
|
||||
maxPostPos += (float) (i - 0.25 * i);
|
||||
float minY = totalMinY + 2.0f * i;
|
||||
float maxY = totalMaxY - 2.0f * i;
|
||||
if (fenceType.size == 1 && !fenceType.solid) {
|
||||
minY = 6.0f * i;
|
||||
maxY = 10.0f * i;
|
||||
} else if (fenceType.size == 0 && fenceType.solid) {
|
||||
minY -= 4.0f * i;
|
||||
maxY -= 4.0f * i;
|
||||
} else if (fenceType.size == 2 && fenceType.solid) {
|
||||
minY += 4.0f * i;
|
||||
maxY += 4.0f * i;
|
||||
}
|
||||
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, minY, minPostPos, maxX, maxY, maxPostPos);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, minY, minPostPos, maxX, maxY, maxPostPos);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, minY, minZ, maxPostPos, maxY, maxZ);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
}
|
||||
blockFence.setBlockBoundsBasedOnState(renderer.blockAccess, x, y, z);
|
||||
return rendered;
|
||||
}
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, minY, minZ, maxPostPos, maxY, maxZ);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
}
|
||||
blockFence.setBlockBoundsBasedOnState(renderer.blockAccess, x, y, z);
|
||||
return rendered;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ExtraTrees.fenceID;
|
||||
}
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ExtraTrees.fenceID;
|
||||
}
|
||||
}
|
||||
@@ -5,56 +5,54 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class FenceType {
|
||||
public int size;
|
||||
public boolean solid;
|
||||
public boolean embossed;
|
||||
public int size;
|
||||
public boolean solid;
|
||||
public boolean embossed;
|
||||
|
||||
public FenceType(int size, boolean solid, boolean embedded) {
|
||||
this.size = size;
|
||||
this.solid = solid;
|
||||
embossed = embedded;
|
||||
}
|
||||
public FenceType(int size, boolean solid, boolean embedded) {
|
||||
this.size = size;
|
||||
this.solid = solid;
|
||||
embossed = embedded;
|
||||
}
|
||||
|
||||
public FenceType(int meta) {
|
||||
size = (meta & 0x3);
|
||||
solid = ((meta >> 2 & 0x1) > 0);
|
||||
embossed = ((meta >> 3 & 0x1) > 0);
|
||||
}
|
||||
public FenceType(int meta) {
|
||||
size = (meta & 0x3);
|
||||
solid = ((meta >> 2 & 0x1) > 0);
|
||||
embossed = ((meta >> 3 & 0x1) > 0);
|
||||
}
|
||||
|
||||
public static Collection<FenceType> values() {
|
||||
List<FenceType> list = new ArrayList<>();
|
||||
for (int size = 0; size < 3; ++size) {
|
||||
for (boolean solid : new boolean[]{false, true}) {
|
||||
for (boolean embedded : new boolean[]{false, true}) {
|
||||
list.add(new FenceType(size, solid, embedded));
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
public static Collection<FenceType> values() {
|
||||
List<FenceType> list = new ArrayList<>();
|
||||
for (int size = 0; size < 3; ++size) {
|
||||
for (boolean solid : new boolean[] {false, true}) {
|
||||
for (boolean embedded : new boolean[] {false, true}) {
|
||||
list.add(new FenceType(size, solid, embedded));
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return ((size == 0) ? "" : ((size == 1) ? "Full " : "Low "))
|
||||
+ (solid ? "Solid " : "")
|
||||
+ (embossed ? "Embedded " : "");
|
||||
}
|
||||
public String getPrefix() {
|
||||
return ((size == 0) ? "" : ((size == 1) ? "Full " : "Low "))
|
||||
+ (solid ? "Solid " : "")
|
||||
+ (embossed ? "Embedded " : "");
|
||||
}
|
||||
|
||||
public int ordinal() {
|
||||
return size + ((solid ? 1 : 0) << 2) + ((embossed ? 1 : 0) << 3);
|
||||
}
|
||||
public int ordinal() {
|
||||
return size + ((solid ? 1 : 0) << 2) + ((embossed ? 1 : 0) << 3);
|
||||
}
|
||||
|
||||
public boolean isPlain() {
|
||||
return size == 0 && !embossed && !solid;
|
||||
}
|
||||
public boolean isPlain() {
|
||||
return size == 0 && !embossed && !solid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof FenceType) {
|
||||
FenceType o = (FenceType) obj;
|
||||
return o.size == size
|
||||
&& o.embossed == embossed
|
||||
&& o.solid == solid;
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof FenceType) {
|
||||
FenceType o = (FenceType) obj;
|
||||
return o.size == size && o.embossed == embossed && o.solid == solid;
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
}
|
||||
@@ -11,111 +11,112 @@ import net.minecraft.world.IBlockAccess;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class HedgeRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
int color = BlockHedge.getColor(metadata);
|
||||
int r = color >> 16 & 0xFF;
|
||||
int g = color >> 8 & 0xFF;
|
||||
int b = color & 0xFF;
|
||||
GL11.glColor3f(r / 255.0f, g / 255.0f, b / 255.0f);
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.25, 0.75, 1.0, 0.75);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, -1.0f, 0.0f);
|
||||
renderer.renderFaceYNeg(block, 0.0, 0.0, 0.0, block.getIcon(0, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 1.0f, 0.0f);
|
||||
renderer.renderFaceYPos(block, 0.0, 0.0, 0.0, block.getIcon(1, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 0.0f, -1.0f);
|
||||
renderer.renderFaceXPos(block, 0.0, 0.0, 0.0, block.getIcon(2, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 0.0f, 1.0f);
|
||||
renderer.renderFaceXNeg(block, 0.0, 0.0, 0.0, block.getIcon(3, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(-1.0f, 0.0f, 0.0f);
|
||||
renderer.renderFaceZNeg(block, 0.0, 0.0, 0.0, block.getIcon(4, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(1.0f, 0.0f, 0.0f);
|
||||
renderer.renderFaceZPos(block, 0.0, 0.0, 0.0, block.getIcon(5, metadata));
|
||||
tess.draw();
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
int color = BlockHedge.getColor(metadata);
|
||||
int r = color >> 16 & 0xFF;
|
||||
int g = color >> 8 & 0xFF;
|
||||
int b = color & 0xFF;
|
||||
GL11.glColor3f(r / 255.0f, g / 255.0f, b / 255.0f);
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.25, 0.75, 1.0, 0.75);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, -1.0f, 0.0f);
|
||||
renderer.renderFaceYNeg(block, 0.0, 0.0, 0.0, block.getIcon(0, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 1.0f, 0.0f);
|
||||
renderer.renderFaceYPos(block, 0.0, 0.0, 0.0, block.getIcon(1, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 0.0f, -1.0f);
|
||||
renderer.renderFaceXPos(block, 0.0, 0.0, 0.0, block.getIcon(2, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, 0.0f, 1.0f);
|
||||
renderer.renderFaceXNeg(block, 0.0, 0.0, 0.0, block.getIcon(3, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(-1.0f, 0.0f, 0.0f);
|
||||
renderer.renderFaceZNeg(block, 0.0, 0.0, 0.0, block.getIcon(4, metadata));
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(1.0f, 0.0f, 0.0f);
|
||||
renderer.renderFaceZPos(block, 0.0, 0.0, 0.0, block.getIcon(5, metadata));
|
||||
tess.draw();
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
IIcon icon = block.getIcon(0, world.getBlockMetadata(x, y, z));
|
||||
BlockHedge hedge = ExtraTrees.blockHedge;
|
||||
boolean connectNegX = hedge.canConnectFenceTo(world, x - 1, y, z);
|
||||
boolean connectPosX = hedge.canConnectFenceTo(world, x + 1, y, z);
|
||||
boolean connectNegZ = hedge.canConnectFenceTo(world, x, y, z - 1);
|
||||
boolean connectPosZ = hedge.canConnectFenceTo(world, x, y, z + 1);
|
||||
GL11.glPushMatrix();
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.25, 0.75, 1.0, 0.75);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
if (!connectNegX) {
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
}
|
||||
if (!connectPosX) {
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
}
|
||||
if (!connectNegZ) {
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
}
|
||||
if (!connectPosZ) {
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
}
|
||||
if (connectNegX) {
|
||||
renderer.setRenderBounds(0.0, 0.0, 0.25, 0.25, 1.0, 0.75);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
}
|
||||
if (connectPosX) {
|
||||
renderer.setRenderBounds(0.75, 0.0, 0.25, 1.0, 1.0, 0.75);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
}
|
||||
if (connectPosZ) {
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.75, 0.75, 1.0, 1.0);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
}
|
||||
if (connectNegZ) {
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.0, 0.75, 1.0, 0.25);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
IIcon icon = block.getIcon(0, world.getBlockMetadata(x, y, z));
|
||||
BlockHedge hedge = ExtraTrees.blockHedge;
|
||||
boolean connectNegX = hedge.canConnectFenceTo(world, x - 1, y, z);
|
||||
boolean connectPosX = hedge.canConnectFenceTo(world, x + 1, y, z);
|
||||
boolean connectNegZ = hedge.canConnectFenceTo(world, x, y, z - 1);
|
||||
boolean connectPosZ = hedge.canConnectFenceTo(world, x, y, z + 1);
|
||||
GL11.glPushMatrix();
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.25, 0.75, 1.0, 0.75);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
if (!connectNegX) {
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
}
|
||||
if (!connectPosX) {
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
}
|
||||
if (!connectNegZ) {
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
}
|
||||
if (!connectPosZ) {
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
}
|
||||
if (connectNegX) {
|
||||
renderer.setRenderBounds(0.0, 0.0, 0.25, 0.25, 1.0, 0.75);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
}
|
||||
if (connectPosX) {
|
||||
renderer.setRenderBounds(0.75, 0.0, 0.25, 1.0, 1.0, 0.75);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
}
|
||||
if (connectPosZ) {
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.75, 0.75, 1.0, 1.0);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
}
|
||||
if (connectNegZ) {
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.0, 0.75, 1.0, 0.25);
|
||||
renderer.renderFaceYPos(block, x, y, z, icon);
|
||||
renderer.renderFaceYNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ModuleBlocks.hedgeRenderID;
|
||||
}
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return ModuleBlocks.hedgeRenderID;
|
||||
}
|
||||
}
|
||||
@@ -9,53 +9,52 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MultiFenceRecipeEmbedded implements IRecipe {
|
||||
protected ItemStack cached;
|
||||
protected ItemStack cached;
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
FenceType type;
|
||||
for (int row = 0; row < 3; ++row) {
|
||||
ItemStack a = inv.getStackInSlot(row * 3);
|
||||
ItemStack b = inv.getStackInSlot(row * 3 + 1);
|
||||
ItemStack c = inv.getStackInSlot(row * 3 + 2);
|
||||
if (a == null || b == null || c == null) {
|
||||
continue;
|
||||
}
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
FenceType type;
|
||||
for (int row = 0; row < 3; ++row) {
|
||||
ItemStack a = inv.getStackInSlot(row * 3);
|
||||
ItemStack b = inv.getStackInSlot(row * 3 + 1);
|
||||
ItemStack c = inv.getStackInSlot(row * 3 + 2);
|
||||
if (a == null || b == null || c == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
type = WoodManager.getFenceType(a);
|
||||
FenceType type2 = WoodManager.getFenceType(c);
|
||||
if (type == null || type2 == null || !type.equals(type2)) {
|
||||
continue;
|
||||
}
|
||||
type = WoodManager.getFenceType(a);
|
||||
FenceType type2 = WoodManager.getFenceType(c);
|
||||
if (type == null || type2 == null || !type.equals(type2)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
IPlankType pType = WoodManager.get(b);
|
||||
if (WoodManager.getFenceDescription(a).getPlankType() != pType) {
|
||||
continue;
|
||||
}
|
||||
IPlankType pType = WoodManager.get(b);
|
||||
if (WoodManager.getFenceDescription(a).getPlankType() != pType) {
|
||||
continue;
|
||||
}
|
||||
|
||||
cached = WoodManager.getFence(
|
||||
WoodManager.getFenceDescription(a).getPlankType(),
|
||||
WoodManager.getFenceDescription(a).getSecondaryPlankType(),
|
||||
new FenceType(type.size, type.solid, true),
|
||||
2
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
cached = WoodManager.getFence(
|
||||
WoodManager.getFenceDescription(a).getPlankType(),
|
||||
WoodManager.getFenceDescription(a).getSecondaryPlankType(),
|
||||
new FenceType(type.size, type.solid, true),
|
||||
2);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return getRecipeOutput();
|
||||
}
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return getRecipeOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 3;
|
||||
}
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return (cached == null) ? new ItemStack(Blocks.fence) : cached;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return (cached == null) ? new ItemStack(Blocks.fence) : cached;
|
||||
}
|
||||
}
|
||||
@@ -2,77 +2,76 @@ package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MultiFenceRecipeSize implements IRecipe {
|
||||
protected ItemStack cached;
|
||||
protected ItemStack cached;
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
StringBuilder pattern = new StringBuilder();
|
||||
List<IPlankType> types = new ArrayList<>();
|
||||
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
IPlankType type = (stack == null) ? null : WoodManager.get(stack);
|
||||
if (stack != null && type == null) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
StringBuilder pattern = new StringBuilder();
|
||||
List<IPlankType> types = new ArrayList<>();
|
||||
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
IPlankType type = (stack == null) ? null : WoodManager.get(stack);
|
||||
if (stack != null && type == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (stack == null) {
|
||||
pattern.append(" ");
|
||||
} else {
|
||||
if (!types.contains(type)) {
|
||||
types.add(type);
|
||||
if (types.size() > 2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
pattern.append(types.indexOf(type));
|
||||
}
|
||||
}
|
||||
if (stack == null) {
|
||||
pattern.append(" ");
|
||||
} else {
|
||||
if (!types.contains(type)) {
|
||||
types.add(type);
|
||||
if (types.size() > 2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
pattern.append(types.indexOf(type));
|
||||
}
|
||||
}
|
||||
|
||||
if (types.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (types.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack fence = null;
|
||||
if (pattern.toString().contains("0100 0 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(1), new FenceType(0, false, false), 4);
|
||||
} else if (pattern.toString().contains("0000 0 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(0, false, false), 4);
|
||||
} else if (pattern.toString().contains("0100 0 1 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(1), new FenceType(1, false, false), 4);
|
||||
} else if (pattern.toString().contains("0000 0 0 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(1, false, false), 4);
|
||||
} else if (pattern.toString().contains(" 0 1 1101")) {
|
||||
fence = WoodManager.getFence(types.get(1), types.get(0), new FenceType(2, false, false), 4);
|
||||
} else if (pattern.toString().contains(" 0 0 0000")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(2, false, false), 4);
|
||||
}
|
||||
ItemStack fence = null;
|
||||
if (pattern.toString().contains("0100 0 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(1), new FenceType(0, false, false), 4);
|
||||
} else if (pattern.toString().contains("0000 0 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(0, false, false), 4);
|
||||
} else if (pattern.toString().contains("0100 0 1 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(1), new FenceType(1, false, false), 4);
|
||||
} else if (pattern.toString().contains("0000 0 0 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(1, false, false), 4);
|
||||
} else if (pattern.toString().contains(" 0 1 1101")) {
|
||||
fence = WoodManager.getFence(types.get(1), types.get(0), new FenceType(2, false, false), 4);
|
||||
} else if (pattern.toString().contains(" 0 0 0000")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(2, false, false), 4);
|
||||
}
|
||||
|
||||
cached = fence;
|
||||
return fence != null;
|
||||
}
|
||||
cached = fence;
|
||||
return fence != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return getRecipeOutput();
|
||||
}
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return getRecipeOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 3;
|
||||
}
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return (cached == null) ? new ItemStack(Blocks.fence) : cached;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return (cached == null) ? new ItemStack(Blocks.fence) : cached;
|
||||
}
|
||||
}
|
||||
@@ -8,49 +8,48 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MultiFenceRecipeSolid implements IRecipe {
|
||||
ItemStack cached;
|
||||
ItemStack cached;
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
FenceType type;
|
||||
for (int row = 0; row < 3; ++row) {
|
||||
ItemStack a = inv.getStackInSlot(row * 3);
|
||||
ItemStack b = inv.getStackInSlot(row * 3 + 1);
|
||||
ItemStack c = inv.getStackInSlot(row * 3 + 2);
|
||||
if (a == null || b == null || c == null) {
|
||||
continue;
|
||||
}
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
FenceType type;
|
||||
for (int row = 0; row < 3; ++row) {
|
||||
ItemStack a = inv.getStackInSlot(row * 3);
|
||||
ItemStack b = inv.getStackInSlot(row * 3 + 1);
|
||||
ItemStack c = inv.getStackInSlot(row * 3 + 2);
|
||||
if (a == null || b == null || c == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
type = WoodManager.getFenceType(a);
|
||||
FenceType type2 = WoodManager.getFenceType(b);
|
||||
FenceType type3 = WoodManager.getFenceType(c);
|
||||
if (type == null || type2 == null || type3 == null || !type.equals(type2) || !type.equals(type3)) {
|
||||
continue;
|
||||
}
|
||||
type = WoodManager.getFenceType(a);
|
||||
FenceType type2 = WoodManager.getFenceType(b);
|
||||
FenceType type3 = WoodManager.getFenceType(c);
|
||||
if (type == null || type2 == null || type3 == null || !type.equals(type2) || !type.equals(type3)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
cached = WoodManager.getFence(
|
||||
WoodManager.getFenceDescription(a).getPlankType(),
|
||||
WoodManager.getFenceDescription(a).getSecondaryPlankType(),
|
||||
new FenceType(type.size, true, type.solid),
|
||||
2
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
cached = WoodManager.getFence(
|
||||
WoodManager.getFenceDescription(a).getPlankType(),
|
||||
WoodManager.getFenceDescription(a).getSecondaryPlankType(),
|
||||
new FenceType(type.size, true, type.solid),
|
||||
2);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return getRecipeOutput();
|
||||
}
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return getRecipeOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 3;
|
||||
}
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return (cached == null) ? new ItemStack(Blocks.fence) : cached;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return (cached == null) ? new ItemStack(Blocks.fence) : cached;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import java.util.HashMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -8,142 +9,141 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class NBTShapedRecipe implements IRecipe {
|
||||
public int recipeWidth;
|
||||
public int recipeHeight;
|
||||
public ItemStack[] recipeItems;
|
||||
private ItemStack recipeOutput;
|
||||
private boolean field_92101_f;
|
||||
public int recipeWidth;
|
||||
public int recipeHeight;
|
||||
public ItemStack[] recipeItems;
|
||||
private ItemStack recipeOutput;
|
||||
private boolean field_92101_f;
|
||||
|
||||
public NBTShapedRecipe(ItemStack stack, Object... p_92103_2_) {
|
||||
String s = "";
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
|
||||
public NBTShapedRecipe(ItemStack stack, Object... p_92103_2_) {
|
||||
String s = "";
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
if (p_92103_2_[i] instanceof String[]) {
|
||||
String[] astring = (String[]) p_92103_2_[i++];
|
||||
for (String s2 : astring) {
|
||||
k++;
|
||||
j = s2.length();
|
||||
s += s2;
|
||||
}
|
||||
} else {
|
||||
while (p_92103_2_[i] instanceof String) {
|
||||
String s3 = (String) p_92103_2_[i++];
|
||||
++k;
|
||||
j = s3.length();
|
||||
s += s3;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_92103_2_[i] instanceof String[]) {
|
||||
String[] astring = (String[]) p_92103_2_[i++];
|
||||
for (String s2 : astring) {
|
||||
k++;
|
||||
j = s2.length();
|
||||
s += s2;
|
||||
}
|
||||
} else {
|
||||
while (p_92103_2_[i] instanceof String) {
|
||||
String s3 = (String) p_92103_2_[i++];
|
||||
++k;
|
||||
j = s3.length();
|
||||
s += s3;
|
||||
}
|
||||
}
|
||||
HashMap hashmap = new HashMap();
|
||||
while (i < p_92103_2_.length) {
|
||||
Character character = (Character) p_92103_2_[i];
|
||||
ItemStack itemstack1 = null;
|
||||
if (p_92103_2_[i + 1] instanceof Item) {
|
||||
itemstack1 = new ItemStack((Item) p_92103_2_[i + 1]);
|
||||
} else if (p_92103_2_[i + 1] instanceof Block) {
|
||||
itemstack1 = new ItemStack((Block) p_92103_2_[i + 1], 1, 32767);
|
||||
} else if (p_92103_2_[i + 1] instanceof ItemStack) {
|
||||
itemstack1 = (ItemStack) p_92103_2_[i + 1];
|
||||
}
|
||||
|
||||
HashMap hashmap = new HashMap();
|
||||
while (i < p_92103_2_.length) {
|
||||
Character character = (Character) p_92103_2_[i];
|
||||
ItemStack itemstack1 = null;
|
||||
if (p_92103_2_[i + 1] instanceof Item) {
|
||||
itemstack1 = new ItemStack((Item) p_92103_2_[i + 1]);
|
||||
} else if (p_92103_2_[i + 1] instanceof Block) {
|
||||
itemstack1 = new ItemStack((Block) p_92103_2_[i + 1], 1, 32767);
|
||||
} else if (p_92103_2_[i + 1] instanceof ItemStack) {
|
||||
itemstack1 = (ItemStack) p_92103_2_[i + 1];
|
||||
}
|
||||
hashmap.put(character, itemstack1);
|
||||
i += 2;
|
||||
}
|
||||
|
||||
hashmap.put(character, itemstack1);
|
||||
i += 2;
|
||||
}
|
||||
ItemStack[] aitemstack = new ItemStack[j * k];
|
||||
for (int i2 = 0; i2 < j * k; ++i2) {
|
||||
char c0 = s.charAt(i2);
|
||||
if (hashmap.containsKey(c0)) {
|
||||
aitemstack[i2] = ((ItemStack) hashmap.get(c0)).copy();
|
||||
} else {
|
||||
aitemstack[i2] = null;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack[] aitemstack = new ItemStack[j * k];
|
||||
for (int i2 = 0; i2 < j * k; ++i2) {
|
||||
char c0 = s.charAt(i2);
|
||||
if (hashmap.containsKey(c0)) {
|
||||
aitemstack[i2] = ((ItemStack) hashmap.get(c0)).copy();
|
||||
} else {
|
||||
aitemstack[i2] = null;
|
||||
}
|
||||
}
|
||||
recipeWidth = j;
|
||||
recipeHeight = k;
|
||||
recipeItems = aitemstack;
|
||||
recipeOutput = stack;
|
||||
NBTShapedRecipes.addRecipe(this);
|
||||
}
|
||||
|
||||
recipeWidth = j;
|
||||
recipeHeight = k;
|
||||
recipeItems = aitemstack;
|
||||
recipeOutput = stack;
|
||||
NBTShapedRecipes.addRecipe(this);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return recipeOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return recipeOutput;
|
||||
}
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) {
|
||||
for (int i = 0; i <= 3 - recipeWidth; ++i) {
|
||||
for (int j = 0; j <= 3 - recipeHeight; ++j) {
|
||||
if (checkMatch(p_77569_1_, i, j, true)) {
|
||||
return true;
|
||||
}
|
||||
if (checkMatch(p_77569_1_, i, j, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) {
|
||||
for (int i = 0; i <= 3 - recipeWidth; ++i) {
|
||||
for (int j = 0; j <= 3 - recipeHeight; ++j) {
|
||||
if (checkMatch(p_77569_1_, i, j, true)) {
|
||||
return true;
|
||||
}
|
||||
if (checkMatch(p_77569_1_, i, j, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private boolean checkMatch(InventoryCrafting crafting, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) {
|
||||
for (int k = 0; k < 3; ++k) {
|
||||
for (int l = 0; l < 3; ++l) {
|
||||
int i1 = k - p_77573_2_;
|
||||
int j1 = l - p_77573_3_;
|
||||
ItemStack itemstack = null;
|
||||
if (i1 >= 0 && j1 >= 0 && i1 < recipeWidth && j1 < recipeHeight) {
|
||||
if (p_77573_4_) {
|
||||
itemstack = recipeItems[recipeWidth - i1 - 1 + j1 * recipeWidth];
|
||||
} else {
|
||||
itemstack = recipeItems[i1 + j1 * recipeWidth];
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkMatch(InventoryCrafting crafting, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) {
|
||||
for (int k = 0; k < 3; ++k) {
|
||||
for (int l = 0; l < 3; ++l) {
|
||||
int i1 = k - p_77573_2_;
|
||||
int j1 = l - p_77573_3_;
|
||||
ItemStack itemstack = null;
|
||||
if (i1 >= 0 && j1 >= 0 && i1 < recipeWidth && j1 < recipeHeight) {
|
||||
if (p_77573_4_) {
|
||||
itemstack = recipeItems[recipeWidth - i1 - 1 + j1 * recipeWidth];
|
||||
} else {
|
||||
itemstack = recipeItems[i1 + j1 * recipeWidth];
|
||||
}
|
||||
}
|
||||
ItemStack itemstack2 = crafting.getStackInRowAndColumn(k, l);
|
||||
if (itemstack2 != null || itemstack != null) {
|
||||
if (itemstack2 == null || itemstack == null) {
|
||||
return false;
|
||||
}
|
||||
if (itemstack.getItem() != itemstack2.getItem()) {
|
||||
return false;
|
||||
}
|
||||
if (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack2.getItemDamage()) {
|
||||
return false;
|
||||
}
|
||||
if (itemstack.hasTagCompound()
|
||||
&& itemstack2.hasTagCompound()
|
||||
&& !ItemStack.areItemStackTagsEqual(itemstack, itemstack2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemStack itemstack2 = crafting.getStackInRowAndColumn(k, l);
|
||||
if (itemstack2 != null || itemstack != null) {
|
||||
if (itemstack2 == null || itemstack == null) {
|
||||
return false;
|
||||
}
|
||||
if (itemstack.getItem() != itemstack2.getItem()) {
|
||||
return false;
|
||||
}
|
||||
if (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack2.getItemDamage()) {
|
||||
return false;
|
||||
}
|
||||
if (itemstack.hasTagCompound() && itemstack2.hasTagCompound() && !ItemStack.areItemStackTagsEqual(itemstack, itemstack2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting crafting) {
|
||||
ItemStack itemstack = getRecipeOutput().copy();
|
||||
// todo unused code?
|
||||
if (field_92101_f) {
|
||||
for (int i = 0; i < crafting.getSizeInventory(); ++i) {
|
||||
ItemStack itemstack2 = crafting.getStackInSlot(i);
|
||||
if (itemstack2 != null && itemstack2.hasTagCompound()) {
|
||||
itemstack.setTagCompound((NBTTagCompound) itemstack2.stackTagCompound.copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting crafting) {
|
||||
ItemStack itemstack = getRecipeOutput().copy();
|
||||
// todo unused code?
|
||||
if (field_92101_f) {
|
||||
for (int i = 0; i < crafting.getSizeInventory(); ++i) {
|
||||
ItemStack itemstack2 = crafting.getStackInSlot(i);
|
||||
if (itemstack2 != null && itemstack2.hasTagCompound()) {
|
||||
itemstack.setTagCompound((NBTTagCompound) itemstack2.stackTagCompound.copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return recipeWidth * recipeHeight;
|
||||
}
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return recipeWidth * recipeHeight;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +1,46 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NBTShapedRecipes implements IRecipe {
|
||||
static List<NBTShapedRecipe> recipes = new ArrayList<>();
|
||||
static List<NBTShapedRecipe> recipes = new ArrayList<>();
|
||||
|
||||
public static void addRecipe(NBTShapedRecipe nbtShapedRecipe) {
|
||||
NBTShapedRecipes.recipes.add(nbtShapedRecipe);
|
||||
}
|
||||
public static void addRecipe(NBTShapedRecipe nbtShapedRecipe) {
|
||||
NBTShapedRecipes.recipes.add(nbtShapedRecipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inventory, World world) {
|
||||
for (NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
|
||||
if (recipe.matches(inventory, world)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inventory, World world) {
|
||||
for (NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
|
||||
if (recipe.matches(inventory, world)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inventory) {
|
||||
for (NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
|
||||
if (recipe.matches(inventory, null)) {
|
||||
return recipe.getCraftingResult(inventory);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inventory) {
|
||||
for (NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
|
||||
if (recipe.matches(inventory, null)) {
|
||||
return recipe.getCraftingResult(inventory);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 9;
|
||||
}
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 9;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -9,23 +9,24 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BlockCarpentry extends BlockDesign {
|
||||
public BlockCarpentry() {
|
||||
super(DesignSystem.Wood, Material.wood);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("carpentry");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
public BlockCarpentry() {
|
||||
super(DesignSystem.Wood, Material.wood);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("carpentry");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCreativeStack(IDesign design) {
|
||||
return ModuleCarpentry.getItemStack(this, PlankType.ExtraTreePlanks.Apple, PlankType.VanillaPlanks.BIRCH, design);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return I18N.localise("extratrees.block.woodentile.name", design.getDesign().getName());
|
||||
}
|
||||
@Override
|
||||
public ItemStack getCreativeStack(IDesign design) {
|
||||
return ModuleCarpentry.getItemStack(
|
||||
this, PlankType.ExtraTreePlanks.Apple, PlankType.VanillaPlanks.BIRCH, design);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return I18N.localise(
|
||||
"extratrees.block.woodentile.name", design.getDesign().getName());
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -14,140 +15,141 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
public BlockCarpentryPanel() {
|
||||
useNeighborBrightness = true;
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
|
||||
setLightOpacity(0);
|
||||
}
|
||||
public BlockCarpentryPanel() {
|
||||
useNeighborBrightness = true;
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
|
||||
setLightOpacity(0);
|
||||
}
|
||||
|
||||
public static boolean isValidPanelPlacement(World world, int x, int y, int z, ForgeDirection facing) {
|
||||
if (facing == ForgeDirection.UNKNOWN) {
|
||||
return false;
|
||||
}
|
||||
public static boolean isValidPanelPlacement(World world, int x, int y, int z, ForgeDirection facing) {
|
||||
if (facing == ForgeDirection.UNKNOWN) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int bx = x - facing.offsetX;
|
||||
int by = y - facing.offsetY;
|
||||
int bz = z - facing.offsetZ;
|
||||
Block block = world.getBlock(bx, by, bz);
|
||||
return block != null && block.isSideSolid(world, bx, by, bz, facing);
|
||||
}
|
||||
int bx = x - facing.offsetX;
|
||||
int by = y - facing.offsetY;
|
||||
int bz = z - facing.offsetZ;
|
||||
Block block = world.getBlock(bx, by, bz);
|
||||
return block != null && block.isSideSolid(world, bx, by, bz, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
DesignBlock block = getCarpentryBlock(world, x, y, z);
|
||||
switch (block.getFacing()) {
|
||||
case DOWN:
|
||||
setBlockBounds(0.0f, 0.9375f, 0.0f, 1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
DesignBlock block = getCarpentryBlock(world, x, y, z);
|
||||
switch (block.getFacing()) {
|
||||
case DOWN:
|
||||
setBlockBounds(0.0f, 0.9375f, 0.0f, 1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
|
||||
case EAST:
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 0.0625f, 1.0f, 1.0f);
|
||||
break;
|
||||
case EAST:
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 0.0625f, 1.0f, 1.0f);
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
setBlockBounds(0.0f, 0.0f, 0.9375f, 1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
case NORTH:
|
||||
setBlockBounds(0.0f, 0.0f, 0.9375f, 1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
|
||||
case SOUTH:
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0625f);
|
||||
break;
|
||||
case SOUTH:
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0625f);
|
||||
break;
|
||||
|
||||
case UP:
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
|
||||
break;
|
||||
case UP:
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
setBlockBounds(0.9375f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case WEST:
|
||||
setBlockBounds(0.9375f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender() {
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
|
||||
}
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender() {
|
||||
setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack stack) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
return I18N.localise("extratrees.block.woodenpanel.name", block.getDesign().getName());
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack stack) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
return I18N.localise(
|
||||
"extratrees.block.woodenpanel.name", block.getDesign().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
|
||||
setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
||||
return AxisAlignedBB.getBoundingBox(par2 + minX, par3 + minY, par4 + minZ, par2 + maxX, par3 + maxY, par4 + maxZ);
|
||||
}
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
|
||||
setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
||||
return AxisAlignedBB.getBoundingBox(
|
||||
par2 + minX, par3 + minY, par4 + minZ, par2 + maxX, par3 + maxY, par4 + maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DesignBlock getCarpentryBlock(IBlockAccess world, int x, int y, int z) {
|
||||
return ModuleCarpentry.getCarpentryPanel(getDesignSystem(), TileEntityMetadata.getTileMetadata(world, x, y, z));
|
||||
}
|
||||
@Override
|
||||
public DesignBlock getCarpentryBlock(IBlockAccess world, int x, int y, int z) {
|
||||
return ModuleCarpentry.getCarpentryPanel(getDesignSystem(), TileEntityMetadata.getTileMetadata(world, x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection clickedBlock) {
|
||||
DesignBlock block = ModuleCarpentry.getCarpentryPanel(getDesignSystem(), TileEntityMetadata.getItemDamage(itemStack));
|
||||
ForgeDirection facing = clickedBlock;
|
||||
boolean valid = true;
|
||||
if (!isValidPanelPlacement(world, x, y, z, facing)) {
|
||||
valid = false;
|
||||
for (ForgeDirection direction : ForgeDirection.values()) {
|
||||
if (isValidPanelPlacement(world, x, y, z, direction)) {
|
||||
facing = direction;
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection clickedBlock) {
|
||||
DesignBlock block =
|
||||
ModuleCarpentry.getCarpentryPanel(getDesignSystem(), TileEntityMetadata.getItemDamage(itemStack));
|
||||
ForgeDirection facing = clickedBlock;
|
||||
boolean valid = true;
|
||||
if (!isValidPanelPlacement(world, x, y, z, facing)) {
|
||||
valid = false;
|
||||
for (ForgeDirection direction : ForgeDirection.values()) {
|
||||
if (isValidPanelPlacement(world, x, y, z, direction)) {
|
||||
facing = direction;
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!valid) {
|
||||
return -1;
|
||||
}
|
||||
block.setFacing(facing);
|
||||
return block.getBlockMetadata(getDesignSystem());
|
||||
}
|
||||
if (!valid) {
|
||||
return -1;
|
||||
}
|
||||
block.setFacing(facing);
|
||||
return block.getBlockMetadata(getDesignSystem());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
super.onNeighborBlockChange(world, x, y, z, block);
|
||||
DesignBlock carpentryBlock = getCarpentryBlock(world, x, y, z);
|
||||
if (isValidPanelPlacement(world, x, y, z, carpentryBlock.getFacing())) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
super.onNeighborBlockChange(world, x, y, z, block);
|
||||
DesignBlock carpentryBlock = getCarpentryBlock(world, x, y, z);
|
||||
if (isValidPanelPlacement(world, x, y, z, carpentryBlock.getFacing())) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (ItemStack stack : BlockMetadata.getBlockDropped(this, world, x, y, z, 0)) {
|
||||
dropBlockAsItem(world, x, y, z, stack);
|
||||
}
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
for (ItemStack stack : BlockMetadata.getBlockDropped(this, world, x, y, z, 0)) {
|
||||
dropBlockAsItem(world, x, y, z, stack);
|
||||
}
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import binnie.extratrees.api.IToolHammer;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -25,145 +26,142 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BlockDesign extends BlockMetadata implements IMultipassBlock {
|
||||
public static ForgeDirection[] RENDER_DIRECTIONS = new ForgeDirection[]{
|
||||
ForgeDirection.DOWN,
|
||||
ForgeDirection.UP,
|
||||
ForgeDirection.EAST,
|
||||
ForgeDirection.WEST,
|
||||
ForgeDirection.NORTH,
|
||||
ForgeDirection.SOUTH
|
||||
};
|
||||
public static ForgeDirection[] RENDER_DIRECTIONS = new ForgeDirection[] {
|
||||
ForgeDirection.DOWN,
|
||||
ForgeDirection.UP,
|
||||
ForgeDirection.EAST,
|
||||
ForgeDirection.WEST,
|
||||
ForgeDirection.NORTH,
|
||||
ForgeDirection.SOUTH
|
||||
};
|
||||
|
||||
protected IDesignSystem designSystem;
|
||||
protected IDesignSystem designSystem;
|
||||
|
||||
public BlockDesign(IDesignSystem system, Material material) {
|
||||
super(material);
|
||||
designSystem = system;
|
||||
}
|
||||
public BlockDesign(IDesignSystem system, Material material) {
|
||||
super(material);
|
||||
designSystem = system;
|
||||
}
|
||||
|
||||
public static int getMetadata(int plank1, int plank2, int design) {
|
||||
return plank1 + (plank2 << 9) + (design << 18);
|
||||
}
|
||||
public static int getMetadata(int plank1, int plank2, int design) {
|
||||
return plank1 + (plank2 << 9) + (design << 18);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClick(PlayerInteractEvent event) {
|
||||
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
|
||||
return;
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onClick(PlayerInteractEvent event) {
|
||||
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
|
||||
return;
|
||||
}
|
||||
|
||||
World world = event.entityPlayer.worldObj;
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
int x = event.x;
|
||||
int y = event.y;
|
||||
int z = event.z;
|
||||
if (!(world.getBlock(x, y, z) instanceof BlockDesign)) {
|
||||
return;
|
||||
}
|
||||
World world = event.entityPlayer.worldObj;
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
int x = event.x;
|
||||
int y = event.y;
|
||||
int z = event.z;
|
||||
if (!(world.getBlock(x, y, z) instanceof BlockDesign)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockDesign blockC = (BlockDesign) world.getBlock(x, y, z);
|
||||
ItemStack item = player.getHeldItem();
|
||||
if (item == null
|
||||
|| !(item.getItem() instanceof IToolHammer)
|
||||
|| !((IToolHammer) item.getItem()).isActive(item)) {
|
||||
return;
|
||||
}
|
||||
BlockDesign blockC = (BlockDesign) world.getBlock(x, y, z);
|
||||
ItemStack item = player.getHeldItem();
|
||||
if (item == null
|
||||
|| !(item.getItem() instanceof IToolHammer)
|
||||
|| !((IToolHammer) item.getItem()).isActive(item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
DesignBlock block = blockC.getCarpentryBlock(world, x, y, z);
|
||||
TileEntityMetadata tile = (TileEntityMetadata) world.getTileEntity(x, y, z);
|
||||
block.rotate(event.face, item, player, world, x, y, z);
|
||||
int meta = block.getBlockMetadata(blockC.getDesignSystem());
|
||||
tile.setTileMetadata(meta, true);
|
||||
}
|
||||
DesignBlock block = blockC.getCarpentryBlock(world, x, y, z);
|
||||
TileEntityMetadata tile = (TileEntityMetadata) world.getTileEntity(x, y, z);
|
||||
block.rotate(event.face, item, player, world, x, y, z);
|
||||
int meta = block.getBlockMetadata(blockC.getDesignSystem());
|
||||
tile.setTileMetadata(meta, true);
|
||||
}
|
||||
|
||||
public abstract ItemStack getCreativeStack(IDesign design);
|
||||
public abstract ItemStack getCreativeStack(IDesign design);
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (IDesign design : CarpentryManager.carpentryInterface.getSortedDesigns()) {
|
||||
list.add(getCreativeStack(design));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (IDesign design : CarpentryManager.carpentryInterface.getSortedDesigns()) {
|
||||
list.add(getCreativeStack(design));
|
||||
}
|
||||
}
|
||||
|
||||
public IDesignSystem getDesignSystem() {
|
||||
return designSystem;
|
||||
}
|
||||
public IDesignSystem getDesignSystem() {
|
||||
return designSystem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return BinnieCore.multipassRenderID;
|
||||
}
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return BinnieCore.multipassRenderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack stack) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
return getBlockName(block);
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(ItemStack stack) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
return getBlockName(block);
|
||||
}
|
||||
|
||||
public abstract String getBlockName(DesignBlock design);
|
||||
|
||||
public DesignBlock getCarpentryBlock(IBlockAccess world, int x, int y, int z) {
|
||||
return ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getTileMetadata(world, x, y, z));
|
||||
}
|
||||
public abstract String getBlockName(DesignBlock design);
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
DesignBlock block = getCarpentryBlock(world, x, y, z);
|
||||
return (MultipassBlockRenderer.getLayer() > 0) ? block.getSecondaryColour() : block.getPrimaryColour();
|
||||
}
|
||||
public DesignBlock getCarpentryBlock(IBlockAccess world, int x, int y, int z) {
|
||||
return ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getTileMetadata(world, x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(int meta) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), meta);
|
||||
return (MultipassBlockRenderer.getLayer() > 0) ? block.getSecondaryColour() : block.getPrimaryColour();
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
DesignBlock block = getCarpentryBlock(world, x, y, z);
|
||||
return (MultipassBlockRenderer.getLayer() > 0) ? block.getSecondaryColour() : block.getPrimaryColour();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int damage) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), damage);
|
||||
if (MultipassBlockRenderer.getLayer() > 0) {
|
||||
return block.getSecondaryIcon(getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[side]);
|
||||
}
|
||||
return block.getPrimaryIcon(getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[side]);
|
||||
}
|
||||
@Override
|
||||
public int colorMultiplier(int meta) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), meta);
|
||||
return (MultipassBlockRenderer.getLayer() > 0) ? block.getSecondaryColour() : block.getPrimaryColour();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(I18N.localise(
|
||||
"extratrees.block.tooltip.twoMaterials",
|
||||
block.getPrimaryMaterial().getName(),
|
||||
block.getSecondaryMaterial().getName()
|
||||
));
|
||||
} else {
|
||||
tooltip.add(block.getPrimaryMaterial().getName());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int damage) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), damage);
|
||||
if (MultipassBlockRenderer.getLayer() > 0) {
|
||||
return block.getSecondaryIcon(getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[side]);
|
||||
}
|
||||
return block.getPrimaryIcon(getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[side]);
|
||||
}
|
||||
|
||||
public ItemStack getItemStack(int plank1, int plank2, int design) {
|
||||
return TileEntityMetadata.getItemStack(this, getMetadata(plank1, plank2, design));
|
||||
}
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(I18N.localise(
|
||||
"extratrees.block.tooltip.twoMaterials",
|
||||
block.getPrimaryMaterial().getName(),
|
||||
block.getSecondaryMaterial().getName()));
|
||||
} else {
|
||||
tooltip.add(block.getPrimaryMaterial().getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (IDesignSystem system : DesignerManager.instance.getDesignSystems()) {
|
||||
system.registerIcons(register);
|
||||
}
|
||||
}
|
||||
public ItemStack getItemStack(int plank1, int plank2, int design) {
|
||||
return TileEntityMetadata.getItemStack(this, getMetadata(plank1, plank2, design));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), tileMeta);
|
||||
return block.getItemMetadata(getDesignSystem());
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (IDesignSystem system : DesignerManager.instance.getDesignSystems()) {
|
||||
system.registerIcons(register);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfPasses() {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), tileMeta);
|
||||
return block.getItemMetadata(getDesignSystem());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfPasses() {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
@@ -7,73 +7,71 @@ import binnie.extratrees.api.IDesign;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockStainedDesign extends BlockDesign {
|
||||
public BlockStainedDesign() {
|
||||
super(DesignSystem.Glass, Material.glass);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("stainedGlass");
|
||||
}
|
||||
public BlockStainedDesign() {
|
||||
super(DesignSystem.Glass, Material.glass);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("stainedGlass");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random p_149745_1_) {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public int quantityDropped(Random p_149745_1_) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
// Block block2 = world.getBlock(x - Facing.offsetsXForSide[side], y - Facing.offsetsYForSide[side], z - Facing.offsetsZForSide[side]);
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block != this
|
||||
&& block != Botany.stained
|
||||
&& super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
// Block block2 = world.getBlock(x - Facing.offsetsXForSide[side], y - Facing.offsetsYForSide[side], z -
|
||||
// Facing.offsetsZForSide[side]);
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block != this && block != Botany.stained && super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCreativeStack(IDesign design) {
|
||||
return ModuleCarpentry.getItemStack(this, GlassType.get(0), GlassType.get(1), design);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getCreativeStack(IDesign design) {
|
||||
return ModuleCarpentry.getItemStack(this, GlassType.get(0), GlassType.get(1), design);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return I18N.localise("extratrees.block.stainedglass.name", design.getDesign().getName());
|
||||
}
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return I18N.localise(
|
||||
"extratrees.block.stainedglass.name", design.getDesign().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(I18N.localise(
|
||||
"extratrees.block.tooltip.twoColors",
|
||||
block.getPrimaryMaterial().getName(),
|
||||
block.getSecondaryMaterial().getName()
|
||||
));
|
||||
} else {
|
||||
tooltip.add(block.getPrimaryMaterial().getName());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(I18N.localise(
|
||||
"extratrees.block.tooltip.twoColors",
|
||||
block.getPrimaryMaterial().getName(),
|
||||
block.getSecondaryMaterial().getName()));
|
||||
} else {
|
||||
tooltip.add(block.getPrimaryMaterial().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,114 +6,111 @@ import binnie.extratrees.api.IDesignCategory;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import binnie.extratrees.api.ILayout;
|
||||
import binnie.extratrees.api.IPattern;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CarpentryInterface implements ICarpentryInterface {
|
||||
protected static Map<Integer, IDesignMaterial> woodMap = new LinkedHashMap<>();
|
||||
protected static Map<Integer, IDesign> designMap = new LinkedHashMap<>();
|
||||
protected static Map<String, IDesignCategory> designCategories = new HashMap<>();
|
||||
protected static Map<Integer, IDesignMaterial> woodMap = new LinkedHashMap<>();
|
||||
protected static Map<Integer, IDesign> designMap = new LinkedHashMap<>();
|
||||
protected static Map<String, IDesignCategory> designCategories = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public boolean registerCarpentryWood(int index, IDesignMaterial wood) {
|
||||
return wood != null
|
||||
&& CarpentryInterface.woodMap.put(index, wood) == null;
|
||||
}
|
||||
@Override
|
||||
public boolean registerCarpentryWood(int index, IDesignMaterial wood) {
|
||||
return wood != null && CarpentryInterface.woodMap.put(index, wood) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCarpentryWoodIndex(IDesignMaterial wood) {
|
||||
for (Integer integer : CarpentryInterface.woodMap.keySet()) {
|
||||
if (CarpentryInterface.woodMap.get(integer).equals(wood)) {
|
||||
return integer;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@Override
|
||||
public int getCarpentryWoodIndex(IDesignMaterial wood) {
|
||||
for (Integer integer : CarpentryInterface.woodMap.keySet()) {
|
||||
if (CarpentryInterface.woodMap.get(integer).equals(wood)) {
|
||||
return integer;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesignMaterial getWoodMaterial(int index) {
|
||||
return CarpentryInterface.woodMap.get(index);
|
||||
}
|
||||
@Override
|
||||
public IDesignMaterial getWoodMaterial(int index) {
|
||||
return CarpentryInterface.woodMap.get(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean registerDesign(int index, IDesign wood) {
|
||||
return wood != null
|
||||
&& CarpentryInterface.designMap.put(index, wood) == null;
|
||||
}
|
||||
@Override
|
||||
public boolean registerDesign(int index, IDesign wood) {
|
||||
return wood != null && CarpentryInterface.designMap.put(index, wood) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDesignIndex(IDesign wood) {
|
||||
for (Integer integer : CarpentryInterface.designMap.keySet()) {
|
||||
if (CarpentryInterface.designMap.get(integer).equals(wood)) {
|
||||
return integer;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@Override
|
||||
public int getDesignIndex(IDesign wood) {
|
||||
for (Integer integer : CarpentryInterface.designMap.keySet()) {
|
||||
if (CarpentryInterface.designMap.get(integer).equals(wood)) {
|
||||
return integer;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesign getDesign(int index) {
|
||||
return CarpentryInterface.designMap.get(index);
|
||||
}
|
||||
@Override
|
||||
public IDesign getDesign(int index) {
|
||||
return CarpentryInterface.designMap.get(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout getLayout(IPattern pattern, boolean inverted) {
|
||||
return Layout.get(pattern, inverted);
|
||||
}
|
||||
@Override
|
||||
public ILayout getLayout(IPattern pattern, boolean inverted) {
|
||||
return Layout.get(pattern, inverted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean registerDesignCategory(IDesignCategory category) {
|
||||
return category != null
|
||||
&& category.getId() != null
|
||||
&& CarpentryInterface.designCategories.put(category.getId(), category) == null;
|
||||
}
|
||||
@Override
|
||||
public boolean registerDesignCategory(IDesignCategory category) {
|
||||
return category != null
|
||||
&& category.getId() != null
|
||||
&& CarpentryInterface.designCategories.put(category.getId(), category) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesignCategory getDesignCategory(String id) {
|
||||
return CarpentryInterface.designCategories.get(id);
|
||||
}
|
||||
@Override
|
||||
public IDesignCategory getDesignCategory(String id) {
|
||||
return CarpentryInterface.designCategories.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<IDesignCategory> getAllDesignCategories() {
|
||||
List<IDesignCategory> categories = new ArrayList<>();
|
||||
for (IDesignCategory category : CarpentryInterface.designCategories.values()) {
|
||||
if (category.getDesigns().size() > 0) {
|
||||
categories.add(category);
|
||||
}
|
||||
}
|
||||
return categories;
|
||||
}
|
||||
@Override
|
||||
public Collection<IDesignCategory> getAllDesignCategories() {
|
||||
List<IDesignCategory> categories = new ArrayList<>();
|
||||
for (IDesignCategory category : CarpentryInterface.designCategories.values()) {
|
||||
if (category.getDesigns().size() > 0) {
|
||||
categories.add(category);
|
||||
}
|
||||
}
|
||||
return categories;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IDesign> getSortedDesigns() {
|
||||
List<IDesign> designs = new ArrayList<>();
|
||||
for (IDesignCategory category : getAllDesignCategories()) {
|
||||
designs.addAll(category.getDesigns());
|
||||
}
|
||||
return designs;
|
||||
}
|
||||
@Override
|
||||
public List<IDesign> getSortedDesigns() {
|
||||
List<IDesign> designs = new ArrayList<>();
|
||||
for (IDesignCategory category : getAllDesignCategories()) {
|
||||
designs.addAll(category.getDesigns());
|
||||
}
|
||||
return designs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesignMaterial getWoodMaterial(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public IDesignMaterial getWoodMaterial(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (Map.Entry<Integer, IDesignMaterial> entry : CarpentryInterface.woodMap.entrySet()) {
|
||||
ItemStack key = entry.getValue().getStack();
|
||||
if (key == null) {
|
||||
continue;
|
||||
}
|
||||
if (key.isItemEqual(stack)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
for (Map.Entry<Integer, IDesignMaterial> entry : CarpentryInterface.woodMap.entrySet()) {
|
||||
ItemStack key = entry.getValue().getStack();
|
||||
if (key == null) {
|
||||
continue;
|
||||
}
|
||||
if (key.isItemEqual(stack)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -13,376 +13,386 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class DesignBlock {
|
||||
protected IDesign design;
|
||||
protected IDesignMaterial primaryMaterial;
|
||||
protected IDesignMaterial secondaryMaterial;
|
||||
protected int rotation;
|
||||
protected ForgeDirection facing;
|
||||
protected boolean panel;
|
||||
protected IDesign design;
|
||||
protected IDesignMaterial primaryMaterial;
|
||||
protected IDesignMaterial secondaryMaterial;
|
||||
protected int rotation;
|
||||
protected ForgeDirection facing;
|
||||
protected boolean panel;
|
||||
|
||||
DesignBlock(IDesignSystem system, IDesignMaterial primaryWood, IDesignMaterial secondaryWood, IDesign design, int rotation, ForgeDirection dir) {
|
||||
this.rotation = 0;
|
||||
this.design = design;
|
||||
this.rotation = rotation;
|
||||
facing = ForgeDirection.UP;
|
||||
panel = false;
|
||||
primaryMaterial = primaryWood;
|
||||
secondaryMaterial = secondaryWood;
|
||||
facing = dir;
|
||||
DesignBlock(
|
||||
IDesignSystem system,
|
||||
IDesignMaterial primaryWood,
|
||||
IDesignMaterial secondaryWood,
|
||||
IDesign design,
|
||||
int rotation,
|
||||
ForgeDirection dir) {
|
||||
this.rotation = 0;
|
||||
this.design = design;
|
||||
this.rotation = rotation;
|
||||
facing = ForgeDirection.UP;
|
||||
panel = false;
|
||||
primaryMaterial = primaryWood;
|
||||
secondaryMaterial = secondaryWood;
|
||||
facing = dir;
|
||||
|
||||
if (design == null) {
|
||||
this.design = EnumDesign.Blank;
|
||||
}
|
||||
if (primaryWood == null) {
|
||||
primaryMaterial = system.getDefaultMaterial();
|
||||
}
|
||||
if (secondaryWood == null) {
|
||||
secondaryMaterial = system.getDefaultMaterial();
|
||||
}
|
||||
if (rotation > 3 || rotation < 0) {
|
||||
this.rotation = 0;
|
||||
}
|
||||
if (facing == null || facing == ForgeDirection.UNKNOWN) {
|
||||
facing = ForgeDirection.UP;
|
||||
}
|
||||
}
|
||||
if (design == null) {
|
||||
this.design = EnumDesign.Blank;
|
||||
}
|
||||
if (primaryWood == null) {
|
||||
primaryMaterial = system.getDefaultMaterial();
|
||||
}
|
||||
if (secondaryWood == null) {
|
||||
secondaryMaterial = system.getDefaultMaterial();
|
||||
}
|
||||
if (rotation > 3 || rotation < 0) {
|
||||
this.rotation = 0;
|
||||
}
|
||||
if (facing == null || facing == ForgeDirection.UNKNOWN) {
|
||||
facing = ForgeDirection.UP;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + " { design:" + design + " }, { primary:" + primaryMaterial + " }, { secondary:" + secondaryMaterial + " }, { rotation:" + rotation + " }, { facing:" + facing + " }";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + " { design:" + design + " }, { primary:" + primaryMaterial + " }, { secondary:"
|
||||
+ secondaryMaterial + " }, { rotation:" + rotation + " }, { facing:" + facing + " }";
|
||||
}
|
||||
|
||||
public IDesign getDesign() {
|
||||
return design;
|
||||
}
|
||||
public IDesign getDesign() {
|
||||
return design;
|
||||
}
|
||||
|
||||
public IDesignMaterial getPrimaryMaterial() {
|
||||
return primaryMaterial;
|
||||
}
|
||||
public IDesignMaterial getPrimaryMaterial() {
|
||||
return primaryMaterial;
|
||||
}
|
||||
|
||||
public IDesignMaterial getSecondaryMaterial() {
|
||||
return secondaryMaterial;
|
||||
}
|
||||
public IDesignMaterial getSecondaryMaterial() {
|
||||
return secondaryMaterial;
|
||||
}
|
||||
|
||||
public int getPrimaryColour() {
|
||||
return getPrimaryMaterial().getColor();
|
||||
}
|
||||
public int getPrimaryColour() {
|
||||
return getPrimaryMaterial().getColor();
|
||||
}
|
||||
|
||||
public int getSecondaryColour() {
|
||||
return getSecondaryMaterial().getColor();
|
||||
}
|
||||
public int getSecondaryColour() {
|
||||
return getSecondaryMaterial().getColor();
|
||||
}
|
||||
|
||||
public ILayout getLayout(ForgeDirection dir) {
|
||||
ForgeDirection adjustedDir;
|
||||
dir = (adjustedDir = dir.getRotation(ForgeDirection.DOWN));
|
||||
switch (getFacing()) {
|
||||
case DOWN:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
break;
|
||||
public ILayout getLayout(ForgeDirection dir) {
|
||||
ForgeDirection adjustedDir;
|
||||
dir = (adjustedDir = dir.getRotation(ForgeDirection.DOWN));
|
||||
switch (getFacing()) {
|
||||
case DOWN:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
break;
|
||||
|
||||
case EAST:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.NORTH);
|
||||
break;
|
||||
case EAST:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.NORTH);
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.SOUTH);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.SOUTH);
|
||||
break;
|
||||
case NORTH:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.SOUTH);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.SOUTH);
|
||||
break;
|
||||
|
||||
case SOUTH:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
break;
|
||||
case SOUTH:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.SOUTH);
|
||||
break;
|
||||
}
|
||||
case WEST:
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.SOUTH);
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < rotation; ++i) {
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.DOWN);
|
||||
}
|
||||
for (int i = 0; i < rotation; ++i) {
|
||||
adjustedDir = adjustedDir.getRotation(ForgeDirection.DOWN);
|
||||
}
|
||||
|
||||
ILayout layout;
|
||||
switch (adjustedDir) {
|
||||
case EAST:
|
||||
layout = getDesign().getEastPattern();
|
||||
break;
|
||||
ILayout layout;
|
||||
switch (adjustedDir) {
|
||||
case EAST:
|
||||
layout = getDesign().getEastPattern();
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
layout = getDesign().getNorthPattern();
|
||||
break;
|
||||
case NORTH:
|
||||
layout = getDesign().getNorthPattern();
|
||||
break;
|
||||
|
||||
case SOUTH:
|
||||
layout = getDesign().getSouthPattern();
|
||||
break;
|
||||
case SOUTH:
|
||||
layout = getDesign().getSouthPattern();
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
layout = getDesign().getWestPattern();
|
||||
break;
|
||||
case WEST:
|
||||
layout = getDesign().getWestPattern();
|
||||
break;
|
||||
|
||||
case DOWN:
|
||||
layout = getDesign().getBottomPattern();
|
||||
break;
|
||||
case DOWN:
|
||||
layout = getDesign().getBottomPattern();
|
||||
break;
|
||||
|
||||
default:
|
||||
layout = getDesign().getTopPattern();
|
||||
}
|
||||
default:
|
||||
layout = getDesign().getTopPattern();
|
||||
}
|
||||
|
||||
// TODO remove label
|
||||
Label_1107:
|
||||
{
|
||||
switch (getFacing()) {
|
||||
case UP:
|
||||
if (dir == ForgeDirection.DOWN || dir == ForgeDirection.UP) {
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
// TODO remove label
|
||||
Label_1107:
|
||||
{
|
||||
switch (getFacing()) {
|
||||
case UP:
|
||||
if (dir == ForgeDirection.DOWN || dir == ForgeDirection.UP) {
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DOWN:
|
||||
switch (dir) {
|
||||
case UP:
|
||||
case DOWN: {
|
||||
layout = layout.flipVertical();
|
||||
break;
|
||||
}
|
||||
case EAST:
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
case WEST: {
|
||||
layout = layout.rotateRight().rotateRight();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dir == ForgeDirection.DOWN || dir == ForgeDirection.UP) {
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DOWN:
|
||||
switch (dir) {
|
||||
case UP:
|
||||
case DOWN: {
|
||||
layout = layout.flipVertical();
|
||||
break;
|
||||
}
|
||||
case EAST:
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
case WEST: {
|
||||
layout = layout.rotateRight().rotateRight();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dir == ForgeDirection.DOWN || dir == ForgeDirection.UP) {
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case EAST:
|
||||
switch (dir) {
|
||||
case SOUTH:
|
||||
case UP: {
|
||||
layout = layout.rotateRight();
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
layout = layout.rotateLeft();
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.rotateLeft().flipHorizontal();
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
layout = layout.flipHorizontal();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dir == ForgeDirection.EAST) {
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
}
|
||||
if (dir == ForgeDirection.WEST) {
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EAST:
|
||||
switch (dir) {
|
||||
case SOUTH:
|
||||
case UP: {
|
||||
layout = layout.rotateRight();
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
layout = layout.rotateLeft();
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.rotateLeft().flipHorizontal();
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
layout = layout.flipHorizontal();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dir == ForgeDirection.EAST) {
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
}
|
||||
if (dir == ForgeDirection.WEST) {
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
switch (dir) {
|
||||
case NORTH:
|
||||
layout = layout.rotateRight();
|
||||
break;
|
||||
case WEST:
|
||||
switch (dir) {
|
||||
case NORTH:
|
||||
layout = layout.rotateRight();
|
||||
break;
|
||||
|
||||
case SOUTH:
|
||||
case UP:
|
||||
layout = layout.rotateLeft();
|
||||
break;
|
||||
case SOUTH:
|
||||
case UP:
|
||||
layout = layout.rotateLeft();
|
||||
break;
|
||||
|
||||
case DOWN:
|
||||
layout = layout.rotateLeft().flipVertical();
|
||||
break;
|
||||
case DOWN:
|
||||
layout = layout.rotateLeft().flipVertical();
|
||||
break;
|
||||
|
||||
case EAST:
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
case EAST:
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case WEST:
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
switch (dir) {
|
||||
case WEST:
|
||||
layout = layout.rotateLeft();
|
||||
break Label_1107;
|
||||
case NORTH:
|
||||
switch (dir) {
|
||||
case WEST:
|
||||
layout = layout.rotateLeft();
|
||||
break Label_1107;
|
||||
|
||||
case EAST:
|
||||
layout = layout.rotateRight();
|
||||
break Label_1107;
|
||||
case EAST:
|
||||
layout = layout.rotateRight();
|
||||
break Label_1107;
|
||||
|
||||
case DOWN:
|
||||
layout = layout.flipHorizontal();
|
||||
break Label_1107;
|
||||
case DOWN:
|
||||
layout = layout.flipHorizontal();
|
||||
break Label_1107;
|
||||
|
||||
case SOUTH:
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break Label_1107;
|
||||
case SOUTH:
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break Label_1107;
|
||||
|
||||
case NORTH:
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break Label_1107;
|
||||
case NORTH:
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break Label_1107;
|
||||
|
||||
default:
|
||||
break Label_1107;
|
||||
}
|
||||
default:
|
||||
break Label_1107;
|
||||
}
|
||||
|
||||
case SOUTH:
|
||||
switch (dir) {
|
||||
case EAST:
|
||||
layout = layout.rotateLeft();
|
||||
break Label_1107;
|
||||
case SOUTH:
|
||||
switch (dir) {
|
||||
case EAST:
|
||||
layout = layout.rotateLeft();
|
||||
break Label_1107;
|
||||
|
||||
case WEST:
|
||||
layout = layout.rotateRight();
|
||||
break Label_1107;
|
||||
case WEST:
|
||||
layout = layout.rotateRight();
|
||||
break Label_1107;
|
||||
|
||||
case UP:
|
||||
layout = layout.rotateRight().rotateRight();
|
||||
break Label_1107;
|
||||
case UP:
|
||||
layout = layout.rotateRight().rotateRight();
|
||||
break Label_1107;
|
||||
|
||||
case DOWN:
|
||||
layout = layout.flipVertical();
|
||||
break Label_1107;
|
||||
case DOWN:
|
||||
layout = layout.flipVertical();
|
||||
break Label_1107;
|
||||
|
||||
case NORTH:
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break Label_1107;
|
||||
case NORTH:
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break Label_1107;
|
||||
|
||||
case SOUTH:
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break Label_1107;
|
||||
case SOUTH:
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break Label_1107;
|
||||
|
||||
default:
|
||||
break Label_1107;
|
||||
}
|
||||
}
|
||||
}
|
||||
return layout;
|
||||
}
|
||||
default:
|
||||
break Label_1107;
|
||||
}
|
||||
}
|
||||
}
|
||||
return layout;
|
||||
}
|
||||
|
||||
public IIcon getPrimaryIcon(IDesignSystem system, ForgeDirection dir) {
|
||||
ILayout layout = getLayout(dir);
|
||||
return (layout == null) ? null : layout.getPrimaryIcon(system);
|
||||
}
|
||||
public IIcon getPrimaryIcon(IDesignSystem system, ForgeDirection dir) {
|
||||
ILayout layout = getLayout(dir);
|
||||
return (layout == null) ? null : layout.getPrimaryIcon(system);
|
||||
}
|
||||
|
||||
public IIcon getSecondaryIcon(IDesignSystem system, ForgeDirection dir) {
|
||||
ILayout layout = getLayout(dir);
|
||||
return (layout == null) ? null : layout.getSecondaryIcon(system);
|
||||
}
|
||||
public IIcon getSecondaryIcon(IDesignSystem system, ForgeDirection dir) {
|
||||
ILayout layout = getLayout(dir);
|
||||
return (layout == null) ? null : layout.getSecondaryIcon(system);
|
||||
}
|
||||
|
||||
public IIcon getIcon(IDesignSystem system, boolean secondary, ForgeDirection dir) {
|
||||
return secondary
|
||||
? getSecondaryIcon(system, dir)
|
||||
: getPrimaryIcon(system, dir);
|
||||
}
|
||||
public IIcon getIcon(IDesignSystem system, boolean secondary, ForgeDirection dir) {
|
||||
return secondary ? getSecondaryIcon(system, dir) : getPrimaryIcon(system, dir);
|
||||
}
|
||||
|
||||
public ForgeDirection getFacing() {
|
||||
return facing;
|
||||
}
|
||||
public ForgeDirection getFacing() {
|
||||
return facing;
|
||||
}
|
||||
|
||||
public void setFacing(ForgeDirection facing) {
|
||||
this.facing = facing;
|
||||
}
|
||||
public void setFacing(ForgeDirection facing) {
|
||||
this.facing = facing;
|
||||
}
|
||||
|
||||
public int getRotation() {
|
||||
return rotation;
|
||||
}
|
||||
public int getRotation() {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
public void rotate(int face, ItemStack hammer, EntityPlayer player, World world, int x, int y, int z) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(face);
|
||||
IToolHammer hammerI = (IToolHammer) hammer.getItem();
|
||||
if (player.isSneaking()) {
|
||||
if (panel) {
|
||||
ForgeDirection newFacing = getFacing();
|
||||
do {
|
||||
newFacing = ForgeDirection.getOrientation(newFacing.ordinal() + 1);
|
||||
if (newFacing == ForgeDirection.UNKNOWN) {
|
||||
newFacing = ForgeDirection.DOWN;
|
||||
}
|
||||
} while (newFacing != getFacing() && !BlockCarpentryPanel.isValidPanelPlacement(world, x, y, z, newFacing));
|
||||
public void rotate(int face, ItemStack hammer, EntityPlayer player, World world, int x, int y, int z) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(face);
|
||||
IToolHammer hammerI = (IToolHammer) hammer.getItem();
|
||||
if (player.isSneaking()) {
|
||||
if (panel) {
|
||||
ForgeDirection newFacing = getFacing();
|
||||
do {
|
||||
newFacing = ForgeDirection.getOrientation(newFacing.ordinal() + 1);
|
||||
if (newFacing == ForgeDirection.UNKNOWN) {
|
||||
newFacing = ForgeDirection.DOWN;
|
||||
}
|
||||
} while (newFacing != getFacing()
|
||||
&& !BlockCarpentryPanel.isValidPanelPlacement(world, x, y, z, newFacing));
|
||||
|
||||
if (newFacing != getFacing()) {
|
||||
hammerI.onHammerUsed(hammer, player);
|
||||
}
|
||||
setFacing(newFacing);
|
||||
} else {
|
||||
if (dir != getFacing()) {
|
||||
hammerI.onHammerUsed(hammer, player);
|
||||
}
|
||||
setFacing(dir);
|
||||
}
|
||||
} else {
|
||||
rotation++;
|
||||
hammerI.onHammerUsed(hammer, player);
|
||||
}
|
||||
if (newFacing != getFacing()) {
|
||||
hammerI.onHammerUsed(hammer, player);
|
||||
}
|
||||
setFacing(newFacing);
|
||||
} else {
|
||||
if (dir != getFacing()) {
|
||||
hammerI.onHammerUsed(hammer, player);
|
||||
}
|
||||
setFacing(dir);
|
||||
}
|
||||
} else {
|
||||
rotation++;
|
||||
hammerI.onHammerUsed(hammer, player);
|
||||
}
|
||||
|
||||
if (rotation > 3) {
|
||||
rotation = 0;
|
||||
} else if (rotation < 0) {
|
||||
rotation = 3;
|
||||
}
|
||||
}
|
||||
if (rotation > 3) {
|
||||
rotation = 0;
|
||||
} else if (rotation < 0) {
|
||||
rotation = 3;
|
||||
}
|
||||
}
|
||||
|
||||
public int getBlockMetadata(IDesignSystem system) {
|
||||
return ModuleCarpentry.getBlockMetadata(system, this);
|
||||
}
|
||||
public int getBlockMetadata(IDesignSystem system) {
|
||||
return ModuleCarpentry.getBlockMetadata(system, this);
|
||||
}
|
||||
|
||||
public int getItemMetadata(IDesignSystem system) {
|
||||
return ModuleCarpentry.getItemMetadata(system, this);
|
||||
}
|
||||
public int getItemMetadata(IDesignSystem system) {
|
||||
return ModuleCarpentry.getItemMetadata(system, this);
|
||||
}
|
||||
|
||||
public void setPanel() {
|
||||
panel = true;
|
||||
}
|
||||
public void setPanel() {
|
||||
panel = true;
|
||||
}
|
||||
|
||||
public String getString() {
|
||||
String type;
|
||||
if (getPrimaryMaterial() != getSecondaryMaterial()) {
|
||||
type = I18N.localise("extratrees.block.tooltip.twoMaterials", getPrimaryMaterial().getName(), getSecondaryMaterial().getName());
|
||||
} else {
|
||||
type = getPrimaryMaterial().getName();
|
||||
}
|
||||
return super.toString() + " " + "{" + type + " " + getDesign().getName() + " " + (panel ? "Panel" : "Tile") + ", Facing:" + getFacing().toString() + ", Rotation:" + getRotation() + "}";
|
||||
}
|
||||
public String getString() {
|
||||
String type;
|
||||
if (getPrimaryMaterial() != getSecondaryMaterial()) {
|
||||
type = I18N.localise(
|
||||
"extratrees.block.tooltip.twoMaterials",
|
||||
getPrimaryMaterial().getName(),
|
||||
getSecondaryMaterial().getName());
|
||||
} else {
|
||||
type = getPrimaryMaterial().getName();
|
||||
}
|
||||
return super.toString() + " " + "{" + type + " " + getDesign().getName() + " " + (panel ? "Panel" : "Tile")
|
||||
+ ", Facing:" + getFacing().toString() + ", Rotation:" + getRotation() + "}";
|
||||
}
|
||||
}
|
||||
@@ -9,134 +9,143 @@ import binnie.extratrees.api.IDesignSystem;
|
||||
import binnie.extratrees.api.IPattern;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import binnie.extratrees.item.ExtraTreeItems;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum DesignSystem implements IDesignSystem {
|
||||
Wood,
|
||||
Glass;
|
||||
Wood,
|
||||
Glass;
|
||||
|
||||
protected Map<Integer, IIcon> primary;
|
||||
protected Map<Integer, IIcon> secondary;
|
||||
protected Map<Integer, IIcon> primary;
|
||||
protected Map<Integer, IIcon> secondary;
|
||||
|
||||
DesignSystem() {
|
||||
primary = new HashMap<>();
|
||||
secondary = new HashMap<>();
|
||||
DesignerManager.instance.registerDesignSystem(this);
|
||||
}
|
||||
DesignSystem() {
|
||||
primary = new HashMap<>();
|
||||
secondary = new HashMap<>();
|
||||
DesignerManager.instance.registerDesignSystem(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesignMaterial getDefaultMaterial() {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.get(0);
|
||||
@Override
|
||||
public IDesignMaterial getDefaultMaterial() {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.get(0);
|
||||
|
||||
case Wood:
|
||||
return PlankType.ExtraTreePlanks.Fir;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
case Wood:
|
||||
return PlankType.ExtraTreePlanks.Fir;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesignMaterial getDefaultMaterial2() {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.get(1);
|
||||
@Override
|
||||
public IDesignMaterial getDefaultMaterial2() {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.get(1);
|
||||
|
||||
case Wood:
|
||||
return PlankType.ExtraTreePlanks.Whitebeam;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
case Wood:
|
||||
return PlankType.ExtraTreePlanks.Whitebeam;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesignMaterial getMaterial(int id) {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.get(id);
|
||||
@Override
|
||||
public IDesignMaterial getMaterial(int id) {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.get(id);
|
||||
|
||||
case Wood:
|
||||
return CarpentryManager.carpentryInterface.getWoodMaterial(id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
case Wood:
|
||||
return CarpentryManager.carpentryInterface.getWoodMaterial(id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaterialIndex(IDesignMaterial id) {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.getIndex(id);
|
||||
@Override
|
||||
public int getMaterialIndex(IDesignMaterial id) {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.getIndex(id);
|
||||
|
||||
case Wood:
|
||||
return CarpentryManager.carpentryInterface.getCarpentryWoodIndex(id);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case Wood:
|
||||
return CarpentryManager.carpentryInterface.getCarpentryWoodIndex(id);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getTexturePath() {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return "glass";
|
||||
public String getTexturePath() {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return "glass";
|
||||
|
||||
case Wood:
|
||||
return "patterns";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
case Wood:
|
||||
return "patterns";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesignMaterial getMaterial(ItemStack stack) {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.get(stack);
|
||||
@Override
|
||||
public IDesignMaterial getMaterial(ItemStack stack) {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return GlassType.get(stack);
|
||||
|
||||
case Wood:
|
||||
return CarpentryManager.carpentryInterface.getWoodMaterial(stack);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
case Wood:
|
||||
return CarpentryManager.carpentryInterface.getWoodMaterial(stack);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getAdhesive() {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return ExtraTreeItems.GlassFitting.get(1);
|
||||
@Override
|
||||
public ItemStack getAdhesive() {
|
||||
switch (this) {
|
||||
case Glass:
|
||||
return ExtraTreeItems.GlassFitting.get(1);
|
||||
|
||||
case Wood:
|
||||
return ExtraTreeItems.WoodWax.get(1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
case Wood:
|
||||
return ExtraTreeItems.WoodWax.get(1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getPrimaryIcon(IPattern pattern) {
|
||||
if (pattern instanceof EnumPattern) {
|
||||
return primary.get(((EnumPattern) pattern).ordinal());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public IIcon getPrimaryIcon(IPattern pattern) {
|
||||
if (pattern instanceof EnumPattern) {
|
||||
return primary.get(((EnumPattern) pattern).ordinal());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getSecondaryIcon(IPattern pattern) {
|
||||
if (pattern instanceof EnumPattern) {
|
||||
return secondary.get(((EnumPattern) pattern).ordinal());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public IIcon getSecondaryIcon(IPattern pattern) {
|
||||
if (pattern instanceof EnumPattern) {
|
||||
return secondary.get(((EnumPattern) pattern).ordinal());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (EnumPattern pattern : EnumPattern.values()) {
|
||||
primary.put(pattern.ordinal(), BinnieCore.proxy.getIcon(register, getMod().getModID(), getTexturePath() + "/" + pattern.toString().toLowerCase() + ".0"));
|
||||
secondary.put(pattern.ordinal(), BinnieCore.proxy.getIcon(register, getMod().getModID(), getTexturePath() + "/" + pattern.toString().toLowerCase() + ".1"));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (EnumPattern pattern : EnumPattern.values()) {
|
||||
primary.put(
|
||||
pattern.ordinal(),
|
||||
BinnieCore.proxy.getIcon(
|
||||
register,
|
||||
getMod().getModID(),
|
||||
getTexturePath() + "/" + pattern.toString().toLowerCase() + ".0"));
|
||||
secondary.put(
|
||||
pattern.ordinal(),
|
||||
BinnieCore.proxy.getIcon(
|
||||
register,
|
||||
getMod().getModID(),
|
||||
getTexturePath() + "/" + pattern.toString().toLowerCase() + ".1"));
|
||||
}
|
||||
}
|
||||
|
||||
public AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
public AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,24 @@
|
||||
package binnie.extratrees.carpentry;
|
||||
|
||||
import binnie.extratrees.api.IDesignSystem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class DesignerManager {
|
||||
public static DesignerManager instance = new DesignerManager();
|
||||
public static DesignerManager instance = new DesignerManager();
|
||||
|
||||
List<IDesignSystem> systems;
|
||||
List<IDesignSystem> systems;
|
||||
|
||||
public DesignerManager() {
|
||||
systems = new ArrayList<>();
|
||||
}
|
||||
public DesignerManager() {
|
||||
systems = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void registerDesignSystem(IDesignSystem system) {
|
||||
systems.add(system);
|
||||
}
|
||||
public void registerDesignSystem(IDesignSystem system) {
|
||||
systems.add(system);
|
||||
}
|
||||
|
||||
public Collection<IDesignSystem> getDesignSystems() {
|
||||
return systems;
|
||||
}
|
||||
public Collection<IDesignSystem> getDesignSystems() {
|
||||
return systems;
|
||||
}
|
||||
}
|
||||
@@ -5,471 +5,504 @@ import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.ILayout;
|
||||
|
||||
public enum EnumDesign implements IDesign {
|
||||
Blank("blank"),
|
||||
Octagon("octagon"),
|
||||
Diamond("diamond"),
|
||||
Ringed("ringed"),
|
||||
Squared("squared"),
|
||||
Multiply("multiply"),
|
||||
Halved("halved"),
|
||||
Striped("striped"),
|
||||
ThinStriped("thinStriped"),
|
||||
Chequered("fullChequered"),
|
||||
Tiled("fullTiled"),
|
||||
ChequeredB("chequered"),
|
||||
TiledB("tiled"),
|
||||
VeryThinCorner("veryThinCornered"),
|
||||
ThinCorner("thinCornered"),
|
||||
Corner("cornered"),
|
||||
ThickCorner("thickCornered"),
|
||||
Edged("edged"),
|
||||
ThinEdged("thinEdged"),
|
||||
ThinBarred("thinBarred"),
|
||||
Barred("barred"),
|
||||
ThickBarred("thickBarred"),
|
||||
Diagonal("diagonal"),
|
||||
ThickDiagonal("thickDiagonal"),
|
||||
ThinSaltire("thinSaltire"),
|
||||
Saltire("saltire"),
|
||||
ThickSaltire("thickSaltire"),
|
||||
ThinCrossed("thinCrossed"),
|
||||
Crossed("crossed"),
|
||||
ThickCrossed("thickCrossed"),
|
||||
ThinTSection("thinTSection"),
|
||||
TSection("tSection"),
|
||||
ThickTSection("thickTSection"),
|
||||
ThinBarredCorner("thinBarredCorner"),
|
||||
BarredCorner("barredCorner"),
|
||||
ThickBarredCorner("thickBarredCorner"),
|
||||
ThinStripedCorner("thinStripedCorner"),
|
||||
StripedCorner("stripedCorner"),
|
||||
Emblem1("emblem1"),
|
||||
Emblem2("emblem2"),
|
||||
Emblem3("emblem3"),
|
||||
Emblem4("emblem4"),
|
||||
Emblem5("emblem5"),
|
||||
LetterA("letterA"),
|
||||
LetterB("letterB"),
|
||||
LetterC("letterC"),
|
||||
LetterD("letterD"),
|
||||
LetterE("letterE"),
|
||||
LetterF("letterF"),
|
||||
LetterG("letterG"),
|
||||
LetterH("letterH"),
|
||||
LetterI("letterI"),
|
||||
LetterJ("letterJ"),
|
||||
LetterK("letterK"),
|
||||
LetterL("letterL"),
|
||||
LetterM("letterM"),
|
||||
LetterN("letterN"),
|
||||
LetterO("letterO"),
|
||||
LetterP("letterP"),
|
||||
LetterQ("letterQ"),
|
||||
LetterR("letterR"),
|
||||
LetterS("letterS"),
|
||||
LetterT("letterT"),
|
||||
LetterU("letterU"),
|
||||
LetterV("letterV"),
|
||||
LetterW("letterW"),
|
||||
LetterX("letterX"),
|
||||
LetterY("letterY"),
|
||||
LetterZ("letterZ"),
|
||||
ThinCurvedCrossed("thinCurvedCrossed"),
|
||||
ThinCurvedBarredCorner("thinCurvedBarredCorner"),
|
||||
CurvedBarredCorner("curvedBarredCorner"),
|
||||
ThinCurvedCorner("thinCurvedCorner"),
|
||||
CurvedCorner("curvedCorner"),
|
||||
ThinCurvedTSection("thinCurvedTSection"),
|
||||
CurvedTSection("curvedTSection"),
|
||||
BarredEnd("barredEnd"),
|
||||
DiagonalCorner("diagonalCorner"),
|
||||
DiagonalTSection("diagonalTSection"),
|
||||
DiagonalCurvedCorner("diagonalCurvedCorner"),
|
||||
DiagonalCurvedTSection("diagonalCurvedTSection"),
|
||||
OrnateBarred("ornateBarred"),
|
||||
SplitBarred("splitBarred"),
|
||||
SplitBarredCorner("splitBarredCorner"),
|
||||
SplitBarredTSection("splitBarredTSection"),
|
||||
SplitCrossed("splitCrossed"),
|
||||
SplitBarredEnd("splitBarredEnd"),
|
||||
OrnateThinBarred("ornateThinBarred"),
|
||||
Circle("circle"),
|
||||
Plus("plus"),
|
||||
Creeper("creeper"),
|
||||
OrnateStripedCorner("ornateStripedCorner"),
|
||||
Test("testingBlock"),
|
||||
DiagonalHalved("diagonalHalved"),
|
||||
Diagonal1Edged("corneredDiagonal"),
|
||||
Diagonal2Edged("oppositeCorneredDiagonal"),
|
||||
ThickDiagonal1Edged("thickCorneredDiagonal"),
|
||||
ThinBarredEnd("thinBarredEnd"),
|
||||
ThickBarredEnd("thickBarredEnd"),
|
||||
OverlappedBarred("overlappedBarred"),
|
||||
OverlappedSplitBarred("overlappedSplitBarred");
|
||||
Blank("blank"),
|
||||
Octagon("octagon"),
|
||||
Diamond("diamond"),
|
||||
Ringed("ringed"),
|
||||
Squared("squared"),
|
||||
Multiply("multiply"),
|
||||
Halved("halved"),
|
||||
Striped("striped"),
|
||||
ThinStriped("thinStriped"),
|
||||
Chequered("fullChequered"),
|
||||
Tiled("fullTiled"),
|
||||
ChequeredB("chequered"),
|
||||
TiledB("tiled"),
|
||||
VeryThinCorner("veryThinCornered"),
|
||||
ThinCorner("thinCornered"),
|
||||
Corner("cornered"),
|
||||
ThickCorner("thickCornered"),
|
||||
Edged("edged"),
|
||||
ThinEdged("thinEdged"),
|
||||
ThinBarred("thinBarred"),
|
||||
Barred("barred"),
|
||||
ThickBarred("thickBarred"),
|
||||
Diagonal("diagonal"),
|
||||
ThickDiagonal("thickDiagonal"),
|
||||
ThinSaltire("thinSaltire"),
|
||||
Saltire("saltire"),
|
||||
ThickSaltire("thickSaltire"),
|
||||
ThinCrossed("thinCrossed"),
|
||||
Crossed("crossed"),
|
||||
ThickCrossed("thickCrossed"),
|
||||
ThinTSection("thinTSection"),
|
||||
TSection("tSection"),
|
||||
ThickTSection("thickTSection"),
|
||||
ThinBarredCorner("thinBarredCorner"),
|
||||
BarredCorner("barredCorner"),
|
||||
ThickBarredCorner("thickBarredCorner"),
|
||||
ThinStripedCorner("thinStripedCorner"),
|
||||
StripedCorner("stripedCorner"),
|
||||
Emblem1("emblem1"),
|
||||
Emblem2("emblem2"),
|
||||
Emblem3("emblem3"),
|
||||
Emblem4("emblem4"),
|
||||
Emblem5("emblem5"),
|
||||
LetterA("letterA"),
|
||||
LetterB("letterB"),
|
||||
LetterC("letterC"),
|
||||
LetterD("letterD"),
|
||||
LetterE("letterE"),
|
||||
LetterF("letterF"),
|
||||
LetterG("letterG"),
|
||||
LetterH("letterH"),
|
||||
LetterI("letterI"),
|
||||
LetterJ("letterJ"),
|
||||
LetterK("letterK"),
|
||||
LetterL("letterL"),
|
||||
LetterM("letterM"),
|
||||
LetterN("letterN"),
|
||||
LetterO("letterO"),
|
||||
LetterP("letterP"),
|
||||
LetterQ("letterQ"),
|
||||
LetterR("letterR"),
|
||||
LetterS("letterS"),
|
||||
LetterT("letterT"),
|
||||
LetterU("letterU"),
|
||||
LetterV("letterV"),
|
||||
LetterW("letterW"),
|
||||
LetterX("letterX"),
|
||||
LetterY("letterY"),
|
||||
LetterZ("letterZ"),
|
||||
ThinCurvedCrossed("thinCurvedCrossed"),
|
||||
ThinCurvedBarredCorner("thinCurvedBarredCorner"),
|
||||
CurvedBarredCorner("curvedBarredCorner"),
|
||||
ThinCurvedCorner("thinCurvedCorner"),
|
||||
CurvedCorner("curvedCorner"),
|
||||
ThinCurvedTSection("thinCurvedTSection"),
|
||||
CurvedTSection("curvedTSection"),
|
||||
BarredEnd("barredEnd"),
|
||||
DiagonalCorner("diagonalCorner"),
|
||||
DiagonalTSection("diagonalTSection"),
|
||||
DiagonalCurvedCorner("diagonalCurvedCorner"),
|
||||
DiagonalCurvedTSection("diagonalCurvedTSection"),
|
||||
OrnateBarred("ornateBarred"),
|
||||
SplitBarred("splitBarred"),
|
||||
SplitBarredCorner("splitBarredCorner"),
|
||||
SplitBarredTSection("splitBarredTSection"),
|
||||
SplitCrossed("splitCrossed"),
|
||||
SplitBarredEnd("splitBarredEnd"),
|
||||
OrnateThinBarred("ornateThinBarred"),
|
||||
Circle("circle"),
|
||||
Plus("plus"),
|
||||
Creeper("creeper"),
|
||||
OrnateStripedCorner("ornateStripedCorner"),
|
||||
Test("testingBlock"),
|
||||
DiagonalHalved("diagonalHalved"),
|
||||
Diagonal1Edged("corneredDiagonal"),
|
||||
Diagonal2Edged("oppositeCorneredDiagonal"),
|
||||
ThickDiagonal1Edged("thickCorneredDiagonal"),
|
||||
ThinBarredEnd("thinBarredEnd"),
|
||||
ThickBarredEnd("thickBarredEnd"),
|
||||
OverlappedBarred("overlappedBarred"),
|
||||
OverlappedSplitBarred("overlappedSplitBarred");
|
||||
|
||||
static {
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Blank);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Octagon);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Diamond);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Ringed);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Squared);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Multiply);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Plus);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Circle);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem1);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem2);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem3);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem4);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem5);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Creeper);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.Chequered);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.ChequeredB);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.Tiled);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.TiledB);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.Striped);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.ThinStriped);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.ThinStripedCorner);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.StripedCorner);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.OrnateStripedCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.Halved);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.Corner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.ThickCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.Edged);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.ThinCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.ThinEdged);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.VeryThinCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.ThinCurvedCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.CurvedCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinCrossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinBarredEnd);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.OrnateThinBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.Barred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.BarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.TSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.Crossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.BarredEnd);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.OverlappedBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.OrnateBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickCrossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickBarredEnd);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinCurvedBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.CurvedBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinCurvedTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.CurvedTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinCurvedCrossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitBarredTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitCrossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitBarredEnd);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.OverlappedSplitBarred);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.ThinSaltire);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.Diagonal);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalCorner);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalTSection);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalCurvedCorner);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalCurvedTSection);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.Saltire);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.ThickDiagonal);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.ThickSaltire);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalHalved);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.Diagonal1Edged);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.Diagonal2Edged);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.ThickDiagonal1Edged);
|
||||
EnumDesign.Octagon.setAllPatterns(EnumPattern.Octagon.layout());
|
||||
EnumDesign.Diamond.setAllPatterns(EnumPattern.Diamond.layout());
|
||||
EnumDesign.Ringed.setAllPatterns(EnumPattern.Ringed.layout());
|
||||
EnumDesign.Squared.setAllPatterns(EnumPattern.Squared.layout());
|
||||
EnumDesign.Multiply.setAllPatterns(EnumPattern.Multiply.layout());
|
||||
EnumDesign.ThinStriped.setupStriped(EnumPattern.ThinStriped.layout());
|
||||
EnumDesign.Striped.setupStriped(EnumPattern.Striped.layout());
|
||||
EnumDesign.Halved.setupStriped(EnumPattern.Halved.layout());
|
||||
EnumDesign.Chequered.setChequered(EnumPattern.Chequered.layout());
|
||||
EnumDesign.Tiled.setChequered(EnumPattern.Tiled.layout());
|
||||
EnumDesign.ChequeredB.setStripedChequered(EnumPattern.Chequered.layout(), EnumPattern.Halved.layout());
|
||||
EnumDesign.TiledB.setStripedChequered(EnumPattern.Tiled.layout(), EnumPattern.Striped.layout());
|
||||
EnumDesign.VeryThinCorner.setCornered(EnumPattern.VeryThinCorner.layout(), EnumPattern.ThinEdged.layout());
|
||||
EnumDesign.ThinCorner.setCornered(EnumPattern.ThinCorner.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.Corner.setCornered(EnumPattern.Corner.layout(), EnumPattern.Halved.layout());
|
||||
EnumDesign.ThickCorner.setCornered(EnumPattern.ThickCorner.layout(), EnumPattern.Edged.layout(true).flipHorizontal());
|
||||
EnumDesign.ThinCurvedCorner.setCornered(EnumPattern.ThinCurvedCorner.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.CurvedCorner.setCornered(EnumPattern.CurvedCorner.layout(), EnumPattern.Halved.layout());
|
||||
EnumDesign.Edged.setEdged(EnumPattern.Edged.layout());
|
||||
EnumDesign.ThinEdged.setEdged(EnumPattern.ThinEdged.layout());
|
||||
EnumDesign.ThinBarred.setBarred(EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.Barred.setBarred(EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickBarred.setBarred(EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.Diagonal.setDiagonal(EnumPattern.Diagonal.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.ThickDiagonal.setDiagonal(EnumPattern.ThickDiagonal.layout(), EnumPattern.Halved.layout());
|
||||
EnumDesign.ThinSaltire.setSaltire(EnumPattern.ThinSaltire.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.Saltire.setSaltire(EnumPattern.Saltire.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickSaltire.setSaltire(EnumPattern.ThickSaltire.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.ThinCrossed.setCross(EnumPattern.ThinCrossed.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.Crossed.setCross(EnumPattern.Crossed.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickCrossed.setCross(EnumPattern.ThickCrossed.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.ThinCurvedCrossed.setCross(EnumPattern.ThinCurvedCrossed.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.ThinTSection.setTSection(EnumPattern.ThinTSection.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.TSection.setTSection(EnumPattern.TSection.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickTSection.setTSection(EnumPattern.ThickTSection.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.ThinCurvedTSection.setTSection(EnumPattern.ThinCurvedTSection.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.CurvedTSection.setTSection(EnumPattern.CurvedTSection.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThinBarredCorner.setBarredCorner(EnumPattern.ThinBarredCorner.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.BarredCorner.setBarredCorner(EnumPattern.BarredCorner.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickBarredCorner.setBarredCorner(EnumPattern.ThickBarredCorner.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.ThinCurvedBarredCorner.setBarredCorner(EnumPattern.ThinCurvedBarredCorner.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.CurvedBarredCorner.setBarredCorner(EnumPattern.BarredCurvedCorner.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThinStripedCorner.setStripedCorner(EnumPattern.ThinStripedCorner.layout(), EnumPattern.ThinStriped.layout());
|
||||
EnumDesign.StripedCorner.setStripedCorner(EnumPattern.StripedCorner.layout(), EnumPattern.Striped.layout());
|
||||
EnumDesign.OrnateStripedCorner.setStripedCorner(EnumPattern.OrnateStripedCorner.layout(), EnumPattern.ThinStriped.layout());
|
||||
EnumDesign.Emblem1.setAllPatterns(EnumPattern.Emblem1.layout());
|
||||
EnumDesign.Emblem2.setAllPatterns(EnumPattern.Emblem2.layout());
|
||||
EnumDesign.Emblem3.setAllPatterns(EnumPattern.Emblem3.layout());
|
||||
EnumDesign.Emblem4.setAllPatterns(EnumPattern.Emblem4.layout());
|
||||
EnumDesign.Emblem5.setAllPatterns(EnumPattern.Emblem5.layout());
|
||||
EnumDesign.LetterA.setLetterPattern(EnumPattern.LetterA.layout());
|
||||
EnumDesign.LetterB.setLetterPattern(EnumPattern.LetterB.layout());
|
||||
EnumDesign.LetterF.setLetterPattern(EnumPattern.LetterF.layout());
|
||||
EnumDesign.LetterS.setLetterPattern(EnumPattern.LetterS.layout());
|
||||
EnumDesign.LetterT.setLetterPattern(EnumPattern.LetterT.layout());
|
||||
EnumDesign.BarredEnd.setBarredEndPattern(EnumPattern.BarredEnd.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.DiagonalCorner.setDiagonalCorner(EnumPattern.DiagonalCorner.layout(), EnumPattern.Barred.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.DiagonalTSection.setDiagonalTSection(EnumPattern.DiagonalTSection.layout(), EnumPattern.Barred.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.DiagonalCurvedCorner.setDiagonalCorner(EnumPattern.DiagonalCurvedCorner.layout(), EnumPattern.Barred.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.DiagonalCurvedTSection.setDiagonalTSection(EnumPattern.DiagonalCurvedTSection.layout(), EnumPattern.Barred.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.OrnateBarred.setBarred(EnumPattern.OrnateBarred.layout());
|
||||
EnumDesign.OrnateThinBarred.setBarred(EnumPattern.OrnateThinBarred.layout());
|
||||
EnumDesign.SplitBarred.setBarred(EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.SplitBarredCorner.setBarredCorner(EnumPattern.SplitBarredCorner.layout(), EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.SplitBarredTSection.setTSection(EnumPattern.SplitBarredTSection.layout(), EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.SplitCrossed.setCross(EnumPattern.SplitCrossed.layout(), EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.SplitBarredEnd.setBarredEndPattern(EnumPattern.SplitBarredEnd.layout(), EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.Circle.setAllPatterns(EnumPattern.Circle.layout());
|
||||
EnumDesign.Plus.setAllPatterns(EnumPattern.Plus.layout());
|
||||
EnumDesign.Creeper.setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
EnumDesign.Creeper.setTopPattern(EnumPattern.Creeper.layout());
|
||||
EnumDesign.DiagonalHalved.setTopPattern(EnumPattern.DiagonalHalved.layout());
|
||||
EnumDesign.DiagonalHalved.setEdgePatterns(EnumPattern.Blank.layout(), EnumPattern.Blank.layout(true), EnumPattern.Blank.layout(true), EnumPattern.Blank.layout());
|
||||
EnumDesign.Diagonal1Edged.setTopPattern(EnumPattern.Diagonal1Edged.layout());
|
||||
EnumDesign.Diagonal1Edged.setEdgePatterns(EnumPattern.Edged.layout().flipHorizontal(), EnumPattern.Blank.layout(true), EnumPattern.Blank.layout(true), EnumPattern.Edged.layout());
|
||||
EnumDesign.Diagonal2Edged.setTopPattern(EnumPattern.Diagonal2Edged.layout());
|
||||
EnumDesign.Diagonal2Edged.setEdgePatterns(EnumPattern.Edged.layout(), EnumPattern.Edged.layout().flipHorizontal(), EnumPattern.Edged.layout(), EnumPattern.Edged.layout().flipHorizontal());
|
||||
EnumDesign.ThickDiagonal1Edged.setTopPattern(EnumPattern.ThickDiagonal1Edged.layout());
|
||||
EnumDesign.ThickDiagonal1Edged.setEdgePatterns(EnumPattern.Halved.layout().flipHorizontal(), EnumPattern.Blank.layout(true), EnumPattern.Blank.layout(true), EnumPattern.Halved.layout());
|
||||
EnumDesign.ThickBarredEnd.setBarredEndPattern(EnumPattern.ThickBarredEnd.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.ThinBarredEnd.setBarredEndPattern(EnumPattern.ThinBarredEnd.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.OverlappedSplitBarred.setAllPatterns(EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.OverlappedSplitBarred.setTopPattern(EnumPattern.OverlappedSplitBarred.layout());
|
||||
EnumDesign.OverlappedBarred.setAllPatterns(EnumPattern.Barred.layout());
|
||||
EnumDesign.OverlappedBarred.setTopPattern(EnumPattern.OverlappedBarred.layout());
|
||||
}
|
||||
static {
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Blank);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Octagon);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Diamond);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Ringed);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Squared);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Multiply);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Plus);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Circle);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem1);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem2);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem3);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem4);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Emblem5);
|
||||
EnumDesignCategory.Design.addDesign(EnumDesign.Creeper);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.Chequered);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.ChequeredB);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.Tiled);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.TiledB);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.Striped);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.ThinStriped);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.ThinStripedCorner);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.StripedCorner);
|
||||
EnumDesignCategory.Stripes.addDesign(EnumDesign.OrnateStripedCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.Halved);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.Corner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.ThickCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.Edged);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.ThinCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.ThinEdged);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.VeryThinCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.ThinCurvedCorner);
|
||||
EnumDesignCategory.Edges.addDesign(EnumDesign.CurvedCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinCrossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinBarredEnd);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.OrnateThinBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.Barred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.BarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.TSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.Crossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.BarredEnd);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.OverlappedBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.OrnateBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickCrossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThickBarredEnd);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinCurvedBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.CurvedBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinCurvedTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.CurvedTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.ThinCurvedCrossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitBarred);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitBarredCorner);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitBarredTSection);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitCrossed);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.SplitBarredEnd);
|
||||
EnumDesignCategory.Barred.addDesign(EnumDesign.OverlappedSplitBarred);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.ThinSaltire);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.Diagonal);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalCorner);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalTSection);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalCurvedCorner);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalCurvedTSection);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.Saltire);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.ThickDiagonal);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.ThickSaltire);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.DiagonalHalved);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.Diagonal1Edged);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.Diagonal2Edged);
|
||||
EnumDesignCategory.Diagonal.addDesign(EnumDesign.ThickDiagonal1Edged);
|
||||
EnumDesign.Octagon.setAllPatterns(EnumPattern.Octagon.layout());
|
||||
EnumDesign.Diamond.setAllPatterns(EnumPattern.Diamond.layout());
|
||||
EnumDesign.Ringed.setAllPatterns(EnumPattern.Ringed.layout());
|
||||
EnumDesign.Squared.setAllPatterns(EnumPattern.Squared.layout());
|
||||
EnumDesign.Multiply.setAllPatterns(EnumPattern.Multiply.layout());
|
||||
EnumDesign.ThinStriped.setupStriped(EnumPattern.ThinStriped.layout());
|
||||
EnumDesign.Striped.setupStriped(EnumPattern.Striped.layout());
|
||||
EnumDesign.Halved.setupStriped(EnumPattern.Halved.layout());
|
||||
EnumDesign.Chequered.setChequered(EnumPattern.Chequered.layout());
|
||||
EnumDesign.Tiled.setChequered(EnumPattern.Tiled.layout());
|
||||
EnumDesign.ChequeredB.setStripedChequered(EnumPattern.Chequered.layout(), EnumPattern.Halved.layout());
|
||||
EnumDesign.TiledB.setStripedChequered(EnumPattern.Tiled.layout(), EnumPattern.Striped.layout());
|
||||
EnumDesign.VeryThinCorner.setCornered(EnumPattern.VeryThinCorner.layout(), EnumPattern.ThinEdged.layout());
|
||||
EnumDesign.ThinCorner.setCornered(EnumPattern.ThinCorner.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.Corner.setCornered(EnumPattern.Corner.layout(), EnumPattern.Halved.layout());
|
||||
EnumDesign.ThickCorner.setCornered(
|
||||
EnumPattern.ThickCorner.layout(), EnumPattern.Edged.layout(true).flipHorizontal());
|
||||
EnumDesign.ThinCurvedCorner.setCornered(EnumPattern.ThinCurvedCorner.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.CurvedCorner.setCornered(EnumPattern.CurvedCorner.layout(), EnumPattern.Halved.layout());
|
||||
EnumDesign.Edged.setEdged(EnumPattern.Edged.layout());
|
||||
EnumDesign.ThinEdged.setEdged(EnumPattern.ThinEdged.layout());
|
||||
EnumDesign.ThinBarred.setBarred(EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.Barred.setBarred(EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickBarred.setBarred(EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.Diagonal.setDiagonal(EnumPattern.Diagonal.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.ThickDiagonal.setDiagonal(EnumPattern.ThickDiagonal.layout(), EnumPattern.Halved.layout());
|
||||
EnumDesign.ThinSaltire.setSaltire(EnumPattern.ThinSaltire.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.Saltire.setSaltire(EnumPattern.Saltire.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickSaltire.setSaltire(EnumPattern.ThickSaltire.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.ThinCrossed.setCross(EnumPattern.ThinCrossed.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.Crossed.setCross(EnumPattern.Crossed.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickCrossed.setCross(EnumPattern.ThickCrossed.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.ThinCurvedCrossed.setCross(EnumPattern.ThinCurvedCrossed.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.ThinTSection.setTSection(EnumPattern.ThinTSection.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.TSection.setTSection(EnumPattern.TSection.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickTSection.setTSection(EnumPattern.ThickTSection.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.ThinCurvedTSection.setTSection(
|
||||
EnumPattern.ThinCurvedTSection.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.CurvedTSection.setTSection(EnumPattern.CurvedTSection.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThinBarredCorner.setBarredCorner(
|
||||
EnumPattern.ThinBarredCorner.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.BarredCorner.setBarredCorner(EnumPattern.BarredCorner.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThickBarredCorner.setBarredCorner(
|
||||
EnumPattern.ThickBarredCorner.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.ThinCurvedBarredCorner.setBarredCorner(
|
||||
EnumPattern.ThinCurvedBarredCorner.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.CurvedBarredCorner.setBarredCorner(
|
||||
EnumPattern.BarredCurvedCorner.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.ThinStripedCorner.setStripedCorner(
|
||||
EnumPattern.ThinStripedCorner.layout(), EnumPattern.ThinStriped.layout());
|
||||
EnumDesign.StripedCorner.setStripedCorner(EnumPattern.StripedCorner.layout(), EnumPattern.Striped.layout());
|
||||
EnumDesign.OrnateStripedCorner.setStripedCorner(
|
||||
EnumPattern.OrnateStripedCorner.layout(), EnumPattern.ThinStriped.layout());
|
||||
EnumDesign.Emblem1.setAllPatterns(EnumPattern.Emblem1.layout());
|
||||
EnumDesign.Emblem2.setAllPatterns(EnumPattern.Emblem2.layout());
|
||||
EnumDesign.Emblem3.setAllPatterns(EnumPattern.Emblem3.layout());
|
||||
EnumDesign.Emblem4.setAllPatterns(EnumPattern.Emblem4.layout());
|
||||
EnumDesign.Emblem5.setAllPatterns(EnumPattern.Emblem5.layout());
|
||||
EnumDesign.LetterA.setLetterPattern(EnumPattern.LetterA.layout());
|
||||
EnumDesign.LetterB.setLetterPattern(EnumPattern.LetterB.layout());
|
||||
EnumDesign.LetterF.setLetterPattern(EnumPattern.LetterF.layout());
|
||||
EnumDesign.LetterS.setLetterPattern(EnumPattern.LetterS.layout());
|
||||
EnumDesign.LetterT.setLetterPattern(EnumPattern.LetterT.layout());
|
||||
EnumDesign.BarredEnd.setBarredEndPattern(EnumPattern.BarredEnd.layout(), EnumPattern.Barred.layout());
|
||||
EnumDesign.DiagonalCorner.setDiagonalCorner(
|
||||
EnumPattern.DiagonalCorner.layout(), EnumPattern.Barred.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.DiagonalTSection.setDiagonalTSection(
|
||||
EnumPattern.DiagonalTSection.layout(), EnumPattern.Barred.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.DiagonalCurvedCorner.setDiagonalCorner(
|
||||
EnumPattern.DiagonalCurvedCorner.layout(), EnumPattern.Barred.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.DiagonalCurvedTSection.setDiagonalTSection(
|
||||
EnumPattern.DiagonalCurvedTSection.layout(), EnumPattern.Barred.layout(), EnumPattern.Edged.layout());
|
||||
EnumDesign.OrnateBarred.setBarred(EnumPattern.OrnateBarred.layout());
|
||||
EnumDesign.OrnateThinBarred.setBarred(EnumPattern.OrnateThinBarred.layout());
|
||||
EnumDesign.SplitBarred.setBarred(EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.SplitBarredCorner.setBarredCorner(
|
||||
EnumPattern.SplitBarredCorner.layout(), EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.SplitBarredTSection.setTSection(
|
||||
EnumPattern.SplitBarredTSection.layout(), EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.SplitCrossed.setCross(EnumPattern.SplitCrossed.layout(), EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.SplitBarredEnd.setBarredEndPattern(
|
||||
EnumPattern.SplitBarredEnd.layout(), EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.Circle.setAllPatterns(EnumPattern.Circle.layout());
|
||||
EnumDesign.Plus.setAllPatterns(EnumPattern.Plus.layout());
|
||||
EnumDesign.Creeper.setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
EnumDesign.Creeper.setTopPattern(EnumPattern.Creeper.layout());
|
||||
EnumDesign.DiagonalHalved.setTopPattern(EnumPattern.DiagonalHalved.layout());
|
||||
EnumDesign.DiagonalHalved.setEdgePatterns(
|
||||
EnumPattern.Blank.layout(),
|
||||
EnumPattern.Blank.layout(true),
|
||||
EnumPattern.Blank.layout(true),
|
||||
EnumPattern.Blank.layout());
|
||||
EnumDesign.Diagonal1Edged.setTopPattern(EnumPattern.Diagonal1Edged.layout());
|
||||
EnumDesign.Diagonal1Edged.setEdgePatterns(
|
||||
EnumPattern.Edged.layout().flipHorizontal(),
|
||||
EnumPattern.Blank.layout(true),
|
||||
EnumPattern.Blank.layout(true),
|
||||
EnumPattern.Edged.layout());
|
||||
EnumDesign.Diagonal2Edged.setTopPattern(EnumPattern.Diagonal2Edged.layout());
|
||||
EnumDesign.Diagonal2Edged.setEdgePatterns(
|
||||
EnumPattern.Edged.layout(),
|
||||
EnumPattern.Edged.layout().flipHorizontal(),
|
||||
EnumPattern.Edged.layout(),
|
||||
EnumPattern.Edged.layout().flipHorizontal());
|
||||
EnumDesign.ThickDiagonal1Edged.setTopPattern(EnumPattern.ThickDiagonal1Edged.layout());
|
||||
EnumDesign.ThickDiagonal1Edged.setEdgePatterns(
|
||||
EnumPattern.Halved.layout().flipHorizontal(),
|
||||
EnumPattern.Blank.layout(true),
|
||||
EnumPattern.Blank.layout(true),
|
||||
EnumPattern.Halved.layout());
|
||||
EnumDesign.ThickBarredEnd.setBarredEndPattern(
|
||||
EnumPattern.ThickBarredEnd.layout(), EnumPattern.ThickBarred.layout());
|
||||
EnumDesign.ThinBarredEnd.setBarredEndPattern(
|
||||
EnumPattern.ThinBarredEnd.layout(), EnumPattern.ThinBarred.layout());
|
||||
EnumDesign.OverlappedSplitBarred.setAllPatterns(EnumPattern.SplitBarred.layout());
|
||||
EnumDesign.OverlappedSplitBarred.setTopPattern(EnumPattern.OverlappedSplitBarred.layout());
|
||||
EnumDesign.OverlappedBarred.setAllPatterns(EnumPattern.Barred.layout());
|
||||
EnumDesign.OverlappedBarred.setTopPattern(EnumPattern.OverlappedBarred.layout());
|
||||
}
|
||||
|
||||
protected String name;
|
||||
protected ILayout topPattern;
|
||||
protected ILayout bottomPattern;
|
||||
protected ILayout northPattern;
|
||||
protected ILayout southPattern;
|
||||
protected ILayout eastPattern;
|
||||
protected ILayout westPattern;
|
||||
protected String name;
|
||||
protected ILayout topPattern;
|
||||
protected ILayout bottomPattern;
|
||||
protected ILayout northPattern;
|
||||
protected ILayout southPattern;
|
||||
protected ILayout eastPattern;
|
||||
protected ILayout westPattern;
|
||||
|
||||
EnumDesign(String name) {
|
||||
this.name = name;
|
||||
topPattern = Layout.get(EnumPattern.Blank, false);
|
||||
bottomPattern = Layout.get(EnumPattern.Blank, false);
|
||||
northPattern = Layout.get(EnumPattern.Blank, false);
|
||||
eastPattern = Layout.get(EnumPattern.Blank, false);
|
||||
southPattern = Layout.get(EnumPattern.Blank, false);
|
||||
westPattern = Layout.get(EnumPattern.Blank, false);
|
||||
}
|
||||
EnumDesign(String name) {
|
||||
this.name = name;
|
||||
topPattern = Layout.get(EnumPattern.Blank, false);
|
||||
bottomPattern = Layout.get(EnumPattern.Blank, false);
|
||||
northPattern = Layout.get(EnumPattern.Blank, false);
|
||||
eastPattern = Layout.get(EnumPattern.Blank, false);
|
||||
southPattern = Layout.get(EnumPattern.Blank, false);
|
||||
westPattern = Layout.get(EnumPattern.Blank, false);
|
||||
}
|
||||
|
||||
void setEdgePatterns(ILayout north, ILayout east, ILayout south, ILayout west) {
|
||||
setNorthPattern(north);
|
||||
setEastPattern(east);
|
||||
setSouthPattern(south);
|
||||
setWestPattern(west);
|
||||
}
|
||||
void setEdgePatterns(ILayout north, ILayout east, ILayout south, ILayout west) {
|
||||
setNorthPattern(north);
|
||||
setEastPattern(east);
|
||||
setSouthPattern(south);
|
||||
setWestPattern(west);
|
||||
}
|
||||
|
||||
void setEdgePatterns(ILayout face) {
|
||||
setEdgePatterns(face, face, face, face);
|
||||
}
|
||||
void setEdgePatterns(ILayout face) {
|
||||
setEdgePatterns(face, face, face, face);
|
||||
}
|
||||
|
||||
void setupStriped(ILayout vert) {
|
||||
setTopPattern(vert);
|
||||
setEdgePatterns(vert.invert(), EnumPattern.Blank.layout(true), vert, EnumPattern.Blank.layout());
|
||||
}
|
||||
void setupStriped(ILayout vert) {
|
||||
setTopPattern(vert);
|
||||
setEdgePatterns(vert.invert(), EnumPattern.Blank.layout(true), vert, EnumPattern.Blank.layout());
|
||||
}
|
||||
|
||||
void setChequered(ILayout cheq) {
|
||||
setAllPatterns(cheq);
|
||||
setNorthPattern(cheq.invert());
|
||||
setSouthPattern(cheq.invert());
|
||||
setBottomPattern(cheq.invert());
|
||||
}
|
||||
void setChequered(ILayout cheq) {
|
||||
setAllPatterns(cheq);
|
||||
setNorthPattern(cheq.invert());
|
||||
setSouthPattern(cheq.invert());
|
||||
setBottomPattern(cheq.invert());
|
||||
}
|
||||
|
||||
void setStripedChequered(ILayout cheq, ILayout stripe) {
|
||||
setAllPatterns(cheq);
|
||||
setNorthPattern(stripe.invert());
|
||||
setSouthPattern(stripe.invert());
|
||||
setEastPattern(stripe);
|
||||
setWestPattern(stripe);
|
||||
}
|
||||
void setStripedChequered(ILayout cheq, ILayout stripe) {
|
||||
setAllPatterns(cheq);
|
||||
setNorthPattern(stripe.invert());
|
||||
setSouthPattern(stripe.invert());
|
||||
setEastPattern(stripe);
|
||||
setWestPattern(stripe);
|
||||
}
|
||||
|
||||
void setCornered(ILayout corner, ILayout edge) {
|
||||
setTopPattern(corner);
|
||||
setNorthPattern(EnumPattern.Blank.layout());
|
||||
setEastPattern(edge.flipHorizontal());
|
||||
setSouthPattern(edge);
|
||||
setWestPattern(EnumPattern.Blank.layout());
|
||||
}
|
||||
void setCornered(ILayout corner, ILayout edge) {
|
||||
setTopPattern(corner);
|
||||
setNorthPattern(EnumPattern.Blank.layout());
|
||||
setEastPattern(edge.flipHorizontal());
|
||||
setSouthPattern(edge);
|
||||
setWestPattern(EnumPattern.Blank.layout());
|
||||
}
|
||||
|
||||
void setEdged(ILayout edge) {
|
||||
setAllPatterns(edge);
|
||||
setWestPattern(EnumPattern.Blank.layout());
|
||||
setEastPattern(EnumPattern.Blank.layout(true));
|
||||
northPattern = northPattern.flipHorizontal();
|
||||
}
|
||||
void setEdged(ILayout edge) {
|
||||
setAllPatterns(edge);
|
||||
setWestPattern(EnumPattern.Blank.layout());
|
||||
setEastPattern(EnumPattern.Blank.layout(true));
|
||||
northPattern = northPattern.flipHorizontal();
|
||||
}
|
||||
|
||||
void setBarred(ILayout bar) {
|
||||
setAllPatterns(bar);
|
||||
setEastPattern(EnumPattern.Blank.layout(true));
|
||||
setWestPattern(EnumPattern.Blank.layout(true));
|
||||
}
|
||||
void setBarred(ILayout bar) {
|
||||
setAllPatterns(bar);
|
||||
setEastPattern(EnumPattern.Blank.layout(true));
|
||||
setWestPattern(EnumPattern.Blank.layout(true));
|
||||
}
|
||||
|
||||
void setDiagonal(ILayout diagonal, ILayout edged) {
|
||||
setAllPatterns(edged);
|
||||
setTopPattern(diagonal);
|
||||
northPattern = northPattern.flipHorizontal();
|
||||
southPattern = southPattern.flipHorizontal();
|
||||
}
|
||||
void setDiagonal(ILayout diagonal, ILayout edged) {
|
||||
setAllPatterns(edged);
|
||||
setTopPattern(diagonal);
|
||||
northPattern = northPattern.flipHorizontal();
|
||||
southPattern = southPattern.flipHorizontal();
|
||||
}
|
||||
|
||||
void setSaltire(ILayout saltire, ILayout bar) {
|
||||
setTopPattern(saltire);
|
||||
setEdgePatterns(bar.invert());
|
||||
}
|
||||
void setSaltire(ILayout saltire, ILayout bar) {
|
||||
setTopPattern(saltire);
|
||||
setEdgePatterns(bar.invert());
|
||||
}
|
||||
|
||||
void setCross(ILayout saltire, ILayout bar) {
|
||||
setTopPattern(saltire);
|
||||
setEdgePatterns(bar);
|
||||
}
|
||||
void setCross(ILayout saltire, ILayout bar) {
|
||||
setTopPattern(saltire);
|
||||
setEdgePatterns(bar);
|
||||
}
|
||||
|
||||
void setTSection(ILayout tsection, ILayout bar) {
|
||||
setTopPattern(tsection);
|
||||
setEdgePatterns(bar);
|
||||
setWestPattern(EnumPattern.Blank.layout(true));
|
||||
}
|
||||
void setTSection(ILayout tsection, ILayout bar) {
|
||||
setTopPattern(tsection);
|
||||
setEdgePatterns(bar);
|
||||
setWestPattern(EnumPattern.Blank.layout(true));
|
||||
}
|
||||
|
||||
void setBarredCorner(ILayout corner, ILayout bar) {
|
||||
setTSection(corner, bar);
|
||||
setNorthPattern(EnumPattern.Blank.layout(true));
|
||||
}
|
||||
void setBarredCorner(ILayout corner, ILayout bar) {
|
||||
setTSection(corner, bar);
|
||||
setNorthPattern(EnumPattern.Blank.layout(true));
|
||||
}
|
||||
|
||||
void setStripedCorner(ILayout corner, ILayout striped) {
|
||||
setCornered(corner, striped);
|
||||
}
|
||||
void setStripedCorner(ILayout corner, ILayout striped) {
|
||||
setCornered(corner, striped);
|
||||
}
|
||||
|
||||
void setLetterPattern(ILayout letter) {
|
||||
setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
setTopPattern(letter);
|
||||
setBottomPattern(EnumPattern.Blank.layout(true));
|
||||
}
|
||||
void setLetterPattern(ILayout letter) {
|
||||
setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
setTopPattern(letter);
|
||||
setBottomPattern(EnumPattern.Blank.layout(true));
|
||||
}
|
||||
|
||||
void setBarredEndPattern(ILayout end, ILayout bar) {
|
||||
setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
setTopPattern(end);
|
||||
setWestPattern(bar);
|
||||
}
|
||||
void setBarredEndPattern(ILayout end, ILayout bar) {
|
||||
setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
setTopPattern(end);
|
||||
setWestPattern(bar);
|
||||
}
|
||||
|
||||
void setDiagonalCorner(ILayout diagonal, ILayout bar, ILayout edged) {
|
||||
setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
setTopPattern(diagonal);
|
||||
setWestPattern(bar.invert());
|
||||
setNorthPattern(edged.flipHorizontal());
|
||||
setSouthPattern(edged);
|
||||
}
|
||||
void setDiagonalCorner(ILayout diagonal, ILayout bar, ILayout edged) {
|
||||
setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
setTopPattern(diagonal);
|
||||
setWestPattern(bar.invert());
|
||||
setNorthPattern(edged.flipHorizontal());
|
||||
setSouthPattern(edged);
|
||||
}
|
||||
|
||||
void setDiagonalTSection(ILayout diagonal, ILayout bar, ILayout edged) {
|
||||
setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
setTopPattern(diagonal);
|
||||
setWestPattern(bar.invert());
|
||||
setNorthPattern(bar.invert());
|
||||
setEastPattern(edged.flipHorizontal());
|
||||
setSouthPattern(edged);
|
||||
}
|
||||
void setDiagonalTSection(ILayout diagonal, ILayout bar, ILayout edged) {
|
||||
setAllPatterns(EnumPattern.Blank.layout(true));
|
||||
setTopPattern(diagonal);
|
||||
setWestPattern(bar.invert());
|
||||
setNorthPattern(bar.invert());
|
||||
setEastPattern(edged.flipHorizontal());
|
||||
setSouthPattern(edged);
|
||||
}
|
||||
|
||||
private void setAllPatterns(ILayout layout) {
|
||||
setTopPattern(layout);
|
||||
setBottomPattern(layout);
|
||||
setNorthPattern(layout);
|
||||
setEastPattern(layout);
|
||||
setSouthPattern(layout);
|
||||
setWestPattern(layout);
|
||||
}
|
||||
private void setAllPatterns(ILayout layout) {
|
||||
setTopPattern(layout);
|
||||
setBottomPattern(layout);
|
||||
setNorthPattern(layout);
|
||||
setEastPattern(layout);
|
||||
setSouthPattern(layout);
|
||||
setWestPattern(layout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("botany.design." + name);
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("botany.design." + name);
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout getTopPattern() {
|
||||
return topPattern;
|
||||
}
|
||||
@Override
|
||||
public ILayout getTopPattern() {
|
||||
return topPattern;
|
||||
}
|
||||
|
||||
public void setTopPattern(ILayout layout) {
|
||||
topPattern = layout;
|
||||
setBottomPattern(layout);
|
||||
}
|
||||
public void setTopPattern(ILayout layout) {
|
||||
topPattern = layout;
|
||||
setBottomPattern(layout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout getBottomPattern() {
|
||||
return bottomPattern;
|
||||
}
|
||||
@Override
|
||||
public ILayout getBottomPattern() {
|
||||
return bottomPattern;
|
||||
}
|
||||
|
||||
public void setBottomPattern(ILayout layout) {
|
||||
bottomPattern = layout;
|
||||
}
|
||||
public void setBottomPattern(ILayout layout) {
|
||||
bottomPattern = layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout getNorthPattern() {
|
||||
return northPattern;
|
||||
}
|
||||
@Override
|
||||
public ILayout getNorthPattern() {
|
||||
return northPattern;
|
||||
}
|
||||
|
||||
public void setNorthPattern(ILayout layout) {
|
||||
northPattern = layout;
|
||||
}
|
||||
public void setNorthPattern(ILayout layout) {
|
||||
northPattern = layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout getSouthPattern() {
|
||||
return southPattern;
|
||||
}
|
||||
@Override
|
||||
public ILayout getSouthPattern() {
|
||||
return southPattern;
|
||||
}
|
||||
|
||||
public void setSouthPattern(ILayout layout) {
|
||||
southPattern = layout;
|
||||
}
|
||||
public void setSouthPattern(ILayout layout) {
|
||||
southPattern = layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout getEastPattern() {
|
||||
return eastPattern;
|
||||
}
|
||||
@Override
|
||||
public ILayout getEastPattern() {
|
||||
return eastPattern;
|
||||
}
|
||||
|
||||
public void setEastPattern(ILayout layout) {
|
||||
eastPattern = layout;
|
||||
}
|
||||
public void setEastPattern(ILayout layout) {
|
||||
eastPattern = layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout getWestPattern() {
|
||||
return westPattern;
|
||||
}
|
||||
@Override
|
||||
public ILayout getWestPattern() {
|
||||
return westPattern;
|
||||
}
|
||||
|
||||
public void setWestPattern(ILayout layout) {
|
||||
westPattern = layout;
|
||||
}
|
||||
public void setWestPattern(ILayout layout) {
|
||||
westPattern = layout;
|
||||
}
|
||||
}
|
||||
@@ -4,44 +4,43 @@ import binnie.core.util.I18N;
|
||||
import binnie.extratrees.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.IDesignCategory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum EnumDesignCategory implements IDesignCategory {
|
||||
Design("designsEmblems"),
|
||||
Stripes("squaresStripes"),
|
||||
Edges("edges"),
|
||||
Barred("bars"),
|
||||
Letters("letters"),
|
||||
Diagonal("diagonals");
|
||||
Design("designsEmblems"),
|
||||
Stripes("squaresStripes"),
|
||||
Edges("edges"),
|
||||
Barred("bars"),
|
||||
Letters("letters"),
|
||||
Diagonal("diagonals");
|
||||
|
||||
protected String name;
|
||||
protected List<IDesign> designs;
|
||||
protected String name;
|
||||
protected List<IDesign> designs;
|
||||
|
||||
EnumDesignCategory(String name) {
|
||||
this.name = name;
|
||||
designs = new ArrayList<>();
|
||||
CarpentryManager.carpentryInterface.registerDesignCategory(this);
|
||||
}
|
||||
EnumDesignCategory(String name) {
|
||||
this.name = name;
|
||||
designs = new ArrayList<>();
|
||||
CarpentryManager.carpentryInterface.registerDesignCategory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("botany.design.category." + name);
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("botany.design.category." + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IDesign> getDesigns() {
|
||||
return designs;
|
||||
}
|
||||
@Override
|
||||
public List<IDesign> getDesigns() {
|
||||
return designs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDesign(IDesign design) {
|
||||
designs.add(design);
|
||||
}
|
||||
@Override
|
||||
public void addDesign(IDesign design) {
|
||||
designs.add(design);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return toString().toLowerCase();
|
||||
}
|
||||
@Override
|
||||
public String getId() {
|
||||
return toString().toLowerCase();
|
||||
}
|
||||
}
|
||||
@@ -7,396 +7,503 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum EnumPattern implements IPattern {
|
||||
Blank,
|
||||
Octagon,
|
||||
Diamond,
|
||||
Ringed,
|
||||
Squared,
|
||||
Multiply,
|
||||
Circle,
|
||||
Plus,
|
||||
Creeper,
|
||||
Creeper2,
|
||||
Creeper3,
|
||||
Creeper4,
|
||||
Halved,
|
||||
Halved2,
|
||||
Striped,
|
||||
Striped2,
|
||||
ThinStriped,
|
||||
ThinStriped2,
|
||||
Chequered,
|
||||
Tiled,
|
||||
VeryThinCorner,
|
||||
VeryThinCorner2,
|
||||
VeryThinCorner3,
|
||||
VeryThinCorner4,
|
||||
ThinCorner,
|
||||
ThinCorner2,
|
||||
ThinCorner3,
|
||||
ThinCorner4,
|
||||
Corner,
|
||||
Corner2,
|
||||
Corner3,
|
||||
Corner4,
|
||||
ThickCorner,
|
||||
ThickCorner2,
|
||||
ThickCorner3,
|
||||
ThickCorner4,
|
||||
ThinCurvedCorner,
|
||||
ThinCurvedCorner2,
|
||||
ThinCurvedCorner3,
|
||||
ThinCurvedCorner4,
|
||||
CurvedCorner,
|
||||
CurvedCorner2,
|
||||
CurvedCorner3,
|
||||
CurvedCorner4,
|
||||
Edged,
|
||||
Edged2,
|
||||
Edged3,
|
||||
Edged4,
|
||||
ThinEdged,
|
||||
ThinEdged2,
|
||||
ThinEdged3,
|
||||
ThinEdged4,
|
||||
ThinBarred,
|
||||
ThinBarred2,
|
||||
Barred,
|
||||
Barred2,
|
||||
ThickBarred,
|
||||
ThickBarred2,
|
||||
BarredEnd,
|
||||
BarredEnd2,
|
||||
BarredEnd3,
|
||||
BarredEnd4,
|
||||
OrnateBarred,
|
||||
OrnateBarred2,
|
||||
OrnateThinBarred,
|
||||
OrnateThinBarred2,
|
||||
SplitBarred,
|
||||
SplitBarred2,
|
||||
SplitBarredCorner,
|
||||
SplitBarredCorner2,
|
||||
SplitBarredCorner3,
|
||||
SplitBarredCorner4,
|
||||
SplitBarredTSection,
|
||||
SplitBarredTSection2,
|
||||
SplitBarredTSection3,
|
||||
SplitBarredTSection4,
|
||||
SplitCrossed,
|
||||
SplitBarredEnd,
|
||||
SplitBarredEnd2,
|
||||
SplitBarredEnd3,
|
||||
SplitBarredEnd4,
|
||||
Diagonal,
|
||||
Diagonal2,
|
||||
ThickDiagonal,
|
||||
ThickDiagonal2,
|
||||
DiagonalCorner,
|
||||
DiagonalCorner2,
|
||||
DiagonalCorner3,
|
||||
DiagonalCorner4,
|
||||
DiagonalTSection,
|
||||
DiagonalTSection2,
|
||||
DiagonalTSection3,
|
||||
DiagonalTSection4,
|
||||
DiagonalCurvedCorner,
|
||||
DiagonalCurvedCorner2,
|
||||
DiagonalCurvedCorner3,
|
||||
DiagonalCurvedCorner4,
|
||||
DiagonalCurvedTSection,
|
||||
DiagonalCurvedTSection2,
|
||||
DiagonalCurvedTSection3,
|
||||
DiagonalCurvedTSection4,
|
||||
DiagonalStriped,
|
||||
DiagonalStriped2,
|
||||
ThinDiagonalStriped,
|
||||
ThinDiagonalStriped2,
|
||||
ThinSaltire,
|
||||
Saltire,
|
||||
ThickSaltire,
|
||||
ThinCrossed,
|
||||
Crossed,
|
||||
ThickCrossed,
|
||||
ThinCurvedCrossed,
|
||||
ThinTSection,
|
||||
ThinTSection2,
|
||||
ThinTSection3,
|
||||
ThinTSection4,
|
||||
TSection,
|
||||
TSection2,
|
||||
TSection3,
|
||||
TSection4,
|
||||
ThickTSection,
|
||||
ThickTSection2,
|
||||
ThickTSection3,
|
||||
ThickTSection4,
|
||||
ThinCurvedTSection,
|
||||
ThinCurvedTSection2,
|
||||
ThinCurvedTSection3,
|
||||
ThinCurvedTSection4,
|
||||
CurvedTSection,
|
||||
CurvedTSection2,
|
||||
CurvedTSection3,
|
||||
CurvedTSection4,
|
||||
ThinBarredCorner,
|
||||
ThinBarredCorner2,
|
||||
ThinBarredCorner3,
|
||||
ThinBarredCorner4,
|
||||
BarredCorner,
|
||||
BarredCorner2,
|
||||
BarredCorner3,
|
||||
BarredCorner4,
|
||||
ThickBarredCorner,
|
||||
ThickBarredCorner2,
|
||||
ThickBarredCorner3,
|
||||
ThickBarredCorner4,
|
||||
ThinCurvedBarredCorner,
|
||||
ThinCurvedBarredCorner2,
|
||||
ThinCurvedBarredCorner3,
|
||||
ThinCurvedBarredCorner4,
|
||||
BarredCurvedCorner,
|
||||
BarredCurvedCorner2,
|
||||
BarredCurvedCorner3,
|
||||
BarredCurvedCorner4,
|
||||
ThinStripedCorner,
|
||||
ThinStripedCorner2,
|
||||
ThinStripedCorner3,
|
||||
ThinStripedCorner4,
|
||||
StripedCorner,
|
||||
StripedCorner2,
|
||||
StripedCorner3,
|
||||
StripedCorner4,
|
||||
OrnateStripedCorner,
|
||||
OrnateStripedCorner2,
|
||||
OrnateStripedCorner3,
|
||||
OrnateStripedCorner4,
|
||||
Emblem1,
|
||||
Emblem2,
|
||||
Emblem3,
|
||||
Emblem4,
|
||||
Emblem5,
|
||||
LetterA,
|
||||
LetterA2,
|
||||
LetterA3,
|
||||
LetterA4,
|
||||
LetterB,
|
||||
LetterB2,
|
||||
LetterB3,
|
||||
LetterB4,
|
||||
LetterF,
|
||||
LetterF2,
|
||||
LetterF3,
|
||||
LetterF4,
|
||||
LetterS,
|
||||
LetterS2,
|
||||
LetterS3,
|
||||
LetterS4,
|
||||
LetterT,
|
||||
LetterT2,
|
||||
LetterT3,
|
||||
LetterT4,
|
||||
DiagonalHalved,
|
||||
DiagonalHalved2,
|
||||
Diagonal1Edged,
|
||||
Diagonal1Edged2,
|
||||
Diagonal1Edged3,
|
||||
Diagonal1Edged4,
|
||||
Diagonal2Edged,
|
||||
Diagonal2Edged2,
|
||||
ThickDiagonal1Edged,
|
||||
ThickDiagonal1Edged2,
|
||||
ThickDiagonal1Edged3,
|
||||
ThickDiagonal1Edged4,
|
||||
ThinBarredEnd,
|
||||
ThinBarredEnd2,
|
||||
ThinBarredEnd3,
|
||||
ThinBarredEnd4,
|
||||
ThickBarredEnd,
|
||||
ThickBarredEnd2,
|
||||
ThickBarredEnd3,
|
||||
ThickBarredEnd4,
|
||||
OverlappedSplitBarred,
|
||||
OverlappedSplitBarred2,
|
||||
OverlappedBarred,
|
||||
OverlappedBarred2;
|
||||
Blank,
|
||||
Octagon,
|
||||
Diamond,
|
||||
Ringed,
|
||||
Squared,
|
||||
Multiply,
|
||||
Circle,
|
||||
Plus,
|
||||
Creeper,
|
||||
Creeper2,
|
||||
Creeper3,
|
||||
Creeper4,
|
||||
Halved,
|
||||
Halved2,
|
||||
Striped,
|
||||
Striped2,
|
||||
ThinStriped,
|
||||
ThinStriped2,
|
||||
Chequered,
|
||||
Tiled,
|
||||
VeryThinCorner,
|
||||
VeryThinCorner2,
|
||||
VeryThinCorner3,
|
||||
VeryThinCorner4,
|
||||
ThinCorner,
|
||||
ThinCorner2,
|
||||
ThinCorner3,
|
||||
ThinCorner4,
|
||||
Corner,
|
||||
Corner2,
|
||||
Corner3,
|
||||
Corner4,
|
||||
ThickCorner,
|
||||
ThickCorner2,
|
||||
ThickCorner3,
|
||||
ThickCorner4,
|
||||
ThinCurvedCorner,
|
||||
ThinCurvedCorner2,
|
||||
ThinCurvedCorner3,
|
||||
ThinCurvedCorner4,
|
||||
CurvedCorner,
|
||||
CurvedCorner2,
|
||||
CurvedCorner3,
|
||||
CurvedCorner4,
|
||||
Edged,
|
||||
Edged2,
|
||||
Edged3,
|
||||
Edged4,
|
||||
ThinEdged,
|
||||
ThinEdged2,
|
||||
ThinEdged3,
|
||||
ThinEdged4,
|
||||
ThinBarred,
|
||||
ThinBarred2,
|
||||
Barred,
|
||||
Barred2,
|
||||
ThickBarred,
|
||||
ThickBarred2,
|
||||
BarredEnd,
|
||||
BarredEnd2,
|
||||
BarredEnd3,
|
||||
BarredEnd4,
|
||||
OrnateBarred,
|
||||
OrnateBarred2,
|
||||
OrnateThinBarred,
|
||||
OrnateThinBarred2,
|
||||
SplitBarred,
|
||||
SplitBarred2,
|
||||
SplitBarredCorner,
|
||||
SplitBarredCorner2,
|
||||
SplitBarredCorner3,
|
||||
SplitBarredCorner4,
|
||||
SplitBarredTSection,
|
||||
SplitBarredTSection2,
|
||||
SplitBarredTSection3,
|
||||
SplitBarredTSection4,
|
||||
SplitCrossed,
|
||||
SplitBarredEnd,
|
||||
SplitBarredEnd2,
|
||||
SplitBarredEnd3,
|
||||
SplitBarredEnd4,
|
||||
Diagonal,
|
||||
Diagonal2,
|
||||
ThickDiagonal,
|
||||
ThickDiagonal2,
|
||||
DiagonalCorner,
|
||||
DiagonalCorner2,
|
||||
DiagonalCorner3,
|
||||
DiagonalCorner4,
|
||||
DiagonalTSection,
|
||||
DiagonalTSection2,
|
||||
DiagonalTSection3,
|
||||
DiagonalTSection4,
|
||||
DiagonalCurvedCorner,
|
||||
DiagonalCurvedCorner2,
|
||||
DiagonalCurvedCorner3,
|
||||
DiagonalCurvedCorner4,
|
||||
DiagonalCurvedTSection,
|
||||
DiagonalCurvedTSection2,
|
||||
DiagonalCurvedTSection3,
|
||||
DiagonalCurvedTSection4,
|
||||
DiagonalStriped,
|
||||
DiagonalStriped2,
|
||||
ThinDiagonalStriped,
|
||||
ThinDiagonalStriped2,
|
||||
ThinSaltire,
|
||||
Saltire,
|
||||
ThickSaltire,
|
||||
ThinCrossed,
|
||||
Crossed,
|
||||
ThickCrossed,
|
||||
ThinCurvedCrossed,
|
||||
ThinTSection,
|
||||
ThinTSection2,
|
||||
ThinTSection3,
|
||||
ThinTSection4,
|
||||
TSection,
|
||||
TSection2,
|
||||
TSection3,
|
||||
TSection4,
|
||||
ThickTSection,
|
||||
ThickTSection2,
|
||||
ThickTSection3,
|
||||
ThickTSection4,
|
||||
ThinCurvedTSection,
|
||||
ThinCurvedTSection2,
|
||||
ThinCurvedTSection3,
|
||||
ThinCurvedTSection4,
|
||||
CurvedTSection,
|
||||
CurvedTSection2,
|
||||
CurvedTSection3,
|
||||
CurvedTSection4,
|
||||
ThinBarredCorner,
|
||||
ThinBarredCorner2,
|
||||
ThinBarredCorner3,
|
||||
ThinBarredCorner4,
|
||||
BarredCorner,
|
||||
BarredCorner2,
|
||||
BarredCorner3,
|
||||
BarredCorner4,
|
||||
ThickBarredCorner,
|
||||
ThickBarredCorner2,
|
||||
ThickBarredCorner3,
|
||||
ThickBarredCorner4,
|
||||
ThinCurvedBarredCorner,
|
||||
ThinCurvedBarredCorner2,
|
||||
ThinCurvedBarredCorner3,
|
||||
ThinCurvedBarredCorner4,
|
||||
BarredCurvedCorner,
|
||||
BarredCurvedCorner2,
|
||||
BarredCurvedCorner3,
|
||||
BarredCurvedCorner4,
|
||||
ThinStripedCorner,
|
||||
ThinStripedCorner2,
|
||||
ThinStripedCorner3,
|
||||
ThinStripedCorner4,
|
||||
StripedCorner,
|
||||
StripedCorner2,
|
||||
StripedCorner3,
|
||||
StripedCorner4,
|
||||
OrnateStripedCorner,
|
||||
OrnateStripedCorner2,
|
||||
OrnateStripedCorner3,
|
||||
OrnateStripedCorner4,
|
||||
Emblem1,
|
||||
Emblem2,
|
||||
Emblem3,
|
||||
Emblem4,
|
||||
Emblem5,
|
||||
LetterA,
|
||||
LetterA2,
|
||||
LetterA3,
|
||||
LetterA4,
|
||||
LetterB,
|
||||
LetterB2,
|
||||
LetterB3,
|
||||
LetterB4,
|
||||
LetterF,
|
||||
LetterF2,
|
||||
LetterF3,
|
||||
LetterF4,
|
||||
LetterS,
|
||||
LetterS2,
|
||||
LetterS3,
|
||||
LetterS4,
|
||||
LetterT,
|
||||
LetterT2,
|
||||
LetterT3,
|
||||
LetterT4,
|
||||
DiagonalHalved,
|
||||
DiagonalHalved2,
|
||||
Diagonal1Edged,
|
||||
Diagonal1Edged2,
|
||||
Diagonal1Edged3,
|
||||
Diagonal1Edged4,
|
||||
Diagonal2Edged,
|
||||
Diagonal2Edged2,
|
||||
ThickDiagonal1Edged,
|
||||
ThickDiagonal1Edged2,
|
||||
ThickDiagonal1Edged3,
|
||||
ThickDiagonal1Edged4,
|
||||
ThinBarredEnd,
|
||||
ThinBarredEnd2,
|
||||
ThinBarredEnd3,
|
||||
ThinBarredEnd4,
|
||||
ThickBarredEnd,
|
||||
ThickBarredEnd2,
|
||||
ThickBarredEnd3,
|
||||
ThickBarredEnd4,
|
||||
OverlappedSplitBarred,
|
||||
OverlappedSplitBarred2,
|
||||
OverlappedBarred,
|
||||
OverlappedBarred2;
|
||||
|
||||
static {
|
||||
setupStripedPattern(EnumPattern.ThinStriped, EnumPattern.ThinStriped2);
|
||||
setupStripedPattern(EnumPattern.Striped, EnumPattern.Striped2);
|
||||
setupStripedPattern(EnumPattern.Halved, EnumPattern.Halved2);
|
||||
setupChequeredPattern(EnumPattern.Chequered);
|
||||
setupChequeredPattern(EnumPattern.Tiled);
|
||||
setupCornerPattern(EnumPattern.VeryThinCorner, EnumPattern.VeryThinCorner2, EnumPattern.VeryThinCorner3, EnumPattern.VeryThinCorner4);
|
||||
setupCornerPattern(EnumPattern.ThinCorner, EnumPattern.ThinCorner2, EnumPattern.ThinCorner3, EnumPattern.ThinCorner4);
|
||||
setupCornerPattern(EnumPattern.Corner, EnumPattern.Corner2, EnumPattern.Corner3, EnumPattern.Corner4);
|
||||
setupCornerPattern(EnumPattern.ThickCorner, EnumPattern.ThickCorner2, EnumPattern.ThickCorner3, EnumPattern.ThickCorner4);
|
||||
setupCornerPattern(EnumPattern.ThinCurvedCorner, EnumPattern.ThinCurvedCorner2, EnumPattern.ThinCurvedCorner3, EnumPattern.ThinCurvedCorner4);
|
||||
setupCornerPattern(EnumPattern.CurvedCorner, EnumPattern.CurvedCorner2, EnumPattern.CurvedCorner3, EnumPattern.CurvedCorner4);
|
||||
setupBarredPattern(EnumPattern.BarredEnd, EnumPattern.BarredEnd2, EnumPattern.BarredEnd3, EnumPattern.BarredEnd4);
|
||||
setupEdgedPattern(EnumPattern.ThinEdged, EnumPattern.ThinEdged2, EnumPattern.ThinEdged3, EnumPattern.ThinEdged4);
|
||||
setupEdgedPattern(EnumPattern.Edged, EnumPattern.Edged2, EnumPattern.Edged3, EnumPattern.Edged4);
|
||||
setupBarredPattern(EnumPattern.ThinBarred, EnumPattern.ThinBarred2);
|
||||
setupBarredPattern(EnumPattern.Barred, EnumPattern.Barred2);
|
||||
setupBarredPattern(EnumPattern.ThickBarred, EnumPattern.ThickBarred2);
|
||||
setupDiagonalPattern(EnumPattern.Diagonal, EnumPattern.Diagonal2);
|
||||
setupDiagonalPattern(EnumPattern.ThickDiagonal, EnumPattern.ThickDiagonal2);
|
||||
setupTSectionPattern(EnumPattern.ThinTSection, EnumPattern.ThinTSection2, EnumPattern.ThinTSection3, EnumPattern.ThinTSection4);
|
||||
setupTSectionPattern(EnumPattern.TSection, EnumPattern.TSection2, EnumPattern.TSection3, EnumPattern.TSection4);
|
||||
setupTSectionPattern(EnumPattern.ThickTSection, EnumPattern.ThickTSection2, EnumPattern.ThickTSection3, EnumPattern.ThickTSection4);
|
||||
setupTSectionPattern(EnumPattern.ThinCurvedTSection, EnumPattern.ThinCurvedTSection2, EnumPattern.ThinCurvedTSection3, EnumPattern.ThinCurvedTSection4);
|
||||
setupTSectionPattern(EnumPattern.CurvedTSection, EnumPattern.CurvedTSection2, EnumPattern.CurvedTSection3, EnumPattern.CurvedTSection4);
|
||||
setupCornerPattern(EnumPattern.ThinBarredCorner, EnumPattern.ThinBarredCorner2, EnumPattern.ThinBarredCorner3, EnumPattern.ThinBarredCorner4);
|
||||
setupCornerPattern(EnumPattern.BarredCorner, EnumPattern.BarredCorner2, EnumPattern.BarredCorner3, EnumPattern.BarredCorner4);
|
||||
setupCornerPattern(EnumPattern.ThickBarredCorner, EnumPattern.ThickBarredCorner2, EnumPattern.ThickBarredCorner3, EnumPattern.ThickBarredCorner4);
|
||||
setupCornerPattern(EnumPattern.ThinCurvedBarredCorner, EnumPattern.ThinCurvedBarredCorner2, EnumPattern.ThinCurvedBarredCorner3, EnumPattern.ThinCurvedBarredCorner4);
|
||||
setupCornerPattern(EnumPattern.BarredCurvedCorner, EnumPattern.BarredCurvedCorner2, EnumPattern.BarredCurvedCorner3, EnumPattern.BarredCurvedCorner4);
|
||||
setupCornerPattern(EnumPattern.ThinStripedCorner, EnumPattern.ThinStripedCorner2, EnumPattern.ThinStripedCorner3, EnumPattern.ThinStripedCorner4);
|
||||
setupCornerPattern(EnumPattern.StripedCorner, EnumPattern.StripedCorner2, EnumPattern.StripedCorner3, EnumPattern.StripedCorner4);
|
||||
setupCornerPattern(EnumPattern.OrnateStripedCorner, EnumPattern.OrnateStripedCorner2, EnumPattern.OrnateStripedCorner3, EnumPattern.OrnateStripedCorner4);
|
||||
setupRotation(EnumPattern.LetterA, EnumPattern.LetterA2, EnumPattern.LetterA3, EnumPattern.LetterA4);
|
||||
setupRotation(EnumPattern.LetterB, EnumPattern.LetterB2, EnumPattern.LetterB3, EnumPattern.LetterB4);
|
||||
setupRotation(EnumPattern.LetterF, EnumPattern.LetterF2, EnumPattern.LetterF3, EnumPattern.LetterF4);
|
||||
setupRotation(EnumPattern.LetterS, EnumPattern.LetterS2, EnumPattern.LetterS3, EnumPattern.LetterS4);
|
||||
setupRotation(EnumPattern.LetterT, EnumPattern.LetterT2, EnumPattern.LetterT3, EnumPattern.LetterT4);
|
||||
setupEdgedPattern(EnumPattern.DiagonalCorner, EnumPattern.DiagonalCorner2, EnumPattern.DiagonalCorner3, EnumPattern.DiagonalCorner4);
|
||||
setupCornerPattern(EnumPattern.DiagonalTSection, EnumPattern.DiagonalTSection2, EnumPattern.DiagonalTSection3, EnumPattern.DiagonalTSection4);
|
||||
setupEdgedPattern(EnumPattern.DiagonalCurvedCorner, EnumPattern.DiagonalCurvedCorner2, EnumPattern.DiagonalCurvedCorner3, EnumPattern.DiagonalCurvedCorner4);
|
||||
setupCornerPattern(EnumPattern.DiagonalCurvedTSection, EnumPattern.DiagonalCurvedTSection2, EnumPattern.DiagonalCurvedTSection3, EnumPattern.DiagonalCurvedTSection4);
|
||||
setupBarredPattern(EnumPattern.OrnateBarred, EnumPattern.OrnateBarred2);
|
||||
setupBarredPattern(EnumPattern.OrnateThinBarred, EnumPattern.OrnateThinBarred2);
|
||||
setupBarredPattern(EnumPattern.SplitBarred, EnumPattern.SplitBarred2);
|
||||
setupCornerPattern(EnumPattern.SplitBarredCorner, EnumPattern.SplitBarredCorner2, EnumPattern.SplitBarredCorner3, EnumPattern.SplitBarredCorner4);
|
||||
setupTSectionPattern(EnumPattern.SplitBarredTSection, EnumPattern.SplitBarredTSection2, EnumPattern.SplitBarredTSection3, EnumPattern.SplitBarredTSection4);
|
||||
setupBarredPattern(EnumPattern.SplitBarredEnd, EnumPattern.SplitBarredEnd2, EnumPattern.SplitBarredEnd3, EnumPattern.SplitBarredEnd4);
|
||||
setupRotation(EnumPattern.Creeper, EnumPattern.Creeper2, EnumPattern.Creeper3, EnumPattern.Creeper4);
|
||||
setupDiagonalPattern(EnumPattern.DiagonalStriped, EnumPattern.DiagonalStriped2);
|
||||
setupDiagonalPattern(EnumPattern.ThinDiagonalStriped, EnumPattern.ThinDiagonalStriped2);
|
||||
setupCornerPattern(EnumPattern.Diagonal1Edged, EnumPattern.Diagonal1Edged2, EnumPattern.Diagonal1Edged3, EnumPattern.Diagonal1Edged4);
|
||||
setupCornerPattern(EnumPattern.ThickDiagonal1Edged, EnumPattern.ThickDiagonal1Edged2, EnumPattern.ThickDiagonal1Edged3, EnumPattern.ThickDiagonal1Edged4);
|
||||
setupInvert2Rot(EnumPattern.DiagonalHalved, EnumPattern.DiagonalHalved2);
|
||||
set2Rotation(EnumPattern.Diagonal2Edged, EnumPattern.Diagonal2Edged2);
|
||||
setupBarredPattern(EnumPattern.ThinBarredEnd, EnumPattern.ThinBarredEnd2, EnumPattern.ThinBarredEnd3, EnumPattern.ThinBarredEnd4);
|
||||
setupBarredPattern(EnumPattern.ThickBarredEnd, EnumPattern.ThickBarredEnd2, EnumPattern.ThickBarredEnd3, EnumPattern.ThickBarredEnd4);
|
||||
EnumPattern.OverlappedBarred.setLeftRotation(EnumPattern.OverlappedBarred2, false);
|
||||
EnumPattern.OverlappedBarred2.setLeftRotation(EnumPattern.OverlappedBarred, false);
|
||||
EnumPattern.OverlappedSplitBarred.setLeftRotation(EnumPattern.OverlappedSplitBarred2, false);
|
||||
EnumPattern.OverlappedSplitBarred2.setLeftRotation(EnumPattern.OverlappedSplitBarred, false);
|
||||
}
|
||||
static {
|
||||
setupStripedPattern(EnumPattern.ThinStriped, EnumPattern.ThinStriped2);
|
||||
setupStripedPattern(EnumPattern.Striped, EnumPattern.Striped2);
|
||||
setupStripedPattern(EnumPattern.Halved, EnumPattern.Halved2);
|
||||
setupChequeredPattern(EnumPattern.Chequered);
|
||||
setupChequeredPattern(EnumPattern.Tiled);
|
||||
setupCornerPattern(
|
||||
EnumPattern.VeryThinCorner,
|
||||
EnumPattern.VeryThinCorner2,
|
||||
EnumPattern.VeryThinCorner3,
|
||||
EnumPattern.VeryThinCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.ThinCorner, EnumPattern.ThinCorner2, EnumPattern.ThinCorner3, EnumPattern.ThinCorner4);
|
||||
setupCornerPattern(EnumPattern.Corner, EnumPattern.Corner2, EnumPattern.Corner3, EnumPattern.Corner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.ThickCorner, EnumPattern.ThickCorner2, EnumPattern.ThickCorner3, EnumPattern.ThickCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.ThinCurvedCorner,
|
||||
EnumPattern.ThinCurvedCorner2,
|
||||
EnumPattern.ThinCurvedCorner3,
|
||||
EnumPattern.ThinCurvedCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.CurvedCorner,
|
||||
EnumPattern.CurvedCorner2,
|
||||
EnumPattern.CurvedCorner3,
|
||||
EnumPattern.CurvedCorner4);
|
||||
setupBarredPattern(
|
||||
EnumPattern.BarredEnd, EnumPattern.BarredEnd2, EnumPattern.BarredEnd3, EnumPattern.BarredEnd4);
|
||||
setupEdgedPattern(
|
||||
EnumPattern.ThinEdged, EnumPattern.ThinEdged2, EnumPattern.ThinEdged3, EnumPattern.ThinEdged4);
|
||||
setupEdgedPattern(EnumPattern.Edged, EnumPattern.Edged2, EnumPattern.Edged3, EnumPattern.Edged4);
|
||||
setupBarredPattern(EnumPattern.ThinBarred, EnumPattern.ThinBarred2);
|
||||
setupBarredPattern(EnumPattern.Barred, EnumPattern.Barred2);
|
||||
setupBarredPattern(EnumPattern.ThickBarred, EnumPattern.ThickBarred2);
|
||||
setupDiagonalPattern(EnumPattern.Diagonal, EnumPattern.Diagonal2);
|
||||
setupDiagonalPattern(EnumPattern.ThickDiagonal, EnumPattern.ThickDiagonal2);
|
||||
setupTSectionPattern(
|
||||
EnumPattern.ThinTSection,
|
||||
EnumPattern.ThinTSection2,
|
||||
EnumPattern.ThinTSection3,
|
||||
EnumPattern.ThinTSection4);
|
||||
setupTSectionPattern(EnumPattern.TSection, EnumPattern.TSection2, EnumPattern.TSection3, EnumPattern.TSection4);
|
||||
setupTSectionPattern(
|
||||
EnumPattern.ThickTSection,
|
||||
EnumPattern.ThickTSection2,
|
||||
EnumPattern.ThickTSection3,
|
||||
EnumPattern.ThickTSection4);
|
||||
setupTSectionPattern(
|
||||
EnumPattern.ThinCurvedTSection,
|
||||
EnumPattern.ThinCurvedTSection2,
|
||||
EnumPattern.ThinCurvedTSection3,
|
||||
EnumPattern.ThinCurvedTSection4);
|
||||
setupTSectionPattern(
|
||||
EnumPattern.CurvedTSection,
|
||||
EnumPattern.CurvedTSection2,
|
||||
EnumPattern.CurvedTSection3,
|
||||
EnumPattern.CurvedTSection4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.ThinBarredCorner,
|
||||
EnumPattern.ThinBarredCorner2,
|
||||
EnumPattern.ThinBarredCorner3,
|
||||
EnumPattern.ThinBarredCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.BarredCorner,
|
||||
EnumPattern.BarredCorner2,
|
||||
EnumPattern.BarredCorner3,
|
||||
EnumPattern.BarredCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.ThickBarredCorner,
|
||||
EnumPattern.ThickBarredCorner2,
|
||||
EnumPattern.ThickBarredCorner3,
|
||||
EnumPattern.ThickBarredCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.ThinCurvedBarredCorner,
|
||||
EnumPattern.ThinCurvedBarredCorner2,
|
||||
EnumPattern.ThinCurvedBarredCorner3,
|
||||
EnumPattern.ThinCurvedBarredCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.BarredCurvedCorner,
|
||||
EnumPattern.BarredCurvedCorner2,
|
||||
EnumPattern.BarredCurvedCorner3,
|
||||
EnumPattern.BarredCurvedCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.ThinStripedCorner,
|
||||
EnumPattern.ThinStripedCorner2,
|
||||
EnumPattern.ThinStripedCorner3,
|
||||
EnumPattern.ThinStripedCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.StripedCorner,
|
||||
EnumPattern.StripedCorner2,
|
||||
EnumPattern.StripedCorner3,
|
||||
EnumPattern.StripedCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.OrnateStripedCorner,
|
||||
EnumPattern.OrnateStripedCorner2,
|
||||
EnumPattern.OrnateStripedCorner3,
|
||||
EnumPattern.OrnateStripedCorner4);
|
||||
setupRotation(EnumPattern.LetterA, EnumPattern.LetterA2, EnumPattern.LetterA3, EnumPattern.LetterA4);
|
||||
setupRotation(EnumPattern.LetterB, EnumPattern.LetterB2, EnumPattern.LetterB3, EnumPattern.LetterB4);
|
||||
setupRotation(EnumPattern.LetterF, EnumPattern.LetterF2, EnumPattern.LetterF3, EnumPattern.LetterF4);
|
||||
setupRotation(EnumPattern.LetterS, EnumPattern.LetterS2, EnumPattern.LetterS3, EnumPattern.LetterS4);
|
||||
setupRotation(EnumPattern.LetterT, EnumPattern.LetterT2, EnumPattern.LetterT3, EnumPattern.LetterT4);
|
||||
setupEdgedPattern(
|
||||
EnumPattern.DiagonalCorner,
|
||||
EnumPattern.DiagonalCorner2,
|
||||
EnumPattern.DiagonalCorner3,
|
||||
EnumPattern.DiagonalCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.DiagonalTSection,
|
||||
EnumPattern.DiagonalTSection2,
|
||||
EnumPattern.DiagonalTSection3,
|
||||
EnumPattern.DiagonalTSection4);
|
||||
setupEdgedPattern(
|
||||
EnumPattern.DiagonalCurvedCorner,
|
||||
EnumPattern.DiagonalCurvedCorner2,
|
||||
EnumPattern.DiagonalCurvedCorner3,
|
||||
EnumPattern.DiagonalCurvedCorner4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.DiagonalCurvedTSection,
|
||||
EnumPattern.DiagonalCurvedTSection2,
|
||||
EnumPattern.DiagonalCurvedTSection3,
|
||||
EnumPattern.DiagonalCurvedTSection4);
|
||||
setupBarredPattern(EnumPattern.OrnateBarred, EnumPattern.OrnateBarred2);
|
||||
setupBarredPattern(EnumPattern.OrnateThinBarred, EnumPattern.OrnateThinBarred2);
|
||||
setupBarredPattern(EnumPattern.SplitBarred, EnumPattern.SplitBarred2);
|
||||
setupCornerPattern(
|
||||
EnumPattern.SplitBarredCorner,
|
||||
EnumPattern.SplitBarredCorner2,
|
||||
EnumPattern.SplitBarredCorner3,
|
||||
EnumPattern.SplitBarredCorner4);
|
||||
setupTSectionPattern(
|
||||
EnumPattern.SplitBarredTSection,
|
||||
EnumPattern.SplitBarredTSection2,
|
||||
EnumPattern.SplitBarredTSection3,
|
||||
EnumPattern.SplitBarredTSection4);
|
||||
setupBarredPattern(
|
||||
EnumPattern.SplitBarredEnd,
|
||||
EnumPattern.SplitBarredEnd2,
|
||||
EnumPattern.SplitBarredEnd3,
|
||||
EnumPattern.SplitBarredEnd4);
|
||||
setupRotation(EnumPattern.Creeper, EnumPattern.Creeper2, EnumPattern.Creeper3, EnumPattern.Creeper4);
|
||||
setupDiagonalPattern(EnumPattern.DiagonalStriped, EnumPattern.DiagonalStriped2);
|
||||
setupDiagonalPattern(EnumPattern.ThinDiagonalStriped, EnumPattern.ThinDiagonalStriped2);
|
||||
setupCornerPattern(
|
||||
EnumPattern.Diagonal1Edged,
|
||||
EnumPattern.Diagonal1Edged2,
|
||||
EnumPattern.Diagonal1Edged3,
|
||||
EnumPattern.Diagonal1Edged4);
|
||||
setupCornerPattern(
|
||||
EnumPattern.ThickDiagonal1Edged,
|
||||
EnumPattern.ThickDiagonal1Edged2,
|
||||
EnumPattern.ThickDiagonal1Edged3,
|
||||
EnumPattern.ThickDiagonal1Edged4);
|
||||
setupInvert2Rot(EnumPattern.DiagonalHalved, EnumPattern.DiagonalHalved2);
|
||||
set2Rotation(EnumPattern.Diagonal2Edged, EnumPattern.Diagonal2Edged2);
|
||||
setupBarredPattern(
|
||||
EnumPattern.ThinBarredEnd,
|
||||
EnumPattern.ThinBarredEnd2,
|
||||
EnumPattern.ThinBarredEnd3,
|
||||
EnumPattern.ThinBarredEnd4);
|
||||
setupBarredPattern(
|
||||
EnumPattern.ThickBarredEnd,
|
||||
EnumPattern.ThickBarredEnd2,
|
||||
EnumPattern.ThickBarredEnd3,
|
||||
EnumPattern.ThickBarredEnd4);
|
||||
EnumPattern.OverlappedBarred.setLeftRotation(EnumPattern.OverlappedBarred2, false);
|
||||
EnumPattern.OverlappedBarred2.setLeftRotation(EnumPattern.OverlappedBarred, false);
|
||||
EnumPattern.OverlappedSplitBarred.setLeftRotation(EnumPattern.OverlappedSplitBarred2, false);
|
||||
EnumPattern.OverlappedSplitBarred2.setLeftRotation(EnumPattern.OverlappedSplitBarred, false);
|
||||
}
|
||||
|
||||
protected ILayout leftRotation;
|
||||
protected ILayout horizontalFlip;
|
||||
protected ILayout leftRotation;
|
||||
protected ILayout horizontalFlip;
|
||||
|
||||
EnumPattern() {
|
||||
leftRotation = Layout.get(this, false);
|
||||
horizontalFlip = Layout.get(this, false);
|
||||
}
|
||||
EnumPattern() {
|
||||
leftRotation = Layout.get(this, false);
|
||||
horizontalFlip = Layout.get(this, false);
|
||||
}
|
||||
|
||||
static void setupStripedPattern(EnumPattern vert, EnumPattern hori) {
|
||||
vert.setLeftRotation(hori, true);
|
||||
hori.setLeftRotation(vert, false);
|
||||
vert.setHorizontalFlip(vert, true);
|
||||
}
|
||||
static void setupStripedPattern(EnumPattern vert, EnumPattern hori) {
|
||||
vert.setLeftRotation(hori, true);
|
||||
hori.setLeftRotation(vert, false);
|
||||
vert.setHorizontalFlip(vert, true);
|
||||
}
|
||||
|
||||
static void setupChequeredPattern(EnumPattern cheq) {
|
||||
cheq.setLeftRotation(cheq, true);
|
||||
cheq.setHorizontalFlip(cheq, true);
|
||||
}
|
||||
static void setupChequeredPattern(EnumPattern cheq) {
|
||||
cheq.setLeftRotation(cheq, true);
|
||||
cheq.setHorizontalFlip(cheq, true);
|
||||
}
|
||||
|
||||
static void setupCornerPattern(EnumPattern tl, EnumPattern tr, EnumPattern br, EnumPattern bl) {
|
||||
tl.setLeftRotation(bl, false);
|
||||
tr.setLeftRotation(tl, false);
|
||||
br.setLeftRotation(tr, false);
|
||||
bl.setLeftRotation(br, false);
|
||||
tl.setHorizontalFlip(tr, false);
|
||||
bl.setHorizontalFlip(br, false);
|
||||
}
|
||||
static void setupCornerPattern(EnumPattern tl, EnumPattern tr, EnumPattern br, EnumPattern bl) {
|
||||
tl.setLeftRotation(bl, false);
|
||||
tr.setLeftRotation(tl, false);
|
||||
br.setLeftRotation(tr, false);
|
||||
bl.setLeftRotation(br, false);
|
||||
tl.setHorizontalFlip(tr, false);
|
||||
bl.setHorizontalFlip(br, false);
|
||||
}
|
||||
|
||||
static void setupInvert2Rot(EnumPattern a, EnumPattern b) {
|
||||
a.setLeftRotation(b, true);
|
||||
b.setLeftRotation(a, false);
|
||||
a.setHorizontalFlip(b, false);
|
||||
}
|
||||
static void setupInvert2Rot(EnumPattern a, EnumPattern b) {
|
||||
a.setLeftRotation(b, true);
|
||||
b.setLeftRotation(a, false);
|
||||
a.setHorizontalFlip(b, false);
|
||||
}
|
||||
|
||||
static void set2Rotation(EnumPattern a, EnumPattern b) {
|
||||
a.setLeftRotation(b, false);
|
||||
b.setLeftRotation(a, false);
|
||||
a.setHorizontalFlip(b, false);
|
||||
}
|
||||
static void set2Rotation(EnumPattern a, EnumPattern b) {
|
||||
a.setLeftRotation(b, false);
|
||||
b.setLeftRotation(a, false);
|
||||
a.setHorizontalFlip(b, false);
|
||||
}
|
||||
|
||||
static void setupBarredPattern(EnumPattern vert, EnumPattern hori) {
|
||||
vert.setLeftRotation(hori, false);
|
||||
hori.setLeftRotation(vert, false);
|
||||
}
|
||||
static void setupBarredPattern(EnumPattern vert, EnumPattern hori) {
|
||||
vert.setLeftRotation(hori, false);
|
||||
hori.setLeftRotation(vert, false);
|
||||
}
|
||||
|
||||
static void setupEdgedPattern(EnumPattern l, EnumPattern t, EnumPattern r, EnumPattern b) {
|
||||
l.setLeftRotation(b, false);
|
||||
t.setLeftRotation(l, false);
|
||||
r.setLeftRotation(t, false);
|
||||
b.setLeftRotation(r, false);
|
||||
l.setHorizontalFlip(r, false);
|
||||
}
|
||||
static void setupEdgedPattern(EnumPattern l, EnumPattern t, EnumPattern r, EnumPattern b) {
|
||||
l.setLeftRotation(b, false);
|
||||
t.setLeftRotation(l, false);
|
||||
r.setLeftRotation(t, false);
|
||||
b.setLeftRotation(r, false);
|
||||
l.setHorizontalFlip(r, false);
|
||||
}
|
||||
|
||||
static void setupDiagonalPattern(EnumPattern a, EnumPattern b) {
|
||||
a.setLeftRotation(b, false);
|
||||
b.setLeftRotation(a, false);
|
||||
a.setHorizontalFlip(b, false);
|
||||
}
|
||||
static void setupDiagonalPattern(EnumPattern a, EnumPattern b) {
|
||||
a.setLeftRotation(b, false);
|
||||
b.setLeftRotation(a, false);
|
||||
a.setHorizontalFlip(b, false);
|
||||
}
|
||||
|
||||
static void setupBarredPattern(EnumPattern l, EnumPattern t, EnumPattern r, EnumPattern b) {
|
||||
l.setLeftRotation(b, false);
|
||||
t.setLeftRotation(l, false);
|
||||
r.setLeftRotation(t, false);
|
||||
b.setLeftRotation(r, false);
|
||||
l.setHorizontalFlip(r, false);
|
||||
}
|
||||
static void setupBarredPattern(EnumPattern l, EnumPattern t, EnumPattern r, EnumPattern b) {
|
||||
l.setLeftRotation(b, false);
|
||||
t.setLeftRotation(l, false);
|
||||
r.setLeftRotation(t, false);
|
||||
b.setLeftRotation(r, false);
|
||||
l.setHorizontalFlip(r, false);
|
||||
}
|
||||
|
||||
static void setupTSectionPattern(EnumPattern l, EnumPattern t, EnumPattern r, EnumPattern b) {
|
||||
setupEdgedPattern(l, t, r, b);
|
||||
}
|
||||
static void setupTSectionPattern(EnumPattern l, EnumPattern t, EnumPattern r, EnumPattern b) {
|
||||
setupEdgedPattern(l, t, r, b);
|
||||
}
|
||||
|
||||
private static void setupRotation(EnumPattern t, EnumPattern r, EnumPattern b, EnumPattern l) {
|
||||
setupEdgedPattern(l, t, r, b);
|
||||
}
|
||||
private static void setupRotation(EnumPattern t, EnumPattern r, EnumPattern b, EnumPattern l) {
|
||||
setupEdgedPattern(l, t, r, b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getPrimaryIcon(IDesignSystem system) {
|
||||
return system.getPrimaryIcon(this);
|
||||
}
|
||||
@Override
|
||||
public IIcon getPrimaryIcon(IDesignSystem system) {
|
||||
return system.getPrimaryIcon(this);
|
||||
}
|
||||
|
||||
private void setHorizontalFlip(EnumPattern pattern, boolean inverted) {
|
||||
horizontalFlip = Layout.get(pattern, inverted);
|
||||
pattern.horizontalFlip = Layout.get(this, inverted);
|
||||
}
|
||||
private void setHorizontalFlip(EnumPattern pattern, boolean inverted) {
|
||||
horizontalFlip = Layout.get(pattern, inverted);
|
||||
pattern.horizontalFlip = Layout.get(this, inverted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getSecondaryIcon(IDesignSystem system) {
|
||||
return system.getSecondaryIcon(this);
|
||||
}
|
||||
@Override
|
||||
public IIcon getSecondaryIcon(IDesignSystem system) {
|
||||
return system.getSecondaryIcon(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout getRotation() {
|
||||
return leftRotation;
|
||||
}
|
||||
@Override
|
||||
public ILayout getRotation() {
|
||||
return leftRotation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout getHorizontalFlip() {
|
||||
return horizontalFlip;
|
||||
}
|
||||
@Override
|
||||
public ILayout getHorizontalFlip() {
|
||||
return horizontalFlip;
|
||||
}
|
||||
|
||||
protected void setLeftRotation(EnumPattern pattern, boolean inverted) {
|
||||
leftRotation = Layout.get(pattern, inverted);
|
||||
}
|
||||
protected void setLeftRotation(EnumPattern pattern, boolean inverted) {
|
||||
leftRotation = Layout.get(pattern, inverted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
}
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {}
|
||||
|
||||
public ILayout layout() {
|
||||
return layout(false);
|
||||
}
|
||||
public ILayout layout() {
|
||||
return layout(false);
|
||||
}
|
||||
|
||||
public ILayout layout(boolean invert) {
|
||||
return Layout.get(this, invert);
|
||||
}
|
||||
public ILayout layout(boolean invert) {
|
||||
return Layout.get(this, invert);
|
||||
}
|
||||
}
|
||||
@@ -4,102 +4,102 @@ import binnie.botany.Botany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class GlassType implements IDesignMaterial {
|
||||
protected static Map<Integer, GlassType> types = new LinkedHashMap<>();
|
||||
protected static Map<Integer, GlassType> types = new LinkedHashMap<>();
|
||||
|
||||
static {
|
||||
for (StandardColor c : StandardColor.values()) {
|
||||
GlassType.types.put(c.ordinal(), new GlassType(c.ordinal(), c.name, c.color));
|
||||
}
|
||||
for (EnumFlowerColor c2 : EnumFlowerColor.values()) {
|
||||
GlassType.types.put(128 + c2.ordinal(), new GlassType(128 + c2.ordinal(), c2.getName(), c2.getColor(false)));
|
||||
}
|
||||
}
|
||||
static {
|
||||
for (StandardColor c : StandardColor.values()) {
|
||||
GlassType.types.put(c.ordinal(), new GlassType(c.ordinal(), c.name, c.color));
|
||||
}
|
||||
for (EnumFlowerColor c2 : EnumFlowerColor.values()) {
|
||||
GlassType.types.put(
|
||||
128 + c2.ordinal(), new GlassType(128 + c2.ordinal(), c2.getName(), c2.getColor(false)));
|
||||
}
|
||||
}
|
||||
|
||||
protected String name;
|
||||
protected int color;
|
||||
protected int id;
|
||||
protected String name;
|
||||
protected int color;
|
||||
protected int id;
|
||||
|
||||
private GlassType(int id, String name, int color) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
}
|
||||
private GlassType(int id, String name, int color) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public static int getIndex(IDesignMaterial id) {
|
||||
for (Map.Entry<Integer, GlassType> entry : GlassType.types.entrySet()) {
|
||||
if (entry.getValue() == id) {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public static int getIndex(IDesignMaterial id) {
|
||||
for (Map.Entry<Integer, GlassType> entry : GlassType.types.entrySet()) {
|
||||
if (entry.getValue() == id) {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static IDesignMaterial get(int id) {
|
||||
return GlassType.types.get(id);
|
||||
}
|
||||
public static IDesignMaterial get(int id) {
|
||||
return GlassType.types.get(id);
|
||||
}
|
||||
|
||||
public static IDesignMaterial get(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
for (Map.Entry<Integer, GlassType> entry : GlassType.types.entrySet()) {
|
||||
if (stack.isItemEqual(entry.getValue().getStack())) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static IDesignMaterial get(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
for (Map.Entry<Integer, GlassType> entry : GlassType.types.entrySet()) {
|
||||
if (stack.isItemEqual(entry.getValue().getStack())) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
if (id < 128) {
|
||||
return new ItemStack(Blocks.stained_glass, 1, id);
|
||||
}
|
||||
return TileEntityMetadata.getItemStack(Botany.stained, id - 128);
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
if (id < 128) {
|
||||
return new ItemStack(Blocks.stained_glass, 1, id);
|
||||
}
|
||||
return TileEntityMetadata.getItemStack(Botany.stained, id - 128);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
@Override
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
private enum StandardColor {
|
||||
White("White", new Color(0xffffff)),
|
||||
Orange("Orange", new Color(0xd87f33)),
|
||||
Magenta("Magenta", new Color(0xb24cd8)),
|
||||
LightBlue("Light Blue", new Color(0x6699d8)),
|
||||
Yellow("Yellow", new Color(0xe5e533)),
|
||||
Lime("Lime", new Color(0x7fcc19)),
|
||||
Pink("Pink", new Color(0xf27fa5)),
|
||||
Gray("Gray", new Color(0x4c4c4c)),
|
||||
LightGray("Light Gray", new Color(0x999999)),
|
||||
Cyan("Cyan", new Color(0x4c7f99)),
|
||||
Purple("Purple", new Color(0x7f3fb2)),
|
||||
Blue("Blue", new Color(0x334cb2)),
|
||||
Brown("Brown", new Color(0x664c33)),
|
||||
Green("Green", new Color(0x667f33)),
|
||||
Red("Red", new Color(0x993333)),
|
||||
Black("Black", new Color(0x191919));
|
||||
private enum StandardColor {
|
||||
White("White", new Color(0xffffff)),
|
||||
Orange("Orange", new Color(0xd87f33)),
|
||||
Magenta("Magenta", new Color(0xb24cd8)),
|
||||
LightBlue("Light Blue", new Color(0x6699d8)),
|
||||
Yellow("Yellow", new Color(0xe5e533)),
|
||||
Lime("Lime", new Color(0x7fcc19)),
|
||||
Pink("Pink", new Color(0xf27fa5)),
|
||||
Gray("Gray", new Color(0x4c4c4c)),
|
||||
LightGray("Light Gray", new Color(0x999999)),
|
||||
Cyan("Cyan", new Color(0x4c7f99)),
|
||||
Purple("Purple", new Color(0x7f3fb2)),
|
||||
Blue("Blue", new Color(0x334cb2)),
|
||||
Brown("Brown", new Color(0x664c33)),
|
||||
Green("Green", new Color(0x667f33)),
|
||||
Red("Red", new Color(0x993333)),
|
||||
Black("Black", new Color(0x191919));
|
||||
|
||||
protected String name;
|
||||
protected int color;
|
||||
protected String name;
|
||||
protected int color;
|
||||
|
||||
StandardColor(String name, Color color) {
|
||||
this.name = name;
|
||||
this.color = color.getRGB();
|
||||
}
|
||||
}
|
||||
StandardColor(String name, Color color) {
|
||||
this.name = name;
|
||||
this.color = color.getRGB();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,72 +6,72 @@ import binnie.extratrees.api.IPattern;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class Layout implements ILayout {
|
||||
protected IPattern pattern;
|
||||
protected boolean inverted;
|
||||
protected IPattern pattern;
|
||||
protected boolean inverted;
|
||||
|
||||
private Layout(IPattern pattern, boolean inverted) {
|
||||
this.pattern = pattern;
|
||||
this.inverted = inverted;
|
||||
}
|
||||
private Layout(IPattern pattern, boolean inverted) {
|
||||
this.pattern = pattern;
|
||||
this.inverted = inverted;
|
||||
}
|
||||
|
||||
private Layout(IPattern pattern) {
|
||||
this(pattern, false);
|
||||
}
|
||||
private Layout(IPattern pattern) {
|
||||
this(pattern, false);
|
||||
}
|
||||
|
||||
public static ILayout get(IPattern pattern, boolean inverted) {
|
||||
return new Layout(pattern, inverted);
|
||||
}
|
||||
public static ILayout get(IPattern pattern, boolean inverted) {
|
||||
return new Layout(pattern, inverted);
|
||||
}
|
||||
|
||||
public static ILayout get(IPattern pattern) {
|
||||
return new Layout(pattern, false);
|
||||
}
|
||||
public static ILayout get(IPattern pattern) {
|
||||
return new Layout(pattern, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPattern getPattern() {
|
||||
return pattern;
|
||||
}
|
||||
@Override
|
||||
public IPattern getPattern() {
|
||||
return pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInverted() {
|
||||
return inverted;
|
||||
}
|
||||
@Override
|
||||
public boolean isInverted() {
|
||||
return inverted;
|
||||
}
|
||||
|
||||
ILayout newLayout(ILayout newLayout) {
|
||||
return new Layout(newLayout.getPattern(), inverted ^ newLayout.isInverted());
|
||||
}
|
||||
ILayout newLayout(ILayout newLayout) {
|
||||
return new Layout(newLayout.getPattern(), inverted ^ newLayout.isInverted());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout rotateRight() {
|
||||
return rotateLeft().rotateLeft().rotateLeft();
|
||||
}
|
||||
@Override
|
||||
public ILayout rotateRight() {
|
||||
return rotateLeft().rotateLeft().rotateLeft();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout rotateLeft() {
|
||||
return newLayout(pattern.getRotation());
|
||||
}
|
||||
@Override
|
||||
public ILayout rotateLeft() {
|
||||
return newLayout(pattern.getRotation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout flipHorizontal() {
|
||||
return newLayout(pattern.getHorizontalFlip());
|
||||
}
|
||||
@Override
|
||||
public ILayout flipHorizontal() {
|
||||
return newLayout(pattern.getHorizontalFlip());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout flipVertical() {
|
||||
return newLayout(pattern.getHorizontalFlip().rotateLeft().rotateLeft());
|
||||
}
|
||||
@Override
|
||||
public ILayout flipVertical() {
|
||||
return newLayout(pattern.getHorizontalFlip().rotateLeft().rotateLeft());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getPrimaryIcon(IDesignSystem system) {
|
||||
return inverted ? pattern.getSecondaryIcon(system) : pattern.getPrimaryIcon(system);
|
||||
}
|
||||
@Override
|
||||
public IIcon getPrimaryIcon(IDesignSystem system) {
|
||||
return inverted ? pattern.getSecondaryIcon(system) : pattern.getPrimaryIcon(system);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getSecondaryIcon(IDesignSystem system) {
|
||||
return inverted ? pattern.getPrimaryIcon(system) : pattern.getSecondaryIcon(system);
|
||||
}
|
||||
@Override
|
||||
public IIcon getSecondaryIcon(IDesignSystem system) {
|
||||
return inverted ? pattern.getPrimaryIcon(system) : pattern.getSecondaryIcon(system);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILayout invert() {
|
||||
return new Layout(pattern, !inverted);
|
||||
}
|
||||
@Override
|
||||
public ILayout invert() {
|
||||
return new Layout(pattern, !inverted);
|
||||
}
|
||||
}
|
||||
@@ -17,83 +17,92 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ModuleCarpentry implements IInitializable {
|
||||
static {
|
||||
CarpentryManager.carpentryInterface = new CarpentryInterface();
|
||||
}
|
||||
static {
|
||||
CarpentryManager.carpentryInterface = new CarpentryInterface();
|
||||
}
|
||||
|
||||
public static ItemStack getItemStack(BlockDesign block, IDesignMaterial type1, IDesignMaterial type2, IDesign design) {
|
||||
return getItemStack(block, block.getDesignSystem().getMaterialIndex(type1), block.getDesignSystem().getMaterialIndex(type2), CarpentryManager.carpentryInterface.getDesignIndex(design));
|
||||
}
|
||||
public static ItemStack getItemStack(
|
||||
BlockDesign block, IDesignMaterial type1, IDesignMaterial type2, IDesign design) {
|
||||
return getItemStack(
|
||||
block,
|
||||
block.getDesignSystem().getMaterialIndex(type1),
|
||||
block.getDesignSystem().getMaterialIndex(type2),
|
||||
CarpentryManager.carpentryInterface.getDesignIndex(design));
|
||||
}
|
||||
|
||||
public static ItemStack getItemStack(BlockDesign block, int type1, int type2, int design) {
|
||||
return TileEntityMetadata.getItemStack(block, getMetadata(type1, type2, design, 0, ForgeDirection.UP.ordinal()));
|
||||
}
|
||||
public static ItemStack getItemStack(BlockDesign block, int type1, int type2, int design) {
|
||||
return TileEntityMetadata.getItemStack(
|
||||
block, getMetadata(type1, type2, design, 0, ForgeDirection.UP.ordinal()));
|
||||
}
|
||||
|
||||
public static ItemStack getItemStack(BlockDesign blockC, DesignBlock block) {
|
||||
return getItemStack(blockC, block.getPrimaryMaterial(), block.getSecondaryMaterial(), block.getDesign());
|
||||
}
|
||||
public static ItemStack getItemStack(BlockDesign blockC, DesignBlock block) {
|
||||
return getItemStack(blockC, block.getPrimaryMaterial(), block.getSecondaryMaterial(), block.getDesign());
|
||||
}
|
||||
|
||||
public static int getMetadata(int plank1, int plank2, int design, int rotation, int facing) {
|
||||
return plank1 + (plank2 << 8) + (design << 16) + (rotation << 26) + (facing << 28);
|
||||
}
|
||||
public static int getMetadata(int plank1, int plank2, int design, int rotation, int facing) {
|
||||
return plank1 + (plank2 << 8) + (design << 16) + (rotation << 26) + (facing << 28);
|
||||
}
|
||||
|
||||
public static DesignBlock getDesignBlock(IDesignSystem system, int meta) {
|
||||
int plankID1 = meta & 0xFF;
|
||||
int plankID2 = meta >> 8 & 0xFF;
|
||||
int tile = meta >> 16 & 0x3FF;
|
||||
int rotation = meta >> 26 & 0x3;
|
||||
int axis = meta >> 28 & 0x7;
|
||||
IDesignMaterial type1 = system.getMaterial(plankID1);
|
||||
IDesignMaterial type2 = system.getMaterial(plankID2);
|
||||
IDesign type3 = CarpentryManager.carpentryInterface.getDesign(tile);
|
||||
return new DesignBlock(system, type1, type2, type3, rotation, ForgeDirection.getOrientation(axis));
|
||||
}
|
||||
public static DesignBlock getDesignBlock(IDesignSystem system, int meta) {
|
||||
int plankID1 = meta & 0xFF;
|
||||
int plankID2 = meta >> 8 & 0xFF;
|
||||
int tile = meta >> 16 & 0x3FF;
|
||||
int rotation = meta >> 26 & 0x3;
|
||||
int axis = meta >> 28 & 0x7;
|
||||
IDesignMaterial type1 = system.getMaterial(plankID1);
|
||||
IDesignMaterial type2 = system.getMaterial(plankID2);
|
||||
IDesign type3 = CarpentryManager.carpentryInterface.getDesign(tile);
|
||||
return new DesignBlock(system, type1, type2, type3, rotation, ForgeDirection.getOrientation(axis));
|
||||
}
|
||||
|
||||
public static DesignBlock getCarpentryPanel(IDesignSystem system, int meta) {
|
||||
DesignBlock block = getDesignBlock(system, meta);
|
||||
block.setPanel();
|
||||
return block;
|
||||
}
|
||||
public static DesignBlock getCarpentryPanel(IDesignSystem system, int meta) {
|
||||
DesignBlock block = getDesignBlock(system, meta);
|
||||
block.setPanel();
|
||||
return block;
|
||||
}
|
||||
|
||||
public static int getBlockMetadata(IDesignSystem system, DesignBlock block) {
|
||||
int plank1 = system.getMaterialIndex(block.getPrimaryMaterial());
|
||||
int plank2 = system.getMaterialIndex(block.getSecondaryMaterial());
|
||||
int design = CarpentryManager.carpentryInterface.getDesignIndex(block.getDesign());
|
||||
int rotation = block.getRotation();
|
||||
int facing = block.getFacing().ordinal();
|
||||
return getMetadata(plank1, plank2, design, rotation, facing);
|
||||
}
|
||||
public static int getBlockMetadata(IDesignSystem system, DesignBlock block) {
|
||||
int plank1 = system.getMaterialIndex(block.getPrimaryMaterial());
|
||||
int plank2 = system.getMaterialIndex(block.getSecondaryMaterial());
|
||||
int design = CarpentryManager.carpentryInterface.getDesignIndex(block.getDesign());
|
||||
int rotation = block.getRotation();
|
||||
int facing = block.getFacing().ordinal();
|
||||
return getMetadata(plank1, plank2, design, rotation, facing);
|
||||
}
|
||||
|
||||
public static int getItemMetadata(IDesignSystem system, DesignBlock block) {
|
||||
int plank1 = system.getMaterialIndex(block.getPrimaryMaterial());
|
||||
int plank2 = system.getMaterialIndex(block.getSecondaryMaterial());
|
||||
int design = CarpentryManager.carpentryInterface.getDesignIndex(block.getDesign());
|
||||
return getMetadata(plank1, plank2, design, 0, ForgeDirection.UP.ordinal());
|
||||
}
|
||||
public static int getItemMetadata(IDesignSystem system, DesignBlock block) {
|
||||
int plank1 = system.getMaterialIndex(block.getPrimaryMaterial());
|
||||
int plank2 = system.getMaterialIndex(block.getSecondaryMaterial());
|
||||
int design = CarpentryManager.carpentryInterface.getDesignIndex(block.getDesign());
|
||||
return getMetadata(plank1, plank2, design, 0, ForgeDirection.UP.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraTrees.blockCarpentry = new BlockCarpentry();
|
||||
ExtraTrees.blockPanel = new BlockCarpentryPanel();
|
||||
ExtraTrees.blockStained = new BlockStainedDesign();
|
||||
GameRegistry.registerBlock(ExtraTrees.blockCarpentry, ItemMetadata.class, "carpentry");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockPanel, ItemMetadata.class, "panel");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockStained, ItemMetadata.class, "stainedglass");
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockCarpentry), new MultipassItemRenderer());
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStained), new MultipassItemRenderer());
|
||||
MinecraftForge.EVENT_BUS.register(ExtraTrees.blockCarpentry);
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockPanel), new MultipassItemRenderer());
|
||||
}
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraTrees.blockCarpentry = new BlockCarpentry();
|
||||
ExtraTrees.blockPanel = new BlockCarpentryPanel();
|
||||
ExtraTrees.blockStained = new BlockStainedDesign();
|
||||
GameRegistry.registerBlock(ExtraTrees.blockCarpentry, ItemMetadata.class, "carpentry");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockPanel, ItemMetadata.class, "panel");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockStained, ItemMetadata.class, "stainedglass");
|
||||
BinnieCore.proxy.registerCustomItemRenderer(
|
||||
Item.getItemFromBlock(ExtraTrees.blockCarpentry), new MultipassItemRenderer());
|
||||
BinnieCore.proxy.registerCustomItemRenderer(
|
||||
Item.getItemFromBlock(ExtraTrees.blockStained), new MultipassItemRenderer());
|
||||
MinecraftForge.EVENT_BUS.register(ExtraTrees.blockCarpentry);
|
||||
BinnieCore.proxy.registerCustomItemRenderer(
|
||||
Item.getItemFromBlock(ExtraTrees.blockPanel), new MultipassItemRenderer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void init() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (EnumDesign design : EnumDesign.values()) {
|
||||
CarpentryManager.carpentryInterface.registerDesign(design.ordinal(), design);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (EnumDesign design : EnumDesign.values()) {
|
||||
CarpentryManager.carpentryInterface.registerDesign(design.ordinal(), design);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,9 @@ import binnie.core.mod.config.PropBoolean;
|
||||
|
||||
@ConfigFile(filename = "/config/forestry/extratrees/main.conf")
|
||||
public class ConfigurationMain {
|
||||
@ConfigProperty(
|
||||
key = "lemon.citrus.family",
|
||||
comment = {"Uses reflection to convert the Forestry lemon tree to the Citrus family."}
|
||||
)
|
||||
@PropBoolean
|
||||
public static boolean alterLemon = true;
|
||||
@ConfigProperty(
|
||||
key = "lemon.citrus.family",
|
||||
comment = {"Uses reflection to convert the Forestry lemon tree to the Citrus family."})
|
||||
@PropBoolean
|
||||
public static boolean alterLemon = true;
|
||||
}
|
||||
@@ -7,29 +7,29 @@ import binnie.core.resource.ResourceType;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
|
||||
public enum ExtraTreeTexture implements IBinnieTexture {
|
||||
Gui(ResourceType.GUI, "gui"),
|
||||
Nursery(ResourceType.Tile, "Nursery");
|
||||
Gui(ResourceType.GUI, "gui"),
|
||||
Nursery(ResourceType.Tile, "Nursery");
|
||||
|
||||
public static String carpenterTexture = "extratrees/carpenter_";
|
||||
public static String panelerTexture = "extratrees/paneler_";
|
||||
public static String tileworkerTexture = "extratrees/tileworker_";
|
||||
public static String incubatorTexture = "extratrees/incubator_";
|
||||
public static String lumbermillTexture = "extratrees/sawmill_";
|
||||
public static String pressTexture = "extratrees/press_";
|
||||
public static String distilleryTexture = "extratrees/distillery_";
|
||||
public static String breweryTexture = "extratrees/brewery_";
|
||||
public static String infuserTexture = "extratrees/infuser_";
|
||||
public static String carpenterTexture = "extratrees/carpenter_";
|
||||
public static String panelerTexture = "extratrees/paneler_";
|
||||
public static String tileworkerTexture = "extratrees/tileworker_";
|
||||
public static String incubatorTexture = "extratrees/incubator_";
|
||||
public static String lumbermillTexture = "extratrees/sawmill_";
|
||||
public static String pressTexture = "extratrees/press_";
|
||||
public static String distilleryTexture = "extratrees/distillery_";
|
||||
public static String breweryTexture = "extratrees/brewery_";
|
||||
public static String infuserTexture = "extratrees/infuser_";
|
||||
|
||||
protected String texture;
|
||||
protected ResourceType type;
|
||||
protected String texture;
|
||||
protected ResourceType type;
|
||||
|
||||
ExtraTreeTexture(ResourceType base, String texture) {
|
||||
this.texture = texture;
|
||||
type = base;
|
||||
}
|
||||
ExtraTreeTexture(ResourceType base, String texture) {
|
||||
this.texture = texture;
|
||||
type = base;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BinnieResource getTexture() {
|
||||
return Binnie.Resource.getPNG(ExtraTrees.instance, type, texture);
|
||||
}
|
||||
@Override
|
||||
public BinnieResource getTexture() {
|
||||
return Binnie.Resource.getPNG(ExtraTrees.instance, type, texture);
|
||||
}
|
||||
}
|
||||
@@ -14,47 +14,47 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public enum ExtraTreesGUID implements IBinnieGUID {
|
||||
Database,
|
||||
Woodworker,
|
||||
Lumbermill,
|
||||
DatabaseNEI,
|
||||
Incubator,
|
||||
MothDatabase,
|
||||
MothDatabaseNEI,
|
||||
Infuser,
|
||||
SetSquare;
|
||||
Database,
|
||||
Woodworker,
|
||||
Lumbermill,
|
||||
DatabaseNEI,
|
||||
Incubator,
|
||||
MothDatabase,
|
||||
MothDatabaseNEI,
|
||||
Infuser,
|
||||
SetSquare;
|
||||
|
||||
@Override
|
||||
public Window getWindow(EntityPlayer player, World world, int x, int y, int z, Side side) {
|
||||
Window window = null;
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
IInventory object = null;
|
||||
if (tileEntity instanceof IInventory) {
|
||||
object = (IInventory) tileEntity;
|
||||
}
|
||||
switch (this) {
|
||||
case Database:
|
||||
case DatabaseNEI:
|
||||
window = WindowArboristDatabase.create(player, side, this != ExtraTreesGUID.Database);
|
||||
break;
|
||||
@Override
|
||||
public Window getWindow(EntityPlayer player, World world, int x, int y, int z, Side side) {
|
||||
Window window = null;
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
IInventory object = null;
|
||||
if (tileEntity instanceof IInventory) {
|
||||
object = (IInventory) tileEntity;
|
||||
}
|
||||
switch (this) {
|
||||
case Database:
|
||||
case DatabaseNEI:
|
||||
window = WindowArboristDatabase.create(player, side, this != ExtraTreesGUID.Database);
|
||||
break;
|
||||
|
||||
case Woodworker:
|
||||
window = WindowWoodworker.create(player, object, side);
|
||||
break;
|
||||
case Woodworker:
|
||||
window = WindowWoodworker.create(player, object, side);
|
||||
break;
|
||||
|
||||
case Lumbermill:
|
||||
window = WindowLumbermill.create(player, object, side);
|
||||
break;
|
||||
case Lumbermill:
|
||||
window = WindowLumbermill.create(player, object, side);
|
||||
break;
|
||||
|
||||
case MothDatabase:
|
||||
case MothDatabaseNEI:
|
||||
window = WindowLepidopteristDatabase.create(player, side, this != ExtraTreesGUID.MothDatabase);
|
||||
break;
|
||||
case MothDatabase:
|
||||
case MothDatabaseNEI:
|
||||
window = WindowLepidopteristDatabase.create(player, side, this != ExtraTreesGUID.MothDatabase);
|
||||
break;
|
||||
|
||||
case SetSquare:
|
||||
window = WindowSetSquare.create(player, world, x, y, z, side);
|
||||
break;
|
||||
}
|
||||
return window;
|
||||
}
|
||||
case SetSquare:
|
||||
window = WindowSetSquare.create(player, world, x, y, z, side);
|
||||
break;
|
||||
}
|
||||
return window;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import binnie.extratrees.block.PlankType;
|
||||
import binnie.extratrees.genetics.ExtraTreeFruitGene;
|
||||
import binnie.extratrees.genetics.ExtraTreeSpecies;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
@@ -19,132 +18,135 @@ import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
|
||||
public class ModuleCore implements IInitializable {
|
||||
@Override
|
||||
public void preInit() {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void preInit() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void init() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
if (!BinnieCore.proxy.isDebug()) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void postInit() {
|
||||
if (!BinnieCore.proxy.isDebug()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
PrintWriter outputSpecies = new PrintWriter(new FileWriter("data/species.html"));
|
||||
PrintWriter outputLogs = new PrintWriter(new FileWriter("data/logs.html"));
|
||||
PrintWriter outputPlanks = new PrintWriter(new FileWriter("data/planks.html"));
|
||||
PrintWriter outputFruit = new PrintWriter(new FileWriter("data/fruit.html"));
|
||||
PrintWriter outputDesigns = new PrintWriter(new FileWriter("data/designs.html"));
|
||||
Queue<IAlleleTreeSpecies> speciesQueue = new LinkedList<>();
|
||||
Collections.addAll(speciesQueue, ExtraTreeSpecies.values());
|
||||
try {
|
||||
PrintWriter outputSpecies = new PrintWriter(new FileWriter("data/species.html"));
|
||||
PrintWriter outputLogs = new PrintWriter(new FileWriter("data/logs.html"));
|
||||
PrintWriter outputPlanks = new PrintWriter(new FileWriter("data/planks.html"));
|
||||
PrintWriter outputFruit = new PrintWriter(new FileWriter("data/fruit.html"));
|
||||
PrintWriter outputDesigns = new PrintWriter(new FileWriter("data/designs.html"));
|
||||
Queue<IAlleleTreeSpecies> speciesQueue = new LinkedList<>();
|
||||
Collections.addAll(speciesQueue, ExtraTreeSpecies.values());
|
||||
|
||||
Queue<ILogType> logQueue = new LinkedList<>();
|
||||
Collections.addAll(logQueue, ILogType.ExtraTreeLog.values());
|
||||
Queue<ILogType> logQueue = new LinkedList<>();
|
||||
Collections.addAll(logQueue, ILogType.ExtraTreeLog.values());
|
||||
|
||||
Queue<IDesignMaterial> plankQueue = new LinkedList<>();
|
||||
Collections.addAll(plankQueue, PlankType.ExtraTreePlanks.values());
|
||||
Queue<IDesignMaterial> plankQueue = new LinkedList<>();
|
||||
Collections.addAll(plankQueue, PlankType.ExtraTreePlanks.values());
|
||||
|
||||
Queue<ExtraTreeFruitGene> fruitQueue = new LinkedList<>();
|
||||
Collections.addAll(fruitQueue, ExtraTreeFruitGene.values());
|
||||
Queue<ExtraTreeFruitGene> fruitQueue = new LinkedList<>();
|
||||
Collections.addAll(fruitQueue, ExtraTreeFruitGene.values());
|
||||
|
||||
Queue<IDesign> designQueue = new LinkedList<>();
|
||||
designQueue.addAll(CarpentryManager.carpentryInterface.getSortedDesigns());
|
||||
Queue<IDesign> designQueue = new LinkedList<>();
|
||||
designQueue.addAll(CarpentryManager.carpentryInterface.getSortedDesigns());
|
||||
|
||||
fruitQueue.remove(ExtraTreeFruitGene.Apple);
|
||||
outputSpecies.println("<table style=\"width: 100%;\">");
|
||||
while (!speciesQueue.isEmpty()) {
|
||||
outputSpecies.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
IAlleleTreeSpecies species = speciesQueue.poll();
|
||||
outputSpecies.println("<td>" + ((species == null) ? "" : species.getName()) + "</td>");
|
||||
}
|
||||
outputSpecies.println("</tr>");
|
||||
}
|
||||
fruitQueue.remove(ExtraTreeFruitGene.Apple);
|
||||
outputSpecies.println("<table style=\"width: 100%;\">");
|
||||
while (!speciesQueue.isEmpty()) {
|
||||
outputSpecies.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
IAlleleTreeSpecies species = speciesQueue.poll();
|
||||
outputSpecies.println("<td>" + ((species == null) ? "" : species.getName()) + "</td>");
|
||||
}
|
||||
outputSpecies.println("</tr>");
|
||||
}
|
||||
|
||||
outputSpecies.println("</table>");
|
||||
outputLogs.println("<table style=\"width: 100%;\">");
|
||||
outputSpecies.println("</table>");
|
||||
outputLogs.println("<table style=\"width: 100%;\">");
|
||||
|
||||
while (!logQueue.isEmpty()) {
|
||||
outputLogs.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
ILogType.ExtraTreeLog wood5 = (ILogType.ExtraTreeLog) logQueue.poll();
|
||||
if (wood5 == null) {
|
||||
outputLogs.println("<td></td>");
|
||||
} else {
|
||||
String img = "<img alt=\"" + wood5.getName() + "\" src=\"images/logs/" + wood5.toString().toLowerCase() + "Bark.png\">";
|
||||
outputLogs.println("<td>" + img + " " + wood5.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputLogs.println("</tr>");
|
||||
}
|
||||
while (!logQueue.isEmpty()) {
|
||||
outputLogs.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
ILogType.ExtraTreeLog wood5 = (ILogType.ExtraTreeLog) logQueue.poll();
|
||||
if (wood5 == null) {
|
||||
outputLogs.println("<td></td>");
|
||||
} else {
|
||||
String img = "<img alt=\"" + wood5.getName() + "\" src=\"images/logs/"
|
||||
+ wood5.toString().toLowerCase() + "Bark.png\">";
|
||||
outputLogs.println("<td>" + img + " " + wood5.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputLogs.println("</tr>");
|
||||
}
|
||||
|
||||
outputLogs.println("</table>");
|
||||
outputPlanks.println("<table style=\"width: 100%;\">");
|
||||
outputLogs.println("</table>");
|
||||
outputPlanks.println("<table style=\"width: 100%;\">");
|
||||
|
||||
while (!plankQueue.isEmpty()) {
|
||||
outputPlanks.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
IDesignMaterial wood2 = plankQueue.poll();
|
||||
if (wood2 == null) {
|
||||
outputPlanks.println("<td></td>");
|
||||
} else {
|
||||
String img = "<img alt=\"" + wood2.getName() + "\" src=\"images/planks/" + wood2.getName() + ".png\">";
|
||||
outputPlanks.println("<td>" + img + " " + wood2.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputPlanks.println("</tr>");
|
||||
}
|
||||
while (!plankQueue.isEmpty()) {
|
||||
outputPlanks.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
IDesignMaterial wood2 = plankQueue.poll();
|
||||
if (wood2 == null) {
|
||||
outputPlanks.println("<td></td>");
|
||||
} else {
|
||||
String img = "<img alt=\"" + wood2.getName() + "\" src=\"images/planks/" + wood2.getName()
|
||||
+ ".png\">";
|
||||
outputPlanks.println("<td>" + img + " " + wood2.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputPlanks.println("</tr>");
|
||||
}
|
||||
|
||||
outputPlanks.println("</table>");
|
||||
outputFruit.println("<table style=\"width: 100%;\">");
|
||||
outputPlanks.println("</table>");
|
||||
outputFruit.println("<table style=\"width: 100%;\">");
|
||||
|
||||
while (!fruitQueue.isEmpty()) {
|
||||
outputFruit.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
ExtraTreeFruitGene wood6 = fruitQueue.poll();
|
||||
if (wood6 == null) {
|
||||
outputFruit.println("<td></td>");
|
||||
} else {
|
||||
String fruit = wood6.getNameOfFruit();
|
||||
String img2 = "<img alt=\"" + wood6.getName() + "\" src=\"images/fruits/" + fruit + ".png\">";
|
||||
outputFruit.println("<td>" + img2 + " " + wood6.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputFruit.println("</tr>");
|
||||
}
|
||||
while (!fruitQueue.isEmpty()) {
|
||||
outputFruit.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
ExtraTreeFruitGene wood6 = fruitQueue.poll();
|
||||
if (wood6 == null) {
|
||||
outputFruit.println("<td></td>");
|
||||
} else {
|
||||
String fruit = wood6.getNameOfFruit();
|
||||
String img2 = "<img alt=\"" + wood6.getName() + "\" src=\"images/fruits/" + fruit + ".png\">";
|
||||
outputFruit.println("<td>" + img2 + " " + wood6.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputFruit.println("</tr>");
|
||||
}
|
||||
|
||||
outputFruit.println("</table>");
|
||||
outputDesigns.println("<table style=\"width: 100%;\">");
|
||||
outputFruit.println("</table>");
|
||||
outputDesigns.println("<table style=\"width: 100%;\">");
|
||||
|
||||
while (!designQueue.isEmpty()) {
|
||||
outputDesigns.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
IDesign wood4 = designQueue.poll();
|
||||
if (wood4 == null) {
|
||||
outputDesigns.println("<td></td>");
|
||||
} else {
|
||||
String texture = wood4.getTopPattern().getPattern().toString().toLowerCase();
|
||||
String img2 = "<img alt=\"" + texture + "\" src=\"images/pattern/" + texture + ".png\">";
|
||||
outputDesigns.println("<td>" + img2 + " " + wood4.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputDesigns.println("</tr>");
|
||||
}
|
||||
while (!designQueue.isEmpty()) {
|
||||
outputDesigns.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
IDesign wood4 = designQueue.poll();
|
||||
if (wood4 == null) {
|
||||
outputDesigns.println("<td></td>");
|
||||
} else {
|
||||
String texture =
|
||||
wood4.getTopPattern().getPattern().toString().toLowerCase();
|
||||
String img2 = "<img alt=\"" + texture + "\" src=\"images/pattern/" + texture + ".png\">";
|
||||
outputDesigns.println("<td>" + img2 + " " + wood4.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputDesigns.println("</tr>");
|
||||
}
|
||||
|
||||
outputDesigns.println("</table>");
|
||||
outputSpecies.close();
|
||||
outputLogs.close();
|
||||
outputPlanks.close();
|
||||
outputFruit.close();
|
||||
outputDesigns.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
outputDesigns.println("</table>");
|
||||
outputSpecies.close();
|
||||
outputLogs.close();
|
||||
outputPlanks.close();
|
||||
outputFruit.close();
|
||||
outputDesigns.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,15 +7,15 @@ import binnie.core.craftgui.geometry.IPoint;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class ControlBlockIconDisplay extends Control {
|
||||
protected IIcon icon;
|
||||
protected IIcon icon;
|
||||
|
||||
public ControlBlockIconDisplay(IWidget parent, float x, float y, IIcon icon) {
|
||||
super(parent, x, y, 18.0f, 18.0f);
|
||||
this.icon = icon;
|
||||
}
|
||||
public ControlBlockIconDisplay(IWidget parent, float x, float y, IIcon icon) {
|
||||
super(parent, x, y, 18.0f, 18.0f);
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.render.iconBlock(IPoint.ZERO, icon);
|
||||
}
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.render.iconBlock(IPoint.ZERO, icon);
|
||||
}
|
||||
}
|
||||
@@ -13,76 +13,76 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ControlFluidDisplay extends Control implements ITooltip {
|
||||
public boolean hasTooltip;
|
||||
public boolean hasTooltip;
|
||||
|
||||
protected FluidStack itemStack;
|
||||
protected FluidStack itemStack;
|
||||
|
||||
public ControlFluidDisplay(IWidget parent, float f, float y) {
|
||||
this(parent, f, y, 16.0f);
|
||||
}
|
||||
public ControlFluidDisplay(IWidget parent, float f, float y) {
|
||||
this(parent, f, y, 16.0f);
|
||||
}
|
||||
|
||||
public ControlFluidDisplay(IWidget parent, float f, float y, FluidStack stack, boolean tooltip) {
|
||||
this(parent, f, y, 16.0f);
|
||||
setItemStack(stack);
|
||||
if (tooltip) {
|
||||
setTooltip();
|
||||
}
|
||||
}
|
||||
public ControlFluidDisplay(IWidget parent, float f, float y, FluidStack stack, boolean tooltip) {
|
||||
this(parent, f, y, 16.0f);
|
||||
setItemStack(stack);
|
||||
if (tooltip) {
|
||||
setTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
public ControlFluidDisplay(IWidget parent, float x, float y, float size) {
|
||||
super(parent, x, y, size, size);
|
||||
itemStack = null;
|
||||
hasTooltip = false;
|
||||
}
|
||||
public ControlFluidDisplay(IWidget parent, float x, float y, float size) {
|
||||
super(parent, x, y, size, size);
|
||||
itemStack = null;
|
||||
hasTooltip = false;
|
||||
}
|
||||
|
||||
public void setTooltip() {
|
||||
hasTooltip = true;
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
public void setTooltip() {
|
||||
hasTooltip = true;
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
if (itemStack == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
if (itemStack == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IPoint relativeToWindow = getAbsolutePosition().sub(getSuperParent().getPosition());
|
||||
if (relativeToWindow.x() > Window.get(this).getSize().x() + 100.0f
|
||||
|| relativeToWindow.y() > Window.get(this).getSize().y() + 100.0f
|
||||
|| itemStack == null) {
|
||||
return;
|
||||
}
|
||||
IPoint relativeToWindow = getAbsolutePosition().sub(getSuperParent().getPosition());
|
||||
if (relativeToWindow.x() > Window.get(this).getSize().x() + 100.0f
|
||||
|| relativeToWindow.y() > Window.get(this).getSize().y() + 100.0f
|
||||
|| itemStack == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Fluid fluid = itemStack.getFluid();
|
||||
int hex = fluid.getColor(itemStack);
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Fluid fluid = itemStack.getFluid();
|
||||
int hex = fluid.getColor(itemStack);
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
if (getSize().x() != 16.0f) {
|
||||
GL11.glPushMatrix();
|
||||
float scale = getSize().x() / 16.0f;
|
||||
GL11.glScalef(scale, scale, 1.0f);
|
||||
CraftGUI.render.iconBlock(IPoint.ZERO, itemStack.getFluid().getIcon(itemStack));
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
CraftGUI.render.iconBlock(IPoint.ZERO, itemStack.getFluid().getIcon(itemStack));
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1, 1, 1, 1.0f);
|
||||
}
|
||||
if (getSize().x() != 16.0f) {
|
||||
GL11.glPushMatrix();
|
||||
float scale = getSize().x() / 16.0f;
|
||||
GL11.glScalef(scale, scale, 1.0f);
|
||||
CraftGUI.render.iconBlock(IPoint.ZERO, itemStack.getFluid().getIcon(itemStack));
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
CraftGUI.render.iconBlock(IPoint.ZERO, itemStack.getFluid().getIcon(itemStack));
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1, 1, 1, 1.0f);
|
||||
}
|
||||
|
||||
public void setItemStack(FluidStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
public void setItemStack(FluidStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (hasTooltip && itemStack != null) {
|
||||
tooltip.add(itemStack.getLocalizedName());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (hasTooltip && itemStack != null) {
|
||||
tooltip.add(itemStack.getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,72 +19,75 @@ import net.minecraft.util.IIcon;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ControlLumbermillProgress extends ControlProgressBase {
|
||||
protected static Texture saw = new StandardTexture(0, 0, 6, 32, ExtraTreeTexture.Gui);
|
||||
protected static Texture saw2 = new StandardTexture(2, 0, 4, 32, ExtraTreeTexture.Gui);
|
||||
protected static Texture saw = new StandardTexture(0, 0, 6, 32, ExtraTreeTexture.Gui);
|
||||
protected static Texture saw2 = new StandardTexture(2, 0, 4, 32, ExtraTreeTexture.Gui);
|
||||
|
||||
protected float oldProgress;
|
||||
protected float animation;
|
||||
protected float oldProgress;
|
||||
protected float animation;
|
||||
|
||||
public ControlLumbermillProgress(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 66.0f, 18.0f);
|
||||
oldProgress = 0.0f;
|
||||
animation = 0.0f;
|
||||
new Panel(this, 0.0f, 0.0f, 66.0f, 18.0f, MinecraftGUI.PanelType.Black);
|
||||
}
|
||||
public ControlLumbermillProgress(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 66.0f, 18.0f);
|
||||
oldProgress = 0.0f;
|
||||
animation = 0.0f;
|
||||
new Panel(this, 0.0f, 0.0f, 66.0f, 18.0f, MinecraftGUI.PanelType.Black);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
if (oldProgress != progress) {
|
||||
oldProgress = progress;
|
||||
animation += 5.0f;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
if (oldProgress != progress) {
|
||||
oldProgress = progress;
|
||||
animation += 5.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
GL11.glDisable(2896);
|
||||
int sawX = (int) (63.0f * progress);
|
||||
CraftGUI.render.texture(ControlLumbermillProgress.saw, new IPoint(sawX, -8.0f + 6.0f * (float) Math.sin(animation)));
|
||||
ItemStack item = Window.get(this).getInventory().getStackInSlot(Lumbermill.SLOT_WOOD);
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
GL11.glDisable(2896);
|
||||
int sawX = (int) (63.0f * progress);
|
||||
CraftGUI.render.texture(
|
||||
ControlLumbermillProgress.saw, new IPoint(sawX, -8.0f + 6.0f * (float) Math.sin(animation)));
|
||||
ItemStack item = Window.get(this).getInventory().getStackInSlot(Lumbermill.SLOT_WOOD);
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
GL11.glDisable(2896);
|
||||
Block block = null;
|
||||
if (item.getItem() instanceof ItemBlock) {
|
||||
block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
}
|
||||
if (block == null) {
|
||||
return;
|
||||
}
|
||||
GL11.glDisable(2896);
|
||||
Block block = null;
|
||||
if (item.getItem() instanceof ItemBlock) {
|
||||
block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
}
|
||||
if (block == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IIcon icon = block.getIcon(2, item.getItemDamage());
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
CraftGUI.render.iconBlock(new IPoint(1 + i * 16, 1.0f), icon);
|
||||
}
|
||||
ItemStack result = Lumbermill.getPlankProduct(item);
|
||||
if (result == null) {
|
||||
return;
|
||||
}
|
||||
IIcon icon = block.getIcon(2, item.getItemDamage());
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
CraftGUI.render.iconBlock(new IPoint(1 + i * 16, 1.0f), icon);
|
||||
}
|
||||
ItemStack result = Lumbermill.getPlankProduct(item);
|
||||
if (result == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Block block2 = null;
|
||||
if (item.getItem() instanceof ItemBlock) {
|
||||
block2 = ((ItemBlock) result.getItem()).field_150939_a;
|
||||
}
|
||||
if (block2 == null) {
|
||||
return;
|
||||
}
|
||||
Block block2 = null;
|
||||
if (item.getItem() instanceof ItemBlock) {
|
||||
block2 = ((ItemBlock) result.getItem()).field_150939_a;
|
||||
}
|
||||
if (block2 == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IIcon icon2 = block2.getIcon(2, result.getItemDamage());
|
||||
IPoint pos = getAbsolutePosition();
|
||||
CraftGUI.render.limitArea(new IArea(pos.add(new IPoint(0.0f, 0.0f)), new IPoint(progress * 64.0f + 2.0f, 18.0f)));
|
||||
GL11.glEnable(3089);
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
CraftGUI.render.iconBlock(new IPoint(1 + j * 16, 1.0f), icon2);
|
||||
}
|
||||
GL11.glDisable(3089);
|
||||
CraftGUI.render.texture(ControlLumbermillProgress.saw2, new IPoint(sawX + 2, -8.0f + 6.0f * (float) Math.sin(animation)));
|
||||
}
|
||||
IIcon icon2 = block2.getIcon(2, result.getItemDamage());
|
||||
IPoint pos = getAbsolutePosition();
|
||||
CraftGUI.render.limitArea(
|
||||
new IArea(pos.add(new IPoint(0.0f, 0.0f)), new IPoint(progress * 64.0f + 2.0f, 18.0f)));
|
||||
GL11.glEnable(3089);
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
CraftGUI.render.iconBlock(new IPoint(1 + j * 16, 1.0f), icon2);
|
||||
}
|
||||
GL11.glDisable(3089);
|
||||
CraftGUI.render.texture(
|
||||
ControlLumbermillProgress.saw2, new IPoint(sawX + 2, -8.0f + 6.0f * (float) Math.sin(animation)));
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,29 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class ControlRecipeSlot extends ControlSlotBase {
|
||||
public ControlRecipeSlot(IWidget parent, int x, int y) {
|
||||
super(parent, x, y, 50);
|
||||
addSelfEventHandler(new MouseDownHandler());
|
||||
setRotating();
|
||||
}
|
||||
public ControlRecipeSlot(IWidget parent, int x, int y) {
|
||||
super(parent, x, y, 50);
|
||||
addSelfEventHandler(new MouseDownHandler());
|
||||
setRotating();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
IComponentRecipe recipe = Machine.getInterface(IComponentRecipe.class, Window.get(this).getInventory());
|
||||
return recipe.isRecipe() ? recipe.getProduct() : null;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
IComponentRecipe recipe =
|
||||
Machine.getInterface(IComponentRecipe.class, Window.get(this).getInventory());
|
||||
return recipe.isRecipe() ? recipe.getProduct() : null;
|
||||
}
|
||||
|
||||
private class MouseDownHandler extends EventMouse.Down.Handler {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
TileEntity tile = (TileEntity) Window.get(getWidget()).getInventory();
|
||||
if (tile == null || !(tile instanceof TileEntityMachine)) {
|
||||
return;
|
||||
}
|
||||
private class MouseDownHandler extends EventMouse.Down.Handler {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
TileEntity tile = (TileEntity) Window.get(getWidget()).getInventory();
|
||||
if (tile == null || !(tile instanceof TileEntityMachine)) {
|
||||
return;
|
||||
}
|
||||
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
Window.get(getWidget()).sendClientAction("recipe", nbt);
|
||||
}
|
||||
}
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
Window.get(getWidget()).sendClientAction("recipe", nbt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,53 +13,56 @@ import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ControlSlotFluid extends Control implements ITooltip {
|
||||
protected ControlFluidDisplay itemDisplay;
|
||||
protected FluidStack fluidStack;
|
||||
protected ControlFluidDisplay itemDisplay;
|
||||
protected FluidStack fluidStack;
|
||||
|
||||
public ControlSlotFluid(IWidget parent, int x, int y, FluidStack fluid) {
|
||||
this(parent, x, y, 18, fluid);
|
||||
}
|
||||
public ControlSlotFluid(IWidget parent, int x, int y, FluidStack fluid) {
|
||||
this(parent, x, y, 18, fluid);
|
||||
}
|
||||
|
||||
public ControlSlotFluid(IWidget parent, int x, int y, int size, FluidStack fluid) {
|
||||
super(parent, x, y, size, size);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
itemDisplay = new ControlFluidDisplay(this, 1.0f, 1.0f, size - 2);
|
||||
fluidStack = fluid;
|
||||
addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventWidget.ChangeSize event) {
|
||||
if (itemDisplay != null) {
|
||||
itemDisplay.setSize(getSize().sub(new IPoint(2.0f, 2.0f)));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
public ControlSlotFluid(IWidget parent, int x, int y, int size, FluidStack fluid) {
|
||||
super(parent, x, y, size, size);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
itemDisplay = new ControlFluidDisplay(this, 1.0f, 1.0f, size - 2);
|
||||
fluidStack = fluid;
|
||||
addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventWidget.ChangeSize event) {
|
||||
if (itemDisplay != null) {
|
||||
itemDisplay.setSize(getSize().sub(new IPoint(2.0f, 2.0f)));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
int size = (int) getSize().x();
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, getArea());
|
||||
if (getSuperParent().getMousedOverWidget() == this) {
|
||||
CraftGUI.render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), getArea().size().sub(new IPoint(2.0f, 2.0f))), 0x80ffffff, 0x80ffffff);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
int size = (int) getSize().x();
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, getArea());
|
||||
if (getSuperParent().getMousedOverWidget() == this) {
|
||||
CraftGUI.render.gradientRect(
|
||||
new IArea(new IPoint(1.0f, 1.0f), getArea().size().sub(new IPoint(2.0f, 2.0f))),
|
||||
0x80ffffff,
|
||||
0x80ffffff);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
itemDisplay.setItemStack(getFluidStack());
|
||||
}
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
itemDisplay.setItemStack(getFluidStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
FluidStack item = getFluidStack();
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
tooltip.add(item.getFluid().getLocalizedName());
|
||||
}
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
FluidStack item = getFluidStack();
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
tooltip.add(item.getFluid().getLocalizedName());
|
||||
}
|
||||
|
||||
public FluidStack getFluidStack() {
|
||||
return fluidStack;
|
||||
}
|
||||
public FluidStack getFluidStack() {
|
||||
return fluidStack;
|
||||
}
|
||||
}
|
||||
@@ -7,34 +7,34 @@ import binnie.core.craftgui.minecraft.Window;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ControlTankSlot extends ControlSlotFluid {
|
||||
protected int tankID;
|
||||
protected int tankID;
|
||||
|
||||
public ControlTankSlot(IWidget parent, int x, int y, int i) {
|
||||
super(parent, x, y, null);
|
||||
tankID = 0;
|
||||
tankID = i;
|
||||
addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
if (event.getButton() == 0) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setByte("id", (byte) tankID);
|
||||
Window.get(getWidget()).sendClientAction("tank-click", nbt);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
public ControlTankSlot(IWidget parent, int x, int y, int i) {
|
||||
super(parent, x, y, null);
|
||||
tankID = 0;
|
||||
tankID = i;
|
||||
addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
if (event.getButton() == 0) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setByte("id", (byte) tankID);
|
||||
Window.get(getWidget()).sendClientAction("tank-click", nbt);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
fluidStack = Window.get(this).getContainer().getTankInfo(tankID).liquid;
|
||||
int height = (int) (16.0f * (((fluidStack == null) ? 0 : fluidStack.amount) / 1000.0f));
|
||||
itemDisplay.setCroppedZone(itemDisplay, new IArea(0.0f, 16 - height, 16.0f, 16.0f));
|
||||
super.onUpdateClient();
|
||||
}
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
fluidStack = Window.get(this).getContainer().getTankInfo(tankID).liquid;
|
||||
int height = (int) (16.0f * (((fluidStack == null) ? 0 : fluidStack.amount) / 1000.0f));
|
||||
itemDisplay.setCroppedZone(itemDisplay, new IArea(0.0f, 16 - height, 16.0f, 16.0f));
|
||||
super.onUpdateClient();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
super.onRenderBackground();
|
||||
}
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
super.onRenderBackground();
|
||||
}
|
||||
}
|
||||
@@ -20,164 +20,170 @@ import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.IDesignCategory;
|
||||
import binnie.extratrees.carpentry.EnumDesign;
|
||||
import binnie.extratrees.machines.designer.WoodworkerRecipeComponent;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ControlTileSelect extends Control implements IControlValue<IDesign>, IControlScrollable {
|
||||
protected IDesign value;
|
||||
protected float shownHeight;
|
||||
protected IDesign value;
|
||||
protected float shownHeight;
|
||||
|
||||
protected ControlTileSelect(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 102.0f, 20 * (CarpentryManager.carpentryInterface.getSortedDesigns().size() / 4) + 22);
|
||||
value = EnumDesign.Blank;
|
||||
shownHeight = 92.0f;
|
||||
refresh("");
|
||||
}
|
||||
protected ControlTileSelect(IWidget parent, float x, float y) {
|
||||
super(
|
||||
parent,
|
||||
x,
|
||||
y,
|
||||
102.0f,
|
||||
20 * (CarpentryManager.carpentryInterface.getSortedDesigns().size() / 4) + 22);
|
||||
value = EnumDesign.Blank;
|
||||
shownHeight = 92.0f;
|
||||
refresh("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPercentageIndex() {
|
||||
return 0.0f;
|
||||
}
|
||||
@Override
|
||||
public float getPercentageIndex() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPercentageIndex(float index) {
|
||||
}
|
||||
@Override
|
||||
public void setPercentageIndex(float index) {}
|
||||
|
||||
@Override
|
||||
public float getPercentageShown() {
|
||||
return 0.0f;
|
||||
}
|
||||
@Override
|
||||
public float getPercentageShown() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesign getValue() {
|
||||
return value;
|
||||
}
|
||||
@Override
|
||||
public IDesign getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(IDesign value) {
|
||||
this.value = value;
|
||||
}
|
||||
@Override
|
||||
public void setValue(IDesign value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void movePercentage(float percentage) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void movePercentage(float percentage) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
TileEntityMachine tile = (TileEntityMachine) Window.get(this).getInventory();
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
TileEntityMachine tile = (TileEntityMachine) Window.get(this).getInventory();
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
WoodworkerRecipeComponent recipe = tile.getMachine().getComponent(WoodworkerRecipeComponent.class);
|
||||
setValue(recipe.getDesign());
|
||||
}
|
||||
WoodworkerRecipeComponent recipe = tile.getMachine().getComponent(WoodworkerRecipeComponent.class);
|
||||
setValue(recipe.getDesign());
|
||||
}
|
||||
|
||||
public void refresh(String filterText) {
|
||||
deleteAllChildren();
|
||||
int cx;
|
||||
int cy = 2;
|
||||
Map<IDesignCategory, List<IDesign>> designs = new HashMap<>();
|
||||
for (IDesignCategory category : CarpentryManager.carpentryInterface.getAllDesignCategories()) {
|
||||
designs.put(category, new ArrayList<>());
|
||||
for (IDesign tile : category.getDesigns()) {
|
||||
if (filterText.isEmpty() || tile.getName().toLowerCase().contains(filterText)) {
|
||||
designs.get(category).add(tile);
|
||||
}
|
||||
}
|
||||
if (designs.get(category).isEmpty()) {
|
||||
designs.remove(category);
|
||||
}
|
||||
}
|
||||
public void refresh(String filterText) {
|
||||
deleteAllChildren();
|
||||
int cx;
|
||||
int cy = 2;
|
||||
Map<IDesignCategory, List<IDesign>> designs = new HashMap<>();
|
||||
for (IDesignCategory category : CarpentryManager.carpentryInterface.getAllDesignCategories()) {
|
||||
designs.put(category, new ArrayList<>());
|
||||
for (IDesign tile : category.getDesigns()) {
|
||||
if (filterText.isEmpty() || tile.getName().toLowerCase().contains(filterText)) {
|
||||
designs.get(category).add(tile);
|
||||
}
|
||||
}
|
||||
if (designs.get(category).isEmpty()) {
|
||||
designs.remove(category);
|
||||
}
|
||||
}
|
||||
|
||||
for (IDesignCategory category : designs.keySet()) {
|
||||
cx = 2;
|
||||
new ControlText(this, new IPoint(cx, cy + 3), category.getName());
|
||||
cy += 16;
|
||||
for (IDesign tile : designs.get(category)) {
|
||||
if (cx > 90) {
|
||||
cx = 2;
|
||||
cy += 20;
|
||||
}
|
||||
new ControlTile(this, cx, cy, tile);
|
||||
cx += 20;
|
||||
}
|
||||
cy += 20;
|
||||
}
|
||||
int height = cy;
|
||||
setSize(new IPoint(getSize().x(), height));
|
||||
}
|
||||
for (IDesignCategory category : designs.keySet()) {
|
||||
cx = 2;
|
||||
new ControlText(this, new IPoint(cx, cy + 3), category.getName());
|
||||
cy += 16;
|
||||
for (IDesign tile : designs.get(category)) {
|
||||
if (cx > 90) {
|
||||
cx = 2;
|
||||
cy += 20;
|
||||
}
|
||||
new ControlTile(this, cx, cy, tile);
|
||||
cx += 20;
|
||||
}
|
||||
cy += 20;
|
||||
}
|
||||
int height = cy;
|
||||
setSize(new IPoint(getSize().x(), height));
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementRange() {
|
||||
return 0.0f;
|
||||
}
|
||||
@Override
|
||||
public float getMovementRange() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public static class ControlTile extends Control implements IControlValue<IDesign>, ITooltip {
|
||||
IDesign value;
|
||||
public static class ControlTile extends Control implements IControlValue<IDesign>, ITooltip {
|
||||
IDesign value;
|
||||
|
||||
protected ControlTile(IWidget parent, float x, float y, IDesign value) {
|
||||
super(parent, x, y, 18.0f, 18.0f);
|
||||
setValue(value);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addSelfEventHandler(new MouseDownHandler());
|
||||
}
|
||||
protected ControlTile(IWidget parent, float x, float y, IDesign value) {
|
||||
super(parent, x, y, 18.0f, 18.0f);
|
||||
setValue(value);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addSelfEventHandler(new MouseDownHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.add(I18N.localise("binniecore.gui.designer.pattern", getValue().getName()));
|
||||
}
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.add(
|
||||
I18N.localise("binniecore.gui.designer.pattern", getValue().getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesign getValue() {
|
||||
return value;
|
||||
}
|
||||
@Override
|
||||
public IDesign getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(IDesign value) {
|
||||
this.value = value;
|
||||
}
|
||||
@Override
|
||||
public void setValue(IDesign value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
|
||||
}
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
ItemStack image = ((WindowWoodworker) getSuperParent()).getDesignerType().getDisplayStack(getValue());
|
||||
CraftGUI.render.item(new IPoint(1.0f, 1.0f), image);
|
||||
if (((IControlValue) getParent()).getValue() == getValue()) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
ItemStack image =
|
||||
((WindowWoodworker) getSuperParent()).getDesignerType().getDisplayStack(getValue());
|
||||
CraftGUI.render.item(new IPoint(1.0f, 1.0f), image);
|
||||
if (((IControlValue) getParent()).getValue() == getValue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Window.get(this).getMousedOverWidget() == this) {
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), 0x44ffffff, 0x44ffffff);
|
||||
} else {
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), 0xaa888888, 0xaa888888);
|
||||
}
|
||||
}
|
||||
if (Window.get(this).getMousedOverWidget() == this) {
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), 0x44ffffff, 0x44ffffff);
|
||||
} else {
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), 0xaa888888, 0xaa888888);
|
||||
}
|
||||
}
|
||||
|
||||
private class MouseDownHandler extends EventMouse.Down.Handler {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
TileEntityMachine tile = (TileEntityMachine) Window.get(getWidget()).getInventory();
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
private class MouseDownHandler extends EventMouse.Down.Handler {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
TileEntityMachine tile =
|
||||
(TileEntityMachine) Window.get(getWidget()).getInventory();
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
tile.getMachine().getComponent(WoodworkerRecipeComponent.class);
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setShort("d", (short) CarpentryManager.carpentryInterface.getDesignIndex(getValue()));
|
||||
Window.get(getWidget()).sendClientAction("design", nbt);
|
||||
}
|
||||
}
|
||||
}
|
||||
tile.getMachine().getComponent(WoodworkerRecipeComponent.class);
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setShort("d", (short) CarpentryManager.carpentryInterface.getDesignIndex(getValue()));
|
||||
Window.get(getWidget()).sendClientAction("design", nbt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,24 +12,32 @@ import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import java.util.Collection;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PageFruit extends PageAbstract<ItemStack> {
|
||||
boolean treesThatBearFruit;
|
||||
boolean treesThatBearFruit;
|
||||
|
||||
public PageFruit(IWidget parent, DatabaseTab tab, boolean treesThatBearFruit) {
|
||||
super(parent, tab);
|
||||
this.treesThatBearFruit = treesThatBearFruit;
|
||||
}
|
||||
public PageFruit(IWidget parent, DatabaseTab tab, boolean treesThatBearFruit) {
|
||||
super(parent, tab);
|
||||
this.treesThatBearFruit = treesThatBearFruit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0.0f, 0.0f, size().x(), 24.0f), I18N.localise("extratrees.gui.database.tab.fruit." + (treesThatBearFruit ? "natural" : "potential")), TextJustification.MIDDLE_CENTER);
|
||||
Collection<IAlleleSpecies> trees = treesThatBearFruit ? ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatBearFruit(species, database.isNEI(), database.getWorld(), database.getUsername()) : ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatCanBearFruit(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4.0f, 24.0f, size().x() - 8.0f, size().y() - 4.0f - 24.0f).setOptions(trees);
|
||||
}
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(
|
||||
this,
|
||||
new IArea(0.0f, 0.0f, size().x(), 24.0f),
|
||||
I18N.localise("extratrees.gui.database.tab.fruit." + (treesThatBearFruit ? "natural" : "potential")),
|
||||
TextJustification.MIDDLE_CENTER);
|
||||
Collection<IAlleleSpecies> trees = treesThatBearFruit
|
||||
? ((TreeBreedingSystem) database.getBreedingSystem())
|
||||
.getTreesThatBearFruit(species, database.isNEI(), database.getWorld(), database.getUsername())
|
||||
: ((TreeBreedingSystem) database.getBreedingSystem())
|
||||
.getTreesThatCanBearFruit(
|
||||
species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4.0f, 24.0f, size().x() - 8.0f, size().y() - 4.0f - 24.0f).setOptions(trees);
|
||||
}
|
||||
}
|
||||
@@ -18,59 +18,71 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class PagePlanksOverview extends PageAbstract<ItemStack> {
|
||||
public PagePlanksOverview(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
public PagePlanksOverview(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
new ControlText(this, new IArea(0.0f, 0.0f, size().x(), 24.0f), species.getDisplayName(), TextJustification.MIDDLE_CENTER);
|
||||
new ControlText(this, new IArea(12.0f, 24.0f, size().x() - 24.0f, 24.0f), I18N.localise("extratrees.gui.database.planks.use"), TextJustification.MIDDLE_LEFT);
|
||||
IPlankType type = WoodManager.get(species);
|
||||
int x = 12;
|
||||
if (type != null) {
|
||||
ItemStack fence = WoodManager.getFence(type, new FenceType(0), 1);
|
||||
ItemStack gate = WoodManager.getGate(type);
|
||||
ItemStack door = WoodManager.getDoor(type, DoorType.STANDARD);
|
||||
if (fence != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(fence);
|
||||
x += 22;
|
||||
}
|
||||
if (gate != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(gate);
|
||||
x += 22;
|
||||
}
|
||||
if (door != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(door);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
new ControlText(
|
||||
this,
|
||||
new IArea(0.0f, 0.0f, size().x(), 24.0f),
|
||||
species.getDisplayName(),
|
||||
TextJustification.MIDDLE_CENTER);
|
||||
new ControlText(
|
||||
this,
|
||||
new IArea(12.0f, 24.0f, size().x() - 24.0f, 24.0f),
|
||||
I18N.localise("extratrees.gui.database.planks.use"),
|
||||
TextJustification.MIDDLE_LEFT);
|
||||
IPlankType type = WoodManager.get(species);
|
||||
int x = 12;
|
||||
if (type != null) {
|
||||
ItemStack fence = WoodManager.getFence(type, new FenceType(0), 1);
|
||||
ItemStack gate = WoodManager.getGate(type);
|
||||
ItemStack door = WoodManager.getDoor(type, DoorType.STANDARD);
|
||||
if (fence != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(fence);
|
||||
x += 22;
|
||||
}
|
||||
if (gate != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(gate);
|
||||
x += 22;
|
||||
}
|
||||
if (door != null) {
|
||||
new ControlItemDisplay(this, x, 48.0f).setItemStack(door);
|
||||
}
|
||||
}
|
||||
|
||||
ControlText controlDescription = new ControlText(this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.MIDDLE_CENTER);
|
||||
ControlText controlSignature = new ControlText(this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.BOTTOM_RIGHT);
|
||||
String desc = "";
|
||||
if (type != null) {
|
||||
desc = type.getDescription();
|
||||
}
|
||||
ControlText controlDescription = new ControlText(
|
||||
this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.MIDDLE_CENTER);
|
||||
ControlText controlSignature = new ControlText(
|
||||
this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.BOTTOM_RIGHT);
|
||||
String desc = "";
|
||||
if (type != null) {
|
||||
desc = type.getDescription();
|
||||
}
|
||||
|
||||
String descBody = EnumChatFormatting.ITALIC.toString();
|
||||
String descSig = "";
|
||||
if (desc == null || desc.isEmpty() || desc.matches("(\\w+\\.?)+")) {
|
||||
descBody += I18N.localise("binniecore.gui.database.nodescription");
|
||||
} else {
|
||||
String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
for (int i = 1; i < descStrings.length - 1; ++i) {
|
||||
descBody = descBody + " " + descStrings[i];
|
||||
}
|
||||
if (descStrings.length > 1) {
|
||||
descSig += descStrings[descStrings.length - 1];
|
||||
}
|
||||
}
|
||||
String descBody = EnumChatFormatting.ITALIC.toString();
|
||||
String descSig = "";
|
||||
if (desc == null || desc.isEmpty() || desc.matches("(\\w+\\.?)+")) {
|
||||
descBody += I18N.localise("binniecore.gui.database.nodescription");
|
||||
} else {
|
||||
String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
for (int i = 1; i < descStrings.length - 1; ++i) {
|
||||
descBody = descBody + " " + descStrings[i];
|
||||
}
|
||||
if (descStrings.length > 1) {
|
||||
descSig += descStrings[descStrings.length - 1];
|
||||
}
|
||||
}
|
||||
|
||||
controlDescription.setValue(descBody + EnumChatFormatting.RESET);
|
||||
controlSignature.setValue(descSig + EnumChatFormatting.RESET);
|
||||
float descHeight = CraftGUI.render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
|
||||
controlSignature.setPosition(new IPoint(controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10.0f));
|
||||
}
|
||||
controlDescription.setValue(descBody + EnumChatFormatting.RESET);
|
||||
controlSignature.setValue(descSig + EnumChatFormatting.RESET);
|
||||
float descHeight = CraftGUI.render.textHeight(
|
||||
controlDescription.getValue(), controlDescription.getSize().x());
|
||||
controlSignature.setPosition(new IPoint(
|
||||
controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10.0f));
|
||||
}
|
||||
}
|
||||
@@ -11,21 +11,25 @@ import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import java.util.Collection;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PagePlanksTrees extends PageAbstract<ItemStack> {
|
||||
public PagePlanksTrees(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
public PagePlanksTrees(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0.0f, 0.0f, size().x(), 24.0f), species.getDisplayName(), TextJustification.MIDDLE_CENTER);
|
||||
Collection<IAlleleSpecies> trees = ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatMakePlanks(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4.0f, 24.0f, size().x() - 8.0f, size().y() - 4.0f - 24.0f).setOptions(trees);
|
||||
}
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(
|
||||
this,
|
||||
new IArea(0.0f, 0.0f, size().x(), 24.0f),
|
||||
species.getDisplayName(),
|
||||
TextJustification.MIDDLE_CENTER);
|
||||
Collection<IAlleleSpecies> trees = ((TreeBreedingSystem) database.getBreedingSystem())
|
||||
.getTreesThatMakePlanks(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4.0f, 24.0f, size().x() - 8.0f, size().y() - 4.0f - 24.0f).setOptions(trees);
|
||||
}
|
||||
}
|
||||
@@ -11,18 +11,18 @@ import binnie.core.craftgui.window.Panel;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public class PageSpeciesImage extends PageSpecies {
|
||||
protected ControlDatabaseIndividualDisplay display;
|
||||
protected ControlDatabaseIndividualDisplay display;
|
||||
|
||||
public PageSpeciesImage(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
new Panel(this, 7.0f, 25.0f, 130.0f, 120.0f, MinecraftGUI.PanelType.Gray);
|
||||
display = new ControlDatabaseIndividualDisplay(this, 12.0f, 25.0f, 120.0f);
|
||||
display.hastooltip = false;
|
||||
new ControlTextCentered(this, 8.0f, getValue().toString());
|
||||
}
|
||||
public PageSpeciesImage(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
new Panel(this, 7.0f, 25.0f, 130.0f, 120.0f, MinecraftGUI.PanelType.Gray);
|
||||
display = new ControlDatabaseIndividualDisplay(this, 12.0f, 25.0f, 120.0f);
|
||||
display.hastooltip = false;
|
||||
new ControlTextCentered(this, 8.0f, getValue().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
display.setSpecies(species, EnumDiscoveryState.SHOW);
|
||||
}
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
display.setSpecies(species, EnumDiscoveryState.SHOW);
|
||||
}
|
||||
}
|
||||
@@ -21,127 +21,201 @@ import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class PageSpeciesTreeGenome extends PageSpecies {
|
||||
public PageSpeciesTreeGenome(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
public PageSpeciesTreeGenome(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
deleteAllChildren();
|
||||
IAllele[] template = Binnie.Genetics.getTreeRoot().getTemplate(species.getUID());
|
||||
if (template == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
deleteAllChildren();
|
||||
IAllele[] template = Binnie.Genetics.getTreeRoot().getTemplate(species.getUID());
|
||||
if (template == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ITree tree = Binnie.Genetics.getTreeRoot().templateAsIndividual(template);
|
||||
if (tree == null) {
|
||||
return;
|
||||
}
|
||||
ITree tree = Binnie.Genetics.getTreeRoot().templateAsIndividual(template);
|
||||
if (tree == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack log = null;
|
||||
try {
|
||||
FakeWorld world = FakeWorld.instance;
|
||||
tree.getGenome().getPrimary().getGenerator().setLogBlock(tree.getGenome(), world, 0, 0, 0, ForgeDirection.UP);// getGenome().getPrimary().getGenerator().getWorldGenerator(tree);
|
||||
log = world.getWooLog();
|
||||
ItemStack log = null;
|
||||
try {
|
||||
FakeWorld world = FakeWorld.instance;
|
||||
tree.getGenome()
|
||||
.getPrimary()
|
||||
.getGenerator()
|
||||
.setLogBlock(
|
||||
tree.getGenome(),
|
||||
world,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
ForgeDirection.UP); // getGenome().getPrimary().getGenerator().getWorldGenerator(tree);
|
||||
log = world.getWooLog();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
ITreeGenome genome = tree.getGenome();
|
||||
IAlleleTreeSpecies treeSpecies = genome.getPrimary();
|
||||
int w = 144;
|
||||
int h = 176;
|
||||
new ControlText(this, new IArea(0.0f, 4.0f, w, 16.0f), getValue().toString(), TextJustification.MIDDLE_CENTER);
|
||||
ControlScrollableContent scrollable = new ControlScrollableContent(this, 4.0f, 20.0f, w - 8, h - 8 - 16, 12.0f);
|
||||
Control contents = new Control(scrollable, 0.0f, 0.0f, w - 8 - 12, h - 8 - 16);
|
||||
int tw = w - 8 - 12;
|
||||
int w2 = 65;
|
||||
int w3 = tw - 50;
|
||||
int y = 0;
|
||||
int th = 14;
|
||||
int th2 = 18;
|
||||
BreedingSystem syst = Binnie.Genetics.treeBreedingSystem;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.PLANT) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getPlantType().toString(), TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise("binniecore.gui.temperature.short") + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
IIcon leaf = treeSpecies.getLeafIcon(false, false);
|
||||
IIcon fruit = null;
|
||||
int fruitColour = 0xffffff;
|
||||
ITreeGenome genome = tree.getGenome();
|
||||
IAlleleTreeSpecies treeSpecies = genome.getPrimary();
|
||||
int w = 144;
|
||||
int h = 176;
|
||||
new ControlText(this, new IArea(0.0f, 4.0f, w, 16.0f), getValue().toString(), TextJustification.MIDDLE_CENTER);
|
||||
ControlScrollableContent scrollable = new ControlScrollableContent(this, 4.0f, 20.0f, w - 8, h - 8 - 16, 12.0f);
|
||||
Control contents = new Control(scrollable, 0.0f, 0.0f, w - 8 - 12, h - 8 - 16);
|
||||
int tw = w - 8 - 12;
|
||||
int w2 = 65;
|
||||
int w3 = tw - 50;
|
||||
int y = 0;
|
||||
int th = 14;
|
||||
int th2 = 18;
|
||||
BreedingSystem syst = Binnie.Genetics.treeBreedingSystem;
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th),
|
||||
syst.getChromosomeShortName(EnumTreeChromosome.PLANT) + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(w2, y, w3, th),
|
||||
treeSpecies.getPlantType().toString(),
|
||||
TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th),
|
||||
I18N.localise("binniecore.gui.temperature.short") + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(w2, y, w3, th),
|
||||
treeSpecies.getTemperature().getName(),
|
||||
TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
IIcon leaf = treeSpecies.getLeafIcon(false, false);
|
||||
IIcon fruit = null;
|
||||
int fruitColour = 0xffffff;
|
||||
|
||||
try {
|
||||
fruit = ForestryAPI.textureManager.getIcon(genome.getFruitProvider().getIconIndex(genome, null, 0, 0, 0, 100, false));
|
||||
fruitColour = genome.getFruitProvider().getColour(genome, null, 0, 0, 0, 100);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
try {
|
||||
fruit = ForestryAPI.textureManager.getIcon(
|
||||
genome.getFruitProvider().getIconIndex(genome, null, 0, 0, 0, 100, false));
|
||||
fruitColour = genome.getFruitProvider().getColour(genome, null, 0, 0, 0, 100);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
if (leaf != null) {
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th2), I18N.localise("extratrees.gui.database.leaves") + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlBlockIconDisplay(contents, w2, y, leaf).setColor(treeSpecies.getLeafColour(false));
|
||||
if (fruit != null && !treeSpecies.getUID().equals("forestry.treeOak")) {
|
||||
new ControlBlockIconDisplay(contents, w2, y, fruit).setColor(fruitColour);
|
||||
}
|
||||
y += th2;
|
||||
}
|
||||
if (leaf != null) {
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th2),
|
||||
I18N.localise("extratrees.gui.database.leaves") + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlBlockIconDisplay(contents, w2, y, leaf).setColor(treeSpecies.getLeafColour(false));
|
||||
if (fruit != null && !treeSpecies.getUID().equals("forestry.treeOak")) {
|
||||
new ControlBlockIconDisplay(contents, w2, y, fruit).setColor(fruitColour);
|
||||
}
|
||||
y += th2;
|
||||
}
|
||||
|
||||
// ItemStack log = (genome.getFruitProvider().getProducts().length
|
||||
// > 0) ? genome.getFruitProvider().getProducts()[0] : null;
|
||||
if (log != null) {
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th2), I18N.localise("extratrees.gui.database.log") + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
ControlItemDisplay display = new ControlItemDisplay(contents, w2, y);
|
||||
display.setItemStack(log);
|
||||
display.setTooltip();
|
||||
y += th2;
|
||||
}
|
||||
// ItemStack log = (genome.getFruitProvider().getProducts().length
|
||||
// > 0) ? genome.getFruitProvider().getProducts()[0] : null;
|
||||
if (log != null) {
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th2),
|
||||
I18N.localise("extratrees.gui.database.log") + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
ControlItemDisplay display = new ControlItemDisplay(contents, w2, y);
|
||||
display.setItemStack(log);
|
||||
display.setTooltip();
|
||||
y += th2;
|
||||
}
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.GROWTH) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getGrowthProvider().getDescription(), TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.HEIGHT) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getHeight() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
List<ItemStack> fruits = new ArrayList<>();
|
||||
Collections.addAll(fruits, genome.getFruitProvider().getProducts());
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th),
|
||||
syst.getChromosomeShortName(EnumTreeChromosome.GROWTH) + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(w2, y, w3, th),
|
||||
genome.getGrowthProvider().getDescription(),
|
||||
TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th),
|
||||
syst.getChromosomeShortName(EnumTreeChromosome.HEIGHT) + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getHeight() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th),
|
||||
syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
List<ItemStack> fruits = new ArrayList<>();
|
||||
Collections.addAll(fruits, genome.getFruitProvider().getProducts());
|
||||
|
||||
if (!fruits.isEmpty()) {
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th2), syst.getChromosomeShortName(EnumTreeChromosome.FRUITS) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
for (ItemStack fruitw : fruits) {
|
||||
ControlItemDisplay display2 = new ControlItemDisplay(contents, w2, y);
|
||||
display2.setItemStack(fruitw);
|
||||
display2.setTooltip();
|
||||
y += th2;
|
||||
}
|
||||
}
|
||||
if (!fruits.isEmpty()) {
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th2),
|
||||
syst.getChromosomeShortName(EnumTreeChromosome.FRUITS) + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
for (ItemStack fruitw : fruits) {
|
||||
ControlItemDisplay display2 = new ControlItemDisplay(contents, w2, y);
|
||||
display2.setItemStack(fruitw);
|
||||
display2.setTooltip();
|
||||
y += th2;
|
||||
}
|
||||
}
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.YIELD) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getYield() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.SAPPINESS) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getSappiness() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.MATURATION) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getMaturationTime() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.GIRTH) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getGirth() + "x" + genome.getGirth(), TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
contents.setSize(new IPoint(contents.size().x(), y));
|
||||
scrollable.setScrollableContent(contents);
|
||||
}
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th),
|
||||
syst.getChromosomeShortName(EnumTreeChromosome.YIELD) + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getYield() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th),
|
||||
syst.getChromosomeShortName(EnumTreeChromosome.SAPPINESS) + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getSappiness() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th),
|
||||
syst.getChromosomeShortName(EnumTreeChromosome.MATURATION) + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(
|
||||
contents, new IArea(w2, y, w3, th), genome.getMaturationTime() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(0.0f, y, w2, th),
|
||||
syst.getChromosomeShortName(EnumTreeChromosome.GIRTH) + " : ",
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(
|
||||
contents,
|
||||
new IArea(w2, y, w3, th),
|
||||
genome.getGirth() + "x" + genome.getGirth(),
|
||||
TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
contents.setSize(new IPoint(contents.size().x(), y));
|
||||
scrollable.setScrollableContent(contents);
|
||||
}
|
||||
}
|
||||
@@ -11,21 +11,22 @@ import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import java.util.Collection;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PageWood extends PageAbstract<ItemStack> {
|
||||
public PageWood(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
public PageWood(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0.0f, 0.0f, size().x(), 24.0f), getValue().toString(), TextJustification.MIDDLE_CENTER);
|
||||
Collection<IAlleleSpecies> trees = ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatHaveWood(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4.0f, 24.0f, size().x() - 8.0f, size().y() - 4.0f - 24.0f).setOptions(trees);
|
||||
}
|
||||
@Override
|
||||
public void onValueChanged(ItemStack species) {
|
||||
deleteAllChildren();
|
||||
WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(
|
||||
this, new IArea(0.0f, 0.0f, size().x(), 24.0f), getValue().toString(), TextJustification.MIDDLE_CENTER);
|
||||
Collection<IAlleleSpecies> trees = ((TreeBreedingSystem) database.getBreedingSystem())
|
||||
.getTreesThatHaveWood(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4.0f, 24.0f, size().x() - 8.0f, size().y() - 4.0f - 24.0f).setOptions(trees);
|
||||
}
|
||||
}
|
||||
@@ -25,82 +25,85 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class WindowArboristDatabase extends WindowAbstractDatabase {
|
||||
public WindowArboristDatabase(EntityPlayer player, Side side, boolean nei) {
|
||||
super(player, side, nei, Binnie.Genetics.treeBreedingSystem, 120.0f);
|
||||
}
|
||||
public WindowArboristDatabase(EntityPlayer player, Side side, boolean nei) {
|
||||
super(player, side, nei, Binnie.Genetics.treeBreedingSystem, 120.0f);
|
||||
}
|
||||
|
||||
public static Window create(EntityPlayer player, Side side, boolean nei) {
|
||||
return new WindowArboristDatabase(player, side, nei);
|
||||
}
|
||||
public static Window create(EntityPlayer player, Side side, boolean nei) {
|
||||
return new WindowArboristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.overview"));
|
||||
new PageSpeciesTreeGenome(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.genome"));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.classification"));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.resultant"));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.further"));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.overview"));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.species"));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder"));
|
||||
createMode(TreeMode.FRUIT, new ModeWidgets(TreeMode.FRUIT, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
(listBox = new ControlListBox<ItemStack>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@Override
|
||||
public IWidget createOption(ItemStack value, int y) {
|
||||
return new ControlItemStackOption(getContent(), value, y);
|
||||
}
|
||||
}).setOptions(((TreeBreedingSystem) getBreedingSystem()).allFruits);
|
||||
}
|
||||
});
|
||||
createMode(TreeMode.WOOD, new ModeWidgets(TreeMode.WOOD, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
(listBox = new ControlListBox<ItemStack>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@Override
|
||||
public IWidget createOption(ItemStack value, int y) {
|
||||
return new ControlItemStackOption(getContent(), value, y);
|
||||
}
|
||||
}).setOptions(((TreeBreedingSystem) getBreedingSystem()).allWoods);
|
||||
}
|
||||
});
|
||||
createMode(TreeMode.PLANKS, new ModeWidgets(TreeMode.PLANKS, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
listBox = new ControlListBox<ItemStack>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@Override
|
||||
public IWidget createOption(ItemStack value, int y) {
|
||||
return new ControlItemStackOption(getContent(), value, y);
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
new PageFruit(getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.natural"), true);
|
||||
new PageFruit(getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.potential"), false);
|
||||
new PageWood(getInfoPages(TreeMode.WOOD), new DatabaseTab(ExtraTrees.instance, "wood.natural"));
|
||||
new PagePlanksOverview(getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.overview"));
|
||||
new PagePlanksTrees(getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.natural"));
|
||||
}
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.overview"));
|
||||
new PageSpeciesTreeGenome(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.genome"));
|
||||
new PageSpeciesClassification(
|
||||
getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.classification"));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.resultant"));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.further"));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.overview"));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.species"));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder"));
|
||||
createMode(TreeMode.FRUIT, new ModeWidgets(TreeMode.FRUIT, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
(listBox = new ControlListBox<ItemStack>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@Override
|
||||
public IWidget createOption(ItemStack value, int y) {
|
||||
return new ControlItemStackOption(getContent(), value, y);
|
||||
}
|
||||
})
|
||||
.setOptions(((TreeBreedingSystem) getBreedingSystem()).allFruits);
|
||||
}
|
||||
});
|
||||
createMode(TreeMode.WOOD, new ModeWidgets(TreeMode.WOOD, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
(listBox = new ControlListBox<ItemStack>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@Override
|
||||
public IWidget createOption(ItemStack value, int y) {
|
||||
return new ControlItemStackOption(getContent(), value, y);
|
||||
}
|
||||
})
|
||||
.setOptions(((TreeBreedingSystem) getBreedingSystem()).allWoods);
|
||||
}
|
||||
});
|
||||
createMode(TreeMode.PLANKS, new ModeWidgets(TreeMode.PLANKS, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
listBox = new ControlListBox<ItemStack>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@Override
|
||||
public IWidget createOption(ItemStack value, int y) {
|
||||
return new ControlItemStackOption(getContent(), value, y);
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
new PageFruit(getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.natural"), true);
|
||||
new PageFruit(getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.potential"), false);
|
||||
new PageWood(getInfoPages(TreeMode.WOOD), new DatabaseTab(ExtraTrees.instance, "wood.natural"));
|
||||
new PagePlanksOverview(getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.overview"));
|
||||
new PagePlanksTrees(getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.natural"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "TreeDatabase";
|
||||
}
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "TreeDatabase";
|
||||
}
|
||||
|
||||
enum TreeMode implements IDatabaseMode {
|
||||
FRUIT,
|
||||
WOOD,
|
||||
PLANKS;
|
||||
enum TreeMode implements IDatabaseMode {
|
||||
FRUIT,
|
||||
WOOD,
|
||||
PLANKS;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.gui.database.mode." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.gui.database.mode." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,33 +17,41 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class WindowLepidopteristDatabase extends WindowAbstractDatabase {
|
||||
public WindowLepidopteristDatabase(EntityPlayer player, Side side, boolean nei) {
|
||||
super(player, side, nei, Binnie.Genetics.mothBreedingSystem, 160.0f);
|
||||
}
|
||||
public WindowLepidopteristDatabase(EntityPlayer player, Side side, boolean nei) {
|
||||
super(player, side, nei, Binnie.Genetics.mothBreedingSystem, 160.0f);
|
||||
}
|
||||
|
||||
public static Window create(EntityPlayer player, Side side, boolean nei) {
|
||||
return new WindowLepidopteristDatabase(player, side, nei);
|
||||
}
|
||||
public static Window create(EntityPlayer player, Side side, boolean nei) {
|
||||
return new WindowLepidopteristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview"));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification"));
|
||||
new PageSpeciesImage(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen"));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant"));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further"));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview"));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species"));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder"));
|
||||
}
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(
|
||||
getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview"));
|
||||
new PageSpeciesClassification(
|
||||
getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification"));
|
||||
new PageSpeciesImage(
|
||||
getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen"));
|
||||
new PageSpeciesResultant(
|
||||
getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant"));
|
||||
new PageSpeciesMutations(
|
||||
getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further"));
|
||||
new PageBranchOverview(
|
||||
getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview"));
|
||||
new PageBranchSpecies(
|
||||
getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species"));
|
||||
new PageBreeder(
|
||||
getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "MothDatabase";
|
||||
}
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "MothDatabase";
|
||||
}
|
||||
}
|
||||
@@ -16,35 +16,35 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class WindowLumbermill extends Window {
|
||||
public WindowLumbermill(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(220.0f, 192.0f, player, inventory, side);
|
||||
}
|
||||
public WindowLumbermill(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(220.0f, 192.0f, player, inventory, side);
|
||||
}
|
||||
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
return new WindowLumbermill(player, inventory, side);
|
||||
}
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
return new WindowLumbermill(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "Lumbermill";
|
||||
}
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "Lumbermill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
|
||||
new ControlSlot(this, 42.0f, 43.0f).assign(Lumbermill.SLOT_WOOD);
|
||||
new ControlSlot(this, 148.0f, 43.0f).assign(Lumbermill.SLOT_PLANKS);
|
||||
new ControlSlot(this, 172.0f, 28.0f).assign(Lumbermill.SLOT_BARK);
|
||||
new ControlSlot(this, 172.0f, 58.0f).assign(Lumbermill.SLOT_SAWDUST);
|
||||
new ControlLumbermillProgress(this, 70.0f, 43.0f);
|
||||
new ControlLiquidTank(this, 16, 32);
|
||||
new ControlEnergyBar(this, 8, 112, 16, 60, Position.BOTTOM);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, 95.0f, 73.0f);
|
||||
}
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
|
||||
new ControlSlot(this, 42.0f, 43.0f).assign(Lumbermill.SLOT_WOOD);
|
||||
new ControlSlot(this, 148.0f, 43.0f).assign(Lumbermill.SLOT_PLANKS);
|
||||
new ControlSlot(this, 172.0f, 28.0f).assign(Lumbermill.SLOT_BARK);
|
||||
new ControlSlot(this, 172.0f, 58.0f).assign(Lumbermill.SLOT_SAWDUST);
|
||||
new ControlLumbermillProgress(this, 70.0f, 43.0f);
|
||||
new ControlLiquidTank(this, 16, 32);
|
||||
new ControlEnergyBar(this, 8, 112, 16, 60, Position.BOTTOM);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, 95.0f, 73.0f);
|
||||
}
|
||||
}
|
||||
@@ -9,26 +9,26 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class WindowSetSquare extends Window {
|
||||
public WindowSetSquare(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(150.0f, 150.0f, player, inventory, side);
|
||||
}
|
||||
public WindowSetSquare(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(150.0f, 150.0f, player, inventory, side);
|
||||
}
|
||||
|
||||
public static Window create(EntityPlayer player, World world, int x, int y, int z, Side side) {
|
||||
return new WindowSetSquare(player, null, side);
|
||||
}
|
||||
public static Window create(EntityPlayer player, World world, int x, int y, int z, Side side) {
|
||||
return new WindowSetSquare(player, null, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
protected String getName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
@@ -26,56 +26,63 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class WindowWoodworker extends Window {
|
||||
protected ControlTextEdit textEdit;
|
||||
protected ControlTileSelect tileSelect;
|
||||
protected ControlTextEdit textEdit;
|
||||
protected ControlTileSelect tileSelect;
|
||||
|
||||
public WindowWoodworker(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(320.0f, 216.0f, player, inventory, side);
|
||||
addEventHandler(new EventTextEdit.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventTextEdit event) {
|
||||
tileSelect.refresh(event.getValue());
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.DirectChild, this));
|
||||
}
|
||||
public WindowWoodworker(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(320.0f, 216.0f, player, inventory, side);
|
||||
addEventHandler(
|
||||
new EventTextEdit.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventTextEdit event) {
|
||||
tileSelect.refresh(event.getValue());
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.DirectChild, this));
|
||||
}
|
||||
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
return new WindowWoodworker(player, inventory, side);
|
||||
}
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
return new WindowWoodworker(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
|
||||
new ControlText(this, new IArea(190.0f, 36.0f, 114.0f, 10.0f), I18N.localise("binniecore.gui.design"), TextJustification.TOP_CENTER).setColor(4473924);
|
||||
new Panel(this, 188.0f, 48.0f, 118.0f, 126.0f, MinecraftGUI.PanelType.Gray);
|
||||
textEdit = new ControlTextEdit(this, 188.0f, 178.0f, 118.0f, 12.0f);
|
||||
ControlScrollableContent scroll = new ControlScrollableContent(this, 190.0f, 50.0f, 114.0f, 122.0f, 12.0f);
|
||||
scroll.setScrollableContent(tileSelect = new ControlTileSelect(scroll, 0.0f, 0.0f));
|
||||
new ControlPlayerInventory(this).setPosition(new IPoint(14.0f, 96.0f));
|
||||
new ControlErrorState(this, 76.0f, 65.0f);
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
|
||||
new ControlText(
|
||||
this,
|
||||
new IArea(190.0f, 36.0f, 114.0f, 10.0f),
|
||||
I18N.localise("binniecore.gui.design"),
|
||||
TextJustification.TOP_CENTER)
|
||||
.setColor(4473924);
|
||||
new Panel(this, 188.0f, 48.0f, 118.0f, 126.0f, MinecraftGUI.PanelType.Gray);
|
||||
textEdit = new ControlTextEdit(this, 188.0f, 178.0f, 118.0f, 12.0f);
|
||||
ControlScrollableContent scroll = new ControlScrollableContent(this, 190.0f, 50.0f, 114.0f, 122.0f, 12.0f);
|
||||
scroll.setScrollableContent(tileSelect = new ControlTileSelect(scroll, 0.0f, 0.0f));
|
||||
new ControlPlayerInventory(this).setPosition(new IPoint(14.0f, 96.0f));
|
||||
new ControlErrorState(this, 76.0f, 65.0f);
|
||||
|
||||
if (getInventory() != null) {
|
||||
ControlSlot slotWood1 = new ControlSlot(this, 22.0f, 34.0f);
|
||||
slotWood1.assign(Designer.DESIGN_1_SLOT);
|
||||
ControlSlot slotWood2 = new ControlSlot(this, 62.0f, 34.0f);
|
||||
slotWood2.assign(Designer.DESIGN_2_SLOT);
|
||||
ControlSlot slotBeeswax = new ControlSlot(this, 42.0f, 64.0f);
|
||||
slotBeeswax.assign(Designer.GLUE_SLOT);
|
||||
new ControlRecipeSlot(this, 112, 34);
|
||||
}
|
||||
}
|
||||
if (getInventory() != null) {
|
||||
ControlSlot slotWood1 = new ControlSlot(this, 22.0f, 34.0f);
|
||||
slotWood1.assign(Designer.DESIGN_1_SLOT);
|
||||
ControlSlot slotWood2 = new ControlSlot(this, 62.0f, 34.0f);
|
||||
slotWood2.assign(Designer.DESIGN_2_SLOT);
|
||||
ControlSlot slotBeeswax = new ControlSlot(this, 42.0f, 64.0f);
|
||||
slotBeeswax.assign(Designer.GLUE_SLOT);
|
||||
new ControlRecipeSlot(this, 112, 34);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "Woodworker";
|
||||
}
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "Woodworker";
|
||||
}
|
||||
|
||||
public DesignerType getDesignerType() {
|
||||
return Machine.getInterface(WoodworkerRecipeComponent.class, getInventory()).getDesignerType();
|
||||
}
|
||||
public DesignerType getDesignerType() {
|
||||
return Machine.getInterface(WoodworkerRecipeComponent.class, getInventory())
|
||||
.getDesignerType();
|
||||
}
|
||||
}
|
||||
@@ -19,237 +19,237 @@ import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.lepidopterology.EnumFlutterType;
|
||||
import forestry.api.lepidopterology.IAlleleButterflySpecies;
|
||||
import forestry.api.lepidopterology.IButterflyRoot;
|
||||
import java.awt.Color;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
WhiteAdmiral("whiteAdmiral", "Limenitis camilla", new Color(0xfafafa)),
|
||||
PurpleEmperor("purpleEmperor", "Apatura iris", new Color(0x4232c6)),
|
||||
RedAdmiral("redAdmiral", "Vanessa atalanta", new Color(0xe66f44)),
|
||||
PaintedLady("paintedLady", "Vanessa cardui", new Color(0xeda048)),
|
||||
SmallTortoiseshell("smallTortoiseshell", "Aglais urticae", new Color(0xea750b)),
|
||||
CamberwellBeauty("camberwellBeauty", "Aglais antiopa", new Color(0x95a2cc)),
|
||||
Peacock("peacock", "Inachis io", new Color(0xd33802)),
|
||||
Wall("wall", "Lasiommata megera", new Color(0xefae1e)),
|
||||
CrimsonRose("crimsonRose", "Atrophaneura hector", new Color(0xff627b)),
|
||||
KaiserIHind("kaiserIHind", "Teinopalpus imperialis", new Color(0x77a040)),
|
||||
GoldenBirdwing("goldenBirdwing", "Troides aeacus", new Color(0xf9dc1e)),
|
||||
MarshFritillary("marshFritillary", "Euphydryas aurinia",new Color(0xff8c00)),
|
||||
PearlBorderedFritillary("pearlBorderedFritillary", "Boloria euphrosyne", new Color(0xff8b03)),
|
||||
QueenOfSpainFritillary("queenOfSpainFritillary", "Issoria lathonia", new Color(0xffd13f)),
|
||||
SpeckledWood("speckledWood", "Pararge aegeria", new Color(0xf5f88d)),
|
||||
ScotchAngus("scotchAngus", "Erebia aethiops", new Color(0xc25423)),
|
||||
Gatekeeper("gatekeeper", "Pyronia tithonus", new Color(0xfac32a)),
|
||||
MeadowBrown("meadowBrown", "Maniola jurtina", new Color(0xe39519)),
|
||||
SmallHeath("smallHeath", "Coenonympha pamphilus", new Color(0xffa632)),
|
||||
Ringlet("ringlet", "Aphantopus hyperantus", new Color(0x975d37)),
|
||||
Monarch("monarch", "Danaus plexippus", new Color(0xffb206)),
|
||||
MarbledWhite("marbledWhite", "Melanargia galathea", new Color(0xececec));
|
||||
WhiteAdmiral("whiteAdmiral", "Limenitis camilla", new Color(0xfafafa)),
|
||||
PurpleEmperor("purpleEmperor", "Apatura iris", new Color(0x4232c6)),
|
||||
RedAdmiral("redAdmiral", "Vanessa atalanta", new Color(0xe66f44)),
|
||||
PaintedLady("paintedLady", "Vanessa cardui", new Color(0xeda048)),
|
||||
SmallTortoiseshell("smallTortoiseshell", "Aglais urticae", new Color(0xea750b)),
|
||||
CamberwellBeauty("camberwellBeauty", "Aglais antiopa", new Color(0x95a2cc)),
|
||||
Peacock("peacock", "Inachis io", new Color(0xd33802)),
|
||||
Wall("wall", "Lasiommata megera", new Color(0xefae1e)),
|
||||
CrimsonRose("crimsonRose", "Atrophaneura hector", new Color(0xff627b)),
|
||||
KaiserIHind("kaiserIHind", "Teinopalpus imperialis", new Color(0x77a040)),
|
||||
GoldenBirdwing("goldenBirdwing", "Troides aeacus", new Color(0xf9dc1e)),
|
||||
MarshFritillary("marshFritillary", "Euphydryas aurinia", new Color(0xff8c00)),
|
||||
PearlBorderedFritillary("pearlBorderedFritillary", "Boloria euphrosyne", new Color(0xff8b03)),
|
||||
QueenOfSpainFritillary("queenOfSpainFritillary", "Issoria lathonia", new Color(0xffd13f)),
|
||||
SpeckledWood("speckledWood", "Pararge aegeria", new Color(0xf5f88d)),
|
||||
ScotchAngus("scotchAngus", "Erebia aethiops", new Color(0xc25423)),
|
||||
Gatekeeper("gatekeeper", "Pyronia tithonus", new Color(0xfac32a)),
|
||||
MeadowBrown("meadowBrown", "Maniola jurtina", new Color(0xe39519)),
|
||||
SmallHeath("smallHeath", "Coenonympha pamphilus", new Color(0xffa632)),
|
||||
Ringlet("ringlet", "Aphantopus hyperantus", new Color(0x975d37)),
|
||||
Monarch("monarch", "Danaus plexippus", new Color(0xffb206)),
|
||||
MarbledWhite("marbledWhite", "Melanargia galathea", new Color(0xececec));
|
||||
|
||||
public IClassification branch;
|
||||
public IClassification branch;
|
||||
|
||||
protected String name;
|
||||
protected String branchName;
|
||||
protected String scientific;
|
||||
protected BinnieResource texture;
|
||||
protected int color;
|
||||
protected String name;
|
||||
protected String branchName;
|
||||
protected String scientific;
|
||||
protected BinnieResource texture;
|
||||
protected int color;
|
||||
|
||||
private Map<ItemStack, Float> butterflyLoot;
|
||||
private Map<ItemStack, Float> caterpillarLoot;
|
||||
private Map<ItemStack, Float> butterflyLoot;
|
||||
private Map<ItemStack, Float> caterpillarLoot;
|
||||
|
||||
ButterflySpecies(String name, String scientific, Color color) {
|
||||
this.name = name;
|
||||
this.scientific = scientific.split(" ")[1];
|
||||
this.color = color.getRGB();
|
||||
butterflyLoot = new HashMap<>();
|
||||
caterpillarLoot = new HashMap<>();
|
||||
branchName = scientific.split(" ")[0].toLowerCase();
|
||||
texture = Binnie.Resource.getPNG(ExtraTrees.instance, ResourceType.Entity, toString());
|
||||
}
|
||||
ButterflySpecies(String name, String scientific, Color color) {
|
||||
this.name = name;
|
||||
this.scientific = scientific.split(" ")[1];
|
||||
this.color = color.getRGB();
|
||||
butterflyLoot = new HashMap<>();
|
||||
caterpillarLoot = new HashMap<>();
|
||||
branchName = scientific.split(" ")[0].toLowerCase();
|
||||
texture = Binnie.Resource.getPNG(ExtraTrees.instance, ResourceType.Entity, toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.butterflies.species." + name);
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.butterflies.species." + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
return EnumTemperature.NORMAL;
|
||||
}
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
return EnumTemperature.NORMAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumHumidity getHumidity() {
|
||||
return EnumHumidity.NORMAL;
|
||||
}
|
||||
@Override
|
||||
public EnumHumidity getHumidity() {
|
||||
return EnumHumidity.NORMAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEffect() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hasEffect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCounted() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isCounted() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBinomial() {
|
||||
return scientific;
|
||||
}
|
||||
@Override
|
||||
public String getBinomial() {
|
||||
return scientific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthority() {
|
||||
return "Binnie";
|
||||
}
|
||||
@Override
|
||||
public String getAuthority() {
|
||||
return "Binnie";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassification getBranch() {
|
||||
return branch;
|
||||
}
|
||||
@Override
|
||||
public IClassification getBranch() {
|
||||
return branch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIconProvider getIconProvider() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIconProvider getIconProvider() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabutterflies.species." + toString().toLowerCase();
|
||||
}
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabutterflies.species." + toString().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEntityTexture() {
|
||||
return texture.getResourceLocation().toString();
|
||||
}
|
||||
@Override
|
||||
public String getEntityTexture() {
|
||||
return texture.getResourceLocation().toString();
|
||||
}
|
||||
|
||||
public IAllele[] getTemplate() {
|
||||
IAllele[] def = getRoot().getDefaultTemplate().clone();
|
||||
def[0] = this;
|
||||
return def;
|
||||
}
|
||||
public IAllele[] getTemplate() {
|
||||
IAllele[] def = getRoot().getDefaultTemplate().clone();
|
||||
def[0] = this;
|
||||
return def;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IButterflyRoot getRoot() {
|
||||
return Binnie.Genetics.getButterflyRoot();
|
||||
}
|
||||
@Override
|
||||
public IButterflyRoot getRoot() {
|
||||
return Binnie.Genetics.getButterflyRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRarity() {
|
||||
return 0.5f;
|
||||
}
|
||||
@Override
|
||||
public float getRarity() {
|
||||
return 0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNocturnal() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isNocturnal() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconColour(int renderPass) {
|
||||
return (renderPass > 0) ? 0xffffff : color;
|
||||
}
|
||||
@Override
|
||||
public int getIconColour(int renderPass) {
|
||||
return (renderPass > 0) ? 0xffffff : color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, Float> getButterflyLoot() {
|
||||
return new HashMap<>();
|
||||
}
|
||||
@Override
|
||||
public Map<ItemStack, Float> getButterflyLoot() {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, Float> getCaterpillarLoot() {
|
||||
return new HashMap<>();
|
||||
}
|
||||
@Override
|
||||
public Map<ItemStack, Float> getCaterpillarLoot() {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComplexity() {
|
||||
return 4;
|
||||
}
|
||||
@Override
|
||||
public int getComplexity() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getResearchSuitability(ItemStack itemstack) {
|
||||
if (itemstack == null) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (itemstack.getItem() == Items.glass_bottle) {
|
||||
return 0.9f;
|
||||
}
|
||||
@Override
|
||||
public float getResearchSuitability(ItemStack itemstack) {
|
||||
if (itemstack == null) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (itemstack.getItem() == Items.glass_bottle) {
|
||||
return 0.9f;
|
||||
}
|
||||
|
||||
for (ItemStack stack : butterflyLoot.keySet()) {
|
||||
if (stack.isItemEqual(itemstack)) {
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
for (ItemStack stack : butterflyLoot.keySet()) {
|
||||
if (stack.isItemEqual(itemstack)) {
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
for (ItemStack stack : caterpillarLoot.keySet()) {
|
||||
if (stack.isItemEqual(itemstack)) {
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
for (ItemStack stack : caterpillarLoot.keySet()) {
|
||||
if (stack.isItemEqual(itemstack)) {
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (itemstack.getItem() == Mods.forestry.item("honeyDrop")) {
|
||||
return 0.5f;
|
||||
}
|
||||
if (itemstack.getItem() == Mods.forestry.item("honeydew")) {
|
||||
return 0.7f;
|
||||
}
|
||||
if (itemstack.getItem() == Mods.forestry.item("beeCombs")) {
|
||||
return 0.4f;
|
||||
}
|
||||
if (AlleleManager.alleleRegistry.isIndividual(itemstack)) {
|
||||
return 1.0f;
|
||||
}
|
||||
if (itemstack.getItem() == Mods.forestry.item("honeyDrop")) {
|
||||
return 0.5f;
|
||||
}
|
||||
if (itemstack.getItem() == Mods.forestry.item("honeydew")) {
|
||||
return 0.7f;
|
||||
}
|
||||
if (itemstack.getItem() == Mods.forestry.item("beeCombs")) {
|
||||
return 0.4f;
|
||||
}
|
||||
if (AlleleManager.alleleRegistry.isIndividual(itemstack)) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
for (Map.Entry<ItemStack, Float> entry : getRoot().getResearchCatalysts().entrySet()) {
|
||||
if (entry.getKey().isItemEqual(itemstack)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
for (Map.Entry<ItemStack, Float> entry :
|
||||
getRoot().getResearchCatalysts().entrySet()) {
|
||||
if (entry.getKey().isItemEqual(itemstack)) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
|
||||
return new ItemStack[]{getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM.ordinal())};
|
||||
}
|
||||
@Override
|
||||
public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
|
||||
return new ItemStack[] {getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM.ordinal())};
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<BiomeDictionary.Type> getSpawnBiomes() {
|
||||
return EnumSet.noneOf(BiomeDictionary.Type.class);
|
||||
}
|
||||
@Override
|
||||
public EnumSet<BiomeDictionary.Type> getSpawnBiomes() {
|
||||
return EnumSet.noneOf(BiomeDictionary.Type.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean strictSpawnMatch() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean strictSpawnMatch() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFlightDistance() {
|
||||
return 5.0f;
|
||||
}
|
||||
@Override
|
||||
public float getFlightDistance() {
|
||||
return 5.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return getUID();
|
||||
}
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return getUID();
|
||||
}
|
||||
}
|
||||
@@ -3,36 +3,36 @@ package binnie.extratrees.genetics;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
|
||||
public enum ExtraTreeFruitFamily implements IFruitFamily {
|
||||
Berry("Berries", "berry", "berri"),
|
||||
Citrus("Citrus", "citrus", "citrus");
|
||||
Berry("Berries", "berry", "berri"),
|
||||
Citrus("Citrus", "citrus", "citrus");
|
||||
|
||||
protected String name;
|
||||
protected String uid;
|
||||
protected String scientific;
|
||||
protected String name;
|
||||
protected String uid;
|
||||
protected String scientific;
|
||||
|
||||
ExtraTreeFruitFamily(String name, String uid, String scientific) {
|
||||
this.name = name;
|
||||
this.uid = uid;
|
||||
this.scientific = scientific;
|
||||
}
|
||||
ExtraTreeFruitFamily(String name, String uid, String scientific) {
|
||||
this.name = name;
|
||||
this.uid = uid;
|
||||
this.scientific = scientific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "binnie.family." + uid;
|
||||
}
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "binnie.family." + uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScientific() {
|
||||
return scientific;
|
||||
}
|
||||
@Override
|
||||
public String getScientific() {
|
||||
return scientific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return name;
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
@@ -18,424 +18,433 @@ import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.arboriculture.FruitProviderNone;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleTreeSpecies;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
Blackthorn(10, 0x6d8f1e, 0xde2f69, FruitSprite.Small),
|
||||
CherryPlum(10, 0x6d8f1e, 0xe81c4b, FruitSprite.Small),
|
||||
Peach(10, 0x6d8f1e, 0xfaa023, FruitSprite.Average),
|
||||
Nectarine(10, 0x6d8f1e, 0xfa5523, FruitSprite.Average),
|
||||
Apricot(10, 0x6d8f1e, 0xfacf23, FruitSprite.Average),
|
||||
Almond(10, 0x6d8f1e, 0x8ee376, FruitSprite.Small),
|
||||
WildCherry(10, 0x6d8f1e, 0xff0000, FruitSprite.Tiny),
|
||||
SourCherry(10, 0x6d8f1e, 0x9c092b, FruitSprite.Tiny),
|
||||
BlackCherry(10, 0x6d8f1e, 0x4a0a19, FruitSprite.Tiny),
|
||||
Orange(10, 0x37f043, 0xff940a, FruitSprite.Average),
|
||||
Manderin(10, 0x37f043, 0xff940a, FruitSprite.Average),
|
||||
Tangerine(10, 0x37f043, 0xff940a, FruitSprite.Average),
|
||||
Satsuma(10, 0x37f043, 0xff940a, FruitSprite.Average),
|
||||
KeyLime(10, 0x37f043, 0x9bff44, FruitSprite.Small),
|
||||
Lime(10, 0x37f043, 0x9bff44, FruitSprite.Average),
|
||||
FingerLime(10, 0x37f043, 0xaa3b38, FruitSprite.Small),
|
||||
Pomelo(10, 0x37f043, 0x5cd34a, FruitSprite.Larger),
|
||||
Grapefruit(10, 0x37f043, 0xff940a, FruitSprite.Large),
|
||||
Kumquat(10, 0x37f043, 0xff940a, FruitSprite.Small),
|
||||
Citron(10, 0x37f043, 0xffec60, FruitSprite.Large),
|
||||
BuddhaHand(10, 0x37f043, 0xffec60, FruitSprite.Large),
|
||||
Apple(10, 0x78c953, 0xf71616, FruitSprite.Average),
|
||||
Crabapple(10, 0x78c953, 0xffbd4c, FruitSprite.Average),
|
||||
Banana("Banana", FruitPod.Banana),
|
||||
RedBanana("Red Banana", FruitPod.RedBanana),
|
||||
Plantain("Platain", FruitPod.Plantain),
|
||||
Hazelnut(7, 0x7d791e, 0xdcb276, FruitSprite.Small),
|
||||
Butternut(7, 0xb2b750, 0xf5b462, FruitSprite.Small),
|
||||
Beechnut(8, 0xdbbe7c, 0x5f3e35, FruitSprite.Tiny),
|
||||
Pecan(8, 0xa2ac4c, 0xf0cf89, FruitSprite.Small),
|
||||
BrazilNut(10, 0x59a769, 0x965530, FruitSprite.Large),
|
||||
Fig(9, 0xd8b162, 0x6c3f46, FruitSprite.Small),
|
||||
Acorn(6, 0x72b226, 0xad6a1d, FruitSprite.Tiny),
|
||||
Elderberry(9, 0x71975d, 0x515b43, FruitSprite.Tiny),
|
||||
Olive(9, 0x879e35, 0x62572a, FruitSprite.Small),
|
||||
GingkoNut(7, 0x8c975b, 0xe5daad, FruitSprite.Tiny),
|
||||
Coffee(8, 0x716d1d, 0xf84f66, FruitSprite.Tiny),
|
||||
Pear(10, 0x9f8f51, 0x9fd551, FruitSprite.Pear),
|
||||
OsangeOsange(10, 0x979752, 0xa2bf27, FruitSprite.Larger),
|
||||
Clove(9, 0x687c2c, 0xab4445, FruitSprite.Tiny),
|
||||
Coconut("Coconut", FruitPod.Coconut),
|
||||
Cashew(8, 0xc4851c, 0xe94b17, FruitSprite.Average),
|
||||
Avacado(10, 0x9cbe72, 0x211f10, FruitSprite.Pear),
|
||||
Nutmeg(9, 0xe2c32d, 0xac8355, FruitSprite.Tiny),
|
||||
Allspice(9, 0xe7a47a, 0x714636, FruitSprite.Tiny),
|
||||
Chilli(10, 0x716265, 0xe71832, FruitSprite.Small),
|
||||
StarAnise(8, 0x85442e, 0xd45c05, FruitSprite.Tiny),
|
||||
Mango(10, 0x658c15, 0xf2a636, FruitSprite.Average),
|
||||
Starfruit(10, 0x95c20d, 0xe5d22e, FruitSprite.Average),
|
||||
Candlenut(8, 0x7da873, 0xdecab2, FruitSprite.Small),
|
||||
Papayimar("Papayimar", FruitPod.Papayimar),
|
||||
Blackcurrant(8, 0x8f8c53, 0x4b4e53, FruitSprite.Tiny),
|
||||
Redcurrant(8, 0xc6800e, 0xe61e0e, FruitSprite.Tiny),
|
||||
Blackberry(8, 0x8f6d71, 0x494371, FruitSprite.Tiny),
|
||||
Raspberry(8, 0xecd1c5, 0xdd6971, FruitSprite.Tiny),
|
||||
Blueberry(8, 0x9bb297, 0x6093be, FruitSprite.Tiny),
|
||||
Cranberry(8, 0xbaa730, 0xde1a30, FruitSprite.Tiny),
|
||||
Juniper(8, 0x9b8c72, 0x606372, FruitSprite.Tiny),
|
||||
Gooseberry(8, 0xb99f50, 0xb9cf50, FruitSprite.Tiny),
|
||||
GoldenRaspberry(8, 0xbeb03b, 0xf3b03b, FruitSprite.Tiny);
|
||||
Blackthorn(10, 0x6d8f1e, 0xde2f69, FruitSprite.Small),
|
||||
CherryPlum(10, 0x6d8f1e, 0xe81c4b, FruitSprite.Small),
|
||||
Peach(10, 0x6d8f1e, 0xfaa023, FruitSprite.Average),
|
||||
Nectarine(10, 0x6d8f1e, 0xfa5523, FruitSprite.Average),
|
||||
Apricot(10, 0x6d8f1e, 0xfacf23, FruitSprite.Average),
|
||||
Almond(10, 0x6d8f1e, 0x8ee376, FruitSprite.Small),
|
||||
WildCherry(10, 0x6d8f1e, 0xff0000, FruitSprite.Tiny),
|
||||
SourCherry(10, 0x6d8f1e, 0x9c092b, FruitSprite.Tiny),
|
||||
BlackCherry(10, 0x6d8f1e, 0x4a0a19, FruitSprite.Tiny),
|
||||
Orange(10, 0x37f043, 0xff940a, FruitSprite.Average),
|
||||
Manderin(10, 0x37f043, 0xff940a, FruitSprite.Average),
|
||||
Tangerine(10, 0x37f043, 0xff940a, FruitSprite.Average),
|
||||
Satsuma(10, 0x37f043, 0xff940a, FruitSprite.Average),
|
||||
KeyLime(10, 0x37f043, 0x9bff44, FruitSprite.Small),
|
||||
Lime(10, 0x37f043, 0x9bff44, FruitSprite.Average),
|
||||
FingerLime(10, 0x37f043, 0xaa3b38, FruitSprite.Small),
|
||||
Pomelo(10, 0x37f043, 0x5cd34a, FruitSprite.Larger),
|
||||
Grapefruit(10, 0x37f043, 0xff940a, FruitSprite.Large),
|
||||
Kumquat(10, 0x37f043, 0xff940a, FruitSprite.Small),
|
||||
Citron(10, 0x37f043, 0xffec60, FruitSprite.Large),
|
||||
BuddhaHand(10, 0x37f043, 0xffec60, FruitSprite.Large),
|
||||
Apple(10, 0x78c953, 0xf71616, FruitSprite.Average),
|
||||
Crabapple(10, 0x78c953, 0xffbd4c, FruitSprite.Average),
|
||||
Banana("Banana", FruitPod.Banana),
|
||||
RedBanana("Red Banana", FruitPod.RedBanana),
|
||||
Plantain("Platain", FruitPod.Plantain),
|
||||
Hazelnut(7, 0x7d791e, 0xdcb276, FruitSprite.Small),
|
||||
Butternut(7, 0xb2b750, 0xf5b462, FruitSprite.Small),
|
||||
Beechnut(8, 0xdbbe7c, 0x5f3e35, FruitSprite.Tiny),
|
||||
Pecan(8, 0xa2ac4c, 0xf0cf89, FruitSprite.Small),
|
||||
BrazilNut(10, 0x59a769, 0x965530, FruitSprite.Large),
|
||||
Fig(9, 0xd8b162, 0x6c3f46, FruitSprite.Small),
|
||||
Acorn(6, 0x72b226, 0xad6a1d, FruitSprite.Tiny),
|
||||
Elderberry(9, 0x71975d, 0x515b43, FruitSprite.Tiny),
|
||||
Olive(9, 0x879e35, 0x62572a, FruitSprite.Small),
|
||||
GingkoNut(7, 0x8c975b, 0xe5daad, FruitSprite.Tiny),
|
||||
Coffee(8, 0x716d1d, 0xf84f66, FruitSprite.Tiny),
|
||||
Pear(10, 0x9f8f51, 0x9fd551, FruitSprite.Pear),
|
||||
OsangeOsange(10, 0x979752, 0xa2bf27, FruitSprite.Larger),
|
||||
Clove(9, 0x687c2c, 0xab4445, FruitSprite.Tiny),
|
||||
Coconut("Coconut", FruitPod.Coconut),
|
||||
Cashew(8, 0xc4851c, 0xe94b17, FruitSprite.Average),
|
||||
Avacado(10, 0x9cbe72, 0x211f10, FruitSprite.Pear),
|
||||
Nutmeg(9, 0xe2c32d, 0xac8355, FruitSprite.Tiny),
|
||||
Allspice(9, 0xe7a47a, 0x714636, FruitSprite.Tiny),
|
||||
Chilli(10, 0x716265, 0xe71832, FruitSprite.Small),
|
||||
StarAnise(8, 0x85442e, 0xd45c05, FruitSprite.Tiny),
|
||||
Mango(10, 0x658c15, 0xf2a636, FruitSprite.Average),
|
||||
Starfruit(10, 0x95c20d, 0xe5d22e, FruitSprite.Average),
|
||||
Candlenut(8, 0x7da873, 0xdecab2, FruitSprite.Small),
|
||||
Papayimar("Papayimar", FruitPod.Papayimar),
|
||||
Blackcurrant(8, 0x8f8c53, 0x4b4e53, FruitSprite.Tiny),
|
||||
Redcurrant(8, 0xc6800e, 0xe61e0e, FruitSprite.Tiny),
|
||||
Blackberry(8, 0x8f6d71, 0x494371, FruitSprite.Tiny),
|
||||
Raspberry(8, 0xecd1c5, 0xdd6971, FruitSprite.Tiny),
|
||||
Blueberry(8, 0x9bb297, 0x6093be, FruitSprite.Tiny),
|
||||
Cranberry(8, 0xbaa730, 0xde1a30, FruitSprite.Tiny),
|
||||
Juniper(8, 0x9b8c72, 0x606372, FruitSprite.Tiny),
|
||||
Gooseberry(8, 0xb99f50, 0xb9cf50, FruitSprite.Tiny),
|
||||
GoldenRaspberry(8, 0xbeb03b, 0xf3b03b, FruitSprite.Tiny);
|
||||
|
||||
protected IFruitFamily family;
|
||||
protected boolean isRipening;
|
||||
protected int diffR;
|
||||
protected int diffG;
|
||||
protected int diffB;
|
||||
protected FruitPod pod;
|
||||
protected int ripeningPeriod;
|
||||
protected int colorUnripe;
|
||||
protected int color;
|
||||
protected FruitSprite index;
|
||||
protected HashMap<ItemStack, Float> products;
|
||||
protected IFruitFamily family;
|
||||
protected boolean isRipening;
|
||||
protected int diffR;
|
||||
protected int diffG;
|
||||
protected int diffB;
|
||||
protected FruitPod pod;
|
||||
protected int ripeningPeriod;
|
||||
protected int colorUnripe;
|
||||
protected int color;
|
||||
protected FruitSprite index;
|
||||
protected HashMap<ItemStack, Float> products;
|
||||
|
||||
ExtraTreeFruitGene(int time, int unripe, int color, FruitSprite index) {
|
||||
this.color = color;
|
||||
this.index = index;
|
||||
isRipening = false;
|
||||
diffB = 0;
|
||||
pod = null;
|
||||
ripeningPeriod = 0;
|
||||
products = new HashMap<>();
|
||||
setRipening(time, unripe);
|
||||
}
|
||||
ExtraTreeFruitGene(int time, int unripe, int color, FruitSprite index) {
|
||||
this.color = color;
|
||||
this.index = index;
|
||||
isRipening = false;
|
||||
diffB = 0;
|
||||
pod = null;
|
||||
ripeningPeriod = 0;
|
||||
products = new HashMap<>();
|
||||
setRipening(time, unripe);
|
||||
}
|
||||
|
||||
ExtraTreeFruitGene(String name, FruitPod pod) {
|
||||
this.pod = pod;
|
||||
isRipening = false;
|
||||
diffB = 0;
|
||||
products = new HashMap<>();
|
||||
ripeningPeriod = 2;
|
||||
}
|
||||
ExtraTreeFruitGene(String name, FruitPod pod) {
|
||||
this.pod = pod;
|
||||
isRipening = false;
|
||||
diffB = 0;
|
||||
products = new HashMap<>();
|
||||
ripeningPeriod = 2;
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
IFruitFamily familyPrune = AlleleManager.alleleRegistry.getFruitFamily("forestry.prunes");
|
||||
IFruitFamily familyPome = AlleleManager.alleleRegistry.getFruitFamily("forestry.pomes");
|
||||
IFruitFamily familyJungle = AlleleManager.alleleRegistry.getFruitFamily("forestry.jungle");
|
||||
IFruitFamily familyNuts = AlleleManager.alleleRegistry.getFruitFamily("forestry.nuts");
|
||||
IFruitFamily familyBerry = ExtraTreeFruitFamily.Berry;
|
||||
IFruitFamily familyCitrus = ExtraTreeFruitFamily.Citrus;
|
||||
AlleleManager.alleleRegistry.registerFruitFamily(familyBerry);
|
||||
AlleleManager.alleleRegistry.registerFruitFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Apple.addProduct(new ItemStack(Items.apple), 1.0f);
|
||||
ExtraTreeFruitGene.Apple.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Crabapple.addProduct(Food.Crabapple.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Crabapple.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Orange.addProduct(Food.Orange.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Orange.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Manderin.addProduct(Food.Manderin.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Manderin.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Tangerine.addProduct(Food.Tangerine.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Tangerine.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Satsuma.addProduct(Food.Satsuma.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Satsuma.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.KeyLime.addProduct(Food.KeyLime.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.KeyLime.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Lime.addProduct(Food.Lime.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Lime.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.FingerLime.addProduct(Food.FingerLime.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.FingerLime.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Pomelo.addProduct(Food.Pomelo.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Pomelo.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Grapefruit.addProduct(Food.Grapefruit.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Grapefruit.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Kumquat.addProduct(Food.Kumquat.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Kumquat.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Citron.addProduct(Food.Citron.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Citron.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.BuddhaHand.addProduct(Food.BuddhaHand.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.BuddhaHand.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Blackthorn.addProduct(Food.Blackthorn.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Blackthorn.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.CherryPlum.addProduct(Food.CherryPlum.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.CherryPlum.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Peach.addProduct(Food.Peach.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Peach.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Nectarine.addProduct(Food.Nectarine.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Nectarine.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Apricot.addProduct(Food.Apricot.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Apricot.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Almond.addProduct(Food.Almond.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Almond.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.WildCherry.addProduct(Food.WildCherry.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.WildCherry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.SourCherry.addProduct(Food.SourCherry.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.SourCherry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.BlackCherry.addProduct(Food.BlackCherry.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.BlackCherry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Hazelnut.addProduct(Food.Hazelnut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Hazelnut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Butternut.addProduct(Food.Butternut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Butternut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Beechnut.addProduct(Food.Beechnut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Beechnut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Pecan.addProduct(Food.Pecan.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Pecan.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Banana.addProduct(Food.Banana.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Banana.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.RedBanana.addProduct(Food.RedBanana.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.RedBanana.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Plantain.addProduct(Food.Plantain.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Plantain.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.BrazilNut.addProduct(Food.BrazilNut.get(4), 1.0f);
|
||||
ExtraTreeFruitGene.BrazilNut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Fig.addProduct(Food.Fig.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Fig.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Acorn.addProduct(Food.Acorn.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Acorn.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Elderberry.addProduct(Food.Elderberry.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Elderberry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Olive.addProduct(Food.Olive.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Olive.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.GingkoNut.addProduct(Food.GingkoNut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.GingkoNut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Coffee.addProduct(Food.Coffee.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Coffee.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Pear.addProduct(Food.Pear.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Pear.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.OsangeOsange.addProduct(Food.OsangeOrange.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.OsangeOsange.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Clove.addProduct(Food.Clove.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Clove.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Blackcurrant.addProduct(Food.Blackcurrant.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Blackcurrant.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Redcurrant.addProduct(Food.Redcurrant.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Redcurrant.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Blackberry.addProduct(Food.Blackberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Blackberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Raspberry.addProduct(Food.Raspberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Raspberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Blueberry.addProduct(Food.Blueberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Blueberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Cranberry.addProduct(Food.Cranberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Cranberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Juniper.addProduct(Food.Juniper.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Juniper.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Gooseberry.addProduct(Food.Gooseberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Gooseberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.GoldenRaspberry.addProduct(Food.GoldenRaspberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.GoldenRaspberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Coconut.addProduct(Food.Coconut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Coconut.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Cashew.addProduct(Food.Cashew.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Cashew.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Avacado.addProduct(Food.Avacado.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Avacado.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Nutmeg.addProduct(Food.Nutmeg.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Nutmeg.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Allspice.addProduct(Food.Allspice.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Allspice.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Chilli.addProduct(Food.Chilli.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Chilli.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.StarAnise.addProduct(Food.StarAnise.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.StarAnise.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Mango.addProduct(Food.Mango.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Mango.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Starfruit.addProduct(Food.Starfruit.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Starfruit.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Candlenut.addProduct(Food.Candlenut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Candlenut.setFamily(familyJungle);
|
||||
public static void init() {
|
||||
IFruitFamily familyPrune = AlleleManager.alleleRegistry.getFruitFamily("forestry.prunes");
|
||||
IFruitFamily familyPome = AlleleManager.alleleRegistry.getFruitFamily("forestry.pomes");
|
||||
IFruitFamily familyJungle = AlleleManager.alleleRegistry.getFruitFamily("forestry.jungle");
|
||||
IFruitFamily familyNuts = AlleleManager.alleleRegistry.getFruitFamily("forestry.nuts");
|
||||
IFruitFamily familyBerry = ExtraTreeFruitFamily.Berry;
|
||||
IFruitFamily familyCitrus = ExtraTreeFruitFamily.Citrus;
|
||||
AlleleManager.alleleRegistry.registerFruitFamily(familyBerry);
|
||||
AlleleManager.alleleRegistry.registerFruitFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Apple.addProduct(new ItemStack(Items.apple), 1.0f);
|
||||
ExtraTreeFruitGene.Apple.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Crabapple.addProduct(Food.Crabapple.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Crabapple.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Orange.addProduct(Food.Orange.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Orange.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Manderin.addProduct(Food.Manderin.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Manderin.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Tangerine.addProduct(Food.Tangerine.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Tangerine.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Satsuma.addProduct(Food.Satsuma.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Satsuma.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.KeyLime.addProduct(Food.KeyLime.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.KeyLime.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Lime.addProduct(Food.Lime.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Lime.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.FingerLime.addProduct(Food.FingerLime.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.FingerLime.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Pomelo.addProduct(Food.Pomelo.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Pomelo.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Grapefruit.addProduct(Food.Grapefruit.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Grapefruit.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Kumquat.addProduct(Food.Kumquat.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Kumquat.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Citron.addProduct(Food.Citron.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Citron.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.BuddhaHand.addProduct(Food.BuddhaHand.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.BuddhaHand.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Blackthorn.addProduct(Food.Blackthorn.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Blackthorn.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.CherryPlum.addProduct(Food.CherryPlum.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.CherryPlum.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Peach.addProduct(Food.Peach.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Peach.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Nectarine.addProduct(Food.Nectarine.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Nectarine.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Apricot.addProduct(Food.Apricot.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Apricot.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Almond.addProduct(Food.Almond.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Almond.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.WildCherry.addProduct(Food.WildCherry.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.WildCherry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.SourCherry.addProduct(Food.SourCherry.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.SourCherry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.BlackCherry.addProduct(Food.BlackCherry.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.BlackCherry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Hazelnut.addProduct(Food.Hazelnut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Hazelnut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Butternut.addProduct(Food.Butternut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Butternut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Beechnut.addProduct(Food.Beechnut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Beechnut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Pecan.addProduct(Food.Pecan.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Pecan.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Banana.addProduct(Food.Banana.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Banana.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.RedBanana.addProduct(Food.RedBanana.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.RedBanana.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Plantain.addProduct(Food.Plantain.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Plantain.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.BrazilNut.addProduct(Food.BrazilNut.get(4), 1.0f);
|
||||
ExtraTreeFruitGene.BrazilNut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Fig.addProduct(Food.Fig.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Fig.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Acorn.addProduct(Food.Acorn.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Acorn.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Elderberry.addProduct(Food.Elderberry.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Elderberry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Olive.addProduct(Food.Olive.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Olive.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.GingkoNut.addProduct(Food.GingkoNut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.GingkoNut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Coffee.addProduct(Food.Coffee.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Coffee.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Pear.addProduct(Food.Pear.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Pear.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.OsangeOsange.addProduct(Food.OsangeOrange.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.OsangeOsange.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Clove.addProduct(Food.Clove.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Clove.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Blackcurrant.addProduct(Food.Blackcurrant.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Blackcurrant.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Redcurrant.addProduct(Food.Redcurrant.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Redcurrant.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Blackberry.addProduct(Food.Blackberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Blackberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Raspberry.addProduct(Food.Raspberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Raspberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Blueberry.addProduct(Food.Blueberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Blueberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Cranberry.addProduct(Food.Cranberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Cranberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Juniper.addProduct(Food.Juniper.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Juniper.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Gooseberry.addProduct(Food.Gooseberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Gooseberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.GoldenRaspberry.addProduct(Food.GoldenRaspberry.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.GoldenRaspberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Coconut.addProduct(Food.Coconut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Coconut.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Cashew.addProduct(Food.Cashew.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Cashew.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Avacado.addProduct(Food.Avacado.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Avacado.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Nutmeg.addProduct(Food.Nutmeg.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Nutmeg.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Allspice.addProduct(Food.Allspice.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Allspice.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Chilli.addProduct(Food.Chilli.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Chilli.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.StarAnise.addProduct(Food.StarAnise.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.StarAnise.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Mango.addProduct(Food.Mango.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Mango.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Starfruit.addProduct(Food.Starfruit.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Starfruit.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Candlenut.addProduct(Food.Candlenut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Candlenut.setFamily(familyJungle);
|
||||
|
||||
if (ConfigurationMain.alterLemon) {
|
||||
try {
|
||||
IAlleleFruit lemon = (IAlleleFruit) AlleleManager.alleleRegistry.getAllele("forestry.fruitLemon");
|
||||
FruitProviderNone prov = (FruitProviderNone) lemon.getProvider();
|
||||
Field f = FruitProviderNone.class.getDeclaredField("family");
|
||||
Field modifiersField = Field.class.getDeclaredField("modifiers");
|
||||
f.setAccessible(true);
|
||||
modifiersField.setAccessible(true);
|
||||
modifiersField.setInt(f, f.getModifiers() & 0xFFFFFFEF);
|
||||
f.set(prov, familyCitrus);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (ConfigurationMain.alterLemon) {
|
||||
try {
|
||||
IAlleleFruit lemon = (IAlleleFruit) AlleleManager.alleleRegistry.getAllele("forestry.fruitLemon");
|
||||
FruitProviderNone prov = (FruitProviderNone) lemon.getProvider();
|
||||
Field f = FruitProviderNone.class.getDeclaredField("family");
|
||||
Field modifiersField = Field.class.getDeclaredField("modifiers");
|
||||
f.setAccessible(true);
|
||||
modifiersField.setAccessible(true);
|
||||
modifiersField.setInt(f, f.getModifiers() & 0xFFFFFFEF);
|
||||
f.set(prov, familyCitrus);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
for (IAlleleSpecies tree : Binnie.Genetics.treeBreedingSystem.getAllSpecies()) {
|
||||
if (tree instanceof AlleleTreeSpecies && ((IAlleleTreeSpecies) tree).getSuitableFruit().contains(familyPrune)) {
|
||||
((AlleleTreeSpecies) tree).addFruitFamily(familyCitrus);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (IAlleleSpecies tree : Binnie.Genetics.treeBreedingSystem.getAllSpecies()) {
|
||||
if (tree instanceof AlleleTreeSpecies
|
||||
&& ((IAlleleTreeSpecies) tree).getSuitableFruit().contains(familyPrune)) {
|
||||
((AlleleTreeSpecies) tree).addFruitFamily(familyCitrus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRipening(int time, int unripe) {
|
||||
ripeningPeriod = time;
|
||||
colorUnripe = unripe;
|
||||
isRipening = true;
|
||||
diffR = (color >> 16 & 0xFF) - (unripe >> 16 & 0xFF);
|
||||
diffG = (color >> 8 & 0xFF) - (unripe >> 8 & 0xFF);
|
||||
diffB = (color & 0xFF) - (unripe & 0xFF);
|
||||
}
|
||||
public void setRipening(int time, int unripe) {
|
||||
ripeningPeriod = time;
|
||||
colorUnripe = unripe;
|
||||
isRipening = true;
|
||||
diffR = (color >> 16 & 0xFF) - (unripe >> 16 & 0xFF);
|
||||
diffG = (color >> 8 & 0xFF) - (unripe >> 8 & 0xFF);
|
||||
diffB = (color & 0xFF) - (unripe & 0xFF);
|
||||
}
|
||||
|
||||
public void addProduct(ItemStack product, float chance) {
|
||||
products.put(product, chance);
|
||||
}
|
||||
public void addProduct(ItemStack product, float chance) {
|
||||
products.put(product, chance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extratrees.fruit." + toString().toLowerCase();
|
||||
}
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extratrees.fruit." + toString().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFruitProvider getProvider() {
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
public IFruitProvider getProvider() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getProducts() {
|
||||
return products.keySet().toArray(new ItemStack[0]);
|
||||
}
|
||||
@Override
|
||||
public ItemStack[] getProducts() {
|
||||
return products.keySet().toArray(new ItemStack[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getSpecialty() {
|
||||
return new ItemStack[0];
|
||||
}
|
||||
@Override
|
||||
public ItemStack[] getSpecialty() {
|
||||
return new ItemStack[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "extratrees.item.food." + name().toLowerCase();
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "extratrees.item.food." + name().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFruitFamily getFamily() {
|
||||
return family;
|
||||
}
|
||||
@Override
|
||||
public IFruitFamily getFamily() {
|
||||
return family;
|
||||
}
|
||||
|
||||
private void setFamily(IFruitFamily family) {
|
||||
this.family = family;
|
||||
}
|
||||
private void setFamily(IFruitFamily family) {
|
||||
this.family = family;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime) {
|
||||
if (!isRipening) {
|
||||
return color;
|
||||
}
|
||||
@Override
|
||||
public int getColour(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime) {
|
||||
if (!isRipening) {
|
||||
return color;
|
||||
}
|
||||
|
||||
float stage = getRipeningStage(ripeningTime);
|
||||
int r = (colorUnripe >> 16 & 0xFF) + (int) (diffR * stage);
|
||||
int g = (colorUnripe >> 8 & 0xFF) + (int) (diffG * stage);
|
||||
int b = (colorUnripe & 0xFF) + (int) (diffB * stage);
|
||||
return (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF);
|
||||
}
|
||||
float stage = getRipeningStage(ripeningTime);
|
||||
int r = (colorUnripe >> 16 & 0xFF) + (int) (diffR * stage);
|
||||
int g = (colorUnripe >> 8 & 0xFF) + (int) (diffG * stage);
|
||||
int b = (colorUnripe & 0xFF) + (int) (diffB * stage);
|
||||
return (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean markAsFruitLeaf(ITreeGenome genome, World world, int x, int y, int z) {
|
||||
return pod == null;
|
||||
}
|
||||
@Override
|
||||
public boolean markAsFruitLeaf(ITreeGenome genome, World world, int x, int y, int z) {
|
||||
return pod == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRipeningPeriod() {
|
||||
return ripeningPeriod;
|
||||
}
|
||||
@Override
|
||||
public int getRipeningPeriod() {
|
||||
return ripeningPeriod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime) {
|
||||
if (pod != null) {
|
||||
if (ripeningTime >= 2) {
|
||||
List<ItemStack> product = new ArrayList<>();
|
||||
for (Map.Entry<ItemStack, Float> entry : products.entrySet()) {
|
||||
ItemStack single = entry.getKey().copy();
|
||||
single.stackSize = 1;
|
||||
for (int i = 0; i < entry.getKey().stackSize; ++i) {
|
||||
if (world.rand.nextFloat() <= entry.getValue()) {
|
||||
product.add(single.copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
return product.toArray(new ItemStack[0]);
|
||||
}
|
||||
return new ItemStack[0];
|
||||
}
|
||||
@Override
|
||||
public ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime) {
|
||||
if (pod != null) {
|
||||
if (ripeningTime >= 2) {
|
||||
List<ItemStack> product = new ArrayList<>();
|
||||
for (Map.Entry<ItemStack, Float> entry : products.entrySet()) {
|
||||
ItemStack single = entry.getKey().copy();
|
||||
single.stackSize = 1;
|
||||
for (int i = 0; i < entry.getKey().stackSize; ++i) {
|
||||
if (world.rand.nextFloat() <= entry.getValue()) {
|
||||
product.add(single.copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
return product.toArray(new ItemStack[0]);
|
||||
}
|
||||
return new ItemStack[0];
|
||||
}
|
||||
|
||||
ArrayList<ItemStack> product2 = new ArrayList<>();
|
||||
float stage = getRipeningStage(ripeningTime);
|
||||
if (stage < 0.5f) {
|
||||
return new ItemStack[0];
|
||||
}
|
||||
ArrayList<ItemStack> product2 = new ArrayList<>();
|
||||
float stage = getRipeningStage(ripeningTime);
|
||||
if (stage < 0.5f) {
|
||||
return new ItemStack[0];
|
||||
}
|
||||
|
||||
float modeYieldMod = 1.0f;
|
||||
for (Map.Entry<ItemStack, Float> entry2 : products.entrySet()) {
|
||||
if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * entry2.getValue() * stage) {
|
||||
product2.add(entry2.getKey().copy());
|
||||
}
|
||||
}
|
||||
return product2.toArray(new ItemStack[0]);
|
||||
}
|
||||
float modeYieldMod = 1.0f;
|
||||
for (Map.Entry<ItemStack, Float> entry2 : products.entrySet()) {
|
||||
if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * entry2.getValue() * stage) {
|
||||
product2.add(entry2.getKey().copy());
|
||||
}
|
||||
}
|
||||
return product2.toArray(new ItemStack[0]);
|
||||
}
|
||||
|
||||
private float getRipeningStage(int ripeningTime) {
|
||||
if (ripeningTime >= ripeningPeriod) {
|
||||
return 1.0f;
|
||||
}
|
||||
return ripeningTime / ripeningPeriod;
|
||||
}
|
||||
private float getRipeningStage(int ripeningTime) {
|
||||
if (ripeningTime >= ripeningPeriod) {
|
||||
return 1.0f;
|
||||
}
|
||||
return ripeningTime / ripeningPeriod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresFruitBlocks() {
|
||||
return pod != null;
|
||||
}
|
||||
@Override
|
||||
public boolean requiresFruitBlocks() {
|
||||
return pod != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean trySpawnFruitBlock(ITreeGenome genome, World world, int x, int y, int z) {
|
||||
return pod != null
|
||||
&& world.rand.nextFloat() <= genome.getSappiness()
|
||||
&& Binnie.Genetics.getTreeRoot().setFruitBlock(world, (IAlleleFruit) genome.getActiveAllele(EnumTreeChromosome.FRUITS), genome.getSappiness(), pod.getTextures(), x, y, z);
|
||||
}
|
||||
@Override
|
||||
public boolean trySpawnFruitBlock(ITreeGenome genome, World world, int x, int y, int z) {
|
||||
return pod != null
|
||||
&& world.rand.nextFloat() <= genome.getSappiness()
|
||||
&& Binnie.Genetics.getTreeRoot()
|
||||
.setFruitBlock(
|
||||
world,
|
||||
(IAlleleFruit) genome.getActiveAllele(EnumTreeChromosome.FRUITS),
|
||||
genome.getSappiness(),
|
||||
pod.getTextures(),
|
||||
x,
|
||||
y,
|
||||
z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getIconIndex(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy) {
|
||||
return index.getIndex();
|
||||
}
|
||||
@Override
|
||||
public short getIconIndex(
|
||||
ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy) {
|
||||
return index.getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
if (ordinal() == 0) {
|
||||
for (FruitSprite sprite : FruitSprite.values()) {
|
||||
sprite.registerIcons(register);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
if (ordinal() == 0) {
|
||||
for (FruitSprite sprite : FruitSprite.values()) {
|
||||
sprite.registerIcons(register);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("for." + getDescription());
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("for." + getDescription());
|
||||
}
|
||||
|
||||
public String getNameOfFruit() {
|
||||
if (this == ExtraTreeFruitGene.Apple) {
|
||||
return "Apple";
|
||||
}
|
||||
public String getNameOfFruit() {
|
||||
if (this == ExtraTreeFruitGene.Apple) {
|
||||
return "Apple";
|
||||
}
|
||||
|
||||
for (ItemStack stack : products.keySet()) {
|
||||
if (stack.getItem() == ExtraTrees.itemFood) {
|
||||
return Food.values()[stack.getItemDamage()].toString();
|
||||
}
|
||||
}
|
||||
return "NoFruit";
|
||||
}
|
||||
for (ItemStack stack : products.keySet()) {
|
||||
if (stack.getItem() == ExtraTrees.itemFood) {
|
||||
return Food.values()[stack.getItemDamage()].toString();
|
||||
}
|
||||
}
|
||||
return "NoFruit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return getUID();
|
||||
}
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return getUID();
|
||||
}
|
||||
}
|
||||
@@ -8,229 +8,247 @@ import forestry.api.arboriculture.ITreeMutation;
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
public class ExtraTreeMutation implements ITreeMutation {
|
||||
protected int chance;
|
||||
protected boolean isSecret;
|
||||
protected IAlleleTreeSpecies allele0;
|
||||
protected IAlleleTreeSpecies allele1;
|
||||
protected IAllele[] template;
|
||||
protected int chance;
|
||||
protected boolean isSecret;
|
||||
protected IAlleleTreeSpecies allele0;
|
||||
protected IAlleleTreeSpecies allele1;
|
||||
protected IAllele[] template;
|
||||
|
||||
private float minTemperature;
|
||||
private float maxTemperature;
|
||||
private float minRainfall;
|
||||
private float maxRainfall;
|
||||
private float height;
|
||||
private float minTemperature;
|
||||
private float maxTemperature;
|
||||
private float minRainfall;
|
||||
private float maxRainfall;
|
||||
private float height;
|
||||
|
||||
public ExtraTreeMutation(IAllele allele0, IAllele allele1, IAllele result, int chance) {
|
||||
this(allele0, allele1, Binnie.Genetics.getTreeRoot().getTemplate(result.getUID()), chance);
|
||||
}
|
||||
public ExtraTreeMutation(IAllele allele0, IAllele allele1, IAllele result, int chance) {
|
||||
this(allele0, allele1, Binnie.Genetics.getTreeRoot().getTemplate(result.getUID()), chance);
|
||||
}
|
||||
|
||||
public ExtraTreeMutation(IAllele allele0, IAllele allele1, IAllele[] template, int chance) {
|
||||
isSecret = false;
|
||||
minTemperature = 0.0f;
|
||||
maxTemperature = 2.0f;
|
||||
minRainfall = 0.0f;
|
||||
maxRainfall = 2.0f;
|
||||
height = -1.0f;
|
||||
this.allele0 = (IAlleleTreeSpecies) allele0;
|
||||
this.allele1 = (IAlleleTreeSpecies) allele1;
|
||||
this.template = template;
|
||||
this.chance = chance;
|
||||
Binnie.Genetics.getTreeRoot().registerMutation(this);
|
||||
}
|
||||
public ExtraTreeMutation(IAllele allele0, IAllele allele1, IAllele[] template, int chance) {
|
||||
isSecret = false;
|
||||
minTemperature = 0.0f;
|
||||
maxTemperature = 2.0f;
|
||||
minRainfall = 0.0f;
|
||||
maxRainfall = 2.0f;
|
||||
height = -1.0f;
|
||||
this.allele0 = (IAlleleTreeSpecies) allele0;
|
||||
this.allele1 = (IAlleleTreeSpecies) allele1;
|
||||
this.template = template;
|
||||
this.chance = chance;
|
||||
Binnie.Genetics.getTreeRoot().registerMutation(this);
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
IAlleleTreeSpecies lemon = (IAlleleTreeSpecies) getVanilla("Lemon");
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ExtraTreeSpecies.KeyLime, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.KeyLime, lemon, ExtraTreeSpecies.FingerLime, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ExtraTreeSpecies.Pomelo, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, getVanilla("Cherry"), ExtraTreeSpecies.Manderin, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, lemon, ExtraTreeSpecies.Citron, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Manderin, getVanilla("Cherry"), ExtraTreeSpecies.Kumquat, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Orange, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Citron, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.BuddhaHand, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Kumquat, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Tangerine, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Kumquat, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Satsuma, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.Orange, ExtraTreeSpecies.Grapefruit, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.KeyLime, ExtraTreeSpecies.Lime, 10);
|
||||
new ExtraTreeMutation(getVanilla("Oak"), getVanilla("Cherry"), ExtraTreeSpecies.OrchardApple, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Maple"), ExtraTreeSpecies.SweetCrabapple, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, ExtraTreeSpecies.SweetCrabapple, ExtraTreeSpecies.FloweringCrabapple, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Birch"), ExtraTreeSpecies.PrairieCrabapple, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.OrchardApple, ExtraTreeSpecies.Blackthorn, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Cherry"), ExtraTreeSpecies.CherryPlum, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Chestnut"), ExtraTreeSpecies.Peach, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.Peach, ExtraTreeSpecies.Nectarine, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.Peach, ExtraTreeSpecies.Apricot, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Walnut"), ExtraTreeSpecies.Almond, 10);
|
||||
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Cherry"), ExtraTreeSpecies.WildCherry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Willow"), getVanilla("Cherry"), ExtraTreeSpecies.SourCherry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Cherry"), ExtraTreeSpecies.BlackCherry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.Banana, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Banana, getVanilla("Kapok"), ExtraTreeSpecies.RedBanana, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Banana, getVanilla("Teak"), ExtraTreeSpecies.Plantain, 10);
|
||||
new ExtraTreeMutation(getVanilla("Birch"), getVanilla("Oak"), ExtraTreeSpecies.Beech, 10);
|
||||
new ExtraTreeMutation(getVanilla("Birch"), ExtraTreeSpecies.Beech, ExtraTreeSpecies.Alder, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Beech, ExtraTreeSpecies.Aspen, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Alder, ExtraTreeSpecies.Rowan, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Hazel, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, ExtraTreeSpecies.Rowan, ExtraTreeSpecies.Hawthorn, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Elder, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Rowan, ExtraTreeSpecies.Holly, 10);
|
||||
new ExtraTreeMutation(getVanilla("Willow"), ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Sallow, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Birch"), ExtraTreeSpecies.Pecan, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Spruce"), ExtraTreeSpecies.CopperBeech, 10);
|
||||
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Spruce"), ExtraTreeSpecies.Ash, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Birch"), ExtraTreeSpecies.Whitebeam, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Pine"), ExtraTreeSpecies.Elm, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Larch"), ExtraTreeSpecies.Hornbeam, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Maple"), ExtraTreeSpecies.Sycamore, 10);
|
||||
new ExtraTreeMutation(getVanilla("Larch"), getVanilla("Spruce"), ExtraTreeSpecies.Yew, 10);
|
||||
new ExtraTreeMutation(getVanilla("Larch"), ExtraTreeSpecies.Alder, ExtraTreeSpecies.BalsamFir, 10);
|
||||
new ExtraTreeMutation(getVanilla("Pine"), ExtraTreeSpecies.BalsamFir, ExtraTreeSpecies.Fir, 10);
|
||||
new ExtraTreeMutation(getVanilla("Pine"), ExtraTreeSpecies.Fir, ExtraTreeSpecies.Hemlock, 10).setHeight(80);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Fir, getVanilla("Larch"), ExtraTreeSpecies.Cedar, 10).setHeight(60);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Fir, getVanilla("Spruce"), ExtraTreeSpecies.DouglasFir, 10).setHeight(60);
|
||||
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ExtraTreeSpecies.Cypress, 10);
|
||||
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ExtraTreeSpecies.LoblollyPine, 10);
|
||||
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Cherry"), ExtraTreeSpecies.Butternut, 10);
|
||||
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Oak"), ExtraTreeSpecies.AcornOak, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Alder, ExtraTreeSpecies.Olive, 10);
|
||||
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Lime"), ExtraTreeSpecies.RedMaple, 10);
|
||||
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Larch"), ExtraTreeSpecies.Sweetgum, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Lime"), ExtraTreeSpecies.Locust, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Teak"), ExtraTreeSpecies.Iroko, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Birch"), ExtraTreeSpecies.Pear, 10);
|
||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.OldFustic, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.OldFustic, getVanilla("Kapok"), ExtraTreeSpecies.OsangeOsange, 10);
|
||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Brazilwood, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Brazilwood, getVanilla("Kapok"), ExtraTreeSpecies.Purpleheart, 10);
|
||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Rosewood, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Rosewood, getVanilla("Kapok"), ExtraTreeSpecies.Logwood, 10);
|
||||
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Lime"), ExtraTreeSpecies.Gingko, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Jungle"), ExtraTreeSpecies.Brazilnut, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.RoseGum, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Mahogony"), ExtraTreeSpecies.SwampGum, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Coffee, getVanilla("Teak"), ExtraTreeSpecies.Clove, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), getVanilla("Jungle"), ExtraTreeSpecies.Coffee, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Holly, ExtraTreeSpecies.Alder, ExtraTreeSpecies.Box, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hemlock, getVanilla("Jungle"), ExtraTreeSpecies.MonkeyPuzzle, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Balsa"), ExtraTreeSpecies.RainbowGum, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, ExtraTreeSpecies.Brazilwood, ExtraTreeSpecies.PinkIvory, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Elder, ExtraTreeSpecies.Raspberry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Elder, ExtraTreeSpecies.Redcurrant, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.BlackCherry, ExtraTreeSpecies.Redcurrant, ExtraTreeSpecies.Blackcurrant, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.BlackCherry, ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Blackberry, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Blackberry, ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Blueberry, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Blackberry, ExtraTreeSpecies.CherryPlum, ExtraTreeSpecies.Cranberry, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Fir, ExtraTreeSpecies.Juniper, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Lime, ExtraTreeSpecies.Gooseberry, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Orange, ExtraTreeSpecies.GoldenRaspberry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Rosewood, ExtraTreeSpecies.Cinnamon, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), ExtraTreeSpecies.Brazilnut, ExtraTreeSpecies.Coconut, 10);
|
||||
new ExtraTreeMutation(getVanilla("Teak"), getVanilla("Oak"), ExtraTreeSpecies.Cashew, 10);
|
||||
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Oak"), ExtraTreeSpecies.Avacado, 10);
|
||||
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Clove, ExtraTreeSpecies.Nutmeg, 10);
|
||||
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Clove, ExtraTreeSpecies.Allspice, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Allspice, ExtraTreeSpecies.Clove, ExtraTreeSpecies.StarAnise, 10);
|
||||
new ExtraTreeMutation(getVanilla("Jungle"), ExtraTreeSpecies.Orange, ExtraTreeSpecies.Mango, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.StarAnise, ExtraTreeSpecies.Mango, ExtraTreeSpecies.Starfruit, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Candlenut, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Chilli, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Alder, ExtraTreeSpecies.DwarfHazel, 10);
|
||||
}
|
||||
public static void init() {
|
||||
IAlleleTreeSpecies lemon = (IAlleleTreeSpecies) getVanilla("Lemon");
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ExtraTreeSpecies.KeyLime, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.KeyLime, lemon, ExtraTreeSpecies.FingerLime, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ExtraTreeSpecies.Pomelo, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, getVanilla("Cherry"), ExtraTreeSpecies.Manderin, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, lemon, ExtraTreeSpecies.Citron, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Manderin, getVanilla("Cherry"), ExtraTreeSpecies.Kumquat, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Orange, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Citron, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.BuddhaHand, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Kumquat, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Tangerine, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Kumquat, ExtraTreeSpecies.Manderin, ExtraTreeSpecies.Satsuma, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.Orange, ExtraTreeSpecies.Grapefruit, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Pomelo, ExtraTreeSpecies.KeyLime, ExtraTreeSpecies.Lime, 10);
|
||||
new ExtraTreeMutation(getVanilla("Oak"), getVanilla("Cherry"), ExtraTreeSpecies.OrchardApple, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Maple"), ExtraTreeSpecies.SweetCrabapple, 10);
|
||||
new ExtraTreeMutation(
|
||||
ExtraTreeSpecies.OrchardApple,
|
||||
ExtraTreeSpecies.SweetCrabapple,
|
||||
ExtraTreeSpecies.FloweringCrabapple,
|
||||
10);
|
||||
new ExtraTreeMutation(
|
||||
ExtraTreeSpecies.OrchardApple, getVanilla("Birch"), ExtraTreeSpecies.PrairieCrabapple, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.OrchardApple, ExtraTreeSpecies.Blackthorn, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Cherry"), ExtraTreeSpecies.CherryPlum, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Chestnut"), ExtraTreeSpecies.Peach, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.Peach, ExtraTreeSpecies.Nectarine, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), ExtraTreeSpecies.Peach, ExtraTreeSpecies.Apricot, 10);
|
||||
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Walnut"), ExtraTreeSpecies.Almond, 10);
|
||||
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Cherry"), ExtraTreeSpecies.WildCherry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Willow"), getVanilla("Cherry"), ExtraTreeSpecies.SourCherry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Cherry"), ExtraTreeSpecies.BlackCherry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.Banana, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Banana, getVanilla("Kapok"), ExtraTreeSpecies.RedBanana, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Banana, getVanilla("Teak"), ExtraTreeSpecies.Plantain, 10);
|
||||
new ExtraTreeMutation(getVanilla("Birch"), getVanilla("Oak"), ExtraTreeSpecies.Beech, 10);
|
||||
new ExtraTreeMutation(getVanilla("Birch"), ExtraTreeSpecies.Beech, ExtraTreeSpecies.Alder, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Beech, ExtraTreeSpecies.Aspen, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Alder, ExtraTreeSpecies.Rowan, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Hazel, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, ExtraTreeSpecies.Rowan, ExtraTreeSpecies.Hawthorn, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Elder, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Alder, ExtraTreeSpecies.Rowan, ExtraTreeSpecies.Holly, 10);
|
||||
new ExtraTreeMutation(getVanilla("Willow"), ExtraTreeSpecies.Aspen, ExtraTreeSpecies.Sallow, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Birch"), ExtraTreeSpecies.Pecan, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Spruce"), ExtraTreeSpecies.CopperBeech, 10);
|
||||
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Spruce"), ExtraTreeSpecies.Ash, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Birch"), ExtraTreeSpecies.Whitebeam, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Pine"), ExtraTreeSpecies.Elm, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Larch"), ExtraTreeSpecies.Hornbeam, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Ash, getVanilla("Maple"), ExtraTreeSpecies.Sycamore, 10);
|
||||
new ExtraTreeMutation(getVanilla("Larch"), getVanilla("Spruce"), ExtraTreeSpecies.Yew, 10);
|
||||
new ExtraTreeMutation(getVanilla("Larch"), ExtraTreeSpecies.Alder, ExtraTreeSpecies.BalsamFir, 10);
|
||||
new ExtraTreeMutation(getVanilla("Pine"), ExtraTreeSpecies.BalsamFir, ExtraTreeSpecies.Fir, 10);
|
||||
new ExtraTreeMutation(getVanilla("Pine"), ExtraTreeSpecies.Fir, ExtraTreeSpecies.Hemlock, 10).setHeight(80);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Fir, getVanilla("Larch"), ExtraTreeSpecies.Cedar, 10).setHeight(60);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Fir, getVanilla("Spruce"), ExtraTreeSpecies.DouglasFir, 10)
|
||||
.setHeight(60);
|
||||
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ExtraTreeSpecies.Cypress, 10);
|
||||
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ExtraTreeSpecies.LoblollyPine, 10);
|
||||
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Cherry"), ExtraTreeSpecies.Butternut, 10);
|
||||
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Oak"), ExtraTreeSpecies.AcornOak, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Alder, ExtraTreeSpecies.Olive, 10);
|
||||
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Lime"), ExtraTreeSpecies.RedMaple, 10);
|
||||
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Larch"), ExtraTreeSpecies.Sweetgum, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Lime"), ExtraTreeSpecies.Locust, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Teak"), ExtraTreeSpecies.Iroko, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.OrchardApple, getVanilla("Birch"), ExtraTreeSpecies.Pear, 10);
|
||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.OldFustic, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.OldFustic, getVanilla("Kapok"), ExtraTreeSpecies.OsangeOsange, 10);
|
||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Brazilwood, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Brazilwood, getVanilla("Kapok"), ExtraTreeSpecies.Purpleheart, 10);
|
||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Rosewood, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Rosewood, getVanilla("Kapok"), ExtraTreeSpecies.Logwood, 10);
|
||||
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Lime"), ExtraTreeSpecies.Gingko, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Jungle"), ExtraTreeSpecies.Brazilnut, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.RoseGum, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Mahogony"), ExtraTreeSpecies.SwampGum, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Coffee, getVanilla("Teak"), ExtraTreeSpecies.Clove, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), getVanilla("Jungle"), ExtraTreeSpecies.Coffee, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Holly, ExtraTreeSpecies.Alder, ExtraTreeSpecies.Box, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hemlock, getVanilla("Jungle"), ExtraTreeSpecies.MonkeyPuzzle, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Balsa"), ExtraTreeSpecies.RainbowGum, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, ExtraTreeSpecies.Brazilwood, ExtraTreeSpecies.PinkIvory, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Elder, ExtraTreeSpecies.Raspberry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Cherry"), ExtraTreeSpecies.Elder, ExtraTreeSpecies.Redcurrant, 10);
|
||||
new ExtraTreeMutation(
|
||||
ExtraTreeSpecies.BlackCherry, ExtraTreeSpecies.Redcurrant, ExtraTreeSpecies.Blackcurrant, 10);
|
||||
new ExtraTreeMutation(
|
||||
ExtraTreeSpecies.BlackCherry, ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Blackberry, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Blackberry, ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Blueberry, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Blackberry, ExtraTreeSpecies.CherryPlum, ExtraTreeSpecies.Cranberry, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Fir, ExtraTreeSpecies.Juniper, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Lime, ExtraTreeSpecies.Gooseberry, 10);
|
||||
new ExtraTreeMutation(
|
||||
ExtraTreeSpecies.Raspberry, ExtraTreeSpecies.Orange, ExtraTreeSpecies.GoldenRaspberry, 10);
|
||||
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Rosewood, ExtraTreeSpecies.Cinnamon, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), ExtraTreeSpecies.Brazilnut, ExtraTreeSpecies.Coconut, 10);
|
||||
new ExtraTreeMutation(getVanilla("Teak"), getVanilla("Oak"), ExtraTreeSpecies.Cashew, 10);
|
||||
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Oak"), ExtraTreeSpecies.Avacado, 10);
|
||||
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Clove, ExtraTreeSpecies.Nutmeg, 10);
|
||||
new ExtraTreeMutation(getVanilla("Teak"), ExtraTreeSpecies.Clove, ExtraTreeSpecies.Allspice, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Allspice, ExtraTreeSpecies.Clove, ExtraTreeSpecies.StarAnise, 10);
|
||||
new ExtraTreeMutation(getVanilla("Jungle"), ExtraTreeSpecies.Orange, ExtraTreeSpecies.Mango, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.StarAnise, ExtraTreeSpecies.Mango, ExtraTreeSpecies.Starfruit, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Candlenut, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Chilli, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Alder, ExtraTreeSpecies.DwarfHazel, 10);
|
||||
}
|
||||
|
||||
public static IAllele getVanilla(String uid) {
|
||||
IAllele allele = AlleleManager.alleleRegistry.getAllele("forestry.tree" + uid);
|
||||
if (allele == null) {
|
||||
throw new RuntimeException("No forestry species with id " + uid);
|
||||
}
|
||||
return allele;
|
||||
}
|
||||
public static IAllele getVanilla(String uid) {
|
||||
IAllele allele = AlleleManager.alleleRegistry.getAllele("forestry.tree" + uid);
|
||||
if (allele == null) {
|
||||
throw new RuntimeException("No forestry species with id " + uid);
|
||||
}
|
||||
return allele;
|
||||
}
|
||||
|
||||
public ExtraTreeMutation setHeight(int minHeight) {
|
||||
height = minHeight;
|
||||
return this;
|
||||
}
|
||||
public ExtraTreeMutation setHeight(int minHeight) {
|
||||
height = minHeight;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAlleleTreeSpecies getAllele0() {
|
||||
return allele0;
|
||||
}
|
||||
@Override
|
||||
public IAlleleTreeSpecies getAllele0() {
|
||||
return allele0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAlleleTreeSpecies getAllele1() {
|
||||
return allele1;
|
||||
}
|
||||
@Override
|
||||
public IAlleleTreeSpecies getAllele1() {
|
||||
return allele1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBaseChance() {
|
||||
return chance;
|
||||
}
|
||||
@Override
|
||||
public float getBaseChance() {
|
||||
return chance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele[] getTemplate() {
|
||||
return template;
|
||||
}
|
||||
@Override
|
||||
public IAllele[] getTemplate() {
|
||||
return template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPartner(IAllele allele) {
|
||||
return allele0.getUID().equals(allele.getUID()) || allele1.getUID().equals(allele.getUID());
|
||||
}
|
||||
@Override
|
||||
public boolean isPartner(IAllele allele) {
|
||||
return allele0.getUID().equals(allele.getUID()) || allele1.getUID().equals(allele.getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele getPartner(IAllele allele) {
|
||||
if (allele0.getUID().equals(allele.getUID())) {
|
||||
return allele1;
|
||||
}
|
||||
return allele0;
|
||||
}
|
||||
@Override
|
||||
public IAllele getPartner(IAllele allele) {
|
||||
if (allele0.getUID().equals(allele.getUID())) {
|
||||
return allele1;
|
||||
}
|
||||
return allele0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return isSecret;
|
||||
}
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return isSecret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(World world, int x, int y, int z, IAlleleTreeSpecies allele0, IAlleleTreeSpecies allele1, ITreeGenome genome0, ITreeGenome genome1) {
|
||||
int processedChance = chance;
|
||||
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z);
|
||||
if (biome.temperature < minTemperature || biome.temperature > maxTemperature) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (biome.rainfall < minRainfall || biome.rainfall > maxRainfall) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (height > 0.0f && y < height) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (this.allele0.getUID().equals(allele0.getUID()) && this.allele1.getUID().equals(allele1.getUID())) {
|
||||
return processedChance;
|
||||
}
|
||||
if (this.allele1.getUID().equals(allele0.getUID()) && this.allele0.getUID().equals(allele1.getUID())) {
|
||||
return processedChance;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
@Override
|
||||
public float getChance(
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
IAlleleTreeSpecies allele0,
|
||||
IAlleleTreeSpecies allele1,
|
||||
ITreeGenome genome0,
|
||||
ITreeGenome genome1) {
|
||||
int processedChance = chance;
|
||||
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z);
|
||||
if (biome.temperature < minTemperature || biome.temperature > maxTemperature) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (biome.rainfall < minRainfall || biome.rainfall > maxRainfall) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (height > 0.0f && y < height) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (this.allele0.getUID().equals(allele0.getUID())
|
||||
&& this.allele1.getUID().equals(allele1.getUID())) {
|
||||
return processedChance;
|
||||
}
|
||||
if (this.allele1.getUID().equals(allele0.getUID())
|
||||
&& this.allele0.getUID().equals(allele1.getUID())) {
|
||||
return processedChance;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getSpecialConditions() {
|
||||
List<String> conditions = new ArrayList<>();
|
||||
if (height > 0.0f) {
|
||||
conditions.add(I18N.localise("extratrees.genetics.requirements.height", height));
|
||||
}
|
||||
return conditions;
|
||||
}
|
||||
@Override
|
||||
public Collection<String> getSpecialConditions() {
|
||||
List<String> conditions = new ArrayList<>();
|
||||
if (height > 0.0f) {
|
||||
conditions.add(I18N.localise("extratrees.genetics.requirements.height", height));
|
||||
}
|
||||
return conditions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITreeRoot getRoot() {
|
||||
return Binnie.Genetics.getTreeRoot();
|
||||
}
|
||||
@Override
|
||||
public ITreeRoot getRoot() {
|
||||
return Binnie.Genetics.getTreeRoot();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -10,32 +10,33 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum FruitSprite implements IIconProvider {
|
||||
Tiny,
|
||||
Small,
|
||||
Average,
|
||||
Large,
|
||||
Larger,
|
||||
Pear;
|
||||
Tiny,
|
||||
Small,
|
||||
Average,
|
||||
Large,
|
||||
Larger,
|
||||
Pear;
|
||||
|
||||
protected BinnieIcon icon;
|
||||
protected BinnieIcon icon;
|
||||
|
||||
public short getIndex() {
|
||||
return (short) (ordinal() + 4200);
|
||||
}
|
||||
public short getIndex() {
|
||||
return (short) (ordinal() + 4200);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(short texUID) {
|
||||
int index = texUID - 4200;
|
||||
if (index >= 0 && index < values().length) {
|
||||
return values()[index].icon.getIcon();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(short texUID) {
|
||||
int index = texUID - 4200;
|
||||
if (index >= 0 && index < values().length) {
|
||||
return values()[index].icon.getIcon();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon = Binnie.Resource.getBlockIcon(ExtraTrees.instance, "fruit/" + toString().toLowerCase());
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon = Binnie.Resource.getBlockIcon(
|
||||
ExtraTrees.instance, "fruit/" + toString().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,22 @@
|
||||
package binnie.extratrees.genetics;
|
||||
|
||||
public enum LeafType {
|
||||
NORMAL((short) 10, (short) 11, (short) 12, "Deciduous"),
|
||||
CONIFER((short) 15, (short) 16, (short) 17, "Conifers"),
|
||||
JUNGLE((short) 20, (short) 21, (short) 22, "Jungle"),
|
||||
WILLOW((short) 25, (short) 26, (short) 27, "Willow"),
|
||||
MAPLE((short) 30, (short) 31, (short) 32, "Maple"),
|
||||
PALM((short) 35, (short) 36, (short) 37, "Palm");
|
||||
NORMAL((short) 10, (short) 11, (short) 12, "Deciduous"),
|
||||
CONIFER((short) 15, (short) 16, (short) 17, "Conifers"),
|
||||
JUNGLE((short) 20, (short) 21, (short) 22, "Jungle"),
|
||||
WILLOW((short) 25, (short) 26, (short) 27, "Willow"),
|
||||
MAPLE((short) 30, (short) 31, (short) 32, "Maple"),
|
||||
PALM((short) 35, (short) 36, (short) 37, "Palm");
|
||||
|
||||
public short fancyUID;
|
||||
public short plainUID;
|
||||
public short changedUID;
|
||||
public String description;
|
||||
public short fancyUID;
|
||||
public short plainUID;
|
||||
public short changedUID;
|
||||
public String description;
|
||||
|
||||
LeafType(short fancyUID, short plainUID, short changedUID, String description) {
|
||||
this.fancyUID = fancyUID;
|
||||
this.plainUID = plainUID;
|
||||
this.changedUID = changedUID;
|
||||
this.description = description;
|
||||
}
|
||||
LeafType(short fancyUID, short plainUID, short changedUID, String description) {
|
||||
this.fancyUID = fancyUID;
|
||||
this.plainUID = plainUID;
|
||||
this.changedUID = changedUID;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
@@ -5,117 +5,120 @@ import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IClassification;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ModuleGenetics implements IInitializable {
|
||||
protected String[] branches;
|
||||
protected List<List<String>> classifications;
|
||||
protected String[] branches;
|
||||
protected List<List<String>> classifications;
|
||||
|
||||
public ModuleGenetics() {
|
||||
branches = new String[]{
|
||||
"Malus Maleae Amygdaloideae Rosaceae",
|
||||
"Musa Musaceae Zingiberales Commelinids Angiosperms",
|
||||
"Sorbus Maleae",
|
||||
"Tsuga Pinaceae",
|
||||
"Fraxinus Oleeae Oleaceae Lamiales Asterids Angiospems"
|
||||
};
|
||||
classifications = new ArrayList<>();
|
||||
}
|
||||
public ModuleGenetics() {
|
||||
branches = new String[] {
|
||||
"Malus Maleae Amygdaloideae Rosaceae",
|
||||
"Musa Musaceae Zingiberales Commelinids Angiosperms",
|
||||
"Sorbus Maleae",
|
||||
"Tsuga Pinaceae",
|
||||
"Fraxinus Oleeae Oleaceae Lamiales Asterids Angiospems"
|
||||
};
|
||||
classifications = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
for (ExtraTreeFruitGene fruit : ExtraTreeFruitGene.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(fruit);
|
||||
}
|
||||
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void preInit() {
|
||||
for (ExtraTreeFruitGene fruit : ExtraTreeFruitGene.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(fruit);
|
||||
}
|
||||
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void init() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
ExtraTreeSpecies.init();
|
||||
ExtraTreeFruitGene.init();
|
||||
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
|
||||
Binnie.Genetics.getTreeRoot().registerTemplate(species.getTemplate());
|
||||
}
|
||||
@Override
|
||||
public void postInit() {
|
||||
ExtraTreeSpecies.init();
|
||||
ExtraTreeFruitGene.init();
|
||||
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
|
||||
Binnie.Genetics.getTreeRoot().registerTemplate(species.getTemplate());
|
||||
}
|
||||
|
||||
ExtraTreeMutation.init();
|
||||
if (!BinnieCore.isLepidopteryActive()) {
|
||||
return;
|
||||
}
|
||||
ExtraTreeMutation.init();
|
||||
if (!BinnieCore.isLepidopteryActive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (ButterflySpecies species2 : ButterflySpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species2);
|
||||
Binnie.Genetics.getButterflyRoot().registerTemplate(species2.getTemplate());
|
||||
String scientific = species2.branchName.substring(0, 1).toUpperCase() + species2.branchName.substring(1).toLowerCase();
|
||||
String uid = "trees." + species2.branchName.toLowerCase();
|
||||
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
|
||||
if (branch == null) {
|
||||
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
}
|
||||
(species2.branch = branch).addMemberSpecies(species2);
|
||||
}
|
||||
}
|
||||
for (ButterflySpecies species2 : ButterflySpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species2);
|
||||
Binnie.Genetics.getButterflyRoot().registerTemplate(species2.getTemplate());
|
||||
String scientific = species2.branchName.substring(0, 1).toUpperCase()
|
||||
+ species2.branchName.substring(1).toLowerCase();
|
||||
String uid = "trees." + species2.branchName.toLowerCase();
|
||||
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
|
||||
if (branch == null) {
|
||||
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(
|
||||
IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
}
|
||||
(species2.branch = branch).addMemberSpecies(species2);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateBranches() {
|
||||
for (String hierarchy : branches) {
|
||||
List<String> set = new ArrayList<>();
|
||||
for (String string : hierarchy.split(" ", 0)) {
|
||||
set.add(string.toLowerCase());
|
||||
}
|
||||
classifications.add(set);
|
||||
}
|
||||
private void generateBranches() {
|
||||
for (String hierarchy : branches) {
|
||||
List<String> set = new ArrayList<>();
|
||||
for (String string : hierarchy.split(" ", 0)) {
|
||||
set.add(string.toLowerCase());
|
||||
}
|
||||
classifications.add(set);
|
||||
}
|
||||
|
||||
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
|
||||
IClassification branch = getOrCreateClassification(IClassification.EnumClassLevel.GENUS, species.branchName);
|
||||
branch.addMemberSpecies(species);
|
||||
species.branch = branch;
|
||||
IClassification clss = branch;
|
||||
int currentLevel = IClassification.EnumClassLevel.GENUS.ordinal();
|
||||
for (ExtraTreeSpecies species : ExtraTreeSpecies.values()) {
|
||||
IClassification branch =
|
||||
getOrCreateClassification(IClassification.EnumClassLevel.GENUS, species.branchName);
|
||||
branch.addMemberSpecies(species);
|
||||
species.branch = branch;
|
||||
IClassification clss = branch;
|
||||
int currentLevel = IClassification.EnumClassLevel.GENUS.ordinal();
|
||||
|
||||
while (clss.getParent() == null) {
|
||||
for (List<String> set2 : classifications) {
|
||||
if (set2.contains(clss.getScientific().toLowerCase())) {
|
||||
String nextLevel = "";
|
||||
int index = set2.indexOf(clss.getScientific().toLowerCase()) + 1;
|
||||
while (nextLevel.length() == 0) {
|
||||
try {
|
||||
nextLevel = set2.get(index++);
|
||||
} catch (IndexOutOfBoundsException ex) {
|
||||
throw new RuntimeException("Reached end point at " + set2.get(index - 2));
|
||||
}
|
||||
currentLevel--;
|
||||
}
|
||||
while (clss.getParent() == null) {
|
||||
for (List<String> set2 : classifications) {
|
||||
if (set2.contains(clss.getScientific().toLowerCase())) {
|
||||
String nextLevel = "";
|
||||
int index = set2.indexOf(clss.getScientific().toLowerCase()) + 1;
|
||||
while (nextLevel.length() == 0) {
|
||||
try {
|
||||
nextLevel = set2.get(index++);
|
||||
} catch (IndexOutOfBoundsException ex) {
|
||||
throw new RuntimeException("Reached end point at " + set2.get(index - 2));
|
||||
}
|
||||
currentLevel--;
|
||||
}
|
||||
|
||||
IClassification parent = getOrCreateClassification(IClassification.EnumClassLevel.values()[currentLevel], nextLevel);
|
||||
parent.addMemberGroup(clss);
|
||||
System.out.println("Went from " + clss.getScientific() + " to " + parent.getScientific());
|
||||
clss = parent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
IClassification parent = getOrCreateClassification(
|
||||
IClassification.EnumClassLevel.values()[currentLevel], nextLevel);
|
||||
parent.addMemberGroup(clss);
|
||||
System.out.println("Went from " + clss.getScientific() + " to " + parent.getScientific());
|
||||
clss = parent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IClassification getOrCreateClassification(IClassification.EnumClassLevel level, String name) {
|
||||
if (level == IClassification.EnumClassLevel.GENUS) {
|
||||
name = "trees." + name;
|
||||
}
|
||||
private IClassification getOrCreateClassification(IClassification.EnumClassLevel level, String name) {
|
||||
if (level == IClassification.EnumClassLevel.GENUS) {
|
||||
name = "trees." + name;
|
||||
}
|
||||
|
||||
String uid = level.name().toLowerCase(Locale.ENGLISH) + "." + name.toLowerCase();
|
||||
if (AlleleManager.alleleRegistry.getClassification(uid) != null) {
|
||||
return AlleleManager.alleleRegistry.getClassification(uid);
|
||||
}
|
||||
return AlleleManager.alleleRegistry.createAndRegisterClassification(level, name.toLowerCase(), name);
|
||||
}
|
||||
String uid = level.name().toLowerCase(Locale.ENGLISH) + "." + name.toLowerCase();
|
||||
if (AlleleManager.alleleRegistry.getClassification(uid) != null) {
|
||||
return AlleleManager.alleleRegistry.getClassification(uid);
|
||||
}
|
||||
return AlleleManager.alleleRegistry.createAndRegisterClassification(level, name.toLowerCase(), name);
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,13 @@ package binnie.extratrees.genetics;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum SaplingType {
|
||||
DEFAULT,
|
||||
JUNGLE,
|
||||
CONIFER,
|
||||
FRUIT,
|
||||
POPLAR,
|
||||
PALM,
|
||||
SHRUB;
|
||||
DEFAULT,
|
||||
JUNGLE,
|
||||
CONIFER,
|
||||
FRUIT,
|
||||
POPLAR,
|
||||
PALM,
|
||||
SHRUB;
|
||||
|
||||
public IIcon[] icon;
|
||||
public IIcon[] icon;
|
||||
}
|
||||
@@ -3,56 +3,55 @@ package binnie.extratrees.item;
|
||||
import binnie.core.item.IItemMisc;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public enum ExtraTreeItems implements IItemMisc {
|
||||
CarpentryHammer("carpentryHammer"),
|
||||
Sawdust("sawdust"),
|
||||
Bark("bark"),
|
||||
ProvenGear("provenGear"),
|
||||
WoodWax("woodWax"),
|
||||
GlassFitting("glassFitting");
|
||||
CarpentryHammer("carpentryHammer"),
|
||||
Sawdust("sawdust"),
|
||||
Bark("bark"),
|
||||
ProvenGear("provenGear"),
|
||||
WoodWax("woodWax"),
|
||||
GlassFitting("glassFitting");
|
||||
|
||||
protected String name;
|
||||
protected String iconPath;
|
||||
protected IIcon icon;
|
||||
protected String name;
|
||||
protected String iconPath;
|
||||
protected IIcon icon;
|
||||
|
||||
ExtraTreeItems(String name) {
|
||||
this.name = name;
|
||||
this.iconPath = name;
|
||||
}
|
||||
ExtraTreeItems(String name) {
|
||||
this.name = name;
|
||||
this.iconPath = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack itemStack) {
|
||||
return icon;
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack itemStack) {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, iconPath);
|
||||
}
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, iconPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void addInformation(List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return I18N.localise("extratrees.item." + name);
|
||||
}
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return I18N.localise("extratrees.item." + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return this != ExtraTreeItems.CarpentryHammer;
|
||||
}
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return this != ExtraTreeItems.CarpentryHammer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(int count) {
|
||||
return new ItemStack(ExtraTrees.itemMisc, count, ordinal());
|
||||
}
|
||||
@Override
|
||||
public ItemStack get(int count) {
|
||||
return new ItemStack(ExtraTrees.itemMisc, count, ordinal());
|
||||
}
|
||||
}
|
||||
@@ -10,72 +10,72 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public enum ExtraTreeLiquid implements ILiquidType {
|
||||
Sap("sap", 0xbe7542),
|
||||
Resin("resin", 0xc96800),
|
||||
Latex("latex", 0xd8dbc9),
|
||||
Turpentine("turpentine", 0x79533a);
|
||||
Sap("sap", 0xbe7542),
|
||||
Resin("resin", 0xc96800),
|
||||
Latex("latex", 0xd8dbc9),
|
||||
Turpentine("turpentine", 0x79533a);
|
||||
|
||||
public String name;
|
||||
public String name;
|
||||
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int color;
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int color;
|
||||
|
||||
ExtraTreeLiquid(String name, int color) {
|
||||
this.name = name;
|
||||
this.ident = name;
|
||||
this.color = color;
|
||||
}
|
||||
ExtraTreeLiquid(String name, int color) {
|
||||
this.name = name;
|
||||
this.ident = name;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcon(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, "liquids/" + getIdentifier());
|
||||
}
|
||||
@Override
|
||||
public void registerIcon(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, "liquids/" + getIdentifier());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.fluid." + name);
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise("extratrees.fluid." + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return ident;
|
||||
}
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return ident;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xffffff;
|
||||
}
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack get(int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(ident, amount);
|
||||
}
|
||||
@Override
|
||||
public FluidStack get(int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(ident, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransparency() {
|
||||
return 255;
|
||||
}
|
||||
@Override
|
||||
public int getTransparency() {
|
||||
return 255;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceIn(FluidContainer container) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canPlaceIn(FluidContainer container) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showInCreative(FluidContainer container) {
|
||||
return container == FluidContainer.Bucket
|
||||
|| container == FluidContainer.Can
|
||||
|| container == FluidContainer.Capsule;
|
||||
}
|
||||
@Override
|
||||
public boolean showInCreative(FluidContainer container) {
|
||||
return container == FluidContainer.Bucket
|
||||
|| container == FluidContainer.Can
|
||||
|| container == FluidContainer.Capsule;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColor() {
|
||||
return color;
|
||||
}
|
||||
@Override
|
||||
public int getContainerColor() {
|
||||
return color;
|
||||
}
|
||||
}
|
||||
@@ -6,216 +6,214 @@ import binnie.core.item.IItemMisc;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public enum Food implements IItemMisc {
|
||||
Crabapple(2),
|
||||
Orange(4),
|
||||
Kumquat(2),
|
||||
Lime(2),
|
||||
WildCherry(2),
|
||||
SourCherry(2),
|
||||
BlackCherry(2),
|
||||
Blackthorn(3),
|
||||
CherryPlum(3),
|
||||
Almond(1),
|
||||
Apricot(4),
|
||||
Grapefruit(4),
|
||||
Peach(4),
|
||||
Satsuma(3),
|
||||
BuddhaHand(3),
|
||||
Citron(3),
|
||||
FingerLime(3),
|
||||
KeyLime(2),
|
||||
Manderin(3),
|
||||
Nectarine(3),
|
||||
Pomelo(3),
|
||||
Tangerine(3),
|
||||
Pear(4),
|
||||
SandPear(2),
|
||||
Hazelnut(2),
|
||||
Butternut(1),
|
||||
Beechnut(0),
|
||||
Pecan(0),
|
||||
Banana(4),
|
||||
RedBanana(4),
|
||||
Plantain(2),
|
||||
BrazilNut(0),
|
||||
Fig(2),
|
||||
Acorn(0),
|
||||
Elderberry(1),
|
||||
Olive(1),
|
||||
GingkoNut(1),
|
||||
Coffee(0),
|
||||
OsangeOrange(1),
|
||||
Clove(0),
|
||||
Papayimar(8),
|
||||
Blackcurrant(2),
|
||||
Redcurrant(2),
|
||||
Blackberry(2),
|
||||
Raspberry(2),
|
||||
Blueberry(2),
|
||||
Cranberry(2),
|
||||
Juniper(0),
|
||||
Gooseberry(2),
|
||||
GoldenRaspberry(2),
|
||||
Coconut(2),
|
||||
Cashew(0),
|
||||
Avacado(2),
|
||||
Nutmeg(0),
|
||||
Allspice(0),
|
||||
Chilli(2),
|
||||
StarAnise(0),
|
||||
Mango(4),
|
||||
Starfruit(2),
|
||||
Candlenut(0);
|
||||
Crabapple(2),
|
||||
Orange(4),
|
||||
Kumquat(2),
|
||||
Lime(2),
|
||||
WildCherry(2),
|
||||
SourCherry(2),
|
||||
BlackCherry(2),
|
||||
Blackthorn(3),
|
||||
CherryPlum(3),
|
||||
Almond(1),
|
||||
Apricot(4),
|
||||
Grapefruit(4),
|
||||
Peach(4),
|
||||
Satsuma(3),
|
||||
BuddhaHand(3),
|
||||
Citron(3),
|
||||
FingerLime(3),
|
||||
KeyLime(2),
|
||||
Manderin(3),
|
||||
Nectarine(3),
|
||||
Pomelo(3),
|
||||
Tangerine(3),
|
||||
Pear(4),
|
||||
SandPear(2),
|
||||
Hazelnut(2),
|
||||
Butternut(1),
|
||||
Beechnut(0),
|
||||
Pecan(0),
|
||||
Banana(4),
|
||||
RedBanana(4),
|
||||
Plantain(2),
|
||||
BrazilNut(0),
|
||||
Fig(2),
|
||||
Acorn(0),
|
||||
Elderberry(1),
|
||||
Olive(1),
|
||||
GingkoNut(1),
|
||||
Coffee(0),
|
||||
OsangeOrange(1),
|
||||
Clove(0),
|
||||
Papayimar(8),
|
||||
Blackcurrant(2),
|
||||
Redcurrant(2),
|
||||
Blackberry(2),
|
||||
Raspberry(2),
|
||||
Blueberry(2),
|
||||
Cranberry(2),
|
||||
Juniper(0),
|
||||
Gooseberry(2),
|
||||
GoldenRaspberry(2),
|
||||
Coconut(2),
|
||||
Cashew(0),
|
||||
Avacado(2),
|
||||
Nutmeg(0),
|
||||
Allspice(0),
|
||||
Chilli(2),
|
||||
StarAnise(0),
|
||||
Mango(4),
|
||||
Starfruit(2),
|
||||
Candlenut(0);
|
||||
|
||||
protected IIcon icon;
|
||||
protected int hunger;
|
||||
private List<String> ores;
|
||||
protected IIcon icon;
|
||||
protected int hunger;
|
||||
private List<String> ores;
|
||||
|
||||
Food() {
|
||||
this(0);
|
||||
}
|
||||
Food() {
|
||||
this(0);
|
||||
}
|
||||
|
||||
Food(int hunger) {
|
||||
ores = new ArrayList<>();
|
||||
this.hunger = hunger;
|
||||
}
|
||||
public static void registerOreDictionary() {
|
||||
Food.Crabapple.ore("Apple").ore("Crabapple");
|
||||
Food.Orange.ore("Orange");
|
||||
Food.Kumquat.ore("Kumquat");
|
||||
Food.Lime.ore("Lime");
|
||||
Food.WildCherry.ore("Cherry").ore("WildCherry");
|
||||
Food.SourCherry.ore("Cherry").ore("SourCherry");
|
||||
Food.BlackCherry.ore("Cherry").ore("BlackCherry");
|
||||
Food.Blackthorn.ore("Blackthorn");
|
||||
Food.CherryPlum.ore("Plum").ore("CherryPlum");
|
||||
Food.Almond.ore("Almond");
|
||||
Food.Apricot.ore("Apricot");
|
||||
Food.Grapefruit.ore("Grapefruit");
|
||||
Food.Peach.ore("Peach");
|
||||
Food.Satsuma.ore("Satsuma").ore("Orange");
|
||||
Food.BuddhaHand.ore("BuddhaHand").ore("Citron");
|
||||
Food.Citron.ore("Citron");
|
||||
Food.FingerLime.ore("Lime").ore("FingerLime");
|
||||
Food.KeyLime.ore("KeyLime").ore("Lime");
|
||||
Food.Manderin.ore("Orange").ore("Manderin");
|
||||
Food.Nectarine.ore("Peach").ore("Nectarine");
|
||||
Food.Pomelo.ore("Pomelo");
|
||||
Food.Tangerine.ore("Tangerine").ore("Orange");
|
||||
Food.Pear.ore("Pear");
|
||||
Food.SandPear.ore("SandPear");
|
||||
Food.Hazelnut.ore("Hazelnut");
|
||||
Food.Butternut.ore("Butternut").ore("Walnut");
|
||||
Food.Beechnut.ore("Beechnut");
|
||||
Food.Pecan.ore("Pecan");
|
||||
Food.Banana.ore("Banana");
|
||||
Food.RedBanana.ore("RedBanana").ore("Banana");
|
||||
Food.Plantain.ore("Plantain");
|
||||
Food.BrazilNut.ore("BrazilNut");
|
||||
Food.Fig.ore("Fig");
|
||||
Food.Acorn.ore("Acorn");
|
||||
Food.Elderberry.ore("Elderberry");
|
||||
Food.Olive.ore("Olive");
|
||||
Food.GingkoNut.ore("GingkoNut");
|
||||
Food.Coffee.ore("Coffee");
|
||||
Food.OsangeOrange.ore("OsangeOrange");
|
||||
Food.Clove.ore("Clove");
|
||||
Food.Papayimar.ore("Papayimar");
|
||||
Food.Blackcurrant.ore("Blackcurrant");
|
||||
Food.Redcurrant.ore("Redcurrant");
|
||||
Food.Blackberry.ore("Blackberry");
|
||||
Food.Raspberry.ore("Raspberry");
|
||||
Food.Blueberry.ore("Blueberry");
|
||||
Food.Cranberry.ore("Cranberry");
|
||||
Food.Juniper.ore("Juniper");
|
||||
Food.Gooseberry.ore("Gooseberry");
|
||||
Food.GoldenRaspberry.ore("GoldenRaspberry");
|
||||
Food.Coconut.ore("Coconut");
|
||||
Food.Cashew.ore("Cashew");
|
||||
Food.Avacado.ore("Avacado");
|
||||
Food.Nutmeg.ore("Nutmeg");
|
||||
Food.Chilli.ore("Chilli");
|
||||
Food.StarAnise.ore("StarAnise");
|
||||
Food.Mango.ore("Mango");
|
||||
Food.Starfruit.ore("Starfruit");
|
||||
Food.Candlenut.ore("Candlenut");
|
||||
}
|
||||
Food(int hunger) {
|
||||
ores = new ArrayList<>();
|
||||
this.hunger = hunger;
|
||||
}
|
||||
|
||||
public boolean isEdible() {
|
||||
return hunger > 0;
|
||||
}
|
||||
public static void registerOreDictionary() {
|
||||
Food.Crabapple.ore("Apple").ore("Crabapple");
|
||||
Food.Orange.ore("Orange");
|
||||
Food.Kumquat.ore("Kumquat");
|
||||
Food.Lime.ore("Lime");
|
||||
Food.WildCherry.ore("Cherry").ore("WildCherry");
|
||||
Food.SourCherry.ore("Cherry").ore("SourCherry");
|
||||
Food.BlackCherry.ore("Cherry").ore("BlackCherry");
|
||||
Food.Blackthorn.ore("Blackthorn");
|
||||
Food.CherryPlum.ore("Plum").ore("CherryPlum");
|
||||
Food.Almond.ore("Almond");
|
||||
Food.Apricot.ore("Apricot");
|
||||
Food.Grapefruit.ore("Grapefruit");
|
||||
Food.Peach.ore("Peach");
|
||||
Food.Satsuma.ore("Satsuma").ore("Orange");
|
||||
Food.BuddhaHand.ore("BuddhaHand").ore("Citron");
|
||||
Food.Citron.ore("Citron");
|
||||
Food.FingerLime.ore("Lime").ore("FingerLime");
|
||||
Food.KeyLime.ore("KeyLime").ore("Lime");
|
||||
Food.Manderin.ore("Orange").ore("Manderin");
|
||||
Food.Nectarine.ore("Peach").ore("Nectarine");
|
||||
Food.Pomelo.ore("Pomelo");
|
||||
Food.Tangerine.ore("Tangerine").ore("Orange");
|
||||
Food.Pear.ore("Pear");
|
||||
Food.SandPear.ore("SandPear");
|
||||
Food.Hazelnut.ore("Hazelnut");
|
||||
Food.Butternut.ore("Butternut").ore("Walnut");
|
||||
Food.Beechnut.ore("Beechnut");
|
||||
Food.Pecan.ore("Pecan");
|
||||
Food.Banana.ore("Banana");
|
||||
Food.RedBanana.ore("RedBanana").ore("Banana");
|
||||
Food.Plantain.ore("Plantain");
|
||||
Food.BrazilNut.ore("BrazilNut");
|
||||
Food.Fig.ore("Fig");
|
||||
Food.Acorn.ore("Acorn");
|
||||
Food.Elderberry.ore("Elderberry");
|
||||
Food.Olive.ore("Olive");
|
||||
Food.GingkoNut.ore("GingkoNut");
|
||||
Food.Coffee.ore("Coffee");
|
||||
Food.OsangeOrange.ore("OsangeOrange");
|
||||
Food.Clove.ore("Clove");
|
||||
Food.Papayimar.ore("Papayimar");
|
||||
Food.Blackcurrant.ore("Blackcurrant");
|
||||
Food.Redcurrant.ore("Redcurrant");
|
||||
Food.Blackberry.ore("Blackberry");
|
||||
Food.Raspberry.ore("Raspberry");
|
||||
Food.Blueberry.ore("Blueberry");
|
||||
Food.Cranberry.ore("Cranberry");
|
||||
Food.Juniper.ore("Juniper");
|
||||
Food.Gooseberry.ore("Gooseberry");
|
||||
Food.GoldenRaspberry.ore("GoldenRaspberry");
|
||||
Food.Coconut.ore("Coconut");
|
||||
Food.Cashew.ore("Cashew");
|
||||
Food.Avacado.ore("Avacado");
|
||||
Food.Nutmeg.ore("Nutmeg");
|
||||
Food.Chilli.ore("Chilli");
|
||||
Food.StarAnise.ore("StarAnise");
|
||||
Food.Mango.ore("Mango");
|
||||
Food.Starfruit.ore("Starfruit");
|
||||
Food.Candlenut.ore("Candlenut");
|
||||
}
|
||||
|
||||
public int getHealth() {
|
||||
return hunger;
|
||||
}
|
||||
public boolean isEdible() {
|
||||
return hunger > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return true;
|
||||
}
|
||||
public int getHealth() {
|
||||
return hunger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return I18N.localise("for.extratrees.item.food." + name().toLowerCase());
|
||||
}
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(int count) {
|
||||
return new ItemStack(ExtraTrees.itemFood, count, ordinal());
|
||||
}
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return I18N.localise("for.extratrees.item.food." + name().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack itemStack) {
|
||||
return icon;
|
||||
}
|
||||
@Override
|
||||
public ItemStack get(int count) {
|
||||
return new ItemStack(ExtraTrees.itemFood, count, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, "food/" + toString());
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack itemStack) {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, "food/" + toString());
|
||||
}
|
||||
|
||||
public void addJuice(int time, int amount, int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(
|
||||
time,
|
||||
new ItemStack[]{get(1)},
|
||||
Binnie.Liquid.getLiquidStack("juice", amount),
|
||||
Mods.forestry.stack("mulch"),
|
||||
mulch
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public void addInformation(List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public void addOil(int time, int amount, int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(
|
||||
time,
|
||||
new ItemStack[]{get(1)},
|
||||
Binnie.Liquid.getLiquidStack("seedoil", amount),
|
||||
Mods.forestry.stack("mulch"),
|
||||
mulch
|
||||
);
|
||||
}
|
||||
public void addJuice(int time, int amount, int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(
|
||||
time,
|
||||
new ItemStack[] {get(1)},
|
||||
Binnie.Liquid.getLiquidStack("juice", amount),
|
||||
Mods.forestry.stack("mulch"),
|
||||
mulch);
|
||||
}
|
||||
|
||||
private Food ore(String string) {
|
||||
OreDictionary.registerOre("crop" + string, get(1));
|
||||
ores.add("crop" + string);
|
||||
return this;
|
||||
}
|
||||
public void addOil(int time, int amount, int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(
|
||||
time,
|
||||
new ItemStack[] {get(1)},
|
||||
Binnie.Liquid.getLiquidStack("seedoil", amount),
|
||||
Mods.forestry.stack("mulch"),
|
||||
mulch);
|
||||
}
|
||||
|
||||
public Collection<String> getOres() {
|
||||
return ores;
|
||||
}
|
||||
private Food ore(String string) {
|
||||
OreDictionary.registerOre("crop" + string, get(1));
|
||||
ores.add("crop" + string);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Collection<String> getOres() {
|
||||
return ores;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import binnie.extratrees.core.ExtraTreesGUID;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -14,60 +15,60 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemDictionary extends Item {
|
||||
protected IIcon iconMaster;
|
||||
protected IIcon iconMaster;
|
||||
|
||||
public ItemDictionary() {
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setUnlocalizedName("database");
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
public ItemDictionary() {
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setUnlocalizedName("database");
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraTrees.proxy.getIcon(register, "arboristDatabase");
|
||||
iconMaster = ExtraTrees.proxy.getIcon(register, "masterArboristDatabase");
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraTrees.proxy.getIcon(register, "arboristDatabase");
|
||||
iconMaster = ExtraTrees.proxy.getIcon(register, "masterArboristDatabase");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return (par1 == 0) ? itemIcon : iconMaster;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return (par1 == 0) ? itemIcon : iconMaster;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List toltip, boolean advanced) {
|
||||
super.addInformation(stack, player, toltip, advanced);
|
||||
if (stack.getItemDamage() > 0) {
|
||||
toltip.add(I18N.localise("extratrees.item.database.tooltip"));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List toltip, boolean advanced) {
|
||||
super.addInformation(stack, player, toltip, advanced);
|
||||
if (stack.getItemDamage() > 0) {
|
||||
toltip.add(I18N.localise("extratrees.item.database.tooltip"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (stack.getItemDamage() == 0) {
|
||||
ExtraTrees.proxy.openGui(ExtraTreesGUID.Database, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
} else {
|
||||
ExtraTrees.proxy.openGui(ExtraTreesGUID.DatabaseNEI, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (stack.getItemDamage() == 0) {
|
||||
ExtraTrees.proxy.openGui(
|
||||
ExtraTreesGUID.Database, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
} else {
|
||||
ExtraTrees.proxy.openGui(
|
||||
ExtraTreesGUID.DatabaseNEI, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return (i.getItemDamage() == 0) ?
|
||||
I18N.localise("extratrees.item.database") :
|
||||
I18N.localise("extratrees.item.masterDatabase");
|
||||
}
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return (i.getItemDamage() == 0)
|
||||
? I18N.localise("extratrees.item.database")
|
||||
: I18N.localise("extratrees.item.masterDatabase");
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import binnie.core.item.IItemMisc;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -11,86 +12,84 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemFood extends net.minecraft.item.ItemFood {
|
||||
protected IItemMisc[] items;
|
||||
protected IItemMisc[] items;
|
||||
|
||||
public ItemFood() {
|
||||
super(0, 0.0f, false);
|
||||
setUnlocalizedName("food");
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setHasSubtypes(true);
|
||||
items = Food.values();
|
||||
}
|
||||
public ItemFood() {
|
||||
super(0, 0.0f, false);
|
||||
setUnlocalizedName("food");
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setHasSubtypes(true);
|
||||
items = Food.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (IItemMisc itemMisc : items) {
|
||||
if (itemMisc.isActive()) {
|
||||
list.add(getStack(itemMisc, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (IItemMisc itemMisc : items) {
|
||||
if (itemMisc.isActive()) {
|
||||
list.add(getStack(itemMisc, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IItemMisc getItem(int damage) {
|
||||
return (damage >= items.length) ? items[0] : items[damage];
|
||||
}
|
||||
private IItemMisc getItem(int damage) {
|
||||
return (damage >= items.length) ? items[0] : items[damage];
|
||||
}
|
||||
|
||||
public ItemStack getStack(IItemMisc type, int size) {
|
||||
return new ItemStack(this, size, type.ordinal());
|
||||
}
|
||||
public ItemStack getStack(IItemMisc type, int size) {
|
||||
return new ItemStack(this, size, type.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
IItemMisc item = getItem(stack.getItemDamage());
|
||||
if (item != null) {
|
||||
item.addInformation(tooltip);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
IItemMisc item = getItem(stack.getItemDamage());
|
||||
if (item != null) {
|
||||
item.addInformation(tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
IItemMisc item = getItem(stack.getItemDamage());
|
||||
return (item != null) ? item.getName(stack) : "null";
|
||||
}
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
IItemMisc item = getItem(stack.getItemDamage());
|
||||
return (item != null) ? item.getName(stack) : "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
IItemMisc item = getItem(stack.getItemDamage());
|
||||
return (item != null) ? item.getIcon(stack) : null;
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
IItemMisc item = getItem(stack.getItemDamage());
|
||||
return (item != null) ? item.getIcon(stack) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
IItemMisc item = getItem(damage);
|
||||
return (item != null) ? item.getIcon(null) : null;
|
||||
}
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
IItemMisc item = getItem(damage);
|
||||
return (item != null) ? item.getIcon(null) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (IItemMisc item : items) {
|
||||
if (item.isActive()) {
|
||||
item.registerIcons(register);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (IItemMisc item : items) {
|
||||
if (item.isActive()) {
|
||||
item.registerIcons(register);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Food getFood(ItemStack stack) {
|
||||
return Food.values()[stack.getItemDamage()];
|
||||
}
|
||||
private Food getFood(ItemStack stack) {
|
||||
return Food.values()[stack.getItemDamage()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int func_150905_g(ItemStack stack) {
|
||||
return getFood(stack).getHealth();
|
||||
}
|
||||
@Override
|
||||
public int func_150905_g(ItemStack stack) {
|
||||
return getFood(stack).getHealth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float func_150906_h(ItemStack stack) {
|
||||
return 3.0f;
|
||||
}
|
||||
@Override
|
||||
public float func_150906_h(ItemStack stack) {
|
||||
return 3.0f;
|
||||
}
|
||||
}
|
||||
@@ -12,37 +12,37 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemHammer extends Item implements IToolHammer {
|
||||
protected boolean isDurableHammer;
|
||||
protected boolean isDurableHammer;
|
||||
|
||||
public ItemHammer(boolean durable) {
|
||||
isDurableHammer = false;
|
||||
isDurableHammer = durable;
|
||||
setCreativeTab(CreativeTabs.tabTools);
|
||||
setUnlocalizedName(durable ? "durableHammer" : "hammer");
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(durable ? 1562 : 251);
|
||||
}
|
||||
public ItemHammer(boolean durable) {
|
||||
isDurableHammer = false;
|
||||
isDurableHammer = durable;
|
||||
setCreativeTab(CreativeTabs.tabTools);
|
||||
setUnlocalizedName(durable ? "durableHammer" : "hammer");
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(durable ? 1562 : 251);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraTrees.proxy.getIcon(register, isDurableHammer ? "durableHammer" : "carpentryHammer");
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraTrees.proxy.getIcon(register, isDurableHammer ? "durableHammer" : "carpentryHammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return isDurableHammer ?
|
||||
I18N.localise("extratrees.item.masterCarpentryHammer") :
|
||||
I18N.localise("extratrees.item.carpentryHammer");
|
||||
}
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return isDurableHammer
|
||||
? I18N.localise("extratrees.item.masterCarpentryHammer")
|
||||
: I18N.localise("extratrees.item.carpentryHammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isActive(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHammerUsed(ItemStack stack, EntityPlayer player) {
|
||||
stack.damageItem(1, player);
|
||||
}
|
||||
@Override
|
||||
public void onHammerUsed(ItemStack stack, EntityPlayer player) {
|
||||
stack.damageItem(1, player);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import binnie.extratrees.core.ExtraTreesGUID;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -14,60 +15,60 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemMothDatabase extends Item {
|
||||
protected IIcon iconMaster;
|
||||
protected IIcon iconMaster;
|
||||
|
||||
public ItemMothDatabase() {
|
||||
setCreativeTab(Tabs.tabLepidopterology);
|
||||
setUnlocalizedName("databaseMoth");
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
public ItemMothDatabase() {
|
||||
setCreativeTab(Tabs.tabLepidopterology);
|
||||
setUnlocalizedName("databaseMoth");
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraTrees.proxy.getIcon(register, "lepiDatabase");
|
||||
iconMaster = ExtraTrees.proxy.getIcon(register, "masterLepiDatabase");
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraTrees.proxy.getIcon(register, "lepiDatabase");
|
||||
iconMaster = ExtraTrees.proxy.getIcon(register, "masterLepiDatabase");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return (par1 == 0) ? itemIcon : iconMaster;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return (par1 == 0) ? itemIcon : iconMaster;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
if (stack.getItemDamage() > 0) {
|
||||
tooltip.add(I18N.localise("extratrees.item.mothDatabase.tooltip"));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
if (stack.getItemDamage() > 0) {
|
||||
tooltip.add(I18N.localise("extratrees.item.mothDatabase.tooltip"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (stack.getItemDamage() == 0) {
|
||||
ExtraTrees.proxy.openGui(ExtraTreesGUID.MothDatabase, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
} else {
|
||||
ExtraTrees.proxy.openGui(ExtraTreesGUID.MothDatabaseNEI, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (stack.getItemDamage() == 0) {
|
||||
ExtraTrees.proxy.openGui(
|
||||
ExtraTreesGUID.MothDatabase, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
} else {
|
||||
ExtraTrees.proxy.openGui(
|
||||
ExtraTreesGUID.MothDatabaseNEI, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return (stack.getItemDamage() == 0) ?
|
||||
I18N.localise("extratrees.item.mothDatabase") :
|
||||
I18N.localise("extratrees.item.mothMasterDatabase");
|
||||
}
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return (stack.getItemDamage() == 0)
|
||||
? I18N.localise("extratrees.item.mothDatabase")
|
||||
: I18N.localise("extratrees.item.mothMasterDatabase");
|
||||
}
|
||||
}
|
||||
@@ -24,182 +24,209 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
public class ModuleItems implements IInitializable {
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraTrees.itemMisc = Binnie.Item.registerMiscItems(ExtraTreeItems.values(), Tabs.tabArboriculture);
|
||||
ExtraTrees.itemDictionary = new ItemDictionary();
|
||||
if (BinnieCore.isLepidopteryActive()) {
|
||||
ExtraTrees.itemDictionaryLepi = new ItemMothDatabase();
|
||||
}
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraTrees.itemMisc = Binnie.Item.registerMiscItems(ExtraTreeItems.values(), Tabs.tabArboriculture);
|
||||
ExtraTrees.itemDictionary = new ItemDictionary();
|
||||
if (BinnieCore.isLepidopteryActive()) {
|
||||
ExtraTrees.itemDictionaryLepi = new ItemMothDatabase();
|
||||
}
|
||||
|
||||
Binnie.Liquid.createLiquids(ExtraTreeLiquid.values(), ItemFluidContainer.LiquidExtraTree);
|
||||
ExtraTrees.itemFood = new ItemFood();
|
||||
Binnie.Liquid.createLiquids(ExtraTreeLiquid.values(), ItemFluidContainer.LiquidExtraTree);
|
||||
ExtraTrees.itemFood = new ItemFood();
|
||||
|
||||
ExtraTrees.itemHammer = new ItemHammer(false);
|
||||
ExtraTrees.itemDurableHammer = new ItemHammer(true);
|
||||
}
|
||||
ExtraTrees.itemHammer = new ItemHammer(false);
|
||||
ExtraTrees.itemDurableHammer = new ItemHammer(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
OreDictionary.registerOre("pulpWood", ExtraTreeItems.Sawdust.get(1));
|
||||
Food.registerOreDictionary();
|
||||
OreDictionary.registerOre("cropApple", Items.apple);
|
||||
OreDictionary.registerOre("seedWheat", Items.wheat_seeds);
|
||||
@Override
|
||||
public void init() {
|
||||
OreDictionary.registerOre("pulpWood", ExtraTreeItems.Sawdust.get(1));
|
||||
Food.registerOreDictionary();
|
||||
OreDictionary.registerOre("cropApple", Items.apple);
|
||||
OreDictionary.registerOre("seedWheat", Items.wheat_seeds);
|
||||
|
||||
Food.Crabapple.addJuice(10, 150, 10);
|
||||
Food.Orange.addJuice(10, 400, 15);
|
||||
Food.Kumquat.addJuice(10, 300, 10);
|
||||
Food.Lime.addJuice(10, 300, 10);
|
||||
Food.WildCherry.addOil(20, 50, 5);
|
||||
Food.SourCherry.addOil(20, 50, 3);
|
||||
Food.BlackCherry.addOil(20, 50, 5);
|
||||
Food.Blackthorn.addJuice(10, 50, 5);
|
||||
Food.CherryPlum.addJuice(10, 100, 60);
|
||||
Food.Almond.addOil(20, 80, 5);
|
||||
Food.Apricot.addJuice(10, 150, 40);
|
||||
Food.Grapefruit.addJuice(10, 500, 15);
|
||||
Food.Peach.addJuice(10, 150, 40);
|
||||
Food.Satsuma.addJuice(10, 300, 10);
|
||||
Food.BuddhaHand.addJuice(10, 400, 15);
|
||||
Food.Citron.addJuice(10, 400, 15);
|
||||
Food.FingerLime.addJuice(10, 300, 10);
|
||||
Food.KeyLime.addJuice(10, 300, 10);
|
||||
Food.Manderin.addJuice(10, 400, 10);
|
||||
Food.Nectarine.addJuice(10, 150, 40);
|
||||
Food.Pomelo.addJuice(10, 300, 10);
|
||||
Food.Tangerine.addJuice(10, 300, 10);
|
||||
Food.Pear.addJuice(10, 300, 20);
|
||||
Food.SandPear.addJuice(10, 200, 10);
|
||||
Food.Hazelnut.addOil(20, 150, 5);
|
||||
Food.Butternut.addOil(20, 180, 5);
|
||||
Food.Beechnut.addOil(20, 100, 4);
|
||||
Food.Pecan.addOil(29, 50, 2);
|
||||
Food.Banana.addJuice(10, 100, 30);
|
||||
Food.RedBanana.addJuice(10, 100, 30);
|
||||
Food.Plantain.addJuice(10, 100, 40);
|
||||
Food.BrazilNut.addOil(20, 20, 2);
|
||||
Food.Fig.addOil(20, 50, 3);
|
||||
Food.Acorn.addOil(20, 50, 3);
|
||||
Food.Elderberry.addJuice(10, 100, 5);
|
||||
Food.Olive.addOil(20, 50, 3);
|
||||
Food.GingkoNut.addOil(20, 50, 5);
|
||||
Food.Coffee.addOil(15, 20, 2);
|
||||
Food.OsangeOrange.addJuice(10, 300, 15);
|
||||
Food.Clove.addOil(10, 25, 2);
|
||||
Food.Coconut.addOil(20, 300, 25);
|
||||
Food.Cashew.addJuice(10, 150, 15);
|
||||
Food.Avacado.addJuice(10, 300, 15);
|
||||
Food.Nutmeg.addOil(20, 50, 10);
|
||||
Food.Allspice.addOil(20, 50, 10);
|
||||
Food.Chilli.addJuice(10, 100, 10);
|
||||
Food.StarAnise.addOil(20, 100, 10);
|
||||
Food.Mango.addJuice(10, 400, 20);
|
||||
Food.Starfruit.addJuice(10, 300, 10);
|
||||
Food.Candlenut.addJuice(20, 50, 10);
|
||||
}
|
||||
Food.Crabapple.addJuice(10, 150, 10);
|
||||
Food.Orange.addJuice(10, 400, 15);
|
||||
Food.Kumquat.addJuice(10, 300, 10);
|
||||
Food.Lime.addJuice(10, 300, 10);
|
||||
Food.WildCherry.addOil(20, 50, 5);
|
||||
Food.SourCherry.addOil(20, 50, 3);
|
||||
Food.BlackCherry.addOil(20, 50, 5);
|
||||
Food.Blackthorn.addJuice(10, 50, 5);
|
||||
Food.CherryPlum.addJuice(10, 100, 60);
|
||||
Food.Almond.addOil(20, 80, 5);
|
||||
Food.Apricot.addJuice(10, 150, 40);
|
||||
Food.Grapefruit.addJuice(10, 500, 15);
|
||||
Food.Peach.addJuice(10, 150, 40);
|
||||
Food.Satsuma.addJuice(10, 300, 10);
|
||||
Food.BuddhaHand.addJuice(10, 400, 15);
|
||||
Food.Citron.addJuice(10, 400, 15);
|
||||
Food.FingerLime.addJuice(10, 300, 10);
|
||||
Food.KeyLime.addJuice(10, 300, 10);
|
||||
Food.Manderin.addJuice(10, 400, 10);
|
||||
Food.Nectarine.addJuice(10, 150, 40);
|
||||
Food.Pomelo.addJuice(10, 300, 10);
|
||||
Food.Tangerine.addJuice(10, 300, 10);
|
||||
Food.Pear.addJuice(10, 300, 20);
|
||||
Food.SandPear.addJuice(10, 200, 10);
|
||||
Food.Hazelnut.addOil(20, 150, 5);
|
||||
Food.Butternut.addOil(20, 180, 5);
|
||||
Food.Beechnut.addOil(20, 100, 4);
|
||||
Food.Pecan.addOil(29, 50, 2);
|
||||
Food.Banana.addJuice(10, 100, 30);
|
||||
Food.RedBanana.addJuice(10, 100, 30);
|
||||
Food.Plantain.addJuice(10, 100, 40);
|
||||
Food.BrazilNut.addOil(20, 20, 2);
|
||||
Food.Fig.addOil(20, 50, 3);
|
||||
Food.Acorn.addOil(20, 50, 3);
|
||||
Food.Elderberry.addJuice(10, 100, 5);
|
||||
Food.Olive.addOil(20, 50, 3);
|
||||
Food.GingkoNut.addOil(20, 50, 5);
|
||||
Food.Coffee.addOil(15, 20, 2);
|
||||
Food.OsangeOrange.addJuice(10, 300, 15);
|
||||
Food.Clove.addOil(10, 25, 2);
|
||||
Food.Coconut.addOil(20, 300, 25);
|
||||
Food.Cashew.addJuice(10, 150, 15);
|
||||
Food.Avacado.addJuice(10, 300, 15);
|
||||
Food.Nutmeg.addOil(20, 50, 10);
|
||||
Food.Allspice.addOil(20, 50, 10);
|
||||
Food.Chilli.addJuice(10, 100, 10);
|
||||
Food.StarAnise.addOil(20, 100, 10);
|
||||
Food.Mango.addJuice(10, 400, 20);
|
||||
Food.Starfruit.addJuice(10, 300, 10);
|
||||
Food.Candlenut.addJuice(20, 50, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(ExtraTrees.itemDurableHammer, 1, 0),
|
||||
"wiw", " s ", " s ",
|
||||
'w', Blocks.obsidian,
|
||||
'i', Items.gold_ingot,
|
||||
's', Items.stick
|
||||
));
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(ExtraTrees.itemDurableHammer, 1, 0),
|
||||
"wiw",
|
||||
" s ",
|
||||
" s ",
|
||||
'w',
|
||||
Blocks.obsidian,
|
||||
'i',
|
||||
Items.gold_ingot,
|
||||
's',
|
||||
Items.stick));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(ExtraTrees.itemHammer, 1, 0),
|
||||
"wiw", " s ", " s ",
|
||||
'w', "plankWood",
|
||||
'i', Items.iron_ingot,
|
||||
's', Items.stick
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(ExtraTrees.itemHammer, 1, 0),
|
||||
"wiw",
|
||||
" s ",
|
||||
" s ",
|
||||
'w',
|
||||
"plankWood",
|
||||
'i',
|
||||
Items.iron_ingot,
|
||||
's',
|
||||
Items.stick));
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
ExtraTreeItems.ProvenGear.get(1),
|
||||
" s ", "s s", " s ",
|
||||
's', Mods.forestry.stack("oakStick")
|
||||
);
|
||||
GameRegistry.addRecipe(
|
||||
ExtraTreeItems.ProvenGear.get(1), " s ", "s s", " s ", 's', Mods.forestry.stack("oakStick"));
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
ExtraTreeItems.GlassFitting.get(6),
|
||||
"s s", " i ", "s s",
|
||||
'i', Items.iron_ingot,
|
||||
's', Items.stick
|
||||
);
|
||||
GameRegistry.addRecipe(
|
||||
ExtraTreeItems.GlassFitting.get(6), "s s", " i ", "s s", 'i', Items.iron_ingot, 's', Items.stick);
|
||||
|
||||
try {
|
||||
Item minium = (Item) Class.forName("com.pahimar.ee3.lib.ItemIds").getField("miniumShard").get(null);
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(Food.Papayimar.get(1), minium, "cropPapaya"));
|
||||
} catch (Exception ex) {
|
||||
// ignored
|
||||
}
|
||||
try {
|
||||
Item minium = (Item) Class.forName("com.pahimar.ee3.lib.ItemIds")
|
||||
.getField("miniumShard")
|
||||
.get(null);
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(Food.Papayimar.get(1), minium, "cropPapaya"));
|
||||
} catch (Exception ex) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
100,
|
||||
Binnie.Liquid.getLiquidStack("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.getLiquidStack("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.getLiquidStack("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.getLiquidStack("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.stillManager.addRecipe(
|
||||
25,
|
||||
ExtraTreeLiquid.Resin.get(5),
|
||||
ExtraTreeLiquid.Turpentine.get(3)
|
||||
);
|
||||
RecipeManagers.stillManager.addRecipe(25, ExtraTreeLiquid.Resin.get(5), ExtraTreeLiquid.Turpentine.get(3));
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
25,
|
||||
ExtraTreeLiquid.Turpentine.get(50),
|
||||
null,
|
||||
((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 4),
|
||||
"x",
|
||||
'x', Mods.forestry.stack("beeswax")
|
||||
);
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
25,
|
||||
ExtraTreeLiquid.Turpentine.get(50),
|
||||
null,
|
||||
((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 4),
|
||||
"x",
|
||||
'x',
|
||||
Mods.forestry.stack("beeswax"));
|
||||
|
||||
if (Binnie.Liquid.getLiquidStack("Creosote Oil", 100) != null) {
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
25,
|
||||
Binnie.Liquid.getLiquidStack("Creosote Oil", 50),
|
||||
null,
|
||||
((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 1),
|
||||
"x",
|
||||
'x', Mods.forestry.stack("beeswax")
|
||||
);
|
||||
}
|
||||
if (Binnie.Liquid.getLiquidStack("Creosote Oil", 100) != null) {
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
25,
|
||||
Binnie.Liquid.getLiquidStack("Creosote Oil", 50),
|
||||
null,
|
||||
((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 1),
|
||||
"x",
|
||||
'x',
|
||||
Mods.forestry.stack("beeswax"));
|
||||
}
|
||||
|
||||
for (FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
|
||||
if (data.fluid.isFluidEqual(Binnie.Liquid.getLiquidStack("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());
|
||||
}
|
||||
}
|
||||
for (FluidContainerRegistry.FluidContainerData data :
|
||||
FluidContainerRegistry.getRegisteredFluidContainerData()) {
|
||||
if (data.fluid.isFluidEqual(Binnie.Liquid.getLiquidStack("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());
|
||||
}
|
||||
}
|
||||
|
||||
FuelManager.bronzeEngineFuel.put(ExtraTreeLiquid.Sap.get(1).getFluid(), new EngineBronzeFuel(ExtraTreeLiquid.Sap.get(1).getFluid(), 20, 10000, 1));
|
||||
FuelManager.bronzeEngineFuel.put(ExtraTreeLiquid.Resin.get(1).getFluid(), new EngineBronzeFuel(ExtraTreeLiquid.Resin.get(1).getFluid(), 30, 10000, 1));
|
||||
for (ILogType.ExtraTreeLog log : ILogType.ExtraTreeLog.values()) {
|
||||
log.addRecipe();
|
||||
}
|
||||
}
|
||||
FuelManager.bronzeEngineFuel.put(
|
||||
ExtraTreeLiquid.Sap.get(1).getFluid(),
|
||||
new EngineBronzeFuel(ExtraTreeLiquid.Sap.get(1).getFluid(), 20, 10000, 1));
|
||||
FuelManager.bronzeEngineFuel.put(
|
||||
ExtraTreeLiquid.Resin.get(1).getFluid(),
|
||||
new EngineBronzeFuel(ExtraTreeLiquid.Resin.get(1).getFluid(), 30, 10000, 1));
|
||||
for (ILogType.ExtraTreeLog log : ILogType.ExtraTreeLog.values()) {
|
||||
log.addRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,70 +24,71 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public enum ExtraTreeMachine implements IMachineType {
|
||||
Lumbermill(LumbermillPackage.class),
|
||||
Woodworker(WoodworkerPackage.class),
|
||||
Panelworker(PanelworkerPackage.class),
|
||||
Glassworker(GlassworkerPackage.class),
|
||||
Tileworker(TileworkerPackage.class);
|
||||
Lumbermill(LumbermillPackage.class),
|
||||
Woodworker(WoodworkerPackage.class),
|
||||
Panelworker(PanelworkerPackage.class),
|
||||
Glassworker(GlassworkerPackage.class),
|
||||
Tileworker(TileworkerPackage.class);
|
||||
|
||||
protected Class<? extends MachinePackage> cls;
|
||||
protected Class<? extends MachinePackage> cls;
|
||||
|
||||
ExtraTreeMachine(Class<? extends MachinePackage> cls) {
|
||||
this.cls = cls;
|
||||
}
|
||||
ExtraTreeMachine(Class<? extends MachinePackage> cls) {
|
||||
this.cls = cls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends MachinePackage> getPackageClass() {
|
||||
return cls;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends MachinePackage> getPackageClass() {
|
||||
return cls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
if (this == ExtraTreeMachine.Tileworker) {
|
||||
return BinnieCore.isBotanyActive();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
if (this == ExtraTreeMachine.Tileworker) {
|
||||
return BinnieCore.isBotanyActive();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack get(int i) {
|
||||
return new ItemStack(ExtraTrees.blockMachine, i, ordinal());
|
||||
}
|
||||
public ItemStack get(int i) {
|
||||
return new ItemStack(ExtraTrees.blockMachine, i, ordinal());
|
||||
}
|
||||
|
||||
public static class ComponentExtraTreeGUI extends MachineComponent implements IInteraction.RightClick {
|
||||
protected ExtraTreesGUID id;
|
||||
public static class ComponentExtraTreeGUI extends MachineComponent implements IInteraction.RightClick {
|
||||
protected ExtraTreesGUID id;
|
||||
|
||||
public ComponentExtraTreeGUI(Machine machine, ExtraTreesGUID id) {
|
||||
super(machine);
|
||||
this.id = id;
|
||||
}
|
||||
public ComponentExtraTreeGUI(Machine machine, ExtraTreesGUID id) {
|
||||
super(machine);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRightClick(World world, EntityPlayer player, int x, int y, int z) {
|
||||
ExtraTrees.proxy.openGui(id, player, x, y, z);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onRightClick(World world, EntityPlayer player, int x, int y, int z) {
|
||||
ExtraTrees.proxy.openGui(id, player, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract static class PackageExtraTreeMachine extends MachinePackage {
|
||||
protected BinnieResource textureName;
|
||||
public abstract static class PackageExtraTreeMachine extends MachinePackage {
|
||||
protected BinnieResource textureName;
|
||||
|
||||
protected PackageExtraTreeMachine(String uid, String textureName, boolean powered) {
|
||||
super(uid, powered);
|
||||
this.textureName = Binnie.Resource.getFile(ExtraTrees.instance, ResourceType.Tile, textureName);
|
||||
}
|
||||
protected PackageExtraTreeMachine(String uid, String textureName, boolean powered) {
|
||||
super(uid, powered);
|
||||
this.textureName = Binnie.Resource.getFile(ExtraTrees.instance, ResourceType.Tile, textureName);
|
||||
}
|
||||
|
||||
protected PackageExtraTreeMachine(String uid, BinnieResource textureName, boolean powered) {
|
||||
super(uid, powered);
|
||||
this.textureName = textureName;
|
||||
}
|
||||
protected PackageExtraTreeMachine(String uid, BinnieResource textureName, boolean powered) {
|
||||
super(uid, powered);
|
||||
this.textureName = textureName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick, RenderBlocks renderer) {
|
||||
MachineRendererForestry.renderMachine(textureName.getShortPath(), x, y, z, partialTick);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void renderMachine(
|
||||
Machine machine, double x, double y, double z, float partialTick, RenderBlocks renderer) {
|
||||
MachineRendererForestry.renderMachine(textureName.getShortPath(), x, y, z, partialTick);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 818 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user