From fcd979fde4c016f3d30ae20dd286f5c3b7137b56 Mon Sep 17 00:00:00 2001 From: Forstride Date: Sun, 7 Jan 2024 16:18:32 -0500 Subject: [PATCH] Only drop temperature in tropical biomes during mid wet season if the default temperature is hot --- .../block/ThermoregulatorBlock.java | 32 +++++++++++++++++- .../toughasnails/particles/cooling.json | 8 +++++ .../toughasnails/particles/heating.json | 8 +++++ .../assets/toughasnails/particles/vapor.json | 8 +++++ .../textures/item/thermometer_00.png | Bin 353 -> 358 bytes .../textures/item/thermometer_20.png | Bin 351 -> 357 bytes .../textures/particle/cooling_0.png | Bin 0 -> 119 bytes .../textures/particle/cooling_1.png | Bin 0 -> 119 bytes .../textures/particle/cooling_2.png | Bin 0 -> 119 bytes .../textures/particle/cooling_3.png | Bin 0 -> 119 bytes .../textures/particle/heating_0.png | Bin 0 -> 119 bytes .../textures/particle/heating_1.png | Bin 0 -> 119 bytes .../textures/particle/heating_2.png | Bin 0 -> 119 bytes .../textures/particle/heating_3.png | Bin 0 -> 119 bytes .../textures/particle/vapor_0.png | Bin 0 -> 165 bytes .../textures/particle/vapor_1.png | Bin 0 -> 162 bytes .../textures/particle/vapor_2.png | Bin 0 -> 136 bytes .../textures/particle/vapor_3.png | Bin 0 -> 126 bytes .../forge/init/ModCompatibility.java | 3 +- 19 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 common/src/main/resources/assets/toughasnails/particles/cooling.json create mode 100644 common/src/main/resources/assets/toughasnails/particles/heating.json create mode 100644 common/src/main/resources/assets/toughasnails/particles/vapor.json create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/cooling_0.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/cooling_1.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/cooling_2.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/cooling_3.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/heating_0.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/heating_1.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/heating_2.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/heating_3.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/vapor_0.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/vapor_1.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/vapor_2.png create mode 100644 common/src/main/resources/assets/toughasnails/textures/particle/vapor_3.png diff --git a/common/src/main/java/toughasnails/block/ThermoregulatorBlock.java b/common/src/main/java/toughasnails/block/ThermoregulatorBlock.java index ea85fd05..308e0e97 100644 --- a/common/src/main/java/toughasnails/block/ThermoregulatorBlock.java +++ b/common/src/main/java/toughasnails/block/ThermoregulatorBlock.java @@ -7,6 +7,8 @@ import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -23,7 +25,6 @@ import net.minecraft.world.phys.BlockHitResult; import toughasnails.api.blockentity.TANBlockEntityTypes; import toughasnails.block.entity.ThermoregulatorBlockEntity; -import toughasnails.block.entity.WaterPurifierBlockEntity; import javax.annotation.Nullable; import java.util.function.ToIntFunction; @@ -110,4 +111,33 @@ public RenderShape getRenderShape(BlockState state) { return RenderShape.MODEL; } + + /*@Override + public void animateTick(BlockState p_221253_, Level p_221254_, BlockPos p_221255_, RandomSource p_221256_) + { + boolean cooling = p_221253_.getValue(COOLING); + boolean heating = p_221253_.getValue(HEATING); + + if (cooling || heating) + { + 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; + + double ymove = (p_221256_.nextDouble() * 0.05D) - (p_221256_.nextDouble() * 0.05D); + double xmove = direction$axis == Direction.Axis.X ? (double)direction.getStepX() * 0.15D : ymove; + double zmove = direction$axis == Direction.Axis.Z ? (double)direction.getStepZ() * 0.15D : ymove; + + p_221254_.addParticle(ParticleTypes.CAMPFIRE_COSY_SMOKE, d0 + d5, d1 + d4, d2 + d6, xmove, ymove, zmove); + + if (cooling && p_221256_.nextInt(6) == 0) { p_221254_.addParticle(ParticleTypes.SNOWFLAKE, d0 + d5, d1 + d6, d2 + d6, xmove, ymove, zmove); } + if (heating && p_221256_.nextInt(6) == 0) { p_221254_.addParticle(ParticleTypes.SMALL_FLAME, d0 + d5, d1 + d6, d2 + d6, xmove, ymove, zmove); } + } + }*/ } diff --git a/common/src/main/resources/assets/toughasnails/particles/cooling.json b/common/src/main/resources/assets/toughasnails/particles/cooling.json new file mode 100644 index 00000000..b657390b --- /dev/null +++ b/common/src/main/resources/assets/toughasnails/particles/cooling.json @@ -0,0 +1,8 @@ +{ + "textures": [ + "toughasnails:cooling_0", + "toughasnails:cooling_1", + "toughasnails:cooling_2", + "toughasnails:cooling_3" + ] +} diff --git a/common/src/main/resources/assets/toughasnails/particles/heating.json b/common/src/main/resources/assets/toughasnails/particles/heating.json new file mode 100644 index 00000000..1ec881c0 --- /dev/null +++ b/common/src/main/resources/assets/toughasnails/particles/heating.json @@ -0,0 +1,8 @@ +{ + "textures": [ + "toughasnails:heating_0", + "toughasnails:heating_1", + "toughasnails:heating_2", + "toughasnails:heating_3" + ] +} diff --git a/common/src/main/resources/assets/toughasnails/particles/vapor.json b/common/src/main/resources/assets/toughasnails/particles/vapor.json new file mode 100644 index 00000000..079b20f7 --- /dev/null +++ b/common/src/main/resources/assets/toughasnails/particles/vapor.json @@ -0,0 +1,8 @@ +{ + "textures": [ + "toughasnails:vapor_0", + "toughasnails:vapor_1", + "toughasnails:vapor_2", + "toughasnails:vapor_3" + ] +} diff --git a/common/src/main/resources/assets/toughasnails/textures/item/thermometer_00.png b/common/src/main/resources/assets/toughasnails/textures/item/thermometer_00.png index 4a8484fc3bde9659b4d955b530920c7087f28f3e..d3521d578151ba54f8f56444fbf70167364781fe 100644 GIT binary patch delta 235 zcmaFJ^o(hOBcu03C%5{CfBw&L)ns5`h%Z~g1EeHNg8YL2;{XhdCS2QriZ}~AB8wRq z`1XS^qXlcQ3Q(}#)5S4FBRKZlL7_tmJgyg2l!B&Q3KIPH-}|h0miRr^!`7EyI(%L) z>|vc>Ca}3fm~XDR@5%T^i_)76B=Vk|4j}i3>&Q|NsBba8_9F6;O<`z$3Dl zfq`#72s2u+2CD!C>pWc?Lo|Y8&z%-(RuFKxIFnP+P+O_dm`_J+Mj5>0TLo^fiAkOL_5{z^jk> zT|at;Ue5h)Qa@#xXtmj%rGgq~da4^tjvViH)>rX+!>D4mjxT)ge+Hp`-osP$Rj&h` O!r7^NtOip1^>qZ7#K~swgVM$7I;J! zGcfS&2Vq7F)?gK&V4bInV~9p@?7544hZJ~PA8u1Jn$pWFa__(A+f4DzKjH<>l{+r@ zd7X2~TyyJ=$RnKX=Vm7?d*UE-D7IVBX_uzopr0Ek!`>i_@% literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/toughasnails/textures/particle/cooling_2.png b/common/src/main/resources/assets/toughasnails/textures/particle/cooling_2.png new file mode 100644 index 0000000000000000000000000000000000000000..e7c1dfb5aad0b396f0c6a9243860ba93ee124831 GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2s6ii6yp7}lMWc?smOq&xaLGB9lH z=l+w(3gmMZctjR6Fz_7&Va6R3v)=**c|2VlLnOkJBR>AMXJC2BG(YM|vo27a!PC{x JWt~$(69C>W9hm?C literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/toughasnails/textures/particle/cooling_3.png b/common/src/main/resources/assets/toughasnails/textures/particle/cooling_3.png new file mode 100644 index 0000000000000000000000000000000000000000..7cdeb876410f6d8d472286a16a9ddff205745c7f GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2s6ii6yp7}lMWc?smOq&xaLGB9lH z=l+w(3gmMZctjR6Fz_7$VMb96uLhtXkEe@ch(vgD#gFIq46O5*?v|=N&;*Jzc)I$z JtaD0e0sx#T8@d1h literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/toughasnails/textures/particle/heating_0.png b/common/src/main/resources/assets/toughasnails/textures/particle/heating_0.png new file mode 100644 index 0000000000000000000000000000000000000000..10506a186dcfcf6beddd940a43bbb2bc26b9f423 GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2s6ii6yp7}lMWc?smOq&xaLGB9lH z=l+w(3gmMZctjR6Fz_7$VMb96uLhtXkEe@ch(vg@g{%e(1G6Nfe(yskUZ6OGr>mdK II;Vst09XPTiU0rr literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/toughasnails/textures/particle/heating_1.png b/common/src/main/resources/assets/toughasnails/textures/particle/heating_1.png new file mode 100644 index 0000000000000000000000000000000000000000..6abb57f311227d1056a7c8b9fea849eabecde798 GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2s6ii6yp7}lMWc?smOq&xaLGB9lH z=l+w(3gmMZctjR6Fz_7$VMb96uLhtXkEe@ch(vgD#Z_f42IlvSJvOVa8Ue)_JYD@< J);T3K0RV?n8s`82 literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/toughasnails/textures/particle/heating_2.png b/common/src/main/resources/assets/toughasnails/textures/particle/heating_2.png new file mode 100644 index 0000000000000000000000000000000000000000..a8af778463be9f60bedde2b56f09984a739070df GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2s6ii6yp7}lMWc?smOq&xaLGB9lH z=l+w(3gmMZctjR6Fz_7&Va6R3v)=**c|2VlLnOkJf9yXc$G|d$@#R~_2Qz@;44$rj JF6*2UngHgc9v=Vz literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/toughasnails/textures/particle/heating_3.png b/common/src/main/resources/assets/toughasnails/textures/particle/heating_3.png new file mode 100644 index 0000000000000000000000000000000000000000..fe11b6265ba0ed0d9c2338610d54c2541a2ac95d GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2s6ii6yp7}lMWc?smOq&xaLGB9lH z=l+w(3gmMZctjR6Fz_7$VMb96uLhtXkEe@ch(vhukD_292A0)~&rj|@=KvIE@O1Ta JS?83{1OS@u8~gwO literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/toughasnails/textures/particle/vapor_0.png b/common/src/main/resources/assets/toughasnails/textures/particle/vapor_0.png new file mode 100644 index 0000000000000000000000000000000000000000..e95370a84434366cc44e76be17076561989721f5 GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^>>$j+1|*LJg?p>$j+1|*LJg`W>$j+1|*LJg*23`1M6Ig2^qI bNkW2Q*D2vZ6&)D|ph5;uS3j3^P6>$j+1|*LJg_*nwf-ZC&VGfZ`1{<|qz Rei2Zb!PC{xWt~$(699@u9wGn$ literal 0 HcmV?d00001 diff --git a/forge/src/main/java/toughasnails/forge/init/ModCompatibility.java b/forge/src/main/java/toughasnails/forge/init/ModCompatibility.java index d3b949e0..6eaea8d1 100644 --- a/forge/src/main/java/toughasnails/forge/init/ModCompatibility.java +++ b/forge/src/main/java/toughasnails/forge/init/ModCompatibility.java @@ -59,7 +59,8 @@ private static TemperatureLevel seasonModifier(Level level, BlockPos pos, Temper break; case MID_WET: - current = current.decrement(1); + if (current == TemperatureLevel.HOT) + current = current.decrement(1); break; }