mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-28 16:22:18 +00:00
fix: MixinWorld more correct height check
I think this Mixin need to be revisiting
This commit is contained in:
parent
43ef36fa15
commit
960d79803d
@ -7,6 +7,7 @@ package dan200.computercraft.fabric.mixin;
|
||||
|
||||
import dan200.computercraft.shared.common.TileGeneric;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@ -26,12 +27,18 @@ import java.util.Collection;
|
||||
public class MixinWorld
|
||||
{
|
||||
@Shadow
|
||||
protected boolean iteratingTickingBlockEntities;
|
||||
private boolean iteratingTickingBlockEntities;
|
||||
|
||||
@Shadow
|
||||
public boolean isInBuildLimit( BlockPos pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Inject( method = "addBlockEntity", at = @At( "HEAD" ) )
|
||||
public void addBlockEntity( @Nullable BlockEntity entity, CallbackInfo info )
|
||||
{
|
||||
if( entity != null && !entity.isRemoved() && entity.getWorld() != null && entity.getWorld().isInBuildLimit( entity.getPos() ) && iteratingTickingBlockEntities )
|
||||
if( entity != null && !entity.isRemoved() && this.isInBuildLimit( entity.getPos() ) && iteratingTickingBlockEntities )
|
||||
{
|
||||
setWorld( entity, this );
|
||||
}
|
||||
@ -41,7 +48,7 @@ public class MixinWorld
|
||||
{
|
||||
if( entity.getWorld() != world && entity instanceof TileGeneric )
|
||||
{
|
||||
entity.setWorld( (World) world ); //TODO why?
|
||||
entity.setWorld( (World) world );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user