3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 15:20:11 +01:00

remove calls to DoNotUse methods

Dieser Commit ist enthalten in:
Jake Potrebic 2024-04-27 18:18:20 -07:00
Ursprung 3e90a19183
Commit d93c6f91f7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: ECE0B3C133C016C5
4 geänderte Dateien mit 35 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -24,7 +24,7 @@ index 752b2bac47588c0f75a13a7e6ec2be3c2f5a149e..b177daa7a974125dc4ccf1bc6d119ad4
/** /**
diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
index 997b06c19a5277656521e0e298f2958c209f1da1..f7f864a2b46129e4d61bc87f3e23c343417aa094 100644 index 997b06c19a5277656521e0e298f2958c209f1da1..b8bf61bea73086c61dce6230686e627dc324ebe0 100644
--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java --- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
@@ -12,6 +12,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { @@ -12,6 +12,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
@ -62,7 +62,7 @@ index 997b06c19a5277656521e0e298f2958c209f1da1..f7f864a2b46129e4d61bc87f3e23c343
} }
/** /**
@@ -132,4 +145,77 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { @@ -132,4 +145,79 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
public static HandlerList getHandlerList() { public static HandlerList getHandlerList() {
return handlers; return handlers;
} }
@ -105,6 +105,8 @@ index 997b06c19a5277656521e0e298f2958c209f1da1..f7f864a2b46129e4d61bc87f3e23c343
+ +
+ INVALID_PAYLOAD, + INVALID_PAYLOAD,
+ +
+ INVALID_COOKIE,
+
+ SPAM, + SPAM,
+ +
+ ILLEGAL_ACTION, + ILLEGAL_ACTION,

Datei anzeigen

@ -95,7 +95,7 @@ index d1caaecfdfba1cdeba032f0bc38c06541fa61633..6468b3a25c7527a2fde6899e4812b5cb
i++; i++;
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 2872bef40440b11a206c3ec88e2c6d95cd1a72e9..0273998b72c9d8a1e7de4b1195c547001922cb8e 100644 index 2872bef40440b11a206c3ec88e2c6d95cd1a72e9..dde1d3850af610241e1f76a194efe1a58dc96bd5 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -127,7 +127,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -127,7 +127,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@ -143,6 +143,15 @@ index 2872bef40440b11a206c3ec88e2c6d95cd1a72e9..0273998b72c9d8a1e7de4b1195c54700
} }
// Paper start - adventure pack callbacks // Paper start - adventure pack callbacks
// call the callbacks before the previously-existing event so the event has final say // call the callbacks before the previously-existing event so the event has final say
@@ -237,7 +237,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
return;
}
// CraftBukkit end
- this.disconnect(ServerCommonPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY);
+ this.disconnect(ServerCommonPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY, org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_COOKIE); // Paper - kick event cause
}
protected void keepConnectionAlive() {
@@ -249,7 +249,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -249,7 +249,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
if (!this.isSingleplayerOwner() && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected if (!this.isSingleplayerOwner() && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected

Datei anzeigen

@ -68,6 +68,21 @@ index 0440fd2d1bb3f87641ad88de6d5ae64617536a6d..db60b91c2b26ca8cdb66e05deab7742f
} else { } else {
if (this.level().isClientSide || this.isSitting() || this.isInWater()) { if (this.level().isClientSide || this.isSitting() || this.isInWater()) {
return InteractionResult.PASS; return InteractionResult.PASS;
diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
index 4e38bed2a450e90a416bfc03e4231b95f67133ea..b38281f963377cc82b360e8457da7cad033b8c36 100644
--- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
+++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
@@ -351,8 +351,8 @@ public class Armadillo extends Animal {
}
@Override
- public void setInLove(@Nullable Player player) {
- super.setInLove(player);
+ public void setInLove(@Nullable Player player, @Nullable ItemStack breedItemCopy) { // Paper
+ super.setInLove(player, breedItemCopy); // Paper
this.makeSound(SoundEvents.ARMADILLO_EAT);
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index 8ebe18a1abbac81094e6aab19ba76edc0255e3b7..4eb26874f21726bbc6e6ad78bfaf4ecd268c7246 100644 index 8ebe18a1abbac81094e6aab19ba76edc0255e3b7..4eb26874f21726bbc6e6ad78bfaf4ecd268c7246 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java

Datei anzeigen

@ -105,7 +105,7 @@ index a7dfad2696e7145af1355a5db132af14d09a6f30..b0421823684ff6b9474b81675742d2ee
} }
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 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 92086ca118d55ec49cefa5bf18977f8706e3e4b4..f78343b50641a63110b8867ad84298ba9e873c22 100644 index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..da30c7fd750aa7b912310368100a5261c189715f 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -156,6 +156,43 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -156,6 +156,43 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@ -470,12 +470,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..f78343b50641a63110b8867ad84298ba
return true; return true;
} }
@@ -342,48 +578,52 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -346,44 +582,47 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
}
}
+ @io.papermc.paper.annotation.DoNotUse // Paper - Optimize hoppers
private static boolean tryTakeInItemFromSlot(Hopper ihopper, Container iinventory, int i, Direction enumdirection, Level world) { // Spigot
ItemStack itemstack = iinventory.getItem(i); ItemStack itemstack = iinventory.getItem(i);
if (!itemstack.isEmpty() && HopperBlockEntity.canTakeItemFromContainer(ihopper, iinventory, itemstack, i, enumdirection)) { if (!itemstack.isEmpty() && HopperBlockEntity.canTakeItemFromContainer(ihopper, iinventory, itemstack, i, enumdirection)) {
@ -561,7 +556,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..f78343b50641a63110b8867ad84298ba
} }
return false; return false;
@@ -392,12 +632,14 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -392,12 +631,14 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
public static boolean addItem(Container inventory, ItemEntity itemEntity) { public static boolean addItem(Container inventory, ItemEntity itemEntity) {
boolean flag = false; boolean flag = false;
// CraftBukkit start // CraftBukkit start
@ -577,7 +572,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..f78343b50641a63110b8867ad84298ba
ItemStack itemstack = itemEntity.getItem().copy(); ItemStack itemstack = itemEntity.getItem().copy();
ItemStack itemstack1 = HopperBlockEntity.addItem((Container) null, inventory, itemstack, (Direction) null); ItemStack itemstack1 = HopperBlockEntity.addItem((Container) null, inventory, itemstack, (Direction) null);
@@ -491,7 +733,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -491,7 +732,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
stack = stack.split(to.getMaxStackSize()); stack = stack.split(to.getMaxStackSize());
} }
// Spigot end // Spigot end
@ -587,7 +582,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..f78343b50641a63110b8867ad84298ba
stack = leftover; // Paper - Make hoppers respect inventory max stack size stack = leftover; // Paper - Make hoppers respect inventory max stack size
flag = true; flag = true;
} else if (HopperBlockEntity.canMergeItems(itemstack1, stack)) { } else if (HopperBlockEntity.canMergeItems(itemstack1, stack)) {
@@ -571,14 +815,20 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -571,14 +814,20 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@Nullable @Nullable
public static Container getContainerAt(Level world, BlockPos pos) { public static Container getContainerAt(Level world, BlockPos pos) {
@ -610,7 +605,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..f78343b50641a63110b8867ad84298ba
iinventory = HopperBlockEntity.getEntityContainer(world, x, y, z); iinventory = HopperBlockEntity.getEntityContainer(world, x, y, z);
} }
@@ -613,13 +863,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -613,13 +862,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@Nullable @Nullable
private static Container getEntityContainer(Level world, double x, double y, double z) { private static Container getEntityContainer(Level world, double x, double y, double z) {