Special warning-toolip for when internet is disabled
This commit is contained in:
committed by
logan
parent
14f1c5caa0
commit
10013fd9e6
@@ -38,6 +38,7 @@ public final class Constants {
|
||||
public static final String TOOLTIP_ENERGY_CONSUMPTION = key("tooltip.{mod}.energyConsumption");
|
||||
public static final String TOOLTIP_CONFIRM = key("tooltip.{mod}.confirm");
|
||||
public static final String TOOLTIP_CANCEL = key("tooltip.{mod}.cancel");
|
||||
public static final String TOOLTIP_INTERNET_DISABLED = key("tooltip.{mod}.internet.disabled");
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@ import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import li.cil.oc2.api.bus.device.DeviceType;
|
||||
import li.cil.oc2.api.bus.device.provider.ItemDeviceQuery;
|
||||
import li.cil.oc2.common.Config;
|
||||
import li.cil.oc2.common.Constants;
|
||||
import li.cil.oc2.common.block.EnergyConsumingBlock;
|
||||
import li.cil.oc2.common.bus.device.util.Devices;
|
||||
import li.cil.oc2.common.capabilities.Capabilities;
|
||||
import li.cil.oc2.common.item.Items;
|
||||
import li.cil.oc2.common.tags.ItemTags;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -104,6 +106,12 @@ public final class TooltipUtils {
|
||||
final MutableComponent energy = withFormat(String.valueOf(energyConsumption), ChatFormatting.GREEN);
|
||||
tooltip.add(withFormat(Component.translatable(Constants.TOOLTIP_ENERGY_CONSUMPTION, energy), ChatFormatting.GRAY));
|
||||
}
|
||||
|
||||
if (!Config.internetCardEnabled) {
|
||||
if (stack.getItem() == Items.INTERNET_GATEWAY.get()) {
|
||||
tooltip.add(withFormat(new TranslatableComponent(Constants.TOOLTIP_INTERNET_DISABLED), ChatFormatting.RED));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void addBlockEntityInventoryInformation(final ItemStack stack, final List<Component> tooltip) {
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
"block.oc2.projector.desc": "Projects images onto surfaces in front of it.",
|
||||
"block.oc2.keyboard": "Keyboard",
|
||||
"block.oc2.keyboard.desc": "Allows keyboard input when using a projector.",
|
||||
"block.oc2.internet_gateway": "Internet Gateway",
|
||||
"block.oc2.internet_gateway.desc": "Gives access to the Internet.",
|
||||
|
||||
"item.oc2.wrench": "Scrench",
|
||||
"item.oc2.wrench.desc": "Configures devices and dismantles them (while sneaking).",
|
||||
@@ -151,6 +153,7 @@
|
||||
"tooltip.oc2.confirm": "Confirm",
|
||||
"tooltip.oc2.cancel": "Cancel",
|
||||
"tooltip.oc2.network_tunnel_id": "Tunnel: %s",
|
||||
"tooltip.oc2.internet.disabled": "Note that Internet access is currently disabled. It can be enabled in the mod config, but know that this is potentially unsafe. Make sure that you either thrust everyone you're playing with, or configure address whitelist properly.",
|
||||
|
||||
"subtitles.oc2.computer": "Computer fans running",
|
||||
"subtitles.oc2.floppy": "Floppy access",
|
||||
|
||||
Reference in New Issue
Block a user