diff --git a/src/main/java/com/hbm/blocks/gas/BlockGasRadon.java b/src/main/java/com/hbm/blocks/gas/BlockGasRadon.java index df166aa03..fdf44479f 100644 --- a/src/main/java/com/hbm/blocks/gas/BlockGasRadon.java +++ b/src/main/java/com/hbm/blocks/gas/BlockGasRadon.java @@ -3,8 +3,10 @@ package com.hbm.blocks.gas; import java.util.Random; import com.hbm.extprop.HbmLivingProps; +import com.hbm.util.ArmorRegistry; import com.hbm.util.ArmorUtil; import com.hbm.util.ContaminationUtil; +import com.hbm.util.ArmorRegistry.HazardClass; import com.hbm.util.ContaminationUtil.ContaminationType; import com.hbm.util.ContaminationUtil.HazardType; @@ -23,7 +25,14 @@ public class BlockGasRadon extends BlockGasBase { @Override public void onEntityCollidedWithBlock(World world, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity) { - if(entity instanceof EntityLivingBase) { + if(!(entity instanceof EntityLivingBase)) + return; + + EntityLivingBase entityLiving = (EntityLivingBase) entity; + + if(ArmorRegistry.hasAllProtection(entityLiving, 3, HazardClass.PARTICLE_FINE)) { + ArmorUtil.damageGasMaskFilter(entityLiving, 1); + } else { ContaminationUtil.contaminate((EntityLivingBase)entity, HazardType.RADIATION, ContaminationType.RAD_BYPASS, 0.05F); HbmLivingProps.incrementFibrosis((EntityLivingBase)entity, 1); } diff --git a/src/main/java/com/hbm/blocks/generic/BlockStorageCrate.java b/src/main/java/com/hbm/blocks/generic/BlockStorageCrate.java index 16ab8ac96..d86689853 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockStorageCrate.java +++ b/src/main/java/com/hbm/blocks/generic/BlockStorageCrate.java @@ -113,8 +113,11 @@ public class BlockStorageCrate extends BlockContainer { if(inv instanceof TileEntityLockableBase) { TileEntityLockableBase lockable = (TileEntityLockableBase) inv; - nbt.setInteger("lock", lockable.getPins()); - nbt.setDouble("lockMod", lockable.getMod()); + + if(lockable.isLocked()) { + nbt.setInteger("lock", lockable.getPins()); + nbt.setDouble("lockMod", lockable.getMod()); + } } if(!nbt.hasNoTags()) { diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index ad96f8919..f0ffd1140 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -640,9 +640,9 @@ public class CraftingManager { GameRegistry.addRecipe(new ItemStack(Blocks.torch, 8), new Object[] { "L", "S", 'L', ModItems.coke, 'S', Items.stick }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_missile_assembly, 1), new Object[] { "PWP", "SSS", "CCC", 'P', ModItems.pedestal_steel, 'W', ModItems.wrench, 'S', "plateSteel", 'C', ModBlocks.steel_scaffold })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.struct_launcher, 1), new Object[] { "PPP", "SDS", "CCC", 'P', "plateSteel", 'S', ModBlocks.steel_scaffold, 'D', ModBlocks.deco_pipe_quad, 'C', ModBlocks.concrete_smooth })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.struct_launcher, 1), new Object[] { "PPP", "SDS", "CCC", 'P', "plateSteel", 'S', ModBlocks.steel_scaffold, 'D', ModBlocks.deco_pipe_quad, 'C', ModBlocks.concrete })); - GameRegistry.addRecipe(new ItemStack(ModBlocks.struct_scaffold, 1), new Object[] { "SSS", "DCD", "SSS", 'S', ModBlocks.steel_scaffold, 'D', ModBlocks.fluid_duct, 'C', ModBlocks.red_cable }); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.struct_launcher, 4), new Object[] { "PPP", "SDS", "CCC", 'P', "plateSteel", 'S', ModBlocks.steel_scaffold, 'D', ModBlocks.deco_pipe_quad, 'C', ModBlocks.concrete_smooth })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.struct_launcher, 4), new Object[] { "PPP", "SDS", "CCC", 'P', "plateSteel", 'S', ModBlocks.steel_scaffold, 'D', ModBlocks.deco_pipe_quad, 'C', ModBlocks.concrete })); + GameRegistry.addRecipe(new ItemStack(ModBlocks.struct_scaffold, 4), new Object[] { "SSS", "DCD", "SSS", 'S', ModBlocks.steel_scaffold, 'D', ModBlocks.fluid_duct, 'C', ModBlocks.red_cable }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.seg_10, 1), new Object[] { "P", "S", "B", 'P', "plateAluminum", 'S', ModBlocks.steel_scaffold, 'B', ModBlocks.steel_beam })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.seg_15, 1), new Object[] { "PP", "SS", "BB", 'P', "plateTitanium", 'S', ModBlocks.steel_scaffold, 'B', ModBlocks.steel_beam })); diff --git a/src/main/java/com/hbm/render/tileentity/RenderRBMKConsole.java b/src/main/java/com/hbm/render/tileentity/RenderRBMKConsole.java index 51b0a92f8..ab52f2ac4 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderRBMKConsole.java +++ b/src/main/java/com/hbm/render/tileentity/RenderRBMKConsole.java @@ -5,8 +5,11 @@ import org.lwjgl.opengl.GL11; import com.hbm.blocks.BlockDummyable; import com.hbm.main.ResourceManager; import com.hbm.tileentity.machine.TileEntityMachineFENSU; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.RBMKColumn; import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; @@ -35,7 +38,90 @@ public class RenderRBMKConsole extends TileEntitySpecialRenderer { bindTexture(ResourceManager.rbmk_console_tex); ResourceManager.rbmk_console.renderAll(); GL11.glShadeModel(GL11.GL_FLAT); + + TileEntityRBMKConsole console = (TileEntityRBMKConsole) te; + + Tessellator tess = Tessellator.instance; + tess.startDrawingQuads(); + + for(int i = 0; i < console.columns.length; i++) { + + RBMKColumn col = console.columns[i]; + + if(col == null) + continue; + + double kx = i % 15 - 0.125D * 7; + double ky = i / 15 + 2.5; + double kz = 0.5D; + + drawColumn(tess, kx, ky, kz, (float)(0.6D + ((kx + ky) % 2) * 0.1D), col.data.getDouble("heat") / col.data.getDouble("maxHeat")); + + switch(col.type) { + case FUEL: + case FUEL_SIM: drawFuel(tess, kx, ky, kz, col.data.getDouble("enrichment")); break; + case CONTROL: drawControl(tess, kx, ky, kz, col.data.getDouble("level")); break; + case CONTROL_AUTO: drawControlAuto(tess, kx, ky, kz, col.data.getDouble("level")); break; + } + } GL11.glPopMatrix(); } + + private void drawColumn(Tessellator tess, double x, double y, double z, float color, double heat) { + + double width = 0.0625D; + + tess.setColorOpaque_F((float) (color + ((1 - color) * heat)), color, color); + tess.addVertex(x - width, y + width, z); + tess.addVertex(x + width, y + width, z); + tess.addVertex(x + width, y - width, z); + tess.addVertex(x - width, y - width, z); + } + + private void drawFuel(Tessellator tess, double x, double y, double z, double enrichment) { + this.drawDot(tess, x, y, z, 0F, 0.25F + (float) (enrichment * 0.75D), 0F); + } + + private void drawControl(Tessellator tess, double x, double y, double z, double level) { + this.drawDot(tess, x, y, z, (float) level, (float) level, 0F); + } + + private void drawControlAuto(Tessellator tess, double x, double y, double z, double level) { + this.drawDot(tess, x, y, z, (float) level, 0F, (float) level); + } + + private void drawSquare(Tessellator tess, double x, double y, double z, float r, float g, float b) { + + double width = 0.0625D; + + tess.setColorOpaque_F(r, g, b); + tess.addVertex(x - width, y + width, z); + tess.addVertex(x + width, y + width, z); + tess.addVertex(x + width, y - width, z); + tess.addVertex(x - width, y - width, z); + } + + private void drawDot(Tessellator tess, double x, double y, double z, float r, float g, float b) { + + double width = 0.03125D; + double edge = 0.022097D; + + tess.setColorOpaque_F(r, g, b); + + tess.addVertex(x, y + width, z); + tess.addVertex(x + edge, y + edge, z); + tess.addVertex(x + width, y, z); + tess.addVertex(x + edge, y - edge, z); + + tess.addVertex(x, y + width, z); + tess.addVertex(x - edge, y + edge, z); + tess.addVertex(x - width, y, z); + tess.addVertex(x - edge, y - edge, z); + + tess.addVertex(x, y + width, z); + tess.addVertex(x + edge, y - edge, z); + tess.addVertex(x, y - width, z); + tess.addVertex(x - edge, y - edge, z); + } } diff --git a/src/main/resources/assets/hbm/textures/models/machines/rbmk_control.png b/src/main/resources/assets/hbm/textures/models/machines/rbmk_control.png index ea2ca336f..ad6377034 100644 Binary files a/src/main/resources/assets/hbm/textures/models/machines/rbmk_control.png and b/src/main/resources/assets/hbm/textures/models/machines/rbmk_control.png differ