Update to Minecraft 1.19

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-06-08 02:00:00 +10:00
parent 91d9aa9a89
commit 25f3b50f6b
332 changed files with 3628 additions and 2559 deletions

View File

@@ -0,0 +1,68 @@
--- a/net/minecraft/world/entity/vehicle/ChestBoat.java
+++ b/net/minecraft/world/entity/vehicle/ChestBoat.java
@@ -23,6 +23,13 @@
import net.minecraft.world.item.Items;
import net.minecraft.world.level.World;
import net.minecraft.world.level.gameevent.GameEvent;
+// CraftBukkit start
+import java.util.List;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end
public class ChestBoat extends EntityBoat implements HasCustomInventoryScreen, ContainerEntity {
@@ -215,4 +222,51 @@
public void clearItemStacks() {
this.itemStacks = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY);
}
+
+ // CraftBukkit start
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
+ private int maxStack = MAX_STACK;
+
+ @Override
+ public List<ItemStack> getContents() {
+ return this.itemStacks;
+ }
+
+ @Override
+ public void onOpen(CraftHumanEntity who) {
+ transaction.add(who);
+ }
+
+ @Override
+ public void onClose(CraftHumanEntity who) {
+ transaction.remove(who);
+ }
+
+ @Override
+ public List<HumanEntity> getViewers() {
+ return transaction;
+ }
+
+ @Override
+ public InventoryHolder getOwner() {
+ org.bukkit.entity.Entity entity = getBukkitEntity();
+ if (entity instanceof InventoryHolder) return (InventoryHolder) entity;
+ return null;
+ }
+
+ @Override
+ public int getMaxStackSize() {
+ return maxStack;
+ }
+
+ @Override
+ public void setMaxStackSize(int size) {
+ maxStack = size;
+ }
+
+ @Override
+ public Location getLocation() {
+ return getBukkitEntity().getLocation();
+ }
+ // CraftBukkit end
}

View File

@@ -65,9 +65,9 @@
+ }
+ // CraftBukkit end
if (!flag && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
this.spawnAtLocation((IMaterial) this.getDropItem());
this.destroy(damagesource);
}
@@ -203,9 +242,29 @@
@@ -207,9 +246,29 @@
public void push(Entity entity) {
if (entity instanceof EntityBoat) {
if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
@@ -97,7 +97,7 @@
super.push(entity);
}
@@ -256,6 +315,7 @@
@@ -262,6 +321,7 @@
return this.getDirection().getClockWise();
}
@@ -105,7 +105,7 @@
@Override
public void tick() {
this.oldStatus = this.status;
@@ -296,6 +356,22 @@
@@ -302,6 +362,22 @@
this.setDeltaMovement(Vec3D.ZERO);
}
@@ -128,7 +128,7 @@
this.tickBubbleColumn();
for (int i = 0; i <= 1; ++i) {
@@ -800,6 +876,11 @@
@@ -809,6 +885,11 @@
this.causeFallDamage(this.fallDistance, 1.0F, DamageSource.FALL);
if (!this.level.isClientSide && !this.isRemoved()) {
@@ -140,7 +140,7 @@
this.kill();
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
int i;
@@ -813,6 +894,7 @@
@@ -822,6 +903,7 @@
}
}
}

View File

@@ -70,7 +70,7 @@
this.ejectPassengers();
if (flag && !this.hasCustomName()) {
this.discard();
@@ -283,6 +325,14 @@
@@ -285,6 +327,14 @@
@Override
public void tick() {
@@ -85,7 +85,7 @@
if (this.getHurtTime() > 0) {
this.setHurtTime(this.getHurtTime() - 1);
}
@@ -292,7 +342,7 @@
@@ -294,7 +344,7 @@
}
this.checkOutOfWorld();
@@ -94,7 +94,7 @@
double d0;
if (this.level.isClientSide) {
@@ -358,6 +408,18 @@
@@ -360,6 +410,18 @@
}
this.setRot(this.getYRot(), this.getXRot());
@@ -113,7 +113,7 @@
if (this.getMinecartType() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.getDeltaMovement().horizontalDistanceSqr() > 0.01D) {
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.pushableBy(this));
@@ -366,8 +428,26 @@
@@ -368,8 +430,26 @@
Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
@@ -140,7 +140,7 @@
entity.push(this);
}
}
@@ -379,6 +459,14 @@
@@ -381,6 +461,14 @@
Entity entity1 = (Entity) iterator.next();
if (!this.hasPassenger(entity1) && entity1.isPushable() && entity1 instanceof EntityMinecartAbstract) {
@@ -155,7 +155,7 @@
entity1.push(this);
}
}
@@ -395,7 +483,7 @@
@@ -397,7 +485,7 @@
}
protected double getMaxSpeed() {
@@ -164,7 +164,7 @@
}
public void activateMinecart(int i, int j, int k, boolean flag) {}
@@ -406,12 +494,16 @@
@@ -408,12 +496,16 @@
this.setDeltaMovement(MathHelper.clamp(vec3d.x, -d0, d0), vec3d.y, MathHelper.clamp(vec3d.z, -d0, d0));
if (this.onGround) {
@@ -183,7 +183,7 @@
}
}
@@ -602,7 +694,7 @@
@@ -604,7 +696,7 @@
}
protected void applyNaturalSlowdown() {
@@ -192,7 +192,7 @@
Vec3D vec3d = this.getDeltaMovement();
vec3d = vec3d.multiply(d0, 0.0D, d0);
@@ -741,6 +833,14 @@
@@ -743,6 +835,14 @@
if (!this.level.isClientSide) {
if (!entity.noPhysics && !this.noPhysics) {
if (!this.hasPassenger(entity)) {
@@ -207,7 +207,7 @@
double d0 = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
double d2 = d0 * d0 + d1 * d1;
@@ -920,4 +1020,26 @@
@@ -922,4 +1022,26 @@
private EnumMinecartType() {}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.java
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.java
@@ -131,5 +131,12 @@
@@ -138,5 +138,12 @@
public CommandListenerWrapper createCommandSourceStack() {
return new CommandListenerWrapper(this, EntityMinecartCommandBlock.this.position(), EntityMinecartCommandBlock.this.getRotationVector(), this.getLevel(), 2, this.getName().getString(), EntityMinecartCommandBlock.this.getDisplayName(), this.getLevel().getServer(), EntityMinecartCommandBlock.this);
}

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java
@@ -31,6 +31,14 @@
import net.minecraft.world.level.storage.loot.parameters.LootContextParameterSets;
import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
@@ -18,6 +18,14 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.World;
+// CraftBukkit start
+import java.util.List;
@@ -12,10 +12,10 @@
+import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end
+
public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements IInventory, ITileInventory {
public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ContainerEntity {
private NonNullList<ItemStack> itemStacks;
@@ -38,14 +46,55 @@
@@ -25,14 +33,55 @@
public MinecraftKey lootTable;
public long lootTableSeed;