mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-02-26 20:04:41 +01:00
Collision Spike
- Reduced false positives for train/player collisions during lag spikes
This commit is contained in:
parent
1f06034b47
commit
95a23f7433
2 changed files with 11 additions and 1 deletions
|
@ -32,6 +32,7 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Direction.Axis;
|
||||
import net.minecraft.core.Direction.AxisDirection;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
@ -373,6 +374,13 @@ public class ContraptionCollider {
|
|||
return entityMotion;
|
||||
if (!entity.isOnGround())
|
||||
return entityMotion;
|
||||
|
||||
CompoundTag persistentData = entity.getPersistentData();
|
||||
if (persistentData.contains("ContraptionGrounded")) {
|
||||
persistentData.remove("ContraptionGrounded");
|
||||
return entityMotion;
|
||||
}
|
||||
|
||||
if (cce.collidingEntities.containsKey(entity))
|
||||
return entityMotion;
|
||||
if (entity instanceof ItemEntity)
|
||||
|
@ -413,7 +421,7 @@ public class ContraptionCollider {
|
|||
.add(0, .25, 0)
|
||||
.scale(damage * 4))
|
||||
.add(diffMotion);
|
||||
|
||||
|
||||
return VecHelper.clamp(added, 3);
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,8 @@ public abstract class EntityContraptionInteractionMixin extends CapabilityProvid
|
|||
return;
|
||||
|
||||
self.setOnGround(true);
|
||||
self.getPersistentData()
|
||||
.putBoolean("ContraptionGrounded", true);
|
||||
}
|
||||
|
||||
@Inject(method = { "spawnSprintParticle" }, at = @At(value = "TAIL"))
|
||||
|
|
Loading…
Add table
Reference in a new issue