From 589c08ac2c5b31bd0403774299ffb12980fa028a Mon Sep 17 00:00:00 2001 From: Forstride Date: Mon, 8 Jan 2024 00:03:16 -0500 Subject: [PATCH] Prevented Thermoregulator from spawning particles if the face in front of it is solid --- .../block/ThermoregulatorBlock.java | 9 ++++++--- .../particle/thermoregulator_neutral_0.png | Bin 149 -> 172 bytes .../particle/thermoregulator_neutral_1.png | Bin 166 -> 166 bytes .../particle/thermoregulator_neutral_2.png | Bin 163 -> 140 bytes .../particle/thermoregulator_neutral_3.png | Bin 138 -> 128 bytes 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/toughasnails/block/ThermoregulatorBlock.java b/common/src/main/java/toughasnails/block/ThermoregulatorBlock.java index a353b2e8..07d2630e 100644 --- a/common/src/main/java/toughasnails/block/ThermoregulatorBlock.java +++ b/common/src/main/java/toughasnails/block/ThermoregulatorBlock.java @@ -127,14 +127,17 @@ public void animateTick(BlockState p_221253_, Level p_221254_, BlockPos p_221255 boolean cooling = p_221253_.getValue(COOLING); boolean heating = p_221253_.getValue(HEATING); - if (cooling || heating) + Direction direction = p_221253_.getValue(FACING); + Direction.Axis direction$axis = direction.getAxis(); + BlockPos blockpos = p_221255_.relative(direction); + BlockState blockstate = p_221254_.getBlockState(blockpos); + + if ((cooling || heating) && !isFaceFull(blockstate.getCollisionShape(p_221254_, blockpos), direction.getOpposite())) { double d0 = (double)p_221255_.getX() + 0.5D; double d1 = (double)p_221255_.getY() + 0.5D; double d2 = (double)p_221255_.getZ() + 0.5D; - Direction direction = p_221253_.getValue(FACING); - Direction.Axis direction$axis = direction.getAxis(); double d4 = (p_221256_.nextDouble() * 0.3D) - (p_221256_.nextDouble() * 0.3D); double d5 = direction$axis == Direction.Axis.X ? (double)direction.getStepX() * 0.55D : d4; double d6 = direction$axis == Direction.Axis.Z ? (double)direction.getStepZ() * 0.55D : d4; diff --git a/common/src/main/resources/assets/toughasnails/textures/particle/thermoregulator_neutral_0.png b/common/src/main/resources/assets/toughasnails/textures/particle/thermoregulator_neutral_0.png index e00fd24ccfd407bcaf497147410f671d33e287c0..f10fe8608981ca137b1d59c167145dc171fd7d2d 100644 GIT binary patch delta 93 zcmbQrxQ1~;SeT=yi(`mHcrrud|A2;bX)T5u7}eVDZ&%P!ILpCuqQ>CI|JQ0=c^2|V x7?@Wu7|j=4*A>c}B+}EyxFIWLZh{#zGlRH(pv~Fssh=5uz|+;wWt~$(698{~A-wkKWZrECAnsfa+!f5sYl=j10eTfh9mR1_0|uw+}a9U;qHV9X6&K{8!lk0000X^4yd`Clrm!?@Ux!GmeJ d3THzjBZHHNxNXTk*LOh044$rjF6*2UngBv=7BT<; delta 97 zcmeBST+BGZGwKin1K%M=Q4OyK1_lNTPZ!4!iST3vsXy$E@#g=Xck=WoFsZOTb7WK& zXvk1Ac>i73fOYZ2(q={v1|A2KFwYXlI}MGD47F`qv3|xE%z$Pvc)I$ztaD0e0sw=h B9ccgn diff --git a/common/src/main/resources/assets/toughasnails/textures/particle/thermoregulator_neutral_3.png b/common/src/main/resources/assets/toughasnails/textures/particle/thermoregulator_neutral_3.png index 6b0346d68d38404705e8f583517fed761e4e18ab..3dc92af5a9fff92556e30b31c33029b5bf6d7cda 100644 GIT binary patch delta 62 zcmeBTY+#(=X}+I|&hY>3D#Ff$sog*0oMf1_lOsPZ!4!iSXnFd_Vrbepas`Ec%C?DMgC;!4*%X cgaif#gRA_rkGXww1}bInboFyt=akR{0AmywD*ylh