mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 19:39:37 +00:00
Improve code readability in binnie.extratrees package
This commit is contained in:
1 parent
adccdd181a
commit
96e4814ae3
225 files changed
+8968
-9306
No files matched your search
@@ -5,8 +5,6 @@ import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public enum BotanyGUI implements IBinnieGUID {
|
||||
|
||||
@@ -15,7 +15,7 @@ public class ControlColorMixBox extends ControlListBox<IColourMix> {
|
||||
|
||||
@Override
|
||||
public IWidget createOption(IColourMix value, int y) {
|
||||
return new ControlColorMixItem(this.getContent(), value, y);
|
||||
return new ControlColorMixItem(getContent(), value, y);
|
||||
}
|
||||
|
||||
enum Type {
|
||||
|
||||
@@ -48,7 +48,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Mod(modid = "BinnieCore", name = "Binnie Core", useMetadata = true)
|
||||
public final class BinnieCore extends AbstractMod {
|
||||
public class BinnieCore extends AbstractMod {
|
||||
@Mod.Instance("BinnieCore")
|
||||
public static BinnieCore instance;
|
||||
@SidedProxy(clientSide = "binnie.core.proxy.BinnieProxyClient", serverSide = "binnie.core.proxy.BinnieProxyServer")
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binnie.core.craftgui.controls;
|
||||
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.events.EventHandler;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binnie.core.craftgui.controls;
|
||||
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.events.EventHandler;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binnie.core.craftgui.controls.button;
|
||||
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.events.EventButtonClicked;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package binnie.core.craftgui.controls.core;
|
||||
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.ITooltipHelp;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.Widget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package binnie.core.craftgui.controls.listbox;
|
||||
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.events.EventMouse;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binnie.core.craftgui.controls.scroll;
|
||||
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.events.EventMouse;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package binnie.core.craftgui.controls.tab;
|
||||
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.events.EventMouse;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ControlSpeciesBox extends ControlListBox<IAlleleSpecies>
|
||||
|
||||
@Override
|
||||
public IWidget createOption(IAlleleSpecies value, int y) {
|
||||
return new ControlSpeciexBoxOption(this.getContent(), value, y);
|
||||
return new ControlSpeciexBoxOption(getContent(), value, y);
|
||||
}
|
||||
|
||||
public ControlSpeciesBox(IWidget parent, float x, float y, float width, float height) {
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.events.EventHandler;
|
||||
import binnie.core.craftgui.events.EventMouse;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.Binnie;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
public interface IMachineInformation
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.machines.transfer.TransferRequest;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
public enum InventoryType
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.ITooltipHelp;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.TopLevelWidget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.events.EventWidget;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface IFluidType {
|
||||
|
||||
int getColor();
|
||||
|
||||
int getContainerColour();
|
||||
int getContainerColor();
|
||||
|
||||
int getTransparency();
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ public class ItemFluidContainer extends ItemFood {
|
||||
return 16777215;
|
||||
}
|
||||
if (pass == 0 && fluid.getFluid() instanceof BinnieFluid) {
|
||||
return ((BinnieFluid) fluid.getFluid()).fluidType.getContainerColour();
|
||||
return ((BinnieFluid) fluid.getFluid()).fluidType.getContainerColor();
|
||||
}
|
||||
return super.getColorFromItemStack(item, pass);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.machines.power;
|
||||
|
||||
import forestry.api.core.INBTTagable;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.core.machines.storage;
|
||||
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.minecraft.EnumColor;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.core.machines.storage;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
|
||||
@@ -2,9 +2,9 @@ package binnie.core.machines.storage;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.ControlCheckbox;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextEdit;
|
||||
|
||||
@@ -74,7 +74,7 @@ public enum ExtraBeeLiquid implements ILiquidType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
public int getContainerColor() {
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +1,50 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
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.extrabees.ExtraBees;
|
||||
import binnie.extratrees.alcohol.ModuleAlcohol;
|
||||
import binnie.extratrees.item.ModuleItems;
|
||||
import binnie.extratrees.alcohol.drink.ItemDrink;
|
||||
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.carpentry.BlockStainedDesign;
|
||||
import binnie.extratrees.carpentry.ModuleCarpentry;
|
||||
import binnie.extratrees.config.ConfigurationMain;
|
||||
import binnie.extratrees.core.ExtraTreesGUID;
|
||||
import binnie.extratrees.core.ModuleCore;
|
||||
import binnie.extratrees.genetics.ModuleGenetics;
|
||||
import binnie.extratrees.item.ModuleItems;
|
||||
import binnie.extratrees.machines.ModuleMachine;
|
||||
import binnie.extratrees.proxy.Proxy;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import binnie.core.AbstractMod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
@Mod(modid = "ExtraTrees", name = "Extra Trees", useMetadata = true, dependencies = "after:BinnieCore")
|
||||
public class ExtraTrees extends 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")
|
||||
|
||||
@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;
|
||||
@@ -70,32 +75,32 @@ public class ExtraTrees extends AbstractMod
|
||||
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;
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
addModule(new ModuleBlocks());
|
||||
addModule(new ModuleItems());
|
||||
addModule(new ModuleAlcohol());
|
||||
addModule(new ModuleGenetics());
|
||||
addModule(new ModuleCarpentry());
|
||||
addModule(new ModuleMachine());
|
||||
addModule(new ModuleCore());
|
||||
preInit();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
postInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinnieGUID[] getGUIDs() {
|
||||
return ExtraTreesGUID.values();
|
||||
@@ -103,7 +108,7 @@ public class ExtraTrees extends AbstractMod
|
||||
|
||||
@Override
|
||||
public Class[] getConfigs() {
|
||||
return new Class[] { ConfigurationMain.class };
|
||||
return new Class[]{ConfigurationMain.class};
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,8 +136,7 @@ public class ExtraTrees extends AbstractMod
|
||||
return BinnieCore.isExtraTreesActive();
|
||||
}
|
||||
|
||||
public static class PacketHandler extends BinniePacketHandler
|
||||
{
|
||||
public static class PacketHandler extends BinniePacketHandler {
|
||||
public PacketHandler() {
|
||||
super(ExtraBees.instance);
|
||||
}
|
||||
|
||||
@@ -1,27 +1,29 @@
|
||||
package binnie.extratrees;
|
||||
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.arboriculture.tiles.TileWood;
|
||||
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.WorldType;
|
||||
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;
|
||||
|
||||
protected Block block;
|
||||
protected int metadata;
|
||||
protected TileEntity te;
|
||||
|
||||
public FakeWorld() {
|
||||
super(null, "", null, new WorldSettings(Long.MAX_VALUE, GameType.NOT_SET, false, false, WorldType.FLAT), null);
|
||||
}
|
||||
|
||||
public ItemStack getWooLog() {
|
||||
if (te instanceof TileWood) {
|
||||
@@ -32,18 +34,14 @@ public class FakeWorld extends World {
|
||||
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) {
|
||||
public boolean setBlock(int x, int y, int z, 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) {
|
||||
public boolean setBlock(int x, int y, int z, Block block, int metadata, int update) {
|
||||
this.block = block;
|
||||
this.metadata = metadata;
|
||||
if (block.hasTileEntity(metadata)) {
|
||||
@@ -57,7 +55,7 @@ public class FakeWorld extends World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlockToAir(int p_147468_1_, int p_147468_2_, int p_147468_3_) {
|
||||
public boolean setBlockToAir(int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -67,7 +65,7 @@ public class FakeWorld extends World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTileEntity(int p_147455_1_, int p_147455_2_, int p_147455_3_, TileEntity p_147455_4_) {
|
||||
public void setTileEntity(int x, int y, int z, TileEntity tileEntity) {
|
||||
|
||||
}
|
||||
|
||||
@@ -77,12 +75,12 @@ public class FakeWorld extends World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockMetadata(int p_72805_1_, int p_72805_2_, int p_72805_3_) {
|
||||
public int getBlockMetadata(int x, int y, int z) {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlockMetadataWithNotify(int p_72921_1_, int p_72921_2_, int p_72921_3_, int metadata, int p_72921_5_) {
|
||||
public boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int delay) {
|
||||
this.metadata = metadata;
|
||||
return true;
|
||||
}
|
||||
@@ -98,7 +96,7 @@ public class FakeWorld extends World {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity getEntityByID(int p_73045_1_) {
|
||||
public Entity getEntityByID(int id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,140 +1,46 @@
|
||||
//
|
||||
// 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.core.liquid.FluidContainer;
|
||||
import binnie.core.liquid.IFluidType;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.ArrayList;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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 getColor() {
|
||||
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.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getABV() {
|
||||
return this.abv;
|
||||
}
|
||||
public enum Alcohol implements IFluidType, ICocktailLiquid {
|
||||
Apple("ciderApple", 0xfabe3c, 0.3, 0.05),
|
||||
Apricot("wineApricot", 0xf0cf36, 0.3, 0.1),
|
||||
Banana("wineBanana", 0xe4c84d, 0.3, 0.1),
|
||||
Cherry("wineCherry", 0xab0416, 0.3, 0.1),
|
||||
Elderberry("wineElderberry", 0x950001, 0.3, 0.1),
|
||||
Peach("ciderPeach", 0xea661b, 0.3, 0.05),
|
||||
Pear("ciderPear", 0xe5d067, 0.3, 0.05),
|
||||
Plum("winePlum", 0xb81408, 0.3, 0.1),
|
||||
Carrot("wineCarrot", 0xf77d02, 0.3, 0.1),
|
||||
WhiteWine("wineWhite", 0xedda95, 0.1, 0.1),
|
||||
RedWine("wineRed", 0x750b0b, 0.2, 0.1),
|
||||
SparklingWine("wineSparkling", 0xfef7be, 0.1, 0.1),
|
||||
Agave("wineAgave", 0xd4ae64, 0.2, 0.1),
|
||||
Potato("fermentedPotatoes", 0xb78950, 0.8, 0.1),
|
||||
Citrus("wineCitrus", 0xffff00, 0.2, 0.1),
|
||||
Cranberry("wineCranberry", 0xb10002, 0.2, 0.1),
|
||||
Pineapple("winePineapple", 0xe0ac36, 0.2, 0.1),
|
||||
Tomato("wineTomato", 0xbe1a19, 0.2, 0.1),
|
||||
Fruit("juice", 0xfabe3c, 0.2, 0.1),
|
||||
Ale("beerAle", 0xc63a21, 0.7, 0.05),
|
||||
Lager("beerLager", 0xe97c05, 0.7, 0.05),
|
||||
WheatBeer("beerWheat", 0xdb6e08, 0.7, 0.05),
|
||||
RyeBeer("beerRye", 0xa55827, 0.7, 0.05),
|
||||
CornBeer("beerCorn", 0xcca424, 0.7, 0.05),
|
||||
Stout("beerStout", 0x592901, 0.8, 0.05),
|
||||
Barley("mashGrain", 0xc63a21, 0.9, 0.05),
|
||||
Wheat("mashWheat", 0xc63a21, 0.9, 0.05),
|
||||
Rye("mashRye", 0xa55827, 0.9, 0.05),
|
||||
Corn("mashCorn", 0xcca424, 0.9, 0.05);
|
||||
|
||||
static {
|
||||
Alcohol.Apple.setFementation(Juice.Apple);
|
||||
@@ -157,4 +63,94 @@ public enum Alcohol implements IFluidType, ICocktailLiquid
|
||||
Alcohol.Pineapple.setFementation(Juice.Pineapple);
|
||||
Alcohol.Potato.setFementation("cropPotato");
|
||||
}
|
||||
|
||||
protected List<String> fermentationLiquid;
|
||||
protected String fermentationSolid;
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int colour;
|
||||
protected float transparency;
|
||||
protected float abv;
|
||||
|
||||
Alcohol(String ident, int colour, double transparency, double abv) {
|
||||
fermentationLiquid = new ArrayList<>();
|
||||
fermentationSolid = "";
|
||||
this.ident = ident;
|
||||
this.colour = colour;
|
||||
this.transparency = (float) transparency;
|
||||
this.abv = (float) abv;
|
||||
}
|
||||
|
||||
private void setFementation(Juice juice) {
|
||||
fermentationLiquid.add(juice.getIdentifier());
|
||||
}
|
||||
|
||||
private void setFementation(String oreDict) {
|
||||
fermentationSolid = oreDict;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcon(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("fluid.alcohol." + name().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return "binnie." + ident;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack get(int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransparency() {
|
||||
return (int) (Math.min(1.0, transparency + 0.3) * 255.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip(int ratio) {
|
||||
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceIn(FluidContainer container) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showInCreative(FluidContainer container) {
|
||||
return container == FluidContainer.Glass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColor() {
|
||||
return getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getABV() {
|
||||
return abv;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,30 @@
|
||||
//
|
||||
// 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;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
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;
|
||||
public class AlcoholEffect {
|
||||
public static void makeDrunk(EntityPlayer player, float strength) {
|
||||
int existingStrength = player.isPotionActive(Potion.confusion) ? player.getActivePotionEffect(Potion.confusion).getAmplifier() : 0;
|
||||
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;
|
||||
|
||||
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));
|
||||
|
||||
@@ -1,93 +1,46 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol;
|
||||
|
||||
import binnie.extratrees.alcohol.drink.DrinkManager;
|
||||
import binnie.extratrees.alcohol.drink.DrinkLiquid;
|
||||
import binnie.extratrees.alcohol.drink.DrinkManager;
|
||||
|
||||
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);
|
||||
public enum Cocktail {
|
||||
Bellini("Bellini", Glassware.Flute, 0xf3c16c),
|
||||
BlackRussian("Black Russian", Glassware.OldFashioned, 0x331618),
|
||||
BloodyMary("Bloody Mary", Glassware.Highball, 0xc12f00),
|
||||
Cosmopolitan("Cosmopolitan", Glassware.Cocktail, 0xe20000),
|
||||
CubaLibre("Cuba Libre", Glassware.Highball, 0x8a0404),
|
||||
FrenchConnection("French Connection", Glassware.OldFashioned, 0xf6ad27),
|
||||
GodFather("God Father", Glassware.OldFashioned, 0xc8691d),
|
||||
GodMother("God Mother", Glassware.OldFashioned, 0xdf7601),
|
||||
Grasshopper("Grasshopper", Glassware.Cocktail, 0x43c46a),
|
||||
French75("French 75", Glassware.Flute, 0xecd89d),
|
||||
HarveyWallbanger("Harvey Wallbanger", Glassware.Highball, 0xf9d100),
|
||||
HemingwaySpecial("Hemingway Special", Glassware.Cocktail, 0xe7f3b5),
|
||||
HorsesNeck("Horse's Neck", Glassware.OldFashioned, 0xfeb500),
|
||||
IrishCoffee("Irish Coffee", Glassware.Wine, 0x440e02),
|
||||
Kir("Kir", Glassware.Wine, 0xf4361e),
|
||||
Bramble("Bramble", Glassware.OldFashioned, 0xc3636e),
|
||||
B52("B-52", Glassware.Shot, 0xc55e00),
|
||||
DarkNStormy("Dark 'N' Stormy", Glassware.Highball, 0xba6628),
|
||||
DirtyMartini("Dirty Martini", Glassware.Cocktail, 0xdab253),
|
||||
ExpressoMartini("Expresso Martini", Glassware.Cocktail, 0x63282a),
|
||||
FrenchMartini("French Martini", Glassware.Cocktail, 0xc12d4d),
|
||||
Kamikaze("Kamikaze", Glassware.Cocktail, 0xe1d8ad),
|
||||
LemonDropMartini("Lemon Drop Martini", Glassware.Cocktail, 0xf9de8d),
|
||||
PiscoSour("Pisco Sour", Glassware.OldFashioned, 0xeae69f),
|
||||
RussianSpringPunch("Russian Spring Punch", Glassware.Highball, 0xb4242c),
|
||||
SpritzVeneziano("Spritz Veneziano", Glassware.OldFashioned, 0xea4f00),
|
||||
TommysMargarita("Tommy's Margartita", Glassware.Cocktail, 0xe2dc88),
|
||||
Vesper("Vesper", Glassware.Cocktail, 0xeeeeec),
|
||||
SexOnTheBeach("Sex on the Beach", Glassware.Highball, 0xfe7a32);
|
||||
|
||||
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.getColor(), 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 Map<String, ICocktailIngredient> cocktailIngredients;
|
||||
|
||||
static {
|
||||
cocktailIngredients = new HashMap<String, ICocktailIngredient>();
|
||||
cocktailIngredients = new HashMap<>();
|
||||
Cocktail.Bellini.add(Alcohol.SparklingWine, 2);
|
||||
Cocktail.Bellini.add(Juice.Peach, 1);
|
||||
Cocktail.BlackRussian.add(Spirit.Vodka, 5);
|
||||
@@ -172,4 +125,48 @@ public enum Cocktail
|
||||
Cocktail.SexOnTheBeach.add(Juice.Orange, 2);
|
||||
Cocktail.SexOnTheBeach.add(Juice.Cranberry, 2);
|
||||
}
|
||||
|
||||
public String name;
|
||||
public Glassware glassware;
|
||||
public int colour;
|
||||
public Map<ICocktailIngredient, Integer> ingredients;
|
||||
|
||||
Cocktail(String name, Glassware glassware, int colour) {
|
||||
ingredients = new HashMap<>();
|
||||
this.name = name;
|
||||
this.glassware = glassware;
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
public static Cocktail get(Map<ICocktailIngredient, Integer> ingredients) {
|
||||
for (Cocktail cocktail : values()) {
|
||||
boolean is = true;
|
||||
for (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(ICocktailIngredient ingredient) {
|
||||
Cocktail.cocktailIngredients.put(ingredient.getIdentifier().toLowerCase(), ingredient);
|
||||
DrinkManager.registerDrinkLiquid(ingredient.getIdentifier().toLowerCase(), new DrinkLiquid(ingredient.getName(), ingredient.getColor(), ingredient.getTransparency(), ingredient.getABV()));
|
||||
}
|
||||
|
||||
public static ICocktailIngredient getIngredient(String name2) {
|
||||
return Cocktail.cocktailIngredients.get(name2.toLowerCase());
|
||||
}
|
||||
|
||||
public static boolean isIngredient(String name) {
|
||||
return name != null && Cocktail.cocktailIngredients.containsKey(name.toLowerCase());
|
||||
}
|
||||
|
||||
private void add(ICocktailIngredient ingredient, int ratio) {
|
||||
ingredients.put(ingredient, ratio);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,12 @@
|
||||
//
|
||||
// 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.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum Glassware
|
||||
{
|
||||
public enum Glassware {
|
||||
BeerMug(16, 10, 14),
|
||||
Pint(20, 6, 20),
|
||||
Snifter(17, 14, 11),
|
||||
@@ -28,47 +23,49 @@ public enum Glassware
|
||||
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);
|
||||
}
|
||||
protected float contentBottom;
|
||||
protected float contentHeight;
|
||||
|
||||
public int getCapacity() {
|
||||
return this.capacity;
|
||||
}
|
||||
private int capacity;
|
||||
|
||||
private Glassware(final int capacity, final int contentBottom, final int contentHeight) {
|
||||
Glassware(int capacity, int contentBottom, 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 String getName(String liquid) {
|
||||
if (liquid == null) {
|
||||
return ExtraTrees.proxy.localise("item.glassware." + name().toLowerCase());
|
||||
}
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "item.glassware." + name().toLowerCase() + ".usage", liquid);
|
||||
}
|
||||
|
||||
public ItemStack get(final int i) {
|
||||
public int getCapacity() {
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
glass = ExtraTrees.proxy.getIcon(par1IconRegister, "glassware/" + toString().toLowerCase() + ".glass");
|
||||
contents = ExtraTrees.proxy.getIcon(par1IconRegister, "glassware/" + toString().toLowerCase() + ".contents");
|
||||
}
|
||||
|
||||
public ItemStack get(int i) {
|
||||
return ExtraTrees.drink.getStack(this, null);
|
||||
}
|
||||
|
||||
public float getContentBottom() {
|
||||
return this.contentBottom;
|
||||
return contentBottom;
|
||||
}
|
||||
|
||||
public float getContentHeight() {
|
||||
return this.contentHeight;
|
||||
return contentHeight;
|
||||
}
|
||||
|
||||
public int getVolume() {
|
||||
return this.getCapacity();
|
||||
return getCapacity();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,6 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol;
|
||||
|
||||
public interface ICocktailIngredient
|
||||
{
|
||||
public interface ICocktailIngredient {
|
||||
String getName();
|
||||
|
||||
String getIdentifier();
|
||||
@@ -14,7 +9,7 @@ public interface ICocktailIngredient
|
||||
|
||||
int getTransparency();
|
||||
|
||||
String getTooltip(final int p0);
|
||||
String getTooltip(int ratio);
|
||||
|
||||
float getABV();
|
||||
}
|
||||
@@ -1,12 +1,7 @@
|
||||
//
|
||||
// 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);
|
||||
public interface ICocktailLiquid extends ICocktailIngredient {
|
||||
FluidStack get(int amount);
|
||||
}
|
||||
@@ -1,116 +1,112 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol;
|
||||
|
||||
import binnie.Binnie;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import binnie.core.liquid.FluidContainer;
|
||||
import binnie.core.liquid.IFluidType;
|
||||
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;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
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");
|
||||
public enum Juice implements IFluidType, ICocktailLiquid {
|
||||
Apple("Apple Juice", "juiceApple", 0xffca32, 0.7, "Apple"),
|
||||
Apricot("Apricot Juice", "juiceApricot", 0xffb51e, 0.6, "Apricot"),
|
||||
Banana("Banana Juice", "juiceBanana", 0xe9d483, 0.6, "Banana"),
|
||||
Cherry("Cherry Juice", "juiceCherry", 0xc70b1f, 0.6, "Cherry"),
|
||||
Elderberry("Elderberry Juice", "juiceElderberry", 0x402629, 0.6, "Elderberry"),
|
||||
Lemon("Lemon Juice", "juiceLemon", 0xdeda52, 0.7, "Lemon"),
|
||||
Lime("Lime Juice", "juiceLime", 0xb9ce6f, 0.6, "Lime"),
|
||||
Orange("Orange Juice", "juiceOrange", 0xf9a22f, 0.8, "Orange"),
|
||||
Peach("Peach Juice", "juicePeach", 0xfac55d, 0.7, "Peach"),
|
||||
Plum("Plum Juice", "juicePlum", 0xa11f11, 0.7, "Plum"),
|
||||
Carrot("Carrot Juice", "juiceCarrot", 0xfb8e17, 0.7, "Carrot"),
|
||||
Tomato("Tomato Juice", "juiceTomato", 0xc2442e, 0.7, "Tomato"),
|
||||
Cranberry("Cranberry Juice", "juiceCranberry", 0xc52735, 0.7, "Cranberry"),
|
||||
Grapefruit("Grapefruit Juice", "juiceGrapefruit", 0xf29255, 0.6, "Grapefruit"),
|
||||
Olive("Olive Oil", "juiceOlive", 0xf4c900, 0.6, "Olive"),
|
||||
Pineapple("Pineapple Juice", "juicePineapple", 0xe7c547, 0.6, "Pineapple"),
|
||||
Pear("Pear Juice", "juicePear", 0xd8bf65, 0.6, "Pear"),
|
||||
WhiteGrape("White Grape Juice", "juiceWhiteGrape", 0xfbe379, 0.6, "WhiteGrape"),
|
||||
RedGrape("Red Grape Juice", "juiceRedGrape", 0x952934, 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;
|
||||
}
|
||||
protected String name;
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int colour;
|
||||
protected float transparency;
|
||||
|
||||
private Juice(final String name, final String ident, final int colour, final double transparency, final String squeezing) {
|
||||
Juice(String name, String ident, int colour, double transparency, String squeezing) {
|
||||
this.name = name;
|
||||
this.ident = ident;
|
||||
this.colour = colour;
|
||||
this.transparency = (float) transparency;
|
||||
this.addSqueezing("crop" + squeezing);
|
||||
addSqueezing("crop" + squeezing);
|
||||
}
|
||||
|
||||
private void addSqueezing(String oreDict) {
|
||||
squeezing = oreDict;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceIn(final FluidContainer container) {
|
||||
public boolean canPlaceIn(FluidContainer container) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showInCreative(final FluidContainer container) {
|
||||
public boolean showInCreative(FluidContainer container) {
|
||||
return container == FluidContainer.Glass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return this.icon;
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcon(final IIconRegister register) {
|
||||
this.icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
|
||||
public void registerIcon(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.name;
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return "binnie." + this.ident;
|
||||
return "binnie." + ident;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return this.colour;
|
||||
return colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(this.getIdentifier(), amount);
|
||||
public FluidStack get(int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransparency() {
|
||||
return (int) (Math.min(1.0, this.transparency + 0.3) * 255.0);
|
||||
return (int) (Math.min(1.0, transparency + 0.3) * 255.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip(final int ratio) {
|
||||
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + this.getName();
|
||||
public String getTooltip(int ratio) {
|
||||
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.getColor();
|
||||
public int getContainerColor() {
|
||||
return getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,123 +1,31 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol;
|
||||
|
||||
import binnie.Binnie;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import binnie.core.liquid.FluidContainer;
|
||||
import binnie.core.liquid.IFluidType;
|
||||
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;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
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 getColor() {
|
||||
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.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getABV() {
|
||||
return this.abv;
|
||||
}
|
||||
public enum Liqueur implements IFluidType, ICocktailLiquid {
|
||||
Almond("Almond", 0xe45d2f, 0.3, 0.2),
|
||||
Orange("Orange", 0xf98900, 0.4, 0.2),
|
||||
Banana("Banana", 0xf8c200, 0.5, 0.2),
|
||||
Chocolate("Chocolate", 0xc14b20, 0.3, 0.2),
|
||||
Mint("Mint", 0x29c67c, 0.4, 0.2),
|
||||
Hazelnut("Hazelnut", 0xed982b, 0.3, 0.2),
|
||||
Cinnamon("Cinnamon", 0xe55000, 0.3, 0.2),
|
||||
Coffee("Coffee", 0x964319, 0.4, 0.2),
|
||||
Melon("Melon", 0xb0c231, 0.4, 0.2),
|
||||
Anise("Anise", 0xdae1e9, 0.3, 0.2),
|
||||
Peach("Peach", 0xfe9560, 0.4, 0.2),
|
||||
Lemon("Lemon", 0xf8e46d, 0.4, 0.2),
|
||||
Herbal("Herbal", 0xfed501, 0.3, 0.2),
|
||||
Cherry("Cherry", 0xd71901, 0.5, 0.2),
|
||||
Blackcurrant("Blackcurrant", 0x6a3d6d, 0.5, 0.2),
|
||||
Blackberry("Blackberry", 0x68554d, 0.5, 0.2),
|
||||
Raspberry("Raspberry", 0x9b0300, 0.5, 0.2);
|
||||
|
||||
static {
|
||||
Liqueur.Almond.addFlavour("cropAlmond");
|
||||
@@ -138,4 +46,91 @@ public enum Liqueur implements IFluidType, ICocktailLiquid
|
||||
Liqueur.Blackberry.addFlavour("cropBlackberry");
|
||||
Liqueur.Raspberry.addFlavour("cropRaspberry");
|
||||
}
|
||||
|
||||
protected String name;
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int colour;
|
||||
protected float transparency;
|
||||
protected float abv;
|
||||
|
||||
Liqueur(String name, int colour, double transparency, double abv) {
|
||||
this(name + " Liqueur", "liqueur" + name, colour, transparency, abv);
|
||||
}
|
||||
|
||||
Liqueur(String name, String ident, int colour, double transparency, double abv) {
|
||||
this.name = name;
|
||||
this.ident = ident;
|
||||
this.colour = colour;
|
||||
this.transparency = (float) transparency;
|
||||
this.abv = (float) abv;
|
||||
}
|
||||
|
||||
private void addFlavour(String oreDict) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceIn(FluidContainer container) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showInCreative(FluidContainer container) {
|
||||
return container == FluidContainer.Glass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcon(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return "binnie." + ident;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack get(int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransparency() {
|
||||
return (int) (Math.min(1.0, transparency + 0.3) * 255.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip(int ratio) {
|
||||
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColor() {
|
||||
return getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getABV() {
|
||||
return abv;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,30 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol;
|
||||
|
||||
import binnie.Binnie;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import binnie.core.liquid.FluidContainer;
|
||||
import binnie.core.liquid.IFluidType;
|
||||
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;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
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);
|
||||
public enum MiscFluid implements IFluidType, ICocktailLiquid {
|
||||
CarbonatedWater("Carbonated Water", "water.carbonated", 0xccccff, 0.10000000149011612),
|
||||
TonicWater("Tonic Water", "water.tonic", 0xccccff, 0.10000000149011612),
|
||||
Cream("Carbonated Water", "cream", 0xeaeade, 2.0),
|
||||
GingerAle("Ginger Ale", "gingerAle", 0xffffff, 0.6000000238418579),
|
||||
Coffee("Coffee", "coffee", 0x5a3105, 0.30000001192092896),
|
||||
SugarSyrup("Simple Syrup", "syrup.simple", 0xf5f8f1, 0.10000000149011612),
|
||||
AgaveNectar("Agave Nectar", "syrup.agave", 0xcf7e25, 0.699999988079071),
|
||||
GrenadineSyrup("Grenadine Syrup", "syrup.grenadine", 0xf44965, 0.800000011920929);
|
||||
|
||||
String name;
|
||||
String ident;
|
||||
IIcon icon;
|
||||
int colour;
|
||||
float transparency;
|
||||
protected String name;
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int colour;
|
||||
protected float transparency;
|
||||
|
||||
private MiscFluid(final String name, final String ident, final int colour, final double transparency) {
|
||||
MiscFluid(String name, String ident, int colour, double transparency) {
|
||||
this.name = name;
|
||||
this.ident = ident;
|
||||
this.colour = colour;
|
||||
@@ -38,62 +33,62 @@ public enum MiscFluid implements IFluidType, ICocktailLiquid
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceIn(final FluidContainer container) {
|
||||
public boolean canPlaceIn(FluidContainer container) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showInCreative(final FluidContainer container) {
|
||||
public boolean showInCreative(FluidContainer container) {
|
||||
return container == FluidContainer.Glass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return this.icon;
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcon(final IIconRegister register) {
|
||||
this.icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
|
||||
public void registerIcon(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.name;
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return "binnie." + this.ident;
|
||||
return "binnie." + ident;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return this.colour;
|
||||
return colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(this.getIdentifier(), amount);
|
||||
public FluidStack get(int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransparency() {
|
||||
return (int) (Math.min(1.0, this.transparency + 0.3) * 255.0);
|
||||
return (int) (Math.min(1.0, transparency + 0.3) * 255.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip(final int ratio) {
|
||||
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + this.getName();
|
||||
public String getTooltip(int ratio) {
|
||||
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.getColor();
|
||||
public int getContainerColor() {
|
||||
return getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,36 +1,30 @@
|
||||
//
|
||||
// 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.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
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;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.alcohol.drink.CocktailRenderer;
|
||||
import binnie.extratrees.alcohol.drink.DrinkLiquid;
|
||||
import binnie.extratrees.alcohol.drink.DrinkManager;
|
||||
import binnie.extratrees.alcohol.drink.ItemDrink;
|
||||
import binnie.extratrees.item.Food;
|
||||
import binnie.extratrees.machines.Brewery;
|
||||
import binnie.extratrees.machines.Distillery;
|
||||
import binnie.extratrees.machines.Press;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class ModuleAlcohol implements IInitializable
|
||||
{
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ModuleAlcohol implements IInitializable {
|
||||
public static int drinkRendererID;
|
||||
public static BinnieIcon liquid;
|
||||
|
||||
@@ -44,41 +38,44 @@ public class ModuleAlcohol implements IInitializable
|
||||
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()) {
|
||||
|
||||
for (Juice juice : Juice.values()) {
|
||||
Cocktail.registerIngredient(juice);
|
||||
}
|
||||
for (final Alcohol juice2 : Alcohol.values()) {
|
||||
for (Alcohol juice2 : Alcohol.values()) {
|
||||
Cocktail.registerIngredient(juice2);
|
||||
}
|
||||
for (final Spirit juice3 : Spirit.values()) {
|
||||
for (Spirit juice3 : Spirit.values()) {
|
||||
Cocktail.registerIngredient(juice3);
|
||||
}
|
||||
for (final Liqueur juice4 : Liqueur.values()) {
|
||||
for (Liqueur juice4 : Liqueur.values()) {
|
||||
Cocktail.registerIngredient(juice4);
|
||||
}
|
||||
DrinkManager.registerDrinkLiquid("water", new DrinkLiquid("Water", 13421823, 0.1f, 0.0f));
|
||||
DrinkManager.registerDrinkLiquid("water", new DrinkLiquid("Water", 0xccccff, 0.1f, 0.0f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (final Juice juice : Juice.values()) {
|
||||
final String oreDict = juice.squeezing;
|
||||
final List<ItemStack> ores = new ArrayList<ItemStack>();
|
||||
for (Juice juice : Juice.values()) {
|
||||
String oreDict = juice.squeezing;
|
||||
List<ItemStack> ores = new ArrayList<ItemStack>();
|
||||
ores.addAll(OreDictionary.getOres(oreDict));
|
||||
for (final Food food : Food.values()) {
|
||||
for (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()) {
|
||||
|
||||
for (ItemStack stack : ores) {
|
||||
for (Map.Entry<Object[], Object[]> entry : RecipeManagers.squeezerManager.getRecipes().entrySet()) {
|
||||
try {
|
||||
final ItemStack input = (ItemStack) entry.getKey()[0];
|
||||
final FluidStack output = (FluidStack) entry.getValue()[1];
|
||||
ItemStack input = (ItemStack) entry.getKey()[0];
|
||||
FluidStack output = (FluidStack) entry.getValue()[1];
|
||||
if (!ItemStack.areItemStacksEqual(stack, input) && !OreDictionary.itemMatches(input, stack, true)) {
|
||||
continue;
|
||||
}
|
||||
@@ -88,45 +85,48 @@ public class ModuleAlcohol implements IInitializable
|
||||
}
|
||||
Press.addRecipe(stack, juice.get(amount));
|
||||
} catch (Exception ex) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (final Alcohol alcohol : Alcohol.values()) {
|
||||
for (final String fermentLiquid : alcohol.fermentationLiquid) {
|
||||
final FluidStack fluid = Binnie.Liquid.getLiquidStack(fermentLiquid, 5);
|
||||
|
||||
for (Alcohol alcohol : Alcohol.values()) {
|
||||
for (String fermentLiquid : alcohol.fermentationLiquid) {
|
||||
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);
|
||||
addDistillery(Alcohol.Apple, Spirit.AppleBrandy, Spirit.AppleLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Pear, Spirit.PearBrandy, Spirit.PearLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Apricot, Spirit.ApricotBrandy, Spirit.ApricotLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Banana, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Cherry, Spirit.CherryBrandy, Spirit.CherryLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Elderberry, Spirit.ElderberryBrandy, Spirit.ElderberryLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Peach, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Plum, Spirit.PlumBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Carrot, Spirit.FruitBrandy, Spirit.Vodka, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.WhiteWine, Spirit.Brandy, Spirit.Brandy, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.RedWine, Spirit.Brandy, Spirit.Brandy, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.SparklingWine, Spirit.Brandy, Spirit.Brandy, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Agave, Spirit.Tequila, Spirit.Tequila, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Potato, Spirit.FruitBrandy, Spirit.Vodka, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Citrus, Spirit.CitrusBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Cranberry, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Pineapple, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Tomato, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Fruit, Spirit.FruitBrandy, Spirit.FruitLiquor, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Barley, Spirit.Whiskey, Spirit.Vodka, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Wheat, Spirit.WheatWhiskey, Spirit.Vodka, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Rye, Spirit.RyeWhiskey, Spirit.Vodka, Spirit.NeutralSpirit);
|
||||
addDistillery(Alcohol.Corn, Spirit.CornWhiskey, Spirit.Vodka, Spirit.NeutralSpirit);
|
||||
}
|
||||
|
||||
private void addDistillery(final IFluidType source, final IFluidType a, final IFluidType b, final IFluidType c) {
|
||||
private void addDistillery(IFluidType source, IFluidType a, IFluidType b, 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);
|
||||
|
||||
@@ -1,55 +1,50 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol;
|
||||
|
||||
import binnie.Binnie;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import binnie.core.liquid.FluidContainer;
|
||||
import binnie.core.liquid.IFluidType;
|
||||
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;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
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);
|
||||
public enum Spirit implements IFluidType, ICocktailLiquid {
|
||||
NeutralSpirit("Neutral Spirit", "spiritNeutral", 0xffffff, 0.05, 0.8),
|
||||
Vodka("Vodka", "vodka", 0xf4f5f7, 0.05, 0.4),
|
||||
WhiteRum("White Rum", "rumWhite", 0xe6e5e4, 0.05, 0.4),
|
||||
DarkRum("Dark Rum", "rumDark", 0xa82200, 0.4, 0.4),
|
||||
Whiskey("Whiskey", "whiskey", 0xcf6f00, 0.2, 0.4),
|
||||
CornWhiskey("Bourbon", "whiskeyCorn", 0x961201, 0.2, 0.4),
|
||||
RyeWhiskey("Rye Whiskey", "whiskeyRye", 0xf57328, 0.2, 0.4),
|
||||
WheatWhiskey("Wheat Whiskey", "whiskeyWheat", 0xe48612, 0.2, 0.4),
|
||||
FortifiedWine("Fortified Wine", "wineFortified", 0xed921f, 0.2, 0.2),
|
||||
Tequila("Tequila", "tequila", 0xf5e9c0, 0.05, 0.4),
|
||||
Brandy("Brandy", "brandyGrape", 0xf79f20, 0.2, 0.4),
|
||||
AppleBrandy("Apple Brandy", "brandyApple", 0xe4aa3e, 0.2, 0.4),
|
||||
PearBrandy("Pear Brandy", "brandyPear", 0xfec633, 0.2, 0.4),
|
||||
ApricotBrandy("Apricot Brandy", "brandyApricot", 0xcb7f43, 0.2, 0.4),
|
||||
PlumBrandy("Plum Brandy", "brandyPlum", 0x912311, 0.2, 0.4),
|
||||
CherryBrandy("Cherry Brandy", "brandyCherry", 0x830b1e, 0.2, 0.4),
|
||||
ElderberryBrandy("Elderberry Brandy", "brandyElderberry", 0xbe2b47, 0.2, 0.4),
|
||||
CitrusBrandy("Citrus Brandy", "brandyCitrus", 0xcb7f43, 0.2, 0.4),
|
||||
FruitBrandy("Fruit Brandy", "brandyFruit", 0xe4aa3e, 0.2, 0.4),
|
||||
Cachaca("Cachaca", "spiritSugarcane", 0xe9f0cf, 0.1, 0.4),
|
||||
Gin("Gin", "spiritGin", 0xf6f6f6, 0.05, 0.4),
|
||||
AppleLiquor("Apple Liquor", "liquorApple", 0xcccccc, 0.05, 0.4),
|
||||
PearLiquor("Pear Liquor", "liquorPear", 0xcccccc, 0.05, 0.4),
|
||||
CherryLiquor("Cherry Liquor", "liquorCherry", 0xcccccc, 0.05, 0.4),
|
||||
ElderberryLiquor("Elderberry Liquor", "liquorElderberry", 0xcccccc, 0.05, 0.4),
|
||||
ApricotLiquor("Apricot Liquor", "liquorApricot", 0xcccccc, 0.05, 0.4),
|
||||
FruitLiquor("Fruit Liquor", "liquorFruit", 0xcccccc, 0.05, 0.4);
|
||||
|
||||
String name;
|
||||
String ident;
|
||||
IIcon icon;
|
||||
int colour;
|
||||
float transparency;
|
||||
float abv;
|
||||
protected String name;
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int colour;
|
||||
protected float transparency;
|
||||
protected float abv;
|
||||
|
||||
private Spirit(final String name, final String ident, final int colour, final double transparency, final double abv) {
|
||||
Spirit(String name, String ident, int colour, double transparency, double abv) {
|
||||
this.name = name;
|
||||
this.ident = ident;
|
||||
this.colour = colour;
|
||||
@@ -59,66 +54,66 @@ public enum Spirit implements IFluidType, ICocktailLiquid
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceIn(final FluidContainer container) {
|
||||
public boolean canPlaceIn(FluidContainer container) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showInCreative(final FluidContainer container) {
|
||||
public boolean showInCreative(FluidContainer container) {
|
||||
return container == FluidContainer.Glass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return this.icon;
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcon(final IIconRegister register) {
|
||||
this.icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
|
||||
public void registerIcon(IIconRegister register) {
|
||||
icon = ExtraTrees.proxy.getIcon(register, "liquids/liquid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.name;
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return "binnie." + this.ident;
|
||||
return "binnie." + ident;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return this.colour;
|
||||
return colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(this.getIdentifier(), amount);
|
||||
public FluidStack get(int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(getIdentifier(), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransparency() {
|
||||
return (int) (Math.min(1.0, this.transparency + 0.3) * 255.0);
|
||||
return (int) (Math.min(1.0, transparency + 0.3) * 255.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip(final int ratio) {
|
||||
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + this.getName();
|
||||
public String getTooltip(int ratio) {
|
||||
return ratio + " Part" + ((ratio > 1) ? "s " : " ") + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.getColor();
|
||||
public int getContainerColor() {
|
||||
return getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getABV() {
|
||||
return this.abv;
|
||||
return abv;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,20 @@
|
||||
//
|
||||
// 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;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDrink extends BlockContainer
|
||||
{
|
||||
// TODO unused class?
|
||||
public class BlockDrink extends BlockContainer {
|
||||
public BlockDrink() {
|
||||
super(Material.glass);
|
||||
this.setBlockName("drink");
|
||||
this.setCreativeTab(CreativeTabs.tabTools);
|
||||
setBlockName("drink");
|
||||
setCreativeTab(CreativeTabs.tabTools);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,7 +24,7 @@ public class BlockDrink extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityDrink();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,39 +1,35 @@
|
||||
//
|
||||
// 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;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class BlockDrinkRenderer implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
// TODO unused class?
|
||||
public class BlockDrinkRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(final Block block, final int metadata, final int modelId, final RenderBlocks renderer) {
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@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) {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
Tessellator.instance.setColorRGBA(255, 255, 255, 150);
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
Tessellator tess = Tessellator.instance;
|
||||
renderer.renderFaceYPos(block, x, y, z, Blocks.dirt.getIcon(0, 0));
|
||||
final float s = 0.0625f;
|
||||
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;
|
||||
float d1 = 8.0f * s;
|
||||
float h2 = 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);
|
||||
tess.addVertexWithUV(x + 0.5f + d1, y + h2, 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();
|
||||
@@ -41,7 +37,7 @@ public class BlockDrinkRenderer implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(final int modelId) {
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,49 +1,45 @@
|
||||
//
|
||||
// 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 binnie.extratrees.alcohol.Glassware;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
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();
|
||||
public class CocktailRenderer implements IItemRenderer {
|
||||
private void renderCocktail(RenderBlocks renderBlocks, ItemStack item, float p, float q, float r) {
|
||||
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);
|
||||
Glassware glass = ExtraTrees.drink.getGlassware(item);
|
||||
FluidStack fluid = ExtraTrees.drink.getFluid(item);
|
||||
IDrinkLiquid drink = (fluid == null) ? null : DrinkManager.getLiquid(fluid.getFluid());
|
||||
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;
|
||||
setColor(drink.getColour(), 1.2f * drink.getTransparency() + 0.3f);
|
||||
IIcon icon = glass.contents;
|
||||
float amount = fluid.amount / glass.getVolume();
|
||||
float level = glass.getContentHeight() * (1.0f - amount);
|
||||
float gapAtTop = 1.0f - (glass.getContentBottom() + glass.getContentHeight());
|
||||
float x = 0.0f;
|
||||
float y = 16.0f * (gapAtTop + level);
|
||||
float w = 16.0f;
|
||||
float h = 16.0f - y;
|
||||
float minV = icon.getInterpolatedV(y);
|
||||
float maxV = icon.getInterpolatedV(16.0);
|
||||
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);
|
||||
@@ -54,116 +50,107 @@ public class CocktailRenderer implements IItemRenderer
|
||||
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;
|
||||
private void setColor(int i1, float alpha) {
|
||||
float f = (i1 >> 16 & 0xFF) / 255.0f;
|
||||
float f2 = (i1 >> 8 & 0xFF) / 255.0f;
|
||||
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) {
|
||||
private void renderFace(Tessellator tessellator, 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;
|
||||
}
|
||||
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) {
|
||||
public boolean handleRenderType(ItemStack item, 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;
|
||||
}
|
||||
case ENTITY:
|
||||
case EQUIPPED:
|
||||
case INVENTORY:
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
}
|
||||
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;
|
||||
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, 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) {
|
||||
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, 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();
|
||||
case ENTITY:
|
||||
case EQUIPPED:
|
||||
case EQUIPPED_FIRST_PERSON: {
|
||||
if (type == IItemRenderer.ItemRenderType.ENTITY) {
|
||||
GL11.glTranslatef(-0.5f, -0.25f, -0.0f);
|
||||
}
|
||||
TextureManager texturemanager = BinnieCore.proxy.getMinecraftInstance().getTextureManager();
|
||||
Glassware glass = ExtraTrees.drink.getGlassware(item);
|
||||
FluidStack fluid = ExtraTrees.drink.getFluid(item);
|
||||
IIcon iicon = glass.glass;
|
||||
float f = iicon.getMinU();
|
||||
float f2 = iicon.getMaxU();
|
||||
float f3 = iicon.getMinV();
|
||||
float f4 = iicon.getMaxV();
|
||||
texturemanager.bindTexture(texturemanager.getResourceLocation(item.getItemSpriteNumber()));
|
||||
TextureUtil.func_152777_a(false, false, 1.0f);
|
||||
setColor(0xffffff, 0.8f);
|
||||
IDrinkLiquid drink = (fluid == null) ? null : DrinkManager.getLiquid(fluid.getFluid());
|
||||
setColor(0xffffff, 0.8f);
|
||||
ItemRenderer.renderItemIn2D(Tessellator.instance, f2, f3, f, f4, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625f);
|
||||
if (drink != null) {
|
||||
setColor(drink.getColour(), 1.2f * drink.getTransparency() + 0.3f);
|
||||
iicon = glass.contents;
|
||||
IIcon icon = glass.contents;
|
||||
float amount = fluid.amount / glass.getVolume();
|
||||
float level = glass.getContentHeight() * (1.0f - amount);
|
||||
float gapAtTop = 1.0f - (glass.getContentBottom() + glass.getContentHeight());
|
||||
float x = 0.0f;
|
||||
float y = 1.0f * (gapAtTop + level);
|
||||
float w = 1.0f;
|
||||
float h = 1.0f - y;
|
||||
float minV = icon.getInterpolatedV(y * 16.0f);
|
||||
float maxV = icon.getInterpolatedV(16.0);
|
||||
float minU = icon.getMinU();
|
||||
float maxU = icon.getMaxU();
|
||||
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: {
|
||||
renderCocktail((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
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) {
|
||||
public void renderItemIn2DPercentage(Tessellator tesselator, float maxU, float minV, float minU, float maxV, int width, int height, float depth, float percent) {
|
||||
maxV = minV + (maxV - minV) * 1.0f;
|
||||
tesselator.startDrawingQuads();
|
||||
tesselator.setNormal(0.0f, 0.0f, 1.0f);
|
||||
@@ -179,13 +166,13 @@ public class CocktailRenderer implements IItemRenderer
|
||||
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;
|
||||
float f5 = 0.5f * (maxU - minU) / width;
|
||||
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;
|
||||
float f7 = k / width;
|
||||
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);
|
||||
@@ -195,9 +182,9 @@ public class CocktailRenderer implements IItemRenderer
|
||||
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;
|
||||
float f7 = k / width;
|
||||
float f8 = maxU + (minU - maxU) * f7 - f5;
|
||||
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);
|
||||
@@ -207,9 +194,9 @@ public class CocktailRenderer implements IItemRenderer
|
||||
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;
|
||||
float f7 = k / height;
|
||||
float f8 = maxV + (minV - maxV) * f7 - f6;
|
||||
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);
|
||||
@@ -219,8 +206,8 @@ public class CocktailRenderer implements IItemRenderer
|
||||
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;
|
||||
float f7 = k / height;
|
||||
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);
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
//
|
||||
// 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 class DrinkLiquid implements IDrinkLiquid {
|
||||
public String ident;
|
||||
|
||||
public DrinkLiquid(final String name, final int colour, final float transparency, final float abv) {
|
||||
protected String name;
|
||||
protected int colour;
|
||||
protected float transparency;
|
||||
protected float abv;
|
||||
|
||||
public DrinkLiquid(String name, int colour, float transparency, float abv) {
|
||||
this.name = name;
|
||||
this.colour = colour;
|
||||
this.transparency = transparency;
|
||||
@@ -29,36 +25,36 @@ public class DrinkLiquid implements IDrinkLiquid
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return this.colour;
|
||||
return colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.name;
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTransparency() {
|
||||
return this.transparency;
|
||||
return transparency;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return this.ident;
|
||||
return ident;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdent(final String lowerCase) {
|
||||
this.ident = lowerCase;
|
||||
public void setIdent(String lowerCase) {
|
||||
ident = lowerCase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getABV() {
|
||||
return this.abv;
|
||||
return abv;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(this.ident, amount);
|
||||
public FluidStack get(int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(ident, amount);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,31 @@
|
||||
//
|
||||
// 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 net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DrinkManager
|
||||
{
|
||||
static Map<String, IDrinkLiquid> drinkLiquids;
|
||||
public class DrinkManager {
|
||||
protected static Map<String, IDrinkLiquid> drinkLiquids = new HashMap<>();
|
||||
|
||||
public static IDrinkLiquid getLiquid(final String id) {
|
||||
public static IDrinkLiquid getLiquid(String id) {
|
||||
return DrinkManager.drinkLiquids.get(id.toLowerCase());
|
||||
}
|
||||
|
||||
public static void registerDrinkLiquid(final String id, final IDrinkLiquid liquid) {
|
||||
public static void registerDrinkLiquid(String id, IDrinkLiquid liquid) {
|
||||
liquid.setIdent(id.toLowerCase());
|
||||
DrinkManager.drinkLiquids.put(id.toLowerCase(), liquid);
|
||||
}
|
||||
|
||||
public static IDrinkLiquid getLiquid(final Fluid fluid) {
|
||||
public static IDrinkLiquid getLiquid(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>();
|
||||
public static IDrinkLiquid getLiquid(FluidStack fluid) {
|
||||
if (fluid == null) {
|
||||
return null;
|
||||
}
|
||||
return getLiquid(fluid.getFluid());
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,5 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol.drink;
|
||||
|
||||
public interface IAlcoholic
|
||||
{
|
||||
public interface IAlcoholic {
|
||||
float getABV();
|
||||
}
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol.drink;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public interface IDrinkLiquid
|
||||
{
|
||||
public interface IDrinkLiquid {
|
||||
boolean isConsumable();
|
||||
|
||||
int getColour();
|
||||
@@ -18,9 +13,9 @@ public interface IDrinkLiquid
|
||||
|
||||
String getIdentifier();
|
||||
|
||||
void setIdent(final String p0);
|
||||
void setIdent(String lowerCase);
|
||||
|
||||
float getABV();
|
||||
|
||||
FluidStack get(final int p0);
|
||||
FluidStack get(int amount);
|
||||
}
|
||||
@@ -1,79 +1,74 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol.drink;
|
||||
|
||||
import net.minecraft.item.EnumAction;
|
||||
import binnie.extratrees.alcohol.Alcohol;
|
||||
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 binnie.extratrees.alcohol.Glassware;
|
||||
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.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
public class ItemDrink extends ItemFood implements IFluidContainerItem
|
||||
{
|
||||
import java.util.List;
|
||||
|
||||
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();
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setUnlocalizedName("drink");
|
||||
setHasSubtypes(true);
|
||||
setMaxStackSize(1);
|
||||
setAlwaysEdible();
|
||||
}
|
||||
|
||||
public Glassware getGlassware(final ItemStack container) {
|
||||
public Glassware getGlassware(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);
|
||||
public ItemStack getStack(Glassware glass, FluidStack fluid) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
saveGlassware(glass, stack);
|
||||
saveFluid(fluid, stack);
|
||||
return stack;
|
||||
}
|
||||
|
||||
public void saveGlassware(final Glassware container, final ItemStack stack) {
|
||||
public void saveGlassware(Glassware container, 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) {
|
||||
public void saveFluid(FluidStack fluid, ItemStack stack) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
final NBTTagCompound nbt = stack.getTagCompound();
|
||||
|
||||
NBTTagCompound nbt = stack.getTagCompound();
|
||||
if (fluid == null) {
|
||||
nbt.removeTag("fluid");
|
||||
}
|
||||
else {
|
||||
final NBTTagCompound liq = new NBTTagCompound();
|
||||
} else {
|
||||
NBTTagCompound liq = new NBTTagCompound();
|
||||
fluid.writeToNBT(liq);
|
||||
nbt.setTag("fluid", liq);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack getFluid(final ItemStack container) {
|
||||
public FluidStack getFluid(ItemStack container) {
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("fluid")) {
|
||||
return null;
|
||||
}
|
||||
@@ -81,119 +76,126 @@ public class ItemDrink extends ItemFood implements IFluidContainerItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity(final ItemStack container) {
|
||||
return this.getGlassware(container).getCapacity();
|
||||
public int getCapacity(ItemStack container) {
|
||||
return getGlassware(container).getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(final ItemStack container, final FluidStack resource, final boolean doFill) {
|
||||
if (resource == null || !container.hasTagCompound()) {
|
||||
public int fill(ItemStack container, FluidStack resource, boolean doFill) {
|
||||
if (resource == null || !container.hasTagCompound() || DrinkManager.getLiquid(resource.getFluid()) == null) {
|
||||
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);
|
||||
|
||||
FluidStack existing = getFluid(container);
|
||||
int space = getGlassware(container).getCapacity() - ((existing == null) ? 0 : existing.amount);
|
||||
int added = Math.min(space, resource.amount);
|
||||
if (space <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (existing == null) {
|
||||
if (doFill) {
|
||||
final FluidStack fill = resource.copy();
|
||||
FluidStack fill = resource.copy();
|
||||
fill.amount = added;
|
||||
this.saveFluid(fill, container);
|
||||
saveFluid(fill, container);
|
||||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
if (!existing.isFluidEqual(resource)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (doFill) {
|
||||
final FluidStack fill = existing.copy();
|
||||
FluidStack fill = existing.copy();
|
||||
fill.amount += added;
|
||||
this.saveFluid(fill, container);
|
||||
saveFluid(fill, container);
|
||||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(final ItemStack container, final int maxDrain, final boolean doDrain) {
|
||||
public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) {
|
||||
if (!container.hasTagCompound()) {
|
||||
return null;
|
||||
}
|
||||
final FluidStack content = this.getFluid(container);
|
||||
|
||||
FluidStack content = getFluid(container);
|
||||
if (content == null) {
|
||||
return null;
|
||||
}
|
||||
final int toRemove = Math.min(maxDrain, content.amount);
|
||||
|
||||
int toRemove = Math.min(maxDrain, content.amount);
|
||||
FluidStack fill = content.copy();
|
||||
final FluidStack drain = content.copy();
|
||||
FluidStack drain = content.copy();
|
||||
drain.amount = toRemove;
|
||||
fill.amount -= toRemove;
|
||||
if (fill.amount == 0) {
|
||||
fill = null;
|
||||
}
|
||||
|
||||
if (doDrain) {
|
||||
this.saveFluid(fill, container);
|
||||
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));
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (Glassware glassware : Glassware.values()) {
|
||||
list.add(getStack(glassware, null));
|
||||
}
|
||||
par3List.add(this.getStack(Glassware.Wine, Alcohol.RedWine.get(Glassware.Wine.getCapacity())));
|
||||
list.add(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());
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
FluidStack fluid = getFluid(stack);
|
||||
IDrinkLiquid liquid = (fluid == null) ? null : DrinkManager.getLiquid(fluid.getFluid());
|
||||
return 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);
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (Glassware glassware : Glassware.values()) {
|
||||
glassware.registerIcons(register);
|
||||
}
|
||||
}
|
||||
|
||||
@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);
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
Glassware glass = getGlassware(stack);
|
||||
return (pass == 0) ? glass.glass : ((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());
|
||||
public int getColorFromItemStack(ItemStack stack, int pass) {
|
||||
FluidStack fluid = getFluid(stack);
|
||||
IDrinkLiquid drink = (fluid == null) ? null : DrinkManager.getLiquid(fluid.getFluid());
|
||||
if (pass == 0 || drink == null) {
|
||||
return 0xffffff;
|
||||
}
|
||||
return drink.getColour();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderPasses(final int metadata) {
|
||||
public int getRenderPasses(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_;
|
||||
public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) {
|
||||
drain(stack, 30, true);
|
||||
AlcoholEffect.makeDrunk(player, 2.1f);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(final ItemStack p_77661_1_) {
|
||||
return (this.getFluid(p_77661_1_) == null) ? EnumAction.none : EnumAction.drink;
|
||||
public EnumAction getItemUseAction(ItemStack stack) {
|
||||
return (getFluid(stack) == null) ? EnumAction.none : EnumAction.drink;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -203,13 +205,13 @@ public class ItemDrink extends ItemFood implements IFluidContainerItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(final ItemStack p_77626_1_) {
|
||||
public int getMaxItemUseDuration(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_;
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
player.setItemInUse(stack, getMaxItemUseDuration(stack));
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,6 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.alcohol.drink;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityDrink extends TileEntity
|
||||
{
|
||||
public class TileEntityDrink extends TileEntity {
|
||||
}
|
||||
@@ -1,10 +1,5 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.api;
|
||||
|
||||
public class CarpentryManager
|
||||
{
|
||||
public class CarpentryManager {
|
||||
public static ICarpentryInterface carpentryInterface;
|
||||
}
|
||||
@@ -1,34 +1,30 @@
|
||||
//
|
||||
// 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);
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
int getCarpentryWoodIndex(final IDesignMaterial p0);
|
||||
public interface ICarpentryInterface {
|
||||
boolean registerCarpentryWood(int index, IDesignMaterial wood);
|
||||
|
||||
IDesignMaterial getWoodMaterial(final int p0);
|
||||
int getCarpentryWoodIndex(IDesignMaterial wood);
|
||||
|
||||
boolean registerDesign(final int p0, final IDesign p1);
|
||||
IDesignMaterial getWoodMaterial(int index);
|
||||
|
||||
int getDesignIndex(final IDesign p0);
|
||||
boolean registerDesign(int index, IDesign wood);
|
||||
|
||||
IDesign getDesign(final int p0);
|
||||
int getDesignIndex(IDesign wood);
|
||||
|
||||
ILayout getLayout(final IPattern p0, final boolean p1);
|
||||
IDesign getDesign(int p0);
|
||||
|
||||
IDesignMaterial getWoodMaterial(final ItemStack p0);
|
||||
ILayout getLayout(IPattern pattern, boolean inverted);
|
||||
|
||||
boolean registerDesignCategory(final IDesignCategory p0);
|
||||
IDesignMaterial getWoodMaterial(ItemStack stack);
|
||||
|
||||
IDesignCategory getDesignCategory(final String p0);
|
||||
boolean registerDesignCategory(IDesignCategory category);
|
||||
|
||||
IDesignCategory getDesignCategory(String id);
|
||||
|
||||
Collection<IDesignCategory> getAllDesignCategories();
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.api;
|
||||
|
||||
public interface IDesign
|
||||
{
|
||||
public interface IDesign {
|
||||
String getName();
|
||||
|
||||
ILayout getTopPattern();
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IDesignCategory
|
||||
{
|
||||
public interface IDesignCategory {
|
||||
String getName();
|
||||
|
||||
List<IDesign> getDesigns();
|
||||
|
||||
void addDesign(final IDesign p0);
|
||||
void addDesign(IDesign design);
|
||||
|
||||
String getId();
|
||||
}
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IDesignMaterial
|
||||
{
|
||||
public interface IDesignMaterial {
|
||||
ItemStack getStack();
|
||||
|
||||
String getName();
|
||||
|
||||
@@ -1,30 +1,25 @@
|
||||
//
|
||||
// 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.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public interface IDesignSystem
|
||||
{
|
||||
IIcon getPrimaryIcon(final IPattern p0);
|
||||
public interface IDesignSystem {
|
||||
IIcon getPrimaryIcon(IPattern pattern);
|
||||
|
||||
IIcon getSecondaryIcon(final IPattern p0);
|
||||
IIcon getSecondaryIcon(IPattern pattern);
|
||||
|
||||
void registerIcons(final IIconRegister p0);
|
||||
void registerIcons(IIconRegister register);
|
||||
|
||||
IDesignMaterial getDefaultMaterial();
|
||||
|
||||
IDesignMaterial getMaterial(final int p0);
|
||||
IDesignMaterial getMaterial(int id);
|
||||
|
||||
int getMaterialIndex(final IDesignMaterial p0);
|
||||
int getMaterialIndex(IDesignMaterial wood);
|
||||
|
||||
IDesignMaterial getDefaultMaterial2();
|
||||
|
||||
ItemStack getAdhesive();
|
||||
|
||||
IDesignMaterial getMaterial(final ItemStack p0);
|
||||
IDesignMaterial getMaterial(ItemStack stack);
|
||||
}
|
||||
@@ -1,13 +1,8 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.api;
|
||||
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public interface ILayout
|
||||
{
|
||||
public interface ILayout {
|
||||
IPattern getPattern();
|
||||
|
||||
boolean isInverted();
|
||||
@@ -22,7 +17,7 @@ public interface ILayout
|
||||
|
||||
ILayout invert();
|
||||
|
||||
IIcon getPrimaryIcon(final IDesignSystem p0);
|
||||
IIcon getPrimaryIcon(IDesignSystem system);
|
||||
|
||||
IIcon getSecondaryIcon(final IDesignSystem p0);
|
||||
IIcon getSecondaryIcon(IDesignSystem system);
|
||||
}
|
||||
@@ -1,21 +1,16 @@
|
||||
//
|
||||
// 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);
|
||||
public interface IPattern {
|
||||
IIcon getPrimaryIcon(IDesignSystem system);
|
||||
|
||||
IIcon getSecondaryIcon(final IDesignSystem p0);
|
||||
IIcon getSecondaryIcon(IDesignSystem system);
|
||||
|
||||
ILayout getRotation();
|
||||
|
||||
ILayout getHorizontalFlip();
|
||||
|
||||
void registerIcons(final IIconRegister p0);
|
||||
void registerIcons(IIconRegister register);
|
||||
}
|
||||
@@ -1,15 +1,10 @@
|
||||
//
|
||||
// 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);
|
||||
public interface IToolHammer {
|
||||
boolean isActive(ItemStack stack);
|
||||
|
||||
void onHammerUsed(final ItemStack p0, final EntityPlayer p1);
|
||||
void onHammerUsed(ItemStack stack, EntityPlayer player);
|
||||
}
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import binnie.core.block.BlockMetadata;
|
||||
@@ -27,18 +23,18 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockBranch extends BlockLog implements IBlockMetadata
|
||||
{
|
||||
// TODO unused class?
|
||||
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);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("branch");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
for (int i = 0; i < ILogType.ExtraTreeLog.values().length; ++i) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, i));
|
||||
}
|
||||
@@ -46,17 +42,17 @@ public class BlockBranch extends BlockLog implements IBlockMetadata
|
||||
|
||||
@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);
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return this.getIcon(side, tile.getTileMetadata(), world.getBlockMetadata(x, y, z));
|
||||
return 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];
|
||||
public IIcon getIcon(int side, int tileMeta, int blockMeta) {
|
||||
int oriented = blockMeta & 0xC;
|
||||
ILogType.ExtraTreeLog log = ILogType.ExtraTreeLog.values()[tileMeta];
|
||||
if (side > 3) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
@@ -64,8 +60,8 @@ public class BlockBranch extends BlockLog implements IBlockMetadata
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int tileMeta) {
|
||||
return this.getIcon(side, tileMeta, 0);
|
||||
public IIcon getIcon(int side, int tileMeta) {
|
||||
return getIcon(side, tileMeta, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,65 +70,66 @@ public class BlockBranch extends BlockLog implements IBlockMetadata
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack itemStack) {
|
||||
this.dropBlockAsItem(world, x, y, z, itemStack);
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(final int meta) {
|
||||
public boolean hasTileEntity(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);
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return ILogType.ExtraTreeLog.values()[meta].getName() + " Branch";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack itemStack, final List tooltip) {
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack itemStack, final World world, final int x, final int y, final int z, final ForgeDirection direction) {
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@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);
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -28,22 +28,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
private IIcon getFlippedIcon(final boolean upper, final boolean flip, final int tileMeta) {
|
||||
final DoorType type = getDoorType(tileMeta);
|
||||
if (upper) {
|
||||
return flip ? type.iconDoorUpperFlip : type.iconDoorUpper;
|
||||
}
|
||||
return 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);
|
||||
setHardness(3.0f).setStepSound(Block.soundTypeWood);
|
||||
@@ -51,20 +35,36 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
setBlockName("door");
|
||||
}
|
||||
|
||||
public static DoorType getDoorType(int tileMeta) {
|
||||
int type = (tileMeta & 0xF00) >> 8;
|
||||
if (type >= 0 && type < DoorType.values().length) {
|
||||
return DoorType.values()[type];
|
||||
}
|
||||
return DoorType.Standard;
|
||||
}
|
||||
|
||||
private IIcon getFlippedIcon(boolean upper, boolean flip, int tileMeta) {
|
||||
DoorType type = getDoorType(tileMeta);
|
||||
if (upper) {
|
||||
return flip ? type.iconDoorUpperFlip : type.iconDoorUpper;
|
||||
}
|
||||
return flip ? type.iconDoorLowerFlip : type.iconDoorLower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return DoorType.Standard.iconDoorLower;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(final IBlockAccess blockAccess, final int x, final int y, final int z, final int par5) {
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int par5) {
|
||||
if (par5 != 1 && par5 != 0) {
|
||||
final int i1 = getFullMetadata(blockAccess, x, y, z);
|
||||
final int j1 = i1 & 0x3;
|
||||
final boolean flag = (i1 & 0x4) != 0;
|
||||
int i1 = getFullMetadata(blockAccess, x, y, z);
|
||||
int j1 = i1 & 0x3;
|
||||
boolean flag = (i1 & 0x4) != 0;
|
||||
boolean flag2;
|
||||
final boolean flag3 = (i1 & 0x8) != 0;
|
||||
boolean flag3 = (i1 & 0x8) != 0;
|
||||
if (flag) {
|
||||
flag2 = (j1 == 0 && par5 == 2)
|
||||
|| (j1 == 1 && par5 == 5)
|
||||
@@ -80,6 +80,7 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
flag2 = !flag2;
|
||||
}
|
||||
}
|
||||
|
||||
int tileMeta;
|
||||
if (flag3) {
|
||||
tileMeta = TileEntityMetadata.getTileMetadata(blockAccess, x, y - 1, z);
|
||||
@@ -93,8 +94,8 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister register) {
|
||||
for (final DoorType type : DoorType.values()) {
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (DoorType type : DoorType.values()) {
|
||||
type.iconDoorLower = ExtraTrees.proxy.getIcon(register, "door." + type.id + ".lower");
|
||||
type.iconDoorUpper = ExtraTrees.proxy.getIcon(register, "door." + type.id + ".upper");
|
||||
type.iconDoorLowerFlip = new IconFlipped(type.iconDoorLower, true, false);
|
||||
@@ -109,19 +110,20 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(final IBlockAccess blockAccess, final int x, final int y, final int z) {
|
||||
final int i1 = getFullMetadata(blockAccess, x, y, z);
|
||||
public int colorMultiplier(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
int i1 = getFullMetadata(blockAccess, x, y, z);
|
||||
if ((i1 & 0x8) != 0) {
|
||||
final int meta = TileEntityMetadata.getTileMetadata(blockAccess, x, y - 1, z);
|
||||
int meta = TileEntityMetadata.getTileMetadata(blockAccess, x, y - 1, z);
|
||||
return WoodManager.getPlankType(meta & 0xFF).getColour();
|
||||
}
|
||||
final int meta = TileEntityMetadata.getTileMetadata(blockAccess, x, y, z);
|
||||
|
||||
int meta = TileEntityMetadata.getTileMetadata(blockAccess, x, y, z);
|
||||
return WoodManager.getPlankType(meta & 0xFF).getColour();
|
||||
}
|
||||
|
||||
public int getFullMetadata(final IBlockAccess blockAccess, final int x, final int y, final int pzr4) {
|
||||
final int l = blockAccess.getBlockMetadata(x, y, pzr4);
|
||||
final boolean flag = (l & 0x8) != 0x0;
|
||||
public int getFullMetadata(IBlockAccess blockAccess, int x, int y, int pzr4) {
|
||||
int l = blockAccess.getBlockMetadata(x, y, pzr4);
|
||||
boolean flag = (l & 0x8) != 0x0;
|
||||
int i1;
|
||||
int j1;
|
||||
if (flag) {
|
||||
@@ -131,65 +133,66 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
i1 = l;
|
||||
j1 = blockAccess.getBlockMetadata(x, y + 1, pzr4);
|
||||
}
|
||||
final boolean flag2 = (j1 & 0x1) != 0x0;
|
||||
|
||||
boolean flag2 = (j1 & 0x1) != 0x0;
|
||||
return (i1 & 0x7) | (flag ? 8 : 0) | (flag2 ? 16 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onBlockHarvested(final World world, final int x, final int y, final int z, final int par5, final EntityPlayer player) {
|
||||
if (player.capabilities.isCreativeMode && (par5 & 0x8) != 0x0 && world.getBlock(x, y - 1, z) == this) {
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
|
||||
if (player.capabilities.isCreativeMode && (meta & 0x8) != 0x0 && world.getBlock(x, y - 1, z) == this) {
|
||||
world.setBlockToAir(x, y - 1, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune) {
|
||||
int yCoord = y;
|
||||
if ((blockMeta & 0x08) != 0) {
|
||||
if ((meta & 0x08) != 0) {
|
||||
yCoord -= 1;
|
||||
}
|
||||
return BlockMetadata.getBlockDropped(this, world, x, yCoord, z, blockMeta);
|
||||
return BlockMetadata.getBlockDropped(this, world, x, yCoord, z, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
// TODO fix deprecated code
|
||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World world, final int k) {
|
||||
public TileEntity createNewTileEntity(World world, int k) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(final int meta) {
|
||||
public boolean hasTileEntity(int meta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockEventReceived(final World world, final int x, final int y, final int z, final int eventId, final int eventType) {
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
final TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack stack, final World world, final int x, final int y, final int z, final ForgeDirection direction) {
|
||||
public int getPlacedMeta(ItemStack stack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
final String typeName = getDoorType(meta).getName();
|
||||
final String woodName = WoodManager.getPlankType(meta & 0xFF).getName();
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
String typeName = getDoorType(meta).getName();
|
||||
String woodName = WoodManager.getPlankType(meta & 0xFF).getName();
|
||||
if (typeName.equals("")) {
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.door.name", woodName);
|
||||
}
|
||||
@@ -197,61 +200,61 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack itemStack, final List tooltip) {
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack itemStack) {
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final List itemList) {
|
||||
for (final IPlankType type : PlankType.ExtraTreePlanks.values()) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List itemList) {
|
||||
for (IPlankType type : PlankType.ExtraTreePlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
}
|
||||
for (final IPlankType type : PlankType.ForestryPlanks.values()) {
|
||||
for (IPlankType type : PlankType.ForestryPlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
}
|
||||
for (final IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
}
|
||||
}
|
||||
for (final IPlankType type : PlankType.VanillaPlanks.values()) {
|
||||
for (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) {
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int par6) {
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6) {
|
||||
super.breakBlock(world, x, y, z, block, par6);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -1,93 +1,86 @@
|
||||
//
|
||||
// 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 binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
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.Block;
|
||||
import net.minecraft.block.BlockLog;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockETLog extends BlockLog implements IBlockMetadata
|
||||
{
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("log");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < ILogType.ExtraTreeLog.values().length; ++i) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, i));
|
||||
list.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);
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return this.getIcon(side, tile.getTileMetadata(), world.getBlockMetadata(x, y, z));
|
||||
return 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];
|
||||
public IIcon getIcon(int side, int tileMeta, int blockMeta) {
|
||||
int oriented = blockMeta & 0xC;
|
||||
ILogType.ExtraTreeLog log = ILogType.ExtraTreeLog.values()[tileMeta];
|
||||
switch (oriented) {
|
||||
case 4: {
|
||||
if (side > 3) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
}
|
||||
case 8: {
|
||||
if (side == 2 || side == 3) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
}
|
||||
default: {
|
||||
if (side < 2) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
case 4:
|
||||
if (side > 3) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
|
||||
case 8:
|
||||
if (side == 2 || side == 3) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
}
|
||||
if (side < 2) {
|
||||
return log.getTrunk();
|
||||
}
|
||||
return log.getBark();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int tileMeta) {
|
||||
return this.getIcon(side, tileMeta, 0);
|
||||
public IIcon getIcon(int side, int tileMeta) {
|
||||
return getIcon(side, tileMeta, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister register) {
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
ILogType.ExtraTreeLog.registerIcons(register);
|
||||
}
|
||||
|
||||
@@ -97,113 +90,112 @@ public class BlockETLog extends BlockLog implements IBlockMetadata
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack itemStack) {
|
||||
this.dropBlockAsItem(world, x, y, z, itemStack);
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
public TileEntity createNewTileEntity(World var1, int i) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(final int meta) {
|
||||
public boolean hasTileEntity(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);
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.log.name", ILogType.ExtraTreeLog.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack itemStack, final List tooltip) {
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainLeaves(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack itemStack, final World world, final int x, final int y, final int z, final ForgeDirection direction) {
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@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) {
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float par6, float par7, float par8, int meta) {
|
||||
byte b0 = 0;
|
||||
switch (side) {
|
||||
case 0:
|
||||
case 1: {
|
||||
b0 = 0;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
case 3: {
|
||||
b0 = 8;
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
case 5: {
|
||||
b0 = 4;
|
||||
break;
|
||||
}
|
||||
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);
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -1,153 +1,150 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
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 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.Block;
|
||||
import net.minecraft.block.BlockWood;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockETPlanks extends BlockWood implements IBlockMetadata
|
||||
{
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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);
|
||||
setBlockName("planks");
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
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) {
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
public TileEntity createNewTileEntity(World var1, int i) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(final int meta) {
|
||||
public boolean hasTileEntity(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);
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack itemStack, final World world, final int x, final int y, final int z, final ForgeDirection direction) {
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.plank.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack itemStack, final List tooltip) {
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack itemStack) {
|
||||
this.dropBlockAsItem(world, x, y, z, itemStack);
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, i));
|
||||
list.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);
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return this.getIcon(side, tile.getTileMetadata());
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
public IIcon getIcon(int side, 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()) {
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (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);
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -1,131 +1,128 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
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 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.Block;
|
||||
import net.minecraft.block.BlockWoodSlab;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
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;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
public BlockETSlab(boolean isDouble) {
|
||||
super(isDouble);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setHardness(2.0f).setResistance(5.0f).setStepSound(Block.soundTypeWood);
|
||||
if (!field_150004_a) {
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
this.setLightOpacity(0);
|
||||
this.setBlockName("slabs");
|
||||
|
||||
setLightOpacity(0);
|
||||
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>();
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
drops.addAll(BlockMetadata.getBlockDropped((IBlockMetadata) ExtraTrees.blockSlab, world, x, y, z, blockMeta));
|
||||
if (this.field_150004_a) {
|
||||
if (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) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(final int meta) {
|
||||
public boolean hasTileEntity(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);
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack itemStack, final World world, final int x, final int y, final int z, final ForgeDirection direction) {
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodslab.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack itemStack, final List tooltip) {
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack itemStack) {
|
||||
this.dropBlockAsItem(world, x, y, z, itemStack);
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
if (this.field_150004_a) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
if (field_150004_a) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, i));
|
||||
list.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);
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return this.getIcon(side, tile.getTileMetadata());
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
public IIcon getIcon(int side, 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);
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,27 +131,27 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -1,145 +1,141 @@
|
||||
//
|
||||
// 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 binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
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;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETStairs extends BlockStairs implements IBlockMetadata {
|
||||
public BlockETStairs(Block par2Block) {
|
||||
super(par2Block, 0);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("stairs");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
public 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) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
|
||||
for (int i = 0; i < PlankType.ExtraTreePlanks.values().length; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
list.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);
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return this.getIcon(side, tile.getTileMetadata());
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
public IIcon getIcon(int side, 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 itemStack) {
|
||||
this.dropBlockAsItem(world, x, y, z, itemStack);
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(final int meta) {
|
||||
public boolean hasTileEntity(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);
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack itemStack, final World world, final int x, final int y, final int z, final ForgeDirection direction) {
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodstairs.name", WoodManager.getPlankType(meta + 32).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack itemStack, final List tooltip) {
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@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);
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,24 @@
|
||||
//
|
||||
// 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;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BranchBlockRenderer implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public class BranchBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, 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);
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(final int i) {
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,82 +1,77 @@
|
||||
//
|
||||
// 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;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class DoorBlockRenderer implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public class DoorBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@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);
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
int c = block.colorMultiplier(renderer.blockAccess, x, y, z);
|
||||
float c2 = (c >> 16 & 0xFF) / 255.0f;
|
||||
float c3 = (c >> 8 & 0xFF) / 255.0f;
|
||||
float c4 = (c & 0xFF) / 255.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int l = renderer.blockAccess.getBlockMetadata(x, y, z);
|
||||
if ((l & 0x8) != 0x0) {
|
||||
if (renderer.blockAccess.getBlock(par2, par3 - 1, par4) != par1Block) {
|
||||
if (renderer.blockAccess.getBlock(x, y - 1, z) != block) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (renderer.blockAccess.getBlock(par2, par3 + 1, par4) != par1Block) {
|
||||
} else if (renderer.blockAccess.getBlock(x, y + 1, z) != block) {
|
||||
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));
|
||||
|
||||
float f = 0.5f;
|
||||
float f2 = 1.0f;
|
||||
float f3 = 0.8f;
|
||||
float f4 = 0.6f;
|
||||
|
||||
int i1 = block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z);
|
||||
tessellator.setBrightness((renderer.renderMinY > 0.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y - 1, z));
|
||||
tessellator.setColorOpaque_F(f * c2, f * c3, f * c4);
|
||||
renderer.renderFaceYNeg(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));
|
||||
renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 0));
|
||||
|
||||
tessellator.setBrightness((renderer.renderMaxY < 1.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y + 1, z));
|
||||
tessellator.setColorOpaque_F(f2 * c2, f2 * c3, f2 * c4);
|
||||
renderer.renderFaceYPos(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));
|
||||
renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 1));
|
||||
|
||||
tessellator.setBrightness((renderer.renderMinZ > 0.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z - 1));
|
||||
tessellator.setColorOpaque_F(f3 * c2, f3 * c3, f3 * c4);
|
||||
IIcon icon = renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 2);
|
||||
renderer.renderFaceZNeg(par1Block, par2, par3, par4, icon);
|
||||
flag = true;
|
||||
IIcon icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 2);
|
||||
renderer.renderFaceZNeg(block, x, y, z, icon);
|
||||
|
||||
renderer.flipTexture = false;
|
||||
tessellator.setBrightness((renderer.renderMaxZ < 1.0) ? i1 : par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2, par3, par4 + 1));
|
||||
tessellator.setBrightness((renderer.renderMaxZ < 1.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z + 1));
|
||||
tessellator.setColorOpaque_F(f3 * c2, f3 * c3, f3 * c4);
|
||||
icon = renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 3);
|
||||
renderer.renderFaceZPos(par1Block, par2, par3, par4, icon);
|
||||
flag = true;
|
||||
icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 3);
|
||||
renderer.renderFaceZPos(block, x, y, z, icon);
|
||||
|
||||
renderer.flipTexture = false;
|
||||
tessellator.setBrightness((renderer.renderMinX > 0.0) ? i1 : par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2 - 1, par3, par4));
|
||||
tessellator.setBrightness((renderer.renderMinX > 0.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x - 1, y, z));
|
||||
tessellator.setColorOpaque_F(f4 * c2, f4 * c3, f4 * c4);
|
||||
icon = renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 4);
|
||||
renderer.renderFaceXNeg(par1Block, par2, par3, par4, icon);
|
||||
flag = true;
|
||||
icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 4);
|
||||
renderer.renderFaceXNeg(block, x, y, z, icon);
|
||||
|
||||
renderer.flipTexture = false;
|
||||
tessellator.setBrightness((renderer.renderMaxX < 1.0) ? i1 : par1Block.getMixedBrightnessForBlock(renderer.blockAccess, par2 + 1, par3, par4));
|
||||
tessellator.setBrightness((renderer.renderMaxX < 1.0) ? i1 : block.getMixedBrightnessForBlock(renderer.blockAccess, x + 1, y, z));
|
||||
tessellator.setColorOpaque_F(f4 * c2, f4 * c3, f4 * c4);
|
||||
icon = renderer.getBlockIcon(par1Block, renderer.blockAccess, par2, par3, par4, 5);
|
||||
renderer.renderFaceXPos(par1Block, par2, par3, par4, icon);
|
||||
flag = true;
|
||||
icon = renderer.getBlockIcon(block, renderer.blockAccess, x, y, z, 5);
|
||||
renderer.renderFaceXPos(block, x, y, z, icon);
|
||||
renderer.flipTexture = false;
|
||||
return flag;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(final int i) {
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +1,26 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum DoorType
|
||||
{
|
||||
public enum DoorType {
|
||||
Standard("standard"),
|
||||
Solid("solid"),
|
||||
Double("double"),
|
||||
Full("full");
|
||||
|
||||
String id;
|
||||
IIcon iconDoorLower;
|
||||
IIcon iconDoorUpper;
|
||||
IIcon iconDoorLowerFlip;
|
||||
IIcon iconDoorUpperFlip;
|
||||
IIcon iconItem;
|
||||
protected String id;
|
||||
protected IIcon iconDoorLower;
|
||||
protected IIcon iconDoorUpper;
|
||||
protected IIcon iconDoorLowerFlip;
|
||||
protected IIcon iconDoorUpperFlip;
|
||||
protected IIcon iconItem;
|
||||
|
||||
private DoorType(final String iconName) {
|
||||
this.id = iconName;
|
||||
DoorType(String iconName) {
|
||||
id = iconName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.door.type." + this.id);
|
||||
return ExtraTrees.proxy.localise("block.door.type." + id);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,14 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
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;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum FruitPod implements IIconProvider
|
||||
{
|
||||
public enum FruitPod implements IIconProvider {
|
||||
Cocoa,
|
||||
Banana,
|
||||
Coconut,
|
||||
@@ -21,33 +16,37 @@ public enum FruitPod implements IIconProvider
|
||||
RedBanana,
|
||||
Papayimar;
|
||||
|
||||
short[] textures;
|
||||
IIcon[] icons;
|
||||
protected short[] textures;
|
||||
protected IIcon[] icons;
|
||||
|
||||
private FruitPod() {
|
||||
this.textures = new short[] { BinnieCore.proxy.getUniqueTextureUID(), BinnieCore.proxy.getUniqueTextureUID(), BinnieCore.proxy.getUniqueTextureUID() };
|
||||
this.icons = new IIcon[3];
|
||||
FruitPod() {
|
||||
textures = new short[]{
|
||||
BinnieCore.proxy.getUniqueTextureUID(),
|
||||
BinnieCore.proxy.getUniqueTextureUID(),
|
||||
BinnieCore.proxy.getUniqueTextureUID(),
|
||||
};
|
||||
icons = new IIcon[3];
|
||||
}
|
||||
|
||||
public short[] getTextures() {
|
||||
return this.textures;
|
||||
return textures;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(final short texUID) {
|
||||
final int index = this.textures[0] - texUID;
|
||||
public IIcon getIcon(short texUID) {
|
||||
int index = textures[0] - texUID;
|
||||
if (index >= 0 && index < 3) {
|
||||
return this.icons[index];
|
||||
return 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");
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icons[0] = ExtraTrees.proxy.getIcon(register, "pods/" + toString().toLowerCase() + ".0");
|
||||
icons[1] = ExtraTrees.proxy.getIcon(register, "pods/" + toString().toLowerCase() + ".1");
|
||||
icons[2] = ExtraTrees.proxy.getIcon(register, "pods/" + toString().toLowerCase() + ".2");
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,19 @@
|
||||
//
|
||||
// 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.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
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();
|
||||
public class GateItemRenderer implements IItemRenderer {
|
||||
private void renderStairBlock(RenderBlocks renderBlocks, ItemStack item, float f, float g, float h) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
IIcon textureIndex = WoodManager.getPlankType(item.getItemDamage()).getIcon();
|
||||
for (int k = 0; k < 3; ++k) {
|
||||
float f2 = 0.0625f;
|
||||
if (k == 0) {
|
||||
@@ -61,43 +56,36 @@ public class GateItemRenderer implements IItemRenderer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(final ItemStack item, final IItemRenderer.ItemRenderType type) {
|
||||
public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY: {
|
||||
return true;
|
||||
}
|
||||
case EQUIPPED: {
|
||||
return true;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return true;
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
case ENTITY:
|
||||
case EQUIPPED:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(final IItemRenderer.ItemRenderType type, final ItemStack item, final IItemRenderer.ItemRendererHelper helper) {
|
||||
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
|
||||
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, 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;
|
||||
}
|
||||
case ENTITY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
renderStairBlock((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,7 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IFenceProvider
|
||||
{
|
||||
public interface IFenceProvider {
|
||||
ItemStack getFence();
|
||||
}
|
||||
@@ -1,40 +1,27 @@
|
||||
//
|
||||
// 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 binnie.extratrees.api.IDesignMaterial;
|
||||
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.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface ILogType
|
||||
{
|
||||
void placeBlock(final World p0, final int p1, final int p2, final int p3);
|
||||
public interface ILogType {
|
||||
void placeBlock(World p0, int p1, int p2, int p3);
|
||||
|
||||
ItemStack getItemStack();
|
||||
|
||||
int getColour();
|
||||
|
||||
public enum ExtraTreeLog implements ILogType
|
||||
{
|
||||
enum ExtraTreeLog implements ILogType {
|
||||
Apple("Apple", 8092283, PlankType.ExtraTreePlanks.Apple),
|
||||
Fig("Fig", 8418135, PlankType.ExtraTreePlanks.Fig),
|
||||
Butternut("Butternut", 12037536, PlankType.ExtraTreePlanks.Butternut),
|
||||
@@ -76,75 +63,74 @@ public interface ILogType
|
||||
Cinnamon("Cinnamon", 8804412, PlankType.VanillaPlanks.JUNGLE),
|
||||
PinkIvory("Pink Ivory", 8349012, PlankType.ExtraTreePlanks.PinkIvory);
|
||||
|
||||
String name;
|
||||
int color;
|
||||
IDesignMaterial plank;
|
||||
IIcon trunk;
|
||||
IIcon bark;
|
||||
protected String name;
|
||||
protected int color;
|
||||
protected IDesignMaterial plank;
|
||||
protected IIcon trunk;
|
||||
protected IIcon bark;
|
||||
|
||||
private ExtraTreeLog(final String name, final int color) {
|
||||
this.plank = null;
|
||||
ExtraTreeLog(String name, int color) {
|
||||
plank = null;
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
private ExtraTreeLog(final String name, final int color, final IDesignMaterial plank) {
|
||||
ExtraTreeLog(String name, int color, 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()) {
|
||||
public static void registerIcons(IIconRegister register) {
|
||||
for (ExtraTreeLog log : values()) {
|
||||
log.trunk = ExtraTrees.proxy.getIcon(register, "logs/" + log.toString().toLowerCase() + "Trunk");
|
||||
log.bark = ExtraTrees.proxy.getIcon(register, "logs/" + log.toString().toLowerCase() + "Bark");
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
if (plank == null) {
|
||||
return;
|
||||
}
|
||||
ItemStack log = getItemStack();
|
||||
ItemStack result = plank.getStack();
|
||||
result.stackSize = 4;
|
||||
GameRegistry.addShapelessRecipe(result, log);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void placeBlock(World world, int x, int y, int z) {
|
||||
world.setBlock(x, y, z, ExtraTrees.blockLog, 0, 2);
|
||||
if (world.getTileEntity(x, y, z) != null) {
|
||||
((TileEntityMetadata) world.getTileEntity(x, y, z)).setTileMetadata(ordinal(), false);
|
||||
}
|
||||
}
|
||||
|
||||
public IIcon getTrunk() {
|
||||
return trunk;
|
||||
}
|
||||
|
||||
public IIcon getBark() {
|
||||
return bark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockLog, this.ordinal()).copy();
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockLog, ordinal()).copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return this.color;
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ForestryLog implements ILogType
|
||||
{
|
||||
enum ForestryLog implements ILogType {
|
||||
LARCH(1, 0, 6376529),
|
||||
TEAK(1, 1, 3486249),
|
||||
ACACIA(1, 2, 7565906),
|
||||
@@ -170,19 +156,19 @@ public interface ILogType
|
||||
MAPLE(6, 2, 9078657),
|
||||
CITRUS(6, 3, 5983033);
|
||||
|
||||
int block;
|
||||
int metadata;
|
||||
int colour;
|
||||
protected int block;
|
||||
protected int metadata;
|
||||
protected int colour;
|
||||
|
||||
private ForestryLog(final int blockOffset, final int meta, final int colour) {
|
||||
this.block = blockOffset;
|
||||
this.metadata = meta;
|
||||
ForestryLog(int blockOffset, int meta, int colour) {
|
||||
block = blockOffset;
|
||||
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));
|
||||
public void placeBlock(World world, int x, int y, int z) {
|
||||
BlockTypeLog logBlock = new BlockTypeLog(TreeManager.woodItemAccess.getLog(EnumWoodType.valueOf(name().toUpperCase()), false));
|
||||
logBlock.setDirection(ForgeDirection.UP);
|
||||
logBlock.setBlock(world, x, y, z);
|
||||
|
||||
@@ -190,43 +176,42 @@ public interface ILogType
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return TreeManager.woodItemAccess.getLog(EnumWoodType.valueOf(this.name().toUpperCase()), false);
|
||||
return TreeManager.woodItemAccess.getLog(EnumWoodType.valueOf(name().toUpperCase()), false);
|
||||
// return new ItemStack(Mods.Forestry.item("logs"), 1,
|
||||
// this.metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return this.colour;
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
|
||||
public enum VanillaLog implements ILogType
|
||||
{
|
||||
enum VanillaLog implements ILogType {
|
||||
Oak(6376752),
|
||||
Spruce(2759179),
|
||||
Birch(6376752),
|
||||
Jungle(5456154);
|
||||
|
||||
int colour;
|
||||
protected int colour;
|
||||
|
||||
private VanillaLog(final int colour) {
|
||||
VanillaLog(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);
|
||||
public void placeBlock(World world, int x, int y, int z) {
|
||||
world.setBlock(x, y, z, Blocks.log, ordinal(), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return new ItemStack(Blocks.log, 1, this.ordinal());
|
||||
return new ItemStack(Blocks.log, 1, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return this.colour;
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,9 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import net.minecraft.util.IIcon;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public interface IPlankType extends IDesignMaterial
|
||||
{
|
||||
public interface IPlankType extends IDesignMaterial {
|
||||
IIcon getIcon();
|
||||
|
||||
String getDescription();
|
||||
|
||||
@@ -1,101 +1,97 @@
|
||||
//
|
||||
// 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.ItemMetadata;
|
||||
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 binnie.extratrees.ExtraTrees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import binnie.core.block.ItemMetadata;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemETDoor extends ItemMetadata {
|
||||
public ItemETDoor(Block block) {
|
||||
super(block);
|
||||
maxStackSize = 1;
|
||||
setCreativeTab(CreativeTabs.tabRedstone);
|
||||
}
|
||||
|
||||
public static void placeDoorBlock(World world, int x, int y, int z, int meta, Block block, ItemStack item, EntityPlayer player) {
|
||||
byte b0 = 0;
|
||||
byte b2 = 0;
|
||||
if (meta == 0) {
|
||||
b2 = 1;
|
||||
}
|
||||
if (meta == 1) {
|
||||
b0 = -1;
|
||||
}
|
||||
if (meta == 2) {
|
||||
b2 = -1;
|
||||
}
|
||||
if (meta == 3) {
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
int i1 = (world.isBlockNormalCubeDefault(x - b0, y, z - b2, false) ? 1 : 0) + (world.isBlockNormalCubeDefault(x - b0, y + 1, z - b2, false) ? 1 : 0);
|
||||
int j1 = (world.isBlockNormalCubeDefault(x + b0, y, z + b2, false) ? 1 : 0) + (world.isBlockNormalCubeDefault(x + b0, y + 1, z + b2, false) ? 1 : 0);
|
||||
boolean flag = world.getBlock(x - b0, y, z - b2) == block || world.getBlock(x - b0, y + 1, z - b2) == block;
|
||||
boolean flag2 = world.getBlock(x + b0, y, z + b2) == block || world.getBlock(x + b0, y + 1, z + b2) == block;
|
||||
boolean flag3 = false;
|
||||
if (flag && !flag2) {
|
||||
flag3 = true;
|
||||
} else if (j1 > i1) {
|
||||
flag3 = true;
|
||||
}
|
||||
|
||||
world.setBlock(x, y, z, block, meta, 2);
|
||||
world.setBlock(x, y + 1, z, block, 0x8 | (flag3 ? 1 : 0), 2);
|
||||
if (world.getBlock(x, y, z) == block) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(TileEntityMetadata.getItemDamage(item), false);
|
||||
}
|
||||
block.onBlockPlacedBy(world, x, y, z, player, item);
|
||||
block.onPostBlockPlaced(world, x, y, z, meta);
|
||||
}
|
||||
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, block);
|
||||
world.notifyBlocksOfNeighborChange(x, y + 1, z, block);
|
||||
}
|
||||
|
||||
public class ItemETDoor extends ItemMetadata
|
||||
{
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
for (final DoorType type : DoorType.values()) {
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (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) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int meta, float hitX, float hitY, float hitZ) {
|
||||
if (meta != 1) {
|
||||
return false;
|
||||
}
|
||||
++par5;
|
||||
final Block block = ExtraTrees.blockDoor;
|
||||
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) || !par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) {
|
||||
|
||||
y++;
|
||||
Block block = ExtraTrees.blockDoor;
|
||||
if (!player.canPlayerEdit(x, y, z, meta, stack) || !player.canPlayerEdit(x, y + 1, z, meta, stack)) {
|
||||
return false;
|
||||
}
|
||||
if (!block.canPlaceBlockAt(par3World, par4, par5, par6)) {
|
||||
if (!block.canPlaceBlockAt(world, x, y, z)) {
|
||||
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;
|
||||
|
||||
int newMeta = MathHelper.floor_double((player.rotationYaw + 180.0f) * 4.0f / 360.0f - 0.5) & 0x3;
|
||||
placeDoorBlock(world, x, y, z, newMeta, block, stack, player);
|
||||
stack.stackSize--;
|
||||
return true;
|
||||
}
|
||||
|
||||
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() {
|
||||
@@ -104,14 +100,14 @@ public class ItemETDoor extends ItemMetadata
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconFromDamage(final int damage) {
|
||||
final DoorType type = BlockETDoor.getDoorType(damage);
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
DoorType type = BlockETDoor.getDoorType(damage);
|
||||
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();
|
||||
public int getColorFromItemStack(ItemStack stack, int meta) {
|
||||
return WoodManager.getPlankType((stack == null) ? 0 : (stack.getItemDamage() & 0xFF)).getColour();
|
||||
}
|
||||
}
|
||||
@@ -1,96 +1,86 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import binnie.core.block.ItemMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
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.block.Block;
|
||||
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;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemETSlab extends ItemMetadata
|
||||
{
|
||||
private final boolean isFullBlock;
|
||||
private final BlockETSlab theHalfSlab;
|
||||
private final BlockETSlab doubleSlab;
|
||||
public class ItemETSlab extends ItemMetadata {
|
||||
private boolean isFullBlock;
|
||||
private BlockETSlab theHalfSlab;
|
||||
private BlockETSlab doubleSlab;
|
||||
|
||||
public ItemETSlab(final Block block) {
|
||||
public ItemETSlab(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);
|
||||
theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
|
||||
doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
|
||||
isFullBlock = (block != theHalfSlab);
|
||||
setMaxDamage(0);
|
||||
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);
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int meta, float hitX, float hitY, float hitZ) {
|
||||
if (isFullBlock) {
|
||||
return super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
if (par1ItemStack.stackSize == 0) {
|
||||
if (stack.stackSize == 0 || !player.canPlayerEdit(x, y, z, meta, stack)) {
|
||||
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);
|
||||
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
boolean flag = (j1 & 0x8) != 0x0;
|
||||
|
||||
if (((meta == 1 && !flag) || (meta == 0 && flag)) && i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z)) && world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, true);
|
||||
}
|
||||
--par1ItemStack.stackSize;
|
||||
stack.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);
|
||||
return func_77888_a(stack, player, world, x, y, z, meta) || super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
private boolean func_77888_a(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final World par3World, int par4, int par5, int par6, final int par7) {
|
||||
if (par7 == 0) {
|
||||
--par5;
|
||||
private boolean func_77888_a(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
if (side == 0) {
|
||||
y--;
|
||||
} else if (side == 1) {
|
||||
y++;
|
||||
} else if (side == 2) {
|
||||
z--;
|
||||
} else if (side == 3) {
|
||||
z++;
|
||||
} else if (side == 4) {
|
||||
x--;
|
||||
} else if (side == 5) {
|
||||
x++;
|
||||
}
|
||||
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);
|
||||
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
|
||||
if (i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z)) && world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, false);
|
||||
par3World.markBlockForUpdate(par4, par5, par6);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
--par1ItemStack.stackSize;
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,39 +1,34 @@
|
||||
//
|
||||
// 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.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemETStairs extends ItemBlock {
|
||||
public ItemETStairs(Block block) {
|
||||
super(block);
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName("stairs");
|
||||
}
|
||||
|
||||
public class ItemETStairs extends ItemBlock
|
||||
{
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(final int par1) {
|
||||
public IIcon getIconFromDamage(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);
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
|
||||
boolean done = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);
|
||||
TileEntityMetadata tile = (TileEntityMetadata) world.getTileEntity(x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(stack.getItemDamage(), false);
|
||||
}
|
||||
@@ -42,7 +37,7 @@ public class ItemETStairs extends ItemBlock
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getItemStackDisplayName(final ItemStack par1ItemStack) {
|
||||
return ((IBlockMetadata) this.field_150939_a).getBlockName(par1ItemStack);
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
return ((IBlockMetadata) field_150939_a).getBlockName(par1ItemStack);
|
||||
}
|
||||
}
|
||||
@@ -1,46 +1,37 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
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.ItemMetadata;
|
||||
import binnie.core.block.ItemMetadataRenderer;
|
||||
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.core.liquid.ILiquidType;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.decor.BlockFence;
|
||||
import binnie.extratrees.block.decor.BlockGate;
|
||||
import binnie.extratrees.block.decor.BlockMultiFence;
|
||||
import binnie.extratrees.block.decor.FenceRenderer;
|
||||
import binnie.extratrees.block.decor.FenceType;
|
||||
import binnie.extratrees.block.decor.HedgeRenderer;
|
||||
import binnie.extratrees.block.decor.MultiFenceRecipeEmbedded;
|
||||
import binnie.extratrees.block.decor.MultiFenceRecipeSize;
|
||||
import binnie.extratrees.block.decor.MultiFenceRecipeSolid;
|
||||
import binnie.extratrees.item.ExtraTreeLiquid;
|
||||
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;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ModuleBlocks implements IInitializable
|
||||
{
|
||||
public class ModuleBlocks implements IInitializable {
|
||||
public static int hedgeRenderID;
|
||||
|
||||
@Override
|
||||
@@ -67,13 +58,15 @@ public class ModuleBlocks implements IInitializable
|
||||
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()) {
|
||||
for (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()) {
|
||||
for (IPlankType plank2 : PlankType.ExtraTreePlanks.values()) {
|
||||
OreDictionary.registerOre("plankWood", plank2.getStack());
|
||||
}
|
||||
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:fence");
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:gate");
|
||||
// FMLInterModComms.sendMessage("Forestry", "add-alveary-slab",
|
||||
@@ -100,49 +93,50 @@ public class ModuleBlocks implements IInitializable
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (final PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
|
||||
final ItemStack planks = plank.getStack();
|
||||
final ItemStack slabs = TileEntityMetadata.getItemStack(ExtraTrees.blockSlab, plank.ordinal());
|
||||
final ItemStack stairs = TileEntityMetadata.getItemStack(ExtraTrees.blockStairs, plank.ordinal());
|
||||
for (PlankType.ExtraTreePlanks plank : PlankType.ExtraTreePlanks.values()) {
|
||||
ItemStack planks = plank.getStack();
|
||||
ItemStack slabs = TileEntityMetadata.getItemStack(ExtraTrees.blockSlab, plank.ordinal());
|
||||
ItemStack stairs = TileEntityMetadata.getItemStack(ExtraTrees.blockStairs, plank.ordinal());
|
||||
stairs.stackSize = 4;
|
||||
GameRegistry.addRecipe(stairs.copy(), new Object[] { "# ", "## ", "###", '#', planks.copy() });
|
||||
GameRegistry.addRecipe(stairs.copy(), "# ", "## ", "###", '#', planks.copy());
|
||||
slabs.stackSize = 6;
|
||||
CraftingManager.getInstance().getRecipeList().add(0, new ShapedOreRecipe(slabs.copy(), new Object[] { "###", '#', planks.copy() }));
|
||||
CraftingManager.getInstance().getRecipeList().add(0, new ShapedOreRecipe(slabs.copy(), "###", '#', 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);
|
||||
for (IPlankType plank2 : WoodManager.getAllPlankTypes()) {
|
||||
ItemStack planks2 = plank2.getStack();
|
||||
ItemStack fenceNormal = WoodManager.getFence(plank2, new FenceType(0), 1);
|
||||
ItemStack gate = WoodManager.getGate(plank2);
|
||||
ItemStack doorStandard = WoodManager.getDoor(plank2, DoorType.Standard);
|
||||
ItemStack doorSolid = WoodManager.getDoor(plank2, DoorType.Solid);
|
||||
ItemStack doorSplit = WoodManager.getDoor(plank2, DoorType.Double);
|
||||
ItemStack doorFull = WoodManager.getDoor(plank2, DoorType.Full);
|
||||
if (planks2 != null) {
|
||||
if (gate == null) {
|
||||
continue;
|
||||
}
|
||||
gate.stackSize = 1;
|
||||
GameRegistry.addRecipe(gate.copy(), new Object[] { "fpf", 'f', fenceNormal.copy(), 'p', planks2.copy() });
|
||||
GameRegistry.addRecipe(gate.copy(), "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() });
|
||||
GameRegistry.addRecipe(fenceNormal.copy(), "###", "# #", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorSolid.copy(), "###", "###", "###", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorStandard.copy(), "# #", "###", "###", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorSplit.copy(), "# #", "###", "# #", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorFull.copy(), "# #", "# #", "# #", '#', planks2.copy());
|
||||
}
|
||||
}
|
||||
this.addSqueezer(ILogType.VanillaLog.Spruce, ExtraTreeLiquid.Resin, 50);
|
||||
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(ILogType log, ILiquidType liquid, int amount, float pulpChance) {
|
||||
FluidStack liquidStack = liquid.get(amount);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{log.getItemStack()}, liquidStack, Mods.Forestry.stack("woodPulp"), (int) (100.0f * pulpChance));
|
||||
}
|
||||
|
||||
public void addSqueezer(final ILogType log, final ILiquidType liquid, final int amount) {
|
||||
this.addSqueezer(log, liquid, amount, 0.5f);
|
||||
public void addSqueezer(ILogType log, ILiquidType liquid, int amount) {
|
||||
addSqueezer(log, liquid, amount, 0.5f);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +1,35 @@
|
||||
//
|
||||
// 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;
|
||||
import com.google.common.base.Optional;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class PlankType
|
||||
{
|
||||
public static final int MAX_PLANKS = 256;
|
||||
|
||||
public class PlankType {
|
||||
public static void setup() {
|
||||
for (final VanillaPlanks plank : VanillaPlanks.values()) {
|
||||
for (VanillaPlanks plank : VanillaPlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank.ordinal(), plank);
|
||||
}
|
||||
for (final ExtraTreePlanks plank2 : ExtraTreePlanks.values()) {
|
||||
for (ExtraTreePlanks plank2 : ExtraTreePlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank2.ordinal() + 32, plank2);
|
||||
}
|
||||
for (final ForestryPlanks plank3 : ForestryPlanks.values()) {
|
||||
for (ForestryPlanks plank3 : ForestryPlanks.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank3.ordinal() + 128, plank3);
|
||||
}
|
||||
for (final ExtraBiomesPlank plank4 : ExtraBiomesPlank.values()) {
|
||||
for (ExtraBiomesPlank plank4 : ExtraBiomesPlank.values()) {
|
||||
CarpentryManager.carpentryInterface.registerCarpentryWood(plank4.ordinal() + 192, plank4);
|
||||
}
|
||||
}
|
||||
|
||||
public enum ExtraTreePlanks implements IPlankType, IFenceProvider
|
||||
{
|
||||
public enum ExtraTreePlanks implements IPlankType, IFenceProvider {
|
||||
Fir(12815444),
|
||||
Cedar(14181940),
|
||||
Hemlock(13088108),
|
||||
@@ -74,40 +66,40 @@ public class PlankType
|
||||
Gingko(16050106),
|
||||
PinkIvory(15502496);
|
||||
|
||||
int color;
|
||||
IIcon icon;
|
||||
protected int color;
|
||||
protected IIcon icon;
|
||||
|
||||
private ExtraTreePlanks(final int color) {
|
||||
ExtraTreePlanks(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.planks." + this.toString().toLowerCase());
|
||||
return ExtraTrees.proxy.localise("block.planks." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("block.planks." + this.toString().toLowerCase() + ".desc");
|
||||
return ExtraTrees.proxy.localise("block.planks." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return this.color;
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockPlanks, this.ordinal());
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockPlanks, ordinal());
|
||||
}
|
||||
|
||||
public IIcon loadIcon(final IIconRegister register) {
|
||||
return this.icon = ExtraTrees.proxy.getIcon(register, "planks/" + this.toString());
|
||||
public IIcon loadIcon(IIconRegister register) {
|
||||
return icon = ExtraTrees.proxy.getIcon(register, "planks/" + toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return this.icon;
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,116 +108,111 @@ public class PlankType
|
||||
}
|
||||
}
|
||||
|
||||
public enum VanillaPlanks implements IPlankType
|
||||
{
|
||||
OAK(11833434),
|
||||
SPRUCE(8412726),
|
||||
BIRCH(14139781),
|
||||
JUNGLE(11632732),
|
||||
ACACIA(12215095),
|
||||
DARKOAK(4599061);
|
||||
public enum VanillaPlanks implements IPlankType {
|
||||
OAK(0xb4905a),
|
||||
SPRUCE(0x805e36),
|
||||
BIRCH(0xd7c185),
|
||||
JUNGLE(0xb1805c),
|
||||
ACACIA(0xba6337),
|
||||
DARKOAK(0x462d15);
|
||||
|
||||
int color;
|
||||
protected int color;
|
||||
|
||||
private VanillaPlanks(final int color) {
|
||||
VanillaPlanks(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.planks.vanilla." + this.toString().toLowerCase());
|
||||
return ExtraTrees.proxy.localise("block.planks.vanilla." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("block.planks.vanilla." + this.toString().toLowerCase() + ".desc");
|
||||
return ExtraTrees.proxy.localise("block.planks.vanilla." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return this.color;
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return new ItemStack(Blocks.planks, 1, this.ordinal());
|
||||
return new ItemStack(Blocks.planks, 1, 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;
|
||||
int meta = getStack().getItemDamage();
|
||||
Block block = Blocks.planks;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
public enum ForestryPlanks implements IPlankType, IFenceProvider {
|
||||
LARCH(0xd79f8d),
|
||||
TEAK(0x7d7963),
|
||||
ACACIA(0x94b387),
|
||||
LIME(0xceaa70),
|
||||
CHESTNUT(0xbbaa5d),
|
||||
WENGE(0x5e564a),
|
||||
BAOBAB(0x929c62),
|
||||
SEQUOIA(0x995a57),
|
||||
KAPOK(0x7c7434),
|
||||
EBONY(0x3c3730),
|
||||
MAHOGANY(0x763f38),
|
||||
BALSA(0xa9a299),
|
||||
WILLOW(0xb2b162),
|
||||
WALNUT(0x685242),
|
||||
GREENHEART(0x4e7e5c),
|
||||
CHERRY(0xb58234),
|
||||
MAHOE(0x7f98aa),
|
||||
POPLAR(0xcfcf82),
|
||||
PALM(0xca804b),
|
||||
PAPAYA(0xdccb75),
|
||||
PINE(0xc49e51),
|
||||
PLUM(0xad687f),
|
||||
MAPLE(0xae6d2b),
|
||||
CITRUS(0x9ca81d),
|
||||
GIGANTEUM(0x4f241e),
|
||||
IPE(0x4d2d1e),
|
||||
PADAUK(0xb36335),
|
||||
COCOBOLO(0x731302),
|
||||
ZEBRAWOOD(0xa6824e);
|
||||
|
||||
int color;
|
||||
protected int color;
|
||||
|
||||
private ForestryPlanks(final int color) {
|
||||
ForestryPlanks(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.planks.forestry." + this.toString().toLowerCase());
|
||||
return ExtraTrees.proxy.localise("block.planks.forestry." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("block.planks.forestry." + this.toString().toLowerCase() + ".desc");
|
||||
return ExtraTrees.proxy.localise("block.planks.forestry." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return this.color;
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
final Item stack = Mods.Forestry.item("planks");
|
||||
return new ItemStack(stack, 1, this.ordinal());
|
||||
Item stack = Mods.Forestry.item("planks");
|
||||
return new ItemStack(stack, 1, 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;
|
||||
if (getStack() != null) {
|
||||
int meta = getStack().getItemDamage();
|
||||
Block block = ((ItemBlock) getStack().getItem()).field_150939_a;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
return null;
|
||||
@@ -233,45 +220,44 @@ public class PlankType
|
||||
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
final ItemStack fence = Mods.Forestry.stack("fences");
|
||||
fence.setItemDamage(this.ordinal());
|
||||
ItemStack fence = Mods.Forestry.stack("fences");
|
||||
fence.setItemDamage(ordinal());
|
||||
return fence;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ExtraBiomesPlank implements IPlankType
|
||||
{
|
||||
Redwood(10185538),
|
||||
Fir(8288074),
|
||||
Acacia(12561022);
|
||||
public enum ExtraBiomesPlank implements IPlankType {
|
||||
Redwood(0x9b6b42),
|
||||
Fir(0x7e774a),
|
||||
Acacia(0xbfaa7e);
|
||||
|
||||
int color;
|
||||
protected int color;
|
||||
|
||||
private ExtraBiomesPlank(final int color) {
|
||||
ExtraBiomesPlank(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.planks.ebxl." + this.toString().toLowerCase());
|
||||
return ExtraTrees.proxy.localise("block.planks.ebxl." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("block.planks.ebxl." + this.toString().toLowerCase() + ".desc");
|
||||
return ExtraTrees.proxy.localise("block.planks.ebxl." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return this.color;
|
||||
return 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());
|
||||
Class clss = Class.forName("extrabiomes.api.Stuff");
|
||||
Block block = (Block) ((Optional) clss.getField("planks").get(null)).get();
|
||||
return new ItemStack(block, 1, ordinal());
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
@@ -279,9 +265,9 @@ public class PlankType
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
if (this.getStack() != null) {
|
||||
final int meta = this.getStack().getItemDamage();
|
||||
final Block block = ((ItemBlock) this.getStack().getItem()).field_150939_a;
|
||||
if (getStack() != null) {
|
||||
int meta = getStack().getItemDamage();
|
||||
Block block = ((ItemBlock) getStack().getItem()).field_150939_a;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -1,24 +1,20 @@
|
||||
//
|
||||
// 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.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class StairItemRenderer implements IItemRenderer {
|
||||
private void renderStairBlock(RenderBlocks renderBlocks, ItemStack item, float f, float g, float h) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ((ItemBlock) item.getItem()).field_150939_a;
|
||||
IIcon textureIndex = PlankType.ExtraTreePlanks.values()[item.getItemDamage()].getIcon();
|
||||
|
||||
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);
|
||||
@@ -56,43 +52,35 @@ public class StairItemRenderer implements IItemRenderer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(final ItemStack item, final IItemRenderer.ItemRenderType type) {
|
||||
public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY: {
|
||||
return true;
|
||||
}
|
||||
case EQUIPPED: {
|
||||
return true;
|
||||
}
|
||||
case INVENTORY: {
|
||||
return true;
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
case ENTITY:
|
||||
case EQUIPPED:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(final IItemRenderer.ItemRenderType type, final ItemStack item, final IItemRenderer.ItemRendererHelper helper) {
|
||||
public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
|
||||
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, 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;
|
||||
}
|
||||
case ENTITY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
renderStairBlock((RenderBlocks) data[0], item, 0.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
renderStairBlock((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,17 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
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
|
||||
{
|
||||
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;
|
||||
public void renderInventoryBlock(Block par1Block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
Tessellator var4 = Tessellator.instance;
|
||||
for (int var5 = 0; var5 < 2; ++var5) {
|
||||
if (var5 == 0) {
|
||||
renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 0.5);
|
||||
@@ -24,6 +19,7 @@ public class StairsRenderer implements ISimpleBlockRenderingHandler
|
||||
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);
|
||||
@@ -54,23 +50,23 @@ public class StairsRenderer implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@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);
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
BlockETStairs blockStairs = (BlockETStairs) block;
|
||||
blockStairs.func_150147_e(renderer.blockAccess, x, y, z);
|
||||
renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
renderer.renderStandardBlock(blockStairs, par2, par3, par4);
|
||||
final boolean var5 = blockStairs.func_150145_f(renderer.blockAccess, par2, par3, par4);
|
||||
renderer.renderStandardBlock(blockStairs, x, y, z);
|
||||
boolean var5 = blockStairs.func_150145_f(renderer.blockAccess, x, y, z);
|
||||
renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
renderer.renderStandardBlock(blockStairs, par2, par3, par4);
|
||||
if (var5 && blockStairs.func_150144_g(renderer.blockAccess, par2, par3, par4)) {
|
||||
renderer.renderStandardBlock(blockStairs, x, y, z);
|
||||
if (var5 && blockStairs.func_150144_g(renderer.blockAccess, x, y, z)) {
|
||||
renderer.setRenderBoundsFromBlock(blockStairs);
|
||||
renderer.renderStandardBlock(blockStairs, par2, par3, par4);
|
||||
renderer.renderStandardBlock(blockStairs, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(final int i) {
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,53 +1,51 @@
|
||||
//
|
||||
// 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.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import binnie.extratrees.block.decor.FenceDescription;
|
||||
import binnie.extratrees.block.decor.FenceType;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
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);
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class WoodManager {
|
||||
public static IPlankType getPlankType(int index) {
|
||||
IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
|
||||
if (wood instanceof IPlankType) {
|
||||
return (IPlankType) wood;
|
||||
}
|
||||
return PlankType.ExtraTreePlanks.Fir;
|
||||
}
|
||||
|
||||
public static int getPlankTypeIndex(final IPlankType type) {
|
||||
final int index = CarpentryManager.carpentryInterface.getCarpentryWoodIndex(type);
|
||||
public static int getPlankTypeIndex(IPlankType type) {
|
||||
int index = CarpentryManager.carpentryInterface.getCarpentryWoodIndex(type);
|
||||
return (index < 0) ? 0 : index;
|
||||
}
|
||||
|
||||
public static FenceType getFenceType(final ItemStack stack) {
|
||||
final FenceDescription desc = getFenceDescription(stack);
|
||||
public static FenceType getFenceType(ItemStack stack) {
|
||||
FenceDescription desc = getFenceDescription(stack);
|
||||
return (desc == null) ? null : desc.getFenceType();
|
||||
}
|
||||
|
||||
public static FenceDescription getFenceDescription(final ItemStack stack) {
|
||||
public static FenceDescription getFenceDescription(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (stack.getItem() == Item.getItemFromBlock(ExtraTrees.blockMultiFence)) {
|
||||
final int damage = TileEntityMetadata.getItemDamage(stack);
|
||||
int damage = TileEntityMetadata.getItemDamage(stack);
|
||||
return getFenceDescription(damage);
|
||||
}
|
||||
for (final IPlankType type : getAllPlankTypes()) {
|
||||
|
||||
for (IPlankType type : getAllPlankTypes()) {
|
||||
if (type instanceof IFenceProvider) {
|
||||
final ItemStack f = ((IFenceProvider) type).getFence();
|
||||
ItemStack f = ((IFenceProvider) type).getFence();
|
||||
if (f != null && ItemStack.areItemStacksEqual(stack, f)) {
|
||||
return new FenceDescription(new FenceType(0), type, type);
|
||||
}
|
||||
@@ -57,65 +55,61 @@ public class WoodManager
|
||||
return null;
|
||||
}
|
||||
|
||||
public static FenceDescription getFenceDescription(final int meta) {
|
||||
public static FenceDescription getFenceDescription(int meta) {
|
||||
return new FenceDescription(meta);
|
||||
}
|
||||
|
||||
public static FenceType getFenceType(final int meta) {
|
||||
public static FenceType getFenceType(int meta) {
|
||||
return getFenceDescription(meta).getFenceType();
|
||||
}
|
||||
|
||||
public static ItemStack getGate(final IPlankType plank) {
|
||||
public static ItemStack getGate(IPlankType plank) {
|
||||
if (plank == PlankType.VanillaPlanks.OAK) {
|
||||
return new ItemStack(Blocks.fence_gate);
|
||||
}
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockGate, getPlankTypeIndex(plank));
|
||||
}
|
||||
|
||||
public static ItemStack getFence(final IPlankType plank, final FenceType type, final int amount) {
|
||||
public static ItemStack getFence(IPlankType plank, FenceType type, int amount) {
|
||||
return getFence(plank, plank, type, amount);
|
||||
}
|
||||
|
||||
public static ItemStack getFence(final IPlankType plank, final IPlankType plank2, final FenceType type, final int amount) {
|
||||
public static ItemStack getFence(IPlankType plank, IPlankType plank2, FenceType type, int amount) {
|
||||
if (plank instanceof IFenceProvider && plank == plank2 && type.isPlain()) {
|
||||
final ItemStack original = ((IFenceProvider) plank).getFence();
|
||||
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));
|
||||
|
||||
int ord = type.ordinal();
|
||||
int i = getPlankTypeIndex(plank) + 256 * ord;
|
||||
ItemStack stack = TileEntityMetadata.getItemStack(ExtraTrees.blockMultiFence, i + 65536 * getPlankTypeIndex(plank2));
|
||||
stack.stackSize = amount;
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ItemStack getDoor(final IPlankType plank, final DoorType type) {
|
||||
public static ItemStack getDoor(IPlankType plank, 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()) {
|
||||
List<IPlankType> list = new ArrayList<IPlankType>();
|
||||
Collections.addAll(list, PlankType.ExtraTreePlanks.values());
|
||||
Collections.addAll(list, PlankType.ForestryPlanks.values());
|
||||
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
list.add(type);
|
||||
}
|
||||
}
|
||||
for (final IPlankType type : PlankType.VanillaPlanks.values()) {
|
||||
list.add(type);
|
||||
}
|
||||
|
||||
Collections.addAll(list, PlankType.VanillaPlanks.values());
|
||||
return list;
|
||||
}
|
||||
|
||||
public static IPlankType get(final ItemStack species) {
|
||||
for (final IPlankType type : getAllPlankTypes()) {
|
||||
public static IPlankType get(ItemStack species) {
|
||||
for (IPlankType type : getAllPlankTypes()) {
|
||||
if (type.getStack() != null && type.getStack().isItemEqual(species)) {
|
||||
return type;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.Binnie;
|
||||
@@ -35,41 +31,44 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockFence extends net.minecraft.block.BlockFence implements IBlockMetadata, IBlockFence
|
||||
{
|
||||
public 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);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("fence");
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
public static boolean canConnect(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 getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
for (final IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
|
||||
itemList.add(type.getFence());
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
|
||||
list.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);
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return this.getIcon(side, tile.getTileMetadata());
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
public FenceDescription getDescription(final int meta) {
|
||||
public FenceDescription getDescription(int meta) {
|
||||
return WoodManager.getFenceDescription(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
return this.getDescription(meta).getPlankType().getIcon();
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return getDescription(meta).getPlankType().getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,113 +77,109 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAsStack(final World world, final int x, final int y, final int z, final ItemStack itemStack) {
|
||||
this.dropBlockAsItem(world, x, y, z, itemStack);
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(final int meta) {
|
||||
public boolean hasTileEntity(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);
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack itemStack, final World world, final int x, final int y, final int z, final ForgeDirection direction) {
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodfence.name", this.getDescription(meta).getPlankType().getName());
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodfence.name", getDescription(meta).getPlankType().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack itemStack, final List tooltip) {
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(final World world, final int x, final int y, final int z) {
|
||||
public boolean canPlaceTorchOnTop(World world, int x, int y, 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);
|
||||
public boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z) {
|
||||
if (!isFence(world, x, y, z)) {
|
||||
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);
|
||||
public boolean isFence(IBlockAccess world, int x, int y, int z) {
|
||||
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(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(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) {
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister p_149651_1_) {
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +1,43 @@
|
||||
//
|
||||
// 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.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
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 cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockGate extends BlockFenceGate implements IBlockMetadata
|
||||
{
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setResistance(5.0f);
|
||||
setHardness(2.0f);
|
||||
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);
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
for (IPlankType type : WoodManager.getAllPlankTypes()) {
|
||||
ItemStack gate = WoodManager.getGate(type);
|
||||
if (gate != null) {
|
||||
itemList.add(gate);
|
||||
}
|
||||
@@ -50,104 +46,104 @@ public class BlockGate extends BlockFenceGate implements IBlockMetadata
|
||||
|
||||
@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);
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
return this.getIcon(side, tile.getTileMetadata());
|
||||
return getIcon(side, tile.getTileMetadata());
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
public IIcon getIcon(int side, 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 itemStack) {
|
||||
this.dropBlockAsItem(world, x, y, z, itemStack);
|
||||
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int blockMeta, final int fortune) {
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(final int meta) {
|
||||
public boolean hasTileEntity(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);
|
||||
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
|
||||
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(final ItemStack itemStack, final World world, final int x, final int y, final int z, final ForgeDirection direction) {
|
||||
public int getPlacedMeta(ItemStack itemStack, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
return TileEntityMetadata.getItemDamage(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(final int blockMeta, final int tileMeta) {
|
||||
public int getDroppedMeta(int blockMeta, int tileMeta) {
|
||||
return tileMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(final ItemStack itemStack, final List tooltip) {
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@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);
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isWood(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, 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_) {
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,54 @@
|
||||
//
|
||||
// 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.block.ModuleBlocks;
|
||||
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.ForestryAPI;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockHedge extends Block implements IBlockFence
|
||||
{
|
||||
import java.util.List;
|
||||
|
||||
public class BlockHedge extends Block implements IBlockFence {
|
||||
public BlockHedge() {
|
||||
super(Material.leaves);
|
||||
this.setCreativeTab(Tabs.tabArboriculture);
|
||||
this.setBlockName("hedge");
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setBlockName("hedge");
|
||||
}
|
||||
|
||||
public static boolean func_149825_a(Block block) {
|
||||
return BlockFence.canConnect(block);
|
||||
}
|
||||
|
||||
public static int getColor(int meta) {
|
||||
ExtraTreeSpecies.LeafType type = ExtraTreeSpecies.LeafType.values()[meta % 6];
|
||||
if (type == ExtraTreeSpecies.LeafType.Conifer) {
|
||||
return ColorizerFoliage.getFoliageColorPine();
|
||||
}
|
||||
double d0 = 0.5;
|
||||
double d2 = 1.0;
|
||||
return ColorizerFoliage.getFoliageColor(d0, d2);
|
||||
}
|
||||
|
||||
@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);
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) {
|
||||
boolean connectNegZ = canConnectFenceTo(world, x, y, z - 1);
|
||||
boolean connectPosZ = canConnectFenceTo(world, x, y, z + 1);
|
||||
boolean connectNegX = canConnectFenceTo(world, x - 1, y, z);
|
||||
boolean connectPosX = canConnectFenceTo(world, x + 1, y, z);
|
||||
float f = 0.25f;
|
||||
float f2 = 0.75f;
|
||||
float f3 = 0.25f;
|
||||
@@ -50,9 +60,10 @@ public class BlockHedge extends Block implements IBlockFence
|
||||
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_);
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
|
||||
super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
|
||||
}
|
||||
|
||||
f3 = 0.25f;
|
||||
f4 = 0.75f;
|
||||
if (connectNegX) {
|
||||
@@ -62,8 +73,8 @@ public class BlockHedge extends Block implements IBlockFence
|
||||
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_);
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.5f, f4);
|
||||
super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
|
||||
}
|
||||
if (connectNegZ) {
|
||||
f3 = 0.0f;
|
||||
@@ -71,15 +82,15 @@ public class BlockHedge extends Block implements IBlockFence
|
||||
if (connectPosZ) {
|
||||
f4 = 1.0f;
|
||||
}
|
||||
this.setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
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);
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
boolean connectNegZ = canConnectFenceTo(world, x, y, z - 1);
|
||||
boolean connectPosZ = canConnectFenceTo(world, x, y, z + 1);
|
||||
boolean connectNegX = canConnectFenceTo(world, x - 1, y, z);
|
||||
boolean connectPosX = canConnectFenceTo(world, x + 1, y, z);
|
||||
float f = 0.25f;
|
||||
float f2 = 0.75f;
|
||||
float f3 = 0.25f;
|
||||
@@ -96,7 +107,7 @@ public class BlockHedge extends Block implements IBlockFence
|
||||
if (connectPosX) {
|
||||
f2 = 1.0f;
|
||||
}
|
||||
this.setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
setBlockBounds(f, 0.0f, f3, f2, 1.0f, f4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,7 +121,7 @@ public class BlockHedge extends Block implements IBlockFence
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBlocksMovement(final IBlockAccess p_149655_1_, final int p_149655_2_, final int p_149655_3_, final int p_149655_4_) {
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -119,44 +130,45 @@ public class BlockHedge extends Block implements IBlockFence
|
||||
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_);
|
||||
public boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block == this
|
||||
|| block == Blocks.fence_gate
|
||||
|| func_149825_a(block)
|
||||
|| block.isLeaves(world, x, y, z)
|
||||
|| (block.getMaterial().isOpaque() && block.renderAsNormalBlock() && block.getMaterial() != Material.gourd);
|
||||
}
|
||||
|
||||
@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_) {
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister p_149651_1_) {
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
private ExtraTreeSpecies.LeafType getType(final int meta) {
|
||||
private ExtraTreeSpecies.LeafType getType(int meta) {
|
||||
return ExtraTreeSpecies.LeafType.values()[meta % 8];
|
||||
}
|
||||
|
||||
private boolean isFull(final int meta) {
|
||||
private boolean isFull(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);
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
ExtraTreeSpecies.LeafType type = getType(meta);
|
||||
return ForestryAPI.textureManager.getIcon(isFull(meta) ? type.plainUID : type.fancyUID);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
for (int f = 0; f < 2; ++f) {
|
||||
list.add(new ItemStack(item, 1, i + f * 8));
|
||||
@@ -166,17 +178,7 @@ public class BlockHedge extends Block implements IBlockFence
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, 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);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +1,45 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import java.util.List;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockMultiFence extends BlockFence implements IBlockMetadata
|
||||
{
|
||||
import java.util.List;
|
||||
|
||||
public class BlockMultiFence extends BlockFence implements IBlockMetadata {
|
||||
public BlockMultiFence() {
|
||||
this.setBlockName("multifence");
|
||||
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));
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (FenceType type : FenceType.values()) {
|
||||
list.add(WoodManager.getFence(PlankType.VanillaPlanks.SPRUCE, PlankType.VanillaPlanks.BIRCH, type, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
return (FenceRenderer.layer == 0) ? this.getDescription(meta).getPlankType().getIcon() : this.getDescription(meta).getSecondaryPlankType().getIcon();
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return (FenceRenderer.layer == 0)
|
||||
? getDescription(meta).getPlankType().getIcon()
|
||||
: getDescription(meta).getSecondaryPlankType().getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
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();
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
IPlankType type1 = getDescription(meta).getPlankType();
|
||||
IPlankType type2 = getDescription(meta).getSecondaryPlankType();
|
||||
boolean twoTypes = type1 != type2;
|
||||
FenceType type3 = getDescription(meta).getFenceType();
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodslab.name" + (twoTypes ? "2" : ""), type3.getPrefix(), type1.getName(), type2.getName());
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,34 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
|
||||
public class FenceDescription
|
||||
{
|
||||
FenceType fenceType;
|
||||
IPlankType plankType;
|
||||
IPlankType secondaryPlankType;
|
||||
public class FenceDescription {
|
||||
protected FenceType fenceType;
|
||||
protected IPlankType plankType;
|
||||
protected IPlankType secondaryPlankType;
|
||||
|
||||
public FenceDescription(final FenceType fenceType, final IPlankType plankType, final IPlankType secondaryPlankType) {
|
||||
public FenceDescription(FenceType fenceType, IPlankType plankType, 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 FenceDescription(int meta) {
|
||||
fenceType = new FenceType(meta >> 8 & 0xFF);
|
||||
plankType = WoodManager.getPlankType(meta & 0xFF);
|
||||
secondaryPlankType = WoodManager.getPlankType(meta >> 16 & 0xFF);
|
||||
}
|
||||
|
||||
public FenceType getFenceType() {
|
||||
return this.fenceType;
|
||||
return fenceType;
|
||||
}
|
||||
|
||||
public IPlankType getPlankType() {
|
||||
return this.plankType;
|
||||
return plankType;
|
||||
}
|
||||
|
||||
public IPlankType getSecondaryPlankType() {
|
||||
return this.secondaryPlankType;
|
||||
return secondaryPlankType;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,24 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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 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;
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
Tessellator tess = Tessellator.instance;
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
final float thickness = 0.125f;
|
||||
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);
|
||||
@@ -31,9 +26,10 @@ public class FenceRenderer implements ISimpleBlockRenderingHandler
|
||||
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 s = 0.0625f;
|
||||
FenceType fenceType = (block == ExtraTrees.blockMultiFence) ? WoodManager.getFenceType(metadata) : new FenceType(0);
|
||||
boolean bottomBar = !fenceType.solid;
|
||||
float topBarMaxY = 1.0f - s;
|
||||
float topBarMinY = 1.0f - s * 3.0f;
|
||||
float bottomBarMaxY = 0.5f - s;
|
||||
@@ -44,13 +40,16 @@ public class FenceRenderer implements ISimpleBlockRenderingHandler
|
||||
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;
|
||||
@@ -58,31 +57,28 @@ public class FenceRenderer implements ISimpleBlockRenderingHandler
|
||||
if (i == 2) {
|
||||
block.setBlockBounds(minX, topBarMinY, minZ, maxX, topBarMaxY, maxZ);
|
||||
FenceRenderer.layer = 1;
|
||||
}
|
||||
if (i == 3) {
|
||||
} else if (i == 3) {
|
||||
if (!bottomBar) {
|
||||
continue;
|
||||
}
|
||||
block.setBlockBounds(minX, bottomBarMinY, minZ, maxX, bottomBarMaxY, maxZ);
|
||||
FenceRenderer.layer = 1;
|
||||
}
|
||||
if (i == 4) {
|
||||
} else 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;
|
||||
float minY;
|
||||
float maxY;
|
||||
|
||||
if (fenceType.size != 1 && !fenceType.solid) {
|
||||
minY = bottomBarMinY + 2.0f * s;
|
||||
maxY = topBarMaxY - 2.0f * s;
|
||||
}
|
||||
else if (fenceType.size == 1 && fenceType.solid) {
|
||||
} else if (fenceType.size == 1 && fenceType.solid) {
|
||||
minY = bottomBarMinY + 2.0f * s;
|
||||
maxY = topBarMaxY - 2.0f * s;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
minY = 0.5f - 2.0f * s;
|
||||
maxY = 0.5f + 2.0f * s;
|
||||
}
|
||||
@@ -96,8 +92,7 @@ public class FenceRenderer implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
block.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
FenceRenderer.layer = 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (fenceType.size != 1 || fenceType.solid) {
|
||||
continue;
|
||||
}
|
||||
@@ -105,6 +100,7 @@ public class FenceRenderer implements ISimpleBlockRenderingHandler
|
||||
FenceRenderer.layer = 1;
|
||||
}
|
||||
}
|
||||
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
tess.startDrawingQuads();
|
||||
@@ -138,46 +134,49 @@ public class FenceRenderer implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@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) {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
FenceRenderer.layer = 0;
|
||||
final BlockFence blockFence = (BlockFence) block;
|
||||
final float i = 0.0625f;
|
||||
BlockFence blockFence = (BlockFence) block;
|
||||
float i = 0.0625f;
|
||||
FenceType fenceType = new FenceType(0);
|
||||
final TileEntity tile = world.getTileEntity(par2, par3, par4);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
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;
|
||||
|
||||
boolean rendered;
|
||||
float postWidth = 0.25f;
|
||||
float postHeight = 1.0f;
|
||||
float minPostPos = 0.5f - postWidth / 2.0f;
|
||||
float maxPostPos = 0.5f + postWidth / 2.0f;
|
||||
renderer.setRenderBounds(minPostPos, 0.0, minPostPos, maxPostPos, postHeight, maxPostPos);
|
||||
renderer.renderStandardBlock(block, par2, par3, par4);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
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)) {
|
||||
if (blockFence.canConnectFenceTo(renderer.blockAccess, x - 1, y, z) || blockFence.canConnectFenceTo(renderer.blockAccess, x + 1, y, z)) {
|
||||
connectAnyX = true;
|
||||
}
|
||||
if (blockFence.canConnectFenceTo(renderer.blockAccess, par2, par3, par4 - 1) || blockFence.canConnectFenceTo(renderer.blockAccess, par2, par3, par4 + 1)) {
|
||||
if (blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z - 1) || blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z + 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);
|
||||
|
||||
boolean connectNegX = blockFence.canConnectFenceTo(renderer.blockAccess, x - 1, y, z);
|
||||
boolean connectPosX = blockFence.canConnectFenceTo(renderer.blockAccess, x + 1, y, z);
|
||||
boolean connectNegZ = blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z - 1);
|
||||
boolean connectPosZ = blockFence.canConnectFenceTo(renderer.blockAccess, x, y, z + 1);
|
||||
if (!connectAnyX && !connectAnyZ) {
|
||||
connectAnyX = true;
|
||||
}
|
||||
|
||||
minPostPos = 7.0f * i;
|
||||
maxPostPos = 9.0f * i;
|
||||
float barMinY = 12.0f * i;
|
||||
float barMaxY = 15.0f * i;
|
||||
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;
|
||||
float minX = connectNegX ? 0.0f : minPostPos;
|
||||
float maxX = connectPosX ? 1.0f : maxPostPos;
|
||||
float minZ = connectNegZ ? 0.0f : minPostPos;
|
||||
float maxZ = connectPosZ ? 1.0f : maxPostPos;
|
||||
boolean renderBottom = true;
|
||||
if (fenceType.size == 2) {
|
||||
barMaxY -= 5.0f * i;
|
||||
@@ -187,23 +186,25 @@ public class FenceRenderer implements ISimpleBlockRenderingHandler
|
||||
renderBottom = false;
|
||||
if (fenceType.size == 0) {
|
||||
barMinY = 6.0f * i;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
barMinY = i;
|
||||
}
|
||||
}
|
||||
final float totalMaxY = barMaxY;
|
||||
|
||||
float totalMaxY = barMaxY;
|
||||
FenceRenderer.layer = 1;
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
|
||||
renderer.renderStandardBlock(blockFence, par2, par3, par4);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
|
||||
renderer.renderStandardBlock(blockFence, par2, par3, par4);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
|
||||
if (renderBottom) {
|
||||
barMinY -= 6.0f * i;
|
||||
barMaxY -= 6.0f * i;
|
||||
@@ -212,31 +213,33 @@ public class FenceRenderer implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
|
||||
renderer.renderStandardBlock(blockFence, par2, par3, par4);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
|
||||
renderer.renderStandardBlock(blockFence, par2, par3, par4);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (renderBottom && fenceType.size == 1) {
|
||||
barMinY -= 6.0f * i;
|
||||
barMaxY -= 6.0f * i;
|
||||
barMaxY += i;
|
||||
if (connectAnyX) {
|
||||
renderer.setRenderBounds(minX, barMinY, minPostPos, maxX, barMaxY, maxPostPos);
|
||||
renderer.renderStandardBlock(blockFence, par2, par3, par4);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, barMinY, minZ, maxPostPos, barMaxY, maxZ);
|
||||
renderer.renderStandardBlock(blockFence, par2, par3, par4);
|
||||
renderer.renderStandardBlock(blockFence, x, y, z);
|
||||
rendered = true;
|
||||
}
|
||||
}
|
||||
final float totalMinY = barMinY;
|
||||
|
||||
float totalMinY = barMinY;
|
||||
FenceRenderer.layer = 0;
|
||||
if (fenceType.embossed) {
|
||||
minPostPos -= (float) (i - 0.25 * i);
|
||||
@@ -246,30 +249,30 @@ public class FenceRenderer implements ISimpleBlockRenderingHandler
|
||||
if (fenceType.size == 1 && !fenceType.solid) {
|
||||
minY = 6.0f * i;
|
||||
maxY = 10.0f * i;
|
||||
}
|
||||
else if (fenceType.size == 0 && fenceType.solid) {
|
||||
} else if (fenceType.size == 0 && fenceType.solid) {
|
||||
minY -= 4.0f * i;
|
||||
maxY -= 4.0f * i;
|
||||
}
|
||||
else if (fenceType.size == 2 && fenceType.solid) {
|
||||
} 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);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
if (connectAnyZ) {
|
||||
renderer.setRenderBounds(minPostPos, minY, minZ, maxPostPos, maxY, maxZ);
|
||||
renderer.renderStandardBlock(block, par2, par3, par4);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
}
|
||||
blockFence.setBlockBoundsBasedOnState(renderer.blockAccess, par2, par3, par4);
|
||||
blockFence.setBlockBoundsBasedOnState(renderer.blockAccess, x, y, z);
|
||||
return rendered;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(final int i) {
|
||||
public boolean shouldRender3DInInventory(int i) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,44 +1,31 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class FenceType
|
||||
{
|
||||
public class FenceType {
|
||||
public int size;
|
||||
public boolean solid;
|
||||
public boolean embossed;
|
||||
|
||||
public FenceType(final int size, final boolean solid, final boolean embedded) {
|
||||
public FenceType(int size, boolean solid, boolean embedded) {
|
||||
this.size = size;
|
||||
this.solid = solid;
|
||||
this.embossed = embedded;
|
||||
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 FenceType(int meta) {
|
||||
size = (meta & 0x3);
|
||||
solid = ((meta >> 2 & 0x1) > 0);
|
||||
embossed = ((meta >> 3 & 0x1) > 0);
|
||||
}
|
||||
|
||||
public static Collection<FenceType> values() {
|
||||
final List<FenceType> list = new ArrayList<FenceType>();
|
||||
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 }) {
|
||||
for (boolean solid : new boolean[]{false, true}) {
|
||||
for (boolean embedded : new boolean[]{false, true}) {
|
||||
list.add(new FenceType(size, solid, embedded));
|
||||
}
|
||||
}
|
||||
@@ -46,15 +33,27 @@ public class FenceType
|
||||
return list;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return ((size == 0) ? "" : ((size == 1) ? "Full " : "Low "))
|
||||
+ (solid ? "Solid " : "")
|
||||
+ (embossed ? "Embedded " : "");
|
||||
}
|
||||
|
||||
public int ordinal() {
|
||||
return size + ((solid ? 1 : 0) << 2) + ((embossed ? 1 : 0) << 3);
|
||||
}
|
||||
|
||||
public boolean isPlain() {
|
||||
return this.size == 0 && !this.embossed && !this.solid;
|
||||
return size == 0 && !embossed && !solid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof FenceType) {
|
||||
final FenceType o = (FenceType) obj;
|
||||
return o.size == this.size && o.embossed == this.embossed && o.solid == this.solid;
|
||||
FenceType o = (FenceType) obj;
|
||||
return o.size == size
|
||||
&& o.embossed == embossed
|
||||
&& o.solid == solid;
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
@@ -1,30 +1,25 @@
|
||||
//
|
||||
// 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 binnie.extratrees.block.ModuleBlocks;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class HedgeRenderer implements 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;
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
int color = BlockHedge.getColor(metadata);
|
||||
int r = color >> 16 & 0xFF;
|
||||
int g = color >> 8 & 0xFF;
|
||||
int b = color & 0xFF;
|
||||
GL11.glColor3f(r / 255.0f, g / 255.0f, b / 255.0f);
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.25, 0.75, 1.0, 0.75);
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
Tessellator tess = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0.0f, -1.0f, 0.0f);
|
||||
@@ -54,13 +49,13 @@ public class HedgeRenderer implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@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);
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
IIcon icon = block.getIcon(0, world.getBlockMetadata(x, y, z));
|
||||
BlockHedge hedge = ExtraTrees.blockHedge;
|
||||
boolean connectNegX = hedge.canConnectFenceTo(world, x - 1, y, z);
|
||||
boolean connectPosX = hedge.canConnectFenceTo(world, x + 1, y, z);
|
||||
boolean connectNegZ = hedge.canConnectFenceTo(world, x, y, z - 1);
|
||||
boolean connectPosZ = hedge.canConnectFenceTo(world, x, y, z + 1);
|
||||
GL11.glPushMatrix();
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.25, 0.75, 1.0, 0.75);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
@@ -115,7 +110,7 @@ public class HedgeRenderer implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(final int modelId) {
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
public interface IBlockFence
|
||||
{
|
||||
public interface IBlockFence {
|
||||
}
|
||||
@@ -1,23 +1,19 @@
|
||||
//
|
||||
// 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;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemHedge extends ItemBlockWithMetadata
|
||||
{
|
||||
public ItemHedge(final Block block) {
|
||||
// TODO unused class?
|
||||
public class ItemHedge extends ItemBlockWithMetadata {
|
||||
public ItemHedge(Block block) {
|
||||
super(block, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack item) {
|
||||
final int meta = item.getItemDamage();
|
||||
public String getItemStackDisplayName(ItemStack item) {
|
||||
int meta = item.getItemDamage();
|
||||
return ExtraTreeSpecies.LeafType.values()[meta % 6].descript + ((meta >= 8) ? " Full" : "") + " Hedge";
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,37 @@
|
||||
//
|
||||
// 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.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MultiFenceRecipeEmbedded implements IRecipe
|
||||
{
|
||||
ItemStack cached;
|
||||
public class MultiFenceRecipeEmbedded implements IRecipe {
|
||||
protected ItemStack cached;
|
||||
|
||||
@Override
|
||||
public boolean matches(final InventoryCrafting inv, final World world) {
|
||||
final String pattern = "";
|
||||
FenceType type = null;
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
FenceType type;
|
||||
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);
|
||||
ItemStack a = inv.getStackInSlot(row * 3);
|
||||
ItemStack b = inv.getStackInSlot(row * 3 + 1);
|
||||
ItemStack c = inv.getStackInSlot(row * 3 + 2);
|
||||
if (a != null && b != null) {
|
||||
if (c != null) {
|
||||
type = WoodManager.getFenceType(a);
|
||||
final FenceType type2 = WoodManager.getFenceType(c);
|
||||
FenceType type2 = WoodManager.getFenceType(c);
|
||||
if (type != null && type2 != null) {
|
||||
if (type.equals(type2)) {
|
||||
final IPlankType pType = WoodManager.get(b);
|
||||
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);
|
||||
cached = WoodManager.getFence(
|
||||
WoodManager.getFenceDescription(a).getPlankType(),
|
||||
WoodManager.getFenceDescription(a).getSecondaryPlankType(),
|
||||
new FenceType(type.size, type.solid, true),
|
||||
2
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -44,8 +43,8 @@ public class MultiFenceRecipeEmbedded implements IRecipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(final InventoryCrafting inv) {
|
||||
return this.getRecipeOutput();
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return getRecipeOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,6 +54,6 @@ public class MultiFenceRecipeEmbedded implements IRecipe
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return (this.cached == null) ? new ItemStack(Blocks.fence) : this.cached;
|
||||
return (cached == null) ? new ItemStack(Blocks.fence) : cached;
|
||||
}
|
||||
}
|
||||
@@ -1,75 +1,69 @@
|
||||
//
|
||||
// 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 binnie.extratrees.block.WoodManager;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MultiFenceRecipeSize implements IRecipe
|
||||
{
|
||||
ItemStack cached;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MultiFenceRecipeSize implements IRecipe {
|
||||
protected ItemStack cached;
|
||||
|
||||
@Override
|
||||
public boolean matches(final InventoryCrafting inv, final World world) {
|
||||
String pattern = "";
|
||||
final List<IPlankType> types = new ArrayList<IPlankType>();
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
StringBuilder pattern = new StringBuilder();
|
||||
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);
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
IPlankType type = (stack == null) ? null : WoodManager.get(stack);
|
||||
if (stack != null && type == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (stack == null) {
|
||||
pattern += " ";
|
||||
}
|
||||
else {
|
||||
pattern.append(" ");
|
||||
} else {
|
||||
if (!types.contains(type)) {
|
||||
types.add(type);
|
||||
if (types.size() > 2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
pattern += types.indexOf(type);
|
||||
pattern.append(types.indexOf(type));
|
||||
}
|
||||
}
|
||||
|
||||
if (types.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack fence = null;
|
||||
if (pattern.contains("0100 0 ")) {
|
||||
if (pattern.toString().contains("0100 0 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(1), new FenceType(0, false, false), 4);
|
||||
}
|
||||
else if (pattern.contains("0000 0 ")) {
|
||||
} else if (pattern.toString().contains("0000 0 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(0, false, false), 4);
|
||||
}
|
||||
else if (pattern.contains("0100 0 1 ")) {
|
||||
} else if (pattern.toString().contains("0100 0 1 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(1), new FenceType(1, false, false), 4);
|
||||
}
|
||||
else if (pattern.contains("0000 0 0 ")) {
|
||||
} else if (pattern.toString().contains("0000 0 0 ")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(1, false, false), 4);
|
||||
}
|
||||
else if (pattern.contains(" 0 1 1101")) {
|
||||
} else if (pattern.toString().contains(" 0 1 1101")) {
|
||||
fence = WoodManager.getFence(types.get(1), types.get(0), new FenceType(2, false, false), 4);
|
||||
}
|
||||
else if (pattern.contains(" 0 0 0000")) {
|
||||
} else if (pattern.toString().contains(" 0 0 0000")) {
|
||||
fence = WoodManager.getFence(types.get(0), types.get(0), new FenceType(2, false, false), 4);
|
||||
}
|
||||
this.cached = fence;
|
||||
|
||||
cached = fence;
|
||||
return fence != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(final InventoryCrafting inv) {
|
||||
return this.getRecipeOutput();
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return getRecipeOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,12 +73,6 @@ public class MultiFenceRecipeSize implements IRecipe
|
||||
|
||||
@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) {
|
||||
}
|
||||
return (cached == null) ? new ItemStack(Blocks.fence) : cached;
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,35 @@
|
||||
//
|
||||
// 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.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MultiFenceRecipeSolid implements IRecipe
|
||||
{
|
||||
public class MultiFenceRecipeSolid implements IRecipe {
|
||||
ItemStack cached;
|
||||
|
||||
@Override
|
||||
public boolean matches(final InventoryCrafting inv, final World world) {
|
||||
final String pattern = "";
|
||||
FenceType type = null;
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
FenceType type;
|
||||
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);
|
||||
ItemStack a = inv.getStackInSlot(row * 3);
|
||||
ItemStack b = inv.getStackInSlot(row * 3 + 1);
|
||||
ItemStack c = inv.getStackInSlot(row * 3 + 2);
|
||||
if (a != null && b != null) {
|
||||
if (c != null) {
|
||||
type = WoodManager.getFenceType(a);
|
||||
final FenceType type2 = WoodManager.getFenceType(b);
|
||||
final FenceType type3 = WoodManager.getFenceType(c);
|
||||
FenceType type2 = WoodManager.getFenceType(b);
|
||||
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);
|
||||
cached = WoodManager.getFence(
|
||||
WoodManager.getFenceDescription(a).getPlankType(),
|
||||
WoodManager.getFenceDescription(a).getSecondaryPlankType(),
|
||||
new FenceType(type.size, true, type.solid),
|
||||
2
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -41,8 +40,8 @@ public class MultiFenceRecipeSolid implements IRecipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(final InventoryCrafting inv) {
|
||||
return this.getRecipeOutput();
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return getRecipeOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,6 +51,6 @@ public class MultiFenceRecipeSolid implements IRecipe
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return (this.cached == null) ? new ItemStack(Blocks.fence) : this.cached;
|
||||
return (cached == null) ? new ItemStack(Blocks.fence) : cached;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +1,91 @@
|
||||
//
|
||||
// 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.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class NBTShapedRecipe implements IRecipe
|
||||
{
|
||||
public final int recipeWidth;
|
||||
public final int recipeHeight;
|
||||
public final ItemStack[] recipeItems;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class NBTShapedRecipe implements IRecipe {
|
||||
public int recipeWidth;
|
||||
public int recipeHeight;
|
||||
public ItemStack[] recipeItems;
|
||||
private ItemStack recipeOutput;
|
||||
private boolean field_92101_f;
|
||||
private static final String __OBFID = "CL_00000093";
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return this.recipeOutput;
|
||||
|
||||
public NBTShapedRecipe(ItemStack stack, Object... p_92103_2_) {
|
||||
String s = "";
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
|
||||
if (p_92103_2_[i] instanceof String[]) {
|
||||
String[] astring = (String[]) p_92103_2_[i++];
|
||||
for (String s2 : astring) {
|
||||
k++;
|
||||
j = s2.length();
|
||||
s += s2;
|
||||
}
|
||||
} else {
|
||||
while (p_92103_2_[i] instanceof String) {
|
||||
String s3 = (String) p_92103_2_[i++];
|
||||
++k;
|
||||
j = s3.length();
|
||||
s += s3;
|
||||
}
|
||||
}
|
||||
|
||||
HashMap hashmap = new HashMap();
|
||||
while (i < p_92103_2_.length) {
|
||||
Character character = (Character) p_92103_2_[i];
|
||||
ItemStack itemstack1 = null;
|
||||
if (p_92103_2_[i + 1] instanceof Item) {
|
||||
itemstack1 = new ItemStack((Item) p_92103_2_[i + 1]);
|
||||
} else if (p_92103_2_[i + 1] instanceof Block) {
|
||||
itemstack1 = new ItemStack((Block) p_92103_2_[i + 1], 1, 32767);
|
||||
} else if (p_92103_2_[i + 1] instanceof ItemStack) {
|
||||
itemstack1 = (ItemStack) p_92103_2_[i + 1];
|
||||
}
|
||||
|
||||
hashmap.put(character, itemstack1);
|
||||
i += 2;
|
||||
}
|
||||
|
||||
ItemStack[] aitemstack = new ItemStack[j * k];
|
||||
for (int i2 = 0; i2 < j * k; ++i2) {
|
||||
char c0 = s.charAt(i2);
|
||||
if (hashmap.containsKey(c0)) {
|
||||
aitemstack[i2] = ((ItemStack) hashmap.get(Character.valueOf(c0))).copy();
|
||||
} else {
|
||||
aitemstack[i2] = null;
|
||||
}
|
||||
}
|
||||
|
||||
recipeWidth = j;
|
||||
recipeHeight = k;
|
||||
recipeItems = aitemstack;
|
||||
recipeOutput = stack;
|
||||
NBTShapedRecipes.addRecipe(this);
|
||||
}
|
||||
|
||||
@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)) {
|
||||
public ItemStack getRecipeOutput() {
|
||||
return recipeOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) {
|
||||
for (int i = 0; i <= 3 - recipeWidth; ++i) {
|
||||
for (int j = 0; j <= 3 - recipeHeight; ++j) {
|
||||
if (checkMatch(p_77569_1_, i, j, true)) {
|
||||
return true;
|
||||
}
|
||||
if (this.checkMatch(p_77569_1_, i, j, false)) {
|
||||
if (checkMatch(p_77569_1_, i, j, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -42,23 +93,23 @@ public class NBTShapedRecipe implements IRecipe
|
||||
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_) {
|
||||
private boolean checkMatch(InventoryCrafting crafting, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) {
|
||||
for (int k = 0; k < 3; ++k) {
|
||||
for (int l = 0; l < 3; ++l) {
|
||||
final int i1 = k - p_77573_2_;
|
||||
final int j1 = l - p_77573_3_;
|
||||
int i1 = k - p_77573_2_;
|
||||
int j1 = l - p_77573_3_;
|
||||
ItemStack itemstack = null;
|
||||
if (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight) {
|
||||
if (i1 >= 0 && j1 >= 0 && i1 < recipeWidth && j1 < recipeHeight) {
|
||||
if (p_77573_4_) {
|
||||
itemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth];
|
||||
}
|
||||
else {
|
||||
itemstack = this.recipeItems[i1 + j1 * this.recipeWidth];
|
||||
itemstack = recipeItems[recipeWidth - i1 - 1 + j1 * recipeWidth];
|
||||
} else {
|
||||
itemstack = recipeItems[i1 + j1 * recipeWidth];
|
||||
}
|
||||
}
|
||||
final ItemStack itemstack2 = p_77573_1_.getStackInRowAndColumn(k, l);
|
||||
|
||||
ItemStack itemstack2 = crafting.getStackInRowAndColumn(k, l);
|
||||
if (itemstack2 != null || itemstack != null) {
|
||||
if ((itemstack2 == null && itemstack != null) || (itemstack2 != null && itemstack == null)) {
|
||||
if (itemstack2 == null || itemstack == null) {
|
||||
return false;
|
||||
}
|
||||
if (itemstack.getItem() != itemstack2.getItem()) {
|
||||
@@ -77,11 +128,11 @@ public class NBTShapedRecipe implements IRecipe
|
||||
}
|
||||
|
||||
@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);
|
||||
public ItemStack getCraftingResult(InventoryCrafting crafting) {
|
||||
ItemStack itemstack = getRecipeOutput().copy();
|
||||
if (field_92101_f) {
|
||||
for (int i = 0; i < crafting.getSizeInventory(); ++i) {
|
||||
ItemStack itemstack2 = crafting.getStackInSlot(i);
|
||||
if (itemstack2 != null && itemstack2.hasTagCompound()) {
|
||||
itemstack.setTagCompound((NBTTagCompound) itemstack2.stackTagCompound.copy());
|
||||
}
|
||||
@@ -92,61 +143,6 @@ public class NBTShapedRecipe implements IRecipe
|
||||
|
||||
@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);
|
||||
return recipeWidth * recipeHeight;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
//
|
||||
// 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.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class NBTShapedRecipes implements IRecipe
|
||||
{
|
||||
static List<NBTShapedRecipe> recipes;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NBTShapedRecipes implements IRecipe {
|
||||
static List<NBTShapedRecipe> recipes = new ArrayList<>();
|
||||
|
||||
public static void addRecipe(NBTShapedRecipe nbtShapedRecipe) {
|
||||
NBTShapedRecipes.recipes.add(nbtShapedRecipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(final InventoryCrafting inventory, final World world) {
|
||||
for (final NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
|
||||
public boolean matches(InventoryCrafting inventory, World world) {
|
||||
for (NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
|
||||
if (recipe.matches(inventory, world)) {
|
||||
return true;
|
||||
}
|
||||
@@ -26,8 +26,8 @@ public class NBTShapedRecipes implements IRecipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(final InventoryCrafting inventory) {
|
||||
for (final NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
|
||||
public ItemStack getCraftingResult(InventoryCrafting inventory) {
|
||||
for (NBTShapedRecipe recipe : NBTShapedRecipes.recipes) {
|
||||
if (recipe.matches(inventory, null)) {
|
||||
return recipe.getCraftingResult(inventory);
|
||||
}
|
||||
@@ -44,12 +44,4 @@ public class NBTShapedRecipes implements IRecipe
|
||||
public ItemStack getRecipeOutput() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void addRecipe(final NBTShapedRecipe nbtShapedRecipe) {
|
||||
NBTShapedRecipes.recipes.add(nbtShapedRecipe);
|
||||
}
|
||||
|
||||
static {
|
||||
NBTShapedRecipes.recipes = new ArrayList<NBTShapedRecipe>();
|
||||
}
|
||||
}
|
||||
Loaded 100 of 225 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user