compile fixes
Dieser Commit ist enthalten in:
Ursprung
d2ef0622c9
Commit
7c6411b930
@ -641,7 +641,7 @@ index 0000000000000000000000000000000000000000..23bd6d2d8fed5a3491e856f8b875456d
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..bfb1904be53112cdff62001c3307c7d5ef89704c
|
index 0000000000000000000000000000000000000000..69347ac0547cba3842040f89615e721b5d1ac3ca
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
@@ -0,0 +1,376 @@
|
@@ -0,0 +1,376 @@
|
||||||
@ -925,7 +925,7 @@ index 0000000000000000000000000000000000000000..bfb1904be53112cdff62001c3307c7d5
|
|||||||
+
|
+
|
||||||
+ private net.kyori.adventure.chat.ChatType.Bound adventure(ChatType.Bound chatType) {
|
+ private net.kyori.adventure.chat.ChatType.Bound adventure(ChatType.Bound chatType) {
|
||||||
+ @Subst("key:value") final String stringKey = Objects.requireNonNull(
|
+ @Subst("key:value") final String stringKey = Objects.requireNonNull(
|
||||||
+ ChatProcessor.this.server.registryAccess().registryOrThrow(Registries.CHAT_TYPE).getKey(chatType.chatType()),
|
+ chatType.chatType().unwrapKey().orElseThrow().location(),
|
||||||
+ () -> "No key for '%s' in CHAT_TYPE registry.".formatted(chatType)
|
+ () -> "No key for '%s' in CHAT_TYPE registry.".formatted(chatType)
|
||||||
+ ).toString();
|
+ ).toString();
|
||||||
+ net.kyori.adventure.chat.@Nullable ChatType adventure = BUILT_IN_CHAT_TYPES.get(stringKey);
|
+ net.kyori.adventure.chat.@Nullable ChatType adventure = BUILT_IN_CHAT_TYPES.get(stringKey);
|
||||||
@ -934,7 +934,7 @@ index 0000000000000000000000000000000000000000..bfb1904be53112cdff62001c3307c7d5
|
|||||||
+ }
|
+ }
|
||||||
+ return adventure.bind(
|
+ return adventure.bind(
|
||||||
+ PaperAdventure.asAdventure(chatType.name()),
|
+ PaperAdventure.asAdventure(chatType.name()),
|
||||||
+ PaperAdventure.asAdventure(chatType.targetName())
|
+ chatType.targetName().map(PaperAdventure::asAdventure).orElse(null)
|
||||||
+ );
|
+ );
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -3587,7 +3587,7 @@ index 9ef8b0327e377817faaf58b82a8fdfa5e801eac8..2dfbe061a064b0c79b96f644a1c3639b
|
|||||||
public String getCustomName() {
|
public String getCustomName() {
|
||||||
BeaconBlockEntity beacon = this.getSnapshot();
|
BeaconBlockEntity beacon = this.getSnapshot();
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
||||||
index f9b89a7c6ac9f7fdbd29567a5b6550398dbc7345..2789d29f5be041a550618d455bb8912ee5162663 100644
|
index f9b89a7c6ac9f7fdbd29567a5b6550398dbc7345..f5b0bec4c1164fe7ef6da1f19a6ce9bb3d6864d0 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
||||||
@@ -45,4 +45,16 @@ public class CraftCommandBlock extends CraftBlockEntityState<CommandBlockEntity>
|
@@ -45,4 +45,16 @@ public class CraftCommandBlock extends CraftBlockEntityState<CommandBlockEntity>
|
||||||
@ -3603,7 +3603,7 @@ index f9b89a7c6ac9f7fdbd29567a5b6550398dbc7345..2789d29f5be041a550618d455bb8912e
|
|||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void name(net.kyori.adventure.text.Component name) {
|
+ 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));
|
+ getSnapshot().getCommandBlock().setCustomName(name == null ? net.minecraft.network.chat.Component.literal("@") : io.papermc.paper.adventure.PaperAdventure.asVanilla(name));
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ for this on CB at one point but I can't find it. We may need to do this
|
|||||||
ourselves at some point in the future.
|
ourselves at some point in the future.
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
index bfb1904be53112cdff62001c3307c7d5ef89704c..1d78e8beacbc93ef2cd6beb418edca843f8a5429 100644
|
index 69347ac0547cba3842040f89615e721b5d1ac3ca..e83f9517b31c5171b8dc75ab63a5bfe654221c84 100644
|
||||||
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
|
||||||
@@ -20,6 +20,7 @@ import net.kyori.adventure.audience.ForwardingAudience;
|
@@ -20,6 +20,7 @@ import net.kyori.adventure.audience.ForwardingAudience;
|
||||||
|
@ -69,10 +69,10 @@ index 1d0964a7f544735a0213d5c7832c71f53db139a9..b90127f9f805fdb5bb43a4b8ad2b1049
|
|||||||
nbt.putShort("MaxNearbyEntities", (short) this.maxNearbyEntities);
|
nbt.putShort("MaxNearbyEntities", (short) this.maxNearbyEntities);
|
||||||
nbt.putShort("RequiredPlayerRange", (short) this.requiredPlayerRange);
|
nbt.putShort("RequiredPlayerRange", (short) this.requiredPlayerRange);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
||||||
index 1a8fe7adf7c3ab9eb4cbc9847df4cfc872b97921..03a464bcb38b23e44bc02d632d469aab1c8b5b23 100644
|
index 1a8fe7adf7c3ab9eb4cbc9847df4cfc872b97921..ebd6b07b8bcad3bc621fe99b0bee394fd2dd154f 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
||||||
@@ -256,4 +256,28 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<SpawnerBlockEnti
|
@@ -256,4 +256,36 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<SpawnerBlockEnti
|
||||||
new HashMap<>(nms.slotDropChances().entrySet().stream().collect(Collectors.toMap((entry) -> CraftEquipmentSlot.getSlot(entry.getKey()), Map.Entry::getValue)))
|
new HashMap<>(nms.slotDropChances().entrySet().stream().collect(Collectors.toMap((entry) -> CraftEquipmentSlot.getSlot(entry.getKey()), Map.Entry::getValue)))
|
||||||
)).orElse(null);
|
)).orElse(null);
|
||||||
}
|
}
|
||||||
@ -96,8 +96,16 @@ index 1a8fe7adf7c3ab9eb4cbc9847df4cfc872b97921..03a464bcb38b23e44bc02d632d469aab
|
|||||||
+ net.minecraft.world.item.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(itemStack);
|
+ net.minecraft.world.item.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(itemStack);
|
||||||
+ net.minecraft.nbt.CompoundTag entity = new net.minecraft.nbt.CompoundTag();
|
+ net.minecraft.nbt.CompoundTag entity = new net.minecraft.nbt.CompoundTag();
|
||||||
+ entity.putString("id", net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getKey(net.minecraft.world.entity.EntityType.ITEM).toString());
|
+ entity.putString("id", net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getKey(net.minecraft.world.entity.EntityType.ITEM).toString());
|
||||||
+ entity.put("Item", item.save(new net.minecraft.nbt.CompoundTag()));
|
+ entity.put("Item", item.save(this.world.getHandle().registryAccess()));
|
||||||
+ this.getSnapshot().getSpawner().setNextSpawnData(this.isPlaced() ? this.world.getHandle() : null, this.getPosition(), new net.minecraft.world.level.SpawnData(entity, java.util.Optional.empty()));
|
+ this.getSnapshot().getSpawner().setNextSpawnData(
|
||||||
|
+ this.isPlaced() ? this.world.getHandle() : null,
|
||||||
|
+ this.getPosition(),
|
||||||
|
+ new net.minecraft.world.level.SpawnData(
|
||||||
|
+ entity,
|
||||||
|
+ java.util.Optional.empty(),
|
||||||
|
+ Optional.ofNullable(this.getSnapshot().getSpawner().nextSpawnData).flatMap(SpawnData::equipment)
|
||||||
|
+ )
|
||||||
|
+ );
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ index 22f27a1ee5bf09247d9bcd50141add4116035735..fb7e956fd7beb741984780a949223091
|
|||||||
testImplementation("org.mockito:mockito-core:5.11.0")
|
testImplementation("org.mockito:mockito-core:5.11.0")
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..e9683b5a76b2dd7fc90f1d2e4538b1abbbe27ef0
|
index 0000000000000000000000000000000000000000..74778e5089814dd3a28e91738e82dfd7b8eb8d4c
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||||
@@ -0,0 +1,376 @@
|
@@ -0,0 +1,376 @@
|
||||||
@ -273,7 +273,7 @@ index 0000000000000000000000000000000000000000..e9683b5a76b2dd7fc90f1d2e4538b1ab
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public static String getUsableName(Class<?> clazz) {
|
+ public static String getUsableName(Class<?> clazz) {
|
||||||
+ String name = MappingEnvironment.reobf() ? ObfHelper.INSTANCE.deobfClassName(clazz.getName()) : clazz.getName();
|
+ String name = io.papermc.paper.util.MappingEnvironment.reobf() ? ObfHelper.INSTANCE.deobfClassName(clazz.getName()) : clazz.getName();
|
||||||
+ name = name.substring(name.lastIndexOf(".") + 1);
|
+ name = name.substring(name.lastIndexOf(".") + 1);
|
||||||
+ boolean flag = false;
|
+ boolean flag = false;
|
||||||
+ // inner classes
|
+ // inner classes
|
||||||
@ -459,10 +459,10 @@ index 0000000000000000000000000000000000000000..b5f75ad725f5933db8f0688b2c0b27d6
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java b/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java b/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..953b0f88cbf0e73c390f8086344f772ac03192bb
|
index 0000000000000000000000000000000000000000..02b3670cfc04209baa56d89f82b65ee30d656923
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java
|
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java
|
||||||
@@ -0,0 +1,213 @@
|
@@ -0,0 +1,216 @@
|
||||||
+package com.destroystokyo.paper.entity.ai;
|
+package com.destroystokyo.paper.entity.ai;
|
||||||
+
|
+
|
||||||
+import java.util.Collection;
|
+import java.util.Collection;
|
||||||
@ -625,7 +625,8 @@ index 0000000000000000000000000000000000000000..953b0f88cbf0e73c390f8086344f772a
|
|||||||
+ public <T extends Mob> Collection<Goal<T>> getRunningGoals(T mob, GoalType type) {
|
+ public <T extends Mob> Collection<Goal<T>> getRunningGoals(T mob, GoalType type) {
|
||||||
+ CraftMob craftMob = (CraftMob) mob;
|
+ CraftMob craftMob = (CraftMob) mob;
|
||||||
+ Set<Goal<T>> goals = new HashSet<>();
|
+ Set<Goal<T>> goals = new HashSet<>();
|
||||||
+ getHandle(craftMob, type).getRunningGoals()
|
+ getHandle(craftMob, type).getAvailableGoals()
|
||||||
|
+ .stream().filter(WrappedGoal::isRunning)
|
||||||
+ .filter(item -> item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type)))
|
+ .filter(item -> item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type)))
|
||||||
+ .forEach(item -> {
|
+ .forEach(item -> {
|
||||||
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
||||||
@ -646,7 +647,9 @@ index 0000000000000000000000000000000000000000..953b0f88cbf0e73c390f8086344f772a
|
|||||||
+ if (internalType == type) {
|
+ if (internalType == type) {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ getHandle(craftMob, internalType).getRunningGoals()
|
+ getHandle(craftMob, internalType).getAvailableGoals()
|
||||||
|
+ .stream()
|
||||||
|
+ .filter(WrappedGoal::isRunning)
|
||||||
+ .filter(item -> !item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type)))
|
+ .filter(item -> !item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type)))
|
||||||
+ .forEach(item -> {
|
+ .forEach(item -> {
|
||||||
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
||||||
|
@ -19,10 +19,10 @@ index 69d093d3450931038ac3d27d7874060d13dc2225..27775df10a490ff75ca377e837393173
|
|||||||
.flatMap(entry -> entry.getKey().stream().map(s -> Map.entry(s, entry.getValue())))
|
.flatMap(entry -> entry.getKey().stream().map(s -> Map.entry(s, entry.getValue())))
|
||||||
diff --git a/src/main/java/io/papermc/paper/command/subcommands/DumpItemCommand.java b/src/main/java/io/papermc/paper/command/subcommands/DumpItemCommand.java
|
diff --git a/src/main/java/io/papermc/paper/command/subcommands/DumpItemCommand.java b/src/main/java/io/papermc/paper/command/subcommands/DumpItemCommand.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..5f0b0fe73a47e6a5ca8706f11e78b4b08e6ccd9a
|
index 0000000000000000000000000000000000000000..5b97a873d20821836820ce2bde54771dc3b86226
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/io/papermc/paper/command/subcommands/DumpItemCommand.java
|
+++ b/src/main/java/io/papermc/paper/command/subcommands/DumpItemCommand.java
|
||||||
@@ -0,0 +1,59 @@
|
@@ -0,0 +1,62 @@
|
||||||
+package io.papermc.paper.command.subcommands;
|
+package io.papermc.paper.command.subcommands;
|
||||||
+
|
+
|
||||||
+import io.papermc.paper.adventure.PaperAdventure;
|
+import io.papermc.paper.adventure.PaperAdventure;
|
||||||
@ -57,6 +57,8 @@ index 0000000000000000000000000000000000000000..5f0b0fe73a47e6a5ca8706f11e78b4b0
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ private void doDumpItem(final CommandSender sender) {
|
+ private void doDumpItem(final CommandSender sender) {
|
||||||
|
+ if (true) throw new UnsupportedOperationException("FIXME"); // TODO
|
||||||
|
+ /*
|
||||||
+ if (!(sender instanceof Player)) {
|
+ if (!(sender instanceof Player)) {
|
||||||
+ sender.sendMessage("Only players can use this command");
|
+ sender.sendMessage("Only players can use this command");
|
||||||
+ return;
|
+ return;
|
||||||
@ -80,5 +82,6 @@ index 0000000000000000000000000000000000000000..5f0b0fe73a47e6a5ca8706f11e78b4b0
|
|||||||
+ .color(GRAY)
|
+ .color(GRAY)
|
||||||
+ .decorate(ITALIC)
|
+ .decorate(ITALIC)
|
||||||
+ .clickEvent(ClickEvent.copyToClipboard(tag == null ? itemId : (itemId + tag))));
|
+ .clickEvent(ClickEvent.copyToClipboard(tag == null ? itemId : (itemId + tag))));
|
||||||
|
+ */
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
|
@ -44,7 +44,7 @@ Co-authored-by: FireInstall <kettnerl@hu-berlin.de>
|
|||||||
Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
|
Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||||
index e9683b5a76b2dd7fc90f1d2e4538b1abbbe27ef0..62a8957cf73c3101ade104f18834a73bf8d594c2 100644
|
index 74778e5089814dd3a28e91738e82dfd7b8eb8d4c..86933746b211a8fa7006b6854c42234a78a37843 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
--- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
|
||||||
@@ -165,7 +165,7 @@ public class MobGoalHelper {
|
@@ -165,7 +165,7 @@ public class MobGoalHelper {
|
||||||
|
@ -44,7 +44,7 @@ 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
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
||||||
index 2789d29f5be041a550618d455bb8912ee5162663..0842a69d711a4e4e3a653e5d1967d44fd31e5829 100644
|
index f5b0bec4c1164fe7ef6da1f19a6ce9bb3d6864d0..138e6539a7786ded482a24aa88a367da7beaabf9 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java
|
||||||
@@ -6,7 +6,7 @@ import org.bukkit.World;
|
@@ -6,7 +6,7 @@ import org.bukkit.World;
|
||||||
@ -58,7 +58,7 @@ index 2789d29f5be041a550618d455bb8912ee5162663..0842a69d711a4e4e3a653e5d1967d44f
|
|||||||
super(world, tileEntity);
|
super(world, tileEntity);
|
||||||
@@ -56,5 +56,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) {
|
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));
|
getSnapshot().getCommandBlock().setCustomName(name == null ? net.minecraft.network.chat.Component.literal("@") : io.papermc.paper.adventure.PaperAdventure.asVanilla(name));
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack Tooltip API
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
index c6ce4e9428b5d6d117def376accdfb0c12b49565..901ce145d8b034559256cf10d97f46ecff1a4003 100644
|
index c6ce4e9428b5d6d117def376accdfb0c12b49565..b8f9731e9fbe435242d7d3ec54ca65871a763562 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
@@ -662,6 +662,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@@ -662,6 +662,20 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||||
return org.bukkit.craftbukkit.CraftStatistic.getNMSStatistic(statistic).getName();
|
return org.bukkit.craftbukkit.CraftStatistic.getNMSStatistic(statistic).getName();
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
@ -20,7 +20,9 @@ index c6ce4e9428b5d6d117def376accdfb0c12b49565..901ce145d8b034559256cf10d97f46ec
|
|||||||
+ if (tooltipContext.isCreative()) {
|
+ if (tooltipContext.isCreative()) {
|
||||||
+ flag = flag.asCreative();
|
+ flag = flag.asCreative();
|
||||||
+ }
|
+ }
|
||||||
+ final java.util.List<net.minecraft.network.chat.Component> lines = CraftItemStack.asNMSCopy(itemStack).getTooltipLines(player == null ? null : ((org.bukkit.craftbukkit.entity.CraftPlayer) player).getHandle(), flag);
|
+ final java.util.List<net.minecraft.network.chat.Component> lines = CraftItemStack.asNMSCopy(itemStack).getTooltipLines(
|
||||||
|
+ net.minecraft.world.item.Item.TooltipContext.of(player == null ? net.minecraft.server.MinecraftServer.getServer().registryAccess() : ((org.bukkit.craftbukkit.entity.CraftPlayer) player).getHandle().level().registryAccess()),
|
||||||
|
+ player == null ? null : ((org.bukkit.craftbukkit.entity.CraftPlayer) player).getHandle(), flag);
|
||||||
+ return lines.stream().map(io.papermc.paper.adventure.PaperAdventure::asAdventure).toList();
|
+ return lines.stream().map(io.papermc.paper.adventure.PaperAdventure::asAdventure).toList();
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - expose itemstack tooltip lines
|
+ // Paper end - expose itemstack tooltip lines
|
||||||
|
@ -28899,7 +28899,7 @@ index 1d287dd7379e56f7fd4b425880b850cd843f5789..8ab7ca373a885fbe658013c9c6a2e38d
|
|||||||
return nbttagcompound;
|
return nbttagcompound;
|
||||||
});
|
});
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
index 901ce145d8b034559256cf10d97f46ecff1a4003..1bdd20802bde86b40a78b336bffeab765841062c 100644
|
index b8f9731e9fbe435242d7d3ec54ca65871a763562..96354aeb0ac36b7d2d3370974380c1a0a58c3276 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
@@ -517,7 +517,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@@ -517,7 +517,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||||
|
@ -8861,23 +8861,23 @@ index 0000000000000000000000000000000000000000..049e20407033073b06fcdeb46c38485f
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkUpgradeGenericStatusTask.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkUpgradeGenericStatusTask.java
|
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkUpgradeGenericStatusTask.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkUpgradeGenericStatusTask.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..5024aafbe607b1fa884fcab42fc05da30a54e185
|
index 0000000000000000000000000000000000000000..259fd6024fb2a4fae1a5751324311f19fed47862
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkUpgradeGenericStatusTask.java
|
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkUpgradeGenericStatusTask.java
|
||||||
@@ -0,0 +1,212 @@
|
@@ -0,0 +1,216 @@
|
||||||
+package io.papermc.paper.chunk.system.scheduling;
|
+package io.papermc.paper.chunk.system.scheduling;
|
||||||
+
|
+
|
||||||
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
|
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
|
||||||
+import ca.spottedleaf.concurrentutil.util.ConcurrentUtil;
|
+import ca.spottedleaf.concurrentutil.util.ConcurrentUtil;
|
||||||
+import com.mojang.datafixers.util.Either;
|
|
||||||
+import com.mojang.logging.LogUtils;
|
+import com.mojang.logging.LogUtils;
|
||||||
+import net.minecraft.server.level.ChunkHolder;
|
|
||||||
+import net.minecraft.server.level.ChunkMap;
|
+import net.minecraft.server.level.ChunkMap;
|
||||||
|
+import net.minecraft.server.level.ChunkResult;
|
||||||
+import net.minecraft.server.level.ServerChunkCache;
|
+import net.minecraft.server.level.ServerChunkCache;
|
||||||
+import net.minecraft.server.level.ServerLevel;
|
+import net.minecraft.server.level.ServerLevel;
|
||||||
+import net.minecraft.world.level.chunk.ChunkAccess;
|
+import net.minecraft.world.level.chunk.ChunkAccess;
|
||||||
+import net.minecraft.world.level.chunk.status.ChunkStatus;
|
+import net.minecraft.world.level.chunk.status.ChunkStatus;
|
||||||
+import net.minecraft.world.level.chunk.ProtoChunk;
|
+import net.minecraft.world.level.chunk.ProtoChunk;
|
||||||
|
+import net.minecraft.world.level.chunk.status.WorldGenContext;
|
||||||
+import org.slf4j.Logger;
|
+import org.slf4j.Logger;
|
||||||
+import java.lang.invoke.VarHandle;
|
+import java.lang.invoke.VarHandle;
|
||||||
+import java.util.List;
|
+import java.util.List;
|
||||||
@ -8931,7 +8931,7 @@ index 0000000000000000000000000000000000000000..5024aafbe607b1fa884fcab42fc05da3
|
|||||||
+ final ServerChunkCache serverChunkCache = this.world.chunkSource;
|
+ final ServerChunkCache serverChunkCache = this.world.chunkSource;
|
||||||
+ final ChunkMap chunkMap = serverChunkCache.chunkMap;
|
+ final ChunkMap chunkMap = serverChunkCache.chunkMap;
|
||||||
+
|
+
|
||||||
+ final CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completeFuture;
|
+ final CompletableFuture<ChunkAccess> completeFuture;
|
||||||
+
|
+
|
||||||
+ final boolean generation;
|
+ final boolean generation;
|
||||||
+ boolean completing = false;
|
+ boolean completing = false;
|
||||||
@ -8939,6 +8939,12 @@ index 0000000000000000000000000000000000000000..5024aafbe607b1fa884fcab42fc05da3
|
|||||||
+ // note: should optimise the case where the chunk does not need to execute the status, because
|
+ // note: should optimise the case where the chunk does not need to execute the status, because
|
||||||
+ // schedule() calls this synchronously if it will run through that path
|
+ // schedule() calls this synchronously if it will run through that path
|
||||||
+
|
+
|
||||||
|
+ final WorldGenContext ctx = new WorldGenContext(
|
||||||
|
+ this.world,
|
||||||
|
+ chunkMap.generator,
|
||||||
|
+ chunkMap.getWorldGenContext().structureManager(),
|
||||||
|
+ serverChunkCache.getLightEngine()
|
||||||
|
+ );
|
||||||
+ try {
|
+ try {
|
||||||
+ generation = !chunk.getStatus().isOrAfter(this.toStatus);
|
+ generation = !chunk.getStatus().isOrAfter(this.toStatus);
|
||||||
+ if (generation) {
|
+ if (generation) {
|
||||||
@ -8950,12 +8956,10 @@ index 0000000000000000000000000000000000000000..5024aafbe607b1fa884fcab42fc05da3
|
|||||||
+ this.complete(chunk, null);
|
+ this.complete(chunk, null);
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ completeFuture = this.toStatus.generate(Runnable::run, this.world, chunkMap.generator, chunkMap.structureTemplateManager,
|
+ completeFuture = this.toStatus.generate(ctx, Runnable::run, null, this.neighbours)
|
||||||
+ serverChunkCache.getLightEngine(), null, this.neighbours)
|
+ .whenComplete((final ChunkAccess either, final Throwable throwable) -> {
|
||||||
+ .whenComplete((final Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either, final Throwable throwable) -> {
|
+ if (either instanceof ProtoChunk proto) {
|
||||||
+ final ChunkAccess newChunk = (either == null) ? null : either.left().orElse(null);
|
+ proto.setStatus(ChunkUpgradeGenericStatusTask.this.toStatus);
|
||||||
+ if (newChunk instanceof ProtoChunk) {
|
|
||||||
+ ((ProtoChunk)newChunk).setStatus(ChunkUpgradeGenericStatusTask.this.toStatus);
|
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ );
|
+ );
|
||||||
@ -8965,7 +8969,7 @@ index 0000000000000000000000000000000000000000..5024aafbe607b1fa884fcab42fc05da3
|
|||||||
+ this.complete(chunk, null);
|
+ this.complete(chunk, null);
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ completeFuture = this.toStatus.load(this.world, chunkMap.structureTemplateManager, serverChunkCache.getLightEngine(), null, chunk);
|
+ completeFuture = this.toStatus.load(ctx, null, chunk);
|
||||||
+ }
|
+ }
|
||||||
+ } catch (final Throwable throwable) {
|
+ } catch (final Throwable throwable) {
|
||||||
+ if (!completing) {
|
+ if (!completing) {
|
||||||
@ -8996,12 +9000,12 @@ index 0000000000000000000000000000000000000000..5024aafbe607b1fa884fcab42fc05da3
|
|||||||
+ LOGGER.warn("Future status not complete after scheduling: " + this.toStatus.toString() + ", generate: " + generation);
|
+ LOGGER.warn("Future status not complete after scheduling: " + this.toStatus.toString() + ", generate: " + generation);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ final Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either;
|
+ final ChunkResult<ChunkAccess> either;
|
||||||
+ final ChunkAccess newChunk;
|
+ final ChunkAccess newChunk;
|
||||||
+
|
+
|
||||||
+ try {
|
+ try {
|
||||||
+ either = completeFuture.join();
|
+ either = completeFuture.join();
|
||||||
+ newChunk = (either == null) ? null : either.left().orElse(null);
|
+ newChunk = (either == null) ? null : either.orElse(null);
|
||||||
+ } catch (final Throwable throwable) {
|
+ } catch (final Throwable throwable) {
|
||||||
+ this.complete(null, throwable);
|
+ this.complete(null, throwable);
|
||||||
+ // ensure the chunk system can respond, then die
|
+ // ensure the chunk system can respond, then die
|
||||||
|
@ -20,13 +20,14 @@ Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
|
|||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/world/worldgen/OptionallyFlatBedrockConditionSource.java b/src/main/java/io/papermc/paper/world/worldgen/OptionallyFlatBedrockConditionSource.java
|
diff --git a/src/main/java/io/papermc/paper/world/worldgen/OptionallyFlatBedrockConditionSource.java b/src/main/java/io/papermc/paper/world/worldgen/OptionallyFlatBedrockConditionSource.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..02d98ec591b676acf64460d14d608860d32a362a
|
index 0000000000000000000000000000000000000000..e0d73113c937ddbcf8144f88b15a8d3d080b90a0
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/io/papermc/paper/world/worldgen/OptionallyFlatBedrockConditionSource.java
|
+++ b/src/main/java/io/papermc/paper/world/worldgen/OptionallyFlatBedrockConditionSource.java
|
||||||
@@ -0,0 +1,76 @@
|
@@ -0,0 +1,80 @@
|
||||||
+package io.papermc.paper.world.worldgen;
|
+package io.papermc.paper.world.worldgen;
|
||||||
+
|
+
|
||||||
+import com.mojang.serialization.Codec;
|
+import com.mojang.serialization.Codec;
|
||||||
|
+import com.mojang.serialization.MapCodec;
|
||||||
+import com.mojang.serialization.codecs.RecordCodecBuilder;
|
+import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
+import net.minecraft.core.Registry;
|
+import net.minecraft.core.Registry;
|
||||||
+import net.minecraft.core.registries.BuiltInRegistries;
|
+import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
@ -46,7 +47,10 @@ index 0000000000000000000000000000000000000000..02d98ec591b676acf64460d14d608860
|
|||||||
+@DefaultQualifier(NonNull.class)
|
+@DefaultQualifier(NonNull.class)
|
||||||
+public record OptionallyFlatBedrockConditionSource(ResourceLocation randomName, VerticalAnchor trueAtAndBelow, VerticalAnchor falseAtAndAbove, boolean isRoof) implements SurfaceRules.ConditionSource {
|
+public record OptionallyFlatBedrockConditionSource(ResourceLocation randomName, VerticalAnchor trueAtAndBelow, VerticalAnchor falseAtAndAbove, boolean isRoof) implements SurfaceRules.ConditionSource {
|
||||||
+
|
+
|
||||||
+ private static final ResourceKey<Codec<? extends SurfaceRules.ConditionSource>> CODEC_RESOURCE_KEY = ResourceKey.create(Registries.MATERIAL_CONDITION, new ResourceLocation(ResourceLocation.PAPER_NAMESPACE, "optionally_flat_bedrock_condition_source"));
|
+ private static final ResourceKey<MapCodec<? extends SurfaceRules.ConditionSource>> CODEC_RESOURCE_KEY = ResourceKey.create(
|
||||||
|
+ Registries.MATERIAL_CONDITION,
|
||||||
|
+ new ResourceLocation(ResourceLocation.PAPER_NAMESPACE, "optionally_flat_bedrock_condition_source")
|
||||||
|
+ );
|
||||||
+ private static final KeyDispatchDataCodec<OptionallyFlatBedrockConditionSource> CODEC = KeyDispatchDataCodec.of(RecordCodecBuilder.mapCodec((instance) -> {
|
+ private static final KeyDispatchDataCodec<OptionallyFlatBedrockConditionSource> CODEC = KeyDispatchDataCodec.of(RecordCodecBuilder.mapCodec((instance) -> {
|
||||||
+ return instance.group(
|
+ return instance.group(
|
||||||
+ ResourceLocation.CODEC.fieldOf("random_name").forGetter(OptionallyFlatBedrockConditionSource::randomName),
|
+ ResourceLocation.CODEC.fieldOf("random_name").forGetter(OptionallyFlatBedrockConditionSource::randomName),
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren