igen 3: revenge of the sith

This commit is contained in:
Bob 2021-12-05 20:33:56 +01:00
parent b54a36f716
commit a77cf08818
24 changed files with 5515 additions and 6451 deletions

View File

@ -130,7 +130,9 @@ public abstract class BlockDummyable extends BlockContainer {
if(!(player instanceof EntityPlayer)) if(!(player instanceof EntityPlayer))
return; return;
safeRem = true;
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
safeRem = false;
EntityPlayer pl = (EntityPlayer) player; EntityPlayer pl = (EntityPlayer) player;
@ -195,7 +197,6 @@ public abstract class BlockDummyable extends BlockContainer {
} }
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, getDimensions(), this, dir); MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, getDimensions(), this, dir);
} }

View File

@ -174,6 +174,7 @@ public class BlockBobble extends BlockContainer {
ADAM29("Adam29", "Adam29", "Ethanol, liquid petroleum gas", "You know, nukes are really quite beatiful.$It's like watching a star be born for a split second.", true), ADAM29("Adam29", "Adam29", "Ethanol, liquid petroleum gas", "You know, nukes are really quite beatiful.$It's like watching a star be born for a split second.", true),
UFFR("UFFR", "UFFR", "All sorts of things from his PR", "fried shrimp", false), UFFR("UFFR", "UFFR", "All sorts of things from his PR", "fried shrimp", false),
VAER("vaer", "vaer", "ZIRNOX", "taken de family out to the weekend cigarette festival", true), VAER("vaer", "vaer", "ZIRNOX", "taken de family out to the weekend cigarette festival", true),
NOS("Dr Nostalgia", "Dr Nostalgia", "SSG and Vortex models", "Take a picture, I'ma pose, paparazzi$I've been drinking, moving like a zombie", true),
//testing garbage. why is she so dumb? //testing garbage. why is she so dumb?
CIRNO("Cirno", "Cirno", "being a dumb ice fairy", "No brain. Head empty.", true); CIRNO("Cirno", "Cirno", "being a dumb ice fairy", "No brain. Head empty.", true);

View File

@ -48,7 +48,7 @@ public class MachineIGenerator extends BlockDummyable {
return false; return false;
} }
/*@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) { if(world.isRemote) {
@ -69,53 +69,22 @@ public class MachineIGenerator extends BlockDummyable {
} else { } else {
return false; return false;
} }
}*/ }
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);
this.makeExtra(world, x + dir.offsetX * (o - 3), y, z + dir.offsetZ * (o - 3));
this.makeExtra(world, x + dir.offsetX * (o + 2), y, z + dir.offsetZ * (o + 2));
}
@Override @Override
public int[] getDimensions() { public int[] getDimensions() {
return new int [] {1,0,2,2,2,4}; return new int [] {2, 0, 3, 2, 1, 1};
} }
@Override @Override
public int getOffset() { public int getOffset() {
return 2; return 2;
} }
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, getDimensions(), x, y, z, dir))
return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int [] {5,0,2,2,8,-2}, x, y, z, dir))
return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int [] {4,0,2,2,-4,8}, x, y, z, dir))
return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int [] {3,-2,1,1,-1,3}, x, y, z, dir))
return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int [] {4,-2,1,1,1,0}, x, y, z, dir))
return false;
return true;
}
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, getDimensions(), this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int [] {5,0,2,2,8,-2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int [] {4,0,2,2,-4,8}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int [] {3,-2,1,1,-1,3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int [] {4,-2,1,1,1,0}, this, dir);
/*int[] rot = MultiblockHandlerXR.rotate(new int [] {1,0,2,2,8,8}, dir);
for(int iy = 0; iy <= 1; iy++) {
for(int ix = -rot[4]; ix <= rot[5]; ix++) {
for(int iz = -rot[2]; iz <= rot[3]; iz++) {
if(ix == -rot[4] || ix == rot[5] || iz == -rot[2] || iz == rot[3]) {
this.makeExtra(world, x + dir.offsetX * o + ix, y + iy, z + dir.offsetZ * o + iz);
}
}
}
}*/
}
} }

View File

@ -18,81 +18,66 @@ public class ContainerIGenerator extends Container {
igen = te; igen = te;
//Solid Fuel
this.addSlotToContainer(new Slot(te, 0, 5, 27));
//RTG In
this.addSlotToContainer(new Slot(te, 1, 41, 63));
//RTG Out
this.addSlotToContainer(new SlotMachineOutput(te, 2, 41, 99));
//Thermo Slots
this.addSlotToContainer(new Slot(te, 3, 68, 36));
this.addSlotToContainer(new Slot(te, 4, 86, 36));
this.addSlotToContainer(new Slot(te, 5, 104, 36));
//Battery //Battery
this.addSlotToContainer(new Slot(te, 6, 86, 108)); this.addSlotToContainer(new Slot(te, 0, 8, 134));
//Water In //Water
this.addSlotToContainer(new Slot(te, 7, 131, 27)); this.addSlotToContainer(new Slot(te, 1, 62, 112));
//Water Out this.addSlotToContainer(new SlotMachineOutput(te, 2, 154, 112));
this.addSlotToContainer(new SlotMachineOutput(te, 8, 167, 27)); //Solid Fuel
//Fuel In this.addSlotToContainer(new Slot(te, 3, 67, 51));
this.addSlotToContainer(new Slot(te, 9, 131, 63)); this.addSlotToContainer(new Slot(te, 4, 85, 51));
//Fuel Out this.addSlotToContainer(new Slot(te, 5, 67, 87));
this.addSlotToContainer(new SlotMachineOutput(te, 10, 167, 63)); this.addSlotToContainer(new Slot(te, 6, 85, 87));
//ID In //Lubricant
this.addSlotToContainer(new Slot(te, 11, 131, 81)); this.addSlotToContainer(new Slot(te, 7, 132, 33));
//ID Out this.addSlotToContainer(new SlotMachineOutput(te, 8, 132, 51));
this.addSlotToContainer(new SlotMachineOutput(te, 12, 167, 81)); //Fuel
//Lube In this.addSlotToContainer(new Slot(te, 9, 132, 69));
this.addSlotToContainer(new Slot(te, 13, 131, 99)); this.addSlotToContainer(new SlotMachineOutput(te, 10, 132, 87));
//Lube Out //RTG
this.addSlotToContainer(new SlotMachineOutput(te, 14, 167, 99)); for(int i = 0; i < 5; i++) {
for(int j = 0; j < 2; j++) {
for(int i = 0; i < 3; i++) this.addSlotToContainer(new Slot(te, 11 + i * 2 + j, 15 + j * 18, 35 + i * 18));
{
for(int j = 0; j < 9; j++)
{
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 14 + j * 18, 84 + i * 18 + 56));
} }
} }
for(int i = 0; i < 9; i++) for(int i = 0; i < 3; i++) {
{ for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(invPlayer, i, 14 + i * 18, 142 + 56)); this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 71));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 71));
} }
} }
//TODO: use smart shift click magic
@Override @Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) { public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
ItemStack var3 = null; ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2); Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack()) if(var4 != null && var4.getHasStack()) {
{
ItemStack var5 = var4.getStack(); ItemStack var5 = var4.getStack();
var3 = var5.copy(); var3 = var5.copy();
if (par2 <= 14) { if(par2 <= 20) {
if (!this.mergeItemStack(var5, 15, this.inventorySlots.size(), true)) if(!this.mergeItemStack(var5, 21, this.inventorySlots.size(), true)) {
{
return null; return null;
} }
} else { } else {
return null; return null;
} }
if (var5.stackSize == 0) if(var5.stackSize == 0) {
{
var4.putStack((ItemStack) null); var4.putStack((ItemStack) null);
} } else {
else
{
var4.onSlotChanged(); var4.onSlotChanged();
} }
} }
return var3; return var3;
} }
@Override @Override
public boolean canInteractWith(EntityPlayer player) { public boolean canInteractWith(EntityPlayer player) {

View File

@ -1,90 +1,62 @@
package com.hbm.inventory.gui; package com.hbm.inventory.gui;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.container.ContainerIGenerator; import com.hbm.inventory.container.ContainerIGenerator;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.packet.AuxButtonPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.render.util.GaugeUtil;
import com.hbm.render.util.GaugeUtil.Gauge;
import com.hbm.tileentity.machine.TileEntityMachineIGenerator; import com.hbm.tileentity.machine.TileEntityMachineIGenerator;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
public class GUIIGenerator extends GuiInfoContainer { public class GUIIGenerator extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/generators/gui_igen.png"); private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/generators/gui_igen.png");
private TileEntityMachineIGenerator igen; private TileEntityMachineIGenerator igen;
boolean caughtMouse = false;
public GUIIGenerator(InventoryPlayer invPlayer, TileEntityMachineIGenerator tedf) { public GUIIGenerator(InventoryPlayer invPlayer, TileEntityMachineIGenerator tedf) {
super(new ContainerIGenerator(invPlayer, tedf)); super(new ContainerIGenerator(invPlayer, tedf));
igen = tedf; igen = tedf;
this.xSize = 188; this.xSize = 176;
this.ySize = 222; this.ySize = 237;
} }
@Override @Override
public void drawScreen(int x, int y, float f) { public void drawScreen(int x, int y, float f) {
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
if(!caughtMouse && Mouse.isButtonDown(0) && guiLeft + 85 <= x && guiLeft + 85 + 18 > x && guiTop + 71 < y && guiTop + 71 + 18 >= y) { this.drawElectricityInfo(this, x, y, guiLeft + 26, guiTop + 134, 142, 16, igen.power, igen.maxPower);
caughtMouse = true;
}
if(caughtMouse && !Mouse.isButtonDown(0)) { for(int i = 0; i < 4; i++) {
int dial = (int) Math.round(Math.toDegrees(getAngle(x, y))); int fire = igen.burn[i];
igen.setDialByAngle(dial);
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(igen.xCoord, igen.yCoord, igen.zCoord, dial, 2));
caughtMouse = false;
}
this.drawCustomInfoStat(x, y, guiLeft + 76, guiTop + 20, 36, 12, x, y, new String[] { (igen.temperature + 300) + "K" }); this.drawCustomInfoStat(x, y, guiLeft + 68 + (i % 2) * 18, guiTop + 34 + (i / 2) * 36, 14, 14, x, y, new String[] {(fire / 20) + "s"});
this.drawCustomInfoStat(x, y, guiLeft + 76, guiTop + 56, 36, 12, x, y, new String[] { (Math.round((igen.torque * igen.animSpeed / (360D * 20D)) * 10D) / 10D) + "RPM" }); }
this.drawCustomInfoStat(x, y, guiLeft + 76, guiTop + 92, 36, 12, x, y, new String[] { Library.getShortNumber(igen.power) + "HE" });
this.drawCustomInfoStat(x, y, guiLeft + 40, guiTop + 26, 18, 18, x, y, new String[] { (igen.burnTime / 20) + "s" });
this.drawCustomInfoStat(x, y, guiLeft + 24, guiTop + 64, 14, 14, x, y, new String[] { "Add pellet to stack" });
this.drawCustomInfoStat(x, y, guiLeft + 24, guiTop + 100, 14, 14, x, y, new String[] { "Take pellet from stack" });
igen.tanks[0].renderTankInfo(this, x, y, guiLeft + 148, guiTop + 26, 18, 18); this.drawCustomInfoStat(x, y, guiLeft + 113, guiTop + 4, 54, 18, x, y, new String[] {"Heat generated"});
igen.tanks[1].renderTankInfo(this, x, y, guiLeft + 148, guiTop + 62, 18, 18);
igen.tanks[2].renderTankInfo(this, x, y, guiLeft + 148, guiTop + 98, 18, 18); igen.tanks[0].renderTankInfo(this, x, y, guiLeft + 80, guiTop + 112, 72, 16);
igen.tanks[1].renderTankInfo(this, x, y, guiLeft + 114, guiTop + 33, 16, 70);
igen.tanks[2].renderTankInfo(this, x, y, guiLeft + 150, guiTop + 33, 18, 70);
} }
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
if(guiLeft + 24 <= x && guiLeft + 24 + 14 > x && guiTop + 64 < y && guiTop + 64 + 14 >= y) {
//push pellet
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(igen.xCoord, igen.yCoord, igen.zCoord, 0, 0));
}
if(guiLeft + 24 <= x && guiLeft + 24 + 14 > x && guiTop + 100 < y && guiTop + 100 + 14 >= y) {
//pop pellet
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(igen.xCoord, igen.yCoord, igen.zCoord, 0, 1));
}
}
@Override @Override
protected void drawGuiContainerForegroundLayer(int i, int j) { protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.igen.hasCustomInventoryName() ? this.igen.getInventoryName() : I18n.format(this.igen.getInventoryName()); String name = this.igen.hasCustomInventoryName() ? this.igen.getInventoryName() : I18n.format(this.igen.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); GL11.glPushMatrix();
this.fontRendererObj.drawString(I18n.format("container.inventory"), 14, this.ySize - 96 + 2, 4210752); double scale = 0.75D;
GL11.glScaled(scale, scale, 1);
this.fontRendererObj.drawString(name, 22, 18, 0x303030);
GL11.glPopMatrix();
String spin = this.igen.spin + "";
this.fontRendererObj.drawString(spin, 139 - this.fontRendererObj.getStringWidth(spin) / 2, 10, 0x00ff00);
} }
@Override @Override
@ -93,74 +65,29 @@ public class GUIIGenerator extends GuiInfoContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture); Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
for(int i = 0; i < igen.pellets.length; i++) { int water = igen.tanks[0].getFill() * 72 / igen.tanks[0].getMaxFill();
drawTexturedModalRect(guiLeft + 80, guiTop + 112, 184, 14, water, 16);
if(igen.pellets[i] != null) int power = (int) (igen.power * 142 / igen.maxPower);
drawTexturedModalRect(guiLeft + 6, guiTop + 106 - 4 * i, 188, igen.pellets[i].offset, 14, 9); drawTexturedModalRect(guiLeft + 26, guiTop + 134, 0, 237, power, 16);
}
for(int i = 0; i < 3; i++) { for(int i = 0; i < 4; i++) {
if(igen.tanks[i].getFill() > 0) { int fire = igen.burn[i];
int hex = igen.tanks[i].getTankType().getColor(); if(fire > 0) {
drawTexturedModalRect(guiLeft + 68 + (i % 2) * 18, guiTop + 34 + (i / 2) * 36, 184, 0, 14, 14);
int r = (hex & 0xFF0000) >> 16;
int g = (hex & 0xFF00) >> 8;
int b = (hex & 0xFF);
GL11.glColor3f(r / 256F, g / 256F, b / 256F);
drawTexturedModalRect(guiLeft + 149, guiTop + 39 + 36 * i, 218, 0, 16, 4);
} }
} }
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); if(igen.hasRTG) {
drawTexturedModalRect(guiLeft + 9, guiTop + 34, 176, 0, 4, 89);
drawTexturedModalRect(guiLeft + 51, guiTop + 34, 180, 0, 4, 89);
}
drawDial(x, y); Minecraft.getMinecraft().getTextureManager().bindTexture(igen.tanks[1].getSheet());
igen.tanks[1].renderTank(this, guiLeft + 114, guiTop + 103, igen.tanks[1].getTankType().textureX() * FluidTank.x, igen.tanks[1].getTankType().textureY() * FluidTank.y, 16, 70);
GaugeUtil.renderGauge(Gauge.BOW_SMALL, guiLeft + 40, guiTop + 26, this.zLevel, igen.getSolidGauge()); Minecraft.getMinecraft().getTextureManager().bindTexture(igen.tanks[2].getSheet());
igen.tanks[2].renderTank(this, guiLeft + 150, guiTop + 103, igen.tanks[2].getTankType().textureX() * FluidTank.x, igen.tanks[2].getTankType().textureY() * FluidTank.y, 16, 70);
GaugeUtil.renderGauge(Gauge.BAR_SMALL, guiLeft + 76, guiTop + 20, this.zLevel, igen.getTempGauge());
GaugeUtil.renderGauge(Gauge.BAR_SMALL, guiLeft + 76, guiTop + 56, this.zLevel, igen.getTorqueGauge());
GaugeUtil.renderGauge(Gauge.BAR_SMALL, guiLeft + 76, guiTop + 92, this.zLevel, igen.getPowerGauge());
GaugeUtil.renderGauge(Gauge.WIDE_SMALL, guiLeft + 148, guiTop + 26, this.zLevel, (double)igen.tanks[0].getFill() / (double)igen.tanks[0].getMaxFill());
GaugeUtil.renderGauge(Gauge.WIDE_SMALL, guiLeft + 148, guiTop + 62, this.zLevel, (double)igen.tanks[1].getFill() / (double)igen.tanks[1].getMaxFill());
GaugeUtil.renderGauge(Gauge.WIDE_SMALL, guiLeft + 148, guiTop + 98, this.zLevel, (double)igen.tanks[2].getFill() / (double)igen.tanks[2].getMaxFill());
}
private void drawDial(float x, float y) {
float angle = (float) getAngle(x, y);
double pixel = 1D/256D;
Vec3 vec = Vec3.createVectorHelper(8, 8, 0);
vec.rotateAroundZ(-angle);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(guiLeft + 94 + vec.xCoord, guiTop + 80 + vec.yCoord, this.zLevel, pixel * 218, 0);
vec.rotateAroundZ((float)Math.toRadians(90));
tessellator.addVertexWithUV(guiLeft + 94 + vec.xCoord, guiTop + 80 + vec.yCoord, this.zLevel, pixel * 218, pixel * 16);
vec.rotateAroundZ((float)Math.toRadians(90));
tessellator.addVertexWithUV(guiLeft + 94 + vec.xCoord, guiTop + 80 + vec.yCoord, this.zLevel, pixel * 202, pixel * 16);
vec.rotateAroundZ((float)Math.toRadians(90));
tessellator.addVertexWithUV(guiLeft + 94 + vec.xCoord, guiTop + 80 + vec.yCoord, this.zLevel, pixel * 202, 0);
tessellator.draw();
}
private double getAngle(float x, float y) {
if(!caughtMouse)
return Math.toRadians(igen.getAngleFromDial());
double angle = -Math.atan2(guiLeft + 94 - x, guiTop + 80 - y) + (float) Math.PI * 1;
angle = Math.max(angle, Math.PI * 0.25);
angle = Math.min(angle, Math.PI * 1.75);
return angle;
} }
} }

View File

@ -43,7 +43,7 @@ public class GUIMachineDiFurnaceRTG extends GuiInfoContainer {
for(int i = 0; i < pellets.size(); i++) { for(int i = 0; i < pellets.size(); i++) {
ItemRTGPellet pellet = pellets.get(i); ItemRTGPellet pellet = pellets.get(i);
pelletText[i + 1] = I18nUtil.resolveKey("desc.gui.rtgBFurnace.pellet", I18nUtil.resolveKey(pellet.getUnlocalizedName()), pellet.getHeat()); pelletText[i + 1] = I18nUtil.resolveKey("desc.gui.rtgBFurnace.pellet", I18nUtil.resolveKey(pellet.getUnlocalizedName() + ".name"), pellet.getHeat());
} }
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 15, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, pelletText); this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 15, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, pelletText);

View File

@ -166,6 +166,16 @@ public class AnvilRecipes {
new ComparableStack(ModItems.circuit_aluminium, 1 * ukModifier) new ComparableStack(ModItems.circuit_aluminium, 1 * ukModifier)
}, new AnvilOutput(new ItemStack(ModBlocks.machine_assembler))).setTier(2)); }, new AnvilOutput(new ItemStack(ModBlocks.machine_assembler))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {
new OreDictStack(STEEL.ingot(), 6),
new OreDictStack(IRON.plate(), 8),
new OreDictStack(POLYMER.ingot(), 4),
new ComparableStack(ModItems.generator_steel, 2),
new ComparableStack(ModItems.turbine_titanium, 1),
new ComparableStack(ModItems.thermo_element, 3)
}, new AnvilOutput(new ItemStack(ModBlocks.machine_industrial_generator))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe( constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] { new AStack[] {
new ComparableStack(ModBlocks.brick_concrete, 64), new ComparableStack(ModBlocks.brick_concrete, 64),
@ -499,19 +509,6 @@ public class AnvilRecipes {
new AnvilOutput(new ItemStack(Items.stick, 2)) new AnvilOutput(new ItemStack(Items.stick, 2))
}).setTier(2)); }).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModBlocks.machine_industrial_generator), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModBlocks.machine_coal_off, 2)),
new AnvilOutput(new ItemStack(ModBlocks.machine_boiler_off, 2)),
new AnvilOutput(new ItemStack(ModBlocks.machine_large_turbine, 1)),
new AnvilOutput(new ItemStack(ModBlocks.machine_transformer, 1)),
new AnvilOutput(new ItemStack(ModBlocks.steel_scaffold, 20)),
new AnvilOutput(new ItemStack(ModItems.ingot_steel, 12)),
new AnvilOutput(new ItemStack(ModItems.plate_lead, 8)),
new AnvilOutput(new ItemStack(ModItems.plate_aluminium, 12)),
new AnvilOutput(new ItemStack(ModItems.pipes_steel, 1))
}).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe( constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModBlocks.rbmk_moderator), new AnvilOutput[] { new ComparableStack(ModBlocks.rbmk_moderator), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModBlocks.rbmk_blank, 1)), new AnvilOutput(new ItemStack(ModBlocks.rbmk_blank, 1)),

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings { public class RefStrings {
public static final String MODID = "hbm"; public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod"; public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (4060)"; public static final String VERSION = "1.0.27 BETA (4074)";
//HBM's Beta Naming Convention: //HBM's Beta Naming Convention:
//V T (X) //V T (X)
//V -> next release version //V -> next release version

View File

@ -44,6 +44,7 @@ public class RenderBobble extends TileEntitySpecialRenderer {
public static final ResourceLocation bobble_adam = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/adam29.png"); public static final ResourceLocation bobble_adam = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/adam29.png");
public static final ResourceLocation bobble_uffr = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/uffr.png"); public static final ResourceLocation bobble_uffr = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/uffr.png");
public static final ResourceLocation bobble_vaer = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/vaer.png"); public static final ResourceLocation bobble_vaer = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/vaer.png");
public static final ResourceLocation bobble_nos = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/nos.png");
public static final ResourceLocation bobble_cirno = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/cirno.png"); public static final ResourceLocation bobble_cirno = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/cirno.png");
@Override @Override
@ -92,6 +93,7 @@ public class RenderBobble extends TileEntitySpecialRenderer {
case ADAM29: bindTexture(bobble_adam); break; case ADAM29: bindTexture(bobble_adam); break;
case UFFR: bindTexture(bobble_uffr); break; case UFFR: bindTexture(bobble_uffr); break;
case VAER: bindTexture(bobble_vaer); break; case VAER: bindTexture(bobble_vaer); break;
case NOS: bindTexture(bobble_nos); break;
default: bindTexture(ResourceManager.universal); default: bindTexture(ResourceManager.universal);
} }
@ -286,6 +288,15 @@ public class RenderBobble extends TileEntitySpecialRenderer {
this.renderItem(new ItemStack(ModItems.cigarette)); this.renderItem(new ItemStack(ModItems.cigarette));
} }
if(type == BobbleType.NOS) {
GL11.glTranslated(0, 1.75, 0);
GL11.glRotated(180, 1, 0, 0);
double scale = 0.095D;
GL11.glScaled(scale, scale, scale);
this.bindTexture(ResourceManager.hat);
ResourceManager.armor_hat.renderAll();
}
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);

View File

@ -15,110 +15,35 @@ import net.minecraft.util.Vec3;
public class RenderIGenerator extends TileEntitySpecialRenderer { public class RenderIGenerator extends TileEntitySpecialRenderer {
@Override @Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) { public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D); GL11.glTranslated(x + 0.5D, y, z + 0.5D);
switch(te.getBlockMetadata() - BlockDummyable.offset) GL11.glTranslated(1, 0, 0);
{
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break; switch(te.getBlockMetadata() - BlockDummyable.offset) {
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break; case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break; case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break; case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
} }
TileEntityMachineIGenerator igen = (TileEntityMachineIGenerator)te; TileEntityMachineIGenerator igen = (TileEntityMachineIGenerator) te;
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.igen_tex); bindTexture(ResourceManager.igen_tex);
ResourceManager.igen.renderPart("Base"); ResourceManager.igen.renderPart("Body");
float angle = igen.prevRotation + (igen.rotation - igen.prevRotation) * f; float rot = igen.prevRotation + (igen.rotation - igen.prevRotation) * f;
float px = 0.0625F; GL11.glTranslated(0, 1.5D, 0);
float sine = (float) Math.sin(Math.toRadians(angle)); GL11.glRotatef(-rot, 0, 0, 1);
float cosine = (float) Math.cos(Math.toRadians(angle)); GL11.glTranslated(0, -1.5D, 0);
float armAng = 22.5F; ResourceManager.igen.renderPart("Rotor");
GL11.glPushMatrix(); GL11.glPopMatrix();
GL11.glTranslated(0, 3.5, 0); }
GL11.glRotatef(angle, 0, 0, 1);
GL11.glTranslated(0, -3.5, 0);
bindTexture(ResourceManager.igen_rotor);
ResourceManager.igen.renderPart("Rotor");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 3.5, px * 5);
GL11.glRotatef(angle, -1, 0, 0);
GL11.glTranslated(0, -3.5, px * -5);
bindTexture(ResourceManager.igen_cog);
ResourceManager.igen.renderPart("CogLeft");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 3.5, px * 5);
GL11.glRotatef(angle, 1, 0, 0);
GL11.glTranslated(0, -3.5, px * -5);
bindTexture(ResourceManager.igen_cog);
ResourceManager.igen.renderPart("CogRight");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, cosine * 0.8725 - 1);
bindTexture(ResourceManager.igen_pistons);
ResourceManager.igen.renderPart("Pistons");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, sine * 0.55, cosine * 0.8725 - 1.125);
GL11.glTranslated(0, 3.5, px * 6.5);
GL11.glRotatef(sine * -armAng, 1, 0, 0);
GL11.glTranslated(0, -3.5, px * -5);
bindTexture(ResourceManager.igen_arm);
ResourceManager.igen.renderPart("ArmLeft");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, -sine * 0.55, cosine * 0.8725 - 1.125);
GL11.glTranslated(0, 3.5, px * 6.5);
GL11.glRotatef(sine * armAng, 1, 0, 0);
GL11.glTranslated(0, -3.5, px * -5);
bindTexture(ResourceManager.igen_arm);
ResourceManager.igen.renderPart("ArmRight");
GL11.glPopMatrix();
GL11.glTranslated(-0.75, 5.5625, -7);
if(igen.torque > 0) {
for(int i = 0; i < 2; i++) {
BeamPronter.prontBeam(Vec3.createVectorHelper(1.5, 0, 0), EnumWaveType.RANDOM, EnumBeamType.LINE, 0x8080ff, 0x0000ff, (int)te.getWorldObj().getTotalWorldTime() % 1000 + i, 5, px * 4, 0, 0);
BeamPronter.prontBeam(Vec3.createVectorHelper(1.5, 0, 0), EnumWaveType.RANDOM, EnumBeamType.LINE, 0xffffff, 0x0000ff, (int)te.getWorldObj().getTotalWorldTime() % 1000 + 2 + i, 5, px * 4, 0, 0);
}
}
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
} }

View File

@ -149,7 +149,7 @@ public class TileEntityMachineDiesel extends TileEntityMachineBase implements IE
public int getHEFromFuel() { public int getHEFromFuel() {
FluidType type = tank.getTankType(); FluidType type = tank.getTankType();
Integer value = fuels.get(type); Integer value = fuels.get(type);
return value != null ? value : null; return value != null ? value : 0;
} }
public void generate() { public void generate() {

View File

@ -1,22 +1,22 @@
package com.hbm.tileentity.machine; package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import com.google.common.collect.HashBiMap;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.BlockDummyable;
import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemRTGPellet;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.energy.IEnergyGenerator;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.Item; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -24,36 +24,29 @@ import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineIGenerator extends TileEntityMachineBase implements IFluidAcceptor { public class TileEntityMachineIGenerator extends TileEntityMachineBase implements IFluidAcceptor, IEnergyGenerator {
public long power; public long power;
public static final long maxPower = 1000000; public static final long maxPower = 1000000;
public int lastBurnTime; public int spin;
public int burnTime; public int[] burn = new int[4];
public int temperature; public boolean hasRTG = false;
public static final int maxTemperature = 1000;
public int torque;
public static final int maxTorque = 10000;
public float limiter = 0.0F; /// 0 - 1 ///
public static final int animSpeed = 50;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public float rotation; public float rotation;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public float prevRotation; public float prevRotation;
public IGenRTG[] pellets = new IGenRTG[12];
public FluidTank[] tanks; public FluidTank[] tanks;
public int age = 0; public int age = 0;
public TileEntityMachineIGenerator() { public TileEntityMachineIGenerator() {
super(15); super(21);
tanks = new FluidTank[3]; tanks = new FluidTank[3];
tanks[0] = new FluidTank(FluidType.WATER, 8000, 0); tanks[0] = new FluidTank(FluidType.WATER, 16000, 0);
tanks[1] = new FluidTank(FluidType.HEATINGOIL, 16000, 1); tanks[1] = new FluidTank(FluidType.HEATINGOIL, 16000, 1);
tanks[2] = new FluidTank(FluidType.LUBRICANT, 2000, 2); tanks[2] = new FluidTank(FluidType.LUBRICANT, 4000, 2);
} }
@Override @Override
@ -66,64 +59,116 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
age++; power = Library.chargeItemsFromTE(slots, 0, power, maxPower);
if (age >= 20) {
age = 0;
}
tanks[0].loadTank(7, 8, slots); ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
this.sendPower(worldObj, xCoord + dir.offsetX * -4, yCoord, zCoord + dir.offsetZ * -4, dir.getOpposite());
this.sendPower(worldObj, xCoord + dir.offsetX * 3, yCoord, zCoord + dir.offsetZ * 3, dir);
tanks[1].setType(9, 10, slots);
tanks[0].loadTank(1, 2, slots);
tanks[1].loadTank(9, 10, slots); tanks[1].loadTank(9, 10, slots);
tanks[1].setType(11, 12, slots); tanks[2].loadTank(7, 8, slots);
tanks[2].loadTank(13, 14, slots);
loadFuel(); this.spin = 0;
pelletAction();
if(burnTime > 0) { /// LIQUID FUEL ///
burnTime --; if(tanks[1].getFill() > 0) {
temperature += 100; int pow = this.getPowerFromFuel();
if(pow > 0) {
tanks[1].setFill(tanks[1].getFill() - 1);
this.spin += pow;
}
} }
fuelAction(); ///SOLID FUEL ///
for(int i = 0; i < 4; i++) {
if(temperature > maxTemperature) // POWER GEN //
temperature = maxTemperature; if(burn[i] > 0) {
burn[i]--;
this.spin += coalGenRate;
int displayHeat = temperature; // REFUELING //
} else {
int slot = i + 3;
rtgAction(); if(slots[slot] != null) {
ItemStack fuel = slots[slot];
int burnTime = TileEntityFurnace.getItemBurnTime(fuel) / 2;
rotorAction(); if(burnTime > 0) {
generatorAction();
this.power = Library.chargeItemsFromTE(slots, 6, power, maxPower); if(fuel.getItem() == Items.coal)
burnTime *= 1.5;
if(fuel.getItem() == ModItems.solid_fuel)
burnTime *= 2;
burn[i] = burnTime;
slots[slot].stackSize--;
if(slots[slot].stackSize <= 0) {
if(slots[slot].getItem().hasContainerItem(slots[slot])) {
slots[slot] = slots[slot].getItem().getContainerItem(slots[slot]);
} else {
slots[slot] = null;
}
}
}
}
}
}
// RTG ///
this.hasRTG = false;
for(int i = 11; i < 21; i++) {
if(slots[i] != null && slots[i].getItem() instanceof ItemRTGPellet) {
ItemRTGPellet pellet = (ItemRTGPellet) slots[i].getItem();
this.spin += pellet.getHeat() * 10;
this.hasRTG = true;
}
}
if(this.spin > 0) {
int powerGen = this.spin;
if(this.tanks[0].getFill() >= 10) {
powerGen += this.spin;
this.tanks[0].setFill(this.tanks[0].getFill() - 10);
}
if(this.tanks[2].getFill() >= 1) {
powerGen += this.spin * 3;
this.tanks[2].setFill(this.tanks[2].getFill() - 1);
}
this.power += Math.pow(powerGen, 1.15D);
if(this.power > this.maxPower)
this.power = this.maxPower;
}
NBTTagCompound data = new NBTTagCompound(); NBTTagCompound data = new NBTTagCompound();
int[] rtgs = new int[pellets.length]; data.setLong("power", power);
data.setInteger("spin", spin);
for(int i = 0; i < pellets.length; i++) { data.setIntArray("burn", burn);
if(pellets[i] != null) data.setBoolean("hasRTG", hasRTG);
rtgs[i] = pellets[i].ordinal(); this.networkPack(data, 150);
else
rtgs[i] = -1;
}
data.setIntArray("rtgs", rtgs);
data.setInteger("temp", displayHeat);
data.setInteger("torque", torque);
data.setInteger("power", (int)power);
data.setShort("burn", (short) burnTime);
data.setShort("lastBurn", (short) lastBurnTime);
data.setFloat("dial", limiter);
this.networkPack(data, 250);
for(int i = 0; i < 3; i++) for(int i = 0; i < 3; i++)
tanks[i].updateTank(xCoord, yCoord, zCoord, this.worldObj.provider.dimensionId); tanks[i].updateTank(xCoord, yCoord, zCoord, this.worldObj.provider.dimensionId);
} else { } else {
this.prevRotation = this.rotation; this.prevRotation = this.rotation;
this.rotation += this.torque * animSpeed / maxTorque; if(this.spin > 0) {
this.rotation += 15;
}
if(this.rotation >= 360) { if(this.rotation >= 360) {
this.rotation -= 360; this.rotation -= 360;
@ -134,253 +179,34 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
@Override @Override
public void networkUnpack(NBTTagCompound nbt) { public void networkUnpack(NBTTagCompound nbt) {
this.power = nbt.getLong("power");
int[] rtgs = nbt.getIntArray("rtgs"); this.spin = nbt.getInteger("spin");
this.burn = nbt.getIntArray("burn");
if(rtgs != null) { this.hasRTG = nbt.getBoolean("hasRTG");
for(int i = 0; i < pellets.length; i++) {
int pellet = rtgs[i];
if(pellet >= 0 && pellet < IGenRTG.values().length) {
pellets[i] = IGenRTG.values()[pellet];
} else {
pellets[i] = null;
}
}
}
this.temperature = nbt.getInteger("temp");
this.torque = nbt.getInteger("torque");
this.power = nbt.getInteger("power");
this.burnTime = nbt.getShort("burn");
this.lastBurnTime = nbt.getShort("lastBurn");
if(ignoreNext <= 0) {
this.limiter = nbt.getFloat("dial");
} else {
ignoreNext--;
}
} }
@Override public static final int coalGenRate = 50;
public void handleButtonPacket(int value, int meta) { public static final HashMap<FluidType, Integer> fuels = new HashMap();
if(meta == 0) static {
pushPellet(); fuels.put(FluidType.SMEAR, 50);
if(meta == 1) fuels.put(FluidType.HEATINGOIL, 75);
popPellet(); fuels.put(FluidType.HYDROGEN, 5);
if(meta == 2) fuels.put(FluidType.DIESEL, 225);
setDialByAngle(value); fuels.put(FluidType.KEROSENE, 300);
fuels.put(FluidType.RECLAIMED, 100);
fuels.put(FluidType.PETROIL, 125);
fuels.put(FluidType.BIOFUEL, 200);
fuels.put(FluidType.GASOLINE, 700);
fuels.put(FluidType.NITAN, 2500);
fuels.put(FluidType.LPG, 200);
fuels.put(FluidType.ETHANOL, 75);
} }
/** public int getPowerFromFuel() {
* Checks for solid fuel and burns it FluidType type = tanks[1].getTankType();
*/ Integer value = fuels.get(type);
private void loadFuel() { return value != null ? value : 0;
if(this.burnTime <= 0 && slots[0] != null) {
int time = TileEntityFurnace.getItemBurnTime(slots[0]) / 2;
if(time > 0) {
if(slots[0].getItem().hasContainerItem(slots[0]) && slots[0].stackSize == 1) {
slots[0] = slots[0].getItem().getContainerItem(slots[0]);
} else {
this.decrStackSize(0, 1);
}
this.burnTime = time;
this.lastBurnTime = time;
this.markDirty();
}
}
}
/**
* Creates heat from RTG pellets
*/
private void pelletAction() {
for(int i = 0; i < pellets.length; i++) {
if(pellets[i] != null)
this.temperature += pellets[i].heat;
}
}
/**
* Burns liquid fuel
*/
private void fuelAction() {
int heat = getHeatFromFuel(tanks[1].getTankType());
int maxBurn = 2;
if(tanks[1].getFill() > 0) {
int burn = Math.min(maxBurn, tanks[1].getFill());
tanks[1].setFill(tanks[1].getFill() - burn);
temperature += heat * burn;
}
}
public int getHeatFromFuel(FluidType type) {
switch(type) {
case SMEAR: return 75;
case HEATINGOIL: return 150;
case DIESEL: return 225;
case KEROSENE: return 300;
case RECLAIMED: return 100;
case PETROIL: return 125;
case BIOFUEL: return 200;
case NITAN: return 2500;
default: return 0;
}
}
/**
* does the thing with the thermo elements
*/
private void rtgAction() {
int rtg = 0;
for(int i = 3; i <= 5; i++) {
if(slots[i] != null && slots[i].getItem() == ModItems.thermo_element)
rtg += 15;
}
int pow = Math.min(this.temperature, rtg);
this.temperature -= pow;
this.power += pow;
if(power > maxPower)
power = maxPower;
}
/**
* Turns heat into rotational energy
*/
private void rotorAction() {
int conversion = getConversion();
if(temperature > 10 && tanks[0].getFill() > 0)
tanks[0].setFill(tanks[0].getFill() - 1);
if(torque > 10 && tanks[2].getFill() > 0 && worldObj.rand.nextInt(2) == 0)
tanks[2].setFill(tanks[2].getFill() - 1);
this.torque += conversion * (tanks[0].getFill() > 0 ? 1.5 : 1);
this.temperature -= conversion;
if(torque > maxTorque)
worldObj.createExplosion(null, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 5, true);
}
/**
* Do the power stuff
*/
private void generatorAction() {
double balanceFactor = 0.025D;
this.power += this.torque * balanceFactor;
torque -= getBrake();
if(power > maxPower)
power = maxPower;
}
public int getBrake() {
return (int) Math.ceil(torque * 0.1 * (tanks[2].getFill() > 0 ? 0.5 : 1));
}
public int getConversion() {
return (int) (temperature * limiter);
}
/**
* Adds a pellet onto the pile
*/
private void pushPellet() {
if(pellets[11] != null)
return;
if(slots[1] != null) {
IGenRTG pellet = IGenRTG.getPellet(slots[1].getItem());
if(pellet != null) {
for(int i = 0; i < pellets.length; i++) {
if(pellets[i] == null) {
pellets[i] = pellet;
this.decrStackSize(1, 1);
this.markDirty();
return;
}
}
}
}
}
/**
* Removes a pellet from the bottom of the pile
*/
private void popPellet() {
if(slots[2] != null)
return;
if(pellets[0] == null)
return;
//i don't feel like adding null checks because they won't trigger anyway
slots[2] = new ItemStack(this.rtgPellets.inverse().get(pellets[0]));
for(int i = 0; i < pellets.length - 1; i++) {
pellets[i] = pellets[i + 1];
}
pellets[pellets.length - 1] = null;
this.markDirty();
}
public double getSolidGauge() {
return (double) burnTime / (double) lastBurnTime;
}
public double getPowerGauge() {
return (double) power / (double) maxPower;
}
public double getTempGauge() {
return (double) temperature / (double) maxTemperature;
}
public double getTorqueGauge() {
return (double) torque / (double) maxTorque;
}
public float getAngleFromDial() {
return (45F + limiter * 270F) % 360F;
}
int ignoreNext = 0;
public void setDialByAngle(float angle) {
this.limiter = (angle - 45F) / 270F;
ignoreNext = 5;
} }
@Override @Override
@ -433,59 +259,22 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
for(int i = 0; i < pellets.length; i++) { for(int i = 0; i < 3; i++)
tanks[i].readFromNBT(nbt, "tank_" + i);
short s = nbt.getShort("pellet" + i); this.power = nbt.getLong("power");
this.burn = nbt.getIntArray("burn");
if(s >= 0 && s < IGenRTG.values().length) {
pellets[i] = IGenRTG.values()[s];
} else {
pellets[i] = null;
}
}
this.burnTime = nbt.getInteger("burn");
this.lastBurnTime = nbt.getInteger("lastBurn");
this.limiter = nbt.getFloat("limiter");
} }
@Override @Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
for(int i = 0; i < pellets.length; i++) { for(int i = 0; i < 3; i++)
tanks[i].writeToNBT(nbt, "tank_" + i);
if(pellets[i] != null) { nbt.setLong("power", power);
nbt.setShort("pellet" + i, (short) pellets[i].ordinal()); nbt.setIntArray("burn", burn);
} else {
nbt.setShort("pellet" + i, (short)-1);
}
}
nbt.setInteger("burn", burnTime);
nbt.setInteger("lastBurn", lastBurnTime);
nbt.setFloat("limiter", limiter);
}
private static HashBiMap<Item, IGenRTG> rtgPellets = HashBiMap.create();
public static enum IGenRTG {
PLUTONIUM(ModItems.pellet_rtg, 0, 5),
URANIUM(ModItems.pellet_rtg_weak, 9, 3),
POLONIUM(ModItems.pellet_rtg_polonium, 18, 25);
public int offset;
public int heat;
private IGenRTG(Item item, int offset, int heat) {
rtgPellets.put(item, this);
this.offset = offset;
this.heat = heat;
}
public static IGenRTG getPellet(Item item) {
return rtgPellets.get(item);
}
} }
@Override @Override
@ -499,4 +288,19 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
{ {
return 65536.0D; return 65536.0D;
} }
@Override
public void setPower(long power) {
this.power = power;
}
@Override
public long getPower() {
return this.power;
}
@Override
public long getMaxPower() {
return this.maxPower;
}
} }

View File

@ -276,7 +276,7 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
public int getHEFromFuel() { public int getHEFromFuel() {
FluidType type = tank.getTankType(); FluidType type = tank.getTankType();
Integer value = fuels.get(type); Integer value = fuels.get(type);
return value != null ? value : null; return value != null ? value : 0;
} }
public void generate() { public void generate() {

View File

@ -50,7 +50,7 @@ public class TileEntityConnector extends TileEntityPylonBase {
} }
@Override @Override
public boolean canConnect(ForgeDirection dir) { public boolean canConnect(ForgeDirection dir) { //i've about had it with your fucking bullshit
return dir == ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite(); return true;
} }
} }

View File

@ -1595,6 +1595,8 @@ item.insert_xsapi.name=XSAPI-Einlage
item.insert_yharonite.name=Yharoniteinlage item.insert_yharonite.name=Yharoniteinlage
item.iv_blood.name=Blutbeutel item.iv_blood.name=Blutbeutel
item.iv_empty.name=Infusionsbeutel item.iv_empty.name=Infusionsbeutel
item.iv_xp.name=Erfahrungsbeutel
item.iv_xp_empty.name=Leerer Erfahrungsbeutel
item.jackt.name=Verdammt stylische Kugeljacke item.jackt.name=Verdammt stylische Kugeljacke
item.jackt2.name=Verdammt stylische Kugeljacke 2: Tokyo Drift item.jackt2.name=Verdammt stylische Kugeljacke 2: Tokyo Drift
item.jetpack_boost.name=Boosterrucksack item.jetpack_boost.name=Boosterrucksack
@ -1993,9 +1995,12 @@ item.pellet_mes.name=MES-Watzpellet
item.pellet_meteorite.name=Meteoritenkugeln item.pellet_meteorite.name=Meteoritenkugeln
item.pellet_neptunium.name=Neptunium-Watzpellet item.pellet_neptunium.name=Neptunium-Watzpellet
item.pellet_rtg.name=Plutonium-238 Pellet item.pellet_rtg.name=Plutonium-238 Pellet
item.pellet_rtg_actinium.name=Actinium Pellet
item.pellet_rtg_americium.name=Americium-241 Pellet item.pellet_rtg_americium.name=Americium-241 Pellet
item.pellet_rtg_berkelium.name=Berkelium Pellet
item.pellet_rtg_gold.name=Gold-198 Pellet item.pellet_rtg_gold.name=Gold-198 Pellet
item.pellet_rtg_polonium.name=Polonium-210 Pellet item.pellet_rtg_polonium.name=Polonium-210 Pellet
item.pellet_rtg_strontium.name=Strontium-90 Pellet
item.pellet_rtg_weak.name=Schwaches Uran RTG-Pellet item.pellet_rtg_weak.name=Schwaches Uran RTG-Pellet
item.pellet_schrabidium.name=Pures Schrabidium-Watzpellet item.pellet_schrabidium.name=Pures Schrabidium-Watzpellet
item.photo_panel.name=Photovoltaikpanele item.photo_panel.name=Photovoltaikpanele
@ -3345,6 +3350,7 @@ tile.reactor_hatch.name=Kraftwerkszugriffsluke
tile.reactor_inserter.name=Reaktor-Brennstoffeinlass tile.reactor_inserter.name=Reaktor-Brennstoffeinlass
tile.red_barrel.name=Explosives Fass tile.red_barrel.name=Explosives Fass
tile.red_cable.name=Rotes Kupferkabel tile.red_cable.name=Rotes Kupferkabel
tile.red_connector.name=Stromverbindungsstück
tile.red_pylon.name=Strommasten tile.red_pylon.name=Strommasten
tile.red_wire_coated.name=Geschirmtes rotes Kupferkabel tile.red_wire_coated.name=Geschirmtes rotes Kupferkabel
tile.reinforced_brick.name=Verstärkter Stein tile.reinforced_brick.name=Verstärkter Stein

View File

@ -1667,6 +1667,8 @@ item.insert_xsapi.name=XSAPI Insert
item.insert_yharonite.name=Yharonite Insert item.insert_yharonite.name=Yharonite Insert
item.iv_blood.name=Blood Bag item.iv_blood.name=Blood Bag
item.iv_empty.name=IV Bag item.iv_empty.name=IV Bag
item.iv_xp.name=Experience Bag
item.iv_xp_empty.name=Empty Experience Bag
item.jackt.name=Damn Stylish Ballistic Jacket item.jackt.name=Damn Stylish Ballistic Jacket
item.jackt2.name=Damn Stylish Ballistic Jacket 2: Tokyo Drift item.jackt2.name=Damn Stylish Ballistic Jacket 2: Tokyo Drift
item.jetpack_boost.name=Boostpack item.jetpack_boost.name=Boostpack
@ -2065,9 +2067,12 @@ item.pellet_mes.name=MES Watz Pellet
item.pellet_meteorite.name=Meteorite Rounds item.pellet_meteorite.name=Meteorite Rounds
item.pellet_neptunium.name=Neptunium Watz Pellet item.pellet_neptunium.name=Neptunium Watz Pellet
item.pellet_rtg.name=Plutonium-238 Fuel Pellet item.pellet_rtg.name=Plutonium-238 Fuel Pellet
item.pellet_rtg_actinium.name=Actinium Fuel Pellet
item.pellet_rtg_americium.name=Americium-241 Fuel Pellet item.pellet_rtg_americium.name=Americium-241 Fuel Pellet
item.pellet_rtg_berkelium.name=Berkelium Fuel Pellet
item.pellet_rtg_gold.name=Gold-198 Fuel Pellet item.pellet_rtg_gold.name=Gold-198 Fuel Pellet
item.pellet_rtg_polonium.name=Polonium-210 Fuel Pellet item.pellet_rtg_polonium.name=Polonium-210 Fuel Pellet
item.pellet_rtg_strontium.name=Strontium-90 Fuel Pellet
item.pellet_rtg_weak.name=Weak Uranium RTG Pellet item.pellet_rtg_weak.name=Weak Uranium RTG Pellet
item.pellet_schrabidium.name=Pure Schrabidium Watz Pellet item.pellet_schrabidium.name=Pure Schrabidium Watz Pellet
item.photo_panel.name=Photovoltaic Panel item.photo_panel.name=Photovoltaic Panel
@ -3417,6 +3422,7 @@ tile.reactor_hatch.name=Reactor Access Hatch
tile.reactor_inserter.name=Reactor Fuel Inserter tile.reactor_inserter.name=Reactor Fuel Inserter
tile.red_barrel.name=Explosive Barrel tile.red_barrel.name=Explosive Barrel
tile.red_cable.name=Red Copper Cable tile.red_cable.name=Red Copper Cable
tile.red_connector.name=Electricity Connector
tile.red_pylon.name=Electricity Pole tile.red_pylon.name=Electricity Pole
tile.red_wire_coated.name=Coated Red Copper Cable tile.red_wire_coated.name=Coated Red Copper Cable
tile.reinforced_brick.name=Reinforced Stone tile.reinforced_brick.name=Reinforced Stone

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -3,7 +3,7 @@
"modid": "hbm", "modid": "hbm",
"name": "Hbm's Nuclear Tech", "name": "Hbm's Nuclear Tech",
"description": "A mod that adds weapons, nuclear themed stuff and machines", "description": "A mod that adds weapons, nuclear themed stuff and machines",
"version":"1.0.27_X4060", "version":"1.0.27_X4074",
"mcversion": "1.7.10", "mcversion": "1.7.10",
"url": "", "url": "",
"updateUrl": "", "updateUrl": "",