Fixed fps magic still running when at PonyLevel.HUMANS

This commit is contained in:
Sollace 2018-08-30 13:30:23 +02:00
parent e4a4de75b0
commit 402a394edc
4 changed files with 10 additions and 5 deletions

View file

@ -127,7 +127,7 @@ public class Pony {
} }
public PonyRace getRace(boolean ignorePony) { public PonyRace getRace(boolean ignorePony) {
return metadata.getRace().getEffectiveRace(MineLittlePony.getConfig().getEffectivePonyLevel(ignorePony)); return metadata.getRace().getEffectiveRace(ignorePony);
} }
public ResourceLocation getTexture() { public ResourceLocation getTexture() {

View file

@ -62,7 +62,7 @@ public class PonyData implements IPonyData {
@Override @Override
public PonySize getSize() { public PonySize getSize() {
return MineLittlePony.getConfig().sizes ? size : PonySize.NORMAL; return size.getEffectiveSize();
} }
@Override @Override
@ -72,7 +72,7 @@ public class PonyData implements IPonyData {
@Override @Override
public boolean hasMagic() { public boolean hasMagic() {
return race != null && getRace().hasHorn() && getGlowColor() != 0; return race != null && getRace().getEffectiveRace(false).hasHorn() && getGlowColor() != 0;
} }
@Override @Override

View file

@ -1,5 +1,6 @@
package com.minelittlepony.pony.data; package com.minelittlepony.pony.data;
import com.minelittlepony.MineLittlePony;
import com.minelittlepony.model.player.PlayerModels; import com.minelittlepony.model.player.PlayerModels;
public enum PonyRace implements ITriggerPixelMapped<PonyRace> { public enum PonyRace implements ITriggerPixelMapped<PonyRace> {
@ -67,8 +68,8 @@ public enum PonyRace implements ITriggerPixelMapped<PonyRace> {
* PonyLevel.BOTH is no change. * PonyLevel.BOTH is no change.
* PonyLevel.PONIES (should) return a pony if this is a human. Don't be fooled, though. It doesn't. * PonyLevel.PONIES (should) return a pony if this is a human. Don't be fooled, though. It doesn't.
*/ */
public PonyRace getEffectiveRace(PonyLevel level) { public PonyRace getEffectiveRace(boolean ignorePony) {
if (level == PonyLevel.HUMANS) return HUMAN; if (MineLittlePony.getConfig().getEffectivePonyLevel(ignorePony) == PonyLevel.HUMANS) return HUMAN;
return this; return this;
} }

View file

@ -40,4 +40,8 @@ public enum PonySize implements ITriggerPixelMapped<PonySize> {
public int getTriggerPixel() { public int getTriggerPixel() {
return triggerValue; return triggerValue;
} }
public PonySize getEffectiveSize() {
return MineLittlePony.getConfig().sizes ? this : PonySize.NORMAL;
}
} }