diff --git a/src/main/java/com/hbm/blocks/gas/BlockGasBase.java b/src/main/java/com/hbm/blocks/gas/BlockGasBase.java index 43a306262..30c443673 100644 --- a/src/main/java/com/hbm/blocks/gas/BlockGasBase.java +++ b/src/main/java/com/hbm/blocks/gas/BlockGasBase.java @@ -79,8 +79,20 @@ public abstract class BlockGasBase extends Block { @Override public void onBlockAdded(World world, int x, int y, int z) { - if(!world.isRemote) + if(!world.isRemote) { + + if(world.getBlockMetadata(x, y, z) == 0) + world.scheduleBlockUpdate(x, y, z, this, 10); + } + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { + + if(world.getBlockMetadata(x, y, z) != 0) { + world.setBlockMetadataWithNotify(x, y, z, 0, 4); world.scheduleBlockUpdate(x, y, z, this, 10); + } } @Override diff --git a/src/main/java/com/hbm/blocks/generic/BlockBobble.java b/src/main/java/com/hbm/blocks/generic/BlockBobble.java index 7105ce29b..26a5d0558 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockBobble.java +++ b/src/main/java/com/hbm/blocks/generic/BlockBobble.java @@ -168,6 +168,7 @@ public class BlockBobble extends BlockContainer { FRIZZLE("Frooz", "Frooz", "Weapon models", "BLOOD IS FUEL", true), PU238("Pu-238", "Pu-238", "Improved Tom impact mechanics", null, false), VT("VT-6/24", "VT-6/24", "Balefire warhead model and general texturework", "You cannot unfuck a horse.", true), + DOC("The Doctor", "Doctor17PH", "Russian localization, lunar miner", "Perhaps the moon rocks were too expensive", true), //testing garbage. why is she so dumb? CIRNO("Cirno", "Cirno", "being a dumb ice fairy", "No brain. Head empty.", true); diff --git a/src/main/java/com/hbm/blocks/generic/WasteLeaves.java b/src/main/java/com/hbm/blocks/generic/WasteLeaves.java index 212dd9c2c..ee32266e8 100644 --- a/src/main/java/com/hbm/blocks/generic/WasteLeaves.java +++ b/src/main/java/com/hbm/blocks/generic/WasteLeaves.java @@ -43,15 +43,20 @@ public class WasteLeaves extends Block { super.updateTick(world, x, y, z, rand); } - /*@Override + @Override @SideOnly(Side.CLIENT) public void randomDisplayTick(World world, int x, int y, int z, Random rand) { super.randomDisplayTick(world, x, y, z, rand); - NBTTagCompound data = new NBTTagCompound(); - data.setString("type", "deadleaf"); - MainRegistry.proxy.effectNT(data); - }*/ + if(rand.nextInt(5) == 0 && world.getBlock(x, y - 1, z).getMaterial() == Material.air) { + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "deadleaf"); + data.setDouble("posX", x + rand.nextDouble()); + data.setDouble("posY", y - 0.05); + data.setDouble("posZ", z + rand.nextDouble()); + MainRegistry.proxy.effectNT(data); + } + } public boolean renderAsNormalBlock() { return false; diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineBattery.java b/src/main/java/com/hbm/inventory/gui/GUIMachineBattery.java index 0893627c1..d39f4eec2 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineBattery.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineBattery.java @@ -36,14 +36,14 @@ public class GUIMachineBattery extends GuiInfoContainer { this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 69 - 52, 52, 52, battery.power, battery.maxPower); long delta = battery.log[19] - battery.log[0]; - String deltaText = Library.getShortNumber(delta) + "HE/s"; + String deltaText = Library.getShortNumber(Math.abs(delta)) + "HE/s"; if(delta > 0) deltaText = EnumChatFormatting.GREEN + "+" + deltaText; else if(delta < 0) - deltaText = EnumChatFormatting.RED + "+" + deltaText; + deltaText = EnumChatFormatting.RED + "-" + deltaText; else - deltaText = EnumChatFormatting.YELLOW + deltaText; + deltaText = EnumChatFormatting.YELLOW + "+" + deltaText; String[] info = { Library.getShortNumber(battery.power) + "/" + Library.getShortNumber(battery.maxPower) + "HE", diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index 6e0c98846..259c44e31 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -70,10 +70,10 @@ public class HbmWorldGen implements IWorldGenerator { DungeonToolbox.generateOre(world, rand, i, j, 1, 64, 32, 32, ModBlocks.ore_coal_oil); if(WorldConfig.gasbubbleSpawn > 0 && rand.nextInt(WorldConfig.gasbubbleSpawn) == 0) - DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_flammable); + DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_flammable, 1); if(WorldConfig.explosivebubbleSpawn > 0 && rand.nextInt(WorldConfig.explosivebubbleSpawn) == 0) - DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_explosive); + DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_explosive, 1); DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_iron, rand, 24); DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_titanium, rand, 32); diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index 7784905a1..047e62cc9 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -865,14 +865,17 @@ public class ModEventHandlerClient { event.green = 0.0F; event.blue = 0.0F; }*/ - + public static IIcon particleBase; + public static IIcon particleLeaf; @SubscribeEvent public void onTextureStitch(TextureStitchEvent.Pre event) { - if(event.map.getTextureType() == 0) + if(event.map.getTextureType() == 0) { particleBase = event.map.registerIcon(RefStrings.MODID + ":particle/particle_base"); + particleLeaf = event.map.registerIcon(RefStrings.MODID + ":particle/dead_leaf"); + } } @SubscribeEvent diff --git a/src/main/java/com/hbm/particle/ParticleCoolingTower.java b/src/main/java/com/hbm/particle/ParticleCoolingTower.java index 5979ea819..265d58c6d 100644 --- a/src/main/java/com/hbm/particle/ParticleCoolingTower.java +++ b/src/main/java/com/hbm/particle/ParticleCoolingTower.java @@ -85,6 +85,8 @@ public class ParticleCoolingTower extends EntityFX { public void renderParticle(Tessellator tess, float interp, float fX, float fY, float fZ, float sX, float sZ) { + tess.setNormal(0.0F, 1.0F, 0.0F); + tess.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); float scale = this.particleScale; diff --git a/src/main/java/com/hbm/particle/ParticleDeadLeaf.java b/src/main/java/com/hbm/particle/ParticleDeadLeaf.java index bc498c7e0..76d19cb40 100644 --- a/src/main/java/com/hbm/particle/ParticleDeadLeaf.java +++ b/src/main/java/com/hbm/particle/ParticleDeadLeaf.java @@ -1,13 +1,12 @@ package com.hbm.particle; -import com.hbm.lib.RefStrings; +import com.hbm.main.ModEventHandlerClient; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; @SideOnly(Side.CLIENT) @@ -15,11 +14,10 @@ public class ParticleDeadLeaf extends EntityFX { public ParticleDeadLeaf(TextureManager texman, World world, double x, double y, double z) { super(world, x, y, z); - this.particleRed = 0.7F + world.rand.nextFloat() * 0.05F; - this.particleGreen = 0.2F + world.rand.nextFloat() * 0.05F; - this.particleBlue = 0.2F + world.rand.nextFloat() * 0.05F; - this.particleScale = 1F; - this.particleMaxAge = 100 + world.rand.nextInt(20); + particleIcon = ModEventHandlerClient.particleLeaf; + this.particleRed = this.particleGreen = this.particleBlue = 1F - world.rand.nextFloat() * 0.2F; + this.particleScale = 0.1F; + this.particleMaxAge = 200 + world.rand.nextInt(50); this.particleGravity = 0.2F; } @@ -31,25 +29,37 @@ public class ParticleDeadLeaf extends EntityFX { super.onUpdate(); if(!this.onGround) { - this.motionX += rand.nextGaussian() * 0.075D; - this.motionZ += rand.nextGaussian() * 0.075D; + this.motionX += rand.nextGaussian() * 0.002D; + this.motionZ += rand.nextGaussian() * 0.002D; + + if(this.motionY < -0.025D) + this.motionY = -0.025D; } } @Override - public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) { + public void renderParticle(Tessellator tess, float interp, float fX, float fY, float fZ, float sX, float sZ) { tess.setNormal(0.0F, 1.0F, 0.0F); + tess.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); - float f10 = this.particleScale * 0.1F; - float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX); - float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY); - float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ); + float scale = this.particleScale; + float pX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX); + float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY); + float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ); - tess.addVertexWithUV((double) (f11 - x * f10 - tx * f10), (double) (f12 - y * f10), (double) (f13 - z * f10 - tz * f10), (double) 0, (double) 0); - tess.addVertexWithUV((double) (f11 - x * f10 + tx * f10), (double) (f12 + y * f10), (double) (f13 - z * f10 + tz * f10), (double) 0, (double) 1); - tess.addVertexWithUV((double) (f11 + x * f10 + tx * f10), (double) (f12 + y * f10), (double) (f13 + z * f10 + tz * f10), (double) 1, (double) 1); - tess.addVertexWithUV((double)(f11 + x * f10 - tx * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - tz * f10), (double)1, (double)0); + boolean flipU = this.getEntityId() % 2 == 0; + boolean flipV = this.getEntityId() % 4 < 2; + + double minU = flipU ? particleIcon.getMaxU() : particleIcon.getMinU(); + double maxU = flipU ? particleIcon.getMinU() : particleIcon.getMaxU(); + double minV = flipV ? particleIcon.getMaxV() : particleIcon.getMinV(); + double maxV = flipV ? particleIcon.getMinV() : particleIcon.getMaxV(); + + tess.addVertexWithUV((double) (pX - fX * scale - sX * scale), (double) (pY - fY * scale), (double) (pZ - fZ * scale - sZ * scale), maxU, maxV); + tess.addVertexWithUV((double) (pX - fX * scale + sX * scale), (double) (pY + fY * scale), (double) (pZ - fZ * scale + sZ * scale), maxU, minV); + tess.addVertexWithUV((double) (pX + fX * scale + sX * scale), (double) (pY + fY * scale), (double) (pZ + fZ * scale + sZ * scale), minU, minV); + tess.addVertexWithUV((double) (pX + fX * scale - sX * scale), (double) (pY - fY * scale), (double) (pZ + fZ * scale - sZ * scale), minU, maxV); } } \ No newline at end of file diff --git a/src/main/java/com/hbm/render/tileentity/RenderBobble.java b/src/main/java/com/hbm/render/tileentity/RenderBobble.java index 4526a77b9..213a39674 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderBobble.java +++ b/src/main/java/com/hbm/render/tileentity/RenderBobble.java @@ -31,6 +31,7 @@ public class RenderBobble extends TileEntitySpecialRenderer { public static final ResourceLocation bobble_pu238 = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/pellet.png"); public static final ResourceLocation bobble_frizzle = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/frizzle.png"); public static final ResourceLocation bobble_vt = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/vt.png"); + public static final ResourceLocation bobble_doc = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/doctor17ph.png"); public static final ResourceLocation bobble_cirno = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/cirno.png"); @Override @@ -74,6 +75,7 @@ public class RenderBobble extends TileEntitySpecialRenderer { case PU238: texman.bindTexture(bobble_pu238); break; case FRIZZLE: texman.bindTexture(bobble_frizzle); break; case VT: texman.bindTexture(bobble_vt); break; + case DOC: texman.bindTexture(bobble_doc); break; case CIRNO: texman.bindTexture(bobble_cirno); break; default: texman.bindTexture(ResourceManager.universal); } @@ -149,15 +151,12 @@ public class RenderBobble extends TileEntitySpecialRenderer { rotRightArm = new double[]{-135, -45, 0}; rotRightLeg = new double[]{-5, 0, 0}; break; - case BOB: break; - case PU238: break; case VT: rotLeftArm = new double[]{0, -45, 60}; rotRightArm = new double[]{0, 0, 45}; rotLeftLeg = new double[]{2, 0, 0}; rotRightLeg = new double[]{-2, 0, 0}; break; - case CIRNO: break; } } diff --git a/src/main/resources/assets/hbm/textures/blocks/particle/dead_leaf.png b/src/main/resources/assets/hbm/textures/blocks/particle/dead_leaf.png new file mode 100644 index 000000000..455524875 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/particle/dead_leaf.png differ diff --git a/src/main/resources/assets/hbm/textures/models/trinkets/doctor17ph.png b/src/main/resources/assets/hbm/textures/models/trinkets/doctor17ph.png new file mode 100644 index 000000000..f9c593c89 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/models/trinkets/doctor17ph.png differ diff --git a/src/main/resources/assets/hbm/textures/particle/dead_leaf.png b/src/main/resources/assets/hbm/textures/particle/dead_leaf.png deleted file mode 100644 index 80a8b21d3..000000000 Binary files a/src/main/resources/assets/hbm/textures/particle/dead_leaf.png and /dev/null differ