aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity
diff options
context:
space:
mode:
authorchill <chill.gtnh@outlook.com>2023-05-28 09:53:08 +0200
committerGitHub <noreply@github.com>2023-05-28 09:53:08 +0200
commit24ad01683a084bebd26152b803ee19bffe78213c (patch)
tree4715e70ae4bb92d1cd447561f34fd232f10e54e9 /src/main/java/gregtech/api/metatileentity
parentb510ec5baafd4ff69bac158631fc4e4ca93b342d (diff)
downloadGT5-Unofficial-24ad01683a084bebd26152b803ee19bffe78213c.tar.gz
GT5-Unofficial-24ad01683a084bebd26152b803ee19bffe78213c.tar.bz2
GT5-Unofficial-24ad01683a084bebd26152b803ee19bffe78213c.zip
simplify logic expressions (#2026)
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity')
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java2
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java2
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java9
3 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
index 38f40f023e..29f109fca0 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
@@ -771,7 +771,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity
@Override
public boolean shouldDropItemAt(int index) {
- return this.mMetaTileEntity != null ? this.mMetaTileEntity.shouldDropItemAt(index) : true;
+ return this.mMetaTileEntity == null || this.mMetaTileEntity.shouldDropItemAt(index);
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
index eda4f829b6..c4e1ba8521 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
@@ -1403,7 +1403,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec
@Override
public boolean shouldDropItemAt(int index) {
- return this.mMetaTileEntity != null ? this.mMetaTileEntity.shouldDropItemAt(index) : true;
+ return this.mMetaTileEntity == null || this.mMetaTileEntity.shouldDropItemAt(index);
}
public int getUpgradeCount() {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java
index 36d2583875..a8c26957f8 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java
@@ -123,8 +123,13 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
@Override
public boolean isInputFacing(ForgeDirection side) {
- return getBaseMetaTileEntity().isAllowedToWork() ? side == getBaseMetaTileEntity().getFrontFacing()
- : side != getBaseMetaTileEntity().getFrontFacing();
+ ForgeDirection blockFrontFacing = getBaseMetaTileEntity().getFrontFacing();
+
+ if (getBaseMetaTileEntity().isAllowedToWork()) {
+ return side == blockFrontFacing;
+ } else {
+ return side != blockFrontFacing;
+ }
}
@Override