|
|
|
|
@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur Server Changes
|
|
|
|
|
Original license: MIT
|
|
|
|
|
Original project: https://github.com/PurpurMC/Purpur
|
|
|
|
|
|
|
|
|
|
Commit: 4b1a082c94ebc090bbc74b9230e4f43075090a29
|
|
|
|
|
Commit: 4f12f5d3d0431cf17c2f6f80f3bdd3c834c9b8fa
|
|
|
|
|
|
|
|
|
|
Patches below are removed in this patch:
|
|
|
|
|
Metrics change in Purpur-config-files.patch
|
|
|
|
|
@@ -27,7 +27,7 @@ Remove-Mojang-Profiler.patch
|
|
|
|
|
MC-121706-Fix-mobs-not-looking-up-and-down-when-stra.patch
|
|
|
|
|
|
|
|
|
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
|
|
|
index b386250d71d47ab5591a9b89ff39b4369ec4e0a3..ab5aee09874e2258d05b22ca1be3c273cb1afb34 100644
|
|
|
|
|
index 2ad52f8ef126982ac2d3f17ff7af210dcb7f1d79..6e60342d9d394ccd595bde42c84b753ed9c0f7ec 100644
|
|
|
|
|
--- a/build.gradle.kts
|
|
|
|
|
+++ b/build.gradle.kts
|
|
|
|
|
@@ -64,6 +64,10 @@ dependencies {
|
|
|
|
|
@@ -1311,7 +1311,7 @@ index 643c889c4099fde0f64ed1fc72770de55adf9033..4f353e049252827a4e751817984746df
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
|
index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f10141db1 100644
|
|
|
|
|
index f02ebd0d95433b44ce8f85f4374669d66a9a9660..1b760a544616c9950f65071736cf34abcb10d7a1 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
|
@@ -275,6 +275,10 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -1361,7 +1361,7 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void doTick() {
|
|
|
|
|
@@ -994,6 +1013,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -992,6 +1011,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
}));
|
|
|
|
|
Team scoreboardteambase = this.getTeam();
|
|
|
|
|
|
|
|
|
|
@@ -1369,7 +1369,7 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != Team.Visibility.ALWAYS) {
|
|
|
|
|
if (scoreboardteambase.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
|
|
|
|
|
this.server.getPlayerList().broadcastSystemToTeam(this, ichatbasecomponent);
|
|
|
|
|
@@ -1100,6 +1120,16 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -1098,6 +1118,16 @@ public class ServerPlayer extends Player {
|
|
|
|
|
if (this.isInvulnerableTo(source)) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
@@ -1386,7 +1386,7 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
boolean flag = this.server.isDedicatedServer() && this.isPvpAllowed() && source.is(DamageTypeTags.IS_FALL);
|
|
|
|
|
|
|
|
|
|
if (!flag && this.spawnInvulnerableTime > 0 && !source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) {
|
|
|
|
|
@@ -1243,6 +1273,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -1241,6 +1271,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
playerlist.sendPlayerPermissionLevel(this);
|
|
|
|
|
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
|
|
|
|
this.unsetRemoved();
|
|
|
|
|
@@ -1394,7 +1394,7 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
this.setServerLevel(worldserver);
|
|
|
|
|
@@ -1398,7 +1429,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -1396,7 +1427,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
return entitymonster.isPreventingPlayerRest(this);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -1403,7 +1403,7 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -1438,7 +1469,19 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -1436,7 +1467,19 @@ public class ServerPlayer extends Player {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!this.serverLevel().canSleepThroughNights()) {
|
|
|
|
|
@@ -1424,7 +1424,7 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
((ServerLevel) this.level()).updateSleepingPlayerList();
|
|
|
|
|
@@ -1535,6 +1578,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -1533,6 +1576,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void openTextEdit(SignBlockEntity sign, boolean front) {
|
|
|
|
|
@@ -1432,7 +1432,7 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), sign.getBlockPos()));
|
|
|
|
|
this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos(), front));
|
|
|
|
|
}
|
|
|
|
|
@@ -1780,6 +1824,26 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -1778,6 +1822,26 @@ public class ServerPlayer extends Player {
|
|
|
|
|
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1459,7 +1459,7 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
@Override
|
|
|
|
|
public void displayClientMessage(Component message, boolean overlay) {
|
|
|
|
|
this.sendSystemMessage(message, overlay);
|
|
|
|
|
@@ -2107,8 +2171,68 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -2105,8 +2169,68 @@ public class ServerPlayer extends Player {
|
|
|
|
|
|
|
|
|
|
public void resetLastActionTime() {
|
|
|
|
|
this.lastActionTime = Util.getMillis();
|
|
|
|
|
@@ -1528,7 +1528,7 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
public ServerStatsCounter getStats() {
|
|
|
|
|
return this.stats;
|
|
|
|
|
}
|
|
|
|
|
@@ -2659,4 +2783,50 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -2657,4 +2781,50 @@ public class ServerPlayer extends Player {
|
|
|
|
|
return (CraftPlayer) super.getBukkitEntity();
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
@@ -1580,10 +1580,10 @@ index 5e822c2292dfa1882edc0250e592f5371480ae15..c7caf3166990d2165b4ca8206706a71f
|
|
|
|
|
+ // Purpur end
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
|
|
|
|
index 58e3ac1e155fcd352efcc90401e4e13ae4c6a2ca..8ebc4d373b600cac4235d6b3e4176fc15393d90f 100644
|
|
|
|
|
index 091d292b04649977961f32dff949a432cb44106e..165b014e9b12f8f091f73c1696ad39fa10e460c1 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
|
|
|
|
@@ -398,6 +398,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
@@ -397,6 +397,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
} else {capturedBlockEntity = true;} // Paper end
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@@ -1591,7 +1591,7 @@ index 58e3ac1e155fcd352efcc90401e4e13ae4c6a2ca..8ebc4d373b600cac4235d6b3e4176fc1
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
|
|
@@ -428,7 +429,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
@@ -427,7 +428,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
|
|
|
|
|
ItemStack mainHandStack = null; // Paper
|
|
|
|
|
boolean isCorrectTool = false; // Paper
|
|
|
|
|
@@ -1600,7 +1600,7 @@ index 58e3ac1e155fcd352efcc90401e4e13ae4c6a2ca..8ebc4d373b600cac4235d6b3e4176fc1
|
|
|
|
|
// return true; // CraftBukkit
|
|
|
|
|
} else {
|
|
|
|
|
ItemStack itemstack = this.player.getMainHandItem();
|
|
|
|
|
@@ -517,6 +518,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
@@ -516,6 +517,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
public InteractionHand interactHand;
|
|
|
|
|
public ItemStack interactItemStack;
|
|
|
|
|
public InteractionResult useItemOn(ServerPlayer player, Level world, ItemStack stack, InteractionHand hand, BlockHitResult hitResult) {
|
|
|
|
|
@@ -1608,7 +1608,7 @@ index 58e3ac1e155fcd352efcc90401e4e13ae4c6a2ca..8ebc4d373b600cac4235d6b3e4176fc1
|
|
|
|
|
BlockPos blockposition = hitResult.getBlockPos();
|
|
|
|
|
BlockState iblockdata = world.getBlockState(blockposition);
|
|
|
|
|
InteractionResult enuminteractionresult = InteractionResult.PASS;
|
|
|
|
|
@@ -578,7 +580,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
@@ -579,7 +581,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
boolean flag1 = player.isSecondaryUseActive() && flag;
|
|
|
|
|
ItemStack itemstack1 = stack.copy();
|
|
|
|
|
|
|
|
|
|
@@ -1617,7 +1617,7 @@ index 58e3ac1e155fcd352efcc90401e4e13ae4c6a2ca..8ebc4d373b600cac4235d6b3e4176fc1
|
|
|
|
|
enuminteractionresult = iblockdata.use(world, player, hand, hitResult);
|
|
|
|
|
|
|
|
|
|
if (enuminteractionresult.consumesAction()) {
|
|
|
|
|
@@ -619,4 +621,18 @@ public class ServerPlayerGameMode {
|
|
|
|
|
@@ -620,4 +622,18 @@ public class ServerPlayerGameMode {
|
|
|
|
|
public void setLevel(ServerLevel world) {
|
|
|
|
|
this.level = world;
|
|
|
|
|
}
|
|
|
|
|
@@ -2376,7 +2376,7 @@ index 1f9e0c139988c4c44a26552881647d36965aa4fa..b8d612d22aca74a08b53393c0723a2ae
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
|
index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737f9c5f1c3 100644
|
|
|
|
|
index 3aad8e715aae1e0a8beeb44390fd31dc50f8ea3a..dda34ad1f05302d0706710dc20766c4059229c83 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
|
@@ -156,7 +156,7 @@ import org.bukkit.plugin.PluginManager;
|
|
|
|
|
@@ -2463,7 +2463,7 @@ index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737
|
|
|
|
|
Entity entity = this.getVehicle();
|
|
|
|
|
|
|
|
|
|
if (entity instanceof Boat) {
|
|
|
|
|
@@ -2978,6 +2998,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -3004,6 +3024,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
this.passengers = ImmutableList.copyOf(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2477,7 +2477,7 @@ index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737
|
|
|
|
|
this.gameEvent(GameEvent.ENTITY_MOUNT, passenger);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -3018,6 +3045,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -3044,6 +3071,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// Spigot end
|
|
|
|
|
@@ -2492,7 +2492,7 @@ index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737
|
|
|
|
|
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
|
|
|
|
this.passengers = ImmutableList.of();
|
|
|
|
|
} else {
|
|
|
|
|
@@ -3097,12 +3132,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -3123,12 +3158,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
return Vec3.directionFromRotation(this.getRotationVector());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2509,7 +2509,7 @@ index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.isInsidePortal = true;
|
|
|
|
|
@@ -3151,7 +3189,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -3177,7 +3215,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.processPortalCooldown();
|
|
|
|
|
@@ -2518,7 +2518,7 @@ index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -3341,7 +3379,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -3367,7 +3405,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getMaxAirSupply() {
|
|
|
|
|
@@ -2527,7 +2527,7 @@ index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getAirSupply() {
|
|
|
|
|
@@ -3805,7 +3843,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -3831,7 +3869,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean canChangeDimensions() {
|
|
|
|
|
@@ -2536,7 +2536,7 @@ index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
|
|
|
|
|
@@ -4103,6 +4141,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -4129,6 +4167,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
return SlotAccess.NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2557,7 +2557,7 @@ index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737
|
|
|
|
|
@Override
|
|
|
|
|
public void sendSystemMessage(Component message) {}
|
|
|
|
|
|
|
|
|
|
@@ -4372,6 +4424,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -4398,6 +4450,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
this.yRotO = this.getYRot();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2570,7 +2570,7 @@ index 1e0e7fa54d058bf9faa4d1652a4cf6f5f6549254..67902da3d03cb794760db49b50408737
|
|
|
|
|
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
|
|
|
|
if (false && this.touchingUnloadedChunk()) { // Gale - Airplane - reduce entity fluid lookups if no fluids - cost of a lookup here is the same cost as below, so skip
|
|
|
|
|
return false;
|
|
|
|
|
@@ -4947,4 +5005,45 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -4973,4 +5031,45 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
@@ -2773,7 +2773,7 @@ index 1bb8b6e91c44cd13411d96d749fa64835c75a267..b18cbe85330e26de6f6cbfcc3d51a741
|
|
|
|
|
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 a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d36611923 100644
|
|
|
|
|
index c522c49e67b2eb92d38d2c76a31b562f653920be..d811a2456b7c2b8c4766f4b7943eeb438e88e3fd 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
|
|
|
@@ -218,9 +218,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -2795,7 +2795,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
public int expToDrop;
|
|
|
|
|
+ public float safeFallDistance = 3.0F; // Purpur
|
|
|
|
|
public boolean forceDrops;
|
|
|
|
|
public ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
|
|
|
|
public ArrayList<DefaultDrop> drops = new ArrayList<>(); // Paper
|
|
|
|
|
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
|
|
|
|
@@ -262,6 +263,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
|
|
|
|
|
@@ -2938,7 +2938,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
|
|
|
|
|
if (event.isCancelled()) {
|
|
|
|
|
continue;
|
|
|
|
|
@@ -1497,13 +1532,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -1505,13 +1540,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
if (entity1 instanceof net.minecraft.world.entity.player.Player) {
|
|
|
|
|
net.minecraft.world.entity.player.Player entityhuman = (net.minecraft.world.entity.player.Player) entity1;
|
|
|
|
|
|
|
|
|
|
@@ -2954,7 +2954,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
LivingEntity entityliving2 = entitywolf.getOwner();
|
|
|
|
|
|
|
|
|
|
if (entityliving2 instanceof net.minecraft.world.entity.player.Player) {
|
|
|
|
|
@@ -1611,6 +1646,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -1619,6 +1654,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2973,7 +2973,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
|
|
|
|
EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
|
|
|
|
|
event.setCancelled(itemstack == null);
|
|
|
|
|
@@ -1778,7 +1825,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -1786,7 +1833,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
|
|
|
|
|
if (this.dead && adversary instanceof WitherBoss) { // Paper
|
|
|
|
|
@@ -2982,7 +2982,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
BlockPos blockposition = this.blockPosition();
|
|
|
|
|
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
|
|
|
|
|
|
|
|
|
|
@@ -1824,6 +1871,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -1832,6 +1879,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
|
|
|
|
|
this.dropEquipment(); // CraftBukkit - from below
|
|
|
|
|
if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
|
|
|
|
@@ -2990,7 +2990,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
this.dropFromLootTable(source, flag);
|
|
|
|
|
// Paper start
|
|
|
|
|
final boolean prev = this.clearEquipmentSlots;
|
|
|
|
|
@@ -1832,6 +1880,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -1840,6 +1888,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
// Paper end
|
|
|
|
|
this.dropCustomDeathLoot(source, i, flag);
|
|
|
|
|
this.clearEquipmentSlots = prev; // Paper
|
|
|
|
|
@@ -2998,7 +2998,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
|
|
|
|
org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops, () -> {
|
|
|
|
|
@@ -2103,7 +2152,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -2111,7 +2160,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
MobEffectInstance mobeffect = this.getEffect(MobEffects.JUMP);
|
|
|
|
|
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);
|
|
|
|
|
|
|
|
|
|
@@ -3007,7 +3007,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2326,6 +2375,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -2334,6 +2383,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -3028,7 +3028,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
if (f > 0 || !human) {
|
|
|
|
|
if (human) {
|
|
|
|
|
// PAIL: Be sure to drag all this code from the EntityHuman subclass each update.
|
|
|
|
|
@@ -2546,7 +2609,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -2554,7 +2617,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onBelowWorld() {
|
|
|
|
|
@@ -3037,7 +3037,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void updateSwingTime() {
|
|
|
|
|
@@ -2740,7 +2803,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -2748,7 +2811,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected long lastJumpTime = 0L; // Paper
|
|
|
|
|
@@ -3046,7 +3046,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
Vec3 vec3d = this.getDeltaMovement();
|
|
|
|
|
// Paper start
|
|
|
|
|
long time = System.nanoTime();
|
|
|
|
|
@@ -2892,6 +2955,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -2900,6 +2963,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
|
|
|
|
|
if (f3 > 0.0F) {
|
|
|
|
|
this.playSound(this.getFallDamageSound((int) f3), 1.0F, 1.0F);
|
|
|
|
|
@@ -3054,7 +3054,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
this.hurt(this.damageSources().flyIntoWall(), f3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -3497,8 +3561,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -3505,8 +3569,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
|
|
|
|
|
this.pushEntities();
|
|
|
|
|
// Paper start
|
|
|
|
|
@@ -3067,7 +3067,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
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());
|
|
|
|
|
@@ -3508,12 +3574,48 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -3516,12 +3582,48 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
this.absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -3116,7 +3116,7 @@ index a6e9cccff99496cdbf08e8bf093fcdf7a98e721c..23197384963b7f67e096eff18bf1809d
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isSensitiveToWater() {
|
|
|
|
|
@@ -3534,7 +3636,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
@@ -3542,7 +3644,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
|
int j = i / 10;
|
|
|
|
|
|
|
|
|
|
if (j % 2 == 0) {
|
|
|
|
|
@@ -5222,7 +5222,7 @@ index f383928fc5b331ddf128bdcb6a23010d8fe088d3..64aba511e615983988cdb6a0fd45b7d9
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
|
|
|
|
index 652c8b5b579a06ab7e66df78bbf323cd9188208c..76cf6c2eaae736d4e524bc3aff9502b81aaef639 100644
|
|
|
|
|
index d3982fc50ab87f64893ae5838d0256576912d311..9d949fe12d1100e03cf2454cc7b820971b6e00b5 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
|
|
|
|
@@ -63,6 +63,43 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder<Mushroo
|
|
|
|
|
@@ -8256,7 +8256,7 @@ index a288180da1996103eb7dc3bb87b4615f86630bb8..7f3c914358a3d623b07dbb69abc23e13
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
|
|
|
index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..71f8cea4a33b30fdafa41714a424b3092a3a7cd0 100644
|
|
|
|
|
index c9a4feb4a52c0eb621b120e5b8c18d0a74dae0cd..8f8a3e03eec72cd48b10649778ec2f26016c419a 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
|
|
|
@@ -84,20 +84,59 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
|
|
|
|
@@ -8530,7 +8530,7 @@ index 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..71f8cea4a33b30fdafa41714a424b309
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
|
|
|
index 9dcf28bdcb5770a191e62353a60c953731671283..1e63972ab647ef9221179875eb25f5988a976384 100644
|
|
|
|
|
index 523f14916073fb137578da777a23ba8265fd8af6..2b9b0acd20d2bf16d08ed89ba625dfb15c630988 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
|
|
|
@@ -99,10 +99,12 @@ public class ArmorStand extends LivingEntity {
|
|
|
|
|
@@ -11245,7 +11245,7 @@ index b14979ab7bed34a37fceff5589ecb789bab31318..e2eb27a60fde8a937ad1101bbda54c89
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
|
|
|
|
index 71b5a9c97a13f703073c0122742ff9e8a0e49df2..42252e86ca02955ba8cae913081795b57e04c934 100644
|
|
|
|
|
index 6f12e342adf1a008709fd9a4fbbbe1da8ec31b83..43ce5ffc6fc1853875f446b543d5b57502a21dc7 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
|
|
|
|
@@ -53,14 +53,48 @@ public class Spider extends Monster {
|
|
|
|
|
@@ -13435,7 +13435,7 @@ index b16d9e2eaa589f19c563ee70b1a56d67dbcdecb0..71beab673f04cd051c46ea37f8c84731
|
|
|
|
|
public static final FoodProperties BAKED_POTATO = (new FoodProperties.Builder()).nutrition(5).saturationMod(0.6F).build();
|
|
|
|
|
public static final FoodProperties BEEF = (new FoodProperties.Builder()).nutrition(3).saturationMod(0.3F).meat().build();
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
|
|
|
|
index f664da5a8413bb13cc95d2cf1604f11a5d285dae..8f73e9e9da595805a2cbb7995b89aac05417d45a 100644
|
|
|
|
|
index 82f18790b9dc55b039ae03600a80a46d56a87521..6a754ecd4e9d6c3ebc7bd91b1de797fdbf3c4290 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
|
|
|
|
@@ -76,6 +76,7 @@ public abstract class AbstractContainerMenu {
|
|
|
|
|
@@ -13985,10 +13985,10 @@ index 18898e16ec42f6b694b06e09d9174b60d62450d7..20f33b77b4a9494be227456bc742a029
|
|
|
|
|
return InteractionResult.PASS;
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
|
|
|
|
index e483186a5292b3b53bfb1af4d56f55fcc1a6106c..41728bcbd5ca3585da64f7c3289b26977f90c229 100644
|
|
|
|
|
index efdf56044396b4ce486948d2c993971f99174a5e..42bfde8e36b6395f50973300313d6959e2735327 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
|
|
|
|
@@ -153,7 +153,24 @@ public class BlockItem extends Item {
|
|
|
|
|
@@ -152,7 +152,24 @@ public class BlockItem extends Item {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected boolean updateCustomBlockEntityTag(BlockPos pos, Level world, @Nullable Player player, ItemStack stack, BlockState state) {
|
|
|
|
|
@@ -14014,7 +14014,7 @@ index e483186a5292b3b53bfb1af4d56f55fcc1a6106c..41728bcbd5ca3585da64f7c3289b2697
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
|
@@ -288,7 +305,7 @@ public class BlockItem extends Item {
|
|
|
|
|
@@ -287,7 +304,7 @@ public class BlockItem extends Item {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onDestroyed(ItemEntity entity) {
|
|
|
|
|
@@ -14083,7 +14083,7 @@ index 08d597db1a5345a343777a01427655e6bf2c926b..d45a2f49c82d00801578c34e5f5277fc
|
|
|
|
|
} else {
|
|
|
|
|
user.startUsingItem(hand);
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
|
|
|
|
|
index 277555a26e8281dd1a626e572794b08cf51d00c5..48e4fecf5ae5538004e3f53093b8be7c4be1cbee 100644
|
|
|
|
|
index aa0f09a18ea781e027ea70928b30d3e93061120f..5cb8f1e13f4889792395d6b498c0ade22a33b446 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/item/BucketItem.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/BucketItem.java
|
|
|
|
|
@@ -195,7 +195,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
|
|
|
|
@@ -14310,7 +14310,7 @@ index 180aec596110309aade13d2080f8824d152b07cb..552c31c0f3746dd35388395036e70a92
|
|
|
|
|
return InteractionResult.PASS;
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
|
|
|
index 1d292f4bae3eadfde0637cf0a8b49ff53eb21ac9..70ec2c6f73dd6aaf7623e47333277425a1d01139 100644
|
|
|
|
|
index 8526df6a7112a8c1b541b341ab9e7dd3b8f53697..97b1852003450fd57bc7971ca5003508f4eb71cc 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
|
|
|
@@ -432,6 +432,7 @@ public final class ItemStack {
|
|
|
|
|
@@ -14321,7 +14321,7 @@ index 1d292f4bae3eadfde0637cf0a8b49ff53eb21ac9..70ec2c6f73dd6aaf7623e47333277425
|
|
|
|
|
}
|
|
|
|
|
world.preventPoiUpdated = false;
|
|
|
|
|
|
|
|
|
|
@@ -461,6 +462,7 @@ public final class ItemStack {
|
|
|
|
|
@@ -463,6 +464,7 @@ public final class ItemStack {
|
|
|
|
|
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
|
|
|
|
|
block.getBlock().onPlace(block, world, newblockposition, oldBlock, true, context); // Paper - pass context
|
|
|
|
|
}
|
|
|
|
|
@@ -14329,7 +14329,7 @@ index 1d292f4bae3eadfde0637cf0a8b49ff53eb21ac9..70ec2c6f73dd6aaf7623e47333277425
|
|
|
|
|
|
|
|
|
|
world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point
|
|
|
|
|
}
|
|
|
|
|
@@ -589,6 +591,16 @@ public final class ItemStack {
|
|
|
|
|
@@ -591,6 +593,16 @@ public final class ItemStack {
|
|
|
|
|
return this.isDamageableItem() && this.getDamageValue() > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -14346,7 +14346,7 @@ index 1d292f4bae3eadfde0637cf0a8b49ff53eb21ac9..70ec2c6f73dd6aaf7623e47333277425
|
|
|
|
|
public int getDamageValue() {
|
|
|
|
|
return this.tag == null ? 0 : this.tag.getInt("Damage");
|
|
|
|
|
}
|
|
|
|
|
@@ -608,7 +620,7 @@ public final class ItemStack {
|
|
|
|
|
@@ -610,7 +622,7 @@ public final class ItemStack {
|
|
|
|
|
int j;
|
|
|
|
|
|
|
|
|
|
if (amount > 0) {
|
|
|
|
|
@@ -14355,7 +14355,7 @@ index 1d292f4bae3eadfde0637cf0a8b49ff53eb21ac9..70ec2c6f73dd6aaf7623e47333277425
|
|
|
|
|
int k = 0;
|
|
|
|
|
|
|
|
|
|
for (int l = 0; j > 0 && l < amount; ++l) {
|
|
|
|
|
@@ -663,6 +675,12 @@ public final class ItemStack {
|
|
|
|
|
@@ -665,6 +677,12 @@ public final class ItemStack {
|
|
|
|
|
if (this.hurt(amount, entity.getRandom(), entity /*instanceof ServerPlayer ? (ServerPlayer) entity : null*/)) { // Paper - pass LivingEntity for EntityItemDamageEvent
|
|
|
|
|
breakCallback.accept(entity);
|
|
|
|
|
Item item = this.getItem();
|
|
|
|
|
@@ -14368,7 +14368,7 @@ index 1d292f4bae3eadfde0637cf0a8b49ff53eb21ac9..70ec2c6f73dd6aaf7623e47333277425
|
|
|
|
|
// CraftBukkit start - Check for item breaking
|
|
|
|
|
if (this.count == 1 && entity instanceof net.minecraft.world.entity.player.Player) {
|
|
|
|
|
org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent((net.minecraft.world.entity.player.Player) entity, this);
|
|
|
|
|
@@ -1189,7 +1207,7 @@ public final class ItemStack {
|
|
|
|
|
@@ -1191,7 +1209,7 @@ public final class ItemStack {
|
|
|
|
|
|
|
|
|
|
ListTag nbttaglist = this.tag.getList("Enchantments", 10);
|
|
|
|
|
|
|
|
|
|
@@ -14377,7 +14377,7 @@ index 1d292f4bae3eadfde0637cf0a8b49ff53eb21ac9..70ec2c6f73dd6aaf7623e47333277425
|
|
|
|
|
processEnchantOrder(this.tag); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1197,6 +1215,12 @@ public final class ItemStack {
|
|
|
|
|
@@ -1199,6 +1217,12 @@ public final class ItemStack {
|
|
|
|
|
return this.tag != null && this.tag.contains("Enchantments", 9) ? !this.tag.getList("Enchantments", 10).isEmpty() : false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -14770,7 +14770,7 @@ index 4f7457578ab3118d10e0d5dfc23d79c9b20c2f44..e03ce53b93d1b9366f2a7f14f341750a
|
|
|
|
|
|
|
|
|
|
public ItemStack assemble() {
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
|
|
|
|
index 1279132e2fb3e8f64f062df0ac8b8197f9d8f343..fb933cc388acf26cebe1da692b9c5dd165f797ee 100644
|
|
|
|
|
index 6eca4a9b3cf462a4d18f32619bbcdfda0fa2ebc5..914564a528c360f352927e7681ab2e31ed365b21 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
|
|
|
|
@@ -71,6 +71,7 @@ public abstract class BaseSpawner {
|
|
|
|
|
@@ -15693,10 +15693,10 @@ index 7385e91f32f070e86a4e0fd3d214f55d832c7979..7b73de87236a60ce7343c29ec147e186
|
|
|
|
|
}, CONTAINER_TITLE));
|
|
|
|
|
player.awardStat(Stats.OPEN_ENDERCHEST);
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
|
|
|
|
index 5946f06f63b5694034bd027984a4925b0831d439..d566f67f8f6f1748023430de4f191881b79e44a1 100644
|
|
|
|
|
index 502dcba14da9d3dcefc61fdc349a4e1e1d94b478..856099241737c43b8213ccc203ef6bb7b7667b1f 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
|
|
|
|
@@ -101,7 +101,7 @@ public class FarmBlock extends Block {
|
|
|
|
|
@@ -103,7 +103,7 @@ public class FarmBlock extends Block {
|
|
|
|
|
@Override
|
|
|
|
|
public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
|
|
|
|
|
super.fallOn(world, state, pos, entity, fallDistance); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage.
|
|
|
|
|
@@ -15705,7 +15705,7 @@ index 5946f06f63b5694034bd027984a4925b0831d439..d566f67f8f6f1748023430de4f191881
|
|
|
|
|
// CraftBukkit start - Interact soil
|
|
|
|
|
org.bukkit.event.Cancellable cancellable;
|
|
|
|
|
if (entity instanceof Player) {
|
|
|
|
|
@@ -115,6 +115,22 @@ public class FarmBlock extends Block {
|
|
|
|
|
@@ -117,6 +117,22 @@ public class FarmBlock extends Block {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -15728,7 +15728,7 @@ index 5946f06f63b5694034bd027984a4925b0831d439..d566f67f8f6f1748023430de4f191881
|
|
|
|
|
if (!CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.DIRT.defaultBlockState())) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@@ -162,7 +178,7 @@ public class FarmBlock extends Block {
|
|
|
|
|
@@ -164,7 +180,7 @@ public class FarmBlock extends Block {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -17412,7 +17412,7 @@ index 2bbc39c257965ad91ee360cdfcd3538a0f041c7e..d0e3b531392738679894a989293ae49e
|
|
|
|
|
+ // Purpur end - OfflinePlayer API
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
|
index dce9eb210fe92f44745a316d1969251554673af2..5cbfa4ecb4c76cfda4fa42bfa6fdcec75ec1fe27 100644
|
|
|
|
|
index 135fd0f6843659b55cc4f5e1482b0544adf6acae..8d8e4623b2551f1d51714a5e3daa4d418f8d8f63 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
|
@@ -405,6 +405,20 @@ public final class CraftServer implements Server {
|
|
|
|
|
@@ -17560,10 +17560,10 @@ index dce9eb210fe92f44745a316d1969251554673af2..5cbfa4ecb4c76cfda4fa42bfa6fdcec7
|
|
|
|
|
+ // Purpur end
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
|
index e00babef42bf7da243570aedaebbb1caf30edb7e..16c3922d7d33ec010170caf29b2605dfe99c6f12 100644
|
|
|
|
|
index 656394bd8e4de8f3292a7781c0dcbf30c2a2ed6b..ee2087cd33167547b0713fa329f00d3c7257165d 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
|
@@ -2321,6 +2321,48 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|
|
|
|
@@ -2354,6 +2354,48 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|
|
|
|
return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -17924,7 +17924,7 @@ index f444e843535ec68ede0f05e7e7ef182ce872342b..6f967e1bce4d359efcdf2a82d4ab6f6b
|
|
|
|
|
+ // Purpur end
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
|
index 1992bd985d1beae77b88d71c5fa551a277943fdb..1af2a41d63c7ce775316b5adbdb073453e84d31a 100644
|
|
|
|
|
index 6be370a2be88aac6e229210ef625380171504693..afcab60de32e61b0dbdddb36b7839b854c3602ab 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
|
@@ -453,7 +453,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
|
|
|
@@ -18018,7 +18018,7 @@ index 0ad16ee7b33582d214dab41eeee378d52c8e38ed..16bd1294c219f15ada653ef810bc2d74
|
|
|
|
|
+ // Purpur end
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
|
index 83aaf3e6e377d731ce02f779f80b7bf5db46f89f..64aaea2b8c27c2b320f423b37dc0254bfe2fe015 100644
|
|
|
|
|
index 3a792ddc31e76038b84e8f87088c4cd94c349138..3b3bbeda831f82b6d9b284d85a31a1fff578a64f 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
|
@@ -519,10 +519,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
|
@@ -18038,7 +18038,7 @@ index 83aaf3e6e377d731ce02f779f80b7bf5db46f89f..64aaea2b8c27c2b320f423b37dc0254b
|
|
|
|
|
for (ServerPlayer player : (List<ServerPlayer>) this.server.getHandle().players) {
|
|
|
|
|
if (player.getBukkitEntity().canSee(this)) {
|
|
|
|
|
player.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME, this.getHandle()));
|
|
|
|
|
@@ -1342,6 +1347,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
|
@@ -1358,6 +1363,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (entity.isVehicle() && !ignorePassengers) { // Paper - Teleport API
|
|
|
|
|
@@ -18049,7 +18049,7 @@ index 83aaf3e6e377d731ce02f779f80b7bf5db46f89f..64aaea2b8c27c2b320f423b37dc0254b
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2502,6 +2511,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
|
@@ -2518,6 +2527,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
|
return this.getHandle().getAbilities().walkingSpeed * 2f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -18078,7 +18078,7 @@ index 83aaf3e6e377d731ce02f779f80b7bf5db46f89f..64aaea2b8c27c2b320f423b37dc0254b
|
|
|
|
|
private void validateSpeed(float value) {
|
|
|
|
|
Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value);
|
|
|
|
|
}
|
|
|
|
|
@@ -3287,4 +3318,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
|
@@ -3303,4 +3334,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
|
return this.spigot;
|
|
|
|
|
}
|
|
|
|
|
// Spigot end
|
|
|
|
|
@@ -18231,7 +18231,7 @@ index 38b6d2c377800134de592a780b737b45c8096a11..449acd9dc983be1cd51208bc8f8d843d
|
|
|
|
|
+ // 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 5dc160b743534665c6b3efb10b10f7c36e2da5ab..f33d6e9785acbd21a0b366587aa170cc1509bf58 100644
|
|
|
|
|
index 64ae7cfe765ebe697a2cce1b71751e628d6f1662..1920c154b43711473cdf29aeb881a773b8ce45df 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
|
|
|
@@ -594,6 +594,15 @@ public class CraftEventFactory {
|
|
|
|
|
@@ -18250,7 +18250,7 @@ index 5dc160b743534665c6b3efb10b10f7c36e2da5ab..f33d6e9785acbd21a0b366587aa170cc
|
|
|
|
|
return event;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1061,6 +1070,7 @@ public class CraftEventFactory {
|
|
|
|
|
@@ -1071,6 +1080,7 @@ public class CraftEventFactory {
|
|
|
|
|
damageCause = DamageCause.ENTITY_EXPLOSION;
|
|
|
|
|
}
|
|
|
|
|
event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), entity.getBukkitEntity(), damageCause, modifiers, modifierFunctions, source.isCritical()); // Paper - add critical damage API
|
|
|
|
|
@@ -18258,7 +18258,7 @@ index 5dc160b743534665c6b3efb10b10f7c36e2da5ab..f33d6e9785acbd21a0b366587aa170cc
|
|
|
|
|
}
|
|
|
|
|
event.setCancelled(cancelled);
|
|
|
|
|
|
|
|
|
|
@@ -1175,6 +1185,7 @@ public class CraftEventFactory {
|
|
|
|
|
@@ -1185,6 +1195,7 @@ public class CraftEventFactory {
|
|
|
|
|
} else {
|
|
|
|
|
entity.lastDamageCancelled = true; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled
|
|
|
|
|
}
|
|
|
|
|
@@ -18266,7 +18266,7 @@ index 5dc160b743534665c6b3efb10b10f7c36e2da5ab..f33d6e9785acbd21a0b366587aa170cc
|
|
|
|
|
return event;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1238,6 +1249,7 @@ public class CraftEventFactory {
|
|
|
|
|
@@ -1248,6 +1259,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
|
|
|
|
|
|