mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-24 05:54: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,32 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.kitchen;
|
||||
|
||||
import binnie.core.machines.inventory.ComponentTankContainer;
|
||||
import binnie.extratrees.core.ExtraTreesGUID;
|
||||
import binnie.extratrees.machines.ExtraTreeMachine;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.craftgui.minecraft.IMachineInformation;
|
||||
|
||||
public class BottleRack
|
||||
{
|
||||
public static class PackageBottleRack extends KitchenMachine.PackageKitchenMachine implements IMachineInformation
|
||||
{
|
||||
public PackageBottleRack() {
|
||||
super("bottleRack", ExtraTreeTexture.lumbermillTexture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.KitchenBottleRack);
|
||||
final ComponentTankContainer inventory = new ComponentTankContainer(machine);
|
||||
for (int x = 0; x < 36; ++x) {
|
||||
inventory.addTank(x, "input", 1000);
|
||||
inventory.getTankSlot(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.kitchen;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import binnie.core.resource.ResourceType;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.core.machines.MachinePackage;
|
||||
import binnie.core.machines.IMachineType;
|
||||
|
||||
public enum KitchenMachine implements IMachineType
|
||||
{
|
||||
Worktop((Class<? extends MachinePackage>) null),
|
||||
Cupboard((Class<? extends MachinePackage>) null),
|
||||
BottleRack(BottleRack.PackageBottleRack.class);
|
||||
|
||||
Class<? extends MachinePackage> clss;
|
||||
|
||||
private KitchenMachine(final Class<? extends MachinePackage> clss) {
|
||||
this.clss = clss;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends MachinePackage> getPackageClass() {
|
||||
return this.clss;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return this.clss != null;
|
||||
}
|
||||
|
||||
public ItemStack get(final int i) {
|
||||
return new ItemStack(ExtraTrees.blockKitchen, i, this.ordinal());
|
||||
}
|
||||
|
||||
public abstract static class PackageKitchenMachine extends MachinePackage
|
||||
{
|
||||
BinnieResource textureName;
|
||||
|
||||
protected PackageKitchenMachine(final String uid, final String textureName) {
|
||||
super(uid, false);
|
||||
this.textureName = Binnie.Resource.getFile(ExtraTrees.instance, ResourceType.Tile, textureName);
|
||||
}
|
||||
|
||||
protected PackageKitchenMachine(final String uid, final BinnieResource textureName) {
|
||||
super(uid, false);
|
||||
this.textureName = textureName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(final Machine machine, final double x, final double y, final double z, final float var8, final RenderBlocks renderer) {
|
||||
MachineRendererKitchen.instance.renderMachine(machine, this.textureName, x, y, z, var8, renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.kitchen;
|
||||
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MachineRendererKitchen
|
||||
{
|
||||
static int level;
|
||||
public static MachineRendererKitchen instance;
|
||||
BinnieResource texture;
|
||||
|
||||
public void renderMachine(final Machine machine, final BinnieResource texture, final double x, final double y, final double z, final float var8, final RenderBlocks renderer) {
|
||||
if (renderer != null && renderer.blockAccess != null) {
|
||||
final Block block = machine.getPackage().getGroup().getBlock();
|
||||
final float i = 0.0625f;
|
||||
renderer.setRenderBounds(2.0f * i, 0.0, 2.0f * i, 14.0f * i, 14.0f * i, 14.0f * i);
|
||||
renderer.renderStandardBlock(block, (int) x, (int) y, (int) z);
|
||||
MachineRendererKitchen.level = 1;
|
||||
renderer.setRenderBounds(0.0, 14.0f * i, 0.0, 1.0, 1.0, 1.0);
|
||||
renderer.renderStandardBlock(block, (int) x, (int) y, (int) z);
|
||||
MachineRendererKitchen.level = 0;
|
||||
renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
|
||||
if (RenderManager.instance == null || RenderManager.instance.renderEngine == null) {
|
||||
return;
|
||||
}
|
||||
final IIcon icon = Blocks.dirt.getIcon(0, 0);
|
||||
final Tessellator tess = Tessellator.instance;
|
||||
boolean wasTessellating = true;
|
||||
try {
|
||||
tess.draw();
|
||||
} catch (Exception e) {
|
||||
wasTessellating = false;
|
||||
}
|
||||
tess.startDrawingQuads();
|
||||
tess.draw();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y + 1.0, z + 0.5);
|
||||
RenderManager.instance.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
final float ux = icon.getMinU();
|
||||
final float uy = icon.getMinV();
|
||||
final float uw = icon.getMaxU();
|
||||
final float uh = icon.getMaxV();
|
||||
final int[] widths = { 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 6, 6, 5, 4 };
|
||||
for (int h = 0; h < 15; ++h) {
|
||||
final float h2 = h * i;
|
||||
final float h3 = h2 + i;
|
||||
final float d1 = widths[h] * i;
|
||||
final float d2 = widths[h + 1] * i;
|
||||
float ang = 0.707f;
|
||||
final float half = 8.0f * i;
|
||||
if (h < 13) {
|
||||
ang -= 0.05f;
|
||||
for (int angle = 0; angle < 360; angle += 90) {
|
||||
}
|
||||
if (h == 12) {
|
||||
}
|
||||
ang += 0.05f;
|
||||
}
|
||||
for (int angle = 0; angle < 360; angle += 90) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(angle, 0.0f, 1.0f, 0.0f);
|
||||
GL11.glTranslatef(-0.5f, 0.0f, 0.0f);
|
||||
tess.startDrawingQuads();
|
||||
tess.setColorRGBA(255, 255, 255, 150);
|
||||
tess.addVertexWithUV(half - d1 * ang, h2, -d1 * ang, 0.0, 0.0);
|
||||
tess.addVertexWithUV(half - d2 * ang, h3, -d2 * ang, 0.0, 0.0);
|
||||
tess.addVertexWithUV(half + d2 * ang, h3, -d2 * ang, 0.0, 0.0);
|
||||
tess.addVertexWithUV(half + d1 * ang, h2, -d1 * ang, 0.0, 0.0);
|
||||
tess.draw();
|
||||
tess.startDrawingQuads();
|
||||
tess.addVertexWithUV(half + d1 * ang, h2, -d1 * ang, 0.0, 0.0);
|
||||
tess.addVertexWithUV(half + d2 * ang, h3, -d2 * ang, 0.0, 0.0);
|
||||
tess.addVertexWithUV(half - d2 * ang, h3, -d2 * ang, 0.0, 0.0);
|
||||
tess.addVertexWithUV(half - d1 * ang, h2, -d1 * ang, 0.0, 0.0);
|
||||
tess.draw();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
if (wasTessellating) {
|
||||
tess.startDrawingQuads();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
MachineRendererKitchen.level = 0;
|
||||
MachineRendererKitchen.instance = new MachineRendererKitchen();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extratrees.kitchen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import forestry.api.core.Tabs;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleKitchen implements IInitializable
|
||||
{
|
||||
@Override
|
||||
public void preInit() {
|
||||
final MachineGroup machineGroup = new MachineGroup(ExtraTrees.instance, "kitchen", "kitchen", KitchenMachine.values());
|
||||
machineGroup.setCreativeTab(Tabs.tabArboriculture);
|
||||
machineGroup.customRenderer = false;
|
||||
ExtraTrees.blockKitchen = machineGroup.getBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user