mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
fix more compile errors
This commit is contained in:
parent
e277e6a990
commit
8b4edb6f19
@ -1238,14 +1238,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * Gets the number of ticks that this hopper minecart cannot pickup items up for.
|
||||
+ *
|
||||
+ * @return ticks left on cooldown
|
||||
+ * @deprecated Hopper minecarts don't have cooldowns anymore
|
||||
+ */
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ int getPickupCooldown();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the number of ticks that this hopper minecart cannot pickup items for.
|
||||
+ *
|
||||
+ * @param cooldown cooldown length in ticks
|
||||
+ * @deprecated Hopper minecarts don't have cooldowns anymore
|
||||
+ */
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ void setPickupCooldown(int cooldown);
|
||||
+ // Paper end
|
||||
}
|
||||
|
@ -243,10 +243,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
+ // Paper start - Teleport API
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ public PlayerTeleportEvent(@NotNull final Player player, @NotNull final Location from, @Nullable final Location to, @NotNull final TeleportCause cause, boolean dismounted, @NotNull java.util.Set<io.papermc.paper.entity.TeleportFlag.@NotNull Relative> teleportFlagSet) {
|
||||
+ public PlayerTeleportEvent(@NotNull final Player player, @NotNull final Location from, @Nullable final Location to, @NotNull final TeleportCause cause, @NotNull java.util.Set<io.papermc.paper.entity.TeleportFlag.@NotNull Relative> teleportFlagSet) {
|
||||
+ super(player, from, to);
|
||||
+
|
||||
+ this.dismounted = dismounted;
|
||||
+ this.teleportFlagSet = teleportFlagSet;
|
||||
+ this.cause = cause;
|
||||
+ }
|
||||
@ -264,8 +262,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * Gets if the player will be dismounted in this teleportation.
|
||||
+ *
|
||||
+ * @return dismounted or not
|
||||
+ * @deprecated dismounting on tp is no longer controlled by the server
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ public boolean willDismountPlayer() {
|
||||
+ return this.dismounted;
|
||||
+ }
|
||||
|
@ -4,19 +4,6 @@ Date: Sun, 8 Aug 2021 19:56:02 +0200
|
||||
Subject: [PATCH] Add CompostItemEvent and EntityCompostItemEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
|
||||
@@ -0,0 +0,0 @@ public class WorkAtComposter extends WorkAtPoi {
|
||||
i -= p;
|
||||
|
||||
for(int q = 0; q < p; ++q) {
|
||||
- blockState = ComposterBlock.insertItem(entity, blockState, world, itemStack, blockPos);
|
||||
+ blockState = ComposterBlock.insertItem(entity, blockState, world, itemStack, blockPos, entity); // Paper
|
||||
if (blockState.getValue(ComposterBlock.LEVEL) == 7) {
|
||||
this.spawnComposterFillEffects(world, composterState, blockPos, blockState);
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
|
@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
super.slotsChanged(inventory);
|
||||
if (inventory == this.inputSlots) {
|
||||
this.createResult();
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, this instanceof SmithingMenu ? 3 : 2); // Paper
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper end
|
||||
String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName();
|
||||
java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress();
|
||||
java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper
|
||||
java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.channel.remoteAddress()).getAddress(); // Paper
|
||||
@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
// Spigot end
|
||||
|
||||
|
@ -21,6 +21,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftLightable
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftCherryLeaves extends org.bukkit.craftbukkit.block.data.C
|
||||
public void setWaterlogged(boolean waterlogged) {
|
||||
set(CraftCherryLeaves.WATERLOGGED, waterlogged);
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public int getMaximumDistance() {
|
||||
+ return getMax(DISTANCE);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getMinimumDistance() {
|
||||
+ return getMin(DISTANCE);
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java
|
||||
|
@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public void fireEvents() throws Exception {
|
||||
String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName();
|
||||
java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress();
|
||||
+ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper
|
||||
+ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.channel.remoteAddress()).getAddress(); // Paper
|
||||
java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId();
|
||||
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;
|
||||
|
||||
|
@ -120,7 +120,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
+import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
+import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
+import net.minecraft.Util;
|
||||
+import net.minecraft.Optionull;
|
||||
+import net.minecraft.commands.CommandSourceStack;
|
||||
+import net.minecraft.network.chat.ChatDecorator;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
@ -194,7 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ private ChatDecorator.Result processModern(final ChatDecorator.Result input) {
|
||||
+ final @Nullable CraftPlayer player = Util.mapNullable(this.player, ServerPlayer::getBukkitEntity);
|
||||
+ final @Nullable CraftPlayer player = Optionull.map(this.player, ServerPlayer::getBukkitEntity);
|
||||
+
|
||||
+ final Component initialResult = input.message().component();
|
||||
+ final AsyncChatDecorateEvent event;
|
||||
@ -280,6 +280,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import net.kyori.adventure.audience.ForwardingAudience;
|
||||
+import net.kyori.adventure.key.Key;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.minecraft.Optionull;
|
||||
+import net.minecraft.Util;
|
||||
+import net.minecraft.core.registries.Registries;
|
||||
+import net.minecraft.network.chat.ChatDecorator;
|
||||
@ -551,7 +552,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ if (acceptsNative(viewer)) {
|
||||
+ this.sendNative(viewer, chatType, msgFunction);
|
||||
+ } else {
|
||||
+ final net.minecraft.network.chat.@Nullable Component unsigned = Util.mapNullable(msgFunction, f -> f.apply(viewer));
|
||||
+ final net.minecraft.network.chat.@Nullable Component unsigned = Optionull.map(msgFunction, f -> f.apply(viewer));
|
||||
+ final PlayerChatMessage msg = unsigned == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(unsigned);
|
||||
+ viewer.sendMessage(msg.adventureView(), this.adventure(chatType));
|
||||
+ }
|
||||
@ -601,7 +602,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ if (viewer instanceof ConsoleCommandSender) {
|
||||
+ this.sendToServer(chatType, msgFunction);
|
||||
+ } else if (viewer instanceof CraftPlayer craftPlayer) {
|
||||
+ craftPlayer.getHandle().sendChatMessage(ChatProcessor.this.outgoing, ChatProcessor.this.player.shouldFilterMessageTo(craftPlayer.getHandle()), chatType, Util.mapNullable(msgFunction, f -> f.apply(viewer)));
|
||||
+ craftPlayer.getHandle().sendChatMessage(ChatProcessor.this.outgoing, ChatProcessor.this.player.shouldFilterMessageTo(craftPlayer.getHandle()), chatType, Optionull.map(msgFunction, f -> f.apply(viewer)));
|
||||
+ } else if (viewer instanceof ForwardingAudience.Single single) {
|
||||
+ this.sendNative(single.audience(), chatType, msgFunction);
|
||||
+ } else {
|
||||
|
@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ this.getJumpControl().tick();
|
||||
+ }
|
||||
+ if (this.isSensitiveToWater() && isInWaterRainOrBubble()) {
|
||||
+ hurt(DamageSource.DROWN, 1.0F);
|
||||
+ hurt(this.damageSources().drown(), 1.0F);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
|
@ -144,7 +144,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ this.getHandle().setPodium(null);
|
||||
+ } else {
|
||||
+ org.apache.commons.lang.Validate.isTrue(location.getWorld() == null || location.getWorld().equals(getWorld()), "You cannot set a podium in a different world to where the dragon is");
|
||||
+ this.getHandle().setPodium(new net.minecraft.core.BlockPos(location.getX(), location.getY(), location.getZ()));
|
||||
+ this.getHandle().setPodium(io.papermc.paper.util.MCUtil.toBlockPos(location));
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ private static final int CURRENT_DATA_VERSION = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
|
||||
+ private static final int CURRENT_DATA_VERSION = net.minecraft.SharedConstants.getCurrentVersion().getDataVersion().getVersion();
|
||||
+ private static final boolean JUST_CORRUPT_IT = Boolean.getBoolean("Paper.ignoreWorldDataVersion");
|
||||
+ // Paper end
|
||||
public static InProgressChunkHolder loadChunk(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt, boolean distinguish) {
|
||||
|
@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@Nullable
|
||||
private Advancement lastSelectedTab;
|
||||
private boolean isFirstPacket = true;
|
||||
+ public final Map<net.minecraft.advancements.critereon.SimpleCriterionTrigger, Set<CriterionTrigger.Listener>> criterionData = Maps.newIdentityHashMap(); // Paper - fix advancement data player leakage
|
||||
+ public final Map<net.minecraft.advancements.critereon.SimpleCriterionTrigger, Set<CriterionTrigger.Listener>> criterionData = new java.util.IdentityHashMap<>(); // Paper - fix advancement data player leakage
|
||||
|
||||
public PlayerAdvancements(DataFixer dataFixer, PlayerList playerManager, ServerAdvancementManager advancementLoader, Path filePath, ServerPlayer owner) {
|
||||
this.dataFixer = dataFixer;
|
||||
|
@ -72,24 +72,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import com.google.common.base.Strings;
|
||||
+import com.mojang.authlib.GameProfile;
|
||||
+import io.papermc.paper.adventure.AdventureComponent;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Collections;
|
||||
+import java.util.List;
|
||||
+import java.util.Optional;
|
||||
+import java.util.UUID;
|
||||
+import javax.annotation.Nonnull;
|
||||
+import net.minecraft.network.Connection;
|
||||
+import net.minecraft.network.chat.Component;
|
||||
+import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket;
|
||||
+import net.minecraft.network.protocol.status.ServerStatus;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.craftbukkit.util.CraftIconCache;
|
||||
+
|
||||
+public final class StandardPaperServerListPingEventImpl extends PaperServerListPingEventImpl {
|
||||
+
|
||||
+ private static final GameProfile[] EMPTY_PROFILES = new GameProfile[0];
|
||||
+ // private static final GameProfile[] EMPTY_PROFILES = new GameProfile[0];
|
||||
+ private static final UUID FAKE_UUID = new UUID(0, 0);
|
||||
+
|
||||
+ private GameProfile[] originalSample;
|
||||
+ private List<GameProfile> originalSample;
|
||||
+
|
||||
+ private StandardPaperServerListPingEventImpl(MinecraftServer server, Connection networkManager, ServerStatus ping) {
|
||||
+ super(server, new PaperStatusClient(networkManager), ping.getVersion() != null ? ping.getVersion().getProtocol() : -1, server.server.getServerIcon());
|
||||
+ this.originalSample = ping.getPlayers() == null ? null : ping.getPlayers().getSample(); // GH-1473 - pre-tick race condition NPE
|
||||
+ super(server, new PaperStatusClient(networkManager), ping.version().map(ServerStatus.Version::protocol).orElse(-1), server.server.getServerIcon());
|
||||
+ this.originalSample = ping.players().map(ServerStatus.Players::sample).orElse(null); // GH-1473 - pre-tick race condition NPE
|
||||
+ }
|
||||
+
|
||||
+ @Nonnull
|
||||
@ -107,18 +112,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return sample;
|
||||
+ }
|
||||
+
|
||||
+ private GameProfile[] getPlayerSampleHandle() {
|
||||
+ private List<GameProfile> getPlayerSampleHandle() {
|
||||
+ if (this.originalSample != null) {
|
||||
+ return this.originalSample;
|
||||
+ }
|
||||
+
|
||||
+ List<PlayerProfile> entries = super.getPlayerSample();
|
||||
+ if (entries.isEmpty()) {
|
||||
+ return EMPTY_PROFILES;
|
||||
+ return Collections.emptyList();
|
||||
+ }
|
||||
+
|
||||
+ GameProfile[] profiles = new GameProfile[entries.size()];
|
||||
+ for (int i = 0; i < profiles.length; i++) {
|
||||
+ final List<GameProfile> profiles = new ArrayList<>();
|
||||
+ for (PlayerProfile profile : entries) {
|
||||
+ /*
|
||||
+ * Avoid null UUIDs/names since that will make the response invalid
|
||||
+ * on the client.
|
||||
@ -126,19 +131,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * This can be used to create custom lines in the player list that do not
|
||||
+ * refer to a specific player.
|
||||
+ */
|
||||
+
|
||||
+ PlayerProfile profile = entries.get(i);
|
||||
+ if (profile.getId() != null && profile.getName() != null) {
|
||||
+ profiles[i] = CraftPlayerProfile.asAuthlib(profile);
|
||||
+ profiles.add(CraftPlayerProfile.asAuthlib(profile));
|
||||
+ } else {
|
||||
+ profiles[i] = new GameProfile(MoreObjects.firstNonNull(profile.getId(), FAKE_UUID), Strings.nullToEmpty(profile.getName()));
|
||||
+ profiles.add(new GameProfile(MoreObjects.firstNonNull(profile.getId(), FAKE_UUID), Strings.nullToEmpty(profile.getName())));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return profiles;
|
||||
+ }
|
||||
+
|
||||
+ @SuppressWarnings("deprecation")
|
||||
+ public static void processRequest(MinecraftServer server, Connection networkManager) {
|
||||
+ StandardPaperServerListPingEventImpl event = new StandardPaperServerListPingEventImpl(server, networkManager, server.getStatus());
|
||||
+ server.server.getPluginManager().callEvent(event);
|
||||
@ -150,24 +151,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ // Setup response
|
||||
+ ServerStatus ping = new ServerStatus();
|
||||
+
|
||||
+ // Description
|
||||
+ ping.setDescription(new AdventureComponent(event.motd()));
|
||||
+ final Component description = new AdventureComponent(event.motd());
|
||||
+
|
||||
+ // Players
|
||||
+ final Optional<ServerStatus.Players> players;
|
||||
+ if (!event.shouldHidePlayers()) {
|
||||
+ ping.setPlayers(new ServerStatus.Players(event.getMaxPlayers(), event.getNumPlayers()));
|
||||
+ ping.getPlayers().setSample(event.getPlayerSampleHandle());
|
||||
+ players = Optional.of(new ServerStatus.Players(event.getMaxPlayers(), event.getNumPlayers(), event.getPlayerSampleHandle()));
|
||||
+ } else {
|
||||
+ players = Optional.empty();
|
||||
+ }
|
||||
+
|
||||
+ // Version
|
||||
+ ping.setVersion(new ServerStatus.Version(event.getVersion(), event.getProtocolVersion()));
|
||||
+ final ServerStatus.Version version = new ServerStatus.Version(event.getVersion(), event.getProtocolVersion());
|
||||
+
|
||||
+ // Favicon
|
||||
+ final Optional<ServerStatus.Favicon> favicon;
|
||||
+ if (event.getServerIcon() != null) {
|
||||
+ ping.setFavicon(event.getServerIcon().getData());
|
||||
+ favicon = Optional.of(new ServerStatus.Favicon(((CraftIconCache) event.getServerIcon()).value));
|
||||
+ } else {
|
||||
+ favicon = Optional.empty();
|
||||
+ }
|
||||
+ final ServerStatus ping = new ServerStatus(description, players, Optional.of(version), favicon, server.enforceSecureProfile());
|
||||
+
|
||||
+ // Send response
|
||||
+ networkManager.send(new ClientboundStatusResponsePacket(ping));
|
||||
@ -215,7 +221,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.connection.send(new ClientboundStatusResponsePacket(ping));
|
||||
// CraftBukkit end
|
||||
+ */
|
||||
+ com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.server, this.connection);
|
||||
+ com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(MinecraftServer.getServer(), this.connection);
|
||||
+ // Paper end
|
||||
}
|
||||
}
|
||||
|
@ -719,6 +719,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
public CraftLootable(World world, T tileEntity) {
|
||||
super(world, tileEntity);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSuspiciousSand.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSuspiciousSand.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSuspiciousSand.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSuspiciousSand.java
|
||||
@@ -0,0 +0,0 @@ public class CraftSuspiciousSand extends CraftBlockEntityState<SuspiciousSandBlo
|
||||
this.setLootTable(this.getLootTable(), seed);
|
||||
}
|
||||
|
||||
- private void setLootTable(LootTable table, long seed) {
|
||||
+ public void setLootTable(LootTable table, long seed) { // Paper - change visibility since it overrides a public method
|
||||
ResourceLocation key = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey());
|
||||
getSnapshot().setLootTable(key, seed);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java
|
||||
|
@ -779,12 +779,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ @Override
|
||||
+ public int getPickupCooldown() {
|
||||
+ return this.getHandle().cooldownTime;
|
||||
+ throw new UnsupportedOperationException("Hopper minecarts don't have cooldowns");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setPickupCooldown(int cooldown) {
|
||||
+ this.getHandle().setCooldown(cooldown);
|
||||
+ throw new UnsupportedOperationException("Hopper minecarts don't have cooldowns");
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
@ -17,10 +17,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause);
|
||||
+ // Paper start - Teleport API
|
||||
+ Set<io.papermc.paper.entity.TeleportFlag.Relative> relativeFlags = java.util.EnumSet.noneOf(io.papermc.paper.entity.TeleportFlag.Relative.class);
|
||||
+ for (net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument relativeArgument : set) {
|
||||
+ for (RelativeMovement relativeArgument : set) {
|
||||
+ relativeFlags.add(org.bukkit.craftbukkit.entity.CraftPlayer.toApiRelativeFlag(relativeArgument));
|
||||
+ }
|
||||
+ PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause, flag, java.util.Set.copyOf(relativeFlags));
|
||||
+ PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause, java.util.Set.copyOf(relativeFlags));
|
||||
+ // Paper end
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
|
||||
|
@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ @Override
|
||||
+ public Location locateNearestBiome(Location origin, Biome biome, int radius, int step) {
|
||||
+ BlockPos originPos = new BlockPos(origin.getX(), origin.getY(), origin.getZ());
|
||||
+ BlockPos originPos = io.papermc.paper.util.MCUtil.toBlockPos(origin);
|
||||
+ Pair<BlockPos, Holder<net.minecraft.world.level.biome.Biome>> pair = getHandle().findClosestBiome3d(holder -> holder.is(CraftNamespacedKey.toMinecraft(biome.getKey())), originPos, radius, step, step);
|
||||
+ if (pair == null) {
|
||||
+ return null;
|
||||
@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ public static net.minecraft.core.BlockPos toBlockPos(org.bukkit.util.Vector bukkit) {
|
||||
+ return new net.minecraft.core.BlockPos(bukkit.getX(), bukkit.getY(), bukkit.getZ());
|
||||
+ return net.minecraft.core.BlockPos.containing(bukkit.getX(), bukkit.getY(), bukkit.getZ());
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
|
||||
- CraftSmithingRecipe recipe = new CraftSmithingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.base), CraftRecipe.toBukkit(this.addition));
|
||||
+ CraftSmithingRecipe recipe = new CraftSmithingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.base), CraftRecipe.toBukkit(this.addition), this.copyNbt); // Paper
|
||||
+ CraftSmithingRecipe recipe = new CraftSmithingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.base), CraftRecipe.toBukkit(this.addition), this.copyNBT); // Paper
|
||||
|
||||
return recipe;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ for (ServerPlayer player : players) {
|
||||
+ CraftPlayer bukkitPlayer = player.getBukkitEntity();
|
||||
+ if (bukkitPlayer.canSee(this)) {
|
||||
+ bukkitPlayer.trackAndShowEntity(self);
|
||||
+ bukkitPlayer.trackAndShowEntity(self.getBukkitEntity());
|
||||
+ }
|
||||
+ }
|
||||
+ // Refresh misc player things AFTER sending game profile
|
||||
|
@ -23142,7 +23142,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- Dynamic<T> dynamic2 = this.type.update(this.fixerUpper, dynamic, j, k);
|
||||
+ // Paper start - route to new converter system
|
||||
+ Dynamic<T> dynamic2;
|
||||
+ if (this.type.getType() == net.minecraft.util.datafix.fixes.References.POI_CHUNK) {
|
||||
+ if (this.type == net.minecraft.util.datafix.DataFixTypes.POI_CHUNK) {
|
||||
+ dynamic2 = new Dynamic<>(dynamic.getOps(), (T)ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.POI_CHUNK, (CompoundTag)dynamic.getValue(), j, k));
|
||||
+ } else {
|
||||
+ dynamic2 = this.type.update(this.fixerUpper, dynamic, j, k);
|
||||
|
@ -58,16 +58,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
player.sentListPacket = true;
|
||||
player.supressTrackerForLogin = false; // Paper
|
||||
((ServerLevel)player.level).getChunkSource().chunkMap.addEntity(player); // Paper - track entity now
|
||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
|
||||
@@ -0,0 +0,0 @@ public class DamageSources {
|
||||
public DamageSource sonicBoom(Entity attacker) {
|
||||
return this.source(DamageTypes.SONIC_BOOM, attacker);
|
||||
}
|
||||
-
|
||||
- public DamageSource badRespawnPointExplosion(Vec3 position) {
|
||||
- return new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), position);
|
||||
- }
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// Paper end
|
||||
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public boolean isDeeplySleeping() {
|
||||
+ return getHandle().isSleepingLongEnough();
|
||||
+ }
|
||||
|
Loading…
Reference in New Issue
Block a user