mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-19 15:09:27 +00:00
28 lines
1.9 KiB
Diff
28 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Paul Sauve <paul@technove.co>
|
|
Date: Tue, 1 Jun 2021 18:06:29 -0500
|
|
Subject: [PATCH] Patch Paper to use fast item merge raytracing
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
index 063f3e4c67e6716c9a03dbe4b72eafd32e4f0d53..dae6f7a05426ea31d13c82458b33e20abc2571b6 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
@@ -243,10 +243,16 @@ public class ItemEntity extends Entity {
|
|
if (entityitem.isMergable()) {
|
|
// Paper Start - Fix items merging through walls
|
|
if (this.level.paperConfig.fixItemsMergingThroughWalls) {
|
|
+ // Airplane start - skip the allocations
|
|
+ /*
|
|
net.minecraft.world.level.ClipContext rayTrace = new net.minecraft.world.level.ClipContext(this.position(), entityitem.position(),
|
|
net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, this);
|
|
net.minecraft.world.phys.BlockHitResult rayTraceResult = level.clip(rayTrace);
|
|
if (rayTraceResult.getType() == net.minecraft.world.phys.HitResult.Type.BLOCK) continue;
|
|
+ */
|
|
+ if (level.rayTraceDirect(this.position(), entityitem.position(), net.minecraft.world.phys.shapes.CollisionContext.of(this)) ==
|
|
+ net.minecraft.world.phys.HitResult.Type.BLOCK) continue;
|
|
+ // Airplane end
|
|
}
|
|
// Paper End
|
|
this.tryToMerge(entityitem);
|