mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-15 17:55:04 +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
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user