From 9f92785ec6a329e7cfe741a14b7376784c67ce64 Mon Sep 17 00:00:00 2001 From: Boblet Date: Fri, 28 Jan 2022 08:04:05 +0100 Subject: [PATCH 1/4] fixed skybox chainloader --- .../com/hbm/main/ModEventHandlerClient.java | 16 ++- .../world/RenderNTMSkyboxChainloader.java | 121 ++++++++++++++++++ ...Skybox.java => RenderNTMSkyboxImpact.java} | 6 +- 3 files changed, 137 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/hbm/render/world/RenderNTMSkyboxChainloader.java rename src/main/java/com/hbm/render/world/{RenderNTMSkybox.java => RenderNTMSkyboxImpact.java} (98%) diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index 13ed5a233..42688a750 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -41,7 +41,8 @@ import com.hbm.render.util.RenderAccessoryUtility; import com.hbm.render.util.RenderOverhead; import com.hbm.render.util.RenderScreenOverlay; import com.hbm.render.util.SoyuzPronter; -import com.hbm.render.world.RenderNTMSkybox; +import com.hbm.render.world.RenderNTMSkyboxChainloader; +import com.hbm.render.world.RenderNTMSkyboxImpact; import com.hbm.sound.MovingSoundChopper; import com.hbm.sound.MovingSoundChopperMine; import com.hbm.sound.MovingSoundCrashing; @@ -688,8 +689,17 @@ public class ModEventHandlerClient { if(world != null && world.provider instanceof WorldProviderSurface) { IRenderHandler sky = world.provider.getSkyRenderer(); - if(!(sky instanceof RenderNTMSkybox)) { - world.provider.setSkyRenderer(new RenderNTMSkybox()); + + if(ModEventHandler.dust > 0 || ModEventHandler.fire > 0) { + + if(!(sky instanceof RenderNTMSkyboxImpact)) { + world.provider.setSkyRenderer(new RenderNTMSkyboxImpact()); + } + } else { + + if(!(sky instanceof RenderNTMSkyboxChainloader)) { + world.provider.setSkyRenderer(new RenderNTMSkyboxChainloader(sky)); + } } } } diff --git a/src/main/java/com/hbm/render/world/RenderNTMSkyboxChainloader.java b/src/main/java/com/hbm/render/world/RenderNTMSkyboxChainloader.java new file mode 100644 index 000000000..df520e044 --- /dev/null +++ b/src/main/java/com/hbm/render/world/RenderNTMSkyboxChainloader.java @@ -0,0 +1,121 @@ +package com.hbm.render.world; + +import org.lwjgl.opengl.GL11; + +import com.hbm.extprop.HbmLivingProps; + +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.client.IRenderHandler; + +public class RenderNTMSkyboxChainloader extends IRenderHandler { //why an abstract class uses the I-prefix is beyond me but ok, alright, whatever + + /* + * To get the terrain render order right, making a sky rendering handler is absolutely necessary. Turns out MC can only handle one of these, so what do we do? + * We make out own renderer, grab any existing renderers that are already occupying the slot, doing what is effectively chainloading while adding our own garbage. + * If somebody does the exact same thing as we do we might be screwed due to increasingly long recursive loops but we can fix that too, no worries. + */ + private IRenderHandler parent; + + private static final ResourceLocation digammaStar = new ResourceLocation("hbm:textures/misc/star_digamma.png"); + private static final ResourceLocation bobmazonSat = new ResourceLocation("hbm:textures/misc/sat_bobmazon.png"); + + /* + * If the skybox was rendered successfully in the last tick (even from other mods' skyboxes chainloading this one) then we don't need to add it again + */ + public static boolean didLastRender = false; + + public RenderNTMSkyboxChainloader(IRenderHandler parent) { + this.parent = parent; + } + + @Override + public void render(float partialTicks, WorldClient world, Minecraft mc) { + + if(parent != null) { + + //basically a recursion-brake to prevent endless rendering loops from other mods' chainloaders. + //do other mods' skyboxes even employ chainloading? + if(!didLastRender) { + didLastRender = true; + parent.render(partialTicks, world, mc); + didLastRender = false; + } + + } else{ + RenderGlobal rg = Minecraft.getMinecraft().renderGlobal; + world.provider.setSkyRenderer(null); + rg.renderSky(partialTicks); + world.provider.setSkyRenderer(this); + } + + GL11.glPushMatrix(); + GL11.glDepthMask(false); + + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_FOG); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + + float brightness = (float) Math.sin(world.getCelestialAngle(partialTicks) * Math.PI); + brightness *= brightness; + + GL11.glColor4f(brightness, brightness, brightness, 1.0F); + + GL11.glPushMatrix(); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(140.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-40.0F, 0.0F, 0.0F, 1.0F); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(digammaStar); + + float digamma = HbmLivingProps.getDigamma(Minecraft.getMinecraft().thePlayer); + float var12 = 1F * (1 + digamma * 0.25F); + double dist = 100D - digamma * 2.5; + + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-var12, dist, -var12, 0.0D, 0.0D); + tessellator.addVertexWithUV(var12, dist, -var12, 0.0D, 1.0D); + tessellator.addVertexWithUV(var12, dist, var12, 1.0D, 1.0D); + tessellator.addVertexWithUV(-var12, dist, var12, 1.0D, 0.0D); + tessellator.draw(); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glRotatef(-40.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef((System.currentTimeMillis() % (360 * 1000) / 1000F), 0.0F, 1.0F, 0.0F); + GL11.glRotatef((System.currentTimeMillis() % (360 * 100) / 100F), 1.0F, 0.0F, 0.0F); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(bobmazonSat); + + var12 = 0.5F; + dist = 100D; + + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-var12, dist, -var12, 0.0D, 0.0D); + tessellator.addVertexWithUV(var12, dist, -var12, 0.0D, 1.0D); + tessellator.addVertexWithUV(var12, dist, var12, 1.0D, 1.0D); + tessellator.addVertexWithUV(-var12, dist, var12, 1.0D, 0.0D); + tessellator.draw(); + GL11.glPopMatrix(); + + GL11.glDepthMask(true); + + GL11.glEnable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + GL11.glPopMatrix(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/hbm/render/world/RenderNTMSkybox.java b/src/main/java/com/hbm/render/world/RenderNTMSkyboxImpact.java similarity index 98% rename from src/main/java/com/hbm/render/world/RenderNTMSkybox.java rename to src/main/java/com/hbm/render/world/RenderNTMSkyboxImpact.java index a76f3318a..9e03e7819 100644 --- a/src/main/java/com/hbm/render/world/RenderNTMSkybox.java +++ b/src/main/java/com/hbm/render/world/RenderNTMSkyboxImpact.java @@ -24,7 +24,7 @@ import com.hbm.main.ModEventHandler; import java.util.Random; -public class RenderNTMSkybox extends IRenderHandler { +public class RenderNTMSkyboxImpact extends IRenderHandler { private static final ResourceLocation sunTexture = new ResourceLocation("textures/environment/sun.png"); private static final ResourceLocation moonTexture = new ResourceLocation("textures/environment/moon_phases.png"); @@ -42,7 +42,7 @@ public class RenderNTMSkybox extends IRenderHandler { /// I had to break your compat feature for other mods' skyboxes in order to /// make the skybox render correctly after Tom. Sorry about that. -Pu - public RenderNTMSkybox() { + public RenderNTMSkyboxImpact() { GL11.glPushMatrix(); GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE); this.renderStars(); @@ -171,7 +171,7 @@ public class RenderNTMSkybox extends IRenderHandler { { GL11.glColor4d(1, 1, 1, rain); f10 = 20.0F; - FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderNTMSkybox.moonTexture); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderNTMSkyboxImpact.moonTexture); float sinphi = FMLClientHandler.instance().getClient().theWorld.getMoonPhase(); final int cosphi = (int) (sinphi % 4); final int var29 = (int) (sinphi / 4 % 2); From da45bb91c82feb1bd2aa8042d3eee2569811afbd Mon Sep 17 00:00:00 2001 From: Boblet Date: Fri, 28 Jan 2022 09:37:18 +0100 Subject: [PATCH 2/4] floppenheimer (it's the FEL) --- .../hbm/handler/nei/SILEXRecipeHandler.java | 25 +- .../java/com/hbm/inventory/gui/GUIFEL.java | 120 ++++------ .../java/com/hbm/inventory/gui/GUISILEX.java | 64 ++++- .../inventory/recipes/AssemblerRecipes.java | 12 + .../hbm/inventory/recipes/SILEXRecipes.java | 162 ++++++------- src/main/java/com/hbm/items/ModItems.java | 20 ++ .../com/hbm/items/machine/ItemFELCrystal.java | 56 +++++ .../java/com/hbm/items/weapon/ItemAmmo.java | 28 +++ .../java/com/hbm/main/CraftingManager.java | 6 + .../com/hbm/render/tileentity/RenderFEL.java | 28 +-- .../hbm/tileentity/machine/TileEntityFEL.java | 224 +++++++++++++----- .../tileentity/machine/TileEntitySILEX.java | 180 +++++++------- .../hbm/textures/gui/machine/gui_fel.png | Bin 2728 -> 7311 bytes .../hbm/textures/gui/nei/gui_nei_silex.png | Bin 756 -> 797 bytes .../hbm/textures/gui/processing/gui_silex.png | Bin 4279 -> 3407 bytes .../textures/items/laser_crystal_bismuth.png | Bin 0 -> 483 bytes .../hbm/textures/items/laser_crystal_cmb.png | Bin 0 -> 462 bytes .../hbm/textures/items/laser_crystal_co2.png | Bin 0 -> 305 bytes .../textures/items/laser_crystal_digamma.png | Bin 0 -> 485 bytes .../items/laser_crystal_digamma.png.mcmeta | 3 + .../hbm/textures/items/laser_crystal_dnt.png | Bin 0 -> 358 bytes 21 files changed, 612 insertions(+), 316 deletions(-) create mode 100644 src/main/java/com/hbm/items/machine/ItemFELCrystal.java create mode 100644 src/main/resources/assets/hbm/textures/items/laser_crystal_bismuth.png create mode 100644 src/main/resources/assets/hbm/textures/items/laser_crystal_cmb.png create mode 100644 src/main/resources/assets/hbm/textures/items/laser_crystal_co2.png create mode 100644 src/main/resources/assets/hbm/textures/items/laser_crystal_digamma.png create mode 100644 src/main/resources/assets/hbm/textures/items/laser_crystal_digamma.png.mcmeta create mode 100644 src/main/resources/assets/hbm/textures/items/laser_crystal_dnt.png diff --git a/src/main/java/com/hbm/handler/nei/SILEXRecipeHandler.java b/src/main/java/com/hbm/handler/nei/SILEXRecipeHandler.java index efedb31f1..cc1dba5b5 100644 --- a/src/main/java/com/hbm/handler/nei/SILEXRecipeHandler.java +++ b/src/main/java/com/hbm/handler/nei/SILEXRecipeHandler.java @@ -10,8 +10,12 @@ import java.util.Map; import com.hbm.inventory.gui.GUISILEX; import com.hbm.inventory.recipes.SILEXRecipes; import com.hbm.inventory.recipes.SILEXRecipes.SILEXRecipe; +import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths; import com.hbm.lib.RefStrings; +import com.hbm.util.I18nUtil; import com.hbm.util.WeightedRandomObject; +import com.hbm.inventory.RecipesCommon.ComparableStack; import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; @@ -19,7 +23,9 @@ import codechicken.nei.recipe.TemplateRecipeHandler; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; public class SILEXRecipeHandler extends TemplateRecipeHandler { @@ -34,6 +40,7 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler { List outputs; List chances; double produced; + EnumWavelengths crystalStrength; public RecipeSet(Object input, SILEXRecipe recipe) { @@ -41,6 +48,7 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler { this.outputs = new ArrayList(); this.chances = new ArrayList(); this.produced = recipe.fluidProduced / recipe.fluidConsumed; + this.crystalStrength = EnumWavelengths.values()[recipe.laserStrength]; double weight = 0; @@ -141,7 +149,7 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler { if(recipe.getKey() instanceof ItemStack) { - if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, (ItemStack)recipe.getKey())) + if (NEIServerUtils.areStacksSameType(ingredient, (ItemStack)recipe.getKey())) this.arecipes.add(new RecipeSet(recipe.getKey(), recipe.getValue())); } else if (recipe.getKey() instanceof ArrayList) { @@ -149,7 +157,7 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler { for(Object o : (ArrayList)recipe.getKey()) { ItemStack stack = (ItemStack)o; - if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, stack)) + if (NEIServerUtils.areStacksSameType(ingredient, stack)) this.arecipes.add(new RecipeSet(stack, recipe.getValue())); } } @@ -174,6 +182,12 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler { RecipeSet rec = (RecipeSet) this.arecipes.get(recipe); FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; + + /*int index = 0; + for(Double chance : rec.chances) { + fontRenderer.drawString(((int)(chance * 10D) / 10D) + "%", 84, 28 + index * 18 - 9 * ((rec.chances.size() + 1) / 2), 0x404040); + index++; + }*/ for(int i = 0; i < rec.chances.size(); i++) { @@ -186,6 +200,11 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler { String am = ((int)(rec.produced * 10D) / 10D) + "x"; fontRenderer.drawString(am, 52 - fontRenderer.getStringWidth(am) / 2, 43, 0x404040); + + String wavelength = (rec.crystalStrength == EnumWavelengths.NULL) ? EnumChatFormatting.WHITE+"N/A" : rec.crystalStrength.textColor + I18nUtil.resolveKey(rec.crystalStrength.name); + fontRenderer.drawString(wavelength, (33 - fontRenderer.getStringWidth(wavelength) / 2), 8, 0x404040); + + } @Override @@ -197,4 +216,4 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler { public String getGuiTexture() { return RefStrings.MODID + ":textures/gui/nei/gui_nei_silex.png"; } -} +} \ No newline at end of file diff --git a/src/main/java/com/hbm/inventory/gui/GUIFEL.java b/src/main/java/com/hbm/inventory/gui/GUIFEL.java index 3365d8759..12bac9043 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIFEL.java +++ b/src/main/java/com/hbm/inventory/gui/GUIFEL.java @@ -1,10 +1,11 @@ package com.hbm.inventory.gui; -import org.apache.commons.lang3.math.NumberUtils; -import org.lwjgl.input.Keyboard; +import java.awt.Color; + import org.lwjgl.opengl.GL11; import com.hbm.inventory.container.ContainerFEL; +import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths; import com.hbm.lib.RefStrings; import com.hbm.packet.AuxButtonPacket; import com.hbm.packet.PacketDispatcher; @@ -13,87 +14,54 @@ import com.hbm.tileentity.machine.TileEntityFEL; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.MathHelper; 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 fel; - private GuiTextField field; public GUIFEL(InventoryPlayer invPlayer, TileEntityFEL laser) { super(new ContainerFEL(invPlayer, laser)); this.fel = laser; - this.xSize = 176; - this.ySize = 168; + this.xSize = 203; + this.ySize = 169; } - - @Override - public void initGui() { - super.initGui(); - - Keyboard.enableRepeatEvents(true); - this.field = new GuiTextField(this.fontRendererObj, guiLeft + 57, guiTop + 57, 29, 12); - this.field.setTextColor(-1); - this.field.setDisabledTextColour(-1); - this.field.setEnableBackgroundDrawing(false); - this.field.setMaxStringLength(3); - this.field.setText(String.valueOf(fel.watts)); - } - + @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"}); - this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 17, 16, 52, fel.power, fel.maxPower); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 182, guiTop + 27, 16, 113, fel.power, fel.maxPower); } protected void mouseClicked(int x, int y, int i) { super.mouseClicked(x, y, i); - this.field.mouseClicked(x, y, i); - - if(guiLeft + 97 <= x && guiLeft + 97 + 18 > x && guiTop + 52 < y && guiTop + 52 + 18 >= y) { - - if(NumberUtils.isNumber(field.getText())) { - int j = MathHelper.clamp_int((int) Double.parseDouble(field.getText()), 1, 100); - field.setText(j + ""); - 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, j, 1)); - } - } - - if(guiLeft + 97 <= x && guiLeft + 97 + 18 > x && guiTop + 16 < y && guiTop + 16 + 18 >= y) { + if(guiLeft + 142 <= x && guiLeft + 142 + 29 > x && guiTop + 41 < y && guiTop + 41 + 17 >= 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, 0, 2)); } - 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.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); + this.fontRendererObj.drawString(name, 90 + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 7, 0xffffff); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 98, 4210752); + + if(fel.missingValidSilex && fel.isOn) { + this.fontRendererObj.drawString(I18n.format("ERR."), 55 + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 9, 0xFF0000); + } else if(fel.isOn) { + this.fontRendererObj.drawString(I18n.format("LIVE"), 54 + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 9, 0x00FF00); + } + } @Override @@ -101,29 +69,39 @@ 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); - - if(field.isFocused()) - drawTexturedModalRect(guiLeft + 53, guiTop + 53, 210, 4, 34, 16); - + if(fel.isOn) - drawTexturedModalRect(guiLeft + 97, guiTop + 16, 192, 0, 18, 18); + drawTexturedModalRect(guiLeft + 142, guiTop + 41, 203, 0, 29, 17); - int mode = fel.mode; - drawTexturedModalRect(guiLeft + 133, guiTop + 16 + mode * 9, 176, 52 + mode * 9, 18, 9); + int k = (int)fel.getPowerScaled(114); + drawTexturedModalRect(guiLeft + 182, guiTop + 27 + 113 - k, 203, 17 + 113 - k, 16, k); - int i = (int) fel.getPowerScaled(52); - drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 176, 52 - i, 16, i); - - drawTexturedModalRect(guiLeft + 53, guiTop + 45, 210, 0, fel.watts * 34 / 100, 4); + int color = !(fel.mode == EnumWavelengths.VISIBLE) ? fel.mode.guiColor : Color.HSBtoRGB(fel.getWorldObj().getTotalWorldTime() / 50.0F, 0.5F, 1F) & 16777215; - this.field.drawTextBox(); - } - - @Override - protected void keyTyped(char c, int key) { - - if(!this.field.textboxKeyTyped(c, key)) { - super.keyTyped(c, key); + if(fel.power > fel.powerReq * Math.pow(2, fel.mode.ordinal()) && fel.isOn && !(fel.mode == EnumWavelengths.NULL) && fel.distance > 0) { + + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glLineWidth(5F); + + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawing(1); + tessellator.setColorOpaque_I(color); + + tessellator.addVertex(guiLeft + 113, guiTop + 31.5F, this.zLevel); + tessellator.addVertex(guiLeft + 135, guiTop + 31.5F, this.zLevel); + tessellator.draw(); + + tessellator.startDrawing(1); + tessellator.setColorOpaque_I(color); + + tessellator.addVertex(0, guiTop + 31.5F, this.zLevel); + tessellator.addVertex(guiLeft + 4, guiTop + 31.5F, this.zLevel); + tessellator.draw(); + + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPopMatrix(); } - } -} + } +} \ No newline at end of file diff --git a/src/main/java/com/hbm/inventory/gui/GUISILEX.java b/src/main/java/com/hbm/inventory/gui/GUISILEX.java index ff2f7604c..8de55b89a 100644 --- a/src/main/java/com/hbm/inventory/gui/GUISILEX.java +++ b/src/main/java/com/hbm/inventory/gui/GUISILEX.java @@ -1,16 +1,21 @@ package com.hbm.inventory.gui; +import java.awt.Color; + import org.lwjgl.opengl.GL11; import com.hbm.inventory.container.ContainerSILEX; import com.hbm.inventory.fluid.Fluids; +import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths; import com.hbm.lib.RefStrings; import com.hbm.packet.AuxButtonPacket; import com.hbm.packet.PacketDispatcher; import com.hbm.tileentity.machine.TileEntitySILEX; +import com.hbm.util.I18nUtil; 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; @@ -19,6 +24,7 @@ public class GUISILEX extends GuiInfoContainer { public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_silex.png"); private TileEntitySILEX silex; + int offset = 0; public GUISILEX(InventoryPlayer invPlayer, TileEntitySILEX laser) { super(new ContainerSILEX(invPlayer, laser)); @@ -32,7 +38,7 @@ public class GUISILEX extends GuiInfoContainer { public void drawScreen(int mouseX, int mouseY, float f) { super.drawScreen(mouseX, mouseY, f); - silex.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 44, guiTop + 54, 52, 7); + silex.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 42, 52, 7); if(silex.current != null) { this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 27, guiTop + 72, 16, 52, mouseX, mouseY, new String[] { silex.currentFill + "/" + silex.maxFill + "mB", silex.current.toStack().getDisplayName() }); @@ -41,6 +47,7 @@ public class GUISILEX extends GuiInfoContainer { this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 10, guiTop + 92, 10, 10, mouseX, mouseY, new String[] { "Void contents" }); } + @Override protected void mouseClicked(int x, int y, int i) { super.mouseClicked(x, y, i); @@ -55,22 +62,33 @@ public class GUISILEX extends GuiInfoContainer { protected void drawGuiContainerForegroundLayer(int i, int j) { String name = this.silex.hasCustomInventoryName() ? this.silex.getInventoryName() : I18n.format(this.silex.getInventoryName()); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(name, (this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2) - 54, 8, 4210752); this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + + if(silex.mode != EnumWavelengths.NULL) { + this.fontRendererObj.drawString(silex.mode.textColor + I18nUtil.resolveKey(silex.mode.name), 100 + (32 - this.fontRendererObj.getStringWidth(I18nUtil.resolveKey(silex.mode.name)) / 2), 16, 0); + } } @Override protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + if(silex.mode != EnumWavelengths.NULL) { + float freq = 0.1F * (float)Math.pow(2, silex.mode.ordinal()); + int color = (silex.mode != EnumWavelengths.VISIBLE) ? silex.mode.guiColor : Color.HSBtoRGB(silex.getWorldObj().getTotalWorldTime() / 50.0F, 0.5F, 1F) & 16777215; + drawWave(81, 46, 16, 84, 0.5F, freq, color, 3F, 1F); + } + if(silex.tank.getFill() > 0) { if(silex.tank.getTankType() == Fluids.ACID || silex.fluidConversion.containsKey(silex.tank.getTankType())) { - drawTexturedModalRect(guiLeft + 43, guiTop + 53, 176, 118, 54, 9); + drawTexturedModalRect(guiLeft + 7, guiTop + 41, 176, 118, 54, 9); } else { - drawTexturedModalRect(guiLeft + 43, guiTop + 53, 176, 109, 54, 9); + drawTexturedModalRect(guiLeft + 7, guiTop + 41, 176, 109, 54, 9); } } @@ -81,6 +99,40 @@ public class GUISILEX extends GuiInfoContainer { drawTexturedModalRect(guiLeft + 26, guiTop + 124 - f, 176, 109 - f, 16, f); int i = silex.getFluidScaled(52); - drawTexturedModalRect(guiLeft + 44, guiTop + 54, 176, silex.tank.getTankType() == Fluids.ACID ? 43 : 50, i, 7); + drawTexturedModalRect(guiLeft + 8, guiTop + 42, 176, silex.tank.getTankType() == Fluids.ACID ? 43 : 50, i, 7); } -} + + private void drawWave(int x, int y, int height, int width, float resolution, float freq, int color, float thickness, float mult) { + float samples = ((float)width) / resolution; + float scale = ((float)height)/2F; + float offset = (float)((float)silex.getWorldObj().getTotalWorldTime() % (4*Math.PI/freq));//((width/3)*Math.PI/3));//(2.05F*width*freq)); + for(int i = 1; i < samples; i++) { + double currentX = offset + x + i*resolution; + double nextX = offset + x + (i+1)*resolution; + double currentY = y + scale*Math.sin(freq*currentX); + double nextY = y + scale*Math.sin(freq*nextX); + drawLine(thickness, color, currentX-offset, currentY, nextX-offset, nextY); + + + } + } + + private void drawLine(float width, int color, double x1, double y1, double x2, double y2) { + + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glLineWidth(width); + + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawing(1); + tessellator.setColorOpaque_I(color); + + tessellator.addVertex(guiLeft + x1, guiTop + y1, this.zLevel); + tessellator.addVertex(guiLeft + x2, guiTop + y2, this.zLevel); + tessellator.draw(); + + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java index 34e7da34a..167cbd124 100644 --- a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java @@ -738,6 +738,18 @@ public class AssemblerRecipes { new ComparableStack(ModItems.crystal_diamond, 1) }, 400); + makeRecipe(new ComparableStack(Item.getItemFromBlock(ModBlocks.machine_fel), 1), new AStack[] { + new ComparableStack(ModBlocks.fusion_conductor, 16), + new ComparableStack(ModBlocks.machine_lithium_battery, 2), + new OreDictStack(STEEL.ingot(), 16), + new OreDictStack(STEEL.plate(), 24), + new OreDictStack(POLYMER.ingot(), 8), + new ComparableStack(ModItems.circuit_red_copper, 4), + new ComparableStack(ModItems.wire_red_copper, 64), + new ComparableStack(ModItems.coil_advanced_torus, 16), + new ComparableStack(ModItems.circuit_gold, 1) + }, 400); + makeRecipe(new ComparableStack(ModBlocks.rbmk_blank, 1), new AStack[] { new ComparableStack(ModBlocks.concrete_asbestos, 4), new OreDictStack(STEEL.plate(), 4), diff --git a/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java b/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java index 94ce516ec..87b47a478 100644 --- a/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java @@ -28,68 +28,68 @@ public class SILEXRecipes { itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.UF6.getID()), new ComparableStack(ModItems.ingot_uranium)); dictTranslation.put("dustUranium", "ingotUranium"); - recipes.put("ingotUranium", new SILEXRecipe(900, 100) + recipes.put("ingotUranium", new SILEXRecipe(900, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 11)) ); - recipes.put(new ComparableStack(ModItems.ingot_pu_mix), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.ingot_pu_mix), new SILEXRecipe(900, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 6)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 3)) ); - recipes.put(new ComparableStack(ModItems.ingot_am_mix), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.ingot_am_mix), new SILEXRecipe(900, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am241), 3)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am242), 6)) ); itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.PUF6.getID()), new ComparableStack(ModItems.ingot_plutonium)); dictTranslation.put("dustPlutonium", "ingotPlutonium"); - recipes.put("ingotPlutonium", new SILEXRecipe(900, 100) + recipes.put("ingotPlutonium", new SILEXRecipe(900, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 3)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 4)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 2)) ); - recipes.put(new ComparableStack(ModItems.ingot_schraranium), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.ingot_schraranium), new SILEXRecipe(900, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_schrabidium), 4)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 3)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_plutonium), 2)) ); itemTranslation.put(new ComparableStack(ModItems.powder_australium), new ComparableStack(ModItems.ingot_australium)); - recipes.put(new ComparableStack(ModItems.ingot_australium), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.ingot_australium), new SILEXRecipe(900, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 5)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_greater), 1)) ); - recipes.put(new ComparableStack(ModItems.crystal_schraranium), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.crystal_schraranium), new SILEXRecipe(900, 100, 3) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_schrabidium), 5)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 2)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_plutonium), 2)) ); itemTranslation.put(new ComparableStack(ModItems.powder_lapis), new ComparableStack(Items.dye, 1, 4)); - recipes.put(new ComparableStack(Items.dye, 1, 4), new SILEXRecipe(100, 100) + recipes.put(new ComparableStack(Items.dye, 1, 4), new SILEXRecipe(100, 100 ,1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.sulfur), 4)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_aluminium), 3)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cobalt), 3)) ); - recipes.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.DEATH.getID()), new SILEXRecipe(1000, 1000) + recipes.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.DEATH.getID()), new SILEXRecipe(1000, 1000, 4) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_impure_osmiridium), 1)) ); for(int i = 0; i < 5; i++) { // UEU // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 88 - i * 6)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 8 - i * 2)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 3 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 2 + 5 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 88 - i * 6)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 8 - i * 2)) @@ -97,116 +97,116 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 1 + 5 * i)) ); // MEU // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium_fuel), 90 - i * 12)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 5 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 7 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium_fuel), 89 - i * 12)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 5 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 7 * i)) ); // HEU233 // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u233), 90 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), 4 + 8 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), 6 + 12 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u233), 89 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), 4 + 8 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), 6 + 12 * i)) ); // HEU235 // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 90 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 8 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 12 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 89 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 8 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 12 * i)) ); // TH232 // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_thorium_fuel), 90 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), 10 + 20 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_thorium_fuel), 89 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), 10 + 20 * i)) ); // LEP // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_plutonium_fuel), 90 - i * 15)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 7 + 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 3 + 5 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_plutonium_fuel), 89 - i * 15)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 7 + 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 3 + 5 * i)) ); // MEP // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu_mix), 85 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 10 + 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 5 + 5 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu_mix), 84 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 10 + 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 5 + 5 * i)) ); // HEP239 // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 85 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 15 + 20 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 84 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 15 + 20 * i)) ); // HEP241 // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 85 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), 15 + 20 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i + 5), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 84 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), 15 + 20 * i)) ); // MEN // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium_fuel), 90 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), 4 + 8 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), 6 + 12 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium_fuel), 89 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), 4 + 8 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), 6 + 12 * i)) ); // MOX // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_mox_fuel), 90 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 4 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 3 + 6 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 3 + 7 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 2 + 3 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_mox_fuel), 89 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 4 * i)) @@ -215,26 +215,26 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 2 + 3 * i)) ); // LEAUS // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 90 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 6 + 12 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 4 + 8 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i + 5), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 89 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 6 + 12 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 4 + 8 * i)) ); // HEAUS // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 90 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 5 + 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(Items.gold_nugget), 3 + 6 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 2 + 4 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i + 5), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 89 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 5 + 10 * i)) @@ -242,34 +242,34 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 2 + 4 * i)) ); // BALEFIRE // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i), new SILEXRecipe(400, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i), new SILEXRecipe(400, 100, 3) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 90 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 10 + 20 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i + 5), new SILEXRecipe(400, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i + 5), new SILEXRecipe(400, 100, 3) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 89 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 10 + 20 * i)) ); // FLASHGOLD // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 90 - 20 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 10 + 20 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i + 5), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 89 - 20 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 10 + 20 * i)) ); // FLASHLEAD // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 44 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 44 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 1 + 6 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_mercury), 1 + 6 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_gh336), 10 + 8 * i)) ); //Reimumunch - recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i + 5), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 2)) //literal how .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 43 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 43 - 10 * i)) @@ -278,13 +278,13 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_gh336), 10 + 8 * i)) ); // POBE // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 45 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 5 + 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 44 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i)) @@ -292,14 +292,14 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); // PUBE // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 45 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 3 + 5 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 2 + 5 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 44 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i)) @@ -308,14 +308,14 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); // RABE // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_ra226), 45 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 3 + 5 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 2 + 5 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i + 5), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_ra226), 44 - 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i)) @@ -324,7 +324,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); // FLASHGOLD // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i), new SILEXRecipe(600, 100, 4) .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) @@ -332,7 +332,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i + 5), new SILEXRecipe(600, 100, 4) .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) @@ -341,13 +341,13 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) ); // ZFB BI // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 50 - i * 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 - i * 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 50 + i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 150)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i + 5), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 3)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 50 - i * 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 - i * 10)) @@ -355,13 +355,13 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 147)) ); // ZFB PU-241 // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 50 - i * 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 50 - i * 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 + i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 150)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i + 5), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 3)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 50 - i * 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 50 - i * 10)) @@ -369,37 +369,37 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 147)) ); // ZFB RG-AM // - recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 100 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am_mix), 50 + i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 150)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i + 5), new SILEXRecipe(600, 100) + recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i + 5), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 3)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 100 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am_mix), 50 + i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 147)) ); } - recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium), 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 45)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_technetium), 15)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 65)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 15)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 12)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_i131_tiny), 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 12)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 56)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 32)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 22)) @@ -408,25 +408,25 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 16)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 15)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium), 25)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 45)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_technetium), 15)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 60)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 25)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 15)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 4)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 12)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_i131_tiny), 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 14)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 60)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 12)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 34)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 13)) @@ -435,7 +435,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 29)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 10)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 25)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 2)) @@ -443,7 +443,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 6)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 52)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 2)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 16)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 40)) @@ -451,7 +451,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 39)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 15)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium), 5)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 2)) @@ -459,7 +459,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 7)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 66)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 2)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 22)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 20)) @@ -468,7 +468,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 36)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), new SILEXRecipe(900, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am241), 25)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am242), 35)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_technetium), 5)) @@ -476,46 +476,46 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 7)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 25)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), new SILEXRecipe(900, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 60)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 15)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 5)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u233), 40)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 35)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 25)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 35)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 40)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 15)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 10)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 15)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 40)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 15)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_technetium), 15)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 15)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 16)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 55)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 9)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 40)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 7)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_i131_tiny), 5)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 8)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 40)) ); - recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 7)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 29)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 2)) @@ -523,7 +523,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 17)) ); - recipes.put(new ComparableStack(ModItems.fallout, 1), new SILEXRecipe(900, 100) + recipes.put(new ComparableStack(ModItems.fallout, 1), new SILEXRecipe(900, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 90)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_co60), 2)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 3)) @@ -532,7 +532,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 1)) ); - recipes.put(new ComparableStack(Blocks.gravel, 1), new SILEXRecipe(1000, 250) + recipes.put(new ComparableStack(Blocks.gravel, 1), new SILEXRecipe(1000, 250, 0) .addOut(new WeightedRandomObject(new ItemStack(Items.flint), 80)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_boron), 5)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_lithium), 10)) @@ -623,20 +623,22 @@ public class SILEXRecipes { return recipes; } - public static class SILEXRecipe { +public static class SILEXRecipe { public int fluidProduced; public int fluidConsumed; + public int laserStrength; public List outputs = new ArrayList(); - public SILEXRecipe(int fluidProduced, int fluidConsumed) { + public SILEXRecipe(int fluidProduced, int fluidConsumed, int laserStrength) { this.fluidProduced = fluidProduced; this.fluidConsumed = fluidConsumed; + this.laserStrength = laserStrength; } public SILEXRecipe addOut(WeightedRandomObject entry) { outputs.add(entry); return this; - } + } } } diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 0c2fd40ba..419835a58 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -13,6 +13,7 @@ import com.hbm.items.armor.*; import com.hbm.items.bomb.*; import com.hbm.items.food.*; import com.hbm.items.machine.*; +import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths; import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType; import com.hbm.items.machine.ItemPlateFuel.FunctionEnum; import com.hbm.items.machine.ItemRBMKRod.EnumBurnFunc; @@ -718,6 +719,12 @@ public class ModItems { public static Item part_carbon; public static Item part_copper; public static Item part_plutonium; + + public static Item laser_crystal_co2; + public static Item laser_crystal_bismuth; + public static Item laser_crystal_cmb; + public static Item laser_crystal_dnt; + public static Item laser_crystal_digamma; public static Item thermo_element; public static Item limiter; @@ -3228,6 +3235,12 @@ public class ModItems { part_copper = new Item().setUnlocalizedName("part_copper").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":part_copper"); part_plutonium = new Item().setUnlocalizedName("part_plutonium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":part_plutonium"); + laser_crystal_co2 = new ItemFELCrystal(EnumWavelengths.IR).setUnlocalizedName("laser_crystal_co2").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_co2"); + laser_crystal_bismuth = new ItemFELCrystal(EnumWavelengths.VISIBLE).setUnlocalizedName("laser_crystal_bismuth").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_bismuth"); + laser_crystal_cmb = new ItemFELCrystal(EnumWavelengths.UV).setUnlocalizedName("laser_crystal_cmb").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_cmb"); + laser_crystal_dnt = new ItemFELCrystal(EnumWavelengths.GAMMA).setUnlocalizedName("laser_crystal_dnt").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_dnt"); + laser_crystal_digamma = new ItemFELCrystal(EnumWavelengths.DRX).setUnlocalizedName("laser_crystal_digamma").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_digamma"); + thermo_element = new Item().setUnlocalizedName("thermo_element").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":thermo_element"); limiter = new Item().setUnlocalizedName("limiter").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":limiter"); @@ -6443,6 +6456,13 @@ public class ModItems { GameRegistry.registerItem(part_copper, part_copper.getUnlocalizedName()); GameRegistry.registerItem(part_plutonium, part_plutonium.getUnlocalizedName()); + //FEL laser crystals + GameRegistry.registerItem(laser_crystal_co2, laser_crystal_co2.getUnlocalizedName()); + GameRegistry.registerItem(laser_crystal_bismuth, laser_crystal_bismuth.getUnlocalizedName()); + GameRegistry.registerItem(laser_crystal_cmb, laser_crystal_cmb.getUnlocalizedName()); + GameRegistry.registerItem(laser_crystal_dnt, laser_crystal_dnt.getUnlocalizedName()); + GameRegistry.registerItem(laser_crystal_digamma, laser_crystal_digamma.getUnlocalizedName()); + //Recycled Units GameRegistry.registerItem(recycled_ground, recycled_ground.getUnlocalizedName()); GameRegistry.registerItem(recycled_rock, recycled_rock.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/machine/ItemFELCrystal.java b/src/main/java/com/hbm/items/machine/ItemFELCrystal.java new file mode 100644 index 000000000..4b0e03748 --- /dev/null +++ b/src/main/java/com/hbm/items/machine/ItemFELCrystal.java @@ -0,0 +1,56 @@ +package com.hbm.items.machine; + +import java.util.List; + +import com.hbm.items.ModItems; +import com.hbm.util.I18nUtil; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +public class ItemFELCrystal extends Item { + + public EnumWavelengths wavelength = EnumWavelengths.NULL; + + public ItemFELCrystal(EnumWavelengths wavelength) + { + this.wavelength = wavelength; + this.setMaxStackSize(1); + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { + String desc = (stack.getItem() == ModItems.laser_crystal_digamma) ? (EnumChatFormatting.OBFUSCATED + "THERADIANCEOFATHOUSANDSUNS") : (this.getUnlocalizedNameInefficiently(stack) + ".desc"); + list.add(I18nUtil.resolveKey(desc)); + list.add(wavelength.textColor + I18nUtil.resolveKey(wavelength.name) + " - " + wavelength.textColor + I18nUtil.resolveKey(this.wavelength.wavelengthRange)); + } + + public static enum EnumWavelengths{ + NULL("la creatura", "6 dollar", 0x010101, 0x010101, EnumChatFormatting.WHITE), + + IR("wavelengths.name.ir", "wavelengths.waveRange.ir", 0xBB1010, 0xCC4040, EnumChatFormatting.RED), + VISIBLE("wavelengths.name.visible", "wavelengths.waveRange.visible", 0, 0, EnumChatFormatting.GREEN), + UV("wavelengths.name.uv", "wavelengths.waveRange.uv", 0x0A1FC4, 0x00EFFF, EnumChatFormatting.AQUA), + GAMMA("wavelengths.name.gamma", "wavelengths.waveRange.gamma", 0x150560, 0xEF00FF, EnumChatFormatting.LIGHT_PURPLE), + DRX("wavelengths.name.drx", "wavelengths.waveRange.drx", 0xFF0000, 0xFF0000, EnumChatFormatting.DARK_RED); + + public String name = ""; + public String wavelengthRange = ""; + public int renderedBeamColor; + public int guiColor; + public EnumChatFormatting textColor; + + private EnumWavelengths(String name, String wavelength, int color, int guiColor, EnumChatFormatting textColor) { + this.name = name; + this.wavelengthRange = wavelength; + this.renderedBeamColor = color; + this.guiColor = guiColor; + this.textColor = textColor; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/hbm/items/weapon/ItemAmmo.java b/src/main/java/com/hbm/items/weapon/ItemAmmo.java index 3879b007b..5246dc19a 100644 --- a/src/main/java/com/hbm/items/weapon/ItemAmmo.java +++ b/src/main/java/com/hbm/items/weapon/ItemAmmo.java @@ -728,6 +728,34 @@ public class ItemAmmo extends Item { if(this == ModItems.ammo_folly_du) { list.add(EnumChatFormatting.BLUE + "+ Howitzer 17kg U238 shell"); } + + //STINGER + if(this == ModItems.ammo_stinger_rocket) { + list.add(EnumChatFormatting.BLUE + "+ Homing"); + } + if(this == ModItems.ammo_stinger_rocket_he) { + list.add(EnumChatFormatting.BLUE + "+ Homing"); + list.add(EnumChatFormatting.BLUE + "+ Increased Blast Radius"); + list.add(EnumChatFormatting.RED + "- Increased Wear"); + } + if(this == ModItems.ammo_stinger_rocket_incendiary) { + list.add(EnumChatFormatting.BLUE + "+ Homing"); + list.add(EnumChatFormatting.BLUE + "+ Incendiary explosion"); + list.add(EnumChatFormatting.RED + "- Slightly Increased wear"); + } + if(this == ModItems.ammo_stinger_rocket_nuclear) { + list.add(EnumChatFormatting.BLUE + "+ Homing"); + list.add(EnumChatFormatting.BLUE + "+ Nuclear"); + list.add(EnumChatFormatting.RED + "- Highly Increased wear"); + } + if(this == ModItems.ammo_stinger_rocket_bones) { + list.add(EnumChatFormatting.BLUE + "+ Homing"); + list.add(EnumChatFormatting.YELLOW + "* RATTLE ME BONES"); + list.add(EnumChatFormatting.YELLOW + "* WELCOME ABOARD MATEYS!"); + list.add(EnumChatFormatting.YELLOW + "* RATTLE ME BONES"); + list.add(EnumChatFormatting.YELLOW + "* RATTLE ME BONES"); + list.add(EnumChatFormatting.YELLOW + "* SPIN THE WHEEL FOR THE TREASURE TO TAKE"); + } } } diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 55973cd64..efe7e53f5 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -313,6 +313,12 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModItems.blades_advanced_alloy, 1), new Object[] { "PIP", 'P', ALLOY.plate(), 'I', new ItemStack(ModItems.blades_advanced_alloy, 1, OreDictionary.WILDCARD_VALUE) }); addRecipeAuto(new ItemStack(ModItems.blades_combine_steel, 1), new Object[] { "PIP", 'P', CMB.plate(), 'I', new ItemStack(ModItems.blades_combine_steel, 1, OreDictionary.WILDCARD_VALUE) }); addRecipeAuto(new ItemStack(ModItems.blades_schrabidium, 1), new Object[] { "PIP", 'P', SA326.plate(), 'I', new ItemStack(ModItems.blades_schrabidium, 1, OreDictionary.WILDCARD_VALUE) }); + + addRecipeAuto(new ItemStack(ModItems.laser_crystal_co2, 1), new Object[] { "QDQ", "NCN", "QDQ", 'Q', ModBlocks.glass_quartz, 'D', DESH.ingot(), 'N', ND.ingot(), 'C', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.CARBONDIOXIDE.getID()) }); + addRecipeAuto(new ItemStack(ModItems.laser_crystal_bismuth, 1), new Object[] {"QUQ", "BCB", "QTQ", 'Q', ModBlocks.glass_quartz, 'U', U.ingot(), 'T', TH232.ingot(), 'B', ModItems.nugget_bismuth, 'C', ModItems.crystal_rare }); + addRecipeAuto(new ItemStack(ModItems.laser_crystal_cmb, 1), new Object[] {"QBQ", "CSC", "QBQ", 'Q', ModBlocks.glass_quartz, 'B', CMB.ingot(), 'C', SBD.ingot(), 'S', ModItems.cell_anti_schrabidium }); + addRecipeAuto(new ItemStack(ModItems.laser_crystal_dnt, 1), new Object[] {"QDQ", "SBS", "QDQ", 'Q', ModBlocks.glass_quartz, 'D', DNT.ingot(), 'B', ModItems.egg_balefire, 'S', ModItems.powder_spark_mix }); + addRecipeAuto(new ItemStack(ModItems.laser_crystal_digamma, 1), new Object[] {"QUQ", "UEU", "QUQ", 'Q', ModBlocks.glass_quartz, 'U', ModItems.undefined, 'E', ModItems.ingot_electronium } ); Item[] bricks = new Item[] {Items.brick, Items.netherbrick}; diff --git a/src/main/java/com/hbm/render/tileentity/RenderFEL.java b/src/main/java/com/hbm/render/tileentity/RenderFEL.java index 00b8c928d..9d888457f 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderFEL.java +++ b/src/main/java/com/hbm/render/tileentity/RenderFEL.java @@ -5,6 +5,7 @@ import java.awt.Color; import org.lwjgl.opengl.GL11; import com.hbm.blocks.BlockDummyable; +import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths; import com.hbm.main.ResourceManager; import com.hbm.render.util.BeamPronter; import com.hbm.render.util.BeamPronter.EnumBeamType; @@ -38,23 +39,20 @@ public class RenderFEL extends TileEntitySpecialRenderer { GL11.glShadeModel(GL11.GL_FLAT); TileEntityFEL fel = (TileEntityFEL) tileEntity; - int color = 0xff0000; + int color = 0xffffff; - switch(fel.mode) { - case 0: color = 0x303000; break; - case 1: color = 0xFF1010; break; - case 2: color = Color.HSBtoRGB(fel.getWorldObj().getTotalWorldTime() / 50.0F, 1F, 0.3F) & 16777215; break; - case 3: color = 0x150560; break; - case 4: color = 0x054005; break; - case 5: color = 0x156015; break; + if(fel.mode.renderedBeamColor == 0) { + color = Color.HSBtoRGB(fel.getWorldObj().getTotalWorldTime() / 50.0F, 0.5F, 0.1F) & 16777215; + } else { + color = fel.mode.renderedBeamColor; + } + int length = fel.distance - 3; + GL11.glTranslated(0, 1.5, -1.5); + if(fel.power > fel.powerReq * Math.pow(2, fel.mode.ordinal()) && fel.isOn && !(fel.mode == EnumWavelengths.NULL) && length > 0) { + 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); } - int length = 25; - - 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(); } -} +} \ No newline at end of file diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityFEL.java b/src/main/java/com/hbm/tileentity/machine/TileEntityFEL.java index 23ed1f571..53e8ae51e 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityFEL.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityFEL.java @@ -1,29 +1,59 @@ package com.hbm.tileentity.machine; +import java.util.ArrayList; +import java.util.List; + import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.BlockHazard; +import com.hbm.blocks.generic.BlockHazardFalling; +import com.hbm.blocks.machine.MachineSILEX; +import com.hbm.extprop.HbmLivingProps; +import com.hbm.handler.radiation.ChunkRadiationManager; +import com.hbm.interfaces.Spaghetti; +import com.hbm.items.machine.ItemFELCrystal; +import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths; import com.hbm.lib.Library; +import com.hbm.main.MainRegistry; +import com.hbm.packet.AuxElectricityPacket; +import com.hbm.packet.PacketDispatcher; import com.hbm.tileentity.TileEntityMachineBase; +import api.hbm.energy.IEnergyUser; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; +import net.minecraft.block.BlockTNT; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityFEL extends TileEntityMachineBase { +public class TileEntityFEL extends TileEntityMachineBase implements IEnergyUser { public long power; - public static final long maxPower = 1000000; - public int watts; - public int mode = 0; + public static final long maxPower = 20000000; + public static final int powerReq = 1250; + public EnumWavelengths mode = EnumWavelengths.NULL; public boolean isOn; + public boolean missingValidSilex = true ; + public int distance; + public List entities = new ArrayList(); + public TileEntityFEL() { - super(1); + super(2); } @Override @@ -32,70 +62,146 @@ public class TileEntityFEL extends TileEntityMachineBase { } @Override + @Spaghetti ("What the fuck were you thinking") public void updateEntity() { if(!worldObj.isRemote) { + //this.trySubscribe(world, x, y, z, dir); TODO this.power = Library.chargeTEFromItems(slots, 0, power, maxPower); - int range = 50; - ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset); - int length = 5; + if(this.isOn && !(this.slots[1] == null)) { + + if(this.slots[1].getItem() instanceof ItemFELCrystal) { + + ItemFELCrystal crystal = (ItemFELCrystal) this.slots[1].getItem(); + this.mode = crystal.wavelength; + + } else { this.mode = EnumWavelengths.NULL; } + + } else { this.mode = EnumWavelengths.NULL; } - for(int i = 5; i < range; i++) { + int range = 24; + ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset); + int length = 3; + boolean silexSpacing = false; + if(this.isOn && power >= powerReq * Math.pow(3, mode.ordinal()) && this.mode != EnumWavelengths.NULL) { - length = i; - - int x = xCoord + dir.offsetX * i; - int y = yCoord + 1; - int z = zCoord + dir.offsetZ * i; + int distance = this.distance-1; + double blx = Math.min(xCoord, xCoord + dir.offsetX * distance) + 0.2; + double bux = Math.max(xCoord, xCoord + dir.offsetX * distance) + 0.8; + double bly = Math.min(yCoord, 1 + yCoord + dir.offsetY * distance) + 0.2; + double buy = Math.max(yCoord, 1 + yCoord + dir.offsetY * distance) + 0.8; + double blz = Math.min(zCoord, zCoord + dir.offsetZ * distance) + 0.2; + double buz = Math.max(zCoord, zCoord + dir.offsetZ * distance) + 0.8; - Block b = worldObj.getBlock(x, y, z); + List list = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(blx, bly, blz, bux, buy, buz)); - if(b.getMaterial().isOpaque()) - continue; - - if(b == ModBlocks.machine_silex) { - - TileEntity te = worldObj.getTileEntity(x + dir.offsetX, yCoord, z + dir.offsetZ); - - if(te instanceof TileEntitySILEX) { - TileEntitySILEX silex = (TileEntitySILEX) te; - silex.laser += this.watts; + for(EntityLivingBase entity : list) { + switch(this.mode) { + case VISIBLE: entity.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 60 * 65536, 0)); + case IR: + case UV: entity.setFire(65535); break; + case GAMMA: HbmLivingProps.incrementRadiation(entity, 25); break; + case DRX: HbmLivingProps.incrementDigamma(entity, 0.1F); break; } } - break; + power -= powerReq * ((mode.ordinal() == 0) ? 0 : Math.pow(3, mode.ordinal())); + for(int i = 3; i < range; i++) { + + length = i; + + int x = xCoord + dir.offsetX * i; + int y = yCoord + 1; + int z = zCoord + dir.offsetZ * i; + + Block b = worldObj.getBlock(x, y, z); + + if(!(b.getMaterial().isOpaque()) && b != Blocks.tnt) { + this.distance = range; + silexSpacing = false; + continue; + } + + if(b == ModBlocks.machine_silex) { + + TileEntity te = worldObj.getTileEntity(x + dir.offsetX, yCoord, z + dir.offsetZ); + + if(te instanceof TileEntitySILEX) { + TileEntitySILEX silex = (TileEntitySILEX) te; + int meta = silex.getBlockMetadata() - BlockDummyable.offset; + if(rotationIsValid(meta, this.getBlockMetadata() - BlockDummyable.offset) && i >= 5 && silexSpacing == false ) { + if(silex.mode != this.mode) { + silex.mode = this.mode; + this.missingValidSilex = false; + silexSpacing = true; + continue; + } + } else { + MachineSILEX silexBlock = (MachineSILEX)silex.getBlockType(); + silexBlock.breakBlock(worldObj, silex.xCoord, silex.yCoord, silex.zCoord, silexBlock, 0); + worldObj.spawnEntityInWorld(new EntityItem(worldObj, x + 0.5, y + 0.5, z + 0.5, new ItemStack(Item.getItemFromBlock(ModBlocks.machine_silex)))); + } + } + + } else if(b.getMaterial().isOpaque() || b == Blocks.tnt) { + + this.distance = i; + + if(b.getMaterial().isLiquid()) { + worldObj.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "random.fizz", 1.0F, 1.0F); + worldObj.setBlockToAir(x, y, z); + break; + } + + float hardness = b.getExplosionResistance(null); + if(hardness < 2400 && worldObj.rand.nextInt(5) == 0) { + worldObj.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "random.fizz", 1.0F, 1.0F); + Block block = (this.mode != EnumWavelengths.DRX) ? Blocks.fire : (MainRegistry.polaroidID == 11) ? ModBlocks.digamma_matter : ModBlocks.fire_digamma; + worldObj.setBlock(x, y, z, block); + if(this.mode == EnumWavelengths.DRX) + worldObj.setBlock(x, y-1, z, ModBlocks.ash_digamma); + } + break; + } + } } NBTTagCompound data = new NBTTagCompound(); data.setLong("power", power); - data.setByte("mode", (byte)mode); - data.setByte("watts", (byte)watts); + data.setString("mode", mode.toString()); data.setBoolean("isOn", isOn); + data.setBoolean("valid", missingValidSilex); + data.setInteger("distance", distance); this.networkPack(data, 250); + + PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); } } + + public boolean rotationIsValid(int silexMeta, int felMeta) { + ForgeDirection silexDir = ForgeDirection.getOrientation(silexMeta); + ForgeDirection felDir = ForgeDirection.getOrientation(felMeta); + if(silexDir == felDir || silexDir == felDir.getOpposite()) { + return true; + } + + return false; + } @Override public void networkUnpack(NBTTagCompound nbt) { this.power = nbt.getLong("power"); - this.mode = nbt.getByte("mode"); - this.watts = nbt.getByte("watts"); + this.mode = EnumWavelengths.valueOf(nbt.getString("mode")); this.isOn = nbt.getBoolean("isOn"); + this.distance = nbt.getInteger("distance"); + this.missingValidSilex = nbt.getBoolean("valid"); } @Override public void handleButtonPacket(int value, int meta) { - if(meta == 0) { - this.mode = Math.abs(value) % 6; - } - - if(meta == 1){ - this.watts = MathHelper.clamp_int(value, 1, 100); - } - if(meta == 2){ this.isOn = !this.isOn; } @@ -105,18 +211,15 @@ public class TileEntityFEL extends TileEntityMachineBase { return (power * i) / maxPower; } - public int getWattsScaled(int i) { - return (watts * i) / 100; - } - @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); power = nbt.getLong("power"); - watts = nbt.getInteger("watts"); - mode = nbt.getInteger("mode"); + mode = EnumWavelengths.valueOf(nbt.getString("mode")); isOn = nbt.getBoolean("isOn"); + missingValidSilex = nbt.getBoolean("valid"); + distance = nbt.getInteger("distance"); } @Override @@ -124,21 +227,15 @@ public class TileEntityFEL extends TileEntityMachineBase { super.writeToNBT(nbt); nbt.setLong("power", power); - nbt.setInteger("watts", watts); - nbt.setInteger("mode", mode); + nbt.setString("mode", mode.toString()); nbt.setBoolean("isOn", isOn); + nbt.setBoolean("valid", missingValidSilex); + nbt.setInteger("distance", distance); } @Override public AxisAlignedBB getRenderBoundingBox() { - return AxisAlignedBB.getBoundingBox( - xCoord - 4, - yCoord, - zCoord - 4, - xCoord + 5, - yCoord + 3, - zCoord + 5 - ); + return INFINITE_EXTENT_AABB; } @Override @@ -146,4 +243,19 @@ public class TileEntityFEL extends TileEntityMachineBase { public double getMaxRenderDistanceSquared() { return 65536.0D; } -} + + @Override + public void setPower(long i) { + power = i; + } + + @Override + public long getPower() { + return power; + } + + @Override + public long getMaxPower() { + return maxPower; + } +} \ No newline at end of file diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntitySILEX.java b/src/main/java/com/hbm/tileentity/machine/TileEntitySILEX.java index c9db1e9ed..4b4ce9600 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntitySILEX.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntitySILEX.java @@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.recipes.SILEXRecipes; import com.hbm.inventory.recipes.SILEXRecipes.SILEXRecipe; import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths; import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.util.InventoryUtil; import com.hbm.util.WeightedRandomObject; @@ -25,20 +26,21 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.WeightedRandom; public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcceptor { - - public int laser = 0; + + public EnumWavelengths mode = EnumWavelengths.NULL; + public boolean hasLaser; public FluidTank tank; public ComparableStack current; public int currentFill; public static final int maxFill = 16000; public int progress; public final int processTime = 100; - - //0: Input - //1: Fluid ID - //2-3: Fluid Containers - //4: Output - //5-10: Queue + + // 0: Input + // 1: Fluid ID + // 2-3: Fluid Containers + // 4: Output + // 5-10: Queue public TileEntitySILEX() { super(11); @@ -52,28 +54,29 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce @Override public void updateEntity() { - + if(!worldObj.isRemote) { tank.setType(1, 1, slots); tank.loadTank(2, 3, slots); - + loadFluid(); - + if(!process()) { this.progress = 0; } - + dequeue(); - + if(currentFill <= 0) { current = null; } - + NBTTagCompound data = new NBTTagCompound(); data.setInteger("fill", currentFill); data.setInteger("progress", progress); - + data.setString("mode", mode.toString()); + if(this.current != null) { data.setInteger("item", Item.getIdFromItem(this.current.item)); data.setInteger("meta", this.current.meta); @@ -81,85 +84,88 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId); this.networkPack(data, 50); + + this.mode = EnumWavelengths.NULL; } } - + public void networkUnpack(NBTTagCompound nbt) { - + this.currentFill = nbt.getInteger("fill"); this.progress = nbt.getInteger("progress"); - + this.mode = EnumWavelengths.valueOf(nbt.getString("mode")); + if(this.currentFill > 0) { this.current = new ComparableStack(Item.getItemById(nbt.getInteger("item")), 1, nbt.getInteger("meta")); - + } else { this.current = null; } } - + public void handleButtonPacket(int value, int meta) { - + this.currentFill = 0; this.current = null; } - + public int getProgressScaled(int i) { return (progress * i) / processTime; } - + public int getFluidScaled(int i) { return (tank.getFill() * i) / tank.getMaxFill(); } - + public int getFillScaled(int i) { return (currentFill * i) / maxFill; } - + public static final HashMap fluidConversion = new HashMap(); - + static { putFluid(Fluids.UF6); putFluid(Fluids.PUF6); putFluid(Fluids.DEATH); } - + private static void putFluid(FluidType fluid) { fluidConversion.put(fluid, new ComparableStack(ModItems.fluid_icon, 1, fluid.getID())); } - + int loadDelay; - + public void loadFluid() { - + ComparableStack conv = fluidConversion.get(tank.getTankType()); - + if(conv != null) { - + if(currentFill == 0) { current = (ComparableStack) conv.copy(); } - + if(current != null && current.equals(conv)) { - + int toFill = Math.min(10, Math.min(maxFill - currentFill, tank.getFill())); currentFill += toFill; tank.setFill(tank.getFill() - toFill); } } - + loadDelay++; - + if(loadDelay > 20) loadDelay = 0; - + if(loadDelay == 0 && slots[0] != null && tank.getTankType() == Fluids.ACID && (this.current == null || this.current.equals(new ComparableStack(slots[0]).makeSingular()))) { SILEXRecipe recipe = SILEXRecipes.getOutput(slots[0]); - + if(recipe == null) return; - + int load = recipe.fluidProduced; - + if(load <= this.maxFill - this.currentFill && load <= tank.getFill()) { this.currentFill += load; this.current = new ComparableStack(slots[0]).makeSingular(); @@ -168,53 +174,58 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce } } } - + private boolean process() { - + if(current == null || currentFill <= 0) return false; - + SILEXRecipe recipe = SILEXRecipes.getOutput(current.toStack()); - + if(recipe == null) return false; - + + if(recipe.laserStrength > this.mode.ordinal()) + return false; + if(currentFill < recipe.fluidConsumed) return false; - + if(slots[4] != null) return false; - - progress++; - + + int progressSpeed = (int) Math.pow(2, this.mode.ordinal() - recipe.laserStrength + 1) / 2; + + progress += progressSpeed; + if(progress >= processTime) { - + currentFill -= recipe.fluidConsumed; - - ItemStack out = ((WeightedRandomObject)WeightedRandom.getRandomItem(worldObj.rand, recipe.outputs)).asStack(); + + ItemStack out = ((WeightedRandomObject) WeightedRandom.getRandomItem(worldObj.rand, recipe.outputs)).asStack(); slots[4] = out.copy(); progress = 0; this.markDirty(); } - + return true; } - + private void dequeue() { - + if(slots[4] != null) { - + for(int i = 5; i < 11; i++) { - + if(slots[i] != null && slots[i].stackSize < slots[i].getMaxStackSize() && InventoryUtil.doesStackDataMatch(slots[4], slots[i])) { slots[i].stackSize++; this.decrStackSize(4, 1); return; } } - + for(int i = 5; i < 11; i++) { - + if(slots[i] == null) { slots[i] = slots[4].copy(); slots[4] = null; @@ -231,9 +242,10 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce @Override public boolean isItemValidForSlot(int i, ItemStack itemStack) { - - if(i == 0) return SILEXRecipes.getOutput(itemStack) != null; - + + if(i == 0) + return SILEXRecipes.getOutput(itemStack) != null; + return false; } @@ -241,46 +253,40 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce public boolean canExtractItem(int slot, ItemStack itemStack, int side) { return slot >= 5; } - + @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); this.tank.readFromNBT(nbt, "tank"); this.currentFill = nbt.getInteger("fill"); - + this.mode = EnumWavelengths.valueOf(nbt.getString("mode")); + if(this.currentFill > 0) { this.current = new ComparableStack(Item.getItemById(nbt.getInteger("item")), 1, nbt.getInteger("meta")); } } - + @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); this.tank.writeToNBT(nbt, "tank"); nbt.setInteger("fill", this.currentFill); - + nbt.setString("mode", mode.toString()); + if(this.current != null) { nbt.setInteger("item", Item.getIdFromItem(this.current.item)); nbt.setInteger("meta", this.current.meta); } } - + @Override public AxisAlignedBB getRenderBoundingBox() { - return AxisAlignedBB.getBoundingBox( - xCoord - 1, - yCoord, - zCoord - 1, - xCoord + 2, - yCoord + 3, - zCoord + 2 - ); + return AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 3, zCoord + 2); } - + @Override @SideOnly(Side.CLIENT) - public double getMaxRenderDistanceSquared() - { + public double getMaxRenderDistanceSquared() { return 65536.0D; } @@ -291,7 +297,7 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce @Override public void setFluidFill(int fill, FluidType type) { - + if(type == tank.getTankType()) tank.setFill(fill); } @@ -303,24 +309,28 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce @Override public List getTanks() { - return new ArrayList() {{ add(tank); }}; + return new ArrayList() { + { + add(tank); + } + }; } @Override public int getFluidFill(FluidType type) { - + if(type == tank.getTankType()) return tank.getFill(); - + return 0; } @Override public int getMaxFluidFill(FluidType type) { - + if(type == tank.getTankType()) return tank.getMaxFill(); - + return 0; } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/hbm/textures/gui/machine/gui_fel.png b/src/main/resources/assets/hbm/textures/gui/machine/gui_fel.png index 25c4533d368cefeb9382f1133053baabf5c73966..db573b1a71877d12f9c68d28f763ba5f2b1f90eb 100644 GIT binary patch literal 7311 zcmdsc`9GB38}~hykliFy%-GAW6j8>Y@UcY6(qJf&7^3XPz7wJ>NfavUSRz@*F!nv! zx3Ps7*=H<+XIj3$Jg?_3cz&2O=iFyr*E!ewy584$-)Eu>4YXKKo;e8s0IQC+=4}7~ zQM(|3@dWkD!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ew{&ye^ip@baO(*;oNzi`b2KRBUsIspN&o-= diff --git a/src/main/resources/assets/hbm/textures/gui/nei/gui_nei_silex.png b/src/main/resources/assets/hbm/textures/gui/nei/gui_nei_silex.png index 81879d81de6ff69fae66a43908d3af7afca72f5b..c31ef6de62e0137224c6bb33a09239903928d381 100644 GIT binary patch literal 797 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5D>38$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&eBzIuR9h%1o(|NsB7W5+^6Lk$cJ92^`%LP8`=#WON8Bpt=g&CR>JyFqFc zsyu)cZ%L3}Fi<@lFxb9OY6D7e7I;J!GcfQS0Aa?gYn_}73`}XBE{-7;ac^%Q^t)rg z!1j=#)ye$*|2+;folj3J)rmGP{;3?+b*BB{vBG)B?dCqVKKD3rzMgu#< zuvXkzx_tRVruhteYMYrj6d2Cgu3-St_x3q5#;|%1@63XWvIW-DRd#W<%r;%-BpgZTpK3qavLd+yzS#=!ij<9eCs0W($u z#s}xW=hbX*3TDW=AN8_n4ZFe5Djg1k@C4U}l}z4DXG9`|6BZp<#PFFVjN!rR|Hsp( zZ`V1X)0pQ_&peIgL8VhR(+7*is*Dx0E_E^3oXK=#C<`)X$cz6!>w`bgRAYu|dJPOr z5AGc1QUK9!r9~VV7z^GdvI+p{58rq}!WQ2*0KL_~Q1P1$Bn)&fBTE9iMSuVGcb8ci zo*&#@p7G=Rf6fmdvp4w0x69pRU4LgaLqsm)hFeStTUifeaW`BQV_2=r5Ejj_X4{C8 dn9Mxqx%F}WD;F0uz6GUz22WQ%mvv4FO#mLLF!BHZ literal 756 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G$6%N?Bp530R%N1DIE+9OshRz z978JRyuEud^KpPc+r^z~p^>>O1e<>aD6VoYiad2#Z4D=9+=hJau2pw)GJ;u-THrybM{&oDO<=WLI~XJX68``~9=o{vEXF z3k@~(4W2srfZFuq?9=2o#q6u+`Vh^@z#`1Rp~fKK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t_3_SE>jv&1DpzSJG9 zH@uh(tzlozFa%+lG5-h*vX5_NcX4;OM(~gJf7Ub`58kP~|1R;^;ajz%ug|{v4UJ~4 z3)nn$5KVr5Q>BK0L`mFLryS**-Ha+(Q`tU(f)65FrZB6`2~c;1VE6R(c|d7VI~vaV zY)mdFsiQ1-jm}0MpO@j*G4SW-EIc9Jrzh3CK|-Qy?E2#7 zQYv%c?$)}c#XD(94pS(S#l;a&((#?vg@P;=C!4jpdbzl0G@+t?IpfYn9i9|Gcxcty z@}f=F8OIAbArPr$<2%Jx``I@d`}+EZ$~~;!=+p7x5ixU!CwC0Rt1~}-tbuCXyY>iu zqk6xDLiqqyS8I8!rNy=xtzMwsvZ0LalQ8HJZPzI<5qk^ep}#_AwpPqRV}Mc-hrG4w zpJk_r{rE8~JUsgRm1{$rL%Y}ddB=~yef0D?=W-MFEFld`!~~7HKQQBH_UaFnCJYD- zeg1|D*jv~^=1d(wb`lQ4k{2)_ToBsylq|qbL<33P25x@ey9nY#CakLGXiaZlEtlO} z{KPM9_3OBXaYqo_{%f&OUpgBk!Ojc_#t`mMZXv9}+BP(^C4I&D66HlH^T(Dj1!27a)#WH#NVH zy@D&fbzYLp!UjEkRC&Co;Ej7g*;&fm^v(8s0fhm^xzk#(5fjqnNoqh0;mk+b(0xj43bm#`mC{N_C{}(S(FY579E5n{c11#xSMix*cW8Nweqf>-nN^JyjUo}*}h$=+kE2q@=K k*_qpg{w4e$kBnP;0(lfgpBc@Eeg~%78u~X%)b2g~FPLA^?EnA( diff --git a/src/main/resources/assets/hbm/textures/items/laser_crystal_bismuth.png b/src/main/resources/assets/hbm/textures/items/laser_crystal_bismuth.png new file mode 100644 index 0000000000000000000000000000000000000000..f35669dc643db645fbed7418115454825053396d GIT binary patch literal 483 zcmV<90UZ8`P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0eDG7K~y+T?UGF> z!*LkLKYuTq*Uh%P6o(1rHA>;2xR8rDD=7yql9P*)gO?*mJ2-eNvkkks7S%~FU5rLC1hUbB*(7)|W6ghG}O zDGFTj0~L*R^mmW(B&qP)ZJ{1~CNoVPG_$lM6~`m&9bDtS4}+`AZ|8sJ^+t61U;p6G Z124?ljSc-U8?OKW002ovPDHLkV1g+O(<1-? literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/items/laser_crystal_cmb.png b/src/main/resources/assets/hbm/textures/items/laser_crystal_cmb.png new file mode 100644 index 0000000000000000000000000000000000000000..d66693130e3d25494dff827a60f75ac5467b8bf2 GIT binary patch literal 462 zcmV;<0WtoGP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0b@x-K~y+T?UGL@ z!(kZ5KSQ==HvcwknnqYC{SGUK9gwrgRZ`+0yC}CMQj{wPDK2i}=NA$0jO_?aI-JffFlgA` zJ%rdZ`1il{mlPD|mK4_F9OdXehsWcIhgL*CD zbOx;Tg)w&_&{sf44e36)ky#p^h)R+6u3h>~tLL6GY`u08nH0v_hj6bQ(GB9>@4BzLj}+%R>C7s4F%2 zqRu8zSAk|3_N71s40S|KQI9@3-P|4sttEn*aa+07*qoM6N<$ Ef)N_XT>t<8 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/items/laser_crystal_co2.png b/src/main/resources/assets/hbm/textures/items/laser_crystal_co2.png new file mode 100644 index 0000000000000000000000000000000000000000..dbf44374ca0d8b8a00978e0a58f4800edd463bb6 GIT binary patch literal 305 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}Z0G|-ocjktl3v(BO>_%)r2R7=#&* z=dVZs3MP5FIEH8hFYR>{YEa;CWjt(hrsKD~*`<<;%UpG4{J&Sjw&D680R!jz4IWpL zk2i1^2PYV|nOZ*AHSTnD@nPI(@IEhMk7M6bu_rYh=6`yYtje;LJuWV|mbZP!RpGW7 cpHmdKI;Vst0D$pyAOHXW literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/items/laser_crystal_digamma.png b/src/main/resources/assets/hbm/textures/items/laser_crystal_digamma.png new file mode 100644 index 0000000000000000000000000000000000000000..6a2397cb457ea9880a62c1a3d184c32ab5af49e6 GIT binary patch literal 485 zcmeAS@N?(olHy`uVBq!ia0vp^0ziC#gBeI#2@BT%DaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheu>n3Iu8xL=6}h>53=IFfJ9Be$U%q_#iG@L!fkB*^c~WQRy5-CN&z|`| zKNqO{2@As+W(FY!2B6-BGiQGL|LgSW(~m#B+QtmB_y3vGfByfiVPcrV#PHw3)P@nL zgW;Q~Zo74o z(=ht_*?$+pUR7KQk~p1p?!52qudj;sW@_@5aGZP3f3@6tEpN$z>_a^MOWVY!B#Ikr zneH-TaEMS7*s2ln^W)-83nW^)6eNV?E>7S)!^`Nv+xR%xIfmUZB`P_uW-8O?~c|)V#zO!A literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/items/laser_crystal_digamma.png.mcmeta b/src/main/resources/assets/hbm/textures/items/laser_crystal_digamma.png.mcmeta new file mode 100644 index 000000000..d7b41bbd3 --- /dev/null +++ b/src/main/resources/assets/hbm/textures/items/laser_crystal_digamma.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": { } +} diff --git a/src/main/resources/assets/hbm/textures/items/laser_crystal_dnt.png b/src/main/resources/assets/hbm/textures/items/laser_crystal_dnt.png new file mode 100644 index 0000000000000000000000000000000000000000..410f475ac78d9a4be075f72deb806a3bdfdc7030 GIT binary patch literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%Lhh0G|+7Ps1s7xtm29LZ^2geDm^)3`0pI!z4xKnvKgZE}eO*h+%gc!}3ao zW0M)$jTrQvp8giiFm)xv?7a+YPcZCYXOOjHNPCuh=McjtIR-;7hRQ02!gPkXJErG> z#s~h>JO`xYN`m}?|KkG;ZzN>mfGRl)JR*x382Ao@Fyrz36)8Z$Y)==*5RKraz21Bc z3OuZu8X8I~8sxWp-@lB-Mc7=gru*61C7GQ2J~>a={lt?& Date: Fri, 28 Jan 2022 10:43:58 +0100 Subject: [PATCH 3/4] pheo's ivy mike GUI, det cord is now cord shaped, as the name implies --- src/main/java/com/hbm/blocks/ModBlocks.java | 6 +- .../java/com/hbm/blocks/bomb/DetCord.java | 148 +++++++----------- .../com/hbm/blocks/bomb/ExplosiveCharge.java | 93 +++++++++++ .../com/hbm/blocks/bomb/IDetConnectible.java | 21 +++ .../container/ContainerNukeMike.java | 73 ++++----- .../com/hbm/inventory/gui/GUINukeMike.java | 31 +++- src/main/java/com/hbm/main/ClientProxy.java | 1 + src/main/java/com/hbm/main/MainRegistry.java | 3 + .../com/hbm/render/block/RenderDetCord.java | 96 ++++++++++++ .../assets/hbm/textures/blocks/det_cord.png | Bin 191 -> 183 bytes .../textures/gui/weapon/ivyMikeSchematic.png | Bin 2736 -> 16860 bytes 11 files changed, 334 insertions(+), 138 deletions(-) create mode 100644 src/main/java/com/hbm/blocks/bomb/ExplosiveCharge.java create mode 100644 src/main/java/com/hbm/blocks/bomb/IDetConnectible.java create mode 100644 src/main/java/com/hbm/render/block/RenderDetCord.java diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 409fed4a8..2c6b7aa5c 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -1672,9 +1672,9 @@ public class ModBlocks { therm_endo = new BombThermo(Material.iron).setBlockName("therm_endo").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F); therm_exo = new BombThermo(Material.iron).setBlockName("therm_exo").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F); emp_bomb = new BombFloat(Material.iron).setBlockName("emp_bomb").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F); - det_cord = new DetCord(Material.iron).setBlockName("det_cord").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_cord"); - det_charge = new DetCord(Material.iron).setBlockName("det_charge").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_charge"); - det_nuke = new DetCord(Material.iron).setBlockName("det_nuke").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_nuke"); + det_cord = new ExplosiveCharge(Material.iron).setBlockName("det_cord").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_cord"); + det_charge = new ExplosiveCharge(Material.iron).setBlockName("det_charge").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_charge"); + det_nuke = new ExplosiveCharge(Material.iron).setBlockName("det_nuke").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_nuke"); det_miner = new DetMiner(Material.iron, RefStrings.MODID + ":det_miner_top").setBlockName("det_miner").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_miner_side"); red_barrel = new RedBarrel(Material.iron).setBlockName("red_barrel").setCreativeTab(MainRegistry.nukeTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":barrel_red"); pink_barrel = new RedBarrel(Material.iron).setBlockName("pink_barrel").setCreativeTab(MainRegistry.nukeTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":barrel_pink"); diff --git a/src/main/java/com/hbm/blocks/bomb/DetCord.java b/src/main/java/com/hbm/blocks/bomb/DetCord.java index 152e55d33..129580a30 100644 --- a/src/main/java/com/hbm/blocks/bomb/DetCord.java +++ b/src/main/java/com/hbm/blocks/bomb/DetCord.java @@ -1,88 +1,60 @@ -package com.hbm.blocks.bomb; - -import com.hbm.blocks.ModBlocks; -import com.hbm.config.BombConfig; -import com.hbm.entity.effect.EntityNukeCloudSmall; -import com.hbm.entity.logic.EntityNukeExplosionMK4; -import com.hbm.explosion.ExplosionLarge; -import com.hbm.explosion.ExplosionNT; -import com.hbm.interfaces.IBomb; -import com.hbm.lib.RefStrings; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.Explosion; -import net.minecraft.world.World; - -public class DetCord extends Block implements IBomb { - - @SideOnly(Side.CLIENT) - private IIcon iconTop; - - public DetCord(Material p_i45394_1_) { - super(p_i45394_1_); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconRegister) { - - super.registerBlockIcons(iconRegister); - - this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":det_nuke_top"); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int metadata) { - - if(this != ModBlocks.det_nuke) - return this.blockIcon; - - return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); - } - - @Override - public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion p_149723_5_) { - this.explode(world, x, y, z); - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) { - if(world.isBlockIndirectlyGettingPowered(x, y, z)) { - this.explode(world, x, y, z); - } - } - - @Override - public BombReturnCode explode(World world, int x, int y, int z) { - - if(!world.isRemote) { - world.setBlock(x, y, z, Blocks.air); - if(this == ModBlocks.det_cord) { - world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 1.5F, true); - } - if(this == ModBlocks.det_charge) { - new ExplosionNT(world, null, x + 0.5, y + 0.5, z + 0.5, 15).overrideResolution(64).explode(); - ExplosionLarge.spawnParticles(world, x, y, z, ExplosionLarge.cloudFunction(15)); - } - if(this == ModBlocks.det_nuke) { - world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5)); - - EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, BombConfig.missileRadius * 0.005F); - entity2.posX = x; - entity2.posY = y; - entity2.posZ = z; - world.spawnEntityInWorld(entity2); - } - } - - return BombReturnCode.DETONATED; - } - -} +package com.hbm.blocks.bomb; + +import com.hbm.blocks.ModBlocks; +import com.hbm.interfaces.IBomb.BombReturnCode; + +import cpw.mods.fml.client.registry.RenderingRegistry; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class DetCord extends Block implements IDetConnectible { + + protected DetCord(Material p_i45394_1_) { + super(p_i45394_1_); + } + + public static int renderID = RenderingRegistry.getNextAvailableRenderId(); + + @Override + public int getRenderType() { + return renderID; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion p_149723_5_) { + this.explode(world, x, y, z); + } + + @Override + public boolean canDropFromExplosion(Explosion explosion) { + return false; + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) { + if(world.isBlockIndirectlyGettingPowered(x, y, z)) { + this.explode(world, x, y, z); + } + } + + public void explode(World world, int x, int y, int z) { + + if(!world.isRemote) { + world.setBlock(x, y, z, Blocks.air); + world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 1.5F, true); + } + } +} diff --git a/src/main/java/com/hbm/blocks/bomb/ExplosiveCharge.java b/src/main/java/com/hbm/blocks/bomb/ExplosiveCharge.java new file mode 100644 index 000000000..56925c285 --- /dev/null +++ b/src/main/java/com/hbm/blocks/bomb/ExplosiveCharge.java @@ -0,0 +1,93 @@ +package com.hbm.blocks.bomb; + +import com.hbm.blocks.ModBlocks; +import com.hbm.config.BombConfig; +import com.hbm.entity.effect.EntityNukeCloudSmall; +import com.hbm.entity.logic.EntityNukeExplosionMK4; +import com.hbm.explosion.ExplosionLarge; +import com.hbm.explosion.ExplosionNT; +import com.hbm.interfaces.IBomb; +import com.hbm.lib.RefStrings; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class ExplosiveCharge extends Block implements IBomb, IDetConnectible { + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + public ExplosiveCharge(Material p_i45394_1_) { + super(p_i45394_1_); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + + super.registerBlockIcons(iconRegister); + + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":det_nuke_top"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + + if(this != ModBlocks.det_nuke) + return this.blockIcon; + + return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); + } + + @Override + public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion p_149723_5_) { + this.explode(world, x, y, z); + } + + @Override + public boolean canDropFromExplosion(Explosion explosion) { + return false; + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) { + if(world.isBlockIndirectlyGettingPowered(x, y, z)) { + this.explode(world, x, y, z); + } + } + + @Override + public BombReturnCode explode(World world, int x, int y, int z) { + + if(!world.isRemote) { + world.setBlock(x, y, z, Blocks.air); + if(this == ModBlocks.det_cord) { + world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 1.5F, true); + } + if(this == ModBlocks.det_charge) { + new ExplosionNT(world, null, x + 0.5, y + 0.5, z + 0.5, 15).overrideResolution(64).explode(); + ExplosionLarge.spawnParticles(world, x, y, z, ExplosionLarge.cloudFunction(15)); + } + if(this == ModBlocks.det_nuke) { + world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5)); + + EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, BombConfig.missileRadius * 0.005F); + entity2.posX = x; + entity2.posY = y; + entity2.posZ = z; + world.spawnEntityInWorld(entity2); + } + } + + return BombReturnCode.DETONATED; + } + +} diff --git a/src/main/java/com/hbm/blocks/bomb/IDetConnectible.java b/src/main/java/com/hbm/blocks/bomb/IDetConnectible.java new file mode 100644 index 000000000..9c0a63e86 --- /dev/null +++ b/src/main/java/com/hbm/blocks/bomb/IDetConnectible.java @@ -0,0 +1,21 @@ +package com.hbm.blocks.bomb; + +import net.minecraft.block.Block; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public interface IDetConnectible { + + public default boolean canConnectToDetCord(IBlockAccess world, int x, int y, int z, ForgeDirection dir) { + return true; + } + + public static boolean isConnectible(IBlockAccess world, int x, int y, int z, ForgeDirection dir) { + Block b = world.getBlock(x, y, z); + if(b instanceof IDetConnectible) { + return ((IDetConnectible)b).canConnectToDetCord(world, x, y, z, dir); + } + return false; + } +} diff --git a/src/main/java/com/hbm/inventory/container/ContainerNukeMike.java b/src/main/java/com/hbm/inventory/container/ContainerNukeMike.java index dc5ce78f9..6520eb428 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerNukeMike.java +++ b/src/main/java/com/hbm/inventory/container/ContainerNukeMike.java @@ -10,71 +10,62 @@ import net.minecraft.item.ItemStack; public class ContainerNukeMike extends Container { -private TileEntityNukeMike nukeMike; - + private TileEntityNukeMike nukeMike; + public ContainerNukeMike(InventoryPlayer invPlayer, TileEntityNukeMike tedf) { - + nukeMike = tedf; - - this.addSlotToContainer(new Slot(tedf, 0, 26, 17)); - this.addSlotToContainer(new Slot(tedf, 1, 62, 17)); - this.addSlotToContainer(new Slot(tedf, 2, 26, 53)); - this.addSlotToContainer(new Slot(tedf, 3, 62, 53)); - this.addSlotToContainer(new Slot(tedf, 4, 44, 35)); - this.addSlotToContainer(new Slot(tedf, 5, 80, 35)); - this.addSlotToContainer(new Slot(tedf, 6, 98, 35)); - this.addSlotToContainer(new Slot(tedf, 7, 116, 35)); - - 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)); + + this.addSlotToContainer(new Slot(tedf, 0, 26, 83)); + this.addSlotToContainer(new Slot(tedf, 1, 26, 101)); + this.addSlotToContainer(new Slot(tedf, 2, 44, 83)); + this.addSlotToContainer(new Slot(tedf, 3, 44, 101)); + this.addSlotToContainer(new Slot(tedf, 4, 39, 35)); + this.addSlotToContainer(new Slot(tedf, 5, 98, 91)); + this.addSlotToContainer(new Slot(tedf, 6, 116, 91)); + this.addSlotToContainer(new Slot(tedf, 7, 134, 91)); + + 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, 135 + i * 18)); } } - - for(int i = 0; i < 9; i++) - { - this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); + + for(int i = 0; i < 9; i++) { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 193)); } } - + @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 <= 7) { - if (!this.mergeItemStack(var5, 8, this.inventorySlots.size(), true)) - { + + if(par2 <= 7) { + if(!this.mergeItemStack(var5, 8, 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) { return nukeMike.isUseableByPlayer(player); } -} +} \ No newline at end of file diff --git a/src/main/java/com/hbm/inventory/gui/GUINukeMike.java b/src/main/java/com/hbm/inventory/gui/GUINukeMike.java index 22e85fcb9..bef83622d 100644 --- a/src/main/java/com/hbm/inventory/gui/GUINukeMike.java +++ b/src/main/java/com/hbm/inventory/gui/GUINukeMike.java @@ -3,6 +3,7 @@ package com.hbm.inventory.gui; import org.lwjgl.opengl.GL11; import com.hbm.inventory.container.ContainerNukeMike; +import com.hbm.items.ModItems; import com.hbm.lib.RefStrings; import com.hbm.tileentity.bomb.TileEntityNukeMike; @@ -22,14 +23,14 @@ public class GUINukeMike extends GuiContainer { testNuke = tedf; this.xSize = 176; - this.ySize = 166; + this.ySize = 217; } @Override protected void drawGuiContainerForegroundLayer( int i, int j) { String name = this.testNuke.hasCustomInventoryName() ? this.testNuke.getInventoryName() : I18n.format(this.testNuke.getInventoryName()); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 4, 4210752); this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); } @@ -41,13 +42,31 @@ public class GUINukeMike extends GuiContainer { if(testNuke.isReady() && !testNuke.isFilled()) { - drawTexturedModalRect(guiLeft + 142, guiTop + 34, 176, 0, 18, 18); + drawTexturedModalRect(guiLeft + 5, guiTop + 35, 177, 1, 16, 16); } if(testNuke.isReady() && testNuke.isFilled()) { - drawTexturedModalRect(guiLeft + 142, guiTop + 34, 176, 18, 18, 18); + drawTexturedModalRect(guiLeft + 5, guiTop + 35, 177, 19, 16, 16); + } + + if(testNuke.getStackInSlot(5) != null && testNuke.getStackInSlot(5).getItem() == ModItems.mike_core) + drawTexturedModalRect(guiLeft + 75, guiTop + 25, 176, 49, 80, 36); + + if(testNuke.getStackInSlot(6) != null && testNuke.getStackInSlot(6).getItem() == ModItems.mike_deut) + drawTexturedModalRect(guiLeft + 79, guiTop + 30, 180, 88, 58, 26); + + if(testNuke.getStackInSlot(7) != null && testNuke.getStackInSlot(7).getItem() == ModItems.mike_cooling_unit) + drawTexturedModalRect(guiLeft + 140, guiTop + 30, 240, 88, 12, 26); + + for(int i = 0; i < 4; i++) { + if(testNuke.getStackInSlot(i) != null && testNuke.getStackInSlot(i).getItem() == ModItems.man_explosive8) + switch(i) { + case 0: drawTexturedModalRect(guiLeft + 24, guiTop + 20 , 209, 1, 23, 23); break; + case 2: drawTexturedModalRect(guiLeft + 47, guiTop + 20 , 232, 1, 23, 23); break; + case 1: drawTexturedModalRect(guiLeft + 24, guiTop + 43 , 209, 24, 23, 23); break; + case 3: drawTexturedModalRect(guiLeft + 47, guiTop + 43 , 232, 24, 23, 23); break; + } } } - -} +} \ No newline at end of file diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 10618cde6..e20609902 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -634,6 +634,7 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerBlockHandler(new RenderCrystal()); RenderingRegistry.registerBlockHandler(new RenderTestCable()); RenderingRegistry.registerBlockHandler(new RenderBlockCT()); + RenderingRegistry.registerBlockHandler(new RenderDetCord()); RenderingRegistry.registerBlockHandler(new RenderBlockRotated(ModBlocks.charge_dynamite.getRenderType(), ResourceManager.charge_dynamite)); diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index f7831f75c..f411e42e4 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -958,6 +958,9 @@ public class MainRegistry { TileEntityMachineReactorLarge.registerAll(); proxy.registerMissileItems(); + + //expand for the largest entity we have (currently Quackos who is 17.5m in diameter, that's one fat duck) + World.MAX_ENTITY_RADIUS = Math.max(World.MAX_ENTITY_RADIUS, 8.75); } @EventHandler diff --git a/src/main/java/com/hbm/render/block/RenderDetCord.java b/src/main/java/com/hbm/render/block/RenderDetCord.java new file mode 100644 index 000000000..c07ffca3c --- /dev/null +++ b/src/main/java/com/hbm/render/block/RenderDetCord.java @@ -0,0 +1,96 @@ +package com.hbm.render.block; + +import org.lwjgl.opengl.GL11; + +import com.hbm.blocks.bomb.IDetConnectible; +import com.hbm.blocks.test.TestConductor; +import com.hbm.lib.Library; +import com.hbm.main.ResourceManager; +import com.hbm.render.util.ObjUtil; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.client.model.obj.WavefrontObject; + +public class RenderDetCord implements ISimpleBlockRenderingHandler { + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + + GL11.glPushMatrix(); + Tessellator tessellator = Tessellator.instance; + IIcon iicon = block.getIcon(0, 0); + tessellator.setColorOpaque_F(1, 1, 1); + + if(renderer.hasOverrideBlockTexture()) { + iicon = renderer.overrideBlockTexture; + } + + GL11.glRotated(180, 0, 1, 0); + GL11.glScaled(1.25D, 1.25D, 1.25D); + tessellator.startDrawingQuads(); + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "CX", iicon, tessellator, 0, false); + tessellator.draw(); + + GL11.glPopMatrix(); + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + + Tessellator tessellator = Tessellator.instance; + IIcon iicon = block.getIcon(0, 0); + tessellator.setColorOpaque_F(1, 1, 1); + + if(renderer.hasOverrideBlockTexture()) { + iicon = renderer.overrideBlockTexture; + } + + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + tessellator.setColorOpaque_F(1, 1, 1); + + boolean pX = IDetConnectible.isConnectible(world, x + 1, y, z, Library.NEG_X); + boolean nX = IDetConnectible.isConnectible(world, x - 1, y, z, Library.POS_X); + boolean pY = IDetConnectible.isConnectible(world, x, y + 1, z, Library.NEG_Y); + boolean nY = IDetConnectible.isConnectible(world, x, y - 1, z, Library.POS_Y); + boolean pZ = IDetConnectible.isConnectible(world, x, y, z + 1, Library.NEG_Z); + boolean nZ = IDetConnectible.isConnectible(world, x, y, z - 1, Library.POS_Z); + + tessellator.addTranslation(x + 0.5F, y + 0.5F, z + 0.5F); + + if(pX && nX && !pY && !nY && !pZ && !nZ) + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "CX", iicon, tessellator, 0, true); + else if(!pX && !nX && pY && nY && !pZ && !nZ) + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "CY", iicon, tessellator, 0, true); + else if(!pX && !nX && !pY && !nY && pZ && nZ) + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "CZ", iicon, tessellator, 0, true); + + else { + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "Core", iicon, tessellator, 0, true); + if(pX) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "posX", iicon, tessellator, 0, true); + if(nX) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "negX", iicon, tessellator, 0, true); + if(pY) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "posY", iicon, tessellator, 0, true); + if(nY) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "negY", iicon, tessellator, 0, true); + if(nZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "posZ", iicon, tessellator, 0, true); + if(pZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "negZ", iicon, tessellator, 0, true); + } + + tessellator.addTranslation(-x - 0.5F, -y - 0.5F, -z - 0.5F); + + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return TestConductor.renderID; + } +} diff --git a/src/main/resources/assets/hbm/textures/blocks/det_cord.png b/src/main/resources/assets/hbm/textures/blocks/det_cord.png index 66c6c57522864ad3f152427ad65c5e2d987b12f9..9be1b515ee4adaef4bcae5eb5518cffa2233eb43 100644 GIT binary patch delta 166 zcmdnbxSer=WIY=L1B3kM|A|0~rP#?cgaZg_I8r)*{5($=#}JF&x06ouHYf>-tKP^2+P)GSjFYg6DVK~xh44$rjF6*2UngF_wKPUhI delta 174 zcmdnaxSw%?WIYoD1H*)g8D>C=u{g-xiDBJ2nU_EgOS+@4BLl<6e(pbstUx|zfk$L9 z0|Vb-5N14{zaj-FC{f}XQ4*Y=R#Ki=l*&+$n3-3imzP?iV4`QBXZEKj`94sMfv1aO zh=qUhiN?kU4-z!E^`)0A5F7#o2<{LV+y`C$ z?|aXl{c!io?!9OC!*jZ;`*ioOtE;Q(^r?EHHPsccG08Cj006d?EC3xRAattJfs)F)s)yhnMVFRlfn{{gt;?esQa+}$!oYQjpA;i(BAAayk*X8?>OLK*|??h zxO!vds;BAWNyA>lkHb2kNBSs8jX4J*7YY6}-r?p7WpL~E3s}e=WhaF#Mt2YmAbBzNpi@~N| zD6Utt29pNSrgCg3nkf66t?QqxbAN(RAbY4FI2rh19c{L2_ltuoswUvs=edXICn?#2 zEp%;Y!i`O8{WgcRx&~y?JQ&_6QvZArxt13g;c_IQ8TfwQ(e2h%tJ8H<(`{N`2Nec- zI!k6dgd}D(=~h{Ax5dx|TNGQ~hSCol=Brn&E5z8wc>lHhwD$ADv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: Boblet Date: Fri, 28 Jan 2022 15:15:03 +0100 Subject: [PATCH 4/4] fluid duct agony --- .../java/com/hbm/blocks/IBlockMultiPass.java | 18 ++ src/main/java/com/hbm/blocks/ModBlocks.java | 3 + .../blocks/network/BlockFluidDuctSolid.java | 71 +++++++ .../java/com/hbm/interfaces/IFluidDuct.java | 3 +- .../com/hbm/items/machine/ItemFluidDuct.java | 2 +- .../items/machine/ItemFluidIdentifier.java | 45 +++-- .../java/com/hbm/items/tool/ItemWandD.java | 7 +- src/main/java/com/hbm/lib/Library.java | 2 +- src/main/java/com/hbm/main/ClientProxy.java | 1 + .../java/com/hbm/packet/PacketDispatcher.java | 2 - .../com/hbm/packet/TEFluidPipePacket.java | 68 ------- .../render/block/RenderBlockMultipass.java | 68 +++++++ .../com/hbm/render/block/RenderChain.java | 175 +++++++++--------- .../render/tileentity/RenderFluidDuct.java | 2 +- .../java/com/hbm/tileentity/TileMappings.java | 1 + .../conductor/TileEntityFluidDuct.java | 36 +--- .../conductor/TileEntityFluidDuctSimple.java | 67 +++++++ .../conductor/TileEntityGasDuct.java | 5 + .../conductor/TileEntityGasDuctSolid.java | 4 + .../conductor/TileEntityOilDuct.java | 5 + .../conductor/TileEntityOilDuctSolid.java | 4 + .../hbm/textures/blocks/fluid_duct_solid.png | Bin 0 -> 348 bytes .../blocks/fluid_duct_solid_overlay.png | Bin 0 -> 126 bytes 23 files changed, 381 insertions(+), 208 deletions(-) create mode 100644 src/main/java/com/hbm/blocks/IBlockMultiPass.java create mode 100644 src/main/java/com/hbm/blocks/network/BlockFluidDuctSolid.java delete mode 100644 src/main/java/com/hbm/packet/TEFluidPipePacket.java create mode 100644 src/main/java/com/hbm/render/block/RenderBlockMultipass.java create mode 100644 src/main/java/com/hbm/tileentity/conductor/TileEntityFluidDuctSimple.java create mode 100644 src/main/resources/assets/hbm/textures/blocks/fluid_duct_solid.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/fluid_duct_solid_overlay.png diff --git a/src/main/java/com/hbm/blocks/IBlockMultiPass.java b/src/main/java/com/hbm/blocks/IBlockMultiPass.java new file mode 100644 index 000000000..7527dfdc1 --- /dev/null +++ b/src/main/java/com/hbm/blocks/IBlockMultiPass.java @@ -0,0 +1,18 @@ +package com.hbm.blocks; + +import cpw.mods.fml.client.registry.RenderingRegistry; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +public interface IBlockMultiPass { + + public int getPasses(); + + public int getColorFromPass(IBlockAccess world, int x, int y, int z, boolean inv); + + public static int renderID = RenderingRegistry.getNextAvailableRenderId(); + public static int getRenderType() { + return renderID; + } + +} diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 2c6b7aa5c..b170b79ed 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -706,6 +706,7 @@ public class ModBlocks { public static Block gas_duct_solid; public static Block gas_duct; public static Block fluid_duct; + public static Block fluid_duct_solid; public static Block conveyor; @@ -1800,6 +1801,7 @@ public class ModBlocks { gas_duct_solid = new GasDuctSolid(Material.iron).setBlockName("gas_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":gas_duct_solid"); gas_duct = new BlockGasDuct(Material.iron).setBlockName("gas_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":gas_duct_icon"); fluid_duct = new BlockFluidDuct(Material.iron).setBlockName("fluid_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_icon"); + fluid_duct_solid = new BlockFluidDuctSolid(Material.iron).setBlockName("fluid_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_solid"); conveyor = new BlockConveyor(Material.iron).setBlockName("conveyor").setHardness(0.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor"); chain = new BlockChain(Material.iron).setBlockName("dungeon_chain").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":chain"); @@ -2880,6 +2882,7 @@ public class ModBlocks { GameRegistry.registerBlock(gas_duct, gas_duct.getUnlocalizedName()); GameRegistry.registerBlock(gas_duct_solid, gas_duct_solid.getUnlocalizedName()); GameRegistry.registerBlock(fluid_duct, fluid_duct.getUnlocalizedName()); + GameRegistry.registerBlock(fluid_duct_solid, fluid_duct_solid.getUnlocalizedName()); GameRegistry.registerBlock(conveyor, conveyor.getUnlocalizedName()); GameRegistry.registerBlock(chain, chain.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/network/BlockFluidDuctSolid.java b/src/main/java/com/hbm/blocks/network/BlockFluidDuctSolid.java new file mode 100644 index 000000000..47bcf4344 --- /dev/null +++ b/src/main/java/com/hbm/blocks/network/BlockFluidDuctSolid.java @@ -0,0 +1,71 @@ +package com.hbm.blocks.network; + +import com.hbm.blocks.IBlockMultiPass; +import com.hbm.inventory.fluid.Fluids; +import com.hbm.render.block.RenderBlockMultipass; +import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFluidDuctSolid extends BlockContainer implements IBlockMultiPass { + + public BlockFluidDuctSolid(Material mat) { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + return new TileEntityFluidDuctSimple(); + } + + @SideOnly(Side.CLIENT) + private IIcon overlay; + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName()); + this.overlay = p_149651_1_.registerIcon(this.getTextureName() + "_overlay"); + } + + @Override + public int getPasses() { + return 2; + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return RenderBlockMultipass.currentPass == 0 ? this.blockIcon : this.overlay; + } + + @Override + public int getRenderType(){ + return IBlockMultiPass.getRenderType(); + } + + @Override + public int getColorFromPass(IBlockAccess world, int x, int y, int z, boolean inv) { + + if(RenderBlockMultipass.currentPass == 0) + return 0xffffff; + + if(inv) + return Fluids.NONE.getColor(); + + TileEntityFluidDuctSimple te = (TileEntityFluidDuctSimple) world.getTileEntity(x, y, z); + + if(te != null) { + return te.getType().getColor(); + } + + return 0xffffff; + } +} diff --git a/src/main/java/com/hbm/interfaces/IFluidDuct.java b/src/main/java/com/hbm/interfaces/IFluidDuct.java index fa9811f4b..101013ef9 100644 --- a/src/main/java/com/hbm/interfaces/IFluidDuct.java +++ b/src/main/java/com/hbm/interfaces/IFluidDuct.java @@ -3,7 +3,8 @@ package com.hbm.interfaces; import com.hbm.inventory.fluid.FluidType; public interface IFluidDuct { - + public FluidType getType(); + public boolean setType(FluidType type); } diff --git a/src/main/java/com/hbm/items/machine/ItemFluidDuct.java b/src/main/java/com/hbm/items/machine/ItemFluidDuct.java index 2a746bee4..f2f3aa457 100644 --- a/src/main/java/com/hbm/items/machine/ItemFluidDuct.java +++ b/src/main/java/com/hbm/items/machine/ItemFluidDuct.java @@ -123,7 +123,7 @@ public class ItemFluidDuct extends Item { world.setBlock(x, y, z, ModBlocks.fluid_duct); if(world.getTileEntity(x, y, z) instanceof TileEntityFluidDuct) { - ((TileEntityFluidDuct) world.getTileEntity(x, y, z)).type = Fluids.fromID(stack.getItemDamage()); + ((TileEntityFluidDuct) world.getTileEntity(x, y, z)).setType(Fluids.fromID(stack.getItemDamage())); } world.playSoundEffect(x, y, z, "hbm:block.pipePlaced", 1.0F, 0.65F + world.rand.nextFloat() * 0.2F); diff --git a/src/main/java/com/hbm/items/machine/ItemFluidIdentifier.java b/src/main/java/com/hbm/items/machine/ItemFluidIdentifier.java index dcb299246..5f1353d54 100644 --- a/src/main/java/com/hbm/items/machine/ItemFluidIdentifier.java +++ b/src/main/java/com/hbm/items/machine/ItemFluidIdentifier.java @@ -9,6 +9,7 @@ import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.Fluids; import com.hbm.items.ModItems; import com.hbm.tileentity.conductor.TileEntityFluidDuct; +import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple; import com.hbm.util.I18nUtil; import cpw.mods.fml.relauncher.Side; @@ -83,13 +84,20 @@ public class ItemFluidIdentifier extends Item { @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int i, float f1, float f2, float f3) { TileEntity te = world.getTileEntity(x, y, z); - if(te instanceof TileEntityFluidDuct) { + if(te instanceof TileEntityFluidDuctSimple) { + if(!world.isRemote) { - TileEntityFluidDuct duct = (TileEntityFluidDuct) te; + TileEntityFluidDuctSimple duct = (TileEntityFluidDuctSimple) te; FluidType type = Fluids.fromID(stack.getItemDamage()); - if (player.isSneaking()) markDuctsRecursively(world, x, y, z, type); - else duct.type = type; + + if (player.isSneaking()) { + markDuctsRecursively(world, x, y, z, type); + } else { + duct.setType(type); + } } + + world.markBlockForUpdate(x, y, z); player.swingItem(); } @@ -102,27 +110,40 @@ public class ItemFluidIdentifier extends Item { private void markDuctsRecursively(World world, int x, int y, int z, FluidType type, int maxRecursion) { TileEntity start = world.getTileEntity(x, y, z); - if (!(start instanceof TileEntityFluidDuct)) return; - TileEntityFluidDuct startDuct = (TileEntityFluidDuct) start; - FluidType oldType = startDuct.type; - if (oldType == type) return; // prevent infinite loops - startDuct.type = type; + + if (!(start instanceof TileEntityFluidDuctSimple)) + return; + + TileEntityFluidDuctSimple startDuct = (TileEntityFluidDuctSimple) start; + FluidType oldType = startDuct.getType(); + + if (oldType == type) + return; // prevent infinite loops + + startDuct.setType(type); directionLoop: for (ForgeDirection direction : ForgeDirection.values()) { for (int currentRecursion = 1; currentRecursion <= maxRecursion; currentRecursion++) { + int nextX = x + direction.offsetX * currentRecursion; int nextY = y + direction.offsetY * currentRecursion; int nextZ = z + direction.offsetZ * currentRecursion; TileEntity te = world.getTileEntity(nextX, nextY, nextZ); - if (te instanceof IFluidDuct && ((IFluidDuct) te).getType() == oldType) { + if (te instanceof TileEntityFluidDuctSimple && ((TileEntityFluidDuctSimple) te).getType() == oldType) { + TileEntityFluidDuct nextDuct = (TileEntityFluidDuct) te; long connectionsCount = Arrays.stream(nextDuct.connections).filter(Objects::nonNull).count(); + if (connectionsCount > 1) { markDuctsRecursively(world, nextX, nextY, nextZ, type, maxRecursion - currentRecursion); continue directionLoop; - } else nextDuct.type = type; - } else break; + } else { + nextDuct.setType(type); + } + } else { + break; + } } } } diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 4c8c4e8d5..525735c84 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -5,6 +5,7 @@ import java.util.List; import com.hbm.blocks.BlockDummyable; import com.hbm.lib.Library; import com.hbm.tileentity.conductor.TileEntityFluidDuct; +import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple; import api.hbm.energy.IEnergyConductor; import net.minecraft.block.Block; @@ -47,10 +48,10 @@ public class ItemWandD extends Item { player.addChatComponentMessage(new ChatComponentText("" + con.getPowerNet())); }*/ - if(te instanceof TileEntityFluidDuct) { + if(te instanceof TileEntityFluidDuctSimple) { - player.addChatComponentMessage(new ChatComponentText("" + ((TileEntityFluidDuct)te).type.getUnlocalizedName())); - player.addChatComponentMessage(new ChatComponentText("" + ((TileEntityFluidDuct)te).type.getID())); + player.addChatComponentMessage(new ChatComponentText("" + ((TileEntityFluidDuctSimple)te).getType().getUnlocalizedName())); + player.addChatComponentMessage(new ChatComponentText("" + ((TileEntityFluidDuctSimple)te).getType().getID())); } //CellularDungeonFactory.meteor.generate(world, x, y, z, world.rand); diff --git a/src/main/java/com/hbm/lib/Library.java b/src/main/java/com/hbm/lib/Library.java index ce9dc72a8..1bb8dcd71 100644 --- a/src/main/java/com/hbm/lib/Library.java +++ b/src/main/java/com/hbm/lib/Library.java @@ -495,7 +495,7 @@ public class Library { if(tileentity instanceof IFluidDuct) { - if(tileentity instanceof TileEntityFluidDuct && ((TileEntityFluidDuct)tileentity).type.name().equals(type.name())) + if(tileentity instanceof TileEntityFluidDuct && ((TileEntityFluidDuct)tileentity).getType() == type) { if(Library.checkUnionListForFluids(((TileEntityFluidDuct)tileentity).uoteab, that)) { diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index e20609902..233e0acee 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -635,6 +635,7 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerBlockHandler(new RenderTestCable()); RenderingRegistry.registerBlockHandler(new RenderBlockCT()); RenderingRegistry.registerBlockHandler(new RenderDetCord()); + RenderingRegistry.registerBlockHandler(new RenderBlockMultipass()); RenderingRegistry.registerBlockHandler(new RenderBlockRotated(ModBlocks.charge_dynamite.getRenderType(), ResourceManager.charge_dynamite)); diff --git a/src/main/java/com/hbm/packet/PacketDispatcher.java b/src/main/java/com/hbm/packet/PacketDispatcher.java index da1a20e05..42703f6aa 100644 --- a/src/main/java/com/hbm/packet/PacketDispatcher.java +++ b/src/main/java/com/hbm/packet/PacketDispatcher.java @@ -27,8 +27,6 @@ public class PacketDispatcher { wrapper.registerMessage(TEDrillSoundPacket.Handler.class, TEDrillSoundPacket.class, i++, Side.CLIENT); //Assembler cog rotation for rendering wrapper.registerMessage(TEAssemblerPacket.Handler.class, TEAssemblerPacket.class, i++, Side.CLIENT); - //Fluid type for pipe rendering - wrapper.registerMessage(TEFluidPipePacket.Handler.class, TEFluidPipePacket.class, i++, Side.CLIENT); //Missile type for rendering wrapper.registerMessage(TEMissilePacket.Handler.class, TEMissilePacket.class, i++, Side.CLIENT); //Fluid packet for GUI diff --git a/src/main/java/com/hbm/packet/TEFluidPipePacket.java b/src/main/java/com/hbm/packet/TEFluidPipePacket.java deleted file mode 100644 index f9c25579e..000000000 --- a/src/main/java/com/hbm/packet/TEFluidPipePacket.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.hbm.packet; - -import com.hbm.inventory.fluid.FluidType; -import com.hbm.inventory.fluid.Fluids; -import com.hbm.tileentity.conductor.TileEntityFluidDuct; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import io.netty.buffer.ByteBuf; -import net.minecraft.client.Minecraft; -import net.minecraft.tileentity.TileEntity; - -public class TEFluidPipePacket implements IMessage { - - int x; - int y; - int z; - FluidType type; - - public TEFluidPipePacket() - { - - } - - public TEFluidPipePacket(int x, int y, int z, FluidType type) - { - this.x = x; - this.y = y; - this.z = z; - this.type = type; - } - - @Override - public void fromBytes(ByteBuf buf) { - x = buf.readInt(); - y = buf.readInt(); - z = buf.readInt(); - type = Fluids.fromID(buf.readInt()); - } - - @Override - public void toBytes(ByteBuf buf) { - buf.writeInt(x); - buf.writeInt(y); - buf.writeInt(z); - buf.writeInt(type.getID()); - } - - public static class Handler implements IMessageHandler { - - @Override - public IMessage onMessage(TEFluidPipePacket m, MessageContext ctx) { - try { - TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z); - - if (te != null && te instanceof TileEntityFluidDuct) { - - TileEntityFluidDuct duct = (TileEntityFluidDuct) te; - duct.type = m.type; - } - return null; - } catch(Exception ex) { - return null; - } - } - } -} diff --git a/src/main/java/com/hbm/render/block/RenderBlockMultipass.java b/src/main/java/com/hbm/render/block/RenderBlockMultipass.java new file mode 100644 index 000000000..537378e9f --- /dev/null +++ b/src/main/java/com/hbm/render/block/RenderBlockMultipass.java @@ -0,0 +1,68 @@ +package com.hbm.render.block; + +import com.hbm.blocks.IBlockMultiPass; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.IBlockAccess; + +public class RenderBlockMultipass implements ISimpleBlockRenderingHandler { + + /** + * First I wanted to pass the current render pass in the methods for getting color and icon, but the later one would have to work with + * texture overrides which would either break sided textures or force me to implement renderStandardBlock myself, so that's a big nono. + * So I made a static variable for the current render pass so that Block.getIcon could use it while still minding sides. Great, I put it + * into IBlockMultiPass because that's the only logical place I could put it since I intend to use IBlockMultiPass for more rendering + * handlers than just this one and BOOM, primitive fields in interfaces are implicitly final. Why? Because "functionality in interfaces + * bad", or so the HeckOverflow people are trying to tell me. Mh-hm, holding a single static value is "functionality" now, and functionality + * in interfaces is very very bad in a language that allows interfaces to define a default behavior that is LITERALLY FULLY FUNCTIONAL + * METHODS. Statistically speaking I, the individual, should be wrong and many people who - supposedly - know what they're talking about + * should be right, but if you ask me there's something off about this whole ordeal. I don't know. + */ + public static int currentPass = 0; + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + + Tessellator tessellator = Tessellator.instance; + int meta = world.getBlockMetadata(x, y, z); + + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + + if(!(block instanceof IBlockMultiPass)) { + renderer.renderStandardBlock(block, x, y, z); + return true; + } + + IBlockMultiPass multi = (IBlockMultiPass) block; + renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 1.0); + + int passes = multi.getPasses(); + + for(int i = 0; i < passes; i++) { + currentPass = i; + System.out.println(multi.getColorFromPass(world, x, y, z, false)); + tessellator.setColorOpaque_I(multi.getColorFromPass(world, x, y, z, false)); + renderer.renderStandardBlock(block, x, y, z); + } + + currentPass = 0; + + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return false; + } + + @Override + public int getRenderId() { + return IBlockMultiPass.getRenderType(); + } +} diff --git a/src/main/java/com/hbm/render/block/RenderChain.java b/src/main/java/com/hbm/render/block/RenderChain.java index 6aab8e71a..7d5d77c1d 100644 --- a/src/main/java/com/hbm/render/block/RenderChain.java +++ b/src/main/java/com/hbm/render/block/RenderChain.java @@ -12,107 +12,104 @@ import net.minecraft.world.IBlockAccess; public class RenderChain implements ISimpleBlockRenderingHandler { @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { } + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - - Tessellator tessellator = Tessellator.instance; - IIcon iicon = block.getIcon(world, x, y, z, 0); - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); - double d0 = (double)iicon.getMinU(); - double d1 = (double)iicon.getMinV(); - double d2 = (double)iicon.getMaxU(); - double d3 = (double)iicon.getMaxV(); - int l = world.getBlockMetadata(x, y, z); - double d4 = 0.0D; - double d5 = 0.05D; - - if(l == 0) { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = block.getIcon(world, x, y, z, 0); - double minU = (double)iicon.getMinU(); - double minV = (double)iicon.getMinV(); - double maxU = (double)iicon.getMaxU(); - double maxV = (double)iicon.getMaxV(); - double d8 = x; - double d9 = x + 1; - double p_147765_4_ = y; - double p_147765_8_ = 1; - double d10 = z + 0; - double d11 = z + 1; - tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d10, minU, minV); - tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d10, minU, maxV); - tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d11, maxU, maxV); - tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d11, maxU, minV); - tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d11, minU, minV); - tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d11, minU, maxV); - tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d10, maxU, maxV); - tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d10, maxU, minV); - tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d11, minU, minV); - tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d11, minU, maxV); - tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d10, maxU, maxV); - tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d10, maxU, minV); - tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d10, minU, minV); - tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d10, minU, maxV); - tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d11, maxU, maxV); - tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d11, maxU, minV); - } + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double d0 = (double) iicon.getMinU(); + double d1 = (double) iicon.getMinV(); + double d2 = (double) iicon.getMaxU(); + double d3 = (double) iicon.getMaxV(); + int l = world.getBlockMetadata(x, y, z); + double scale = 0.0D; + double wallOffset = 0.05D; - if (l == 5) - { - tessellator.addVertexWithUV((double)x + d5, (double)(y + 1) + d4, (double)(z + 1) + d4, d0, d1); - tessellator.addVertexWithUV((double)x + d5, (double)(y + 0) - d4, (double)(z + 1) + d4, d0, d3); - tessellator.addVertexWithUV((double)x + d5, (double)(y + 0) - d4, (double)(z + 0) - d4, d2, d3); - tessellator.addVertexWithUV((double)x + d5, (double)(y + 1) + d4, (double)(z + 0) - d4, d2, d1); + if(l == 0) { - tessellator.addVertexWithUV((double)x + d5, (double)(y + 0) - d4, (double)(z + 1) + d4, d0, d3); - tessellator.addVertexWithUV((double)x + d5, (double)(y + 1) + d4, (double)(z + 1) + d4, d0, d1); - tessellator.addVertexWithUV((double)x + d5, (double)(y + 1) + d4, (double)(z + 0) - d4, d2, d1); - tessellator.addVertexWithUV((double)x + d5, (double)(y + 0) - d4, (double)(z + 0) - d4, d2, d3); - } + double minU = (double) iicon.getMinU(); + double minV = (double) iicon.getMinV(); + double maxU = (double) iicon.getMaxU(); + double maxV = (double) iicon.getMaxV(); + double minX = x; + double maxX = x + 1; + double minY = y; + double ySize = 1; + double minZ = z + 0; + double maxZ = z + 1; + tessellator.addVertexWithUV(minX, minY + (double) ySize, minZ, minU, minV); + tessellator.addVertexWithUV(minX, minY + 0.0D, minZ, minU, maxV); + tessellator.addVertexWithUV(maxX, minY + 0.0D, maxZ, maxU, maxV); + tessellator.addVertexWithUV(maxX, minY + (double) ySize, maxZ, maxU, minV); + tessellator.addVertexWithUV(maxX, minY + (double) ySize, maxZ, minU, minV); + tessellator.addVertexWithUV(maxX, minY + 0.0D, maxZ, minU, maxV); + tessellator.addVertexWithUV(minX, minY + 0.0D, minZ, maxU, maxV); + tessellator.addVertexWithUV(minX, minY + (double) ySize, minZ, maxU, minV); + tessellator.addVertexWithUV(minX, minY + (double) ySize, maxZ, minU, minV); + tessellator.addVertexWithUV(minX, minY + 0.0D, maxZ, minU, maxV); + tessellator.addVertexWithUV(maxX, minY + 0.0D, minZ, maxU, maxV); + tessellator.addVertexWithUV(maxX, minY + (double) ySize, minZ, maxU, minV); + tessellator.addVertexWithUV(maxX, minY + (double) ySize, minZ, minU, minV); + tessellator.addVertexWithUV(maxX, minY + 0.0D, minZ, minU, maxV); + tessellator.addVertexWithUV(minX, minY + 0.0D, maxZ, maxU, maxV); + tessellator.addVertexWithUV(minX, minY + (double) ySize, maxZ, maxU, minV); + } - if (l == 4) - { - tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 0) - d4, (double)(z + 1) + d4, d2, d3); - tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 1) + d4, (double)(z + 1) + d4, d2, d1); - tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 1) + d4, (double)(z + 0) - d4, d0, d1); - tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 0) - d4, (double)(z + 0) - d4, d0, d3); - - tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 1) + d4, (double)(z + 1) + d4, d2, d1); - tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 0) - d4, (double)(z + 1) + d4, d2, d3); - tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 0) - d4, (double)(z + 0) - d4, d0, d3); - tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 1) + d4, (double)(z + 0) - d4, d0, d1); - } + if(l == 5) { + tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 1) + scale, (double) (z + 1) + scale, d0, d1); + tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 0) - scale, (double) (z + 1) + scale, d0, d3); + tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 0) - scale, (double) (z + 0) - scale, d2, d3); + tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 1) + scale, (double) (z + 0) - scale, d2, d1); - if (l == 3) - { - tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 0) - d4, (double)z + d5, d2, d3); - tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 1) + d4, (double)z + d5, d2, d1); - tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 1) + d4, (double)z + d5, d0, d1); - tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 0) - d4, (double)z + d5, d0, d3); - - tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 1) + d4, (double)z + d5, d2, d1); - tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 0) - d4, (double)z + d5, d2, d3); - tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 0) - d4, (double)z + d5, d0, d3); - tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 1) + d4, (double)z + d5, d0, d1); - } + tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 0) - scale, (double) (z + 1) + scale, d0, d3); + tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 1) + scale, (double) (z + 1) + scale, d0, d1); + tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 1) + scale, (double) (z + 0) - scale, d2, d1); + tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 0) - scale, (double) (z + 0) - scale, d2, d3); + } - if (l == 2) - { - tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 1) + d4, (double)(z + 1) - d5, d0, d1); - tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 0) - d4, (double)(z + 1) - d5, d0, d3); - tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 0) - d4, (double)(z + 1) - d5, d2, d3); - tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 1) + d4, (double)(z + 1) - d5, d2, d1); + if(l == 4) { + tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 0) - scale, (double) (z + 1) + scale, d2, d3); + tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 1) + scale, (double) (z + 1) + scale, d2, d1); + tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 1) + scale, (double) (z + 0) - scale, d0, d1); + tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 0) - scale, (double) (z + 0) - scale, d0, d3); - tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 0) - d4, (double)(z + 1) - d5, d0, d3); - tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 1) + d4, (double)(z + 1) - d5, d0, d1); - tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 1) + d4, (double)(z + 1) - d5, d2, d1); - tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 0) - d4, (double)(z + 1) - d5, d2, d3); - } + tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 1) + scale, (double) (z + 1) + scale, d2, d1); + tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 0) - scale, (double) (z + 1) + scale, d2, d3); + tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 0) - scale, (double) (z + 0) - scale, d0, d3); + tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 1) + scale, (double) (z + 0) - scale, d0, d1); + } - return true; + if(l == 3) { + tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 0) - scale, (double) z + wallOffset, d2, d3); + tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 1) + scale, (double) z + wallOffset, d2, d1); + tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 1) + scale, (double) z + wallOffset, d0, d1); + tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 0) - scale, (double) z + wallOffset, d0, d3); + + tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 1) + scale, (double) z + wallOffset, d2, d1); + tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 0) - scale, (double) z + wallOffset, d2, d3); + tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 0) - scale, (double) z + wallOffset, d0, d3); + tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 1) + scale, (double) z + wallOffset, d0, d1); + } + + if(l == 2) { + tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 1) + scale, (double) (z + 1) - wallOffset, d0, d1); + tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 0) - scale, (double) (z + 1) - wallOffset, d0, d3); + tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 0) - scale, (double) (z + 1) - wallOffset, d2, d3); + tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 1) + scale, (double) (z + 1) - wallOffset, d2, d1); + + tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 0) - scale, (double) (z + 1) - wallOffset, d0, d3); + tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 1) + scale, (double) (z + 1) - wallOffset, d0, d1); + tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 1) + scale, (double) (z + 1) - wallOffset, d2, d1); + tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 0) - scale, (double) (z + 1) - wallOffset, d2, d3); + } + + return true; } @Override diff --git a/src/main/java/com/hbm/render/tileentity/RenderFluidDuct.java b/src/main/java/com/hbm/render/tileentity/RenderFluidDuct.java index 5e3bbd830..afa01d9ee 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderFluidDuct.java +++ b/src/main/java/com/hbm/render/tileentity/RenderFluidDuct.java @@ -28,7 +28,7 @@ public class RenderFluidDuct extends TileEntitySpecialRenderer { { if(cable.connections[i] != null) { - drawConnection(cable.connections[i], cable.type.getColor()); + drawConnection(cable.connections[i], cable.getType().getColor()); } } GL11.glTranslated(-offsetX, -offsetY, -offsetZ); diff --git a/src/main/java/com/hbm/tileentity/TileMappings.java b/src/main/java/com/hbm/tileentity/TileMappings.java index 269db65c1..bc380a589 100644 --- a/src/main/java/com/hbm/tileentity/TileMappings.java +++ b/src/main/java/com/hbm/tileentity/TileMappings.java @@ -76,6 +76,7 @@ public class TileMappings { put(TileEntityStructureMarker.class, "tileentity_structure_marker"); put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill"); put(TileEntityMachineAssembler.class, "tileentity_assembly_machine"); + put(TileEntityFluidDuctSimple.class, "tileentity_universal_duct_simple"); put(TileEntityFluidDuct.class, "tileentity_universal_duct"); put(TileEntityMachineChemplant.class, "tileentity_chemical_plant"); put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank"); diff --git a/src/main/java/com/hbm/tileentity/conductor/TileEntityFluidDuct.java b/src/main/java/com/hbm/tileentity/conductor/TileEntityFluidDuct.java index c2ba5f345..f59bff633 100644 --- a/src/main/java/com/hbm/tileentity/conductor/TileEntityFluidDuct.java +++ b/src/main/java/com/hbm/tileentity/conductor/TileEntityFluidDuct.java @@ -10,31 +10,25 @@ import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.Fluids; import com.hbm.lib.Library; import com.hbm.packet.PacketDispatcher; -import com.hbm.packet.TEFluidPipePacket; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityFluidDuct extends TileEntity implements IFluidDuct { +public class TileEntityFluidDuct extends TileEntityFluidDuctSimple { public ForgeDirection[] connections = new ForgeDirection[6]; - public FluidType type = Fluids.NONE; - public List uoteab = new ArrayList(); - public TileEntityFluidDuct() { - - } + public TileEntityFluidDuct() { } @Override public void updateEntity() { - - if(!worldObj.isRemote) - PacketDispatcher.wrapper.sendToAllAround(new TEFluidPipePacket(xCoord, yCoord, zCoord, type), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 25)); - this.updateConnections(); } @@ -57,28 +51,10 @@ public class TileEntityFluidDuct extends TileEntity implements IFluidDuct { if(Library.checkFluidConnectables(this.worldObj, xCoord - 1, yCoord, zCoord, type)) connections[5] = ForgeDirection.WEST; else connections[5] = null; } - - @Override - public void readFromNBT(NBTTagCompound nbt) { - super.readFromNBT(nbt); - type = Fluids.fromID(nbt.getInteger("fluid")); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - nbt.setInteger("fluid", type.getID()); - } @Override @SideOnly(Side.CLIENT) - public double getMaxRenderDistanceSquared() - { + public double getMaxRenderDistanceSquared() { return 65536.0D; } - - @Override - public FluidType getType() { - return type; - } } diff --git a/src/main/java/com/hbm/tileentity/conductor/TileEntityFluidDuctSimple.java b/src/main/java/com/hbm/tileentity/conductor/TileEntityFluidDuctSimple.java new file mode 100644 index 000000000..46c169d63 --- /dev/null +++ b/src/main/java/com/hbm/tileentity/conductor/TileEntityFluidDuctSimple.java @@ -0,0 +1,67 @@ +package com.hbm.tileentity.conductor; + +import java.util.ArrayList; +import java.util.List; + +import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids; +import com.hbm.interfaces.IFluidDuct; +import com.hbm.inventory.fluid.FluidType; +import com.hbm.inventory.fluid.Fluids; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.WorldServer; + +public class TileEntityFluidDuctSimple extends TileEntity implements IFluidDuct { + + protected FluidType type = Fluids.NONE; + public List uoteab = new ArrayList(); + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + this.writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + this.readFromNBT(pkt.func_148857_g()); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + type = Fluids.fromID(nbt.getInteger("fluid")); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setInteger("fluid", type.getID()); + } + + public boolean setType(FluidType type) { + + if(this.type == type) + return true; + + this.type = type; + this.markDirty(); + + if(worldObj instanceof WorldServer) { + WorldServer world = (WorldServer) worldObj; + world.getPlayerManager().markBlockForUpdate(xCoord, yCoord, zCoord); + } + + return true; + } + + @Override + public FluidType getType() { + return type; + } +} diff --git a/src/main/java/com/hbm/tileentity/conductor/TileEntityGasDuct.java b/src/main/java/com/hbm/tileentity/conductor/TileEntityGasDuct.java index 9d9638597..48f619f1c 100644 --- a/src/main/java/com/hbm/tileentity/conductor/TileEntityGasDuct.java +++ b/src/main/java/com/hbm/tileentity/conductor/TileEntityGasDuct.java @@ -79,4 +79,9 @@ public class TileEntityGasDuct extends TileEntity implements IFluidDuct { public FluidType getType() { return type; } + + @Override + public boolean setType(FluidType type) { + return false; + } } diff --git a/src/main/java/com/hbm/tileentity/conductor/TileEntityGasDuctSolid.java b/src/main/java/com/hbm/tileentity/conductor/TileEntityGasDuctSolid.java index 911254bb4..760612a1e 100644 --- a/src/main/java/com/hbm/tileentity/conductor/TileEntityGasDuctSolid.java +++ b/src/main/java/com/hbm/tileentity/conductor/TileEntityGasDuctSolid.java @@ -20,4 +20,8 @@ public class TileEntityGasDuctSolid extends TileEntity implements IFluidDuct { return type; } + @Override + public boolean setType(FluidType type) { + return false; + } } diff --git a/src/main/java/com/hbm/tileentity/conductor/TileEntityOilDuct.java b/src/main/java/com/hbm/tileentity/conductor/TileEntityOilDuct.java index d22c6ddbb..2df4d8c60 100644 --- a/src/main/java/com/hbm/tileentity/conductor/TileEntityOilDuct.java +++ b/src/main/java/com/hbm/tileentity/conductor/TileEntityOilDuct.java @@ -78,4 +78,9 @@ public class TileEntityOilDuct extends TileEntity implements IFluidDuct { public FluidType getType() { return type; } + + @Override + public boolean setType(FluidType type) { + return false; + } } diff --git a/src/main/java/com/hbm/tileentity/conductor/TileEntityOilDuctSolid.java b/src/main/java/com/hbm/tileentity/conductor/TileEntityOilDuctSolid.java index 2e10791ce..059876707 100644 --- a/src/main/java/com/hbm/tileentity/conductor/TileEntityOilDuctSolid.java +++ b/src/main/java/com/hbm/tileentity/conductor/TileEntityOilDuctSolid.java @@ -20,4 +20,8 @@ public class TileEntityOilDuctSolid extends TileEntity implements IFluidDuct { return type; } + @Override + public boolean setType(FluidType type) { + return false; + } } diff --git a/src/main/resources/assets/hbm/textures/blocks/fluid_duct_solid.png b/src/main/resources/assets/hbm/textures/blocks/fluid_duct_solid.png new file mode 100644 index 0000000000000000000000000000000000000000..2a1ef864f4b77af1ca7258d52735c213c4d28076 GIT binary patch literal 348 zcmV-i0i*tjP)k^r04bJ8Gw`$ z03iebPH*ppUI4D{ZVAIMpsGuEA;!1?Pm`7mtXN73Rb`&%^)02;oKUxk{L=~srgjJc zk$iE45W>$gEu#c*-b+Ev)Q&N3L=@=@9lV#4fq_l!d=Koc9%q+RH>=fd#SG(eTDD