some FEL stuff, spicy gold pellets, more zirconium

This commit is contained in:
Bob 2021-03-24 23:45:31 +01:00
parent fb63ad0736
commit 03e80f5a12
21 changed files with 141 additions and 71 deletions

View File

@ -17,11 +17,11 @@ import net.minecraft.util.ResourceLocation;
public class GUIFEL extends GuiInfoContainer {
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_fel.png");
private TileEntityFEL silex;
private TileEntityFEL fel;
public GUIFEL(InventoryPlayer invPlayer, TileEntityFEL laser) {
super(new ContainerFEL(invPlayer, laser));
this.silex = laser;
this.fel = laser;
this.xSize = 176;
this.ySize = 168;
@ -30,21 +30,30 @@ public class GUIFEL extends GuiInfoContainer {
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 16, 18, 9, mouseX, mouseY, new String[] {"Microwave"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 25, 18, 9, mouseX, mouseY, new String[] {"Infrared"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 34, 18, 9, mouseX, mouseY, new String[] {"Visible Light"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 43, 18, 9, mouseX, mouseY, new String[] {"UV"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 52, 18, 9, mouseX, mouseY, new String[] {"X-Ray"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 61, 18, 9, mouseX, mouseY, new String[] {"Gamma Ray"});
}
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
if(guiLeft + 10 <= x && guiLeft + 10 + 12 > x && guiTop + 92 < y && guiTop + 92 + 12 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(silex.xCoord, silex.yCoord, silex.zCoord, 0, 0));
for(int k = 0; k < 6; k++) {
if(guiLeft + 133 <= x && guiLeft + 133 + 18 > x && guiTop + 16 + k * 9 < y && guiTop + 16 + k * 9 + 9 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(fel.xCoord, fel.yCoord, fel.zCoord, k, 0));
}
}
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.silex.hasCustomInventoryName() ? this.silex.getInventoryName() : I18n.format(this.silex.getInventoryName());
String name = this.fel.hasCustomInventoryName() ? this.fel.getInventoryName() : I18n.format(this.fel.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
@ -55,5 +64,8 @@ public class GUIFEL 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 mode = fel.mode;
drawTexturedModalRect(guiLeft + 133, guiTop + 16 + mode * 9, 176, 52 + mode * 9, 18, 9);
}
}

View File

@ -571,6 +571,7 @@ public class ModItems {
public static Item pellet_rtg;
public static Item pellet_rtg_weak;
public static Item pellet_rtg_polonium;
public static Item pellet_rtg_gold;
public static Item tritium_deuterium_cake;
public static Item pellet_schrabidium;
@ -2661,9 +2662,10 @@ public class ModItems {
wiring_red_copper = new ItemWiring().setUnlocalizedName("wiring_red_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wiring_red_copper");
pellet_rtg = new ItemRTGPellet(ItemHazard.pu238 * 1.5F, true).setUnlocalizedName("pellet_rtg").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg");
pellet_rtg_weak = new ItemHazard(ItemHazard.pu238 * 0.5F).setUnlocalizedName("pellet_rtg_weak").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_weak");
pellet_rtg_polonium = new ItemHazard(ItemHazard.po210 * 1.5F, true).setUnlocalizedName("pellet_rtg_polonium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_polonium");
pellet_rtg = new ItemRTGPellet(ItemHazard.pu238 * ItemHazard.billet * 3, true).setUnlocalizedName("pellet_rtg").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg");
pellet_rtg_weak = new ItemHazard(ItemHazard.pu238 * ItemHazard.billet).setUnlocalizedName("pellet_rtg_weak").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_weak");
pellet_rtg_polonium = new ItemHazard(ItemHazard.po210 * ItemHazard.billet * 3, true).setUnlocalizedName("pellet_rtg_polonium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_polonium");
pellet_rtg_gold = new ItemHazard().addRadiation(ItemHazard.au198 * ItemHazard.billet * 3).addFire(15).setUnlocalizedName("pellet_rtg_gold").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_gold");
tritium_deuterium_cake = new ItemCustomLore().setUnlocalizedName("tritium_deuterium_cake").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":tritium_deuterium_cake");
piston_selenium = new Item().setUnlocalizedName("piston_selenium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":piston_selenium");
@ -5149,6 +5151,7 @@ public class ModItems {
GameRegistry.registerItem(pellet_rtg, pellet_rtg.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_weak, pellet_rtg_weak.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_polonium, pellet_rtg_polonium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_gold, pellet_rtg_gold.getUnlocalizedName());
GameRegistry.registerItem(tritium_deuterium_cake, tritium_deuterium_cake.getUnlocalizedName());
GameRegistry.registerItem(pellet_cluster, pellet_cluster.getUnlocalizedName());
GameRegistry.registerItem(pellet_buckshot, pellet_buckshot.getUnlocalizedName());

View File

@ -17,17 +17,19 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class ItemHazard extends ItemCustomLore {
//PO210 138d α 25.00Rad/s Spicy
//TH232 14,000,000,000a α 00.10Rad/s
//U233 160,000a α 05.00Rad/s
//U235 700,000,000a α 01.00Rad/s
//U238 4,500,000,000a α 00.25Rad/s
//NP237 2,100,000a α 02.50Rad/s
//PU238 88a α 10.00Rad/s Spicy
//PU239 24,000a α 05.00Rad/s
//PU240 6,600a α 07.50Rad/s
//AU192 64h α 500.00Rad/s 2 much spice :(
//PO210 138d α 025.00Rad/s Spicy
//TH232 14,000,000,000a α 000.10Rad/s
//U233 160,000a α 005.00Rad/s
//U235 700,000,000a α 001.00Rad/s
//U238 4,500,000,000a α 000.25Rad/s
//NP237 2,100,000a α 002.50Rad/s
//PU238 88a α 010.00Rad/s Spicy
//PU239 24,000a α 005.00Rad/s
//PU240 6,600a α 007.50Rad/s
public static final float au198 = 500.0F;
public static final float po210 = 25.0F;
public static final float th232 = 0.1F;
public static final float thf = 1.75F;

View File

@ -1,5 +1,7 @@
package com.hbm.render.tileentity;
import java.awt.Color;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.BlockDummyable;
@ -7,6 +9,7 @@ import com.hbm.main.ResourceManager;
import com.hbm.render.util.BeamPronter;
import com.hbm.render.util.BeamPronter.EnumBeamType;
import com.hbm.render.util.BeamPronter.EnumWaveType;
import com.hbm.tileentity.machine.TileEntityFEL;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
@ -33,10 +36,24 @@ public class RenderFEL extends TileEntitySpecialRenderer {
bindTexture(ResourceManager.fel_tex);
ResourceManager.fel.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
TileEntityFEL fel = (TileEntityFEL) tileEntity;
int color = 0xff0000;
switch(fel.mode) {
case 0: color = 0x303000; break;
case 1: color = 0x400000; break;
case 2: color = Color.HSBtoRGB(fel.getWorldObj().getTotalWorldTime() / 50.0F, 1F, 0.3F) & 16777215; break;
case 3: color = 0x100040; break;
case 4: color = 0x003000; break;
case 5: color = 0x306000; break;
}
int length = 25;
GL11.glTranslated(0, 1.5, -2.5 + 0.0625);
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -8), EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0x400000, 0x400000, 0, 1, 0F, 2, 0.0625F);
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -8), EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x400000, 0x400000, (int)(tileEntity.getWorldObj().getTotalWorldTime() % 1000 / 2), 24, 0.0625F, 2, 0.0625F);
GL11.glTranslated(0, 1.5, -1.5);
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -length - 1), EnumWaveType.SPIRAL, EnumBeamType.SOLID, color, color, 0, 1, 0F, 2, 0.0625F);
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -length - 1), EnumWaveType.RANDOM, EnumBeamType.SOLID, color, color, (int)(tileEntity.getWorldObj().getTotalWorldTime() % 1000 / 2), (length / 2) + 1, 0.0625F, 2, 0.0625F);
GL11.glPopMatrix();
}

View File

@ -9,40 +9,38 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
public class BeamPronter {
public static enum EnumWaveType {
RANDOM,
SPIRAL
RANDOM, SPIRAL
}
public static enum EnumBeamType {
SOLID,
LINE
SOLID, LINE
}
public static void prontBeam(Vec3 skeleton, EnumWaveType wave, EnumBeamType beam, int outerColor, int innerColor, int start, int segments, float size, int layers, float thickness) {
GL11.glPushMatrix();
GL11.glDepthMask(false);
float sYaw = (float)(Math.atan2(skeleton.xCoord, skeleton.zCoord) * 180F / Math.PI);
float sqrt = MathHelper.sqrt_double(skeleton.xCoord * skeleton.xCoord + skeleton.zCoord * skeleton.zCoord);
float sPitch = (float)(Math.atan2(skeleton.yCoord, (double)sqrt) * 180F / Math.PI);
float sYaw = (float) (Math.atan2(skeleton.xCoord, skeleton.zCoord) * 180F / Math.PI);
float sqrt = MathHelper.sqrt_double(skeleton.xCoord * skeleton.xCoord + skeleton.zCoord * skeleton.zCoord);
float sPitch = (float) (Math.atan2(skeleton.yCoord, (double) sqrt) * 180F / Math.PI);
GL11.glRotatef(180, 0, 1F, 0);
GL11.glRotatef(sYaw, 0, 1F, 0);
GL11.glRotatef(sPitch - 90, 1F, 0, 0);
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
if(beam == EnumBeamType.SOLID) {
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
}
Tessellator tessellator = Tessellator.instance;
Vec3 unit = Vec3.createVectorHelper(0, 1, 0);
@ -52,63 +50,63 @@ public class BeamPronter {
double lastX = 0;
double lastY = 0;
double lastZ = 0;
for(int i = 0; i <= segments; i++) {
Vec3 spinner = Vec3.createVectorHelper(size, 0, 0);
if(wave == EnumWaveType.SPIRAL) {
spinner.rotateAroundY((float)Math.PI * (float)start / 180F);
spinner.rotateAroundY((float)Math.PI * 45F / 180F * i);
spinner.rotateAroundY((float) Math.PI * (float) start / 180F);
spinner.rotateAroundY((float) Math.PI * 45F / 180F * i);
} else if(wave == EnumWaveType.RANDOM) {
spinner.rotateAroundY((float)Math.PI * 2 * rand.nextFloat());
spinner.rotateAroundY((float) Math.PI * 4 * rand.nextFloat());
}
double pX = unit.xCoord * segLength * i + spinner.xCoord;
double pY = unit.yCoord * segLength * i + spinner.yCoord;
double pZ = unit.zCoord * segLength * i + spinner.zCoord;
if(beam == EnumBeamType.LINE && i > 0) {
tessellator.startDrawing(3);
tessellator.setColorOpaque_I(outerColor);
tessellator.addVertex(pX, pY, pZ);
tessellator.addVertex(lastX, lastY, lastZ);
tessellator.draw();
tessellator.startDrawing(3);
tessellator.setColorOpaque_I(outerColor);
tessellator.addVertex(pX, pY, pZ);
tessellator.addVertex(lastX, lastY, lastZ);
tessellator.draw();
}
if(beam == EnumBeamType.SOLID && i > 0) {
float radius = thickness / layers;
for(int j = 1; j <= layers; j++) {
float inter = (float)(j - 1) / (float)(layers - 1);
float inter = (float) (j - 1) / (float) (layers - 1);
int color = (int) (outerColor + (innerColor - outerColor) * inter);
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(color);
tessellator.setColorOpaque_I(color);
tessellator.addVertex(lastX + (radius * j), lastY, lastZ + (radius * j));
tessellator.addVertex(lastX + (radius * j), lastY, lastZ - (radius * j));
tessellator.addVertex(pX + (radius * j), pY, pZ - (radius * j));
tessellator.addVertex(pX + (radius * j), pY, pZ + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(color);
tessellator.setColorOpaque_I(color);
tessellator.addVertex(lastX - (radius * j), lastY, lastZ + (radius * j));
tessellator.addVertex(lastX - (radius * j), lastY, lastZ - (radius * j));
tessellator.addVertex(pX - (radius * j), pY, pZ - (radius * j));
tessellator.addVertex(pX - (radius * j), pY, pZ + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(color);
tessellator.setColorOpaque_I(color);
tessellator.addVertex(lastX + (radius * j), lastY, lastZ + (radius * j));
tessellator.addVertex(lastX - (radius * j), lastY, lastZ + (radius * j));
tessellator.addVertex(pX - (radius * j), pY, pZ + (radius * j));
tessellator.addVertex(pX + (radius * j), pY, pZ + (radius * j));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(color);
tessellator.setColorOpaque_I(color);
tessellator.addVertex(lastX + (radius * j), lastY, lastZ - (radius * j));
tessellator.addVertex(lastX - (radius * j), lastY, lastZ - (radius * j));
tessellator.addVertex(pX - (radius * j), pY, pZ - (radius * j));
@ -116,28 +114,28 @@ public class BeamPronter {
tessellator.draw();
}
}
lastX = pX;
lastY = pY;
lastZ = pZ;
}
if(beam == EnumBeamType.LINE) {
tessellator.startDrawing(3);
tessellator.setColorOpaque_I(innerColor);
tessellator.addVertex(0, 0, 0);
tessellator.addVertex(0, skeleton.lengthVector(), 0);
tessellator.draw();
tessellator.startDrawing(3);
tessellator.setColorOpaque_I(innerColor);
tessellator.addVertex(0, 0, 0);
tessellator.addVertex(0, skeleton.lengthVector(), 0);
tessellator.draw();
}
if(beam == EnumBeamType.SOLID) {
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
GL11.glDepthMask(true);

View File

@ -4,10 +4,15 @@ import com.hbm.tileentity.TileEntityMachineBase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityFEL extends TileEntityMachineBase {
public long power;
public static final long maxPower = 1000000;
public int mode = 0;
public TileEntityFEL() {
super(1);
}
@ -20,6 +25,27 @@ public class TileEntityFEL extends TileEntityMachineBase {
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
NBTTagCompound data = new NBTTagCompound();
data.setLong("power", power);
data.setByte("mode", (byte)mode);
this.networkPack(data, 250);
}
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
this.power = nbt.getLong("power");
this.mode = nbt.getByte("mode");
}
@Override
public void handleButtonPacket(int value, int meta) {
if(meta == 0) {
this.mode = Math.abs(value) % 6;
}
}
@Override

View File

@ -22,7 +22,7 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory,
private ItemStack slots[];
public int heat;
public final int heatMax = 75;
public final int heatMax = 150;
public long power;
public final long powerMax = 90000;
public int age = 0;
@ -230,6 +230,14 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory,
heat += 3;
if(slots[i].getItem() == ModItems.pellet_rtg_polonium)
heat += 25;
if(slots[i].getItem() == ModItems.pellet_rtg_gold) {
if(worldObj.rand.nextInt(60*60*20) == 0)
slots[i] = null;
else
heat += 150;
}
}
}

View File

@ -167,10 +167,12 @@ public class TileEntityTurretHoward extends TileEntityTurretBaseNT {
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.loaded = nbt.getInteger("loaded");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setInteger("loaded", loaded);
}
}

View File

@ -1739,6 +1739,7 @@ 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_gold.name=Gold 198 Pellet
item.pellet_rtg_polonium.name=Polonium 210 Pellet
item.pellet_rtg_weak.name=Schwaches Uran RTG-Pellet
item.pellet_schrabidium.name=Pures Schrabidium-Watzpellet

View File

@ -1741,6 +1741,7 @@ 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_gold.name=Gold 198 Fuel Pellet
item.pellet_rtg_polonium.name=Polonium 210 Fuel Pellet
item.pellet_rtg_weak.name=Weak Uranium RTG Pellet
item.pellet_schrabidium.name=Pure Schrabidium Watz Pellet

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

View File

Before

Width:  |  Height:  |  Size: 322 B

After

Width:  |  Height:  |  Size: 322 B

View File

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 383 B