Removed Farm
This commit is contained in:
parent
97d990e316
commit
081f16a533
17 changed files with 1 additions and 946 deletions
|
@ -125,8 +125,6 @@ public class GuiHandler implements IGuiHandler {
|
|||
return new ContainerIDSU((TileIDSU) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == chargeBench) {
|
||||
return new ContainerChargeBench((TileChargeBench) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == farmID) {
|
||||
return new ContainerFarm((TileFarm) world.getTileEntity(x, y, z), player);
|
||||
}
|
||||
|
||||
|
||||
|
@ -215,8 +213,6 @@ public class GuiHandler implements IGuiHandler {
|
|||
return new GuiIDSU(player, (TileIDSU) world.getTileEntity(x, y, z));
|
||||
} else if (ID == chargeBench) {
|
||||
return new GuiChargeBench(player, (TileChargeBench) world.getTileEntity(x, y, z));
|
||||
} else if (ID == farmID) {
|
||||
return new GuiFarm(new ContainerFarm((TileFarm) world.getTileEntity(x, y, z), player));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import techreborn.tiles.TileFarm;
|
||||
|
||||
public class ContainerFarm extends TechRebornContainer {
|
||||
|
||||
TileFarm farm;
|
||||
EntityPlayer player;
|
||||
|
||||
public ContainerFarm(TileFarm farm, EntityPlayer player) {
|
||||
this.farm = farm;
|
||||
this.player = player;
|
||||
|
||||
|
||||
this.addSlotToContainer(new Slot(farm.inventory, 0, 35, 7));
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
this.addSlotToContainer(new Slot(farm.inventory, 1 + i, 71 + (i * 18), 52));
|
||||
}
|
||||
|
||||
|
||||
int p = 5;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
this.addSlotToContainer(new Slot(farm.inventory, p, 143 + (i * 18), 16 + (j * 18)));
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, j + i * 9
|
||||
+ 9, 8 + j * 18 + 27, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18 + 27,
|
||||
142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.client.container.ContainerFarm;
|
||||
|
||||
public class GuiFarm extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/farm.png");
|
||||
|
||||
ContainerFarm containerFarm;
|
||||
|
||||
public GuiFarm(ContainerFarm container) {
|
||||
super(container);
|
||||
this.xSize = 203;
|
||||
this.ySize = 166;
|
||||
container = (ContainerFarm) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int arg0, int arg1) {
|
||||
String name = StatCollector.translateToLocal("tile.techreborn.farm.name");
|
||||
fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2 + 68, 5, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 60,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
super.drawGuiContainerForegroundLayer(arg0, arg1);
|
||||
}
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
package techreborn.client.render;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import techreborn.lib.Functions;
|
||||
import techreborn.lib.vecmath.Vecs3d;
|
||||
import techreborn.lib.vecmath.Vecs3dCube;
|
||||
import techreborn.partSystem.parts.FarmInventoryCable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class RenderFarmInventoryCable {
|
||||
|
||||
|
||||
public static void renderBox(Vecs3dCube cube, Block block, Tessellator tessellator, RenderBlocks renderblocks, IIcon texture, Double xD, Double yD, double zD, float thickness) {
|
||||
block.setBlockBounds((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ(), (float) cube.getMaxX() + thickness, (float) cube.getMaxY() + thickness, (float) cube.getMaxZ() + thickness);
|
||||
renderblocks.setRenderBoundsFromBlock(block);
|
||||
tessellator.setColorOpaque_F(0.5F, 0.5F, 0.5F);
|
||||
renderblocks.renderFaceYNeg(block, xD, yD, zD, texture);
|
||||
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
|
||||
renderblocks.renderFaceYPos(block, xD, yD, zD, texture);
|
||||
tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F);
|
||||
renderblocks.renderFaceZNeg(block, xD, yD, zD, texture);
|
||||
renderblocks.renderFaceZPos(block, xD, yD, zD, texture);
|
||||
tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F);
|
||||
renderblocks.renderFaceXNeg(block, xD, yD, zD, texture);
|
||||
renderblocks.renderFaceXPos(block, xD, yD, zD, texture);
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static boolean renderStatic(Vecs3d translation, int pass, FarmInventoryCable part) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
IIcon stone = Blocks.stone.getIcon(0, 0);
|
||||
IIcon redstone = Blocks.redstone_block.getIcon(0, 0);
|
||||
IIcon quartz = Blocks.quartz_block.getIcon(0, 0);
|
||||
RenderBlocks renderblocks = RenderBlocks.getInstance();
|
||||
double xD = part.xCoord;
|
||||
double yD = part.yCoord;
|
||||
double zD = part.zCoord;
|
||||
Block block = part.getBlockType();
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(part.getWorld(), part.getX(), part.getY(), part.getZ()));
|
||||
Vecs3dCube cube = new Vecs3dCube(part.boundingBoxes[6].getMinX() + 0.1, part.boundingBoxes[6].getMinY() + 0.1, part.boundingBoxes[6].getMinZ() + 0.1, part.boundingBoxes[6].getMaxX() - 0.1, part.boundingBoxes[6].getMaxY() - 0.1, part.boundingBoxes[6].getMaxZ() - 0.1);
|
||||
renderBox(cube, block, tessellator, renderblocks, stone, xD, yD, zD, 0F);
|
||||
|
||||
ArrayList<Vecs3dCube> cubes = new ArrayList<Vecs3dCube>();
|
||||
|
||||
cube = new Vecs3dCube(0.15, 0.15, 0.15, 0.3, 0.3, 0.85);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.15, 0.15, 0.15, 0.85, 0.3, 0.3);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.15, 0.15, 0.15, 0.3, 0.85, 0.3);
|
||||
renderBox(cube, block, tessellator, renderblocks, redstone, xD, yD, zD, 0F);
|
||||
|
||||
cube = new Vecs3dCube(0.85, 0.85, 0.85, 0.7, 0.15, 0.7);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.85, 0.85, 0.85, 0.7, 0.7, 0.15);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.85, 0.85, 0.85, 0.15, 0.7, 0.7);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.15, 0.85, 0.85, 0.3, 0.15, 0.7);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.85, 0.85, 0.15, 0.7, 0.15, 0.3);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.85, 0.15, 0.85, 0.7, 0.3, 0.15);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.85, 0.15, 0.85, 0.15, 0.3, 0.7);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.15, 0.85, 0.15, 0.85, 0.7, 0.3);
|
||||
cubes.add(cube);
|
||||
|
||||
cube = new Vecs3dCube(0.15, 0.85, 0.15, 0.3, 0.7, 0.85);
|
||||
cubes.add(cube);
|
||||
|
||||
for (Vecs3dCube vecs3dCube : cubes) {
|
||||
renderBox(vecs3dCube, block, tessellator, renderblocks, redstone, xD, yD, zD, 0f);
|
||||
}
|
||||
|
||||
for (ForgeDirection direction : ForgeDirection.values()) {
|
||||
if (part.connectedSides.get(direction) != null) {
|
||||
renderBox(part.boundingBoxes[Functions.getIntDirFromDirection(direction)], block, tessellator, renderblocks, quartz, xD, yD, zD, 0f);
|
||||
}
|
||||
}
|
||||
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderblocks.setRenderBoundsFromBlock(block);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue