Skip to content

Commit

Permalink
Cleanup patch hunks (#253)
Browse files Browse the repository at this point in the history
* Cleanup patch hunks

* Cleanup patch hunks
  • Loading branch information
HaHaWTH authored Dec 8, 2024
1 parent 27f74c2 commit e7f0a41
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 751 deletions.
Original file line number Diff line number Diff line change
@@ -1,116 +1,10 @@
--- 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<Advancement.Builder>()
+ public static final Gson field_192783_b = (new GsonBuilder()).registerTypeHierarchyAdapter(Advancement.Builder.class, new JsonDeserializer<Advancement.Builder>()
{
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<ResourceLocation, Advancement.Builder> map = this.func_192781_c();
this.func_192777_a(map);
+ this.field_193768_e |= net.minecraftforge.common.ForgeHooks.loadAdvancements(map);
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.<ResourceLocation, Advancement.Builder>newHashMap();
}
else
{
- Map<ResourceLocation, Advancement.Builder> map = Maps.newHashMap();
+ Map<ResourceLocation, Advancement.Builder> map = Maps.<ResourceLocation, Advancement.Builder>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);
}
}

Original file line number Diff line number Diff line change
@@ -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())
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}

Expand All @@ -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;
}

Expand Down
Loading

0 comments on commit e7f0a41

Please sign in to comment.