mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@512995c Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7359) PaperMC/Paper@0a9602c [ci skip] Fix multiple ItemStack array nullability mistakes (#7055)
This commit is contained in:
@@ -22,7 +22,7 @@ index 14610e6144ec144ebbec6fb0945c67bb0ea86795..6833eb5dc7aa64bef1b3b38de5e282bd
|
||||
super(x, y, z);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 31950910c206a5ab21ef2c9bc7ea284bd3e45b54..54ce8f0b9219790f6317c3eb95b81cadd64ac9b7 100644
|
||||
index 61d3ed736314d68322585cb6266a47fd17a4a4b4..044b1d5d17fe4554ceefbdd893ef23dba4b999d9 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1589,6 +1589,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -86,10 +86,10 @@ index 38de81f8696ed658d002427d002f22b28e3a6122..39bf75a7ba276f25e39573f084786dd5
|
||||
if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) {
|
||||
ServerGamePacketListenerImpl.this.send(new ClientboundAddMobPacket((LivingEntity) entity));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 6beb31d68b5d1fc84e396a510a68a488771fcac3..998bc2ef37de8cbebde0f6bca4ad8c9bea88aed7 100644
|
||||
index 0f9758851ed05dd27496653cb0c00e6b0711a408..622bc5a8e7e105ee9368f67be3ae7740ecaaf256 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -292,7 +292,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -297,7 +297,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
private final Set<String> tags;
|
||||
private final double[] pistonDeltas;
|
||||
private long pistonDeltasGameTime;
|
||||
@@ -98,7 +98,7 @@ index 6beb31d68b5d1fc84e396a510a68a488771fcac3..998bc2ef37de8cbebde0f6bca4ad8c9b
|
||||
private float eyeHeight;
|
||||
public boolean isInPowderSnow;
|
||||
public boolean wasInPowderSnow;
|
||||
@@ -2643,6 +2643,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -2657,6 +2657,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
this.passengers = ImmutableList.copyOf(list);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ index 6beb31d68b5d1fc84e396a510a68a488771fcac3..998bc2ef37de8cbebde0f6bca4ad8c9b
|
||||
}
|
||||
return true; // CraftBukkit
|
||||
}
|
||||
@@ -2683,6 +2689,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -2697,6 +2703,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
return false;
|
||||
}
|
||||
// Spigot end
|
||||
@@ -126,7 +126,7 @@ index 6beb31d68b5d1fc84e396a510a68a488771fcac3..998bc2ef37de8cbebde0f6bca4ad8c9b
|
||||
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
||||
this.passengers = ImmutableList.of();
|
||||
} else {
|
||||
@@ -4367,4 +4381,45 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -4382,4 +4396,45 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
return ((ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
|
||||
}
|
||||
// Paper end
|
||||
@@ -201,7 +201,7 @@ index 645c1dc9bd09b135a641759c76ce8d957b9bd488..912767ed261e44c0192c5a07e2c20261
|
||||
protected ParticleOptions getInkParticle() {
|
||||
return ParticleTypes.GLOW_SQUID_INK;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index d4da096f22bd3c118304fb00c7b9763562b9c889..1a5587e25356a239ae6a8c219747fcd93491e741 100644
|
||||
index eeef768b8a4235276812ac060da5505274688a57..c7a6756521cc7c188910304f62a579b6724853e2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -216,9 +216,9 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -217,7 +217,7 @@ index d4da096f22bd3c118304fb00c7b9763562b9c889..1a5587e25356a239ae6a8c219747fcd9
|
||||
protected int lerpSteps;
|
||||
protected double lerpX;
|
||||
protected double lerpY;
|
||||
@@ -283,7 +283,7 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -282,7 +282,7 @@ public abstract class LivingEntity extends Entity {
|
||||
this.effectsDirty = true;
|
||||
this.useItem = ItemStack.EMPTY;
|
||||
this.lastClimbablePos = Optional.empty();
|
||||
@@ -226,7 +226,7 @@ index d4da096f22bd3c118304fb00c7b9763562b9c889..1a5587e25356a239ae6a8c219747fcd9
|
||||
this.craftAttributes = new CraftAttributeMap(this.attributes); // CraftBukkit
|
||||
// CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor
|
||||
this.entityData.set(LivingEntity.DATA_HEALTH_ID, (float) this.getAttribute(Attributes.MAX_HEALTH).getValue());
|
||||
@@ -334,6 +334,7 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -333,6 +333,7 @@ public abstract class LivingEntity extends Entity {
|
||||
public static AttributeSupplier.Builder createLivingAttributes() {
|
||||
return AttributeSupplier.builder().add(Attributes.MAX_HEALTH).add(Attributes.KNOCKBACK_RESISTANCE).add(Attributes.MOVEMENT_SPEED).add(Attributes.ARMOR).add(Attributes.ARMOR_TOUGHNESS);
|
||||
}
|
||||
@@ -234,7 +234,7 @@ index d4da096f22bd3c118304fb00c7b9763562b9c889..1a5587e25356a239ae6a8c219747fcd9
|
||||
|
||||
@Override
|
||||
protected void checkFallDamage(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition) {
|
||||
@@ -2605,7 +2606,7 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -2604,7 +2605,7 @@ public abstract class LivingEntity extends Entity {
|
||||
}
|
||||
|
||||
protected long lastJumpTime = 0L; // Paper
|
||||
@@ -243,7 +243,7 @@ index d4da096f22bd3c118304fb00c7b9763562b9c889..1a5587e25356a239ae6a8c219747fcd9
|
||||
double d0 = (double) this.getJumpPower() + this.getJumpBoostPower();
|
||||
Vec3 vec3d = this.getDeltaMovement();
|
||||
// Paper start
|
||||
@@ -3347,8 +3348,10 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -3346,8 +3347,10 @@ public abstract class LivingEntity extends Entity {
|
||||
this.pushEntities();
|
||||
this.level.getProfiler().pop();
|
||||
// Paper start
|
||||
@@ -256,7 +256,7 @@ index d4da096f22bd3c118304fb00c7b9763562b9c889..1a5587e25356a239ae6a8c219747fcd9
|
||||
Location from = new Location(this.level.getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO);
|
||||
Location to = new Location (this.level.getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
||||
io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone());
|
||||
@@ -3358,6 +3361,21 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -3357,6 +3360,21 @@ public abstract class LivingEntity extends Entity {
|
||||
absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch());
|
||||
}
|
||||
}
|
||||
@@ -989,10 +989,10 @@ index 425c6da0de40983b0870c9fd1b53f16b6a11c34c..8f046fb76b6967e72abde523ffb790e0
|
||||
// CraftBukkit end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
||||
index 7283a4f216d5d915f21c481bbe43f2598915ca6d..4eca8dbdf0ce52588483a599b8b10e9c239821b7 100644
|
||||
index 6f759d144c1b0f576a4fd617bf36456b72ff428d..ca8c0651642500a0aeded005a446eebbca7aa399 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
||||
@@ -74,14 +74,87 @@ public class Dolphin extends WaterAnimal {
|
||||
@@ -80,14 +80,87 @@ public class Dolphin extends WaterAnimal {
|
||||
public static final Predicate<ItemEntity> ALLOWED_ITEMS = (entityitem) -> {
|
||||
return !entityitem.hasPickUpDelay() && entityitem.isAlive() && entityitem.isInWater();
|
||||
};
|
||||
@@ -1081,7 +1081,7 @@ index 7283a4f216d5d915f21c481bbe43f2598915ca6d..4eca8dbdf0ce52588483a599b8b10e9c
|
||||
@Nullable
|
||||
@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
|
||||
@@ -156,6 +229,7 @@ public class Dolphin extends WaterAnimal {
|
||||
@@ -162,6 +235,7 @@ public class Dolphin extends WaterAnimal {
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new BreathAirGoal(this));
|
||||
this.goalSelector.addGoal(0, new TryFindWaterGoal(this));
|
||||
@@ -1089,7 +1089,7 @@ index 7283a4f216d5d915f21c481bbe43f2598915ca6d..4eca8dbdf0ce52588483a599b8b10e9c
|
||||
this.goalSelector.addGoal(1, new Dolphin.DolphinSwimToTreasureGoal(this));
|
||||
this.goalSelector.addGoal(2, new Dolphin.DolphinSwimWithPlayerGoal(this, 4.0D));
|
||||
this.goalSelector.addGoal(4, new RandomSwimmingGoal(this, 1.0D, 10));
|
||||
@@ -166,6 +240,7 @@ public class Dolphin extends WaterAnimal {
|
||||
@@ -172,6 +246,7 @@ public class Dolphin extends WaterAnimal {
|
||||
this.goalSelector.addGoal(8, new Dolphin.PlayWithItemsGoal());
|
||||
this.goalSelector.addGoal(8, new FollowBoatGoal(this));
|
||||
this.goalSelector.addGoal(9, new AvoidEntityGoal<>(this, Guardian.class, 8.0F, 1.0D, 1.0D));
|
||||
@@ -1097,7 +1097,7 @@ index 7283a4f216d5d915f21c481bbe43f2598915ca6d..4eca8dbdf0ce52588483a599b8b10e9c
|
||||
this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Guardian.class})).setAlertOthers());
|
||||
}
|
||||
|
||||
@@ -217,7 +292,7 @@ public class Dolphin extends WaterAnimal {
|
||||
@@ -223,7 +298,7 @@ public class Dolphin extends WaterAnimal {
|
||||
|
||||
@Override
|
||||
protected boolean canRide(Entity entity) {
|
||||
@@ -1106,7 +1106,7 @@ index 7283a4f216d5d915f21c481bbe43f2598915ca6d..4eca8dbdf0ce52588483a599b8b10e9c
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -252,6 +327,11 @@ public class Dolphin extends WaterAnimal {
|
||||
@@ -258,6 +333,11 @@ public class Dolphin extends WaterAnimal {
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
@@ -2190,10 +2190,10 @@ index 4797c34872f8fa2fba00172357c4f45e45cfe27f..5a7a8e3b31f4598216ebeaef12cfb377
|
||||
this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this));
|
||||
this.targetSelector.addGoal(3, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
index 0fe2d6190ebba24713a3da7ef5367ecb86814a66..807834e81b5ee18b6c8e897095161fe208b51168 100644
|
||||
index c296862063d2dcaf5e2d03d316c49ae03ab7d625..80ee4883d72d8beaa73865740eec8fc20becd0af 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
@@ -91,6 +91,28 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
@@ -97,6 +97,28 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
this.maxUpStep = 1.0F;
|
||||
}
|
||||
|
||||
@@ -2222,7 +2222,7 @@ index 0fe2d6190ebba24713a3da7ef5367ecb86814a66..807834e81b5ee18b6c8e897095161fe2
|
||||
@Override
|
||||
public Map<String, Vector3f> getModelRotationValues() {
|
||||
return this.modelRotationValues;
|
||||
@@ -516,14 +538,22 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
@@ -522,14 +544,22 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
private static class AxolotlMoveControl extends SmoothSwimmingMoveControl {
|
||||
|
||||
private final Axolotl axolotl;
|
||||
@@ -2245,7 +2245,7 @@ index 0fe2d6190ebba24713a3da7ef5367ecb86814a66..807834e81b5ee18b6c8e897095161fe2
|
||||
if (!this.axolotl.isPlayingDead()) {
|
||||
super.tick();
|
||||
}
|
||||
@@ -538,9 +568,9 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
@@ -544,9 +574,9 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3317,10 +3317,10 @@ index 56d313c2c4a98eac7f4f594d2c29dcd82a4753ac..59ccb6ff28d888874ffb380bda9dbb3d
|
||||
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Evoker.java b/src/main/java/net/minecraft/world/entity/monster/Evoker.java
|
||||
index 74e6216366afcc4d3e751b911042fcb5a05a283f..66a36712d57feaf6e7df73daeeb303e8565de452 100644
|
||||
index fb1fdf8f50f54463ee711d373c90622afe5a863f..4ed00e61227e2a50a0a80834e2d6c7ad6c691284 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Evoker.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Evoker.java
|
||||
@@ -47,10 +47,28 @@ public class Evoker extends SpellcasterIllager {
|
||||
@@ -48,10 +48,28 @@ public class Evoker extends SpellcasterIllager {
|
||||
this.xpReward = 10;
|
||||
}
|
||||
|
||||
@@ -3349,12 +3349,12 @@ index 74e6216366afcc4d3e751b911042fcb5a05a283f..66a36712d57feaf6e7df73daeeb303e8
|
||||
this.goalSelector.addGoal(1, new Evoker.EvokerCastingSpellGoal());
|
||||
this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, Player.class, 8.0F, 0.6D, 1.0D));
|
||||
this.goalSelector.addGoal(4, new Evoker.EvokerSummonSpellGoal());
|
||||
@@ -59,6 +77,7 @@ public class Evoker extends SpellcasterIllager {
|
||||
@@ -60,6 +78,7 @@ public class Evoker extends SpellcasterIllager {
|
||||
this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6D));
|
||||
this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F));
|
||||
this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F));
|
||||
+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, Raider.class)).setAlertOthers());
|
||||
this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Raider.class})).setAlertOthers());
|
||||
this.targetSelector.addGoal(2, (new NearestAttackableTargetGoal<>(this, Player.class, true)).setUnseenMemoryTicks(300));
|
||||
this.targetSelector.addGoal(3, (new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)).setUnseenMemoryTicks(300));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Ghast.java b/src/main/java/net/minecraft/world/entity/monster/Ghast.java
|
||||
@@ -4955,7 +4955,7 @@ index 69223b13e894d86d9529f2ef8b60a08a1f7a9267..c2581fb017f6579e59bd25e46b781aa9
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 35cc150adf51f79e2fccef8b094c90554aafbee2..b6f2bae38781f16c46ad515f34d829074b58e70d 100644
|
||||
index 519b17fac445b7118f5493508bddccd368dadcde..cd6db807c50f9b6269b54a69b6601837aebd28ed 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -542,6 +542,15 @@ public class CraftEventFactory {
|
||||
@@ -4982,7 +4982,7 @@ index 35cc150adf51f79e2fccef8b094c90554aafbee2..b6f2bae38781f16c46ad515f34d82907
|
||||
}
|
||||
event.setCancelled(cancelled);
|
||||
|
||||
@@ -1066,6 +1076,7 @@ public class CraftEventFactory {
|
||||
@@ -1075,6 +1085,7 @@ public class CraftEventFactory {
|
||||
} else {
|
||||
entity.lastDamageCancelled = true; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled
|
||||
}
|
||||
@@ -4990,7 +4990,7 @@ index 35cc150adf51f79e2fccef8b094c90554aafbee2..b6f2bae38781f16c46ad515f34d82907
|
||||
return event;
|
||||
}
|
||||
|
||||
@@ -1125,6 +1136,7 @@ public class CraftEventFactory {
|
||||
@@ -1134,6 +1145,7 @@ public class CraftEventFactory {
|
||||
EntityDamageEvent event;
|
||||
if (damager != null) {
|
||||
event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, modifiers, modifierFunctions, critical); // Paper - add critical damage API
|
||||
|
||||
Reference in New Issue
Block a user