port to forestry 4.2

This commit is contained in:
marcin212 committed 2016-10-20 02:56:31 +02:00
1 parent dbc5c1a564
commit f969f63b66
3697 files changed
+78372

No files matched your search

@@ -0,0 +1,140 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees;
import binnie.extrabees.ExtraBees;
import binnie.core.BinnieCore;
import binnie.core.network.BinniePacketHandler;
import binnie.core.proxy.IProxyCore;
import binnie.extratrees.config.ConfigurationMain;
import binnie.extratrees.core.ExtraTreesGUID;
import binnie.core.gui.IBinnieGUID;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import binnie.extratrees.core.ModuleCore;
import binnie.extratrees.machines.ModuleMachine;
import binnie.extratrees.carpentry.ModuleCarpentry;
import binnie.extratrees.genetics.ModuleGenetics;
import binnie.extratrees.alcohol.ModuleAlcohol;
import binnie.extratrees.item.ModuleItems;
import binnie.extratrees.block.ModuleBlocks;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import binnie.extratrees.carpentry.BlockStainedDesign;
import binnie.extratrees.block.decor.BlockHedge;
import binnie.extratrees.block.decor.BlockMultiFence;
import binnie.extratrees.alcohol.drink.ItemDrink;
import binnie.extratrees.carpentry.BlockCarpentry;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import cpw.mods.fml.common.SidedProxy;
import binnie.extratrees.proxy.Proxy;
import cpw.mods.fml.common.Mod;
import binnie.core.AbstractMod;
@Mod(modid = "ExtraTrees", name = "Extra Trees", useMetadata = true, dependencies = "after:BinnieCore")
public class ExtraTrees extends AbstractMod
{
@Mod.Instance("ExtraTrees")
public static ExtraTrees instance;
@SidedProxy(clientSide = "binnie.extratrees.proxy.ProxyClient", serverSide = "binnie.extratrees.proxy.ProxyServer")
public static Proxy proxy;
public static Item itemDictionary;
public static Item itemDictionaryLepi;
public static 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 blockMachine;
public static Block blockFence;
public static BlockCarpentry blockPanel;
public static Block blockKitchen;
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 Block blockBranch;
public static ItemDrink drink;
public static BlockMultiFence blockMultiFence;
public static Block blockDrink;
public static BlockHedge blockHedge;
public static BlockStainedDesign blockStained;
public static int fruitPodRenderId;
public static int doorRenderId;
public static int branchRenderId;
public static int fenceID;
public static int stairsID;
@Mod.EventHandler
public void preInit(final FMLPreInitializationEvent evt) {
this.addModule(new ModuleBlocks());
this.addModule(new ModuleItems());
this.addModule(new ModuleAlcohol());
this.addModule(new ModuleGenetics());
this.addModule(new ModuleCarpentry());
this.addModule(new ModuleMachine());
this.addModule(new ModuleCore());
this.preInit();
}
@Mod.EventHandler
public void init(final FMLInitializationEvent evt) {
this.init();
}
@Mod.EventHandler
public void postInit(final FMLPostInitializationEvent evt) {
this.postInit();
}
public ExtraTrees() {
ExtraTrees.instance = this;
}
@Override
public IBinnieGUID[] getGUIDs() {
return ExtraTreesGUID.values();
}
@Override
public Class[] getConfigs() {
return new Class[] { ConfigurationMain.class };
}
@Override
public String getChannel() {
return "ET";
}
@Override
public IProxyCore getProxy() {
return ExtraTrees.proxy;
}
@Override
public String getModID() {
return "extratrees";
}
@Override
protected Class<? extends BinniePacketHandler> getPacketHandler() {
return PacketHandler.class;
}
@Override
public boolean isActive() {
return BinnieCore.isExtraTreesActive();
}
public static class PacketHandler extends BinniePacketHandler
{
public PacketHandler() {
super(ExtraBees.instance);
}
}
}
@@ -0,0 +1,105 @@
package binnie.extratrees;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldSettings;
import net.minecraft.world.WorldType;
import net.minecraft.world.WorldSettings.GameType;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.storage.SaveHandler;
import forestry.api.arboriculture.EnumWoodType;
import forestry.arboriculture.tiles.TileWood;
import binnie.core.block.TileEntityMetadata;
public class FakeWorld extends World {
public static FakeWorld instance = new FakeWorld();
Block block;
int metadata;
TileEntity te;
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 FakeWorld() {
super((SaveHandler) null, "", (WorldProvider) null, new WorldSettings(Long.MAX_VALUE, GameType.NOT_SET, false, false, WorldType.FLAT), null);
}
@Override
public boolean setBlock(int p_147449_1_, int p_147449_2_, int p_147449_3_, Block block) {
this.block = block;
return true;
}
@Override
public boolean setBlock(int p_147465_1_, int p_147465_2_, int p_147465_3_, 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 p_147468_1_, int p_147468_2_, int p_147468_3_) {
return true;
}
@Override
public TileEntity getTileEntity(int x, int y, int z) {
return te;
}
@Override
public void setTileEntity(int p_147455_1_, int p_147455_2_, int p_147455_3_, TileEntity p_147455_4_) {
}
@Override
public Block getBlock(int x, int y, int z) {
return block != null ? block : Blocks.air;
}
@Override
public int getBlockMetadata(int p_72805_1_, int p_72805_2_, int p_72805_3_) {
return metadata;
}
@Override
public boolean setBlockMetadataWithNotify(int p_72921_1_, int p_72921_2_, int p_72921_3_, int metadata, int p_72921_5_) {
this.metadata = metadata;
return true;
}
@Override
protected IChunkProvider createChunkProvider() {
return null;
}
@Override
protected int func_152379_p() {
return 0;
}
@Override
public Entity getEntityByID(int p_73045_1_) {
return null;
}
}
@@ -0,0 +1,160 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import binnie.core.liquid.FluidContainer;
import binnie.Binnie;
import net.minecraftforge.fluids.FluidStack;
import binnie.extratrees.ExtraTrees;
import net.minecraft.client.renderer.texture.IIconRegister;
import java.util.ArrayList;
import net.minecraft.util.IIcon;
import java.util.List;
import binnie.core.liquid.IFluidType;
public enum Alcohol implements IFluidType, ICocktailLiquid
{
Apple("ciderApple", 16432700, 0.3, 0.05),
Apricot("wineApricot", 15781686, 0.3, 0.1),
Banana("wineBanana", 14993485, 0.3, 0.1),
Cherry("wineCherry", 11207702, 0.3, 0.1),
Elderberry("wineElderberry", 9764865, 0.3, 0.1),
Peach("ciderPeach", 15361563, 0.3, 0.05),
Pear("ciderPear", 15061095, 0.3, 0.05),
Plum("winePlum", 12063752, 0.3, 0.1),
Carrot("wineCarrot", 16219394, 0.3, 0.1),
WhiteWine("wineWhite", 15587989, 0.1, 0.1),
RedWine("wineRed", 7670539, 0.2, 0.1),
SparklingWine("wineSparkling", 16709566, 0.1, 0.1),
Agave("wineAgave", 13938276, 0.2, 0.1),
Potato("fermentedPotatoes", 12028240, 0.8, 0.1),
Citrus("wineCitrus", 16776960, 0.2, 0.1),
Cranberry("wineCranberry", 11599874, 0.2, 0.1),
Pineapple("winePineapple", 14724150, 0.2, 0.1),
Tomato("wineTomato", 12458521, 0.2, 0.1),
Fruit("juice", 16432700, 0.2, 0.1),
Ale("beerAle", 12991009, 0.7, 0.05),
Lager("beerLager", 15301637, 0.7, 0.05),
WheatBeer("beerWheat", 14380552, 0.7, 0.05),
RyeBeer("beerRye", 10836007, 0.7, 0.05),
CornBeer("beerCorn", 13411364, 0.7, 0.05),
Stout("beerStout", 5843201, 0.8, 0.05),
Barley("mashGrain", 12991009, 0.9, 0.05),
Wheat("mashWheat", 12991009, 0.9, 0.05),
Rye("mashRye", 10836007, 0.9, 0.05),
Corn("mashCorn", 13411364, 0.9, 0.05);
List<String> fermentationLiquid;
String fermentationSolid;
String ident;
IIcon icon;
int colour;
float transparency;
float abv;
private void setFementation(final Juice juice) {
this.fermentationLiquid.add(juice.getIdentifier());
}
private void setFementation(final String oreDict) {
this.fermentationSolid = oreDict;
}
private Alcohol(final String ident, final int colour, final double transparency, final double abv) {
this.fermentationLiquid = new ArrayList<String>();
this.fermentationSolid = "";
this.ident = ident;
this.colour = colour;
this.transparency = (float) transparency;
this.abv = (float) abv;
}
@Override
public String toString() {
return this.getName();
}
@Override
public IIcon getIcon() {
return this.icon;
}
@Override
public void registerIcon(final IIconRegister register) {
this.icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
}
@Override
public String getName() {
return ExtraTrees.proxy.localise("fluid.alcohol." + this.name().toLowerCase());
}
@Override
public String getIdentifier() {
return "binnie." + this.ident;
}
@Override
public int getColour() {
return this.colour;
}
@Override
public FluidStack get(final int amount) {
return Binnie.Liquid.getLiquidStack(this.getIdentifier(), amount);
}
@Override
public int getTransparency() {
return (int) (Math.min(1.0, this.transparency + 0.3) * 255.0);
}
@Override
public String getTooltip(final int ratio) {
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + this.getName();
}
@Override
public boolean canPlaceIn(final FluidContainer container) {
return true;
}
@Override
public boolean showInCreative(final FluidContainer container) {
return container == FluidContainer.Glass;
}
@Override
public int getContainerColour() {
return this.getColour();
}
@Override
public float getABV() {
return this.abv;
}
static {
Alcohol.Apple.setFementation(Juice.Apple);
Alcohol.Apricot.setFementation(Juice.Apricot);
Alcohol.Banana.setFementation(Juice.Banana);
Alcohol.Cherry.setFementation(Juice.Cherry);
Alcohol.Elderberry.setFementation(Juice.Elderberry);
Alcohol.Peach.setFementation(Juice.Peach);
Alcohol.Pear.setFementation(Juice.Pear);
Alcohol.Plum.setFementation(Juice.Plum);
Alcohol.Carrot.setFementation(Juice.Carrot);
Alcohol.WhiteWine.setFementation(Juice.WhiteGrape);
Alcohol.RedWine.setFementation(Juice.RedGrape);
Alcohol.Citrus.setFementation(Juice.Lemon);
Alcohol.Citrus.setFementation(Juice.Lime);
Alcohol.Citrus.setFementation(Juice.Orange);
Alcohol.Citrus.setFementation(Juice.Grapefruit);
Alcohol.Tomato.setFementation(Juice.Tomato);
Alcohol.Cranberry.setFementation(Juice.Cranberry);
Alcohol.Pineapple.setFementation(Juice.Pineapple);
Alcohol.Potato.setFementation("cropPotato");
}
}
@@ -0,0 +1,34 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import net.minecraft.potion.PotionEffect;
import net.minecraft.potion.Potion;
import net.minecraft.entity.player.EntityPlayer;
public class AlcoholEffect
{
public static void makeDrunk(final EntityPlayer player, final float strength) {
final int existingStrength = player.isPotionActive(Potion.confusion) ? player.getActivePotionEffect(Potion.confusion).getAmplifier() : 0;
final int existingTime = player.isPotionActive(Potion.confusion) ? player.getActivePotionEffect(Potion.confusion).getDuration() : 0;
int time = (int) (100.0 * Math.sqrt(strength)) + existingTime;
final float intensity = 0.1f * strength + existingStrength + existingTime / 500;
if (time < 5) {
time = 5;
}
float slowIntense = (intensity - 10.0f) / 4.0f;
if (slowIntense < 0.0f) {
slowIntense = 0.0f;
}
float blindIntense = (intensity - 25.0f) / 2.0f;
if (blindIntense < 0.0f) {
blindIntense = 0.0f;
}
player.addPotionEffect(new PotionEffect(Potion.confusion.id, time, (int) intensity, false));
if (slowIntense > 0.0f) {
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, time, (int) slowIntense, false));
}
}
}
@@ -0,0 +1,175 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import binnie.extratrees.alcohol.drink.DrinkManager;
import binnie.extratrees.alcohol.drink.DrinkLiquid;
import java.util.HashMap;
import java.util.Map;
public enum Cocktail
{
Bellini("Bellini", Glassware.Flute, 15974764),
BlackRussian("Black Russian", Glassware.OldFashioned, 3347992),
BloodyMary("Bloody Mary", Glassware.Highball, 12660480),
Cosmopolitan("Cosmopolitan", Glassware.Cocktail, 14811136),
CubaLibre("Cuba Libre", Glassware.Highball, 9044996),
FrenchConnection("French Connection", Glassware.OldFashioned, 16166183),
GodFather("God Father", Glassware.OldFashioned, 13134109),
GodMother("God Mother", Glassware.OldFashioned, 14644737),
Grasshopper("Grasshopper", Glassware.Cocktail, 4441194),
French75("French 75", Glassware.Flute, 15521949),
HarveyWallbanger("Harvey Wallbanger", Glassware.Highball, 16371968),
HemingwaySpecial("Hemingway Special", Glassware.Cocktail, 15201205),
HorsesNeck("Horse's Neck", Glassware.OldFashioned, 16692480),
IrishCoffee("Irish Coffee", Glassware.Wine, 4460034),
Kir("Kir", Glassware.Wine, 16004638),
Bramble("Bramble", Glassware.OldFashioned, 12804974),
B52("B-52", Glassware.Shot, 12934656),
DarkNStormy("Dark 'N' Stormy", Glassware.Highball, 12215848),
DirtyMartini("Dirty Martini", Glassware.Cocktail, 14332499),
ExpressoMartini("Expresso Martini", Glassware.Cocktail, 6498346),
FrenchMartini("French Martini", Glassware.Cocktail, 12660045),
Kamikaze("Kamikaze", Glassware.Cocktail, 14801069),
LemonDropMartini("Lemon Drop Martini", Glassware.Cocktail, 16375437),
PiscoSour("Pisco Sour", Glassware.OldFashioned, 15394463),
RussianSpringPunch("Russian Spring Punch", Glassware.Highball, 11805740),
SpritzVeneziano("Spritz Veneziano", Glassware.OldFashioned, 15355648),
TommysMargarita("Tommy's Margartita", Glassware.Cocktail, 14867592),
Vesper("Vesper", Glassware.Cocktail, 15658732),
SexOnTheBeach("Sex on the Beach", Glassware.Highball, 16677426);
static final Map<String, ICocktailIngredient> cocktailIngredients;
public String name;
public Glassware glassware;
public int colour;
public Map<ICocktailIngredient, Integer> ingredients;
private Cocktail(final String name, final Glassware glassware, final int colour) {
this.ingredients = new HashMap<ICocktailIngredient, Integer>();
this.name = name;
this.glassware = glassware;
this.colour = colour;
}
private void add(final ICocktailIngredient ingredient, final int ratio) {
this.ingredients.put(ingredient, ratio);
}
public static Cocktail get(final Map<ICocktailIngredient, Integer> ingredients) {
for (final Cocktail cocktail : values()) {
boolean is = true;
for (final Map.Entry<ICocktailIngredient, Integer> entry : ingredients.entrySet()) {
if (cocktail.ingredients.get(entry.getKey()) != entry.getValue()) {
is = false;
}
}
if (is) {
return cocktail;
}
}
return null;
}
public static void registerIngredient(final ICocktailIngredient ingredient) {
Cocktail.cocktailIngredients.put(ingredient.getIdentifier().toLowerCase(), ingredient);
DrinkManager.registerDrinkLiquid(ingredient.getIdentifier().toLowerCase(), new DrinkLiquid(ingredient.getName(), ingredient.getColour(), ingredient.getTransparency(), ingredient.getABV()));
}
public static ICocktailIngredient getIngredient(final String name2) {
return Cocktail.cocktailIngredients.get(name2.toLowerCase());
}
public static boolean isIngredient(final String name) {
return name != null && Cocktail.cocktailIngredients.containsKey(name.toLowerCase());
}
static {
cocktailIngredients = new HashMap<String, ICocktailIngredient>();
Cocktail.Bellini.add(Alcohol.SparklingWine, 2);
Cocktail.Bellini.add(Juice.Peach, 1);
Cocktail.BlackRussian.add(Spirit.Vodka, 5);
Cocktail.BlackRussian.add(Liqueur.Coffee, 2);
Cocktail.BloodyMary.add(Spirit.Vodka, 3);
Cocktail.BloodyMary.add(Juice.Tomato, 6);
Cocktail.BloodyMary.add(Juice.Lemon, 1);
Cocktail.Cosmopolitan.add(Spirit.Vodka, 3);
Cocktail.Cosmopolitan.add(Liqueur.Orange, 1);
Cocktail.Cosmopolitan.add(Juice.Lime, 1);
Cocktail.Cosmopolitan.add(Juice.Cranberry, 2);
Cocktail.CubaLibre.add(MiscFluid.CarbonatedWater, 12);
Cocktail.CubaLibre.add(Spirit.WhiteRum, 5);
Cocktail.CubaLibre.add(Juice.Lime, 1);
Cocktail.FrenchConnection.add(Spirit.Brandy, 1);
Cocktail.FrenchConnection.add(Liqueur.Almond, 1);
Cocktail.GodFather.add(Spirit.Whiskey, 1);
Cocktail.GodFather.add(Liqueur.Almond, 1);
Cocktail.GodMother.add(Spirit.Vodka, 1);
Cocktail.GodFather.add(Liqueur.Almond, 1);
Cocktail.Grasshopper.add(Liqueur.Mint, 1);
Cocktail.Grasshopper.add(Liqueur.Chocolate, 1);
Cocktail.Grasshopper.add(MiscFluid.Cream, 1);
Cocktail.French75.add(Spirit.Gin, 2);
Cocktail.French75.add(Juice.Lemon, 1);
Cocktail.French75.add(Alcohol.SparklingWine, 4);
Cocktail.HarveyWallbanger.add(Spirit.Vodka, 3);
Cocktail.HarveyWallbanger.add(Liqueur.Herbal, 1);
Cocktail.HarveyWallbanger.add(Juice.Orange, 6);
Cocktail.HemingwaySpecial.add(Spirit.WhiteRum, 4);
Cocktail.HemingwaySpecial.add(Juice.Grapefruit, 3);
Cocktail.HemingwaySpecial.add(Liqueur.Cherry, 1);
Cocktail.HemingwaySpecial.add(Juice.Lime, 1);
Cocktail.HorsesNeck.add(Spirit.Brandy, 1);
Cocktail.HorsesNeck.add(MiscFluid.GingerAle, 3);
Cocktail.IrishCoffee.add(Spirit.Whiskey, 2);
Cocktail.IrishCoffee.add(MiscFluid.Coffee, 4);
Cocktail.IrishCoffee.add(MiscFluid.Cream, 2);
Cocktail.Kir.add(Alcohol.WhiteWine, 9);
Cocktail.Kir.add(Liqueur.Blackcurrant, 1);
Cocktail.Bramble.add(Spirit.Gin, 4);
Cocktail.Bramble.add(Juice.Lemon, 2);
Cocktail.Bramble.add(MiscFluid.SugarSyrup, 1);
Cocktail.Bramble.add(Liqueur.Blackberry, 2);
Cocktail.B52.add(Liqueur.Coffee, 1);
Cocktail.B52.add(Liqueur.Orange, 1);
Cocktail.DarkNStormy.add(Spirit.DarkRum, 1);
Cocktail.DarkNStormy.add(MiscFluid.GingerAle, 3);
Cocktail.DirtyMartini.add(Spirit.Vodka, 6);
Cocktail.DirtyMartini.add(Spirit.FortifiedWine, 1);
Cocktail.DirtyMartini.add(Juice.Olive, 1);
Cocktail.ExpressoMartini.add(Spirit.Vodka, 5);
Cocktail.ExpressoMartini.add(Liqueur.Coffee, 1);
Cocktail.ExpressoMartini.add(MiscFluid.SugarSyrup, 1);
Cocktail.ExpressoMartini.add(MiscFluid.Coffee, 1);
Cocktail.FrenchMartini.add(Spirit.Vodka, 3);
Cocktail.FrenchMartini.add(Liqueur.Raspberry, 1);
Cocktail.FrenchMartini.add(Juice.Pineapple, 1);
Cocktail.Kamikaze.add(Spirit.Vodka, 1);
Cocktail.Kamikaze.add(Liqueur.Orange, 1);
Cocktail.Kamikaze.add(Juice.Lime, 1);
Cocktail.LemonDropMartini.add(Spirit.Vodka, 5);
Cocktail.LemonDropMartini.add(Liqueur.Orange, 4);
Cocktail.LemonDropMartini.add(Juice.Lemon, 3);
Cocktail.PiscoSour.add(Spirit.Brandy, 8);
Cocktail.PiscoSour.add(Juice.Lemon, 4);
Cocktail.PiscoSour.add(MiscFluid.SugarSyrup, 3);
Cocktail.RussianSpringPunch.add(Spirit.Vodka, 5);
Cocktail.RussianSpringPunch.add(Juice.Lemon, 5);
Cocktail.RussianSpringPunch.add(Liqueur.Blackcurrant, 3);
Cocktail.RussianSpringPunch.add(MiscFluid.SugarSyrup, 1);
Cocktail.SpritzVeneziano.add(Alcohol.SparklingWine, 6);
Cocktail.SpritzVeneziano.add(MiscFluid.CarbonatedWater, 1);
Cocktail.TommysMargarita.add(Spirit.Tequila, 6);
Cocktail.TommysMargarita.add(Juice.Lime, 2);
Cocktail.TommysMargarita.add(MiscFluid.AgaveNectar, 1);
Cocktail.Vesper.add(Spirit.Gin, 8);
Cocktail.Vesper.add(Spirit.Vodka, 2);
Cocktail.Vesper.add(Spirit.FortifiedWine, 1);
Cocktail.SexOnTheBeach.add(Spirit.Vodka, 2);
Cocktail.SexOnTheBeach.add(Liqueur.Peach, 1);
Cocktail.SexOnTheBeach.add(Juice.Orange, 2);
Cocktail.SexOnTheBeach.add(Juice.Cranberry, 2);
}
}
@@ -0,0 +1,74 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import net.minecraft.item.ItemStack;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.Binnie;
import binnie.extratrees.ExtraTrees;
import net.minecraft.util.IIcon;
public enum Glassware
{
BeerMug(16, 10, 14),
Pint(20, 6, 20),
Snifter(17, 14, 11),
Flute(6, 13, 15),
Cocktail(8, 20, 8),
Cordial(2, 15, 7),
Collins(12, 8, 18),
Highball(8, 10, 14),
Hurricane(15, 10, 18),
Margarita(12, 18, 9),
OldFashioned(8, 13, 8),
Wine(8, 17, 10),
Shot(1, 13, 7),
Sherry(2, 17, 7),
Coupe(6, 19, 8);
private int capacity;
float contentBottom;
float contentHeight;
public IIcon glass;
public IIcon contents;
public String getName(final String liquid) {
if (liquid == null) {
return ExtraTrees.proxy.localise("item.glassware." + this.name().toLowerCase());
}
return Binnie.Language.localise(ExtraTrees.instance, "item.glassware." + this.name().toLowerCase() + ".usage", liquid);
}
public int getCapacity() {
return this.capacity;
}
private Glassware(final int capacity, final int contentBottom, final int contentHeight) {
this.capacity = 30 * capacity;
this.contentBottom = contentBottom / 32.0f;
this.contentHeight = contentHeight / 32.0f;
}
public void registerIcons(final IIconRegister par1IconRegister) {
this.glass = ExtraTrees.proxy.getIcon(par1IconRegister, "glassware/" + this.toString().toLowerCase() + ".glass");
this.contents = ExtraTrees.proxy.getIcon(par1IconRegister, "glassware/" + this.toString().toLowerCase() + ".contents");
}
public ItemStack get(final int i) {
return ExtraTrees.drink.getStack(this, null);
}
public float getContentBottom() {
return this.contentBottom;
}
public float getContentHeight() {
return this.contentHeight;
}
public int getVolume() {
return this.getCapacity();
}
}
@@ -0,0 +1,20 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
public interface ICocktailIngredient
{
String getName();
String getIdentifier();
int getColour();
int getTransparency();
String getTooltip(final int p0);
float getABV();
}
@@ -0,0 +1,12 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import net.minecraftforge.fluids.FluidStack;
public interface ICocktailLiquid extends ICocktailIngredient
{
FluidStack get(final int p0);
}
@@ -0,0 +1,120 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import binnie.Binnie;
import net.minecraftforge.fluids.FluidStack;
import binnie.extratrees.ExtraTrees;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.core.liquid.FluidContainer;
import net.minecraft.util.IIcon;
import binnie.core.liquid.IFluidType;
public enum Juice implements IFluidType, ICocktailLiquid
{
Apple("Apple Juice", "juiceApple", 16763442, 0.7, "Apple"),
Apricot("Apricot Juice", "juiceApricot", 16758046, 0.6, "Apricot"),
Banana("Banana Juice", "juiceBanana", 15324291, 0.6, "Banana"),
Cherry("Cherry Juice", "juiceCherry", 13044511, 0.6, "Cherry"),
Elderberry("Elderberry Juice", "juiceElderberry", 4204073, 0.6, "Elderberry"),
Lemon("Lemon Juice", "juiceLemon", 14604882, 0.7, "Lemon"),
Lime("Lime Juice", "juiceLime", 12177007, 0.6, "Lime"),
Orange("Orange Juice", "juiceOrange", 16359983, 0.8, "Orange"),
Peach("Peach Juice", "juicePeach", 16434525, 0.7, "Peach"),
Plum("Plum Juice", "juicePlum", 10559249, 0.7, "Plum"),
Carrot("Carrot Juice", "juiceCarrot", 16485911, 0.7, "Carrot"),
Tomato("Tomato Juice", "juiceTomato", 12731438, 0.7, "Tomato"),
Cranberry("Cranberry Juice", "juiceCranberry", 12920629, 0.7, "Cranberry"),
Grapefruit("Grapefruit Juice", "juiceGrapefruit", 15897173, 0.6, "Grapefruit"),
Olive("Olive Oil", "juiceOlive", 16042240, 0.6, "Olive"),
Pineapple("Pineapple Juice", "juicePineapple", 15189319, 0.6, "Pineapple"),
Pear("Pear Juice", "juicePear", 14204773, 0.6, "Pear"),
WhiteGrape("White Grape Juice", "juiceWhiteGrape", 16507769, 0.6, "WhiteGrape"),
RedGrape("Red Grape Juice", "juiceRedGrape", 9775412, 0.6, "RedGrape");
String name;
String ident;
public String squeezing;
IIcon icon;
int colour;
float transparency;
private void addSqueezing(final String oreDict) {
this.squeezing = oreDict;
}
private Juice(final String name, final String ident, final int colour, final double transparency, final String squeezing) {
this.name = name;
this.ident = ident;
this.colour = colour;
this.transparency = (float) transparency;
this.addSqueezing("crop" + squeezing);
}
@Override
public String toString() {
return this.name;
}
@Override
public boolean canPlaceIn(final FluidContainer container) {
return true;
}
@Override
public boolean showInCreative(final FluidContainer container) {
return container == FluidContainer.Glass;
}
@Override
public IIcon getIcon() {
return this.icon;
}
@Override
public void registerIcon(final IIconRegister register) {
this.icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
}
@Override
public String getName() {
return this.name;
}
@Override
public String getIdentifier() {
return "binnie." + this.ident;
}
@Override
public int getColour() {
return this.colour;
}
@Override
public FluidStack get(final int amount) {
return Binnie.Liquid.getLiquidStack(this.getIdentifier(), amount);
}
@Override
public int getTransparency() {
return (int) (Math.min(1.0, this.transparency + 0.3) * 255.0);
}
@Override
public String getTooltip(final int ratio) {
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + this.getName();
}
@Override
public int getContainerColour() {
return this.getColour();
}
@Override
public float getABV() {
return 0.0f;
}
}
@@ -0,0 +1,141 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import binnie.Binnie;
import net.minecraftforge.fluids.FluidStack;
import binnie.extratrees.ExtraTrees;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.core.liquid.FluidContainer;
import net.minecraft.util.IIcon;
import binnie.core.liquid.IFluidType;
public enum Liqueur implements IFluidType, ICocktailLiquid
{
Almond("Almond", 14966063, 0.3, 0.2),
Orange("Orange", 16353536, 0.4, 0.2),
Banana("Banana", 16302592, 0.5, 0.2),
Chocolate("Chocolate", 12667680, 0.3, 0.2),
Mint("Mint", 2737788, 0.4, 0.2),
Hazelnut("Hazelnut", 15570987, 0.3, 0.2),
Cinnamon("Cinnamon", 15028224, 0.3, 0.2),
Coffee("Coffee", 9847577, 0.4, 0.2),
Melon("Melon", 11584049, 0.4, 0.2),
Anise("Anise", 14344681, 0.3, 0.2),
Peach("Peach", 16684384, 0.4, 0.2),
Lemon("Lemon", 16311405, 0.4, 0.2),
Herbal("Herbal", 16700673, 0.3, 0.2),
Cherry("Cherry", 14096641, 0.5, 0.2),
Blackcurrant("Blackcurrant", 6962541, 0.5, 0.2),
Blackberry("Blackberry", 6837581, 0.5, 0.2),
Raspberry("Raspberry", 10158848, 0.5, 0.2);
String name;
String ident;
IIcon icon;
int colour;
float transparency;
float abv;
private void addFlavour(final String oreDict) {
}
private Liqueur(final String name, final int colour, final double transparency, final double abv) {
this(name + " Liqueur", "liqueur" + name, colour, transparency, abv);
}
private Liqueur(final String name, final String ident, final int colour, final double transparency, final double abv) {
this.name = name;
this.ident = ident;
this.colour = colour;
this.transparency = (float) transparency;
this.abv = (float) abv;
}
@Override
public String toString() {
return this.name;
}
@Override
public boolean canPlaceIn(final FluidContainer container) {
return true;
}
@Override
public boolean showInCreative(final FluidContainer container) {
return container == FluidContainer.Glass;
}
@Override
public IIcon getIcon() {
return this.icon;
}
@Override
public void registerIcon(final IIconRegister register) {
this.icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
}
@Override
public String getName() {
return this.name;
}
@Override
public String getIdentifier() {
return "binnie." + this.ident;
}
@Override
public int getColour() {
return this.colour;
}
@Override
public FluidStack get(final int amount) {
return Binnie.Liquid.getLiquidStack(this.getIdentifier(), amount);
}
@Override
public int getTransparency() {
return (int) (Math.min(1.0, this.transparency + 0.3) * 255.0);
}
@Override
public String getTooltip(final int ratio) {
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + this.getName();
}
@Override
public int getContainerColour() {
return this.getColour();
}
@Override
public float getABV() {
return this.abv;
}
static {
Liqueur.Almond.addFlavour("cropAlmond");
Liqueur.Orange.addFlavour("cropOrange");
Liqueur.Banana.addFlavour("cropBanana");
Liqueur.Chocolate.addFlavour("cropCocoa");
Liqueur.Mint.addFlavour("cropMint");
Liqueur.Hazelnut.addFlavour("cropHazelnut");
Liqueur.Cinnamon.addFlavour("cropCinnamon");
Liqueur.Coffee.addFlavour("cropCoffee");
Liqueur.Melon.addFlavour("cropMelon");
Liqueur.Anise.addFlavour("cropAnise");
Liqueur.Peach.addFlavour("cropPeach");
Liqueur.Lemon.addFlavour("cropLemon");
Liqueur.Herbal.addFlavour("cropHerbal");
Liqueur.Cherry.addFlavour("cropCherry");
Liqueur.Blackcurrant.addFlavour("cropBlackcurrant");
Liqueur.Blackberry.addFlavour("cropBlackberry");
Liqueur.Raspberry.addFlavour("cropRaspberry");
}
}
@@ -0,0 +1,103 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import binnie.Binnie;
import net.minecraftforge.fluids.FluidStack;
import binnie.extratrees.ExtraTrees;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.core.liquid.FluidContainer;
import net.minecraft.util.IIcon;
import binnie.core.liquid.IFluidType;
public enum MiscFluid implements IFluidType, ICocktailLiquid
{
CarbonatedWater("Carbonated Water", "water.carbonated", 13421823, 0.10000000149011612),
TonicWater("Tonic Water", "water.tonic", 13421823, 0.10000000149011612),
Cream("Carbonated Water", "cream", 15395550, 2.0),
GingerAle("Ginger Ale", "gingerAle", 16777215, 0.6000000238418579),
Coffee("Coffee", "coffee", 5910789, 0.30000001192092896),
SugarSyrup("Simple Syrup", "syrup.simple", 16120049, 0.10000000149011612),
AgaveNectar("Agave Nectar", "syrup.agave", 13598245, 0.699999988079071),
GrenadineSyrup("Grenadine Syrup", "syrup.grenadine", 16009573, 0.800000011920929);
String name;
String ident;
IIcon icon;
int colour;
float transparency;
private MiscFluid(final String name, final String ident, final int colour, final double transparency) {
this.name = name;
this.ident = ident;
this.colour = colour;
this.transparency = (float) transparency;
}
@Override
public String toString() {
return this.name;
}
@Override
public boolean canPlaceIn(final FluidContainer container) {
return true;
}
@Override
public boolean showInCreative(final FluidContainer container) {
return container == FluidContainer.Glass;
}
@Override
public IIcon getIcon() {
return this.icon;
}
@Override
public void registerIcon(final IIconRegister register) {
this.icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
}
@Override
public String getName() {
return this.name;
}
@Override
public String getIdentifier() {
return "binnie." + this.ident;
}
@Override
public int getColour() {
return this.colour;
}
@Override
public FluidStack get(final int amount) {
return Binnie.Liquid.getLiquidStack(this.getIdentifier(), amount);
}
@Override
public int getTransparency() {
return (int) (Math.min(1.0, this.transparency + 0.3) * 255.0);
}
@Override
public String getTooltip(final int ratio) {
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + this.getName();
}
@Override
public int getContainerColour() {
return this.getColour();
}
@Override
public float getABV() {
return 0.0f;
}
}
@@ -0,0 +1,137 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import binnie.extratrees.machines.Distillery;
import java.util.List;
import binnie.extratrees.machines.Brewery;
import binnie.extratrees.machines.Press;
import net.minecraftforge.fluids.FluidStack;
import java.util.Map;
import forestry.api.recipes.RecipeManagers;
import binnie.extratrees.item.Food;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import binnie.extratrees.alcohol.drink.DrinkManager;
import binnie.extratrees.alcohol.drink.DrinkLiquid;
import binnie.core.liquid.IFluidType;
import binnie.core.liquid.ItemFluidContainer;
import net.minecraftforge.client.IItemRenderer;
import net.minecraft.item.Item;
import binnie.extratrees.alcohol.drink.CocktailRenderer;
import binnie.extratrees.alcohol.drink.ItemDrink;
import binnie.core.BinnieCore;
import binnie.extratrees.ExtraTrees;
import binnie.Binnie;
import binnie.core.resource.BinnieIcon;
import binnie.core.IInitializable;
public class ModuleAlcohol implements IInitializable
{
public static int drinkRendererID;
public static BinnieIcon liquid;
@Override
public void preInit() {
ModuleAlcohol.liquid = Binnie.Resource.getBlockIcon(ExtraTrees.instance, "liquids/liquid");
ModuleAlcohol.drinkRendererID = BinnieCore.proxy.getUniqueRenderID();
ExtraTrees.drink = new ItemDrink();
BinnieCore.proxy.registerCustomItemRenderer(ExtraTrees.drink, new CocktailRenderer());
Binnie.Liquid.createLiquids(Juice.values(), ItemFluidContainer.LiquidJuice);
Binnie.Liquid.createLiquids(Alcohol.values(), ItemFluidContainer.LiquidAlcohol);
Binnie.Liquid.createLiquids(Spirit.values(), ItemFluidContainer.LiquidSpirit);
Binnie.Liquid.createLiquids(Liqueur.values(), ItemFluidContainer.LiquidLiqueuer);
for (final Juice juice : Juice.values()) {
Cocktail.registerIngredient(juice);
}
for (final Alcohol juice2 : Alcohol.values()) {
Cocktail.registerIngredient(juice2);
}
for (final Spirit juice3 : Spirit.values()) {
Cocktail.registerIngredient(juice3);
}
for (final Liqueur juice4 : Liqueur.values()) {
Cocktail.registerIngredient(juice4);
}
DrinkManager.registerDrinkLiquid("water", new DrinkLiquid("Water", 13421823, 0.1f, 0.0f));
}
@Override
public void init() {
}
@Override
public void postInit() {
for (final Juice juice : Juice.values()) {
final String oreDict = juice.squeezing;
final List<ItemStack> ores = new ArrayList<ItemStack>();
ores.addAll(OreDictionary.getOres(oreDict));
for (final Food food : Food.values()) {
if (food.getOres().contains(oreDict)) {
ores.add(food.get(1));
}
}
for (final ItemStack stack : ores) {
for (final Map.Entry<Object[], Object[]> entry : RecipeManagers.squeezerManager.getRecipes().entrySet()) {
try {
final ItemStack input = (ItemStack) entry.getKey()[0];
final FluidStack output = (FluidStack) entry.getValue()[1];
if (!ItemStack.areItemStacksEqual(stack, input) && !OreDictionary.itemMatches(input, stack, true)) {
continue;
}
int amount = output.amount;
if (output.getFluid().getName() == "seedoil") {
amount *= 2;
}
Press.addRecipe(stack, juice.get(amount));
} catch (Exception ex) {
}
}
}
}
for (final Alcohol alcohol : Alcohol.values()) {
for (final String fermentLiquid : alcohol.fermentationLiquid) {
final FluidStack fluid = Binnie.Liquid.getLiquidStack(fermentLiquid, 5);
if (fluid != null) {
Brewery.addRecipe(fluid, alcohol.get(5));
}
}
}
Brewery.addBeerAndMashRecipes();
this.addDistillery(Alcohol.Apple, Spirit.AppleBrandy, Spirit.AppleLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Pear, Spirit.PearBrandy, Spirit.PearLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Apricot, Spirit.ApricotBrandy, Spirit.ApricotLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Banana, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Cherry, Spirit.CherryBrandy, Spirit.CherryLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Elderberry, Spirit.ElderberryBrandy, Spirit.ElderberryLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Peach, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Plum, Spirit.PlumBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Carrot, Spirit.FruitBrandy, Spirit.Vodka, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.WhiteWine, Spirit.Brandy, Spirit.Brandy, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.RedWine, Spirit.Brandy, Spirit.Brandy, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.SparklingWine, Spirit.Brandy, Spirit.Brandy, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Agave, Spirit.Tequila, Spirit.Tequila, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Potato, Spirit.FruitBrandy, Spirit.Vodka, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Citrus, Spirit.CitrusBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Cranberry, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Pineapple, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Tomato, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Fruit, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Barley, Spirit.Whiskey, Spirit.Vodka, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Wheat, Spirit.WheatWhiskey, Spirit.Vodka, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Rye, Spirit.RyeWhiskey, Spirit.Vodka, Spirit.NeutralSpirit);
this.addDistillery(Alcohol.Corn, Spirit.CornWhiskey, Spirit.Vodka, Spirit.NeutralSpirit);
}
private void addDistillery(final IFluidType source, final IFluidType a, final IFluidType b, final IFluidType c) {
Distillery.addRecipe(source.get(5), a.get(4), 0);
Distillery.addRecipe(source.get(5), b.get(2), 1);
Distillery.addRecipe(source.get(5), c.get(1), 2);
Distillery.addRecipe(a.get(5), b.get(2), 0);
Distillery.addRecipe(a.get(5), b.get(1), 1);
Distillery.addRecipe(b.get(5), c.get(2), 0);
}
}
@@ -0,0 +1,124 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol;
import binnie.Binnie;
import net.minecraftforge.fluids.FluidStack;
import binnie.extratrees.ExtraTrees;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.core.liquid.FluidContainer;
import net.minecraft.util.IIcon;
import binnie.core.liquid.IFluidType;
public enum Spirit implements IFluidType, ICocktailLiquid
{
NeutralSpirit("Neutral Spirit", "spiritNeutral", 16777215, 0.05, 0.8),
Vodka("Vodka", "vodka", 16053751, 0.05, 0.4),
WhiteRum("White Rum", "rumWhite", 15132132, 0.05, 0.4),
DarkRum("Dark Rum", "rumDark", 11018752, 0.4, 0.4),
Whiskey("Whiskey", "whiskey", 13594368, 0.2, 0.4),
CornWhiskey("Bourbon", "whiskeyCorn", 9835009, 0.2, 0.4),
RyeWhiskey("Rye Whiskey", "whiskeyRye", 16085800, 0.2, 0.4),
WheatWhiskey("Wheat Whiskey", "whiskeyWheat", 14976530, 0.2, 0.4),
FortifiedWine("Fortified Wine", "wineFortified", 15569439, 0.2, 0.2),
Tequila("Tequila", "tequila", 16116160, 0.05, 0.4),
Brandy("Brandy", "brandyGrape", 16228128, 0.2, 0.4),
AppleBrandy("Apple Brandy", "brandyApple", 14985790, 0.2, 0.4),
PearBrandy("Pear Brandy", "brandyPear", 16696883, 0.2, 0.4),
ApricotBrandy("Apricot Brandy", "brandyApricot", 13336387, 0.2, 0.4),
PlumBrandy("Plum Brandy", "brandyPlum", 9511697, 0.2, 0.4),
CherryBrandy("Cherry Brandy", "brandyCherry", 8588062, 0.2, 0.4),
ElderberryBrandy("Elderberry Brandy", "brandyElderberry", 12462919, 0.2, 0.4),
CitrusBrandy("Citrus Brandy", "brandyCitrus", 13336387, 0.2, 0.4),
FruitBrandy("Fruit Brandy", "brandyFruit", 14985790, 0.2, 0.4),
Cachaca("Cachaca", "spiritSugarcane", 15331535, 0.1, 0.4),
Gin("Gin", "spiritGin", 16185078, 0.05, 0.4),
AppleLiquor("Apple Liquor", "liquorApple", 13421772, 0.05, 0.4),
PearLiquor("Pear Liquor", "liquorPear", 13421772, 0.05, 0.4),
CherryLiquor("Cherry Liquor", "liquorCherry", 13421772, 0.05, 0.4),
ElderberryLiquor("Elderberry Liquor", "liquorElderberry", 13421772, 0.05, 0.4),
ApricotLiquor("Apricot Liquor", "liquorApricot", 13421772, 0.05, 0.4),
FruitLiquor("Fruit Liquor", "liquorFruit", 13421772, 0.05, 0.4);
String name;
String ident;
IIcon icon;
int colour;
float transparency;
float abv;
private Spirit(final String name, final String ident, final int colour, final double transparency, final double abv) {
this.name = name;
this.ident = ident;
this.colour = colour;
this.transparency = (float) transparency;
this.abv = (float) abv;
}
@Override
public String toString() {
return this.name;
}
@Override
public boolean canPlaceIn(final FluidContainer container) {
return true;
}
@Override
public boolean showInCreative(final FluidContainer container) {
return container == FluidContainer.Glass;
}
@Override
public IIcon getIcon() {
return this.icon;
}
@Override
public void registerIcon(final IIconRegister register) {
this.icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
}
@Override
public String getName() {
return this.name;
}
@Override
public String getIdentifier() {
return "binnie." + this.ident;
}
@Override
public int getColour() {
return this.colour;
}
@Override
public FluidStack get(final int amount) {
return Binnie.Liquid.getLiquidStack(this.getIdentifier(), amount);
}
@Override
public int getTransparency() {
return (int) (Math.min(1.0, this.transparency + 0.3) * 255.0);
}
@Override
public String getTooltip(final int ratio) {
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + this.getName();
}
@Override
public int getContainerColour() {
return this.getColour();
}
@Override
public float getABV() {
return this.abv;
}
}
@@ -0,0 +1,49 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol.drink;
import binnie.extratrees.alcohol.ModuleAlcohol;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.block.material.Material;
import net.minecraft.block.BlockContainer;
public class BlockDrink extends BlockContainer
{
public BlockDrink() {
super(Material.glass);
this.setBlockName("drink");
this.setCreativeTab(CreativeTabs.tabTools);
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 1;
}
@Override
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
return new TileEntityDrink();
}
@Override
public int getRenderType() {
return ModuleAlcohol.drinkRendererID;
}
@Override
public boolean isNormalCube() {
return false;
}
@Override
public boolean isOpaqueCube() {
return true;
}
}
@@ -0,0 +1,52 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol.drink;
import binnie.extratrees.alcohol.ModuleAlcohol;
import net.minecraft.init.Blocks;
import net.minecraft.client.renderer.Tessellator;
import org.lwjgl.opengl.GL11;
import net.minecraft.world.IBlockAccess;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.block.Block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class BlockDrinkRenderer implements ISimpleBlockRenderingHandler
{
@Override
public void renderInventoryBlock(final Block block, final int metadata, final int modelId, final RenderBlocks renderer) {
}
@Override
public boolean renderWorldBlock(final IBlockAccess world, final int x, final int y, final int z, final Block block, final int modelId, final RenderBlocks renderer) {
GL11.glPushMatrix();
Tessellator.instance.setColorRGBA(255, 255, 255, 150);
final Tessellator tess = Tessellator.instance;
renderer.renderFaceYPos(block, x, y, z, Blocks.dirt.getIcon(0, 0));
final float s = 0.0625f;
for (int h = 0; h < 16; ++h) {
final float d1 = 8.0f * s;
final float d2 = 8.0f * s;
final float h2 = h * s;
final float h3 = h * s;
tess.addVertexWithUV(x + 0.5f - d1, y + h2, z + 0.5f - d1, 0.0, 0.0);
tess.addVertexWithUV(x + 0.5f - d1, y + h3, z + 0.5f - d1, 0.0, 0.0);
tess.addVertexWithUV(x + 0.5f + d1, y + h3, z + 0.5f - d1, 0.0, 0.0);
tess.addVertexWithUV(x + 0.5f + d1, y + h2, z + 0.5f - d1, 0.0, 0.0);
}
GL11.glPopMatrix();
return false;
}
@Override
public boolean shouldRender3DInInventory(final int modelId) {
return false;
}
@Override
public int getRenderId() {
return ModuleAlcohol.drinkRendererID;
}
}
@@ -0,0 +1,231 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol.drink;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.texture.TextureUtil;
import binnie.core.BinnieCore;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.util.IIcon;
import net.minecraftforge.fluids.FluidStack;
import binnie.extratrees.alcohol.Glassware;
import net.minecraft.client.renderer.Tessellator;
import binnie.extratrees.ExtraTrees;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraftforge.client.IItemRenderer;
public class CocktailRenderer implements IItemRenderer
{
private void renderCocktail(final RenderBlocks renderBlocks, final ItemStack item, final float p, final float q, final float r) {
final RenderItem renderItem = new RenderItem();
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
final Glassware glass = ExtraTrees.drink.getGlassware(item);
final FluidStack fluid = ExtraTrees.drink.getFluid(item);
final IDrinkLiquid drink = (fluid == null) ? null : DrinkManager.getLiquid(fluid.getFluid());
this.setColor(16777215, 0.8f);
renderItem.renderIcon(0, 0, glass.glass, 16, 16);
if (drink != null) {
this.setColor(drink.getColour(), 1.2f * drink.getTransparency() + 0.3f);
final IIcon icon = glass.contents;
final float amount = fluid.amount / glass.getVolume();
final float level = glass.getContentHeight() * (1.0f - amount);
final float gapAtTop = 1.0f - (glass.getContentBottom() + glass.getContentHeight());
final float x = 0.0f;
final float y = 16.0f * (gapAtTop + level);
final float w = 16.0f;
final float h = 16.0f - y;
final float minV = icon.getInterpolatedV(y);
final float maxV = icon.getInterpolatedV(16.0);
final Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(x + 0.0f, y + h, renderItem.zLevel, icon.getMinU(), maxV);
tessellator.addVertexWithUV(x + w, y + h, renderItem.zLevel, icon.getMaxU(), maxV);
tessellator.addVertexWithUV(x + w, y + 0.0f, renderItem.zLevel, icon.getMaxU(), minV);
tessellator.addVertexWithUV(x + 0.0f, y + 0.0f, renderItem.zLevel, icon.getMinU(), minV);
tessellator.draw();
}
GL11.glDisable(3042);
}
private void setColor(final int i1, final float alpha) {
final float f = (i1 >> 16 & 0xFF) / 255.0f;
final float f2 = (i1 >> 8 & 0xFF) / 255.0f;
final float f3 = (i1 & 0xFF) / 255.0f;
GL11.glColor4f(f, f2, f3, (alpha > 1.0f) ? 1.0f : alpha);
}
private void renderFace(final Tessellator tessellator, final ForgeDirection dir) {
switch (dir) {
case DOWN: {
tessellator.addVertex(0.0, 0.0, 0.0);
tessellator.addVertex(0.0, 0.0, 1.0);
tessellator.addVertex(1.0, 0.0, 1.0);
tessellator.addVertex(1.0, 0.0, 0.0);
break;
}
}
}
@Override
public boolean handleRenderType(final ItemStack item, final IItemRenderer.ItemRenderType type) {
switch (type) {
case ENTITY: {
return true;
}
case EQUIPPED: {
return true;
}
case INVENTORY: {
return true;
}
case EQUIPPED_FIRST_PERSON: {
return true;
}
default: {
return false;
}
}
}
@Override
public boolean shouldUseRenderHelper(final IItemRenderer.ItemRenderType type, final ItemStack item, final IItemRenderer.ItemRendererHelper helper) {
return helper == IItemRenderer.ItemRendererHelper.ENTITY_ROTATION || helper == IItemRenderer.ItemRendererHelper.ENTITY_BOBBING;
}
@Override
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
switch (type) {
case ENTITY:
case EQUIPPED:
case EQUIPPED_FIRST_PERSON: {
if (type == IItemRenderer.ItemRenderType.ENTITY) {
GL11.glTranslatef(-0.5f, -0.25f, -0.0f);
}
final TextureManager texturemanager = BinnieCore.proxy.getMinecraftInstance().getTextureManager();
final Glassware glass = ExtraTrees.drink.getGlassware(item);
final FluidStack fluid = ExtraTrees.drink.getFluid(item);
IIcon iicon = glass.glass;
final float f = iicon.getMinU();
final float f2 = iicon.getMaxU();
final float f3 = iicon.getMinV();
final float f4 = iicon.getMaxV();
texturemanager.bindTexture(texturemanager.getResourceLocation(item.getItemSpriteNumber()));
TextureUtil.func_152777_a(false, false, 1.0f);
this.setColor(16777215, 0.8f);
final IDrinkLiquid drink = (fluid == null) ? null : DrinkManager.getLiquid(fluid.getFluid());
this.setColor(16777215, 0.8f);
ItemRenderer.renderItemIn2D(Tessellator.instance, f2, f3, f, f4, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625f);
if (drink != null) {
this.setColor(drink.getColour(), 1.2f * drink.getTransparency() + 0.3f);
iicon = glass.contents;
final IIcon icon = glass.contents;
final float amount = fluid.amount / glass.getVolume();
final float level = glass.getContentHeight() * (1.0f - amount);
final float gapAtTop = 1.0f - (glass.getContentBottom() + glass.getContentHeight());
final float x = 0.0f;
final float y = 1.0f * (gapAtTop + level);
final float w = 1.0f;
final float h = 1.0f - y;
final float minV = icon.getInterpolatedV(y * 16.0f);
final float maxV = icon.getInterpolatedV(16.0);
final float minU = icon.getMinU();
final float maxU = icon.getMaxU();
final Tessellator tessellator = Tessellator.instance;
tessellator.setNormal(0.0f, 0.0f, -1.0f);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(0.0, 1.0 - y, -0.03125, maxU, minV);
tessellator.addVertexWithUV(1.0, 1.0 - y, -0.03125, minU, minV);
tessellator.addVertexWithUV(1.0, 0.0, -0.03125, minU, maxV);
tessellator.addVertexWithUV(0.0, 0.0, -0.03125, maxU, maxV);
tessellator.draw();
tessellator.setNormal(0.0f, 0.0f, 1.0f);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(0.0, 1.0 - y, -0.03125, maxU, minV);
tessellator.addVertexWithUV(0.0, 0.0, -0.03125, maxU, maxV);
tessellator.addVertexWithUV(1.0, 0.0, -0.03125, minU, maxV);
tessellator.addVertexWithUV(1.0, 1.0 - y, -0.03125, minU, minV);
tessellator.draw();
break;
}
break;
}
case INVENTORY: {
this.renderCocktail((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
break;
}
}
}
public void renderItemIn2DPercentage(final Tessellator tesselator, final float maxU, final float minV, final float minU, float maxV, final int width, final int height, final float depth, final float percent) {
maxV = minV + (maxV - minV) * 1.0f;
tesselator.startDrawingQuads();
tesselator.setNormal(0.0f, 0.0f, 1.0f);
tesselator.addVertexWithUV(0.0, 0.0, 0.0, maxU, maxV);
tesselator.addVertexWithUV(1.0, 0.0, 0.0, minU, maxV);
tesselator.addVertexWithUV(1.0, 1.0, 0.0, minU, minV);
tesselator.addVertexWithUV(0.0, 1.0, 0.0, maxU, minV);
tesselator.draw();
tesselator.startDrawingQuads();
tesselator.setNormal(0.0f, 0.0f, -1.0f);
tesselator.addVertexWithUV(0.0, percent, 0.0f - depth, maxU, minV);
tesselator.addVertexWithUV(1.0, percent, 0.0f - depth, minU, minV);
tesselator.addVertexWithUV(1.0, 0.0, 0.0f - depth, minU, maxV);
tesselator.addVertexWithUV(0.0, 0.0, 0.0f - depth, maxU, maxV);
tesselator.draw();
final float f5 = 0.5f * (maxU - minU) / width;
final float f6 = 0.5f * (maxV - minV) / height;
tesselator.startDrawingQuads();
tesselator.setNormal(-1.0f, 0.0f, 0.0f);
for (int k = 0; k < width; ++k) {
final float f7 = k / width;
final float f8 = maxU + (minU - maxU) * f7 - f5;
tesselator.addVertexWithUV(f7, 0.0, 0.0f - depth, f8, maxV);
tesselator.addVertexWithUV(f7, 0.0, 0.0, f8, maxV);
tesselator.addVertexWithUV(f7, 1.0, 0.0, f8, minV);
tesselator.addVertexWithUV(f7, 1.0, 0.0f - depth, f8, minV);
}
tesselator.draw();
tesselator.startDrawingQuads();
tesselator.setNormal(1.0f, 0.0f, 0.0f);
for (int k = 0; k < width; ++k) {
final float f7 = k / width;
final float f8 = maxU + (minU - maxU) * f7 - f5;
final float f9 = f7 + 1.0f / width;
tesselator.addVertexWithUV(f9, 1.0, 0.0f - depth, f8, minV);
tesselator.addVertexWithUV(f9, 1.0, 0.0, f8, minV);
tesselator.addVertexWithUV(f9, 0.0, 0.0, f8, maxV);
tesselator.addVertexWithUV(f9, 0.0, 0.0f - depth, f8, maxV);
}
tesselator.draw();
tesselator.startDrawingQuads();
tesselator.setNormal(0.0f, 1.0f, 0.0f);
for (int k = 0; k < height; ++k) {
final float f7 = k / height;
final float f8 = maxV + (minV - maxV) * f7 - f6;
final float f9 = f7 + 1.0f / height;
tesselator.addVertexWithUV(0.0, f9, 0.0, maxU, f8);
tesselator.addVertexWithUV(1.0, f9, 0.0, minU, f8);
tesselator.addVertexWithUV(1.0, f9, 0.0f - depth, minU, f8);
tesselator.addVertexWithUV(0.0, f9, 0.0f - depth, maxU, f8);
}
tesselator.draw();
tesselator.startDrawingQuads();
tesselator.setNormal(0.0f, -1.0f, 0.0f);
for (int k = 0; k < height; ++k) {
final float f7 = k / height;
final float f8 = maxV + (minV - maxV) * f7 - f6;
tesselator.addVertexWithUV(1.0, f7, 0.0, minU, f8);
tesselator.addVertexWithUV(0.0, f7, 0.0, maxU, f8);
tesselator.addVertexWithUV(0.0, f7, 0.0f - depth, maxU, f8);
tesselator.addVertexWithUV(1.0, f7, 0.0f - depth, minU, f8);
}
tesselator.draw();
}
}
@@ -0,0 +1,64 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol.drink;
import binnie.Binnie;
import net.minecraftforge.fluids.FluidStack;
public class DrinkLiquid implements IDrinkLiquid
{
String name;
int colour;
float transparency;
float abv;
public String ident;
public DrinkLiquid(final String name, final int colour, final float transparency, final float abv) {
this.name = name;
this.colour = colour;
this.transparency = transparency;
this.abv = abv;
}
@Override
public boolean isConsumable() {
return true;
}
@Override
public int getColour() {
return this.colour;
}
@Override
public String getName() {
return this.name;
}
@Override
public float getTransparency() {
return this.transparency;
}
@Override
public String getIdentifier() {
return this.ident;
}
@Override
public void setIdent(final String lowerCase) {
this.ident = lowerCase;
}
@Override
public float getABV() {
return this.abv;
}
@Override
public FluidStack get(final int amount) {
return Binnie.Liquid.getLiquidStack(this.ident, amount);
}
}
@@ -0,0 +1,36 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol.drink;
import java.util.HashMap;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.Fluid;
import java.util.Map;
public class DrinkManager
{
static Map<String, IDrinkLiquid> drinkLiquids;
public static IDrinkLiquid getLiquid(final String id) {
return DrinkManager.drinkLiquids.get(id.toLowerCase());
}
public static void registerDrinkLiquid(final String id, final IDrinkLiquid liquid) {
liquid.setIdent(id.toLowerCase());
DrinkManager.drinkLiquids.put(id.toLowerCase(), liquid);
}
public static IDrinkLiquid getLiquid(final Fluid fluid) {
return getLiquid(fluid.getName());
}
public static IDrinkLiquid getLiquid(final FluidStack fluid) {
return (fluid != null) ? getLiquid(fluid.getFluid()) : null;
}
static {
DrinkManager.drinkLiquids = new HashMap<String, IDrinkLiquid>();
}
}
@@ -0,0 +1,10 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol.drink;
public interface IAlcoholic
{
float getABV();
}
@@ -0,0 +1,26 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol.drink;
import net.minecraftforge.fluids.FluidStack;
public interface IDrinkLiquid
{
boolean isConsumable();
int getColour();
String getName();
float getTransparency();
String getIdentifier();
void setIdent(final String p0);
float getABV();
FluidStack get(final int p0);
}
@@ -0,0 +1,215 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol.drink;
import net.minecraft.item.EnumAction;
import binnie.extratrees.alcohol.AlcoholEffect;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraft.util.IIcon;
import net.minecraft.client.renderer.texture.IIconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.extratrees.alcohol.Alcohol;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.item.Item;
import net.minecraftforge.fluids.FluidStack;
import binnie.extratrees.alcohol.Glassware;
import net.minecraft.item.ItemStack;
import forestry.api.core.Tabs;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraft.item.ItemFood;
public class ItemDrink extends ItemFood implements IFluidContainerItem
{
public ItemDrink() {
super(0, 0.0f, false);
this.setCreativeTab(Tabs.tabArboriculture);
this.setUnlocalizedName("drink");
this.setHasSubtypes(true);
this.setMaxStackSize(1);
this.setAlwaysEdible();
}
public Glassware getGlassware(final ItemStack container) {
if (!container.hasTagCompound() || !container.getTagCompound().hasKey("glassware")) {
return Glassware.BeerMug;
}
return Glassware.values()[container.getTagCompound().getShort("glassware")];
}
public ItemStack getStack(final Glassware glass, final FluidStack fluid) {
final ItemStack stack = new ItemStack(this);
this.saveGlassware(glass, stack);
this.saveFluid(fluid, stack);
return stack;
}
public void saveGlassware(final Glassware container, final ItemStack stack) {
if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
stack.getTagCompound().setShort("glassware", (short) container.ordinal());
}
public void saveFluid(final FluidStack fluid, final ItemStack stack) {
if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
final NBTTagCompound nbt = stack.getTagCompound();
if (fluid == null) {
nbt.removeTag("fluid");
}
else {
final NBTTagCompound liq = new NBTTagCompound();
fluid.writeToNBT(liq);
nbt.setTag("fluid", liq);
}
}
@Override
public FluidStack getFluid(final ItemStack container) {
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("fluid")) {
return null;
}
return FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("fluid"));
}
@Override
public int getCapacity(final ItemStack container) {
return this.getGlassware(container).getCapacity();
}
@Override
public int fill(final ItemStack container, final FluidStack resource, final boolean doFill) {
if (resource == null || !container.hasTagCompound()) {
return 0;
}
if (DrinkManager.getLiquid(resource.getFluid()) == null) {
return 0;
}
final FluidStack existing = this.getFluid(container);
final int space = this.getGlassware(container).getCapacity() - ((existing == null) ? 0 : existing.amount);
final int added = Math.min(space, resource.amount);
if (space <= 0) {
return 0;
}
if (existing == null) {
if (doFill) {
final FluidStack fill = resource.copy();
fill.amount = added;
this.saveFluid(fill, container);
}
return added;
}
if (!existing.isFluidEqual(resource)) {
return 0;
}
if (doFill) {
final FluidStack fill = existing.copy();
fill.amount += added;
this.saveFluid(fill, container);
}
return added;
}
@Override
public FluidStack drain(final ItemStack container, final int maxDrain, final boolean doDrain) {
if (!container.hasTagCompound()) {
return null;
}
final FluidStack content = this.getFluid(container);
if (content == null) {
return null;
}
final int toRemove = Math.min(maxDrain, content.amount);
FluidStack fill = content.copy();
final FluidStack drain = content.copy();
drain.amount = toRemove;
fill.amount -= toRemove;
if (fill.amount == 0) {
fill = null;
}
if (doDrain) {
this.saveFluid(fill, container);
}
return drain;
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
for (final Glassware glassware : Glassware.values()) {
par3List.add(this.getStack(glassware, null));
}
par3List.add(this.getStack(Glassware.Wine, Alcohol.RedWine.get(Glassware.Wine.getCapacity())));
}
@Override
public String getItemStackDisplayName(final ItemStack stack) {
final FluidStack fluid = this.getFluid(stack);
final IDrinkLiquid liquid = (fluid == null) ? null : DrinkManager.getLiquid(fluid.getFluid());
return this.getGlassware(stack).getName((liquid == null) ? null : liquid.getName());
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(final IIconRegister par1IconRegister) {
for (final Glassware glassware : Glassware.values()) {
glassware.registerIcons(par1IconRegister);
}
}
@Override
public IIcon getIcon(final ItemStack stack, final int pass) {
final Glassware glass = this.getGlassware(stack);
return (pass == 0) ? glass.glass : ((this.getFluid(stack) == null) ? glass.glass : glass.contents);
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(final ItemStack stack, final int pass) {
final FluidStack fluid = this.getFluid(stack);
final IDrinkLiquid drink = (fluid == null) ? null : DrinkManager.getLiquid(fluid.getFluid());
return (pass == 0) ? 16777215 : ((drink == null) ? 16777215 : drink.getColour());
}
@Override
public int getRenderPasses(final int metadata) {
return 2;
}
@Override
public ItemStack onEaten(final ItemStack p_77654_1_, final World p_77654_2_, final EntityPlayer p_77654_3_) {
this.drain(p_77654_1_, 30, true);
AlcoholEffect.makeDrunk(p_77654_3_, 2.1f);
return p_77654_1_;
}
@Override
public EnumAction getItemUseAction(final ItemStack p_77661_1_) {
return (this.getFluid(p_77661_1_) == null) ? EnumAction.none : EnumAction.drink;
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
return true;
}
@Override
public int getMaxItemUseDuration(final ItemStack p_77626_1_) {
return 16;
}
@Override
public ItemStack onItemRightClick(final ItemStack p_77659_1_, final World p_77659_2_, final EntityPlayer p_77659_3_) {
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
return p_77659_1_;
}
}
@@ -0,0 +1,11 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.alcohol.drink;
import net.minecraft.tileentity.TileEntity;
public class TileEntityDrink extends TileEntity
{
}
@@ -0,0 +1,10 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.api;
public class CarpentryManager
{
public static ICarpentryInterface carpentryInterface;
}
@@ -0,0 +1,36 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.api;
import java.util.List;
import java.util.Collection;
import net.minecraft.item.ItemStack;
public interface ICarpentryInterface
{
boolean registerCarpentryWood(final int p0, final IDesignMaterial p1);
int getCarpentryWoodIndex(final IDesignMaterial p0);
IDesignMaterial getWoodMaterial(final int p0);
boolean registerDesign(final int p0, final IDesign p1);
int getDesignIndex(final IDesign p0);
IDesign getDesign(final int p0);
ILayout getLayout(final IPattern p0, final boolean p1);
IDesignMaterial getWoodMaterial(final ItemStack p0);
boolean registerDesignCategory(final IDesignCategory p0);
IDesignCategory getDesignCategory(final String p0);
Collection<IDesignCategory> getAllDesignCategories();
List<IDesign> getSortedDesigns();
}
@@ -0,0 +1,22 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.api;
public interface IDesign
{
String getName();
ILayout getTopPattern();
ILayout getBottomPattern();
ILayout getNorthPattern();
ILayout getEastPattern();
ILayout getSouthPattern();
ILayout getWestPattern();
}
@@ -0,0 +1,18 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.api;
import java.util.List;
public interface IDesignCategory
{
String getName();
List<IDesign> getDesigns();
void addDesign(final IDesign p0);
String getId();
}
@@ -0,0 +1,16 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.api;
import net.minecraft.item.ItemStack;
public interface IDesignMaterial
{
ItemStack getStack();
String getName();
int getColour();
}
@@ -0,0 +1,30 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.api;
import net.minecraft.item.ItemStack;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
public interface IDesignSystem
{
IIcon getPrimaryIcon(final IPattern p0);
IIcon getSecondaryIcon(final IPattern p0);
void registerIcons(final IIconRegister p0);
IDesignMaterial getDefaultMaterial();
IDesignMaterial getMaterial(final int p0);
int getMaterialIndex(final IDesignMaterial p0);
IDesignMaterial getDefaultMaterial2();
ItemStack getAdhesive();
IDesignMaterial getMaterial(final ItemStack p0);
}
@@ -0,0 +1,28 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.api;
import net.minecraft.util.IIcon;
public interface ILayout
{
IPattern getPattern();
boolean isInverted();
ILayout rotateRight();
ILayout rotateLeft();
ILayout flipHorizontal();
ILayout flipVertical();
ILayout invert();
IIcon getPrimaryIcon(final IDesignSystem p0);
IIcon getSecondaryIcon(final IDesignSystem p0);
}
@@ -0,0 +1,21 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.api;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
public interface IPattern
{
IIcon getPrimaryIcon(final IDesignSystem p0);
IIcon getSecondaryIcon(final IDesignSystem p0);
ILayout getRotation();
ILayout getHorizontalFlip();
void registerIcons(final IIconRegister p0);
}
@@ -0,0 +1,15 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.api;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public interface IToolHammer
{
boolean isActive(final ItemStack p0);
void onHammerUsed(final ItemStack p0, final EntityPlayer p1);
}
@@ -0,0 +1,137 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.block.BlockMetadata;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import binnie.extratrees.ExtraTrees;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.block.Block;
import binnie.core.block.TileEntityMetadata;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import forestry.api.core.Tabs;
import binnie.core.block.IBlockMetadata;
import net.minecraft.block.BlockLog;
public class BlockBranch extends BlockLog implements IBlockMetadata
{
public BlockBranch() {
this.setCreativeTab(Tabs.tabArboriculture);
this.setBlockName("branch");
this.setResistance(5.0f);
this.setHardness(2.0f);
this.setStepSound(Block.soundTypeWood);
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
for (int i = 0; i < ILogType.ExtraTreeLog.values().length; ++i) {
itemList.add(TileEntityMetadata.getItemStack(this, i));
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
if (tile != null) {
return this.getIcon(side, tile.getTileMetadata(), world.getBlockMetadata(x, y, z));
}
return super.getIcon(world, x, y, z, side);
}
public IIcon getIcon(final int side, final int tileMeta, final int blockMeta) {
final int oriented = blockMeta & 0xC;
final ILogType.ExtraTreeLog log = ILogType.ExtraTreeLog.values()[tileMeta];
if (side > 3) {
return log.getTrunk();
}
return log.getBark();
}
@Override
public IIcon getIcon(final int side, final int tileMeta) {
return this.getIcon(side, tileMeta, 0);
}
@Override
public int getRenderType() {
return ExtraTrees.branchRenderId;
}
@Override
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
this.dropBlockAsItem(world, x, y, z, drop);
}
@Override
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
}
@Override
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
return BlockMetadata.breakBlock(this, player, world, x, y, z);
}
@Override
public TileEntity createNewTileEntity(final World var1, final int i) {
return new TileEntityMetadata();
}
@Override
public boolean hasTileEntity(final int meta) {
return true;
}
@Override
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
}
@Override
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
return tileMeta;
}
@Override
public String getBlockName(final ItemStack par1ItemStack) {
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
return ILogType.ExtraTreeLog.values()[meta].getName() + " Branch";
}
@Override
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
}
@Override
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
return TileEntityMetadata.getItemDamage(stack);
}
@Override
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
par1World.removeTileEntity(par2, par3, par4);
}
@Override
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
return BlockMetadata.getPickBlock(world, x, y, z);
}
}
@@ -0,0 +1,306 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import java.util.List;
import binnie.Binnie;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.tileentity.TileEntity;
import binnie.core.block.BlockMetadata;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraft.client.renderer.IconFlipped;
import binnie.extratrees.ExtraTrees;
import net.minecraft.client.renderer.texture.IIconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.world.IBlockAccess;
import forestry.api.core.Tabs;
import net.minecraft.block.material.Material;
import net.minecraft.util.IIcon;
import binnie.core.block.IBlockMetadata;
import net.minecraft.block.BlockDoor;
public class BlockETDoor extends BlockDoor implements IBlockMetadata
{
private IIcon getFlippedIcon(final boolean upper, final boolean flip, final int tileMeta) {
final DoorType type = getDoorType(tileMeta);
return upper ? (flip ? type.iconDoorUpperFlip : type.iconDoorUpper) : (flip ? type.iconDoorLowerFlip : type.iconDoorLower);
}
public static DoorType getDoorType(final int tileMeta) {
final int type = (tileMeta & 0xF00) >> 8;
if (type >= 0 && type < DoorType.values().length) {
return DoorType.values()[type];
}
return DoorType.Standard;
}
protected BlockETDoor() {
super(Material.wood);
this.setHardness(3.0f).setStepSound(Block.soundTypeWood);
this.setCreativeTab(Tabs.tabArboriculture);
this.setBlockName("door");
}
@Override
public IIcon getIcon(final int side, final int meta) {
return DoorType.Standard.iconDoorLower;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4, final int par5) {
if (par5 != 1 && par5 != 0) {
final int i1 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4);
final int j1 = i1 & 0x3;
final boolean flag = (i1 & 0x4) != 0x0;
boolean flag2 = false;
final boolean flag3 = (i1 & 0x8) != 0x0;
if (flag) {
if (j1 == 0 && par5 == 2) {
flag2 = !flag2;
}
else if (j1 == 1 && par5 == 5) {
flag2 = !flag2;
}
else if (j1 == 2 && par5 == 3) {
flag2 = !flag2;
}
else if (j1 == 3 && par5 == 4) {
flag2 = !flag2;
}
}
else {
if (j1 == 0 && par5 == 5) {
flag2 = !flag2;
}
else if (j1 == 1 && par5 == 3) {
flag2 = !flag2;
}
else if (j1 == 2 && par5 == 4) {
flag2 = !flag2;
}
else if (j1 == 3 && par5 == 2) {
flag2 = !flag2;
}
if ((i1 & 0x10) != 0x0) {
flag2 = !flag2;
}
}
int tileMeta = 0;
if (flag3) {
tileMeta = TileEntityMetadata.getTileMetadata(par1IBlockAccess, par2, par3 - 1, par4);
}
else {
tileMeta = TileEntityMetadata.getTileMetadata(par1IBlockAccess, par2, par3, par4);
}
return this.getFlippedIcon(flag3, flag2, tileMeta);
}
return DoorType.Standard.iconDoorLower;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister register) {
for (final 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
@SideOnly(Side.CLIENT)
public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
final int par5 = 2;
final int i1 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4);
final int j1 = i1 & 0x3;
final boolean flag = (i1 & 0x4) != 0x0;
boolean flag2 = false;
final boolean flag3 = (i1 & 0x8) != 0x0;
if (flag) {
if (j1 == 0 && par5 == 2) {
flag2 = !flag2;
}
else if (j1 == 1 && par5 == 5) {
flag2 = !flag2;
}
else if (j1 == 2 && par5 == 3) {
flag2 = !flag2;
}
else if (j1 == 3 && par5 == 4) {
flag2 = !flag2;
}
}
else {
if (j1 == 0 && par5 == 5) {
flag2 = !flag2;
}
else if (j1 == 1 && par5 == 3) {
flag2 = !flag2;
}
else if (j1 == 2 && par5 == 4) {
flag2 = !flag2;
}
else if (j1 == 3 && par5 == 2) {
flag2 = !flag2;
}
if ((i1 & 0x10) != 0x0) {
flag2 = !flag2;
}
}
if (flag3) {
final int meta = TileEntityMetadata.getTileMetadata(par1IBlockAccess, par2, par3 - 1, par4);
return WoodManager.getPlankType(meta & 0xFF).getColour();
}
final int meta = TileEntityMetadata.getTileMetadata(par1IBlockAccess, par2, par3, par4);
return WoodManager.getPlankType(meta & 0xFF).getColour();
}
public int getFullMetadata(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
final int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
final boolean flag = (l & 0x8) != 0x0;
int i1;
int j1;
if (flag) {
i1 = par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4);
j1 = l;
}
else {
i1 = l;
j1 = par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4);
}
final boolean flag2 = (j1 & 0x1) != 0x0;
return (i1 & 0x7) | (flag ? 8 : 0) | (flag2 ? 16 : 0);
}
@Override
@SideOnly(Side.CLIENT)
public void onBlockHarvested(final World par1World, final int par2, final int par3, final int par4, final int par5, final EntityPlayer par6EntityPlayer) {
if (par6EntityPlayer.capabilities.isCreativeMode && (par5 & 0x8) != 0x0 && par1World.getBlock(par2, par3 - 1, par4) == this) {
par1World.setBlockToAir(par2, par3 - 1, par4);
}
}
@Override
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
}
@Override
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
return BlockMetadata.breakBlock(this, player, world, x, y, z);
}
@Override
public TileEntity createNewTileEntity(final World var1, final int k) {
return new TileEntityMetadata();
}
@Override
public boolean hasTileEntity(final int meta) {
return true;
}
@Override
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
}
@Override
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
return TileEntityMetadata.getItemDamage(stack);
}
@Override
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
return tileMeta;
}
@Override
public String getBlockName(final ItemStack par1ItemStack) {
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
final String typeName = getDoorType(meta).getName();
final String woodName = WoodManager.getPlankType(meta & 0xFF).getName();
if (typeName.equals("")) {
return Binnie.Language.localise(ExtraTrees.instance, "block.door.name", woodName);
}
return Binnie.Language.localise(ExtraTrees.instance, "block.door.name.adv", woodName, typeName);
}
@Override
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
}
@Override
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
this.dropBlockAsItem(world, x, y, z, drop);
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
for (final IPlankType type : PlankType.ExtraTreePlanks.values()) {
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
}
for (final IPlankType type : PlankType.ForestryPlanks.values()) {
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
}
for (final IPlankType type : PlankType.ExtraBiomesPlank.values()) {
if (type.getStack() != null) {
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
}
}
for (final IPlankType type : PlankType.VanillaPlanks.values()) {
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
}
}
@Override
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
return true;
}
@Override
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 20;
}
@Override
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return true;
}
@Override
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 5;
}
@Override
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
par1World.removeTileEntity(par2, par3, par4);
}
@Override
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
return BlockMetadata.getPickBlock(world, x, y, z);
}
}
@@ -0,0 +1,209 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.common.util.ForgeDirection;
import binnie.extratrees.ExtraTrees;
import binnie.Binnie;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.block.BlockMetadata;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.client.renderer.texture.IIconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.block.Block;
import binnie.core.block.TileEntityMetadata;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import forestry.api.core.Tabs;
import binnie.core.block.IBlockMetadata;
import net.minecraft.block.BlockLog;
public class BlockETLog extends BlockLog implements IBlockMetadata
{
public BlockETLog() {
this.setCreativeTab(Tabs.tabArboriculture);
this.setBlockName("log");
this.setResistance(5.0f);
this.setHardness(2.0f);
this.setStepSound(Block.soundTypeWood);
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
for (int i = 0; i < ILogType.ExtraTreeLog.values().length; ++i) {
itemList.add(TileEntityMetadata.getItemStack(this, i));
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
if (tile != null) {
return this.getIcon(side, tile.getTileMetadata(), world.getBlockMetadata(x, y, z));
}
return super.getIcon(world, x, y, z, side);
}
public IIcon getIcon(final int side, final int tileMeta, final int blockMeta) {
final int oriented = blockMeta & 0xC;
final 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();
}
default: {
if (side < 2) {
return log.getTrunk();
}
return log.getBark();
}
}
}
@Override
public IIcon getIcon(final int side, final int tileMeta) {
return this.getIcon(side, tileMeta, 0);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister register) {
ILogType.ExtraTreeLog.registerIcons(register);
}
@Override
public int getRenderType() {
return 31;
}
@Override
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
this.dropBlockAsItem(world, x, y, z, drop);
}
@Override
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
}
@Override
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
return BlockMetadata.breakBlock(this, player, world, x, y, z);
}
@Override
public TileEntity createNewTileEntity(final World var1, final int i) {
return new TileEntityMetadata();
}
@Override
public boolean hasTileEntity(final int meta) {
return true;
}
@Override
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
}
@Override
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
return tileMeta;
}
@Override
public String getBlockName(final ItemStack par1ItemStack) {
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
return Binnie.Language.localise(ExtraTrees.instance, "block.log.name", ILogType.ExtraTreeLog.values()[meta].getName());
}
@Override
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
}
@Override
public boolean canSustainLeaves(final IBlockAccess world, final int x, final int y, final int z) {
return true;
}
@Override
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
return TileEntityMetadata.getItemDamage(stack);
}
@Override
public int onBlockPlaced(final World world, final int x, final int y, final int z, final int side, final float par6, final float par7, final float par8, final int meta) {
byte b0 = 0;
switch (side) {
case 0:
case 1: {
b0 = 0;
break;
}
case 2:
case 3: {
b0 = 8;
break;
}
case 4:
case 5: {
b0 = 4;
break;
}
}
return b0;
}
@Override
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
par1World.removeTileEntity(par2, par3, par4);
}
@Override
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
return true;
}
@Override
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 20;
}
@Override
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return true;
}
@Override
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 5;
}
@Override
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
return BlockMetadata.getPickBlock(world, x, y, z);
}
}
@@ -0,0 +1,153 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.client.renderer.texture.IIconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import java.util.List;
import binnie.extratrees.ExtraTrees;
import binnie.Binnie;
import net.minecraftforge.common.util.ForgeDirection;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.block.BlockMetadata;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import net.minecraft.world.World;
import forestry.api.core.Tabs;
import binnie.core.block.IBlockMetadata;
import net.minecraft.block.BlockWood;
public class BlockETPlanks extends BlockWood implements IBlockMetadata
{
public BlockETPlanks() {
this.setBlockName("planks");
this.setCreativeTab(Tabs.tabArboriculture);
this.setResistance(5.0f);
this.setHardness(2.0f);
this.setStepSound(Block.soundTypeWood);
}
@Override
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
}
@Override
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
return BlockMetadata.breakBlock(this, player, world, x, y, z);
}
@Override
public TileEntity createNewTileEntity(final World var1, final int i) {
return new TileEntityMetadata();
}
@Override
public boolean hasTileEntity(final int meta) {
return true;
}
@Override
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
}
@Override
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
return TileEntityMetadata.getItemDamage(stack);
}
@Override
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
return tileMeta;
}
@Override
public String getBlockName(final ItemStack par1ItemStack) {
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
return Binnie.Language.localise(ExtraTrees.instance, "block.plank.name", PlankType.ExtraTreePlanks.values()[meta].getName());
}
@Override
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
}
@Override
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
this.dropBlockAsItem(world, x, y, z, drop);
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
itemList.add(TileEntityMetadata.getItemStack(this, i));
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
if (tile != null) {
return this.getIcon(side, tile.getTileMetadata());
}
return super.getIcon(world, x, y, z, side);
}
@Override
public IIcon getIcon(final int side, final int meta) {
return PlankType.ExtraTreePlanks.values()[meta].getIcon();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister register) {
for (final PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
plank.loadIcon(register);
}
}
@Override
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
par1World.removeTileEntity(par2, par3, par4);
}
@Override
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
return true;
}
@Override
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 20;
}
@Override
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return true;
}
@Override
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 5;
}
@Override
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
return BlockMetadata.getPickBlock(world, x, y, z);
}
}
@@ -0,0 +1,160 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.util.MovingObjectPosition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import java.util.List;
import binnie.Binnie;
import net.minecraftforge.common.util.ForgeDirection;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.block.BlockMetadata;
import binnie.extratrees.ExtraTrees;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import net.minecraft.world.World;
import forestry.api.core.Tabs;
import binnie.core.block.IBlockMetadata;
import net.minecraft.block.BlockWoodSlab;
public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata
{
public BlockETSlab(final boolean par2) {
super(par2);
this.setCreativeTab(Tabs.tabArboriculture);
this.setHardness(2.0f).setResistance(5.0f).setStepSound(Block.soundTypeWood);
if (!this.field_150004_a) {
this.useNeighborBrightness = true;
}
this.setLightOpacity(0);
this.setBlockName("slabs");
}
@Override
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
final ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
drops.addAll(BlockMetadata.getBlockDropped((IBlockMetadata) ExtraTrees.blockSlab, world, x, y, z, blockMeta));
if (this.field_150004_a) {
drops.addAll(BlockMetadata.getBlockDropped((IBlockMetadata) ExtraTrees.blockSlab, world, x, y, z, blockMeta));
}
return drops;
}
@Override
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
return BlockMetadata.breakBlock(this, player, world, x, y, z);
}
@Override
public TileEntity createNewTileEntity(final World var1, final int i) {
return new TileEntityMetadata();
}
@Override
public boolean hasTileEntity(final int meta) {
return true;
}
@Override
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
}
@Override
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
return TileEntityMetadata.getItemDamage(stack);
}
@Override
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
return tileMeta;
}
@Override
public String getBlockName(final ItemStack par1ItemStack) {
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
return Binnie.Language.localise(ExtraTrees.instance, "block.woodslab.name", PlankType.ExtraTreePlanks.values()[meta].getName());
}
@Override
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
}
@Override
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
this.dropBlockAsItem(world, x, y, z, drop);
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
if (this.field_150004_a) {
return;
}
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
itemList.add(TileEntityMetadata.getItemStack(this, i));
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
if (tile != null) {
return this.getIcon(side, tile.getTileMetadata());
}
return super.getIcon(world, x, y, z, side);
}
@Override
public IIcon getIcon(final int side, final int meta) {
return PlankType.ExtraTreePlanks.values()[meta].getIcon();
}
@Override
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
par1World.removeTileEntity(par2, par3, par4);
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
return true;
}
@Override
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 20;
}
@Override
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return true;
}
@Override
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 5;
}
@Override
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
return BlockMetadata.getPickBlock(world, x, y, z);
}
}
@@ -0,0 +1,145 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import binnie.Binnie;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.block.BlockMetadata;
import java.util.ArrayList;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.item.ItemStack;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import forestry.api.core.Tabs;
import net.minecraft.block.Block;
import binnie.extratrees.ExtraTrees;
import binnie.core.block.IBlockMetadata;
import net.minecraft.block.BlockStairs;
public class BlockETStairs extends BlockStairs implements IBlockMetadata
{
@Override
public int getRenderType() {
return ExtraTrees.stairsID;
}
public BlockETStairs(final Block par2Block) {
super(par2Block, 0);
this.setCreativeTab(Tabs.tabArboriculture);
this.setBlockName("stairs");
this.setResistance(5.0f);
this.setHardness(2.0f);
this.setStepSound(Block.soundTypeWood);
this.useNeighborBrightness = true;
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
itemList.add(new ItemStack(this, 1, i));
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
if (tile != null) {
return this.getIcon(side, tile.getTileMetadata());
}
return super.getIcon(world, x, y, z, side);
}
@Override
public IIcon getIcon(final int side, final int meta) {
return WoodManager.getPlankType(meta + 32).getIcon();
}
@Override
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
this.dropBlockAsItem(world, x, y, z, drop);
}
@Override
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
}
@Override
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
return BlockMetadata.breakBlock(this, player, world, x, y, z);
}
@Override
public TileEntity createNewTileEntity(final World var1, final int i) {
return new TileEntityMetadata();
}
@Override
public boolean hasTileEntity(final int meta) {
return true;
}
@Override
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
}
@Override
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
return TileEntityMetadata.getItemDamage(stack);
}
@Override
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
return tileMeta;
}
@Override
public String getBlockName(final ItemStack par1ItemStack) {
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
return Binnie.Language.localise(ExtraTrees.instance, "block.woodstairs.name", WoodManager.getPlankType(meta + 32).getName());
}
@Override
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
}
@Override
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
par1World.removeTileEntity(par2, par3, par4);
}
@Override
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
return true;
}
@Override
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 20;
}
@Override
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return true;
}
@Override
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 5;
}
}
@@ -0,0 +1,34 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import binnie.extratrees.ExtraTrees;
import net.minecraft.world.IBlockAccess;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.block.Block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class BranchBlockRenderer implements ISimpleBlockRenderingHandler
{
@Override
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
}
@Override
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block par1Block, final int modelId, final RenderBlocks renderer) {
renderer.renderStandardBlock(par1Block, par2, par3, par4);
return true;
}
@Override
public boolean shouldRender3DInInventory(final int i) {
return false;
}
@Override
public int getRenderId() {
return ExtraTrees.branchRenderId;
}
}
@@ -0,0 +1,87 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import binnie.extratrees.ExtraTrees;
import net.minecraft.util.IIcon;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.block.Block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class DoorBlockRenderer implements ISimpleBlockRenderingHandler
{
@Override
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
}
@Override
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block par1Block, final int modelId, final RenderBlocks renderer) {
final int c = par1Block.colorMultiplier(renderer.blockAccess, par2, par3, par4);
final float c2 = (c >> 16 & 0xFF) / 255.0f;
final float c3 = (c >> 8 & 0xFF) / 255.0f;
final float c4 = (c & 0xFF) / 255.0f;
final Tessellator tessellator = Tessellator.instance;
final int l = renderer.blockAccess.getBlockMetadata(par2, par3, par4);
if ((l & 0x8) != 0x0) {
if (renderer.blockAccess.getBlock(par2, par3 - 1, par4) != par1Block) {
return false;
}
}
else if (renderer.blockAccess.getBlock(par2, par3 + 1, par4) != par1Block) {
return false;
}
boolean flag = false;
final float f = 0.5f;
final float f2 = 1.0f;
final float f3 = 0.8f;
final float f4 = 0.6f;
final int i1 = par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2, par3, par4);
tessellator.setBrightness((renderer.renderMinY > 0.0) ? i1 : par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2, par3 - 1, par4));
tessellator.setColorOpaque_F(f * c2, f * c3, f * c4);
renderer.renderFaceYNeg(par1Block, par2, par3, par4, renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 0));
flag = true;
tessellator.setBrightness((renderer.renderMaxY < 1.0) ? i1 : par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2, par3 + 1, par4));
tessellator.setColorOpaque_F(f2 * c2, f2 * c3, f2 * c4);
renderer.renderFaceYPos(par1Block, par2, par3, par4, renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 1));
flag = true;
tessellator.setBrightness((renderer.renderMinZ > 0.0) ? i1 : par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2, par3, par4 - 1));
tessellator.setColorOpaque_F(f3 * c2, f3 * c3, f3 * c4);
IIcon icon = renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 2);
renderer.renderFaceZNeg(par1Block, par2, par3, par4, icon);
flag = true;
renderer.flipTexture = false;
tessellator.setBrightness((renderer.renderMaxZ < 1.0) ? i1 : par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2, par3, par4 + 1));
tessellator.setColorOpaque_F(f3 * c2, f3 * c3, f3 * c4);
icon = renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 3);
renderer.renderFaceZPos(par1Block, par2, par3, par4, icon);
flag = true;
renderer.flipTexture = false;
tessellator.setBrightness((renderer.renderMinX > 0.0) ? i1 : par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2 - 1, par3, par4));
tessellator.setColorOpaque_F(f4 * c2, f4 * c3, f4 * c4);
icon = renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 4);
renderer.renderFaceXNeg(par1Block, par2, par3, par4, icon);
flag = true;
renderer.flipTexture = false;
tessellator.setBrightness((renderer.renderMaxX < 1.0) ? i1 : par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2 + 1, par3, par4));
tessellator.setColorOpaque_F(f4 * c2, f4 * c3, f4 * c4);
icon = renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 5);
renderer.renderFaceXPos(par1Block, par2, par3, par4, icon);
flag = true;
renderer.flipTexture = false;
return flag;
}
@Override
public boolean shouldRender3DInInventory(final int i) {
return false;
}
@Override
public int getRenderId() {
return ExtraTrees.doorRenderId;
}
}
@@ -0,0 +1,31 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import binnie.extratrees.ExtraTrees;
import net.minecraft.util.IIcon;
public enum DoorType
{
Standard("standard"),
Solid("solid"),
Double("double"),
Full("full");
String id;
IIcon iconDoorLower;
IIcon iconDoorUpper;
IIcon iconDoorLowerFlip;
IIcon iconDoorUpperFlip;
IIcon iconItem;
private DoorType(final String iconName) {
this.id = iconName;
}
public String getName() {
return ExtraTrees.proxy.localise("block.door.type." + this.id);
}
}
@@ -0,0 +1,53 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import binnie.extratrees.ExtraTrees;
import net.minecraft.client.renderer.texture.IIconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.core.BinnieCore;
import net.minecraft.util.IIcon;
import forestry.api.core.IIconProvider;
public enum FruitPod implements IIconProvider
{
Cocoa,
Banana,
Coconut,
Plantain,
RedBanana,
Papayimar;
short[] textures;
IIcon[] icons;
private FruitPod() {
this.textures = new short[] { BinnieCore.proxy.getUniqueTextureUID(), BinnieCore.proxy.getUniqueTextureUID(), BinnieCore.proxy.getUniqueTextureUID() };
this.icons = new IIcon[3];
}
public short[] getTextures() {
return this.textures;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final short texUID) {
final int index = this.textures[0] - texUID;
if (index >= 0 && index < 3) {
return this.icons[index];
}
return null;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(final IIconRegister register) {
this.icons[0] = ExtraTrees.proxy.getIcon(register, "pods/" + this.toString().toLowerCase() + ".0");
this.icons[1] = ExtraTrees.proxy.getIcon(register, "pods/" + this.toString().toLowerCase() + ".1");
this.icons[2] = ExtraTrees.proxy.getIcon(register, "pods/" + this.toString().toLowerCase() + ".2");
}
}
@@ -0,0 +1,103 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.util.IIcon;
import net.minecraft.block.Block;
import org.lwjgl.opengl.GL11;
import net.minecraft.item.ItemBlock;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraftforge.client.IItemRenderer;
public class GateItemRenderer implements IItemRenderer
{
private void renderStairBlock(final RenderBlocks renderBlocks, final ItemStack item, final float f, final float g, final float h) {
final Tessellator tessellator = Tessellator.instance;
final Block block = ((ItemBlock) item.getItem()).field_150939_a;
final IIcon textureIndex = WoodManager.getPlankType(item.getItemDamage()).getIcon();
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(final ItemStack item, final IItemRenderer.ItemRenderType type) {
switch (type) {
case ENTITY: {
return true;
}
case EQUIPPED: {
return true;
}
case INVENTORY: {
return true;
}
default: {
return false;
}
}
}
@Override
public boolean shouldUseRenderHelper(final IItemRenderer.ItemRenderType type, final ItemStack item, final IItemRenderer.ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
switch (type) {
case ENTITY: {
this.renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
break;
}
case EQUIPPED: {
this.renderStairBlock((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
break;
}
case INVENTORY: {
this.renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
break;
}
}
}
}
@@ -0,0 +1,12 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.item.ItemStack;
public interface IFenceProvider
{
ItemStack getFence();
}
@@ -0,0 +1,232 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.init.Blocks;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.core.block.TileEntityMetadata;
import binnie.extratrees.ExtraTrees;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraftforge.common.util.ForgeDirection;
import forestry.api.arboriculture.EnumWoodType;
import forestry.api.arboriculture.TreeManager;
import forestry.arboriculture.worldgen.BlockTypeLog;
import net.minecraft.util.IIcon;
import binnie.extratrees.api.IDesignMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public interface ILogType
{
void placeBlock(final World p0, final int p1, final int p2, final int p3);
ItemStack getItemStack();
int getColour();
public enum ExtraTreeLog implements ILogType
{
Apple("Apple", 8092283, PlankType.ExtraTreePlanks.Apple),
Fig("Fig", 8418135, PlankType.ExtraTreePlanks.Fig),
Butternut("Butternut", 12037536, PlankType.ExtraTreePlanks.Butternut),
Cherry("Cherry", 7432272, PlankType.ForestryPlanks.CHERRY),
Whitebeam("Whitebeam", 7891565, PlankType.ExtraTreePlanks.Whitebeam),
Rowan("Rowan", 11972763, PlankType.ExtraTreePlanks.Rowan),
Hemlock("Hemlock", 11379611, PlankType.ExtraTreePlanks.Hemlock),
Ash("Ash", 9013634, PlankType.ExtraTreePlanks.Ash),
Alder("Alder", 13025464, PlankType.ExtraTreePlanks.Alder),
Beech("Beech", 11702654, PlankType.ExtraTreePlanks.Beech),
Hawthorn("Hawthorn", 6248261, PlankType.ExtraTreePlanks.Hawthorn),
Banana("Banana", 8753743),
Yew("Yew", 13745089, PlankType.ExtraTreePlanks.Yew),
Cypress("Cypress", 10126467, PlankType.ExtraTreePlanks.Cypress),
Fir("Fir", 8553346, PlankType.ExtraTreePlanks.Fir),
Hazel("Hazel", 11180143, PlankType.ExtraTreePlanks.Hazel),
Hickory("Hickory", 4076848, PlankType.ExtraTreePlanks.Hickory),
Elm("Elm", 8684422, PlankType.ExtraTreePlanks.Elm),
Elder("Elder", 14202996, PlankType.ExtraTreePlanks.Elder),
Holly("Holly", 11905669, PlankType.ExtraTreePlanks.Holly),
Hornbeam("Hornbeam", 10719862, PlankType.ExtraTreePlanks.Hornbeam),
Cedar("Cedar", 11368015, PlankType.ExtraTreePlanks.Cedar),
Olive("Olive", 8089706, PlankType.ExtraTreePlanks.Olive),
Sweetgum("Sweetgum", 10592668, PlankType.ExtraTreePlanks.Sweetgum),
Locust("Locust", 11381948, PlankType.ExtraTreePlanks.Locust),
Pear("Pear", 11048825, PlankType.ExtraTreePlanks.Pear),
Maclura("Maclura", 9131828, PlankType.ExtraTreePlanks.Maclura),
Brazilwood("Brazilwood", 10387560, PlankType.ExtraTreePlanks.Brazilwood),
Logwood("Logwood", 16376530, PlankType.ExtraTreePlanks.Logwood),
Rosewood("Rosewood", 10061414, PlankType.ExtraTreePlanks.Rosewood),
Purpleheart("Purpleheart", 9671330, PlankType.ExtraTreePlanks.Purpleheart),
Iroko("Iroko", 6315099, PlankType.ExtraTreePlanks.Iroko),
Gingko("Gingko", 11382428, PlankType.ExtraTreePlanks.Gingko),
Eucalyptus("Eucalyptus", 15392474, PlankType.ExtraTreePlanks.Eucalyptus),
Eucalyptus2("Eucalyptus", 8814181, PlankType.ExtraTreePlanks.Eucalyptus),
Box("Box", 11235159, PlankType.ExtraTreePlanks.Box),
Syzgium("Syzgium", 11235159, PlankType.ExtraTreePlanks.Syzgium),
Eucalyptus3("Eucalyptus", 7123007, PlankType.ExtraTreePlanks.Eucalyptus),
Cinnamon("Cinnamon", 8804412, PlankType.VanillaPlanks.JUNGLE),
PinkIvory("Pink Ivory", 8349012, PlankType.ExtraTreePlanks.PinkIvory);
String name;
int color;
IDesignMaterial plank;
IIcon trunk;
IIcon bark;
private ExtraTreeLog(final String name, final int color) {
this.plank = null;
this.name = name;
this.color = color;
}
private ExtraTreeLog(final String name, final int color, final IDesignMaterial plank) {
this.plank = null;
this.name = name;
this.color = color;
this.plank = plank;
}
public String getName() {
return this.name;
}
public void addRecipe() {
if (this.plank == null) {
return;
}
final ItemStack log = this.getItemStack();
final ItemStack result = this.plank.getStack();
result.stackSize = 4;
GameRegistry.addShapelessRecipe(result, new Object[] { log });
}
@Override
public void placeBlock(final World world, final int x, final int y, final 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(this.ordinal(), false);
}
}
public IIcon getTrunk() {
return this.trunk;
}
public IIcon getBark() {
return this.bark;
}
public static void registerIcons(final IIconRegister register) {
for (final 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");
}
}
@Override
public ItemStack getItemStack() {
return TileEntityMetadata.getItemStack(ExtraTrees.blockLog, this.ordinal()).copy();
}
@Override
public int getColour() {
return this.color;
}
}
public 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);
int block;
int metadata;
int colour;
private ForestryLog(final int blockOffset, final int meta, final int colour) {
this.block = blockOffset;
this.metadata = meta;
this.colour = colour;
}
@Override
public void placeBlock(final World world, final int x, final int y, final int z) {
BlockTypeLog logBlock = new BlockTypeLog(TreeManager.woodItemAccess.getLog(EnumWoodType.valueOf(this.name().toUpperCase()), false));
logBlock.setDirection(ForgeDirection.UP);
logBlock.setBlock(world, x, y, z);
}
@Override
public ItemStack getItemStack() {
return TreeManager.woodItemAccess.getLog(EnumWoodType.valueOf(this.name().toUpperCase()), false);
// return new ItemStack(Mods.Forestry.item("logs"), 1,
// this.metadata);
}
@Override
public int getColour() {
return this.colour;
}
}
public enum VanillaLog implements ILogType
{
Oak(6376752),
Spruce(2759179),
Birch(6376752),
Jungle(5456154);
int colour;
private VanillaLog(final int colour) {
this.colour = colour;
}
@Override
public void placeBlock(final World world, final int x, final int y, final int z) {
world.setBlock(x, y, z, Blocks.log, this.ordinal(), 2);
}
@Override
public ItemStack getItemStack() {
return new ItemStack(Blocks.log, 1, this.ordinal());
}
@Override
public int getColour() {
return this.colour;
}
}
}
@@ -0,0 +1,15 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.util.IIcon;
import binnie.extratrees.api.IDesignMaterial;
public interface IPlankType extends IDesignMaterial
{
IIcon getIcon();
String getDescription();
}
@@ -0,0 +1,117 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.util.IIcon;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.IBlockAccess;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.block.Block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.extratrees.ExtraTrees;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.core.block.ItemMetadata;
public class ItemETDoor extends ItemMetadata
{
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(final IIconRegister register) {
for (final DoorType type : DoorType.values()) {
type.iconItem = ExtraTrees.proxy.getIcon(register, "door." + type.id);
}
}
public ItemETDoor(final Block block) {
super(block);
this.maxStackSize = 1;
this.setCreativeTab(CreativeTabs.tabRedstone);
}
@Override
public boolean onItemUse(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final World par3World, final int par4, int par5, final int par6, final int par7, final float par8, final float par9, final float par10) {
if (par7 != 1) {
return false;
}
++par5;
final Block block = ExtraTrees.blockDoor;
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) || !par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) {
return false;
}
if (!block.canPlaceBlockAt(par3World, par4, par5, par6)) {
return false;
}
final int i1 = MathHelper.floor_double((par2EntityPlayer.rotationYaw + 180.0f) * 4.0f / 360.0f - 0.5) & 0x3;
placeDoorBlock(par3World, par4, par5, par6, i1, block, par1ItemStack, par2EntityPlayer);
--par1ItemStack.stackSize;
return true;
}
public static void placeDoorBlock(final World par0World, final int par1, final int par2, final int par3, final int par4, final Block par5Block, final ItemStack item, final EntityPlayer player) {
byte b0 = 0;
byte b2 = 0;
if (par4 == 0) {
b2 = 1;
}
if (par4 == 1) {
b0 = -1;
}
if (par4 == 2) {
b2 = -1;
}
if (par4 == 3) {
b0 = 1;
}
final int i1 = (par0World.isBlockNormalCubeDefault(par1 - b0, par2, par3 - b2, false) ? 1 : 0) + (par0World.isBlockNormalCubeDefault(par1 - b0, par2 + 1, par3 - b2, false) ? 1 : 0);
final int j1 = (par0World.isBlockNormalCubeDefault(par1 + b0, par2, par3 + b2, false) ? 1 : 0) + (par0World.isBlockNormalCubeDefault(par1 + b0, par2 + 1, par3 + b2, false) ? 1 : 0);
final boolean flag = par0World.getBlock(par1 - b0, par2, par3 - b2) == par5Block || par0World.getBlock(par1 - b0, par2 + 1, par3 - b2) == par5Block;
final boolean flag2 = par0World.getBlock(par1 + b0, par2, par3 + b2) == par5Block || par0World.getBlock(par1 + b0, par2 + 1, par3 + b2) == par5Block;
boolean flag3 = false;
if (flag && !flag2) {
flag3 = true;
}
else if (j1 > i1) {
flag3 = true;
}
par0World.setBlock(par1, par2, par3, par5Block, par4, 2);
par0World.setBlock(par1, par2 + 1, par3, par5Block, 0x8 | (flag3 ? 1 : 0), 2);
if (par0World.getBlock(par1, par2, par3) == par5Block) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(par0World, par1, par2, par3);
if (tile != null) {
tile.setTileMetadata(TileEntityMetadata.getItemDamage(item), false);
}
par5Block.onBlockPlacedBy(par0World, par1, par2, par3, player, item);
par5Block.onPostBlockPlaced(par0World, par1, par2, par3, par4);
}
par0World.notifyBlocksOfNeighborChange(par1, par2, par3, par5Block);
par0World.notifyBlocksOfNeighborChange(par1, par2 + 1, par3, par5Block);
}
@Override
@SideOnly(Side.CLIENT)
public int getSpriteNumber() {
return 1;
}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIconFromDamage(final int par1) {
final DoorType type = BlockETDoor.getDoorType(par1);
return type.iconItem;
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(final ItemStack par1ItemStack, final int par2) {
return WoodManager.getPlankType((par1ItemStack == null) ? 0 : (par1ItemStack.getItemDamage() & 0xFF)).getColour();
}
}
@@ -0,0 +1,99 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.world.IBlockAccess;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.world.World;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import binnie.extratrees.ExtraTrees;
import net.minecraft.block.Block;
import binnie.core.block.ItemMetadata;
public class ItemETSlab extends ItemMetadata
{
private final boolean isFullBlock;
private final BlockETSlab theHalfSlab;
private final BlockETSlab doubleSlab;
public ItemETSlab(final Block block) {
super(block);
this.theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
this.doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
this.isFullBlock = (block != this.theHalfSlab);
this.setMaxDamage(0);
this.setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public boolean onItemUse(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final World par3World, final int par4, final int par5, final int par6, final int par7, final float par8, final float par9, final float par10) {
if (this.isFullBlock) {
return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
}
if (par1ItemStack.stackSize == 0) {
return false;
}
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
return false;
}
final Block i1 = par3World.getBlock(par4, par5, par6);
final int j1 = par3World.getBlockMetadata(par4, par5, par6);
final int tileMeta = TileEntityMetadata.getTileMetadata(par3World, par4, par5, par6);
final int k1 = j1 & 0x7;
final boolean flag = (j1 & 0x8) != 0x0;
if (((par7 == 1 && !flag) || (par7 == 0 && flag)) && i1 == this.theHalfSlab && tileMeta == par1ItemStack.getItemDamage()) {
if (par3World.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlock(par4, par5, par6, this.doubleSlab, k1, 3)) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(par3World, par4, par5, par6);
if (tile != null) {
tile.setTileMetadata(tileMeta, true);
}
--par1ItemStack.stackSize;
}
return true;
}
return this.func_77888_a(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7) || super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
}
private boolean func_77888_a(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final World par3World, int par4, int par5, int par6, final int par7) {
if (par7 == 0) {
--par5;
}
if (par7 == 1) {
++par5;
}
if (par7 == 2) {
--par6;
}
if (par7 == 3) {
++par6;
}
if (par7 == 4) {
--par4;
}
if (par7 == 5) {
++par4;
}
final Block i1 = par3World.getBlock(par4, par5, par6);
final int j1 = par3World.getBlockMetadata(par4, par5, par6);
final int k1 = j1 & 0x7;
final int tileMeta = TileEntityMetadata.getTileMetadata(par3World, par4, par5, par6);
if (i1 == this.theHalfSlab && tileMeta == par1ItemStack.getItemDamage()) {
if (par3World.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlock(par4, par5, par6, this.doubleSlab, k1, 3)) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(par3World, par4, par5, par6);
if (tile != null) {
tile.setTileMetadata(tileMeta, false);
par3World.markBlockForUpdate(par4, par5, par6);
}
--par1ItemStack.stackSize;
}
return true;
}
return false;
}
}
@@ -0,0 +1,48 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import binnie.core.block.IBlockMetadata;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.world.World;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.block.Block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.IIcon;
import net.minecraft.item.ItemBlock;
public class ItemETStairs extends ItemBlock
{
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(final int par1) {
return PlankType.ExtraTreePlanks.values()[par1].getIcon();
}
public ItemETStairs(final Block block) {
super(block);
this.setCreativeTab(CreativeTabs.tabBlock);
this.setUnlocalizedName("stairs");
}
@Override
public boolean placeBlockAt(final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ, final int metadata) {
final boolean done = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);
final 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(final ItemStack par1ItemStack) {
return ((IBlockMetadata) this.field_150939_a).getBlockName(par1ItemStack);
}
}
@@ -0,0 +1,148 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraftforge.fluids.FluidStack;
import binnie.core.Mods;
import forestry.api.recipes.RecipeManagers;
import binnie.core.liquid.ILiquidType;
import binnie.extratrees.item.ExtraTreeLiquid;
import binnie.extratrees.block.decor.FenceType;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraft.item.crafting.CraftingManager;
import binnie.core.block.TileEntityMetadata;
import binnie.extratrees.block.decor.MultiFenceRecipeSolid;
import binnie.extratrees.block.decor.MultiFenceRecipeEmbedded;
import net.minecraftforge.oredict.RecipeSorter;
import binnie.extratrees.block.decor.MultiFenceRecipeSize;
import binnie.extratrees.block.decor.HedgeRenderer;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import binnie.extratrees.block.decor.FenceRenderer;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.event.FMLInterModComms;
import net.minecraft.item.ItemStack;
import net.minecraft.init.Items;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.client.IItemRenderer;
import binnie.core.block.ItemMetadataRenderer;
import net.minecraft.item.Item;
import binnie.core.BinnieCore;
import net.minecraft.block.Block;
import cpw.mods.fml.common.registry.GameRegistry;
import binnie.core.block.ItemMetadata;
import binnie.extratrees.block.decor.BlockMultiFence;
import binnie.extratrees.block.decor.BlockGate;
import binnie.extratrees.block.decor.BlockFence;
import binnie.extratrees.ExtraTrees;
import binnie.core.IInitializable;
public class ModuleBlocks implements IInitializable
{
public static int hedgeRenderID;
@Override
public void preInit() {
PlankType.setup();
ExtraTrees.blockPlanks = new BlockETPlanks();
ExtraTrees.blockFence = new BlockFence();
ExtraTrees.blockLog = new BlockETLog();
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");
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStairs), new StairItemRenderer());
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockGate), new GateItemRenderer());
for (final ILogType plank : ILogType.ExtraTreeLog.values()) {
OreDictionary.registerOre("logWood", plank.getItemStack());
}
GameRegistry.addSmelting(ExtraTrees.blockLog, new ItemStack(Items.coal, 1, 1), 0.15f);
for (final 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();
}
@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 (final PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
final ItemStack planks = plank.getStack();
final ItemStack slabs = TileEntityMetadata.getItemStack(ExtraTrees.blockSlab, plank.ordinal());
final ItemStack stairs = TileEntityMetadata.getItemStack(ExtraTrees.blockStairs, plank.ordinal());
stairs.stackSize = 4;
GameRegistry.addRecipe(stairs.copy(), new Object[] { "# ", "## ", "###", '#', planks.copy() });
slabs.stackSize = 6;
CraftingManager.getInstance().getRecipeList().add(0, new ShapedOreRecipe(slabs.copy(), new Object[] { "###", '#', planks.copy() }));
}
GameRegistry.addRecipe(new MultiFenceRecipeSize());
GameRegistry.addRecipe(new MultiFenceRecipeEmbedded());
GameRegistry.addRecipe(new MultiFenceRecipeSolid());
for (final IPlankType plank2 : WoodManager.getAllPlankTypes()) {
final ItemStack planks2 = plank2.getStack();
final ItemStack fenceNormal = WoodManager.getFence(plank2, new FenceType(0), 1);
final ItemStack gate = WoodManager.getGate(plank2);
final ItemStack doorStandard = WoodManager.getDoor(plank2, DoorType.Standard);
final ItemStack doorSolid = WoodManager.getDoor(plank2, DoorType.Solid);
final ItemStack doorSplit = WoodManager.getDoor(plank2, DoorType.Double);
final ItemStack doorFull = WoodManager.getDoor(plank2, DoorType.Full);
if (planks2 != null) {
if (gate == null) {
continue;
}
gate.stackSize = 1;
GameRegistry.addRecipe(gate.copy(), new Object[] { "fpf", 'f', fenceNormal.copy(), 'p', planks2.copy() });
fenceNormal.stackSize = 4;
GameRegistry.addRecipe(fenceNormal.copy(), new Object[] { "###", "# #", '#', planks2.copy() });
GameRegistry.addRecipe(doorSolid.copy(), new Object[] { "###", "###", "###", '#', planks2.copy() });
GameRegistry.addRecipe(doorStandard.copy(), new Object[] { "# #", "###", "###", '#', planks2.copy() });
GameRegistry.addRecipe(doorSplit.copy(), new Object[] { "# #", "###", "# #", '#', planks2.copy() });
GameRegistry.addRecipe(doorFull.copy(), new Object[] { "# #", "# #", "# #", '#', planks2.copy() });
}
}
this.addSqueezer(ILogType.VanillaLog.Spruce, ExtraTreeLiquid.Resin, 50);
}
public void addSqueezer(final ILogType log, final ILiquidType liquid, final int amount, final float pulpChance) {
final 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(final ILogType log, final ILiquidType liquid, final int amount) {
this.addSqueezer(log, liquid, amount, 0.5f);
}
}
@@ -0,0 +1,290 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import com.google.common.base.Optional;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.Item;
import binnie.core.Mods;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.item.ItemStack;
import binnie.extratrees.ExtraTrees;
import net.minecraft.util.IIcon;
import binnie.extratrees.api.CarpentryManager;
public class PlankType
{
public static final int MAX_PLANKS = 256;
public static void setup() {
for (final VanillaPlanks plank : VanillaPlanks.values()) {
CarpentryManager.carpentryInterface.registerCarpentryWood(plank.ordinal(), plank);
}
for (final ExtraTreePlanks plank2 : ExtraTreePlanks.values()) {
CarpentryManager.carpentryInterface.registerCarpentryWood(plank2.ordinal() + 32, plank2);
}
for (final ForestryPlanks plank3 : ForestryPlanks.values()) {
CarpentryManager.carpentryInterface.registerCarpentryWood(plank3.ordinal() + 128, plank3);
}
for (final ExtraBiomesPlank plank4 : ExtraBiomesPlank.values()) {
CarpentryManager.carpentryInterface.registerCarpentryWood(plank4.ordinal() + 192, plank4);
}
}
public enum ExtraTreePlanks implements IPlankType, IFenceProvider
{
Fir(12815444),
Cedar(14181940),
Hemlock(13088108),
Cypress(16169052),
Fig(13142058),
Beech(14784849),
Alder(12092755),
Hazel(13480341),
Hornbeam(12818528),
Box(16511430),
Butternut(15510138),
Hickory(14333070),
Whitebeam(13222585),
Elm(15772004),
Apple(6305064),
Yew(14722426),
Pear(12093805),
Hawthorn(13402978),
Rowan(13610394),
Elder(12489337),
Maclura(15970862),
Syzgium(15123393),
Brazilwood(7487063),
Logwood(10762028),
Iroko(7681024),
Locust(12816736),
Eucalyptus(16165771),
Purpleheart(5970991),
Ash(16107368),
Holly(16512743),
Olive(11578760),
Sweetgum(13997656),
Rosewood(7738624),
Gingko(16050106),
PinkIvory(15502496);
int color;
IIcon icon;
private ExtraTreePlanks(final int color) {
this.color = color;
}
@Override
public String getName() {
return ExtraTrees.proxy.localise("block.planks." + this.toString().toLowerCase());
}
@Override
public String getDescription() {
return ExtraTrees.proxy.localise("block.planks." + this.toString().toLowerCase() + ".desc");
}
@Override
public int getColour() {
return this.color;
}
@Override
public ItemStack getStack() {
return TileEntityMetadata.getItemStack(ExtraTrees.blockPlanks, this.ordinal());
}
public IIcon loadIcon(final IIconRegister register) {
return this.icon = ExtraTrees.proxy.getIcon(register, "planks/" + this.toString());
}
@Override
public IIcon getIcon() {
return this.icon;
}
@Override
public ItemStack getFence() {
return TileEntityMetadata.getItemStack(ExtraTrees.blockFence, WoodManager.getPlankTypeIndex(this));
}
}
public enum VanillaPlanks implements IPlankType
{
OAK(11833434),
SPRUCE(8412726),
BIRCH(14139781),
JUNGLE(11632732),
ACACIA(12215095),
DARKOAK(4599061);
int color;
private VanillaPlanks(final int color) {
this.color = color;
}
@Override
public String getName() {
return ExtraTrees.proxy.localise("block.planks.vanilla." + this.toString().toLowerCase());
}
@Override
public String getDescription() {
return ExtraTrees.proxy.localise("block.planks.vanilla." + this.toString().toLowerCase() + ".desc");
}
@Override
public int getColour() {
return this.color;
}
@Override
public ItemStack getStack() {
return new ItemStack(Blocks.planks, 1, this.ordinal());
}
@Override
public IIcon getIcon() {
if (this.getStack() != null) {
final int meta = this.getStack().getItemDamage();
final Block block = Blocks.planks;
return block.getIcon(2, meta);
}
return null;
}
}
public enum ForestryPlanks implements IPlankType, IFenceProvider
{
LARCH(14131085),
TEAK(8223075),
ACACIA(9745287),
LIME(13544048),
CHESTNUT(12298845),
WENGE(6182474),
BAOBAB(9608290),
SEQUOIA(10050135),
KAPOK(8156212),
EBONY(3946288),
MAHOGANY(7749432),
BALSA(11117209),
WILLOW(11710818),
WALNUT(6836802),
GREENHEART(5144156),
CHERRY(11895348),
MAHOE(8362154),
POPLAR(13619074),
PALM(13271115),
PAPAYA(14470005),
PINE(12885585),
PLUM(11364479),
MAPLE(11431211),
CITRUS(10266653),
GIGANTEUM(5186590),
IPE(5057822),
PADAUK(11756341),
COCOBOLO(7541506),
ZEBRAWOOD(10912334);
int color;
private ForestryPlanks(final int color) {
this.color = color;
}
@Override
public String getName() {
return ExtraTrees.proxy.localise("block.planks.forestry." + this.toString().toLowerCase());
}
@Override
public String getDescription() {
return ExtraTrees.proxy.localise("block.planks.forestry." + this.toString().toLowerCase() + ".desc");
}
@Override
public int getColour() {
return this.color;
}
@Override
public ItemStack getStack() {
final Item stack = Mods.Forestry.item("planks");
return new ItemStack(stack, 1, this.ordinal());
}
@Override
public IIcon getIcon() {
if (this.getStack() != null) {
final int meta = this.getStack().getItemDamage();
final Block block = ((ItemBlock) this.getStack().getItem()).field_150939_a;
return block.getIcon(2, meta);
}
return null;
}
@Override
public ItemStack getFence() {
final ItemStack fence = Mods.Forestry.stack("fences");
fence.setItemDamage(this.ordinal());
return fence;
}
}
public enum ExtraBiomesPlank implements IPlankType
{
Redwood(10185538),
Fir(8288074),
Acacia(12561022);
int color;
private ExtraBiomesPlank(final int color) {
this.color = color;
}
@Override
public String getName() {
return ExtraTrees.proxy.localise("block.planks.ebxl." + this.toString().toLowerCase());
}
@Override
public String getDescription() {
return ExtraTrees.proxy.localise("block.planks.ebxl." + this.toString().toLowerCase() + ".desc");
}
@Override
public int getColour() {
return this.color;
}
@Override
public ItemStack getStack() {
try {
final Class clss = Class.forName("extrabiomes.api.Stuff");
final Block block = (Block) ((Optional) clss.getField("planks").get(null)).get();
return new ItemStack(block, 1, this.ordinal());
} catch (Exception e) {
return null;
}
}
@Override
public IIcon getIcon() {
if (this.getStack() != null) {
final int meta = this.getStack().getItemDamage();
final Block block = ((ItemBlock) this.getStack().getItem()).field_150939_a;
return block.getIcon(2, meta);
}
return null;
}
}
}
@@ -0,0 +1,98 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import net.minecraft.util.IIcon;
import net.minecraft.block.Block;
import org.lwjgl.opengl.GL11;
import net.minecraft.item.ItemBlock;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraftforge.client.IItemRenderer;
public class StairItemRenderer implements IItemRenderer
{
private void renderStairBlock(final RenderBlocks renderBlocks, final ItemStack item, final float f, final float g, final float h) {
final Tessellator tessellator = Tessellator.instance;
final Block block = ((ItemBlock) item.getItem()).field_150939_a;
final IIcon textureIndex = PlankType.ExtraTreePlanks.values()[item.getItemDamage()].getIcon();
for (int i = 0; i < 2; ++i) {
if (i == 0) {
renderBlocks.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 0.5);
}
if (i == 1) {
renderBlocks.setRenderBounds(0.0, 0.0, 0.5, 1.0, 0.5, 1.0);
}
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0f, -1.0f, 0.0f);
renderBlocks.renderFaceYNeg(block, 0.0, 0.0, 0.0, textureIndex);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0f, 1.0f, 0.0f);
renderBlocks.renderFaceYPos(block, 0.0, 0.0, 0.0, textureIndex);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0f, 0.0f, -1.0f);
renderBlocks.renderFaceXNeg(block, 0.0, 0.0, 0.0, textureIndex);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0f, 0.0f, 1.0f);
renderBlocks.renderFaceXPos(block, 0.0, 0.0, 0.0, textureIndex);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0f, 0.0f, 0.0f);
renderBlocks.renderFaceZNeg(block, 0.0, 0.0, 0.0, textureIndex);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0f, 0.0f, 0.0f);
renderBlocks.renderFaceZPos(block, 0.0, 0.0, 0.0, textureIndex);
tessellator.draw();
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
}
}
@Override
public boolean handleRenderType(final ItemStack item, final IItemRenderer.ItemRenderType type) {
switch (type) {
case ENTITY: {
return true;
}
case EQUIPPED: {
return true;
}
case INVENTORY: {
return true;
}
default: {
return false;
}
}
}
@Override
public boolean shouldUseRenderHelper(final IItemRenderer.ItemRenderType type, final ItemStack item, final IItemRenderer.ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
switch (type) {
case ENTITY: {
this.renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
break;
}
case EQUIPPED: {
this.renderStairBlock((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
break;
}
case INVENTORY: {
this.renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
break;
}
}
}
}
@@ -0,0 +1,81 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import binnie.extratrees.ExtraTrees;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.block.Block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class StairsRenderer implements ISimpleBlockRenderingHandler
{
@Override
public void renderInventoryBlock(final Block par1Block, final int metadata, final int modelID, final RenderBlocks renderer) {
final Tessellator var4 = Tessellator.instance;
for (int var5 = 0; var5 < 2; ++var5) {
if (var5 == 0) {
renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 0.5);
}
if (var5 == 1) {
renderer.setRenderBounds(0.0, 0.0, 0.5, 1.0, 0.5, 1.0);
}
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
var4.startDrawingQuads();
var4.setNormal(0.0f, -1.0f, 0.0f);
renderer.renderFaceYNeg(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(0, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(0.0f, 1.0f, 0.0f);
renderer.renderFaceYPos(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(1, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(0.0f, 0.0f, -1.0f);
renderer.renderFaceXPos(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(2, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(0.0f, 0.0f, 1.0f);
renderer.renderFaceXNeg(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(3, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(-1.0f, 0.0f, 0.0f);
renderer.renderFaceZNeg(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(4, metadata));
var4.draw();
var4.startDrawingQuads();
var4.setNormal(1.0f, 0.0f, 0.0f);
renderer.renderFaceZPos(par1Block, 0.0, 0.0, 0.0, par1Block.getIcon(5, metadata));
var4.draw();
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
}
}
@Override
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block block, final int modelId, final RenderBlocks renderer) {
final BlockETStairs blockStairs = (BlockETStairs) block;
blockStairs.func_150147_e(renderer.blockAccess, par2, par3, par4);
renderer.setRenderBoundsFromBlock(blockStairs);
renderer.renderStandardBlock(blockStairs, par2, par3, par4);
final boolean var5 = blockStairs.func_150145_f(renderer.blockAccess, par2, par3, par4);
renderer.setRenderBoundsFromBlock(blockStairs);
renderer.renderStandardBlock(blockStairs, par2, par3, par4);
if (var5 && blockStairs.func_150144_g(renderer.blockAccess, par2, par3, par4)) {
renderer.setRenderBoundsFromBlock(blockStairs);
renderer.renderStandardBlock(blockStairs, par2, par3, par4);
}
return true;
}
@Override
public boolean shouldRender3DInInventory(final int i) {
return true;
}
@Override
public int getRenderId() {
return ExtraTrees.stairsID;
}
}
@@ -0,0 +1,125 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.init.Blocks;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import binnie.extratrees.ExtraTrees;
import binnie.extratrees.block.decor.FenceDescription;
import binnie.extratrees.block.decor.FenceType;
import net.minecraft.item.ItemStack;
import binnie.extratrees.api.IDesignMaterial;
import binnie.extratrees.api.CarpentryManager;
public class WoodManager
{
public static IPlankType getPlankType(final int index) {
final IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
if (wood instanceof IPlankType) {
return (IPlankType) wood;
}
return PlankType.ExtraTreePlanks.Fir;
}
public static int getPlankTypeIndex(final IPlankType type) {
final int index = CarpentryManager.carpentryInterface.getCarpentryWoodIndex(type);
return (index < 0) ? 0 : index;
}
public static FenceType getFenceType(final ItemStack stack) {
final FenceDescription desc = getFenceDescription(stack);
return (desc == null) ? null : desc.getFenceType();
}
public static FenceDescription getFenceDescription(final ItemStack stack) {
if (stack == null) {
return null;
}
if (stack.getItem() == Item.getItemFromBlock(ExtraTrees.blockMultiFence)) {
final int damage = TileEntityMetadata.getItemDamage(stack);
return getFenceDescription(damage);
}
for (final IPlankType type : getAllPlankTypes()) {
if (type instanceof IFenceProvider) {
final ItemStack f = ((IFenceProvider) type).getFence();
if (f != null && ItemStack.areItemStacksEqual(stack, f)) {
return new FenceDescription(new FenceType(0), type, type);
}
continue;
}
}
return null;
}
public static FenceDescription getFenceDescription(final int meta) {
return new FenceDescription(meta);
}
public static FenceType getFenceType(final int meta) {
return getFenceDescription(meta).getFenceType();
}
public static ItemStack getGate(final IPlankType plank) {
if (plank == PlankType.VanillaPlanks.OAK) {
return new ItemStack(Blocks.fence_gate);
}
return TileEntityMetadata.getItemStack(ExtraTrees.blockGate, getPlankTypeIndex(plank));
}
public static ItemStack getFence(final IPlankType plank, final FenceType type, final int amount) {
return getFence(plank, plank, type, amount);
}
public static ItemStack getFence(final IPlankType plank, final IPlankType plank2, final FenceType type, final int amount) {
if (plank instanceof IFenceProvider && plank == plank2 && type.isPlain()) {
final ItemStack original = ((IFenceProvider) plank).getFence();
if (original != null) {
original.stackSize = amount;
return original;
}
}
final int ord = type.ordinal();
final int i = getPlankTypeIndex(plank) + 256 * ord;
final ItemStack stack = TileEntityMetadata.getItemStack(ExtraTrees.blockMultiFence, i + 65536 * getPlankTypeIndex(plank2));
stack.stackSize = amount;
return stack;
}
public static ItemStack getDoor(final IPlankType plank, final DoorType type) {
return TileEntityMetadata.getItemStack(ExtraTrees.blockDoor, type.ordinal() * 256 + getPlankTypeIndex(plank));
}
public static List<IPlankType> getAllPlankTypes() {
final List<IPlankType> list = new ArrayList<IPlankType>();
for (final IPlankType type : PlankType.ExtraTreePlanks.values()) {
list.add(type);
}
for (final IPlankType type : PlankType.ForestryPlanks.values()) {
list.add(type);
}
for (final IPlankType type : PlankType.ExtraBiomesPlank.values()) {
if (type.getStack() != null) {
list.add(type);
}
}
for (final IPlankType type : PlankType.VanillaPlanks.values()) {
list.add(type);
}
return list;
}
public static IPlankType get(final ItemStack species) {
for (final IPlankType type : getAllPlankTypes()) {
if (type.getStack() != null && type.getStack().isItemEqual(species)) {
return type;
}
}
return null;
}
}
@@ -0,0 +1,189 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import binnie.core.Mods;
import net.minecraft.item.ItemBlock;
import net.minecraft.block.Block;
import binnie.Binnie;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.block.BlockMetadata;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import binnie.extratrees.ExtraTrees;
import binnie.extratrees.block.WoodManager;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import binnie.extratrees.block.IFenceProvider;
import binnie.extratrees.block.PlankType;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import forestry.api.core.Tabs;
import net.minecraft.block.material.Material;
import binnie.core.block.IBlockMetadata;
public class BlockFence extends net.minecraft.block.BlockFence implements IBlockMetadata, IBlockFence
{
public BlockFence() {
super("", Material.wood);
this.setCreativeTab(Tabs.tabArboriculture);
this.setBlockName("fence");
this.setResistance(5.0f);
this.setHardness(2.0f);
this.setStepSound(Block.soundTypeWood);
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
for (final IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
itemList.add(type.getFence());
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
if (tile != null) {
return this.getIcon(side, tile.getTileMetadata());
}
return super.getIcon(world, x, y, z, side);
}
public FenceDescription getDescription(final int meta) {
return WoodManager.getFenceDescription(meta);
}
@Override
public IIcon getIcon(final int side, final int meta) {
return this.getDescription(meta).getPlankType().getIcon();
}
@Override
public int getRenderType() {
return ExtraTrees.fenceID;
}
@Override
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
this.dropBlockAsItem(world, x, y, z, drop);
}
@Override
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
}
@Override
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
return BlockMetadata.breakBlock(this, player, world, x, y, z);
}
@Override
public TileEntity createNewTileEntity(final World var1, final int i) {
return new TileEntityMetadata();
}
@Override
public boolean hasTileEntity(final int meta) {
return true;
}
@Override
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
}
@Override
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
return TileEntityMetadata.getItemDamage(stack);
}
@Override
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
return tileMeta;
}
@Override
public String getBlockName(final ItemStack par1ItemStack) {
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
return Binnie.Language.localise(ExtraTrees.instance, "block.woodfence.name", this.getDescription(meta).getPlankType().getName());
}
@Override
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
}
@Override
public boolean canPlaceTorchOnTop(final World world, final int x, final int y, final int z) {
return true;
}
@Override
public boolean canConnectFenceTo(final IBlockAccess world, final int x, final int y, final int z) {
if (!this.isFence(world, x, y, z)) {
final Block block = world.getBlock(x, y, z);
return block != null && block.getMaterial().isOpaque() && block.renderAsNormalBlock();
}
return true;
}
public boolean isFence(final IBlockAccess world, final int x, final int y, final int z) {
final Block block = world.getBlock(x, y, z);
return canConnect(block);
}
public static boolean canConnect(final Block block) {
return block == ((ItemBlock) Mods.Forestry.item("fences")).field_150939_a || block == Blocks.fence || block == Blocks.fence_gate || block == Blocks.nether_brick_fence || block instanceof IBlockFence || block == ExtraTrees.blockGate;
}
@Override
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
par1World.removeTileEntity(par2, par3, par4);
}
@Override
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
return true;
}
@Override
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 20;
}
@Override
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return true;
}
@Override
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 5;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister p_149651_1_) {
}
@Override
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
return BlockMetadata.getPickBlock(world, x, y, z);
}
}
@@ -0,0 +1,153 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.block.Block;
import binnie.extratrees.ExtraTrees;
import binnie.Binnie;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.block.BlockMetadata;
import java.util.ArrayList;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.item.ItemStack;
import binnie.extratrees.block.IPlankType;
import binnie.extratrees.block.WoodManager;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import forestry.api.core.Tabs;
import binnie.core.block.IBlockMetadata;
import net.minecraft.block.BlockFenceGate;
public class BlockGate extends BlockFenceGate implements IBlockMetadata
{
public BlockGate() {
this.setCreativeTab(Tabs.tabArboriculture);
this.setResistance(5.0f);
this.setHardness(2.0f);
this.setStepSound(Block.soundTypeWood);
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
for (final IPlankType type : WoodManager.getAllPlankTypes()) {
final ItemStack gate = WoodManager.getGate(type);
if (gate != null) {
itemList.add(gate);
}
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
if (tile != null) {
return this.getIcon(side, tile.getTileMetadata());
}
return super.getIcon(world, x, y, z, side);
}
@Override
public IIcon getIcon(final int side, final int meta) {
return WoodManager.getPlankType(meta).getIcon();
}
@Override
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack drop) {
this.dropBlockAsItem(world, x, y, z, drop);
}
@Override
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
}
@Override
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
return BlockMetadata.breakBlock(this, player, world, x, y, z);
}
@Override
public TileEntity createNewTileEntity(final World var1, final int i) {
return new TileEntityMetadata();
}
@Override
public boolean hasTileEntity(final int meta) {
return true;
}
@Override
public boolean onBlockEventReceived(final World par1World, final int par2, final int par3, final int par4, final int par5, final int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
final TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null && tileentity.receiveClientEvent(par5, par6);
}
@Override
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
return TileEntityMetadata.getItemDamage(stack);
}
@Override
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
return tileMeta;
}
@Override
public String getBlockName(final ItemStack par1ItemStack) {
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
return Binnie.Language.localise(ExtraTrees.instance, "block.woodgate.name", WoodManager.getPlankType(meta).getName());
}
@Override
public void getBlockTooltip(final ItemStack par1ItemStack, final List par3List) {
}
@Override
public void breakBlock(final World par1World, final int par2, final int par3, final int par4, final Block par5, final int par6) {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
par1World.removeTileEntity(par2, par3, par4);
}
@Override
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
return true;
}
@Override
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 20;
}
@Override
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return true;
}
@Override
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
return 5;
}
@Override
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
return BlockMetadata.getPickBlock(world, x, y, z);
}
@Override
public boolean getBlocksMovement(final IBlockAccess p_149655_1_, final int p_149655_2_, final int p_149655_3_, final int p_149655_4_) {
return false;
}
}
@@ -0,0 +1,182 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.item.ItemStack;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import forestry.api.core.ForestryAPI;
import net.minecraft.util.IIcon;
import binnie.extratrees.genetics.ExtraTreeSpecies;
import net.minecraft.client.renderer.texture.IIconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.init.Blocks;
import binnie.extratrees.block.ModuleBlocks;
import net.minecraft.world.IBlockAccess;
import net.minecraft.entity.Entity;
import java.util.List;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import forestry.api.core.Tabs;
import net.minecraft.block.material.Material;
import net.minecraft.block.Block;
public class BlockHedge extends Block implements IBlockFence
{
public BlockHedge() {
super(Material.leaves);
this.setCreativeTab(Tabs.tabArboriculture);
this.setBlockName("hedge");
}
@Override
public void addCollisionBoxesToList(final World world, final int x, final int y, final int z, final AxisAlignedBB aabb, final List list, final Entity p_149743_7_) {
final boolean connectNegZ = this.canConnectFenceTo(world, x, y, z - 1);
final boolean connectPosZ = this.canConnectFenceTo(world, x, y, z + 1);
final boolean connectNegX = this.canConnectFenceTo(world, x - 1, y, z);
final boolean connectPosX = this.canConnectFenceTo(world, x + 1, y, z);
float f = 0.25f;
float f2 = 0.75f;
float f3 = 0.25f;
float f4 = 0.75f;
if (connectNegZ) {
f3 = 0.0f;
}
if (connectPosZ) {
f4 = 1.0f;
}
if (connectNegZ || connectPosZ) {
this.setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
super.addCollisionBoxesToList(world, x, y, z, aabb, list, p_149743_7_);
}
f3 = 0.25f;
f4 = 0.75f;
if (connectNegX) {
f = 0.0f;
}
if (connectPosX) {
f2 = 1.0f;
}
if (connectNegX || connectPosX || (!connectNegZ && !connectPosZ)) {
this.setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
super.addCollisionBoxesToList(world, x, y, z, aabb, list, p_149743_7_);
}
if (connectNegZ) {
f3 = 0.0f;
}
if (connectPosZ) {
f4 = 1.0f;
}
this.setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
}
@Override
public void setBlockBoundsBasedOnState(final IBlockAccess world, final int x, final int y, final int z) {
final boolean connectNegZ = this.canConnectFenceTo(world, x, y, z - 1);
final boolean connectPosZ = this.canConnectFenceTo(world, x, y, z + 1);
final boolean connectNegX = this.canConnectFenceTo(world, x - 1, y, z);
final boolean connectPosX = this.canConnectFenceTo(world, x + 1, y, z);
float f = 0.25f;
float f2 = 0.75f;
float f3 = 0.25f;
float f4 = 0.75f;
if (connectNegZ) {
f3 = 0.0f;
}
if (connectPosZ) {
f4 = 1.0f;
}
if (connectNegX) {
f = 0.0f;
}
if (connectPosX) {
f2 = 1.0f;
}
this.setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public boolean getBlocksMovement(final IBlockAccess p_149655_1_, final int p_149655_2_, final int p_149655_3_, final int p_149655_4_) {
return false;
}
@Override
public int getRenderType() {
return ModuleBlocks.hedgeRenderID;
}
public boolean canConnectFenceTo(final IBlockAccess p_149826_1_, final int p_149826_2_, final int p_149826_3_, final int p_149826_4_) {
final Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_);
return block == this || block == Blocks.fence_gate || func_149825_a(block) || block.isLeaves(p_149826_1_, p_149826_2_, p_149826_3_, p_149826_4_) || (block.getMaterial().isOpaque() && block.renderAsNormalBlock() && block.getMaterial() != Material.gourd);
}
public static boolean func_149825_a(final Block p_149825_0_) {
return BlockFence.canConnect(p_149825_0_);
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(final IBlockAccess p_149646_1_, final int p_149646_2_, final int p_149646_3_, final int p_149646_4_, final int p_149646_5_) {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister p_149651_1_) {
}
private ExtraTreeSpecies.LeafType getType(final int meta) {
return ExtraTreeSpecies.LeafType.values()[meta % 8];
}
private boolean isFull(final int meta) {
return meta / 8 > 0;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(final int p_149691_1_, final int meta) {
final ExtraTreeSpecies.LeafType type = this.getType(meta);
return ForestryAPI.textureManager.getIcon(this.isFull(meta) ? type.plainUID : type.fancyUID);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(final Item item, final CreativeTabs tab, final 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(final IBlockAccess world, final int x, final int y, final int z) {
return getColor(world.getBlockMetadata(x, y, z));
}
public static int getColor(final int meta) {
final ExtraTreeSpecies.LeafType type = ExtraTreeSpecies.LeafType.values()[meta % 6];
if (type == ExtraTreeSpecies.LeafType.Conifer) {
return ColorizerFoliage.getFoliageColorPine();
}
final double d0 = 0.5;
final double d2 = 1.0;
return ColorizerFoliage.getFoliageColor(d0, d2);
}
}
@@ -0,0 +1,47 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import binnie.extratrees.ExtraTrees;
import binnie.Binnie;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import binnie.extratrees.block.IPlankType;
import binnie.extratrees.block.WoodManager;
import binnie.extratrees.block.PlankType;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import binnie.core.block.IBlockMetadata;
public class BlockMultiFence extends BlockFence implements IBlockMetadata
{
public BlockMultiFence() {
this.setBlockName("multifence");
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
for (final FenceType type : FenceType.values()) {
itemList.add(WoodManager.getFence(PlankType.VanillaPlanks.SPRUCE, PlankType.VanillaPlanks.BIRCH, type, 1));
}
}
@Override
public IIcon getIcon(final int side, final int meta) {
return (FenceRenderer.layer == 0) ? this.getDescription(meta).getPlankType().getIcon() : this.getDescription(meta).getSecondaryPlankType().getIcon();
}
@Override
public String getBlockName(final ItemStack par1ItemStack) {
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
final IPlankType type1 = this.getDescription(meta).getPlankType();
final IPlankType type2 = this.getDescription(meta).getSecondaryPlankType();
final boolean twoTypes = type1 != type2;
final FenceType type3 = this.getDescription(meta).getFenceType();
return Binnie.Language.localise(ExtraTrees.instance, "block.woodslab.name" + (twoTypes ? "2" : ""), type3.getPrefix(), type1.getName(), type2.getName());
}
}
@@ -0,0 +1,39 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import binnie.extratrees.block.WoodManager;
import binnie.extratrees.block.IPlankType;
public class FenceDescription
{
FenceType fenceType;
IPlankType plankType;
IPlankType secondaryPlankType;
public FenceDescription(final FenceType fenceType, final IPlankType plankType, final IPlankType secondaryPlankType) {
this.fenceType = fenceType;
this.plankType = plankType;
this.secondaryPlankType = secondaryPlankType;
}
public FenceDescription(final int meta) {
this.fenceType = new FenceType(meta >> 8 & 0xFF);
this.plankType = WoodManager.getPlankType(meta & 0xFF);
this.secondaryPlankType = WoodManager.getPlankType(meta >> 16 & 0xFF);
}
public FenceType getFenceType() {
return this.fenceType;
}
public IPlankType getPlankType() {
return this.plankType;
}
public IPlankType getSecondaryPlankType() {
return this.secondaryPlankType;
}
}
@@ -0,0 +1,280 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import net.minecraft.tileentity.TileEntity;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import binnie.extratrees.block.WoodManager;
import binnie.extratrees.ExtraTrees;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.block.Block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class FenceRenderer implements ISimpleBlockRenderingHandler
{
public static int layer;
@Override
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
final Tessellator tess = Tessellator.instance;
for (int i = 0; i < 5; ++i) {
final 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);
}
final float s = 0.0625f;
final FenceType fenceType = (block == ExtraTrees.blockMultiFence) ? WoodManager.getFenceType(metadata) : new FenceType(0);
final 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.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;
}
if (i == 3) {
if (!bottomBar) {
continue;
}
block.setBlockBounds(minX, bottomBarMinY, minZ, maxX, bottomBarMaxY, maxZ);
FenceRenderer.layer = 1;
}
if (i == 4) {
if (fenceType.embossed) {
minX -= s * 0.9f;
maxX += s * 0.9f;
minZ -= s;
maxZ += s;
float minY = 0.0f;
float maxY = 1.0f;
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);
}
@Override
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block block, final int modelId, final RenderBlocks renderer) {
FenceRenderer.layer = 0;
final BlockFence blockFence = (BlockFence) block;
final float i = 0.0625f;
FenceType fenceType = new FenceType(0);
final TileEntity tile = world.getTileEntity(par2, par3, par4);
if (tile != null && tile instanceof TileEntityMetadata && block instanceof BlockMultiFence) {
fenceType = WoodManager.getFenceType(((TileEntityMetadata) tile).getTileMetadata());
}
boolean rendered = false;
final float postWidth = 0.25f;
final 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, par2, par3, par4);
rendered = true;
boolean connectAnyX = false;
boolean connectAnyZ = false;
if (blockFence.canConnectFenceTo(renderer.blockAccess, par2 - 1, par3, par4) || blockFence.canConnectFenceTo(renderer.blockAccess, par2 + 1, par3, par4)) {
connectAnyX = true;
}
if (blockFence.canConnectFenceTo(renderer.blockAccess, par2, par3, par4 - 1) || blockFence.canConnectFenceTo(renderer.blockAccess, par2, par3, par4 + 1)) {
connectAnyZ = true;
}
final boolean connectNegX = blockFence.canConnectFenceTo(renderer.blockAccess, par2 - 1, par3, par4);
final boolean connectPosX = blockFence.canConnectFenceTo(renderer.blockAccess, par2 + 1, par3, par4);
final boolean connectNegZ = blockFence.canConnectFenceTo(renderer.blockAccess, par2, par3, par4 - 1);
final boolean connectPosZ = blockFence.canConnectFenceTo(renderer.blockAccess, par2, par3, par4 + 1);
if (!connectAnyX && !connectAnyZ) {
connectAnyX = true;
}
minPostPos = 7.0f * i;
maxPostPos = 9.0f * i;
float barMinY = 12.0f * i;
float barMaxY = 15.0f * i;
final float minX = connectNegX ? 0.0f : minPostPos;
final float maxX = connectPosX ? 1.0f : maxPostPos;
final float minZ = connectNegZ ? 0.0f : minPostPos;
final 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;
}
}
final float totalMaxY = barMaxY;
FenceRenderer.layer = 1;
if (connectAnyX) {
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
renderer.renderStandardBlock(blockFence, par2, par3, par4);
rendered = true;
}
if (connectAnyZ) {
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
renderer.renderStandardBlock(blockFence, par2, par3, par4);
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, par2, par3, par4);
rendered = true;
}
if (connectAnyZ) {
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
renderer.renderStandardBlock(blockFence, par2, par3, par4);
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, par2, par3, par4);
rendered = true;
}
if (connectAnyZ) {
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
renderer.renderStandardBlock(blockFence, par2, par3, par4);
rendered = true;
}
}
final 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, par2, par3, par4);
}
if (connectAnyZ) {
renderer.setRenderBounds(minPostPos, minY, minZ, maxPostPos, maxY, maxZ);
renderer.renderStandardBlock(block, par2, par3, par4);
}
}
blockFence.setBlockBoundsBasedOnState(renderer.blockAccess, par2, par3, par4);
return rendered;
}
@Override
public boolean shouldRender3DInInventory(final int i) {
return true;
}
@Override
public int getRenderId() {
return ExtraTrees.fenceID;
}
}
@@ -0,0 +1,61 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
public class FenceType
{
public int size;
public boolean solid;
public boolean embossed;
public FenceType(final int size, final boolean solid, final boolean embedded) {
this.size = size;
this.solid = solid;
this.embossed = embedded;
}
public String getPrefix() {
return ((this.size == 0) ? "" : ((this.size == 1) ? "Full " : "Low ")) + (this.solid ? "Solid " : "") + (this.embossed ? "Embedded " : "");
}
public int ordinal() {
return this.size + ((this.solid ? 1 : 0) << 2) + ((this.embossed ? 1 : 0) << 3);
}
public FenceType(final int meta) {
this.size = (meta & 0x3);
this.solid = ((meta >> 2 & 0x1) > 0);
this.embossed = ((meta >> 3 & 0x1) > 0);
}
public static Collection<FenceType> values() {
final List<FenceType> list = new ArrayList<FenceType>();
for (int size = 0; size < 3; ++size) {
for (final boolean solid : new boolean[] { false, true }) {
for (final boolean embedded : new boolean[] { false, true }) {
list.add(new FenceType(size, solid, embedded));
}
}
}
return list;
}
public boolean isPlain() {
return this.size == 0 && !this.embossed && !this.solid;
}
@Override
public boolean equals(final Object obj) {
if (obj instanceof FenceType) {
final FenceType o = (FenceType) obj;
return o.size == this.size && o.embossed == this.embossed && o.solid == this.solid;
}
return super.equals(obj);
}
}
@@ -0,0 +1,126 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import binnie.extratrees.block.ModuleBlocks;
import net.minecraft.util.IIcon;
import binnie.extratrees.ExtraTrees;
import net.minecraft.world.IBlockAccess;
import net.minecraft.client.renderer.Tessellator;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.block.Block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class HedgeRenderer implements ISimpleBlockRenderingHandler
{
@Override
public void renderInventoryBlock(final Block block, final int metadata, final int modelId, final RenderBlocks renderer) {
final int color = BlockHedge.getColor(metadata);
final int r = color >> 16 & 0xFF;
final int g = color >> 8 & 0xFF;
final 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);
final 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(final IBlockAccess world, final int x, final int y, final int z, final Block block, final int modelId, final RenderBlocks renderer) {
final IIcon icon = block.getIcon(0, world.getBlockMetadata(x, y, z));
final BlockHedge hedge = ExtraTrees.blockHedge;
final boolean connectNegX = hedge.canConnectFenceTo(world, x - 1, y, z);
final boolean connectPosX = hedge.canConnectFenceTo(world, x + 1, y, z);
final boolean connectNegZ = hedge.canConnectFenceTo(world, x, y, z - 1);
final 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(final int modelId) {
return true;
}
@Override
public int getRenderId() {
return ModuleBlocks.hedgeRenderID;
}
}
@@ -0,0 +1,9 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
public interface IBlockFence
{
}
@@ -0,0 +1,23 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import binnie.extratrees.genetics.ExtraTreeSpecies;
import net.minecraft.item.ItemStack;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlockWithMetadata;
public class ItemHedge extends ItemBlockWithMetadata
{
public ItemHedge(final Block block) {
super(block, block);
}
@Override
public String getItemStackDisplayName(final ItemStack item) {
final int meta = item.getItemDamage();
return ExtraTreeSpecies.LeafType.values()[meta % 6].descript + ((meta >= 8) ? " Full" : "") + " Hedge";
}
}
@@ -0,0 +1,60 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import net.minecraft.init.Blocks;
import binnie.extratrees.block.IPlankType;
import binnie.extratrees.block.WoodManager;
import net.minecraft.world.World;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
public class MultiFenceRecipeEmbedded implements IRecipe
{
ItemStack cached;
@Override
public boolean matches(final InventoryCrafting inv, final World world) {
final String pattern = "";
FenceType type = null;
for (int row = 0; row < 3; ++row) {
final ItemStack a = inv.getStackInSlot(row * 3);
final ItemStack b = inv.getStackInSlot(row * 3 + 1);
final ItemStack c = inv.getStackInSlot(row * 3 + 2);
if (a != null && b != null) {
if (c != null) {
type = WoodManager.getFenceType(a);
final FenceType type2 = WoodManager.getFenceType(c);
if (type != null && type2 != null) {
if (type.equals(type2)) {
final IPlankType pType = WoodManager.get(b);
if (WoodManager.getFenceDescription(a).getPlankType() == pType) {
this.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(final InventoryCrafting inv) {
return this.getRecipeOutput();
}
@Override
public int getRecipeSize() {
return 3;
}
@Override
public ItemStack getRecipeOutput() {
return (this.cached == null) ? new ItemStack(Blocks.fence) : this.cached;
}
}
@@ -0,0 +1,90 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import net.minecraft.init.Blocks;
import java.util.List;
import binnie.extratrees.block.WoodManager;
import binnie.extratrees.block.IPlankType;
import java.util.ArrayList;
import net.minecraft.world.World;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
public class MultiFenceRecipeSize implements IRecipe
{
ItemStack cached;
@Override
public boolean matches(final InventoryCrafting inv, final World world) {
String pattern = "";
final List<IPlankType> types = new ArrayList<IPlankType>();
for (int i = 0; i < inv.getSizeInventory(); ++i) {
final ItemStack stack = inv.getStackInSlot(i);
final IPlankType type = (stack == null) ? null : WoodManager.get(stack);
if (stack != null && type == null) {
return false;
}
if (stack == null) {
pattern += " ";
}
else {
if (!types.contains(type)) {
types.add(type);
if (types.size() > 2) {
return false;
}
}
pattern += types.indexOf(type);
}
}
if (types.isEmpty()) {
return false;
}
ItemStack fence = null;
if (pattern.contains("0100 0 ")) {
fence = WoodManager.getFence(types.get(0), types.get(1), new FenceType(0, false, false), 4);
}
else if (pattern.contains("0000 0 ")) {
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(0, false, false), 4);
}
else if (pattern.contains("0100 0 1 ")) {
fence = WoodManager.getFence(types.get(0), types.get(1), new FenceType(1, false, false), 4);
}
else if (pattern.contains("0000 0 0 ")) {
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(1, false, false), 4);
}
else if (pattern.contains(" 0 1 1101")) {
fence = WoodManager.getFence(types.get(1), types.get(0), new FenceType(2, false, false), 4);
}
else if (pattern.contains(" 0 0 0000")) {
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(2, false, false), 4);
}
this.cached = fence;
return fence != null;
}
@Override
public ItemStack getCraftingResult(final InventoryCrafting inv) {
return this.getRecipeOutput();
}
@Override
public int getRecipeSize() {
return 3;
}
@Override
public ItemStack getRecipeOutput() {
return (this.cached == null) ? new ItemStack(Blocks.fence) : this.cached;
}
public static void generateTypes() {
final int type = 0;
for (int type2 = 0; type2 < 2; ++type2) {
}
}
}
@@ -0,0 +1,57 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import net.minecraft.init.Blocks;
import binnie.extratrees.block.WoodManager;
import net.minecraft.world.World;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
public class MultiFenceRecipeSolid implements IRecipe
{
ItemStack cached;
@Override
public boolean matches(final InventoryCrafting inv, final World world) {
final String pattern = "";
FenceType type = null;
for (int row = 0; row < 3; ++row) {
final ItemStack a = inv.getStackInSlot(row * 3);
final ItemStack b = inv.getStackInSlot(row * 3 + 1);
final ItemStack c = inv.getStackInSlot(row * 3 + 2);
if (a != null && b != null) {
if (c != null) {
type = WoodManager.getFenceType(a);
final FenceType type2 = WoodManager.getFenceType(b);
final FenceType type3 = WoodManager.getFenceType(c);
if (type != null && type2 != null && type3 != null && type.equals(type2)) {
if (type.equals(type3)) {
this.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(final InventoryCrafting inv) {
return this.getRecipeOutput();
}
@Override
public int getRecipeSize() {
return 3;
}
@Override
public ItemStack getRecipeOutput() {
return (this.cached == null) ? new ItemStack(Blocks.fence) : this.cached;
}
}
@@ -0,0 +1,152 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import java.util.HashMap;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
public class NBTShapedRecipe implements IRecipe
{
public final int recipeWidth;
public final int recipeHeight;
public final ItemStack[] recipeItems;
private ItemStack recipeOutput;
private boolean field_92101_f;
private static final String __OBFID = "CL_00000093";
@Override
public ItemStack getRecipeOutput() {
return this.recipeOutput;
}
@Override
public boolean matches(final InventoryCrafting p_77569_1_, final World p_77569_2_) {
for (int i = 0; i <= 3 - this.recipeWidth; ++i) {
for (int j = 0; j <= 3 - this.recipeHeight; ++j) {
if (this.checkMatch(p_77569_1_, i, j, true)) {
return true;
}
if (this.checkMatch(p_77569_1_, i, j, false)) {
return true;
}
}
}
return false;
}
private boolean checkMatch(final InventoryCrafting p_77573_1_, final int p_77573_2_, final int p_77573_3_, final boolean p_77573_4_) {
for (int k = 0; k < 3; ++k) {
for (int l = 0; l < 3; ++l) {
final int i1 = k - p_77573_2_;
final int j1 = l - p_77573_3_;
ItemStack itemstack = null;
if (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight) {
if (p_77573_4_) {
itemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth];
}
else {
itemstack = this.recipeItems[i1 + j1 * this.recipeWidth];
}
}
final ItemStack itemstack2 = p_77573_1_.getStackInRowAndColumn(k, l);
if (itemstack2 != null || itemstack != null) {
if ((itemstack2 == null && itemstack != null) || (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(final InventoryCrafting p_77572_1_) {
final ItemStack itemstack = this.getRecipeOutput().copy();
if (this.field_92101_f) {
for (int i = 0; i < p_77572_1_.getSizeInventory(); ++i) {
final ItemStack itemstack2 = p_77572_1_.getStackInSlot(i);
if (itemstack2 != null && itemstack2.hasTagCompound()) {
itemstack.setTagCompound((NBTTagCompound) itemstack2.stackTagCompound.copy());
}
}
}
return itemstack;
}
@Override
public int getRecipeSize() {
return this.recipeWidth * this.recipeHeight;
}
public NBTShapedRecipe(final ItemStack p_92103_1_, final Object... p_92103_2_) {
String s = "";
int i = 0;
int j = 0;
int k = 0;
if (p_92103_2_[i] instanceof String[]) {
final String[] astring = (String[]) p_92103_2_[i++];
for (int l = 0; l < astring.length; ++l) {
final String s2 = astring[l];
++k;
j = s2.length();
s += s2;
}
}
else {
while (p_92103_2_[i] instanceof String) {
final String s3 = (String) p_92103_2_[i++];
++k;
j = s3.length();
s += s3;
}
}
final HashMap hashmap = new HashMap();
while (i < p_92103_2_.length) {
final 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;
}
final ItemStack[] aitemstack = new ItemStack[j * k];
for (int i2 = 0; i2 < j * k; ++i2) {
final char c0 = s.charAt(i2);
if (hashmap.containsKey(c0)) {
aitemstack[i2] = ((ItemStack) hashmap.get(Character.valueOf(c0))).copy();
}
else {
aitemstack[i2] = null;
}
}
this.recipeWidth = j;
this.recipeHeight = k;
this.recipeItems = aitemstack;
this.recipeOutput = p_92103_1_;
NBTShapedRecipes.addRecipe(this);
}
}
@@ -0,0 +1,55 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.block.decor;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.inventory.InventoryCrafting;
import java.util.List;
import net.minecraft.item.crafting.IRecipe;
public class NBTShapedRecipes implements IRecipe
{
static List<NBTShapedRecipe> recipes;
@Override
public boolean matches(final InventoryCrafting inventory, final World world) {
for (final NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
if (recipe.matches(inventory, world)) {
return true;
}
}
return false;
}
@Override
public ItemStack getCraftingResult(final InventoryCrafting inventory) {
for (final NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
if (recipe.matches(inventory, null)) {
return recipe.getCraftingResult(inventory);
}
}
return null;
}
@Override
public int getRecipeSize() {
return 9;
}
@Override
public ItemStack getRecipeOutput() {
return null;
}
public static void addRecipe(final NBTShapedRecipe nbtShapedRecipe) {
NBTShapedRecipes.recipes.add(nbtShapedRecipe);
}
static {
NBTShapedRecipes.recipes = new ArrayList<NBTShapedRecipe>();
}
}
@@ -0,0 +1,40 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import binnie.extratrees.ExtraTrees;
import binnie.Binnie;
import binnie.extratrees.block.PlankType;
import net.minecraft.item.ItemStack;
import binnie.extratrees.api.IDesign;
import forestry.api.core.Tabs;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class BlockCarpentry extends BlockDesign
{
public BlockCarpentry() {
super(DesignSystem.Wood, Material.wood);
this.setCreativeTab(Tabs.tabArboriculture);
this.setBlockName("carpentry");
this.setResistance(5.0f);
this.setHardness(2.0f);
this.setStepSound(Block.soundTypeWood);
}
@Override
public ItemStack getCreativeStack(final IDesign design) {
return ModuleCarpentry.getItemStack(this, PlankType.ExtraTreePlanks.Apple, PlankType.VanillaPlanks.BIRCH, design);
}
@Override
public String getBlockName(final DesignBlock design) {
return Binnie.Language.localise(ExtraTrees.instance, "block.woodentile.name", design.getDesign().getName());
}
}
@@ -0,0 +1,155 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import binnie.core.block.BlockMetadata;
import net.minecraft.block.Block;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import binnie.extratrees.ExtraTrees;
import binnie.Binnie;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class BlockCarpentryPanel extends BlockCarpentry
{
public BlockCarpentryPanel() {
this.useNeighborBrightness = true;
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
this.setLightOpacity(0);
}
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
}
@Override
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z)
{
this.setBlockBoundsBasedOnState(world, x, y, z);
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
}
@Override
public void setBlockBoundsBasedOnState(final IBlockAccess world, final int x, final int y, final int z) {
final DesignBlock block = this.getCarpentryBlock(world, x, y, z);
switch (block.getFacing()) {
case DOWN: {
this.setBlockBounds(0.0f, 0.9375f, 0.0f, 1.0f, 1.0f, 1.0f);
break;
}
case EAST: {
this.setBlockBounds(0.0f, 0.0f, 0.0f, 0.0625f, 1.0f, 1.0f);
break;
}
case NORTH: {
this.setBlockBounds(0.0f, 0.0f, 0.9375f, 1.0f, 1.0f, 1.0f);
break;
}
case SOUTH: {
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0625f);
break;
}
case UP: {
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
break;
}
case WEST: {
this.setBlockBounds(0.9375f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
break;
}
}
}
@Override
public void setBlockBoundsForItemRender() {
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
}
@Override
public String getBlockName(final ItemStack stack) {
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
return Binnie.Language.localise(ExtraTrees.instance, "block.woodenpanel.name", block.getDesign().getName());
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(final World par1World, final int par2, final int par3, final int par4) {
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
return AxisAlignedBB.getBoundingBox(par2 + this.minX, par3 + this.minY, par4 + this.minZ, par2 + this.maxX, par3 + this.maxY, par4 + this.maxZ);
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(final IBlockAccess world, final int x, final int y, final int z, final int side) {
return super.shouldSideBeRendered(world, x, y, z, side);
}
@Override
public DesignBlock getCarpentryBlock(final IBlockAccess world, final int x, final int y, final int z) {
return ModuleCarpentry.getCarpentryPanel(this.getDesignSystem(), TileEntityMetadata.getTileMetadata(world, x, y, z));
}
public static boolean isValidPanelPlacement(final World world, final int x, final int y, final int z, final ForgeDirection facing) {
if (facing == ForgeDirection.UNKNOWN) {
return false;
}
final int bx = x - facing.offsetX;
final int by = y - facing.offsetY;
final int bz = z - facing.offsetZ;
final Block block = world.getBlock(bx, by, bz);
return block != null && block.isSideSolid(world, bx, by, bz, facing);
}
@Override
public int getPlacedMeta(final ItemStack item, final World world, final int x, final int y, final int z, final ForgeDirection clickedBlock) {
final DesignBlock block = ModuleCarpentry.getCarpentryPanel(this.getDesignSystem(), TileEntityMetadata.getItemDamage(item));
ForgeDirection facing = clickedBlock;
boolean valid = true;
if (!isValidPanelPlacement(world, x, y, z, facing)) {
valid = false;
for (final 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(this.getDesignSystem());
}
@Override
public void onNeighborBlockChange(final World world, final int x, final int y, final int z, final Block par5) {
super.onNeighborBlockChange(world, x, y, z, par5);
final DesignBlock block = this.getCarpentryBlock(world, x, y, z);
if (!isValidPanelPlacement(world, x, y, z, block.getFacing())) {
for (final ItemStack stack : BlockMetadata.getBlockDropped(this, world, x, y, z, 0)) {
this.dropBlockAsItem(world, x, y, z, stack);
}
world.setBlockToAir(x, y, z);
}
}
}
@@ -0,0 +1,175 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.block.Block;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.core.block.MultipassBlockRenderer;
import binnie.core.BinnieCore;
import binnie.extratrees.api.CarpentryManager;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import binnie.extratrees.api.IDesign;
import net.minecraft.block.material.Material;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import binnie.core.block.TileEntityMetadata;
import net.minecraft.world.IBlockAccess;
import binnie.extratrees.api.IToolHammer;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.common.util.ForgeDirection;
import binnie.extratrees.api.IDesignSystem;
import binnie.core.block.IMultipassBlock;
import binnie.core.block.BlockMetadata;
public abstract class BlockDesign extends BlockMetadata implements IMultipassBlock
{
IDesignSystem designSystem;
public static final ForgeDirection[] RENDER_DIRECTIONS;
@SubscribeEvent
public void onClick(final PlayerInteractEvent event) {
if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
return;
}
final World world = event.entityPlayer.worldObj;
final EntityPlayer player = event.entityPlayer;
final int x = event.x;
final int y = event.y;
final int z = event.z;
if (!(world.getBlock(x, y, z) instanceof BlockDesign)) {
return;
}
final BlockDesign blockC = (BlockDesign) world.getBlock(x, y, z);
final ItemStack item = player.getHeldItem();
if (item == null) {
return;
}
if (!(item.getItem() instanceof IToolHammer)) {
return;
}
if (!((IToolHammer) item.getItem()).isActive(item)) {
return;
}
final DesignBlock block = blockC.getCarpentryBlock(world, x, y, z);
final TileEntityMetadata tile = (TileEntityMetadata) world.getTileEntity(x, y, z);
block.rotate(event.face, item, player, world, x, y, z);
final int meta = block.getBlockMetadata(blockC.getDesignSystem());
tile.setTileMetadata(meta, true);
}
public BlockDesign(final IDesignSystem system, final Material material) {
super(material);
this.designSystem = system;
}
public abstract ItemStack getCreativeStack(final IDesign p0);
@Override
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
for (final IDesign design : CarpentryManager.carpentryInterface.getSortedDesigns()) {
itemList.add(this.getCreativeStack(design));
}
}
public IDesignSystem getDesignSystem() {
return this.designSystem;
}
@Override
public int getRenderType() {
return BinnieCore.multipassRenderID;
}
@Override
public String getBlockName(final ItemStack stack) {
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
return this.getBlockName(block);
}
public abstract String getBlockName(final DesignBlock p0);
public DesignBlock getCarpentryBlock(final IBlockAccess world, final int x, final int y, final int z) {
return ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getTileMetadata(world, x, y, z));
}
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(final IBlockAccess world, final int x, final int y, final int z) {
final DesignBlock block = this.getCarpentryBlock(world, x, y, z);
return (MultipassBlockRenderer.getLayer() > 0) ? block.getSecondaryColour() : block.getPrimaryColour();
}
@Override
public int colorMultiplier(final int meta) {
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), meta);
return (MultipassBlockRenderer.getLayer() > 0) ? block.getSecondaryColour() : block.getPrimaryColour();
}
@Override
public IIcon getIcon(final int side, final int damage) {
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), damage);
final IIcon icon = (MultipassBlockRenderer.getLayer() > 0) ? block.getSecondaryIcon(this.getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[side]) : block.getPrimaryIcon(this.getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[side]);
return icon;
}
@Override
public void getBlockTooltip(final ItemStack stack, final List par3List) {
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
par3List.add(block.getPrimaryMaterial().getName() + " and " + block.getSecondaryMaterial().getName());
}
else {
par3List.add(block.getPrimaryMaterial().getName());
}
}
public int primaryColor(final int damage) {
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), damage);
return block.getPrimaryColour();
}
public int secondaryColor(final int damage) {
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), damage);
return block.getSecondaryColour();
}
public ItemStack getItemStack(final int plank1, final int plank2, final int design) {
return TileEntityMetadata.getItemStack(this, getMetadata(plank1, plank2, design));
}
public static int getMetadata(final int plank1, final int plank2, final int design) {
return plank1 + (plank2 << 9) + (design << 18);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister register) {
for (final IDesignSystem system : DesignerManager.instance.getDesignSystems()) {
system.registerIcons(register);
}
}
@Override
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), tileMeta);
return block.getItemMetadata(this.getDesignSystem());
}
@Override
public int getNumberOfPasses() {
return 2;
}
static {
RENDER_DIRECTIONS = new ForgeDirection[] { ForgeDirection.DOWN, ForgeDirection.UP, ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.NORTH, ForgeDirection.SOUTH };
}
}
@@ -0,0 +1,67 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import binnie.extratrees.ExtraTrees;
import binnie.Binnie;
import net.minecraft.item.ItemStack;
import binnie.extratrees.api.IDesign;
import net.minecraft.block.Block;
import binnie.botany.Botany;
import net.minecraft.util.Facing;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import forestry.api.core.Tabs;
import net.minecraft.block.material.Material;
public class BlockStainedDesign extends BlockDesign
{
public BlockStainedDesign() {
super(DesignSystem.Glass, Material.glass);
this.setCreativeTab(Tabs.tabArboriculture);
this.setBlockName("stainedGlass");
}
@Override
public int quantityDropped(final Random p_149745_1_) {
return 0;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(final IBlockAccess p_149646_1_, final int p_149646_2_, final int p_149646_3_, final int p_149646_4_, final int p_149646_5_) {
final Block block2 = p_149646_1_.getBlock(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_]);
final Block block3 = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
return block3 != this && block3 != Botany.stained && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
}
@Override
public ItemStack getCreativeStack(final IDesign design) {
return ModuleCarpentry.getItemStack(this, GlassType.get(0), GlassType.get(1), design);
}
@Override
public String getBlockName(final DesignBlock design) {
return Binnie.Language.localise(ExtraTrees.instance, "block.stainedglass.name", design.getDesign().getName());
}
}
@@ -0,0 +1,124 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import java.util.HashMap;
import java.util.LinkedHashMap;
import net.minecraft.item.ItemStack;
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
import binnie.extratrees.api.ILayout;
import binnie.extratrees.api.IPattern;
import binnie.extratrees.api.IDesignCategory;
import binnie.extratrees.api.IDesign;
import binnie.extratrees.api.IDesignMaterial;
import java.util.Map;
import binnie.extratrees.api.ICarpentryInterface;
public class CarpentryInterface implements ICarpentryInterface
{
static Map<Integer, IDesignMaterial> woodMap;
static Map<Integer, IDesign> designMap;
static Map<String, IDesignCategory> designCategories;
@Override
public boolean registerCarpentryWood(final int index, final IDesignMaterial wood) {
return wood != null && CarpentryInterface.woodMap.put(index, wood) == null;
}
@Override
public int getCarpentryWoodIndex(final IDesignMaterial wood) {
for (final Integer integer : CarpentryInterface.woodMap.keySet()) {
if (CarpentryInterface.woodMap.get(integer).equals(wood)) {
return integer;
}
}
return -1;
}
@Override
public IDesignMaterial getWoodMaterial(final int index) {
return CarpentryInterface.woodMap.get(index);
}
@Override
public boolean registerDesign(final int index, final IDesign wood) {
return wood != null && CarpentryInterface.designMap.put(index, wood) == null;
}
@Override
public int getDesignIndex(final IDesign wood) {
for (final Integer integer : CarpentryInterface.designMap.keySet()) {
if (CarpentryInterface.designMap.get(integer).equals(wood)) {
return integer;
}
}
return -1;
}
@Override
public IDesign getDesign(final int index) {
return CarpentryInterface.designMap.get(index);
}
@Override
public ILayout getLayout(final IPattern pattern, final boolean inverted) {
return Layout.get(pattern, inverted);
}
@Override
public boolean registerDesignCategory(final IDesignCategory category) {
return category != null && category.getId() != null && CarpentryInterface.designCategories.put(category.getId(), category) == null;
}
@Override
public IDesignCategory getDesignCategory(final String id) {
return CarpentryInterface.designCategories.get(id);
}
@Override
public Collection<IDesignCategory> getAllDesignCategories() {
final List<IDesignCategory> categories = new ArrayList<IDesignCategory>();
for (final IDesignCategory category : CarpentryInterface.designCategories.values()) {
if (category.getDesigns().size() > 0) {
categories.add(category);
}
}
return categories;
}
@Override
public List<IDesign> getSortedDesigns() {
final List<IDesign> designs = new ArrayList<IDesign>();
for (final IDesignCategory category : this.getAllDesignCategories()) {
designs.addAll(category.getDesigns());
}
return designs;
}
@Override
public IDesignMaterial getWoodMaterial(final ItemStack stack) {
if (stack == null) {
return null;
}
for (final Map.Entry<Integer, IDesignMaterial> entry : CarpentryInterface.woodMap.entrySet()) {
final ItemStack key = entry.getValue().getStack();
if (key == null) {
continue;
}
if (key.isItemEqual(stack)) {
return entry.getValue();
}
}
return null;
}
static {
CarpentryInterface.woodMap = new LinkedHashMap<Integer, IDesignMaterial>();
CarpentryInterface.designMap = new LinkedHashMap<Integer, IDesign>();
CarpentryInterface.designCategories = new HashMap<String, IDesignCategory>();
}
}
@@ -0,0 +1,455 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import binnie.extratrees.api.IToolHammer;
import net.minecraft.world.World;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import binnie.extratrees.api.ILayout;
import binnie.extratrees.api.IDesignSystem;
import net.minecraftforge.common.util.ForgeDirection;
import binnie.extratrees.api.IDesignMaterial;
import binnie.extratrees.api.IDesign;
public class DesignBlock
{
IDesign design;
IDesignMaterial primaryMaterial;
IDesignMaterial secondaryMaterial;
int rotation;
ForgeDirection facing;
boolean panel;
@Override
public String toString() {
return super.toString() + " { design:" + this.design + " }, { primary:" + this.primaryMaterial + " }, { secondary:" + this.secondaryMaterial + " }, { rotation:" + this.rotation + " }, { facing:" + this.facing + " }";
}
public IDesign getDesign() {
return this.design;
}
public IDesignMaterial getPrimaryMaterial() {
return this.primaryMaterial;
}
public IDesignMaterial getSecondaryMaterial() {
return this.secondaryMaterial;
}
DesignBlock(final IDesignSystem system, final IDesignMaterial primaryWood, final IDesignMaterial secondaryWood, final IDesign design, final int rotation, final ForgeDirection dir) {
this.rotation = 0;
this.facing = ForgeDirection.UP;
this.panel = false;
this.design = design;
this.primaryMaterial = primaryWood;
this.secondaryMaterial = secondaryWood;
this.rotation = rotation;
this.facing = dir;
if (design == null) {
this.design = EnumDesign.Blank;
}
if (primaryWood == null) {
this.primaryMaterial = system.getDefaultMaterial();
}
if (secondaryWood == null) {
this.secondaryMaterial = system.getDefaultMaterial();
}
if (this.rotation > 3 || this.rotation < 0) {
this.rotation = 0;
}
if (this.facing == null || this.facing == ForgeDirection.UNKNOWN) {
this.facing = ForgeDirection.UP;
}
}
public int getPrimaryColour() {
return this.getPrimaryMaterial().getColour();
}
public int getSecondaryColour() {
return this.getSecondaryMaterial().getColour();
}
ForgeDirection getRotation(final ForgeDirection dir, final ModuleCarpentry.Axis axis) {
if (axis == ModuleCarpentry.Axis.Y) {
switch (dir) {
case EAST: {
return ForgeDirection.NORTH;
}
case NORTH: {
return ForgeDirection.WEST;
}
case SOUTH: {
return ForgeDirection.EAST;
}
case WEST: {
return ForgeDirection.SOUTH;
}
default: {
return dir;
}
}
}
else if (axis == ModuleCarpentry.Axis.X) {
switch (dir) {
case EAST: {
return ForgeDirection.UP;
}
case UP: {
return ForgeDirection.WEST;
}
case WEST: {
return ForgeDirection.DOWN;
}
case DOWN: {
return ForgeDirection.EAST;
}
default: {
return dir;
}
}
}
else {
switch (dir) {
case SOUTH: {
return ForgeDirection.UP;
}
case UP: {
return ForgeDirection.NORTH;
}
case NORTH: {
return ForgeDirection.DOWN;
}
case DOWN: {
return ForgeDirection.SOUTH;
}
default: {
return dir;
}
}
}
}
public ILayout getLayout(ForgeDirection dir) {
ForgeDirection adjustedDir;
dir = (adjustedDir = dir.getRotation(ForgeDirection.DOWN));
switch (this.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 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 WEST: {
adjustedDir = adjustedDir.getRotation(ForgeDirection.EAST);
adjustedDir = adjustedDir.getRotation(ForgeDirection.SOUTH);
break;
}
}
for (int i = 0; i < this.rotation; ++i) {
adjustedDir = adjustedDir.getRotation(ForgeDirection.DOWN);
}
ILayout layout = null;
switch (adjustedDir) {
case EAST: {
layout = this.getDesign().getEastPattern();
break;
}
case NORTH: {
layout = this.getDesign().getNorthPattern();
break;
}
case SOUTH: {
layout = this.getDesign().getSouthPattern();
break;
}
case WEST: {
layout = this.getDesign().getWestPattern();
break;
}
case DOWN: {
layout = this.getDesign().getBottomPattern();
break;
}
default: {
layout = this.getDesign().getTopPattern();
break;
}
}
Label_1107: {
switch (this.getFacing()) {
case UP: {
if (dir == ForgeDirection.DOWN || dir == ForgeDirection.UP) {
for (int j = 0; j < this.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 < this.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 < this.rotation; ++j) {
layout = layout.rotateRight();
}
}
if (dir == ForgeDirection.WEST) {
for (int j = 0; j < this.rotation; ++j) {
layout = layout.rotateLeft();
}
break;
}
break;
}
case WEST: {
switch (dir) {
case NORTH: {
layout = layout.rotateRight();
break;
}
case SOUTH:
case UP: {
layout = layout.rotateLeft();
break;
}
case DOWN: {
layout = layout.rotateLeft().flipVertical();
break;
}
case EAST: {
layout = layout.flipHorizontal();
for (int j = 0; j < this.rotation; ++j) {
layout = layout.rotateLeft();
}
break;
}
case WEST: {
for (int j = 0; j < this.rotation; ++j) {
layout = layout.rotateRight();
}
break;
}
}
break;
}
case NORTH: {
switch (dir) {
case WEST: {
layout = layout.rotateLeft();
break Label_1107;
}
case EAST: {
layout = layout.rotateRight();
break Label_1107;
}
case DOWN: {
layout = layout.flipHorizontal();
break Label_1107;
}
case SOUTH: {
layout = layout.flipHorizontal();
for (int j = 0; j < this.rotation; ++j) {
layout = layout.rotateLeft();
}
break Label_1107;
}
case NORTH: {
for (int j = 0; j < this.rotation; ++j) {
layout = layout.rotateRight();
}
break Label_1107;
}
default: {
break Label_1107;
}
}
}
case SOUTH: {
switch (dir) {
case EAST: {
layout = layout.rotateLeft();
break Label_1107;
}
case WEST: {
layout = layout.rotateRight();
break Label_1107;
}
case UP: {
layout = layout.rotateRight().rotateRight();
break Label_1107;
}
case DOWN: {
layout = layout.flipVertical();
break Label_1107;
}
case NORTH: {
layout = layout.flipHorizontal();
for (int j = 0; j < this.rotation; ++j) {
layout = layout.rotateLeft();
}
break Label_1107;
}
case SOUTH: {
for (int j = 0; j < this.rotation; ++j) {
layout = layout.rotateRight();
}
break Label_1107;
}
default: {
break Label_1107;
}
}
}
}
}
return layout;
}
public IIcon getPrimaryIcon(final IDesignSystem system, final ForgeDirection dir) {
final ILayout l = this.getLayout(dir);
return (l == null) ? null : l.getPrimaryIcon(system);
}
public IIcon getSecondaryIcon(final IDesignSystem system, final ForgeDirection dir) {
final ILayout l = this.getLayout(dir);
return (l == null) ? null : l.getSecondaryIcon(system);
}
public IIcon getIcon(final IDesignSystem system, final boolean secondary, final ForgeDirection dir) {
return secondary ? this.getSecondaryIcon(system, dir) : this.getPrimaryIcon(system, dir);
}
public ForgeDirection getFacing() {
return this.facing;
}
public int getRotation() {
return this.rotation;
}
public void rotate(final int face, final ItemStack hammer, final EntityPlayer player, final World world, final int x, final int y, final int z) {
final ForgeDirection dir = ForgeDirection.getOrientation(face);
final IToolHammer hammerI = (IToolHammer) hammer.getItem();
if (player.isSneaking()) {
if (this.panel) {
ForgeDirection newFacing = this.getFacing();
do {
newFacing = ForgeDirection.getOrientation(newFacing.ordinal() + 1);
if (newFacing == ForgeDirection.UNKNOWN) {
newFacing = ForgeDirection.DOWN;
}
} while (newFacing != this.getFacing() && !BlockCarpentryPanel.isValidPanelPlacement(world, x, y, z, newFacing));
if (newFacing != this.getFacing()) {
hammerI.onHammerUsed(hammer, player);
}
this.setFacing(newFacing);
}
else {
if (dir != this.getFacing()) {
hammerI.onHammerUsed(hammer, player);
}
this.setFacing(dir);
}
}
else {
++this.rotation;
hammerI.onHammerUsed(hammer, player);
}
if (this.rotation > 3) {
this.rotation = 0;
}
if (this.rotation < 0) {
this.rotation = 3;
}
}
public void setFacing(final ForgeDirection facing) {
this.facing = facing;
}
public int getBlockMetadata(final IDesignSystem system) {
return ModuleCarpentry.getBlockMetadata(system, this);
}
public int getItemMetadata(final IDesignSystem system) {
return ModuleCarpentry.getItemMetadata(system, this);
}
public void setPanel() {
this.panel = true;
}
public String getString() {
String type = "";
if (this.getPrimaryMaterial() != this.getSecondaryMaterial()) {
type = this.getPrimaryMaterial().getName() + " and " + this.getSecondaryMaterial().getName();
}
else {
type = this.getPrimaryMaterial().getName();
}
return super.toString() + " " + "{" + type + " " + this.getDesign().getName() + " " + (this.panel ? "Panel" : "Tile") + ", Facing:" + this.getFacing().toString() + ", Rotation:" + this.getRotation() + "}";
}
}
@@ -0,0 +1,167 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import binnie.extratrees.ExtraTrees;
import binnie.core.AbstractMod;
import binnie.core.BinnieCore;
import net.minecraft.client.renderer.texture.IIconRegister;
import binnie.extratrees.api.IPattern;
import binnie.extratrees.item.ExtraTreeItems;
import net.minecraft.item.ItemStack;
import binnie.extratrees.api.CarpentryManager;
import binnie.extratrees.block.PlankType;
import binnie.extratrees.api.IDesignMaterial;
import java.util.HashMap;
import net.minecraft.util.IIcon;
import java.util.Map;
import binnie.extratrees.api.IDesignSystem;
public enum DesignSystem implements IDesignSystem
{
Wood,
Glass;
Map<Integer, IIcon> primary;
Map<Integer, IIcon> secondary;
private DesignSystem() {
this.primary = new HashMap<Integer, IIcon>();
this.secondary = new HashMap<Integer, IIcon>();
DesignerManager.instance.registerDesignSystem(this);
}
@Override
public IDesignMaterial getDefaultMaterial() {
switch (this) {
case Glass: {
return GlassType.get(0);
}
case Wood: {
return PlankType.ExtraTreePlanks.Fir;
}
default: {
return null;
}
}
}
@Override
public IDesignMaterial getDefaultMaterial2() {
switch (this) {
case Glass: {
return GlassType.get(1);
}
case Wood: {
return PlankType.ExtraTreePlanks.Whitebeam;
}
default: {
return null;
}
}
}
@Override
public IDesignMaterial getMaterial(final int id) {
switch (this) {
case Glass: {
return GlassType.get(id);
}
case Wood: {
return CarpentryManager.carpentryInterface.getWoodMaterial(id);
}
default: {
return null;
}
}
}
@Override
public int getMaterialIndex(final IDesignMaterial id) {
switch (this) {
case Glass: {
return GlassType.getIndex(id);
}
case Wood: {
return CarpentryManager.carpentryInterface.getCarpentryWoodIndex(id);
}
default: {
return 0;
}
}
}
public String getTexturePath() {
switch (this) {
case Glass: {
return "glass";
}
case Wood: {
return "patterns";
}
default: {
return "";
}
}
}
@Override
public IDesignMaterial getMaterial(final ItemStack stack) {
switch (this) {
case Glass: {
return GlassType.get(stack);
}
case Wood: {
return CarpentryManager.carpentryInterface.getWoodMaterial(stack);
}
default: {
return null;
}
}
}
@Override
public ItemStack getAdhesive() {
switch (this) {
case Glass: {
return ExtraTreeItems.GlassFitting.get(1);
}
case Wood: {
return ExtraTreeItems.WoodWax.get(1);
}
default: {
return null;
}
}
}
@Override
public IIcon getPrimaryIcon(final IPattern pattern) {
if (pattern instanceof EnumPattern) {
return this.primary.get(((EnumPattern) pattern).ordinal());
}
return null;
}
@Override
public IIcon getSecondaryIcon(final IPattern pattern) {
if (pattern instanceof EnumPattern) {
return this.secondary.get(((EnumPattern) pattern).ordinal());
}
return null;
}
@Override
public void registerIcons(final IIconRegister register) {
for (final EnumPattern pattern : EnumPattern.values()) {
this.primary.put(pattern.ordinal(), BinnieCore.proxy.getIcon(register, this.getMod().getModID(), this.getTexturePath() + "/" + pattern.toString().toLowerCase() + ".0"));
this.secondary.put(pattern.ordinal(), BinnieCore.proxy.getIcon(register, this.getMod().getModID(), this.getTexturePath() + "/" + pattern.toString().toLowerCase() + ".1"));
}
}
public AbstractMod getMod() {
return ExtraTrees.instance;
}
}
@@ -0,0 +1,36 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import java.util.Collection;
import java.util.ArrayList;
import binnie.extratrees.api.IDesignSystem;
import java.util.List;
public class DesignerManager
{
public static DesignerManager instance;
List<IDesignSystem> systems;
public DesignerManager() {
this.systems = new ArrayList<IDesignSystem>();
}
public void registerDesignSystem(final IDesignSystem system) {
this.systems.add(system);
}
public Collection<IDesignSystem> getDesignSystems() {
return this.systems;
}
public void addDesignSystem(final DesignSystem system) {
this.systems.add(system);
}
static {
DesignerManager.instance = new DesignerManager();
}
}
@@ -0,0 +1,521 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import binnie.extratrees.api.CarpentryManager;
import java.util.ArrayList;
import java.util.List;
import binnie.extratrees.api.IDesignCategory;
import binnie.extratrees.api.ILayout;
import binnie.extratrees.api.IDesign;
public enum EnumDesign implements IDesign
{
Blank("Blank"),
Octagon("Octagon"),
Diamond("Diamond"),
Ringed("Ringed"),
Squared("Squared"),
Multiply("Multiply"),
Halved("Halved"),
Striped("Striped"),
ThinStriped("Thin Striped"),
Chequered("Full Chequered"),
Tiled("Full Tiled"),
ChequeredB("Chequered"),
TiledB("Tiled"),
VeryThinCorner("Very Thin Cornered"),
ThinCorner("Thin Cornered"),
Corner("Cornered"),
ThickCorner("Thick Cornered"),
Edged("Edged"),
ThinEdged("Thin Edged"),
ThinBarred("Thin Barred"),
Barred("Barred"),
ThickBarred("Thick Barred"),
Diagonal("Diagonal"),
ThickDiagonal("Thick Diagonal"),
ThinSaltire("Thin Saltire"),
Saltire("Saltire"),
ThickSaltire("Thick Saltire"),
ThinCrossed("Thin Crossed"),
Crossed("Crossed"),
ThickCrossed("Thick Crossed"),
ThinTSection("Thin T Section"),
TSection("T Section"),
ThickTSection("Thick T Section"),
ThinBarredCorner("Thin Barred Corner"),
BarredCorner("Barred Corner"),
ThickBarredCorner("Thick Barred Corner"),
ThinStripedCorner("Thin Striped Corner"),
StripedCorner("Striped Corner"),
Emblem1("Emblem 1"),
Emblem2("Emblem 2"),
Emblem3("Emblem 3"),
Emblem4("Emblem 4"),
Emblem5("Emblem 5"),
LetterA("Letter A"),
LetterB("Letter B"),
LetterC("Letter C"),
LetterD("Letter D"),
LetterE("Letter E"),
LetterF("Letter F"),
LetterG("Letter G"),
LetterH("Letter H"),
LetterI("Letter I"),
LetterJ("Letter J"),
LetterK("Letter K"),
LetterL("Letter L"),
LetterM("Letter M"),
LetterN("Letter N"),
LetterO("Letter O"),
LetterP("Letter P"),
LetterQ("Letter Q"),
LetterR("Letter R"),
LetterS("Letter S"),
LetterT("Letter T"),
LetterU("Letter U"),
LetterV("Letter V"),
LetterW("Letter W"),
LetterX("Letter X"),
LetterY("Letter Y"),
LetterZ("Letter Z"),
ThinCurvedCrossed("Thin Curved Crossed"),
ThinCurvedBarredCorner("Thin Curved Barred Corner"),
CurvedBarredCorner("Curved Barred Corner"),
ThinCurvedCorner("Thin Curved Corner"),
CurvedCorner("Curved Corner"),
ThinCurvedTSection("Thin Curved T Section"),
CurvedTSection("Curved T Section"),
BarredEnd("Barred End"),
DiagonalCorner("Diagonal Corner"),
DiagonalTSection("Diagonal T Section"),
DiagonalCurvedCorner("Diagonal Curved Corner"),
DiagonalCurvedTSection("Diagonal Curved T Section"),
OrnateBarred("Ornate Barred"),
SplitBarred("Split Barred"),
SplitBarredCorner("Split Barred Corner"),
SplitBarredTSection("Split Barred T Section"),
SplitCrossed("Split Crossed"),
SplitBarredEnd("Split Barred End"),
OrnateThinBarred("Ornate Thin Barred"),
Circle("Circle"),
Plus("Plus"),
Creeper("Creeper"),
OrnateStripedCorner("Ornate Striped Corner"),
Test("Testing Block"),
DiagonalHalved("Diagonal Halved"),
Diagonal1Edged("Cornered Diagonal"),
Diagonal2Edged("Opposite Cornered Diagonal"),
ThickDiagonal1Edged("Thick Cornered Diagonal"),
ThinBarredEnd("Thin Barred End"),
ThickBarredEnd("Thick Barred End"),
OverlappedBarred("Overlapped Barred"),
OverlappedSplitBarred("Overlapped Split Barred");
String name;
ILayout topPattern;
ILayout bottomPattern;
ILayout northPattern;
ILayout southPattern;
ILayout eastPattern;
ILayout westPattern;
void setEdgePatterns(final ILayout north, final ILayout east, final ILayout south, final ILayout west) {
this.setNorthPattern(north);
this.setEastPattern(east);
this.setSouthPattern(south);
this.setWestPattern(west);
}
void setEdgePatterns(final ILayout face) {
this.setEdgePatterns(face, face, face, face);
}
void setupStriped(final ILayout vert) {
this.setTopPattern(vert);
this.setEdgePatterns(vert.invert(), EnumPattern.Blank.layout(true), vert, EnumPattern.Blank.layout());
}
void setChequered(final ILayout cheq) {
this.setAllPatterns(cheq);
this.setNorthPattern(cheq.invert());
this.setSouthPattern(cheq.invert());
this.setBottomPattern(cheq.invert());
}
void setStripedChequered(final ILayout cheq, final ILayout stripe) {
this.setAllPatterns(cheq);
this.setNorthPattern(stripe.invert());
this.setSouthPattern(stripe.invert());
this.setEastPattern(stripe);
this.setWestPattern(stripe);
}
void setCornered(final ILayout corner, final ILayout edge) {
this.setTopPattern(corner);
this.setNorthPattern(EnumPattern.Blank.layout());
this.setEastPattern(edge.flipHorizontal());
this.setSouthPattern(edge);
this.setWestPattern(EnumPattern.Blank.layout());
}
void setEdged(final ILayout edge) {
this.setAllPatterns(edge);
this.setWestPattern(EnumPattern.Blank.layout());
this.setEastPattern(EnumPattern.Blank.layout(true));
this.northPattern = this.northPattern.flipHorizontal();
}
void setBarred(final ILayout bar) {
this.setAllPatterns(bar);
this.setEastPattern(EnumPattern.Blank.layout(true));
this.setWestPattern(EnumPattern.Blank.layout(true));
}
void setDiagonal(final ILayout diagonal, final ILayout edged) {
this.setAllPatterns(edged);
this.setTopPattern(diagonal);
this.northPattern = this.northPattern.flipHorizontal();
this.southPattern = this.southPattern.flipHorizontal();
}
void setSaltire(final ILayout saltire, final ILayout bar) {
this.setTopPattern(saltire);
this.setEdgePatterns(bar.invert());
}
void setCross(final ILayout saltire, final ILayout bar) {
this.setTopPattern(saltire);
this.setEdgePatterns(bar);
}
void setTSection(final ILayout tsection, final ILayout bar) {
this.setTopPattern(tsection);
this.setEdgePatterns(bar);
this.setWestPattern(EnumPattern.Blank.layout(true));
}
void setBarredCorner(final ILayout corner, final ILayout bar) {
this.setTSection(corner, bar);
this.setNorthPattern(EnumPattern.Blank.layout(true));
}
void setStripedCorner(final ILayout corner, final ILayout striped) {
this.setCornered(corner, striped);
}
void setLetterPattern(final ILayout letter) {
this.setAllPatterns(EnumPattern.Blank.layout(true));
this.setTopPattern(letter);
this.setBottomPattern(EnumPattern.Blank.layout(true));
}
void setBarredEndPattern(final ILayout end, final ILayout bar) {
this.setAllPatterns(EnumPattern.Blank.layout(true));
this.setTopPattern(end);
this.setWestPattern(bar);
}
void setDiagonalCorner(final ILayout diagonal, final ILayout bar, final ILayout edged) {
this.setAllPatterns(EnumPattern.Blank.layout(true));
this.setTopPattern(diagonal);
this.setWestPattern(bar.invert());
this.setNorthPattern(edged.flipHorizontal());
this.setSouthPattern(edged);
}
void setDiagonalTSection(final ILayout diagonal, final ILayout bar, final ILayout edged) {
this.setAllPatterns(EnumPattern.Blank.layout(true));
this.setTopPattern(diagonal);
this.setWestPattern(bar.invert());
this.setNorthPattern(bar.invert());
this.setEastPattern(edged.flipHorizontal());
this.setSouthPattern(edged);
}
private EnumDesign(final String name) {
this.topPattern = Layout.get(EnumPattern.Blank, false);
this.bottomPattern = Layout.get(EnumPattern.Blank, false);
this.northPattern = Layout.get(EnumPattern.Blank, false);
this.eastPattern = Layout.get(EnumPattern.Blank, false);
this.southPattern = Layout.get(EnumPattern.Blank, false);
this.westPattern = Layout.get(EnumPattern.Blank, false);
this.name = name;
}
private void setAllPatterns(final ILayout layout) {
this.setTopPattern(layout);
this.setBottomPattern(layout);
this.setNorthPattern(layout);
this.setEastPattern(layout);
this.setSouthPattern(layout);
this.setWestPattern(layout);
}
@Override
public String getName() {
return this.name;
}
@Override
public ILayout getTopPattern() {
return this.topPattern;
}
public void setTopPattern(final ILayout layout) {
this.setBottomPattern(this.topPattern = layout);
}
@Override
public ILayout getBottomPattern() {
return this.bottomPattern;
}
public void setBottomPattern(final ILayout layout) {
this.bottomPattern = layout;
}
@Override
public ILayout getNorthPattern() {
return this.northPattern;
}
public void setNorthPattern(final ILayout layout) {
this.northPattern = layout;
}
@Override
public ILayout getSouthPattern() {
return this.southPattern;
}
public void setSouthPattern(final ILayout layout) {
this.southPattern = layout;
}
@Override
public ILayout getEastPattern() {
return this.eastPattern;
}
public void setEastPattern(final ILayout layout) {
this.eastPattern = layout;
}
@Override
public ILayout getWestPattern() {
return this.westPattern;
}
public void setWestPattern(final ILayout layout) {
this.westPattern = layout;
}
public void setName(final String name) {
this.name = name;
}
static {
Category.Design.addDesign(EnumDesign.Blank);
Category.Design.addDesign(EnumDesign.Octagon);
Category.Design.addDesign(EnumDesign.Diamond);
Category.Design.addDesign(EnumDesign.Ringed);
Category.Design.addDesign(EnumDesign.Squared);
Category.Design.addDesign(EnumDesign.Multiply);
Category.Design.addDesign(EnumDesign.Plus);
Category.Design.addDesign(EnumDesign.Circle);
Category.Design.addDesign(EnumDesign.Emblem1);
Category.Design.addDesign(EnumDesign.Emblem2);
Category.Design.addDesign(EnumDesign.Emblem3);
Category.Design.addDesign(EnumDesign.Emblem4);
Category.Design.addDesign(EnumDesign.Emblem5);
Category.Design.addDesign(EnumDesign.Creeper);
Category.Stripes.addDesign(EnumDesign.Chequered);
Category.Stripes.addDesign(EnumDesign.ChequeredB);
Category.Stripes.addDesign(EnumDesign.Tiled);
Category.Stripes.addDesign(EnumDesign.TiledB);
Category.Stripes.addDesign(EnumDesign.Striped);
Category.Stripes.addDesign(EnumDesign.ThinStriped);
Category.Stripes.addDesign(EnumDesign.ThinStripedCorner);
Category.Stripes.addDesign(EnumDesign.StripedCorner);
Category.Stripes.addDesign(EnumDesign.OrnateStripedCorner);
Category.Edges.addDesign(EnumDesign.Halved);
Category.Edges.addDesign(EnumDesign.Corner);
Category.Edges.addDesign(EnumDesign.ThickCorner);
Category.Edges.addDesign(EnumDesign.Edged);
Category.Edges.addDesign(EnumDesign.ThinCorner);
Category.Edges.addDesign(EnumDesign.ThinEdged);
Category.Edges.addDesign(EnumDesign.VeryThinCorner);
Category.Edges.addDesign(EnumDesign.ThinCurvedCorner);
Category.Edges.addDesign(EnumDesign.CurvedCorner);
Category.Barred.addDesign(EnumDesign.ThinBarred);
Category.Barred.addDesign(EnumDesign.ThinBarredCorner);
Category.Barred.addDesign(EnumDesign.ThinTSection);
Category.Barred.addDesign(EnumDesign.ThinCrossed);
Category.Barred.addDesign(EnumDesign.ThinBarredEnd);
Category.Barred.addDesign(EnumDesign.OrnateThinBarred);
Category.Barred.addDesign(EnumDesign.Barred);
Category.Barred.addDesign(EnumDesign.BarredCorner);
Category.Barred.addDesign(EnumDesign.TSection);
Category.Barred.addDesign(EnumDesign.Crossed);
Category.Barred.addDesign(EnumDesign.BarredEnd);
Category.Barred.addDesign(EnumDesign.OverlappedBarred);
Category.Barred.addDesign(EnumDesign.OrnateBarred);
Category.Barred.addDesign(EnumDesign.ThickBarred);
Category.Barred.addDesign(EnumDesign.ThickBarredCorner);
Category.Barred.addDesign(EnumDesign.ThickTSection);
Category.Barred.addDesign(EnumDesign.ThickCrossed);
Category.Barred.addDesign(EnumDesign.ThickBarredEnd);
Category.Barred.addDesign(EnumDesign.ThinCurvedBarredCorner);
Category.Barred.addDesign(EnumDesign.CurvedBarredCorner);
Category.Barred.addDesign(EnumDesign.ThinCurvedTSection);
Category.Barred.addDesign(EnumDesign.CurvedTSection);
Category.Barred.addDesign(EnumDesign.ThinCurvedCrossed);
Category.Barred.addDesign(EnumDesign.SplitBarred);
Category.Barred.addDesign(EnumDesign.SplitBarredCorner);
Category.Barred.addDesign(EnumDesign.SplitBarredTSection);
Category.Barred.addDesign(EnumDesign.SplitCrossed);
Category.Barred.addDesign(EnumDesign.SplitBarredEnd);
Category.Barred.addDesign(EnumDesign.OverlappedSplitBarred);
Category.Diagonal.addDesign(EnumDesign.ThinSaltire);
Category.Diagonal.addDesign(EnumDesign.Diagonal);
Category.Diagonal.addDesign(EnumDesign.DiagonalCorner);
Category.Diagonal.addDesign(EnumDesign.DiagonalTSection);
Category.Diagonal.addDesign(EnumDesign.DiagonalCurvedCorner);
Category.Diagonal.addDesign(EnumDesign.DiagonalCurvedTSection);
Category.Diagonal.addDesign(EnumDesign.Saltire);
Category.Diagonal.addDesign(EnumDesign.ThickDiagonal);
Category.Diagonal.addDesign(EnumDesign.ThickSaltire);
Category.Diagonal.addDesign(EnumDesign.DiagonalHalved);
Category.Diagonal.addDesign(EnumDesign.Diagonal1Edged);
Category.Diagonal.addDesign(EnumDesign.Diagonal2Edged);
Category.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());
}
enum Category implements IDesignCategory
{
Design("Designs & Emblems"),
Stripes("Squares & Stripes"),
Edges("Edges"),
Barred("Bars"),
Letters("Letters"),
Diagonal("Diagonals");
String name;
List<IDesign> designs;
private Category(final String name) {
this.designs = new ArrayList<IDesign>();
this.name = name;
CarpentryManager.carpentryInterface.registerDesignCategory(this);
}
@Override
public String getName() {
return this.name;
}
@Override
public List<IDesign> getDesigns() {
return this.designs;
}
@Override
public void addDesign(final IDesign design) {
this.designs.add(design);
}
@Override
public String getId() {
return this.toString().toLowerCase();
}
}
}
@@ -0,0 +1,407 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import binnie.extratrees.api.IDesignSystem;
import binnie.extratrees.api.ILayout;
import binnie.extratrees.api.IPattern;
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;
ILayout leftRotation;
ILayout horizontalFlip;
private EnumPattern() {
this.leftRotation = Layout.get(this, false);
this.horizontalFlip = Layout.get(this, false);
}
static void setupStripedPattern(final EnumPattern vert, final EnumPattern hori) {
vert.setLeftRotation(hori, true);
hori.setLeftRotation(vert, false);
vert.setHorizontalFlip(vert, true);
}
static void setupChequeredPattern(final EnumPattern cheq) {
cheq.setLeftRotation(cheq, true);
cheq.setHorizontalFlip(cheq, true);
}
static void setupCornerPattern(final EnumPattern tl, final EnumPattern tr, final EnumPattern br, final 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(final EnumPattern a, final EnumPattern b) {
a.setLeftRotation(b, true);
b.setLeftRotation(a, false);
a.setHorizontalFlip(b, false);
}
static void set2Rotation(final EnumPattern a, final EnumPattern b) {
a.setLeftRotation(b, false);
b.setLeftRotation(a, false);
a.setHorizontalFlip(b, false);
}
static void setupBarredPattern(final EnumPattern vert, final EnumPattern hori) {
vert.setLeftRotation(hori, false);
hori.setLeftRotation(vert, false);
}
static void setupEdgedPattern(final EnumPattern l, final EnumPattern t, final EnumPattern r, final 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(final EnumPattern a, final EnumPattern b) {
a.setLeftRotation(b, false);
b.setLeftRotation(a, false);
a.setHorizontalFlip(b, false);
}
static void setupBarredPattern(final EnumPattern l, final EnumPattern t, final EnumPattern r, final 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(final EnumPattern l, final EnumPattern t, final EnumPattern r, final EnumPattern b) {
setupEdgedPattern(l, t, r, b);
}
@Override
public IIcon getPrimaryIcon(final IDesignSystem system) {
return system.getPrimaryIcon(this);
}
private static void setupRotation(final EnumPattern t, final EnumPattern r, final EnumPattern b, final EnumPattern l) {
setupEdgedPattern(l, t, r, b);
}
private void setHorizontalFlip(final EnumPattern pattern, final boolean inverted) {
this.horizontalFlip = Layout.get(pattern, inverted);
pattern.horizontalFlip = Layout.get(this, inverted);
}
@Override
public IIcon getSecondaryIcon(final IDesignSystem system) {
return system.getSecondaryIcon(this);
}
@Override
public ILayout getRotation() {
return this.leftRotation;
}
@Override
public ILayout getHorizontalFlip() {
return this.horizontalFlip;
}
protected void setLeftRotation(final EnumPattern pattern, final boolean inverted) {
this.leftRotation = Layout.get(pattern, inverted);
}
@Override
public void registerIcons(final IIconRegister register) {
}
public ILayout layout() {
return this.layout(false);
}
public ILayout layout(final boolean invert) {
return Layout.get(this, invert);
}
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);
}
}
@@ -0,0 +1,110 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import binnie.botany.genetics.EnumFlowerColor;
import java.util.LinkedHashMap;
import binnie.core.block.TileEntityMetadata;
import binnie.botany.Botany;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import java.util.Map;
import binnie.extratrees.api.IDesignMaterial;
public class GlassType implements IDesignMaterial
{
static Map<Integer, GlassType> types;
String name;
int colour;
int id;
private GlassType(final int id, final String name, final int colour) {
this.id = id;
this.name = name;
this.colour = colour;
}
@Override
public ItemStack getStack() {
if (this.id < 128) {
return new ItemStack(Blocks.stained_glass, 1, this.id);
}
return TileEntityMetadata.getItemStack(Botany.stained, this.id - 128);
}
@Override
public String getName() {
return this.name;
}
@Override
public int getColour() {
return this.colour;
}
public static int getIndex(final IDesignMaterial id) {
for (final Map.Entry<Integer, GlassType> entry : GlassType.types.entrySet()) {
if (entry.getValue() == id) {
return entry.getKey();
}
}
return 0;
}
public static IDesignMaterial get(final int id) {
return GlassType.types.get(id);
}
public static IDesignMaterial get(final ItemStack stack) {
if (stack == null) {
return null;
}
for (final Map.Entry<Integer, GlassType> entry : GlassType.types.entrySet()) {
if (stack.isItemEqual(entry.getValue().getStack())) {
return entry.getValue();
}
}
return null;
}
static {
GlassType.types = new LinkedHashMap<Integer, GlassType>();
for (final StandardColor c : StandardColor.values()) {
GlassType.types.put(c.ordinal(), new GlassType(c.ordinal(), c.name, c.colour));
}
for (final EnumFlowerColor c2 : EnumFlowerColor.values()) {
GlassType.types.put(128 + c2.ordinal(), new GlassType(128 + c2.ordinal(), c2.getName(), c2.getColor(false)));
}
}
private enum StandardColor
{
White("White", 16777215),
Orange("Orange", 14188339),
Magenta("Magenta", 11685080),
LightBlue("Light Blue", 6724056),
Yellow("Yellow", 15066419),
Lime("Lime", 8375321),
Pink("Pink", 15892389),
Gray("Gray", 5000268),
LightGray("Light Gray", 10066329),
Cyan("Cyan", 5013401),
Purple("Purple", 8339378),
Blue("Blue", 3361970),
Brown("Brown", 6704179),
Green("Green", 6717235),
Red("Red", 10040115),
Black("Black", 1644825);
String name;
int colour;
private StandardColor(final String name, final int colour) {
this.name = name;
this.colour = colour;
}
}
}
@@ -0,0 +1,82 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import net.minecraft.util.IIcon;
import binnie.extratrees.api.IDesignSystem;
import binnie.extratrees.api.IPattern;
import binnie.extratrees.api.ILayout;
public class Layout implements ILayout
{
IPattern pattern;
boolean inverted;
@Override
public IPattern getPattern() {
return this.pattern;
}
@Override
public boolean isInverted() {
return this.inverted;
}
private Layout(final IPattern pattern, final boolean inverted) {
this.pattern = pattern;
this.inverted = inverted;
}
private Layout(final IPattern pattern) {
this(pattern, false);
}
ILayout newLayout(final ILayout newLayout) {
return new Layout(newLayout.getPattern(), this.inverted ^ newLayout.isInverted());
}
@Override
public ILayout rotateRight() {
return this.rotateLeft().rotateLeft().rotateLeft();
}
@Override
public ILayout rotateLeft() {
return this.newLayout(this.pattern.getRotation());
}
@Override
public ILayout flipHorizontal() {
return this.newLayout(this.pattern.getHorizontalFlip());
}
@Override
public ILayout flipVertical() {
return this.newLayout(this.pattern.getHorizontalFlip().rotateLeft().rotateLeft());
}
@Override
public IIcon getPrimaryIcon(final IDesignSystem system) {
return this.inverted ? this.pattern.getSecondaryIcon(system) : this.pattern.getPrimaryIcon(system);
}
@Override
public IIcon getSecondaryIcon(final IDesignSystem system) {
return this.inverted ? this.pattern.getPrimaryIcon(system) : this.pattern.getSecondaryIcon(system);
}
@Override
public ILayout invert() {
return new Layout(this.pattern, !this.inverted);
}
public static ILayout get(final IPattern pattern, final boolean inverted) {
return new Layout(pattern, inverted);
}
public static ILayout get(final IPattern pattern) {
return new Layout(pattern, false);
}
}
@@ -0,0 +1,112 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.carpentry;
import binnie.extratrees.api.IDesignSystem;
import binnie.core.block.TileEntityMetadata;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.item.ItemStack;
import binnie.extratrees.api.IDesignMaterial;
import binnie.extratrees.api.IDesign;
import binnie.extratrees.api.CarpentryManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.client.IItemRenderer;
import binnie.core.block.MultipassItemRenderer;
import net.minecraft.item.Item;
import binnie.core.BinnieCore;
import net.minecraft.block.Block;
import cpw.mods.fml.common.registry.GameRegistry;
import binnie.core.block.ItemMetadata;
import binnie.extratrees.ExtraTrees;
import binnie.core.IInitializable;
public class ModuleCarpentry implements IInitializable
{
@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() {
}
@Override
public void postInit() {
for (final EnumDesign design : EnumDesign.values()) {
CarpentryManager.carpentryInterface.registerDesign(design.ordinal(), design);
}
}
public static ItemStack getItemStack(final BlockDesign block, final IDesignMaterial type1, final IDesignMaterial type2, final IDesign design) {
return getItemStack(block, block.getDesignSystem().getMaterialIndex(type1), block.getDesignSystem().getMaterialIndex(type2), CarpentryManager.carpentryInterface.getDesignIndex(design));
}
public static ItemStack getItemStack(final BlockDesign block, final int type1, final int type2, final int design) {
return TileEntityMetadata.getItemStack(block, getMetadata(type1, type2, design, 0, ForgeDirection.UP.ordinal()));
}
public static ItemStack getItemStack(final BlockDesign blockC, final DesignBlock block) {
return getItemStack(blockC, block.getPrimaryMaterial(), block.getSecondaryMaterial(), block.getDesign());
}
public static int getMetadata(final int plank1, final int plank2, final int design, final int rotation, final int facing) {
return plank1 + (plank2 << 8) + (design << 16) + (rotation << 26) + (facing << 28);
}
public static DesignBlock getDesignBlock(final IDesignSystem system, final int meta) {
final int plankID1 = meta & 0xFF;
final int plankID2 = meta >> 8 & 0xFF;
final int tile = meta >> 16 & 0x3FF;
final int rotation = meta >> 26 & 0x3;
final int axis = meta >> 28 & 0x7;
final IDesignMaterial type1 = system.getMaterial(plankID1);
final IDesignMaterial type2 = system.getMaterial(plankID2);
final IDesign type3 = CarpentryManager.carpentryInterface.getDesign(tile);
return new DesignBlock(system, type1, type2, type3, rotation, ForgeDirection.getOrientation(axis));
}
public static DesignBlock getCarpentryPanel(final IDesignSystem system, final int meta) {
final DesignBlock block = getDesignBlock(system, meta);
block.setPanel();
return block;
}
public static int getBlockMetadata(final IDesignSystem system, final DesignBlock block) {
final int plank1 = system.getMaterialIndex(block.getPrimaryMaterial());
final int plank2 = system.getMaterialIndex(block.getSecondaryMaterial());
final int design = CarpentryManager.carpentryInterface.getDesignIndex(block.getDesign());
final int rotation = block.getRotation();
final int facing = block.getFacing().ordinal();
return getMetadata(plank1, plank2, design, rotation, facing);
}
public static int getItemMetadata(final IDesignSystem system, final DesignBlock block) {
final int plank1 = system.getMaterialIndex(block.getPrimaryMaterial());
final int plank2 = system.getMaterialIndex(block.getSecondaryMaterial());
final int design = CarpentryManager.carpentryInterface.getDesignIndex(block.getDesign());
return getMetadata(plank1, plank2, design, 0, ForgeDirection.UP.ordinal());
}
static {
CarpentryManager.carpentryInterface = new CarpentryInterface();
}
enum Axis
{
Y,
X,
Z;
}
}
@@ -0,0 +1,21 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.config;
import binnie.core.mod.config.PropBoolean;
import binnie.core.mod.config.ConfigProperty;
import binnie.core.mod.config.ConfigFile;
@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;
static {
ConfigurationMain.alterLemon = true;
}
}
@@ -0,0 +1,51 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.core;
import binnie.extratrees.ExtraTrees;
import binnie.Binnie;
import binnie.core.resource.BinnieResource;
import binnie.core.resource.ResourceType;
import binnie.core.resource.IBinnieTexture;
public enum ExtraTreeTexture implements IBinnieTexture
{
Gui(ResourceType.GUI, "gui"),
Nursery(ResourceType.Tile, "Nursery");
String texture;
ResourceType type;
public static String carpenterTexture;
public static String panelerTexture;
public static String tileworkerTexture;
public static String incubatorTexture;
public static String lumbermillTexture;
public static String pressTexture;
public static String distilleryTexture;
public static String breweryTexture;
public static String infuserTexture;
private ExtraTreeTexture(final ResourceType base, final String texture) {
this.texture = texture;
this.type = base;
}
@Override
public BinnieResource getTexture() {
return Binnie.Resource.getPNG(ExtraTrees.instance, this.type, this.texture);
}
static {
ExtraTreeTexture.carpenterTexture = "extratrees/carpenter_";
ExtraTreeTexture.panelerTexture = "extratrees/paneler_";
ExtraTreeTexture.tileworkerTexture = "extratrees/tileworker_";
ExtraTreeTexture.incubatorTexture = "extratrees/incubator_";
ExtraTreeTexture.lumbermillTexture = "extratrees/sawmill_";
ExtraTreeTexture.pressTexture = "extratrees/press_";
ExtraTreeTexture.distilleryTexture = "extratrees/distillery_";
ExtraTreeTexture.breweryTexture = "extratrees/brewery_";
ExtraTreeTexture.infuserTexture = "extratrees/infuser_";
}
}
@@ -0,0 +1,90 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.core;
import net.minecraft.tileentity.TileEntity;
import binnie.craftgui.extratrees.dictionary.WindowSetSquare;
import binnie.craftgui.extratrees.dictionary.WindowLepidopteristDatabase;
import binnie.craftgui.extratrees.dictionary.WindowDistillery;
import binnie.craftgui.extratrees.dictionary.WindowBrewery;
import binnie.craftgui.extratrees.dictionary.WindowPress;
import binnie.craftgui.extratrees.kitchen.WindowBottleRack;
import binnie.craftgui.extratrees.dictionary.WindowLumbermill;
import binnie.craftgui.extratrees.dictionary.WindowWoodworker;
import binnie.craftgui.extratrees.dictionary.WindowArboristDatabase;
import net.minecraft.inventory.IInventory;
import binnie.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.world.World;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.gui.IBinnieGUID;
public enum ExtraTreesGUID implements IBinnieGUID
{
Database,
Woodworker,
Lumbermill,
DatabaseNEI,
Incubator,
MothDatabase,
MothDatabaseNEI,
Press,
Brewery,
Distillery,
KitchenBottleRack,
Infuser,
SetSquare;
@Override
public Window getWindow(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) {
Window window = null;
final 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 Lumbermill: {
window = WindowLumbermill.create(player, object, side);
break;
}
case KitchenBottleRack: {
window = WindowBottleRack.create(player, object, side);
break;
}
case Press: {
window = WindowPress.create(player, object, side);
break;
}
case Brewery: {
window = WindowBrewery.create(player, object, side);
break;
}
case Distillery: {
window = WindowDistillery.create(player, object, side);
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;
}
}
@@ -0,0 +1,153 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.core;
import java.util.Queue;
import java.io.IOException;
import binnie.extratrees.carpentry.EnumPattern;
import binnie.extratrees.api.CarpentryManager;
import binnie.extratrees.api.IDesign;
import binnie.extratrees.genetics.ExtraTreeFruitGene;
import binnie.extratrees.block.PlankType;
import binnie.extratrees.api.IDesignMaterial;
import binnie.extratrees.block.ILogType;
import binnie.extratrees.genetics.ExtraTreeSpecies;
import forestry.api.arboriculture.IAlleleTreeSpecies;
import java.util.LinkedList;
import java.io.PrintWriter;
import java.io.FileWriter;
import binnie.core.BinnieCore;
import binnie.core.IInitializable;
public class ModuleCore implements IInitializable
{
@Override
public void preInit() {
}
@Override
public void init() {
}
@Override
public void postInit() {
if (BinnieCore.proxy.isDebug()) {
try {
final PrintWriter outputSpecies = new PrintWriter(new FileWriter("data/species.html"));
final PrintWriter outputLogs = new PrintWriter(new FileWriter("data/logs.html"));
final PrintWriter outputPlanks = new PrintWriter(new FileWriter("data/planks.html"));
final PrintWriter outputFruit = new PrintWriter(new FileWriter("data/fruit.html"));
final PrintWriter outputDesigns = new PrintWriter(new FileWriter("data/designs.html"));
final Queue<IAlleleTreeSpecies> speciesQueue = new LinkedList<IAlleleTreeSpecies>();
for (final IAlleleTreeSpecies s : ExtraTreeSpecies.values()) {
speciesQueue.add(s);
}
final Queue<ILogType> logQueue = new LinkedList<ILogType>();
for (final ILogType wood : ILogType.ExtraTreeLog.values()) {
logQueue.add(wood);
}
final Queue<IDesignMaterial> plankQueue = new LinkedList<IDesignMaterial>();
for (final IDesignMaterial wood2 : PlankType.ExtraTreePlanks.values()) {
plankQueue.add(wood2);
}
final Queue<ExtraTreeFruitGene> fruitQueue = new LinkedList<ExtraTreeFruitGene>();
for (final ExtraTreeFruitGene wood3 : ExtraTreeFruitGene.values()) {
fruitQueue.add(wood3);
}
final Queue<IDesign> designQueue = new LinkedList<IDesign>();
for (final IDesign wood4 : CarpentryManager.carpentryInterface.getSortedDesigns()) {
designQueue.add(wood4);
}
fruitQueue.remove(ExtraTreeFruitGene.Apple);
outputSpecies.println("<table style=\"width: 100%;\">");
while (!speciesQueue.isEmpty()) {
outputSpecies.println("<tr>");
for (int i = 0; i < 4; ++i) {
final IAlleleTreeSpecies species = speciesQueue.poll();
outputSpecies.println("<td>" + ((species == null) ? "" : species.getName()) + "</td>");
}
outputSpecies.println("</tr>");
}
outputSpecies.println("</table>");
outputLogs.println("<table style=\"width: 100%;\">");
while (!logQueue.isEmpty()) {
outputLogs.println("<tr>");
for (int i = 0; i < 4; ++i) {
final ILogType.ExtraTreeLog wood5 = (ILogType.ExtraTreeLog) logQueue.poll();
if (wood5 == null) {
outputLogs.println("<td></td>");
}
else {
final 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%;\">");
while (!plankQueue.isEmpty()) {
outputPlanks.println("<tr>");
for (int i = 0; i < 4; ++i) {
final IDesignMaterial wood2 = plankQueue.poll();
if (wood2 == null) {
outputPlanks.println("<td></td>");
}
else {
final 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%;\">");
while (!fruitQueue.isEmpty()) {
outputFruit.println("<tr>");
for (int i = 0; i < 4; ++i) {
final ExtraTreeFruitGene wood6 = fruitQueue.poll();
if (wood6 == null) {
outputFruit.println("<td></td>");
}
else {
final String fruit = wood6.getNameOfFruit();
final 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%;\">");
while (!designQueue.isEmpty()) {
outputDesigns.println("<tr>");
for (int i = 0; i < 4; ++i) {
final IDesign wood4 = designQueue.poll();
if (wood4 == null) {
outputDesigns.println("<td></td>");
}
else {
final String texture = ((EnumPattern) wood4.getTopPattern().getPattern()).toString().toLowerCase();
final 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();
}
}
}
}
@@ -0,0 +1,78 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import java.util.Random;
import net.minecraft.world.World;
import forestry.api.world.ITreeGenData;
import forestry.api.arboriculture.ITree;
import net.minecraft.world.gen.feature.WorldGenerator;
public class TreeGenBase extends WorldGenerator
{
protected ITree tree;
protected ITreeGenData treeGen;
protected World world;
protected Random rand;
protected int startX;
protected int startY;
protected int startZ;
protected int girth;
protected int height;
protected int minHeight;
protected int maxHeight;
protected boolean spawnPods;
protected int minPodHeight;
public TreeGenBase() {
this.minHeight = 4;
this.maxHeight = 80;
this.spawnPods = false;
this.minPodHeight = 3;
}
protected final int randBetween(final int a, final int b) {
return a + this.rand.nextInt(b - a);
}
protected final float randBetween(final float a, final float b) {
return a + this.rand.nextFloat() * (b - a);
}
@Override
public boolean generate(final World world, final Random random, final int x, final int y, final int z) {
this.world = world;
this.startX = x;
this.startY = y;
this.startZ = z;
this.girth = this.tree.getGirth(world, x, y, z);
this.height = (int) (this.randBetween(this.getHeight()[0], this.getHeight()[1]) * this.tree.getGenome().getHeight());
if (this.tree.canGrow(world, x, y, z, this.girth, this.height)) {
this.generate();
return true;
}
return false;
}
protected void generate() {
}
protected int[] getHeight() {
return new int[] { 5, 2 };
}
private static class Vector
{
int x;
int y;
int z;
public Vector(final int x, final int y, final int z) {
this.x = x;
this.y = y;
this.z = z;
}
}
}
@@ -0,0 +1,53 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.world.ITreeGenData;
public class WorldGenAlder
{
public static class CommonAlder extends WorldGenTree
{
public CommonAlder(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 1;
final float bottom = this.randBetween(1, 2);
final float width = this.height * this.randBetween(0.4f, 0.45f);
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, this.leaf, false);
}
final float f5 = 0.0f;
final float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(5, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
@@ -0,0 +1,112 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenApple
{
public static class OrchardApple extends WorldGenTree
{
public OrchardApple(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
int leafSpawn = this.height;
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
while (leafSpawn > 2) {
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, this.leaf, false);
}
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(3, 6);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class SweetCrabapple extends WorldGenTree
{
public SweetCrabapple(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
int leafSpawn = this.height;
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, this.leaf, false);
while (leafSpawn > 3) {
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
}
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(4, 4);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class FloweringCrabapple extends WorldGenTree
{
public FloweringCrabapple(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
int leafSpawn = this.height;
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
while (leafSpawn > 3) {
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, this.leaf, false);
}
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(3, 6);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class PrairieCrabapple extends WorldGenTree
{
public PrairieCrabapple(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
int leafSpawn = this.height;
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, this.leaf, false);
while (leafSpawn > 3) {
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
}
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(4, 4);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
@@ -0,0 +1,45 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.world.ITreeGenData;
public class WorldGenAsh
{
public static class CommonAsh extends WorldGenTree
{
public CommonAsh(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 1;
final float bottom = this.randBetween(2, 3);
final float width = this.height * this.randBetween(0.35f, 0.45f);
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.8f * width, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), this.randBetween(0.95f, 1.05f) * width, 1, this.leaf, false);
}
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.7f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(5, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
@@ -0,0 +1,32 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.world.ITreeGenData;
public class WorldGenBanana extends WorldGenTree
{
public WorldGenBanana(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.bushiness = 0.9f;
this.generateTreeTrunk(this.height, this.girth);
int leafSpawn = this.height + 1;
final float width = this.height / this.randBetween(1.8f, 2.0f);
final int bottom = this.randBetween(3, 4);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(6, 1);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
@@ -0,0 +1,54 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.arboriculture.ITree;
public class WorldGenBeech
{
public static class CommonBeech extends WorldGenTree
{
public CommonBeech(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 1;
final float bottom = this.randBetween(2, 3);
final float width = this.height * this.randBetween(0.47f, 0.5f);
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, this.leaf, false);
}
final float f5 = 0.0f;
final float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 1.0f, 1, this.leaf, false);
}
}
public static class CopperBeech extends CommonBeech
{
public CopperBeech(final ITree tree) {
super(tree);
}
}
}
@@ -0,0 +1,35 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.world.ITreeGenData;
public class WorldGenCitrus extends WorldGenTree
{
public WorldGenCitrus(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
int leafSpawn = this.height;
final float width = this.height / this.randBetween(1.1f, 1.5f);
final int bottom = this.randBetween(1, 2);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, this.leaf, false);
while (leafSpawn > bottom) {
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, this.leaf, false);
}
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.minHeight = this.randBetween(2, 3);
this.height = this.determineHeight(6, 1);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
@@ -0,0 +1,284 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenConifer
{
public static class WesternHemlock extends WorldGenTree
{
public WesternHemlock(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 6;
final float bottom = this.randBetween(2, 3);
float width = this.height / this.randBetween(2.0f, 2.5f);
if (width > 7.0f) {
width = 7.0f;
}
final float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width;
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
}
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(7, 3);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class Cypress extends WorldGenTree
{
public Cypress(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 2;
final float bottom = 1.0f;
float width = this.height * this.randBetween(0.15f, 0.2f);
if (width > 7.0f) {
width = 7.0f;
}
final float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width - 1.0f;
++radius;
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
}
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(6, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class Yew extends WorldGenTree
{
public Yew(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 2;
final float bottom = this.randBetween(1, 2);
float width = this.height * this.randBetween(0.7f, 0.75f);
if (width > 7.0f) {
width = 7.0f;
}
final float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= 2.0f - radius;
radius *= width;
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
}
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(5, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class Cedar extends WorldGenTree
{
public Cedar(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 3;
final float bottom = this.randBetween(2, 3);
float width = this.height * this.randBetween(0.7f, 0.75f);
if (width > 7.0f) {
width = 7.0f;
}
final float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), this.girth, 1, this.leaf, false);
}
for (leafSpawn = this.height + 3; leafSpawn > bottom; leafSpawn += 1 + this.rand.nextInt(2)) {
float cone = 1.0f - (leafSpawn - bottom) / coneHeight;
float radius = (0.7f + this.rand.nextFloat() * 0.3f) * width;
float xOffset = (-width + this.rand.nextFloat() * 2.0f * width) / 2.0f;
float yOffset = (-width + this.rand.nextFloat() * 2.0f * width) / 2.0f;
cone *= 2.0f - cone;
xOffset *= cone;
yOffset *= cone;
radius *= cone;
if (radius < 2.0f) {
radius = 2.0f;
}
if (xOffset > radius / 2.0f) {
xOffset = radius / 2.0f;
}
if (yOffset > radius / 2.0f) {
yOffset = radius / 2.0f;
}
final float f2 = xOffset;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, yOffset), 0.7f * radius, 1, this.leaf, false);
final float f3 = xOffset;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, yOffset), radius, 1, this.leaf, false);
final float f4 = xOffset;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, yOffset), 0.5f * radius, 1, this.leaf, false);
}
final float f5 = 0.0f;
final float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.7f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(6, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class LoblollyPine extends WorldGenTree
{
public LoblollyPine(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 2;
final float bottom = this.height * this.randBetween(0.65f, 0.7f);
float width = this.height * this.randBetween(0.25f, 0.3f);
if (width > 7.0f) {
width = 7.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.6f * width, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
}
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.7f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(6, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class MonkeyPuzzle extends WorldGenTree
{
public MonkeyPuzzle(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 2;
final float bottom = this.randBetween(2, 3);
float width = this.height * this.randBetween(0.4f, 0.45f);
if (width > 7.0f) {
width = 7.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.35f * width, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.55f * width, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.75f * width, 1, this.leaf, false);
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, this.leaf, false);
final float f5 = 0.0f;
final float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
this.generateCylinder(new Vector(f5, h5, 0.0f), 1.0f * width, 1, this.leaf, false);
final float f6 = 0.0f;
final float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
this.generateCylinder(new Vector(f6, h6, 0.0f), 0.5f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(9, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
@@ -0,0 +1,44 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import binnie.extratrees.worldgen.BlockTypeLog;
import binnie.extratrees.genetics.ExtraTreeSpecies;
import binnie.extratrees.worldgen.BlockTypeLeaf;
import binnie.extratrees.worldgen.BlockType;
import forestry.api.world.ITreeGenData;
public class WorldGenDefault extends WorldGenTree
{
public WorldGenDefault(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
int leafSpawn = this.height + 1;
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.0f, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.9f, 1, this.leaf, false);
this.generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.9f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(5, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
@Override
public BlockType getLeaf() {
return new BlockTypeLeaf();
}
@Override
public BlockType getWood() {
return new BlockTypeLog(((ExtraTreeSpecies) this.treeGen.getGenome().getPrimary()).getLog());
}
}
@@ -0,0 +1,160 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import binnie.extratrees.worldgen.BlockTypeLog;
import binnie.extratrees.block.ILogType;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenEucalyptus
{
public static class SwampGum extends WorldGenTree
{
public SwampGum(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 2;
final float weakerBottm = this.randBetween(0.5f, 0.6f) * this.height;
final float bottom = this.randBetween(0.4f, 0.5f) * this.height;
float width = this.height * this.randBetween(0.15f, 0.2f);
if (width > 7.0f) {
width = 7.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
this.bushiness = 0.3f;
while (leafSpawn > weakerBottm) {
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), this.randBetween(0.9f, 1.0f) * width, 1, this.leaf, false);
}
this.bushiness = 0.6f;
while (leafSpawn > bottom) {
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), this.randBetween(0.8f, 0.9f) * width, 1, this.leaf, false);
}
final float f5 = 0.0f;
final float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.5f * width, 1, this.leaf, false);
for (int i = 0; i < 5; ++i) {
final float f6 = this.randBetween(-1, 1);
final float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
this.generateSphere(new Vector(f6, h6, this.randBetween(-1, 1)), this.randBetween(1, 2), this.leaf, false);
}
}
@Override
public void preGenerate() {
this.height = this.determineHeight(14, 3);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class RoseGum extends WorldGenTree
{
public RoseGum(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
final int offset = (this.girth - 1) / 2;
for (int x = 0; x < this.girth; ++x) {
for (int y = 0; y < this.girth; ++y) {
for (int i = 0; i < 2; ++i) {
this.addBlock(x - offset, i, y - offset, new BlockTypeLog(ILogType.ExtraTreeLog.Eucalyptus2), true);
}
}
}
float leafSpawn = this.height + 2;
final float bottom = this.randBetween(0.4f, 0.5f) * this.height;
float width = this.height * this.randBetween(0.05f, 0.1f);
if (width < 1.5f) {
width = 1.5f;
}
this.bushiness = 0.5f;
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
while (leafSpawn > bottom) {
this.bushiness = 0.1f;
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), this.randBetween(0.9f, 1.1f) * width, 1, this.leaf, false);
}
}
@Override
public void preGenerate() {
this.height = this.determineHeight(9, 3);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class RainbowGum extends WorldGenTree
{
public RainbowGum(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 2;
final float bottom = this.randBetween(0.5f, 0.6f) * this.height;
float width = this.height * this.randBetween(0.15f, 0.2f);
if (width < 1.5f) {
width = 1.5f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, this.leaf, false);
}
}
@Override
public void preGenerate() {
this.height = this.determineHeight(7, 3);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
@@ -0,0 +1,145 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenFir
{
public static class DouglasFir extends WorldGenTree
{
public DouglasFir(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 1;
final float patchyBottom = this.height / 2;
final float bottom = this.randBetween(3, 4);
final float width = this.height * this.randBetween(0.35f, 0.4f);
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
this.bushiness = 0.1f;
while (leafSpawn > patchyBottom) {
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), this.randBetween(0.9f, 1.1f) * width, 1, this.leaf, false);
}
this.bushiness = 0.5f;
while (leafSpawn > bottom) {
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), this.randBetween(0.7f, 1.0f) * width, 1, this.leaf, false);
}
final float f5 = 0.0f;
final float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
this.generateCylinder(new Vector(f5, h5, 0.0f), 0.7f * width, 1, this.leaf, false);
final float f6 = 0.0f;
final float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
this.generateCylinder(new Vector(f6, h6, 0.0f), 0.3f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(7, 3);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class SilverFir extends WorldGenTree
{
public SilverFir(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 2;
final float bottom = this.randBetween(2, 3);
float width = this.height / this.randBetween(2.5f, 3.0f);
if (width > 7.0f) {
width = 7.0f;
}
final float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width;
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
}
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(7, 3);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class BalsamFir extends WorldGenTree
{
public BalsamFir(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 2;
final float bottom = 1.0f;
float width = this.height / this.randBetween(2.0f, 2.5f);
if (width > 7.0f) {
width = 7.0f;
}
final float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width;
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), radius, 1, this.leaf, false);
}
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(6, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
@@ -0,0 +1,52 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.world.ITreeGenData;
public class WorldGenHolly
{
public static class Holly extends WorldGenTree
{
public Holly(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 1;
final float bottom = 1.0f;
float width = this.height * this.randBetween(0.4f, 0.45f);
if (width < 1.5f) {
width = 1.5f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
}
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), width = 1.0f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(4, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
@@ -0,0 +1,355 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenJungle
{
public static class Brazilwood extends WorldGenTree
{
public Brazilwood(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height;
final float bottom = 1.0f;
float width = this.height * this.randBetween(0.15f, 0.2f);
if (width < 2.0f) {
width = 2.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 0.8f, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
}
}
@Override
public void preGenerate() {
this.height = this.determineHeight(4, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class Logwood extends WorldGenTree
{
public Logwood(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height;
final float bottom = this.randBetween(1, 2);
float width = this.height * this.randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.7f, 1, this.leaf, false);
}
}
@Override
public void preGenerate() {
this.height = this.determineHeight(4, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class Rosewood extends WorldGenTree
{
public Rosewood(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 1;
final float bottom = this.randBetween(1, 2);
float width = this.height * this.randBetween(0.2f, 0.25f);
if (width < 2.0f) {
width = 2.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.7f, 1, this.leaf, false);
}
}
@Override
public void preGenerate() {
this.height = this.determineHeight(6, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class Purpleheart extends WorldGenTree
{
public Purpleheart(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 1;
final float bottom = this.height - 3;
float width = this.height * this.randBetween(0.2f, 0.25f);
if (width < 2.0f) {
width = 2.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.7f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(7, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class OsangeOsange extends WorldGenTree
{
public OsangeOsange(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height;
final float bottom = this.randBetween(1, 2);
float width = this.height * this.randBetween(0.2f, 0.25f);
if (width < 2.0f) {
width = 2.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, this.leaf, false);
}
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(5, 1);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class OldFustic extends WorldGenTree
{
public OldFustic(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height;
final float bottom = this.randBetween(1, 2);
float width = this.height * this.randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 0.7f, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, this.leaf, false);
}
}
@Override
public void preGenerate() {
this.height = this.determineHeight(5, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class Coffee extends WorldGenTree
{
public Coffee(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height;
final float bottom = 1.0f;
float width = this.height * this.randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 0.5f, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
}
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.3f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(3, 1);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class BrazilNut extends WorldGenTree
{
public BrazilNut(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 1;
final float bottom = this.height - 3;
float width = this.height * this.randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
}
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(7, 1);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
public static class Shrub15 extends WorldGenTree
{
public Shrub15(final ITree tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height;
final float bottom = 1.0f;
float width = this.height * this.randBetween(0.15f, 0.2f);
if (width < 1.5f) {
width = 1.5f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 0.8f, 1, this.leaf, false);
while (leafSpawn > bottom) {
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
}
}
@Override
public void preGenerate() {
this.height = this.determineHeight(4, 1);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
@@ -0,0 +1,46 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.world.ITreeGenData;
public class WorldGenLazy
{
public static class Tree extends WorldGenTree
{
public Tree(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height;
final float bottom = this.height / 2 - 1;
float width = this.height * this.randBetween(0.35f, 0.4f);
if (width < 1.2) {
width = 1.55f;
}
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, this.leaf, false);
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, this.leaf, false);
}
@Override
public void preGenerate() {
this.height = this.determineHeight(4, 1);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
@@ -0,0 +1,63 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extratrees.gen;
import forestry.api.world.ITreeGenData;
public class WorldGenMaple
{
public static class RedMaple extends WorldGenTree
{
public RedMaple(final ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
this.generateTreeTrunk(this.height, this.girth);
float leafSpawn = this.height + 2;
final float bottom = this.randBetween(1, 2);
final float bottom2 = (this.height + bottom) / 2.0f;
float width = 2.0f;
final float f = 0.0f;
final float h = leafSpawn;
leafSpawn = h - 1.0f;
this.generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, this.leaf, false);
while (leafSpawn > bottom2) {
final float f2 = 0.0f;
final float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
this.generateCylinder(new Vector(f2, h2, 0.0f), width, 1, this.leaf, false);
final float f3 = 0.0f;
final float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
this.generateCylinder(new Vector(f3, h3, 0.0f), width - 0.4f, 1, this.leaf, false);
}
width += 0.6;
while (leafSpawn > bottom) {
final float f4 = 0.0f;
final float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
this.generateCylinder(new Vector(f4, h4, 0.0f), width, 1, this.leaf, false);
final float f5 = 0.0f;
final float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
this.generateCylinder(new Vector(f5, h5, 0.0f), width - 0.4f, 1, this.leaf, false);
}
if (leafSpawn == bottom) {
final float f6 = 0.0f;
final float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
this.generateCylinder(new Vector(f6, h6, 0.0f), width - 0.6f, 1, this.leaf, false);
}
}
@Override
public void preGenerate() {
this.height = this.determineHeight(5, 2);
this.girth = this.determineGirth(this.treeGen.getGirth(this.world, this.startX, this.startY, this.startZ));
}
}
}
Loaded 100 of 3697 files, more files were not shown because too many files have changed in this diff. Show more