Fix Server Crash
This commit is contained in:
parent
6ef2285ab6
commit
960bac8cc2
5 changed files with 31 additions and 31 deletions
|
@ -1,11 +1,11 @@
|
|||
package techreborn.client;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
@ -31,30 +31,30 @@ public class StackToolTipEvent
|
|||
int percentage = percentage(
|
||||
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack()),
|
||||
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack()));
|
||||
ChatFormatting color;
|
||||
TextFormatting color;
|
||||
if (percentage <= 10)
|
||||
{
|
||||
color = ChatFormatting.RED;
|
||||
color = TextFormatting.RED;
|
||||
} else if (percentage >= 75)
|
||||
{
|
||||
color = ChatFormatting.GREEN;
|
||||
color = TextFormatting.GREEN;
|
||||
} else
|
||||
{
|
||||
color = ChatFormatting.YELLOW;
|
||||
color = TextFormatting.YELLOW;
|
||||
}
|
||||
event.getToolTip().add(color + ""
|
||||
+ PowerSystem.getLocaliszedPower(
|
||||
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack()))
|
||||
+ ChatFormatting.LIGHT_PURPLE + " stored");
|
||||
+ TextFormatting.LIGHT_PURPLE + " stored");
|
||||
event.getToolTip().add(Color.GREEN + ""
|
||||
+ PowerSystem.getLocaliszedPower(
|
||||
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack()))
|
||||
+ ChatFormatting.LIGHT_PURPLE + " max");
|
||||
+ TextFormatting.LIGHT_PURPLE + " max");
|
||||
event.getToolTip()
|
||||
.add(ChatFormatting.GREEN + "" + percentage + "%" + ChatFormatting.LIGHT_PURPLE + " charged");
|
||||
.add(TextFormatting.GREEN + "" + percentage + "%" + TextFormatting.LIGHT_PURPLE + " charged");
|
||||
event.getToolTip().add(Color.GREEN + "" + PowerSystem.getLocaliszedPower(
|
||||
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxTransfer(event.getItemStack()))
|
||||
+ ChatFormatting.LIGHT_PURPLE + " /tick in/out");
|
||||
+ TextFormatting.LIGHT_PURPLE + " /tick in/out");
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package techreborn.items;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -10,6 +9,7 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
@ -43,14 +43,14 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
|
|||
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat)
|
||||
{
|
||||
ChatUtils.sendNoSpamClient(new TextComponentString(
|
||||
ChatFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " X: " +
|
||||
ChatFormatting.GOLD + pos.getX() +
|
||||
ChatFormatting.GRAY + " Y: " +
|
||||
ChatFormatting.GOLD + pos.getY() +
|
||||
ChatFormatting.GRAY + " Z: " +
|
||||
ChatFormatting.GOLD + pos.getZ() +
|
||||
ChatFormatting.GRAY + " " + I18n.translateToLocal("techreborn.message.in") + " " +
|
||||
ChatFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension()).getName() + " ("+world.provider.getDimension()+")"));
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " X: " +
|
||||
TextFormatting.GOLD + pos.getX() +
|
||||
TextFormatting.GRAY + " Y: " +
|
||||
TextFormatting.GOLD + pos.getY() +
|
||||
TextFormatting.GRAY + " Z: " +
|
||||
TextFormatting.GOLD + pos.getZ() +
|
||||
TextFormatting.GRAY + " " + I18n.translateToLocal("techreborn.message.in") + " " +
|
||||
TextFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension()).getName() + " ("+world.provider.getDimension()+")"));
|
||||
}
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
@ -69,11 +69,11 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
|
|||
list.add("X: " + x);
|
||||
list.add("Y: " + y);
|
||||
list.add("X: " + z);
|
||||
list.add(ChatFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
|
||||
list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
|
||||
|
||||
} else
|
||||
{
|
||||
list.add(ChatFormatting.GRAY + "No Coordinates Set");
|
||||
list.add(TextFormatting.GRAY + "No Coordinates Set");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package techreborn.parts.fluidPipes;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 09/05/2016.
|
||||
|
@ -9,17 +9,17 @@ import net.minecraft.util.IStringSerializable;
|
|||
public enum EnumFluidPipeTypes implements IStringSerializable
|
||||
{
|
||||
|
||||
EMPTY("empty", "techreborn:blocks/fluidPipes/fluidpipe", false, false, ChatFormatting.DARK_GRAY),
|
||||
INSERT("insert", "techreborn:blocks/fluidPipes/fluidpipe_insert", false, true, ChatFormatting.BLUE),
|
||||
EXTRACT("extract", "techreborn:blocks/fluidPipes/fluidpipe_extract", true, false, ChatFormatting.GOLD);
|
||||
EMPTY("empty", "techreborn:blocks/fluidPipes/fluidpipe", false, false, TextFormatting.DARK_GRAY),
|
||||
INSERT("insert", "techreborn:blocks/fluidPipes/fluidpipe_insert", false, true, TextFormatting.BLUE),
|
||||
EXTRACT("extract", "techreborn:blocks/fluidPipes/fluidpipe_extract", true, false, TextFormatting.GOLD);
|
||||
|
||||
public String textureName = "minecraft:blocks/iron_block";
|
||||
public boolean extract = false;
|
||||
public boolean insert = false;
|
||||
public ChatFormatting colour = ChatFormatting.WHITE;
|
||||
public TextFormatting colour = TextFormatting.WHITE;
|
||||
private String name;
|
||||
|
||||
EnumFluidPipeTypes(String name, String textureName, boolean extract, boolean insert, ChatFormatting colour)
|
||||
EnumFluidPipeTypes(String name, String textureName, boolean extract, boolean insert, TextFormatting colour)
|
||||
{
|
||||
this.name = name;
|
||||
this.textureName = textureName;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
|
@ -44,9 +44,9 @@ public class TilePump extends TilePowerAcceptor implements IFluidHandler {
|
|||
@Override
|
||||
public void addInfo(List<String> info, boolean isRealTile) {
|
||||
super.addInfo(info, isRealTile);
|
||||
info.add(ChatFormatting.LIGHT_PURPLE + "Eu per extract " + ChatFormatting.GREEN
|
||||
info.add(TextFormatting.LIGHT_PURPLE + "Eu per extract " + TextFormatting.GREEN
|
||||
+ PowerSystem.getLocaliszedPower(ConfigTechReborn.pumpExtractEU));
|
||||
info.add(ChatFormatting.LIGHT_PURPLE + "Speed: " + ChatFormatting.GREEN
|
||||
info.add(TextFormatting.LIGHT_PURPLE + "Speed: " + TextFormatting.GREEN
|
||||
+ "1000mb/5 sec");
|
||||
}
|
||||
|
||||
|
|
|
@ -55,8 +55,8 @@ public class TileSolarPanel extends TilePowerAcceptor implements ITickable
|
|||
if (isRealTile)
|
||||
{
|
||||
// FIXME: 25/02/2016
|
||||
// info.add(ChatFormatting.LIGHT_PURPLE + "Power gen/tick " +
|
||||
// ChatFormatting.GREEN + PowerSystem.getLocaliszedPower(
|
||||
// info.add(TextFormatting.LIGHT_PURPLE + "Power gen/tick " +
|
||||
// TextFormatting.GREEN + PowerSystem.getLocaliszedPower(
|
||||
// powerToAdd)) ;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue