and yet again, more patches

This commit is contained in:
Jake Potrebic 2021-11-24 15:46:26 -08:00
parent 8df1b4ad21
commit dbeda4c036
36 changed files with 16 additions and 33 deletions

View File

@ -35,11 +35,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+ @Deprecated // Paper
public void setRespawnPosition(ResourceKey<Level> dimension, @Nullable BlockPos pos, float angle, boolean spawnPointSet, boolean sendMessage) {
public void setRespawnPosition(ResourceKey<Level> dimension, @Nullable BlockPos pos, float angle, boolean forced, boolean sendMessage) {
+ // Paper start
+ this.setRespawnPosition(dimension, pos, angle, spawnPointSet, sendMessage, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.UNKNOWN);
+ this.setRespawnPosition(dimension, pos, angle, forced, sendMessage, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.UNKNOWN);
+ }
+ public void setRespawnPosition(ResourceKey<Level> dimension, @Nullable BlockPos pos, float angle, boolean spawnPointSet, boolean sendMessage, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause cause) {
+ public void setRespawnPosition(ResourceKey<Level> dimension, @Nullable BlockPos pos, float angle, boolean forced, boolean sendMessage, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause cause) {
+ Location spawnLoc = null;
+ boolean willNotify = false;
if (pos != null) {
@ -48,7 +48,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ spawnLoc.setYaw(angle);
+ willNotify = sendMessage && !flag2;
+ }
+ com.destroystokyo.paper.event.player.PlayerSetSpawnEvent event = new com.destroystokyo.paper.event.player.PlayerSetSpawnEvent(this.getBukkitEntity(), cause, spawnLoc, spawnPointSet, willNotify, willNotify ? net.kyori.adventure.text.Component.translatable("block.minecraft.set_spawn") : null);
+ com.destroystokyo.paper.event.player.PlayerSetSpawnEvent event = new com.destroystokyo.paper.event.player.PlayerSetSpawnEvent(this.getBukkitEntity(), cause, spawnLoc, forced, willNotify, willNotify ? net.kyori.adventure.text.Component.translatable("block.minecraft.set_spawn") : null);
+ if (!event.callEvent()) {
+ return;
+ }
@ -56,7 +56,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ dimension = event.getLocation().getWorld() != null ? ((CraftWorld) event.getLocation().getWorld()).getHandle().dimension() : dimension;
+ pos = net.minecraft.server.MCUtil.toBlockPosition(event.getLocation());
+ angle = (float) event.getLocation().getYaw();
+ spawnPointSet = event.isForced();
+ forced = event.isForced();
+ // Paper end
- if (sendMessage && !flag2) {

View File

@ -29,6 +29,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static void angerNearbyPiglins(Player player, boolean blockOpen) {
+ if (!player.level.paperConfig.piglinsGuardChests) return; // Paper
List<AbstractPiglin> list = (List) player.level.getEntitiesOfClass(Piglin.class, player.getBoundingBox().inflate(16.0D)); // CraftBukkit - decompile error
List<Piglin> list = player.level.getEntitiesOfClass(Piglin.class, player.getBoundingBox().inflate(16.0D));
list.stream().filter(PiglinAi::isIdle).filter((entitypiglin) -> {

View File

@ -31,5 +31,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- 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.mapItemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig.mapItemFrameCursorUpdateInterval == 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, (Level) this.level);
MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level);

View File

@ -24,7 +24,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ allowPlayerCrammingDamage = getBoolean("allow-player-cramming-damage", allowPlayerCrammingDamage);
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java

View File

@ -33,8 +33,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.player.disconnect();
// Paper start - Adventure
- net.kyori.adventure.text.Component quitMessage = this.server.getPlayerList().disconnect(this.player);
+ quitMessage = quitMessage == null ? this.server.getPlayerList().disconnect(this.player) : this.server.getPlayerList().disconnect(this.player, quitMessage); // Paper - pass in quitMessage to fix kick message not being used
- net.kyori.adventure.text.Component quitMessage = this.server.getPlayerList().remove(this.player);
+ quitMessage = quitMessage == null ? this.server.getPlayerList().remove(this.player) : this.server.getPlayerList().remove(this.player, quitMessage); // Paper - pass in quitMessage to fix kick message not being used
if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) {
this.server.getPlayerList().broadcastMessage(PaperAdventure.asVanilla(quitMessage), ChatType.SYSTEM, Util.NIL_UUID);
// Paper end
@ -45,11 +45,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class PlayerList {
}
public net.kyori.adventure.text.Component disconnect(ServerPlayer entityplayer) { // Paper - return Component
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // Paper - return Component
+ // Paper start
+ return this.disconnect(entityplayer, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName())));
+ return this.remove(entityplayer, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName())));
+ }
+ public net.kyori.adventure.text.Component disconnect(ServerPlayer entityplayer, net.kyori.adventure.text.Component leaveMessage) {
+ public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer, net.kyori.adventure.text.Component leaveMessage) {
+ // Paper end
ServerLevel worldserver = entityplayer.getLevel();

View File

@ -13,9 +13,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return new IllegalStateException("No jar file system provider found");
});
+ public static final double COLLISION_EPSILON = 1.0E-7; // Paper
static final Logger LOGGER = LogManager.getLogger();
private static Consumer<String> thePauser = (string) -> {
};
public static <K, V> Collector<Entry<? extends K, ? extends V>, ?, Map<K, V>> toMap() {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
@ -68,16 +68,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.lastYd = 0.0D;
this.status = Boat.Status.IN_WATER;
} else {
diff --git a/src/main/java/net/minecraft/world/item/BoatItem.java b/src/main/java/net/minecraft/world/item/BoatItem.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/item/BoatItem.java
+++ b/src/main/java/net/minecraft/world/item/BoatItem.java
@@ -0,0 +0,0 @@ public class BoatItem extends Item {
entityboat.setType(this.type);
entityboat.setYRot(user.getYRot());
- if (!world.noCollision(entityboat, entityboat.getBoundingBox().inflate(-0.1D))) {
+ if (!world.noCollision(entityboat, entityboat.getBoundingBox())) { // Paper
return InteractionResultHolder.fail(itemstack);
} else {
if (!world.isClientSide) {

View File

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
}
private Stream<Entity> getIndirectPassengersStream() {

View File

@ -37,15 +37,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
+
+import com.google.common.collect.HashBasedTable;
+import com.google.common.collect.Table;
import net.minecraft.world.Difficulty;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.monster.Vindicator;
@@ -0,0 +0,0 @@ import net.minecraft.world.entity.monster.Zombie;
import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray.EngineMode;
import net.minecraft.world.entity.monster.Zombie;
import net.minecraft.world.level.NaturalSpawner;
import org.bukkit.Bukkit;
+import org.bukkit.configuration.ConfigurationSection;
@ -110,7 +108,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return rate != null && rate > -1 ? rate : def;
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java