Skip to content

Commit

Permalink
Fix lore tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Jan 16, 2025
1 parent 60235db commit e2d4e20
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 29 deletions.
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies {
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.70:dev')
api('com.github.GTNewHorizons:Galacticraft:3.3.2-GTNH:dev')
api('com.github.GTNewHorizons:GTNHLib:0.6.1:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.77:dev')
api('com.github.GTNewHorizons:Galacticraft:3.3.3-GTNH:dev')
api('com.github.GTNewHorizons:GTNHLib:0.6.2:dev')
compileOnly('com.github.GTNewHorizons:BlockRenderer6343:1.3.2:dev') {transitive = false}
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.15:dev") {transitive = false}
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.16:dev") {transitive = false}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

import java.util.function.Supplier;

import com.gtnewhorizon.gtnhlib.client.tooltip.LoreHandler;
import com.gtnewhorizon.gtnhlib.client.tooltip.LoreHolder;
import com.gtnewhorizons.gtnhintergalactic.item.IGItems;
import com.gtnewhorizons.gtnhintergalactic.tile.multi.TileEntityDysonSwarm;
import com.gtnewhorizons.gtnhintergalactic.tile.multi.TileEntityPlanetaryGasSiphon;
import com.gtnewhorizons.gtnhintergalactic.tile.multi.elevator.TileEntitySpaceElevator;

/**
* Utility functions for tooltips
Expand All @@ -17,14 +14,19 @@
*/
public class TooltipUtil {

@LoreHolder("gt.blockmachines.multimachine.ig.siphon.lore")
public static String siphonLoreText;

@LoreHolder("gt.blockmachines.multimachine.ig.elevator.lore")
public static String elevatorLoreText;

@LoreHolder("gt.blockmachines.multimachine.ig.dyson.lore")
public static String dysonLoreText;

/**
* Initialize the tooltip utilities
*/
public static void postInit() {
LoreHandler.registerLoreHolder(TileEntityPlanetaryGasSiphon.class);
LoreHandler.registerLoreHolder(TileEntityDysonSwarm.class);
LoreHandler.registerLoreHolder(TileEntitySpaceElevator.class);

Supplier<String> AUTHOR_GLOWREDMAN = chain(
translatedText("ig.structure.author"),
text(": "),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import net.minecraft.world.WorldProvider;
import net.minecraftforge.common.util.ForgeDirection;

import com.gtnewhorizon.gtnhlib.client.tooltip.LoreHolder;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureUtility;
import com.gtnewhorizons.gtnhintergalactic.block.IGBlocks;
import com.gtnewhorizons.gtnhintergalactic.client.IGTextures;
import com.gtnewhorizons.gtnhintergalactic.client.TooltipUtil;
import com.gtnewhorizons.gtnhintergalactic.config.IGConfig;
import com.gtnewhorizons.gtnhintergalactic.item.IGItems;

Expand All @@ -50,9 +50,6 @@

public class TileEntityDysonSwarm extends TTMultiblockBase implements ISurvivalConstructable {

@LoreHolder("gt.blockmachines.multimachine.ig.dyson.lore")
private static String loreTooltip;

private static final Map<Locale, DecimalFormat> DECIMAL_FORMATTERS = new HashMap<>();
private static final String STRUCTURE_PIECE_MAIN = "main";

Expand Down Expand Up @@ -404,7 +401,7 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec
protected MultiblockTooltipBuilder createTooltip() {
final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType(translateToLocal("gt.blockmachines.multimachine.ig.dyson.type"));
if (loreTooltip != null) tt.addInfo(ITALIC + loreTooltip);
if (TooltipUtil.dysonLoreText != null) tt.addInfo(ITALIC + TooltipUtil.dysonLoreText);

tt.addInfo(translateToLocal("gt.blockmachines.multimachine.ig.dyson.desc1"))
.addInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@

import org.jetbrains.annotations.NotNull;

import com.gtnewhorizon.gtnhlib.client.tooltip.LoreHolder;
import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.IStructureElement;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureUtility;
import com.gtnewhorizons.gtnhintergalactic.block.IGBlocks;
import com.gtnewhorizons.gtnhintergalactic.client.IGTextures;
import com.gtnewhorizons.gtnhintergalactic.client.TooltipUtil;
import com.gtnewhorizons.gtnhintergalactic.recipe.GasSiphonRecipes;

import bartworks.client.textures.PrefixTextureLinker;
Expand Down Expand Up @@ -73,10 +73,6 @@
public class TileEntityPlanetaryGasSiphon extends MTEEnhancedMultiBlockBase<TileEntityPlanetaryGasSiphon>
implements IChunkLoader {

/** Lore string, which will be randomly picked from a selection each time the resources are reloaded */
@LoreHolder("gt.blockmachines.multimachine.ig.siphon.lore")
@SuppressWarnings("unused")
private static String loreTooltip;
/** Main structure of the machine */
private static final String STRUCTURE_PIECE_MAIN = "main";
/** Cached value of log10(4) */
Expand Down Expand Up @@ -178,7 +174,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity tileEntity) {
protected MultiblockTooltipBuilder createTooltip() {
final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType(GCCoreUtil.translate("gt.blockmachines.multimachine.ig.siphon.type"));
if (loreTooltip != null) tt.addInfo(ITALIC + loreTooltip);
if (TooltipUtil.siphonLoreText != null) tt.addInfo(ITALIC + TooltipUtil.siphonLoreText);
tt.addInfo(GCCoreUtil.translate("gt.blockmachines.multimachine.ig.siphon.desc1"))
.addInfo(GCCoreUtil.translate("gt.blockmachines.multimachine.ig.siphon.desc2"))
.addInfo(GCCoreUtil.translate("gt.blockmachines.multimachine.ig.siphon.desc3"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import org.jetbrains.annotations.NotNull;

import com.gtnewhorizon.gtnhlib.client.tooltip.LoreHolder;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.alignment.enumerable.Rotation;
Expand All @@ -32,6 +31,7 @@
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureUtility;
import com.gtnewhorizons.gtnhintergalactic.block.IGBlocks;
import com.gtnewhorizons.gtnhintergalactic.client.TooltipUtil;
import com.gtnewhorizons.gtnhintergalactic.config.IGConfig;
import com.gtnewhorizons.gtnhintergalactic.gui.IG_UITextures;
import com.gtnewhorizons.gtnhintergalactic.tile.TileEntitySpaceElevatorCable;
Expand Down Expand Up @@ -124,10 +124,6 @@ public class TileEntitySpaceElevator extends TTMultiblockBase implements ISurviv
/** Depth offset of the extended structure piece */
private static final int STRUCTURE_PIECE_EXTENDED_DEPTH_OFFSET = 20;

/** Lore tooltip of the machine. Randomly picked from a selection */
@LoreHolder("gt.blockmachines.multimachine.ig.elevator.lore")
private static String loreTooltip;

// spotless:off
/** Structure definition of this machine */
private static final IStructureDefinition<TileEntitySpaceElevator> STRUCTURE_DEFINITION =
Expand Down Expand Up @@ -672,7 +668,7 @@ protected SoundResource getActivitySoundLoop() {
protected MultiblockTooltipBuilder createTooltip() {
final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType(GCCoreUtil.translate("gt.blockmachines.multimachine.ig.elevator.name"));
if (loreTooltip != null) tt.addInfo(ITALIC + loreTooltip);
if (TooltipUtil.elevatorLoreText != null) tt.addInfo(ITALIC + TooltipUtil.elevatorLoreText);
tt.addInfo(GCCoreUtil.translate("gt.blockmachines.multimachine.ig.elevator.desc2"))
.addInfo(GCCoreUtil.translate("gt.blockmachines.multimachine.ig.elevator.desc3"))
.addInfo(GCCoreUtil.translate("gt.blockmachines.multimachine.ig.elevator.desc4"))
Expand Down

0 comments on commit e2d4e20

Please sign in to comment.