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,15 +1,15 @@
--- a/net/minecraft/server/EntityFallingBlock.java
+++ b/net/minecraft/server/EntityFallingBlock.java
@@ -4,6 +4,8 @@
import java.util.Iterator;
import java.util.List;
--- a/net/minecraft/world/entity/item/EntityFallingBlock.java
+++ b/net/minecraft/world/entity/item/EntityFallingBlock.java
@@ -43,6 +43,8 @@
import net.minecraft.world.phys.MovingObjectPositionBlock;
import net.minecraft.world.phys.Vec3D;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class EntityFallingBlock extends Entity {
private IBlockData block;
@@ -70,7 +72,7 @@
@@ -109,7 +111,7 @@
if (this.ticksLived++ == 0) {
blockposition = this.getChunkCoordinates();
@@ -18,7 +18,7 @@
this.world.a(blockposition, false);
} else if (!this.world.isClientSide) {
this.die();
@@ -122,6 +124,11 @@
@@ -161,6 +163,11 @@
this.block = (IBlockData) this.block.set(BlockProperties.C, true);
}
@@ -30,7 +30,7 @@
if (this.world.setTypeAndData(blockposition, this.block, 3)) {
if (block instanceof BlockFalling) {
((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata, this);
@@ -178,7 +185,9 @@
@@ -217,7 +224,9 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();

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) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/EntityTNTPrimed.java
+++ b/net/minecraft/server/EntityTNTPrimed.java
@@ -2,12 +2,16 @@
import javax.annotation.Nullable;
--- a/net/minecraft/world/entity/item/EntityTNTPrimed.java
+++ b/net/minecraft/world/entity/item/EntityTNTPrimed.java
@@ -17,12 +17,16 @@
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.World;
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+
@@ -17,7 +17,7 @@
public EntityTNTPrimed(EntityTypes<? extends EntityTNTPrimed> entitytypes, World world) {
super(entitytypes, world);
@@ -57,10 +61,13 @@
@@ -72,10 +76,13 @@
--this.fuseTicks;
if (this.fuseTicks <= 0) {
@@ -32,7 +32,7 @@
} else {
this.aK();
if (this.world.isClientSide) {
@@ -71,9 +78,16 @@
@@ -86,9 +93,16 @@
}
private void explode() {