Progress for matter fabricator finally works. Closes #1630

This commit is contained in:
drcrazy 2018-11-06 17:46:07 +03:00
parent c7db26c21e
commit 941629e790

View file

@ -117,28 +117,27 @@ public class TRBuilder extends GuiBuilder {
gui.mc.getTextureManager().bindTexture(GUI_SHEET); gui.mc.getTextureManager().bindTexture(GUI_SHEET);
gui.drawTexturedModalRect(x, y, direction.x, direction.y, direction.width, direction.height); gui.drawTexturedModalRect(x, y, direction.x, direction.y, direction.width, direction.height);
int j = (int) ((double) progress / (double) maxProgress * 16);
if (direction.equals(ProgressDirection.RIGHT)) { if (j < 0) {
int j = (int) ((double) progress / (double) maxProgress * 16); j = 0;
if (j < 0)
j = 0;
gui.drawTexturedModalRect(x, y, direction.xActive, direction.yActive, j, 10);
} }
if (direction.equals(ProgressDirection.LEFT)) { switch (direction) {
int j = (int) ((double) progress / (double) maxProgress * 16); case RIGHT:
if (j < 0) gui.drawTexturedModalRect(x, y, direction.xActive, direction.yActive, j, 10);
j = 0; break;
gui.drawTexturedModalRect(x + 16 - j, y, direction.xActive + 16 - j, direction.yActive, j, 10); case LEFT:
gui.drawTexturedModalRect(x + 16 - j, y, direction.xActive + 16 - j, direction.yActive, j, 10);
break;
case UP:
gui.drawTexturedModalRect(x, y + 16 - j, direction.xActive, direction.yActive + 16 - j, 10, j);
break;
case DOWN:
gui.drawTexturedModalRect(x, y, direction.xActive, direction.yActive, 10, j);
break;
default:
return;
} }
if (direction.equals(ProgressDirection.UP)) {
int j = (int) ((double) progress / (double) maxProgress * 16);
if (j < 0)
j = 0;
gui.drawTexturedModalRect(x, y + 16 - j, direction.xActive, direction.yActive + 16 - j, 10, j);
}
if (isInRect(x, y, direction.width, direction.height, mouseX, mouseY)) { if (isInRect(x, y, direction.width, direction.height, mouseX, mouseY)) {
int percentage = percentage(maxProgress, progress); int percentage = percentage(maxProgress, progress);