diff options
| author | Martin Robertz <dream-master@gmx.net> | 2021-12-15 16:11:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-15 16:11:54 +0100 |
| commit | 128c74faa99dfef8d056c1d82c6e4388b9d470e8 (patch) | |
| tree | 2c84162154ba681232f86dffd4106db530236814 /src/Java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java | |
| parent | 47ce336f288a45aa3244c8ae1177499fa5080942 (diff) | |
| parent | ff4b8c7068c2ea7d654e9beda00646d23e62b314 (diff) | |
| download | GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.gz GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.bz2 GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.zip | |
Merge pull request #65 from GTNewHorizons/unified-build-script2
Move sources and resources
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java')
| -rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java deleted file mode 100644 index 0b52560e0d..0000000000 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.helpers; - -import java.util.HashMap; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.GregTech_API; -import net.minecraft.block.Block; -import net.minecraftforge.event.world.BlockEvent; - -public class MachineUpdateHandler { - - private static final HashMap<String, Block> mBlockCache = new HashMap<String, Block>(); - - public static void registerBlockToCauseMachineUpdate(String aUnlocalName, Block aBlock) { - mBlockCache.put(aUnlocalName, aBlock); - } - - @SubscribeEvent - public void onBlockEvent(BlockEvent event) { - Block aBlock = event.block; - String aUnlocalName = aBlock != null ? aBlock.getUnlocalizedName() : "NULL"; - boolean aDoUpdate = false; - if (aBlock != null && aUnlocalName != null && !aUnlocalName.equals("NULL")) { - for (String aCachedName : mBlockCache.keySet()) { - if (aCachedName.equals(aUnlocalName)) { - aDoUpdate = true; - break; - } - else { - if (aBlock == mBlockCache.get(aCachedName)) { - aDoUpdate = true; - break; - } - } - } - if (aDoUpdate) { - GregTech_API.causeMachineUpdate(event.world, event.x, event.y, event.z); - } - } - } - -} |
