-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Cleanup patch hunks * Cleanup patch hunks
- Loading branch information
Showing
5 changed files
with
7 additions
and
751 deletions.
There are no files selected for viewing
108 changes: 1 addition & 107 deletions
108
patches/minecraft/net/minecraft/advancements/AdvancementManager.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
|
34 changes: 0 additions & 34 deletions
34
patches/minecraft/net/minecraft/advancements/critereon/ItemPredicate.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.