mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 10:35:38 +01:00
Patches!!!!!!!
This commit is contained in:
parent
051855997e
commit
e0a245d2ea
@ -8,44 +8,6 @@ item which is being dispensed. Before this fix, sometimes it was the whole
|
||||
stack before a single item had been taken. This fixes that so the stack size
|
||||
is always 1.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/AbstractProjectileDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/AbstractProjectileDispenseBehavior.java
|
||||
index e22d71c371952e91b838d10206d3dcdf9dc8716d..155bd3d6d9c7d3cac7fd04de8210301251d1e17a 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/AbstractProjectileDispenseBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/AbstractProjectileDispenseBehavior.java
|
||||
@@ -27,7 +27,7 @@ public abstract class AbstractProjectileDispenseBehavior extends DefaultDispense
|
||||
|
||||
// CraftBukkit start
|
||||
// iprojectile.shoot((double) enumdirection.getStepX(), (double) ((float) enumdirection.getStepY() + 0.1F), (double) enumdirection.getStepZ(), this.getPower(), this.getUncertainty());
|
||||
- ItemStack itemstack1 = stack.split(1);
|
||||
+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event
|
||||
org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
@@ -37,12 +37,13 @@ public abstract class AbstractProjectileDispenseBehavior extends DefaultDispense
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
- stack.grow(1);
|
||||
+ // stack.grow(1); // Paper - shrink below
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
- stack.grow(1);
|
||||
+ shrink = false; // Paper - shrink below
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -56,7 +57,7 @@ public abstract class AbstractProjectileDispenseBehavior extends DefaultDispense
|
||||
((Entity) iprojectile).projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(pointer.blockEntity());
|
||||
// CraftBukkit end
|
||||
worldserver.addFreshEntity(iprojectile);
|
||||
- // itemstack.shrink(1); // CraftBukkit - Handled during event processing
|
||||
+ if (shrink) stack.shrink(1); // Paper - actually handle here
|
||||
return stack;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java
|
||||
index 90e1914599b43c8bf813596b3b428d8be3bac1b5..6df0db8b4cdab23494ea34236949ece4989110a3 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/BoatDispenseItemBehavior.java
|
||||
@ -86,10 +48,10 @@ index 90e1914599b43c8bf813596b3b428d8be3bac1b5..6df0db8b4cdab23494ea34236949ece4
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea883bba41c 100644
|
||||
index 2bb3d1f0b89ef5b9b1f9f8da1070d21168830645..9507dbbb4b490149b9248c384be5adaccae40c41 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
@@ -217,7 +217,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -109,7 +109,7 @@ public interface DispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
ServerLevel worldserver = pointer.level();
|
||||
@ -98,7 +60,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
@@ -227,12 +227,13 @@ public interface DispenseItemBehavior {
|
||||
@@ -119,12 +119,13 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -114,16 +76,16 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -249,7 +250,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -141,7 +142,7 @@ public interface DispenseItemBehavior {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
- // itemstack.shrink(1); // Handled during event processing
|
||||
+ if (shrink) stack.shrink(1); // Paper - actually handle here
|
||||
// CraftBukkit end
|
||||
pointer.level().gameEvent((Entity) null, GameEvent.ENTITY_PLACE, pointer.pos());
|
||||
pointer.level().gameEvent((Entity) null, (Holder) GameEvent.ENTITY_PLACE, pointer.pos());
|
||||
return stack;
|
||||
@@ -271,7 +272,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -163,7 +164,7 @@ public interface DispenseItemBehavior {
|
||||
ServerLevel worldserver = pointer.level();
|
||||
|
||||
// CraftBukkit start
|
||||
@ -132,7 +94,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
@@ -281,12 +282,13 @@ public interface DispenseItemBehavior {
|
||||
@@ -173,12 +174,13 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -148,8 +110,8 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -303,7 +305,7 @@ public interface DispenseItemBehavior {
|
||||
ArmorStand entityarmorstand = (ArmorStand) EntityType.ARMOR_STAND.spawn(worldserver, stack.getTag(), consumer, blockposition, MobSpawnType.DISPENSER, false, false);
|
||||
@@ -195,7 +197,7 @@ public interface DispenseItemBehavior {
|
||||
ArmorStand entityarmorstand = (ArmorStand) EntityType.ARMOR_STAND.spawn(worldserver, consumer, blockposition, MobSpawnType.DISPENSER, false, false);
|
||||
|
||||
if (entityarmorstand != null) {
|
||||
- // itemstack.shrink(1); // CraftBukkit - Handled during event processing
|
||||
@ -157,16 +119,16 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
}
|
||||
|
||||
return stack;
|
||||
@@ -325,7 +327,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -215,7 +217,7 @@ public interface DispenseItemBehavior {
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
// CraftBukkit start
|
||||
- ItemStack itemstack1 = stack.split(1);
|
||||
+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event
|
||||
Level world = pointer.level();
|
||||
ServerLevel world = pointer.level();
|
||||
org.bukkit.block.Block block = CraftBlock.at(world, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
@@ -336,12 +338,13 @@ public interface DispenseItemBehavior {
|
||||
@@ -226,12 +228,13 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -182,7 +144,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -352,7 +355,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -242,7 +245,7 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
// CraftBukkit end
|
||||
((Saddleable) list.get(0)).equipSaddle(SoundSource.BLOCKS, CraftItemStack.asNMSCopy(event.getItem())); // Paper - Fix saddles losing nbt data - MC-191591
|
||||
@ -191,16 +153,16 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
this.setSuccess(true);
|
||||
return stack;
|
||||
} else {
|
||||
@@ -380,7 +383,7 @@ public interface DispenseItemBehavior {
|
||||
} while (!entityhorseabstract.isArmor(stack) || entityhorseabstract.isWearingArmor() || !entityhorseabstract.isTamed());
|
||||
@@ -270,7 +273,7 @@ public interface DispenseItemBehavior {
|
||||
} while (!entityhorseabstract.isBodyArmorItem(stack) || entityhorseabstract.isWearingBodyArmor() || !entityhorseabstract.isTamed());
|
||||
|
||||
// CraftBukkit start
|
||||
- ItemStack itemstack1 = stack.split(1);
|
||||
+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event
|
||||
Level world = pointer.level();
|
||||
ServerLevel world = pointer.level();
|
||||
org.bukkit.block.Block block = CraftBlock.at(world, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
@@ -391,12 +394,13 @@ public interface DispenseItemBehavior {
|
||||
@@ -281,12 +284,13 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -216,24 +178,24 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -406,6 +410,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -296,6 +300,7 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
}
|
||||
|
||||
+ if (shrink) stack.shrink(1); // Paper - shrink here
|
||||
entityhorseabstract.getSlot(401).set(CraftItemStack.asNMSCopy(event.getItem()));
|
||||
entityhorseabstract.setBodyArmorItem(CraftItemStack.asNMSCopy(event.getItem()));
|
||||
// CraftBukkit end
|
||||
this.setSuccess(true);
|
||||
@@ -452,7 +457,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -342,7 +347,7 @@ public interface DispenseItemBehavior {
|
||||
entityhorsechestedabstract = (AbstractChestedHorse) iterator1.next();
|
||||
// CraftBukkit start
|
||||
} while (!entityhorsechestedabstract.isTamed());
|
||||
- ItemStack itemstack1 = stack.split(1);
|
||||
+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below
|
||||
Level world = pointer.level();
|
||||
ServerLevel world = pointer.level();
|
||||
org.bukkit.block.Block block = CraftBlock.at(world, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
@@ -463,10 +468,13 @@ public interface DispenseItemBehavior {
|
||||
@@ -353,10 +358,13 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -247,7 +209,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -478,7 +486,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -368,7 +376,7 @@ public interface DispenseItemBehavior {
|
||||
entityhorsechestedabstract.getSlot(499).set(CraftItemStack.asNMSCopy(event.getItem()));
|
||||
// CraftBukkit end
|
||||
|
||||
@ -256,75 +218,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
this.setSuccess(true);
|
||||
return stack;
|
||||
}
|
||||
@@ -489,7 +497,7 @@ public interface DispenseItemBehavior {
|
||||
Direction enumdirection = (Direction) pointer.state().getValue(DispenserBlock.FACING);
|
||||
// CraftBukkit start
|
||||
ServerLevel worldserver = pointer.level();
|
||||
- ItemStack itemstack1 = stack.split(1);
|
||||
+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event
|
||||
org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
@@ -499,12 +507,13 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
- stack.grow(1);
|
||||
+ // stack.grow(1); // Paper - shrink below
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
- stack.grow(1);
|
||||
+ shrink = false; // Paper - shrink below
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -521,7 +530,7 @@ public interface DispenseItemBehavior {
|
||||
|
||||
entityfireworks.shoot((double) enumdirection.getStepX(), (double) enumdirection.getStepY(), (double) enumdirection.getStepZ(), 0.5F, 1.0F);
|
||||
pointer.level().addFreshEntity(entityfireworks);
|
||||
- // itemstack.shrink(1); // Handled during event processing
|
||||
+ if (shrink) stack.shrink(1); // Paper - actually handle here
|
||||
// CraftBukkit end
|
||||
return stack;
|
||||
}
|
||||
@@ -546,7 +555,7 @@ public interface DispenseItemBehavior {
|
||||
double d5 = randomsource.triangle((double) enumdirection.getStepZ(), 0.11485000000000001D);
|
||||
|
||||
// CraftBukkit start
|
||||
- ItemStack itemstack1 = stack.split(1);
|
||||
+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper - shrink below and single item in event
|
||||
org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
@@ -556,12 +565,13 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
- stack.grow(1);
|
||||
+ // stack.grow(1); // Paper - shrink at end
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
- stack.grow(1);
|
||||
+ shrink = false; // Paper - shrink at end
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -576,7 +586,7 @@ public interface DispenseItemBehavior {
|
||||
entitysmallfireball.projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(pointer.blockEntity());
|
||||
|
||||
worldserver.addFreshEntity(entitysmallfireball);
|
||||
- // itemstack.shrink(1); // Handled during event processing
|
||||
+ if (shrink) stack.shrink(1); // Paper - actually handle here
|
||||
// CraftBukkit end
|
||||
return stack;
|
||||
}
|
||||
@@ -626,7 +636,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -413,7 +421,7 @@ public interface DispenseItemBehavior {
|
||||
if (willEmptyContentsSolidBucketItem || willEmptyBucketItem) {
|
||||
// Paper end - correctly check if the bucket place will succeed
|
||||
org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos());
|
||||
@ -333,7 +227,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(x, y, z));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -700,7 +710,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -486,7 +494,7 @@ public interface DispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos());
|
||||
@ -342,7 +236,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -747,7 +757,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -533,7 +541,7 @@ public interface DispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos());
|
||||
@ -351,7 +245,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -808,7 +818,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -596,7 +604,7 @@ public interface DispenseItemBehavior {
|
||||
BlockPos blockposition = pointer.pos().relative((Direction) pointer.state().getValue(DispenserBlock.FACING));
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos());
|
||||
@ -360,7 +254,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -874,7 +884,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -662,7 +670,7 @@ public interface DispenseItemBehavior {
|
||||
// CraftBukkit start
|
||||
// EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null);
|
||||
|
||||
@ -369,7 +263,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
@@ -884,12 +894,13 @@ public interface DispenseItemBehavior {
|
||||
@@ -672,12 +680,13 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -385,16 +279,16 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -905,7 +916,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -693,7 +702,7 @@ public interface DispenseItemBehavior {
|
||||
worldserver.addFreshEntity(entitytntprimed);
|
||||
worldserver.playSound((Player) null, entitytntprimed.getX(), entitytntprimed.getY(), entitytntprimed.getZ(), SoundEvents.TNT_PRIMED, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||
worldserver.gameEvent((Entity) null, GameEvent.ENTITY_PLACE, blockposition);
|
||||
worldserver.gameEvent((Entity) null, (Holder) GameEvent.ENTITY_PLACE, blockposition);
|
||||
- // itemstack.shrink(1); // CraftBukkit - handled above
|
||||
+ if (shrink) stack.shrink(1); // Paper - actually handle here
|
||||
return stack;
|
||||
}
|
||||
});
|
||||
@@ -932,7 +943,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -720,7 +729,7 @@ public interface DispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos());
|
||||
@ -403,7 +297,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -981,7 +992,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -769,7 +778,7 @@ public interface DispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos());
|
||||
@ -412,7 +306,7 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -1054,7 +1065,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -842,7 +851,7 @@ public interface DispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos());
|
||||
@ -421,11 +315,49 @@ index 24b2d57ebe76ce825686a53c94ae994b418a1272..b83af374a33a66a6ceeca119b961eea8
|
||||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java
|
||||
index 1b1c54ce8f187b968352d4aad05821ece182e20b..985954030654d521291cccbfc3ca49b67ee4357d 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java
|
||||
@@ -40,7 +40,7 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
// this.projectileItem.shoot(iprojectile, (double) enumdirection.getStepX(), (double) enumdirection.getStepY(), (double) enumdirection.getStepZ(), this.dispenseConfig.power(), this.dispenseConfig.uncertainty());
|
||||
- ItemStack itemstack1 = stack.split(1);
|
||||
+ ItemStack itemstack1 = stack.copyWithCount(1); // Paper
|
||||
org.bukkit.block.Block block = CraftBlock.at(worldserver, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
@@ -50,12 +50,13 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
- stack.grow(1);
|
||||
+ // stack.grow(1); // Paper - shrink below
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
- stack.grow(1);
|
||||
+ shrink = false; // Paper - shrink below
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -69,7 +70,7 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior {
|
||||
((Entity) iprojectile).projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(pointer.blockEntity());
|
||||
// CraftBukkit end
|
||||
worldserver.addFreshEntity(iprojectile);
|
||||
- // itemstack.shrink(1); // CraftBukkit - Handled during event processing
|
||||
+ if (shrink) stack.shrink(1); // Paper - actually handle here
|
||||
return stack;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
index e17090003988ad2c890d48666c2234b14d511345..45d356c1ed888b4d749379ceaa8a95d7d7c876d5 100644
|
||||
index 4924926327787e7564116e9d6e20d2c2e98b2229..fbed5d57db0c0e79996f85571b9af0071fa953c7 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
@@ -37,7 +37,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
|
||||
@@ -38,7 +38,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
|
||||
ServerLevel worldserver = pointer.level();
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos());
|
||||
@ -448,10 +380,10 @@ index f84987c36a16df19286d6f1badfb1ffb9cc7e770..6f2adf2334e35e8a617a4ced0c1af2ab
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ArmorItem.java b/src/main/java/net/minecraft/world/item/ArmorItem.java
|
||||
index a745dc02ae25bcf10cee954b6e53f8b106fd045d..42d87800a328f71c5127ce5599ca4c71cc9bb1cd 100644
|
||||
index f1cee3266e95094dd1afd501c96e4beaa3d71796..e766397aae3f73548b290b0809b9d1ca0967ea39 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ArmorItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ArmorItem.java
|
||||
@@ -62,7 +62,7 @@ public class ArmorItem extends Item implements Equipable {
|
||||
@@ -64,7 +64,7 @@ public class ArmorItem extends Item implements Equipable {
|
||||
} else {
|
||||
LivingEntity entityliving = (LivingEntity) list.get(0);
|
||||
EquipmentSlot enumitemslot = Mob.getEquipmentSlotForItem(armor);
|
||||
@ -460,7 +392,7 @@ index a745dc02ae25bcf10cee954b6e53f8b106fd045d..42d87800a328f71c5127ce5599ca4c71
|
||||
// CraftBukkit start
|
||||
Level world = pointer.level();
|
||||
org.bukkit.block.Block block = CraftBlock.at(world, pointer.pos());
|
||||
@@ -74,12 +74,13 @@ public class ArmorItem extends Item implements Equipable {
|
||||
@@ -76,12 +76,13 @@ public class ArmorItem extends Item implements Equipable {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -476,7 +408,7 @@ index a745dc02ae25bcf10cee954b6e53f8b106fd045d..42d87800a328f71c5127ce5599ca4c71
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -96,6 +97,7 @@ public class ArmorItem extends Item implements Equipable {
|
||||
@@ -98,6 +99,7 @@ public class ArmorItem extends Item implements Equipable {
|
||||
((Mob) entityliving).setPersistenceRequired();
|
||||
}
|
||||
|
||||
@ -485,10 +417,10 @@ index a745dc02ae25bcf10cee954b6e53f8b106fd045d..42d87800a328f71c5127ce5599ca4c71
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/MinecartItem.java b/src/main/java/net/minecraft/world/item/MinecartItem.java
|
||||
index 9bcca21ba03dc838f3e857018adee9506d8bb6a3..3aa73cd44aa8c86b78c35bc1788e4f83018c49ed 100644
|
||||
index 727319e86aa77b5a67b4c4f03b1e9aba9fe6bcde..66074445d3908b9bb1c8d70e1e27d057720ec8e5 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/MinecartItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/MinecartItem.java
|
||||
@@ -65,7 +65,7 @@ public class MinecartItem extends Item {
|
||||
@@ -66,7 +66,7 @@ public class MinecartItem extends Item {
|
||||
|
||||
// CraftBukkit start
|
||||
// EntityMinecartAbstract entityminecartabstract = EntityMinecartAbstract.createMinecart(worldserver, d0, d1 + d3, d2, ((ItemMinecart) itemstack.getItem()).type);
|
||||
@ -497,7 +429,7 @@ index 9bcca21ba03dc838f3e857018adee9506d8bb6a3..3aa73cd44aa8c86b78c35bc1788e4f83
|
||||
org.bukkit.block.Block block2 = CraftBlock.at(worldserver, pointer.pos());
|
||||
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
|
||||
@@ -75,12 +75,13 @@ public class MinecartItem extends Item {
|
||||
@@ -76,12 +76,13 @@ public class MinecartItem extends Item {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -513,7 +445,7 @@ index 9bcca21ba03dc838f3e857018adee9506d8bb6a3..3aa73cd44aa8c86b78c35bc1788e4f83
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -93,8 +94,7 @@ public class MinecartItem extends Item {
|
||||
@@ -94,8 +95,7 @@ public class MinecartItem extends Item {
|
||||
itemstack1 = CraftItemStack.asNMSCopy(event.getItem());
|
||||
AbstractMinecart entityminecartabstract = AbstractMinecart.createMinecart(worldserver, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), ((MinecartItem) itemstack1.getItem()).type, itemstack1, (Player) null);
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockLockCheckEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
index fce3a45d09a93ca68a3d49f2e666afa4c860d042..b8b4d74076fa5ed6eb3b2045384db77e165931b2 100644
|
||||
index ff3f26c31bd11b48f48e354ea6b33aa55dcbff5d..02675f15e157ce68506c813b19cf5472bf67bc00 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
@@ -69,17 +69,44 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
||||
@@ -73,17 +73,44 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
||||
protected abstract Component getDefaultName();
|
||||
|
||||
public boolean canOpen(Player player) {
|
||||
@ -54,12 +54,12 @@ index fce3a45d09a93ca68a3d49f2e666afa4c860d042..b8b4d74076fa5ed6eb3b2045384db77e
|
||||
+ } // Paper - Add BlockLockCheckEvent
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected abstract NonNullList<ItemStack> getItems();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
index 247f24c7fadc203ee0f6a6f85122c91ab4c82f80..eff48e43a35a752bd33de2b55a0ad04332109ce0 100644
|
||||
index 35c7d05b1898adf6b193d0b0b53f3c3be186d4ce..2e3d89ca35b513340cd1ebefa875280b32e1756e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
@@ -470,7 +470,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
@@ -472,7 +472,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
@Nullable
|
||||
@Override
|
||||
public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory, Player player) {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add Sneaking API for Entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index f6d6b2c7aefc39a6e6e2b0e61fd9afb334bee764..4dfbcaba4615bd761c1eb9d5994168c7202fc571 100644
|
||||
index 92c80776273f6be43b40686c7ab7dd7371b1c06f..365281dfc0308c5db0c72b56208d9b87be0e955e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -872,6 +872,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Improve logging and errors
|
||||
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/advancements/AdvancementTree.java b/src/main/java/net/minecraft/advancements/AdvancementTree.java
|
||||
index 938fe76677139e7e99698b61691bfcadf70dbd87..a017ebf550e3430c14a7159baa9a644530a0b5ab 100644
|
||||
index 2665170b8391a77d6b3fb7ae7b5ccfc0be65acd7..e00d4e0896c0163c43d79af63338de67c7cb0dc4 100644
|
||||
--- a/src/main/java/net/minecraft/advancements/AdvancementTree.java
|
||||
+++ b/src/main/java/net/minecraft/advancements/AdvancementTree.java
|
||||
@@ -35,7 +35,7 @@ public class AdvancementTree {
|
||||
@ -28,10 +28,10 @@ index 938fe76677139e7e99698b61691bfcadf70dbd87..a017ebf550e3430c14a7159baa9a6445
|
||||
|
||||
private boolean tryInsert(AdvancementHolder advancement) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ServerAdvancementManager.java b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
||||
index 536f0c496ce36ca3248fc6eeac9bbd77214a36f9..31718823250a1490b783f426fff65bf5a067b6f4 100644
|
||||
index 4fa6abfe79ab7ff0e7643975351ab1a10efdc278..b4f15c51faae544bc0a4fcc33760df66e1397f87 100644
|
||||
--- a/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
||||
@@ -66,6 +66,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener {
|
||||
@@ -67,6 +67,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener {
|
||||
AdvancementTree advancementtree = new AdvancementTree();
|
||||
|
||||
advancementtree.addAll(this.advancements.values());
|
||||
@ -40,10 +40,10 @@ index 536f0c496ce36ca3248fc6eeac9bbd77214a36f9..31718823250a1490b783f426fff65bf5
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 5675931fe3ea896027a510944fc484f41f5ef555..1b38d267daa7902bcb7d2a71d28b3f39da722ad1 100644
|
||||
index fdff82ed5dbf5176d470b9b6c41acfe6b98c7039..00679b76715fde4b90a999fd11cca40d048b1349 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -265,6 +265,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -278,6 +278,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!");
|
||||
DedicatedServer.LOGGER.warn("The exception was: {}", ioexception.toString());
|
||||
DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?");
|
||||
@ -52,10 +52,10 @@ index 5675931fe3ea896027a510944fc484f41f5ef555..1b38d267daa7902bcb7d2a71d28b3f39
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index faa43550844fd3a3595bd9621b5730c209a54124..dd7f0aed33183dd51e3378d2430df4f7c96ae730 100644
|
||||
index d20baa57c5367861fb5b3b6ea746a6391b6115cc..c9b4960d9818b71ca2af5e2e23755545ca7da55a 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -3309,7 +3309,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -3393,7 +3393,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator));
|
||||
} catch (ProfilePublicKey.ValidationException profilepublickey_b) {
|
||||
@ -65,10 +65,10 @@ index faa43550844fd3a3595bd9621b5730c209a54124..dd7f0aed33183dd51e3378d2430df4f7
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/packs/PathPackResources.java b/src/main/java/net/minecraft/server/packs/PathPackResources.java
|
||||
index 87928500f40ceeaad6669de194d2c80089051e60..8d554e7bb1291ac24a958a92458f993344e3be3b 100644
|
||||
index ed1d3d30404dfc6303e746f31295b6b1aa40f204..8d7565eda4536e8aa42dd3dcbcfac38cbf16020a 100644
|
||||
--- a/src/main/java/net/minecraft/server/packs/PathPackResources.java
|
||||
+++ b/src/main/java/net/minecraft/server/packs/PathPackResources.java
|
||||
@@ -102,6 +102,12 @@ public class PathPackResources extends AbstractPackResources {
|
||||
@@ -103,6 +103,12 @@ public class PathPackResources extends AbstractPackResources {
|
||||
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path)) {
|
||||
for (Path path2 : directoryStream) {
|
||||
String string = path2.getFileName().toString();
|
||||
@ -82,20 +82,20 @@ index 87928500f40ceeaad6669de194d2c80089051e60..8d554e7bb1291ac24a958a92458f9933
|
||||
set.add(string);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
index 4259181bab2dc4f2d0409b56fdf81d966003376d..a0ab3c55826af292d1cdac05648139b4d31f1376 100644
|
||||
index 9ae23dbf076e977c9d9b98a02c5925e9a8f68f7f..0126b88f60904dfbf1e29eb3b89a985061d91f91 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
@@ -84,7 +84,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||
return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore?
|
||||
}));
|
||||
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
|
||||
- RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
|
||||
@@ -79,7 +79,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||
this.byType = LinkedHashMultimap.create(builder.build());
|
||||
this.byName = Maps.newHashMap(com_google_common_collect_immutablemap_builder.build());
|
||||
// CraftBukkit end
|
||||
- RecipeManager.LOGGER.info("Loaded {} recipes", this.byType.size());
|
||||
+ RecipeManager.LOGGER.info("Loaded {} recipes", this.byName.size()); // Paper - Improve logging and errors; log correct number of recipes
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
index 080cca90f15d90249b7a38f33286ae2f735ba7d9..fde9aadd6c688b9797a6755f9d214918047598a0 100644
|
||||
index 1f82491fc885e3c349fca779ce98798a5c6efde5..71d057dc8c7362f8e7aaca5e31c9f02b2bf3f281 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
@@ -44,6 +44,7 @@ import org.bukkit.material.MaterialData;
|
@ -5,10 +5,10 @@ Subject: [PATCH] Improve PortalEvents
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 96a1f1460daba1507659a8ed34b608ded7084c0f..99035a91f04cc838e30b860d480ef710e1dbe2ea 100644
|
||||
index 63e4fa54c6931a3fc33b081662823f5b736d8496..48103cefacf75a51619f7a3ebeb7731956a65a4f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3495,7 +3495,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -3513,7 +3513,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
Location enter = bukkitEntity.getLocation();
|
||||
Location exit = CraftLocation.toBukkit(exitPosition, exitWorldServer.getWorld());
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add config option for spider worldborder climbing
|
||||
|
||||
|
||||
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 4d5cfaa58bdf4e6cb975134004d14c591f6e85fa..d90da2f9e4d6214577bc81bd6c70ba8593788898 100644
|
||||
index c80019f0c9f814c5259b4d3ec2d8a85669dc728f..6006480d9f6d60bb7b5628eabe6740013066cde4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
||||
@@ -86,7 +86,7 @@ public class Spider extends Monster {
|
||||
@@ -82,7 +82,7 @@ public class Spider extends Monster {
|
||||
public void tick() {
|
||||
super.tick();
|
||||
if (!this.level().isClientSide) {
|
@ -5,11 +5,11 @@ Subject: [PATCH] Add missing SpigotConfig logCommands check
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index dd7f0aed33183dd51e3378d2430df4f7c96ae730..5f1c31323d58cdc4419cf5f8870a8acf121c7669 100644
|
||||
index c9b4960d9818b71ca2af5e2e23755545ca7da55a..6e6024d9c397894903130a4b91a621ae1844a4b5 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2060,7 +2060,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
private void performChatCommand(ServerboundChatCommandPacket packet, LastSeenMessages lastSeenMessages) {
|
||||
@@ -2087,7 +2087,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
private void performSignedChatCommand(ServerboundChatCommandSignedPacket packet, LastSeenMessages lastSeenMessages) {
|
||||
// CraftBukkit start
|
||||
String command = "/" + packet.command();
|
||||
+ if (org.spigotmc.SpigotConfig.logCommands) { // Paper - Add missing SpigotConfig logCommands check
|
@ -5,18 +5,18 @@ Subject: [PATCH] Flying Fall Damage
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 262cefa51856cf6a58ae3b80b1ae93a5dd7bfaa7..e92cb12a04827c2afc0662a26320458527aa2bd4 100644
|
||||
index 761e8a0c4e1db465c18892999e86885f27ca8075..230ffd3c4541ef8979605d733b6463e39cd00206 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -182,6 +182,7 @@ public abstract class Player extends LivingEntity {
|
||||
public FishingHook fishing;
|
||||
public float hurtDir; // Paper - protected -> public
|
||||
@@ -194,6 +194,7 @@ public abstract class Player extends LivingEntity {
|
||||
public Entity currentExplosionCause;
|
||||
public boolean ignoreFallDamageFromCurrentImpulse;
|
||||
public boolean affectsSpawning = true; // Paper - Affects Spawning API
|
||||
+ public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
|
||||
|
||||
// CraftBukkit start
|
||||
public boolean fauxSleeping;
|
||||
@@ -1680,7 +1681,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1693,7 +1694,7 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
@Override
|
||||
public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
@ -26,10 +26,10 @@ index 262cefa51856cf6a58ae3b80b1ae93a5dd7bfaa7..e92cb12a04827c2afc0662a263204585
|
||||
} else {
|
||||
if (fallDistance >= 2.0F) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index f80a71100d317c8670b728a7c289ffa40dd2038b..5a2969f97207b3d42937e8afffbc9293cba7cbf6 100644
|
||||
index af6713dc949cce945f3625092a01f04ad41120e7..1925d55ffb0fbf554fc3d6f6d75f119146f60dca 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2500,6 +2500,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2566,6 +2566,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().onUpdateAbilities();
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add exploded block state to BlockExplodeEvent and
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
index 8187feffe52efa5c887f1910e581a37c6e439401..1561b85a45f52a8162f43553f8485bfe084b8f1f 100644
|
||||
index ec52c7a75d9988475fbb4fe12ef7f4489ef3d894..a78fd4f9ce97ebece45979908382de8f5fc14c1b 100644
|
||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -20,6 +20,7 @@ public class DamageSource {
|
||||
@@ -21,6 +21,7 @@ public class DamageSource {
|
||||
private final Entity directEntity;
|
||||
@Nullable
|
||||
private final Vec3 damageSourcePosition;
|
||||
@ -17,7 +17,7 @@ index 8187feffe52efa5c887f1910e581a37c6e439401..1561b85a45f52a8162f43553f8485bfe
|
||||
// CraftBukkit start
|
||||
@Nullable
|
||||
private org.bukkit.block.Block directBlock; // The block that caused the damage. damageSourcePosition is not used for all block damages
|
||||
@@ -88,6 +89,7 @@ public class DamageSource {
|
||||
@@ -94,6 +95,7 @@ public class DamageSource {
|
||||
|
||||
private DamageSource cloneInstance() {
|
||||
DamageSource damageSource = new DamageSource(this.type, this.directEntity, this.causingEntity, this.damageSourcePosition);
|
||||
@ -26,10 +26,10 @@ index 8187feffe52efa5c887f1910e581a37c6e439401..1561b85a45f52a8162f43553f8485bfe
|
||||
damageSource.withSweep = this.isSweep();
|
||||
damageSource.poison = this.isPoison();
|
||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
||||
index 8c0653012192144cd11c802d1ad9bf7e42e94f59..a47473c9875c70c52b9a61e0156e55961f34c694 100644
|
||||
index 2f5591aa232b834bb9b69a2a349ce93d1a9c63fa..8ba60de95845f4d56f299c5f1b2b5163461ba38d 100644
|
||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
||||
@@ -257,8 +257,17 @@ public class DamageSources {
|
||||
@@ -265,8 +265,17 @@ public class DamageSources {
|
||||
return this.source(DamageTypes.SONIC_BOOM, attacker);
|
||||
}
|
||||
|
||||
@ -49,10 +49,10 @@ index 8c0653012192144cd11c802d1ad9bf7e42e94f59..a47473c9875c70c52b9a61e0156e5596
|
||||
|
||||
public DamageSource outOfBorder() {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
index 2d1fe6af7923ad4a0143f2d3fd28abc85e6092c1..217018dbdd78af4b89d9d4e7154956593dfa8dae 100644
|
||||
index aa81144975fa66bcdb3d107e2a461b6d62d8e59e..fbd1f4f3a8c94a4842f91b7cc6c21f0cf7edd7ac 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -383,7 +383,7 @@ public class Explosion {
|
||||
@@ -386,7 +386,7 @@ public class Explosion {
|
||||
bukkitBlocks = event.blockList();
|
||||
this.yield = event.getYield();
|
||||
} else {
|
||||
@ -62,10 +62,10 @@ index 2d1fe6af7923ad4a0143f2d3fd28abc85e6092c1..217018dbdd78af4b89d9d4e715495659
|
||||
this.wasCanceled = event.isCancelled();
|
||||
bukkitBlocks = event.blockList();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
index c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6efbde620c 100644
|
||||
index 03035ed3df2f32e14a8eb9bc3d536ef64b5d87ba..872bec4c366c86177334452315cc4a8097dae3c0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
@@ -96,6 +96,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
@@ -95,6 +95,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
|
||||
// CraftBukkit - moved world and biome check into EntityHuman
|
||||
if (false && !BedBlock.canSetSpawn(world)) {
|
||||
@ -73,7 +73,7 @@ index c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6e
|
||||
world.removeBlock(pos, false);
|
||||
BlockPos blockposition1 = pos.relative(((Direction) state.getValue(BedBlock.FACING)).getOpposite());
|
||||
|
||||
@@ -105,7 +106,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
@@ -104,7 +105,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
|
||||
Vec3 vec3d = pos.getCenter();
|
||||
|
||||
@ -82,7 +82,7 @@ index c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6e
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) {
|
||||
if (!this.kickVillagerOutOfBed(world, pos)) {
|
||||
@@ -147,6 +148,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
@@ -146,6 +147,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
private InteractionResult explodeBed(BlockState iblockdata, Level world, BlockPos blockposition) {
|
||||
{
|
||||
{
|
||||
@ -90,7 +90,7 @@ index c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6e
|
||||
world.removeBlock(blockposition, false);
|
||||
BlockPos blockposition1 = blockposition.relative(((Direction) iblockdata.getValue(BedBlock.FACING)).getOpposite());
|
||||
|
||||
@@ -156,7 +158,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
@@ -155,7 +157,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
|
||||
Vec3 vec3d = blockposition.getCenter();
|
||||
|
||||
@ -100,10 +100,10 @@ index c5d892950b4027cf9879eafc1c0f4e4c62fb4f51..c14cddd42c61512c312231b1e93ccc6e
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
index acd5ec218b8d4c096f44ae2eec1379eeaf30ddc5..088262f306755a9cb785c7a0cf0a9c66ed0965a8 100644
|
||||
index a4a90df0b500fb440226b07462faaa87594b12a5..c389e2f891655bd8c9f307057dc1ad62dfcbc79e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
@@ -131,6 +131,7 @@ public class RespawnAnchorBlock extends Block {
|
||||
@@ -133,6 +133,7 @@ public class RespawnAnchorBlock extends Block {
|
||||
}
|
||||
|
||||
private void explode(BlockState state, Level world, final BlockPos explodedPos) {
|
||||
@ -111,7 +111,7 @@ index acd5ec218b8d4c096f44ae2eec1379eeaf30ddc5..088262f306755a9cb785c7a0cf0a9c66
|
||||
world.removeBlock(explodedPos, false);
|
||||
Stream<Direction> stream = Direction.Plane.HORIZONTAL.stream(); // CraftBukkit - decompile error
|
||||
|
||||
@@ -147,7 +148,7 @@ public class RespawnAnchorBlock extends Block {
|
||||
@@ -149,7 +150,7 @@ public class RespawnAnchorBlock extends Block {
|
||||
};
|
||||
Vec3 vec3d = explodedPos.getCenter();
|
||||
|
||||
@ -121,11 +121,11 @@ index acd5ec218b8d4c096f44ae2eec1379eeaf30ddc5..088262f306755a9cb785c7a0cf0a9c66
|
||||
|
||||
public static boolean canSetSpawn(Level world) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
index f81c0d07a5efc92942d8ab5c50a8260db033307d..8afc396c162d928902a9d9beb9f039b06630f755 100644
|
||||
index c38b7148a3bbe7d29adea19d08dde4d9c8e29704..30b40d3715f98eff90d16aad491f5be5162be9e2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
@@ -276,6 +276,12 @@ public final class CraftBlockStates {
|
||||
BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag);
|
||||
@@ -291,6 +291,12 @@ public final class CraftBlockStates {
|
||||
BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag, registry);
|
||||
return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity);
|
||||
}
|
||||
+ // Paper start - add exploded state
|
||||
@ -138,11 +138,11 @@ index f81c0d07a5efc92942d8ab5c50a8260db033307d..8afc396c162d928902a9d9beb9f039b0
|
||||
// See BlockStateFactory#createBlockState(World, BlockPosition, IBlockData, TileEntity)
|
||||
private static CraftBlockState getBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 6b226ab2b6365788362683e629c8cece12118233..82c0a13558948a5f5e5cee0e2b67fcde5a906301 100644
|
||||
index c52cb55cd1da988ec646e4e1484ec1a72513291d..a226b7cdc9c63ef09d7d48269c287af1ab6dbdc4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1071,7 +1071,7 @@ public class CraftEventFactory {
|
||||
Entity damager = source.getCausingEntity();
|
||||
@@ -1070,7 +1070,7 @@ public class CraftEventFactory {
|
||||
Entity damager = (bukkitDamageSource.isIndirect() && source.getDirectEntity() != null) ? source.getDirectEntity() : source.getCausingEntity();
|
||||
if (source.is(DamageTypeTags.IS_EXPLOSION)) {
|
||||
if (damager == null) {
|
||||
- return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
|
||||
@ -150,7 +150,7 @@ index 6b226ab2b6365788362683e629c8cece12118233..82c0a13558948a5f5e5cee0e2b67fcde
|
||||
}
|
||||
DamageCause damageCause = (damager.getBukkitEntity() instanceof org.bukkit.entity.TNTPrimed) ? DamageCause.BLOCK_EXPLOSION : DamageCause.ENTITY_EXPLOSION;
|
||||
return CraftEventFactory.callEntityDamageEvent(damager, entity, damageCause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
|
||||
@@ -1122,7 +1122,7 @@ public class CraftEventFactory {
|
||||
@@ -1117,7 +1117,7 @@ public class CraftEventFactory {
|
||||
} else {
|
||||
throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, source.getDirectBlock(), source.getMsgId()));
|
||||
}
|
||||
@ -159,7 +159,7 @@ index 6b226ab2b6365788362683e629c8cece12118233..82c0a13558948a5f5e5cee0e2b67fcde
|
||||
}
|
||||
|
||||
DamageCause cause;
|
||||
@@ -1175,8 +1175,13 @@ public class CraftEventFactory {
|
||||
@@ -1170,8 +1170,13 @@ public class CraftEventFactory {
|
||||
return CraftEventFactory.callEntityDamageEvent(event, damagee, cancelled);
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Expose pre-collision moving velocity to
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 99035a91f04cc838e30b860d480ef710e1dbe2ea..9eecdc0a6fb111fb36e4e8e8666d056563e48cda 100644
|
||||
index 48103cefacf75a51619f7a3ebeb7731956a65a4f..09defe4a20c7b0794cba358c177e787f1c0273c1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -957,6 +957,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -968,6 +968,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public void move(MoverType movementType, Vec3 movement) {
|
||||
@ -17,7 +17,7 @@ index 99035a91f04cc838e30b860d480ef710e1dbe2ea..9eecdc0a6fb111fb36e4e8e8666d0565
|
||||
if (this.noPhysics) {
|
||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||
} else {
|
||||
@@ -1041,7 +1042,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -1052,7 +1053,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
if (!bl.getType().isAir()) {
|
@ -0,0 +1,27 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Wed, 15 Sep 2021 14:52:42 -0700
|
||||
Subject: [PATCH] config for disabling entity tag tags
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index 3ac31c869d0e53410558ddeb79c21d3f5a3decb6..c36b5aa3cf7ecff839f7115bf9be4776bcee13c3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -502,6 +502,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
|
||||
if (minecraftserver != null && entity != null) {
|
||||
if (world.isClientSide || !entity.onlyOpCanSetNbt() || player != null && minecraftserver.getPlayerList().isOp(player.getGameProfile())) {
|
||||
+ // Paper start - filter out protected tags
|
||||
+ if (player == null || !player.getBukkitEntity().hasPermission("minecraft.nbt.place")) {
|
||||
+ nbt = nbt.update((compound) -> {
|
||||
+ for (net.minecraft.commands.arguments.NbtPathArgument.NbtPath tag : world.paperConfig().entities.spawning.filteredEntityTagNbtPaths) {
|
||||
+ tag.remove(compound);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+ // Paper end - filter out protected tags
|
||||
+
|
||||
nbt.loadInto(entity);
|
||||
}
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Use single player info update packet on join
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 5f1c31323d58cdc4419cf5f8870a8acf121c7669..0c87fff227448f7f88e3377989b1091e4badcc53 100644
|
||||
index 6e6024d9c397894903130a4b91a621ae1844a4b5..c3beef7d81e43466d99dbc6a42150a4ae9fa7f54 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -3339,7 +3339,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -3429,7 +3429,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.signedMessageDecoder = session.createMessageDecoder(this.player.getUUID());
|
||||
this.chatMessageChain.append(() -> {
|
||||
this.player.setChatSession(session);
|
||||
@ -18,10 +18,10 @@ index 5f1c31323d58cdc4419cf5f8870a8acf121c7669..0c87fff227448f7f88e3377989b1091e
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 1478def0ba4bc02c1c466d80cc2b90919612c18a..0747b0042446271385371f1ca9c8fefdebd851b8 100644
|
||||
index b2634bdedfe8359da602cf600a2bdddbd762e7c2..eef1fb3265a088a2f6718631c1728f3e32014c14 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -359,6 +359,7 @@ public abstract class PlayerList {
|
||||
@@ -361,6 +361,7 @@ public abstract class PlayerList {
|
||||
// CraftBukkit start - sendAll above replaced with this loop
|
||||
ClientboundPlayerInfoUpdatePacket packet = ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player));
|
||||
|
||||
@ -29,7 +29,7 @@ index 1478def0ba4bc02c1c466d80cc2b90919612c18a..0747b0042446271385371f1ca9c8fefd
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
ServerPlayer entityplayer1 = (ServerPlayer) this.players.get(i);
|
||||
|
||||
@@ -366,12 +367,17 @@ public abstract class PlayerList {
|
||||
@@ -368,12 +369,17 @@ public abstract class PlayerList {
|
||||
entityplayer1.connection.send(packet);
|
||||
}
|
||||
|
@ -22,10 +22,10 @@ This patch corrects this behaviour by only shrinking the item if a totem
|
||||
of undying was found and the event was called uncancelled.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 084d988ec3dcdae54a10309d34d335ca4f37b7b0..c022ec61fa6a84f4e68f4df0a0f07ba8bb368302 100644
|
||||
index 6ac6848fe27336a96a813c84d7d797cc9bc4c297..810e94674acff08eda6d98e91546a2338706ef42 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1618,7 +1618,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1638,7 +1638,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
@ -7,10 +7,10 @@ Subject: [PATCH] Win Screen API
|
||||
public net.minecraft.server.level.ServerPlayer seenCredits
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 5a2969f97207b3d42937e8afffbc9293cba7cbf6..c52399e0c19fd919d59c007786de7c8036c9a424 100644
|
||||
index 1925d55ffb0fbf554fc3d6f6d75f119146f60dca..1519220d02dfeb14fded5687b77a85306faf6dcd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1216,6 +1216,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1292,6 +1292,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().connection.send(packet);
|
||||
}
|
||||
|
@ -16,10 +16,10 @@ with less than zero amounts, so this code doesn't create
|
||||
a problem with operations on the vanilla ItemStack.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index 6b75314023adf313937990e31323dff9bacc564b..fb2e4881096459eff16a7c46faa9921166837ee9 100644
|
||||
index 79529a5208810d25aeab537eac70ed9c6583ef18..be2b7c2b412a1d64466c25c1b19b10a869cd288d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -161,7 +161,7 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -160,7 +160,7 @@ public final class CraftItemStack extends ItemStack {
|
||||
}
|
||||
|
||||
this.handle.setCount(amount);
|
@ -5,16 +5,16 @@ Subject: [PATCH] Fix force-opening enchantment tables
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
index 98ee3a7eff6cd1dd3fdbd7cc6a94deebcefbc565..103d5e14972516968030df255cde49c82b93c38f 100644
|
||||
index 79faf3c64891899bf5d6d119154aba02d4665b3b..e1150d36de56466ad9fdd5f2cdb4c30855d4af70 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -405,7 +405,18 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
@@ -403,7 +403,18 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
|
||||
// If there isn't an enchant table we can force create one, won't be very useful though.
|
||||
BlockPos pos = CraftLocation.toBlockPosition(location);
|
||||
- this.getHandle().openMenu(((EnchantmentTableBlock) Blocks.ENCHANTING_TABLE).getMenuProvider(null, this.getHandle().level(), pos));
|
||||
- this.getHandle().openMenu(Blocks.ENCHANTING_TABLE.defaultBlockState().getMenuProvider(this.getHandle().level(), pos));
|
||||
+ // Paper start
|
||||
+ MenuProvider menuProvider = ((EnchantmentTableBlock) Blocks.ENCHANTING_TABLE).getMenuProvider(null, this.getHandle().level(), pos);
|
||||
+ MenuProvider menuProvider = Blocks.ENCHANTING_TABLE.defaultBlockState().getMenuProvider(this.getHandle().level(), pos);
|
||||
+ if (menuProvider == null) {
|
||||
+ if (!force) {
|
||||
+ return null;
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Entity Body Yaw API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 4dfbcaba4615bd761c1eb9d5994168c7202fc571..8025b3e9afebc9ad0c08453403422589bf5dd27d 100644
|
||||
index 365281dfc0308c5db0c72b56208d9b87be0e955e..991b94ff1186b1071a94b2662873dc071255e2e6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1154,6 +1154,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -1164,6 +1164,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
}
|
||||
// Paper end - entity powdered snow API
|
||||
|
||||
@ -43,10 +43,10 @@ index 4dfbcaba4615bd761c1eb9d5994168c7202fc571..8025b3e9afebc9ad0c08453403422589
|
||||
@Override
|
||||
public boolean isInvisible() { // Paper - moved up from LivingEntity
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index b0c03854ee9936b1dac9cbf89e9977d978712d56..ab1e1a56f3811d4446a6b0a7461c0bddd8015228 100644
|
||||
index 51e9b9f7460ec4f8b14d570356026d433351806d..4f31bf6f51a72b010b850e1e62a06b455eac906c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -1191,4 +1191,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -1176,4 +1176,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
this.getHandle().frictionState = state;
|
||||
}
|
||||
// Paper end - friction API
|
@ -10,10 +10,10 @@ https://bugs.mojang.com/browse/MC-157464
|
||||
https://github.com/PaperMC/Paper/issues/8569
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
|
||||
index 5feef31a37aa30a0fdabd14396f5cdb05ad63030..d2917f9b215919890f28b513601863ccaced17c7 100644
|
||||
index 5a18bf854792339fcd54e32f8053d014f3d195a5..f000a6c1e61198e6dd06ae5f084d12fdf309f50a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
|
||||
@@ -35,7 +35,7 @@ public class VillagerGoalPackages {
|
||||
@@ -38,7 +38,7 @@ public class VillagerGoalPackages {
|
||||
Pair.of(1, new MoveToTargetSink()),
|
||||
Pair.of(2, PoiCompetitorScan.create()),
|
||||
Pair.of(3, new LookAndFollowTradingPlayerSink(speed)),
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityFertilizeEggEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
index cfc0cee09dfd522409bb5853fc96528bd0137475..6a98f66b7701e8af389ca9a1e9eb230a6100c838 100644
|
||||
index b550befd7bd05951be160f81600200b0b31bae5b..3eabf1e94c0a1086f471e30bf523581907169c58 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
@@ -443,6 +443,10 @@ public class Turtle extends Animal {
|
||||
@@ -441,6 +441,10 @@ public class Turtle extends Animal {
|
||||
if (entityplayer == null && this.partner.getLoveCause() != null) {
|
||||
entityplayer = this.partner.getLoveCause();
|
||||
}
|
||||
@ -19,7 +19,7 @@ index cfc0cee09dfd522409bb5853fc96528bd0137475..6a98f66b7701e8af389ca9a1e9eb230a
|
||||
|
||||
if (entityplayer != null) {
|
||||
entityplayer.awardStat(Stats.ANIMALS_BRED);
|
||||
@@ -457,7 +461,7 @@ public class Turtle extends Animal {
|
||||
@@ -455,7 +459,7 @@ public class Turtle extends Animal {
|
||||
RandomSource randomsource = this.animal.getRandom();
|
||||
|
||||
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||
@ -29,10 +29,10 @@ index cfc0cee09dfd522409bb5853fc96528bd0137475..6a98f66b7701e8af389ca9a1e9eb230a
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index 70bbc325e3a1f7f334a6d1024097800efa6bec03..a03fb7aa9f4528f4885db88eaf480202d5f54750 100644
|
||||
index a7af50ebc17abd829a7254c03785206da9624060..816977990639ec0559b652fc9666afd5046f0a5d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -263,7 +263,12 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
||||
@@ -261,7 +261,12 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
|
||||
@Override
|
||||
public void spawnChildFromBreeding(ServerLevel world, Animal other) {
|
||||
@ -47,10 +47,10 @@ index 70bbc325e3a1f7f334a6d1024097800efa6bec03..a03fb7aa9f4528f4885db88eaf480202
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index 0e85e3ab58d848b119212fa7d2eb4f92d3efe29b..0a5b953bd8c0c7f181da4090b950e9e6524b6d61 100644
|
||||
index a0c52ce65d4035d135b1536c7408a6867a553447..dc035bf94c5f6574ed8ad369b327b7f7a145e1d6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -347,11 +347,16 @@ public class Sniffer extends Animal {
|
||||
@@ -345,11 +345,16 @@ public class Sniffer extends Animal {
|
||||
|
||||
@Override
|
||||
public void spawnChildFromBreeding(ServerLevel world, Animal other) {
|
||||
@ -69,10 +69,10 @@ index 0e85e3ab58d848b119212fa7d2eb4f92d3efe29b..0a5b953bd8c0c7f181da4090b950e9e6
|
||||
this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F);
|
||||
} // Paper - Call EntityDropItemEvent
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 82c0a13558948a5f5e5cee0e2b67fcde5a906301..3291d8e14b53185a774b0219251d8a080192992b 100644
|
||||
index a226b7cdc9c63ef09d7d48269c287af1ab6dbdc4..e9a70547324dabd97dc90820515a11d2b630a704 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2114,4 +2114,28 @@ public class CraftEventFactory {
|
||||
@@ -2109,4 +2109,28 @@ public class CraftEventFactory {
|
||||
return event.callEvent();
|
||||
}
|
||||
// Paper end
|
@ -7,10 +7,10 @@ Subject: [PATCH] Fix HumanEntity#drop not updating the client inv
|
||||
public net.minecraft.server.level.ServerPlayer containerSynchronizer
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
index 103d5e14972516968030df255cde49c82b93c38f..6a52789d6e68438c1eaa2fb9af591fa9e1d381e2 100644
|
||||
index e1150d36de56466ad9fdd5f2cdb4c30855d4af70..3d36d79a4e7f16f6face3465cdf54656984f3ebc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -752,8 +752,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
@@ -750,8 +750,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
// Paper end
|
||||
@Override
|
||||
public boolean dropItem(boolean dropAll) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add CompostItemEvent and EntityCompostItemEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
index 413b307acaad5823b9e06f49fa2faf561f5f7b9a..f9084e2605d7403721fe6b714bfad051f932aaef 100644
|
||||
index fcd8a977eaa52cd478507c3b44fa72b194df9540..0af05d6f046368af5a5a600288b8329c17f278c7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
@@ -328,7 +328,21 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -336,7 +336,21 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL);
|
||||
float f = ComposterBlock.COMPOSTABLES.getFloat(itemstack.getItem());
|
||||
|
||||
@ -31,7 +31,7 @@ index 413b307acaad5823b9e06f49fa2faf561f5f7b9a..f9084e2605d7403721fe6b714bfad051
|
||||
return iblockdata;
|
||||
} else {
|
||||
int j = i + 1;
|
||||
@@ -477,6 +491,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -485,6 +499,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
if (!itemstack.isEmpty()) {
|
||||
this.changed = true;
|
||||
BlockState iblockdata = ComposterBlock.addItem((Entity) null, this.state, this.level, this.pos, itemstack);
|
@ -10,23 +10,23 @@ Fixes a couple places where the original damage and modified damage
|
||||
were passed in the reverse order to the advancement triggers
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Interaction.java b/src/main/java/net/minecraft/world/entity/Interaction.java
|
||||
index f054d67a637b204de604fadc0d321f5c9816d808..fc5f1e1b445f0a55a35a31d58a90920a80275662 100644
|
||||
index 2ebbf7954dc5e0d6c9d53327d05b725eec310086..c5bd2e90ad74ba08910f65a2e07b6f76435df10f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Interaction.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Interaction.java
|
||||
@@ -160,7 +160,7 @@ public class Interaction extends Entity implements Attackable, Targeting {
|
||||
if (entityhuman instanceof ServerPlayer) {
|
||||
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
||||
|
||||
@@ -156,7 +156,7 @@ public class Interaction extends Entity implements Attackable, Targeting {
|
||||
// CraftBukkit end
|
||||
this.attack = new Interaction.PlayerAction(entityhuman.getUUID(), this.level().getGameTime());
|
||||
if (entityhuman instanceof ServerPlayer entityplayer) {
|
||||
- CriteriaTriggers.PLAYER_HURT_ENTITY.trigger(entityplayer, this, source, (float) event.getFinalDamage(), 1.0F, false); // CraftBukkit
|
||||
+ CriteriaTriggers.PLAYER_HURT_ENTITY.trigger(entityplayer, this, entityhuman.damageSources().generic(), 1.0F, (float) event.getFinalDamage(), false); // CraftBukkit // Paper - use correct source and fix taken/dealt param order
|
||||
}
|
||||
|
||||
return !this.getResponse();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index c022ec61fa6a84f4e68f4df0a0f07ba8bb368302..09a48779046484c2f3628d1499659e247c736fce 100644
|
||||
index 810e94674acff08eda6d98e91546a2338706ef42..a356d0476e6ff9389809e8db1f584ac4bffe8be9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2322,7 +2322,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2369,7 +2369,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
// Duplicate triggers if blocking
|
||||
if (event.getDamage(DamageModifier.BLOCKING) < 0) {
|
||||
if (this instanceof ServerPlayer) {
|
||||
@ -35,7 +35,7 @@ index c022ec61fa6a84f4e68f4df0a0f07ba8bb368302..09a48779046484c2f3628d1499659e24
|
||||
f2 = (float) -event.getDamage(DamageModifier.BLOCKING);
|
||||
if (f2 > 0.0F && f2 < 3.4028235E37F) {
|
||||
((ServerPlayer) this).awardStat(Stats.DAMAGE_BLOCKED_BY_SHIELD, Math.round(originalDamage * 10.0F));
|
||||
@@ -2330,7 +2330,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2377,7 +2377,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
if (damagesource.getEntity() instanceof ServerPlayer) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix text display error on spawn
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Display.java b/src/main/java/net/minecraft/world/entity/Display.java
|
||||
index 4a9aad128c884d659f42f5d6b35e2d7147c4bc17..bba45aa7ba4fa578344ec2b9dfa552097770a59f 100644
|
||||
index bd56721485b3b4ac81c97d60fc2a83bfc20977c0..a658943669cdfd49f66ba713505d11b33306ed86 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Display.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Display.java
|
||||
@@ -899,7 +899,7 @@ public abstract class Display extends Entity {
|
||||
@@ -892,7 +892,7 @@ public abstract class Display extends Entity {
|
||||
b = loadFlag(b, nbt, "default_background", (byte)4);
|
||||
Optional<Display.TextDisplay.Align> optional = Display.TextDisplay.Align.CODEC
|
||||
.decode(NbtOps.INSTANCE, nbt.get("alignment"))
|
@ -9,7 +9,7 @@ when a block or entity location is readily available
|
||||
Co-authored-by: Lukas Planz <lukas.planz@web.de>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/SimpleContainer.java b/src/main/java/net/minecraft/world/SimpleContainer.java
|
||||
index d5eeb2fcb119b815213aeffb3811d4a843502e50..ff1aba1e69cfde633fd01724f1a8d0af7f59437f 100644
|
||||
index c26161784359ea167e11de8aa58eda3b4851059c..6632cf24ebe6d147950a1fdb876660937da86b73 100644
|
||||
--- a/src/main/java/net/minecraft/world/SimpleContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/SimpleContainer.java
|
||||
@@ -63,6 +63,16 @@ public class SimpleContainer implements Container, StackedContentsCompatible {
|
||||
@ -30,10 +30,10 @@ index d5eeb2fcb119b815213aeffb3811d4a843502e50..ff1aba1e69cfde633fd01724f1a8d0af
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
index 9599a5f96601030bf7f7cbd3392861d626959f9d..2813a87a01d0704a3de210cd005073f953d538f8 100644
|
||||
index 580e5714c62aef5a5fdd16606712b96f3d41c938..37735417e2a3df96eea88aa0a3f2d7faeb823a2e 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
@@ -51,6 +51,12 @@ public class BeaconMenu extends AbstractContainerMenu {
|
||||
@@ -52,6 +52,12 @@ public class BeaconMenu extends AbstractContainerMenu {
|
||||
public int getMaxStackSize() {
|
||||
return 1;
|
||||
}
|
||||
@ -47,7 +47,7 @@ index 9599a5f96601030bf7f7cbd3392861d626959f9d..2813a87a01d0704a3de210cd005073f9
|
||||
checkContainerDataCount(propertyDelegate, 3);
|
||||
this.beaconData = propertyDelegate;
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java b/src/main/java/net/minecraft/world/inventory/MerchantContainer.java
|
||||
index 083e50e27685f441ede4c75e913d671fe45d1d15..ac4ec7157cf93b0cbc4472dc42fbbbff3402335a 100644
|
||||
index 7cc96b62f6bacdb44a37d74db214bd0e11c4d503..9140fab07aab32065f7a3b5d13dd17d61dc6d646 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/MerchantContainer.java
|
||||
@@ -65,7 +65,7 @@ public class MerchantContainer implements Container {
|
@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..bcf254e3c81cf1e401bddc850fb24ad2
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java
|
||||
index cc69f471c623c65251ccf7015499d8dbdb70ffad..b453a47cadbda2e22262bcdc5454c4c6cf5b2583 100644
|
||||
index 986f7b18112ef183de3bbff269a92bf6ac945477..9cc81bcccbf1141f66fedada1359b7c0dfa8e22a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java
|
||||
@@ -14,7 +14,7 @@ import org.bukkit.entity.MushroomCow;
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnEggMeta#get/setSpawnedType
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
|
||||
index 50a5321a59895739d3d42f2d06ac9d1b43480cfa..7ff690f386b7fb9e090c86a28f649119505af7b9 100644
|
||||
index c36c004156d3a89dc2209423c57a2ce230d686dc..a6d2370113eb44c0863b7837362dbb350f5057c6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
|
||||
@@ -219,6 +219,30 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta {
|
||||
@@ -224,6 +224,30 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta {
|
||||
public void setSpawnedType(EntityType type) {
|
||||
throw new UnsupportedOperationException("Must change item type to set spawned type");
|
||||
}
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix crash relating to bad recipes in furnace-like tile
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
index d7beeac4a8e4a16221809663a5aa03389a759742..d04fc84eef11adb5ea64077f48794b6ed7fb3ada 100644
|
||||
index d19e799491f790ca967a0731ef95a06993a7ab9a..f40b2582d9087f9dbb5cab950304698f33fdd879 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -643,6 +643,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -613,6 +613,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
Entry<ResourceLocation> entry = (Entry) objectiterator.next();
|
||||
|
||||
worldserver.getRecipeManager().byKey((ResourceLocation) entry.getKey()).ifPresent((recipeholder) -> {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Treat sequence violations like they should be
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0c87fff227448f7f88e3377989b1091e4badcc53..f2b6c74317dbedaa983bb5d821255dc40e1c81e4 100644
|
||||
index c3beef7d81e43466d99dbc6a42150a4ae9fa7f54..e351ed77fbe1ea9de2dd5600d61524eb39c17899 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1964,6 +1964,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1966,6 +1966,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
public void ackBlockChangesUpTo(int sequence) {
|
||||
if (sequence < 0) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] remove duplicate animate packet for records
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/RecordItem.java b/src/main/java/net/minecraft/world/item/RecordItem.java
|
||||
index eca08037fd2742e6e969f91367a0ae053f61a23b..d2ea1b1ea4ac37af09985e1c9da14049c262df7a 100644
|
||||
index 115ac21ea743d30fe8ba62b206da4f5a1bd56cc4..815220924753e87a8f485c2c928222561c726855 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/RecordItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/RecordItem.java
|
||||
@@ -46,7 +46,7 @@ public class RecordItem extends Item {
|
||||
@@ -47,7 +47,7 @@ public class RecordItem extends Item {
|
||||
ItemStack itemstack = context.getItemInHand();
|
||||
|
||||
if (!world.isClientSide) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Prevent causing expired keys from impacting new joins
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
|
||||
index e4f0949b6538734ff25daf68a428262481feeb81..754a2a5e958a04b3f8bf216b6022f547aa1cd36f 100644
|
||||
index 68c062cbaa030d62d97c9c003651f8fc17a00a6b..6247a21c9c391abf1f6db3482c659593e4f29355 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
|
||||
@@ -101,7 +101,15 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
|
||||
@@ -113,7 +113,15 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
|
||||
}),
|
||||
INITIALIZE_CHAT(
|
||||
(serialized, buf) -> serialized.chatSession = buf.readNullable(RemoteChatSession.Data::read),
|
||||
@ -26,10 +26,10 @@ index e4f0949b6538734ff25daf68a428262481feeb81..754a2a5e958a04b3f8bf216b6022f547
|
||||
UPDATE_GAME_MODE((serialized, buf) -> serialized.gameMode = GameType.byId(buf.readVarInt()), (buf, entry) -> buf.writeVarInt(entry.gameMode().getId())),
|
||||
UPDATE_LISTED((serialized, buf) -> serialized.listed = buf.readBoolean(), (buf, entry) -> buf.writeBoolean(entry.listed())),
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index f2b6c74317dbedaa983bb5d821255dc40e1c81e4..1de8ee39347a6f4c56c2d3aa0e32887b57b80524 100644
|
||||
index e351ed77fbe1ea9de2dd5600d61524eb39c17899..1a0245c798107d2d4239e07262f5cc89490a3b08 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -286,6 +286,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -296,6 +296,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
private int knownMovePacketCount;
|
||||
@Nullable
|
||||
private RemoteChatSession chatSession;
|
||||
@ -37,7 +37,7 @@ index f2b6c74317dbedaa983bb5d821255dc40e1c81e4..1de8ee39347a6f4c56c2d3aa0e32887b
|
||||
private SignedMessageChain.Decoder signedMessageDecoder;
|
||||
private final LastSeenMessagesValidator lastSeenMessages = new LastSeenMessagesValidator(20);
|
||||
private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault();
|
||||
@@ -394,6 +395,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -408,6 +409,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
|
||||
}
|
||||
|
||||
@ -50,8 +50,8 @@ index f2b6c74317dbedaa983bb5d821255dc40e1c81e4..1de8ee39347a6f4c56c2d3aa0e32887b
|
||||
+
|
||||
}
|
||||
|
||||
public void resetPosition() {
|
||||
@@ -3337,6 +3345,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
private int getMaximumFlyingTicks(Entity vehicle) {
|
||||
@@ -3427,6 +3435,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
private void resetPlayerChatState(RemoteChatSession session) {
|
||||
this.chatSession = session;
|
@ -5,13 +5,13 @@ Subject: [PATCH] Prevent GameEvents being fired from unloaded chunks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 5f1a4a35d2179b7ff5a95390f82d65cacf4fd457..a6af6585aca50033f45138a4408218b056b8b785 100644
|
||||
index 2eda55a09632a6c5668600251a8c491c501fbe2b..80c927c906d1b6119c1b32b8982d879fbbd4d257 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1368,6 +1368,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1374,6 +1374,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
@Override
|
||||
public void gameEvent(GameEvent event, Vec3 emitterPos, GameEvent.Context emitter) {
|
||||
public void gameEvent(Holder<GameEvent> event, Vec3 emitterPos, GameEvent.Context emitter) {
|
||||
+ // Paper start - Prevent GameEvents being fired from unloaded chunks
|
||||
+ if (this.getChunkIfLoadedImmediately((Mth.floor(emitterPos.x) >> 4), (Mth.floor(emitterPos.z) >> 4)) == null) {
|
||||
+ return;
|
@ -5,18 +5,18 @@ Subject: [PATCH] Use array for gamerule storage
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
|
||||
index ac7a5410b01a6741e3b548d153f37ea1d8c1a4cb..4a340bd1f1859e43bb58e68aee4018fdb4ca7a5a 100644
|
||||
index 51e560d7856f230c5aa2dc32706c3a4996720aa5..89e327bc3a45879fe68887c7aadb077f31a770eb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/GameRules.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
|
||||
@@ -115,6 +115,7 @@ public class GameRules {
|
||||
public static final GameRules.Key<GameRules.BooleanValue> RULE_DO_VINES_SPREAD = GameRules.register("doVinesSpread", GameRules.Category.UPDATES, GameRules.BooleanValue.create(true));
|
||||
public static final GameRules.Key<GameRules.BooleanValue> RULE_ENDER_PEARLS_VANISH_ON_DEATH = GameRules.register("enderPearlsVanishOnDeath", GameRules.Category.PLAYER, GameRules.BooleanValue.create(true));
|
||||
@@ -122,6 +122,7 @@ public class GameRules {
|
||||
worldserver.setDefaultSpawnPos(worldserver.getSharedSpawnPos(), worldserver.getSharedSpawnAngle());
|
||||
}));
|
||||
private final Map<GameRules.Key<?>, GameRules.Value<?>> rules;
|
||||
+ private final GameRules.Value<?>[] gameruleArray; // Paper - Perf: Use array for gamerule storage
|
||||
|
||||
private static <T extends GameRules.Value<T>> GameRules.Key<T> register(String name, GameRules.Category category, GameRules.Type<T> type) {
|
||||
GameRules.Key<T> gamerules_gamerulekey = new GameRules.Key<>(name, category);
|
||||
@@ -133,17 +134,30 @@ public class GameRules {
|
||||
@@ -140,17 +141,30 @@ public class GameRules {
|
||||
}
|
||||
|
||||
public GameRules() {
|
||||
@ -50,7 +50,7 @@ index ac7a5410b01a6741e3b548d153f37ea1d8c1a4cb..4a340bd1f1859e43bb58e68aee4018fd
|
||||
}
|
||||
|
||||
public CompoundTag createTag() {
|
||||
@@ -202,6 +216,10 @@ public class GameRules {
|
||||
@@ -209,6 +223,10 @@ public class GameRules {
|
||||
}
|
||||
|
||||
public static final class Key<T extends GameRules.Value<T>> {
|
@ -10,10 +10,10 @@ but then replaced it with a bed, you could respawn
|
||||
at the bed in that world.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
index c14cddd42c61512c312231b1e93ccc6efbde620c..38fcde81d797dc46409f5a9ed426fe296d79bdfa 100644
|
||||
index 872bec4c366c86177334452315cc4a8097dae3c0..e9f8949267208b93f0c56c36ada38274ed4280f5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
@@ -109,6 +109,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
@@ -108,6 +108,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) {
|
||||
@ -21,7 +21,7 @@ index c14cddd42c61512c312231b1e93ccc6efbde620c..38fcde81d797dc46409f5a9ed426fe29
|
||||
if (!this.kickVillagerOutOfBed(world, pos)) {
|
||||
player.displayClientMessage(Component.translatable("block.minecraft.bed.occupied"), true);
|
||||
}
|
||||
@@ -166,8 +167,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
@@ -165,8 +166,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
// CraftBukkit end
|
||||
|
||||
public static boolean canSetSpawn(Level world) {
|
@ -6,17 +6,17 @@ Subject: [PATCH] Fix demo flag not enabling demo mode
|
||||
https://github.com/PaperMC/Paper/issues/9046
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 953e228afc6f706b819bb26655b91761436cc68d..2906cb10461b5334a7555046384c28848eec149f 100644
|
||||
index 13e1a914d4523f1c192db2a9a1ee6522e0ee27da..c33f85b570f159ab465b5a10a8044a81f2797f43 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -321,7 +321,9 @@ public class Main {
|
||||
@@ -325,7 +325,9 @@ public class Main {
|
||||
|
||||
/*
|
||||
dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec10));
|
||||
dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec11));
|
||||
- dedicatedserver1.setDemo(optionset.has(optionspec2));
|
||||
+ */
|
||||
+ dedicatedserver1.setDemo(optionset.has("demo")); // Paper - Restore setting the demo mode
|
||||
+ dedicatedserver1.setDemo(optionset.has("demo")); // Paper
|
||||
+ /*
|
||||
dedicatedserver1.setId((String) optionset.valueOf(optionspec11));
|
||||
dedicatedserver1.setId((String) optionset.valueOf(optionspec12));
|
||||
*/
|
||||
boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui");
|
||||
boolean flag2 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui");
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Mob Experience reward API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
index ad293ad9d5dcd7836a4fa29b4b687346e3ae516c..31f62fbb54ec7b270fbd8afba7bd7c4bfafa09e3 100644
|
||||
index 921594a78ea511337434b29b5bc1a037eb30992c..e155501fb3a88edf3ddac3aa0aae1b6a5a84962e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
@@ -170,4 +170,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||
@@ -167,4 +167,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||
this.getHandle().setAggressive(aggressive);
|
||||
}
|
||||
// Paper end
|
@ -7,7 +7,7 @@ This logic hooks into the neighbour update which should be invoked
|
||||
as a result of redstone powering the trap door.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java
|
||||
index 98566a0d8776bd460abc28d56c5df7d6b7ff0506..1027e5e8da4323714a3e7fed8d39264b8b9e50e7 100644
|
||||
index 26096c28f654118b0d541f33c659fbc43b34509b..2b5fdcb12dcd8730df24113b9a6d295f000dd9f6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java
|
||||
@@ -153,7 +153,26 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
|
@ -7,7 +7,7 @@ This patch is meant to get rid of any instances of lazy initialization that Mine
|
||||
This has the possibility to create race condition issues, and generally don't make sense to be lazily done anyways.
|
||||
|
||||
diff --git a/src/main/java/com/mojang/math/OctahedralGroup.java b/src/main/java/com/mojang/math/OctahedralGroup.java
|
||||
index 05d28a08c1fdf75221f5d774fe49d905840ae472..207f424b2bf5e0c48f33e4553c7c6019ef2dd009 100644
|
||||
index 0a3b6b8e250bd35530c05a1cdaf2eb8a9af4c72b..9aa82fc757c67a9456b2bdec744c0cb474d64df6 100644
|
||||
--- a/src/main/java/com/mojang/math/OctahedralGroup.java
|
||||
+++ b/src/main/java/com/mojang/math/OctahedralGroup.java
|
||||
@@ -110,6 +110,7 @@ public enum OctahedralGroup implements StringRepresentable {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expand PlayerItemMendEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||
index a9c30fb4cfe4ff7bb27d498218373c572031fab8..36422fb394a158f36c84ba0ee03cc704956c91b2 100644
|
||||
index adc3e6298a1946fdea029c82a9954fb5b6e24497..a207a31d80a302dbdfe80f8727222542d3a78da2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||
@@ -338,7 +338,7 @@ public class ExperienceOrb extends Entity {
|
||||
@@ -344,7 +344,7 @@ public class ExperienceOrb extends Entity {
|
||||
ItemStack itemstack = (ItemStack) entry.getValue();
|
||||
int j = Math.min(this.xpToDurability(amount), itemstack.getDamageValue());
|
||||
// CraftBukkit start
|
||||
@ -17,7 +17,7 @@ index a9c30fb4cfe4ff7bb27d498218373c572031fab8..36422fb394a158f36c84ba0ee03cc704
|
||||
j = event.getRepairAmount();
|
||||
if (event.isCancelled()) {
|
||||
return amount;
|
||||
@@ -346,8 +346,13 @@ public class ExperienceOrb extends Entity {
|
||||
@@ -352,8 +352,13 @@ public class ExperienceOrb extends Entity {
|
||||
// CraftBukkit end
|
||||
|
||||
itemstack.setDamageValue(itemstack.getDamageValue() - j);
|
||||
@ -33,10 +33,10 @@ index a9c30fb4cfe4ff7bb27d498218373c572031fab8..36422fb394a158f36c84ba0ee03cc704
|
||||
return k > 0 ? this.repairPlayerItems(player, k) : 0;
|
||||
} else {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index c52399e0c19fd919d59c007786de7c8036c9a424..af4cf6ff7123b67807b147b80d143405ec6998a4 100644
|
||||
index 1519220d02dfeb14fded5687b77a85306faf6dcd..722c69e0149a9bf35159a7ffbb338fbc42600f0e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1759,11 +1759,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1835,11 +1835,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ());
|
||||
|
||||
int i = Math.min(orb.xpToDurability(amount), itemstack.getDamageValue());
|
||||
@ -51,10 +51,10 @@ index c52399e0c19fd919d59c007786de7c8036c9a424..af4cf6ff7123b67807b147b80d143405
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 3291d8e14b53185a774b0219251d8a080192992b..e457cd3b6a5a627f18fa8ce7fca90e75e0adb8ea 100644
|
||||
index e9a70547324dabd97dc90820515a11d2b630a704..c1b5d9713cb301dc06b74d97dca4fd5562c539e2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1272,10 +1272,10 @@ public class CraftEventFactory {
|
||||
@@ -1267,10 +1267,10 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
|
@ -14,10 +14,10 @@ clearing the owner.
|
||||
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 9eecdc0a6fb111fb36e4e8e8666d056563e48cda..ee9ab1abbed298138e48c659481e03c01ac5940a 100644
|
||||
index 09defe4a20c7b0794cba358c177e787f1c0273c1..b2e2bd4d7e3b373a92d3a4a13446f27fbf652c0a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -384,6 +384,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -386,6 +386,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public boolean inWorld = false;
|
||||
public boolean generation;
|
||||
public int maxAirTicks = this.getDefaultMaxAirSupply(); // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
||||
@ -26,10 +26,10 @@ index 9eecdc0a6fb111fb36e4e8e8666d056563e48cda..ee9ab1abbed298138e48c659481e03c0
|
||||
public boolean lastDamageCancelled; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled
|
||||
public boolean persistentInvisibility = false;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 0a207f3f2e4c0790e784fb4b0c3c2dfa49c39724..156809090f1f83ad68e7e2477a3cfddac5757a8e 100644
|
||||
index 734e00caf72a694654319f69f793dcbf616f1784..64f7ae4d9e37daf2d48231f44f686008953ad39b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -50,14 +50,31 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -51,14 +51,31 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
this.ownerUUID = entity.getUUID();
|
||||
this.cachedOwner = entity;
|
||||
}
|
||||
@ -63,7 +63,7 @@ index 0a207f3f2e4c0790e784fb4b0c3c2dfa49c39724..156809090f1f83ad68e7e2477a3cfdda
|
||||
return this.cachedOwner;
|
||||
} else {
|
||||
if (this.ownerUUID != null) {
|
||||
@@ -67,6 +84,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -68,6 +85,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
ServerLevel worldserver = (ServerLevel) world;
|
||||
|
||||
this.cachedOwner = worldserver.getEntity(this.ownerUUID);
|
@ -21,7 +21,7 @@ index 12135ffeacd648f6bc4d7d327059ea1a7e8c79c4..52439f4b959c74027eb191a3af960c70
|
||||
public void removeModifier(AttributeModifier modifier) {
|
||||
throw new UnsupportedOperationException("Cannot modify default attributes");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java
|
||||
index a88acd3ebc0f11f9b5caca3fbf2401ca5eb3f553..e0faf9bf55f95ab21bd3452cee73196ae7ba8122 100644
|
||||
index 8afbb8e0cb368e95f23bb78c1261f9aa9b8abd86..c0fb6da6bc3c5b4f37601d898fa421d430417d97 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java
|
||||
@@ -50,6 +50,14 @@ public class CraftAttributeInstance implements AttributeInstance {
|
@ -9,23 +9,23 @@ Fix several issues when a player interact with a block:
|
||||
* poi can desync when the BlockPhysicsEvent is cancelled
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index 1ac739c92031e80c35e1af4417e6358346079580..8c54b92b65b3d379e14a11370b09d45351ab22e1 100644
|
||||
index 7d76cdc59984b156628273c8357485eb10046007..7180996027f70aef7afe32fb2adfce6431429401 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -130,7 +130,7 @@ public class BlockItem extends Item {
|
||||
@@ -128,7 +128,7 @@ public class BlockItem extends Item {
|
||||
|
||||
SoundType soundeffecttype = iblockdata1.getSoundType();
|
||||
|
||||
- // world.playSound(entityhuman, blockposition, this.getPlaceSound(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
|
||||
+ if (entityhuman == null) world.playSound(entityhuman, blockposition, this.getPlaceSound(iblockdata1), net.minecraft.sounds.SoundSource.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F); // Paper - Fix block place logic; reintroduce this for the dispenser (i.e the shulker)
|
||||
world.gameEvent(GameEvent.BLOCK_PLACE, blockposition, GameEvent.Context.of(entityhuman, iblockdata1));
|
||||
if ((entityhuman == null || !entityhuman.getAbilities().instabuild) && itemstack != ItemStack.EMPTY) { // CraftBukkit
|
||||
itemstack.shrink(1);
|
||||
world.gameEvent((Holder) GameEvent.BLOCK_PLACE, blockposition, GameEvent.Context.of(entityhuman, iblockdata1));
|
||||
itemstack.consume(1, entityhuman);
|
||||
return InteractionResult.sidedSuccess(world.isClientSide);
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 59c4550b4cb8b0317f5256efc9376265f4583b60..964d6af9eb9752b9e08f712c80b67bd9410d1554 100644
|
||||
index a80d225a7a4206acc4b93e328c96adf4411dad1d..1e104a724a327b98963ef2f23c10c426de6113a5 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -494,13 +494,7 @@ public final class ItemStack {
|
||||
@@ -507,13 +507,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
if (tileentity instanceof JukeboxBlockEntity) {
|
||||
JukeboxBlockEntity tileentityjukebox = (JukeboxBlockEntity) tileentity;
|
||||
|
||||
@ -41,10 +41,10 @@ index 59c4550b4cb8b0317f5256efc9376265f4583b60..964d6af9eb9752b9e08f712c80b67bd9
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 59dba562e17e9463c1e00dee4979b61a0f68643e..336ae7f1fc4bd045183c967f8e3bfb5a967a40a1 100644
|
||||
index 37c81d6c95efaab12a05075e6397ab2548c76722..19a177041e6e9621b0e35ca4f4ceb79b72448680 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -560,17 +560,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -554,17 +554,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// CraftBukkit start
|
||||
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
|
||||
CraftWorld world = ((ServerLevel) this).getWorld();
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix spigot sound playing for BlockItem ItemStacks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 964d6af9eb9752b9e08f712c80b67bd9410d1554..30cf71507c45432b2b5ac636aff852acf662ce60 100644
|
||||
index 1e104a724a327b98963ef2f23c10c426de6113a5..735a56648a783a618891b391418a8fd0d2968f4f 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -545,7 +545,11 @@ public final class ItemStack {
|
||||
@@ -558,7 +558,11 @@ public final class ItemStack implements DataComponentHolder {
|
||||
|
||||
// SPIGOT-1288 - play sound stripped from ItemBlock
|
||||
if (this.item instanceof BlockItem) {
|
@ -19,7 +19,7 @@ index d06e3892cf42723f8e3f621b5497c5348fa1a715..5f1ec3f69295760b7b8097916c82cbf9
|
||||
world.setBlock(pos.above(), blockState.setValue(HALF, DoubleBlockHalf.UPPER), 3);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
|
||||
index 9766a919f85abfd52497ecd6d2e2002d3de8051d..4f1ff12df44756b63e3c3f9fc43e7ea485df6f57 100644
|
||||
index f53808e200bd83ab80954ec5c1e9c14250302be8..b943384eb6a4612993556036f0d3beec6939a559 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
|
||||
@@ -71,8 +71,13 @@ public class SnifferEggBlock extends Block {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 10450a2bb6973a647fb6969d3c142e7a6a1011a4..56a6b3921c74bdeb27f8736302503bee1f731065 100644
|
||||
index d5575fcc1458fe3083821792f09f9ed53c12e825..29a11dc69b64ddc6022812757b2839931e271ac2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -354,7 +354,11 @@ public final class CraftServer implements Server {
|
@ -5,12 +5,12 @@ Subject: [PATCH] fix MapLike spam for missing key 'selector'
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java
|
||||
index e7bd45e9834ffc6b94dd07cf69a685de66c9c37a..af5019716f487d9e4259b259712cf022f987603b 100644
|
||||
index 8c8c16ce53f5bdf88274cb80767decf0a2612637..d4288ae84c08ff6cb2f6763eeb9c358d5bf38f55 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java
|
||||
@@ -347,7 +347,7 @@ public interface VibrationSystem {
|
||||
@@ -353,7 +353,7 @@ public interface VibrationSystem {
|
||||
public static Codec<VibrationSystem.Data> CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
return instance.group(VibrationInfo.CODEC.optionalFieldOf("event").forGetter((vibrationsystem_a) -> {
|
||||
return instance.group(VibrationInfo.CODEC.lenientOptionalFieldOf("event").forGetter((vibrationsystem_a) -> {
|
||||
return Optional.ofNullable(vibrationsystem_a.currentVibration);
|
||||
- }), VibrationSelector.CODEC.fieldOf("selector").forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> {
|
||||
+ }), Codec.optionalField("selector", VibrationSelector.CODEC).xmap(o -> o.orElseGet(VibrationSelector::new), Optional::of).forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { // Paper - fix MapLike spam for missing "selector" in 1.19.2
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add method to remove all active potion effects
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index ab1e1a56f3811d4446a6b0a7461c0bddd8015228..c4a166a0c226c6083c25c58145d9631d4296e615 100644
|
||||
index 4f31bf6f51a72b010b850e1e62a06b455eac906c..eca55d45e1529fffbfcf5d6b8fd23935385e8bcd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -556,6 +556,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -555,6 +555,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return effects;
|
||||
}
|
||||
|
@ -6,13 +6,13 @@ Subject: [PATCH] Fix incorrect crafting result amount for fireworks
|
||||
Although vanilla does not specifically call this method anywhere, this fixes a bug where the result using the Bukkit API returns the wrong amount.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java b/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java
|
||||
index 54da7997123b4159a29baedf402608b7db7cb745..a86507569b759f8ef85f3fc32324677c37f65d28 100644
|
||||
index da924bb34354b1a8b3db3ad63b5705253d942514..56c8900c8771919d5e0e62b4d165ae6f00042872 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/FireworkRocketRecipe.java
|
||||
@@ -80,7 +80,7 @@ public class FireworkRocketRecipe extends CustomRecipe {
|
||||
@@ -78,7 +78,7 @@ public class FireworkRocketRecipe extends CustomRecipe {
|
||||
|
||||
@Override
|
||||
public ItemStack getResultItem(RegistryAccess registryManager) {
|
||||
public ItemStack getResultItem(HolderLookup.Provider registriesLookup) {
|
||||
- return new ItemStack(Items.FIREWORK_ROCKET);
|
||||
+ return new ItemStack(Items.FIREWORK_ROCKET, 3); // Paper - Fix incorrect crafting result amount
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add event for player editing sign
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 30cf71507c45432b2b5ac636aff852acf662ce60..5a86b2c205250ddcd833a15accb27ca4a580eadd 100644
|
||||
index 735a56648a783a618891b391418a8fd0d2968f4f..31f67c83416031079569375e5f69738dd639b93f 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -524,7 +524,7 @@ public final class ItemStack {
|
||||
@@ -537,7 +537,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
try {
|
||||
if (world.getBlockEntity(SignItem.openSign) instanceof SignBlockEntity tileentitysign) {
|
||||
if (world.getBlockState(SignItem.openSign).getBlock() instanceof SignBlock blocksign) {
|
||||
@ -18,19 +18,19 @@ index 30cf71507c45432b2b5ac636aff852acf662ce60..5a86b2c205250ddcd833a15accb27ca4
|
||||
}
|
||||
} finally {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SignBlock.java b/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
index 57b79e7fa34755e68b06f5b3010e68745cabbb7e..27a1e8ffc43efe4e086e7fd88ee4d80c23f98674 100644
|
||||
index e602c58bc14036d78a00ad548a821650b92e29df..f7bae8060d993176799ff3ff4653d760a137faba 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
@@ -118,7 +118,7 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
} else if (flag2) {
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if (!this.otherPlayerIsEditingSign(player, tileentitysign) && player.mayBuild() && this.hasEditableText(player, tileentitysign, flag1)) {
|
||||
- this.openTextEdit(player, tileentitysign, flag1, org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT); // CraftBukkit
|
||||
+ this.openTextEdit(player, tileentitysign, flag1, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.INTERACT); // Paper - Add PlayerOpenSignEvent
|
||||
return this.getInteractionResult(flag);
|
||||
} else {
|
||||
return InteractionResult.PASS;
|
||||
@@ -170,16 +170,33 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
@@ -142,7 +142,7 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
} else if (flag1) {
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if (!this.otherPlayerIsEditingSign(player, tileentitysign) && player.mayBuild() && this.hasEditableText(player, tileentitysign, flag)) {
|
||||
- this.openTextEdit(player, tileentitysign, flag, org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT); // CraftBukkit
|
||||
+ this.openTextEdit(player, tileentitysign, flag, io.papermc.paper.event.player.PlayerOpenSignEvent.Cause.INTERACT); // Paper - Add PlayerOpenSignEvent
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
return InteractionResult.PASS;
|
||||
@@ -187,16 +187,33 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
return blockpropertywood;
|
||||
}
|
||||
|
||||
@ -72,10 +72,10 @@ index 57b79e7fa34755e68b06f5b3010e68745cabbb7e..27a1e8ffc43efe4e086e7fd88ee4d80c
|
||||
entityhuman.openTextEdit(tileentitysign, flag);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
index d1b335d7342aa85478daeb7801a999ccd4be7136..1d0ef05cc694c5519dc233d24fd002c0699cd2ab 100644
|
||||
index a12702cdf36c75572e661b5b5758270f5058c181..8303343ecca91076839f4436d6b3a3bf4739c2fd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
@@ -162,9 +162,15 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
|
||||
@@ -168,9 +168,15 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
|
||||
Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed");
|
||||
Preconditions.checkArgument(sign.getWorld() == player.getWorld(), "Sign must be in same world as Player");
|
||||
|
@ -6,15 +6,15 @@ Subject: [PATCH] Only tick item frames if players can see it
|
||||
In the event that an item frame cannot be seen by any players, ticking the item frame every tick is unnecessary. This can be a very hot section of the entity tracker when lots of item frames are present on a server, so this reduces the logic which speeds it up.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 40949825392281c2f7c756007781c672ec24665d..888cbfaf49aa6d1d1b8cc87cf411a1dd53fbe89d 100644
|
||||
index f355dd986bf861da3edb90d7e05f901e19686fef..b195de05371e9762654b69365f0e722443425d33 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -111,7 +111,7 @@ public class ServerEntity {
|
||||
@@ -113,7 +113,7 @@ public class ServerEntity {
|
||||
|
||||
Entity entity = this.entity;
|
||||
|
||||
- if (entity instanceof ItemFrame) {
|
||||
- if (entity instanceof ItemFrame entityitemframe) {
|
||||
+ if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame) { // Paper - Perf: Only tick item frames if players can see it
|
||||
ItemFrame entityitemframe = (ItemFrame) entity;
|
||||
|
||||
if (true || this.tickCount % 10 == 0) { // CraftBukkit - Moved below, should always enter this block
|
||||
ItemStack itemstack = entityitemframe.getItem();
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix cmd permission levels for command blocks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
index 907bc9d84dbc98427384cf529bfde4b09d8ce8ca..faa375f2722793a86265248a4be4fa14736d9818 100644
|
||||
index f3c83bb20a73b489f1fb6bacb69388902b1b6fe7..3c0d2332207ba638faaaa4280bce18c334a01271 100644
|
||||
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -204,10 +204,29 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||
@ -41,10 +41,10 @@ index 907bc9d84dbc98427384cf529bfde4b09d8ce8ca..faa375f2722793a86265248a4be4fa14
|
||||
// CraftBukkit end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index dd7c1ac97505ce7a846aa8ee91bb654d060acc1a..df06c28c778255cb2d8d5e14960bd38a2af9ad22 100644
|
||||
index 4114e2b148baf9ddc489eed11fed4aacd0eab401..60406cb01c5a409ba6fe98677a5cc332effaebea 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -296,16 +296,7 @@ public class Commands {
|
||||
@@ -299,16 +299,7 @@ public class Commands {
|
||||
String[] args = command.split(" ");
|
||||
if (args.length == 0) return; // Paper - empty commands shall not be dispatched
|
||||
|
||||
@ -63,7 +63,7 @@ index dd7c1ac97505ce7a846aa8ee91bb654d060acc1a..df06c28c778255cb2d8d5e14960bd38a
|
||||
// Handle vanilla commands;
|
||||
if (sender.getLevel().getCraftServer().getCommandBlockOverride(args[0])) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java
|
||||
index 48b4fe75a7f881e7713885d79d4ef5ec7b574a2d..88b00556322f078b8a9d28fb7c759bb8c84bfcf0 100644
|
||||
index c671b26d7dc70bac1f4bf9a68a264b25865cf7da..83ef2c3e7b06152b9e68f90002c35e77f148347d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java
|
||||
@@ -136,7 +136,7 @@ public class MinecartCommandBlock extends AbstractMinecart {
|
||||
@ -76,10 +76,10 @@ index 48b4fe75a7f881e7713885d79d4ef5ec7b574a2d..88b00556322f078b8a9d28fb7c759bb8
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/CommandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CommandBlockEntity.java
|
||||
index 167f334eec90417eba05fcecec21435415771df7..f08c77e20462bada221b5ed395ceb2f7d39ee7c0 100644
|
||||
index 4c7d142dc653f3aca82e0563b6ba2e020721eb9b..6c484f3f8f37a19992ebbfe30aba399cac21acfe 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/CommandBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/CommandBlockEntity.java
|
||||
@@ -54,7 +54,7 @@ public class CommandBlockEntity extends BlockEntity {
|
||||
@@ -58,7 +58,7 @@ public class CommandBlockEntity extends BlockEntity {
|
||||
public CommandSourceStack createCommandSourceStack() {
|
||||
Direction enumdirection = (Direction) CommandBlockEntity.this.getBlockState().getValue(CommandBlock.FACING);
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add option to disable block updates
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java b/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java
|
||||
index ad801476cc25d51e4145a41b9c8100382f1f49bb..1ba7a6a14f7fbfdd279cb8c2bebf5ea6c98dbf1f 100644
|
||||
index 06f0e5afdab6274154213d82ab3278e08c4ba1b7..8569ad43985fa60d5196ae4bc21646406d8b2adc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java
|
||||
@@ -38,6 +38,7 @@ public class ChorusPlantBlock extends PipeBlock {
|
||||
@ -19,7 +19,7 @@ index ad801476cc25d51e4145a41b9c8100382f1f49bb..1ba7a6a14f7fbfdd279cb8c2bebf5ea6
|
||||
@@ -59,6 +60,7 @@ public class ChorusPlantBlock extends PipeBlock {
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableChorusPlantUpdates) return state; // Paper - add option to disable block updates
|
||||
if (!state.canSurvive(world, pos)) {
|
||||
world.scheduleTick(pos, this, 1);
|
||||
@ -27,7 +27,7 @@ index ad801476cc25d51e4145a41b9c8100382f1f49bb..1ba7a6a14f7fbfdd279cb8c2bebf5ea6
|
||||
@@ -70,6 +72,7 @@ public class ChorusPlantBlock extends PipeBlock {
|
||||
|
||||
@Override
|
||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableChorusPlantUpdates) return; // Paper - add option to disable block updates
|
||||
if (!state.canSurvive(world, pos)) {
|
||||
world.destroyBlock(pos, true);
|
||||
@ -35,13 +35,13 @@ index ad801476cc25d51e4145a41b9c8100382f1f49bb..1ba7a6a14f7fbfdd279cb8c2bebf5ea6
|
||||
@@ -77,6 +80,7 @@ public class ChorusPlantBlock extends PipeBlock {
|
||||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
protected boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableChorusPlantUpdates) return true; // Paper - add option to disable block updates
|
||||
BlockState blockState = world.getBlockState(pos.below());
|
||||
boolean bl = !world.getBlockState(pos.above()).isAir() && !blockState.isAir();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java b/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java
|
||||
index 322cd656b82611ca8048c3e35cb66551bdea87d6..f70898bddec0b53f92ab88b862e2d865d82d558d 100644
|
||||
index 3f45058eee0c78f50c119da5da4c7d2af0251a27..d16aad72c90bbde158b845759eef227546d12e24 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java
|
||||
@@ -43,6 +43,7 @@ public class HugeMushroomBlock extends Block {
|
||||
@ -55,7 +55,7 @@ index 322cd656b82611ca8048c3e35cb66551bdea87d6..f70898bddec0b53f92ab88b862e2d865
|
||||
@@ -56,6 +57,7 @@ public class HugeMushroomBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableMushroomBlockUpdates) return state; // Paper - add option to disable block updates
|
||||
return neighborState.is(this)
|
||||
? state.setValue(PROPERTY_BY_DIRECTION.get(direction), Boolean.valueOf(false))
|
||||
@ -63,7 +63,7 @@ index 322cd656b82611ca8048c3e35cb66551bdea87d6..f70898bddec0b53f92ab88b862e2d865
|
||||
@@ -63,6 +65,7 @@ public class HugeMushroomBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState rotate(BlockState state, Rotation rotation) {
|
||||
protected BlockState rotate(BlockState state, Rotation rotation) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableMushroomBlockUpdates) return state; // Paper - add option to disable block updates
|
||||
return state.setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.NORTH)), state.getValue(NORTH))
|
||||
.setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.SOUTH)), state.getValue(SOUTH))
|
||||
@ -71,16 +71,16 @@ index 322cd656b82611ca8048c3e35cb66551bdea87d6..f70898bddec0b53f92ab88b862e2d865
|
||||
@@ -73,6 +76,7 @@ public class HugeMushroomBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState mirror(BlockState state, Mirror mirror) {
|
||||
protected BlockState mirror(BlockState state, Mirror mirror) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableMushroomBlockUpdates) return state; // Paper - add option to disable block updates
|
||||
return state.setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.NORTH)), state.getValue(NORTH))
|
||||
.setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.SOUTH)), state.getValue(SOUTH))
|
||||
.setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.EAST)), state.getValue(EAST))
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
index 92a24cf02f15f3ab893eb9a793770d9819e4f600..a541dc3a6e373b30fff0abf5305e77854c190f10 100644
|
||||
index f77d51d10e01fc4eaf5516c05c8be0ef7a425893..1d82cfe7af0dc42f88901fb0c44896771fdf8a93 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
@@ -65,11 +65,13 @@ public class NoteBlock extends Block {
|
||||
@@ -66,11 +66,13 @@ public class NoteBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
@ -89,21 +89,21 @@ index 92a24cf02f15f3ab893eb9a793770d9819e4f600..a541dc3a6e373b30fff0abf5305e7785
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return state; // Paper - prevent noteblock instrument from updating
|
||||
boolean flag = direction.getAxis() == Direction.Axis.Y;
|
||||
|
||||
return flag ? this.setInstrument(world, pos, state) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
@@ -77,6 +79,7 @@ public class NoteBlock extends Block {
|
||||
@@ -78,6 +80,7 @@ public class NoteBlock extends Block {
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
|
||||
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return; // Paper - prevent noteblock powered-state from updating
|
||||
boolean flag1 = world.hasNeighborSignal(pos);
|
||||
|
||||
if (flag1 != (Boolean) state.getValue(NoteBlock.POWERED)) {
|
||||
@@ -114,7 +117,7 @@ public class NoteBlock extends Block {
|
||||
} else if (world.isClientSide) {
|
||||
@@ -116,7 +119,7 @@ public class NoteBlock extends Block {
|
||||
if (world.isClientSide) {
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
- state = (BlockState) state.cycle(NoteBlock.NOTE);
|
||||
@ -112,10 +112,10 @@ index 92a24cf02f15f3ab893eb9a793770d9819e4f600..a541dc3a6e373b30fff0abf5305e7785
|
||||
this.playNote(player, state, world, pos);
|
||||
player.awardStat(Stats.TUNE_NOTEBLOCK);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
index 003fd247b12323cca5fd82a6cdf31bd897afd682..bdb99b799d1a97f1340c3d388d2901f7cb1c3527 100644
|
||||
index e032d8907045c653c3dd449f65e93e40fd0bb6be..6fe5be785423a35b6ff4e6206ca281b66845b979 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
@@ -66,6 +66,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -67,6 +67,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
@ -123,37 +123,37 @@ index 003fd247b12323cca5fd82a6cdf31bd897afd682..bdb99b799d1a97f1340c3d388d2901f7
|
||||
Level world = ctx.getLevel();
|
||||
BlockPos blockposition = ctx.getClickedPos();
|
||||
|
||||
@@ -74,11 +75,13 @@ public class TripWireBlock extends Block {
|
||||
@@ -75,11 +76,13 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent tripwire from updating
|
||||
return direction.getAxis().isHorizontal() ? (BlockState) state.setValue((Property) TripWireBlock.PROPERTY_BY_DIRECTION.get(direction), this.shouldConnectTo(neighborState, direction)) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
||||
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||
if (!oldState.is(state.getBlock())) {
|
||||
this.updateSource(world, pos, state);
|
||||
}
|
||||
@@ -86,6 +89,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -87,6 +90,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
|
||||
protected void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||
if (!moved && !state.is(newState.getBlock())) {
|
||||
this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true));
|
||||
}
|
||||
@@ -93,6 +97,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -94,6 +98,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent disarming tripwires
|
||||
if (!world.isClientSide && !player.getMainHandItem().isEmpty() && player.getMainHandItem().is(Items.SHEARS)) {
|
||||
world.setBlock(pos, (BlockState) state.setValue(TripWireBlock.DISARMED, true), 4);
|
||||
world.gameEvent((Entity) player, GameEvent.SHEAR, pos);
|
||||
@@ -102,6 +107,7 @@ public class TripWireBlock extends Block {
|
||||
world.gameEvent((Entity) player, (Holder) GameEvent.SHEAR, pos);
|
||||
@@ -103,6 +108,7 @@ public class TripWireBlock extends Block {
|
||||
}
|
||||
|
||||
private void updateSource(Level world, BlockPos pos, BlockState state) {
|
||||
@ -161,18 +161,18 @@ index 003fd247b12323cca5fd82a6cdf31bd897afd682..bdb99b799d1a97f1340c3d388d2901f7
|
||||
Direction[] aenumdirection = new Direction[]{Direction.SOUTH, Direction.WEST};
|
||||
int i = aenumdirection.length;
|
||||
int j = 0;
|
||||
@@ -134,6 +140,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -135,6 +141,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent tripwires from detecting collision
|
||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
||||
if (!world.isClientSide) {
|
||||
if (!(Boolean) state.getValue(TripWireBlock.POWERED)) {
|
||||
@@ -144,6 +151,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -145,6 +152,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent tripwire pressed check
|
||||
if ((Boolean) world.getBlockState(pos).getValue(TripWireBlock.POWERED)) {
|
||||
this.checkPressed(world, pos);
|
@ -5,10 +5,10 @@ Subject: [PATCH] Call missing BlockDispenseEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
index b83af374a33a66a6ceeca119b961eea883bba41c..175b965c92b8b8be9c671e1ee478afa9a2f7bf82 100644
|
||||
index 9507dbbb4b490149b9248c384be5adaccae40c41..5bbadc890a72f1cb22c6881ebcc163b0c06a367a 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
@@ -1112,6 +1112,13 @@ public interface DispenseItemBehavior {
|
||||
@@ -898,6 +898,13 @@ public interface DispenseItemBehavior {
|
||||
this.setSuccess(true);
|
||||
if (iblockdata.is(Blocks.RESPAWN_ANCHOR)) {
|
||||
if ((Integer) iblockdata.getValue(RespawnAnchorBlock.CHARGE) != 4) {
|
||||
@ -22,7 +22,7 @@ index b83af374a33a66a6ceeca119b961eea883bba41c..175b965c92b8b8be9c671e1ee478afa9
|
||||
RespawnAnchorBlock.charge((Entity) null, worldserver, blockposition, iblockdata);
|
||||
stack.shrink(1);
|
||||
} else {
|
||||
@@ -1134,6 +1141,13 @@ public interface DispenseItemBehavior {
|
||||
@@ -977,6 +984,13 @@ public interface DispenseItemBehavior {
|
||||
Optional<BlockState> optional = HoneycombItem.getWaxed(iblockdata);
|
||||
|
||||
if (optional.isPresent()) {
|
||||
@ -36,7 +36,7 @@ index b83af374a33a66a6ceeca119b961eea883bba41c..175b965c92b8b8be9c671e1ee478afa9
|
||||
worldserver.setBlockAndUpdate(blockposition, (BlockState) optional.get());
|
||||
worldserver.levelEvent(3003, blockposition, 0);
|
||||
stack.shrink(1);
|
||||
@@ -1159,6 +1173,12 @@ public interface DispenseItemBehavior {
|
||||
@@ -1004,6 +1018,12 @@ public interface DispenseItemBehavior {
|
||||
if (!worldserver.getBlockState(blockposition1).is(BlockTags.CONVERTABLE_TO_MUD)) {
|
||||
return this.defaultDispenseItemBehavior.dispense(pointer, stack);
|
||||
} else {
|
||||
@ -50,10 +50,10 @@ index b83af374a33a66a6ceeca119b961eea883bba41c..175b965c92b8b8be9c671e1ee478afa9
|
||||
for (int k = 0; k < 5; ++k) {
|
||||
worldserver.sendParticles(ParticleTypes.SPLASH, (double) blockposition.getX() + worldserver.random.nextDouble(), (double) (blockposition.getY() + 1), (double) blockposition.getZ() + worldserver.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index e457cd3b6a5a627f18fa8ce7fca90e75e0adb8ea..600b340bd7fc6db3914ad67684a15428b619a9a3 100644
|
||||
index c1b5d9713cb301dc06b74d97dca4fd5562c539e2..27bafd5349805171399dbd141f5c568ec35286f4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2115,6 +2115,32 @@ public class CraftEventFactory {
|
||||
@@ -2110,6 +2110,32 @@ public class CraftEventFactory {
|
||||
}
|
||||
// Paper end
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't load chunks for supporting block checks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index ee9ab1abbed298138e48c659481e03c01ac5940a..fe768bd70c08719f11e28e793fe90a908f22c4ad 100644
|
||||
index b2e2bd4d7e3b373a92d3a4a13446f27fbf652c0a..16f36d1bfe6458f9aa935cdc63066c082bc83f8e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1200,7 +1200,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -1211,7 +1211,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
protected BlockPos getOnPos(float offset) {
|
@ -7,10 +7,10 @@ For larger ranges, it's better to iterate over the player list
|
||||
than the entity slices.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
index eff48e43a35a752bd33de2b55a0ad04332109ce0..4b81b0180dfc96fc6a88646838a886ca5b5d301b 100644
|
||||
index 2e3d89ca35b513340cd1ebefa875280b32e1756e..8a89ba2f50b0032b9db854d2c8cb6493f58dbe34 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
@@ -329,7 +329,22 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
@@ -333,7 +333,22 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
double d0 = blockEntity != null ? blockEntity.getEffectRange() : (i * 10 + 10); // Paper - Custom beacon ranges
|
||||
|
||||
AABB axisalignedbb = (new AABB(blockposition)).inflate(d0).expandTowards(0.0D, (double) world.getHeight(), 0.0D);
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Sign#getInteractableSideFor
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
index f3cea7a8de334419b4a2f6dc64ef0e20fd715e75..927c7ea03560be0c86884cec70ee8e408e66cb07 100644
|
||||
index a55a2db66d8c8482c5b4107b21bb82d7e8ff4288..749b24cdc0cc2f04fe7fa29da7ea2ffd4ee153e5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
@@ -66,13 +66,18 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||
@@ -68,12 +68,17 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||
}
|
||||
|
||||
public boolean isFacingFrontText(net.minecraft.world.entity.player.Player player) {
|
||||
@ -19,8 +19,7 @@ index f3cea7a8de334419b4a2f6dc64ef0e20fd715e75..927c7ea03560be0c86884cec70ee8e40
|
||||
+ // Paper end - Add Sign#getInteractableSideFor
|
||||
Block block = this.getBlockState().getBlock();
|
||||
|
||||
if (block instanceof SignBlock) {
|
||||
SignBlock blocksign = (SignBlock) block;
|
||||
if (block instanceof SignBlock blocksign) {
|
||||
Vec3 vec3d = blocksign.getSignHitboxCenterPosition(this.getBlockState());
|
||||
- double d0 = player.getX() - ((double) this.getBlockPos().getX() + vec3d.x);
|
||||
- double d1 = player.getZ() - ((double) this.getBlockPos().getZ() + vec3d.z);
|
||||
@ -30,10 +29,10 @@ index f3cea7a8de334419b4a2f6dc64ef0e20fd715e75..927c7ea03560be0c86884cec70ee8e40
|
||||
float f1 = (float) (Mth.atan2(d1, d0) * 57.2957763671875D) - 90.0F;
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
index 1d0ef05cc694c5519dc233d24fd002c0699cd2ab..ec96e8020c2042d939ab836464c547838447d708 100644
|
||||
index 8303343ecca91076839f4436d6b3a3bf4739c2fd..cefbb015a77b9e3cab56e5ed4fe35fba91641632 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
@@ -192,6 +192,14 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
|
||||
@@ -198,6 +198,14 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
|
||||
}
|
||||
// Paper end
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] fix item meta for tadpole buckets
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index c421649a0c88ee9c773bb6985f7114e58f08a7a1..71aac5d4cf29cea9daa378fc8ac584750de4d1ca 100644
|
||||
index 071f4fe53fbea333b5db52ac719c5e6b833ffe19..4cc5f39ee20948e2369b21041b663a7e50d15ac1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -357,6 +357,7 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -364,6 +364,7 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
case COD_BUCKET:
|
||||
case PUFFERFISH_BUCKET:
|
||||
case SALMON_BUCKET:
|
||||
@ -17,10 +17,10 @@ index c421649a0c88ee9c773bb6985f7114e58f08a7a1..71aac5d4cf29cea9daa378fc8ac58475
|
||||
case GLOW_ITEM_FRAME:
|
||||
case PAINTING:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index fb2e4881096459eff16a7c46faa9921166837ee9..f106db3aa5e5b3b0b8133eff77dbc65c8895ff2e 100644
|
||||
index be2b7c2b412a1d64466c25c1b19b10a869cd288d..d544a4e4d88b51cf6ca53e048c411aa23c64d78f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -601,6 +601,7 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -600,6 +600,7 @@ public final class CraftItemStack extends ItemStack {
|
||||
case COD_BUCKET:
|
||||
case PUFFERFISH_BUCKET:
|
||||
case SALMON_BUCKET:
|
||||
@ -29,10 +29,10 @@ index fb2e4881096459eff16a7c46faa9921166837ee9..f106db3aa5e5b3b0b8133eff77dbc65c
|
||||
case GLOW_ITEM_FRAME:
|
||||
case PAINTING:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java
|
||||
index 6aa64334943a22da8cfcac88d48ae8156ad7a9b4..630e16403cb1fc0f4ba798993bb0c3139196a97c 100644
|
||||
index 27af7ca9d62bdb4a24be5af139c181d7bc271ba5..3ff0340c40e9dc9a6e690de15ccade7a0c4e8f02 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java
|
||||
@@ -16,6 +16,7 @@ public class CraftMetaEntityTag extends CraftMetaItem {
|
||||
@@ -19,6 +19,7 @@ public class CraftMetaEntityTag extends CraftMetaItem {
|
||||
Material.COD_BUCKET,
|
||||
Material.PUFFERFISH_BUCKET,
|
||||
Material.SALMON_BUCKET,
|
||||
@ -41,10 +41,10 @@ index 6aa64334943a22da8cfcac88d48ae8156ad7a9b4..630e16403cb1fc0f4ba798993bb0c313
|
||||
Material.GLOW_ITEM_FRAME,
|
||||
Material.PAINTING
|
||||
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
index adb7c742e8fe3b8e0c2ecf63c627e7566285fd55..9f96ee1ac21f44ca7a41122353f72339b148f036 100644
|
||||
index 7237e24686885c754c87e7eec53c6400fd0b47bf..f071968be481a164192085a3e405bea2d26062b6 100644
|
||||
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
@@ -235,6 +235,27 @@ public class ItemMetaTest extends AbstractTestingBase {
|
||||
@@ -234,6 +234,27 @@ public class ItemMetaTest extends AbstractTestingBase {
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix BanList API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
index ef2dfa30686bba3eb510bf95172174cc9972422e..96408d505ce80799868ff84554a3b0b25adabb22 100644
|
||||
index 8caee0181f256e2ffd4e880274859eaf5f81ae96..4d654c4f0b6210a9841427789ba70ce5d1d308be 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
@@ -115,17 +115,17 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
||||
@ -208,10 +208,10 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57
|
||||
return null;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index af4cf6ff7123b67807b147b80d143405ec6998a4..d4875f4477d1d76857bc135f6f0849b889baca22 100644
|
||||
index 722c69e0149a9bf35159a7ffbb338fbc42600f0e..1c6fdad145d81a25ccd2b1193ebe4b5ad96bfb9c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1657,23 +1657,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1733,23 +1733,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -240,7 +240,7 @@ index af4cf6ff7123b67807b147b80d143405ec6998a4..d4875f4477d1d76857bc135f6f0849b8
|
||||
if (kickPlayer) {
|
||||
this.kickPlayer(reason);
|
||||
}
|
||||
@@ -1681,12 +1681,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1757,12 +1757,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
@Override
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix possible NPE on painting creation
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 08316493785e0cf1f93f07dda8016ca5956216f8..a97ceea235f756cbca3c82aa1965d90cf7767580 100644
|
||||
index 7ba6302ecb72fa6e523054e7e3223d79eedf6589..63f9852de5b557351793ba3aebdd7e752caf2417 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -318,8 +318,13 @@ public final class CraftEntityTypes {
|
||||
@@ -325,8 +325,13 @@ public final class CraftEntityTypes {
|
||||
// Hanging
|
||||
register(new EntityTypeData<>(EntityType.PAINTING, Painting.class, CraftPainting::new, createHanging(Painting.class, (spawnData, hangingData) -> {
|
||||
if (spawnData.normalWorld && hangingData.randomize()) {
|
||||
@ -24,7 +24,7 @@ index 08316493785e0cf1f93f07dda8016ca5956216f8..a97ceea235f756cbca3c82aa1965d90c
|
||||
net.minecraft.world.entity.decoration.Painting entity = new net.minecraft.world.entity.decoration.Painting(net.minecraft.world.entity.EntityType.PAINTING, spawnData.minecraftWorld());
|
||||
entity.absMoveTo(spawnData.x(), spawnData.y(), spawnData.z(), spawnData.yaw(), spawnData.pitch());
|
||||
entity.setDirection(hangingData.direction());
|
||||
@@ -457,6 +462,7 @@ public final class CraftEntityTypes {
|
||||
@@ -465,6 +470,7 @@ public final class CraftEntityTypes {
|
||||
AABB bb = (ItemFrame.class.isAssignableFrom(clazz))
|
||||
? net.minecraft.world.entity.decoration.ItemFrame.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height)
|
||||
: HangingEntity.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height);
|
@ -6,7 +6,7 @@ Subject: [PATCH] Only set despawnTimer for Wandering Traders spawned by
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||
index 9b0f54af3160c5756784e31cf1347eb97ca77e47..8d1cc1a644415be251f469ab1cb2ebc09fe5c3eb 100644
|
||||
index 63189d6325173a42b619907b44a426848fbc6988..0854e9b7ee2e6b23b6c1ee6a324a5a253c9d4679 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||
@@ -68,7 +68,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
||||
@ -19,7 +19,7 @@ index 9b0f54af3160c5756784e31cf1347eb97ca77e47..8d1cc1a644415be251f469ab1cb2ebc0
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
index a089f72695b5fb49c7918e89fd5015e8c3a3dd0e..d7bddedb19c10f62fd1f7d3128453ad706ed16be 100644
|
||||
index d5d27b0d352ca3fd57a26605cb35c499e88b57fc..f4cdb97ed6c0850da980760c0c2df69480485940 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
@@ -120,7 +120,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
@ -5,10 +5,10 @@ Subject: [PATCH] ExperienceOrb should call EntitySpawnEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 600b340bd7fc6db3914ad67684a15428b619a9a3..592670a6ebaed9b42d76afe66264265fc0664934 100644
|
||||
index 27bafd5349805171399dbd141f5c568ec35286f4..5af62603415865068ca4b79a7e68d8eb813596b1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -736,7 +736,8 @@ public class CraftEventFactory {
|
||||
@@ -735,7 +735,8 @@ public class CraftEventFactory {
|
||||
// Spigot start - SPIGOT-7523: Merge after spawn event and only merge if the event was not cancelled (gets checked above)
|
||||
if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) {
|
||||
double radius = world.spigotConfig.expMerge;
|
@ -5,7 +5,7 @@ Subject: [PATCH] Make Amethyst throw both Spread and Grow Events
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
||||
index 79f1fb45447350b5bedee8ce3efe6c150aa9772c..7f58c9f5935cd14ea1096de14633f653eb486d7e 100644
|
||||
index 6c402bfd9bed54cbb9b337d3528fdcffbd3d87c0..8920855b07a31715327b8102c7faafc9f916825d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java
|
||||
@@ -45,7 +45,13 @@ public class BuddingAmethystBlock extends AmethystBlock {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerFailMoveEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a51a2665ca 100644
|
||||
index 1a0245c798107d2d4239e07262f5cc89490a3b08..8085e59bf16d3a5c85bd9d328126f226c026f163 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1279,8 +1279,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1272,8 +1272,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
double d0 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX(this.player.getX())); final double toX = d0; // Paper - OBFHELPER
|
||||
double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); final double toY = d1; // Paper - OBFHELPER
|
||||
double d2 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ(this.player.getZ())); final double toZ = d2; // Paper - OBFHELPER
|
||||
@ -19,7 +19,7 @@ index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a5
|
||||
|
||||
if (this.player.isPassenger()) {
|
||||
this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1);
|
||||
@@ -1345,8 +1345,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1340,8 +1340,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
// Paper start - Prevent moving into unloaded chunks
|
||||
if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) {
|
||||
@ -36,7 +36,7 @@ index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a5
|
||||
}
|
||||
// Paper end - Prevent moving into unloaded chunks
|
||||
|
||||
@@ -1355,9 +1361,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1350,9 +1356,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||
// CraftBukkit end
|
||||
@ -56,26 +56,28 @@ index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a5
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1419,14 +1432,29 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1414,14 +1427,31 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
d8 = d2 - this.player.getZ();
|
||||
d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||
- boolean flag2 = false;
|
||||
- boolean flag3 = false;
|
||||
+ boolean movedWrongly = false; // Paper - Add fail move event; rename
|
||||
|
||||
if (!this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot
|
||||
- flag2 = true;
|
||||
- flag3 = true;
|
||||
+ // Paper start - Add fail move event
|
||||
+ io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY,
|
||||
+ toX, toY, toZ, toYaw, toPitch, true);
|
||||
+ if (!event.isAllowed()) {
|
||||
+ movedWrongly = true;
|
||||
+ if (event.getLogWarning())
|
||||
+ // Paper end
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("{} moved wrongly!", this.player.getName().getString());
|
||||
+ }
|
||||
+ } // Paper
|
||||
}
|
||||
|
||||
- if (!this.player.noPhysics && !this.player.isSleeping() && (flag2 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb, d0, d1, d2))) {
|
||||
- if (!this.player.noPhysics && !this.player.isSleeping() && (flag3 && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb, d0, d1, d2))) {
|
||||
+ // Paper start - Add fail move event
|
||||
+ boolean teleportBack = !this.player.noPhysics && !this.player.isSleeping() && (movedWrongly && worldserver.noCollision(this.player, axisalignedbb) || this.isPlayerCollidingWithAnythingNew(worldserver, axisalignedbb, d0, d1, d2));
|
||||
+ if (teleportBack) {
|
||||
+ io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.CLIPPED_INTO_BLOCK,
|
||||
@ -85,11 +87,11 @@ index 1de8ee39347a6f4c56c2d3aa0e32887b57b80524..91e9e8a62ae25360ad82ab12ef07f8a5
|
||||
+ }
|
||||
+ }
|
||||
+ if (teleportBack) {
|
||||
+ // Paper end - Add fail move event
|
||||
+ // Paper end - Add fail move event
|
||||
this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
|
||||
this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packet.isOnGround());
|
||||
} else {
|
||||
@@ -3363,4 +3391,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -3456,4 +3486,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
InteractionResult run(ServerPlayer player, Entity entity, InteractionHand hand);
|
||||
}
|
@ -1148,10 +1148,10 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index a540c744ca88884207c4520794091c01c1c9f50e..882b6effa39b62172914b41af54e54c2890480fb 100644
|
||||
index f12165838f77ae83437f5770faeac1e46b326e98..1d8c63a5a0b05340396a9f7ba079eb7fceda03e2 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1497,6 +1497,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1554,6 +1554,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper
|
||||
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
|
||||
MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
|
||||
@ -1173,10 +1173,10 @@ index a540c744ca88884207c4520794091c01c1c9f50e..882b6effa39b62172914b41af54e54c2
|
||||
this.profiler.push("commandFunctions");
|
||||
MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 0747b0042446271385371f1ca9c8fefdebd851b8..fade1e36037075aae968eb90bbfeac76bfed496a 100644
|
||||
index eef1fb3265a088a2f6718631c1728f3e32014c14..b00da578cb4ba037a540584738b3f866acfa9f88 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -648,6 +648,7 @@ public abstract class PlayerList {
|
||||
@@ -646,6 +646,7 @@ public abstract class PlayerList {
|
||||
|
||||
entityplayer.unRide();
|
||||
worldserver.removePlayerImmediately(entityplayer, Entity.RemovalReason.UNLOADED_WITH_PLAYER);
|
||||
@ -1185,10 +1185,10 @@ index 0747b0042446271385371f1ca9c8fefdebd851b8..fade1e36037075aae968eb90bbfeac76
|
||||
this.players.remove(entityplayer);
|
||||
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index fe768bd70c08719f11e28e793fe90a908f22c4ad..3ae2f450ac43c3752f779eeb40ec7761590f9e51 100644
|
||||
index 16f36d1bfe6458f9aa935cdc63066c082bc83f8e..638aeef75dc5f7ab8b8e050118a7c709246a85f4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -247,11 +247,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -250,11 +250,23 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public @org.jetbrains.annotations.Nullable net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper
|
||||
public CraftEntity getBukkitEntity() {
|
||||
if (this.bukkitEntity == null) {
|
||||
@ -1213,7 +1213,7 @@ index fe768bd70c08719f11e28e793fe90a908f22c4ad..3ae2f450ac43c3752f779eeb40ec7761
|
||||
@Override
|
||||
public CommandSender getBukkitSender(CommandSourceStack wrapper) {
|
||||
return this.getBukkitEntity();
|
||||
@@ -4448,6 +4460,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -4472,6 +4484,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
|
||||
CraftEventFactory.callEntityRemoveEvent(this, cause);
|
||||
// CraftBukkit end
|
||||
@ -1221,7 +1221,7 @@ index fe768bd70c08719f11e28e793fe90a908f22c4ad..3ae2f450ac43c3752f779eeb40ec7761
|
||||
if (this.removalReason == null) {
|
||||
this.removalReason = entity_removalreason;
|
||||
}
|
||||
@@ -4458,12 +4471,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -4482,12 +4495,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
this.getPassengers().forEach(Entity::stopRiding);
|
||||
this.levelCallback.onRemove(entity_removalreason);
|
||||
@ -1251,10 +1251,10 @@ index fe768bd70c08719f11e28e793fe90a908f22c4ad..3ae2f450ac43c3752f779eeb40ec7761
|
||||
public void setLevelCallback(EntityInLevelCallback changeListener) {
|
||||
this.levelCallback = changeListener;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 56a6b3921c74bdeb27f8736302503bee1f731065..b5140b37d2161d89c6c5d6465949e96f5472057a 100644
|
||||
index 29a11dc69b64ddc6022812757b2839931e271ac2..233dc26b6698887e5b2ab179a67364eca389ed86 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -308,6 +308,76 @@ public final class CraftServer implements Server {
|
||||
@@ -310,6 +310,76 @@ public final class CraftServer implements Server {
|
||||
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
|
||||
private final CraftPotionBrewer potionBrewer = new CraftPotionBrewer(); // Paper - Custom Potion Mixes
|
||||
|
||||
@ -1332,7 +1332,7 @@ index 56a6b3921c74bdeb27f8736302503bee1f731065..b5140b37d2161d89c6c5d6465949e96f
|
||||
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
|
||||
ConfigurationSerialization.registerClass(CraftPlayerProfile.class);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 8025b3e9afebc9ad0c08453403422589bf5dd27d..a47d3dba348a058ea9ca675b7f6490a46c1ad970 100644
|
||||
index 991b94ff1186b1071a94b2662873dc071255e2e6..36c97ac40d7e1127d95eeca396570b1d50b69a5c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -68,6 +68,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@ -5,10 +5,10 @@ Subject: [PATCH] API for updating recipes on clients
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index fade1e36037075aae968eb90bbfeac76bfed496a..bc0e9fb41fe22e0a603837fcbdd82134f51d21d9 100644
|
||||
index b00da578cb4ba037a540584738b3f866acfa9f88..2f62af670441d422133b18d00d9e5e5e58e4afe7 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1531,6 +1531,13 @@ public abstract class PlayerList {
|
||||
@@ -1530,6 +1530,13 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public void reloadResources() {
|
||||
@ -22,7 +22,7 @@ index fade1e36037075aae968eb90bbfeac76bfed496a..bc0e9fb41fe22e0a603837fcbdd82134
|
||||
// CraftBukkit start
|
||||
/*Iterator iterator = this.advancements.values().iterator();
|
||||
|
||||
@@ -1546,7 +1553,15 @@ public abstract class PlayerList {
|
||||
@@ -1545,7 +1552,15 @@ public abstract class PlayerList {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@ -35,14 +35,14 @@ index fade1e36037075aae968eb90bbfeac76bfed496a..bc0e9fb41fe22e0a603837fcbdd82134
|
||||
+ }
|
||||
+ public void reloadRecipeData() {
|
||||
+ // Paper end - API for updating recipes on clients
|
||||
ClientboundUpdateRecipesPacket packetplayoutrecipeupdate = new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getRecipes());
|
||||
ClientboundUpdateRecipesPacket packetplayoutrecipeupdate = new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getOrderedRecipes());
|
||||
Iterator iterator1 = this.players.iterator();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index b5140b37d2161d89c6c5d6465949e96f5472057a..458bf151cb733e023b897a2acff2ab3a10fe0949 100644
|
||||
index 233dc26b6698887e5b2ab179a67364eca389ed86..810ffd7cd1a8a7facc63e10e9eb5fed0504737e3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1141,6 +1141,18 @@ public final class CraftServer implements Server {
|
||||
@@ -1142,6 +1142,18 @@ public final class CraftServer implements Server {
|
||||
ReloadCommand.reload(this.console);
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ index b5140b37d2161d89c6c5d6465949e96f5472057a..458bf151cb733e023b897a2acff2ab3a
|
||||
private void loadIcon() {
|
||||
this.icon = new CraftIconCache(null);
|
||||
try {
|
||||
@@ -1516,6 +1528,13 @@ public final class CraftServer implements Server {
|
||||
@@ -1529,6 +1541,13 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public boolean addRecipe(Recipe recipe) {
|
||||
@ -75,7 +75,7 @@ index b5140b37d2161d89c6c5d6465949e96f5472057a..458bf151cb733e023b897a2acff2ab3a
|
||||
CraftRecipe toAdd;
|
||||
if (recipe instanceof CraftRecipe) {
|
||||
toAdd = (CraftRecipe) recipe;
|
||||
@@ -1545,6 +1564,11 @@ public final class CraftServer implements Server {
|
||||
@@ -1558,6 +1577,11 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
}
|
||||
toAdd.addToCraftingManager();
|
||||
@ -87,7 +87,7 @@ index b5140b37d2161d89c6c5d6465949e96f5472057a..458bf151cb733e023b897a2acff2ab3a
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1725,10 +1749,23 @@ public final class CraftServer implements Server {
|
||||
@@ -1738,10 +1762,23 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public boolean removeRecipe(NamespacedKey recipeKey) {
|
@ -5,18 +5,18 @@ Subject: [PATCH] Fix rotation when spawning display entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index a97ceea235f756cbca3c82aa1965d90cf7767580..2c60f2d82daacfcfc1eb9f64267ca8ae70726d17 100644
|
||||
index 63f9852de5b557351793ba3aebdd7e752caf2417..2c44056065b75efecdf7bc835d1e899d1b50ccfe 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -216,6 +216,7 @@ public final class CraftEntityTypes {
|
||||
@@ -220,6 +220,7 @@ public final class CraftEntityTypes {
|
||||
Vector direction = spawnData.location().getDirection().multiply(10);
|
||||
entity.setDirection(direction.getX(), direction.getY(), direction.getZ());
|
||||
entity.assignPower(direction.getX(), direction.getY(), direction.getZ());
|
||||
};
|
||||
+ private static final BiConsumer<SpawnData, net.minecraft.world.entity.Entity> ROT = (spawnData, entity) -> entity.setRot(spawnData.yaw(), spawnData.pitch()); // Paper
|
||||
private static final Map<Class<?>, EntityTypeData<?, ?>> CLASS_TYPE_DATA = new HashMap<>();
|
||||
private static final Map<EntityType, EntityTypeData<?, ?>> ENTITY_TYPE_DATA = new HashMap<>();
|
||||
|
||||
@@ -352,10 +353,10 @@ public final class CraftEntityTypes {
|
||||
@@ -360,10 +361,10 @@ public final class CraftEntityTypes {
|
||||
|
||||
// Set pos
|
||||
register(new EntityTypeData<>(EntityType.MARKER, Marker.class, CraftMarker::new, createAndSetPos(net.minecraft.world.entity.EntityType.MARKER)));
|
||||
@ -29,4 +29,4 @@ index a97ceea235f756cbca3c82aa1965d90cf7767580..2c60f2d82daacfcfc1eb9f64267ca8ae
|
||||
+ register(new EntityTypeData<>(EntityType.TEXT_DISPLAY, TextDisplay.class, CraftTextDisplay::new, combine(createAndSetPos(net.minecraft.world.entity.EntityType.TEXT_DISPLAY), ROT))); // Paper
|
||||
|
||||
// MISC
|
||||
register(new EntityTypeData<>(EntityType.DROPPED_ITEM, Item.class, CraftItem::new, spawnData -> {
|
||||
register(new EntityTypeData<>(EntityType.ITEM, Item.class, CraftItem::new, spawnData -> {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Only capture actual tree growth
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
index 175b965c92b8b8be9c671e1ee478afa9a2f7bf82..1fb809486ee56efd3d0ef3fa02503ba9be459f68 100644
|
||||
index 5bbadc890a72f1cb22c6881ebcc163b0c06a367a..4fa838bf97ede6e1c893ba64f53aa7af5db0405a 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
@@ -868,6 +868,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -654,6 +654,7 @@ public interface DispenseItemBehavior {
|
||||
if (!fertilizeEvent.isCancelled()) {
|
||||
for (org.bukkit.block.BlockState blockstate : blocks) {
|
||||
blockstate.update(true);
|
||||
@ -17,10 +17,10 @@ index 175b965c92b8b8be9c671e1ee478afa9a2f7bf82..1fb809486ee56efd3d0ef3fa02503ba9
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 5a86b2c205250ddcd833a15accb27ca4a580eadd..9b4e20d4bfba2de08084f1d69cb2ebfff7455c14 100644
|
||||
index 31f67c83416031079569375e5f69738dd639b93f..789740cadc1b66531b465bb0a052e2392852c4a8 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -424,6 +424,7 @@ public final class ItemStack {
|
||||
@@ -437,6 +437,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
for (CraftBlockState blockstate : blocks) {
|
||||
// SPIGOT-7572 - Move fix for SPIGOT-7248 to CapturedBlockState, to allow bees in bee nest
|
||||
CapturedBlockState.setBlockState(blockstate);
|
||||
@ -29,10 +29,10 @@ index 5a86b2c205250ddcd833a15accb27ca4a580eadd..9b4e20d4bfba2de08084f1d69cb2ebff
|
||||
entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 336ae7f1fc4bd045183c967f8e3bfb5a967a40a1..e881ed9de9d864e0522e1f7f97dc3debf57cf4b6 100644
|
||||
index 19a177041e6e9621b0e35ca4f4ceb79b72448680..f3486d042a592cb538c5e8f681673a0c2c45ffd9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1372,4 +1372,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1366,4 +1366,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
|
||||
}
|
||||
// Paper end - respect global sound events gamerule
|
||||
@ -48,7 +48,7 @@ index 336ae7f1fc4bd045183c967f8e3bfb5a967a40a1..e881ed9de9d864e0522e1f7f97dc3deb
|
||||
+ // Paper end - notify observers even if grow failed
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java b/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
|
||||
index 83e6e3286d04c39d6d7ba496251aec962621f72e..3ff0d08e4964aae82d8e51d3b8bf9aa002096f81 100644
|
||||
index 2d7290ace5fc8890325a8ec623075ad32f9b1d44..d262a5a6da57ef9ba9a6fe0dfbc88f577105e74f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
|
||||
@@ -86,6 +86,7 @@ public class SaplingBlock extends BushBlock implements BonemealableBlock {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Use correct source for mushroom block spread event
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
|
||||
index 1448386e71a1f7c81b48788ac42b49d6dff29912..1f27ae8abd5891a0b8057b454f2210b088b4e95a 100644
|
||||
index f549cac99a665f20f1cd1d8c807ed3649fed7531..1172d85c5c26ab2142343d91149766e5993cb36a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
|
||||
@@ -68,6 +68,7 @@ public class MushroomBlock extends BushBlock implements BonemealableBlock {
|
@ -9,11 +9,11 @@ Subject: [PATCH] Respect randomizeData on more entities when spawning
|
||||
* ExperienceOrb
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 2c60f2d82daacfcfc1eb9f64267ca8ae70726d17..21d3b6f2021b2afd88c5ef6b9a375977d1ccadef 100644
|
||||
index 2c44056065b75efecdf7bc835d1e899d1b50ccfe..405caaff1459d8928f91be0fc85213b80ee8b8af 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -217,6 +217,13 @@ public final class CraftEntityTypes {
|
||||
entity.setDirection(direction.getX(), direction.getY(), direction.getZ());
|
||||
@@ -221,6 +221,13 @@ public final class CraftEntityTypes {
|
||||
entity.assignPower(direction.getX(), direction.getY(), direction.getZ());
|
||||
};
|
||||
private static final BiConsumer<SpawnData, net.minecraft.world.entity.Entity> ROT = (spawnData, entity) -> entity.setRot(spawnData.yaw(), spawnData.pitch()); // Paper
|
||||
+ // Paper start - respect randomizeData
|
||||
@ -26,7 +26,7 @@ index 2c60f2d82daacfcfc1eb9f64267ca8ae70726d17..21d3b6f2021b2afd88c5ef6b9a375977
|
||||
private static final Map<Class<?>, EntityTypeData<?, ?>> CLASS_TYPE_DATA = new HashMap<>();
|
||||
private static final Map<EntityType, EntityTypeData<?, ?>> ENTITY_TYPE_DATA = new HashMap<>();
|
||||
|
||||
@@ -365,11 +372,12 @@ public final class CraftEntityTypes {
|
||||
@@ -373,11 +380,12 @@ public final class CraftEntityTypes {
|
||||
net.minecraft.world.item.ItemStack itemStack = new net.minecraft.world.item.ItemStack(Items.STONE);
|
||||
ItemEntity item = new ItemEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), itemStack);
|
||||
item.setPickUpDelay(10);
|
||||
@ -40,19 +40,19 @@ index 2c60f2d82daacfcfc1eb9f64267ca8ae70726d17..21d3b6f2021b2afd88c5ef6b9a375977
|
||||
));
|
||||
register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, createAndMove(net.minecraft.world.entity.EntityType.AREA_EFFECT_CLOUD))); // Paper - set area effect cloud rotation
|
||||
register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
@@ -381,12 +389,23 @@ public final class CraftEntityTypes {
|
||||
@@ -389,12 +397,23 @@ public final class CraftEntityTypes {
|
||||
entity.setItem(CraftItemStack.asNMSCopy(new ItemStack(Material.SPLASH_POTION, 1)));
|
||||
return entity;
|
||||
}));
|
||||
- register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null)));
|
||||
+ register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, combine(spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null), CLEAR_MOVE_IF_NOT_RANDOMIZED))); // Paper - respect randomizeData
|
||||
- register(new EntityTypeData<>(EntityType.TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null)));
|
||||
+ register(new EntityTypeData<>(EntityType.TNT, TNTPrimed.class, CraftTNTPrimed::new, combine(spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null), CLEAR_MOVE_IF_NOT_RANDOMIZED))); // Paper - respect randomizeData
|
||||
register(new EntityTypeData<>(EntityType.FALLING_BLOCK, FallingBlock.class, CraftFallingBlock::new, spawnData -> {
|
||||
BlockPos pos = BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z());
|
||||
return new FallingBlockEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), spawnData.world().getBlockState(pos)); // Paper - create falling block entities correctly
|
||||
}));
|
||||
- register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY)));
|
||||
- register(new EntityTypeData<>(EntityType.FIREWORK_ROCKET, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY)));
|
||||
+ // Paper start - respect randomizeData
|
||||
+ register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> {
|
||||
+ register(new EntityTypeData<>(EntityType.FIREWORK_ROCKET, Firework.class, CraftFirework::new, spawnData -> {
|
||||
+ FireworkRocketEntity entity = new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY);
|
||||
+ if (!spawnData.randomizeData()) {
|
||||
+ // logic below was taken from FireworkRocketEntity constructor
|
||||
@ -64,5 +64,5 @@ index 2c60f2d82daacfcfc1eb9f64267ca8ae70726d17..21d3b6f2021b2afd88c5ef6b9a375977
|
||||
+ }));
|
||||
+ // Paper end - respect randomizeData
|
||||
register(new EntityTypeData<>(EntityType.EVOKER_FANGS, EvokerFangs.class, CraftEvokerFangs::new, spawnData -> new net.minecraft.world.entity.projectile.EvokerFangs(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), (float) Math.toRadians(spawnData.yaw()), 0, null)));
|
||||
register(new EntityTypeData<>(EntityType.MINECART_COMMAND, CommandMinecart.class, CraftMinecartCommand::new, spawnData -> new MinecartCommandBlock(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
register(new EntityTypeData<>(EntityType.COMMAND_BLOCK_MINECART, CommandMinecart.class, CraftMinecartCommand::new, spawnData -> new MinecartCommandBlock(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
register(new EntityTypeData<>(EntityType.MINECART, RideableMinecart.class, CraftMinecartRideable::new, spawnData -> new Minecart(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
@ -5,11 +5,11 @@ Subject: [PATCH] Use correct seed on api world load
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 458bf151cb733e023b897a2acff2ab3a10fe0949..33d5454b95011395e0868b4e6a338a2db4b5c398 100644
|
||||
index 810ffd7cd1a8a7facc63e10e9eb5fed0504737e3..0daa352795a6533289370388c9c75c98c82396ca 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1361,7 +1361,7 @@ public final class CraftServer implements Server {
|
||||
net.minecraft.server.Main.forceUpgrade(worldSession, DataFixers.getDataFixer(), this.console.options.has("eraseCache"), () -> true, iregistry);
|
||||
@@ -1364,7 +1364,7 @@ public final class CraftServer implements Server {
|
||||
net.minecraft.server.Main.forceUpgrade(worldSession, DataFixers.getDataFixer(), this.console.options.has("eraseCache"), () -> true, iregistrycustom_dimension, this.console.options.has("recreateRegionFiles"));
|
||||
}
|
||||
|
||||
- long j = BiomeManager.obfuscateSeed(creator.seed());
|
@ -7,7 +7,7 @@ The lists are only supposed to contain ticks for the 1 radius
|
||||
neighbours of the chunk.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java b/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java
|
||||
index ae52f9a04221efed322bc3dc76ac0d56738ffba7..25c1abaeb916781f810d580a4d388d4d3adad75a 100644
|
||||
index bfb73e016f107fb8da12903bf233a824d062ed73..22b6d0851a51da180cd8fbbe6554c5370f5ac5bd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java
|
||||
@@ -100,6 +100,25 @@ public class UpgradeData {
|
@ -5,23 +5,23 @@ Subject: [PATCH] Cache map ids on item frames
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 888cbfaf49aa6d1d1b8cc87cf411a1dd53fbe89d..c2a4fde17673a2bc3133aa0c68608c3da75d5cc5 100644
|
||||
index b195de05371e9762654b69365f0e722443425d33..fbb138aefe19237aeeba2f5fc8070bf81e289dc3 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -118,7 +118,7 @@ public class ServerEntity {
|
||||
ItemStack itemstack = entityitemframe.getItem();
|
||||
|
||||
if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable
|
||||
- Integer integer = MapItem.getMapId(itemstack);
|
||||
- MapId mapid = (MapId) itemstack.get(DataComponents.MAP_ID);
|
||||
+ Integer integer = entityitemframe.cachedMapId; // Paper - Perf: Cache map ids on item frames
|
||||
MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level);
|
||||
MapItemSavedData worldmap = MapItem.getSavedData(mapid, this.level);
|
||||
|
||||
if (worldmap != null) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
index e875196824ef9618a52ca3f172f202d5584990df..c34701f95580e4cf45fe086115563127432a28c5 100644
|
||||
index 6bf89686ce5cf700ac06ec1e38f53af745098fa3..3f35e16a91b3cf360a3b8a69ee495aaca9210e13 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -50,6 +50,7 @@ public class ItemFrame extends HangingEntity {
|
||||
@@ -49,6 +49,7 @@ public class ItemFrame extends HangingEntity {
|
||||
public static final int NUM_ROTATIONS = 8;
|
||||
public float dropChance;
|
||||
public boolean fixed;
|
||||
@ -29,7 +29,7 @@ index e875196824ef9618a52ca3f172f202d5584990df..c34701f95580e4cf45fe086115563127
|
||||
|
||||
public ItemFrame(EntityType<? extends ItemFrame> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -388,6 +389,7 @@ public class ItemFrame extends HangingEntity {
|
||||
@@ -364,6 +365,7 @@ public class ItemFrame extends HangingEntity {
|
||||
}
|
||||
|
||||
private void onItemChanged(ItemStack stack) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix custom statistic criteria creation
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 0d49d7b92305977fe66f13c1e66739c1430dc7fd..6cba1d9f5c6e77309399c245d209662eb4548d56 100644
|
||||
index b2755299789dea3bcc49e66d3647a6e8a5080b4d..9ed12c6f896470f140f9ed4bdc565d2b4edda1eb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -638,6 +638,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -635,6 +635,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biomeBase = cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME).getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.BIOME, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(biomeKey)));
|
||||
cra.setBiome(x, y, z, biomeBase);
|
||||
}
|
@ -9,10 +9,10 @@ upstream. Until then, this test and these fixes
|
||||
should address all the known issues with them
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java
|
||||
index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f98c5d0572 100644
|
||||
index 71733f918ed84b9879ac1b142ef6205c5e768a9c..7ee13c0a0cd12979c7f8cc2e403baf9300fd61c8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java
|
||||
@@ -16,12 +16,16 @@ public class CraftEffect {
|
||||
@@ -15,6 +15,8 @@ public class CraftEffect {
|
||||
public static <T> int getDataValue(Effect effect, T data) {
|
||||
int datavalue;
|
||||
switch (effect) {
|
||||
@ -21,15 +21,7 @@ index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f9
|
||||
case VILLAGER_PLANT_GROW:
|
||||
datavalue = (Integer) data;
|
||||
break;
|
||||
case POTION_BREAK:
|
||||
+ if (data instanceof Potion) { // Paper - use Color for POTION_BREAK
|
||||
datavalue = ((Potion) data).toDamageValue() & 0x3F;
|
||||
break;
|
||||
+ } // Paper - Color will fall through to cast below
|
||||
case INSTANT_POTION_BREAK:
|
||||
datavalue = ((Color) data).asRGB();
|
||||
break;
|
||||
@@ -29,6 +33,13 @@ public class CraftEffect {
|
||||
@@ -26,6 +28,13 @@ public class CraftEffect {
|
||||
Preconditions.checkArgument(data == Material.AIR || ((Material) data).isRecord(), "Invalid record type for Material %s!", data);
|
||||
datavalue = Item.getId(CraftItemType.bukkitToMinecraft((Material) data));
|
||||
break;
|
||||
@ -43,7 +35,7 @@ index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f9
|
||||
case SMOKE:
|
||||
switch ((BlockFace) data) {
|
||||
case DOWN:
|
||||
@@ -60,8 +71,15 @@ public class CraftEffect {
|
||||
@@ -57,8 +66,15 @@ public class CraftEffect {
|
||||
}
|
||||
break;
|
||||
case STEP_SOUND:
|
||||
@ -60,10 +52,10 @@ index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f9
|
||||
case COMPOSTER_FILL_ATTEMPT:
|
||||
datavalue = ((Boolean) data) ? 1 : 0;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 51e709beb32499f2f56189a0426bba93c43e1c0d..9dadce62fc3e248fa2a8607fe87960491353c317 100644
|
||||
index 6231bc770ea6eb6aba47abbc74b6380fd9360d8c..81e5768f556628f3f37dc8091193c0a1b853f1da 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1391,7 +1391,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1400,7 +1400,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
public <T> void playEffect(Location loc, Effect effect, T data, int radius) {
|
||||
if (data != null) {
|
||||
Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect);
|
||||
@ -73,10 +65,10 @@ index 51e709beb32499f2f56189a0426bba93c43e1c0d..9dadce62fc3e248fa2a8607fe8796049
|
||||
// Special case: the axis is optional for ELECTRIC_SPARK
|
||||
Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index d4875f4477d1d76857bc135f6f0849b889baca22..9eec302c02ebed13859bab0316896ae5a1c084d2 100644
|
||||
index 1c6fdad145d81a25ccd2b1193ebe4b5ad96bfb9c..0fe81e58541dbc46ac493897aa190ebf9ddbc805 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -839,7 +839,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -914,7 +914,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
Preconditions.checkArgument(effect != null, "Effect cannot be null");
|
||||
if (data != null) {
|
||||
Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect);
|
@ -7,12 +7,12 @@ Subject: [PATCH] SculkCatalyst bloom API
|
||||
public net.minecraft.world.level.block.entity.SculkCatalystBlockEntity$CatalystListener bloom(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/util/RandomSource;)V
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java
|
||||
index 139026c06589bb9c4201e20cd200887a8527fe55..a4ad8a90d0c2e4978370f9631dbd3a430e951b1c 100644
|
||||
index 5211dc80f449cec09f992a42667e869ab9e7115e..407d5b1d87d14e18878f0ebf1d676a7f49e7cfaf 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java
|
||||
@@ -32,4 +32,20 @@ public class CraftSculkCatalyst extends CraftBlockEntityState<SculkCatalystBlock
|
||||
public CraftSculkCatalyst copy() {
|
||||
return new CraftSculkCatalyst(this);
|
||||
@@ -38,4 +38,20 @@ public class CraftSculkCatalyst extends CraftBlockEntityState<SculkCatalystBlock
|
||||
public CraftSculkCatalyst copy(Location location) {
|
||||
return new CraftSculkCatalyst(this, location);
|
||||
}
|
||||
+
|
||||
+ // Paper start - SculkCatalyst bloom API
|
@ -7,10 +7,10 @@ Was obtainable through different methods, but you had to use different
|
||||
methods depending on the implementation of Entity you were working with.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index a47d3dba348a058ea9ca675b7f6490a46c1ad970..cbcfb0bc3a85b60e13014245f256e5c356b4b79b 100644
|
||||
index 36c97ac40d7e1127d95eeca396570b1d50b69a5c..96448895a0a18e6f819d0a2a629c04abd331fa85 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1234,4 +1234,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -1244,4 +1244,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
return !this.getHandle().level().noCollision(this.getHandle(), aabb);
|
||||
}
|
||||
// Paper end - Collision API
|
@ -5,10 +5,10 @@ Subject: [PATCH] Deprecate and replace methods with old StructureType
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 33d5454b95011395e0868b4e6a338a2db4b5c398..92369eb350fd795a4e99731d7ceda4f8b890791e 100644
|
||||
index 0daa352795a6533289370388c9c75c98c82396ca..ca4cce36d462567f9fbab53dd904cad6db382f72 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1958,6 +1958,11 @@ public final class CraftServer implements Server {
|
||||
@@ -1977,6 +1977,11 @@ public final class CraftServer implements Server {
|
||||
|
||||
ServerLevel worldServer = ((CraftWorld) world).getHandle();
|
||||
Location structureLocation = world.locateNearestStructure(location, structureType, radius, findUnexplored);
|
||||
@ -20,7 +20,7 @@ index 33d5454b95011395e0868b4e6a338a2db4b5c398..92369eb350fd795a4e99731d7ceda4f8
|
||||
BlockPos structurePosition = CraftLocation.toBlockPosition(structureLocation);
|
||||
|
||||
// Create map with trackPlayer = true, unlimitedTracking = true
|
||||
@@ -1968,6 +1973,31 @@ public final class CraftServer implements Server {
|
||||
@@ -1987,6 +1992,31 @@ public final class CraftServer implements Server {
|
||||
|
||||
return CraftItemStack.asBukkitCopy(stack);
|
||||
}
|
@ -11,10 +11,10 @@ This patch prevents server from sending namespaced commands when player
|
||||
requests tab-complete only commands.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 91e9e8a62ae25360ad82ab12ef07f8a51a2665ca..a580b36ae2dafc1b178fd2333afcc23e0691e5f2 100644
|
||||
index 8085e59bf16d3a5c85bd9d328126f226c026f163..b88d6230172311d92844a9621f2eb3be644ac2aa 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -792,6 +792,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -823,6 +823,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
|
||||
|
||||
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
@ -9,10 +9,10 @@ food consumption, turtle egg count decreases, ice to water
|
||||
conversions and beehive releases
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index 3621770701c6fb1da75c69a41297684493380e37..4747b05619f37009a5a236678aceec6cfc1c0b79 100644
|
||||
index ee7f36700863b9f504a70a56c5f28c8e39b45c91..7b4426ac0435d3f419d9ece29dc9eccdb8f99950 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -431,8 +431,8 @@ public class ServerPlayerGameMode {
|
||||
@@ -434,8 +434,8 @@ public class ServerPlayerGameMode {
|
||||
isCorrectTool = flag1; // Paper - Trigger bee_nest_destroyed trigger in the correct place
|
||||
|
||||
itemstack.mineBlock(this.level, iblockdata1, pos, this.player);
|
||||
@ -24,10 +24,10 @@ index 3621770701c6fb1da75c69a41297684493380e37..4747b05619f37009a5a236678aceec6c
|
||||
|
||||
// return true; // CraftBukkit
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
|
||||
index 799e44ae5a7c3d6994653d43d455c39f3e30b012..25e8d6066fb94d0b9a244ab1fec5139b9266d86d 100644
|
||||
index 4e8bafa97127632799a1f0260c1ef3367cb8a54c..6ef43d544e9d3dd31506c5a55b0db428fb074b47 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
|
||||
@@ -84,8 +84,8 @@ public class BeehiveBlock extends BaseEntityBlock {
|
||||
@@ -86,8 +86,8 @@ public class BeehiveBlock extends BaseEntityBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -35,14 +35,14 @@ index 799e44ae5a7c3d6994653d43d455c39f3e30b012..25e8d6066fb94d0b9a244ab1fec5139b
|
||||
- super.playerDestroy(world, player, pos, state, blockEntity, tool);
|
||||
+ public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack tool, boolean includeDrops, boolean dropExp) { // Paper - fix drops not preventing stats/food exhaustion
|
||||
+ super.playerDestroy(world, player, pos, state, blockEntity, tool, includeDrops, dropExp); // Paper - fix drops not preventing stats/food exhaustion
|
||||
if (!world.isClientSide && blockEntity instanceof BeehiveBlockEntity) {
|
||||
BeehiveBlockEntity tileentitybeehive = (BeehiveBlockEntity) blockEntity;
|
||||
|
||||
if (!world.isClientSide && blockEntity instanceof BeehiveBlockEntity tileentitybeehive) {
|
||||
if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) == 0) {
|
||||
tileentitybeehive.emptyAllLivingFromHive(player, state, BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index 57d92c1785586dfab2b3934733d8ba253e042e2e..c4bf01177b2dfcc88f6992dc85de216d448a79f8 100644
|
||||
index c09851136944bd58d82b3a9d19719b0354802824..a757a45d423e1729c9374391df4186ae0522e1ac 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -411,10 +411,18 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -403,10 +403,18 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
return this.defaultBlockState();
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ index 57d92c1785586dfab2b3934733d8ba253e042e2e..c4bf01177b2dfcc88f6992dc85de216d
|
||||
|
||||
public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
|
||||
index 0f0750f8c790d0db72a0e6b277449a1461674890..03b5ab8251497c0c94467f90e6663a0dc766babb 100644
|
||||
index 7fdf744a2be55313cc75c1322f6534f55cf463f5..f446c40c4d90307c568faa2866800f5326634df6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
|
||||
@@ -96,8 +96,8 @@ public class DoublePlantBlock extends BushBlock {
|
||||
@ -77,7 +77,7 @@ index 0f0750f8c790d0db72a0e6b277449a1461674890..03b5ab8251497c0c94467f90e6663a0d
|
||||
|
||||
protected static void preventDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/IceBlock.java b/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||
index 52c6c26a300cfd19c478afba411a17c8d5ea0c3c..9c8c1df5187daefb1c8098b4d4a0976c71a7bbfd 100644
|
||||
index 4bfe53e3a231a7bec461759e78c7a6cbcb8bb625..013302623d3ca3ff88f242d740af935dcf4844a6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||
@@ -33,8 +33,8 @@ public class IceBlock extends HalfTransparentBlock {
|
||||
@ -92,10 +92,10 @@ index 52c6c26a300cfd19c478afba411a17c8d5ea0c3c..9c8c1df5187daefb1c8098b4d4a0976c
|
||||
this.afterDestroy(world, pos, tool);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
index c79f3a8885a5ffc9ebac51992e63df14929d9f24..b4646e26965e0f1f26c5019e7c6a13fdf22bdb47 100644
|
||||
index bdcb732a31fff0cfc2119132079ce197c7a77c9a..a6f408e56fa6c9de82fd93555fe21e1b11ce1022 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
@@ -173,8 +173,8 @@ public class TurtleEggBlock extends Block {
|
||||
@@ -174,8 +174,8 @@ public class TurtleEggBlock extends Block {
|
||||
}
|
||||
|
||||
@Override
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fire entity death event for ender dragon
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
index 61e4f8be9f5927b65ae03da98250d3cd4c1e8c13..1df13af62af7d0bbd92c84d424a07da66bb8583f 100644
|
||||
index e8be7ddbef12b27ed5c5fcfa8b726d5a85058aa9..6f14607a88761171a72e274b3c9b476b20a272f1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
@@ -643,6 +643,15 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
@@ -641,6 +641,15 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
|
||||
@Override
|
||||
public void kill() {
|
@ -6,10 +6,10 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate
|
||||
Options to configure entity tracking by Y coordinate, also for each entity category.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index ca24463405f138deb882f319bf84696f52a1f606..aed4f4ac21b8ddc9c9ee7ce5151bbfc8bb6cf7f5 100644
|
||||
index bff776f07bcc7841acc5757c1f53bde1812756c8..e7994d0f45b186938dd5606284290f56f110d7ed 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1741,6 +1741,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1754,6 +1754,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
|
||||
double d2 = d0 * d0;
|
||||
boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z);
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Listing API for Player
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
|
||||
index 754a2a5e958a04b3f8bf216b6022f547aa1cd36f..d41fe931daf03c40ca1d7b9159001d0122d72f0c 100644
|
||||
index 6247a21c9c391abf1f6db3482c659593e4f29355..9ccca41bf23efadba5329cc584bbcdcacbe09a92 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
|
||||
@@ -29,6 +29,17 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
|
||||
@@ -37,6 +37,17 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
|
||||
this.actions = EnumSet.of(action);
|
||||
this.entries = List.of(new ClientboundPlayerInfoUpdatePacket.Entry(player));
|
||||
}
|
||||
@ -26,7 +26,7 @@ index 754a2a5e958a04b3f8bf216b6022f547aa1cd36f..d41fe931daf03c40ca1d7b9159001d01
|
||||
|
||||
public static ClientboundPlayerInfoUpdatePacket createPlayerInitializing(Collection<ServerPlayer> players) {
|
||||
EnumSet<ClientboundPlayerInfoUpdatePacket.Action> enumSet = EnumSet.of(
|
||||
@@ -42,6 +53,29 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
|
||||
@@ -50,6 +61,28 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
|
||||
return new ClientboundPlayerInfoUpdatePacket(enumSet, players);
|
||||
}
|
||||
|
||||
@ -52,11 +52,10 @@ index 754a2a5e958a04b3f8bf216b6022f547aa1cd36f..d41fe931daf03c40ca1d7b9159001d01
|
||||
+ return new ClientboundPlayerInfoUpdatePacket(enumSet, new ClientboundPlayerInfoUpdatePacket.Entry(playerInfoId, listed));
|
||||
+ }
|
||||
+ // Paper end - Add Listing API for Player
|
||||
+
|
||||
public ClientboundPlayerInfoUpdatePacket(FriendlyByteBuf buf) {
|
||||
private ClientboundPlayerInfoUpdatePacket(RegistryFriendlyByteBuf buf) {
|
||||
this.actions = buf.readEnumSet(ClientboundPlayerInfoUpdatePacket.Action.class);
|
||||
this.entries = buf.readList(buf2 -> {
|
||||
@@ -146,16 +180,24 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
|
||||
@@ -158,16 +191,24 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
|
||||
@Nullable RemoteChatSession.Data chatSession
|
||||
) {
|
||||
Entry(ServerPlayer player) {
|
||||
@ -83,10 +82,10 @@ index 754a2a5e958a04b3f8bf216b6022f547aa1cd36f..d41fe931daf03c40ca1d7b9159001d01
|
||||
|
||||
static class EntryBuilder {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index bc0e9fb41fe22e0a603837fcbdd82134f51d21d9..d38fe02af4cc35ed5b22acec41bedb76151f8af5 100644
|
||||
index 2f62af670441d422133b18d00d9e5e5e58e4afe7..db1279f780e905e5b29fd4db0440d29f52596be0 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -357,14 +357,22 @@ public abstract class PlayerList {
|
||||
@@ -359,14 +359,22 @@ public abstract class PlayerList {
|
||||
// CraftBukkit end
|
||||
|
||||
// CraftBukkit start - sendAll above replaced with this loop
|
||||
@ -110,7 +109,7 @@ index bc0e9fb41fe22e0a603837fcbdd82134f51d21d9..d38fe02af4cc35ed5b22acec41bedb76
|
||||
}
|
||||
|
||||
if (entityplayer1 == player || !bukkitPlayer.canSee(entityplayer1.getBukkitEntity())) { // Paper - Use single player info update packet on join; Don't include joining player
|
||||
@@ -375,7 +383,7 @@ public abstract class PlayerList {
|
||||
@@ -377,7 +385,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper start - Use single player info update packet on join
|
||||
if (!onlinePlayers.isEmpty()) {
|
||||
@ -120,10 +119,10 @@ index bc0e9fb41fe22e0a603837fcbdd82134f51d21d9..d38fe02af4cc35ed5b22acec41bedb76
|
||||
// Paper end - Use single player info update packet on join
|
||||
player.sentListPacket = true;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 9eec302c02ebed13859bab0316896ae5a1c084d2..2c7c39eab2bdbedf4aea903ba76f3289285bd7e7 100644
|
||||
index 0fe81e58541dbc46ac493897aa190ebf9ddbc805..1d6ea70c8039b7dcae3742ce7ef6a52015d6bc52 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -188,6 +188,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -198,6 +198,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
private final ConversationTracker conversationTracker = new ConversationTracker();
|
||||
private final Set<String> channels = new HashSet<String>();
|
||||
private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new HashMap<>();
|
||||
@ -131,7 +130,7 @@ index 9eec302c02ebed13859bab0316896ae5a1c084d2..2c7c39eab2bdbedf4aea903ba76f3289
|
||||
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
|
||||
private int hash = 0;
|
||||
private double health = 20;
|
||||
@@ -1997,7 +1998,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2073,7 +2074,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
otherPlayer.setUUID(uuidOverride);
|
||||
}
|
||||
// Paper end
|
||||
@ -140,7 +139,7 @@ index 9eec302c02ebed13859bab0316896ae5a1c084d2..2c7c39eab2bdbedf4aea903ba76f3289
|
||||
if (original != null) otherPlayer.setUUID(original); // Paper - uuid override
|
||||
}
|
||||
|
||||
@@ -2104,6 +2105,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2180,6 +2181,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it
|
||||
}
|
||||
|
@ -5,27 +5,26 @@ Subject: [PATCH] Configurable Region Compression Format
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
index 169e375c814ff814d15101d09dccc67783f50465..8d20e265872e1f8200de186a69a29f498ceb8588 100644
|
||||
index f1237f6fd6414900ffbad0caee31aa83310eeef4..e956bca0d06382b8dd63453a6eb111deae68b62e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
@@ -46,7 +46,7 @@ public class RegionFile implements AutoCloseable {
|
||||
@@ -50,7 +50,7 @@ public class RegionFile implements AutoCloseable {
|
||||
protected final RegionBitmap usedSectors;
|
||||
|
||||
public RegionFile(Path file, Path directory, boolean dsync) throws IOException {
|
||||
- this(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
|
||||
public RegionFile(RegionStorageInfo storageKey, Path directory, Path path, boolean dsync) throws IOException {
|
||||
- this(storageKey, directory, path, RegionFileVersion.getSelected(), dsync);
|
||||
+ this(file, directory, RegionFileVersion.getCompressionFormat(), dsync); // Paper - Configurable region compression format
|
||||
}
|
||||
|
||||
public RegionFile(Path file, Path directory, RegionFileVersion outputChunkStreamVersion, boolean dsync) throws IOException {
|
||||
public RegionFile(RegionStorageInfo storageKey, Path path, Path directory, RegionFileVersion compressionFormat, boolean dsync) throws IOException {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileVersion.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
|
||||
index ebe6fafc26031bc503ca032976f2a593a0f54c6b..581912e1315a4a8b46042a27df54826fa63e9c75 100644
|
||||
index cbd892598287c9358c1c2a3840c517462820b389..ef68b57ef1d8d7cb317c417569dd23a777fba4ad 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileVersion.java
|
||||
@@ -26,6 +26,17 @@ public class RegionFileVersion {
|
||||
)
|
||||
);
|
||||
public static final RegionFileVersion VERSION_NONE = register(new RegionFileVersion(3, stream -> stream, stream -> stream));
|
||||
+
|
||||
@@ -58,6 +58,15 @@ public class RegionFileVersion {
|
||||
private final RegionFileVersion.StreamWrapper<InputStream> inputWrapper;
|
||||
private final RegionFileVersion.StreamWrapper<OutputStream> outputWrapper;
|
||||
|
||||
+ // Paper start - Configurable region compression format
|
||||
+ public static RegionFileVersion getCompressionFormat() {
|
||||
+ return switch (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.compressionFormat) {
|
||||
@ -35,7 +34,6 @@ index ebe6fafc26031bc503ca032976f2a593a0f54c6b..581912e1315a4a8b46042a27df54826f
|
||||
+ };
|
||||
+ }
|
||||
+ // Paper end - Configurable region compression format
|
||||
+
|
||||
private final int id;
|
||||
private final RegionFileVersion.StreamWrapper<InputStream> inputWrapper;
|
||||
private final RegionFileVersion.StreamWrapper<OutputStream> outputWrapper;
|
||||
private RegionFileVersion(
|
||||
int id,
|
||||
@Nullable String name,
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockFace to BlockDamageEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index 4747b05619f37009a5a236678aceec6cfc1c0b79..d0ca98c3f9ea5c8cb1053da6b17e9a90c86b3ae7 100644
|
||||
index 7b4426ac0435d3f419d9ece29dc9eccdb8f99950..cef3a64b5e6c4d34ed079078420078a7adfcd574 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -253,7 +253,7 @@ public class ServerPlayerGameMode {
|
||||
@@ -256,7 +256,7 @@ public class ServerPlayerGameMode {
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -18,10 +18,10 @@ index 4747b05619f37009a5a236678aceec6cfc1c0b79..d0ca98c3f9ea5c8cb1053da6b17e9a90
|
||||
if (blockEvent.isCancelled()) {
|
||||
// Let the client know the block still exists
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 592670a6ebaed9b42d76afe66264265fc0664934..cd237b81a09b89926b15460eccb503af5267eb34 100644
|
||||
index 5af62603415865068ca4b79a7e68d8eb813596b1..47a02b7786d284370d8019b07b8d85f895dc280a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -651,13 +651,13 @@ public class CraftEventFactory {
|
||||
@@ -650,13 +650,13 @@ public class CraftEventFactory {
|
||||
/**
|
||||
* BlockDamageEvent
|
||||
*/
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expand Pose API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 3ae2f450ac43c3752f779eeb40ec7761590f9e51..ad3cdb1a3ab07c48bf6b2662b93ddad5974db1a6 100644
|
||||
index 638aeef75dc5f7ab8b8e050118a7c709246a85f4..acf2cc8afaf4dee193ecf3bfc4a39b8c39ffc376 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -419,6 +419,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -421,6 +421,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@javax.annotation.Nullable
|
||||
private UUID originWorld;
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
@ -16,7 +16,7 @@ index 3ae2f450ac43c3752f779eeb40ec7761590f9e51..ad3cdb1a3ab07c48bf6b2662b93ddad5
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -631,6 +632,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -644,6 +645,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public void onClientRemoval() {}
|
||||
|
||||
public void setPose(net.minecraft.world.entity.Pose pose) {
|
||||
@ -25,7 +25,7 @@ index 3ae2f450ac43c3752f779eeb40ec7761590f9e51..ad3cdb1a3ab07c48bf6b2662b93ddad5
|
||||
if (pose == this.getPose()) {
|
||||
return;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index cbcfb0bc3a85b60e13014245f256e5c356b4b79b..6fcc7949351c5741908a0150498b811f57961899 100644
|
||||
index 96448895a0a18e6f819d0a2a629c04abd331fa85..d52b7c5739b8ea51cb91c45ddcad6237b9ce5a5e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -897,6 +897,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@ -10,7 +10,7 @@ public net.minecraft.world.level.dimension.end.EndDragonFight respawnCrystals
|
||||
public net.minecraft.world.level.dimension.end.EndDragonFight spawnNewGateway(Lnet/minecraft/core/BlockPos;)V
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index 8737501e14792de13adf95da24fa6177bfb77946..b9c85289776971f90eb5749262a9014befe465f7 100644
|
||||
index f6f5fad52e41d5ccc37dc28c40904fce014907fb..6b59c4b5906c0fb4fdbc674452c6ff3df42b099b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -439,6 +439,24 @@ public class EndDragonFight {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerPickItemEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index a580b36ae2dafc1b178fd2333afcc23e0691e5f2..6349ac2f093c067311efac06dd84c92996b1c64a 100644
|
||||
index b88d6230172311d92844a9621f2eb3be644ac2aa..88baa1235210553248a7fec765bd5ad660ad5295 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -907,8 +907,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -938,8 +938,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.disconnect("Invalid hotbar selection (Hacking?)", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
|
||||
return;
|
||||
}
|
||||
@ -28,10 +28,10 @@ index a580b36ae2dafc1b178fd2333afcc23e0691e5f2..6349ac2f093c067311efac06dd84c929
|
||||
this.player.connection.send(new ClientboundContainerSetSlotPacket(-2, 0, packet.getSlot(), this.player.getInventory().getItem(packet.getSlot())));
|
||||
this.player.connection.send(new ClientboundSetCarriedItemPacket(this.player.getInventory().selected));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
index 395cecc385e4126a7534ac9aeb15cf323efab03e..309acf7bd07e38043aa81e0e686edba1136bd04c 100644
|
||||
index 2c20441cce1e07239a65aadfb85004fcdf3672c8..1e77482a98869e464c1f0a873cff8febf7924c8c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -174,7 +174,13 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -171,7 +171,13 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
public void pickSlot(int slot) {
|
@ -5,13 +5,13 @@ Subject: [PATCH] Allow trident custom damage
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
|
||||
index 870db6ab82ef2ecb989342bb6a66435f823a9263..8ae7d62b72fb72d893e68b02b645d48374595ae6 100644
|
||||
index c75ac52f302e8e29e0bdea32c85ccf6713257a9b..3ff06cc6ad35567bcb1f29115db63c11a8e79dbb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
|
||||
@@ -37,10 +37,12 @@ public class ThrownTrident extends AbstractArrow {
|
||||
@@ -35,10 +35,12 @@ public class ThrownTrident extends AbstractArrow {
|
||||
|
||||
public ThrownTrident(EntityType<? extends ThrownTrident> type, Level world) {
|
||||
super(type, world, ThrownTrident.DEFAULT_ARROW_STACK);
|
||||
super(type, world);
|
||||
+ this.setBaseDamage(net.minecraft.world.item.TridentItem.BASE_DAMAGE); // Paper - Allow trident custom damage
|
||||
}
|
||||
|
||||
@ -21,12 +21,12 @@ index 870db6ab82ef2ecb989342bb6a66435f823a9263..8ae7d62b72fb72d893e68b02b645d483
|
||||
this.entityData.set(ThrownTrident.ID_LOYALTY, (byte) EnchantmentHelper.getLoyalty(stack));
|
||||
this.entityData.set(ThrownTrident.ID_FOIL, stack.hasFoil());
|
||||
}
|
||||
@@ -124,7 +126,7 @@ public class ThrownTrident extends AbstractArrow {
|
||||
@@ -128,7 +130,7 @@ public class ThrownTrident extends AbstractArrow {
|
||||
@Override
|
||||
protected void onHitEntity(EntityHitResult entityHitResult) {
|
||||
Entity entity = entityHitResult.getEntity();
|
||||
- float f = 8.0F;
|
||||
+ float f = (float) this.getBaseDamage(); // Paper - Allow trident custom damage
|
||||
|
||||
if (entity instanceof LivingEntity) {
|
||||
LivingEntity entityliving = (LivingEntity) entity;
|
||||
if (entity instanceof LivingEntity entityliving) {
|
||||
f += EnchantmentHelper.getDamageBonus(this.getPickupItemStackOrigin(), entityliving.getType());
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose hand in BlockCanBuildEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index 8c54b92b65b3d379e14a11370b09d45351ab22e1..e258e5915b286f1117bc1413dfd3d2a5c4655380 100644
|
||||
index 7180996027f70aef7afe32fb2adfce6431429401..fc7d978f9e57814a933b9cb725c3af1e7d403795 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -214,7 +214,7 @@ public class BlockItem extends Item {
|
||||
@@ -191,7 +191,7 @@ public class BlockItem extends Item {
|
||||
boolean defaultReturn = (!this.mustSurvive() || state.canSurvive(context.getLevel(), context.getClickedPos())) && world.checkEntityCollision(state, entityhuman, voxelshapecollision, context.getClickedPos(), true); // Paper - Cancel hit for vanished players
|
||||
org.bukkit.entity.Player player = (context.getPlayer() instanceof ServerPlayer) ? (org.bukkit.entity.Player) context.getPlayer().getBukkitEntity() : null;
|
||||
|
@ -14,10 +14,10 @@ ensure that the returned found structure (which may for example be a buried
|
||||
treasure that will be marked on a treasure map) is the same as in vanilla.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
index a7ac9a0c4966c2f9d2b325fa59e8792850d376e8..84a2a5384a8a31eff5363e6391c9a5187212ff36 100644
|
||||
index c4972e5767488878f7929226258c41c1cc30a47f..c9cd18ce79a6ee7297a8fd14f4dbe712570b3ced 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
@@ -260,12 +260,15 @@ public abstract class ChunkGenerator {
|
||||
@@ -266,12 +266,15 @@ public abstract class ChunkGenerator {
|
||||
int i1 = placement.spacing();
|
||||
|
||||
for (int j1 = -radius; j1 <= radius; ++j1) {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement OfflinePlayer#isConnected
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
index 96408d505ce80799868ff84554a3b0b25adabb22..4a875bce9563f3b9351ebecde9b0eb1287beb50e 100644
|
||||
index 4d654c4f0b6210a9841427789ba70ce5d1d308be..9d93130f23addb18b97d7f5ec013faef17a74529 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
|
||||
@@ -54,6 +54,13 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
||||
@ -23,10 +23,10 @@ index 96408d505ce80799868ff84554a3b0b25adabb22..4a875bce9563f3b9351ebecde9b0eb12
|
||||
public String getName() {
|
||||
Player player = this.getPlayer();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 2c7c39eab2bdbedf4aea903ba76f3289285bd7e7..3cbebe9a08a6f37c8716a71db9c34454025b458a 100644
|
||||
index 1d6ea70c8039b7dcae3742ce7ef6a52015d6bc52..b8999852f132ac25da3ddb5164c73c886a3fa572 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -243,6 +243,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -253,6 +253,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return this.server.getPlayer(this.getUniqueId()) != null;
|
||||
}
|
||||
|
||||
@ -39,4 +39,4 @@ index 2c7c39eab2bdbedf4aea903ba76f3289285bd7e7..3cbebe9a08a6f37c8716a71db9c34454
|
||||
+
|
||||
@Override
|
||||
public InetSocketAddress getAddress() {
|
||||
if (this.getHandle().connection == null) return null;
|
||||
if (this.getHandle().connection.protocol() == null) return null;
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix inventory desync
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index d1833dcc92b1570e62a1941bbea6d66ff0b2ee5f..5da7ffee71bf6d82a53b3c2f99e2bd898d0b1799 100644
|
||||
index b7cc2b5ee85e8e6a5c8cb8ce1f3c934773be32e6..7f93b60e9bdfc2739c77f4dfa69031fbe2097d65 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1336,6 +1336,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1464,6 +1464,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
// CraftBukkit start - fire PlayerLeashEntityEvent
|
||||
if (CraftEventFactory.callPlayerLeashEntityEvent(this, player, player, hand).isCancelled()) {
|
||||
((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(this, this.getLeashHolder()));
|
||||
@ -17,10 +17,10 @@ index d1833dcc92b1570e62a1941bbea6d66ff0b2ee5f..5da7ffee71bf6d82a53b3c2f99e2bd89
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index e258e5915b286f1117bc1413dfd3d2a5c4655380..8d2c0accadaf0c5d28e7db6e62a05f6c619cf02f 100644
|
||||
index fc7d978f9e57814a933b9cb725c3af1e7d403795..96fb69ec6db2e7c8c728435f0c537b076259b2fb 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -116,7 +116,7 @@ public class BlockItem extends Item {
|
||||
@@ -114,7 +114,7 @@ public class BlockItem extends Item {
|
||||
if (placeEvent != null && (placeEvent.isCancelled() || !placeEvent.canBuild())) {
|
||||
blockstate.update(true, false);
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add titleOverride to InventoryOpenEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 406794c439900a0d86fd4fe67d05a98bde625aec..2bb82dcffd8fdc25d658ec36a34f959b25217396 100644
|
||||
index c70e1a17d855f2a9d160e8cd15a6a4bcf39b8945..b2bf086506ba7eda6ba6912ebf51a9da154cd414 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1523,12 +1523,17 @@ public class ServerPlayer extends Player {
|
||||
@@ -1607,12 +1607,17 @@ public class ServerPlayer extends Player {
|
||||
this.nextContainerCounter();
|
||||
AbstractContainerMenu container = factory.createMenu(this.containerCounter, this.getInventory(), this);
|
||||
|
||||
@ -27,7 +27,7 @@ index 406794c439900a0d86fd4fe67d05a98bde625aec..2bb82dcffd8fdc25d658ec36a34f959b
|
||||
if (container == null && !cancelled) { // Let pre-cancelled events fall through
|
||||
// SPIGOT-5263 - close chest if cancelled
|
||||
if (factory instanceof Container) {
|
||||
@@ -1550,7 +1555,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -1634,7 +1639,7 @@ public class ServerPlayer extends Player {
|
||||
} else {
|
||||
// CraftBukkit start
|
||||
this.containerMenu = container;
|
||||
@ -37,10 +37,10 @@ index 406794c439900a0d86fd4fe67d05a98bde625aec..2bb82dcffd8fdc25d658ec36a34f959b
|
||||
this.initMenu(container);
|
||||
return OptionalInt.of(this.containerCounter);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
index 6a52789d6e68438c1eaa2fb9af591fa9e1d381e2..7984365c8290ac9e526a413b56e1c8c0841e330c 100644
|
||||
index 3d36d79a4e7f16f6face3465cdf54656984f3ebc..41f3cdec7deabf34358b8087df77169f85a5b919 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -360,12 +360,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
@@ -358,12 +358,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
Preconditions.checkArgument(windowType != null, "Unknown windowType");
|
||||
AbstractContainerMenu container = new CraftContainer(inventory, player, player.nextContainerCounter());
|
||||
|
||||
@ -58,7 +58,7 @@ index 6a52789d6e68438c1eaa2fb9af591fa9e1d381e2..7984365c8290ac9e526a413b56e1c8c0
|
||||
|
||||
//player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, CraftChatMessage.fromString(title)[0])); // Paper - comment
|
||||
if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen
|
||||
@@ -441,7 +445,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
@@ -439,7 +443,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
}
|
||||
|
||||
// Trigger an INVENTORY_OPEN event
|
||||
@ -70,7 +70,7 @@ index 6a52789d6e68438c1eaa2fb9af591fa9e1d381e2..7984365c8290ac9e526a413b56e1c8c0
|
||||
if (container == null) {
|
||||
return;
|
||||
}
|
||||
@@ -452,6 +459,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
@@ -450,6 +457,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
//String title = inventory.getTitle(); // Paper - comment
|
||||
net.kyori.adventure.text.Component adventure$title = inventory.title(); // Paper
|
||||
if (adventure$title == null) adventure$title = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(inventory.getTitle()); // Paper
|
||||
@ -79,10 +79,10 @@ index 6a52789d6e68438c1eaa2fb9af591fa9e1d381e2..7984365c8290ac9e526a413b56e1c8c0
|
||||
if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen
|
||||
player.containerMenu = container;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index cd237b81a09b89926b15460eccb503af5267eb34..53c3b2123d6fa78367aef53d6949e58170cb9fce 100644
|
||||
index 47a02b7786d284370d8019b07b8d85f895dc280a..eefdb3da069d9615db7c663bcf8a72b78a0e6817 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1389,10 +1389,21 @@ public class CraftEventFactory {
|
||||
@@ -1384,10 +1384,21 @@ public class CraftEventFactory {
|
||||
}
|
||||
|
||||
public static AbstractContainerMenu callInventoryOpenEvent(ServerPlayer player, AbstractContainerMenu container) {
|
||||
@ -105,7 +105,7 @@ index cd237b81a09b89926b15460eccb503af5267eb34..53c3b2123d6fa78367aef53d6949e581
|
||||
if (player.containerMenu != player.inventoryMenu) { // fire INVENTORY_CLOSE if one already open
|
||||
player.connection.handleContainerClose(new ServerboundContainerClosePacket(player.containerMenu.containerId), InventoryCloseEvent.Reason.OPEN_NEW); // Paper - Inventory close reason
|
||||
}
|
||||
@@ -1407,10 +1418,10 @@ public class CraftEventFactory {
|
||||
@@ -1402,10 +1413,10 @@ public class CraftEventFactory {
|
||||
|
||||
if (event.isCancelled()) {
|
||||
container.transferTo(player.containerMenu, craftPlayer);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user