Skip to content

Commit 9646d3a

Browse files
authored
Add terrain resist tooltips to multiblocks (#2620)
1 parent 3e35cc9 commit 9646d3a

File tree

7 files changed

+9
-27
lines changed

7 files changed

+9
-27
lines changed

src/main/java/gregtech/api/metatileentity/MetaTileEntity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@ public void addDebugInfo(List<String> list) {}
235235

236236
@SideOnly(Side.CLIENT)
237237
public void addInformation(ItemStack stack, @Nullable World world, @NotNull List<String> tooltip,
238-
boolean advanced) {}
238+
boolean advanced) {
239+
if (ConfigHolder.machines.doTerrainExplosion && getIsWeatherOrTerrainResistant())
240+
tooltip.add(I18n.format("gregtech.universal.tooltip.terrain_resist"));
241+
}
239242

240243
/**
241244
* Override this to add extended tool information to the "Hold SHIFT to show Tool Info" tooltip section.

src/main/java/gregtech/api/metatileentity/TieredMetaTileEntity.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
import gregtech.api.util.GTUtility;
88
import gregtech.client.renderer.texture.Textures;
99
import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer;
10-
import gregtech.common.ConfigHolder;
1110

1211
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
13-
import net.minecraft.client.resources.I18n;
14-
import net.minecraft.item.ItemStack;
1512
import net.minecraft.util.ResourceLocation;
16-
import net.minecraft.world.World;
1713
import net.minecraftforge.fml.relauncher.Side;
1814
import net.minecraftforge.fml.relauncher.SideOnly;
1915

@@ -23,10 +19,6 @@
2319
import codechicken.lib.vec.Matrix4;
2420
import org.apache.commons.lang3.ArrayUtils;
2521
import org.apache.commons.lang3.tuple.Pair;
26-
import org.jetbrains.annotations.NotNull;
27-
import org.jetbrains.annotations.Nullable;
28-
29-
import java.util.List;
3022

3123
public abstract class TieredMetaTileEntity extends MetaTileEntity
3224
implements IEnergyChangeListener, ITieredMetaTileEntity {
@@ -57,14 +49,6 @@ protected SimpleSidedCubeRenderer getBaseRenderer() {
5749
return Textures.VOLTAGE_CASINGS[tier];
5850
}
5951

60-
@Override
61-
public void addInformation(ItemStack stack, @Nullable World player, @NotNull List<String> tooltip,
62-
boolean advanced) {
63-
super.addInformation(stack, player, tooltip, advanced);
64-
if (ConfigHolder.machines.doTerrainExplosion && getIsWeatherOrTerrainResistant())
65-
tooltip.add(I18n.format("gregtech.universal.tooltip.terrain_resist"));
66-
}
67-
6852
@Override
6953
@SideOnly(Side.CLIENT)
7054
public Pair<TextureAtlasSprite, Integer> getParticleTexture() {

src/main/java/gregtech/common/metatileentities/electric/MetaTileEntityBlockBreaker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ public boolean getIsWeatherOrTerrainResistant() {
270270

271271
@Override
272272
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, boolean advanced) {
273+
super.addInformation(stack, player, tooltip, advanced);
273274
tooltip.add(I18n.format("gregtech.machine.block_breaker.tooltip"));
274275
tooltip.add(I18n.format("gregtech.universal.tooltip.uses_per_op", getEnergyPerBlockBreak()));
275276
tooltip.add(I18n.format("gregtech.universal.tooltip.voltage_in", energyContainer.getInputVoltage(),
@@ -279,7 +280,6 @@ public void addInformation(ItemStack stack, @Nullable World player, List<String>
279280
tooltip.add(I18n.format("gregtech.universal.tooltip.item_storage_capacity", getInventorySize()));
280281
tooltip.add(I18n.format("gregtech.machine.block_breaker.speed_bonus", (int) (getEfficiencyMultiplier() * 100)));
281282
tooltip.add(I18n.format("gregtech.universal.tooltip.requires_redstone"));
282-
super.addInformation(stack, player, tooltip, advanced);
283283
}
284284

285285
@Override

src/main/java/gregtech/common/metatileentities/electric/MetaTileEntityFisher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation,
142142

143143
@Override
144144
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, boolean advanced) {
145+
super.addInformation(stack, player, tooltip, advanced);
145146
tooltip.add(I18n.format("gregtech.machine.fisher.tooltip"));
146147
tooltip.add(I18n.format("gregtech.machine.fisher.speed", fishingTicks));
147148
tooltip.add(I18n.format("gregtech.machine.fisher.requirement", (int) Math.sqrt(WATER_CHECK_SIZE),
@@ -150,7 +151,6 @@ public void addInformation(ItemStack stack, @Nullable World player, List<String>
150151
GTValues.VNF[getTier()]));
151152
tooltip.add(
152153
I18n.format("gregtech.universal.tooltip.energy_storage_capacity", energyContainer.getEnergyCapacity()));
153-
super.addInformation(stack, player, tooltip, advanced);
154154
}
155155

156156
@Override

src/main/java/gregtech/common/metatileentities/electric/MetaTileEntityPump.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
1212
import gregtech.api.util.GTUtility;
1313
import gregtech.client.renderer.texture.Textures;
14-
import gregtech.common.ConfigHolder;
1514

1615
import net.minecraft.block.BlockLiquid;
1716
import net.minecraft.block.state.IBlockState;
@@ -398,9 +397,8 @@ public void readFromNBT(NBTTagCompound data) {
398397

399398
@Override
400399
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, boolean advanced) {
400+
super.addInformation(stack, player, tooltip, advanced);
401401
tooltip.add(I18n.format("gregtech.machine.pump.tooltip"));
402-
if (ConfigHolder.machines.doTerrainExplosion)
403-
tooltip.add(I18n.format("gregtech.universal.tooltip.terrain_resist"));
404402
tooltip.add(
405403
I18n.format("gregtech.universal.tooltip.uses_per_op", GTValues.V[getTier()] * 2) + TextFormatting.GRAY +
406404
", " + I18n.format("gregtech.machine.pump.tooltip_buckets", getPumpingCycleLength()));

src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityLongDistanceEndpoint.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import gregtech.api.pipenet.longdist.ILDEndpoint;
66
import gregtech.api.pipenet.longdist.LongDistanceNetwork;
77
import gregtech.api.pipenet.longdist.LongDistancePipeType;
8-
import gregtech.common.ConfigHolder;
98

109
import net.minecraft.client.resources.I18n;
1110
import net.minecraft.entity.player.EntityPlayer;
@@ -213,15 +212,13 @@ protected boolean openGUIOnRightClick() {
213212
@Override
214213
public void addInformation(ItemStack stack, @Nullable World player, @NotNull List<String> tooltip,
215214
boolean advanced) {
215+
super.addInformation(stack, player, tooltip, advanced);
216216
tooltip.add(I18n.format("gregtech.machine.endpoint.tooltip.1"));
217217
tooltip.add(I18n.format("gregtech.machine.endpoint.tooltip.2"));
218218
tooltip.add(I18n.format("gregtech.machine.endpoint.tooltip.3"));
219219
if (pipeType.getMinLength() > 0) {
220220
tooltip.add(I18n.format("gregtech.machine.endpoint.tooltip.min_length", pipeType.getMinLength()));
221221
}
222-
if (ConfigHolder.machines.doTerrainExplosion && getIsWeatherOrTerrainResistant()) {
223-
tooltip.add(I18n.format("gregtech.universal.tooltip.terrain_resist"));
224-
}
225222
}
226223

227224
@Override

src/main/resources/assets/gregtech/lang/en_us.lang

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5420,7 +5420,7 @@ gregtech.universal.tooltip.uses_per_op=Uses §f%,d EU/operation
54205420
gregtech.universal.tooltip.base_production_eut=§eBase Production: §f%,d EU/t
54215421
gregtech.universal.tooltip.base_production_fluid=§eBase Production: §f%,d L/t
54225422
gregtech.universal.tooltip.produces_fluid=§eProduces: §f%,d L/t
5423-
gregtech.universal.tooltip.terrain_resist=This Machine will not explode when exposed to the Elements
5423+
gregtech.universal.tooltip.terrain_resist=§eThis Machine will not explode when exposed to the Elements
54245424
gregtech.universal.tooltip.requires_redstone=§4Requires Redstone power
54255425

54265426
gregtech.block.tooltip.no_mob_spawning=§bMobs cannot spawn on this block

0 commit comments

Comments
 (0)