More config changes
This commit is contained in:
parent
0cf3e43992
commit
b7e141e004
13 changed files with 68 additions and 254 deletions
|
@ -42,7 +42,6 @@ import reborncore.client.hud.StackInfoElement;
|
|||
import reborncore.common.util.ChatUtils;
|
||||
import reborncore.common.util.Color;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.lib.MessageIDs;
|
||||
|
||||
|
@ -80,7 +79,7 @@ public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
|||
stack.getTagCompound().setInteger("z", pos.getZ());
|
||||
stack.getTagCompound().setInteger("dim", world.provider.getDimension());
|
||||
|
||||
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat) {
|
||||
if (!world.isRemote) {
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " X: " +
|
||||
TextFormatting.GOLD + pos.getX() +
|
||||
|
@ -101,7 +100,7 @@ public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
|||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (player.isSneaking()) {
|
||||
stack.setTagCompound(null);
|
||||
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat) {
|
||||
if (!world.isRemote) {
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.coordsHaveBeen") + " "
|
||||
+ TextFormatting.GOLD + I18n.translateToLocal("techreborn.message.cleared")));
|
||||
|
@ -112,21 +111,19 @@ public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
|||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
if (ConfigTechReborn.FreqTransmitterTooltip) {
|
||||
if (stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) {
|
||||
int x = stack.getTagCompound().getInteger("x");
|
||||
int y = stack.getTagCompound().getInteger("y");
|
||||
int z = stack.getTagCompound().getInteger("z");
|
||||
int dim = stack.getTagCompound().getInteger("dim");
|
||||
if (stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) {
|
||||
int x = stack.getTagCompound().getInteger("x");
|
||||
int y = stack.getTagCompound().getInteger("y");
|
||||
int z = stack.getTagCompound().getInteger("z");
|
||||
int dim = stack.getTagCompound().getInteger("dim");
|
||||
|
||||
list.add(TextFormatting.GRAY + "X: " + TextFormatting.GOLD + x);
|
||||
list.add(TextFormatting.GRAY + "Y: " + TextFormatting.GOLD + y);
|
||||
list.add(TextFormatting.GRAY + "Z: " + TextFormatting.GOLD + z);
|
||||
list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
|
||||
list.add(TextFormatting.GRAY + "X: " + TextFormatting.GOLD + x);
|
||||
list.add(TextFormatting.GRAY + "Y: " + TextFormatting.GOLD + y);
|
||||
list.add(TextFormatting.GRAY + "Z: " + TextFormatting.GOLD + z);
|
||||
list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
|
||||
|
||||
} else {
|
||||
list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.noCoordsSet"));
|
||||
}
|
||||
} else {
|
||||
list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.noCoordsSet"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,12 +35,20 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.api.power.IEnergyItemInfo;
|
||||
import reborncore.common.powerSystem.PoweredItem;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemTRNoDestroy;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class ItemCloakingDevice extends ItemTRNoDestroy implements IEnergyItemInfo {
|
||||
|
||||
@ConfigRegistry(config = "items", category = "cloacking_device", key = "ClockingDeviceEnergyUsage", comment = "Cloacking device energy usesage (Value in EU)")
|
||||
public static int usage = 10;
|
||||
|
||||
public static int MaxCharge = ConfigTechReborn.CloakingDeviceCharge;
|
||||
public static int Limit = 100;
|
||||
public static boolean isActive;
|
||||
|
@ -54,8 +62,8 @@ public class ItemCloakingDevice extends ItemTRNoDestroy implements IEnergyItemIn
|
|||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if (PoweredItem.canUseEnergy(ConfigTechReborn.CloakingDeviceEUTick, itemStack)) {
|
||||
PoweredItem.useEnergy(ConfigTechReborn.CloakingDeviceEUTick, itemStack);
|
||||
if (PoweredItem.canUseEnergy(usage, itemStack)) {
|
||||
PoweredItem.useEnergy(usage, itemStack);
|
||||
player.setInvisible(true);
|
||||
} else {
|
||||
if (!player.isPotionActive(MobEffects.INVISIBILITY)) {
|
||||
|
|
|
@ -48,7 +48,6 @@ import reborncore.api.power.IEnergyItemInfo;
|
|||
import reborncore.common.powerSystem.PoweredItem;
|
||||
import reborncore.common.util.ChatUtils;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.lib.MessageIDs;
|
||||
|
||||
|
@ -160,7 +159,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
|
|||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
stack.getTagCompound().setBoolean("isActive", true);
|
||||
if (world.isRemote && ConfigTechReborn.NanosaberChat) {
|
||||
if (world.isRemote) {
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " "
|
||||
+ TextFormatting.GOLD + I18n
|
||||
|
@ -168,7 +167,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
|
|||
}
|
||||
} else {
|
||||
stack.getTagCompound().setBoolean("isActive", false);
|
||||
if (world.isRemote && ConfigTechReborn.NanosaberChat) {
|
||||
if (world.isRemote) {
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " "
|
||||
+ TextFormatting.GOLD + I18n
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue