From 79394a84c8b7238f5867508712bfe03adc6ea470 Mon Sep 17 00:00:00 2001 From: Bob Date: Wed, 10 Nov 2021 22:08:25 +0100 Subject: [PATCH] patched up dead leaf particles, small fixes --- .../java/com/hbm/blocks/gas/BlockGasBase.java | 14 ++++- .../com/hbm/blocks/generic/BlockBobble.java | 1 + .../com/hbm/blocks/generic/WasteLeaves.java | 15 ++++-- .../hbm/inventory/gui/GUIMachineBattery.java | 6 +-- src/main/java/com/hbm/lib/HbmWorldGen.java | 4 +- .../com/hbm/main/ModEventHandlerClient.java | 7 ++- .../hbm/particle/ParticleCoolingTower.java | 2 + .../com/hbm/particle/ParticleDeadLeaf.java | 48 +++++++++++------- .../hbm/render/tileentity/RenderBobble.java | 5 +- .../textures/blocks/particle/dead_leaf.png | Bin 0 -> 154 bytes .../textures/models/trinkets/doctor17ph.png | Bin 0 -> 2814 bytes .../hbm/textures/particle/dead_leaf.png | Bin 184 -> 0 bytes 12 files changed, 67 insertions(+), 35 deletions(-) create mode 100644 src/main/resources/assets/hbm/textures/blocks/particle/dead_leaf.png create mode 100644 src/main/resources/assets/hbm/textures/models/trinkets/doctor17ph.png delete mode 100644 src/main/resources/assets/hbm/textures/particle/dead_leaf.png 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 0000000000000000000000000000000000000000..4555248758cae01512e37b14174ee87b9fca0e72 GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqEX7WqAsj$Z!;#Vf-X0kR{egz=EMn($u&P;YByWRn;$;y zA20b#b}!5I6D-Lcp9_r*3=9@{EMh3x-O0wF*Dj;^M$IxBXgGtXtDnm{r-UW|J*qYg literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..f9c593c892071f655af29db9b0cc08e3ad91b485 GIT binary patch literal 2814 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_cPe*6Fc00(qQO+^Rd2^bX@ z7n4|R;s5{u7<5HgbW?9;ba!ELWdLwtX>N2bZe?^JG%hhNF=Hy6O8@{0TuDShRCr$P zT5D{ZR~fF_=Hg47dz#d3(%hY!9pCN5_UFWjlh{d{G;xw{ohr&*)6keSAtA&cejrU6 z5|f}CMH_;x+Yh8tA(#-|sERVwB)y|`D^Lw68e^sEnr**WAKv%)JK>9y%%!f^MDi;= zI`4PR@yU6f^SMX#906Ki zrbg;-rLX$EE@_Xa75tXnTa)M>11X0sU*YSo%`_iQ{tNtTK7q~r=q zk~eSOgv;exes;UvxOMB65P}7eM46NniGR;^vXp|zzETWz8Y@VpLhZ8LM}54j-=sCU z>XMvXJudnA4&f6b#l-#>0V`j6Brzt${ke{P7Lv){O$4kr>9t6$Rj0M}>en=$EU!Eh z;-gEF;fYIv41U&5JhhF(ps%9IL9Tf)*tOc`NYIwO3Dkc;%(%)$XgT#-Kx$X?;+abof+zIJg&wlzn)F z$|t5~arNYP1aSQq0&2H=w{!xi-PSc0;9x9@J@f+@}cGN5uEyOVM${e*EgWZ;I7t@?5Ij?%t+*qL^?hm~ixA$`i$yD}*t7 zkC;qRQ4tCY3t=*uU@#a^U0scFdmj>>K@4^I5NvHnq|1XLs}D+>9TBS+X1xyeCIg<# zZ>321P=I~2QIDO}rnK6jSX`oie}@~9b_e3!e#{0VNO*&UekAkQ)1z&K{8 zZps-&+#1HDV~G4Anr9eON-sV)6v5%aIL7@UO!g{xBoxCzC5}n|KzczQ>WO34J487( zgabXX6#|${MbPW@*ili2in3C)?`}#8piYnl=xg^N)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textures/particle/dead_leaf.png deleted file mode 100644 index 80a8b21d31962a680d966c83cd3735cc1c267771..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufG}g$wN6f;ps%NkV~9p@@&en0mPI8oWjJ$ a#_&*sKkNIVqYr@wGkCiCxvX