From d605a82b0722e5986ce308672a23fa864896891e Mon Sep 17 00:00:00 2001 From: Forstride Date: Fri, 5 Jan 2024 14:03:50 -0500 Subject: [PATCH] Added dripping water particles to the Water Purifier and gave some oxidation to the Water Purifier textures --- .../block/WaterPurifierBlock.java | 27 ++++++++++++++---- .../entity/WaterPurifierBlockEntity.java | 5 ++-- .../textures/block/water_purifier_bottom.png | Bin 232 -> 251 bytes .../textures/block/water_purifier_front.png | Bin 351 -> 392 bytes .../textures/block/water_purifier_inner.png | Bin 282 -> 279 bytes .../textures/block/water_purifier_side.png | Bin 338 -> 367 bytes 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/common/src/main/java/toughasnails/block/WaterPurifierBlock.java b/common/src/main/java/toughasnails/block/WaterPurifierBlock.java index 38de386c..bbd1f02a 100644 --- a/common/src/main/java/toughasnails/block/WaterPurifierBlock.java +++ b/common/src/main/java/toughasnails/block/WaterPurifierBlock.java @@ -4,11 +4,11 @@ ******************************************************************************/ package toughasnails.block; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Maps; 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.Containers; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -17,7 +17,6 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; -import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.entity.BlockEntity; @@ -28,13 +27,10 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.DirectionProperty; import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.shapes.CollisionContext; -import net.minecraft.world.phys.shapes.VoxelShape; import toughasnails.api.blockentity.TANBlockEntityTypes; import toughasnails.block.entity.WaterPurifierBlockEntity; import javax.annotation.Nullable; -import java.util.Map; public class WaterPurifierBlock extends BaseEntityBlock { @@ -152,4 +148,23 @@ public RenderShape getRenderShape(BlockState state) { return RenderShape.MODEL; } + + @Override + public void animateTick(BlockState p_221253_, Level p_221254_, BlockPos p_221255_, RandomSource p_221256_) + { + if (p_221253_.getValue(PURIFYING) && p_221256_.nextInt(12) == 0) + { + double d0 = (double)p_221255_.getX() + 0.5D; + double d1 = (double)p_221255_.getY() + 0.4D; + 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.4D - 0.2D; + double d5 = direction$axis == Direction.Axis.X ? (double)direction.getStepX() * 0.55D : d4; + double d6 = p_221256_.nextDouble() * 1.0D / 16.0D; + double d7 = direction$axis == Direction.Axis.Z ? (double)direction.getStepZ() * 0.55D : d4; + p_221254_.addParticle(ParticleTypes.DRIPPING_WATER, d0 + d5, d1 + d6, d2 + d7, 0.0D, 0.0D, 0.0D); + } + } } diff --git a/common/src/main/java/toughasnails/block/entity/WaterPurifierBlockEntity.java b/common/src/main/java/toughasnails/block/entity/WaterPurifierBlockEntity.java index 8fb4e83d..b0de0389 100644 --- a/common/src/main/java/toughasnails/block/entity/WaterPurifierBlockEntity.java +++ b/common/src/main/java/toughasnails/block/entity/WaterPurifierBlockEntity.java @@ -27,7 +27,6 @@ import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; import net.minecraft.world.level.block.state.BlockState; @@ -432,8 +431,8 @@ private static void add(ImmutableMap.Builder builder, TagKey builder, ItemLike itemLike, int i) { - Item item = itemLike.asItem(); + private static void add(ImmutableMap.Builder builder, Item item, int i) + { builder.put(item, i); } } diff --git a/common/src/main/resources/assets/toughasnails/textures/block/water_purifier_bottom.png b/common/src/main/resources/assets/toughasnails/textures/block/water_purifier_bottom.png index c4ee61bcec23e40d44a08aba4b0de20aff87e67a..d26a7944040ad19be513a939c73f453b8384f825 100644 GIT binary patch delta 194 zcmV;z06qWc0s8@vL4O!fOjJdpkaen;dYFi7ihW^Bl!QHaWHw|`fpAuSv+8vK000Sa zNLh0L01mun?Z@hub4tTaCLqrQ< wTdPmPMtw9#bJnKEOy(LDNi$ng|2Jaz03o^#_+oDb8UO$Q07*qoM6N<$f)x!)6#xJL delta 175 zcmV;g08sz?0q6mcL4OZWOjJdpkaen;dYFi7ihW^$a8~F?Fs}dr010qNS#tmY4#NNd z4#NS*Z>VGd003f1L_t&-(=CqM4Zt7_#0(Pv?EoQ6z+(g0f2Jm=`8nxipF+s@5=G+_ zVx>qMKp>$Y-dGYP@b0zeI-QhpD^Q}d7~|pkqk?Ly2G4WWb|~29FAQyn!H-F{*(puT d(*D1Z(+A*q3V&$_Mgjl;002ovPDHLkV1h0fNcI2# diff --git a/common/src/main/resources/assets/toughasnails/textures/block/water_purifier_front.png b/common/src/main/resources/assets/toughasnails/textures/block/water_purifier_front.png index 785e5d1243054531f109f6c7176b79940258fec4..944c3b0c23e63f6f66f612235369fdfd7b658546 100644 GIT binary patch delta 314 zcmcc5)WJN#F+D24C&YEdg_{>%y}VW(JuATCaZ}FnD2H>s&6O!3-3QO^YAUZ@w>@Wi zOxnuwtU~t)U+dCTpPV>PMMcHHCEd0aDT0E6K2us+%A?Iv0&T3V7fmQ#HNC34yK6>A zHUk5L^@(%`ASE|(f@J-FC}4OaArl7_cd>@7}LbZZd~Q9C$$@xjD7Eh&DAY07Pu9-JR1iO4=#<9*00%Cx>`O=fEV zZ&g#1bn5FBXV*SB7U#7x)NrD8Sk_xzhq4dNt*#OYT%X0)r3o>62m0CpUB=+)>gTe~ HDWM4f_Y8&` delta 277 zcmV+w0qXvU1K$FWK~q9dOjJdv(Am)H>DGH&nov07f^4T+K#Rf6d#<;_YfM;8J9TAD zY+gwrAt4bF5rlVJkV!E-J3FF~b*h(oi;Iewh-&}<0G}Bgxc~qF7IachQ<1S1e*gi} zz~le`010qNS#tmY4!{5a4!{9w)`=(e6fbWn(N08hN<{G{ougn0|1{1*9N1Q(^$kV?sU7h;5LP?;2OJ{^{jl(Z%} zn{!Hq;1mrVv}P${C0^FPPP2GHH<*cSP;jH)3-ft*+<1ELV;Cm#!O9q`3FHDlSXq?; brZWEk&?*b#qnA$?00000NkvXXu0mjflFV=7 diff --git a/common/src/main/resources/assets/toughasnails/textures/block/water_purifier_inner.png b/common/src/main/resources/assets/toughasnails/textures/block/water_purifier_inner.png index 38e84ff13af9a90f90c76e8a7654278564921af0..4b4bdf36cbe21219b6e67c74558b509e9cb9dedd 100644 GIT binary patch delta 116 zcmbQmG@WUJqpNy=Pl)S^3pX#kdbwyq>8j~fGdi-nY7@H;o^31$^O@38y>7d0O~!PFKHDd-fMbqe(8lK_6K`va#7k?; Ue1Cnn15g8lr>mdKI;Vst0REXUn*aa+ delta 119 zcmbQvG>d71qlZ?2Pl)S^3pX#kdbwyq>8j~fGdi-nY7@H;o^31$TOQ?5y>9!g0E*So+=En2rndRBnNx!&f=l#uR&XLmJ~=S+`DTUnk}=w7{U zdxWobX{t|7oM%gUbl{S1+lrJ$6G~@vWcy5M>F(|_O9@;xy^4W>fm?Uoav&vH666>B z9|vGyG~wC~RK!`}Q6E{%z`(a3gc&VZgH?c{9iA?ZAsWGf8Z1NY?!v|OtqF$6NWA!<1bL^>=+Dngr%!`bUy;awcymMXmd1hRIC)rmeZT|MSy_#j) o<mdKI;Vst0ABWvcmMzZ delta 282 zcmaFQbctz#W4&d7Pl)S^3pX#kdU>rndRBnNVq)h8#; zv!y(G(S*_&9ogO8T@ySFS52>CU|`_W%#j3A!X-g|!T&J;!=~Ch96)K#0*}aIpyGod z%(!D>_FJG}v!{z=h(>*IXb(5vVFM25%*{(4PB+{6KQaA;Nv^*U8@Gbh3!RdNk~7(R zUwIvx_=nvkckO5O48a&{&+IGF?=$R|mL@T#-xW#>Vh*1=W#*(^r&k-CLI3~&