mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-14 06:24:29 +01:00
Collision Spike
- Reduced false positives for train/player collisions during lag spikes
This commit is contained in:
parent
1f06034b47
commit
95a23f7433
@ -32,6 +32,7 @@ import net.minecraft.core.BlockPos;
|
|||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.Direction.Axis;
|
import net.minecraft.core.Direction.Axis;
|
||||||
import net.minecraft.core.Direction.AxisDirection;
|
import net.minecraft.core.Direction.AxisDirection;
|
||||||
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.sounds.SoundEvents;
|
import net.minecraft.sounds.SoundEvents;
|
||||||
import net.minecraft.sounds.SoundSource;
|
import net.minecraft.sounds.SoundSource;
|
||||||
@ -373,6 +374,13 @@ public class ContraptionCollider {
|
|||||||
return entityMotion;
|
return entityMotion;
|
||||||
if (!entity.isOnGround())
|
if (!entity.isOnGround())
|
||||||
return entityMotion;
|
return entityMotion;
|
||||||
|
|
||||||
|
CompoundTag persistentData = entity.getPersistentData();
|
||||||
|
if (persistentData.contains("ContraptionGrounded")) {
|
||||||
|
persistentData.remove("ContraptionGrounded");
|
||||||
|
return entityMotion;
|
||||||
|
}
|
||||||
|
|
||||||
if (cce.collidingEntities.containsKey(entity))
|
if (cce.collidingEntities.containsKey(entity))
|
||||||
return entityMotion;
|
return entityMotion;
|
||||||
if (entity instanceof ItemEntity)
|
if (entity instanceof ItemEntity)
|
||||||
|
@ -141,6 +141,8 @@ public abstract class EntityContraptionInteractionMixin extends CapabilityProvid
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
self.setOnGround(true);
|
self.setOnGround(true);
|
||||||
|
self.getPersistentData()
|
||||||
|
.putBoolean("ContraptionGrounded", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = { "spawnSprintParticle" }, at = @At(value = "TAIL"))
|
@Inject(method = { "spawnSprintParticle" }, at = @At(value = "TAIL"))
|
||||||
|
Loading…
Reference in New Issue
Block a user