From e7f0a41e9a59a88e5a4461fba0cf4dd89942b3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kobe=20=E2=91=A7?= <102713261+HaHaWTH@users.noreply.github.com> Date: Sat, 7 Dec 2024 19:06:28 -0800 Subject: [PATCH] Cleanup patch hunks (#253) * Cleanup patch hunks * Cleanup patch hunks --- .../AdvancementManager.java.patch | 108 +---- .../critereon/ItemPredicate.java.patch | 34 -- .../entity/AbstractClientPlayer.java.patch | 56 +-- .../minecraft/command/CommandBase.java.patch | 418 +----------------- .../minecraft/command/CommandFill.java.patch | 142 +----- 5 files changed, 7 insertions(+), 751 deletions(-) diff --git a/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch b/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch index 2c7a3b195..f273709ce 100644 --- a/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch +++ b/patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch @@ -1,40 +1,6 @@ --- before/net/minecraft/advancements/AdvancementManager.java +++ after/net/minecraft/advancements/AdvancementManager.java -@@ -9,6 +9,7 @@ - import com.google.gson.JsonObject; - import com.google.gson.JsonParseException; - import java.io.BufferedReader; -+import java.io.Closeable; - import java.io.File; - import java.io.IOException; - import java.io.Reader; -@@ -41,23 +42,14 @@ - public class AdvancementManager - { - private static final Logger field_192782_a = LogManager.getLogger(); -- public static final Gson field_192783_b = new GsonBuilder() -- .registerTypeHierarchyAdapter( -- Advancement.Builder.class, -- new JsonDeserializer() -+ public static final Gson field_192783_b = (new GsonBuilder()).registerTypeHierarchyAdapter(Advancement.Builder.class, new JsonDeserializer() - { - public Advancement.Builder deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException - { - JsonObject jsonobject = JsonUtils.func_151210_l(p_deserialize_1_, "advancement"); - return Advancement.Builder.func_192059_a(jsonobject, p_deserialize_3_); - } -- } -- ) -- .registerTypeAdapter(AdvancementRewards.class, new AdvancementRewards.Deserializer()) -- .registerTypeHierarchyAdapter(ITextComponent.class, new ITextComponent.Serializer()) -- .registerTypeHierarchyAdapter(Style.class, new Style.Serializer()) -- .registerTypeAdapterFactory(new EnumTypeAdapterFactory()) -- .create(); -+ }).registerTypeAdapter(AdvancementRewards.class, new AdvancementRewards.Deserializer()).registerTypeHierarchyAdapter(ITextComponent.class, new ITextComponent.Serializer()).registerTypeHierarchyAdapter(Style.class, new Style.Serializer()).registerTypeAdapterFactory(new EnumTypeAdapterFactory()).create(); - private static final AdvancementList field_192784_c = new AdvancementList(); - private final File field_192785_d; - private boolean field_193768_e; -@@ -74,6 +66,7 @@ +@@ -74,6 +74,7 @@ field_192784_c.func_192087_a(); Map map = this.func_192781_c(); this.func_192777_a(map); @@ -42,75 +8,3 @@ field_192784_c.func_192083_a(map); for (Advancement advancement : field_192784_c.func_192088_b()) -@@ -94,11 +87,11 @@ - { - if (this.field_192785_d == null) - { -- return Maps.newHashMap(); -+ return Maps.newHashMap(); - } - else - { -- Map map = Maps.newHashMap(); -+ Map map = Maps.newHashMap(); - this.field_192785_d.mkdirs(); - - for (File file1 : FileUtils.listFiles(this.field_192785_d, new String[] {"json"}, true)) -@@ -112,9 +105,7 @@ - - try - { -- Advancement.Builder advancement$builder = JsonUtils.func_188178_a( -- field_192783_b, FileUtils.readFileToString(file1, StandardCharsets.UTF_8), Advancement.Builder.class -- ); -+ Advancement.Builder advancement$builder = (Advancement.Builder)JsonUtils.func_188178_a(field_192783_b, FileUtils.readFileToString(file1, StandardCharsets.UTF_8), Advancement.Builder.class); - - if (advancement$builder == null) - { -@@ -149,12 +140,7 @@ - { - URL url = AdvancementManager.class.getResource("/assets/.mcassetsroot"); - -- if (url == null) -- { -- field_192782_a.error("Couldn't find .mcassetsroot"); -- this.field_193768_e = true; -- } -- else -+ if (url != null) - { - URI uri = url.toURI(); - Path path; -@@ -195,7 +181,7 @@ - try - { - bufferedreader = Files.newBufferedReader(path1); -- Advancement.Builder advancement$builder = JsonUtils.func_193839_a(field_192783_b, bufferedreader, Advancement.Builder.class); -+ Advancement.Builder advancement$builder = (Advancement.Builder)JsonUtils.func_193839_a(field_192783_b, bufferedreader, Advancement.Builder.class); - p_192777_1_.put(resourcelocation, advancement$builder); - } - catch (JsonParseException jsonparseexception) -@@ -215,16 +201,22 @@ - } - } - } -+ -+ return; - } -+ -+ field_192782_a.error("Couldn't find .mcassetsroot"); -+ this.field_193768_e = true; - } - catch (IOException | URISyntaxException urisyntaxexception) - { - field_192782_a.error("Couldn't get a list of all built-in advancement files", (Throwable)urisyntaxexception); - this.field_193768_e = true; -+ return; - } - finally - { -- IOUtils.closeQuietly(filesystem); -+ IOUtils.closeQuietly((Closeable)filesystem); - } - } - diff --git a/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch b/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch index 6570abd1e..f8a642a93 100644 --- a/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch +++ b/patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch @@ -1,39 +1,5 @@ --- before/net/minecraft/advancements/critereon/ItemPredicate.java +++ after/net/minecraft/advancements/critereon/ItemPredicate.java -@@ -37,15 +37,7 @@ - this.field_193445_h = NBTPredicate.field_193479_a; - } - -- public ItemPredicate( -- @Nullable Item p_i47540_1_, -- @Nullable Integer p_i47540_2_, -- MinMaxBounds p_i47540_3_, -- MinMaxBounds p_i47540_4_, -- EnchantmentPredicate[] p_i47540_5_, -- @Nullable PotionType p_i47540_6_, -- NBTPredicate p_i47540_7_ -- ) -+ public ItemPredicate(@Nullable Item p_i47540_1_, @Nullable Integer p_i47540_2_, MinMaxBounds p_i47540_3_, MinMaxBounds p_i47540_4_, EnchantmentPredicate[] p_i47540_5_, @Nullable PotionType p_i47540_6_, NBTPredicate p_i47540_7_) - { - this.field_192496_b = p_i47540_1_; - this.field_192497_c = p_i47540_2_; -@@ -95,7 +87,15 @@ - } - - PotionType potiontype = PotionUtils.func_185191_c(p_192493_1_); -- return this.field_192500_f == null || this.field_192500_f == potiontype; -+ -+ if (this.field_192500_f != null && this.field_192500_f != potiontype) -+ { -+ return false; -+ } -+ else -+ { -+ return true; -+ } - } - } - @@ -104,6 +104,13 @@ if (p_192492_0_ != null && !p_192492_0_.isJsonNull()) { diff --git a/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch b/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch index 67e3b25ef..ca2aee1b8 100644 --- a/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java.patch @@ -1,51 +1,6 @@ --- before/net/minecraft/client/entity/AbstractClientPlayer.java +++ after/net/minecraft/client/entity/AbstractClientPlayer.java -@@ -1,6 +1,7 @@ - package net.minecraft.client.entity; - - import com.mojang.authlib.GameProfile; -+import java.io.File; - import javax.annotation.Nullable; - import net.minecraft.client.Minecraft; - import net.minecraft.client.network.NetworkPlayerInfo; -@@ -33,14 +34,12 @@ - super(p_i45074_1_, p_i45074_2_); - } - -- @Override - public boolean func_175149_v() - { - NetworkPlayerInfo networkplayerinfo = Minecraft.func_71410_x().func_147114_u().func_175102_a(this.func_146103_bH().getId()); - return networkplayerinfo != null && networkplayerinfo.func_178848_b() == GameType.SPECTATOR; - } - -- @Override - public boolean func_184812_l_() - { - NetworkPlayerInfo networkplayerinfo = Minecraft.func_71410_x().func_147114_u().func_175102_a(this.func_146103_bH().getId()); -@@ -101,12 +100,7 @@ - - if (itextureobject == null) - { -- itextureobject = new ThreadDownloadImageData( -- null, -- String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", StringUtils.func_76338_a(p_110304_1_)), -- DefaultPlayerSkin.func_177334_a(func_175147_b(p_110304_1_)), -- new ImageBufferDownload() -- ); -+ itextureobject = new ThreadDownloadImageData((File)null, String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", StringUtils.func_76338_a(p_110304_1_)), DefaultPlayerSkin.func_177334_a(func_175147_b(p_110304_1_)), new ImageBufferDownload()); - texturemanager.func_110579_a(p_110304_0_, itextureobject); - } - -@@ -134,14 +128,14 @@ - } - - IAttributeInstance iattributeinstance = this.func_110148_a(SharedMonsterAttributes.field_111263_d); -- f = (float)((double)f * ((iattributeinstance.func_111126_e() / (double)this.field_71075_bZ.func_75094_b() + 1.0) / 2.0)); -+ f = (float)((double)f * ((iattributeinstance.func_111126_e() / (double)this.field_71075_bZ.func_75094_b() + 1.0D) / 2.0D)); - - if (this.field_71075_bZ.func_75094_b() == 0.0F || Float.isNaN(f) || Float.isInfinite(f)) - { +@@ -141,7 +141,7 @@ f = 1.0F; } @@ -54,14 +9,7 @@ { int i = this.func_184612_cw(); float f1 = (float)i / 20.0F; -@@ -152,12 +146,12 @@ - } - else - { -- f1 *= f1; -+ f1 = f1 * f1; - } - +@@ -158,6 +158,6 @@ f *= 1.0F - f1 * 0.15F; } diff --git a/patches/minecraft/net/minecraft/command/CommandBase.java.patch b/patches/minecraft/net/minecraft/command/CommandBase.java.patch index 796dd83b9..9e65b3882 100644 --- a/patches/minecraft/net/minecraft/command/CommandBase.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandBase.java.patch @@ -1,139 +1,6 @@ --- before/net/minecraft/command/CommandBase.java +++ after/net/minecraft/command/CommandBase.java -@@ -56,7 +56,7 @@ - } - } - -- return new SyntaxErrorException("commands.tellraw.jsonException", s); -+ return new SyntaxErrorException("commands.tellraw.jsonException", new Object[] {s}); - } - - public static NBTTagCompound func_184887_a(Entity p_184887_0_) -@@ -81,22 +81,19 @@ - return 4; - } - -- @Override - public List func_71514_a() - { -- return Collections.emptyList(); -+ return Collections.emptyList(); - } - -- @Override - public boolean func_184882_a(MinecraftServer p_184882_1_, ICommandSender p_184882_2_) - { - return p_184882_2_.func_70003_b(this.func_82362_a(), this.func_71517_b()); - } - -- @Override - public List func_184883_a(MinecraftServer p_184883_1_, ICommandSender p_184883_2_, String[] p_184883_3_, @Nullable BlockPos p_184883_4_) - { -- return Collections.emptyList(); -+ return Collections.emptyList(); - } - - public static int func_175755_a(String p_175755_0_) throws NumberInvalidException -@@ -105,9 +102,9 @@ - { - return Integer.parseInt(p_175755_0_); - } -- catch (NumberFormatException numberformatexception) -+ catch (NumberFormatException var2) - { -- throw new NumberInvalidException("commands.generic.num.invalid", p_175755_0_); -+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {p_175755_0_}); - } - } - -@@ -122,11 +119,11 @@ - - if (i < p_175764_1_) - { -- throw new NumberInvalidException("commands.generic.num.tooSmall", i, p_175764_1_); -+ throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {i, p_175764_1_}); - } - else if (i > p_175764_2_) - { -- throw new NumberInvalidException("commands.generic.num.tooBig", i, p_175764_2_); -+ throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {i, p_175764_2_}); - } - else - { -@@ -140,9 +137,9 @@ - { - return Long.parseLong(p_175766_0_); - } -- catch (NumberFormatException numberformatexception) -+ catch (NumberFormatException var2) - { -- throw new NumberInvalidException("commands.generic.num.invalid", p_175766_0_); -+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {p_175766_0_}); - } - } - -@@ -152,11 +149,11 @@ - - if (i < p_175760_1_) - { -- throw new NumberInvalidException("commands.generic.num.tooSmall", i, p_175760_1_); -+ throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {i, p_175760_1_}); - } - else if (i > p_175760_3_) - { -- throw new NumberInvalidException("commands.generic.num.tooBig", i, p_175760_3_); -+ throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {i, p_175760_3_}); - } - else - { -@@ -167,11 +164,7 @@ - public static BlockPos func_175757_a(ICommandSender p_175757_0_, String[] p_175757_1_, int p_175757_2_, boolean p_175757_3_) throws NumberInvalidException - { - BlockPos blockpos = p_175757_0_.func_180425_c(); -- return new BlockPos( -- func_175769_b((double)blockpos.func_177958_n(), p_175757_1_[p_175757_2_], -30000000, 30000000, p_175757_3_), -- func_175769_b((double)blockpos.func_177956_o(), p_175757_1_[p_175757_2_ + 1], 0, 256, false), -- func_175769_b((double)blockpos.func_177952_p(), p_175757_1_[p_175757_2_ + 2], -30000000, 30000000, p_175757_3_) -- ); -+ return new BlockPos(func_175769_b((double)blockpos.func_177958_n(), p_175757_1_[p_175757_2_], -30000000, 30000000, p_175757_3_), func_175769_b((double)blockpos.func_177956_o(), p_175757_1_[p_175757_2_ + 1], 0, 256, false), func_175769_b((double)blockpos.func_177952_p(), p_175757_1_[p_175757_2_ + 2], -30000000, 30000000, p_175757_3_)); - } - - public static double func_175765_c(String p_175765_0_) throws NumberInvalidException -@@ -182,16 +175,16 @@ - - if (!Doubles.isFinite(d0)) - { -- throw new NumberInvalidException("commands.generic.num.invalid", p_175765_0_); -+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {p_175765_0_}); - } - else - { - return d0; - } - } -- catch (NumberFormatException numberformatexception) -+ catch (NumberFormatException var3) - { -- throw new NumberInvalidException("commands.generic.num.invalid", p_175765_0_); -+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {p_175765_0_}); - } - } - -@@ -206,11 +199,11 @@ - - if (d0 < p_175756_1_) - { -- throw new NumberInvalidException("commands.generic.num.tooSmall", String.format("%.2f", d0), String.format("%.2f", p_175756_1_)); -+ throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {String.format("%.2f", d0), String.format("%.2f", p_175756_1_)}); - } - else if (d0 > p_175756_3_) - { -- throw new NumberInvalidException("commands.generic.num.tooBig", String.format("%.2f", d0), String.format("%.2f", p_175756_3_)); -+ throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {String.format("%.2f", d0), String.format("%.2f", p_175756_3_)}); - } - else - { -@@ -220,18 +213,21 @@ +@@ -220,18 +220,21 @@ public static boolean func_180527_d(String p_180527_0_) throws CommandException { @@ -164,70 +31,7 @@ } public static EntityPlayerMP func_71521_c(ICommandSender p_71521_0_) throws PlayerNotFoundException -@@ -249,7 +245,7 @@ - public static List func_193513_a(MinecraftServer p_193513_0_, ICommandSender p_193513_1_, String p_193513_2_) throws CommandException - { - List list = EntitySelector.func_193531_b(p_193513_1_, p_193513_2_); -- return (List)(list.isEmpty() ? Lists.newArrayList(func_193512_a(p_193513_0_, null, p_193513_2_)) : list); -+ return (List)(list.isEmpty() ? Lists.newArrayList(func_193512_a(p_193513_0_, (EntityPlayerMP)null, p_193513_2_)) : list); - } - - public static EntityPlayerMP func_184888_a(MinecraftServer p_184888_0_, ICommandSender p_184888_1_, String p_184888_2_) throws PlayerNotFoundException, CommandException -@@ -265,8 +261,9 @@ - { - p_193512_1_ = p_193512_0_.func_184103_al().func_177451_a(UUID.fromString(p_193512_2_)); - } -- catch (IllegalArgumentException illegalargumentexception) -+ catch (IllegalArgumentException var4) - { -+ ; - } - } - -@@ -277,7 +274,7 @@ - - if (p_193512_1_ == null) - { -- throw new PlayerNotFoundException("commands.generic.player.notFound", p_193512_2_); -+ throw new PlayerNotFoundException("commands.generic.player.notFound", new Object[] {p_193512_2_}); - } - else - { -@@ -311,11 +308,11 @@ - entity = p_184884_0_.func_184103_al().func_177451_a(uuid); - } - } -- catch (IllegalArgumentException illegalargumentexception) -+ catch (IllegalArgumentException var6) - { - if (p_184884_2_.split("-").length == 5) - { -- throw new EntityNotFoundException("commands.generic.entity.invalidUuid", p_184884_2_); -+ throw new EntityNotFoundException("commands.generic.entity.invalidUuid", new Object[] {p_184884_2_}); - } - } - } -@@ -332,9 +329,7 @@ - - public static List func_184890_c(MinecraftServer p_184890_0_, ICommandSender p_184890_1_, String p_184890_2_) throws EntityNotFoundException, CommandException - { -- return (List)(EntitySelector.func_82378_b(p_184890_2_) -- ? EntitySelector.func_179656_b(p_184890_1_, p_184890_2_, Entity.class) -- : Lists.newArrayList(func_184885_b(p_184890_0_, p_184890_1_, p_184890_2_))); -+ return (List)(EntitySelector.func_82378_b(p_184890_2_) ? EntitySelector.func_179656_b(p_184890_1_, p_184890_2_, Entity.class) : Lists.newArrayList(func_184885_b(p_184890_0_, p_184890_1_, p_184890_2_))); - } - - public static String func_184886_d(MinecraftServer p_184886_0_, ICommandSender p_184886_1_, String p_184886_2_) throws PlayerNotFoundException, CommandException -@@ -362,7 +357,7 @@ - { - return func_184888_a(p_184891_0_, p_184891_1_, p_184891_2_).func_70005_c_(); - } -- catch (PlayerNotFoundException playernotfoundexception) -+ catch (PlayerNotFoundException var6) - { - try - { -@@ -398,7 +393,7 @@ +@@ -398,7 +401,7 @@ itextcomponent.func_150258_a(" "); } @@ -236,221 +40,3 @@ if (p_147176_3_) { -@@ -408,7 +403,7 @@ - { - if (EntitySelector.func_82378_b(p_147176_1_[i])) - { -- throw new PlayerNotFoundException("commands.generic.selector.notFound", p_147176_1_[i]); -+ throw new PlayerNotFoundException("commands.generic.selector.notFound", new Object[] {p_147176_1_[i]}); - } - } - else -@@ -452,11 +447,11 @@ - - if (flag && Double.isNaN(p_175767_0_)) - { -- throw new NumberInvalidException("commands.generic.num.invalid", p_175767_0_); -+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {p_175767_0_}); - } - else - { -- double d0 = 0.0; -+ double d0 = 0.0D; - - if (!flag || p_175767_2_.length() > 1) - { -@@ -471,22 +466,22 @@ - - if (!flag1 && !flag && p_175767_5_) - { -- d0 += 0.5; -+ d0 += 0.5D; - } - } - -- double d1 = d0 + (flag ? p_175767_0_ : 0.0); -+ double d1 = d0 + (flag ? p_175767_0_ : 0.0D); - - if (p_175767_3_ != 0 || p_175767_4_ != 0) - { - if (d1 < (double)p_175767_3_) - { -- throw new NumberInvalidException("commands.generic.num.tooSmall", String.format("%.2f", d1), p_175767_3_); -+ throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {String.format("%.2f", d1), p_175767_3_}); - } - - if (d1 > (double)p_175767_4_) - { -- throw new NumberInvalidException("commands.generic.num.tooBig", String.format("%.2f", d1), p_175767_4_); -+ throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {String.format("%.2f", d1), p_175767_4_}); - } - } - -@@ -505,11 +500,11 @@ - - if (flag && Double.isNaN(p_175769_0_)) - { -- throw new NumberInvalidException("commands.generic.num.invalid", p_175769_0_); -+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {p_175769_0_}); - } - else - { -- double d0 = flag ? p_175769_0_ : 0.0; -+ double d0 = flag ? p_175769_0_ : 0.0D; - - if (!flag || p_175769_2_.length() > 1) - { -@@ -524,7 +519,7 @@ - - if (!flag1 && !flag && p_175769_5_) - { -- d0 += 0.5; -+ d0 += 0.5D; - } - } - -@@ -532,12 +527,12 @@ - { - if (d0 < (double)p_175769_3_) - { -- throw new NumberInvalidException("commands.generic.num.tooSmall", String.format("%.2f", d0), p_175769_3_); -+ throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {String.format("%.2f", d0), p_175769_3_}); - } - - if (d0 > (double)p_175769_4_) - { -- throw new NumberInvalidException("commands.generic.num.tooBig", String.format("%.2f", d0), p_175769_4_); -+ throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {String.format("%.2f", d0), p_175769_4_}); - } - } - -@@ -552,7 +547,7 @@ - - if (item == null) - { -- throw new NumberInvalidException("commands.give.item.notFound", resourcelocation); -+ throw new NumberInvalidException("commands.give.item.notFound", new Object[] {resourcelocation}); - } - else - { -@@ -566,7 +561,7 @@ - - if (!Block.field_149771_c.func_148741_d(resourcelocation)) - { -- throw new NumberInvalidException("commands.give.block.notFound", resourcelocation); -+ throw new NumberInvalidException("commands.give.block.notFound", new Object[] {resourcelocation}); - } - else - { -@@ -582,18 +577,18 @@ - - if (i < 0) - { -- throw new NumberInvalidException("commands.generic.num.tooSmall", i, 0); -+ throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {i, Integer.valueOf(0)}); - } - else if (i > 15) - { -- throw new NumberInvalidException("commands.generic.num.tooBig", i, 15); -+ throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {i, Integer.valueOf(15)}); - } - else - { - return p_190794_0_.func_176203_a(Integer.parseInt(p_190794_1_)); - } - } -- catch (RuntimeException runtimeexception1) -+ catch (RuntimeException var7) - { - try - { -@@ -607,16 +602,16 @@ - - return iblockstate; - } -- catch (RuntimeException runtimeexception) -+ catch (RuntimeException var6) - { -- throw new InvalidBlockStateException("commands.generic.blockstate.invalid", p_190794_1_, Block.field_149771_c.func_177774_c(p_190794_0_)); -+ throw new InvalidBlockStateException("commands.generic.blockstate.invalid", new Object[] {p_190794_1_, Block.field_149771_c.func_177774_c(p_190794_0_)}); - } - } - } - - private static > IBlockState func_190793_a(IBlockState p_190793_0_, IProperty p_190793_1_, Comparable p_190793_2_) - { -- return p_190793_0_.func_177226_a(p_190793_1_, (T) p_190793_2_); -+ return p_190793_0_.func_177226_a(p_190793_1_, (T)p_190793_2_); - } - - public static Predicate func_190791_b(final Block p_190791_0_, String p_190791_1_) throws InvalidBlockStateException -@@ -634,7 +629,7 @@ - } - }; - } -- catch (RuntimeException runtimeexception) -+ catch (RuntimeException var3) - { - final Map < IProperty, Comparable> map = func_190795_c(p_190791_0_, p_190791_1_); - return new Predicate() -@@ -669,7 +664,7 @@ - - private static Map < IProperty, Comparable> func_190795_c(Block p_190795_0_, String p_190795_1_) throws InvalidBlockStateException - { -- Map < IProperty, Comparable> map = Maps.newHashMap(); -+ Map < IProperty, Comparable> map = Maps. < IProperty, Comparable> newHashMap(); - - if ("default".equals(p_190795_1_)) - { -@@ -712,14 +707,14 @@ - map.put(iproperty, comparable); - } - -- throw new InvalidBlockStateException("commands.generic.blockstate.invalid", p_190795_1_, Block.field_149771_c.func_177774_c(p_190795_0_)); -+ throw new InvalidBlockStateException("commands.generic.blockstate.invalid", new Object[] {p_190795_1_, Block.field_149771_c.func_177774_c(p_190795_0_)}); - } - } - - @Nullable - private static > T func_190792_a(IProperty p_190792_0_, String p_190792_1_) - { -- return p_190792_0_.func_185929_b(p_190792_1_).orNull(); -+ return (T)(p_190792_0_.func_185929_b(p_190792_1_).orNull()); - } - - public static String func_71527_a(Object[] p_71527_0_) -@@ -800,7 +795,7 @@ - { - if (i != p_175771_1_ + 2) - { -- return Collections.emptyList(); -+ return Collections.emptyList(); - } - - s = Integer.toString(p_175771_2_.func_177952_p()); -@@ -829,7 +824,7 @@ - { - if (i != p_181043_1_ + 1) - { -- return Collections.emptyList(); -+ return Collections.emptyList(); - } - - s = Integer.toString(p_181043_2_.func_177952_p()); -@@ -852,7 +847,7 @@ - public static List func_175762_a(String[] p_175762_0_, Collection p_175762_1_) - { - String s = p_175762_0_[p_175762_0_.length - 1]; -- List list = Lists.newArrayList(); -+ List list = Lists.newArrayList(); - - if (!p_175762_1_.isEmpty()) - { -@@ -879,7 +874,6 @@ - return list; - } - -- @Override - public boolean func_82358_a(String[] p_82358_1_, int p_82358_2_) - { - return false; diff --git a/patches/minecraft/net/minecraft/command/CommandFill.java.patch b/patches/minecraft/net/minecraft/command/CommandFill.java.patch index fd45befc5..b7955415c 100644 --- a/patches/minecraft/net/minecraft/command/CommandFill.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandFill.java.patch @@ -1,75 +1,6 @@ --- before/net/minecraft/command/CommandFill.java +++ after/net/minecraft/command/CommandFill.java -@@ -18,30 +18,26 @@ - - public class CommandFill extends CommandBase - { -- @Override - public String func_71517_b() - { - return "fill"; - } - -- @Override - public int func_82362_a() - { - return 2; - } - -- @Override - public String func_71518_a(ICommandSender p_71518_1_) - { - return "commands.fill.usage"; - } - -- @Override - public void func_184881_a(MinecraftServer p_184881_1_, ICommandSender p_184881_2_, String[] p_184881_3_) throws CommandException - { - if (p_184881_3_.length < 7) - { -- throw new WrongUsageException("commands.fill.usage"); -+ throw new WrongUsageException("commands.fill.usage", new Object[0]); - } - else - { -@@ -60,23 +56,13 @@ - iblockstate = block.func_176223_P(); - } - -- BlockPos blockpos2 = new BlockPos( -- Math.min(blockpos.func_177958_n(), blockpos1.func_177958_n()), -- Math.min(blockpos.func_177956_o(), blockpos1.func_177956_o()), -- Math.min(blockpos.func_177952_p(), blockpos1.func_177952_p()) -- ); -- BlockPos blockpos3 = new BlockPos( -- Math.max(blockpos.func_177958_n(), blockpos1.func_177958_n()), -- Math.max(blockpos.func_177956_o(), blockpos1.func_177956_o()), -- Math.max(blockpos.func_177952_p(), blockpos1.func_177952_p()) -- ); -- int i = (blockpos3.func_177958_n() - blockpos2.func_177958_n() + 1) -- * (blockpos3.func_177956_o() - blockpos2.func_177956_o() + 1) -- * (blockpos3.func_177952_p() - blockpos2.func_177952_p() + 1); -+ BlockPos blockpos2 = new BlockPos(Math.min(blockpos.func_177958_n(), blockpos1.func_177958_n()), Math.min(blockpos.func_177956_o(), blockpos1.func_177956_o()), Math.min(blockpos.func_177952_p(), blockpos1.func_177952_p())); -+ BlockPos blockpos3 = new BlockPos(Math.max(blockpos.func_177958_n(), blockpos1.func_177958_n()), Math.max(blockpos.func_177956_o(), blockpos1.func_177956_o()), Math.max(blockpos.func_177952_p(), blockpos1.func_177952_p())); -+ int i = (blockpos3.func_177958_n() - blockpos2.func_177958_n() + 1) * (blockpos3.func_177956_o() - blockpos2.func_177956_o() + 1) * (blockpos3.func_177952_p() - blockpos2.func_177952_p() + 1); - - if (i > 32768) - { -- throw new CommandException("commands.fill.tooManyBlocks", i, 32768); -+ throw new CommandException("commands.fill.tooManyBlocks", new Object[] {i, Integer.valueOf(32768)}); - } - else if (blockpos2.func_177956_o() >= 0 && blockpos3.func_177956_o() < 256) - { -@@ -88,7 +74,7 @@ - { - if (!world.func_175667_e(new BlockPos(k, blockpos3.func_177956_o() - blockpos2.func_177956_o(), j))) - { -- throw new CommandException("commands.fill.outOfWorld"); -+ throw new CommandException("commands.fill.outOfWorld", new Object[0]); - } - } - } -@@ -96,7 +82,7 @@ +@@ -96,7 +96,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; @@ -78,21 +9,7 @@ { String s = func_180529_a(p_184881_3_, 9); -@@ -107,11 +93,11 @@ - } - catch (NBTException nbtexception) - { -- throw new CommandException("commands.fill.tagError", nbtexception.getMessage()); -+ throw new CommandException("commands.fill.tagError", new Object[] {nbtexception.getMessage()}); - } - } - -- List list = Lists.newArrayList(); -+ List list = Lists.newArrayList(); - i = 0; - - for (int l = blockpos2.func_177952_p(); l <= blockpos3.func_177952_p(); ++l) -@@ -137,26 +123,17 @@ +@@ -137,7 +137,7 @@ continue; } } @@ -101,58 +18,3 @@ { Block block1 = CommandBase.func_147180_g(p_184881_2_, p_184881_3_[9]); -- if (world.func_180495_p(blockpos4).func_177230_c() != block1 -- || p_184881_3_.length > 10 -- && !"-1".equals(p_184881_3_[10]) -- && !"*".equals(p_184881_3_[10]) -- && !CommandBase.func_190791_b(block1, p_184881_3_[10]).apply(world.func_180495_p(blockpos4))) -+ if (world.func_180495_p(blockpos4).func_177230_c() != block1 || p_184881_3_.length > 10 && !"-1".equals(p_184881_3_[10]) && !"*".equals(p_184881_3_[10]) && !CommandBase.func_190791_b(block1, p_184881_3_[10]).apply(world.func_180495_p(blockpos4))) - { - continue; - } - } - } -- else if (j1 != blockpos2.func_177958_n() -- && j1 != blockpos3.func_177958_n() -- && i1 != blockpos2.func_177956_o() -- && i1 != blockpos3.func_177956_o() -- && l != blockpos2.func_177952_p() -- && l != blockpos3.func_177952_p()) -+ else if (j1 != blockpos2.func_177958_n() && j1 != blockpos3.func_177958_n() && i1 != blockpos2.func_177956_o() && i1 != blockpos3.func_177956_o() && l != blockpos2.func_177952_p() && l != blockpos3.func_177952_p()) - { - if ("hollow".equals(p_184881_3_[8])) - { -@@ -205,7 +182,7 @@ - - if (i <= 0) - { -- throw new CommandException("commands.fill.failed"); -+ throw new CommandException("commands.fill.failed", new Object[0]); - } - else - { -@@ -215,12 +192,11 @@ - } - else - { -- throw new CommandException("commands.fill.outOfWorld"); -+ throw new CommandException("commands.fill.outOfWorld", new Object[0]); - } - } - } - -- @Override - public List func_184883_a(MinecraftServer p_184883_1_, ICommandSender p_184883_2_, String[] p_184883_3_, @Nullable BlockPos p_184883_4_) - { - if (p_184883_3_.length > 0 && p_184883_3_.length <= 3) -@@ -241,9 +217,7 @@ - } - else - { -- return p_184883_3_.length == 10 && "replace".equals(p_184883_3_[8]) -- ? func_175762_a(p_184883_3_, Block.field_149771_c.func_148742_b()) -- : Collections.emptyList(); -+ return p_184883_3_.length == 10 && "replace".equals(p_184883_3_[8]) ? func_175762_a(p_184883_3_, Block.field_149771_c.func_148742_b()) : Collections.emptyList(); - } - } - }