Commits

Parker Hawke authored and md_5 committed 4b843638ea8
Add BlockData#getAsString(boolean) to hide unspecified states
No tags

nms-patches/ArgumentBlock.patch

Added
1 +--- a/net/minecraft/server/ArgumentBlock.java
2 ++++ b/net/minecraft/server/ArgumentBlock.java
3 +@@ -41,7 +41,7 @@
4 + private static final Function<SuggestionsBuilder, CompletableFuture<Suggestions>> h = SuggestionsBuilder::buildFuture;
5 + private final StringReader i;
6 + private final boolean j;
7 +- private final Map<IBlockState<?>, Comparable<?>> k = Maps.newHashMap();
8 ++ private final Map<IBlockState<?>, Comparable<?>> k = Maps.newLinkedHashMap(); // CraftBukkit - stable
9 + private final Map<String, String> l = Maps.newHashMap();
10 + private MinecraftKey m = new MinecraftKey("");
11 + private BlockStateList<Block, IBlockData> n;
12 +@@ -222,7 +222,7 @@
13 + if (comparable instanceof Integer) {
14 + suggestionsbuilder.suggest((Integer) comparable);
15 + } else {
16 +- suggestionsbuilder.suggest(iblockstate.a(comparable));
17 ++ suggestionsbuilder.suggest(iblockstate.a((T) comparable)); // CraftBukkit - decompile error
18 + }
19 + }
20 +
21 +@@ -488,8 +488,8 @@
22 + Optional optional = iblockstate.b(s);
23 +
24 + if (optional.isPresent()) {
25 +- this.o = (IBlockData) this.o.set(iblockstate, (Comparable) optional.get());
26 +- this.k.put(iblockstate, optional.get());
27 ++ this.o = (IBlockData) this.o.set(iblockstate, (T) optional.get()); // CraftBukkit - decompile error
28 ++ this.k.put(iblockstate, (Comparable) optional.get()); // CraftBukkit - decompile error
29 + } else {
30 + this.i.setCursor(i);
31 + throw ArgumentBlock.e.createWithContext(this.i, this.m.toString(), iblockstate.a(), s);
32 +@@ -526,7 +526,7 @@
33 + private static <T extends Comparable<T>> void a(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) {
34 + stringbuilder.append(iblockstate.a());
35 + stringbuilder.append('=');
36 +- stringbuilder.append(iblockstate.a(comparable));
37 ++ stringbuilder.append(iblockstate.a((T) comparable)); // CraftBukkit - decompile error
38 + }
39 +
40 + public CompletableFuture<Suggestions> a(SuggestionsBuilder suggestionsbuilder) {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut