mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 03:49:07 +00:00
1 parent
140df9ce4e
commit
d678903d68
8 files changed
+115
-61
No files matched your search
@@ -26,10 +26,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
|
||||
import forestry.api.lepidopterology.IButterflyRoot;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
@@ -45,7 +41,6 @@ import binnie.extratrees.carpentry.ModuleCarpentry;
|
||||
import binnie.extratrees.config.ConfigurationMain;
|
||||
import binnie.extratrees.core.ExtraTreesGUID;
|
||||
import binnie.extratrees.core.ModuleCore;
|
||||
import binnie.extratrees.genetics.ButterflySpecies;
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import binnie.extratrees.genetics.FruitSprite;
|
||||
import binnie.extratrees.genetics.ModuleGenetics;
|
||||
@@ -169,16 +164,6 @@ public class ExtraTrees extends AbstractMod {
|
||||
return Constants.EXTRA_TREES_MOD_ID;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void speciesRegister(AlleleSpeciesRegisterEvent event) {
|
||||
if (event.getRoot() instanceof ITreeRoot) {
|
||||
ETTreeDefinition.preInitTrees();
|
||||
PlankType.ExtraTreePlanks.initWoodTypes();
|
||||
} else if (event.getRoot() instanceof IButterflyRoot && BinnieCore.isLepidopteryActive()) {
|
||||
ButterflySpecies.preInit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BinniePacketHandler> getPacketHandler() {
|
||||
return PacketHandler.class;
|
||||
|
||||
@@ -46,22 +46,28 @@ public enum EnumETLog implements IWoodType {
|
||||
Iroko("Iroko", PlankType.ExtraTreePlanks.Iroko),
|
||||
Gingko("Gingko", PlankType.ExtraTreePlanks.Gingko),
|
||||
Eucalyptus("Eucalyptus", PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Eucalyptus2("Eucalyptus", PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Box("Box", PlankType.ExtraTreePlanks.Box),
|
||||
Syzgium("Syzgium", PlankType.ExtraTreePlanks.Syzgium),
|
||||
Eucalyptus3("Eucalyptus", PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
PinkIvory("Pink Ivory", PlankType.ExtraTreePlanks.PinkIvory),
|
||||
Cherry("Cherry", PlankType.ForestryPlanks.CHERRY),
|
||||
Cinnamon("Cinnamon", PlankType.VanillaPlanks.JUNGLE);
|
||||
Eucalyptus2("Eucalyptus", PlankType.ExtraTreePlanks.Eucalyptus, false),
|
||||
Eucalyptus3("Eucalyptus", PlankType.ExtraTreePlanks.Eucalyptus, false),
|
||||
Cherry("Cherry", PlankType.ForestryPlanks.CHERRY, false),
|
||||
Cinnamon("Cinnamon", PlankType.VanillaPlanks.JUNGLE, false);
|
||||
|
||||
public static final EnumETLog[] VALUES = values();
|
||||
|
||||
private final String name;
|
||||
private final IPlankType plank;
|
||||
|
||||
private final boolean hasProducts;
|
||||
|
||||
EnumETLog(final String name, final IPlankType plank) {
|
||||
this(name, plank, true);
|
||||
}
|
||||
|
||||
EnumETLog(final String name, final IPlankType plank, boolean hasProducts) {
|
||||
this.name = name;
|
||||
this.plank = plank;
|
||||
this.hasProducts = hasProducts;
|
||||
}
|
||||
|
||||
public static EnumETLog byMetadata(int meta) {
|
||||
@@ -70,7 +76,11 @@ public enum EnumETLog implements IWoodType {
|
||||
}
|
||||
return VALUES[meta];
|
||||
}
|
||||
|
||||
|
||||
public boolean hasProducts() {
|
||||
return hasProducts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase();
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.extratrees.block;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -11,8 +12,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -27,6 +26,7 @@ import forestry.api.arboriculture.IWoodAccess;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
@@ -34,8 +34,10 @@ import forestry.arboriculture.WoodAccess;
|
||||
import forestry.arboriculture.blocks.BlockForestryFenceGate;
|
||||
import forestry.arboriculture.blocks.BlockForestryStairs;
|
||||
import forestry.arboriculture.items.ItemBlockLeaves;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.IInitializable;
|
||||
@@ -85,12 +87,7 @@ public class ModuleBlocks implements IInitializable {
|
||||
public BlockHedge blockHedge;
|
||||
public BlockShrubLog shrubLog;
|
||||
public BlockHops hops;
|
||||
|
||||
private static void addRecipeAtPosition(int position, IRecipe recipe) {
|
||||
CraftingManager manager = CraftingManager.getInstance();
|
||||
manager.getRecipeList().add(position, recipe);
|
||||
}
|
||||
|
||||
|
||||
private static void registerOreDictWildcard(String oreDictName, Block block) {
|
||||
OreDictionary.registerOre(oreDictName, new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
@@ -102,10 +99,11 @@ public class ModuleBlocks implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
WoodAccess woodAccess = WoodAccess.getInstance();
|
||||
PlankType.setup();
|
||||
|
||||
//TODO: clean up
|
||||
|
||||
logs = BlockETLog.create(false);
|
||||
logsFireproof = BlockETLog.create(true);
|
||||
for (BlockETLog block : logs) {
|
||||
ExtraTrees.proxy.registerBlock(block, new ItemBlockETWood<>(block));
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
@@ -117,8 +115,6 @@ public class ModuleBlocks implements IInitializable {
|
||||
registerOreDictWildcard(OreDictUtil.LOG_WOOD, block);
|
||||
}
|
||||
|
||||
WoodAccess woodAccess = WoodAccess.getInstance();
|
||||
|
||||
woodAccess.registerLogs(logs);
|
||||
woodAccess.registerLogs(logsFireproof);
|
||||
|
||||
@@ -240,10 +236,12 @@ public class ModuleBlocks implements IInitializable {
|
||||
|
||||
doors = new ArrayList<>();
|
||||
for (EnumETLog woodType : EnumETLog.VALUES) {
|
||||
BlockETDoor door = new BlockETDoor(woodType);
|
||||
ExtraTrees.proxy.registerBlock(door, new ItemBlockETWoodDoor(door));
|
||||
registerOreDictWildcard(OreDictUtil.DOOR_WOOD, door);
|
||||
doors.add(door);
|
||||
if(woodType.hasProducts()) {
|
||||
BlockETDoor door = new BlockETDoor(woodType);
|
||||
ExtraTrees.proxy.registerBlock(door, new ItemBlockETWoodDoor(door));
|
||||
registerOreDictWildcard(OreDictUtil.DOOR_WOOD, door);
|
||||
doors.add(door);
|
||||
}
|
||||
}
|
||||
|
||||
registerDoors(woodAccess, doors);
|
||||
@@ -322,10 +320,28 @@ public class ModuleBlocks implements IInitializable {
|
||||
}
|
||||
|
||||
IWoodAccess woodAccess = TreeManager.woodAccess;
|
||||
for(EnumETLog log : EnumETLog.VALUES){
|
||||
if (ForestryAPI.enabledPlugins.containsAll(Arrays.asList(ForestryPluginUids.FACTORY, ForestryPluginUids.APICULTURE))) {
|
||||
ItemStack logs = woodAccess.getStack(log, WoodBlockKind.LOG, false);
|
||||
ItemStack fireproofLogs = woodAccess.getStack(log, WoodBlockKind.LOG, true);
|
||||
|
||||
logs.setCount(1);
|
||||
fireproofLogs.setCount(1);
|
||||
RecipeManagers.fabricatorManager.addRecipe(ItemStack.EMPTY, Fluids.GLASS.getFluid(500), fireproofLogs.copy(), new Object[]{
|
||||
" # ",
|
||||
"#X#",
|
||||
" # ",
|
||||
'#', Mods.Forestry.item("refractory_wax"),
|
||||
'X', logs.copy()});
|
||||
}
|
||||
}
|
||||
|
||||
for (PlankType.ExtraTreePlanks plankType : PlankType.ExtraTreePlanks.VALUES) {
|
||||
for (boolean fireproof : new boolean[]{false, true}) {
|
||||
ItemStack planks = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.PLANKS, fireproof);
|
||||
ItemStack slabs = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.SLAB, fireproof);
|
||||
ItemStack fences = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.FENCE, fireproof);
|
||||
ItemStack fenceGates = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.FENCE_GATE, fireproof);
|
||||
ItemStack stairs = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.STAIRS, fireproof);
|
||||
|
||||
stairs.setCount(4);
|
||||
@@ -338,6 +354,21 @@ public class ModuleBlocks implements IInitializable {
|
||||
|
||||
slabs.setCount(6);
|
||||
RecipeUtil.addPriorityRecipe(slabs.copy(), "###", '#', planks.copy());
|
||||
|
||||
fences.setCount(3);
|
||||
planks.setCount(1);
|
||||
RecipeUtil.addRecipe(fences.copy(),
|
||||
"#X#",
|
||||
"#X#",
|
||||
'#', planks.copy(), 'X', "stickWood");
|
||||
|
||||
fenceGates.setCount(1);
|
||||
planks.setCount(1);
|
||||
RecipeUtil.addRecipe(fenceGates.copy(),
|
||||
"X#X",
|
||||
"X#X",
|
||||
'#', planks.copy(), 'X', "stickWood");
|
||||
|
||||
if(!fireproof){
|
||||
ItemStack doors = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.DOOR, false);
|
||||
doors.setCount(3);
|
||||
@@ -349,6 +380,19 @@ public class ModuleBlocks implements IInitializable {
|
||||
'#', planks.copy());
|
||||
}
|
||||
}
|
||||
// Fabricator recipes
|
||||
if (ForestryAPI.enabledPlugins.containsAll(Arrays.asList(ForestryPluginUids.FACTORY, ForestryPluginUids.APICULTURE))) {
|
||||
ItemStack planks = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.PLANKS, false);
|
||||
ItemStack fireproofPlanks = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.PLANKS, true);
|
||||
planks.setCount(1);
|
||||
fireproofPlanks.setCount(5);
|
||||
RecipeManagers.fabricatorManager.addRecipe(ItemStack.EMPTY, Fluids.GLASS.getFluid(500), fireproofPlanks.copy(), new Object[]{
|
||||
"X#X",
|
||||
"#X#",
|
||||
"X#X",
|
||||
'#', Mods.Forestry.item("refractory_wax"),
|
||||
'X', planks.copy()});
|
||||
}
|
||||
}
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeSize());
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeEmbedded());
|
||||
|
||||
@@ -27,7 +27,8 @@ import binnie.extratrees.block.decor.FenceDescription;
|
||||
import binnie.extratrees.block.decor.FenceType;
|
||||
|
||||
public class WoodManager {
|
||||
public static Map<IPlankType, ItemStack> PLANKS;
|
||||
private static List<IPlankType> PLANK_TYPES;
|
||||
private static Map<IPlankType, ItemStack> PLANKS_STACKS;
|
||||
|
||||
public static String getDisplayName(IWoodTyped wood, IWoodType woodType) {
|
||||
WoodBlockKind blockKind = wood.getBlockKind();
|
||||
@@ -143,27 +144,29 @@ public class WoodManager {
|
||||
}
|
||||
|
||||
public static List<IPlankType> getAllPlankTypes() {
|
||||
List<IPlankType> list = new ArrayList<>();
|
||||
Collections.addAll(list, PlankType.ExtraTreePlanks.values());
|
||||
Collections.addAll(list, PlankType.ForestryPlanks.values());
|
||||
//TODO: extrabiomes 1.10.2
|
||||
/*for (final IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
list.add(type);
|
||||
}
|
||||
}*/
|
||||
Collections.addAll(list, PlankType.VanillaPlanks.values());
|
||||
return list;
|
||||
if(PLANK_TYPES == null){
|
||||
PLANK_TYPES = new ArrayList<>();
|
||||
Collections.addAll(PLANK_TYPES, PlankType.ExtraTreePlanks.VALUES);
|
||||
Collections.addAll(PLANK_TYPES, PlankType.ForestryPlanks.values());
|
||||
Collections.addAll(PLANK_TYPES, PlankType.VanillaPlanks.values());
|
||||
//TODO: extrabiomes 1.10.2
|
||||
/*for (final IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
list.add(type);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
return PLANK_TYPES;
|
||||
}
|
||||
|
||||
public static Map<IPlankType, ItemStack> getAllPlankStacks() {
|
||||
if (PLANKS == null) {
|
||||
PLANKS = new HashMap<>();
|
||||
if (PLANKS_STACKS == null) {
|
||||
PLANKS_STACKS = new HashMap<>();
|
||||
for (IPlankType type : getAllPlankTypes()) {
|
||||
PLANKS.put(type, type.getStack(false));
|
||||
PLANKS_STACKS.put(type, type.getStack(false));
|
||||
}
|
||||
}
|
||||
return PLANKS;
|
||||
return PLANKS_STACKS;
|
||||
}
|
||||
|
||||
public static Collection<ItemStack> getAllPlankStacks(IPlankType type) {
|
||||
|
||||
@@ -42,6 +42,6 @@ public class MultiFenceRecipePattern {
|
||||
}
|
||||
|
||||
public ItemStack createFence(IPlankType plank, IPlankType plankSecondary) {
|
||||
return WoodManager.getFence(plank, plankSecondary, new FenceType(size, false, false), 4);
|
||||
return WoodManager.getFence(plank, plankSecondary, new FenceType(size, false, false), 3);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import com.google.common.base.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import binnie.extratrees.block.EnumETLog;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
|
||||
public class ETWoodTypePredicate implements Predicate<EnumETLog> {
|
||||
private final int minWoodTypeMeta;
|
||||
@@ -21,7 +20,7 @@ public class ETWoodTypePredicate implements Predicate<EnumETLog> {
|
||||
@Override
|
||||
public boolean apply(@Nullable EnumETLog woodType) {
|
||||
if (woodType != null) {
|
||||
if (isLog || woodType.getPlank() instanceof PlankType.ExtraTreePlanks) {
|
||||
if (isLog || woodType.hasProducts()) {
|
||||
if (woodType.getMetadata() >= minWoodTypeMeta && woodType.getMetadata() <= maxWoodTypeMeta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,14 @@ import java.util.List;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import forestry.api.arboriculture.IAlleleFruit;
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.genetics.AlleleRegisterEvent;
|
||||
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
|
||||
import forestry.api.lepidopterology.IButterflyRoot;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
|
||||
public class ModuleGenetics implements IInitializable {
|
||||
String[] branches;
|
||||
@@ -26,6 +30,16 @@ public class ModuleGenetics implements IInitializable {
|
||||
AlleleETFruit.preInit();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void speciesRegister(AlleleSpeciesRegisterEvent event) {
|
||||
if (event.getRoot() instanceof ITreeRoot) {
|
||||
ETTreeDefinition.preInitTrees();
|
||||
PlankType.ExtraTreePlanks.initWoodTypes();
|
||||
} else if (event.getRoot() instanceof IButterflyRoot && BinnieCore.isLepidopteryActive()) {
|
||||
ButterflySpecies.preInit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
|
||||
@@ -3,7 +3,6 @@ package binnie.extratrees.machines;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
@@ -45,9 +44,9 @@ public class ModuleMachine implements IInitializable {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Press.get(1), "iGi", "tSt", "tPt", 'i', "ingotIron", 'G', Blocks.GLASS, 't', "ingotTin", 'S', Mods.Forestry.stack("sturdy_machine"), 'P', "gearBronze"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Brewery.get(1), "bGb", "iSi", "bPb", 'i', "ingotIron", 'G', Blocks.GLASS, 'b', "gearBronze", 'S', Mods.Forestry.stack("sturdy_machine"), 'P', "gearBronze"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Distillery.get(1), "rGr", "iSi", "rPr", 'i', "ingotIron", 'G', Blocks.GLASS, 'r', "dustRedstone", 'S', Mods.Forestry.stack("sturdy_machine"), 'P', "gearBronze"));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Woodworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.PLANKS, 's', Mods.Forestry.stack("impregnated_casing")));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Panelworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.WOODEN_SLAB, 's', Mods.Forestry.stack("impregnated_casing")));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Glassworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.GLASS, 's', Mods.Forestry.stack("impregnated_casing")));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Tileworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Items.CLAY_BALL, 's', Mods.Forestry.stack("impregnated_casing")));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Woodworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.PLANKS, 's', Mods.Forestry.stack("impregnated_casing")));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Panelworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.WOODEN_SLAB, 's', Mods.Forestry.stack("impregnated_casing")));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Glassworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.GLASS, 's', Mods.Forestry.stack("impregnated_casing")));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Tileworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Items.CLAY_BALL, 's', Mods.Forestry.stack("impregnated_casing")));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user