Skip to content

Commit

Permalink
Fix negative costs
Browse files Browse the repository at this point in the history
  • Loading branch information
cam72cam committed Mar 24, 2018
1 parent 4998f83 commit 1182af6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
double fluidPercent = ((CastingInstance) tile.getMultiblock()).getSteelLevel();
int progress = this.tile.getCraftProgress();
float cost = ItemCastingCost.getCastCost(currentItem);
if(cost == ItemCastingCost.BAD_CAST_COST) {
cost = 0;
}

this.mc.getTextureManager().bindTexture(CASTING_GUI_TEXTURE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ public void tick(BlockPos offset) {
}

int cost = ItemCastingCost.getCastCost(item);
if (cost == ItemCastingCost.BAD_CAST_COST) {
return;
}

if (craftTe.getCraftProgress() >= cost) {
craftTe.setCraftProgress(0);
Expand Down

0 comments on commit 1182af6

Please sign in to comment.