Run formatter

This commit is contained in:
Nicholas Ignoffo 2017-08-15 21:30:48 -07:00
parent 61c44a831b
commit 08258fd6ef
606 changed files with 13464 additions and 22975 deletions

View file

@ -9,47 +9,38 @@ import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
public class KeyProcessor implements IMessage, IMessageHandler<KeyProcessor, IMessage>
{
public class KeyProcessor implements IMessage, IMessageHandler<KeyProcessor, IMessage> {
public int keyId;
public boolean showInChat;
public KeyProcessor()
{
public KeyProcessor() {
}
public KeyProcessor(KeyBindings key, boolean showInChat)
{
public KeyProcessor(KeyBindings key, boolean showInChat) {
this.keyId = key.ordinal();
this.showInChat = showInChat;
}
@Override
public void fromBytes(ByteBuf buf)
{
public void fromBytes(ByteBuf buf) {
this.keyId = buf.readInt();
this.showInChat = buf.readBoolean();
}
@Override
public void toBytes(ByteBuf buf)
{
public void toBytes(ByteBuf buf) {
buf.writeInt(this.keyId);
buf.writeBoolean(this.showInChat);
}
@Override
public IMessage onMessage(KeyProcessor msg, MessageContext ctx)
{
public IMessage onMessage(KeyProcessor msg, MessageContext ctx) {
EntityPlayer entityPlayer = ctx.getServerHandler().player;
if (entityPlayer != null)
{
if (entityPlayer != null) {
ItemStack heldStack = entityPlayer.getHeldItemMainhand();
if (heldStack.getItem() instanceof IKeybindable)
{
if (msg.keyId < 0 || msg.keyId >= KeyBindings.values().length)
{
if (heldStack.getItem() instanceof IKeybindable) {
if (msg.keyId < 0 || msg.keyId >= KeyBindings.values().length) {
return null;
}
KeyBindings key = KeyBindings.values()[msg.keyId];