Merge remote-tracking branch 'origin/master'

This commit is contained in:
Vaern 2021-12-11 11:40:21 -08:00
commit 4dded8894f
37 changed files with 20330 additions and 6476 deletions

View File

@ -130,7 +130,9 @@ public abstract class BlockDummyable extends BlockContainer {
if(!(player instanceof EntityPlayer))
return;
safeRem = true;
world.setBlockToAir(x, y, z);
safeRem = false;
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) {
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),
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),
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?
CIRNO("Cirno", "Cirno", "being a dumb ice fairy", "No brain. Head empty.", true);

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.generic;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.hbm.util.Tuple.Quartet;
@ -10,6 +11,7 @@ import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
@ -41,6 +43,11 @@ public class BlockLoot extends BlockContainer {
return false;
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return null;
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z);

View File

@ -48,7 +48,7 @@ public class MachineIGenerator extends BlockDummyable {
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) {
if(world.isRemote) {
@ -69,53 +69,22 @@ public class MachineIGenerator extends BlockDummyable {
} else {
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
public int[] getDimensions() {
return new int [] {1,0,2,2,2,4};
return new int [] {2, 0, 3, 2, 1, 1};
}
@Override
public int getOffset() {
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;
//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
this.addSlotToContainer(new Slot(te, 6, 86, 108));
//Water In
this.addSlotToContainer(new Slot(te, 7, 131, 27));
//Water Out
this.addSlotToContainer(new SlotMachineOutput(te, 8, 167, 27));
//Fuel In
this.addSlotToContainer(new Slot(te, 9, 131, 63));
//Fuel Out
this.addSlotToContainer(new SlotMachineOutput(te, 10, 167, 63));
//ID In
this.addSlotToContainer(new Slot(te, 11, 131, 81));
//ID Out
this.addSlotToContainer(new SlotMachineOutput(te, 12, 167, 81));
//Lube In
this.addSlotToContainer(new Slot(te, 13, 131, 99));
//Lube Out
this.addSlotToContainer(new SlotMachineOutput(te, 14, 167, 99));
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 9; j++)
{
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 14 + j * 18, 84 + i * 18 + 56));
this.addSlotToContainer(new Slot(te, 0, 8, 134));
//Water
this.addSlotToContainer(new Slot(te, 1, 62, 112));
this.addSlotToContainer(new SlotMachineOutput(te, 2, 154, 112));
//Solid Fuel
this.addSlotToContainer(new Slot(te, 3, 67, 51));
this.addSlotToContainer(new Slot(te, 4, 85, 51));
this.addSlotToContainer(new Slot(te, 5, 67, 87));
this.addSlotToContainer(new Slot(te, 6, 85, 87));
//Lubricant
this.addSlotToContainer(new Slot(te, 7, 132, 33));
this.addSlotToContainer(new SlotMachineOutput(te, 8, 132, 51));
//Fuel
this.addSlotToContainer(new Slot(te, 9, 132, 69));
this.addSlotToContainer(new SlotMachineOutput(te, 10, 132, 87));
//RTG
for(int i = 0; i < 5; i++) {
for(int j = 0; j < 2; j++) {
this.addSlotToContainer(new Slot(te, 11 + i * 2 + j, 15 + j * 18, 35 + i * 18));
}
}
for(int i = 0; i < 9; i++)
{
this.addSlotToContainer(new Slot(invPlayer, i, 14 + i * 18, 142 + 56));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
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
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= 14) {
if (!this.mergeItemStack(var5, 15, this.inventorySlots.size(), true))
{
if(par2 <= 20) {
if(!this.mergeItemStack(var5, 21, this.inventorySlots.size(), true)) {
return null;
}
} else {
return null;
}
if (var5.stackSize == 0)
{
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
}
else
{
} else {
var4.onSlotChanged();
}
}
return var3;
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {

View File

@ -1,90 +1,62 @@
package com.hbm.inventory.gui;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.container.ContainerIGenerator;
import com.hbm.lib.Library;
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 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.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
public class GUIIGenerator extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/generators/gui_igen.png");
private TileEntityMachineIGenerator igen;
boolean caughtMouse = false;
public GUIIGenerator(InventoryPlayer invPlayer, TileEntityMachineIGenerator tedf) {
super(new ContainerIGenerator(invPlayer, tedf));
igen = tedf;
this.xSize = 188;
this.ySize = 222;
this.xSize = 176;
this.ySize = 237;
}
@Override
public void drawScreen(int x, int y, float 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) {
caughtMouse = true;
}
if(caughtMouse && !Mouse.isButtonDown(0)) {
int dial = (int) Math.round(Math.toDegrees(getAngle(x, y)));
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 + 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);
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);
this.drawElectricityInfo(this, x, y, guiLeft + 26, guiTop + 134, 142, 16, igen.power, igen.maxPower);
for(int i = 0; i < 4; i++) {
int fire = igen.burn[i];
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 + 113, guiTop + 4, 54, 18, x, y, new String[] {"Heat generated"});
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
protected void drawGuiContainerForegroundLayer(int i, int j) {
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);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 14, this.ySize - 96 + 2, 4210752);
GL11.glPushMatrix();
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
@ -92,75 +64,30 @@ public class GUIIGenerator extends GuiInfoContainer {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
int water = igen.tanks[0].getFill() * 72 / igen.tanks[0].getMaxFill();
drawTexturedModalRect(guiLeft + 80, guiTop + 112, 184, 14, water, 16);
int power = (int) (igen.power * 142 / igen.maxPower);
drawTexturedModalRect(guiLeft + 26, guiTop + 134, 0, 237, power, 16);
for(int i = 0; i < igen.pellets.length; i++) {
for(int i = 0; i < 4; i++) {
int fire = igen.burn[i];
if(igen.pellets[i] != null)
drawTexturedModalRect(guiLeft + 6, guiTop + 106 - 4 * i, 188, igen.pellets[i].offset, 14, 9);
}
for(int i = 0; i < 3; i++) {
if(igen.tanks[i].getFill() > 0) {
int hex = igen.tanks[i].getTankType().getColor();
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);
if(fire > 0) {
drawTexturedModalRect(guiLeft + 68 + (i % 2) * 18, guiTop + 34 + (i / 2) * 36, 184, 0, 14, 14);
}
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
drawDial(x, y);
GaugeUtil.renderGauge(Gauge.BOW_SMALL, guiLeft + 40, guiTop + 26, this.zLevel, igen.getSolidGauge());
if(igen.hasRTG) {
drawTexturedModalRect(guiLeft + 9, guiTop + 34, 176, 0, 4, 89);
drawTexturedModalRect(guiLeft + 51, guiTop + 34, 180, 0, 4, 89);
}
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) {
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);
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;
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);
}
}

View File

@ -43,7 +43,7 @@ public class GUIMachineDiFurnaceRTG extends GuiInfoContainer {
for(int i = 0; i < pellets.size(); 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);

View File

@ -166,6 +166,16 @@ public class AnvilRecipes {
new ComparableStack(ModItems.circuit_aluminium, 1 * ukModifier)
}, 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(
new AStack[] {
new ComparableStack(ModBlocks.brick_concrete, 64),
@ -498,19 +508,6 @@ public class AnvilRecipes {
new AnvilOutput(new ItemStack(ModItems.ingot_boron, 2)),
new AnvilOutput(new ItemStack(Items.stick, 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(
new ComparableStack(ModBlocks.rbmk_moderator), new AnvilOutput[] {

View File

@ -1653,6 +1653,7 @@ public class ModItems {
public static Item gun_bf_ammo;
public static Item gun_mp40;
public static Item gun_mp40_ammo;
public static Item gun_mg42;
public static Item gun_thompson;
public static Item gun_uzi;
public static Item gun_uzi_silencer;
@ -4315,6 +4316,7 @@ public class ModItems {
gun_bf = new ItemGunBase(GunFatmanFactory.getBELConfig()).setUnlocalizedName("gun_bf").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_bf");
gun_mp40_ammo = new Item().setUnlocalizedName("gun_mp40_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_mp40_ammo");
gun_mp40 = new ItemGunBase(Gun9mmFactory.getMP40Config()).setUnlocalizedName("gun_mp40").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mp40");
gun_mg42 = new ItemGunBase(Gun9mmFactory.getMP40Config()).setUnlocalizedName("gun_mg42").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mg42");
gun_thompson = new ItemGunBase(Gun9mmFactory.getThompsonConfig()).setUnlocalizedName("gun_thompson").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_thompson");
gun_uzi_ammo = new Item().setUnlocalizedName("gun_uzi_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_uzi_ammo");
gun_uzi = new ItemGunBase(Gun22LRFactory.getUziConfig()).setUnlocalizedName("gun_uzi").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi");
@ -7076,6 +7078,7 @@ public class ModItems {
GameRegistry.registerItem(gun_mirv, gun_mirv.getUnlocalizedName());
GameRegistry.registerItem(gun_bf, gun_bf.getUnlocalizedName());
GameRegistry.registerItem(gun_mp40, gun_mp40.getUnlocalizedName());
GameRegistry.registerItem(gun_mg42, gun_mg42.getUnlocalizedName());
GameRegistry.registerItem(gun_thompson, gun_thompson.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi, gun_uzi.getUnlocalizedName());
GameRegistry.registerItem(gun_uzi_silencer,gun_uzi_silencer.getUnlocalizedName());

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
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:
//V T (X)
//V -> next release version

View File

@ -414,6 +414,7 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_bolter_digamma, new ItemRenderWeaponBolter());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_fireext, new ItemRenderFireExt());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_ar15, new ItemRenderWeaponAR15());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_mg42, new ItemRenderWeaponFFMG42());
//multitool
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool());
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_silk, new ItemRenderMultitool());

View File

@ -597,6 +597,7 @@ public class ResourceManager {
public static final IModelCustom ff_nightmare = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/nightmare.obj"));
public static final IModelCustom fireext = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/fireext.obj"));
public static final IModelCustom ar15 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/ar15.obj"));
public static final IModelCustom mg42 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/mg42.obj"));
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
@ -660,6 +661,7 @@ public class ResourceManager {
public static final ResourceLocation fireext_foam_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_foam.png");
public static final ResourceLocation fireext_sand_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/fireext_sand.png");
public static final ResourceLocation ar15_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/carbine.png");
public static final ResourceLocation mg42_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/mg42.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -0,0 +1,95 @@
package com.hbm.render.item.weapon;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
public class ItemRenderWeaponFFMG42 implements IItemRenderer {
public ItemRenderWeaponFFMG42() { }
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch(type) {
case EQUIPPED:
case EQUIPPED_FIRST_PERSON:
case ENTITY:
case INVENTORY:
return true;
default: return false;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.mg42_tex);
switch(type) {
case EQUIPPED_FIRST_PERSON:
double s0 = 0.65D;
GL11.glRotated(170, 0, 1, 0);
GL11.glRotated(-25, 0, 0, 1);
GL11.glTranslated(-0.125, 0, 0);
GL11.glScaled(s0, s0, s0);
break;
case EQUIPPED:
double scale = 0.35D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(100, 0, 1, 0);
GL11.glRotated(-10, 1, 0, 0);
GL11.glRotated(10, 0, 0, 1);
GL11.glTranslated(-0.5, 0.75, 1.25);
break;
case ENTITY:
double s1 = 0.3D;
GL11.glScaled(s1, s1, s1);
break;
case INVENTORY:
GL11.glEnable(GL11.GL_LIGHTING);
double s = 1.75D;
GL11.glTranslated(10, 9.5, 0);
GL11.glRotated(180, 1, 0, 0);
GL11.glRotated(-45, 0, 0, 1);
GL11.glScaled(s, s, -s);
break;
default: break;
}
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.mg42.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

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_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_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");
@Override
@ -92,6 +93,7 @@ public class RenderBobble extends TileEntitySpecialRenderer {
case ADAM29: bindTexture(bobble_adam); break;
case UFFR: bindTexture(bobble_uffr); break;
case VAER: bindTexture(bobble_vaer); break;
case NOS: bindTexture(bobble_nos); break;
default: bindTexture(ResourceManager.universal);
}
@ -286,6 +288,15 @@ public class RenderBobble extends TileEntitySpecialRenderer {
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.glAlphaFunc(GL11.GL_GREATER, 0.1F);

View File

@ -15,110 +15,35 @@ import net.minecraft.util.Vec3;
public class RenderIGenerator extends TileEntitySpecialRenderer {
@Override
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
switch(te.getBlockMetadata() - BlockDummyable.offset)
{
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
TileEntityMachineIGenerator igen = (TileEntityMachineIGenerator)te;
GL11.glTranslated(1, 0, 0);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.igen_tex);
ResourceManager.igen.renderPart("Base");
float angle = igen.prevRotation + (igen.rotation - igen.prevRotation) * f;
float px = 0.0625F;
float sine = (float) Math.sin(Math.toRadians(angle));
float cosine = (float) Math.cos(Math.toRadians(angle));
float armAng = 22.5F;
GL11.glPushMatrix();
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();
switch(te.getBlockMetadata() - BlockDummyable.offset) {
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
}
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();
}
TileEntityMachineIGenerator igen = (TileEntityMachineIGenerator) te;
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.igen_tex);
ResourceManager.igen.renderPart("Body");
float rot = igen.prevRotation + (igen.rotation - igen.prevRotation) * f;
GL11.glTranslated(0, 1.5D, 0);
GL11.glRotatef(-rot, 0, 0, 1);
GL11.glTranslated(0, -1.5D, 0);
ResourceManager.igen.renderPart("Rotor");
GL11.glPopMatrix();
}
}

View File

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

View File

@ -1,22 +1,22 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import com.google.common.collect.HashBiMap;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.blocks.BlockDummyable;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.inventory.FluidTank;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemRTGPellet;
import com.hbm.lib.Library;
import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.energy.IEnergyGenerator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.Item;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@ -24,36 +24,29 @@ import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.AxisAlignedBB;
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 static final long maxPower = 1000000;
public int lastBurnTime;
public int burnTime;
public int temperature;
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;
public int spin;
public int[] burn = new int[4];
public boolean hasRTG = false;
@SideOnly(Side.CLIENT)
public float rotation;
@SideOnly(Side.CLIENT)
public float prevRotation;
public IGenRTG[] pellets = new IGenRTG[12];
public FluidTank[] tanks;
public int age = 0;
public TileEntityMachineIGenerator() {
super(15);
super(21);
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[2] = new FluidTank(FluidType.LUBRICANT, 2000, 2);
tanks[2] = new FluidTank(FluidType.LUBRICANT, 4000, 2);
}
@Override
@ -66,64 +59,116 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
if(!worldObj.isRemote) {
age++;
if (age >= 20) {
age = 0;
}
tanks[0].loadTank(7, 8, slots);
power = Library.chargeItemsFromTE(slots, 0, power, maxPower);
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].setType(11, 12, slots);
tanks[2].loadTank(13, 14, slots);
tanks[2].loadTank(7, 8, slots);
loadFuel();
pelletAction();
this.spin = 0;
if(burnTime > 0) {
burnTime --;
temperature += 100;
/// LIQUID FUEL ///
if(tanks[1].getFill() > 0) {
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++) {
// POWER GEN //
if(burn[i] > 0) {
burn[i]--;
this.spin += coalGenRate;
// REFUELING //
} else {
int slot = i + 3;
if(slots[slot] != null) {
ItemStack fuel = slots[slot];
int burnTime = TileEntityFurnace.getItemBurnTime(fuel) / 2;
if(burnTime > 0) {
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;
}
}
}
}
}
}
if(temperature > maxTemperature)
temperature = maxTemperature;
// 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;
}
}
int displayHeat = temperature;
rtgAction();
rotorAction();
generatorAction();
this.power = Library.chargeItemsFromTE(slots, 6, power, maxPower);
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();
int[] rtgs = new int[pellets.length];
for(int i = 0; i < pellets.length; i++) {
if(pellets[i] != null)
rtgs[i] = pellets[i].ordinal();
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);
data.setLong("power", power);
data.setInteger("spin", spin);
data.setIntArray("burn", burn);
data.setBoolean("hasRTG", hasRTG);
this.networkPack(data, 150);
for(int i = 0; i < 3; i++)
tanks[i].updateTank(xCoord, yCoord, zCoord, this.worldObj.provider.dimensionId);
} else {
this.prevRotation = this.rotation;
this.rotation += this.torque * animSpeed / maxTorque;
if(this.spin > 0) {
this.rotation += 15;
}
if(this.rotation >= 360) {
this.rotation -= 360;
@ -134,253 +179,34 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
@Override
public void networkUnpack(NBTTagCompound nbt) {
int[] rtgs = nbt.getIntArray("rtgs");
if(rtgs != null) {
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 void handleButtonPacket(int value, int meta) {
if(meta == 0)
pushPellet();
if(meta == 1)
popPellet();
if(meta == 2)
setDialByAngle(value);
this.power = nbt.getLong("power");
this.spin = nbt.getInteger("spin");
this.burn = nbt.getIntArray("burn");
this.hasRTG = nbt.getBoolean("hasRTG");
}
/**
* Checks for solid fuel and burns it
*/
private void loadFuel() {
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();
}
}
public static final int coalGenRate = 50;
public static final HashMap<FluidType, Integer> fuels = new HashMap();
static {
fuels.put(FluidType.SMEAR, 50);
fuels.put(FluidType.HEATINGOIL, 75);
fuels.put(FluidType.HYDROGEN, 5);
fuels.put(FluidType.DIESEL, 225);
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);
}
/**
* 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;
public int getPowerFromFuel() {
FluidType type = tanks[1].getTankType();
Integer value = fuels.get(type);
return value != null ? value : 0;
}
@Override
@ -433,59 +259,22 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
for(int i = 0; i < pellets.length; i++) {
short s = nbt.getShort("pellet" + i);
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");
for(int i = 0; i < 3; i++)
tanks[i].readFromNBT(nbt, "tank_" + i);
this.power = nbt.getLong("power");
this.burn = nbt.getIntArray("burn");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
for(int i = 0; i < pellets.length; i++) {
if(pellets[i] != null) {
nbt.setShort("pellet" + i, (short) pellets[i].ordinal());
} 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);
for(int i = 0; i < 3; i++)
tanks[i].writeToNBT(nbt, "tank_" + i);
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);
}
nbt.setLong("power", power);
nbt.setIntArray("burn", burn);
}
@Override
@ -499,4 +288,19 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
{
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

@ -23,7 +23,7 @@ public class TileEntityMachineMiniRTG extends TileEntity implements IEnergyGener
if(this.getBlockType() == ModBlocks.machine_powerrtg)
power += 2500;
else
power += 70;
power += 700;
if(power > getMaxPower())
power = getMaxPower();

View File

@ -24,7 +24,7 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory,
public int heat;
public final int heatMax = 150;
public long power;
public final long powerMax = 90000;
public final long powerMax = 100000;
private static final int[] slots_top = new int[] { 0 };
private static final int[] slots_bottom = new int[] { 0 };
@ -238,7 +238,7 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory,
if(heat > heatMax)
heat = heatMax;
power += heat;
power += heat * 10;
if(power > powerMax)
power = powerMax;

View File

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

View File

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

View File

@ -30,9 +30,13 @@ public abstract class TileEntityPylonBase extends TileEntityCableBaseNT {
Vec3 firstPos = first.getMountPos();
Vec3 secondPos = second.getMountPos();
double deltaSq = Math.pow(secondPos.xCoord - firstPos.xCoord, 2) + Math.pow(secondPos.yCoord - firstPos.yCoord, 2) + Math.pow(secondPos.zCoord - firstPos.zCoord, 2);
Vec3 delta = Vec3.createVectorHelper(
(second.xCoord + secondPos.xCoord) - (first.xCoord + firstPos.xCoord),
(second.yCoord + secondPos.yCoord) - (first.yCoord + firstPos.yCoord),
(second.zCoord + secondPos.zCoord) - (first.zCoord + firstPos.zCoord)
);
return lenSq >= deltaSq;
return Math.sqrt(lenSq) >= delta.lengthVector();
}
public void addConnection(int x, int y, int z) {

View File

@ -1595,6 +1595,8 @@ item.insert_xsapi.name=XSAPI-Einlage
item.insert_yharonite.name=Yharoniteinlage
item.iv_blood.name=Blutbeutel
item.iv_empty.name=Infusionsbeutel
item.iv_xp.name=Erfahrungsbeutel
item.iv_xp_empty.name=Leerer Erfahrungsbeutel
item.jackt.name=Verdammt stylische Kugeljacke
item.jackt2.name=Verdammt stylische Kugeljacke 2: Tokyo Drift
item.jetpack_boost.name=Boosterrucksack
@ -1993,9 +1995,12 @@ item.pellet_mes.name=MES-Watzpellet
item.pellet_meteorite.name=Meteoritenkugeln
item.pellet_neptunium.name=Neptunium-Watzpellet
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_berkelium.name=Berkelium Pellet
item.pellet_rtg_gold.name=Gold-198 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_schrabidium.name=Pures Schrabidium-Watzpellet
item.photo_panel.name=Photovoltaikpanele
@ -3345,6 +3350,7 @@ tile.reactor_hatch.name=Kraftwerkszugriffsluke
tile.reactor_inserter.name=Reaktor-Brennstoffeinlass
tile.red_barrel.name=Explosives Fass
tile.red_cable.name=Rotes Kupferkabel
tile.red_connector.name=Stromverbindungsstück
tile.red_pylon.name=Strommasten
tile.red_wire_coated.name=Geschirmtes rotes Kupferkabel
tile.reinforced_brick.name=Verstärkter Stein

View File

@ -1671,6 +1671,8 @@ item.insert_xsapi.name=XSAPI Insert
item.insert_yharonite.name=Yharonite Insert
item.iv_blood.name=Blood 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.jackt2.name=Damn Stylish Ballistic Jacket 2: Tokyo Drift
item.jetpack_boost.name=Boostpack
@ -2069,9 +2071,12 @@ item.pellet_mes.name=MES Watz Pellet
item.pellet_meteorite.name=Meteorite Rounds
item.pellet_neptunium.name=Neptunium Watz 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_berkelium.name=Berkelium Fuel Pellet
item.pellet_rtg_gold.name=Gold-198 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_schrabidium.name=Pure Schrabidium Watz Pellet
item.photo_panel.name=Photovoltaic Panel
@ -3421,6 +3426,7 @@ tile.reactor_hatch.name=Reactor Access Hatch
tile.reactor_inserter.name=Reactor Fuel Inserter
tile.red_barrel.name=Explosive Barrel
tile.red_cable.name=Red Copper Cable
tile.red_connector.name=Electricity Connector
tile.red_pylon.name=Electricity Pole
tile.red_wire_coated.name=Coated Red Copper Cable
tile.reinforced_brick.name=Reinforced Stone

View File

@ -859,6 +859,7 @@ chem.OSMIRIDIUM_DEATH=Производство осмиридного раств
chem.HELIUM3=Извлечение гелия-3 из лунного грунта
chem.HEAVY_ELECTROLYSIS=Электролиз тяжёлой воды
chem.ETHANOL=Производство этанола
chem.CO2=Получение CO2 путём сжигания природного газа
item.record.lc.desc=Valve - Diabolic Adrenaline Guitar/Lambda Core
item.record.ss.desc=Valve - Sector Sweep
@ -1512,6 +1513,7 @@ item.ingot_uranium.name=Урановый слиток
item.ingot_u233.name=Слиток урана-233
item.ingot_u235.name=Слиток урана-235
item.ingot_u238.name=Слиток урана-238
item.ingot_ra226.name=Слиток радия-226
item.ingot_u238m2.name=Полустабильный слиток урана-238-2
item.ingot_plutonium.name=Плутониевый слиток
item.ingot_pu_mix.name=Слиток плутония реакторного качества
@ -1533,6 +1535,7 @@ item.ingot_tantalium.name=Танталовый слиток
item.ingot_meteorite.name=Метеоритовый слиток
item.ingot_osmiridium.name=Осмиридиевый слиток
item.ingot_meteorite_forged.name=Выкованный метеоритовый слиток
item.ingot_bakelite.name=Бакелитовый слиток
item.sulfur.name=Сера
item.niter.name=Селитра
@ -1865,6 +1868,7 @@ tile.block_semtex.name=Блок семтекса
tile.block_smore.name=Блок с'мора
tile.block_niobium.name=Блок ниобия
tile.block_ra226.name=Блок радия-226
tile.block_u233.name=Блок урана-233
tile.block_u235.name=Блок урана-235
tile.block_u238.name=Блок урана-238
@ -2235,6 +2239,7 @@ item.powder_impure_osmiridium.name=Порошок загрязнённого о
item.powder_paleogenite.name=Порошок палеогенита
item.powder_paleogenite_tiny.name=Кучка палеогенитового порошка
item.powder_tektite.name=Порошок тектита
item.powder_ra226.name=Порошок радия-226
item.fragment_neodymium.name=Неодимовый осколок
item.fragment_cobalt.name=Кобальтовый осколок
@ -2535,6 +2540,7 @@ item.billet_zfb_bismuth.name=Заготовка ЦТС висмута
item.billet_zfb_pu241.name=Заготовка ЦТС плутония-241
item.billet_zirconium.name=Заготовка циркония
item.billet_nuclear_waste.name=Заготовка ядерных отходов
item.billet_ra226.name=Заготовка радия-226
item.rbmk_pellet_balefire.name=Жар-топливная пеллета
item.rbmk_pellet_balefire_gold.name=Флэшголд-топливная пеллета
@ -3191,6 +3197,10 @@ item.syringe_antidote.name=Антидот
item.syringe_poison.name=Ядовитая инъекция
item.syringe_awesome.name=ПОТРЯСАЮЩЕ
item.syringe_metal_empty.name=Металлический шприц
item.iv_blood.name=Пакет с кровью
item.iv_empty.name=Пакет для внутривенного введения
item.iv_xp.name=Пакет с опытом
item.iv_xp_empty.name=Пакет для магического внутривенного введения
item.syringe_metal_stimpak.name=Стимулятор
item.syringe_metal_medx.name=Мед-X
item.syringe_metal_psycho.name=Психо
@ -3783,6 +3793,7 @@ item.crucible.name="Горнило Палача"
item.bismuth_pickaxe.name=Висмутовая кирка
tile.red_cable.name=Провод из красной меди
tile.red_connector.name=Электрический коннектор
tile.block_meteor.name=Блок метеорита
tile.block_meteor_broken.name=Разбитый блок метеорита
@ -4403,9 +4414,9 @@ item.pellet_gas.desc=Used in multi purpose bombs:$*cough cough* Halp pls!
item.pellet_rtg.desc.11=Contains ~100%% Plutonium-238 oxide.
item.pellet_rtg.desc=RTG fuel pellet for infinite energy! (almost)
item.pellet_rtg_actinium.desc=Glowey isn't it?
item.pellet_rtg_actinium.name=Actinium-227 RTG Pellet
item.pellet_rtg_actinium.name=РИТЭГ-пеллета из актиния-227
item.pellet_rtg_berkelium.desc=Pu-238: Who are you?$Bk-248: I'm you, but stronger
item.pellet_rtg_berkelium.name=Berkelium-248 RTG Pellet
item.pellet_rtg_berkelium.name=РИТЭГ-пеллета из берклия-248
item.pellet_rtg_gold.desc.11=it's that spicy gold
item.pellet_rtg_gold.desc=Made from a rare, highly unstable gold isotope.
item.pellet_rtg_polonium.desc.11=Polonium 4 U and me.
@ -4481,15 +4492,7 @@ item.shrimp_fry.desc=§oberigooo...
item.shrimp_fry.name=shrimp fry
item.silicon_lump.name=Lump of Unprocessed Silicon
item.spawn_robot.name=Heavy Duty Combat Droid "Dark Trooper"
item.stamp_357_desh.name=.357 Magnum Stamp (Desh)
item.stamp_44_desh.name=.44 Magnum Stamp (Desh)
item.stamp_50_desh.name=Large Caliber Stamp (Desh)
item.stamp_9_desh.name=Small Caliber Stamp (Desh)
item.stamp_desh_circuit.name=Circuit Stamp (Desh)
item.stamp_desh_disc.name=Disc Stamp (Desh)
item.stamp_desh_flat.name=Flat Stamp (Desh)
item.stamp_desh_plate.name=Flat Stamp (Desh)
item.stamp_desh_wire.name=Wire Stamp (Desh)
item.stamp_ferrouranium_circuit.name=Circuit Stamp (Ferrouranium)
item.stamp_ferrouranium_disc.name=Disc Stamp (Ferrouranium)
item.stamp_ferrouranium_flat.name=Flat Stamp (Ferrouranium)

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +0,0 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

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: 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: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

View File

@ -3,7 +3,7 @@
"modid": "hbm",
"name": "Hbm's Nuclear Tech",
"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",
"url": "",
"updateUrl": "",