A better way to do this (#6827)

This commit is contained in:
dead inside 2022-05-11 11:01:10 -07:00 committed by GitHub
parent f54116425d
commit 4d12ac8ed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,13 +145,13 @@ public class GenericCrafter extends Block{
public void drawOverlay(float x, float y, int rotation){
if(outputLiquids != null){
for(int i = 0; i < outputLiquids.length; i++){
int dir = liquidOutputDirections.length > i && liquidOutputDirections[i] != -1 ? liquidOutputDirections[i] + rotation : -1;
int dir = liquidOutputDirections.length > i ? liquidOutputDirections[i] : -1;
if(dir != -1){
Draw.rect(
outputLiquids[i].liquid.fullIcon,
x + Geometry.d4x(dir) * (size * tilesize / 2f + 4),
y + Geometry.d4y(dir) * (size * tilesize / 2f + 4),
x + Geometry.d4x(dir + rotation) * (size * tilesize / 2f + 4),
y + Geometry.d4y(dir + rotation) * (size * tilesize / 2f + 4),
8f, 8f
);
}