More compile fixes

This commit is contained in:
Nassim Jahnke 2023-12-06 20:10:59 +01:00
parent 61209168b7
commit b7ab883a24
10 changed files with 26 additions and 46 deletions

View File

@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Override
+ public void resetScore() {
+ Scoreboard board = this.objective.checkState().board;
+ board.resetPlayerScore(entry, this.objective.getHandle());
+ board.resetSinglePlayerScore(entry, this.objective.getHandle());
+ }
+ // Paper end
}

View File

@ -50,7 +50,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ CompoundTag compound;
+ try {
+ compound = net.minecraft.nbt.NbtIo.readCompressed(
+ new java.io.ByteArrayInputStream(data)
+ new java.io.ByteArrayInputStream(data), net.minecraft.nbt.NbtAccounter.unlimitedHeap()
+ );
+ } catch (IOException ex) {
+ throw new RuntimeException(ex);

View File

@ -1683,12 +1683,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- Component component = chatDecorator.decorate(source.getPlayer(), message.decoratedContent());
- callback.accept(message.withUnsignedContent(component));
+ // Paper start
+ source.getChatMessageChainer().append(executor -> {
+ CompletableFuture<ChatDecorator.Result> componentFuture = chatDecorator.decorate(source.getPlayer(), source, message.decoratedContent());
+ return componentFuture.thenAcceptAsync((result) -> {
+ callback.accept(message.withUnsignedContent(result.component()));
+ }, executor);
+ });
+ CompletableFuture<ChatDecorator.Result> componentFuture = chatDecorator.decorate(source.getPlayer(), source, message.decoratedContent());
+ source.getChatMessageChainer().append(() -> componentFuture.thenAccept((result) -> callback.accept(message.withUnsignedContent(result.component()))));
+ // Paper end
}

View File

@ -11,7 +11,6 @@ public org.bukkit.craftbukkit.profile.CraftPlayerTextures
public org.bukkit.craftbukkit.profile.CraftPlayerTextures copyFrom(Lorg/bukkit/profile/PlayerTextures;)V
public org.bukkit.craftbukkit.profile.CraftPlayerTextures rebuildPropertyIfDirty()V
public org.bukkit.craftbukkit.profile.CraftPlayerProfile toString(Lcom/mojang/authlib/properties/PropertyMap;)Ljava/lang/String;
# needed to maintain visibility with overridden methods
public org.bukkit.craftbukkit.profile.CraftPlayerProfile getProperty(Ljava/lang/String;)Lcom/mojang/authlib/properties/Property;
public org.bukkit.craftbukkit.profile.CraftPlayerProfile setProperty(Ljava/lang/String;Lcom/mojang/authlib/properties/Property;)V
@ -498,15 +497,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package com.destroystokyo.paper.profile;
+
+import com.mojang.authlib.Environment;
+import com.mojang.authlib.GameProfile;
+import com.mojang.authlib.minecraft.MinecraftProfileTexture;
+import com.mojang.authlib.yggdrasil.ProfileResult;
+import com.mojang.authlib.yggdrasil.ServicesKeySet;
+import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
+import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService;
+
+import java.net.Proxy;
+import java.util.Map;
+import java.util.UUID;
+import org.jetbrains.annotations.Nullable;
+
@ -517,11 +512,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> getTextures(GameProfile profile, boolean requireSecure) {
+ return super.getTextures(profile, requireSecure);
+ }
+
+ @Override
+ public @Nullable ProfileResult fetchProfile(final UUID profileId, final boolean requireSecure) {
+ return super.fetchProfile(profileId, requireSecure);
+ }

View File

@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Sat, 18 Feb 2017 19:29:58 -0600
Subject: [PATCH] Do not let armorstands drown
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -0,0 +0,0 @@ public class ArmorStand extends LivingEntity {
super.move(type, movement);
}
}
+
+ // Paper start
+ @Override
+ public boolean canBreatheUnderwater() { // Skips a bit of damage handling code, probably a micro-optimization
+ return true;
+ }
+ // Paper end
// Paper end
}

View File

@ -14,8 +14,16 @@ diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSession
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
@@ -0,0 +0,0 @@
package com.destroystokyo.paper.profile;
import com.mojang.authlib.Environment;
+import com.mojang.authlib.GameProfile;
import com.mojang.authlib.yggdrasil.ProfileResult;
import com.mojang.authlib.yggdrasil.ServicesKeySet;
import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService;
@@ -0,0 +0,0 @@ public class PaperMinecraftSessionService extends YggdrasilMinecraftSessionServi
return super.getTextures(profile, requireSecure);
super(servicesKeySet, proxy, environment);
}
- @Override

View File

@ -59,6 +59,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Optional<Direction> optional = state.getOptionalValue(TripWireHookBlock.FACING);
if (optional.isPresent()) {
@@ -0,0 +0,0 @@ public class TripWireHookBlock extends Block {
boolean flag2 = (Boolean) state.getOptionalValue(TripWireHookBlock.ATTACHED).orElse(false);
boolean flag3 = (Boolean) state.getOptionalValue(TripWireHookBlock.POWERED).orElse(false);
Block block = state.getBlock();
- boolean flag4 = !flag;
+ boolean flag4 = !beingRemoved; // Paper
boolean flag5 = false;
int j = 0;
BlockState[] aiblockdata = new BlockState[42];
@@ -0,0 +0,0 @@ public class TripWireHookBlock extends Block {
boolean flag7 = (Boolean) iblockdata2.getValue(TripWireBlock.POWERED);

View File

@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ boolean placing = bl2;
+ org.bukkit.block.Block bukkitblock = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos);
+ org.bukkit.inventory.ItemStack bukkititemstack = org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemStack);
+ org.bukkit.Material mat = org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(content);
+ org.bukkit.Material mat = org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(this.potted);
+ org.bukkit.inventory.ItemStack bukkititemstack1 = new org.bukkit.inventory.ItemStack(mat, 1);
+ org.bukkit.inventory.ItemStack whichitem = placing ? bukkititemstack : bukkititemstack1;
+

View File

@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
vector.add("Memory use: " + (data.getUsedMem() / 1024L / 1024L) + " mb (" + (data.getFree() * 100L / data.getMax()) + "% free)");
vector.add("Heap: " + (data.getTotal() / 1024L / 1024L) + " / " + (data.getMax() / 1024L / 1024L) + " mb");
vector.add("Avg tick: " + DECIMAL_FORMAT.format(getAverage(server.tickTimes)) + " ms");
vector.add("Avg tick: " + DECIMAL_FORMAT.format(this.getAverage(server.getTickTimesNanos())) + " ms");
+ vector.add("TPS from last 1m, 5m, 15m: " + String.join(", ", tpsAvg));
+
setListData(vector);

View File

@ -221,14 +221,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Vector<String> vector = new Vector<>();
+ vector.add("Memory use: " + (data.getUsedMem() / 1024L / 1024L) + " mb (" + (data.getFree() * 100L / data.getMax()) + "% free)");
+ vector.add("Heap: " + (data.getTotal() / 1024L / 1024L) + " / " + (data.getMax() / 1024L / 1024L) + " mb");
+ vector.add("Avg tick: " + DECIMAL_FORMAT.format(getAverage(server.tickTimes)) + " ms");
+ vector.add("Avg tick: " + DECIMAL_FORMAT.format(this.getAverage(server.getTickTimesNanos())) + " ms");
+ setListData(vector);
+ }
+
+ public double getAverage(long[] tickTimes) {
+ long total = 0L;
+ for (long value : tickTimes) {
+ total += value;
+ total += value * 1000;
+ }
+ return ((double) total / (double) tickTimes.length) * 1.0E-6D;
+ }