Fix Server Crash

This commit is contained in:
modmuss50 2016-05-13 07:46:17 +01:00
parent 6ef2285ab6
commit 960bac8cc2
5 changed files with 31 additions and 31 deletions

View file

@ -1,11 +1,11 @@
package techreborn.client; package techreborn.client;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.ITileEntityProvider;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
@ -31,30 +31,30 @@ public class StackToolTipEvent
int percentage = percentage( int percentage = percentage(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack()), (int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack()),
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack())); (int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack()));
ChatFormatting color; TextFormatting color;
if (percentage <= 10) if (percentage <= 10)
{ {
color = ChatFormatting.RED; color = TextFormatting.RED;
} else if (percentage >= 75) } else if (percentage >= 75)
{ {
color = ChatFormatting.GREEN; color = TextFormatting.GREEN;
} else } else
{ {
color = ChatFormatting.YELLOW; color = TextFormatting.YELLOW;
} }
event.getToolTip().add(color + "" event.getToolTip().add(color + ""
+ PowerSystem.getLocaliszedPower( + PowerSystem.getLocaliszedPower(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack())) (int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack()))
+ ChatFormatting.LIGHT_PURPLE + " stored"); + TextFormatting.LIGHT_PURPLE + " stored");
event.getToolTip().add(Color.GREEN + "" event.getToolTip().add(Color.GREEN + ""
+ PowerSystem.getLocaliszedPower( + PowerSystem.getLocaliszedPower(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack())) (int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack()))
+ ChatFormatting.LIGHT_PURPLE + " max"); + TextFormatting.LIGHT_PURPLE + " max");
event.getToolTip() 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( event.getToolTip().add(Color.GREEN + "" + PowerSystem.getLocaliszedPower(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxTransfer(event.getItemStack())) (int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxTransfer(event.getItemStack()))
+ ChatFormatting.LIGHT_PURPLE + " /tick in/out"); + TextFormatting.LIGHT_PURPLE + " /tick in/out");
} }
} else } else
{ {

View file

@ -1,6 +1,5 @@
package techreborn.items; package techreborn.items;
import com.mojang.realmsclient.gui.ChatFormatting;
import me.modmuss50.jsonDestroyer.api.ITexturedItem; import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -10,6 +9,7 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
@ -43,14 +43,14 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat) if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat)
{ {
ChatUtils.sendNoSpamClient(new TextComponentString( ChatUtils.sendNoSpamClient(new TextComponentString(
ChatFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " X: " + TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " X: " +
ChatFormatting.GOLD + pos.getX() + TextFormatting.GOLD + pos.getX() +
ChatFormatting.GRAY + " Y: " + TextFormatting.GRAY + " Y: " +
ChatFormatting.GOLD + pos.getY() + TextFormatting.GOLD + pos.getY() +
ChatFormatting.GRAY + " Z: " + TextFormatting.GRAY + " Z: " +
ChatFormatting.GOLD + pos.getZ() + TextFormatting.GOLD + pos.getZ() +
ChatFormatting.GRAY + " " + I18n.translateToLocal("techreborn.message.in") + " " + TextFormatting.GRAY + " " + I18n.translateToLocal("techreborn.message.in") + " " +
ChatFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension()).getName() + " ("+world.provider.getDimension()+")")); TextFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension()).getName() + " ("+world.provider.getDimension()+")"));
} }
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
@ -69,11 +69,11 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
list.add("X: " + x); list.add("X: " + x);
list.add("Y: " + y); list.add("Y: " + y);
list.add("X: " + z); list.add("X: " + z);
list.add(ChatFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName()); list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
} else } else
{ {
list.add(ChatFormatting.GRAY + "No Coordinates Set"); list.add(TextFormatting.GRAY + "No Coordinates Set");
} }
} }
} }

View file

@ -1,7 +1,7 @@
package techreborn.parts.fluidPipes; package techreborn.parts.fluidPipes;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.IStringSerializable;
import net.minecraft.util.text.TextFormatting;
/** /**
* Created by modmuss50 on 09/05/2016. * Created by modmuss50 on 09/05/2016.
@ -9,17 +9,17 @@ import net.minecraft.util.IStringSerializable;
public enum EnumFluidPipeTypes implements IStringSerializable public enum EnumFluidPipeTypes implements IStringSerializable
{ {
EMPTY("empty", "techreborn:blocks/fluidPipes/fluidpipe", false, false, ChatFormatting.DARK_GRAY), EMPTY("empty", "techreborn:blocks/fluidPipes/fluidpipe", false, false, TextFormatting.DARK_GRAY),
INSERT("insert", "techreborn:blocks/fluidPipes/fluidpipe_insert", false, true, ChatFormatting.BLUE), INSERT("insert", "techreborn:blocks/fluidPipes/fluidpipe_insert", false, true, TextFormatting.BLUE),
EXTRACT("extract", "techreborn:blocks/fluidPipes/fluidpipe_extract", true, false, ChatFormatting.GOLD); EXTRACT("extract", "techreborn:blocks/fluidPipes/fluidpipe_extract", true, false, TextFormatting.GOLD);
public String textureName = "minecraft:blocks/iron_block"; public String textureName = "minecraft:blocks/iron_block";
public boolean extract = false; public boolean extract = false;
public boolean insert = false; public boolean insert = false;
public ChatFormatting colour = ChatFormatting.WHITE; public TextFormatting colour = TextFormatting.WHITE;
private String name; 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.name = name;
this.textureName = textureName; this.textureName = textureName;

View file

@ -1,12 +1,12 @@
package techreborn.tiles; package techreborn.tiles;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid; import net.minecraft.block.BlockLiquid;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fluids.*; import net.minecraftforge.fluids.*;
import reborncore.api.power.EnumPowerTier; import reborncore.api.power.EnumPowerTier;
@ -44,9 +44,9 @@ public class TilePump extends TilePowerAcceptor implements IFluidHandler {
@Override @Override
public void addInfo(List<String> info, boolean isRealTile) { public void addInfo(List<String> info, boolean isRealTile) {
super.addInfo(info, 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)); + PowerSystem.getLocaliszedPower(ConfigTechReborn.pumpExtractEU));
info.add(ChatFormatting.LIGHT_PURPLE + "Speed: " + ChatFormatting.GREEN info.add(TextFormatting.LIGHT_PURPLE + "Speed: " + TextFormatting.GREEN
+ "1000mb/5 sec"); + "1000mb/5 sec");
} }

View file

@ -55,8 +55,8 @@ public class TileSolarPanel extends TilePowerAcceptor implements ITickable
if (isRealTile) if (isRealTile)
{ {
// FIXME: 25/02/2016 // FIXME: 25/02/2016
// info.add(ChatFormatting.LIGHT_PURPLE + "Power gen/tick " + // info.add(TextFormatting.LIGHT_PURPLE + "Power gen/tick " +
// ChatFormatting.GREEN + PowerSystem.getLocaliszedPower( // TextFormatting.GREEN + PowerSystem.getLocaliszedPower(
// powerToAdd)) ; // powerToAdd)) ;
} }
} }