aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech
diff options
context:
space:
mode:
authorConnor-Colenso <52056774+Connor-Colenso@users.noreply.github.com>2022-07-31 07:23:05 +0100
committerGitHub <noreply@github.com>2022-07-31 13:23:05 +0700
commitb9fea1be881fa1e21d3385f8c378dca636f885bf (patch)
treed5d1d46a42554ef9c80f04147e5ec2a82a68f782 /src/main/java/gregtech
parent445003d9f1b9f57fd8dc1b597be5ba529e558202 (diff)
downloadGT5-Unofficial-b9fea1be881fa1e21d3385f8c378dca636f885bf.tar.gz
GT5-Unofficial-b9fea1be881fa1e21d3385f8c378dca636f885bf.tar.bz2
GT5-Unofficial-b9fea1be881fa1e21d3385f8c378dca636f885bf.zip
Better Endgame Wireless EU (#1144)
* Basis of changes * Adjust voltage tiers to remove OpV * Better textures, move IDs around etc. * Format cleanup * Log level change * Dynamos * More stuff * More OpV purging. * Fixes * Remove wire support. * Textures * IDs * Update hatch/dynamo * New number formatter * Add default method * Add save method on world close * Cleanup old comments/debug * Author * Author * Author * Author * Restructuring of code * Unit tests * More unit tests + cleanup * Fix ID shift + add spares Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech')
-rw-r--r--src/main/java/gregtech/api/enums/GT_Values.java14
-rw-r--r--src/main/java/gregtech/api/enums/ItemList.java32
-rw-r--r--src/main/java/gregtech/api/enums/Materials.java7
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java41
-rw-r--r--src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java293
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java2
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java4
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java148
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java166
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java5
-rw-r--r--src/main/java/gregtech/client/GT_TooltipEventHandler.java8
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java6
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Item_Machines.java2
-rw-r--r--src/main/java/gregtech/common/misc/GT_Command.java104
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java10
-rw-r--r--src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java250
17 files changed, 1047 insertions, 54 deletions
diff --git a/src/main/java/gregtech/api/enums/GT_Values.java b/src/main/java/gregtech/api/enums/GT_Values.java
index 5765fc42c2..f0a29e2dfc 100644
--- a/src/main/java/gregtech/api/enums/GT_Values.java
+++ b/src/main/java/gregtech/api/enums/GT_Values.java
@@ -98,6 +98,7 @@ public class GT_Values {
//TODO:AND ALL THE MATERIALS... for that
//TODO:LIST OF MACHINES WITH POINTLESS TIERS (unless you implement some other tiering mechanism like reducing eu cost if time=1tick)
//Macerator/Compressor/Furnace... and for cheap recipes any
+
/**
* keeping Voltage*Amps < Integer.MAX_VALUE-7 for machines (and tier logic 4x EUt 2/ time)
* AMV[4]= max amps at tier 4
@@ -448,9 +449,22 @@ public class GT_Values {
public static boolean worldTickHappened = false;
public static final int[] emptyIntArray = new int[0];
+
+
public static final IFluidTank[] emptyFluidTank = new IFluidTank[0];
public static final FluidTankGT[] emptyFluidTankGT = new FluidTankGT[0];
public static final FluidTankInfo[] emptyFluidTankInfo = new FluidTankInfo[0];
public static final FluidStack[] emptyFluidStack = new FluidStack[0];
public static final ItemStack[] emptyItemStackArray = new ItemStack[0];
+
+ /**
+ * Pretty formatting for author names.
+ */
+ public static final String AuthorColen = "Author: " +
+ EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "C" +
+ EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "o" +
+ EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "l" +
+ EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "e" +
+ EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "n";
+
}
diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java
index b73e6bd3a8..6996a139c4 100644
--- a/src/main/java/gregtech/api/enums/ItemList.java
+++ b/src/main/java/gregtech/api/enums/ItemList.java
@@ -967,6 +967,38 @@ public enum ItemList implements IItemContainer {
Hatch_Energy_UV,
Hatch_Energy_MAX,
+ Wireless_Hatch_Energy_ULV,
+ Wireless_Hatch_Energy_LV,
+ Wireless_Hatch_Energy_MV,
+ Wireless_Hatch_Energy_HV,
+ Wireless_Hatch_Energy_EV,
+ Wireless_Hatch_Energy_IV,
+ Wireless_Hatch_Energy_LuV,
+ Wireless_Hatch_Energy_ZPM,
+ Wireless_Hatch_Energy_UV,
+ Wireless_Hatch_Energy_UHV,
+ Wireless_Hatch_Energy_UEV,
+ Wireless_Hatch_Energy_UIV,
+ Wireless_Hatch_Energy_UMV,
+ Wireless_Hatch_Energy_UXV,
+ Wireless_Hatch_Energy_MAX,
+
+ Wireless_Dynamo_Energy_ULV,
+ Wireless_Dynamo_Energy_LV,
+ Wireless_Dynamo_Energy_MV,
+ Wireless_Dynamo_Energy_HV,
+ Wireless_Dynamo_Energy_EV,
+ Wireless_Dynamo_Energy_IV,
+ Wireless_Dynamo_Energy_LuV,
+ Wireless_Dynamo_Energy_ZPM,
+ Wireless_Dynamo_Energy_UV,
+ Wireless_Dynamo_Energy_UHV,
+ Wireless_Dynamo_Energy_UEV,
+ Wireless_Dynamo_Energy_UIV,
+ Wireless_Dynamo_Energy_UMV,
+ Wireless_Dynamo_Energy_UXV,
+ Wireless_Dynamo_Energy_MAX,
+
Hatch_Input_ULV,
Hatch_Input_LV,
Hatch_Input_MV,
diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java
index c51086369b..e080df4e0f 100644
--- a/src/main/java/gregtech/api/enums/Materials.java
+++ b/src/main/java/gregtech/api/enums/Materials.java
@@ -2324,13 +2324,6 @@ public class Materials implements IColorModulationContainer, ISubTagContainer {
}
private static void addHasGasFluid(Materials aMaterial, String aConfigPath) {
-// System.out.println("ABC4321 " + aMaterial.mDefaultLocalName + " " + aMaterial.mIconSet.is_custom + " " + aMaterial.mName);
-// if (aMaterial.mDefaultLocalName.toLowerCase().contains("spacetime")) {
-//// GT_Mod.gregtechproxy.addFluid("molten.spacetime", "Molten SpaceTime", Materials.SpaceTime, 0, 0, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SpaceTime, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 100);
-// System.out.println("TESTING 1234");
-// System.out.println("ABC4321 " + aMaterial.mDefaultLocalName + " " + aMaterial.mIconSet.is_custom + " " + aMaterial.mName + " " + aMaterial.mHasPlasma + " " + aMaterial.mHasGas);
-// return;
-// }
if (aMaterial.mIconSet.is_custom) {
return;
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index fb1ff424fc..26cd952a8d 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -548,6 +548,8 @@ public class Textures {
OVERLAY_FRONT_VACUUM_FREEZER_GLOW,
OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE,
OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW,
+ OVERLAY_ENERGY_ON_WIRELESS,
+ OVERLAY_ENERGY_OFF_WIRELESS,
OVERLAY_FRONT_MULTI_SMELTER,
OVERLAY_FRONT_MULTI_SMELTER_GLOW,
@@ -1850,6 +1852,45 @@ public class Textures {
TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}),
TextureFactory.of(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}),
};
+
+ public static final ITexture[] OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON = {
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[]{255, 255, 255, 0}),
+ };
+
+ public static final ITexture[] OVERLAYS_ENERGY_IN_MULTI_WIRELESS_OFF = {
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ TextureFactory.of(OVERLAY_ENERGY_OFF_WIRELESS, new short[]{0, 0, 0, 0}),
+ };
+
public static final ITexture[] OVERLAYS_ENERGY_OUT_MULTI = {
TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}),
TextureFactory.of(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}),
diff --git a/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java b/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java
new file mode 100644
index 0000000000..bc0bf4a9e8
--- /dev/null
+++ b/src/main/java/gregtech/api/interfaces/IGlobalWirelessEnergy.java
@@ -0,0 +1,293 @@
+package gregtech.api.interfaces;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
+
+import java.io.File;
+import java.io.IOException;
+import java.math.BigInteger;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.List;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+// 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.
+public interface IGlobalWirelessEnergy {
+
+ // --------------------- NEVER access these maps! Use the methods provided! ---------------------
+
+ // Global EU map.
+ HashMap<String, BigInteger> GlobalEnergy = new HashMap<>(100, 0.9f);
+
+ // Maps user IDs to usernames and vice versa. Seems redundant but this makes accessing this
+ // easier in certain locations (like gt commands).
+ HashMap<String, String> GlobalEnergyName = new HashMap<>(100, 0.9f);
+
+ // Maps UUIDs to other UUIDs. This allows users to join a team.
+ HashMap<String, String> GlobalEnergyTeam = new HashMap<>(100, 0.9f);
+
+ // ----------------------------------------------------------------------------------------------
+
+ // Folder
+ String GlobalEnergyFolderName = "GlobalEnergyInformationStorage";
+
+ // 3 txt file names. Do not change.
+ String GlobalEnergyMapFileName = "GlobalEnergyMap";
+ String GlobalEnergyNameFileName = "GlobalEnergyNameMap";
+ String GlobalEnergyTeamFileName = "GlobalEnergyTeamMap";
+
+ // User 0 will join user 1 by calling this function. They will share the same energy network.
+ default void JoinUserNetwork(String user_uuid_0, String user_uuid_1) {
+ GlobalEnergyTeam.put(user_uuid_0, user_uuid_1);
+ }
+
+ // --- Save data for global energy network --
+
+ default void SaveGlobalEnergyInfo(String world_name) {
+ CreateStorageIfNotExist(world_name);
+ SaveGlobalEnergyMap(world_name);
+ SaveGlobalEnergyName(world_name);
+ SaveGlobalEnergyTeam(world_name);
+
+ }
+
+ default void SaveGlobalEnergyMap(String world_name) {
+ try {
+ List<String> lines = GlobalEnergy.entrySet()
+ .stream()
+ .map(entry -> entry.getKey() + ":" + entry.getValue())
+ .collect(Collectors.toList());
+
+ Path path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName + "/" + GlobalEnergyMapFileName + ".txt").toAbsolutePath();
+ Files.write(path, lines);
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ default void SaveGlobalEnergyName(String world_name) {
+ try {
+ List<String> lines = GlobalEnergyName.entrySet()
+ .stream()
+ .map(entry -> entry.getKey() + ":" + entry.getValue())
+ .collect(Collectors.toList());
+
+ Path path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName + "/" + GlobalEnergyNameFileName + ".txt").toAbsolutePath();
+ Files.write(path, lines);
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ default void SaveGlobalEnergyTeam(String world_name) {
+ try {
+ List<String> lines = GlobalEnergyTeam.entrySet()
+ .stream()
+ .map(entry -> entry.getKey() + ":" + entry.getValue())
+ .collect(Collectors.toList());
+
+ Path path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName + "/" + GlobalEnergyTeamFileName + ".txt").toAbsolutePath();
+ Files.write(path, lines);
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // --- Load data for global energy network ---
+
+ default void LoadGlobalEnergyInfo(World world) {
+ CreateStorageIfNotExist(world.getWorldInfo().getWorldName());
+ LoadGlobalEnergyMap(world);
+ LoadGlobalEnergyName(world);
+ LoadGlobalEnergyTeam(world);
+ }
+
+ default void LoadGlobalEnergyMap(World world) {
+ try {
+ Path path = Paths.get("./saves/" + world.getWorldInfo().getWorldName() + "/" + GlobalEnergyFolderName + "/" + GlobalEnergyMapFileName + ".txt").toAbsolutePath();
+
+ String[] data;
+ for(String line : Files.readAllLines(path)) {
+ data = line.split(":");
+
+ String UUID = data[0];
+ BigInteger num = new BigInteger(data[1]);
+
+ GlobalEnergy.put(UUID, num);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ default void LoadGlobalEnergyName(World world) {
+ try {
+ Path path = Paths.get("./saves/" + world.getWorldInfo().getWorldName() + "/"
+ + GlobalEnergyFolderName + "/" + GlobalEnergyNameFileName + ".txt").toAbsolutePath();
+
+ String[] data;
+ for(String line : Files.readAllLines(path)) {
+ data = line.split(":");
+
+ GlobalEnergyName.put(data[0], data[1]);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ default void LoadGlobalEnergyTeam(World world) {
+ try {
+ Path path = Paths.get("./saves/" + world.getWorldInfo().getWorldName() + "/"
+ + GlobalEnergyFolderName + "/" + GlobalEnergyTeamFileName + ".txt").toAbsolutePath();
+
+ String[] data;
+ for(String line : Files.readAllLines(path)) {
+ data = line.split(":");
+
+ GlobalEnergyName.put(data[0], data[1]);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ // ------------------
+
+ default void CreateStorageIfNotExist(String world_name) {
+ Path folder_path = Paths.get("./saves/" + world_name + "/" + GlobalEnergyFolderName).toAbsolutePath();
+
+ // Create folder for storing global energy network info.
+ try {
+ Files.createDirectories(folder_path);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ // Create txt files.
+ try {
+ File file_0 = new File(folder_path + "/" + GlobalEnergyMapFileName + ".txt");
+ file_0.createNewFile();
+ File file_1 = new File(folder_path + "/" + GlobalEnergyNameFileName + ".txt");
+ file_1.createNewFile();
+ File file_2 = new File(folder_path + "/" + GlobalEnergyTeamFileName + ".txt");
+ file_2.createNewFile();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ // Adds a user to the energy map if they do not already exist. Otherwise, do nothing. Will also check if the user
+ // has changed their username and adjust the maps accordingly. This should be called infrequently. Ideally on first
+ // tick of a machine being placed only.
+
+ default void StrongCheckOrAddUser(EntityPlayer user) {
+ StrongCheckOrAddUser(user.getUniqueID().toString(), user.getDisplayName());
+ }
+
+ default void StrongCheckOrAddUser(UUID user_uuid, String user_name) {
+ StrongCheckOrAddUser(user_uuid.toString(), user_name);
+ }
+
+ default void StrongCheckOrAddUser(String user_uuid, String user_name) {
+
+ // Check if the user has a team. Add them if not.
+ GlobalEnergyTeam.putIfAbsent(user_uuid, user_uuid);
+
+ // Check if the user is in the global energy map.
+ GlobalEnergy.putIfAbsent(user_uuid, BigInteger.ZERO);
+
+ // If the username linked to the users fixed uuid is not equal to their current name then remove it.
+ // This indicates that their username has changed.
+ if (!(GlobalEnergyName.getOrDefault(user_uuid, "").equals(user_name))) {
+ String old_name = GlobalEnergyName.get(user_uuid);
+ GlobalEnergyName.remove(old_name);
+ }
+
+ // Add UUID -> Name, Name -> UUID.
+ GlobalEnergyName.put(user_name, user_uuid);
+ GlobalEnergyName.put(user_uuid, user_name);
+ }
+
+ // ------------------------------------------------------------------------------------
+ // Add EU to the users global energy. You can enter a negative number to subtract it.
+ // 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) {
+
+ // 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);
+
+ // 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);
+
+ // If there is sufficient EU then complete the operation and return true.
+ if (total_eu.signum() >= 0) {
+ GlobalEnergy.put(team_uuid, total_eu);
+ return true;
+ }
+
+ // There is insufficient EU so cancel the operation and return false.
+ return false;
+ }
+
+ default boolean addEUToGlobalEnergyMap(UUID user_uuid, BigInteger EU) {
+ return addEUToGlobalEnergyMap(user_uuid.toString(), EU);
+ }
+
+ default boolean addEUToGlobalEnergyMap(UUID user_uuid, long EU) {
+ return addEUToGlobalEnergyMap(user_uuid.toString(), BigInteger.valueOf(EU));
+ }
+
+ default boolean addEUToGlobalEnergyMap(UUID user_uuid, int EU) {
+ return addEUToGlobalEnergyMap(user_uuid.toString(), BigInteger.valueOf(EU));
+ }
+
+ default boolean addEUToGlobalEnergyMap(String user_uuid, long EU) {
+ return addEUToGlobalEnergyMap(user_uuid, BigInteger.valueOf(EU));
+ }
+
+ default boolean addEUToGlobalEnergyMap(String user_uuid, int EU) {
+ return addEUToGlobalEnergyMap(user_uuid, BigInteger.valueOf(EU));
+ }
+
+ // ------------------------------------------------------------------------------------
+
+ default BigInteger GetUserEU(String user_uuid) {
+ return GlobalEnergy.getOrDefault(GlobalEnergyTeam.getOrDefault(user_uuid, user_uuid), BigInteger.ZERO);
+ }
+
+ // This overwrites the EU in the network. Only use this if you are absolutely sure you know what you are doing.
+ default void SetUserEU(String user_uuid, BigInteger EU) {
+ GlobalEnergy.put(GlobalEnergyTeam.get(user_uuid), EU);
+ }
+
+ default String GetUsernameFromUUID(String uuid) {
+ return GlobalEnergyName.getOrDefault(GlobalEnergyTeam.getOrDefault(uuid, ""), "");
+ }
+
+ default String GetUUIDFromUsername(String username) {
+ return GlobalEnergyTeam.getOrDefault(GlobalEnergyName.getOrDefault(username, ""), "");
+ }
+
+ default void ClearMaps() {
+ // Do not use this unless you are 100% certain you know what you are doing.
+ GlobalEnergy.clear();
+ GlobalEnergyName.clear();
+ GlobalEnergyTeam.clear();
+ }
+
+}
+
+
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
index 524e377010..16a8ec8cca 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
@@ -346,7 +346,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity implements IGregTec
@Override
public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aLogLevel) {
final ArrayList<String> tList = new ArrayList<>();
- if (aLogLevel > 2) {
+ if (aLogLevel > 3) {
tList.add("Meta-ID: " + EnumChatFormatting.BLUE+ mID +EnumChatFormatting.RESET + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN+" valid"+EnumChatFormatting.RESET : EnumChatFormatting.RED+" invalid"+EnumChatFormatting.RESET) + (mMetaTileEntity == null ? EnumChatFormatting.RED+" MetaTileEntity == null!"+EnumChatFormatting.RESET : " "));
}
if (aLogLevel > 1) {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java
index 1156ed7117..ae2aea8e4a 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Dynamo.java
@@ -14,6 +14,10 @@ public class GT_MetaTileEntity_Hatch_Dynamo extends GT_MetaTileEntity_Hatch {
super(aID, aName, aNameRegional, aTier, 0, new String[]{"Generating electric Energy from Multiblocks", "Puts out up to 1 Amp"});
}
+ public GT_MetaTileEntity_Hatch_Dynamo(int aID, String aName, String aNameRegional, int aTier, String[] aDescription) {
+ super(aID, aName, aNameRegional, aTier, 0, aDescription);
+ }
+
public GT_MetaTileEntity_Hatch_Dynamo(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 0, aDescription, aTextures);
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java
index d9fb5f01cc..a6bdc6726c 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy.java
@@ -10,6 +10,11 @@ import net.minecraft.item.ItemStack;
import static gregtech.api.enums.GT_Values.V;
public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch {
+
+ public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier, String[] aDescription) {
+ super(aID, aName, aNameRegional, aTier, 0, aDescription);
+ }
+
public GT_MetaTileEntity_Hatch_Energy(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 0, new String[]{"Energy Injector for Multiblocks", "Accepts up to 2 Amps"});
}
@@ -22,6 +27,10 @@ public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch {
super(aName, aTier, 0, aDescription, aTextures);
}
+ public GT_MetaTileEntity_Hatch_Energy(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 0, aDescription, aTextures);
+ }
+
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return new ITexture[]{aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java
new file mode 100644
index 0000000000..7f59b13669
--- /dev/null
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java
@@ -0,0 +1,148 @@
+package gregtech.api.metatileentity.implementations;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IGlobalWirelessEnergy;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import java.math.BigInteger;
+
+import static gregtech.GT_Mod.gregtechproxy;
+import static gregtech.api.enums.GT_Values.*;
+
+public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_Dynamo implements IGlobalWirelessEnergy {
+
+ private static final long ticks_between_energy_addition = 100L*20L;
+ private static final long number_of_energy_additions = 2L;
+ private final BigInteger eu_transferred_per_operation = BigInteger.valueOf(2L * V[mTier] * ticks_between_energy_addition);
+ private String owner_uuid;
+ private String owner_name;
+
+ public GT_MetaTileEntity_Wireless_Dynamo(String aName, byte aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_Wireless_Dynamo(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, new String[] {""});
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[]{aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier]};
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[]{aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier]};
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 2 * V[mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * number_of_energy_additions * ticks_between_energy_addition;
+ }
+
+ @Override
+ public String[] getDescription() {
+ String uuid = gregtechproxy.getThePlayer().getUniqueID().toString();
+ return new String[] {
+// "Transmits " + EnumChatFormatting.RED + GT_Utility.formatNumbers(eu_transferred_per_operation/V[mTier]) + EnumChatFormatting.GRAY + " A of " + TIER_COLORS[mTier] + VN[mTier] + EnumChatFormatting.GRAY + " through trans-dimensional space every " + EnumChatFormatting.RED + GT_Utility.formatNumbers(ticks_between_energy_addition) + EnumChatFormatting.GRAY + " ticks.",
+ EnumChatFormatting.GRAY + "Does not connect to wires.",
+ EnumChatFormatting.GRAY + "There is currently " + EnumChatFormatting.RED + GT_Utility.formatNumbers(GlobalEnergy.getOrDefault(uuid, BigInteger.ZERO)) + EnumChatFormatting.GRAY + " EU in your network.",
+ AuthorColen
+ };
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 2;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Wireless_Dynamo(mName, mTier, new String[] {""}, mTextures);
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+
+ // On first tick find the player name and attempt to add them to the map.
+ if (aTick == 1) {
+
+ // UUID and username of the owner.
+ owner_uuid = aBaseMetaTileEntity.getOwnerUuid().toString();
+ owner_name = aBaseMetaTileEntity.getOwnerName();
+
+ // Attempt to load in map from file.
+ if (GlobalEnergy.size() == 0)
+ IGlobalWirelessEnergy.super.LoadGlobalEnergyInfo(aBaseMetaTileEntity.getWorld());
+
+ IGlobalWirelessEnergy.super.StrongCheckOrAddUser(owner_uuid, owner_name);
+
+ }
+
+ // Every ticks_between_energy_addition ticks change the energy content of the machine.
+ if (aTick % ticks_between_energy_addition == 0L) {
+ IGlobalWirelessEnergy.super.addEUToGlobalEnergyMap(owner_uuid, getEUVar());
+ setEUVar(0L);
+ }
+ }
+ }
+}
+
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java
new file mode 100644
index 0000000000..cd999fce4e
--- /dev/null
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java
@@ -0,0 +1,166 @@
+package gregtech.api.metatileentity.implementations;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IGlobalWirelessEnergy;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
+import java.math.BigInteger;
+
+import static gregtech.GT_Mod.gregtechproxy;
+import static gregtech.api.enums.GT_Values.*;
+
+public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_Energy implements IGlobalWirelessEnergy {
+
+ private static final long ticks_between_energy_addition = 100L*20L;
+ private static final long number_of_energy_additions = 2L;
+ private final BigInteger eu_transferred_per_operation = BigInteger.valueOf(2L * V[mTier] * ticks_between_energy_addition);
+ private final long eu_transferred_per_operation_long = eu_transferred_per_operation.longValueExact();
+ private String owner_uuid;
+ private String owner_name;
+
+
+ public GT_MetaTileEntity_Wireless_Hatch(String aName, byte aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 0, aDescription, aTextures);
+ }
+
+ public GT_MetaTileEntity_Wireless_Hatch(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, new String[] {""});
+ }
+
+ @Override
+ public String[] getDescription() {
+ String uuid = gregtechproxy.getThePlayer().getUniqueID().toString();
+ return new String[] {
+// "Receives " + EnumChatFormatting.RED + GT_Utility.formatNumbers(eu_transferred_per_operation.divide(BigInteger.valueOf(V[mTier]))) + EnumChatFormatting.GRAY + " A of " + TIER_COLORS[mTier] + VN[mTier] + EnumChatFormatting.GRAY + " through trans-dimensional space every " + EnumChatFormatting.RED + GT_Utility.formatNumbers(ticks_between_energy_addition) + EnumChatFormatting.GRAY + " ticks.",
+ EnumChatFormatting.GRAY + "Does not connect to wires.",
+ EnumChatFormatting.GRAY + "There is currently " + EnumChatFormatting.RED + GT_Utility.formatNumbers(IGlobalWirelessEnergy.super.GetUserEU(uuid)) + EnumChatFormatting.GRAY + " EU in your network.",
+ AuthorColen
+ };
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return new ITexture[]{aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier]};
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[]{aBaseTexture, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI_WIRELESS_ON[mTier]};
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 2 * V[mTier];
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * number_of_energy_additions * ticks_between_energy_addition;
+ }
+
+ public long getEUCapacity() { return 40000L; }
+
+ @Override
+ public long maxAmperesIn() {
+ return 2;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Wireless_Hatch(mName, mTier, new String[] {""}, mTextures);
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+
+ // On first tick find the player name and attempt to add them to the map.
+ if (aTick == 1) {
+
+ // UUID and username of the owner.
+ owner_uuid = aBaseMetaTileEntity.getOwnerUuid().toString();
+ owner_name = aBaseMetaTileEntity.getOwnerName();
+
+ // Attempt to load in map from file.
+ if (GlobalEnergy.size() == 0)
+ IGlobalWirelessEnergy.super.LoadGlobalEnergyInfo(aBaseMetaTileEntity.getWorld());
+
+ IGlobalWirelessEnergy.super.StrongCheckOrAddUser(owner_uuid, owner_name);
+
+ if (IGlobalWirelessEnergy.super.addEUToGlobalEnergyMap(owner_uuid, eu_transferred_per_operation.negate()))
+ setEUVar(eu_transferred_per_operation_long);
+ }
+
+ // This is set up in a way to be as optimised as possible. If a user has a relatively plentiful energy network
+ // it should make no difference to them. Minimising the number of operations on BigInteger is essential.
+
+ // Every ticks_between_energy_addition add eu_transferred_per_operation to internal EU storage from network.
+ if (aTick % ticks_between_energy_addition == 0L) {
+ long total_eu = this.getBaseMetaTileEntity().getStoredEU();
+
+ // Can the machine store the EU being added?
+ if (total_eu + eu_transferred_per_operation_long <= maxEUStore()) {
+
+ // Attempt to remove energy from the network and add it to the internal buffer of the machine.
+ if (IGlobalWirelessEnergy.super.addEUToGlobalEnergyMap(owner_uuid, eu_transferred_per_operation.negate())) {
+ setEUVar(total_eu + eu_transferred_per_operation_long);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java
index e244bb4460..47d66ff816 100644
--- a/src/main/java/gregtech/api/util/GT_Utility.java
+++ b/src/main/java/gregtech/api/util/GT_Utility.java
@@ -95,6 +95,7 @@ import javax.annotation.Nullable;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
@@ -2563,6 +2564,10 @@ public class GT_Utility {
});
}
+ public static String formatNumbers(BigInteger aNumber) {
+ return getDecimalFormat().format(aNumber);
+ }
+
public static String formatNumbers(long aNumber) {
return getDecimalFormat().format(aNumber);
}
diff --git a/src/main/java/gregtech/client/GT_TooltipEventHandler.java b/src/main/java/gregtech/client/GT_TooltipEventHandler.java
index 30ef1a396d..eccdd7cbc8 100644
--- a/src/main/java/gregtech/client/GT_TooltipEventHandler.java
+++ b/src/main/java/gregtech/client/GT_TooltipEventHandler.java
@@ -22,13 +22,13 @@ public class GT_TooltipEventHandler {
/*
* What you can do:
- * - add simple, unformated text
- * - add formatted text
+ * - Add simple, unformatted text.
+ * - Add formatted text.
* Note: you can chain formatting codes but the color must be used first:
* e.g. BLACK + ITALIC will create black, italic text but ITALIC + BLACK will only create black text.
* - add animated text
* - chain multiple static and/or animated text together using chain()
- * (Although chaining only static text together is pointless, text() is already able to to that)
+ * (Although chaining only static text together is pointless, text() is already able to do that)
* - add multiple lines by using NEW_LINE (either as String or as Supplier<String>)
* Note: formatting only applies for one line
* Note: having a NEW_LINE in animated text results in "skipping" of one formatting since NEW_LINE
@@ -184,4 +184,4 @@ public class GT_TooltipEventHandler {
};
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index 26ed6f155c..f15970a965 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -26,6 +26,7 @@ import gregtech.api.enums.SubTag;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
import gregtech.api.enums.ToolDictNames;
import gregtech.api.interfaces.IBlockOnWalkOver;
+import gregtech.api.interfaces.IGlobalWirelessEnergy;
import gregtech.api.interfaces.IProjectileItem;
import gregtech.api.interfaces.internal.IGT_Mod;
import gregtech.api.interfaces.internal.IThaumcraftCompat;
@@ -139,7 +140,7 @@ import static gregtech.api.enums.GT_Values.debugEntityCramming;
import static gregtech.api.util.GT_Util.LAST_BROKEN_TILEENTITY;
-public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
+public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IGlobalWirelessEnergy {
private static final EnumSet<OreGenEvent.GenerateMinable.EventType> PREVENTED_ORES = EnumSet.of(OreGenEvent.GenerateMinable.EventType.COAL,
OreGenEvent.GenerateMinable.EventType.IRON, OreGenEvent.GenerateMinable.EventType.GOLD,
OreGenEvent.GenerateMinable.EventType.DIAMOND, OreGenEvent.GenerateMinable.EventType.REDSTONE, OreGenEvent.GenerateMinable.EventType.LAPIS,
@@ -903,6 +904,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
public void onServerStopping() {
File tSaveDirectory = getSaveDirectory();
GregTech_API.sWirelessRedstone.clear();
+ IGlobalWirelessEnergy.super.SaveGlobalEnergyInfo(mUniverse.getWorldInfo().getWorldName());
+ IGlobalWirelessEnergy.super.ClearMaps();
if (tSaveDirectory != null) {
try {
for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
@@ -916,6 +919,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}
this.mUniverse = null;
//GT_ChunkAssociatedData.saveAll(); todo: figure out if this is needed
+
}
@SubscribeEvent
diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
index 2a108aca71..9cf4029934 100644
--- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
+++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
@@ -89,7 +89,7 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem {
if (tTileEntity.getOutputAmperage() > 1L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(tTileEntity.getOutputAmperage()) + EnumChatFormatting.GRAY);
}
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(tTileEntity.getEUCapacity()) + EnumChatFormatting.GRAY);
+ aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(tTileEntity.getEUCapacity()) + EnumChatFormatting.GRAY + " EU");
}
if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumTank || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperTank) {
if (aStack.hasTagCompound() && aStack.stackTagCompound.hasKey("mFluid")) {
diff --git a/src/main/java/gregtech/common/misc/GT_Command.java b/src/main/java/gregtech/common/misc/GT_Command.java
index 4f6f77ea70..a91a696d37 100644
--- a/src/main/java/gregtech/common/misc/GT_Command.java
+++ b/src/main/java/gregtech/common/misc/GT_Command.java
@@ -3,20 +3,21 @@ package gregtech.common.misc;
import com.gtnewhorizon.structurelib.StructureLib;
import gregtech.GT_Mod;
import gregtech.api.enums.GT_Values;
+import gregtech.api.interfaces.IGlobalWirelessEnergy;
import gregtech.api.objects.GT_ChunkManager;
import gregtech.common.GT_Pollution;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.util.EnumChatFormatting;
import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import java.math.BigInteger;
+import java.util.*;
import java.util.stream.Stream;
-public final class GT_Command extends CommandBase {
+public final class GT_Command extends CommandBase implements IGlobalWirelessEnergy {
@Override
public String getCommandName() {
@@ -27,8 +28,9 @@ public final class GT_Command extends CommandBase {
public String getCommandUsage(ICommandSender sender) {
return "Usage: gt <subcommand>. Valid subcommands are: toggle, chunks, pollution.";
}
+
private void printHelp(ICommandSender sender) {
- sender.addChatMessage(new ChatComponentText("Usage: gt <toggle|chunks|pollution>"));
+ sender.addChatMessage(new ChatComponentText("Usage: gt <toggle|chunks|pollution|global_energy_add|global_energy_set|global_energy_join>"));
sender.addChatMessage(new ChatComponentText("\"toggle D1\" - toggles general.Debug (D1)"));
sender.addChatMessage(new ChatComponentText("\"toggle D2\" - toggles general.Debug2 (D2)"));
sender.addChatMessage(new ChatComponentText("\"toggle debugCleanroom\" - toggles cleanroom debug log"));
@@ -47,15 +49,21 @@ public final class GT_Command extends CommandBase {
"\"pollution <amount>\" - adds the <amount> of the pollution to the current chunk, " +
"\n if <amount> isnt specified, will add" + GT_Mod.gregtechproxy.mPollutionSmogLimit + "gibbl."
));
+ sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GOLD + " --- Global wireless EU controls ---"));
+ sender.addChatMessage(new ChatComponentText("Allows you to set the amount of EU in a users wireless network."));
+ sender.addChatMessage(new ChatComponentText("Usage: global_energy_set [Name] [EU]"));
+ sender.addChatMessage(new ChatComponentText("Allows you to add EU to a users wireless network. Also accepts negative numbers."));
+ sender.addChatMessage(new ChatComponentText("Usage: global_energy_add [Name] [EU]"));
+ sender.addChatMessage(new ChatComponentText("Allows you to join two users together into one network. Can be undone by writing the users name twice."));
+ sender.addChatMessage(new ChatComponentText("Usage: global_energy_join [User joining] [User to join]"));
}
@Override
public List addTabCompletionOptions(ICommandSender sender, String[] ss) {
List<String> l = new ArrayList<>();
- Stream<String> keywords = Arrays.stream(new String[]{"toggle", "chunks"});
String test = ss.length == 0 ? "" : ss[0].trim();
- if (ss.length == 0 || ss.length == 1 && (test.isEmpty() || Stream.of("toggle", "chunks", "pollution").anyMatch(s -> s.startsWith(test)))) {
- Stream.of("toggle", "chunks", "pollution")
+ if (ss.length == 0 || ss.length == 1 && (test.isEmpty() || Stream.of("toggle", "chunks", "pollution", "global_energy_add", "global_energy_set", "global_energy_join").anyMatch(s -> s.startsWith(test)))) {
+ Stream.of("toggle", "chunks", "pollution", "global_energy_add", "global_energy_set", "global_energy_join")
.filter(s -> test.isEmpty() || s.startsWith(test))
.forEach(l::add);
} else if (test.equals("toggle")) {
@@ -64,7 +72,6 @@ public final class GT_Command extends CommandBase {
"debugOrevein", "debugSmallOres", "debugStones", "debugChunkloaders", "debugMulti", "debugWorldData")
.filter(s -> test1.isEmpty() || s.startsWith(test1))
.forEach(l::add);
-
}
return l;
}
@@ -75,6 +82,10 @@ public final class GT_Command extends CommandBase {
printHelp(sender);
return;
}
+
+ String username;
+ String uuid;
+
switch (strings[0]) {
case "toggle":
if (strings.length < 2) {
@@ -103,20 +114,79 @@ public final class GT_Command extends CommandBase {
GT_ChunkManager.printTickets();
sender.addChatMessage(new ChatComponentText("Forced chunks logged to GregTech.log"));
break;
- case "pollution": {
+ case "pollution":
ChunkCoordinates coordinates = sender.getPlayerCoordinates();
int amount = (strings.length < 2) ? GT_Mod.gregtechproxy.mPollutionSmogLimit : Integer.parseInt(strings[1]);
GT_Pollution.addPollution(sender
- .getEntityWorld()
- .getChunkFromBlockCoords(
- coordinates.posX,
- coordinates.posZ
- ),
- amount
+ .getEntityWorld()
+ .getChunkFromBlockCoords(
+ coordinates.posX,
+ coordinates.posZ
+ ),
+ amount
);
break;
- }
+ case "global_energy_add":
+
+ username = strings[1];
+ uuid = IGlobalWirelessEnergy.super.GetUUIDFromUsername(username);
+
+ String EU_String = strings[2];
+
+ // Usage is /gt global_energy_add username EU
+
+ if (uuid.equals("")) {
+ sender.addChatMessage(new ChatComponentText("User " + username + " has no global energy network."));
+ break;
+ }
+
+ if (addEUToGlobalEnergyMap(uuid, new BigInteger(EU_String)))
+ sender.addChatMessage(new ChatComponentText("Successfully added " + EU_String + "EU to the global energy network of " + username + "."));
+ else
+ sender.addChatMessage(new ChatComponentText("Failed to add " + EU_String + "EU to the global energy map of " + username +
+ ". Insufficient energy in network. " + username + "currently has " + IGlobalWirelessEnergy.super.GetUserEU(uuid).toString() + " in their network."));
+
+ break;
+ case "global_energy_set":
+
+ // Usage is /gt global_energy_set username EU
+
+ username = strings[1];
+ uuid = IGlobalWirelessEnergy.super.GetUUIDFromUsername(username);
+
+ String EU_String_0 = strings[2];
+
+ IGlobalWirelessEnergy.super.SetUserEU(uuid, new BigInteger(EU_String_0));
+ break;
+
+ case "global_energy_join":
+
+ // Usage is /gt global_energy_join username_of_you username_to_join
+
+ String username_0 = strings[1];
+ String username_1 = strings[2];
+
+ String uuid_0 = IGlobalWirelessEnergy.super.GetUUIDFromUsername(username_0);
+ String uuid_1 = IGlobalWirelessEnergy.super.GetUUIDFromUsername(username_1);
+
+ if (uuid_0.equals("")) {
+ sender.addChatMessage(new ChatComponentText("User " + username_0 + " has no global energy network."));
+ break;
+ }
+
+ if (uuid_0.equals("")) {
+ sender.addChatMessage(new ChatComponentText("User " + username_1 + " has no global energy network."));
+ break;
+ }
+
+ IGlobalWirelessEnergy.super.JoinUserNetwork(uuid_0, uuid_1);
+
+ sender.addChatMessage(new ChatComponentText("Success! " + username_0 + " has joined " + username_1 + "."));
+ sender.addChatMessage(new ChatComponentText("To undo this simply join your own network again with /gt global_energy_join " + username_0 + " " + username_0 + "."));
+
+ break;
default:
+ sender.addChatMessage(new ChatComponentText( EnumChatFormatting.RED + "Invalid command/syntax detected."));
printHelp(sender);
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java
index 3f7405931b..6c88d7c203 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java
@@ -31,8 +31,7 @@ import java.util.List;
import java.util.ArrayList;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static gregtech.api.enums.GT_Values.TIER_COLORS;
-import static gregtech.api.enums.GT_Values.VN;
+import static gregtech.api.enums.GT_Values.*;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_StructureUtility.ofCoil;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
@@ -152,12 +151,7 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul
.addInfo("Takes " + EnumChatFormatting.RED + GT_Utility.formatNumbers(max_efficiency_time_in_ticks/(3600*20)) + EnumChatFormatting.GRAY + " hours of continuous run time to fully breach dimensional")
.addInfo("boundaries and achieve maximum efficiency. This reduces fuel")
.addInfo("consumption by up to " + EnumChatFormatting.RED + GT_Utility.formatNumbers(100*maximum_discount) + "%" + EnumChatFormatting.GRAY + ". Supports overclocking beyond MAX voltage.")
- .addInfo("Author: " +
- EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "C" +
- EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "o" +
- EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "l" +
- EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "e" +
- EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + EnumChatFormatting.ITALIC + EnumChatFormatting.UNDERLINE + "n")
+ .addInfo(AuthorColen)
.addSeparator()
.beginStructureBlock(33, 24, 33, false)
.addStructureInfo("DTPF Structure is too complex! See schematic for details.")
diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
index a3a1434795..32f67857dd 100644
--- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
+++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
@@ -25,6 +25,185 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+// Free IDs left for machines in GT as of 29th of July 2022 - Colen. Please try use them up in order.
+// 349
+// 356
+// 357
+// 358
+// 359
+// 366
+// 367
+// 368
+// 369
+// 370
+// 376
+// 377
+// 378
+// 379
+// 386
+// 387
+// 388
+// 389
+// 390
+// 396
+// 397
+// 398
+// 399
+// 410
+// 419
+// 426
+// 427
+// 428
+// 429
+// 430
+// 436
+// 437
+// 438
+// 439
+// 446
+// 447
+// 448
+// 449
+// 450
+// 456
+// 457
+// 458
+// 459
+// 466
+// 467
+// 468
+// 469
+// 470
+// 476
+// 477
+// 478
+// 479
+// 486
+// 487
+// 488
+// 489
+// 496
+// 497
+// 498
+// 499
+// 506
+// 507
+// 508
+// 509
+// 518
+// 519
+// 526
+// 530
+// 537
+// 538
+// 539
+// 546
+// 547
+// 548
+// 549
+// 550
+// 556
+// 557
+// 558
+// 559
+// 566
+// 567
+// 576
+// 577
+// 578
+// 579
+// 586
+// 587
+// 588
+// 589
+// 590
+// 596
+// 597
+// 598
+// 599
+// 607
+// 608
+// 609
+// 610
+// 616
+// 617
+// 618
+// 619
+// 626
+// 627
+// 628
+// 629
+// 630
+// 636
+// 637
+// 639
+// 646
+// 647
+// 648
+// 649
+// 650
+// 656
+// 657
+// 658
+// 659
+// 666
+// 667
+// 668
+// 669
+// 670
+// 676
+// 677
+// 678
+// 682
+// 683
+// 684
+// 686
+// 687
+// 688
+// 689
+// 702
+// 703
+// 704
+// 705
+// 706
+// 707
+// 708
+// 709
+// 714
+// 715
+// 716
+// 717
+// 718
+// 719
+// 721
+// 722
+// 723
+// 724
+// 725
+// 726
+// 727
+// 728
+// 729
+// 730
+// 731
+// 732
+// 733
+// 734
+// 735
+// 736
+// 737
+// 738
+// 739
+// 741
+// 742
+// 743
+// 744
+// 745
+// 746
+// 747
+// 748
+// 749
+
public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUIT RECIPES AND USAGES
private static final String aTextWire1 = "wire."; private static final String aTextCable1 = "cable."; private static final String aTextWire2 = " Wire"; private static final String aTextCable2 = " Cable";
private static final String aTextPlate = "PPP"; private static final String aTextPlateWrench = "PwP"; private static final String aTextPlateMotor = "PMP"; private static final String aTextCableHull = "CMC";
@@ -71,7 +250,7 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI
GT_ModHandler.addCraftingRecipe(ItemList.Casing_Gearbox_Steel.get(1L), bits, new Object[]{"PhP", "GFG", aTextPlateWrench, 'P', OrePrefixes.plate.get(Materials.Steel), 'F', OrePrefixes.frameGt.get(Materials.Steel), 'G', OrePrefixes.gearGt.get(Materials.Steel)});
GT_ModHandler.addCraftingRecipe(ItemList.Casing_Gearbox_Titanium.get(1L), bits, new Object[]{"PhP", "GFG", aTextPlateWrench, 'P', OrePrefixes.plate.get(Materials.Steel), 'F', OrePrefixes.frameGt.get(Materials.Titanium), 'G', OrePrefixes.gearGt.get(Materials.Titanium)});
GT_ModHandler.addCraftingRecipe(ItemList.Casing_Gearbox_TungstenSteel.get(1L), bits, new Object[]{"PhP", "GFG", aTextPlateWrench, 'P', OrePrefixes.plate.get(Materials.Steel), 'F', OrePrefixes.frameGt.get(Materials.TungstenSteel), 'G', ItemList.Robot_Arm_IV});
- GT_ModHandler.addCraftingRecipe(ItemList.Casing_Grate.get(1L), bits, new Object[]{"PVP", "PFP", aTextPlateMotor, 'P', new ItemStack(Blocks.iron_bars,1), 'F', OrePrefixes.frameGt.get(Materials.Steel), 'M', ItemList.Electric_Motor_MV, 'V', OrePrefixes.rotor.get(Materials.Steel)});
+ GT_ModHandler.addCraftingRecipe(ItemList.Casing_Grate.get(1L), bits, new Object[]{"PVP", "PFP", aTextPlateMotor, 'P', new ItemStack(Blocks.iron_bars, 1), 'F', OrePrefixes.frameGt.get(Materials.Steel), 'M', ItemList.Electric_Motor_MV, 'V', OrePrefixes.rotor.get(Materials.Steel)});
GT_ModHandler.addCraftingRecipe(ItemList.Casing_Assembler.get(1L), bits, new Object[]{"PVP", "PFP", aTextPlateMotor, 'P', OrePrefixes.circuit.get(Materials.Ultimate), 'F', OrePrefixes.frameGt.get(Materials.TungstenSteel), 'M', ItemList.Electric_Motor_IV, 'V', OrePrefixes.circuit.get(Materials.Master)});
GT_ModHandler.addCraftingRecipe(ItemList.Casing_Firebox_Bronze.get(1L), bits, new Object[]{"PSP", "SFS", "PSP", 'P', OrePrefixes.plate.get(Materials.Bronze), 'F', OrePrefixes.frameGt.get(Materials.Bronze), 'S', OrePrefixes.stick.get(Materials.Bronze)});
GT_ModHandler.addCraftingRecipe(ItemList.Casing_Firebox_Steel.get(1L), bits, new Object[]{"PSP", "SFS", "PSP", 'P', OrePrefixes.plate.get(Materials.Steel), 'F', OrePrefixes.frameGt.get(Materials.Steel), 'S', OrePrefixes.stick.get(Materials.Steel)});
@@ -181,13 +360,13 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI
GT_ModHandler.addCraftingRecipe(ItemList.Transformer_LV_ULV.get(1L), bitsd, new Object[]{" BB", "CM ", " BB", 'M', ItemList.Hull_ULV, 'C', OrePrefixes.cableGt01.get(Materials.Tin), 'B', OrePrefixes.cableGt01.get(Materials.Lead)});
GT_ModHandler.addCraftingRecipe(ItemList.Transformer_MV_LV.get(1L), bitsd, new Object[]{" BB", "CM ", " BB", 'M', ItemList.Hull_LV, 'C', OrePrefixes.cableGt01.get(Materials.AnyCopper), 'B', OrePrefixes.cableGt01.get(Materials.Tin)});
- GT_ModHandler.addCraftingRecipe(ItemList.Transformer_HV_MV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_MV, 'C', OrePrefixes.cableGt01.get(Materials.Gold), 'B', OrePrefixes.cableGt01.get(Materials.AnyCopper),'K',ItemList.Circuit_Parts_Coil});
- GT_ModHandler.addCraftingRecipe(ItemList.Transformer_EV_HV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_HV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium), 'B', OrePrefixes.cableGt01.get(Materials.Gold),'K',ItemList.Circuit_Chip_ULPIC});
- GT_ModHandler.addCraftingRecipe(ItemList.Transformer_IV_EV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_EV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten), 'B', OrePrefixes.cableGt01.get(Materials.Aluminium),'K',ItemList.Circuit_Chip_LPIC});
- GT_ModHandler.addCraftingRecipe(ItemList.Transformer_LuV_IV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_IV, 'C', OrePrefixes.cableGt01.get(Materials.VanadiumGallium), 'B', OrePrefixes.cableGt01.get(Materials.Tungsten),'K',ItemList.Circuit_Chip_PIC});
- GT_ModHandler.addCraftingRecipe(ItemList.Transformer_ZPM_LuV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_LuV, 'C', OrePrefixes.cableGt01.get(Materials.Naquadah), 'B', OrePrefixes.cableGt01.get(Materials.VanadiumGallium),'K',ItemList.Circuit_Chip_HPIC});
- GT_ModHandler.addCraftingRecipe(ItemList.Transformer_UV_ZPM.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_ZPM, 'C', OrePrefixes.cableGt01.get(Materials.NaquadahAlloy), 'B', OrePrefixes.cableGt01.get(Materials.Naquadah),'K',ItemList.Circuit_Chip_UHPIC});
- GT_ModHandler.addCraftingRecipe(ItemList.Transformer_MAX_UV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_UV, 'C', OrePrefixes.wireGt01.get(Materials.Bedrockium), 'B', OrePrefixes.cableGt01.get(Materials.NaquadahAlloy),'K',ItemList.Circuit_Chip_NPIC});
+ GT_ModHandler.addCraftingRecipe(ItemList.Transformer_HV_MV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_MV, 'C', OrePrefixes.cableGt01.get(Materials.Gold), 'B', OrePrefixes.cableGt01.get(Materials.AnyCopper), 'K', ItemList.Circuit_Parts_Coil});
+ GT_ModHandler.addCraftingRecipe(ItemList.Transformer_EV_HV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_HV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium), 'B', OrePrefixes.cableGt01.get(Materials.Gold), 'K', ItemList.Circuit_Chip_ULPIC});
+ GT_ModHandler.addCraftingRecipe(ItemList.Transformer_IV_EV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_EV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten), 'B', OrePrefixes.cableGt01.get(Materials.Aluminium), 'K', ItemList.Circuit_Chip_LPIC});
+ GT_ModHandler.addCraftingRecipe(ItemList.Transformer_LuV_IV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_IV, 'C', OrePrefixes.cableGt01.get(Materials.VanadiumGallium), 'B', OrePrefixes.cableGt01.get(Materials.Tungsten), 'K', ItemList.Circuit_Chip_PIC});
+ GT_ModHandler.addCraftingRecipe(ItemList.Transformer_ZPM_LuV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_LuV, 'C', OrePrefixes.cableGt01.get(Materials.Naquadah), 'B', OrePrefixes.cableGt01.get(Materials.VanadiumGallium), 'K', ItemList.Circuit_Chip_HPIC});
+ GT_ModHandler.addCraftingRecipe(ItemList.Transformer_UV_ZPM.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_ZPM, 'C', OrePrefixes.cableGt01.get(Materials.NaquadahAlloy), 'B', OrePrefixes.cableGt01.get(Materials.Naquadah), 'K', ItemList.Circuit_Chip_UHPIC});
+ GT_ModHandler.addCraftingRecipe(ItemList.Transformer_MAX_UV.get(1L), bitsd, new Object[]{"KBB", "CM ", "KBB", 'M', ItemList.Hull_UV, 'C', OrePrefixes.wireGt01.get(Materials.Bedrockium), 'B', OrePrefixes.cableGt01.get(Materials.NaquadahAlloy), 'K', ItemList.Circuit_Chip_NPIC});
ItemList.Hatch_Dynamo_ULV.set(new GT_MetaTileEntity_Hatch_Dynamo(30, "hatch.dynamo.tier.00", "ULV Dynamo Hatch", 0).getStackForm(1L));
ItemList.Hatch_Dynamo_LV.set(new GT_MetaTileEntity_Hatch_Dynamo(31, "hatch.dynamo.tier.01", "LV Dynamo Hatch", 1).getStackForm(1L));
@@ -204,6 +383,7 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI
GT_ModHandler.addCraftingRecipe(ItemList.Hatch_Dynamo_LV.get(1L), bitsd, new Object[]{"XOL", "SMP", "XOL", 'M', ItemList.Hull_LV, 'S', OrePrefixes.spring.get(Materials.Tin), 'X', OrePrefixes.circuit.get(Materials.Basic), 'O', ItemList.LV_Coil, 'L', OrePrefixes.cell.get(Materials.Lubricant), 'P', ItemList.Electric_Pump_LV});
GT_ModHandler.addCraftingRecipe(ItemList.Hatch_Dynamo_MV.get(1L), bitsd, new Object[]{"XOL", "SMP", "XOL", 'M', ItemList.Hull_MV, 'S', OrePrefixes.spring.get(Materials.Copper), 'X', ItemList.Circuit_Chip_ULPIC, 'O', ItemList.MV_Coil, 'L', OrePrefixes.cell.get(Materials.Lubricant), 'P', ItemList.Electric_Pump_MV});
+ // 1234
ItemList.Hatch_Energy_ULV.set(new GT_MetaTileEntity_Hatch_Energy(40, "hatch.energy.tier.00", "ULV Energy Hatch", 0).getStackForm(1L));
ItemList.Hatch_Energy_LV.set(new GT_MetaTileEntity_Hatch_Energy(41, "hatch.energy.tier.01", "LV Energy Hatch", 1).getStackForm(1L));
ItemList.Hatch_Energy_MV.set(new GT_MetaTileEntity_Hatch_Energy(42, "hatch.energy.tier.02", "MV Energy Hatch", 2).getStackForm(1L));
@@ -311,11 +491,11 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI
ItemList.Hatch_DataAccess_LuV.set(new GT_MetaTileEntity_Hatch_DataAccess(146, "hatch.dataaccess.adv", "Advanced Data Access Hatch", 6).getStackForm(1L));
ItemList.Hatch_DataAccess_UV.set(new GT_MetaTileEntity_Hatch_DataAccess(147, "hatch.dataaccess.auto", "Automatable Data Access Hatch", 8).getStackForm(1L));
- GT_ModHandler.addCraftingRecipe(ItemList.Hatch_DataAccess_EV.get(1L), bitsd, new Object[]{"COC", "OMO", "COC", 'M', ItemList.Hull_EV, 'O', ItemList.Tool_DataStick , 'C' ,OrePrefixes.circuit.get(Materials.Elite)});
- GT_ModHandler.addCraftingRecipe(ItemList.Hatch_DataAccess_LuV.get(1L), bitsd, new Object[]{"COC", "OMO", "COC", 'M', ItemList.Hull_LuV, 'O', ItemList.Tool_DataOrb , 'C' ,OrePrefixes.circuit.get(Materials.Ultimate)});
- GT_ModHandler.addCraftingRecipe(ItemList.Hatch_DataAccess_UV.get(1L), bitsd, new Object[]{"CRC", "OMO", "CRC", 'M', ItemList.Hull_UV, 'O', ItemList.Tool_DataOrb , 'C' ,OrePrefixes.circuit.get(Materials.Infinite), 'R', ItemList.Robot_Arm_UV});
+ GT_ModHandler.addCraftingRecipe(ItemList.Hatch_DataAccess_EV.get(1L), bitsd, new Object[]{"COC", "OMO", "COC", 'M', ItemList.Hull_EV, 'O', ItemList.Tool_DataStick, 'C', OrePrefixes.circuit.get(Materials.Elite)});
+ GT_ModHandler.addCraftingRecipe(ItemList.Hatch_DataAccess_LuV.get(1L), bitsd, new Object[]{"COC", "OMO", "COC", 'M', ItemList.Hull_LuV, 'O', ItemList.Tool_DataOrb, 'C', OrePrefixes.circuit.get(Materials.Ultimate)});
+ GT_ModHandler.addCraftingRecipe(ItemList.Hatch_DataAccess_UV.get(1L), bitsd, new Object[]{"CRC", "OMO", "CRC", 'M', ItemList.Hull_UV, 'O', ItemList.Tool_DataOrb, 'C', OrePrefixes.circuit.get(Materials.Infinite), 'R', ItemList.Robot_Arm_UV});
- GT_ModHandler.addCraftingRecipe(ItemList.Hatch_AutoMaintenance.get(1L), bitsd, new Object[]{"CHC", "AMA", "CHC", 'M', ItemList.Hull_LuV,'H',ItemList.Hatch_Maintenance,'A',ItemList.Robot_Arm_LuV,'C',OrePrefixes.circuit.get(Materials.Ultimate)});
+ GT_ModHandler.addCraftingRecipe(ItemList.Hatch_AutoMaintenance.get(1L), bitsd, new Object[]{"CHC", "AMA", "CHC", 'M', ItemList.Hull_LuV, 'H', ItemList.Hatch_Maintenance, 'A', ItemList.Robot_Arm_LuV, 'C', OrePrefixes.circuit.get(Materials.Ultimate)});
ItemList.Hatch_Muffler_LV.set(new GT_MetaTileEntity_Hatch_Muffler(91, "hatch.muffler.tier.01", "Muffler Hatch (LV)", 1).getStackForm(1L));
ItemList.Hatch_Muffler_MV.set(new GT_MetaTileEntity_Hatch_Muffler(92, "hatch.muffler.tier.02", "Muffler Hatch (MV)", 2).getStackForm(1L));
@@ -334,12 +514,12 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI
ItemList.Machine_Steel_Boiler.set(new GT_MetaTileEntity_Boiler_Steel(101, "boiler.steel", "High Pressure Coal Boiler").getStackForm(1L));
ItemList.Machine_Steel_Boiler_Lava.set(new GT_MetaTileEntity_Boiler_Lava(102, "boiler.lava", "High Pressure Lava Boiler").getStackForm(1L));
ItemList.Machine_Bronze_Boiler_Solar.set(new GT_MetaTileEntity_Boiler_Solar(105, "boiler.solar", "Simple Solar Boiler").getStackForm(1L));
- ItemList.Machine_HP_Solar.set(new GT_MetaTileEntity_Boiler_Solar_Steel(114,"boiler.steel.solar", "High Pressure Solar Boiler").getStackForm(1L));
+ ItemList.Machine_HP_Solar.set(new GT_MetaTileEntity_Boiler_Solar_Steel(114, "boiler.steel.solar", "High Pressure Solar Boiler").getStackForm(1L));
GT_ModHandler.addCraftingRecipe(ItemList.Machine_Bronze_Boiler.get(1L), bits, new Object[]{aTextPlate, "PwP", "BFB", 'F', OreDictNames.craftingIronFurnace, 'P', OrePrefixes.plate.get(Materials.Bronze), 'B', new ItemStack(Blocks.brick_block, 1)});
GT_ModHandler.addCraftingRecipe(ItemList.Machine_Steel_Boiler.get(1L), bits, new Object[]{aTextPlate, "PwP", "BFB", 'F', OreDictNames.craftingIronFurnace, 'P', OrePrefixes.plate.get(Materials.Steel), 'B', new ItemStack(Blocks.brick_block, 1)});
GT_ModHandler.addCraftingRecipe(ItemList.Machine_Steel_Boiler_Lava.get(1L), bits, new Object[]{aTextPlate, "PTP", aTextPlateMotor, 'M', ItemList.Hull_HP, 'P', OrePrefixes.plate.get(Materials.Steel), 'T', GT_ModHandler.getModItem("BuildCraft|Factory", "tankBlock", 1L, 0)});
GT_ModHandler.addCraftingRecipe(ItemList.Machine_Bronze_Boiler_Solar.get(1L), bits, new Object[]{"GGG", "SSS", aTextPlateMotor, 'M', ItemList.Hull_Bronze_Bricks, 'P', OrePrefixes.pipeSmall.get(Materials.Bronze), 'S', OrePrefixes.plateDouble.get(Materials.Silver), 'G', new ItemStack(Blocks.glass, 1)});
- GT_ModHandler.addCraftingRecipe(ItemList.Machine_HP_Solar.get(1L), bits, new Object[]{"GGG", "SSS", aTextPlateMotor, 'M', ItemList.Hull_HP_Bricks, 'P', OrePrefixes.pipeSmall.get(Materials.Steel), 'S', OrePrefixes.plateTriple.get(Materials.Silver), 'G', GT_ModHandler.getModItem("IC2","blockAlloyGlass",1L)});
+ GT_ModHandler.addCraftingRecipe(ItemList.Machine_HP_Solar.get(1L), bits, new Object[]{"GGG", "SSS", aTextPlateMotor, 'M', ItemList.Hull_HP_Bricks, 'P', OrePrefixes.pipeSmall.get(Materials.Steel), 'S', OrePrefixes.plateTriple.get(Materials.Silver), 'G', GT_ModHandler.getModItem("IC2", "blockAlloyGlass", 1L)});
ItemList.Machine_Bronze_BlastFurnace.set(new GT_MetaTileEntity_BronzeBlastFurnace(108, "bronzemachine.blastfurnace", "Bronze Plated Blast Furnace").getStackForm(1L));
ItemList.Machine_Bronze_Furnace.set(new GT_MetaTileEntity_Furnace_Bronze(103, "bronzemachine.furnace", "Steam Furnace").getStackForm(1L));
@@ -478,6 +658,46 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI
ItemList.Battery_Charger_4by4_UV.set(new GT_MetaTileEntity_Charger(698, "batterycharger.16.tier.08", "Ultimate Voltage Battery Charger", 8, "Each battery gives 8A in/4A out (min 4A/2A)", 4).getStackForm(1L));
ItemList.Battery_Charger_4by4_MAX.set(new GT_MetaTileEntity_Charger(699, "batterycharger.16.tier.09", "Highly Ultimate Voltage Battery Charger", 9, "Each battery gives 8A in/4A out (min 4A/2A)", 4).getStackForm(1L));
+ {
+
+ // Wireless Energy Hatches
+
+ ItemList.Wireless_Hatch_Energy_ULV.set(new GT_MetaTileEntity_Wireless_Hatch(206, "hatch.wireless.receiver.tier.00", "ULV Wireless Energy Hatch", 0).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_LV.set(new GT_MetaTileEntity_Wireless_Hatch(207, "hatch.wireless.receiver.tier.01", "LV Wireless Energy Hatch", 1).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_MV.set(new GT_MetaTileEntity_Wireless_Hatch(208, "hatch.wireless.receiver.tier.02", "MV Wireless Energy Hatch", 2).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_HV.set(new GT_MetaTileEntity_Wireless_Hatch(209, "hatch.wireless.receiver.tier.03", "HV Wireless Energy Hatch", 3).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_EV.set(new GT_MetaTileEntity_Wireless_Hatch(216, "hatch.wireless.receiver.tier.04", "EV Wireless Energy Hatch", 4).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_IV.set(new GT_MetaTileEntity_Wireless_Hatch(217, "hatch.wireless.receiver.tier.05", "IV Wireless Energy Hatch", 5).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_LuV.set(new GT_MetaTileEntity_Wireless_Hatch(218, "hatch.wireless.receiver.tier.06", "LuV Wireless Energy Hatch", 6).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_ZPM.set(new GT_MetaTileEntity_Wireless_Hatch(219, "hatch.wireless.receiver.tier.07", "ZPM Wireless Energy Hatch", 7).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_UV.set(new GT_MetaTileEntity_Wireless_Hatch(227, "hatch.wireless.receiver.tier.08", "UV Wireless Energy Hatch", 8).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_UHV.set(new GT_MetaTileEntity_Wireless_Hatch(229, "hatch.wireless.receiver.tier.09", "UHV Wireless Energy Hatch", 9).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_UEV.set(new GT_MetaTileEntity_Wireless_Hatch(266, "hatch.wireless.receiver.tier.10", "UEV Wireless Energy Hatch", 10).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_UIV.set(new GT_MetaTileEntity_Wireless_Hatch(267, "hatch.wireless.receiver.tier.11", "UIV Wireless Energy Hatch", 11).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_UMV.set(new GT_MetaTileEntity_Wireless_Hatch(268, "hatch.wireless.receiver.tier.12", "UMV Wireless Energy Hatch", 12).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_UXV.set(new GT_MetaTileEntity_Wireless_Hatch(269, "hatch.wireless.receiver.tier.13", "UXV Wireless Energy Hatch", 13).getStackForm(1L));
+ ItemList.Wireless_Hatch_Energy_MAX.set(new GT_MetaTileEntity_Wireless_Hatch(286, "hatch.wireless.receiver.tier.14", "MAX Wireless Energy Hatch", 14).getStackForm(1L));
+
+ // Wireless Dynamo Hatches
+
+ ItemList.Wireless_Dynamo_Energy_ULV.set(new GT_MetaTileEntity_Wireless_Dynamo(287, "hatch.wireless.transmitter.tier.00", "ULV Wireless Energy Dynamo", 0).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_LV.set(new GT_MetaTileEntity_Wireless_Dynamo(288, "hatch.wireless.transmitter.tier.01", "LV Wireless Energy Dynamo", 1).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_MV.set(new GT_MetaTileEntity_Wireless_Dynamo(289, "hatch.wireless.transmitter.tier.02", "MV Wireless Energy Dynamo", 2).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_HV.set(new GT_MetaTileEntity_Wireless_Dynamo(296, "hatch.wireless.transmitter.tier.03", "HV Wireless Energy Dynamo", 3).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_EV.set(new GT_MetaTileEntity_Wireless_Dynamo(297, "hatch.wireless.transmitter.tier.04", "EV Wireless Energy Dynamo", 4).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_IV.set(new GT_MetaTileEntity_Wireless_Dynamo(298, "hatch.wireless.transmitter.tier.05", "IV Wireless Energy Dynamo", 5).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_LuV.set(new GT_MetaTileEntity_Wireless_Dynamo(299, "hatch.wireless.transmitter.tier.06", "LuV Wireless Energy Dynamo", 6).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_ZPM.set(new GT_MetaTileEntity_Wireless_Dynamo(310, "hatch.wireless.transmitter.tier.07", "ZPM Wireless Energy Dynamo", 7).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_UV.set(new GT_MetaTileEntity_Wireless_Dynamo(316, "hatch.wireless.transmitter.tier.08", "UV Wireless Energy Dynamo", 8).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_UHV.set(new GT_MetaTileEntity_Wireless_Dynamo(317, "hatch.wireless.transmitter.tier.09", "UHV Wireless Energy Dynamo", 9).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_UEV.set(new GT_MetaTileEntity_Wireless_Dynamo(318, "hatch.wireless.transmitter.tier.10", "UEV Wireless Energy Dynamo", 10).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_UIV.set(new GT_MetaTileEntity_Wireless_Dynamo(319, "hatch.wireless.transmitter.tier.11", "UIV Wireless Energy Dynamo", 11).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_UMV.set(new GT_MetaTileEntity_Wireless_Dynamo(346, "hatch.wireless.transmitter.tier.12", "UMV Wireless Energy Dynamo", 12).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_UXV.set(new GT_MetaTileEntity_Wireless_Dynamo(347, "hatch.wireless.transmitter.tier.13", "UXV Wireless Energy Dynamo", 13).getStackForm(1L));
+ ItemList.Wireless_Dynamo_Energy_MAX.set(new GT_MetaTileEntity_Wireless_Dynamo(348, "hatch.wireless.transmitter.tier.14", "MAX Wireless Energy Dynamo", 14).getStackForm(1L));
+
+ }
+
GT_ModHandler.addCraftingRecipe(ItemList.Battery_Charger_4by4_ULV.get(1L), bitsd, new Object[]{aTextWireChest, aTextWireHull, "BCB", 'M', ItemList.Hull_ULV, 'W', OrePrefixes.wireGt16.get(Materials.Lead), 'T', OreDictNames.craftingChest, 'B', ItemList.Battery_RE_ULV_Tantalum, 'C', OrePrefixes.circuit.get(Materials.Primitive)});
GT_ModHandler.addCraftingRecipe(ItemList.Battery_Charger_4by4_LV.get(1L), bitsd, new Object[]{aTextWireChest, aTextWireHull, "BCB", 'M', ItemList.Hull_LV, 'W', OrePrefixes.wireGt16.get(Materials.Tin), 'T', OreDictNames.craftingChest, 'B', ItemList.Battery_RE_LV_Lithium, 'C', OrePrefixes.circuit.get(Materials.Basic)});
GT_ModHandler.addCraftingRecipe(ItemList.Battery_Charger_4by4_MV.get(1L), bitsd, new Object[]{aTextWireChest, aTextWireHull, "BCB", 'M', ItemList.Hull_MV, 'W', OrePrefixes.wireGt16.get(Materials.AnyCopper), 'T', OreDictNames.craftingChest, 'B', ItemList.Battery_RE_MV_Lithium, 'C', OrePrefixes.circuit.get(Materials.Good)});
@@ -1190,7 +1410,7 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI
makeWires(Materials.SuperconductorUEV, 2026, 0L, 0L, 64L, gregtech.api.enums.GT_Values.V[10], false, true);
makeWires(Materials.Ichorium, 2600, 2L, 2L, 12L, GT_Values.V[9], false, true);
- makeWires(Materials.SpaceTime, 2606, 0L, 0L, 1_000_000L, GT_Values.V[15], false, true);
+ makeWires(Materials.SpaceTime, 2606, 0L, 0L, 1_000_000L, GT_Values.V[14], false, true);
if (!GT_Mod.gregtechproxy.mDisableIC2Cables) {
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getIC2Item("copperCableItem", 2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xP", 'P', OrePrefixes.plate.get(Materials.AnyCopper)});