Fixed Botania and Energy Port Bar direction. TODO: Fix the rest of the bars when I know how to fill the ports Xd

Fixed a render bug with overlapping on the structure Generator Boundary Box rendering. TODO: Box disappears at certain angles.
Fisher's first commit :)
This commit is contained in:
Fisher
2021-08-19 17:39:47 -04:00
parent c1244d1684
commit 1316d2ab39
4 changed files with 27 additions and 10 deletions

View File

@@ -52,12 +52,21 @@ public class StructureGenTileEntityRenderer extends TileEntityRenderer<Structure
matrixStackIn.push();
Matrix4f mat = matrixStackIn.getLast().getMatrix();
int x = Math.min(pos1.getX(), pos2.getX());
int y = Math.min(pos1.getY(), pos2.getY());
int z = Math.min(pos1.getZ(), pos2.getZ());
int dx = Math.max(pos1.getX(), pos2.getX()) + 1;
int dy = Math.max(pos1.getY(), pos2.getY()) + 1;
int dz = Math.max(pos1.getZ(), pos2.getZ()) + 1;
float x = Math.min(pos1.getX(), pos2.getX());
float y = Math.min(pos1.getY(), pos2.getY());
float z = Math.min(pos1.getZ(), pos2.getZ());
float dx = Math.max(pos1.getX(), pos2.getX()) + 1;
float dy = Math.max(pos1.getY(), pos2.getY()) + 1;
float dz = Math.max(pos1.getZ(), pos2.getZ()) + 1;
float xAdjust = addWiggleRoom(x,dx);
x = x+xAdjust;
dx = dx+(xAdjust*-1);
float yAdjust = addWiggleRoom(y,dy);
y = y+yAdjust;
dy = dy+(yAdjust*-1);
float zAdjust = addWiggleRoom(z,dz);
z = z+zAdjust;
dz = dz+(zAdjust*-1);
int R = 255, G = 255, B = 255, A = 70;
builder.pos(mat, x , y, z).color(R, G, B, A).endVertex();
@@ -93,4 +102,11 @@ public class StructureGenTileEntityRenderer extends TileEntityRenderer<Structure
matrixStackIn.pop();
}
}
private float addWiggleRoom(float coordOne, float coordTwo) {
if(coordOne > coordTwo) {
return 0.05f;
}
return -0.05f;
}
}

View File

@@ -67,7 +67,8 @@ public class EnergyPortStorage extends PortStorage {
if (inv.getMaxEnergyStored() > 0) {
amount = (float)inv.getEnergyStored() / inv.getMaxEnergyStored();
}
screen.blit(stack, left + barOffsetX, top + barOffsetY, 193, 18, 18, (int) (108 * amount));
//screen.blit(stack, left + barOffsetX, top + barOffsetY, 193, 18, 18, (int) (108 * amount));
screen.blit(stack, left + barOffsetX, top + barOffsetY + 108 - (int) (108*amount), 193, 18, 18, (int) (108*amount)-1);
AbstractGui.drawString(stack, Minecraft.getInstance().fontRenderer,Math.round((float)10000 * amount) / 100.f + "%", left + 30, top + 60, 0xfefefe);
AbstractGui.drawString(stack, Minecraft.getInstance().fontRenderer, inv.getEnergyStored() + "FE", left + 30, top + 80, 0xfefefe);
}

View File

@@ -73,7 +73,7 @@ public class ManaPortStorage extends PortStorage {
if (inv.getMaxManaStored() > 0) {
amount = (float)inv.getManaStored() / inv.getMaxManaStored();
}
screen.blit(stack, left + barOffsetX, top + barOffsetY, 193, 18, 18, (int) (108 * amount));
screen.blit(stack, left + barOffsetX, top + barOffsetY + 108 - (int) (108*amount), 193, 18, 18, (int) (108*amount)-1);
AbstractGui.drawString(stack, Minecraft.getInstance().fontRenderer, inv.getManaStored() + " Mana", left + 30, top + 60, 0xfefefe);
}
}

View File

@@ -1,2 +1,2 @@
#Sat Jul 17 00:12:57 BST 2021
VERSION_CODE=658
#Thu Aug 19 17:18:09 EDT 2021
VERSION_CODE=718