Repackage NMS

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-03-16 09:00:00 +11:00
parent 18496e998f
commit 9da047989c
968 changed files with 5448 additions and 5050 deletions

View File

@@ -1,10 +1,11 @@
--- a/net/minecraft/server/EntityItem.java
+++ b/net/minecraft/server/EntityItem.java
@@ -6,6 +6,11 @@
import java.util.UUID;
import javax.annotation.Nullable;
--- a/net/minecraft/world/entity/item/EntityItem.java
+++ b/net/minecraft/world/entity/item/EntityItem.java
@@ -31,6 +31,12 @@
import net.minecraft.world.level.World;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import net.minecraft.server.MinecraftServer;
+import org.bukkit.event.entity.EntityPickupItemEvent;
+import org.bukkit.event.player.PlayerPickupItemEvent;
+// CraftBukkit end
@@ -12,7 +13,7 @@
public class EntityItem extends Entity {
private static final DataWatcherObject<ItemStack> ITEM = DataWatcher.a(EntityItem.class, DataWatcherRegistry.g);
@@ -15,6 +20,7 @@
@@ -40,6 +46,7 @@
private UUID thrower;
private UUID owner;
public final float b;
@@ -20,7 +21,7 @@
public EntityItem(EntityTypes<? extends EntityItem> entitytypes, World world) {
super(entitytypes, world);
@@ -50,9 +56,12 @@
@@ -75,9 +82,12 @@
this.die();
} else {
super.tick();
@@ -36,7 +37,7 @@
this.lastX = this.locX();
this.lastY = this.locY();
@@ -108,9 +117,11 @@
@@ -133,9 +143,11 @@
}
}
@@ -48,7 +49,7 @@
this.impulse |= this.aK();
if (!this.world.isClientSide) {
@@ -122,6 +133,12 @@
@@ -147,6 +159,12 @@
}
if (!this.world.isClientSide && this.age >= 6000) {
@@ -61,7 +62,7 @@
this.die();
}
@@ -197,10 +214,11 @@
@@ -222,10 +240,11 @@
private static void a(EntityItem entityitem, ItemStack itemstack, ItemStack itemstack1) {
ItemStack itemstack2 = a(itemstack, itemstack1, 64);
@@ -74,7 +75,7 @@
a(entityitem, itemstack, itemstack1);
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay);
entityitem.age = Math.min(entityitem.age, entityitem1.age);
@@ -224,6 +242,11 @@
@@ -249,6 +268,11 @@
} else if (!this.getItemStack().getItem().a(damagesource)) {
return false;
} else {
@@ -86,7 +87,7 @@
this.velocityChanged();
this.f = (int) ((float) this.f - f);
if (this.f <= 0) {
@@ -285,6 +308,46 @@
@@ -310,6 +334,46 @@
Item item = itemstack.getItem();
int i = itemstack.getCount();
@@ -133,7 +134,7 @@
if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) {
entityhuman.receive(this, i);
if (itemstack.isEmpty()) {
@@ -328,7 +391,9 @@
@@ -353,7 +417,9 @@
}
public void setItemStack(ItemStack itemstack) {