From fec622d83175ca392cbc197e3bf1595a8edd56c2 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 3 Jan 2016 12:58:09 -0200 Subject: [PATCH] Update to 1.8.9 --- build.gradle | 27 +++++++++---------- .../github/soniex2/notebetter/NoteBetter.java | 4 +-- .../notebetter/asm/NoteBetterCore.java | 1 - .../notebetter/config/util/JsonHelper.java | 2 +- .../note/NoteBetterInstruments.java | 16 +++++------ .../util/CachedResourceLocation.java | 2 +- 6 files changed, 25 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index a592ad2..fead6da 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,3 @@ -/* // For those who want the bleeding edge buildscript { repositories { @@ -9,31 +8,32 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.0-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' -*/ +/* // for people who want stable plugins { id "net.minecraftforge.gradle.forge" version "2.0.1" } +*/ -version = "0.2.1" -group= "com.github.soniex2.notebetter" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +version = "0.2.2" +group = "com.github.soniex2.notebetter" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "notebetter" minecraft { - version = "1.8-11.14.3.1521" + version = "1.8.9-11.15.0.1674" runDir = "run" - + // the mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD snapshot are built nightly. // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not allways work. // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20141130" + mappings = "snapshot_20160103" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } @@ -49,7 +49,7 @@ dependencies { // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" - + // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env @@ -68,8 +68,7 @@ dependencies { } -processResources -{ +processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version @@ -77,11 +76,11 @@ processResources // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' - + // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version + expand 'version': project.version, 'mcversion': project.minecraft.version } - + // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' diff --git a/src/main/java/com/github/soniex2/notebetter/NoteBetter.java b/src/main/java/com/github/soniex2/notebetter/NoteBetter.java index 870c74d..2da93f7 100644 --- a/src/main/java/com/github/soniex2/notebetter/NoteBetter.java +++ b/src/main/java/com/github/soniex2/notebetter/NoteBetter.java @@ -10,11 +10,11 @@ import java.io.*; @Mod(modid = NoteBetter.MODID, name = "NoteBetter", version = NoteBetter.VERSION, - acceptedMinecraftVersions = "1.8", acceptableRemoteVersions = "*", + acceptedMinecraftVersions = "1.8.*", acceptableRemoteVersions = "*", guiFactory = "com.github.soniex2.notebetter.gui.NoteBetterGuiFactory") public class NoteBetter { public static final String MODID = "notebetter"; - public static final String VERSION = "0.2.1"; + public static final String VERSION = "0.2.2"; @Mod.Instance public static NoteBetter instance; diff --git a/src/main/java/com/github/soniex2/notebetter/asm/NoteBetterCore.java b/src/main/java/com/github/soniex2/notebetter/asm/NoteBetterCore.java index e18af40..60a738e 100644 --- a/src/main/java/com/github/soniex2/notebetter/asm/NoteBetterCore.java +++ b/src/main/java/com/github/soniex2/notebetter/asm/NoteBetterCore.java @@ -9,7 +9,6 @@ /** * @author soniex2 */ -@IFMLLoadingPlugin.MCVersion("1.8") @IFMLLoadingPlugin.TransformerExclusions("com.github.soniex2.notebetter") @IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE) public class NoteBetterCore implements IFMLLoadingPlugin { diff --git a/src/main/java/com/github/soniex2/notebetter/config/util/JsonHelper.java b/src/main/java/com/github/soniex2/notebetter/config/util/JsonHelper.java index 5f87407..825152f 100644 --- a/src/main/java/com/github/soniex2/notebetter/config/util/JsonHelper.java +++ b/src/main/java/com/github/soniex2/notebetter/config/util/JsonHelper.java @@ -13,7 +13,7 @@ public static JsonArray getJsonArrayOrNull(JsonObject jsonObject, String key) { if (jsonObject.isJsonNull()) { return null; } - return JsonUtils.getJsonElementAsJsonArray(jsonObject.get(key), key); + return JsonUtils.getJsonArray(jsonObject.get(key), key); } else { return null; } diff --git a/src/main/java/com/github/soniex2/notebetter/note/NoteBetterInstruments.java b/src/main/java/com/github/soniex2/notebetter/note/NoteBetterInstruments.java index 1cac959..1beb40a 100644 --- a/src/main/java/com/github/soniex2/notebetter/note/NoteBetterInstruments.java +++ b/src/main/java/com/github/soniex2/notebetter/note/NoteBetterInstruments.java @@ -49,7 +49,7 @@ public NoteBetterInstrument getInstrumentForMaterial(@Nonnull Material material) // We already have a ResourceLocation, this is faster. Block b = null; if (Block.blockRegistry.containsKey(blockName)) { - b = (Block) Block.blockRegistry.getObject(blockName); + b = Block.blockRegistry.getObject(blockName); } if (b != null && b.getMaterial() == material) { return ms.getInstrument(); @@ -66,7 +66,7 @@ public NoteBetterInstrument getInstrumentForMaterial(@Nonnull Material material) */ @Nullable public NoteBetterInstrument getInstrumentForBlock(@Nonnull Block block) { - ResourceLocation rl = (ResourceLocation) Block.blockRegistry.getNameForObject(block); + ResourceLocation rl = Block.blockRegistry.getNameForObject(block); if (rl != null && blocks.containsKey(rl)) { // null check is an optimization return blocks.get(rl); } @@ -120,7 +120,7 @@ private NoteBetterInstrument getInstrument(@Nonnull JsonElement jsonElement) { } else { throw new JsonSyntaxException("Invalid instrument: " + jsonElement); } - volume = JsonUtils.getJsonObjectFloatFieldValueOrDefault(jsonObject, "volume", 3f); + volume = JsonUtils.getFloat(jsonObject, "volume", 3f); } else if (jsonElement.isJsonNull()) { name = null; volume = 3f; @@ -146,8 +146,8 @@ public Object deserialize(JsonElement json, Type typeOfT, JsonDeserializationCon JsonArray materials = JsonHelper.getJsonArrayOrNull(jsonObject, "materials"); if (blocks != null) { for (JsonElement element : blocks) { - JsonObject blockObject = JsonUtils.getElementAsJsonObject(element, "blocks"); - String block = JsonUtils.getJsonObjectStringFieldValue(blockObject, "block"); + JsonObject blockObject = JsonUtils.getJsonObject(element, "blocks"); + String block = JsonUtils.getString(blockObject, "block"); JsonElement soundElement = blockObject.get("sound"); if (soundElement == null) throw new JsonSyntaxException("Invalid instrument"); config.blocks.put(new CachedResourceLocation(block), getInstrument(soundElement)); @@ -155,12 +155,12 @@ public Object deserialize(JsonElement json, Type typeOfT, JsonDeserializationCon } if (materials != null) { for (JsonElement element : materials) { - JsonObject materialObject = JsonUtils.getElementAsJsonObject(element, "materials"); + JsonObject materialObject = JsonUtils.getJsonObject(element, "materials"); String block; if (materialObject.has("material_of")) { - block = JsonUtils.getJsonObjectStringFieldValue(materialObject, "material_of"); + block = JsonUtils.getString(materialObject, "material_of"); } else { - block = JsonUtils.getJsonObjectStringFieldValue(materialObject, "material"); + block = JsonUtils.getString(materialObject, "material"); } JsonElement soundElement = materialObject.get("sound"); if (soundElement == null) throw new JsonSyntaxException("Invalid instrument"); diff --git a/src/main/java/com/github/soniex2/notebetter/util/CachedResourceLocation.java b/src/main/java/com/github/soniex2/notebetter/util/CachedResourceLocation.java index 0ddd229..26205df 100644 --- a/src/main/java/com/github/soniex2/notebetter/util/CachedResourceLocation.java +++ b/src/main/java/com/github/soniex2/notebetter/util/CachedResourceLocation.java @@ -28,7 +28,7 @@ protected CachedResourceLocation(int p_i45928_1_, String... resourcePathIn) { } public CachedResourceLocation(@Nonnull String p_i1293_1_) { - this(0, func_177516_a(p_i1293_1_)); + this(0, splitObjectName(p_i1293_1_)); } public CachedResourceLocation(@Nonnull String p_i1292_1_, @Nonnull String p_i1292_2_) {