aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2021-03-10 18:21:44 +0100
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2021-03-10 18:21:44 +0100
commitf03e907ac73d92bfaf5948e1cae7848675439497 (patch)
tree194d69bd2c9e62813da4c74e49ba7ab968c79bc6 /src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
parent2d7fe3783011c605a90cf48c04bb575e0e75a72b (diff)
downloadGT5-Unofficial-f03e907ac73d92bfaf5948e1cae7848675439497.tar.gz
GT5-Unofficial-f03e907ac73d92bfaf5948e1cae7848675439497.tar.bz2
GT5-Unofficial-f03e907ac73d92bfaf5948e1cae7848675439497.zip
Refactor World Events
World events have way to many parameters, so the code gets unreadable, this commit fixes that behavior.
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java')
-rw-r--r--src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
index 31ec73d04b..8fc06b3dc4 100644
--- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
@@ -9,6 +9,7 @@ import gregtech.api.interfaces.tileentity.IColoredTileEntity;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.PositionedWorldEvent;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_LanguageManager;
@@ -697,8 +698,11 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord();
World tWorld = getBaseMetaTileEntity().getWorld();
tWorld.setBlock(tX, tY, tZ, Blocks.air);
- if (GregTech_API.sMachineExplosions)
- tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
+ if (GregTech_API.sMachineExplosions){
+ PositionedWorldEvent<Entity> event = new PositionedWorldEvent<>(tWorld);
+ event.setPosition(tX + 0.5, tY + 0.5, tZ + 0.5);
+ event.createExplosion(tStrength, true);
+ }
}
@Override