From 85c804fa112fd1f19c91e45d150a787cfbf0f7a8 Mon Sep 17 00:00:00 2001 From: Shawn Buckley Date: Sun, 18 Oct 2015 23:04:39 -0400 Subject: Move source directory --- .../threads/GT_Runnable_MachineBlockUpdate.java | 38 ---------------------- .../gregtech/api/threads/GT_Runnable_Sound.java | 26 --------------- 2 files changed, 64 deletions(-) delete mode 100644 main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java delete mode 100644 main/java/gregtech/api/threads/GT_Runnable_Sound.java (limited to 'main/java/gregtech/api/threads') diff --git a/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java deleted file mode 100644 index deed269adf..0000000000 --- a/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java +++ /dev/null @@ -1,38 +0,0 @@ -package gregtech.api.threads; - -import gregtech.api.GregTech_API; -import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; - -import java.util.ArrayList; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.World; - -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; - } - - @Override - public void run() { - try {stepToUpdateMachine(mWorld, mX, mY, mZ, new ArrayList());} catch(Throwable e) {/**/} - } - - private static void stepToUpdateMachine(World aWorld, int aX, int aY, int aZ, ArrayList 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); - } - } -} \ No newline at end of file diff --git a/main/java/gregtech/api/threads/GT_Runnable_Sound.java b/main/java/gregtech/api/threads/GT_Runnable_Sound.java deleted file mode 100644 index aaa8b84028..0000000000 --- a/main/java/gregtech/api/threads/GT_Runnable_Sound.java +++ /dev/null @@ -1,26 +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 -- cgit