diff --git a/src/main/java/com/uraneptus/sullysmod/common/blockentities/AmberBE.java b/src/main/java/com/uraneptus/sullysmod/common/blockentities/AmberBE.java index 75a2d604..986b8c49 100644 --- a/src/main/java/com/uraneptus/sullysmod/common/blockentities/AmberBE.java +++ b/src/main/java/com/uraneptus/sullysmod/common/blockentities/AmberBE.java @@ -1,7 +1,6 @@ package com.uraneptus.sullysmod.common.blockentities; import com.uraneptus.sullysmod.core.registry.SMBlockEntityTypes; -import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; @@ -9,7 +8,6 @@ import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; diff --git a/src/main/java/com/uraneptus/sullysmod/common/blocks/AmberBlock.java b/src/main/java/com/uraneptus/sullysmod/common/blocks/AmberBlock.java index 2d52b4b6..e8a0a100 100644 --- a/src/main/java/com/uraneptus/sullysmod/common/blocks/AmberBlock.java +++ b/src/main/java/com/uraneptus/sullysmod/common/blocks/AmberBlock.java @@ -1,15 +1,11 @@ package com.uraneptus.sullysmod.common.blocks; import com.uraneptus.sullysmod.common.blockentities.AmberBE; -import com.uraneptus.sullysmod.common.blockentities.FlingerTotemBE; import com.uraneptus.sullysmod.core.other.tags.SMBlockTags; -import com.uraneptus.sullysmod.core.registry.SMBlockEntityTypes; import com.uraneptus.sullysmod.core.registry.SMBlocks; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; -import net.minecraft.server.level.ServerLevel; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.world.entity.Entity; @@ -21,7 +17,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LightLayer; import net.minecraft.world.level.block.BaseEntityBlock; -import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.RenderShape; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; @@ -34,10 +29,6 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - public class AmberBlock extends BaseEntityBlock { private static final VoxelShape MELTING_COLLISION_SHAPE = Shapes.box(0.0D, 0.0D, 0.0D, 1.0D, (double)0.0F, 1.0D); @@ -52,7 +43,6 @@ public RenderShape getRenderShape(BlockState pState) { return RenderShape.MODEL; } - public VoxelShape getCollisionShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { BlockEntity blockEntity = pLevel.getBlockEntity(pPos); @@ -62,27 +52,29 @@ public VoxelShape getCollisionShape(BlockState pState, BlockGetter pLevel, Block Level level = blockEntity.getLevel(); if (!amber.hasStuckEntity()) { if (entity != null) { - boolean flag = false; + boolean shouldMeltFlag = false; for (BlockPos pos : BlockPos.betweenClosed(pPos.offset(-1, -1, -1), pPos.offset(1, 1, 1))) { BlockState state = pLevel.getBlockState(pos); BlockEntity be = pLevel.getBlockEntity(pos); if (state.is(SMBlockTags.MELTS_AMBER)) { - flag = true; + shouldMeltFlag = true; } if (state.getBlock() instanceof AmberBlock && be instanceof AmberBE amberBE) { if (amberBE.isBlockMelted() && level != null && level.getBrightness(LightLayer.BLOCK, pPos.above()) >= 9) { - flag = true; + shouldMeltFlag = true; } } } - if (flag) { + if (shouldMeltFlag) { if (entity instanceof Player player) { - //return MELTING_COLLISION_SHAPE; - - + if (player.jumping) { + amber.setBlockMelted(false); + return Shapes.block(); + } } + amber.setBlockMelted(true); amber.update(); return MELTING_COLLISION_SHAPE; diff --git a/src/main/java/com/uraneptus/sullysmod/common/entities/Piranha.java b/src/main/java/com/uraneptus/sullysmod/common/entities/Piranha.java index 4343f802..733d6602 100644 --- a/src/main/java/com/uraneptus/sullysmod/common/entities/Piranha.java +++ b/src/main/java/com/uraneptus/sullysmod/common/entities/Piranha.java @@ -22,13 +22,15 @@ import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal; import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal; import net.minecraft.world.entity.ai.goal.target.ResetUniversalAngerTargetGoal; -import net.minecraft.world.entity.animal.*; +import net.minecraft.world.entity.animal.AbstractFish; +import net.minecraft.world.entity.animal.AbstractSchoolingFish; +import net.minecraft.world.entity.animal.Bucketable; +import net.minecraft.world.entity.animal.WaterAnimal; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.vehicle.Boat; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; -import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.pathfinder.Path; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; diff --git a/src/main/java/com/uraneptus/sullysmod/common/entities/TortoiseShell.java b/src/main/java/com/uraneptus/sullysmod/common/entities/TortoiseShell.java index 60eded64..16c1db17 100644 --- a/src/main/java/com/uraneptus/sullysmod/common/entities/TortoiseShell.java +++ b/src/main/java/com/uraneptus/sullysmod/common/entities/TortoiseShell.java @@ -198,7 +198,6 @@ public boolean isPickable() { return !this.isRemoved(); } - private void hurtEntity(List pEntities) { for (Entity entity : pEntities) { if (entity instanceof LivingEntity livingEntity) { diff --git a/src/main/java/com/uraneptus/sullysmod/core/events/SMPlayerEvents.java b/src/main/java/com/uraneptus/sullysmod/core/events/SMPlayerEvents.java index 5dd4e5e8..81976840 100644 --- a/src/main/java/com/uraneptus/sullysmod/core/events/SMPlayerEvents.java +++ b/src/main/java/com/uraneptus/sullysmod/core/events/SMPlayerEvents.java @@ -195,6 +195,5 @@ public static void onPlayerTick(TickEvent.PlayerTickEvent event) { } } - } } \ No newline at end of file