diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2021-03-10 18:21:44 +0100 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2021-03-10 18:21:44 +0100 |
commit | f03e907ac73d92bfaf5948e1cae7848675439497 (patch) | |
tree | 194d69bd2c9e62813da4c74e49ba7ab968c79bc6 /src/main/java/gregtech/api/interfaces/tileentity | |
parent | 2d7fe3783011c605a90cf48c04bb575e0e75a72b (diff) | |
download | GT5-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/interfaces/tileentity')
-rw-r--r-- | src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java index 47bec844ee..66b0e5b27c 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -3,9 +3,11 @@ package gregtech.api.interfaces.tileentity; import cofh.api.energy.IEnergyReceiver; import gregtech.GT_Mod; import gregtech.api.GregTech_API; +import gregtech.api.util.PositionedWorldEvent; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; import ic2.api.energy.tile.IEnergySink; +import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -112,7 +114,10 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd if (GregTech_API.sMachineExplosions) if (GT_Mod.gregtechproxy.mPollution) GT_Pollution.addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), 100000); - tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); + + PositionedWorldEvent<Entity> event = new PositionedWorldEvent<>(tWorld); + event.setPosition(tX + 0.5, tY + 0.5, tZ + 0.5); + event.createExplosion(tStrength, true); } } } |