aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/threads
diff options
context:
space:
mode:
authorNotAPenguin <michiel.vandeginste@gmail.com>2024-09-02 23:17:17 +0200
committerGitHub <noreply@github.com>2024-09-02 23:17:17 +0200
commit1b820de08a05070909a267e17f033fcf58ac8710 (patch)
tree02831a025986a06b20f87e5bcc69d1e0c639a342 /src/main/java/gregtech/api/threads
parentafd3fd92b6a6ab9ab0d0dc3214e6bc8ff7a86c9b (diff)
downloadGT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.gz
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.bz2
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.zip
The Great Renaming (#3014)
* move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names
Diffstat (limited to 'src/main/java/gregtech/api/threads')
-rw-r--r--src/main/java/gregtech/api/threads/RunnableCableUpdate.java (renamed from src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java)20
-rw-r--r--src/main/java/gregtech/api/threads/RunnableMachineUpdate.java (renamed from src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java)38
-rw-r--r--src/main/java/gregtech/api/threads/RunnableSound.java (renamed from src/main/java/gregtech/api/threads/GT_Runnable_Sound.java)14
3 files changed, 36 insertions, 36 deletions
diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java b/src/main/java/gregtech/api/threads/RunnableCableUpdate.java
index 5e3b36f473..7ed4e28554 100644
--- a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java
+++ b/src/main/java/gregtech/api/threads/RunnableCableUpdate.java
@@ -6,21 +6,21 @@ import net.minecraftforge.common.util.ForgeDirection;
import com.gtnewhorizon.gtnhlib.util.CoordinatePacker;
-import gregtech.GT_Mod;
+import gregtech.GTMod;
import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
-import gregtech.common.GT_Proxy;
+import gregtech.api.metatileentity.implementations.MTECable;
+import gregtech.common.GTProxy;
-public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate {
+public class RunnableCableUpdate extends RunnableMachineUpdate {
- protected GT_Runnable_Cable_Update(World aWorld, int posX, int posY, int posZ) {
+ protected RunnableCableUpdate(World aWorld, int posX, int posY, int posZ) {
super(aWorld, posX, posY, posZ);
}
public static void setCableUpdateValues(World aWorld, int posX, int posY, int posZ) {
if (isEnabled) {
- EXECUTOR_SERVICE.submit(new GT_Runnable_Cable_Update(aWorld, posX, posY, posZ));
+ EXECUTOR_SERVICE.submit(new RunnableCableUpdate(aWorld, posX, posY, posZ));
}
}
@@ -36,7 +36,7 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate {
final TileEntity tTileEntity;
- GT_Proxy.TICK_LOCK.lock();
+ GTProxy.TICK_LOCK.lock();
try {
// we dont want to go over cables that are in unloaded chunks
// keeping the lock just to make sure no CME happens
@@ -46,7 +46,7 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate {
tTileEntity = null;
}
} finally {
- GT_Proxy.TICK_LOCK.unlock();
+ GTProxy.TICK_LOCK.unlock();
}
// See if the block itself needs an update
@@ -56,7 +56,7 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate {
// Now see if we should add the nearby blocks to the queue:
// only add blocks the cable is connected to
if (tTileEntity instanceof BaseMetaPipeEntity metaPipe
- && metaPipe.getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable cable) {
+ && metaPipe.getMetaTileEntity() instanceof MTECable cable) {
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
final ForgeDirection side = ForgeDirection.VALID_DIRECTIONS[i];
if (cable.isConnectedAtSide(side)) {
@@ -70,7 +70,7 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate {
}
}
} catch (Exception e) {
- GT_Mod.GT_FML_LOGGER.error(
+ GTMod.GT_FML_LOGGER.error(
"Well this update was broken... " + initialX
+ ", "
+ initialY
diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/src/main/java/gregtech/api/threads/RunnableMachineUpdate.java
index 339556e246..d11e176f3d 100644
--- a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java
+++ b/src/main/java/gregtech/api/threads/RunnableMachineUpdate.java
@@ -11,15 +11,15 @@ import net.minecraftforge.common.util.ForgeDirection;
import com.gtnewhorizon.gtnhlib.util.CoordinatePacker;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
+import gregtech.GTMod;
+import gregtech.api.GregTechAPI;
import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable;
-import gregtech.common.GT_Proxy;
+import gregtech.common.GTProxy;
import it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
import it.unimi.dsi.fastutil.longs.LongSet;
-public class GT_Runnable_MachineBlockUpdate implements Runnable {
+public class RunnableMachineUpdate implements Runnable {
// used by runner thread
protected final int initialX, initialY, initialZ;
@@ -36,7 +36,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable {
protected static ExecutorService EXECUTOR_SERVICE;
// This class should never be initiated outside of this class!
- protected GT_Runnable_MachineBlockUpdate(World aWorld, int posX, int posY, int posZ) {
+ protected RunnableMachineUpdate(World aWorld, int posX, int posY, int posZ) {
this.world = aWorld;
this.initialX = posX;
this.initialY = posY;
@@ -51,15 +51,15 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable {
}
public static void setEnabled() {
- GT_Runnable_MachineBlockUpdate.isEnabled = true;
+ RunnableMachineUpdate.isEnabled = true;
}
public static void setDisabled() {
- GT_Runnable_MachineBlockUpdate.isEnabled = false;
+ RunnableMachineUpdate.isEnabled = false;
}
public static void setEnabled(boolean isEnabled) {
- GT_Runnable_MachineBlockUpdate.isEnabled = isEnabled;
+ RunnableMachineUpdate.isEnabled = isEnabled;
}
public static boolean isCurrentThreadEnabled() {
@@ -67,7 +67,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable {
}
public static void setCurrentThreadEnabled(boolean perThreadEnable) {
- GT_Runnable_MachineBlockUpdate.perThreadEnable.set(perThreadEnable);
+ RunnableMachineUpdate.perThreadEnable.set(perThreadEnable);
}
protected static boolean isEnabled = true;
@@ -75,7 +75,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable {
public static void setMachineUpdateValues(World aWorld, int posX, int posY, int posZ) {
if (isEnabled() && isCurrentThreadEnabled()) {
- EXECUTOR_SERVICE.submit(new GT_Runnable_MachineBlockUpdate(aWorld, posX, posY, posZ));
+ EXECUTOR_SERVICE.submit(new RunnableMachineUpdate(aWorld, posX, posY, posZ));
}
}
@@ -91,30 +91,30 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable {
public static void shutdownExecutorService() {
try {
- GT_Mod.GT_FML_LOGGER.info("Shutting down Machine block update executor service");
+ GTMod.GT_FML_LOGGER.info("Shutting down Machine block update executor service");
EXECUTOR_SERVICE.shutdown(); // Disable new tasks from being submitted
// Wait a while for existing tasks to terminate
if (!EXECUTOR_SERVICE.awaitTermination(60, TimeUnit.SECONDS)) {
EXECUTOR_SERVICE.shutdownNow(); // Cancel currently executing tasks
// Wait a while for tasks to respond to being cancelled
if (!EXECUTOR_SERVICE.awaitTermination(60, TimeUnit.SECONDS)) {
- GT_Mod.GT_FML_LOGGER.error(
+ GTMod.GT_FML_LOGGER.error(
"Well this didn't terminated well... GT_Runnable_MachineBlockUpdate.shutdownExecutorService");
}
}
} catch (InterruptedException ie) {
- GT_Mod.GT_FML_LOGGER.error("Well this interruption got interrupted...", ie);
+ GTMod.GT_FML_LOGGER.error("Well this interruption got interrupted...", ie);
// (Re-)Cancel if current thread also interrupted
EXECUTOR_SERVICE.shutdownNow();
// Preserve interrupt status
Thread.currentThread()
.interrupt();
} catch (Exception e) {
- GT_Mod.GT_FML_LOGGER.error("Well this didn't terminated well...", e);
+ GTMod.GT_FML_LOGGER.error("Well this didn't terminated well...", e);
// (Re-)Cancel in case
EXECUTOR_SERVICE.shutdownNow();
} finally {
- GT_Mod.GT_FML_LOGGER.info("Leaving... GT_Runnable_MachineBlockUpdate.shutdownExecutorService");
+ GTMod.GT_FML_LOGGER.info("Leaving... GT_Runnable_MachineBlockUpdate.shutdownExecutorService");
}
}
@@ -135,13 +135,13 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable {
// `loadedTileEntityList`... which might be in the process
// of being iterated over during `UpdateEntities()`... which might cause a
// ConcurrentModificationException. So, lock that shit.
- GT_Proxy.TICK_LOCK.lock();
+ GTProxy.TICK_LOCK.lock();
try {
tTileEntity = world.getTileEntity(posX, posY, posZ);
- isMachineBlock = GregTech_API
+ isMachineBlock = GregTechAPI
.isMachineBlock(world.getBlock(posX, posY, posZ), world.getBlockMetadata(posX, posY, posZ));
} finally {
- GT_Proxy.TICK_LOCK.unlock();
+ GTProxy.TICK_LOCK.unlock();
}
// See if the block itself needs an update
@@ -167,7 +167,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable {
}
}
} catch (Exception e) {
- GT_Mod.GT_FML_LOGGER.error(
+ GTMod.GT_FML_LOGGER.error(
"Well this update was broken... " + initialX
+ ", "
+ initialY
diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java b/src/main/java/gregtech/api/threads/RunnableSound.java
index 9021a60e89..30704f2a97 100644
--- a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java
+++ b/src/main/java/gregtech/api/threads/RunnableSound.java
@@ -3,10 +3,10 @@ package gregtech.api.threads;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-import gregtech.api.util.GT_PlayedSound;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.util.GTPlayedSound;
+import gregtech.api.util.GTUtility;
-public class GT_Runnable_Sound implements Runnable {
+public class RunnableSound implements Runnable {
private final double mX, mY, mZ;
private final int mTimeUntilNextSound;
@@ -14,7 +14,7 @@ public class GT_Runnable_Sound implements Runnable {
private final ResourceLocation mSoundResourceLocation;
private final float mSoundStrength, mSoundModulation;
- public GT_Runnable_Sound(World aWorld, double aX, double aY, double aZ, int aTimeUntilNextSound,
+ public RunnableSound(World aWorld, double aX, double aY, double aZ, int aTimeUntilNextSound,
ResourceLocation aSoundResourceLocation, float aSoundStrength, float aSoundModulation) {
mWorld = aWorld;
mX = aX;
@@ -29,11 +29,11 @@ public class GT_Runnable_Sound implements Runnable {
@Override
public void run() {
try {
- GT_PlayedSound tSound;
- if (GT_Utility.sPlayedSoundMap.containsKey(tSound = new GT_PlayedSound(mSoundResourceLocation, mX, mY, mZ)))
+ GTPlayedSound tSound;
+ if (GTUtility.sPlayedSoundMap.containsKey(tSound = new GTPlayedSound(mSoundResourceLocation, mX, mY, mZ)))
return;
mWorld.playSound(mX, mY, mZ, mSoundResourceLocation.toString(), mSoundStrength, mSoundModulation, false);
- GT_Utility.sPlayedSoundMap.put(tSound, mTimeUntilNextSound);
+ GTUtility.sPlayedSoundMap.put(tSound, mTimeUntilNextSound);
} catch (Throwable e) {
/**/
}