mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-24 22:14:40 +00:00
Ported to 1.7.10
Fixed BC Thanks for the PRs from Shane Sova, Crazy Pants & MrSourceCoded
This commit is contained in:
1 parent
73ac295ade
commit
08a7be082c
8 files changed
+20
-18
No files matched your search
@@ -33,22 +33,22 @@ public class HUDHandlerIPowerReceptor implements IWailaDataProvider {
|
||||
Object powerReceiver = BCPowerAPIModule.IPowerReceptor_getPowerReceiver.invoke(accessor.getTileEntity(), ForgeDirection.UNKNOWN);
|
||||
if (powerReceiver != null){
|
||||
|
||||
Float minEnergyRecv = (Float)BCPowerAPIModule.PR_getMinEnergyReceived.invoke(powerReceiver);
|
||||
Float maxEnergyRecv = (Float)BCPowerAPIModule.PR_getMaxEnergyReceived.invoke(powerReceiver);
|
||||
Float activation = (Float)BCPowerAPIModule.PR_getActivationEnergy.invoke(powerReceiver);
|
||||
Object minEnergyRecv = BCPowerAPIModule.PR_getMinEnergyReceived.invoke(powerReceiver);
|
||||
Object maxEnergyRecv = BCPowerAPIModule.PR_getMaxEnergyReceived.invoke(powerReceiver);
|
||||
Object activation = BCPowerAPIModule.PR_getActivationEnergy.invoke(powerReceiver);
|
||||
|
||||
|
||||
if(accessor.getNBTData().hasKey("powerProvider") && accessor.getNBTData().getCompoundTag("powerProvider").hasKey("storedEnergy") && config.getConfig("bcapi.storage")){
|
||||
Float energyStored = (Float)accessor.getNBTData().getCompoundTag("powerProvider").getFloat("storedEnergy");
|
||||
Float maxEnergyStor = (Float)BCPowerAPIModule.PR_getMaxEnergyStored.invoke(powerReceiver);
|
||||
if (maxEnergyStor != 0.0f)
|
||||
Object energyStored = accessor.getNBTData().getCompoundTag("powerProvider").getFloat("storedEnergy");
|
||||
Number maxEnergyStor = (Number)BCPowerAPIModule.PR_getMaxEnergyStored.invoke(powerReceiver);
|
||||
if (maxEnergyStor.floatValue() != 0.0f)
|
||||
currenttip.add(String.format("%.1f / %.1f MJ", energyStored, maxEnergyStor));
|
||||
}
|
||||
|
||||
if(accessor.getNBTData().hasKey("storedEnergy") && config.getConfig("bcapi.storage")){
|
||||
Float energyStored = (Float)accessor.getNBTData().getFloat("storedEnergy");
|
||||
Float maxEnergyStor = (Float)BCPowerAPIModule.PR_getMaxEnergyStored.invoke(powerReceiver);
|
||||
if (maxEnergyStor != 0.0f)
|
||||
Object energyStored = accessor.getNBTData().getFloat("storedEnergy");
|
||||
Number maxEnergyStor = (Number)BCPowerAPIModule.PR_getMaxEnergyStored.invoke(powerReceiver);
|
||||
if (maxEnergyStor.floatValue() != 0.0f)
|
||||
currenttip.add(String.format("%.1f / %.1f MJ", energyStored, maxEnergyStor));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class HUDHandlerCapacitor implements IWailaDataProvider{
|
||||
String outputStr = LangUtil.translateG("hud.msg.output");
|
||||
|
||||
Integer maxEnergyStored = (Integer)EnderIOModule.TCB_getMaxEnergyStored.invoke(accessor.getTileEntity());
|
||||
Float energyStored = (Float)EnderIOModule.TCB_getEnergyStored.invoke(accessor.getTileEntity());
|
||||
Double energyStored = (Double)EnderIOModule.TCB_getEnergyStored.invoke(accessor.getTileEntity());
|
||||
Integer maxIO = (Integer)EnderIOModule.TCB_getMaxIO.invoke(accessor.getTileEntity());
|
||||
Integer maxInput = (Integer)EnderIOModule.TCB_getMaxInput.invoke(accessor.getTileEntity());
|
||||
Integer maxOutput = (Integer)EnderIOModule.TCB_getMaxOutput.invoke(accessor.getTileEntity());
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FontHelper {
|
||||
|
||||
public static void drawString(String s, float x, float y, TrueTypeFont font, float scaleX, float scaleY, float rotationZ, float... rgba){
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
ScaledResolution sr = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
if(mc.gameSettings.hideGUI){
|
||||
return;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public class FontHelper {
|
||||
|
||||
private static void set2DMode(FloatBuffer matrixData) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ScaledResolution sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
ScaledResolution sr = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
mc.entityRenderer.setupOverlayRendering();
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -25,7 +25,7 @@ public class LayoutCanvas extends LayoutBase{
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
this.rez = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
this.setGeometry(0, 0, this.rez.getScaledWidth(), this.rez.getScaledHeight(), CType.ABSXY, CType.ABSXY);
|
||||
|
||||
/*
|
||||
|
||||
@@ -22,7 +22,7 @@ public class LayoutCropping extends LayoutBase {
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
this.rez = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
this.saveGLState();
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
@@ -43,7 +43,7 @@ public abstract class WidgetBase implements IWidget {
|
||||
public WidgetBase(){
|
||||
this.setParent(null);
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
this.rez = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
this.texManager = this.mc.renderEngine;
|
||||
this.setGeometry(new WidgetGeometry(0, 0, 50, 50, CType.ABSXY, CType.ABSXY));
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public abstract class WidgetBase implements IWidget {
|
||||
public WidgetBase(IWidget parent){
|
||||
this.setParent(parent);
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
this.rez = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
this.rez = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
this.texManager = this.mc.renderEngine;
|
||||
this.setGeometry(new WidgetGeometry(0, 0, 50, 50, CType.ABSXY, CType.ABSXY));
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.google.common.base.Charsets;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTSizeTracker;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.FMLEmbeddedChannel;
|
||||
@@ -106,7 +107,7 @@ public enum WailaPacketHandler {
|
||||
else{
|
||||
byte[] abyte = new byte[short1];
|
||||
dat.readBytes(abyte);
|
||||
return CompressedStreamTools.decompress(abyte);
|
||||
return CompressedStreamTools.func_152457_a(abyte, NBTSizeTracker.field_152451_a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.logging.Level;
|
||||
import mcp.mobius.waila.Waila;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTSizeTracker;
|
||||
import net.minecraft.nbt.NBTTagByte;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagInt;
|
||||
@@ -101,7 +102,7 @@ public class NBTUtil {
|
||||
{
|
||||
byte[] abyte = new byte[short1];
|
||||
par0DataInputStream.readFully(abyte);
|
||||
return CompressedStreamTools.decompress(abyte);
|
||||
return CompressedStreamTools.func_152457_a(abyte, NBTSizeTracker.field_152451_a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user