Skip to content

Commit

Permalink
Update BlockEntityBase.java
Browse files Browse the repository at this point in the history
another thutcore fix
  • Loading branch information
Thutmose committed Aug 27, 2022
1 parent 4535e29 commit 665776a
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
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.state.BlockState;
import net.minecraft.world.level.material.Fluids;
Expand All @@ -53,6 +52,7 @@
import thut.api.maths.Vector3;
import thut.core.common.ThutCore;
import thut.core.common.network.EntityUpdate;
import thut.crafts.ThutCrafts;

public abstract class BlockEntityBase extends Entity implements IEntityAdditionalSpawnData, IBlockEntity
{
Expand Down Expand Up @@ -104,8 +104,6 @@ public void write(final FriendlyByteBuf buf, final Vec3 value)

public static final EntityDataSerializer<Vec3> VEC3DSER = new VecSer();

public static Block FAKEBLOCK = null;

static final EntityDataAccessor<Vec3> velocity = SynchedEntityData.<Vec3>defineId(BlockEntityBase.class,
BlockEntityBase.VEC3DSER);
static final EntityDataAccessor<Vec3> position = SynchedEntityData.<Vec3>defineId(BlockEntityBase.class,
Expand Down Expand Up @@ -257,12 +255,12 @@ public void checkCollision()

boolean isReplaceable = air || ItemList.is(replaceable, block);

if (isReplaceable && block.getBlock() != BlockEntityBase.FAKEBLOCK)
if (isReplaceable && block.getBlock() != ThutCrafts.CRAFTBLOCK.get())
{
final boolean flag = world.getFluidState(p).getType() == Fluids.WATER;
if (!air) world.destroyBlock(p, true);
world.setBlockAndUpdate(p,
BlockEntityBase.FAKEBLOCK.defaultBlockState().setValue(TempBlock.WATERLOGGED, flag));
ThutCrafts.CRAFTBLOCK.get().defaultBlockState().setValue(TempBlock.WATERLOGGED, flag));
}
final BlockEntity te = world.getBlockEntity(p);
if (te instanceof TempTile tile)
Expand Down

0 comments on commit 665776a

Please sign in to comment.