PaperMC/paper-server/patches/sources/net/minecraft/commands/arguments/blocks/BlockStateParser.java.patch
CraftBukkit/Spigot 30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00

38 lines
1.9 KiB
Diff

--- a/net/minecraft/commands/arguments/blocks/BlockStateParser.java
+++ b/net/minecraft/commands/arguments/blocks/BlockStateParser.java
@@ -67,7 +67,7 @@
private final StringReader reader;
private final boolean forTesting;
private final boolean allowNbt;
- private final Map<Property<?>, Comparable<?>> properties = Maps.newHashMap();
+ private final Map<Property<?>, Comparable<?>> properties = Maps.newLinkedHashMap(); // CraftBukkit - stable
private final Map<String, String> vagueProperties = Maps.newHashMap();
private ResourceLocation id = ResourceLocation.withDefaultNamespace("");
@Nullable
@@ -275,7 +275,7 @@
Iterator iterator = property.getPossibleValues().iterator();
while (iterator.hasNext()) {
- T t0 = (Comparable) iterator.next();
+ T t0 = (T) iterator.next(); // CraftBukkit - decompile error
if (t0 instanceof Integer integer) {
builder.suggest(integer);
@@ -545,7 +545,7 @@
Optional<T> optional = property.getValue(value);
if (optional.isPresent()) {
- this.state = (BlockState) this.state.setValue(property, (Comparable) optional.get());
+ this.state = (BlockState) this.state.setValue(property, (T) optional.get()); // CraftBukkit - decompile error
this.properties.put(property, (Comparable) optional.get());
} else {
this.reader.setCursor(cursor);
@@ -581,7 +581,7 @@
private static <T extends Comparable<T>> void appendProperty(StringBuilder builder, Property<T> property, Comparable<?> value) {
builder.append(property.getName());
builder.append('=');
- builder.append(property.getName(value));
+ builder.append(property.getName((T) value)); // CraftBukkit - decompile error
}
public static record BlockResult(BlockState blockState, Map<Property<?>, Comparable<?>> properties, @Nullable CompoundTag nbt) {