Skip to content

Commit

Permalink
Remove unintentional hard dependency on ProbeData. Closes #6 and #7
Browse files Browse the repository at this point in the history
  • Loading branch information
falkreon committed Dec 31, 2017
1 parent c26d736 commit f3a0575
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ repositories {

def mc_version='1.12.1';
def jei_version="4.7.8.92";
def concrete_version="0.3.5-SNAPSHOT";
def concrete_version="0.3.6-SNAPSHOT";
//def concrete_modules=[]; //For eclipse import
def concrete_modules=["common","inventory","recipe","network","reflect"];
def project_package='com.elytradev.thermionics';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public void provideProbeData(List<IProbeData> data) {
}

public static void addRFData(IEnergyStorage storage, List<IProbeData> list) {
if (storage==null) return; //Odd!
list.add(new ProbeData(new TextComponentTranslation("thermionics.data.energystorage"))
.withBar(0, storage.getEnergyStored(), storage.getMaxEnergyStored(), UnitDictionary.FORGE_ENERGY));
if (storage instanceof ITransferRate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.energy.IEnergyStorage;
import net.minecraftforge.fml.common.Loader;

public class TileEntityBattery extends TileEntity implements ITickable {
protected CapabilityProvider capabilities = new CapabilityProvider();
Expand All @@ -60,7 +61,9 @@ public TileEntityBattery() {

energyStorage.listen(this::markDirty);

ProbeDataSupport.registerRFInspector(this, capabilities);
if (Loader.isModLoaded("probedataprovider")) {
ProbeDataSupport.registerRFInspector(this, capabilities);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.Loader;

public class TileEntityMachine extends TileEntity {
protected CapabilityProvider capabilities = new CapabilityProvider();

public TileEntityMachine() {
ProbeDataSupport.registerMachineInspector(this, capabilities);
if (Loader.isModLoaded("probedataprovider")) {
ProbeDataSupport.registerMachineInspector(this, capabilities);
}
}

public EnumFacing getFacing() {
Expand Down

0 comments on commit f3a0575

Please sign in to comment.