Skip to content

Commit 8e41792

Browse files
committed
Bump version to 1.1.4
* Fix PTERB coolant not being re-enabled if only one of the coolant vars was zero * Add more Jade integration, putting the PTERB's coolant drain in the hover info * Add tool tags to Omni-breaker, update tooltip
1 parent 918be03 commit 8e41792

File tree

10 files changed

+41
-23
lines changed

10 files changed

+41
-23
lines changed

changelog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
# GregTech Modern Utilities version 1.1.3
1+
# GregTech Modern Utilities version 1.1.4
22

3-
Fix Omni-breaker not looking right in third person
3+
* Fix PTERB coolant not being re-enabled if only one of the coolant vars was zero
4+
* Add more Jade integration, putting the PTERB's coolant drain in the hover info
5+
* Add tool tags to Omni-breaker, update tooltip

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ org.gradle.jvmargs=-Xmx1G
1111
mapping_version=2023.09.03-1.20.1
1212

1313
# Mod Properties
14-
mod_version=1.1.3
14+
mod_version=1.1.4
1515
maven_group=net.neganote.gtmutils
1616
archives_base_name=gtmutils
1717
mod_id=gtmutils

src/generated/resources/assets/gtmutils/lang/en_ud.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"config.gtmutils.option.pterbCoolantIOMultiplier": "ɹǝıןdıʇןnWOIʇuɐןooƆqɹǝʇd",
2626
"config.gtmutils.option.pterbEnabled": "pǝןqɐuƎqɹǝʇd",
2727
"config.gtmutils.option.sterileHatchEnabled": "pǝןqɐuƎɥɔʇɐHǝןıɹǝʇs",
28-
"config.jade.plugin_gtmutils.frequency_info": "oɟuI ʎɔuǝnbǝɹℲ ᗺᴚƎ⟘Ԁ",
28+
"config.jade.plugin_gtmutils.pterb_info": "oɟuI ᗺᴚƎ⟘Ԁ",
2929
"gtmutils.gui.pterb.wireless_configurator.title": "ʎɔuǝnbǝɹɟ ssǝןǝɹıM",
3030
"gtmutils.multiblock.pterb_machine.coolant_usage": "puoɔǝs ɹǝd %s ɟo Ꞁ%s suıɐɹᗡɔ§",
3131
"gtmutils.pterb.current_frequency": "%s :ʎɔuǝnbǝɹɟ ʇuǝɹɹnƆ",
@@ -35,6 +35,7 @@
3535
"material.gtmutils.quantum_coolant": "ʇuɐןooƆ ɯnʇuɐnὉ",
3636
"tooltip.omnibreaker.can_break_anything": "¡⅁NIH⟘ʎNⱯ ǝuıɯ-ɐʇsuı uɐɔ ɹǝʞɐǝɹq-ıuɯO ǝɥ⟘",
3737
"tooltip.omnibreaker.charge_status": "∩Ǝ %s / ∩Ǝ %s :ʎbɹǝuƎ",
38+
"tooltip.omnibreaker.modern_vajra": "ɐɹظɐΛ uɹǝpoW Ɐ",
3839
"tooltip.omnibreaker.right_click_function": "¡ʞɔıןɔ-ʇɥbıɹ ɥʇıʍ sʞɔoןq ןɐnpıʌıpuı ʞɐǝɹᗺ",
3940
"tooltip.pterb_machine.frequencies": "˙ɹǝɯɹoɟsuɐɹ⟘ ǝʌıʇɔⱯ ǝןbuıs ɐ ǝʞıן ʇɔɐ ʎɔuǝnbǝɹɟ ǝɯɐs ǝɥʇ ɥʇıʍ sᗺᴚƎ⟘Ԁ ןןⱯ",
4041
"tooltip.pterb_machine.purpose": ")ᗺᴚƎ⟘Ԁ( ɹǝɯɹoɟsuɐɹ⟘ ǝʌıʇɔⱯ ssǝןǝɹıM",

src/generated/resources/assets/gtmutils/lang/en_us.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"config.gtmutils.option.pterbCoolantIOMultiplier": "pterbCoolantIOMultiplier",
2626
"config.gtmutils.option.pterbEnabled": "pterbEnabled",
2727
"config.gtmutils.option.sterileHatchEnabled": "sterileHatchEnabled",
28-
"config.jade.plugin_gtmutils.frequency_info": "PTERB Frequency Info",
28+
"config.jade.plugin_gtmutils.pterb_info": "PTERB Info",
2929
"gtmutils.gui.pterb.wireless_configurator.title": "Wireless frequency",
3030
"gtmutils.multiblock.pterb_machine.coolant_usage": "§cDrains %sL of %s per second",
3131
"gtmutils.pterb.current_frequency": "Current frequency: %s",
@@ -35,6 +35,7 @@
3535
"material.gtmutils.quantum_coolant": "Quantum Coolant",
3636
"tooltip.omnibreaker.can_break_anything": "The Omni-breaker can insta-mine ANYTHING!",
3737
"tooltip.omnibreaker.charge_status": "Energy: %s EU / %s EU",
38+
"tooltip.omnibreaker.modern_vajra": "A Modern Vajra",
3839
"tooltip.omnibreaker.right_click_function": "Break individual blocks with right-click!",
3940
"tooltip.pterb_machine.frequencies": "All PTERBs with the same frequency act like a single Active Transformer.",
4041
"tooltip.pterb_machine.purpose": "Wireless Active Transformer (PTERB)",

src/main/java/net/neganote/gtutilities/common/item/OmniBreakerItem.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public void appendHoverText(@NotNull ItemStack stack, @Nullable Level level,
8484
tooltipComponents.add(Component.translatable("tooltip.omnibreaker.charge_status",
8585
Component.translatable(FormattingUtil.formatNumbers(charge)).withStyle(ChatFormatting.GREEN),
8686
Component.translatable(FormattingUtil.formatNumbers(maxCharge)).withStyle(ChatFormatting.YELLOW)));
87+
tooltipComponents.add(Component.translatable("tooltip.omnibreaker.modern_vajra"));
8788
tooltipComponents
8889
.add(Component.translatable("tooltip.omnibreaker.can_break_anything").withStyle(ChatFormatting.GRAY));
8990
tooltipComponents

src/main/java/net/neganote/gtutilities/common/machine/multiblock/PTERBMachine.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public class PTERBMachine extends WorkableElectricMultiblockMachine
7272
@DescSynced
7373
private BlockPos coolantHatchPos;
7474

75-
private long coolantDrain;
75+
@Getter
76+
private int coolantDrain;
7677

7778
@Persisted
7879
@DescSynced
@@ -108,7 +109,7 @@ public void convertEnergyTick() {
108109
FluidStack coolant = coolantHatch.tank.getFluidInTank(0);
109110
if (coolant.getFluid() == UtilMaterials.QuantumCoolant.getFluid() && coolant.getAmount() >= coolantDrain) {
110111
coolantHatch.tank.handleRecipe(IO.IN, null,
111-
List.of(FluidIngredient.of((int) coolantDrain, UtilMaterials.QuantumCoolant.getFluid())), null,
112+
List.of(FluidIngredient.of(coolantDrain, UtilMaterials.QuantumCoolant.getFluid())), null,
112113
false);
113114
} else {
114115
if (!ConfigHolder.INSTANCE.machines.harmlessActiveTransformers) {
@@ -138,7 +139,7 @@ public void convertEnergyTick() {
138139
converterSubscription.updateSubscription();
139140
}
140141

141-
private long calculateCoolantDrain() {
142+
private int calculateCoolantDrain() {
142143
long inputAmperage = 0;
143144
long inputVoltage = 0;
144145
long outputAmperage = 0;
@@ -158,7 +159,7 @@ private long calculateCoolantDrain() {
158159

159160
long scalingFactor = Math.max(inputAmperage * inputVoltage, outputAmperage * outputVoltage);
160161
return UtilConfig.INSTANCE.features.pterbCoolantBaseDrain +
161-
(long) (scalingFactor * UtilConfig.INSTANCE.features.pterbCoolantIOMultiplier);
162+
(int) (scalingFactor * UtilConfig.INSTANCE.features.pterbCoolantIOMultiplier);
162163
}
163164

164165
@SuppressWarnings("RedundantIfStatement") // It is cleaner to have the final return true separate.
@@ -280,7 +281,7 @@ public static TraceabilityPredicate getHatchPredicates() {
280281
.or(abilities(PartAbility.SUBSTATION_OUTPUT_ENERGY).setPreviewCount(1))
281282
.or(abilities(PartAbility.INPUT_LASER).setPreviewCount(1))
282283
.or(abilities(PartAbility.OUTPUT_LASER).setPreviewCount(1))
283-
.or(abilities(PartAbility.IMPORT_FLUIDS).setMinGlobalLimited(1)) :
284+
.or(abilities(PartAbility.IMPORT_FLUIDS).setExactLimit(1)) :
284285
abilities(PartAbility.INPUT_ENERGY).setPreviewCount(1)
285286
.or(abilities(PartAbility.OUTPUT_ENERGY).setPreviewCount(2))
286287
.or(abilities(PartAbility.SUBSTATION_INPUT_ENERGY).setPreviewCount(1))

src/main/java/net/neganote/gtutilities/config/UtilConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static class FeatureConfigs {
6060
}
6161

6262
public static boolean coolantEnabled() {
63-
return UtilConfig.INSTANCE.features.pterbCoolantBaseDrain != 0 &&
63+
return UtilConfig.INSTANCE.features.pterbCoolantBaseDrain != 0 ||
6464
UtilConfig.INSTANCE.features.pterbCoolantIOMultiplier != 0.0f;
6565
}
6666
}

src/main/java/net/neganote/gtutilities/datagen/lang/UtilLangHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public static void init(RegistrateLangProvider provider) {
1717
provider.add("tooltip.omnibreaker.can_break_anything", "The Omni-breaker can insta-mine ANYTHING!");
1818
provider.add("tooltip.omnibreaker.charge_status", "Energy: %s EU / %s EU");
1919
provider.add("tooltip.omnibreaker.right_click_function", "Break individual blocks with right-click!");
20+
provider.add("tooltip.omnibreaker.modern_vajra", "A Modern Vajra");
2021

2122
provider.add("tooltip.pterb_machine.uses_coolant", "Drains %s to function!");
2223

@@ -30,7 +31,7 @@ public static void init(RegistrateLangProvider provider) {
3031
"All PTERBs with the same frequency act like a single Active Transformer.");
3132
provider.add("gtmutils.pterb.current_frequency", "Current frequency: %s");
3233

33-
provider.add("config.jade.plugin_gtmutils.frequency_info", "PTERB Frequency Info");
34+
provider.add("config.jade.plugin_gtmutils.pterb_info", "PTERB Info");
3435

3536
dfs(provider, new HashSet<>(), UtilConfig.CONFIG_HOLDER.getValueMap());
3637
}

src/main/java/net/neganote/gtutilities/integration/jade/UtilJadePlugin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import net.minecraft.world.level.block.Block;
44
import net.minecraft.world.level.block.entity.BlockEntity;
5-
import net.neganote.gtutilities.integration.jade.provider.PTERBFrequencyProvider;
5+
import net.neganote.gtutilities.integration.jade.provider.PTERBInformationProvider;
66

77
import snownee.jade.api.IWailaClientRegistration;
88
import snownee.jade.api.IWailaCommonRegistration;
@@ -15,11 +15,11 @@ public class UtilJadePlugin implements IWailaPlugin {
1515

1616
@Override
1717
public void register(IWailaCommonRegistration registration) {
18-
registration.registerBlockDataProvider(new PTERBFrequencyProvider(), BlockEntity.class);
18+
registration.registerBlockDataProvider(new PTERBInformationProvider(), BlockEntity.class);
1919
}
2020

2121
@Override
2222
public void registerClient(IWailaClientRegistration registration) {
23-
registration.registerBlockComponent(new PTERBFrequencyProvider(), Block.class);
23+
registration.registerBlockComponent(new PTERBInformationProvider(), Block.class);
2424
}
2525
}

src/main/java/net/neganote/gtutilities/integration/jade/provider/PTERBFrequencyProvider.java renamed to src/main/java/net/neganote/gtutilities/integration/jade/provider/PTERBInformationProvider.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,30 @@
1010
import net.neganote.gtutilities.GregTechModernUtilities;
1111
import net.neganote.gtutilities.common.machine.multiblock.PTERBMachine;
1212

13+
import net.neganote.gtutilities.common.materials.UtilMaterials;
14+
import net.neganote.gtutilities.config.UtilConfig;
1315
import snownee.jade.api.BlockAccessor;
1416
import snownee.jade.api.IBlockComponentProvider;
1517
import snownee.jade.api.IServerDataProvider;
1618
import snownee.jade.api.ITooltip;
1719
import snownee.jade.api.config.IPluginConfig;
1820

19-
public class PTERBFrequencyProvider implements IBlockComponentProvider, IServerDataProvider<BlockAccessor> {
21+
public class PTERBInformationProvider implements IBlockComponentProvider, IServerDataProvider<BlockAccessor> {
2022

2123
@Override
2224
public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) {
2325
BlockEntity be = blockAccessor.getBlockEntity();
24-
if (be instanceof MetaMachineBlockEntity mmbe && mmbe.getMetaMachine() instanceof PTERBMachine) {
26+
if (be instanceof MetaMachineBlockEntity mmbe && mmbe.getMetaMachine() instanceof PTERBMachine pterb) {
2527
CompoundTag data = blockAccessor.getServerData().getCompound(getUid().toString());
26-
if (data.contains("frequencyData")) {
27-
var tag = data.getCompound("frequencyData");
28+
if (data.contains("pterbData")) {
29+
var tag = data.getCompound("pterbData");
2830
iTooltip.add(Component.translatable("gtmutils.pterb.current_frequency",
2931
FormattingUtil.formatNumbers(tag.getInt("currentFrequency"))));
32+
if (tag.contains("coolantDrain") && UtilConfig.coolantEnabled() && pterb.isFormed()) {
33+
iTooltip.add(Component.translatable("gtmutils.multiblock.pterb_machine.coolant_usage",
34+
FormattingUtil.formatNumbers(tag.getInt("coolantDrain")),
35+
UtilMaterials.QuantumCoolant.getLocalizedName()));
36+
}
3037
}
3138
}
3239
}
@@ -36,15 +43,19 @@ public void appendServerData(CompoundTag compoundTag, BlockAccessor blockAccesso
3643
CompoundTag data = compoundTag.getCompound(getUid().toString());
3744
if (blockAccessor.getBlockEntity() instanceof MetaMachineBlockEntity mmbe &&
3845
mmbe.getMetaMachine() instanceof PTERBMachine pterb) {
39-
CompoundTag freqData = new CompoundTag();
40-
freqData.putInt("currentFrequency", pterb.getFrequency());
41-
data.put("frequencyData", freqData);
46+
CompoundTag pterbData = new CompoundTag();
47+
pterbData.putInt("currentFrequency", pterb.getFrequency());
48+
if (UtilConfig.coolantEnabled() && pterb.isFormed()) {
49+
int coolantDrain = pterb.getCoolantDrain();
50+
pterbData.putInt("coolantDrain", coolantDrain);
51+
}
52+
data.put("pterbData", pterbData);
4253
}
4354
compoundTag.put(getUid().toString(), data);
4455
}
4556

4657
@Override
4758
public ResourceLocation getUid() {
48-
return GregTechModernUtilities.id("frequency_info");
59+
return GregTechModernUtilities.id("pterb_info");
4960
}
5061
}

0 commit comments

Comments
 (0)