mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-15 17:44:46 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80e761d83f | ||
|
|
ef0f8b5329 |
No files matched your search
@@ -90,20 +90,20 @@ public enum WailaPacketHandler {
|
||||
}
|
||||
|
||||
public void writeNBT(ByteBuf target, NBTTagCompound tag) throws IOException {
|
||||
if (tag == null) target.writeShort(-1);
|
||||
if (tag == null) target.writeInt(-1);
|
||||
else {
|
||||
byte[] abyte = CompressedStreamTools.compress(tag);
|
||||
target.writeShort((short) abyte.length);
|
||||
target.writeInt(abyte.length);
|
||||
target.writeBytes(abyte);
|
||||
}
|
||||
}
|
||||
|
||||
public NBTTagCompound readNBT(ByteBuf dat) throws IOException {
|
||||
short short1 = dat.readShort();
|
||||
int val = dat.readInt();
|
||||
|
||||
if (short1 < 0) return null;
|
||||
if (val < 0) return null;
|
||||
else {
|
||||
byte[] abyte = new byte[short1];
|
||||
byte[] abyte = new byte[val];
|
||||
dat.readBytes(abyte);
|
||||
return CompressedStreamTools.func_152457_a(abyte, NBTSizeTracker.field_152451_a);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class TTRenderFluidBar implements IWailaVariableWidthTooltipRenderer {
|
||||
tessellator.startDrawingQuads();
|
||||
// Intentionally draw 2 pixels taller than needed than cover with the border to make the texture more
|
||||
// visible
|
||||
int i = (int) ((double) (maxStringW - 2) * amount / capacity);
|
||||
int i = (int) ((double) (maxStringW - 2) * (amount / Math.max(capacity, amount)));
|
||||
int j = 0;
|
||||
for (; i > height; i = i - height) {
|
||||
drawRectFromIcon(tessellator, 1 + (j * height), 0, 0, icon, height, height);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class TTRenderRFBar implements IWailaVariableWidthTooltipRenderer {
|
||||
drawRect(tessellator, 1 + i, 0, 0, width, height, 0.0, 0.0, 0.5, 1.0);
|
||||
}
|
||||
|
||||
double i = (double) (maxStringW - 2) * amount / capacity;
|
||||
double i = (double) (maxStringW - 2) * ((double) amount / Math.max(capacity, amount));
|
||||
int drawnRects = 0;
|
||||
for (; i > width; i -= width) {
|
||||
drawRect(tessellator, 1 + (drawnRects * width), 0, 0, width, height, 0.5, 0.0, 1.0, 1.0);
|
||||
|
||||
Reference in new issue
Block a user