aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces
diff options
context:
space:
mode:
authorConnor-Colenso <52056774+Connor-Colenso@users.noreply.github.com>2023-02-05 19:01:37 +0000
committerGitHub <noreply@github.com>2023-02-05 19:01:37 +0000
commit4e53f4462feae7b64d5f5f378c48bad7c10cee4f (patch)
treeb44e457aa460a0024d1767e354d6bf431e997b66 /src/main/java/gregtech/api/interfaces
parent80fa02e61233286de5ae486682ecd3f93dd5c20c (diff)
downloadGT5-Unofficial-4e53f4462feae7b64d5f5f378c48bad7c10cee4f.tar.gz
GT5-Unofficial-4e53f4462feae7b64d5f5f378c48bad7c10cee4f.tar.bz2
GT5-Unofficial-4e53f4462feae7b64d5f5f378c48bad7c10cee4f.zip
Add TPM Multiblock (#1718)
* Remove warning suppression * New helper default method * Initial work on TPM * Bump dep for structure lib and modular UI * Structure works + recipe map * Working * Tooltip and NEI work * Change controller texture * spotlessApply (#1719) * Fix wrong order * Add override * Spotless * Big opps lol * Comment * Spotless --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api/interfaces')
-rw-r--r--src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java b/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java
index 29b32b5d3b..8bb0ed87aa 100644
--- a/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java
+++ b/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java
@@ -7,12 +7,12 @@ import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.common.misc.GlobalEnergyWorldSavedData;
// If you are adding very late-game content feel free to tap into this interface.
// The eventual goal is to bypass laser/dynamo stuff and have energy deposited directly from ultra-endgame
// multi-blocks directly into the users network.
-@SuppressWarnings("unused")
public interface IGlobalWirelessEnergy {
// User 0 will join user 1 by calling this function. They will share the same energy network.
@@ -57,7 +57,7 @@ public interface IGlobalWirelessEnergy {
// If the value goes below 0 it will return false and not perform the operation.
// BigIntegers have much slower operations than longs/ints. You should call these methods
// as infrequently as possible and bulk store values to add to the global map.
- default boolean addEUToGlobalEnergyMap(String user_uuid, BigInteger EU) {
+ default boolean addEUToGlobalEnergyMap(String userUUID, BigInteger EU) {
// Mark the data as dirty and in need of saving.
try {
@@ -68,15 +68,15 @@ public interface IGlobalWirelessEnergy {
}
// Get the team UUID. Users are by default in a team with a UUID equal to their player UUID.
- String team_uuid = GlobalEnergyTeam.getOrDefault(user_uuid, user_uuid);
+ String teamUUID = GlobalEnergyTeam.getOrDefault(userUUID, userUUID);
// Get the teams total energy stored. If they are not in the map, return 0 EU.
- BigInteger total_eu = GlobalEnergy.getOrDefault(team_uuid, BigInteger.ZERO);
- total_eu = total_eu.add(EU);
+ BigInteger totalEU = GlobalEnergy.getOrDefault(teamUUID, BigInteger.ZERO);
+ totalEU = totalEU.add(EU);
// If there is sufficient EU then complete the operation and return true.
- if (total_eu.signum() >= 0) {
- GlobalEnergy.put(team_uuid, total_eu);
+ if (totalEU.signum() >= 0) {
+ GlobalEnergy.put(teamUUID, totalEU);
return true;
}
@@ -137,4 +137,14 @@ public interface IGlobalWirelessEnergy {
GlobalEnergyName.clear();
GlobalEnergyTeam.clear();
}
+
+ default String processInitialSettings(final IGregTechTileEntity machine) {
+
+ // UUID and username of the owner.
+ final String UUID = machine.getOwnerUuid().toString();
+ final String name = machine.getOwnerName();
+
+ strongCheckOrAddUser(UUID, name);
+ return UUID;
+ }
}