666 plus 1
Dieser Commit ist enthalten in:
Ursprung
21afc0a2e2
Commit
1de0dc8828
@ -105,10 +105,10 @@ index 0000000000000000000000000000000000000000..a8e813ca89b033f061e695288b3383bd
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 236e73eed6caac7f98236ca418185a143f78c5fa..51337b1b2e74a67ad54c5d594004b649cb6af4ed 100644
|
||||
index 507cad6ef11603924389956305908fd157043178..aab59a42af04971b5be4b6295700a1c50e1c964f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -305,6 +305,7 @@ public final class CraftServer implements Server {
|
||||
@@ -307,6 +307,7 @@ public final class CraftServer implements Server {
|
||||
public int reloadCount;
|
||||
private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper
|
||||
public static Exception excessiveVelEx; // Paper - Velocity warnings
|
@ -5,10 +5,10 @@ Subject: [PATCH] Prevent AFK kick while watching end credits
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index cb7d038b902c326d2ebec61f1dc40849c3cfbc63..574efd531199332a36fb26c70cc44bd5a05ff37d 100644
|
||||
index cc45bb947fbd6f2b7a7bc11a2bc66336a7bf3c9e..0bb6b0b776f80040f901532fcf1052eeaed7bae4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -389,7 +389,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -403,7 +403,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
--this.dropSpamTickCount;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ Makes less git noise, as it won't update the date every single time
|
||||
Use -DPaper.skipServerPropertiesComments=true flag to disable writing it
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/Settings.java b/src/main/java/net/minecraft/server/dedicated/Settings.java
|
||||
index fc45c2c4ecdf3906df6bceaf3e019c462fe62186..61bf3ccf998bcb9ebd80e983566e7181a73f0e30 100644
|
||||
index 0ec3b546db0cf3858dd9cd9ea067d1d6713a8491..d7bd235ef2815890e038091dd625177049d253a5 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/Settings.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/Settings.java
|
||||
@@ -29,6 +29,7 @@ public abstract class Settings<T extends Settings<T>> {
|
@ -49,10 +49,10 @@ index a2d0699e8427b2262a2396495111125eccafbb66..15db9368227dbc29d07d74e85bd126b3
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index bb0a5e3cdfec18a71c30fde98d21affcd95a9885..3f4950e0c0525346a89c7402ea85edebc6b36698 100644
|
||||
index b9aadb3eea0a8910f58fa747c50959ebcf89292a..36e3676d4a0725d5b55388367152c13c078b6abd 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1307,7 +1307,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -1374,7 +1374,7 @@ public class ServerPlayer extends Player {
|
||||
} else if (this.bedBlocked(blockposition, enumdirection)) {
|
||||
return Either.left(Player.BedSleepingProblem.OBSTRUCTED);
|
||||
} else {
|
||||
@ -61,7 +61,7 @@ index bb0a5e3cdfec18a71c30fde98d21affcd95a9885..3f4950e0c0525346a89c7402ea85edeb
|
||||
if (this.level().isDay()) {
|
||||
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
|
||||
} else {
|
||||
@@ -2262,44 +2262,50 @@ public class ServerPlayer extends Player {
|
||||
@@ -2344,44 +2344,50 @@ public class ServerPlayer extends Player {
|
||||
return this.respawnForced;
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ index bb0a5e3cdfec18a71c30fde98d21affcd95a9885..3f4950e0c0525346a89c7402ea85edeb
|
||||
} else {
|
||||
this.respawnPosition = null;
|
||||
this.respawnDimension = Level.OVERWORLD;
|
||||
@@ -2307,6 +2313,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -2389,6 +2395,7 @@ public class ServerPlayer extends Player {
|
||||
this.respawnForced = false;
|
||||
}
|
||||
|
||||
@ -154,10 +154,10 @@ index bb0a5e3cdfec18a71c30fde98d21affcd95a9885..3f4950e0c0525346a89c7402ea85edeb
|
||||
|
||||
public SectionPos getLastSectionPos() {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 57e7ce227666a2e273c9e61a102152efd2c0ebd9..7cd6d91fe154d29ec0b0fc0a5a50713bbc2c1c83 100644
|
||||
index 6cc5bca80cdf1f70c5599026483625ef6c1b2bd9..a476762125f5f7b6fbda37837b50880d415b25c6 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -871,7 +871,7 @@ public abstract class PlayerList {
|
||||
@@ -870,7 +870,7 @@ public abstract class PlayerList {
|
||||
location = CraftLocation.toBukkit(vec3d, worldserver1.getWorld(), f1, 0.0F);
|
||||
} else if (blockposition != null) {
|
||||
entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F));
|
||||
@ -167,10 +167,10 @@ index 57e7ce227666a2e273c9e61a102152efd2c0ebd9..7cd6d91fe154d29ec0b0fc0a5a50713b
|
||||
}
|
||||
|
||||
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 ecaa7f0b2bf795f16187f11fa27f6d5d435ccbfe..acd5ec218b8d4c096f44ae2eec1379eeaf30ddc5 100644
|
||||
index e18726915d1491d74084827afd9978800aecb644..a4a90df0b500fb440226b07462faaa87594b12a5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
@@ -87,9 +87,14 @@ public class RespawnAnchorBlock extends Block {
|
||||
@@ -89,9 +89,14 @@ public class RespawnAnchorBlock extends Block {
|
||||
ServerPlayer entityplayer = (ServerPlayer) player;
|
||||
|
||||
if (entityplayer.getRespawnDimension() != world.dimension() || !pos.equals(entityplayer.getRespawnPosition())) {
|
||||
@ -187,10 +187,10 @@ index ecaa7f0b2bf795f16187f11fa27f6d5d435ccbfe..acd5ec218b8d4c096f44ae2eec1379ee
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 423e599e703723ce038c85c5d42e18a633e130f5..b522a5353cef252fa9040b81c9f012228d334e8f 100644
|
||||
index 5a1d8386e12842f36c07dac6211f961c95ecd8ee..81060ef3c9ba90a5bd3ecda65a0e1ac02ce5a9ce 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1323,9 +1323,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1399,9 +1399,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@Override
|
||||
public void setRespawnLocation(Location location, boolean override) {
|
||||
if (location == null) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Make hoppers respect inventory max stack size
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index f0b4b8eb5d2740cd73b4338fd0c2acc3b06df1f6..e3b6f2bf93710ea695b0c25c0b6968a8f24f0829 100644
|
||||
index 4e9113b704599fb2130d866dd4106053da4cf524..43ee9017fbbe0a5485a281712f76c23b059a849b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -438,15 +438,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -485,15 +485,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
// Spigot start - SPIGOT-6693, InventorySubcontainer#setItem
|
@ -5,10 +5,10 @@ Subject: [PATCH] Optimize entity tracker passenger checks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index e324c41947b823bba04e3da157e5be7a74d9f099..36e87e8650bef90fab47c4156ce12315f45b2241 100644
|
||||
index 002c73c7dc7c72968ed8692a67e1bce4236f7214..56408fa2603137819f47e7bd9b53b0b5f647edd6 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -79,7 +79,7 @@ public class ServerEntity {
|
||||
@@ -83,7 +83,7 @@ public class ServerEntity {
|
||||
this.trackedPlayers = trackedPlayers;
|
||||
// CraftBukkit end
|
||||
this.ap = Vec3.ZERO;
|
@ -5,10 +5,10 @@ Subject: [PATCH] Config option for Piglins guarding chests
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
||||
index 4a071dea48e86a962fd41a6ebecc5dfdaf9df78a..9d905ba5c306409ff846f93e3569d1e4c3c6bbf7 100644
|
||||
index 31bb652c7ef35e7d61df2b1b60589fbb5c845bb0..96d8f0fea969fa14bae77afc60c6a64032ca4957 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
||||
@@ -478,6 +478,7 @@ public class PiglinAi {
|
||||
@@ -476,6 +476,7 @@ public class PiglinAi {
|
||||
}
|
||||
|
||||
public static void angerNearbyPiglins(Player player, boolean blockOpen) {
|
@ -5,19 +5,19 @@ Subject: [PATCH] Add EntityDamageItemEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 9d2d305a5e66b9f3d94f6464736f5bb40adae591..d5ee83e6538fbd067388272fa9895e17859be642 100644
|
||||
index a80f09d61b3b0d8bc5c5bec7c9df17327bd94b57..29a463ebceabf2d7ae22c26178f969cf1c1e5a21 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -624,7 +624,7 @@ public final class ItemStack {
|
||||
return this.getItem().getMaxDamage();
|
||||
@@ -639,7 +639,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
return (Integer) this.getOrDefault(DataComponents.MAX_DAMAGE, 0);
|
||||
}
|
||||
|
||||
- public boolean hurt(int amount, RandomSource random, @Nullable ServerPlayer player) {
|
||||
+ public boolean hurt(int amount, RandomSource random, @Nullable LivingEntity player) { // Paper - Add EntityDamageItemEvent
|
||||
if (!this.isDamageableItem()) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -642,8 +642,8 @@ public final class ItemStack {
|
||||
- public void hurtAndBreak(int amount, RandomSource random, @Nullable ServerPlayer player, Runnable breakCallback) {
|
||||
+ public void hurtAndBreak(int amount, RandomSource random, @Nullable LivingEntity player, Runnable breakCallback) { // Paper - Add EntityDamageItemEvent
|
||||
if (this.isDamageableItem()) {
|
||||
int j;
|
||||
|
||||
@@ -655,8 +655,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
|
||||
amount -= k;
|
||||
// CraftBukkit start
|
||||
@ -28,7 +28,7 @@ index 9d2d305a5e66b9f3d94f6464736f5bb40adae591..d5ee83e6538fbd067388272fa9895e17
|
||||
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (amount != event.getDamage() || event.isCancelled()) {
|
||||
@@ -654,6 +654,14 @@ public final class ItemStack {
|
||||
@@ -667,6 +667,14 @@ public final class ItemStack implements DataComponentHolder {
|
||||
}
|
||||
|
||||
amount = event.getDamage();
|
||||
@ -43,7 +43,7 @@ index 9d2d305a5e66b9f3d94f6464736f5bb40adae591..d5ee83e6538fbd067388272fa9895e17
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (amount <= 0) {
|
||||
@@ -661,8 +669,8 @@ public final class ItemStack {
|
||||
@@ -674,8 +682,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,12 +54,12 @@ index 9d2d305a5e66b9f3d94f6464736f5bb40adae591..d5ee83e6538fbd067388272fa9895e17
|
||||
}
|
||||
|
||||
j = this.getDamageValue() + amount;
|
||||
@@ -674,7 +682,7 @@ public final class ItemStack {
|
||||
public <T extends LivingEntity> void hurtAndBreak(int amount, T entity, Consumer<T> breakCallback) {
|
||||
if (!entity.level().isClientSide && (!(entity instanceof net.minecraft.world.entity.player.Player) || !((net.minecraft.world.entity.player.Player) entity).getAbilities().instabuild)) {
|
||||
if (this.isDamageableItem()) {
|
||||
- if (this.hurt(amount, entity.getRandom(), entity instanceof ServerPlayer ? (ServerPlayer) entity : null)) {
|
||||
+ if (this.hurt(amount, entity.getRandom(), entity /*instanceof ServerPlayer ? (ServerPlayer) entity : null*/)) { // Paper - Add EntityDamageItemEvent
|
||||
breakCallback.accept(entity);
|
||||
Item item = this.getItem();
|
||||
// CraftBukkit start - Check for item breaking
|
||||
@@ -708,7 +716,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
entityplayer = null;
|
||||
}
|
||||
|
||||
- this.hurtAndBreak(amount, randomsource, entityplayer, () -> {
|
||||
+ this.hurtAndBreak(amount, randomsource, entity, () -> { // Paper - Add EntityDamageItemEvent
|
||||
entity.broadcastBreakEvent(slot);
|
||||
Item item = this.getItem();
|
||||
// CraftBukkit start - Check for item breaking
|
@ -5,10 +5,10 @@ Subject: [PATCH] Optimize indirect passenger iteration
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 53e2ca6ddba4936a7387e07a2aae4c282a305222..04f901236a5b9ca59ba45a5bac69ba89fc767679 100644
|
||||
index aac47d2de2825b46e54ad936a48c96ef7f6703e1..66ddae628d8ccce62aa6937166d719911aef44a2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3842,20 +3842,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -3870,20 +3870,34 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
private Stream<Entity> getIndirectPassengersStream() {
|
||||
@ -43,7 +43,7 @@ index 53e2ca6ddba4936a7387e07a2aae4c282a305222..04f901236a5b9ca59ba45a5bac69ba89
|
||||
return () -> {
|
||||
return this.getIndirectPassengersStream().iterator();
|
||||
};
|
||||
@@ -3868,6 +3882,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -3896,6 +3910,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public boolean hasExactlyOnePlayerPassenger() {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Configurable item frame map cursor update interval
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 36e87e8650bef90fab47c4156ce12315f45b2241..91563f903834c1a0636dc087f8c6376815165b6c 100644
|
||||
index 56408fa2603137819f47e7bd9b53b0b5f647edd6..19a7d0ab2ee5494149dfb0503b7c69784b7bee8b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -117,7 +117,7 @@ public class ServerEntity {
|
||||
@ -14,6 +14,6 @@ index 36e87e8650bef90fab47c4156ce12315f45b2241..91563f903834c1a0636dc087f8c63768
|
||||
|
||||
- if (this.tickCount % 10 == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks
|
||||
+ 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);
|
||||
MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level);
|
||||
MapId mapid = (MapId) itemstack.get(DataComponents.MAP_ID);
|
||||
MapItemSavedData worldmap = MapItem.getSavedData(mapid, this.level);
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Clear bucket NBT after dispense
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
index c1c57f24ccfa7bd17541f53d02293db0bce8dc5c..829c72333664da0c06ce04af93ea39bb90ce0b67 100644
|
||||
index dc68ade2ed576020a4a40608243059d6d9d82f19..f880f9faa1e5660853f28c0e2daf4ab6bc6a55fd 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
@@ -656,8 +656,7 @@ public interface DispenseItemBehavior {
|
||||
@@ -444,8 +444,7 @@ public interface DispenseItemBehavior {
|
||||
Item item = Items.BUCKET;
|
||||
stack.shrink(1);
|
||||
if (stack.isEmpty()) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Change EnderEye target without changing other things
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EyeOfEnder.java b/src/main/java/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
||||
index 305e92007fa2466f9aa7be8b9224dcc04d20120f..d06a02f1868b911721477c149f1b321979d8d178 100644
|
||||
index 8b0ccd1aa0f2f1d2326c6071f16e641afc101751..fca3786d0a3f99a3e61e7a4b2251361276eff9d7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/EyeOfEnder.java
|
||||
@@ -73,6 +73,11 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
||||
@@ -69,6 +69,11 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
||||
}
|
||||
|
||||
public void signalTo(BlockPos pos) {
|
||||
@ -20,7 +20,7 @@ index 305e92007fa2466f9aa7be8b9224dcc04d20120f..d06a02f1868b911721477c149f1b3219
|
||||
double d0 = (double) pos.getX();
|
||||
int i = pos.getY();
|
||||
double d1 = (double) pos.getZ();
|
||||
@@ -90,8 +95,10 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
||||
@@ -86,8 +91,10 @@ public class EyeOfEnder extends Entity implements ItemSupplier {
|
||||
this.tz = d1;
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockBreakBlockEvent
|
||||
|
||||
|
||||
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 89a62fbeeb78c864938a1cea84178478c6dc1b34..57d92c1785586dfab2b3934733d8ba253e042e2e 100644
|
||||
index ed336112581ac77196ed3e60dc8aaf50312c078b..c09851136944bd58d82b3a9d19719b0354802824 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -314,6 +314,24 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -306,6 +306,24 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
|
||||
}
|
||||
|
||||
@ -34,20 +34,20 @@ index 89a62fbeeb78c864938a1cea84178478c6dc1b34..57d92c1785586dfab2b3934733d8ba25
|
||||
if (world instanceof ServerLevel) {
|
||||
Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool).forEach((itemstack1) -> {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||
index 3ae61e7b50bfc440c597f88843f92903f8a66801..0dbdcd443fe8a299119ea5ba3acb1a0412856184 100644
|
||||
index 4aa34b7df734bb755906b228e0df9eb629569ea0..2f2c9fb65d4cc8bd40303216e03c5c1956305ff4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
|
||||
@@ -402,7 +402,7 @@ public class PistonBaseBlock extends DirectionalBlock {
|
||||
@@ -403,7 +403,7 @@ public class PistonBaseBlock extends DirectionalBlock {
|
||||
iblockdata1 = world.getBlockState(blockposition3);
|
||||
BlockEntity tileentity = iblockdata1.hasBlockEntity() ? world.getBlockEntity(blockposition3) : null;
|
||||
|
||||
- dropResources(iblockdata1, world, blockposition3, tileentity);
|
||||
+ dropResources(iblockdata1, world, blockposition3, tileentity, pos); // Paper - Add BlockBreakBlockEvent
|
||||
world.setBlock(blockposition3, Blocks.AIR.defaultBlockState(), 18);
|
||||
world.gameEvent(GameEvent.BLOCK_DESTROY, blockposition3, GameEvent.Context.of(iblockdata1));
|
||||
world.gameEvent((Holder) GameEvent.BLOCK_DESTROY, blockposition3, GameEvent.Context.of(iblockdata1));
|
||||
if (!iblockdata1.is(BlockTags.FIRE)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
index 0aeb9faa1ce22359361741a591aa3d465d955970..a98ab20814cc29a25e9d29adfbb7e70d46768df2 100644
|
||||
index 3a2ae2bca410708736da64560e74b8010444f2dc..1c0712295695727ee9c4d430d4157b8e17cbd71f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -295,7 +295,7 @@ public abstract class FlowingFluid extends Fluid {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Option to prevent NBT copy in smithing recipes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/SmithingTransformRecipe.java b/src/main/java/net/minecraft/world/item/crafting/SmithingTransformRecipe.java
|
||||
index 566b588006da2b46ec1727be85560ccd59c42c6f..67f7eb89570934b73ff5b894ae3e89fdb874b923 100644
|
||||
index c6c6d54f35dd75e14a6e040d730d5ae9c1406059..3448bd7882edde4ba76ba8b592b6003009aa5f02 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/SmithingTransformRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/SmithingTransformRecipe.java
|
||||
@@ -23,8 +23,15 @@ public class SmithingTransformRecipe implements SmithingRecipe {
|
||||
@ -24,21 +24,17 @@ index 566b588006da2b46ec1727be85560ccd59c42c6f..67f7eb89570934b73ff5b894ae3e89fd
|
||||
this.template = template;
|
||||
this.base = base;
|
||||
this.addition = addition;
|
||||
@@ -39,11 +46,13 @@ public class SmithingTransformRecipe implements SmithingRecipe {
|
||||
@Override
|
||||
public ItemStack assemble(Container inventory, RegistryAccess registryManager) {
|
||||
ItemStack itemstack = this.result.copy();
|
||||
@@ -40,7 +47,9 @@ public class SmithingTransformRecipe implements SmithingRecipe {
|
||||
public ItemStack assemble(Container inventory, HolderLookup.Provider lookup) {
|
||||
ItemStack itemstack = inventory.getItem(1).transmuteCopy(this.result.getItem(), this.result.getCount());
|
||||
|
||||
+ if (this.copyNBT) { // Paper - Option to prevent NBT copy
|
||||
CompoundTag nbttagcompound = inventory.getItem(1).getTag();
|
||||
|
||||
if (nbttagcompound != null) {
|
||||
itemstack.setTag(nbttagcompound.copy());
|
||||
}
|
||||
itemstack.applyComponents(this.result.getComponentsPatch());
|
||||
+ } // Paper - Option to prevent NBT copy
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
@@ -83,7 +92,7 @@ public class SmithingTransformRecipe implements SmithingRecipe {
|
||||
|
||||
@@ -79,7 +88,7 @@ public class SmithingTransformRecipe implements SmithingRecipe {
|
||||
public Recipe toBukkitRecipe(NamespacedKey id) {
|
||||
CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
|
||||
@ -48,10 +44,10 @@ index 566b588006da2b46ec1727be85560ccd59c42c6f..67f7eb89570934b73ff5b894ae3e89fd
|
||||
return recipe;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/SmithingTrimRecipe.java b/src/main/java/net/minecraft/world/item/crafting/SmithingTrimRecipe.java
|
||||
index e0b24c140e04a159a7b8aaef64ab94e19fc03dfd..a3686cede266c0205247abcec3ce082ae4a048a0 100644
|
||||
index f1207df56718ad2a62fb7d567b397ceaa668e1e7..1206a581b5b10ee67411551be359a90b1078c9b8 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/SmithingTrimRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/SmithingTrimRecipe.java
|
||||
@@ -29,8 +29,15 @@ public class SmithingTrimRecipe implements SmithingRecipe {
|
||||
@@ -31,8 +31,15 @@ public class SmithingTrimRecipe implements SmithingRecipe {
|
||||
final Ingredient template;
|
||||
final Ingredient base;
|
||||
final Ingredient addition;
|
||||
@ -67,16 +63,16 @@ index e0b24c140e04a159a7b8aaef64ab94e19fc03dfd..a3686cede266c0205247abcec3ce082a
|
||||
this.template = template;
|
||||
this.base = base;
|
||||
this.addition = addition;
|
||||
@@ -56,7 +63,7 @@ public class SmithingTrimRecipe implements SmithingRecipe {
|
||||
@@ -58,7 +65,7 @@ public class SmithingTrimRecipe implements SmithingRecipe {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
- ItemStack itemstack1 = itemstack.copy();
|
||||
+ ItemStack itemstack1 = this.copyNbt ? itemstack.copy() : new ItemStack(itemstack.getItem(), itemstack.getCount()); // Paper - Option to prevent NBT copy
|
||||
- ItemStack itemstack1 = itemstack.copyWithCount(1);
|
||||
+ ItemStack itemstack1 = this.copyNbt ? itemstack.copyWithCount(1) : new ItemStack(itemstack.getItem(), 1); // Paper - Option to prevent NBT copy
|
||||
|
||||
itemstack1.setCount(1);
|
||||
ArmorTrim armortrim = new ArmorTrim((Holder) optional.get(), (Holder) optional1.get());
|
||||
@@ -116,7 +123,7 @@ public class SmithingTrimRecipe implements SmithingRecipe {
|
||||
itemstack1.set(DataComponents.TRIM, new ArmorTrim((Holder) optional.get(), (Holder) optional1.get()));
|
||||
return itemstack1;
|
||||
@@ -109,7 +116,7 @@ public class SmithingTrimRecipe implements SmithingRecipe {
|
||||
// CraftBukkit start
|
||||
@Override
|
||||
public Recipe toBukkitRecipe(NamespacedKey id) {
|
@ -44,10 +44,10 @@ index 0000000000000000000000000000000000000000..0b42306f17bf8850a13a51067c2d19e7
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
||||
index 7f5d930b6bfaf9a0042f9be4be68f2cc111b304e..63f6b97d82c8b98eb1379b5c30f6c75eb22f7c23 100644
|
||||
index 2789d29f5be041a550618d455bb8912ee5162663..0842a69d711a4e4e3a653e5d1967d44fd31e5829 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
||||
@@ -5,7 +5,7 @@ import org.bukkit.World;
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.block.CommandBlock;
|
||||
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
|
||||
@ -56,7 +56,7 @@ index 7f5d930b6bfaf9a0042f9be4be68f2cc111b304e..63f6b97d82c8b98eb1379b5c30f6c75e
|
||||
|
||||
public CraftCommandBlock(World world, CommandBlockEntity tileEntity) {
|
||||
super(world, tileEntity);
|
||||
@@ -50,5 +50,10 @@ public class CraftCommandBlock extends CraftBlockEntityState<CommandBlockEntity>
|
||||
@@ -56,5 +56,10 @@ public class CraftCommandBlock extends CraftBlockEntityState<CommandBlockEntity>
|
||||
public void name(net.kyori.adventure.text.Component name) {
|
||||
getSnapshot().getCommandBlock().setName(name == null ? net.minecraft.network.chat.Component.literal("@") : io.papermc.paper.adventure.PaperAdventure.asVanilla(name));
|
||||
}
|
||||
@ -68,7 +68,7 @@ index 7f5d930b6bfaf9a0042f9be4be68f2cc111b304e..63f6b97d82c8b98eb1379b5c30f6c75e
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java
|
||||
index 92e21126a9347f1ee2279ab09bb6abf2344ad2e2..0ee159d488b15e571f9b19ec852fe279755696fa 100644
|
||||
index 9ea1537408ff2d790747b6e5a681d9171a4233ae..f34fa6715e477936097367a7aefd1a2bf87d3d90 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java
|
||||
@@ -13,7 +13,7 @@ import org.bukkit.permissions.PermissionAttachment;
|
@ -8,6 +8,37 @@ public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations
|
||||
public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations toBukkitSlot(Lnet/minecraft/world/scores/DisplaySlot;)Lorg/bukkit/scoreboard/DisplaySlot;
|
||||
public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations fromBukkitSlot(Lorg/bukkit/scoreboard/DisplaySlot;)Lnet/minecraft/world/scores/DisplaySlot;
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java b/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java
|
||||
index 71e79ad334a658324058c68284eaf3e55da411a6..8b87c178b17b6d1f9723b2d8d24fa99cb8d80782 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java
|
||||
@@ -24,6 +24,7 @@ public class FieldRename {
|
||||
}
|
||||
|
||||
return switch (owner) {
|
||||
+ case "org/bukkit/scoreboard/DisplaySlot" -> FieldRename.convertDisplaySlot(apiVersion, from); // Paper - DisplaySlot
|
||||
case "org/bukkit/block/banner/PatternType" -> FieldRename.convertPatternTypeName(apiVersion, from);
|
||||
case "org/bukkit/enchantments/Enchantment" -> FieldRename.convertEnchantmentName(apiVersion, from);
|
||||
case "org/bukkit/block/Biome" -> FieldRename.convertBiomeName(apiVersion, from);
|
||||
@@ -38,6 +39,18 @@ public class FieldRename {
|
||||
};
|
||||
}
|
||||
|
||||
+ // Paper start - DisplaySlot
|
||||
+ private static final FieldRenameData DISPLAY_SLOT_DATA = FieldRenameData.Builder.newBuilder()
|
||||
+ .forAllVersions()
|
||||
+ .change("SIDEBAR_TEAM_", "SIDEBAR_")
|
||||
+ .build();
|
||||
+
|
||||
+ @DoNotReroute
|
||||
+ public static String convertDisplaySlot(ApiVersion version, String from) {
|
||||
+ return FieldRename.DISPLAY_SLOT_DATA.getReplacement(version, from);
|
||||
+ }
|
||||
+ // Paper end - DisplaySlot
|
||||
+
|
||||
// PatternType
|
||||
private static final FieldRenameData PATTERN_TYPE_DATA = FieldRenameData.Builder.newBuilder()
|
||||
.forVersionsBefore(ApiVersion.FIELD_NAME_PARITY)
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java
|
||||
index 73c5ffff70605b32188a9bb5fb6c0ee04cb66efe..711d227f5ee6d63356a94a0567968da48e9f284c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java
|
||||
@ -51,26 +82,6 @@ index 73c5ffff70605b32188a9bb5fb6c0ee04cb66efe..711d227f5ee6d63356a94a0567968da4
|
||||
return net.minecraft.world.scores.DisplaySlot.CODEC.byName(CraftScoreboardTranslations.SLOTS.get(slot));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 31714ce05b1023b82e96b36ba52254b4e3e948f2..a06352499b9f2c6fb84e585459077b4aa1886d6f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -217,6 +217,15 @@ public class Commodore {
|
||||
desc = getOriginalOrRewrite(desc);
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
+ // Paper start - DisplaySlot
|
||||
+ if (owner.equals("org/bukkit/scoreboard/DisplaySlot")) {
|
||||
+ if (name.startsWith("SIDEBAR_") && !name.startsWith("SIDEBAR_TEAM_")) {
|
||||
+ super.visitFieldInsn(opcode, owner, name.replace("SIDEBAR_", "SIDEBAR_TEAM_"), desc);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - DisplaySlot
|
||||
if (owner.equals("org/bukkit/block/Biome")) {
|
||||
switch (name) {
|
||||
case "NETHER":
|
||||
diff --git a/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..69c9678f8218c240be1044eeabe1c6bef7747b1e
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add back EntityPortalExitEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 04f901236a5b9ca59ba45a5bac69ba89fc767679..11985b5c0e48178a7f995dfc35dd27a172261f1c 100644
|
||||
index 66ddae628d8ccce62aa6937166d719911aef44a2..dd353bad7ddf7c1e4bbc37ed3724d73696f7b8a7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3291,6 +3291,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -3307,6 +3307,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
} else {
|
||||
// CraftBukkit start
|
||||
worldserver = shapedetectorshape.world;
|
||||
@ -37,7 +37,7 @@ index 04f901236a5b9ca59ba45a5bac69ba89fc767679..11985b5c0e48178a7f995dfc35dd27a1
|
||||
if (worldserver == this.level) {
|
||||
// SPIGOT-6782: Just move the entity if a plugin changed the world to the one the entity is already in
|
||||
this.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, shapedetectorshape.xRot);
|
||||
@@ -3310,8 +3332,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -3326,8 +3348,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
if (entity != null) {
|
||||
entity.restoreFrom(this);
|
@ -7,10 +7,10 @@ Subject: [PATCH] Add methods to find targets for lightning strikes
|
||||
public net.minecraft.server.level.ServerLevel findLightningRod(Lnet/minecraft/core/BlockPos;)Ljava/util/Optional;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 60590ee30d2ff3b94c796bae2d7e9d9bc145fc0d..14b3edc05a04f5049f994df5be68e4f01e8cf1ef 100644
|
||||
index e42d40654a2bb66c277daa36ee08b56696b8c6a4..a2a0bbe77db3bba2da40236346a5700266b61e0c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -757,6 +757,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -763,6 +763,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
protected BlockPos findLightningTargetAround(BlockPos pos) {
|
||||
@ -22,7 +22,7 @@ index 60590ee30d2ff3b94c796bae2d7e9d9bc145fc0d..14b3edc05a04f5049f994df5be68e4f0
|
||||
BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos);
|
||||
Optional<BlockPos> optional = this.findLightningRod(blockposition1);
|
||||
|
||||
@@ -771,6 +776,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -777,6 +782,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
if (!list.isEmpty()) {
|
||||
return ((LivingEntity) list.get(this.random.nextInt(list.size()))).blockPosition();
|
||||
} else {
|
||||
@ -31,7 +31,7 @@ index 60590ee30d2ff3b94c796bae2d7e9d9bc145fc0d..14b3edc05a04f5049f994df5be68e4f0
|
||||
blockposition1 = blockposition1.above(2);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 95a5f2ef87252ab3fb684d1e04e2a3d05a3aa4bb..6d74a3a43aee0f7ba4c109bd2443c5fcd950fa54 100644
|
||||
index 28c027db9f017c35bfc0407dd1bd46fa685f58fd..8410d9ecc722475fceb248df1855841afd7cffc8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -687,6 +687,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@ -81,10 +81,10 @@ index 0000000000000000000000000000000000000000..68044b8439c302114240d0ae4da93ab3
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 31898e8425c524277bd07b139a898fe5f9fe344d..445e87a4cc7a1b6c38a4cbf2212ebddbc3496d12 100644
|
||||
index 81e4ba5afba072f0a3b139538e2b146b9bafad6a..4b01afda33e05a10fbdd588b4637ecead9b4da61 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -581,6 +581,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -578,6 +578,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public int getProtocolVersion() {
|
||||
return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion();
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Left handed API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
index ae430c36ed433e337dd92f197f1717fbf00ac0e1..ad293ad9d5dcd7836a4fa29b4b687346e3ae516c 100644
|
||||
index fb29afb6517b009b81285adc9e6dca2eb7f74aee..921594a78ea511337434b29b5bc1a037eb30992c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
||||
@@ -147,6 +147,16 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||
@@ -144,6 +144,16 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
||||
public int getMaxHeadPitch() {
|
||||
return getHandle().getMaxHeadXRot();
|
||||
}
|
@ -84,10 +84,10 @@ index 0000000000000000000000000000000000000000..adac21ce6db3ff7a56dbcd6bffc02143
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/advancements/DisplayInfo.java b/src/main/java/net/minecraft/advancements/DisplayInfo.java
|
||||
index 3751b43469e92b8a3d70ec3d5413bc1571147e6e..8057d42f2484bca8e5555e3010c27b898c4245b5 100644
|
||||
index 05de12414a3ad1c8f0f02f7973898dda84b89b82..6581cdbec730d5d184566e7b611369b3c424fecf 100644
|
||||
--- a/src/main/java/net/minecraft/advancements/DisplayInfo.java
|
||||
+++ b/src/main/java/net/minecraft/advancements/DisplayInfo.java
|
||||
@@ -34,6 +34,7 @@ public class DisplayInfo {
|
||||
@@ -37,6 +37,7 @@ public class DisplayInfo {
|
||||
private final boolean hidden;
|
||||
private float x;
|
||||
private float y;
|
||||
@ -164,24 +164,16 @@ index 8ca86852319d7463f60832bc98b825b0b4325995..62ada73302c6b3ce3fb2dcc8c31a1d9c
|
||||
|
||||
private final DisplayInfo handle;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index a06352499b9f2c6fb84e585459077b4aa1886d6f..6d6a7abe1aa39a2e4ecf3ac5f55b1f227e1a9db9 100644
|
||||
index 6b4d696dc9f718fecfdba9b1091630d7ac6bd18a..e495b2ce1f129172314178222de9bba7bfe56572 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -56,6 +56,7 @@ public class Commodore {
|
||||
);
|
||||
|
||||
// Paper start - Plugin rewrites
|
||||
+ private static final String CB_PACKAGE = org.bukkit.Bukkit.getServer().getClass().getPackageName().replace('.', '/');
|
||||
private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap();
|
||||
private static Map<String, String> initReplacementsMap() {
|
||||
Map<String, String> getAndRemove = new HashMap<>();
|
||||
@@ -388,6 +389,11 @@ public class Commodore {
|
||||
@@ -368,6 +368,11 @@ public class Commodore {
|
||||
super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf);
|
||||
return;
|
||||
}
|
||||
+ if (owner.equals("org/bukkit/advancement/Advancement") && name.equals("getDisplay") && desc.endsWith(")Lorg/bukkit/advancement/AdvancementDisplay;")) {
|
||||
+ super.visitTypeInsn(Opcodes.CHECKCAST, CB_PACKAGE + "/advancement/CraftAdvancement");
|
||||
+ super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE + "/advancement/CraftAdvancement", "getDisplay0", desc, false);
|
||||
+ super.visitTypeInsn(Opcodes.CHECKCAST, CB_PACKAGE_PREFIX + "advancement/CraftAdvancement");
|
||||
+ super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE_PREFIX + "advancement/CraftAdvancement", "getDisplay0", desc, false);
|
||||
+ return;
|
||||
+ }
|
||||
// Paper end
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add ItemFactory#getSpawnEgg API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index 12f90520e4d6d5fcea0c2f8e19dad9102970cd99..ef0c6e04a89704688f7b5461b27c0036abbf647d 100644
|
||||
index 3ebba8af1cf2d2eaf6670860b011c7dc1da62890..acf57732dd902bd23166e60788477b69e023cb35 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -564,4 +564,19 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -574,4 +574,19 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
new net.md_5.bungee.api.chat.TextComponent(customName));
|
||||
}
|
||||
// Paper end - bungee hover events
|
||||
@ -29,10 +29,10 @@ index 12f90520e4d6d5fcea0c2f8e19dad9102970cd99..ef0c6e04a89704688f7b5461b27c0036
|
||||
+ // Paper end - old getSpawnEgg API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 6d6a7abe1aa39a2e4ecf3ac5f55b1f227e1a9db9..010014c06fcea7d603160928f124f54d6e5e63d8 100644
|
||||
index e495b2ce1f129172314178222de9bba7bfe56572..0542b72550ee92293b2b8fdb8a19bea6f8633030 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -396,6 +396,15 @@ public class Commodore {
|
||||
@@ -375,6 +375,15 @@ public class Commodore {
|
||||
}
|
||||
// Paper end
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add critical damage API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
index e055106c50944c9a23bc59fe23f58a62c5deb7e4..8187feffe52efa5c887f1910e581a37c6e439401 100644
|
||||
index 435490f2931dae9d4fc5adb713c47a962684eeb5..ec52c7a75d9988475fbb4fe12ef7f4489ef3d894 100644
|
||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -234,4 +234,18 @@ public class DamageSource {
|
||||
@@ -238,4 +238,18 @@ public class DamageSource {
|
||||
public Holder<DamageType> typeHolder() {
|
||||
return this.type;
|
||||
}
|
||||
@ -28,53 +28,53 @@ index e055106c50944c9a23bc59fe23f58a62c5deb7e4..8187feffe52efa5c887f1910e581a37c
|
||||
+ // Paper end - add critical damage API
|
||||
}
|
||||
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 4d967016ac34d21161f10217db494f5bb537bd07..cb91111c1ae1cfbf256ba09f76ce0b0c8fc91f32 100644
|
||||
index 44e2a0f36359ab914c9328b633dd8a360591751d..c3fc0adeafbebaaaab8c155df9829f488e41d8ab 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1257,7 +1257,7 @@ public abstract class Player extends LivingEntity {
|
||||
flag1 = true;
|
||||
}
|
||||
@@ -1274,7 +1274,7 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
|
||||
- boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity;
|
||||
+ boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; // Paper - Add critical damage API; diff on change
|
||||
f += this.getItemInHand(InteractionHand.MAIN_HAND).getItem().getAttackDamageBonus(this, f);
|
||||
- boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting();
|
||||
+ boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting(); // Paper - Add critical damage API; diff on change
|
||||
|
||||
flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
|
||||
flag2 = flag2 && !this.isSprinting();
|
||||
@@ -1297,7 +1297,7 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
|
||||
if (flag2) {
|
||||
@@ -1313,7 +1313,7 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
|
||||
Vec3 vec3d = target.getDeltaMovement();
|
||||
- boolean flag5 = target.hurt(this.damageSources().playerAttack(this), f);
|
||||
+ boolean flag5 = target.hurt(this.damageSources().playerAttack(this).critical(flag2), f); // Paper - add critical damage API
|
||||
Vec3 vec3d = target.getDeltaMovement();
|
||||
- boolean flag5 = target.hurt(this.damageSources().playerAttack(this), f);
|
||||
+ boolean flag5 = target.hurt(this.damageSources().playerAttack(this).critical(flag2), f); // Paper - add critical damage API
|
||||
|
||||
if (flag5) {
|
||||
if (i > 0) {
|
||||
@@ -1325,7 +1325,7 @@ public abstract class Player extends LivingEntity {
|
||||
if (flag5) {
|
||||
if (i > 0) {
|
||||
@@ -1341,7 +1341,7 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
|
||||
// CraftBukkit start - Only apply knockback if the damage hits
|
||||
- if (entityliving.hurt(this.damageSources().playerAttack(this).sweep(), f4)) {
|
||||
+ if (entityliving.hurt(this.damageSources().playerAttack(this).sweep().critical(flag2), f4)) { // Paper - add critical damage API
|
||||
entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.SWEEP_ATTACK); // CraftBukkit
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
|
||||
// CraftBukkit start - Only apply knockback if the damage hits
|
||||
- if (entityliving.hurt(this.damageSources().playerAttack(this).sweep(), f4)) {
|
||||
+ if (entityliving.hurt(this.damageSources().playerAttack(this).sweep().critical(flag2), f4)) { // Paper - add critical damage API
|
||||
entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.SWEEP_ATTACK); // CraftBukkit
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
index 913f0eb1d9081cd224b54df401ff4a0af2989f1f..b3972c0aececb1d7170a47bbe8f1d6ce02d11331 100644
|
||||
index 047629405dc67e3bcb5e4b3d5afa0e821f8fde44..8e8258333e181491b2d5b61ebdb80de36e8179a9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -380,6 +380,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
@@ -392,6 +392,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
}
|
||||
}
|
||||
|
||||
+ if (this.isCritArrow()) damagesource = damagesource.critical(); // Paper - add critical damage API
|
||||
boolean flag = entity.getType() == EntityType.ENDERMAN;
|
||||
int k = entity.getRemainingFireTicks();
|
||||
boolean flag1 = entity.getType().is(EntityTypeTags.DEFLECTS_ARROWS);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 74df21363c96dbf82337550ae2d8525e82eaface..7d72ccdd82daa6afe85859f5bc6ec7b187622384 100644
|
||||
index 11f9220c4a5d2481f3a52238b4d845bad1fd0867..28d371e59d8780bf6e154bac56ee189b3b43b201 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1063,7 +1063,7 @@ public class CraftEventFactory {
|
||||
@@ -1062,7 +1062,7 @@ public class CraftEventFactory {
|
||||
return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
|
||||
}
|
||||
DamageCause damageCause = (damager.getBukkitEntity() instanceof org.bukkit.entity.TNTPrimed) ? DamageCause.BLOCK_EXPLOSION : DamageCause.ENTITY_EXPLOSION;
|
||||
@ -83,7 +83,7 @@ index 74df21363c96dbf82337550ae2d8525e82eaface..7d72ccdd82daa6afe85859f5bc6ec7b1
|
||||
} else if (damager != null || source.getDirectEntity() != null) {
|
||||
DamageCause cause = (source.isSweep()) ? DamageCause.ENTITY_SWEEP_ATTACK : DamageCause.ENTITY_ATTACK;
|
||||
|
||||
@@ -1093,7 +1093,7 @@ public class CraftEventFactory {
|
||||
@@ -1088,7 +1088,7 @@ public class CraftEventFactory {
|
||||
cause = DamageCause.MAGIC;
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ index 74df21363c96dbf82337550ae2d8525e82eaface..7d72ccdd82daa6afe85859f5bc6ec7b1
|
||||
} else if (source.is(DamageTypes.FELL_OUT_OF_WORLD)) {
|
||||
return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.VOID, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
|
||||
} else if (source.is(DamageTypes.LAVA)) {
|
||||
@@ -1151,13 +1151,13 @@ public class CraftEventFactory {
|
||||
@@ -1146,13 +1146,13 @@ public class CraftEventFactory {
|
||||
cause = DamageCause.CUSTOM;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix issues with mob conversion
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Skeleton.java b/src/main/java/net/minecraft/world/entity/monster/Skeleton.java
|
||||
index e88af2dcc0f7fc5190654e2640f67d706e6c8c81..92974452d8f63fde8524cfac305ee2ef5212f840 100644
|
||||
index d99bd9f652f3cf09661e426c79693a203effb04c..5642bddc8268d70e5bb5446b65be1d8ce34feb9b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Skeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Skeleton.java
|
||||
@@ -90,10 +90,15 @@ public class Skeleton extends AbstractSkeleton {
|
||||
@ -26,10 +26,10 @@ index e88af2dcc0f7fc5190654e2640f67d706e6c8c81..92974452d8f63fde8524cfac305ee2ef
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
index 2025599c337759d8856e15b606cde604d6c64a88..050ffa4a23feba29fdf4c6a175cdff4e5009027d 100644
|
||||
index 5cd316e6f8139f4258f40e28824ec2d27bad02f1..c583d883118ded5e1884c757427dc5e73c10dd27 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
@@ -271,6 +271,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
|
||||
@@ -258,6 +258,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
|
||||
if (zoglin != null) {
|
||||
zoglin.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0));
|
||||
}
|
||||
@ -42,10 +42,10 @@ index 2025599c337759d8856e15b606cde604d6c64a88..050ffa4a23feba29fdf4c6a175cdff4e
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
|
||||
index 22c8d6233be5e4f7fb4f03176e83dbee02256b1f..c575a86ca5c1bbdd6d2faf6e4a609af8ba03cab6 100644
|
||||
index 4e4cfbcaa5c236969da288b9d6f9cd7773bf4687..dedbf88e03d5840fa9f5c5198033379701a9a29e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/AbstractPiglin.java
|
||||
@@ -120,6 +120,11 @@ public abstract class AbstractPiglin extends Monster {
|
||||
@@ -99,6 +99,11 @@ public abstract class AbstractPiglin extends Monster {
|
||||
if (entitypigzombie != null) {
|
||||
entitypigzombie.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0));
|
||||
}
|
@ -23,12 +23,12 @@ index ce297420f695404356655b1df2847a32fb98ec59..068b3735b6c50a7a2053c7dc39856f72
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
index 928a301627134b49915b0ceaeabb7dc350605dc2..08716e757b2e100f7bc47a046f02db664d882aba 100644
|
||||
index 1002123cd0c6f57cecc4e80f5f21cc6ff5886d37..e96023b71845526383288917e8d7c5759a4c0e9b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
@@ -331,4 +331,11 @@ public class CraftBlockState implements BlockState {
|
||||
public CraftBlockState copy() {
|
||||
return new CraftBlockState(this);
|
||||
@@ -341,4 +341,11 @@ public class CraftBlockState implements BlockState {
|
||||
public BlockState copy(Location location) {
|
||||
return new CraftBlockState(this, location);
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
@ -39,10 +39,10 @@ index 928a301627134b49915b0ceaeabb7dc350605dc2..08716e757b2e100f7bc47a046f02db66
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 445e87a4cc7a1b6c38a4cbf2212ebddbc3496d12..2734f4187a4b92ef461e1f2fdae9139c6f54d8fc 100644
|
||||
index 4b01afda33e05a10fbdd588b4637ecead9b4da61..704eaa3cae99e2c1f9750029b9d86709ea019df0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -593,6 +593,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -590,6 +590,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
var supplier = net.minecraft.world.entity.ai.attributes.DefaultAttributes.getSupplier((net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.LivingEntity>) net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(bukkitEntityKey)));
|
||||
return new io.papermc.paper.attribute.UnmodifiableAttributeMap(supplier);
|
||||
}
|
@ -5,12 +5,12 @@ Subject: [PATCH] Goat ram API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
index 52f3f679568955b632a60d44de687c6db0e2b38a..ee1b2c1fec4b76a821e1d52fbb07e1f302b2efa1 100644
|
||||
index fa380dcfa16f5d872c9d29d6fab9f9cf095f3791..3b2cf9ca8447321d64ffdb4fdb9569d736d63dbb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
@@ -392,4 +392,15 @@ public class Goat extends Animal {
|
||||
protected Vector3f getPassengerAttachmentPoint(Entity passenger, EntityDimensions dimensions, float scaleFactor) {
|
||||
return new Vector3f(0.0F, dimensions.height - 0.1875F * scaleFactor, 0.0F);
|
||||
@@ -391,4 +391,15 @@ public class Goat extends Animal {
|
||||
public static boolean checkGoatSpawnRules(EntityType<? extends Animal> entityType, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
|
||||
return world.getBlockState(pos.below()).is(BlockTags.GOATS_SPAWNABLE_ON) && isBrightEnoughToSpawn(world, pos);
|
||||
}
|
||||
+
|
||||
+ // Paper start - Goat ram API
|
@ -7,10 +7,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization
|
||||
public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 11985b5c0e48178a7f995dfc35dd27a172261f1c..b9f61d08adf83bbaed522c2258db116492cb24c5 100644
|
||||
index dd353bad7ddf7c1e4bbc37ed3724d73696f7b8a7..cdb69f4d5d49a2459671fa86dc39d60fdfa62489 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2078,6 +2078,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -2106,6 +2106,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,10 +27,10 @@ index 11985b5c0e48178a7f995dfc35dd27a172261f1c..b9f61d08adf83bbaed522c2258db1164
|
||||
return this.isPassenger() ? false : this.saveAsPassenger(nbt);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 65ce8ab201e7e36f6d2637e906af325e11e425dd..c819fa8e5b69c23558a89b68f9a5a31e1b233ca3 100644
|
||||
index 9edcdc71b28cf08e42fbe44723ba540e8d4f7808..a61638bc8200f6aa25d9c3254aea6c0cd38bcbf1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1058,6 +1058,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -1068,6 +1068,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
}
|
||||
// Paper end - tracked players API
|
||||
|
||||
@ -50,10 +50,10 @@ index 65ce8ab201e7e36f6d2637e906af325e11e425dd..c819fa8e5b69c23558a89b68f9a5a31e
|
||||
@Override
|
||||
public boolean isInvisible() { // Paper - moved up from LivingEntity
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 2734f4187a4b92ef461e1f2fdae9139c6f54d8fc..be82e1d52d7026facb20bf07f4b3a394e77ab708 100644
|
||||
index 704eaa3cae99e2c1f9750029b9d86709ea019df0..8191fedcdc7d96de9574f567a8e95ce121a15df4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -504,6 +504,32 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -501,6 +501,32 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(compound));
|
||||
}
|
||||
|
@ -33,10 +33,10 @@ index 899008b2980d13f1be6280cd8cb959c53a29bebf..d5f7da3502575f6847f3c22ab0e94284
|
||||
private RedirectModifier<S> modifier = null;
|
||||
private boolean forks;
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index c11977dceeba4120cdb63972c4ec486640d8114e..8be58d29f2a4753a241e68bd305b3e30186ca0e9 100644
|
||||
index 8bc9da1a23a7bac65557114171f2f9391b0a32b0..412c21ce2dcd772e525432efadff7e1340cb58e9 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -257,6 +257,13 @@ public class Commands {
|
||||
@@ -260,6 +260,13 @@ public class Commands {
|
||||
}
|
||||
this.vanillaCommandNodes.addAll(this.dispatcher.getRoot().getChildren()); // Paper - Add UnknownCommandEvent
|
||||
|
@ -9,10 +9,10 @@ chunk through it. This should also be OK from a leak prevention/
|
||||
state desync POV because the TE is getting unloaded anyways.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 14b3edc05a04f5049f994df5be68e4f01e8cf1ef..10eb5c342930d2efd7d919f286fe8fa64cebaea4 100644
|
||||
index a2a0bbe77db3bba2da40236346a5700266b61e0c..6bcc1c873d0943378a9b065856cbd3de3ad1de7e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1270,9 +1270,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1276,9 +1276,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// Spigot Start
|
||||
for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) {
|
||||
if (tileentity instanceof net.minecraft.world.Container) {
|
||||
@ -28,10 +28,10 @@ index 14b3edc05a04f5049f994df5be68e4f01e8cf1ef..10eb5c342930d2efd7d919f286fe8fa6
|
||||
}
|
||||
// Spigot End
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 3f4950e0c0525346a89c7402ea85edebc6b36698..5f43cd7f6cc1e14771c3df6ec1f074e670ec6206 100644
|
||||
index 36e3676d4a0725d5b55388367152c13c078b6abd..0b1114ade26f3f2280e4485a8260045a2b343c1b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1581,6 +1581,18 @@ public class ServerPlayer extends Player {
|
||||
@@ -1665,6 +1665,18 @@ public class ServerPlayer extends Player {
|
||||
this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId));
|
||||
this.doCloseContainer();
|
||||
}
|
||||
@ -51,10 +51,10 @@ index 3f4950e0c0525346a89c7402ea85edebc6b36698..5f43cd7f6cc1e14771c3df6ec1f074e6
|
||||
@Override
|
||||
public void doCloseContainer() {
|
||||
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 cb91111c1ae1cfbf256ba09f76ce0b0c8fc91f32..e06cb31f9e3eda651a44dcede095ef7b38ef2ba7 100644
|
||||
index c3fc0adeafbebaaaab8c155df9829f488e41d8ab..4003dfeae8b2486045a3dbe4c1adc65a882e70ba 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -510,6 +510,11 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -509,6 +509,11 @@ public abstract class Player extends LivingEntity {
|
||||
this.containerMenu = this.inventoryMenu;
|
||||
}
|
||||
// Paper end - Inventory close reason
|
@ -7,7 +7,7 @@ Separate lookup and state access locks prevent lookups
|
||||
from stalling simple state access/write calls
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
||||
index 1ec0f3a7148c2f412421772f6e1dff0bb92a51bc..d45fe762941dd6da45c890706bc9e4c0438522c3 100644
|
||||
index 774d81c702edb76a2f6184d4dc53687de6734a79..34b4166adfae8ff7d1eb73d56a72931b005330a7 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
||||
@@ -60,6 +60,11 @@ public class GameProfileCache {
|
@ -17,10 +17,10 @@ Async catch modifications to critical entity state
|
||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 574efd531199332a36fb26c70cc44bd5a05ff37d..7efe0cc24590966075ae84d19c3899a43f9adc2a 100644
|
||||
index 0bb6b0b776f80040f901532fcf1052eeaed7bae4..8e01958ddd2a8fd2994cf9f579adaf769381c8b4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1570,6 +1570,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1571,6 +1571,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) { // Paper
|
||||
@ -29,10 +29,10 @@ index 574efd531199332a36fb26c70cc44bd5a05ff37d..7efe0cc24590966075ae84d19c3899a4
|
||||
if (player.isRemoved()) {
|
||||
LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index f01ace6a6e517ff3d3cd66e69e2594ae3d702072..31eb77e4e5f07b120708edeca497ef2eef1fcf13 100644
|
||||
index 3541d5f4a0605415e1d7941fdf82e1ba3e5e2965..f5c18ac111188ae2397eaf41cac28edda98c1002 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1126,7 +1126,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1147,7 +1147,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
public boolean addEffect(MobEffectInstance mobeffect, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause) {
|
||||
@ -42,7 +42,7 @@ index f01ace6a6e517ff3d3cd66e69e2594ae3d702072..31eb77e4e5f07b120708edeca497ef2e
|
||||
this.effectsToProcess.add(new ProcessableEffect(mobeffect, cause));
|
||||
return true;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
index 8f23b45dce35617bb56b21fb4f7a09baf36d40c5..cbdb2a710a7217b750de3e782cad5b5a45c814b3 100644
|
||||
index 219062cff8a05c765b092f1525043d9d9a1153ae..1c6e8438219f355274db4e0fa849cdd90648fbb4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
||||
@@ -78,6 +78,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
||||
@ -166,10 +166,10 @@ index 8f23b45dce35617bb56b21fb4f7a09baf36d40c5..cbdb2a710a7217b750de3e782cad5b5a
|
||||
PersistentEntitySectionManager.LOGGER.warn("Entity {} wasn't found in section {} (destroying due to {})", new Object[]{this.entity, SectionPos.of(this.currentSectionKey), reason});
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 6d74a3a43aee0f7ba4c109bd2443c5fcd950fa54..0b1d918452deee4c75bc61cb6a620f69cefa80b3 100644
|
||||
index 8410d9ecc722475fceb248df1855841afd7cffc8..e3a45690210030be46751aa1704f1d59a3a78f01 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1757,6 +1757,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1756,6 +1756,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public void playSound(Location loc, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch, long seed) {
|
||||
@ -177,7 +177,7 @@ index 6d74a3a43aee0f7ba4c109bd2443c5fcd950fa54..0b1d918452deee4c75bc61cb6a620f69
|
||||
if (loc == null || sound == null || category == null) return;
|
||||
|
||||
double x = loc.getX();
|
||||
@@ -1768,6 +1769,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1767,6 +1768,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public void playSound(Location loc, String sound, org.bukkit.SoundCategory category, float volume, float pitch, long seed) {
|
||||
@ -185,7 +185,7 @@ index 6d74a3a43aee0f7ba4c109bd2443c5fcd950fa54..0b1d918452deee4c75bc61cb6a620f69
|
||||
if (loc == null || sound == null || category == null) return;
|
||||
|
||||
double x = loc.getX();
|
||||
@@ -1800,6 +1802,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1799,6 +1801,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public void playSound(Entity entity, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch, long seed) {
|
||||
@ -193,7 +193,7 @@ index 6d74a3a43aee0f7ba4c109bd2443c5fcd950fa54..0b1d918452deee4c75bc61cb6a620f69
|
||||
if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return;
|
||||
|
||||
ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(CraftSound.bukkitToMinecraftHolder(sound), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed);
|
||||
@@ -1811,6 +1814,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1810,6 +1813,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public void playSound(Entity entity, String sound, org.bukkit.SoundCategory category, float volume, float pitch, long seed) {
|
||||
@ -202,10 +202,10 @@ index 6d74a3a43aee0f7ba4c109bd2443c5fcd950fa54..0b1d918452deee4c75bc61cb6a620f69
|
||||
|
||||
ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(Holder.direct(SoundEvent.createVariableRangeEvent(new ResourceLocation(sound))), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 4461663659f351f844ed78adc8c1ffd0531a7878..5a760234a4604cec289705f1439f03c821bb0aab 100644
|
||||
index 0c718dc32beb7c4afec64c19edcef41bdf1b8e39..6344ab27c113dd42c729e0b05b957670c4930722 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -517,6 +517,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -516,6 +516,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
|
||||
@Override
|
||||
public boolean addPotionEffect(PotionEffect effect, boolean force) {
|
@ -257,10 +257,10 @@ index 0000000000000000000000000000000000000000..d3b39d88a72ca25057fd8574d32f28db
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index 5247782edc426107fb4b3ade5d92f148c0b6e681..c44c10e15564af6ba0f6d60a1b5f38c6e874a43a 100644
|
||||
index 58ea6a1f95a09c22125a8262b1b221004ebce0e4..ea6533c1ac218aa075da3401807a06fcb7892321 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -157,6 +157,16 @@ public final class NaturalSpawner {
|
||||
@@ -152,6 +152,16 @@ public final class NaturalSpawner {
|
||||
world.getProfiler().pop();
|
||||
}
|
||||
|
||||
@ -278,10 +278,10 @@ index 5247782edc426107fb4b3ade5d92f148c0b6e681..c44c10e15564af6ba0f6d60a1b5f38c6
|
||||
BlockPos blockposition = NaturalSpawner.getRandomPosWithin(world, chunk);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 51337b1b2e74a67ad54c5d594004b649cb6af4ed..dc37989ab5e0971a144a8248152169b4fd868067 100644
|
||||
index aab59a42af04971b5be4b6295700a1c50e1c964f..382c5a9ad23523b830edc7c81767b13a49aca087 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2286,6 +2286,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2298,6 +2298,11 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public int getSpawnLimit(SpawnCategory spawnCategory) {
|
||||
@ -294,10 +294,10 @@ index 51337b1b2e74a67ad54c5d594004b649cb6af4ed..dc37989ab5e0971a144a8248152169b4
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 0b1d918452deee4c75bc61cb6a620f69cefa80b3..139281eab642a3676987fa9b3597b5b6e1a99e9c 100644
|
||||
index e3a45690210030be46751aa1704f1d59a3a78f01..268ce3e66ce85b1b7cf2378a32bf4fd3f0f4f268 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1715,9 +1715,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1714,9 +1714,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null");
|
||||
Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory);
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Sanitize ResourceLocation error logging
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/resources/ResourceLocation.java b/src/main/java/net/minecraft/resources/ResourceLocation.java
|
||||
index aed74e471126a8a66046a181973158d7d288d3f0..3908f88959e43d2f485d5f239257e6564dbda6cd 100644
|
||||
index 0ad6d9d417193248f6a9df67f1d1a66cef3ff122..d93b623ce973b63d4f3a77bfe459f51af7cb3c1c 100644
|
||||
--- a/src/main/java/net/minecraft/resources/ResourceLocation.java
|
||||
+++ b/src/main/java/net/minecraft/resources/ResourceLocation.java
|
||||
@@ -207,7 +207,7 @@ public class ResourceLocation implements Comparable<ResourceLocation> {
|
||||
@@ -231,7 +231,7 @@ public class ResourceLocation implements Comparable<ResourceLocation> {
|
||||
|
||||
private static String assertValidNamespace(String namespace, String path) {
|
||||
if (!isValidNamespace(namespace)) {
|
||||
@ -17,7 +17,7 @@ index aed74e471126a8a66046a181973158d7d288d3f0..3908f88959e43d2f485d5f239257e656
|
||||
} else {
|
||||
return namespace;
|
||||
}
|
||||
@@ -233,7 +233,7 @@ public class ResourceLocation implements Comparable<ResourceLocation> {
|
||||
@@ -257,7 +257,7 @@ public class ResourceLocation implements Comparable<ResourceLocation> {
|
||||
|
||||
private static String assertValidPath(String namespace, String path) {
|
||||
if (!isValidPath(path)) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Manually inline methods in BlockPosition
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
|
||||
index 4bc994bacdf1fbb7689d799d21a50b7903bf9e59..d80e3f5f53b9d28dea574cff5c65dfa3f8148f88 100644
|
||||
index 19fdd77d4830b7218b627fdf4ed755d8935c00aa..4144c872fbd89d22827ad1f586e9a8d63a39ed46 100644
|
||||
--- a/src/main/java/net/minecraft/core/BlockPos.java
|
||||
+++ b/src/main/java/net/minecraft/core/BlockPos.java
|
||||
@@ -536,9 +536,9 @@ public class BlockPos extends Vec3i {
|
||||
@@ -558,9 +558,9 @@ public class BlockPos extends Vec3i {
|
||||
}
|
||||
|
||||
public BlockPos.MutableBlockPos set(int x, int y, int z) {
|
||||
@ -21,7 +21,7 @@ index 4bc994bacdf1fbb7689d799d21a50b7903bf9e59..d80e3f5f53b9d28dea574cff5c65dfa3
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -603,19 +603,19 @@ public class BlockPos extends Vec3i {
|
||||
@@ -625,19 +625,19 @@ public class BlockPos extends Vec3i {
|
||||
|
||||
@Override
|
||||
public BlockPos.MutableBlockPos setX(int i) {
|
||||
@ -45,10 +45,10 @@ index 4bc994bacdf1fbb7689d799d21a50b7903bf9e59..d80e3f5f53b9d28dea574cff5c65dfa3
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
|
||||
index afb1e5ff7b1b6b42f81eaa7888a1ec3ded804ccb..21387401c7958414fa6f3fd530488481d92a6eca 100644
|
||||
index df4c9b275752ad97a4efe9380ae0d511ee760695..02367ef1371dde94ff6c4cd40bd32e800d6ccaaf 100644
|
||||
--- a/src/main/java/net/minecraft/core/Vec3i.java
|
||||
+++ b/src/main/java/net/minecraft/core/Vec3i.java
|
||||
@@ -17,9 +17,9 @@ public class Vec3i implements Comparable<Vec3i> {
|
||||
@@ -16,9 +16,9 @@ public class Vec3i implements Comparable<Vec3i> {
|
||||
vec -> IntStream.of(vec.getX(), vec.getY(), vec.getZ())
|
||||
);
|
||||
public static final Vec3i ZERO = new Vec3i(0, 0, 0);
|
||||
@ -60,4 +60,4 @@ index afb1e5ff7b1b6b42f81eaa7888a1ec3ded804ccb..21387401c7958414fa6f3fd530488481
|
||||
+ protected int z; // Paper - Perf: Manually inline methods in BlockPosition; protected
|
||||
|
||||
public static Codec<Vec3i> offsetCodec(int maxAbsValue) {
|
||||
return ExtraCodecs.validate(
|
||||
return CODEC.validate(
|
@ -10,10 +10,10 @@ chunks did get inlined, but the standard CPS.getChunkAt
|
||||
method was not inlined.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index a1dbd23a5d8ea064f1b7909f3e285a4dadf34d88..1ed82afbc3aaa826f8067c65fdfc3ffce36a2ce5 100644
|
||||
index efda6fbe8d02477cf8251c68683ae8bf7c5f1667..12a104fd9aa6c02a4e983f9651e07804a8df606e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -358,6 +358,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -352,6 +352,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
@Override
|
||||
public final LevelChunk getChunk(int chunkX, int chunkZ) { // Paper - final to help inline
|
@ -8,10 +8,10 @@ Lighting is purged on update anyways, so let's not add more
|
||||
into the conversion process
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
index eaf978d15618b80d23c443acbd42db926d570d01..6743dca44e6552ad39aca757a24f3c4df400d83d 100644
|
||||
index 09a73383867d1ffadababd24428ee7a61ab98959..e605dbdb821b2d13217ac88426e50480a4e4741d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
@@ -44,6 +44,7 @@ public class ChunkStorage implements AutoCloseable {
|
||||
@@ -47,6 +47,7 @@ public class ChunkStorage implements AutoCloseable {
|
||||
|
||||
// CraftBukkit start
|
||||
private boolean check(ServerChunkCache cps, int x, int z) {
|
@ -7,15 +7,15 @@ Reference2BooleanOpenHashMap is going to have
|
||||
better lookups than HashMap.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 4c1dd470ac561f61d7f49adf90d273b1f293d296..f2d3dc066b00b685715eb5104234945c41a15f92 100644
|
||||
index 406c78dcb97d954f16f05d379d4dbf74c61c8fd1..3532febc8e34c8436a69a4c4b472b1776f21ee48 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1677,7 +1677,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1690,7 +1690,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
final Entity entity;
|
||||
private final int range;
|
||||
SectionPos lastSectionPos;
|
||||
- public final Set<ServerPlayerConnection> seenBy = Sets.newIdentityHashSet();
|
||||
+ public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
|
||||
|
||||
public TrackedEntity(Entity entity, int i, int j, boolean flag) {
|
||||
public TrackedEntity(final Entity entity, final int i, final int j, final boolean flag) {
|
||||
this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit
|
@ -7,10 +7,10 @@ Apparently the abstract block iteration was taking about
|
||||
75% of the method call.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
index 66106b821d7a384a2eb0f27993beb9f4257e6815..6e4c852c93f2418ea69e485ed3a10cbe3a6e3bd2 100644
|
||||
index 529f9f57249bd1ffa2698da76ffa9d4a284088db..d59e33e7326489c6d55d316d0130f22235f4c63c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -151,19 +151,28 @@ public class FarmBlock extends Block {
|
||||
@@ -152,19 +152,28 @@ public class FarmBlock extends Block {
|
||||
}
|
||||
|
||||
private static boolean isNearWater(LevelReader world, BlockPos pos) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 10eb5c342930d2efd7d919f286fe8fa64cebaea4..03a9f82ac2af6cb64081c2bb758cb02a7ffd5b89 100644
|
||||
index 6bcc1c873d0943378a9b065856cbd3de3ad1de7e..d4dc2e3a89b76009bb1ce2c3b03515fcf308efa0 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2325,6 +2325,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -2277,6 +2277,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// Spigot end
|
||||
// Spigot Start
|
||||
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
@ -6,10 +6,10 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 7efe0cc24590966075ae84d19c3899a43f9adc2a..8fcb241e8d161c9fb024a2a0488f8c29784a74f1 100644
|
||||
index 8e01958ddd2a8fd2994cf9f579adaf769381c8b4..39ba1860b6c0384f04fa9219c976c144cc4027fe 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -725,6 +725,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -751,6 +751,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
@ -24,10 +24,10 @@ and an action can be defined: DROP or KICK
|
||||
If interval or rate are less-than 0, the limit is ignored
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index 37b16918451859c22f92bcbcbce05c16b8beff75..22a7f17180b76b6c3548d3b54ae8218a469401a8 100644
|
||||
index 6c30eb3750f434341ecec0bf8e9054bb331f9757..fd2a5c829899d45641a5b5d30116f4f368953c15 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -128,6 +128,22 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -137,6 +137,22 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
return null;
|
||||
}
|
||||
// Paper end - add utility methods
|
||||
@ -50,7 +50,7 @@ index 37b16918451859c22f92bcbcbce05c16b8beff75..22a7f17180b76b6c3548d3b54ae8218a
|
||||
|
||||
public Connection(PacketFlow side) {
|
||||
this.receiving = side;
|
||||
@@ -220,6 +236,55 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -207,6 +223,55 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
if (packetlistener == null) {
|
||||
throw new IllegalStateException("Received a packet before the packet listener was initialized");
|
||||
} else {
|
@ -11,10 +11,10 @@ This commit hence simply fixes this by using the proper body colour
|
||||
value when updating the pattern color.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java
|
||||
index a4256ee1c1cd305d1253e7b8084d814428386369..67c56a4f643e1cb52139c8f3ffc4af0cf278339f 100644
|
||||
index ce915b31d964f7ce5f5be9fbb5b52b1473ac4961..8940fc62f14dd7f53f98ea47ac06a21aa92a4b62 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java
|
||||
@@ -107,7 +107,7 @@ class CraftMetaTropicalFishBucket extends CraftMetaItem implements TropicalFishB
|
||||
@@ -112,7 +112,7 @@ class CraftMetaTropicalFishBucket extends CraftMetaItem implements TropicalFishB
|
||||
if (this.variant == null) {
|
||||
this.variant = 0;
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Ensure valid vehicle status
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 5f43cd7f6cc1e14771c3df6ec1f074e670ec6206..b5a3587a9074a1a2fcc2252d2db8b184b6ab6793 100644
|
||||
index 0b1114ade26f3f2280e4485a8260045a2b343c1b..3db8f376f3a73256d13fd778bb1c80606e6712d9 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -527,7 +527,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -557,7 +557,7 @@ public class ServerPlayer extends Player {
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Prevent softlocked end exit portal generation
|
||||
|
||||
|
||||
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 1c9bfcf595bcb247c3b9ffe8b0e0cfee0d0ba91f..50071bec6825ec2b34662de14128070510d16afb 100644
|
||||
index 609b20e2b222c5b1fddf22c2621d0d7a88cabcfa..b8bba857aa390e5435b8a199a25065a940d6a972 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
|
||||
@@ -466,6 +466,11 @@ public class EndDragonFight {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix CocaoDecorator causing a crash when trying to generate
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java b/src/main/java/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java
|
||||
index 05a874404daec8d7194e0d5bc8d17f76d3cc94ef..961a772eecb759c8c2a2e1461988fdb3f06dd1b0 100644
|
||||
index 1b59f530840a2a490e295f73db90ab266b27712f..f924f09aaf5d8fd643f86d826ab053dbe861369e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/treedecorators/CocoaDecorator.java
|
||||
@@ -26,6 +26,7 @@ public class CocoaDecorator extends TreeDecorator {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't log debug logging being disabled
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
index 56dbc23f10d946a7ec992b08fd868f3ee5089068..6c260403d91d640da0473a3df56e1c5582459fde 100644
|
||||
index 9572177323f29ea8315a3dfb943dfe10463f32ae..6c2a3813e7d63d57f07a8fa2edbb9d231221d818 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
@@ -382,7 +382,7 @@ public class SpigotConfig
|
@ -10,10 +10,10 @@ chunk bans via the large amount of NBT created by unstacking the items.
|
||||
Fixes GH-5140 and GH-4748.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java
|
||||
index 214215d203892b8009595539f25ce26e8752debd..05af6fa0585406c4922d2eb174f7e53f4269acd6 100644
|
||||
index 83fce6746aaa3b378da6c5573ec9991d8438b071..6db7a023dd802706935c384df0b0aa430a6e29aa 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java
|
||||
@@ -68,9 +68,10 @@ public class LootTable {
|
||||
@@ -72,9 +72,10 @@ public class LootTable {
|
||||
}
|
||||
|
||||
public static Consumer<ItemStack> createStackSplitter(ServerLevel world, Consumer<ItemStack> consumer) {
|
@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw.
|
||||
This issue only applies to players.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index b9f61d08adf83bbaed522c2258db116492cb24c5..685cd5c719a0bf8d3e41aa95b0e84effe1241948 100644
|
||||
index cdb69f4d5d49a2459671fa86dc39d60fdfa62489..24e4db0e80b774e5681e031f56cb7da844656f8f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1790,6 +1790,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -1814,6 +1814,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
|
||||
this.yRotO = this.getYRot();
|
||||
this.xRotO = this.getXRot();
|
||||
@ -19,7 +19,7 @@ index b9f61d08adf83bbaed522c2258db116492cb24c5..685cd5c719a0bf8d3e41aa95b0e84eff
|
||||
}
|
||||
|
||||
public void absMoveTo(double x, double y, double z) {
|
||||
@@ -1828,6 +1829,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -1852,6 +1853,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.setXRot(pitch);
|
||||
this.setOldPosAndRot();
|
||||
this.reapplyPosition();
|
@ -5,12 +5,12 @@ Subject: [PATCH] prevent unintended light block manipulation
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/LightBlock.java b/src/main/java/net/minecraft/world/level/block/LightBlock.java
|
||||
index 0fe3186b4edbbc93f5794d23dffe58c063be8d67..95d36c3a74d0b71662864f27c54cf52ba41d384c 100644
|
||||
index 01722473a4861533dba0ab6edf3982c0278c41e1..a57dd6a6815a83c6a9e7d9eb75e4fccc014e6fac 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/LightBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/LightBlock.java
|
||||
@@ -52,6 +52,7 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock {
|
||||
@Override
|
||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) {
|
||||
if (!world.isClientSide && player.canUseGameMasterBlocks()) {
|
||||
+ if (player.getItemInHand(hand).getItem() != Items.LIGHT || !player.mayInteract(world, pos) || !player.mayUseItemAt(pos, hit.getDirection(), player.getItemInHand(hand))) { return InteractionResult.FAIL; } // Paper - Prevent unintended light block manipulation
|
||||
world.setBlock(pos, state.cycle(LEVEL), 2);
|
@ -13,10 +13,10 @@ the material type of the block at that location.
|
||||
public net.minecraft.world.level.block.entity.BlockEntityType validBlocks
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
index 53443b472d21633f49c102b330c8406c92f09d8d..4893eaf93738da860014ddf3ad003334c9ebc9fa 100644
|
||||
index 90b218ebc947a1d8a8c7dfc677fe145b6386654a..df945a152747bea0452ec18c09d59598903aa91f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
@@ -247,7 +247,7 @@ public abstract class BlockEntity {
|
||||
@@ -350,7 +350,7 @@ public abstract class BlockEntity {
|
||||
// Paper end
|
||||
if (this.level == null) return null;
|
||||
org.bukkit.block.Block block = this.level.getWorld().getBlockAt(this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ());
|
||||
@ -26,10 +26,10 @@ index 53443b472d21633f49c102b330c8406c92f09d8d..4893eaf93738da860014ddf3ad003334
|
||||
if (state instanceof InventoryHolder) return (InventoryHolder) state;
|
||||
return null;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
index ff3f88f107a4c059688566b69dcdf48bc01210ab..7cd0fae59c497861063827eda4243cc6c11e7cff 100644
|
||||
index 52fe7315fa838e3b6b236127c293ac0e8528ee7d..16ecf1aeff89ef38e54678fed0010d30286ffb81 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
@@ -13,7 +13,7 @@ import org.bukkit.persistence.PersistentDataContainer;
|
||||
@@ -18,7 +18,7 @@ import org.bukkit.persistence.PersistentDataContainer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -38,22 +38,22 @@ index ff3f88f107a4c059688566b69dcdf48bc01210ab..7cd0fae59c497861063827eda4243cc6
|
||||
|
||||
private final T tileEntity;
|
||||
private final T snapshot;
|
||||
@@ -153,9 +153,7 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
||||
@@ -182,9 +182,7 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
||||
}
|
||||
|
||||
@Override
|
||||
- public CraftBlockEntityState<T> copy() {
|
||||
- return new CraftBlockEntityState<>(this);
|
||||
- public CraftBlockEntityState<T> copy(Location location) {
|
||||
- return new CraftBlockEntityState<>(this, location);
|
||||
- }
|
||||
+ public abstract CraftBlockEntityState<T> copy(); // Paper - make abstract
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
index 76a3f4ad26718f95f4cf64206efe16e598fa2285..f81c0d07a5efc92942d8ab5c50a8260db033307d 100644
|
||||
index 4c30af81697db25d9913b436c45d9a926cbb5cca..c38b7148a3bbe7d29adea19d08dde4d9c8e29704 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BellBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlastFurnaceBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
@ -61,7 +61,7 @@ index 76a3f4ad26718f95f4cf64206efe16e598fa2285..f81c0d07a5efc92942d8ab5c50a8260d
|
||||
import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BrushableBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity;
|
||||
@@ -114,227 +115,64 @@ public final class CraftBlockStates {
|
||||
@@ -118,228 +119,65 @@ public final class CraftBlockStates {
|
||||
private static final BlockStateFactory<?> DEFAULT_FACTORY = new BlockStateFactory<CraftBlockState>(CraftBlockState.class) {
|
||||
@Override
|
||||
public CraftBlockState createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) {
|
||||
@ -271,7 +271,7 @@ index 76a3f4ad26718f95f4cf64206efe16e598fa2285..f81c0d07a5efc92942d8ab5c50a8260d
|
||||
- register(Material.DECORATED_POT, CraftDecoratedPot.class, CraftDecoratedPot::new, DecoratedPotBlockEntity::new);
|
||||
- register(Material.DISPENSER, CraftDispenser.class, CraftDispenser::new, DispenserBlockEntity::new);
|
||||
- register(Material.DROPPER, CraftDropper.class, CraftDropper::new, DropperBlockEntity::new);
|
||||
- register(Material.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new, EnchantmentTableBlockEntity::new);
|
||||
- register(Material.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new, EnchantingTableBlockEntity::new);
|
||||
- register(Material.ENDER_CHEST, CraftEnderChest.class, CraftEnderChest::new, EnderChestBlockEntity::new);
|
||||
- register(Material.END_GATEWAY, CraftEndGateway.class, CraftEndGateway::new, TheEndGatewayBlockEntity::new);
|
||||
- register(Material.END_PORTAL, CraftEndPortal.class, CraftEndPortal::new, TheEndPortalBlockEntity::new);
|
||||
@ -293,6 +293,7 @@ index 76a3f4ad26718f95f4cf64206efe16e598fa2285..f81c0d07a5efc92942d8ab5c50a8260d
|
||||
- register(Material.TRAPPED_CHEST, CraftChest.class, CraftChest::new, TrappedChestBlockEntity::new);
|
||||
- register(Material.CRAFTER, CraftCrafter.class, CraftCrafter::new, CrafterBlockEntity::new);
|
||||
- register(Material.TRIAL_SPAWNER, CraftTrialSpawner.class, CraftTrialSpawner::new, TrialSpawnerBlockEntity::new);
|
||||
- register(Material.VAULT, CraftVault.class, CraftVault::new, VaultBlockEntity::new);
|
||||
+ // Paper start - simplify
|
||||
+ register(BlockEntityType.SIGN, CraftSign.class, CraftSign::new);
|
||||
+ register(BlockEntityType.HANGING_SIGN, CraftHangingSign.class, CraftHangingSign::new);
|
||||
@ -337,11 +338,12 @@ index 76a3f4ad26718f95f4cf64206efe16e598fa2285..f81c0d07a5efc92942d8ab5c50a8260d
|
||||
+ register(BlockEntityType.TRAPPED_CHEST, CraftChest.class, CraftChest::new);
|
||||
+ register(BlockEntityType.CRAFTER, CraftCrafter.class, CraftCrafter::new);
|
||||
+ register(BlockEntityType.TRIAL_SPAWNER, CraftTrialSpawner.class, CraftTrialSpawner::new);
|
||||
+ register(BlockEntityType.VAULT, CraftVault.class, CraftVault::new);
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
private static void register(Material blockType, BlockStateFactory<?> factory) {
|
||||
@@ -342,30 +180,33 @@ public final class CraftBlockStates {
|
||||
@@ -347,30 +185,33 @@ public final class CraftBlockStates {
|
||||
}
|
||||
|
||||
private static <T extends BlockEntity, B extends CraftBlockEntityState<T>> void register(
|
||||
@ -390,7 +392,7 @@ index 76a3f4ad26718f95f4cf64206efe16e598fa2285..f81c0d07a5efc92942d8ab5c50a8260d
|
||||
public static Class<? extends CraftBlockState> getBlockStateType(Material material) {
|
||||
Preconditions.checkNotNull(material, "material is null");
|
||||
return CraftBlockStates.getFactory(material).blockStateType;
|
||||
@@ -381,6 +222,13 @@ public final class CraftBlockStates {
|
||||
@@ -386,6 +227,13 @@ public final class CraftBlockStates {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -404,7 +406,7 @@ index 76a3f4ad26718f95f4cf64206efe16e598fa2285..f81c0d07a5efc92942d8ab5c50a8260d
|
||||
public static BlockState getBlockState(Block block) {
|
||||
// Paper start
|
||||
return CraftBlockStates.getBlockState(block, true);
|
||||
@@ -438,7 +286,7 @@ public final class CraftBlockStates {
|
||||
@@ -453,7 +301,7 @@ public final class CraftBlockStates {
|
||||
if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) {
|
||||
factory = CraftBlockStates.DEFAULT_FACTORY;
|
||||
} else {
|
In neuem Issue referenzieren
Einen Benutzer sperren