diff options
author | Dream-Master <dream-master@gmx.net> | 2016-06-21 18:42:02 +0200 |
---|---|---|
committer | Dream-Master <dream-master@gmx.net> | 2016-06-21 18:42:02 +0200 |
commit | b09b54435f9427332854558c42bd2c902825cbfe (patch) | |
tree | 96a8143cafd99b28a194714e9846b8e974ce50f8 /src/main/java/gregtech/api/threads | |
parent | 6fe4d4a8d3226c02a65a70d7a8035a219cbd2c66 (diff) | |
download | GT5-Unofficial-b09b54435f9427332854558c42bd2c902825cbfe.tar.gz GT5-Unofficial-b09b54435f9427332854558c42bd2c902825cbfe.tar.bz2 GT5-Unofficial-b09b54435f9427332854558c42bd2c902825cbfe.zip |
remove all
Diffstat (limited to 'src/main/java/gregtech/api/threads')
-rw-r--r-- | src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java | 43 | ||||
-rw-r--r-- | src/main/java/gregtech/api/threads/GT_Runnable_Sound.java | 34 |
2 files changed, 0 insertions, 77 deletions
diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java deleted file mode 100644 index 0909229d82..0000000000 --- a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java +++ /dev/null @@ -1,43 +0,0 @@ -package gregtech.api.threads; - -import gregtech.api.GregTech_API; -import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.World; - -import java.util.ArrayList; - -public class GT_Runnable_MachineBlockUpdate implements Runnable { - private final int mX, mY, mZ; - private final World mWorld; - - public GT_Runnable_MachineBlockUpdate(World aWorld, int aX, int aY, int aZ) { - mWorld = aWorld; - mX = aX; - mY = aY; - mZ = aZ; - } - - private static void stepToUpdateMachine(World aWorld, int aX, int aY, int aZ, ArrayList<ChunkPosition> aList) { - aList.add(new ChunkPosition(aX, aY, aZ)); - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity != null && tTileEntity instanceof IMachineBlockUpdateable) - ((IMachineBlockUpdateable) tTileEntity).onMachineBlockUpdate(); - if (aList.size() < 5 || (tTileEntity != null && tTileEntity instanceof IMachineBlockUpdateable) || GregTech_API.isMachineBlock(aWorld.getBlock(aX, aY, aZ), aWorld.getBlockMetadata(aX, aY, aZ))) { - if (!aList.contains(new ChunkPosition(aX + 1, aY, aZ))) stepToUpdateMachine(aWorld, aX + 1, aY, aZ, aList); - if (!aList.contains(new ChunkPosition(aX - 1, aY, aZ))) stepToUpdateMachine(aWorld, aX - 1, aY, aZ, aList); - if (!aList.contains(new ChunkPosition(aX, aY + 1, aZ))) stepToUpdateMachine(aWorld, aX, aY + 1, aZ, aList); - if (!aList.contains(new ChunkPosition(aX, aY - 1, aZ))) stepToUpdateMachine(aWorld, aX, aY - 1, aZ, aList); - if (!aList.contains(new ChunkPosition(aX, aY, aZ + 1))) stepToUpdateMachine(aWorld, aX, aY, aZ + 1, aList); - if (!aList.contains(new ChunkPosition(aX, aY, aZ - 1))) stepToUpdateMachine(aWorld, aX, aY, aZ - 1, aList); - } - } - - @Override - public void run() { - try { - stepToUpdateMachine(mWorld, mX, mY, mZ, new ArrayList<ChunkPosition>()); - } catch (Throwable e) {/**/} - } -}
\ No newline at end of file diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java b/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java deleted file mode 100644 index 6588780624..0000000000 --- a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java +++ /dev/null @@ -1,34 +0,0 @@ -package gregtech.api.threads; - -import gregtech.api.util.GT_PlayedSound; -import gregtech.api.util.GT_Utility; -import net.minecraft.world.World; - -public class GT_Runnable_Sound implements Runnable { - private final int mX, mY, mZ, mTimeUntilNextSound; - private final World mWorld; - private final String mSoundName; - private final float mSoundStrength, mSoundModulation; - - public GT_Runnable_Sound(World aWorld, int aX, int aY, int aZ, int aTimeUntilNextSound, String aSoundName, float aSoundStrength, float aSoundModulation) { - mWorld = aWorld; - mX = aX; - mY = aY; - mZ = aZ; - mTimeUntilNextSound = aTimeUntilNextSound; - mSoundName = aSoundName; - mSoundStrength = aSoundStrength; - mSoundModulation = aSoundModulation; - } - - @Override - public void run() { - try { - GT_PlayedSound tSound; - if (GT_Utility.sPlayedSoundMap.keySet().contains(tSound = new GT_PlayedSound(mSoundName, mX, mY, mZ))) - return; - mWorld.playSound(mX, mY, mZ, mSoundName, mSoundStrength, mSoundModulation, false); - GT_Utility.sPlayedSoundMap.put(tSound, mTimeUntilNextSound); - } catch (Throwable e) {/**/} - } -}
\ No newline at end of file |