From 54d052d081995399fe89b6a9eb6e4281296dcab6 Mon Sep 17 00:00:00 2001 From: Quintinity Date: Fri, 3 Jul 2020 17:57:59 -0300 Subject: [PATCH] v1.0.2 --- CHANGELOG.md | 8 + README.md | 6 +- build.gradle | 249 +++++++++--------- gradle.properties | 7 +- .../energymeters/EnergyMetersCreativeTab.java | 2 +- .../energymeters/EnergyMetersMod.java | 5 +- .../energymeters/block/BlockBase.java | 2 +- .../energymeters/block/BlockEnergyMeter.java | 2 +- .../client/model/TextureLocations.java | 4 +- src/main/resources/mcmod.info | 2 +- 10 files changed, 152 insertions(+), 135 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 744ffdb..87be9fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +### 1.0.2 - 3 July 2020 +- Updated the FE meter texture to make it look less like a piston +- Added IF (Immersive Flux) as an alias to Forge Energy (when Immersive Engineering is installed) +- Fixed FE meter interaction with Mekanism Universal Cables +- Fixed FE meter interaction with Immersive Engineering Cables +- Fixed a crash when looking at a meter while holding a Better Builder's Wand + + ### 1.0.1 - 29 June 2020 - Fixed MJ meter drawing power even when none is requested downstream - Updated EU meter recipe diff --git a/README.md b/README.md index 6feb567..2b8abdd 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ This is a mod for Minecraft **1.12** (and **1.15** soon) that adds energy meters There are currently 3 different meters available in the 1.12 version. ### **FE Meter** -Works with (almost) all implementations of Forge Energy: +Works with all implementations of Forge Energy: - Redstone Flux (RF) - *from various mods, including the [Thermal series](https://www.curseforge.com/minecraft/mc-mods/thermal-foundation)* - Micro Infinities (μI) - *from [Ender IO](https://www.curseforge.com/minecraft/mc-mods/ender-io)* -- *and likely many more* +- Immersive Flux (IF) - *from [Immersive Engineering](https://www.curseforge.com/minecraft/mc-mods/immersive-engineering)* -Currently does **NOT** work properly with *Mekanism Universal Cables* and *Immersive Engineering Flux* - the numbers on the meter appear incorrectly. +Also works with [Mekanism](https://www.curseforge.com/minecraft/mc-mods/immersive-engineering) Universal Cables. ![](https://i.imgur.com/oS9SxdN.png) diff --git a/build.gradle b/build.gradle index bd1b42d..6d030dd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,122 +1,127 @@ -buildscript { - repositories { - maven { url = 'https://files.minecraftforge.net/maven' } - jcenter() - mavenCentral() - } - dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:3.+' - } -} - -apply plugin: 'net.minecraftforge.gradle' -// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. -apply plugin: 'eclipse' -apply plugin: 'idea' -apply plugin: 'maven-publish' - -version = '1.12.2-1.0.1' -group = 'com.vladmarica.energymeters' -archivesBaseName = 'energymeters' - -sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. - -idea { - module { - downloadJavadoc = true - downloadSources = true - } -} - -minecraft { - // 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 always work. - // Simply re-run your setup task after changing the mappings to update your workspace. - //mappings channel: 'snapshot', version: '20171003-1.12' - mappings channel: 'snapshot', version: '20171003-1.12' - - runs { - client { - workingDirectory project.file('run') - - // Recommended logging data for a userdev environment - property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' - - // Recommended logging level for the console - property 'forge.logging.console.level', 'debug' - } - - server { - - // Recommended logging data for a userdev environment - property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' - - // Recommended logging level for the console - property 'forge.logging.console.level', 'debug' - } - } -} - -repositories { - maven { url = 'http://maven.cil.li/' } // OpenComputers - maven { url = 'https://squiddev.cc/maven/' } // CC:Tweaked - maven { url = 'https://mod-buildcraft.com/maven/' } // Buildcraft - maven { url = 'http://maven.ic2.player.to/' } // IC2 - maven { url = "http://chickenbones.net/maven/" } - maven { url = "http://maven.covers1624.net" } // COFH mods -} - -dependencies { - minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2854' - - testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2' - - // Compile-time dependencies (mod APIs) - compileOnly "li.cil.oc:OpenComputers:MC1.12.2-${opencomputers_api_version}:api" - compileOnly "net.industrial-craft:industrialcraft-2:${ic2_api_version}:api" - compileOnly fg.deobf("org.squiddev:cc-tweaked-1.12.2:${cc_tweaked_api_version}") - compileOnly fg.deobf("com.mod-buildcraft:buildcraft-api:${buildcraft_api_version}") -} - -jar { - manifest { - attributes([ - "Specification-Title": "energymeters", - "Specification-Vendor": "com.vladmarica", - "Specification-Version": "1", - "Implementation-Title": project.name, - "Implementation-Version": "${version}", - "Implementation-Vendor" :"com.vladmarica", - "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") - ]) - } -} - -// Example configuration to allow publishing using the maven-publish task -// This is the preferred method to reobfuscate your jar file -jar.finalizedBy('reobfJar') -// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing -//publish.dependsOn('reobfJar') - -publishing { - publications { - mavenJava(MavenPublication) { - artifact jar - } - } - repositories { - maven { - url "file:///${project.projectDir}/mcmodsrepo" - } - } -} - -sourceSets { - main { output.resourcesDir = output.classesDir } -} - -test { - useJUnitPlatform() -} +buildscript { + repositories { + maven { url = 'https://files.minecraftforge.net/maven' } + jcenter() + mavenCentral() + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:3.+' + } +} + +plugins { + id "com.wynprice.cursemaven" version "2.1.5" +} + +apply plugin: 'net.minecraftforge.gradle' +// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. +apply plugin: 'eclipse' +apply plugin: 'idea' +apply plugin: 'maven-publish' + +version = '1.12.2-1.0.2' +group = 'com.vladmarica.energymeters' +archivesBaseName = 'energymeters' + +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. + +idea { + module { + downloadJavadoc = true + downloadSources = true + } +} + +minecraft { + // 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 always work. + // Simply re-run your setup task after changing the mappings to update your workspace. + //mappings channel: 'snapshot', version: '20171003-1.12' + mappings channel: 'snapshot', version: '20180814-1.12' + + runs { + client { + workingDirectory project.file('run') + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + } + + server { + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + } + } +} + +repositories { + maven { url = 'http://maven.cil.li/' } // OpenComputers + maven { url = 'https://squiddev.cc/maven/' } // CC:Tweaked + maven { url = 'https://mod-buildcraft.com/maven/' } // Buildcraft + maven { url = 'http://maven.ic2.player.to/' } // IC2 + maven { url = "http://chickenbones.net/maven/" } + maven { url = "http://maven.covers1624.net" } // COFH mods +} + +dependencies { + minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2854' + + testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2' + + // Compile-time dependencies (mod APIs) + compileOnly "li.cil.oc:OpenComputers:MC1.12.2-${opencomputers_api_version}:api" + compileOnly "net.industrial-craft:industrialcraft-2:${ic2_api_version}:api" + compileOnly "org.squiddev:cc-tweaked-1.12.2:${cc_tweaked_api_version}" + compileOnly fg.deobf("com.mod-buildcraft:buildcraft-api:${buildcraft_api_version}") + compileOnly "curse.maven:mekanism-api:${mekanism_api_file}" +} + +jar { + manifest { + attributes([ + "Specification-Title": "energymeters", + "Specification-Vendor": "com.vladmarica", + "Specification-Version": "1", + "Implementation-Title": project.name, + "Implementation-Version": "${version}", + "Implementation-Vendor" :"com.vladmarica", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) + } +} + +// Example configuration to allow publishing using the maven-publish task +// This is the preferred method to reobfuscate your jar file +jar.finalizedBy('reobfJar') +// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing +//publish.dependsOn('reobfJar') + +publishing { + publications { + mavenJava(MavenPublication) { + artifact jar + } + } + repositories { + maven { + url "file:///${project.projectDir}/mcmodsrepo" + } + } +} + +sourceSets { + main { output.resourcesDir = output.classesDir } +} + +test { + useJUnitPlatform() +} diff --git a/gradle.properties b/gradle.properties index a2ba198..722a709 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,9 @@ mc_version_short=1.12 # Mod APIs (compile time only) opencomputers_api_version=1.7.+ -cc_tweaked_api_version=1.89.+ +cc_tweaked_api_version=1.89.2 ic2_api_version=2.8.220-ex112 -buildcraft_api_version=7.99.24.+ \ No newline at end of file +buildcraft_api_version=7.99.24.+ + +# https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2835176 +mekanism_api_file=2835176 \ No newline at end of file diff --git a/src/main/java/com/vladmarica/energymeters/EnergyMetersCreativeTab.java b/src/main/java/com/vladmarica/energymeters/EnergyMetersCreativeTab.java index 48db2a4..2ab4c85 100644 --- a/src/main/java/com/vladmarica/energymeters/EnergyMetersCreativeTab.java +++ b/src/main/java/com/vladmarica/energymeters/EnergyMetersCreativeTab.java @@ -11,7 +11,7 @@ public EnergyMetersCreativeTab() { } @Override - public ItemStack getTabIconItem() { + public ItemStack createIcon() { return new ItemStack(Item.getItemFromBlock(Blocks.ENERGY_METER)); } } diff --git a/src/main/java/com/vladmarica/energymeters/EnergyMetersMod.java b/src/main/java/com/vladmarica/energymeters/EnergyMetersMod.java index 6256af2..60e8d8d 100644 --- a/src/main/java/com/vladmarica/energymeters/EnergyMetersMod.java +++ b/src/main/java/com/vladmarica/energymeters/EnergyMetersMod.java @@ -14,11 +14,12 @@ import org.apache.logging.log4j.Logger; @SuppressWarnings("unused") -@Mod(modid = EnergyMetersMod.MODID, name = EnergyMetersMod.NAME, version = EnergyMetersMod.VERSION) +@Mod(modid = EnergyMetersMod.MODID, name = EnergyMetersMod.NAME, version = EnergyMetersMod.VERSION, updateJSON = EnergyMetersMod.UPDATE_CHECKER_URL) public class EnergyMetersMod { public static final String MODID = "energymeters"; public static final String NAME = "Forge Energy Meters"; - public static final String VERSION = "1.0.1"; + public static final String VERSION = "1.0.2"; + public static final String UPDATE_CHECKER_URL = "https://gist.githubusercontent.com/vladmarica/6a3f0ef227c40d4bff4c99725fe6c3c6/raw/ebfc193ec18abe08b936f308d65f0517b04587ff/energy-meters-updates.json"; public static final Logger LOGGER = LogManager.getLogger(MODID); public static final SimpleNetworkWrapper NETWORK = diff --git a/src/main/java/com/vladmarica/energymeters/block/BlockBase.java b/src/main/java/com/vladmarica/energymeters/block/BlockBase.java index 7682c5c..5bd0cad 100644 --- a/src/main/java/com/vladmarica/energymeters/block/BlockBase.java +++ b/src/main/java/com/vladmarica/energymeters/block/BlockBase.java @@ -9,7 +9,7 @@ public BlockBase(Material material, String name) { super(material); this.setRegistryName(name); - this.setUnlocalizedName(String.format("%s.%s", EnergyMetersMod.MODID, name)); + this.setTranslationKey(String.format("%s.%s", EnergyMetersMod.MODID, name)); this.setHardness(1F); this.setCreativeTab(EnergyMetersMod.CREATIVE_TAB); } diff --git a/src/main/java/com/vladmarica/energymeters/block/BlockEnergyMeter.java b/src/main/java/com/vladmarica/energymeters/block/BlockEnergyMeter.java index 135e088..aa2fcd7 100644 --- a/src/main/java/com/vladmarica/energymeters/block/BlockEnergyMeter.java +++ b/src/main/java/com/vladmarica/energymeters/block/BlockEnergyMeter.java @@ -131,7 +131,7 @@ public IBlockState getStateFromMeta(int meta) { int facingIndex = meta & 0b11; int typeIndex = (meta & 0b1100) >> 2; return getDefaultState() - .withProperty(PROP_FACING, EnumFacing.getHorizontal(facingIndex)) + .withProperty(PROP_FACING, EnumFacing.byHorizontalIndex(facingIndex)) .withProperty(PROP_TYPE, MeterType.values()[typeIndex]); } diff --git a/src/main/java/com/vladmarica/energymeters/client/model/TextureLocations.java b/src/main/java/com/vladmarica/energymeters/client/model/TextureLocations.java index 56958f5..6f22805 100644 --- a/src/main/java/com/vladmarica/energymeters/client/model/TextureLocations.java +++ b/src/main/java/com/vladmarica/energymeters/client/model/TextureLocations.java @@ -39,7 +39,7 @@ public static ResourceLocation getScreenTexture(MeterType type) { } public static ResourceLocation getGuiResource(ResourceLocation location) { - String path = location.getResourcePath(); - return new ResourceLocation(location.getResourceDomain(), String.format("textures/%s.png", path)); + String path = location.getPath(); + return new ResourceLocation(location.getNamespace(), String.format("textures/%s.png", path)); } } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index a831da0..7131bde 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "energymeters", "name": "Energy Meters", "description": "Adds energy meters for measuring and limiting the throughput of, FE, RF, MJ, EU, and more.", - "version": "1.0.1", + "version": "1.0.2", "mcversion": "1.12.2", "url": "https://github.com/vladmarica/energy-meters", "updateUrl": "",