Additional bugfixes

This commit is contained in:
Anuken
2018-07-03 10:07:48 -04:00
parent ec127519aa
commit 7a4f56d943
7 changed files with 20 additions and 12 deletions

View File

@@ -181,7 +181,7 @@ public class ItemDrop extends SolidEntity implements SaveTrait, SyncTrait, DrawT
} }
if(sinktime >= sinkLifetime){ if(sinktime >= sinkLifetime){
CallEntity.onPickup(getID()); remove();
} }
}else{ }else{
sinktime = 0f; sinktime = 0f;

View File

@@ -25,10 +25,7 @@ import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill; import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines; import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.graphics.Shapes; import io.anuke.ucore.graphics.Shapes;
import io.anuke.ucore.util.Angles; import io.anuke.ucore.util.*;
import io.anuke.ucore.util.Geometry;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Translator;
import java.util.Arrays; import java.util.Arrays;

View File

@@ -251,6 +251,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
if(Net.client()){ if(Net.client()){
interpolate(); interpolate();
status.update(this);
return; return;
} }

View File

@@ -121,11 +121,11 @@ public class OverlayRenderer {
drawbars.run(); drawbars.run();
if(values[0] > 0){ if(values[0] > 0){
drawEncloser(target.drawx(), target.drawy() + target.block().size * tilesize/2f + 2f + values[0]/2f + (values[0] > 2 ? 1 : 0), values[0]); drawEncloser(target.drawx(), target.drawy() + target.block().size * tilesize/2f + 2f + values[0]/2f - 0.5f + (values[0] > 2 ? 0.5f : 0), values[0]);
} }
if(values[1] > 0){ if(values[1] > 0){
drawEncloser(target.drawx(), target.drawy() - target.block().size * tilesize/2f - 2f - values[1]/2f, values[1]); drawEncloser(target.drawx(), target.drawy() - target.block().size * tilesize/2f - 2f - values[1]/2f - 0.5f, values[1]);
} }
doDraw[0] = true; doDraw[0] = true;

View File

@@ -259,7 +259,11 @@ public class BlocksFragment extends Fragment{
return; return;
} }
} }
} }/*else{
if(control.input(0).recipe == r){
control.input(0).recipe = null;
}
}*/
image.setChecked(false); image.setChecked(false);
}); });

View File

@@ -196,7 +196,6 @@ public class BuildBlock extends Block {
double maxProgress = amount; double maxProgress = amount;
for(int i = 0; i < recipe.requirements.length; i ++){ for(int i = 0; i < recipe.requirements.length; i ++){
accumulator[i] += recipe.requirements[i].amount*amount; //add amount progressed to the accumulator
int required = (int)(accumulator[i]); //calculate items that are required now int required = (int)(accumulator[i]); //calculate items that are required now
if(required > 0){ //if this amount is positive... if(required > 0){ //if this amount is positive...
@@ -205,7 +204,7 @@ public class BuildBlock extends Block {
//get this as a fraction //get this as a fraction
double fraction = maxUse / (double)required; double fraction = maxUse / (double)required;
accumulator[i] -= recipe.requirements[i].amount*amount*(1-fraction); //accumulator[i] -= recipe.requirements[i].amount*amount*(1-fraction);
//move max progress down if this fraction is less than 1 //move max progress down if this fraction is less than 1
maxProgress = Math.min(maxProgress, maxProgress*fraction); maxProgress = Math.min(maxProgress, maxProgress*fraction);
@@ -217,6 +216,10 @@ public class BuildBlock extends Block {
//else, no items are required yet, so just keep going //else, no items are required yet, so just keep going
} }
for (int i = 0; i < recipe.requirements.length; i++) {
accumulator[i] += recipe.requirements[i].amount*maxProgress; //add min amount progressed to the accumulator
}
progress += maxProgress; progress += maxProgress;
updated = true; updated = true;
} }

View File

@@ -77,8 +77,11 @@ public class Conveyor extends Block{
float x = tile.drawx(), y = tile.drawy(); float x = tile.drawx(), y = tile.drawy();
if(offset % 2 == 1){ if(offset % 2 == 1){
if(point.x < 0) x += 0.5f; if(point.x < 0) x += 0.75f;
if(point.y < 0) y += 0.5f; if(point.y < 0)
y += 0.5f;
else if(point.y > 0)
y -= 0.5f;
} }
Draw.rect(region1, Draw.rect(region1,