diff --git a/src/main/java/com/minelittlepony/unicopia/Race.java b/src/main/java/com/minelittlepony/unicopia/Race.java index d17c57a4..26e7d7fe 100644 --- a/src/main/java/com/minelittlepony/unicopia/Race.java +++ b/src/main/java/com/minelittlepony/unicopia/Race.java @@ -6,7 +6,6 @@ import java.util.Map; import com.google.common.base.Strings; import com.minelittlepony.pony.data.PonyRace; -import net.minecraft.client.resources.I18n; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -59,18 +58,13 @@ public enum Race { return canFly() && this != CHANGELING; } - public String getDisplayString() { - return I18n.format(getTranslationString()); - } - - public String getTranslationString() { + public String getTranslationKey() { return String.format("unicopia.race.%s", name().toLowerCase()); } public boolean isSameAs(String s) { return name().equalsIgnoreCase(s) - || getTranslationString().equalsIgnoreCase(s) - || getDisplayString().equalsIgnoreCase(s); + || getTranslationKey().equalsIgnoreCase(s); } public static Race fromName(String s, Race def) { diff --git a/src/main/java/com/minelittlepony/unicopia/UClient.java b/src/main/java/com/minelittlepony/unicopia/UClient.java index d4633a3c..38137afb 100644 --- a/src/main/java/com/minelittlepony/unicopia/UClient.java +++ b/src/main/java/com/minelittlepony/unicopia/UClient.java @@ -1,5 +1,7 @@ package com.minelittlepony.unicopia; +import java.util.UUID; + import javax.annotation.Nullable; import com.minelittlepony.unicopia.forgebullshit.FUF; @@ -43,6 +45,12 @@ public class UClient { return null; } + @FUF(reason = "Forced client Separation") + @Nullable + public EntityPlayer getPlayerByUUID(UUID playerId) { + return null; + } + @FUF(reason = "Forced client Separation") public boolean isClientPlayer(@Nullable EntityPlayer player) { return false; diff --git a/src/main/java/com/minelittlepony/unicopia/UnicopiaClient.java b/src/main/java/com/minelittlepony/unicopia/UnicopiaClient.java index 6d931ed7..569f2085 100644 --- a/src/main/java/com/minelittlepony/unicopia/UnicopiaClient.java +++ b/src/main/java/com/minelittlepony/unicopia/UnicopiaClient.java @@ -1,5 +1,7 @@ package com.minelittlepony.unicopia; +import java.util.UUID; + import javax.annotation.Nullable; import com.minelittlepony.jumpingcastle.api.Target; @@ -69,11 +71,24 @@ public class UnicopiaClient extends UClient { } } + @Override @Nullable public EntityPlayer getPlayer() { return Minecraft.getMinecraft().player; } + @Override + @Nullable + public EntityPlayer getPlayerByUUID(UUID playerId) { + Minecraft mc = Minecraft.getMinecraft(); + + if (mc.player.getUniqueID().equals(playerId)) { + return mc.player; + } + + return mc.world.getPlayerEntityByUUID(playerId); + } + @Override public boolean isClientPlayer(@Nullable EntityPlayer player) { if (getPlayer() == player) { diff --git a/src/main/java/com/minelittlepony/unicopia/command/CommandSpecies.java b/src/main/java/com/minelittlepony/unicopia/command/CommandSpecies.java index 2621e319..b4f627c0 100644 --- a/src/main/java/com/minelittlepony/unicopia/command/CommandSpecies.java +++ b/src/main/java/com/minelittlepony/unicopia/command/CommandSpecies.java @@ -91,7 +91,7 @@ class CommandSpecies extends CommandBase { String name = "commands.race.tell."; name += player == sender ? "self" : "other"; - ITextComponent race = new TextComponentTranslation(spec.getTranslationString()); + ITextComponent race = new TextComponentTranslation(spec.getTranslationKey()); ITextComponent message = new TextComponentTranslation(name); race.getStyle().setColor(TextFormatting.GOLD); diff --git a/src/main/java/com/minelittlepony/unicopia/edibles/Toxicity.java b/src/main/java/com/minelittlepony/unicopia/edibles/Toxicity.java index d256b582..7928ec17 100644 --- a/src/main/java/com/minelittlepony/unicopia/edibles/Toxicity.java +++ b/src/main/java/com/minelittlepony/unicopia/edibles/Toxicity.java @@ -4,6 +4,8 @@ import net.minecraft.client.resources.I18n; import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public enum Toxicity { SAFE(0, 0), @@ -46,6 +48,7 @@ public enum Toxicity { return String.format("toxicity.%s.name", name().toLowerCase()); } + @SideOnly(Side.CLIENT) public String getTooltip() { TextFormatting color = toxicWhenCooked() ? TextFormatting.RED : toxicWhenRaw() ? TextFormatting.DARK_PURPLE : TextFormatting.GRAY; diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerCapabilities.java b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerCapabilities.java index 9f4829e9..776f8541 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerCapabilities.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerCapabilities.java @@ -12,6 +12,7 @@ import com.minelittlepony.jumpingcastle.api.IChannel; import com.minelittlepony.jumpingcastle.api.IMessage; import com.minelittlepony.jumpingcastle.api.IMessageHandler; import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.UClient; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.player.IPlayer; import com.minelittlepony.unicopia.player.PlayerSpeciesList; @@ -53,7 +54,7 @@ public class MsgPlayerCapabilities implements IMessage, IMessageHandler, IRaceContainer 1) || player.distanceWalkedOnStepModified > nextStepDistance) { + if (player.fallDistance > 1 || player.distanceWalkedOnStepModified > nextStepDistance) { nextStepDistance = player.distanceWalkedOnStepModified + 2; player.fallDistance = 0;