Skip to content

Commit

Permalink
v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vladmarica committed Jul 3, 2020
1 parent 3fc7939 commit 54d052d
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 135 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
249 changes: 127 additions & 122 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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()
}
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.+
buildcraft_api_version=7.99.24.+

# https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2835176
mekanism_api_file=2835176
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public EnergyMetersCreativeTab() {
}

@Override
public ItemStack getTabIconItem() {
public ItemStack createIcon() {
return new ItemStack(Item.getItemFromBlock(Blocks.ENERGY_METER));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down

0 comments on commit 54d052d

Please sign in to comment.