aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/machines/multi/drone
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/common/tileentities/machines/multi/drone
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/common/tileentities/machines/multi/drone')
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/drone/DroneConnection.java34
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java (renamed from src/main/java/gregtech/common/tileentities/machines/multi/drone/GT_MetaTileEntity_DroneCentre.java)116
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEHatchDroneDownLink.java (renamed from src/main/java/gregtech/common/tileentities/machines/multi/drone/GT_MetaTileEntity_Hatch_DroneDownLink.java)47
3 files changed, 93 insertions, 104 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/drone/DroneConnection.java b/src/main/java/gregtech/common/tileentities/machines/multi/drone/DroneConnection.java
index 92b1c65032..e5f3cb99ab 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/drone/DroneConnection.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/drone/DroneConnection.java
@@ -1,6 +1,6 @@
package gregtech.common.tileentities.machines.multi.drone;
-import static gregtech.GT_Mod.gregtechproxy;
+import static gregtech.GTMod.gregtechproxy;
import java.util.Optional;
@@ -13,23 +13,23 @@ import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Util;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.metatileentity.implementations.MTEMultiBlockBase;
+import gregtech.api.util.GTLanguageManager;
+import gregtech.api.util.GTUtil;
+import gregtech.api.util.GTUtility;
public class DroneConnection {
String customName;
String unlocalizedName;
- GT_MetaTileEntity_MultiBlockBase machine;
+ MTEMultiBlockBase machine;
ItemStack machineItem;
ChunkCoordinates machineCoord;
- GT_MetaTileEntity_DroneCentre centre;
+ MTEDroneCentre centre;
ChunkCoordinates centreCoord;
World world;
- public DroneConnection(GT_MetaTileEntity_MultiBlockBase machine, GT_MetaTileEntity_DroneCentre centre) {
+ public DroneConnection(MTEMultiBlockBase machine, MTEDroneCentre centre) {
this.machine = machine;
this.machineItem = machine.getStackForm(1);
machineCoord = machine.getBaseMetaTileEntity()
@@ -62,19 +62,18 @@ public class DroneConnection {
centreTag.getInteger("x"),
centreTag.getInteger("y"),
centreTag.getInteger("z"));
- this.centre = (GT_MetaTileEntity_DroneCentre) getLoadedGT_BaseMachineAt(centreCoord, world, true);
+ this.centre = (MTEDroneCentre) getLoadedGT_BaseMachineAt(centreCoord, world, true);
this.customName = aNBT.getString("name");
this.unlocalizedName = aNBT.getString("unlocalizedName");
}
- public GT_MetaTileEntity_MultiBlockBase getMachine() {
+ public MTEMultiBlockBase getMachine() {
return machine;
}
public boolean reCheckConnection() {
if (machine == null) this.machine = getLoadedGT_BaseMachineAt(machineCoord, world, true);
- if (centre == null)
- this.centre = (GT_MetaTileEntity_DroneCentre) getLoadedGT_BaseMachineAt(centreCoord, world, true);
+ if (centre == null) this.centre = (MTEDroneCentre) getLoadedGT_BaseMachineAt(centreCoord, world, true);
if (machine != null && centre != null
&& !centre.getConnectionList()
.contains(this))
@@ -84,7 +83,7 @@ public class DroneConnection {
}
public String getCustomName(boolean localized) {
- if (localized) return GT_LanguageManager.getTranslation("gt.blockmachines." + unlocalizedName + ".name");
+ if (localized) return GTLanguageManager.getTranslation("gt.blockmachines." + unlocalizedName + ".name");
return customName;
}
@@ -100,7 +99,7 @@ public class DroneConnection {
return machine != null && machine.shouldDisplayShutDownReason()
&& !machine.getBaseMetaTileEntity()
.isActive()
- && GT_Utility.isStringValid(
+ && GTUtility.isStringValid(
machine.getBaseMetaTileEntity()
.getLastShutDownReason()
.getDisplayString())
@@ -122,11 +121,10 @@ public class DroneConnection {
return aNBT;
}
- public GT_MetaTileEntity_MultiBlockBase getLoadedGT_BaseMachineAt(ChunkCoordinates coords, World world,
- boolean isLoaded) {
- TileEntity te = GT_Util.getTileEntity(world, coords, isLoaded);
+ public MTEMultiBlockBase getLoadedGT_BaseMachineAt(ChunkCoordinates coords, World world, boolean isLoaded) {
+ TileEntity te = GTUtil.getTileEntity(world, coords, isLoaded);
if (te == null) return null;
- return (GT_MetaTileEntity_MultiBlockBase) ((IGregTechTileEntity) te).getMetaTileEntity();
+ return (MTEMultiBlockBase) ((IGregTechTileEntity) te).getMetaTileEntity();
}
private NBTTagCompound transCoordsToNBT(ChunkCoordinates coord) {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/drone/GT_MetaTileEntity_DroneCentre.java b/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java
index 8d2eaa0480..cf52680d71 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/drone/GT_MetaTileEntity_DroneCentre.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java
@@ -3,11 +3,11 @@ package gregtech.common.tileentities.machines.multi.drone;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
-import static gregtech.api.enums.GT_HatchElement.InputBus;
-import static gregtech.api.enums.GT_Values.AuthorSilverMoon;
+import static gregtech.api.enums.GTValues.AuthorSilverMoon;
+import static gregtech.api.enums.HatchElement.InputBus;
import static gregtech.api.multitileentity.multiblock.casing.Glasses.chainAllGlasses;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
-import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import static gregtech.api.util.GTStructureUtility.buildHatchAdder;
import java.io.IOException;
import java.text.Collator;
@@ -65,32 +65,31 @@ import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget;
import appeng.api.util.DimensionalCoord;
import appeng.api.util.WorldCoord;
import appeng.client.render.BlockPosHighlighter;
-import gregtech.api.GregTech_API;
+import gregtech.api.GregTechAPI;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.SoundResource;
import gregtech.api.enums.Textures;
-import gregtech.api.gui.modularui.GT_UITextures;
+import gregtech.api.gui.modularui.GTUITextures;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.metatileentity.implementations.MTEExtendedPowerMultiBlockBase;
+import gregtech.api.metatileentity.implementations.MTEMultiBlockBase;
import gregtech.api.recipe.check.CheckRecipeResult;
import gregtech.api.recipe.check.SimpleCheckRecipeResult;
import gregtech.api.render.TextureFactory;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.util.GTLog;
+import gregtech.api.util.GTUtility;
+import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.api.util.shutdown.ShutDownReason;
import gregtech.api.util.shutdown.ShutDownReasonRegistry;
import gregtech.common.gui.modularui.widget.ShutDownReasonSyncer;
-import gregtech.common.items.GT_TierDrone;
+import gregtech.common.items.ItemTierDrone;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
-public class GT_MetaTileEntity_DroneCentre extends
- GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GT_MetaTileEntity_DroneCentre> implements ISurvivalConstructable {
+public class MTEDroneCentre extends MTEExtendedPowerMultiBlockBase<MTEDroneCentre> implements ISurvivalConstructable {
private static final IIconContainer ACTIVE = new Textures.BlockIcons.CustomIcon("iconsets/DRONE_CENTRE_ACTIVE");
private static final IIconContainer FACE = new Textures.BlockIcons.CustomIcon("iconsets/DRONE_CENTRE_FACE");
@@ -109,10 +108,10 @@ public class GT_MetaTileEntity_DroneCentre extends
private List<DroneConnection> connectionList = new ArrayList<>();
public HashMap<String, String> tempNameList = new HashMap<>();
// Save centre by dimID
- private static final HashMultimap<Integer, GT_MetaTileEntity_DroneCentre> droneMap = HashMultimap.create();
+ private static final HashMultimap<Integer, MTEDroneCentre> droneMap = HashMultimap.create();
// spotless off
- private static final IStructureDefinition<GT_MetaTileEntity_DroneCentre> STRUCTURE_DEFINITION = StructureDefinition
- .<GT_MetaTileEntity_DroneCentre>builder()
+ private static final IStructureDefinition<MTEDroneCentre> STRUCTURE_DEFINITION = StructureDefinition
+ .<MTEDroneCentre>builder()
.addShape(
"main",
transpose(
@@ -122,30 +121,27 @@ public class GT_MetaTileEntity_DroneCentre extends
{ "C C", " ", " ", " ", " ", " ", " ", " ", "C C" } }))
.addElement(
'C',
- buildHatchAdder(GT_MetaTileEntity_DroneCentre.class).atLeast(InputBus)
+ buildHatchAdder(MTEDroneCentre.class).atLeast(InputBus)
.casingIndex(59)
.dot(1)
- .buildAndChain(
- onElementPass(
- GT_MetaTileEntity_DroneCentre::onCasingAdded,
- ofBlock(GregTech_API.sBlockCasings4, 2))))
+ .buildAndChain(onElementPass(MTEDroneCentre::onCasingAdded, ofBlock(GregTechAPI.sBlockCasings4, 2))))
.addElement('A', chainAllGlasses())
- .addElement('B', ofBlock(GregTech_API.sBlockCasings1, 11))
- .addElement('D', ofBlock(GregTech_API.sBlockCasings4, 0))
+ .addElement('B', ofBlock(GregTechAPI.sBlockCasings1, 11))
+ .addElement('D', ofBlock(GregTechAPI.sBlockCasings4, 0))
.build();
// spotless on
- public GT_MetaTileEntity_DroneCentre(String name) {
+ public MTEDroneCentre(String name) {
super(name);
}
- public GT_MetaTileEntity_DroneCentre(int ID, String Name, String NameRegional) {
+ public MTEDroneCentre(int ID, String Name, String NameRegional) {
super(ID, Name, NameRegional);
}
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_DroneCentre(super.mName);
+ return new MTEDroneCentre(super.mName);
}
@Override
@@ -173,13 +169,13 @@ public class GT_MetaTileEntity_DroneCentre extends
}
@Override
- public IStructureDefinition<GT_MetaTileEntity_DroneCentre> getStructureDefinition() {
+ public IStructureDefinition<MTEDroneCentre> getStructureDefinition() {
return STRUCTURE_DEFINITION;
}
@Override
- protected GT_Multiblock_Tooltip_Builder createTooltip() {
- GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ protected MultiblockTooltipBuilder createTooltip() {
+ MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType("Drone Centre")
.addInfo("Drone Center Controller")
.addInfo(EnumChatFormatting.AQUA + "Drone #10032, cleared for takeoff!")
@@ -432,7 +428,7 @@ public class GT_MetaTileEntity_DroneCentre extends
List<ItemStack> inputs = getStoredInputs();
if (inputs.isEmpty()) return false;
for (ItemStack item : inputs) {
- if (item != null && item.getItem() instanceof GT_TierDrone drone) {
+ if (item != null && item.getItem() instanceof ItemTierDrone drone) {
this.droneLevel = drone.getLevel();
item.stackSize--;
updateSlots();
@@ -446,7 +442,7 @@ public class GT_MetaTileEntity_DroneCentre extends
List<ItemStack> inputs = getStoredInputs();
if (inputs.isEmpty()) return;
for (ItemStack item : inputs) {
- if (item != null && item.getItem() instanceof GT_TierDrone drone) {
+ if (item != null && item.getItem() instanceof ItemTierDrone drone) {
if (drone.getLevel() <= this.droneLevel) continue;
this.droneLevel = drone.getLevel();
item.stackSize--;
@@ -471,7 +467,7 @@ public class GT_MetaTileEntity_DroneCentre extends
.setBlock((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset), Blocks.air);
this.getBaseMetaTileEntity()
.getWorld()
- .setBlock((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset), GregTech_API.sDroneRender);
+ .setBlock((int) (x + xOffset), (int) (y + yOffset), (int) (z + zOffset), GregTechAPI.sDroneRender);
}
private void destroyRenderBlock() {
@@ -502,8 +498,8 @@ public class GT_MetaTileEntity_DroneCentre extends
.setSize(16, 16)
.setBackground(() -> {
List<UITexture> UI = new ArrayList<>();
- UI.add(GT_UITextures.BUTTON_STANDARD);
- UI.add(GT_UITextures.OVERLAY_BUTTON_WHITELIST);
+ UI.add(GTUITextures.BUTTON_STANDARD);
+ UI.add(GTUITextures.OVERLAY_BUTTON_WHITELIST);
return UI.toArray(new IDrawable[0]);
})
.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.drone_open_list"))
@@ -534,8 +530,8 @@ public class GT_MetaTileEntity_DroneCentre extends
.setSize(16, 16)
.setBackground(() -> {
List<UITexture> UI = new ArrayList<>();
- UI.add(GT_UITextures.BUTTON_STANDARD);
- UI.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON);
+ UI.add(GTUITextures.BUTTON_STANDARD);
+ UI.add(GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON);
return UI.toArray(new IDrawable[0]);
})
.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.drone_poweron_all"))
@@ -566,8 +562,8 @@ public class GT_MetaTileEntity_DroneCentre extends
.setSize(16, 16)
.setBackground(() -> {
List<UITexture> UI = new ArrayList<>();
- UI.add(GT_UITextures.BUTTON_STANDARD);
- UI.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF);
+ UI.add(GTUITextures.BUTTON_STANDARD);
+ UI.add(GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF);
return UI.toArray(new IDrawable[0]);
})
.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.drone_poweroff_all"))
@@ -580,13 +576,13 @@ public class GT_MetaTileEntity_DroneCentre extends
try {
buffer.writeNBTTagCompoundToBuffer(j.transConnectionToNBT());
} catch (IOException e) {
- GT_Log.err.println(e.getCause());
+ GTLog.err.println(e.getCause());
}
}, buffer -> {
try {
return new DroneConnection(buffer.readNBTTagCompoundFromBuffer());
} catch (IOException e) {
- GT_Log.err.println(e.getCause());
+ GTLog.err.println(e.getCause());
}
return null;
}));
@@ -596,7 +592,7 @@ public class GT_MetaTileEntity_DroneCentre extends
int heightCoff = getBaseMetaTileEntity().isServerSide() ? 0
: Minecraft.getMinecraft().currentScreen.height - 40;
ModularWindow.Builder builder = ModularWindow.builder(260, heightCoff);
- builder.setBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT);
+ builder.setBackground(GTUITextures.BACKGROUND_SINGLEBLOCK_DEFAULT);
builder.setGuiTint(getGUIColorization());
builder.widget(
ButtonWidget.closeWindowButton(true)
@@ -632,7 +628,7 @@ public class GT_MetaTileEntity_DroneCentre extends
.setTextAlignment(Alignment.CenterLeft)
.setTextColor(Color.WHITE.dark(1))
.setFocusOnGuiOpen(false)
- .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2))
+ .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2))
.addTooltip(StatCollector.translateToLocal("GT5U.gui.text.drone_search"))
.setPos(50, 30)
.setSize(200, 16))
@@ -665,7 +661,7 @@ public class GT_MetaTileEntity_DroneCentre extends
})
.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.drone_" + sort))
.setBackground(
- () -> new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_SORTING_MODE })
+ () -> new IDrawable[] { GTUITextures.BUTTON_STANDARD, GTUITextures.OVERLAY_BUTTON_SORTING_MODE })
.setPos(10, 30)
.setSize(16, 16))
.widget(new FakeSyncWidget.StringSyncer(() -> sort, var1 -> sort = var1))
@@ -693,8 +689,8 @@ public class GT_MetaTileEntity_DroneCentre extends
.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.drone_showLocalName"))
.setBackground(
() -> new IDrawable[] {
- showLocalizedName ? GT_UITextures.BUTTON_STANDARD_PRESSED : GT_UITextures.BUTTON_STANDARD,
- GT_UITextures.OVERLAY_BUTTON_CYCLIC })
+ showLocalizedName ? GTUITextures.BUTTON_STANDARD_PRESSED : GTUITextures.BUTTON_STANDARD,
+ GTUITextures.OVERLAY_BUTTON_CYCLIC })
.setPos(30, 30)
.setSize(16, 16));
// Sort first
@@ -724,7 +720,7 @@ public class GT_MetaTileEntity_DroneCentre extends
ItemStackHandler drawitem = new ItemStackHandler(1);
drawitem.setStackInSlot(0, connection.machineItem);
DynamicPositionedRow row = new DynamicPositionedRow().setSynced(false);
- GT_MetaTileEntity_MultiBlockBase coreMachine = connection.machine;
+ MTEMultiBlockBase coreMachine = connection.machine;
int finalI = i;
row.widget(
SlotWidget.phantom(drawitem, 0)
@@ -737,7 +733,7 @@ public class GT_MetaTileEntity_DroneCentre extends
})
.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.drone_setname"))
.setBackground(
- () -> new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_PRINT })
+ () -> new IDrawable[] { GTUITextures.BUTTON_STANDARD, GTUITextures.OVERLAY_BUTTON_PRINT })
.setSize(16, 16));
// Client can't handle unloaded machines
row.widget(
@@ -757,22 +753,22 @@ public class GT_MetaTileEntity_DroneCentre extends
}))
.setPlayClickSoundResource(
() -> Optional.ofNullable(coreMachine)
- .filter(GT_MetaTileEntity_MultiBlockBase::isAllowedToWork)
+ .filter(MTEMultiBlockBase::isAllowedToWork)
.map(var -> SoundResource.GUI_BUTTON_UP.resourceLocation)
.orElse(SoundResource.GUI_BUTTON_DOWN.resourceLocation))
.setBackground(
() -> Optional.ofNullable(coreMachine)
.map(
machine -> machine.isAllowedToWork()
- ? new IDrawable[] { GT_UITextures.BUTTON_STANDARD_PRESSED,
- GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON }
- : new IDrawable[] { GT_UITextures.BUTTON_STANDARD,
- GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF })
- .orElse(new IDrawable[] { GT_UITextures.OVERLAY_BUTTON_CROSS }))
+ ? new IDrawable[] { GTUITextures.BUTTON_STANDARD_PRESSED,
+ GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON }
+ : new IDrawable[] { GTUITextures.BUTTON_STANDARD,
+ GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF })
+ .orElse(new IDrawable[] { GTUITextures.OVERLAY_BUTTON_CROSS }))
.attachSyncer(
new FakeSyncWidget.BooleanSyncer(
() -> Optional.ofNullable(coreMachine)
- .map(GT_MetaTileEntity_MultiBlockBase::isAllowedToWork)
+ .map(MTEMultiBlockBase::isAllowedToWork)
.orElse(false),
var -> Optional.ofNullable(coreMachine)
.ifPresent(machine -> {
@@ -792,7 +788,7 @@ public class GT_MetaTileEntity_DroneCentre extends
})
.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.drone_highlight"))
.setBackground(
- new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_INVERT_REDSTONE })
+ new IDrawable[] { GTUITextures.BUTTON_STANDARD, GTUITextures.OVERLAY_BUTTON_INVERT_REDSTONE })
.setSize(16, 16));
// Show the reason why the machine shutdown
row.widget(
@@ -804,13 +800,13 @@ public class GT_MetaTileEntity_DroneCentre extends
.getLastShutDownReason()
.getDisplayString())
.orElse("")))
- .setBackground(GT_UITextures.PICTURE_STALLED_ELECTRICITY)
+ .setBackground(GTUITextures.PICTURE_STALLED_ELECTRICITY)
.setSize(16, 16)
.setEnabled(
var -> coreMachine != null && coreMachine.shouldDisplayShutDownReason()
&& !coreMachine.getBaseMetaTileEntity()
.isActive()
- && GT_Utility.isStringValid(
+ && GTUtility.isStringValid(
coreMachine.getBaseMetaTileEntity()
.getLastShutDownReason()
.getDisplayString())
@@ -860,7 +856,7 @@ public class GT_MetaTileEntity_DroneCentre extends
protected ModularWindow createCustomNameWindow(final EntityPlayer player) {
ModularWindow.Builder builder = ModularWindow.builder(150, 40);
- builder.setBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT);
+ builder.setBackground(GTUITextures.BACKGROUND_SINGLEBLOCK_DEFAULT);
builder.setGuiTint(getGUIColorization());
return builder.widget(
ButtonWidget.closeWindowButton(true)
@@ -887,7 +883,7 @@ public class GT_MetaTileEntity_DroneCentre extends
.setTextAlignment(Alignment.CenterLeft)
.setTextColor(Color.WHITE.dark(1))
.setFocusOnGuiOpen(true)
- .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2))
+ .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2))
.setPos(10, 16)
.setSize(130, 16))
.build();
@@ -906,7 +902,7 @@ public class GT_MetaTileEntity_DroneCentre extends
System.currentTimeMillis() + 500 * WorldCoord.getTaxicabDistance(blockPos, blockPos2));
}
- public static HashMultimap<Integer, GT_MetaTileEntity_DroneCentre> getCentreMap() {
+ public static HashMultimap<Integer, MTEDroneCentre> getCentreMap() {
return droneMap;
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/drone/GT_MetaTileEntity_Hatch_DroneDownLink.java b/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEHatchDroneDownLink.java
index 33dad93d52..224f187347 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/drone/GT_MetaTileEntity_Hatch_DroneDownLink.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEHatchDroneDownLink.java
@@ -33,36 +33,35 @@ import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
+import gregtech.api.GregTechAPI;
import gregtech.api.enums.Textures;
-import gregtech.api.gui.modularui.GT_UIInfos;
-import gregtech.api.gui.modularui.GT_UITextures;
+import gregtech.api.gui.modularui.GTUIInfos;
+import gregtech.api.gui.modularui.GTUITextures;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.metatileentity.implementations.MTEHatchMaintenance;
+import gregtech.api.metatileentity.implementations.MTEMultiBlockBase;
import gregtech.api.render.TextureFactory;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
-public class GT_MetaTileEntity_Hatch_DroneDownLink extends GT_MetaTileEntity_Hatch_Maintenance {
+public class MTEHatchDroneDownLink extends MTEHatchMaintenance {
private Vec3Impl downlinkCoord;
private DroneConnection connection;
// This has to be existed for doing random damage.
- private GT_MetaTileEntity_MultiBlockBase machine;
+ private MTEMultiBlockBase machine;
private static final IIconContainer moduleActive = new Textures.BlockIcons.CustomIcon(
"iconsets/OVERLAY_DRONE_MODULE_ACTIVE");
- public GT_MetaTileEntity_Hatch_DroneDownLink(int aID, String aName, String aNameRegional, int aTier) {
+ public MTEHatchDroneDownLink(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier);
}
- public GT_MetaTileEntity_Hatch_DroneDownLink(String aName, int aTier, String[] aDescription,
- ITexture[][][] aTextures) {
+ public MTEHatchDroneDownLink(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures, false);
}
@@ -89,11 +88,7 @@ public class GT_MetaTileEntity_Hatch_DroneDownLink extends GT_MetaTileEntity_Hat
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Hatch_DroneDownLink(
- this.mName,
- this.mTier,
- this.mDescriptionArray,
- this.mTextures);
+ return new MTEHatchDroneDownLink(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
}
@Override
@@ -144,7 +139,7 @@ public class GT_MetaTileEntity_Hatch_DroneDownLink extends GT_MetaTileEntity_Hat
aPlayer.addChatComponentMessage(new ChatComponentTranslation("GT5U.machines.dronecentre.noconnection"));
return false;
}
- GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
+ GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
return true;
}
return false;
@@ -177,18 +172,18 @@ public class GT_MetaTileEntity_Hatch_DroneDownLink extends GT_MetaTileEntity_Hat
* Find a drone connection. This will search for all DC in the same dimension, then find one in range.
*/
private void tryFindConnection() {
- if (GT_MetaTileEntity_DroneCentre.getCentreMap()
+ if (MTEDroneCentre.getCentreMap()
.containsKey(getBaseMetaTileEntity().getWorld().provider.dimensionId)) {
- List<GT_MetaTileEntity_DroneCentre> target = GT_MetaTileEntity_DroneCentre.getCentreMap()
+ List<MTEDroneCentre> target = MTEDroneCentre.getCentreMap()
.get(getBaseMetaTileEntity().getWorld().provider.dimensionId)
.stream()
.collect(Collectors.toList());
- for (GT_MetaTileEntity_DroneCentre centre : target) {
+ for (MTEDroneCentre centre : target) {
if (centre.getCoords()
.withinDistance(this.downlinkCoord, centre.getRange())
&& centre.getBaseMetaTileEntity()
.isActive()) {
- GT_MetaTileEntity_MultiBlockBase machine = tryFindCoreGTMultiBlock();
+ MTEMultiBlockBase machine = tryFindCoreGTMultiBlock();
if (machine != null && machine.isValid()) {
this.machine = machine;
connection = new DroneConnection(machine, centre);
@@ -202,7 +197,7 @@ public class GT_MetaTileEntity_Hatch_DroneDownLink extends GT_MetaTileEntity_Hat
}
// Find mainframe. Mainly from a method in GT_API——This will cause performance issue! Do not call it frequently.
- private GT_MetaTileEntity_MultiBlockBase tryFindCoreGTMultiBlock() {
+ private MTEMultiBlockBase tryFindCoreGTMultiBlock() {
Queue<ChunkCoordinates> tQueue = new LinkedList<>();
Set<ChunkCoordinates> visited = new HashSet<>(80);
tQueue.add(
@@ -219,13 +214,13 @@ public class GT_MetaTileEntity_Hatch_DroneDownLink extends GT_MetaTileEntity_Hat
// Plascrete block isn't registered as machineBlock, therefore we have to check it manually so that drone
// can work with cleanroom.
// Todo: loading cleanroom's config for other blocks
- isMachineBlock = GregTech_API
+ isMachineBlock = GregTechAPI
.isMachineBlock(block, world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ))
- || (block == GregTech_API.sBlockReinforced
+ || (block == GregTechAPI.sBlockReinforced
&& world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ) == 2);
// See if the block itself is MultiBlock, also the one we need.
if (tTileEntity instanceof IGregTechTileEntity te
- && te.getMetaTileEntity() instanceof GT_MetaTileEntity_MultiBlockBase mte)
+ && te.getMetaTileEntity() instanceof MTEMultiBlockBase mte)
if (mte.mMaintenanceHatches.contains(this)) return mte;
// Now see if we should add the nearby blocks to the queue:
@@ -272,7 +267,7 @@ public class GT_MetaTileEntity_Hatch_DroneDownLink extends GT_MetaTileEntity_Hat
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
- builder.setBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT);
+ builder.setBackground(GTUITextures.BACKGROUND_SINGLEBLOCK_DEFAULT);
builder.setGuiTint(getGUIColorization());
builder.widget(
ButtonWidget.closeWindowButton(true)
@@ -288,7 +283,7 @@ public class GT_MetaTileEntity_Hatch_DroneDownLink extends GT_MetaTileEntity_Hat
.setTextAlignment(Alignment.CenterLeft)
.setTextColor(Color.WHITE.dark(1))
.setFocusOnGuiOpen(true)
- .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2))
+ .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD_LIGHT_GRAY.withOffset(-1, -1, 2, 2))
.setPos(10, 16)
.setSize(130, 16))
.build();