Archiviert
13
0

Compiler issue v5

Dieser Commit ist enthalten in:
Bjarne Koll 2024-10-25 18:08:28 +02:00
Ursprung bb124f4021
Commit 0a8fd78e37
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 27F6CCCF55D2EE62
42 geänderte Dateien mit 97 neuen und 87 gelöschten Zeilen

Datei anzeigen

@ -3140,7 +3140,7 @@ index 0000000000000000000000000000000000000000..36ca88b677e1b55b41c52750948d5b6d
+} +}
diff --git a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryEntrySerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryEntrySerializer.java diff --git a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryEntrySerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryEntrySerializer.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..9073c619f14feb7a14bf32a504eb935f6d4cfe2e index 0000000000000000000000000000000000000000..cb0de1a639578320fd38177a915bfa5d1e9a73bd
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryEntrySerializer.java +++ b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryEntrySerializer.java
@@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
@ -3178,7 +3178,7 @@ index 0000000000000000000000000000000000000000..9073c619f14feb7a14bf32a504eb935f
+ } + }
+ +
+ protected final Registry<R> registry() { + protected final Registry<R> registry() {
+ return this.registryAccess.registryOrThrow(this.registryKey); + return this.registryAccess.lookupOrThrow(this.registryKey);
+ } + }
+ +
+ protected abstract T convertFromResourceKey(ResourceKey<R> key) throws SerializationException; + protected abstract T convertFromResourceKey(ResourceKey<R> key) throws SerializationException;
@ -3210,7 +3210,7 @@ index 0000000000000000000000000000000000000000..9073c619f14feb7a14bf32a504eb935f
+} +}
diff --git a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryHolderSerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryHolderSerializer.java diff --git a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryHolderSerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryHolderSerializer.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..eeae35ede747e473ddba4ca1688f2f6cbc35ce7d index 0000000000000000000000000000000000000000..76f6219eac049afef7ce03cd30d7c3232b5b9b7c
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryHolderSerializer.java +++ b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryHolderSerializer.java
@@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
@ -3240,7 +3240,7 @@ index 0000000000000000000000000000000000000000..eeae35ede747e473ddba4ca1688f2f6c
+ +
+ @Override + @Override
+ protected Holder<T> convertFromResourceKey(ResourceKey<T> key) throws SerializationException { + protected Holder<T> convertFromResourceKey(ResourceKey<T> key) throws SerializationException {
+ return this.registry().getHolder(key).orElseThrow(() -> new SerializationException("Missing holder in " + this.registry().key() + " with key " + key)); + return this.registry().get(key).orElseThrow(() -> new SerializationException("Missing holder in " + this.registry().key() + " with key " + key));
+ } + }
+ +
+ @Override + @Override
@ -3250,7 +3250,7 @@ index 0000000000000000000000000000000000000000..eeae35ede747e473ddba4ca1688f2f6c
+} +}
diff --git a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java diff --git a/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..718377ce91a010a48b2b4a5e59e02ee8a42107a7 index 0000000000000000000000000000000000000000..6831b7b72c5e1f79eff36019ca2ff56531c26df8
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java +++ b/src/main/java/io/papermc/paper/configuration/serializer/registry/RegistryValueSerializer.java
@@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
@ -3277,7 +3277,7 @@ index 0000000000000000000000000000000000000000..718377ce91a010a48b2b4a5e59e02ee8
+ +
+ @Override + @Override
+ protected T convertFromResourceKey(ResourceKey<T> key) throws SerializationException { + protected T convertFromResourceKey(ResourceKey<T> key) throws SerializationException {
+ final T value = this.registry().get(key); + final T value = this.registry().getValue(key);
+ if (value == null) { + if (value == null) {
+ throw new SerializationException("Missing value in " + this.registry() + " with key " + key.location()); + throw new SerializationException("Missing value in " + this.registry() + " with key " + key.location());
+ } + }
@ -3617,7 +3617,7 @@ index 0000000000000000000000000000000000000000..66073f7a6a96405348cc4044ad1e6922
+} +}
diff --git a/src/main/java/io/papermc/paper/configuration/transformation/world/FeatureSeedsGeneration.java b/src/main/java/io/papermc/paper/configuration/transformation/world/FeatureSeedsGeneration.java diff --git a/src/main/java/io/papermc/paper/configuration/transformation/world/FeatureSeedsGeneration.java b/src/main/java/io/papermc/paper/configuration/transformation/world/FeatureSeedsGeneration.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..6cdc40cb4a5f94654c874f9dbdb106fa0e4d41f3 index 0000000000000000000000000000000000000000..cb1f5f65c098470dc8553b015d0f0f29f28ed956
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/transformation/world/FeatureSeedsGeneration.java +++ b/src/main/java/io/papermc/paper/configuration/transformation/world/FeatureSeedsGeneration.java
@@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
@ -3668,7 +3668,7 @@ index 0000000000000000000000000000000000000000..6cdc40cb4a5f94654c874f9dbdb106fa
+ final Reference2LongMap<Holder<ConfiguredFeature<?, ?>>> features = Objects.requireNonNullElseGet(featureNode.get(new TypeToken<Reference2LongMap<Holder<ConfiguredFeature<?, ?>>>>() {}), Reference2LongOpenHashMap::new); + final Reference2LongMap<Holder<ConfiguredFeature<?, ?>>> features = Objects.requireNonNullElseGet(featureNode.get(new TypeToken<Reference2LongMap<Holder<ConfiguredFeature<?, ?>>>>() {}), Reference2LongOpenHashMap::new);
+ final Random random = new SecureRandom(); + final Random random = new SecureRandom();
+ AtomicInteger counter = new AtomicInteger(0); + AtomicInteger counter = new AtomicInteger(0);
+ MinecraftServer.getServer().registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).holders().forEach(holder -> { + MinecraftServer.getServer().registryAccess().lookupOrThrow(Registries.CONFIGURED_FEATURE).listElements().forEach(holder -> {
+ if (features.containsKey(holder)) { + if (features.containsKey(holder)) {
+ return; + return;
+ } + }
@ -3694,7 +3694,7 @@ index 0000000000000000000000000000000000000000..6cdc40cb4a5f94654c874f9dbdb106fa
+} +}
diff --git a/src/main/java/io/papermc/paper/configuration/transformation/world/LegacyPaperWorldConfig.java b/src/main/java/io/papermc/paper/configuration/transformation/world/LegacyPaperWorldConfig.java diff --git a/src/main/java/io/papermc/paper/configuration/transformation/world/LegacyPaperWorldConfig.java b/src/main/java/io/papermc/paper/configuration/transformation/world/LegacyPaperWorldConfig.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..3332531d902899a156179ef2e9ec85b2f42c1fd1 index 0000000000000000000000000000000000000000..77e530830dc8ebc861b2e70f787f9b71524a54d2
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/transformation/world/LegacyPaperWorldConfig.java +++ b/src/main/java/io/papermc/paper/configuration/transformation/world/LegacyPaperWorldConfig.java
@@ -0,0 +1,322 @@ @@ -0,0 +1,322 @@
@ -3805,7 +3805,7 @@ index 0000000000000000000000000000000000000000..3332531d902899a156179ef2e9ec85b2
+ ) + )
+ .addVersion(26, ConfigurationTransformation.builder().addAction(path("alt-item-despawn-rate", "items", ConfigurationTransformation.WILDCARD_OBJECT), (path, value) -> { + .addVersion(26, ConfigurationTransformation.builder().addAction(path("alt-item-despawn-rate", "items", ConfigurationTransformation.WILDCARD_OBJECT), (path, value) -> {
+ String itemName = path.get(path.size() - 1).toString(); + String itemName = path.get(path.size() - 1).toString();
+ final Optional<Holder.Reference<Item>> item = BuiltInRegistries.ITEM.getHolder(ResourceKey.create(Registries.ITEM, ResourceLocation.parse(itemName.toLowerCase(Locale.ROOT)))); + final Optional<Holder.Reference<Item>> item = BuiltInRegistries.ITEM.get(ResourceKey.create(Registries.ITEM, ResourceLocation.parse(itemName.toLowerCase(Locale.ROOT))));
+ if (item.isEmpty()) { + if (item.isEmpty()) {
+ itemName = Material.valueOf(itemName).getKey().getKey(); + itemName = Material.valueOf(itemName).getKey().getKey();
+ } + }
@ -3837,7 +3837,7 @@ index 0000000000000000000000000000000000000000..3332531d902899a156179ef2e9ec85b2
+ Map<String, Integer> rebuild = new HashMap<>(); + Map<String, Integer> rebuild = new HashMap<>();
+ value.childrenMap().forEach((key, node) -> { + value.childrenMap().forEach((key, node) -> {
+ String itemName = key.toString(); + String itemName = key.toString();
+ final Optional<Holder.Reference<Item>> itemHolder = BuiltInRegistries.ITEM.getHolder(ResourceKey.create(Registries.ITEM, ResourceLocation.parse(itemName.toLowerCase(Locale.ROOT)))); + final Optional<Holder.Reference<Item>> itemHolder = BuiltInRegistries.ITEM.get(ResourceKey.create(Registries.ITEM, ResourceLocation.parse(itemName.toLowerCase(Locale.ROOT))));
+ final @Nullable String item; + final @Nullable String item;
+ if (itemHolder.isEmpty()) { + if (itemHolder.isEmpty()) {
+ final @Nullable Material bukkitMat = Material.matchMaterial(itemName); + final @Nullable Material bukkitMat = Material.matchMaterial(itemName);

Datei anzeigen

@ -14,10 +14,10 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java b/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java diff --git a/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java b/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..8dcedc5f4d4453fd942787dbcb9c757274ec7715 index 0000000000000000000000000000000000000000..2c5702a42c4a3d8b37deeb26e1bd7fbdcca3554e
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java +++ b/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java
@@ -0,0 +1,446 @@ @@ -0,0 +1,450 @@
+package io.papermc.paper.adventure; +package io.papermc.paper.adventure;
+ +
+import com.google.gson.JsonElement; +import com.google.gson.JsonElement;
@ -61,6 +61,7 @@ index 0000000000000000000000000000000000000000..8dcedc5f4d4453fd942787dbcb9c7572
+import net.kyori.adventure.text.format.TextColor; +import net.kyori.adventure.text.format.TextColor;
+import net.kyori.adventure.text.format.TextDecoration; +import net.kyori.adventure.text.format.TextDecoration;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; +import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
+import net.minecraft.commands.arguments.selector.SelectorPattern;
+import net.minecraft.core.UUIDUtil; +import net.minecraft.core.UUIDUtil;
+import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.BuiltInRegistries;
+import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.CompoundTag;
@ -146,7 +147,7 @@ index 0000000000000000000000000000000000000000..8dcedc5f4d4453fd942787dbcb9c7572
+ @Subst("key") final String typeKey = isi.item.unwrapKey().orElseThrow().location().toString(); + @Subst("key") final String typeKey = isi.item.unwrapKey().orElseThrow().location().toString();
+ return HoverEvent.ShowItem.showItem(Key.key(typeKey), isi.count, PaperAdventure.asAdventure(isi.getItemStack().getComponentsPatch())); + return HoverEvent.ShowItem.showItem(Key.key(typeKey), isi.count, PaperAdventure.asAdventure(isi.getItemStack().getComponentsPatch()));
+ }, si -> { + }, si -> {
+ final Item itemType = BuiltInRegistries.ITEM.get(PaperAdventure.asVanilla(si.item())); + final Item itemType = BuiltInRegistries.ITEM.getValue(PaperAdventure.asVanilla(si.item()));
+ final Map<Key, DataComponentValue> dataComponentsMap = si.dataComponents(); + final Map<Key, DataComponentValue> dataComponentsMap = si.dataComponents();
+ final ItemStack stack = new ItemStack(BuiltInRegistries.ITEM.wrapAsHolder(itemType), si.count(), PaperAdventure.asVanilla(dataComponentsMap)); + final ItemStack stack = new ItemStack(BuiltInRegistries.ITEM.wrapAsHolder(itemType), si.count(), PaperAdventure.asVanilla(dataComponentsMap));
+ return new net.minecraft.network.chat.HoverEvent.ItemStackInfo(stack); + return new net.minecraft.network.chat.HoverEvent.ItemStackInfo(stack);
@ -315,7 +316,10 @@ index 0000000000000000000000000000000000000000..8dcedc5f4d4453fd942787dbcb9c7572
+ }); + });
+ +
+ static final MapCodec<KeybindComponent> KEYBIND_COMPONENT_MAP_CODEC = KeybindContents.CODEC.xmap(k -> Component.keybind(k.getName()), k -> new KeybindContents(k.keybind())); + static final MapCodec<KeybindComponent> KEYBIND_COMPONENT_MAP_CODEC = KeybindContents.CODEC.xmap(k -> Component.keybind(k.getName()), k -> new KeybindContents(k.keybind()));
+ static final MapCodec<ScoreComponent> SCORE_COMPONENT_INNER_MAP_CODEC = ScoreContents.INNER_CODEC.xmap(s -> Component.score(s.getName(), s.getObjective()), s -> new ScoreContents(s.name(), s.objective())); + static final MapCodec<ScoreComponent> SCORE_COMPONENT_INNER_MAP_CODEC = ScoreContents.INNER_CODEC.xmap(
+ s -> Component.score(s.name().map(SelectorPattern::pattern, Function.identity()), s.objective()),
+ s -> new ScoreContents(SelectorPattern.parse(s.name()).<Either<SelectorPattern, String>>map(Either::left).result().orElse(Either.right(s.name())), s.objective())
+ ); // TODO we might want to ask adventure for a nice way we can avoid parsing and flattening the SelectorPattern on every conversion.
+ static final MapCodec<ScoreComponent> SCORE_COMPONENT_MAP_CODEC = SCORE_COMPONENT_INNER_MAP_CODEC.fieldOf("score"); + static final MapCodec<ScoreComponent> SCORE_COMPONENT_MAP_CODEC = SCORE_COMPONENT_INNER_MAP_CODEC.fieldOf("score");
+ static final MapCodec<SelectorComponent> SELECTOR_COMPONENT_MAP_CODEC = mapCodec((instance) -> { + static final MapCodec<SelectorComponent> SELECTOR_COMPONENT_MAP_CODEC = mapCodec((instance) -> {
+ return instance.group( + return instance.group(
@ -1157,7 +1161,7 @@ index 0000000000000000000000000000000000000000..2fd6c3e65354071af71c7d8ebb97b559
+} +}
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..dc4837c577676115f0653acc35f55962a432e425 index 0000000000000000000000000000000000000000..161bc8c577643094d824ea96fb6974c76e5e77f0
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java +++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
@@ -0,0 +1,479 @@ @@ -0,0 +1,479 @@
@ -1580,7 +1584,7 @@ index 0000000000000000000000000000000000000000..dc4837c577676115f0653acc35f55962
+ } + }
+ final DataComponentPatch.Builder builder = DataComponentPatch.builder(); + final DataComponentPatch.Builder builder = DataComponentPatch.builder();
+ map.forEach((key, dataComponentValue) -> { + map.forEach((key, dataComponentValue) -> {
+ final DataComponentType<?> type = requireNonNull(BuiltInRegistries.DATA_COMPONENT_TYPE.get(asVanilla(key))); + final DataComponentType<?> type = requireNonNull(BuiltInRegistries.DATA_COMPONENT_TYPE.getValue(asVanilla(key)));
+ if (dataComponentValue instanceof DataComponentValue.Removed) { + if (dataComponentValue instanceof DataComponentValue.Removed) {
+ builder.remove(type); + builder.remove(type);
+ return; + return;
@ -1839,7 +1843,7 @@ index 0000000000000000000000000000000000000000..8323f135d6bf2e1f12525e05094ffa3f
+} +}
diff --git a/src/main/java/io/papermc/paper/adventure/providers/DataComponentValueConverterProviderImpl.java b/src/main/java/io/papermc/paper/adventure/providers/DataComponentValueConverterProviderImpl.java diff --git a/src/main/java/io/papermc/paper/adventure/providers/DataComponentValueConverterProviderImpl.java b/src/main/java/io/papermc/paper/adventure/providers/DataComponentValueConverterProviderImpl.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..6b37c0ebda4a0cfcf9c3b2c3483ffababe622555 index 0000000000000000000000000000000000000000..ee2076fd098ae2164596f39b88f56b3700ed3687
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/adventure/providers/DataComponentValueConverterProviderImpl.java +++ b/src/main/java/io/papermc/paper/adventure/providers/DataComponentValueConverterProviderImpl.java
@@ -0,0 +1,82 @@ @@ -0,0 +1,82 @@
@ -1895,7 +1899,7 @@ index 0000000000000000000000000000000000000000..6b37c0ebda4a0cfcf9c3b2c3483ffaba
+ GsonDataComponentValue.class, + GsonDataComponentValue.class,
+ PaperAdventure.DataComponentValueImpl.class, + PaperAdventure.DataComponentValueImpl.class,
+ (key, dataComponentValue) -> { + (key, dataComponentValue) -> {
+ final @Nullable DataComponentType<?> type = BuiltInRegistries.DATA_COMPONENT_TYPE.get(PaperAdventure.asVanilla(key)); + final @Nullable DataComponentType<?> type = BuiltInRegistries.DATA_COMPONENT_TYPE.getValue(PaperAdventure.asVanilla(key));
+ if (type == null) { + if (type == null) {
+ throw new IllegalArgumentException("Unknown data component type: " + key); + throw new IllegalArgumentException("Unknown data component type: " + key);
+ } + }
@ -1911,7 +1915,7 @@ index 0000000000000000000000000000000000000000..6b37c0ebda4a0cfcf9c3b2c3483ffaba
+ DataComponentValue.TagSerializable.class, + DataComponentValue.TagSerializable.class,
+ PaperAdventure.DataComponentValueImpl.class, + PaperAdventure.DataComponentValueImpl.class,
+ (key, tagSerializable) -> { + (key, tagSerializable) -> {
+ final @Nullable DataComponentType<?> type = BuiltInRegistries.DATA_COMPONENT_TYPE.get(PaperAdventure.asVanilla(key)); + final @Nullable DataComponentType<?> type = BuiltInRegistries.DATA_COMPONENT_TYPE.getValue(PaperAdventure.asVanilla(key));
+ if (type == null) { + if (type == null) {
+ throw new IllegalArgumentException("Unknown data component type: " + key); + throw new IllegalArgumentException("Unknown data component type: " + key);
+ } + }

Datei anzeigen

@ -216,7 +216,7 @@ index 0000000000000000000000000000000000000000..8f07539a82f449ad217e316a7513a170
+ +
+} +}
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
index dc4837c577676115f0653acc35f55962a432e425..22fe529890f34f66534c01248f654dc911b44c3b 100644 index 161bc8c577643094d824ea96fb6974c76e5e77f0..cfcaf215c4a901dd2938c7ce41db502c57b42bbf 100644
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java --- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java +++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
@@ -32,6 +32,7 @@ import net.kyori.adventure.text.flattener.ComponentFlattener; @@ -32,6 +32,7 @@ import net.kyori.adventure.text.flattener.ComponentFlattener;

Datei anzeigen

@ -14,7 +14,7 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 63499a4fa349b3fa61040244db8be2d5d2569b96..d222de793776b0217c8ec0a4a3151d085efa339f 100644 index 63499a4fa349b3fa61040244db8be2d5d2569b96..128fcd537783986d816dae6d1ce2afb7af07d45a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1665,7 +1665,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1665,7 +1665,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -22,7 +22,7 @@ index 63499a4fa349b3fa61040244db8be2d5d2569b96..d222de793776b0217c8ec0a4a3151d08
@Override @Override
- public void giveExp(int exp) { - public void giveExp(int exp) {
+ // Paper start + // Paper start - ability to apply mending
+ public int applyMending(int amount) { + public int applyMending(int amount) {
+ ServerPlayer handle = this.getHandle(); + ServerPlayer handle = this.getHandle();
+ // Logic copied from EntityExperienceOrb and remapped to unobfuscated methods/properties + // Logic copied from EntityExperienceOrb and remapped to unobfuscated methods/properties
@ -31,7 +31,7 @@ index 63499a4fa349b3fa61040244db8be2d5d2569b96..d222de793776b0217c8ec0a4a3151d08
+ .getRandomItemWith(net.minecraft.world.item.enchantment.EnchantmentEffectComponents.REPAIR_WITH_XP, handle, net.minecraft.world.item.ItemStack::isDamaged); + .getRandomItemWith(net.minecraft.world.item.enchantment.EnchantmentEffectComponents.REPAIR_WITH_XP, handle, net.minecraft.world.item.ItemStack::isDamaged);
+ final net.minecraft.world.item.ItemStack itemstack = stackEntry.map(net.minecraft.world.item.enchantment.EnchantedItemInUse::itemStack).orElse(net.minecraft.world.item.ItemStack.EMPTY); + final net.minecraft.world.item.ItemStack itemstack = stackEntry.map(net.minecraft.world.item.enchantment.EnchantedItemInUse::itemStack).orElse(net.minecraft.world.item.ItemStack.EMPTY);
+ if (!itemstack.isEmpty() && itemstack.getItem().components().has(net.minecraft.core.component.DataComponents.MAX_DAMAGE)) { + if (!itemstack.isEmpty() && itemstack.getItem().components().has(net.minecraft.core.component.DataComponents.MAX_DAMAGE)) {
+ net.minecraft.world.entity.ExperienceOrb orb = net.minecraft.world.entity.EntityType.EXPERIENCE_ORB.create(handle.level()); + net.minecraft.world.entity.ExperienceOrb orb = net.minecraft.world.entity.EntityType.EXPERIENCE_ORB.create(handle.level(), net.minecraft.world.entity.EntitySpawnReason.COMMAND);
+ orb.value = amount; + orb.value = amount;
+ orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM; + orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM;
+ orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ()); + orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ());
@ -56,7 +56,7 @@ index 63499a4fa349b3fa61040244db8be2d5d2569b96..d222de793776b0217c8ec0a4a3151d08
+ if (applyMending) { + if (applyMending) {
+ exp = this.applyMending(exp); + exp = this.applyMending(exp);
+ } + }
+ // Paper end + // Paper end - ability to apply mending
this.getHandle().giveExperiencePoints(exp); this.getHandle().giveExperiencePoints(exp);
} }

Datei anzeigen

@ -64,7 +64,7 @@ index 818df09e9245b5d89b4180b1eaa51470b7539341..f6b2ca92fd3510a76cbf56d0ea55aa6c
public Server getServer() { public Server getServer() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d222de793776b0217c8ec0a4a3151d085efa339f..6191c780cfab682464e23c53873d0acb0c642b0d 100644 index 128fcd537783986d816dae6d1ce2afb7af07d45a..32eeca2467189c6c97f7da5529d4fe9375e8a848 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -254,11 +254,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -254,11 +254,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk. provide an optional flag to disable this check, at your own risk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6191c780cfab682464e23c53873d0acb0c642b0d..afee0dd824cfa229f9ebdbc2b4ca9beee485d6e7 100644 index 32eeca2467189c6c97f7da5529d4fe9375e8a848..a4333eae8aa2ae3fefdc8a765a4434c36e123b12 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -214,6 +214,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -214,6 +214,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -165,7 +165,7 @@ index 6d4e0a90c70f7a66450cbb18ebec1d7bf9200af2..5ff159be1a6dfb4b1a5b9aa1e435d294
@Override @Override
public boolean isBlocking() { public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index afee0dd824cfa229f9ebdbc2b4ca9beee485d6e7..d1b14e7460bd2974e2c3c49a085968a90e1f410f 100644 index a4333eae8aa2ae3fefdc8a765a4434c36e123b12..462877cf6f0dce4f86b6a47564affe9beb2559a8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1290,7 +1290,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1290,7 +1290,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -14,7 +14,7 @@ public net.minecraft.world.entity.decoration.ArmorStand isDisabled(Lnet/minecraf
Co-authored-by: SoSeDiK <mrsosedik@gmail.com> Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
index 1bb080a8af45411b68a0f2a3c40718d60fdc9d97..e1cedcb95e9b2e2e9587b623256b5cffa7b08ce4 100644 index 1bb080a8af45411b68a0f2a3c40718d60fdc9d97..c8713200d946b0fdd74b60d0c2c136c8226389e0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
@@ -233,6 +233,149 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { @@ -233,6 +233,149 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
@ -72,7 +72,7 @@ index 1bb080a8af45411b68a0f2a3c40718d60fdc9d97..e1cedcb95e9b2e2e9587b623256b5cff
+ for (org.bukkit.inventory.EquipmentSlot slot : slots) { + for (org.bukkit.inventory.EquipmentSlot slot : slots) {
+ if (slot == org.bukkit.inventory.EquipmentSlot.OFF_HAND) continue; + if (slot == org.bukkit.inventory.EquipmentSlot.OFF_HAND) continue;
+ net.minecraft.world.entity.EquipmentSlot nmsSlot = org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot); + net.minecraft.world.entity.EquipmentSlot nmsSlot = org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot);
+ disabled += (1 << nmsSlot.getFilterFlag()) + (1 << (nmsSlot.getFilterFlag() + 8)) + (1 << (nmsSlot.getFilterFlag() + 16)); + disabled += (1 << nmsSlot.getFilterBit(0)) + (1 << nmsSlot.getFilterBit(8)) + (1 << nmsSlot.getFilterBit(16));
+ } + }
+ getHandle().disabledSlots = disabled; + getHandle().disabledSlots = disabled;
+ } + }

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d1b14e7460bd2974e2c3c49a085968a90e1f410f..6fb400243e491bb8492342327fe98127b2df331e 100644 index 462877cf6f0dce4f86b6a47564affe9beb2559a8..e4d840d6335007a6a542240746504bf1f2af332d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3007,6 +3007,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3007,6 +3007,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -420,7 +420,7 @@ index 2caba38a50b7ea535337a3540aa5272d4a9f1878..e20565cf256aacd012a1722c5ebbf901
// CraftBukkit end // CraftBukkit end
this.gameEvent(GameEvent.ENTITY_DIE); this.gameEvent(GameEvent.ENTITY_DIE);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6fb400243e491bb8492342327fe98127b2df331e..5dab50309b9441ddb3fe66aec653be0246b049d2 100644 index e4d840d6335007a6a542240746504bf1f2af332d..159bba49095aec77cce5f53d4388a5dff0afcc60 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2544,7 +2544,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2544,7 +2544,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -106,7 +106,7 @@ index f6b2ca92fd3510a76cbf56d0ea55aa6caaf12ba1..e0d342a0ddd140b342f7af138c71596c
public Location getLastDeathLocation() { public Location getLastDeathLocation() {
if (this.getData().contains("LastDeathLocation", 10)) { if (this.getData().contains("LastDeathLocation", 10)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5dab50309b9441ddb3fe66aec653be0246b049d2..38989d2e0702e6edba0e81e292b439b7ef48023c 100644 index 159bba49095aec77cce5f53d4388a5dff0afcc60..f351250b8e8b66bcf72230bbc76835fcb45817e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -215,6 +215,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -215,6 +215,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -8,7 +8,7 @@ We just add a check to ensure that the CraftPlayer's handle
is a ServerPlayer is a ServerPlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 38989d2e0702e6edba0e81e292b439b7ef48023c..92fb4dfce832f5cb98b476365c060acfd8277183 100644 index f351250b8e8b66bcf72230bbc76835fcb45817e1..faab55435a0c4fc6ff9d117f29a2401677b9f828 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -229,8 +229,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -229,8 +229,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -136,7 +136,7 @@ index 363175d3325c012f31ba84060bb0bfac694f6ab8..9911e231ad021286f2da90057b06874f
this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper
this.requestedViewDistance = clientOptions.viewDistance(); this.requestedViewDistance = clientOptions.viewDistance();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 92fb4dfce832f5cb98b476365c060acfd8277183..330a64edf72dc598fb5458702cf7cae5dd83ab00 100644 index faab55435a0c4fc6ff9d117f29a2401677b9f828..69108fd869c7c929fd7971abea520d5ab9063f69 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -670,6 +670,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -670,6 +670,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -19,7 +19,7 @@ index 3010d57efcc97fb409bfe43b1fc9af198c099a67..cdad0fd5257ae842f83b9c1c98b4565b
.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..e993177b052c76cb3f9c44edb598ebb4be858393 index 0000000000000000000000000000000000000000..b4b90c1bda72f845756b46e2316d952361989697
--- /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,133 @@ @@ -0,0 +1,133 @@
@ -103,7 +103,7 @@ index 0000000000000000000000000000000000000000..e993177b052c76cb3f9c44edb598ebb4
+ +
+ final RegistryAccess.Frozen access = ((CraftServer) sender.getServer()).getServer().registryAccess(); + final RegistryAccess.Frozen access = ((CraftServer) sender.getServer()).getServer().registryAccess();
+ final RegistryOps<Tag> ops = access.createSerializationContext(NbtOps.INSTANCE); + final RegistryOps<Tag> ops = access.createSerializationContext(NbtOps.INSTANCE);
+ final Registry<DataComponentType<?>> registry = access.registryOrThrow(Registries.DATA_COMPONENT_TYPE); + final Registry<DataComponentType<?>> registry = access.lookupOrThrow(Registries.DATA_COMPONENT_TYPE);
+ final List<ComponentLike> componentComponents = new ArrayList<>(); + final List<ComponentLike> componentComponents = new ArrayList<>();
+ final List<String> commandComponents = new ArrayList<>(); + final List<String> commandComponents = new ArrayList<>();
+ for (final DataComponentType<?> type : referencedComponentTypes) { + for (final DataComponentType<?> type : referencedComponentTypes) {

Datei anzeigen

@ -57,7 +57,7 @@ index b9fbaddcc8239bf737fdea51790f678306e511eb..9a8b08d4b70b8890961e4af7ce6e870a
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 330a64edf72dc598fb5458702cf7cae5dd83ab00..3b0e7473b3e0c5d9e9e34ed505eae4823e626aae 100644 index 69108fd869c7c929fd7971abea520d5ab9063f69..3191c66c9e5b9c5fcfd07716733aaa51612d507f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3166,6 +3166,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3166,6 +3166,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3b0e7473b3e0c5d9e9e34ed505eae4823e626aae..875d96ca1461d254745e53970b401634c07a8dd6 100644 index 3191c66c9e5b9c5fcfd07716733aaa51612d507f..e7f2d02de2ac58ffa484d8eca5f8b5688e7e02d8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2734,7 +2734,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2734,7 +2734,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -32,7 +32,7 @@ index 70b7871091ab9b64d2a5503620a71c3d5585c25d..7676dbe55b4bf6e0472dc0190c01e6ec
public boolean isWhiteListed(GameProfile profile) { public boolean isWhiteListed(GameProfile profile) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 875d96ca1461d254745e53970b401634c07a8dd6..0ca539a7e037b7f8791ed4c71ce3093a3def2746 100644 index e7f2d02de2ac58ffa484d8eca5f8b5688e7e02d8..711697d039da58c1b93392f70a70e1ad827b1646 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -694,6 +694,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -694,6 +694,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -147,7 +147,7 @@ index e6a927e991779bad84a02d81010057a4e36b9c95..9007a0f01b823c613c39c974d9e0f585
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0ca539a7e037b7f8791ed4c71ce3093a3def2746..8551d626fd4eb38f57414d022f752c0a389a1095 100644 index 711697d039da58c1b93392f70a70e1ad827b1646..fc246d30808ad6242f4adfe201adc169a2ddeb90 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1681,7 +1681,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1681,7 +1681,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -495,7 +495,7 @@ index 9e2ad78b12cadbf0e2bda1e12fe844120529c347..6a7d7fad990fc44fdda6849d43dad141
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8551d626fd4eb38f57414d022f752c0a389a1095..f0f8238aeb49c45921c7ec48cc49ed628087741f 100644 index fc246d30808ad6242f4adfe201adc169a2ddeb90..e24d5992cfb89ccc4e727c91918ab1f94131987e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -280,7 +280,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -280,7 +280,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -187,7 +187,7 @@ index db26b5a0464bd6087eeacaf6dd61eba37365df92..9117c035d5a6ff114b028fad3380ceb1
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f0f8238aeb49c45921c7ec48cc49ed628087741f..efc9b5f6864b09fcf116bbad82424b82448f5469 100644 index e24d5992cfb89ccc4e727c91918ab1f94131987e..ca13d317a5e1c7b7ccda3fdec63e2146562649f6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1430,9 +1430,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1430,9 +1430,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -24,7 +24,7 @@ index 926ff9be3d9e3f5d620e4c7ccb22b9f64865ff8c..1a37654aff9a9c86c9f7af10a1cf7213
buf.writeLong(this.sectionPos.asLong()); buf.writeLong(this.sectionPos.asLong());
buf.writeVarInt(this.positions.length); buf.writeVarInt(this.positions.length);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index efc9b5f6864b09fcf116bbad82424b82448f5469..5274ee417ba3b9ccdab70449c87ce8f3809ea137 100644 index ca13d317a5e1c7b7ccda3fdec63e2146562649f6..fe0c355f8203c9bfa30d2ec48392a5a1a3d616ae 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -947,6 +947,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -947,6 +947,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Add GameEvent tags
diff --git a/src/main/java/io/papermc/paper/CraftGameEventTag.java b/src/main/java/io/papermc/paper/CraftGameEventTag.java diff --git a/src/main/java/io/papermc/paper/CraftGameEventTag.java b/src/main/java/io/papermc/paper/CraftGameEventTag.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4fd3d22b5b index 0000000000000000000000000000000000000000..874c420e60b6be09c806d64f40cf63663ffddc07
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/CraftGameEventTag.java +++ b/src/main/java/io/papermc/paper/CraftGameEventTag.java
@@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4f
+ private static final Map<GameEvent, ResourceKey<net.minecraft.world.level.gameevent.GameEvent>> KEY_CACHE = Collections.synchronizedMap(new IdentityHashMap<>()); + private static final Map<GameEvent, ResourceKey<net.minecraft.world.level.gameevent.GameEvent>> KEY_CACHE = Collections.synchronizedMap(new IdentityHashMap<>());
+ @Override + @Override
+ public boolean isTagged(@NotNull GameEvent gameEvent) { + public boolean isTagged(@NotNull GameEvent gameEvent) {
+ return registry.getHolderOrThrow(KEY_CACHE.computeIfAbsent(gameEvent, event -> ResourceKey.create(Registries.GAME_EVENT, CraftNamespacedKey.toMinecraft(event.getKey())))).is(tag); + return registry.getOrThrow(KEY_CACHE.computeIfAbsent(gameEvent, event -> ResourceKey.create(Registries.GAME_EVENT, CraftNamespacedKey.toMinecraft(event.getKey())))).is(tag);
+ } + }
+ +
+ @Override + @Override

Datei anzeigen

@ -6,32 +6,34 @@ Subject: [PATCH] Expose furnace minecart push values
Adds methods for getting and setting a furnace minecart's push values Adds methods for getting and setting a furnace minecart's push values
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java
index 53042b75b45093535d6572239b34c3ff9a72f648..1b41026ab638bb2764b19429706eb0aded5aad12 100644 index 53042b75b45093535d6572239b34c3ff9a72f648..1be1f6d23f2224d4d8720d40f2e530736b1bae81 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java
@@ -27,6 +27,28 @@ public class CraftMinecartFurnace extends CraftMinecart implements PoweredMineca @@ -27,6 +27,30 @@ public class CraftMinecartFurnace extends CraftMinecart implements PoweredMineca
this.getHandle().fuel = fuel; this.getHandle().fuel = fuel;
} }
+ // Paper start + // Paper start
+ @Override + @Override
+ public double getPushX() { + public double getPushX() {
+ return getHandle().xPush; + return getHandle().push.x;
+ } + }
+ +
+ @Override + @Override
+ public double getPushZ() { + public double getPushZ() {
+ return getHandle().zPush; + return getHandle().push.z;
+ } + }
+ +
+ @Override + @Override
+ public void setPushX(double xPush) { + public void setPushX(double xPush) {
+ getHandle().xPush = xPush; + final net.minecraft.world.phys.Vec3 push = getHandle().push;
+ getHandle().push = new net.minecraft.world.phys.Vec3(xPush, push.y, push.z);
+ } + }
+ +
+ @Override + @Override
+ public void setPushZ(double zPush) { + public void setPushZ(double zPush) {
+ getHandle().zPush = zPush; + final net.minecraft.world.phys.Vec3 push = getHandle().push;
+ getHandle().push = new net.minecraft.world.phys.Vec3(push.x, push.y, zPush);
+ } + }
+ // Paper end + // Paper end
+ +

Datei anzeigen

@ -112,7 +112,7 @@ index 4e6afa243d6108cb946a8a7cf96c4036a3c2ac0c..43786eacc72cdf3bb209d3dfb1808ea9
private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot() private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot()
{ {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5274ee417ba3b9ccdab70449c87ce8f3809ea137..c45753f4b65b189ebfdaea4fb0ec51217dd990c3 100644 index fe0c355f8203c9bfa30d2ec48392a5a1a3d616ae..baae7a129853a296273b7f295f58cbb99187da22 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1303,13 +1303,102 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1303,13 +1303,102 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -246,7 +246,7 @@ index 5274ee417ba3b9ccdab70449c87ce8f3809ea137..c45753f4b65b189ebfdaea4fb0ec5121
// SPIGOT-5509: Wakeup, similar to riding // SPIGOT-5509: Wakeup, similar to riding
if (this.isSleeping()) { if (this.isSleeping()) {
@@ -1356,13 +1445,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1356,13 +1445,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
ServerLevel toWorld = ((CraftWorld) to.getWorld()).getHandle(); ServerLevel toWorld = ((CraftWorld) to.getWorld()).getHandle();
// Close any foreign inventory // Close any foreign inventory
@ -263,7 +263,9 @@ index 5274ee417ba3b9ccdab70449c87ce8f3809ea137..c45753f4b65b189ebfdaea4fb0ec5121
+ for (final io.papermc.paper.entity.TeleportFlag.Relative bukkit : relativeArguments) { + for (final io.papermc.paper.entity.TeleportFlag.Relative bukkit : relativeArguments) {
+ nms.add(toNmsRelativeFlag(bukkit)); + nms.add(toNmsRelativeFlag(bukkit));
+ } + }
+ entity.connection.internalTeleport(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch(), nms); + entity.connection.internalTeleport(new net.minecraft.world.entity.PositionMoveRotation(
+ io.papermc.paper.util.MCUtil.toVec3(to), net.minecraft.world.phys.Vec3.ZERO, to.getYaw(), to.getPitch()
+ ), nms);
+ // Paper end - Teleport API + // Paper end - Teleport API
} else { } else {
entity.portalProcess = null; // SPIGOT-7785: there is no need to carry this over as it contains the old world/location and we might run into trouble if there is a portal in the same spot in both worlds entity.portalProcess = null; // SPIGOT-7785: there is no need to carry this over as it contains the old world/location and we might run into trouble if there is a portal in the same spot in both worlds

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Custom Chat Completion Suggestions API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c45753f4b65b189ebfdaea4fb0ec51217dd990c3..2b5eb586eda41d465f3f1faae8159f6fbe346312 100644 index baae7a129853a296273b7f295f58cbb99187da22..58f3ca95b1d79269bed3b6473cd69d8988ede162 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -708,6 +708,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -708,6 +708,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2b5eb586eda41d465f3f1faae8159f6fbe346312..d8d3d256910790fd7fc406d64ab38e1c372ecfa7 100644 index 58f3ca95b1d79269bed3b6473cd69d8988ede162..667796909ea6b56b93ec591aae1c393ec2f8940a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3326,6 +3326,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3328,6 +3328,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper end // Paper end

Datei anzeigen

@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d8d3d256910790fd7fc406d64ab38e1c372ecfa7..bc96e6a4f6833b351da5ac91563fd6f0d057c854 100644 index 667796909ea6b56b93ec591aae1c393ec2f8940a..7ef67f0b5da392fa09a99d1213eefa373aad96b6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3331,6 +3331,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3333,6 +3333,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void showElderGuardian(boolean silent) { public void showElderGuardian(boolean silent) {
if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F));
} }

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] fix Instruments
properly handle Player#playNote properly handle Player#playNote
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index bc96e6a4f6833b351da5ac91563fd6f0d057c854..b0818d1fc60ab75770e671d30cdbfd531b3dfa99 100644 index 7ef67f0b5da392fa09a99d1213eefa373aad96b6..f710776d2a81c426cbe75532b06da4f8b1ef4787 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -785,7 +785,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -785,7 +785,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -26,10 +26,10 @@ index 30e0a5fe3f9bd85d2b702c2c877c5682ed35d461..aca888c2f02b09ac6739bdc81b194c45
} else { } else {
if (fallDistance >= 2.0F) { if (fallDistance >= 2.0F) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b0818d1fc60ab75770e671d30cdbfd531b3dfa99..05d95294a5183612c171fbd0e5181ac02270e784 100644 index f710776d2a81c426cbe75532b06da4f8b1ef4787..35722608d2c2d702429f5724732e8af39bb37488 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2609,6 +2609,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2611,6 +2611,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().onUpdateAbilities(); this.getHandle().onUpdateAbilities();
} }

Datei anzeigen

@ -7,7 +7,7 @@ Subject: [PATCH] Win Screen API
public net.minecraft.server.level.ServerPlayer seenCredits public net.minecraft.server.level.ServerPlayer seenCredits
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 05d95294a5183612c171fbd0e5181ac02270e784..0a700df3e4f4f6e2e902f0c69dd6ae149978be47 100644 index 35722608d2c2d702429f5724732e8af39bb37488..83e29f518a57bd2eb4113d5b93cdf47af119c715 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1322,6 +1322,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1322,6 +1322,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Correctly handle ArmorStand invisibility
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
index e1cedcb95e9b2e2e9587b623256b5cffa7b08ce4..a2a0064ed86628494e80cb6f6357b4cd9f91f04b 100644 index c8713200d946b0fdd74b60d0c2c136c8226389e0..184fe8257e5ffb0ef090ffa2833786a4db8b59ea 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
@@ -152,6 +152,14 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { @@ -152,6 +152,14 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {

Datei anzeigen

@ -30,10 +30,10 @@ index 3a7af27bb1ce0cbe56bd3760cd400083daf98d4c..bf0838f574fa3fb9654e087d602b8d38
if (l > 0) { if (l > 0) {
// this.value = l; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls // Paper - the value field should not be mutated here because it doesn't take "count" into account // this.value = l; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls // Paper - the value field should not be mutated here because it doesn't take "count" into account
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0a700df3e4f4f6e2e902f0c69dd6ae149978be47..3d52de930c4358843c5a8c88a1dce478b61ed616 100644 index 83e29f518a57bd2eb4113d5b93cdf47af119c715..0d2fd570463d7ad1b6457a8b14303273b97716dd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1881,11 +1881,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1883,11 +1883,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
handle.serverLevel(), itemstack, amount handle.serverLevel(), itemstack, amount
); );
int i = Math.min(possibleDurabilityFromXp, itemstack.getDamageValue()); int i = Math.min(possibleDurabilityFromXp, itemstack.getDamageValue());

Datei anzeigen

@ -208,10 +208,10 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57
return null; return null;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3d52de930c4358843c5a8c88a1dce478b61ed616..de96fdd4b6129f875e710670f6734bf7fa7a4cfb 100644 index 0d2fd570463d7ad1b6457a8b14303273b97716dd..ccf2c23ecf6f406ae07a2d7614d52e65da8ca586 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1775,23 +1775,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1777,23 +1777,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
@Override @Override
@ -240,7 +240,7 @@ index 3d52de930c4358843c5a8c88a1dce478b61ed616..de96fdd4b6129f875e710670f6734bf7
if (kickPlayer) { if (kickPlayer) {
this.kickPlayer(reason); this.kickPlayer(reason);
} }
@@ -1799,12 +1799,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1801,12 +1801,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
@Override @Override

Datei anzeigen

@ -81,7 +81,7 @@ index 67d6840faea539b41ba3abb6d94b28e417a84511..b646f882de3ab04d54d07e9e944c261c
// Special case: the axis is optional for ELECTRIC_SPARK // Special case: the axis is optional for ELECTRIC_SPARK
Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect); Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index de96fdd4b6129f875e710670f6734bf7fa7a4cfb..86f74c35a74b3c3a1d04d6be79e0df30642d475a 100644 index ccf2c23ecf6f406ae07a2d7614d52e65da8ca586..80877e62d0743891f38abeee5b5b04b4f3bc4010 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -934,7 +934,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -934,7 +934,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -122,7 +122,7 @@ index a9063533ea4b2b349d476127b99c822203d7dfcb..218e18b9c7836bc4c9d3eba78e0717ca
// Paper end - Use single player info update packet on join // Paper end - Use single player info update packet on join
player.sentListPacket = true; player.sentListPacket = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 86f74c35a74b3c3a1d04d6be79e0df30642d475a..9b59e7efde0516d55643e8ceb6d94e02ed22aacc 100644 index 80877e62d0743891f38abeee5b5b04b4f3bc4010..1943cb7b691573d3f9755d21d4b5a4210c1cc329 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -206,6 +206,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -206,6 +206,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -133,7 +133,7 @@ index 86f74c35a74b3c3a1d04d6be79e0df30642d475a..9b59e7efde0516d55643e8ceb6d94e02
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>(); private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0; private int hash = 0;
private double health = 20; private double health = 20;
@@ -2120,7 +2121,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2122,7 +2123,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
otherPlayer.setUUID(uuidOverride); otherPlayer.setUUID(uuidOverride);
} }
// Paper end // Paper end
@ -142,7 +142,7 @@ index 86f74c35a74b3c3a1d04d6be79e0df30642d475a..9b59e7efde0516d55643e8ceb6d94e02
if (original != null) otherPlayer.setUUID(original); // Paper - uuid override if (original != null) otherPlayer.setUUID(original); // Paper - uuid override
} }
@@ -2224,6 +2225,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2226,6 +2227,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it
} }

Datei anzeigen

@ -23,7 +23,7 @@ index 2c2c4db31a746b4eb853dc04c6b3e5631bbfa034..4f4e3ee18d586f61706504218cddc06a
public String getName() { public String getName() {
Player player = this.getPlayer(); Player player = this.getPlayer();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9b59e7efde0516d55643e8ceb6d94e02ed22aacc..4de2a6a04a5bcf635f2bb5da640eb5941183e87c 100644 index 1943cb7b691573d3f9755d21d4b5a4210c1cc329..3b2d7837486424a2d1759c4ba5d1b1d492e9ec48 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -261,6 +261,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -261,6 +261,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API
Implements API for getting and resetting a player's idle duration. Implements API for getting and resetting a player's idle duration.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4de2a6a04a5bcf635f2bb5da640eb5941183e87c..4060a25f414631f702f04a53169b14e2ae6f9e31 100644 index 3b2d7837486424a2d1759c4ba5d1b1d492e9ec48..b72d6395768a762cd72f2b98bc8cb2598dc286b9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3447,6 +3447,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3449,6 +3449,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper end // Paper end

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Allow null itemstack for Player#sendEquipmentChange
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4060a25f414631f702f04a53169b14e2ae6f9e31..a343684b52594c295d5a75b9005da3434b72f329 100644 index b72d6395768a762cd72f2b98bc8cb2598dc286b9..542c2d85da9695da0f8cc5c34f2e3c0b925dfb7c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1144,7 +1144,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1144,7 +1144,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -18,10 +18,10 @@ index aca888c2f02b09ac6739bdc81b194c4527dd69f5..a19a795deaa7f46c92b97912e2ade006
// Paper start - send while respecting visibility // Paper start - send while respecting visibility
private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a343684b52594c295d5a75b9005da3434b72f329..a6b26d33de210e8c5351f3246b9ac391eb688689 100644 index 542c2d85da9695da0f8cc5c34f2e3c0b925dfb7c..0a3d44ac5bfe252854377011ac363d52991c15ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1949,6 +1949,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1951,6 +1951,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Preconditions.checkArgument(exp >= 0, "Total experience points must not be negative (%s)", exp); Preconditions.checkArgument(exp >= 0, "Total experience points must not be negative (%s)", exp);
this.getHandle().totalExperience = exp; this.getHandle().totalExperience = exp;
} }

Datei anzeigen

@ -35,7 +35,7 @@ index c62df32af11636ad408b584fcc590590ce4fb0d0..baed0bb80d44973f9323bbe536551182
} else { } else {
super.channelRead(ctx, msg); super.channelRead(ctx, msg);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a6b26d33de210e8c5351f3246b9ac391eb688689..7d8465ec67d4b2551c8fbe01964dd0cb2c94cbe8 100644 index 0a3d44ac5bfe252854377011ac363d52991c15ed..72b9bffb12ef94d029c9502be90fb8c1bd37a4d1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -270,7 +270,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -270,7 +270,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -29,10 +29,10 @@ index 0000000000000000000000000000000000000000..c6fd2e8a570ac474dd1751929137280c
+} +}
diff --git a/src/main/java/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java b/src/main/java/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java diff --git a/src/main/java/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java b/src/main/java/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..d58b650fcafd04d00a92005ca8576d314535ce32 index 0000000000000000000000000000000000000000..8a2fb217501bb6293adf54686420ef7d1ce2ec11
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java +++ b/src/main/java/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java
@@ -0,0 +1,53 @@ @@ -0,0 +1,55 @@
+package io.papermc.paper.world.flag; +package io.papermc.paper.world.flag;
+ +
+import com.google.common.collect.BiMap; +import com.google.common.collect.BiMap;
@ -55,8 +55,10 @@ index 0000000000000000000000000000000000000000..d58b650fcafd04d00a92005ca8576d31
+ +
+ public static final BiMap<FeatureFlag, net.minecraft.world.flag.FeatureFlag> FLAGS = ImmutableBiMap.of( + public static final BiMap<FeatureFlag, net.minecraft.world.flag.FeatureFlag> FLAGS = ImmutableBiMap.of(
+ FeatureFlag.VANILLA, FeatureFlags.VANILLA, + FeatureFlag.VANILLA, FeatureFlags.VANILLA,
+ FeatureFlag.BUNDLE, FeatureFlags.BUNDLE, + FeatureFlag.TRADE_REBALANCE, FeatureFlags.TRADE_REBALANCE,
+ FeatureFlag.TRADE_REBALANCE, FeatureFlags.TRADE_REBALANCE + FeatureFlag.MINECART_IMPROVEMENTS, FeatureFlags.MINECART_IMPROVEMENTS,
+ FeatureFlag.REDSTONE_EXPERIMENTS, FeatureFlags.REDSTONE_EXPERIMENTS,
+ FeatureFlag.WINTER_DROP, FeatureFlags.WINTER_DROP
+ ); + );
+ +
+ @Override + @Override

Datei anzeigen

@ -25,7 +25,7 @@ index ca95a36b0149d4b8a67c3b42316c5d9d0415f5dd..64c6f54cc4d0c22bc972b808cb92925c
+ // Paper end - broadcast hurt animation + // Paper end - broadcast hurt animation
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7d8465ec67d4b2551c8fbe01964dd0cb2c94cbe8..40a9f02091e9ae06fae28508c967fe1298419eda 100644 index 72b9bffb12ef94d029c9502be90fb8c1bd37a4d1..d5dc7ecb9c4dddfd2c92d89b27c15512a0822b08 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1294,6 +1294,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1294,6 +1294,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -49,7 +49,7 @@ index 7d8465ec67d4b2551c8fbe01964dd0cb2c94cbe8..40a9f02091e9ae06fae28508c967fe12
} }
@Override @Override
@@ -3546,4 +3551,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3548,4 +3553,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setSendViewDistance(final int viewDistance) { public void setSendViewDistance(final int viewDistance) {
throw new UnsupportedOperationException("Not implemented yet"); throw new UnsupportedOperationException("Not implemented yet");
} }