mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 13:09:47 +00:00
port to forestry 4.2
This commit is contained in:
1 parent
dbc5c1a564
commit
f969f63b66
3697 files changed
+78372
No files matched your search
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.core;
|
||||
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.core.resource.ResourceType;
|
||||
import binnie.core.resource.IBinnieTexture;
|
||||
|
||||
public enum ExtraTreeTexture implements IBinnieTexture
|
||||
{
|
||||
Gui(ResourceType.GUI, "gui"),
|
||||
Nursery(ResourceType.Tile, "Nursery");
|
||||
|
||||
String texture;
|
||||
ResourceType type;
|
||||
public static String carpenterTexture;
|
||||
public static String panelerTexture;
|
||||
public static String tileworkerTexture;
|
||||
public static String incubatorTexture;
|
||||
public static String lumbermillTexture;
|
||||
public static String pressTexture;
|
||||
public static String distilleryTexture;
|
||||
public static String breweryTexture;
|
||||
public static String infuserTexture;
|
||||
|
||||
private ExtraTreeTexture(final ResourceType base, final String texture) {
|
||||
this.texture = texture;
|
||||
this.type = base;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BinnieResource getTexture() {
|
||||
return Binnie.Resource.getPNG(ExtraTrees.instance, this.type, this.texture);
|
||||
}
|
||||
|
||||
static {
|
||||
ExtraTreeTexture.carpenterTexture = "extratrees/carpenter_";
|
||||
ExtraTreeTexture.panelerTexture = "extratrees/paneler_";
|
||||
ExtraTreeTexture.tileworkerTexture = "extratrees/tileworker_";
|
||||
ExtraTreeTexture.incubatorTexture = "extratrees/incubator_";
|
||||
ExtraTreeTexture.lumbermillTexture = "extratrees/sawmill_";
|
||||
ExtraTreeTexture.pressTexture = "extratrees/press_";
|
||||
ExtraTreeTexture.distilleryTexture = "extratrees/distillery_";
|
||||
ExtraTreeTexture.breweryTexture = "extratrees/brewery_";
|
||||
ExtraTreeTexture.infuserTexture = "extratrees/infuser_";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.core;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowSetSquare;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowLepidopteristDatabase;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowDistillery;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowBrewery;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowPress;
|
||||
import binnie.craftgui.extratrees.kitchen.WindowBottleRack;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowLumbermill;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowWoodworker;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowArboristDatabase;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
|
||||
public enum ExtraTreesGUID implements IBinnieGUID
|
||||
{
|
||||
Database,
|
||||
Woodworker,
|
||||
Lumbermill,
|
||||
DatabaseNEI,
|
||||
Incubator,
|
||||
MothDatabase,
|
||||
MothDatabaseNEI,
|
||||
Press,
|
||||
Brewery,
|
||||
Distillery,
|
||||
KitchenBottleRack,
|
||||
Infuser,
|
||||
SetSquare;
|
||||
|
||||
@Override
|
||||
public Window getWindow(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) {
|
||||
Window window = null;
|
||||
final TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
IInventory object = null;
|
||||
if (tileEntity instanceof IInventory) {
|
||||
object = (IInventory) tileEntity;
|
||||
}
|
||||
switch (this) {
|
||||
case Database:
|
||||
case DatabaseNEI: {
|
||||
window = WindowArboristDatabase.create(player, side, this != ExtraTreesGUID.Database);
|
||||
break;
|
||||
}
|
||||
case Woodworker: {
|
||||
window = WindowWoodworker.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case Lumbermill: {
|
||||
window = WindowLumbermill.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case KitchenBottleRack: {
|
||||
window = WindowBottleRack.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case Press: {
|
||||
window = WindowPress.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case Brewery: {
|
||||
window = WindowBrewery.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case Distillery: {
|
||||
window = WindowDistillery.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case MothDatabase:
|
||||
case MothDatabaseNEI: {
|
||||
window = WindowLepidopteristDatabase.create(player, side, this != ExtraTreesGUID.MothDatabase);
|
||||
break;
|
||||
}
|
||||
case SetSquare: {
|
||||
window = WindowSetSquare.create(player, world, x, y, z, side);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return window;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.core;
|
||||
|
||||
import java.util.Queue;
|
||||
import java.io.IOException;
|
||||
|
||||
import binnie.extratrees.carpentry.EnumPattern;
|
||||
import binnie.extratrees.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.genetics.ExtraTreeFruitGene;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import binnie.extratrees.block.ILogType;
|
||||
import binnie.extratrees.genetics.ExtraTreeSpecies;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.FileWriter;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleCore implements IInitializable
|
||||
{
|
||||
@Override
|
||||
public void preInit() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
if (BinnieCore.proxy.isDebug()) {
|
||||
try {
|
||||
final PrintWriter outputSpecies = new PrintWriter(new FileWriter("data/species.html"));
|
||||
final PrintWriter outputLogs = new PrintWriter(new FileWriter("data/logs.html"));
|
||||
final PrintWriter outputPlanks = new PrintWriter(new FileWriter("data/planks.html"));
|
||||
final PrintWriter outputFruit = new PrintWriter(new FileWriter("data/fruit.html"));
|
||||
final PrintWriter outputDesigns = new PrintWriter(new FileWriter("data/designs.html"));
|
||||
final Queue<IAlleleTreeSpecies> speciesQueue = new LinkedList<IAlleleTreeSpecies>();
|
||||
for (final IAlleleTreeSpecies s : ExtraTreeSpecies.values()) {
|
||||
speciesQueue.add(s);
|
||||
}
|
||||
final Queue<ILogType> logQueue = new LinkedList<ILogType>();
|
||||
for (final ILogType wood : ILogType.ExtraTreeLog.values()) {
|
||||
logQueue.add(wood);
|
||||
}
|
||||
final Queue<IDesignMaterial> plankQueue = new LinkedList<IDesignMaterial>();
|
||||
for (final IDesignMaterial wood2 : PlankType.ExtraTreePlanks.values()) {
|
||||
plankQueue.add(wood2);
|
||||
}
|
||||
final Queue<ExtraTreeFruitGene> fruitQueue = new LinkedList<ExtraTreeFruitGene>();
|
||||
for (final ExtraTreeFruitGene wood3 : ExtraTreeFruitGene.values()) {
|
||||
fruitQueue.add(wood3);
|
||||
}
|
||||
final Queue<IDesign> designQueue = new LinkedList<IDesign>();
|
||||
for (final IDesign wood4 : CarpentryManager.carpentryInterface.getSortedDesigns()) {
|
||||
designQueue.add(wood4);
|
||||
}
|
||||
fruitQueue.remove(ExtraTreeFruitGene.Apple);
|
||||
outputSpecies.println("<table style=\"width: 100%;\">");
|
||||
while (!speciesQueue.isEmpty()) {
|
||||
outputSpecies.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
final IAlleleTreeSpecies species = speciesQueue.poll();
|
||||
outputSpecies.println("<td>" + ((species == null) ? "" : species.getName()) + "</td>");
|
||||
}
|
||||
outputSpecies.println("</tr>");
|
||||
}
|
||||
outputSpecies.println("</table>");
|
||||
outputLogs.println("<table style=\"width: 100%;\">");
|
||||
while (!logQueue.isEmpty()) {
|
||||
outputLogs.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
final ILogType.ExtraTreeLog wood5 = (ILogType.ExtraTreeLog) logQueue.poll();
|
||||
if (wood5 == null) {
|
||||
outputLogs.println("<td></td>");
|
||||
}
|
||||
else {
|
||||
final String img = "<img alt=\"" + wood5.getName() + "\" src=\"images/logs/" + wood5.toString().toLowerCase() + "Bark.png\">";
|
||||
outputLogs.println("<td>" + img + " " + wood5.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputLogs.println("</tr>");
|
||||
}
|
||||
outputLogs.println("</table>");
|
||||
outputPlanks.println("<table style=\"width: 100%;\">");
|
||||
while (!plankQueue.isEmpty()) {
|
||||
outputPlanks.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
final IDesignMaterial wood2 = plankQueue.poll();
|
||||
if (wood2 == null) {
|
||||
outputPlanks.println("<td></td>");
|
||||
}
|
||||
else {
|
||||
final String img = "<img alt=\"" + wood2.getName() + "\" src=\"images/planks/" + wood2.getName() + ".png\">";
|
||||
outputPlanks.println("<td>" + img + " " + wood2.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputPlanks.println("</tr>");
|
||||
}
|
||||
outputPlanks.println("</table>");
|
||||
outputFruit.println("<table style=\"width: 100%;\">");
|
||||
while (!fruitQueue.isEmpty()) {
|
||||
outputFruit.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
final ExtraTreeFruitGene wood6 = fruitQueue.poll();
|
||||
if (wood6 == null) {
|
||||
outputFruit.println("<td></td>");
|
||||
}
|
||||
else {
|
||||
final String fruit = wood6.getNameOfFruit();
|
||||
final String img2 = "<img alt=\"" + wood6.getName() + "\" src=\"images/fruits/" + fruit + ".png\">";
|
||||
outputFruit.println("<td>" + img2 + " " + wood6.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputFruit.println("</tr>");
|
||||
}
|
||||
outputFruit.println("</table>");
|
||||
outputDesigns.println("<table style=\"width: 100%;\">");
|
||||
while (!designQueue.isEmpty()) {
|
||||
outputDesigns.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
final IDesign wood4 = designQueue.poll();
|
||||
if (wood4 == null) {
|
||||
outputDesigns.println("<td></td>");
|
||||
}
|
||||
else {
|
||||
final String texture = ((EnumPattern) wood4.getTopPattern().getPattern()).toString().toLowerCase();
|
||||
final String img2 = "<img alt=\"" + texture + "\" src=\"images/pattern/" + texture + ".png\">";
|
||||
outputDesigns.println("<td>" + img2 + " " + wood4.getName() + "</td>");
|
||||
}
|
||||
}
|
||||
outputDesigns.println("</tr>");
|
||||
}
|
||||
outputDesigns.println("</table>");
|
||||
outputSpecies.close();
|
||||
outputLogs.close();
|
||||
outputPlanks.close();
|
||||
outputFruit.close();
|
||||
outputDesigns.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user