From 8d8923734e80089de56ca11b0399579a56e2d74e Mon Sep 17 00:00:00 2001 From: Scott Killen Date: Fri, 26 Jun 2015 17:00:05 -0400 Subject: [PATCH 1/8] Update to latest recommended forge version. --- build.gradle | 2 +- version/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f642d64..1802882 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ group = "com.scottkillen.mod" archivesBaseName = "KoreSample" minecraft { - version = project.mcversion + "-" + project.forgeversion + version = project.forgeversion + "-" + project.mcversion runDir = "run" replace '${mod_version}', project.version diff --git a/version/gradle.properties b/version/gradle.properties index 1d48d52..610ec69 100644 --- a/version/gradle.properties +++ b/version/gradle.properties @@ -1,6 +1,6 @@ #Sun, 31 May 2015 21:41:35 -0400 mcversion=1.7.10 -forgeversion=10.13.2.1291 +forgeversion=10.13.4.1448 version_major=1 version_series=3 version_revision=0 From a820886cd25caf02c2ef8e30648ef3a83d150c32 Mon Sep 17 00:00:00 2001 From: Scott Killen Date: Sat, 27 Jun 2015 15:16:12 -0400 Subject: [PATCH 2/8] Standardize property names --- build.gradle | 16 ++++++++-------- version/build.gradle | 6 +++--- version/gradle.properties | 5 +++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 1802882..096e00e 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ group = "com.scottkillen.mod" archivesBaseName = "KoreSample" minecraft { - version = project.forgeversion + "-" + project.mcversion + version = project.version_forge + "-" + project.version_mc runDir = "run" replace '${mod_version}', project.version @@ -34,16 +34,16 @@ processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - inputs.property "forgeversion", project.ext.forgeversion + inputs.property "version_mc", project.minecraft.version + inputs.property "version_forge", project.ext.version_forge // replace stuff in the files we want. from(sourceSets.main.resources.srcDirs) { include '**/*.info' include '**/version.properties' - expand 'mod_version': project.version, 'minecraft_version': project.minecraft.version, 'forge_version': project - .ext.forgeversion + expand 'mod_version': project.version, 'minecraft_version': project.minecraft.version, 'forge_version': project + .ext.version_forge } // copy everything else, that we didn't do before @@ -54,7 +54,7 @@ processResources } jar { - includeEmptyDirs = false + includeEmptyDirs = false } task sourcesJar(type: Jar, dependsOn: classes) { @@ -63,7 +63,7 @@ task sourcesJar(type: Jar, dependsOn: classes) { include '**/version.properties' expand 'mod_version': project.version, 'minecraft_version': project.minecraft.version, 'forge_version': project - .ext.forgeversion + .ext.version_forge } from(sourceSets.main.allSource) { @@ -87,7 +87,7 @@ task deobfJar(type: Jar) { include '**/version.properties' expand 'mod_version': project.version, 'minecraft_version': project.minecraft.version, 'forge_version': project - .ext.forgeversion + .ext.version_forge } from(sourceSets.main.output) { diff --git a/version/build.gradle b/version/build.gradle index 9977553..6b8090b 100644 --- a/version/build.gradle +++ b/version/build.gradle @@ -1,6 +1,6 @@ -rootProject.version = "$mcversion-$version_major.$version_series.$version_revision" -rootProject.ext.mcversion = mcversion -rootProject.ext.forgeversion = forgeversion +rootProject.version = "$version_mc-$version_major.$version_series.$version_revision" +rootProject.ext.version_mc = version_mc +rootProject.ext.version_forge = version_forge task echoVersion << { printNextVersion() diff --git a/version/gradle.properties b/version/gradle.properties index 610ec69..119fd09 100644 --- a/version/gradle.properties +++ b/version/gradle.properties @@ -1,6 +1,7 @@ #Sun, 31 May 2015 21:41:35 -0400 -mcversion=1.7.10 -forgeversion=10.13.4.1448 +version_mc=1.7.10 +version_forge=10.13.4.1448 + version_major=1 version_series=3 version_revision=0 From 46d362f6a6987886aeee5a6cf6de1e0941b8e2a2 Mon Sep 17 00:00:00 2001 From: Scott Killen Date: Sat, 27 Jun 2015 15:16:49 -0400 Subject: [PATCH 3/8] Move common version code to external source --- version/build.gradle | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/version/build.gradle b/version/build.gradle index 6b8090b..fcea887 100644 --- a/version/build.gradle +++ b/version/build.gradle @@ -2,41 +2,4 @@ rootProject.version = "$version_mc-$version_major.$version_series.$version_revis rootProject.ext.version_mc = version_mc rootProject.ext.version_forge = version_forge -task echoVersion << { - printNextVersion() -} - -def saveVersion() { - ant.propertyfile( - file: "gradle.properties") { - entry( key:"version_major", type:"int", value: version_major) - entry( key:"version_series", type:"int", value: version_series) - entry( key:"version_revision", type:"int", value: version_revision) - } - rootProject.version = "$mcversion-$version_major.$version_series.$version_revision" - printNextVersion() -} - -def printNextVersion(){ - println '*************************************************************' - println 'The next build will be version: ' + rootProject.version - println '*************************************************************' -} - -task bumpMajor << { - project.version_major = Integer.parseInt(project.version_major) + 1 - project.version_series = "0" - project.version_revision = "0" - saveVersion() -} - -task bumpSeries << { - project.version_series = Integer.parseInt(project.version_series) + 1 - project.version_revision = "0" - saveVersion() -} - -task bumpRevision << { - project.version_revision = Integer.parseInt(project.version_revision) + 1 - saveVersion() -} +apply from: "https://raw.githubusercontent.com/ScottKillen/Snippets/master/gradle/version.gradle" \ No newline at end of file From fba7844e1ba14ee221998b35f7503c2c389e227b Mon Sep 17 00:00:00 2001 From: Scott Killen Date: Sat, 27 Jun 2015 15:43:44 -0400 Subject: [PATCH 4/8] Fix whitespace --- .../mod/koresample/tree/block/WoodBlock.java | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/src/main/java/com/scottkillen/mod/koresample/tree/block/WoodBlock.java b/src/main/java/com/scottkillen/mod/koresample/tree/block/WoodBlock.java index d376405..e51c762 100644 --- a/src/main/java/com/scottkillen/mod/koresample/tree/block/WoodBlock.java +++ b/src/main/java/com/scottkillen/mod/koresample/tree/block/WoodBlock.java @@ -19,76 +19,76 @@ public abstract class WoodBlock extends BlockWood { - public static final int CAPACITY = 16; - private final ImmutableList subBlocks; - private final List icons = Lists.newArrayList(); + public static final int CAPACITY = 16; + private final ImmutableList subBlocks; + private final List icons = Lists.newArrayList(); - protected WoodBlock(Collection subBlocks) - { - Preconditions.checkArgument(!subBlocks.isEmpty()); - Preconditions.checkArgument(subBlocks.size() <= CAPACITY); - this.subBlocks = ImmutableList.copyOf(subBlocks); - setBlockName("wood"); - } + protected WoodBlock(Collection subBlocks) + { + Preconditions.checkArgument(!subBlocks.isEmpty()); + Preconditions.checkArgument(subBlocks.size() <= CAPACITY); + this.subBlocks = ImmutableList.copyOf(subBlocks); + setBlockName("wood"); + } - @SuppressWarnings("WeakerAccess") - protected static String getUnwrappedUnlocalizedName(String unlocalizedName) - { - return unlocalizedName.substring(unlocalizedName.indexOf('.') + 1); - } + @SuppressWarnings("WeakerAccess") + protected static String getUnwrappedUnlocalizedName(String unlocalizedName) + { + return unlocalizedName.substring(unlocalizedName.indexOf('.') + 1); + } - protected final List subBlocks() { return Collections.unmodifiableList(subBlocks); } + protected final List subBlocks() { return Collections.unmodifiableList(subBlocks); } - public final ImmutableList getSubBlockNames() - { - final List names = Lists.newArrayList(); - for (final DefinesWood subBlock : subBlocks) - names.add(subBlock.speciesName()); - return ImmutableList.copyOf(names); - } + public final ImmutableList getSubBlockNames() + { + final List names = Lists.newArrayList(); + for (final DefinesWood subBlock : subBlocks) + names.add(subBlock.speciesName()); + return ImmutableList.copyOf(names); + } - @Override - public final String getUnlocalizedName() - { - return String.format("tile.%s%s", resourcePrefix(), getUnwrappedUnlocalizedName(super.getUnlocalizedName())); - } + @Override + public final String getUnlocalizedName() + { + return String.format("tile.%s%s", resourcePrefix(), getUnwrappedUnlocalizedName(super.getUnlocalizedName())); + } - @SideOnly(Side.CLIENT) - @Override - public final IIcon getIcon(int unused, int meta) - { - final int meta1 = meta < 0 || meta >= icons.size() ? 0 : meta; - return icons.get(meta1); - } + @SideOnly(Side.CLIENT) + @Override + public final IIcon getIcon(int unused, int meta) + { + final int meta1 = meta < 0 || meta >= icons.size() ? 0 : meta; + return icons.get(meta1); + } - @SuppressWarnings("unchecked") - @SideOnly(Side.CLIENT) - @Override - public final void getSubBlocks(Item item, CreativeTabs unused, List subblocks) - { - for (int i = 0; i < subBlocks.size(); i++) - //noinspection ObjectAllocationInLoop - subblocks.add(new ItemStack(item, 1, i)); - } + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + @Override + public final void getSubBlocks(Item item, CreativeTabs unused, List subblocks) + { + for (int i = 0; i < subBlocks.size(); i++) + //noinspection ObjectAllocationInLoop + subblocks.add(new ItemStack(item, 1, i)); + } - @SideOnly(Side.CLIENT) - @Override - public final void registerBlockIcons(IIconRegister iconRegister) - { - icons.clear(); + @SideOnly(Side.CLIENT) + @Override + public final void registerBlockIcons(IIconRegister iconRegister) + { + icons.clear(); - for (int i = 0; i < subBlocks.size(); i++) - { - final String iconName = String.format("%splanks_%s", resourcePrefix(), subBlocks.get(i).speciesName()); - icons.add(i, iconRegister.registerIcon(iconName)); - } - } + for (int i = 0; i < subBlocks.size(); i++) + { + final String iconName = String.format("%splanks_%s", resourcePrefix(), subBlocks.get(i).speciesName()); + icons.add(i, iconRegister.registerIcon(iconName)); + } + } - protected abstract String resourcePrefix(); + protected abstract String resourcePrefix(); - @Override - public String toString() - { - return Objects.toStringHelper(this).add("subBlocks", subBlocks).add("icons", icons).toString(); - } + @Override + public String toString() + { + return Objects.toStringHelper(this).add("subBlocks", subBlocks).add("icons", icons).toString(); + } } From cd210c8a03b607ddd4f51dd1126b7e9692c8b94d Mon Sep 17 00:00:00 2001 From: Scott Killen Date: Sat, 27 Jun 2015 15:50:50 -0400 Subject: [PATCH 5/8] Adjust metadata so the NEI stops reporting an exception (even though there is no bug or crash) Addresses MinecraftModArchive/Dendrology/#37 --- .../scottkillen/mod/koresample/common/block/SlabBlock.java | 5 ++++- .../mod/koresample/tree/block/SaplingBlock.java | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/scottkillen/mod/koresample/common/block/SlabBlock.java b/src/main/java/com/scottkillen/mod/koresample/common/block/SlabBlock.java index 7853a93..83f992c 100644 --- a/src/main/java/com/scottkillen/mod/koresample/common/block/SlabBlock.java +++ b/src/main/java/com/scottkillen/mod/koresample/common/block/SlabBlock.java @@ -56,7 +56,10 @@ protected static String getUnwrappedUnlocalizedName(String unlocalizedName) @Override public final IIcon getIcon(int side, int metadata) { - final DefinesSlab subBlock = subBlocks.get(mask(metadata)); + int index = mask(metadata); + if (index < 0 || index > subBlocks.size()) index = 0; + + final DefinesSlab subBlock = subBlocks.get(index); final Block modelBlock = subBlock.slabModelBlock(); final int modelBlockMetadata = subBlock.slabModelSubBlockIndex(); return modelBlock.getIcon(side, modelBlockMetadata); diff --git a/src/main/java/com/scottkillen/mod/koresample/tree/block/SaplingBlock.java b/src/main/java/com/scottkillen/mod/koresample/tree/block/SaplingBlock.java index 4a587e7..bef4bac 100644 --- a/src/main/java/com/scottkillen/mod/koresample/tree/block/SaplingBlock.java +++ b/src/main/java/com/scottkillen/mod/koresample/tree/block/SaplingBlock.java @@ -62,7 +62,12 @@ public final List subBlockNames() @SideOnly(Side.CLIENT) @Override - public final IIcon getIcon(int unused, int metadata) { return subblockIcons.get(mask(metadata)); } + public final IIcon getIcon(int unused, int metadata) + { + int index = mask(metadata); + if (index < 0 || index > subblockIcons.size()) index = 0; + return subblockIcons.get(index); + } @Override public final void func_149878_d(World world, int x, int y, int z, Random rand) From df800d2ed79e007fa421e700b34fd748a70ed8b3 Mon Sep 17 00:00:00 2001 From: Scott Killen Date: Sat, 27 Jun 2015 17:04:40 -0400 Subject: [PATCH 6/8] Fixed index bounds. --- .../com/scottkillen/mod/koresample/common/block/SlabBlock.java | 2 +- .../com/scottkillen/mod/koresample/tree/block/SaplingBlock.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/scottkillen/mod/koresample/common/block/SlabBlock.java b/src/main/java/com/scottkillen/mod/koresample/common/block/SlabBlock.java index 83f992c..224892d 100644 --- a/src/main/java/com/scottkillen/mod/koresample/common/block/SlabBlock.java +++ b/src/main/java/com/scottkillen/mod/koresample/common/block/SlabBlock.java @@ -57,7 +57,7 @@ protected static String getUnwrappedUnlocalizedName(String unlocalizedName) public final IIcon getIcon(int side, int metadata) { int index = mask(metadata); - if (index < 0 || index > subBlocks.size()) index = 0; + if (index < 0 || index >= subBlocks.size()) index = 0; final DefinesSlab subBlock = subBlocks.get(index); final Block modelBlock = subBlock.slabModelBlock(); diff --git a/src/main/java/com/scottkillen/mod/koresample/tree/block/SaplingBlock.java b/src/main/java/com/scottkillen/mod/koresample/tree/block/SaplingBlock.java index bef4bac..bc27d20 100644 --- a/src/main/java/com/scottkillen/mod/koresample/tree/block/SaplingBlock.java +++ b/src/main/java/com/scottkillen/mod/koresample/tree/block/SaplingBlock.java @@ -65,7 +65,7 @@ public final List subBlockNames() public final IIcon getIcon(int unused, int metadata) { int index = mask(metadata); - if (index < 0 || index > subblockIcons.size()) index = 0; + if (index < 0 || index >= subblockIcons.size()) index = 0; return subblockIcons.get(index); } From 135f1ec8183d598bf5862f205d111a10b2f0b2f6 Mon Sep 17 00:00:00 2001 From: Scott Killen Date: Sat, 27 Jun 2015 17:22:13 -0400 Subject: [PATCH 7/8] Convert project to directory-based per https://www.jetbrains.com/idea/help/project.html#d1369943e149 --- .gitignore | 5 +- .idea/codeStyleSettings.xml | 92 ++ .idea/compiler.xml | 19 + .idea/encodings.xml | 4 + .idea/gradle.xml | 18 + .idea/inspectionProfiles/Project_Default.xml | 949 ++++++++++++++++++ .../inspectionProfiles/profiles_settings.xml | 7 + .idea/misc.xml | 6 + .idea/modules.xml | 9 + .idea/scopes/scope_settings.xml | 5 + .idea/vcs.xml | 7 + 11 files changed, 1120 insertions(+), 1 deletion(-) create mode 100644 .idea/codeStyleSettings.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/scopes/scope_settings.xml create mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index a91a1cd..10099c1 100644 --- a/.gitignore +++ b/.gitignore @@ -102,7 +102,7 @@ local.properties # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm ## Directory-based project format -.idea/ +.idea/workspace.xml /*.iml ## File-based project format @@ -133,3 +133,6 @@ build/ # Ignore Gradle GUI config gradle-app.setting + +### Miscellaneous ### +*.stackdump diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml new file mode 100644 index 0000000..e7d5f7e --- /dev/null +++ b/.idea/codeStyleSettings.xml @@ -0,0 +1,92 @@ + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..0345430 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..d821048 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..9741485 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..c59a3d9 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,949 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..c60c33b --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..cf12881 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..421040a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..fce7f71 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From 83d71aefa12ff0d394ceaeee93c1304ed541b4c5 Mon Sep 17 00:00:00 2001 From: Scott Killen Date: Sat, 27 Jun 2015 17:27:58 -0400 Subject: [PATCH 8/8] Bump version to 1.3.1 --- README.md | 2 +- src/main/resources/CHANGELOG.md | 3 +++ version/gradle.properties | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f6600c0..39b26ad 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## Kore Sample -**LATEST OFFICIAL VERSION**: [Kore Sample 1.3.0 for MC 1.7.10][latest] ([changelog][changelog.md]) ([all +**LATEST OFFICIAL VERSION**: [Kore Sample 1.3.1 for MC 1.7.10][latest] ([changelog][changelog.md]) ([all releases][releases]) [latest]: http://scottk.us/KoreSampleMod diff --git a/src/main/resources/CHANGELOG.md b/src/main/resources/CHANGELOG.md index 07940b5..2193c17 100644 --- a/src/main/resources/CHANGELOG.md +++ b/src/main/resources/CHANGELOG.md @@ -1,5 +1,8 @@ # Kore Sample Changelog +## 1.3.1 +- Fixed NEI reporting (non-crash) exception even when all is OK + ## 1.3.0 - Changed logo. - Added WeightedSet utility. diff --git a/version/gradle.properties b/version/gradle.properties index 119fd09..3d72c01 100644 --- a/version/gradle.properties +++ b/version/gradle.properties @@ -1,7 +1,7 @@ -#Sun, 31 May 2015 21:41:35 -0400 +#Sat, 27 Jun 2015 17:24:29 -0400 version_mc=1.7.10 version_forge=10.13.4.1448 version_major=1 version_series=3 -version_revision=0 +version_revision=1