Replace EnumDifficulty with vanilla Difficulty enum
This commit is contained in:
@@ -3,6 +3,7 @@ package exopandora.worldhandler.builder.impl;
|
|||||||
import exopandora.worldhandler.builder.CommandBuilder;
|
import exopandora.worldhandler.builder.CommandBuilder;
|
||||||
import exopandora.worldhandler.builder.Syntax;
|
import exopandora.worldhandler.builder.Syntax;
|
||||||
import exopandora.worldhandler.builder.types.Type;
|
import exopandora.worldhandler.builder.types.Type;
|
||||||
|
import net.minecraft.world.Difficulty;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
@@ -14,16 +15,16 @@ public class BuilderDifficulty extends CommandBuilder
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BuilderDifficulty(EnumDifficulty difficulty)
|
public BuilderDifficulty(Difficulty difficulty)
|
||||||
{
|
{
|
||||||
this.setDifficulty(difficulty);
|
this.setDifficulty(difficulty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDifficulty(EnumDifficulty difficulty)
|
public void setDifficulty(Difficulty difficulty)
|
||||||
{
|
{
|
||||||
if(difficulty != null)
|
if(difficulty != null)
|
||||||
{
|
{
|
||||||
this.setNode(0, difficulty.toString());
|
this.setNode(0, difficulty.getTranslationKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,20 +43,4 @@ public class BuilderDifficulty extends CommandBuilder
|
|||||||
|
|
||||||
return syntax;
|
return syntax;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static enum EnumDifficulty
|
|
||||||
{
|
|
||||||
PEACEFUL,
|
|
||||||
EASY,
|
|
||||||
NORMAL,
|
|
||||||
HARD;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return this.name().toLowerCase();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package exopandora.worldhandler.helper;
|
|||||||
import exopandora.worldhandler.Main;
|
import exopandora.worldhandler.Main;
|
||||||
import exopandora.worldhandler.WorldHandler;
|
import exopandora.worldhandler.WorldHandler;
|
||||||
import exopandora.worldhandler.builder.impl.BuilderDifficulty;
|
import exopandora.worldhandler.builder.impl.BuilderDifficulty;
|
||||||
import exopandora.worldhandler.builder.impl.BuilderDifficulty.EnumDifficulty;
|
|
||||||
import exopandora.worldhandler.builder.impl.BuilderGamemode;
|
import exopandora.worldhandler.builder.impl.BuilderGamemode;
|
||||||
import exopandora.worldhandler.builder.impl.BuilderGamemode.EnumGamemode;
|
import exopandora.worldhandler.builder.impl.BuilderGamemode.EnumGamemode;
|
||||||
import exopandora.worldhandler.builder.impl.BuilderTime;
|
import exopandora.worldhandler.builder.impl.BuilderTime;
|
||||||
@@ -26,6 +25,7 @@ import net.minecraft.util.text.TextFormatting;
|
|||||||
import net.minecraft.util.text.TranslationTextComponent;
|
import net.minecraft.util.text.TranslationTextComponent;
|
||||||
import net.minecraft.util.text.event.ClickEvent;
|
import net.minecraft.util.text.event.ClickEvent;
|
||||||
import net.minecraft.util.text.event.ClickEvent.Action;
|
import net.minecraft.util.text.event.ClickEvent.Action;
|
||||||
|
import net.minecraft.world.Difficulty;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
@@ -88,22 +88,22 @@ public class ActionHelper
|
|||||||
|
|
||||||
public static void difficultyPeaceful()
|
public static void difficultyPeaceful()
|
||||||
{
|
{
|
||||||
CommandHelper.sendCommand(new BuilderDifficulty(EnumDifficulty.PEACEFUL));
|
CommandHelper.sendCommand(new BuilderDifficulty(Difficulty.PEACEFUL));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void difficultyEasy()
|
public static void difficultyEasy()
|
||||||
{
|
{
|
||||||
CommandHelper.sendCommand(new BuilderDifficulty(EnumDifficulty.EASY));
|
CommandHelper.sendCommand(new BuilderDifficulty(Difficulty.EASY));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void difficultyNormal()
|
public static void difficultyNormal()
|
||||||
{
|
{
|
||||||
CommandHelper.sendCommand(new BuilderDifficulty(EnumDifficulty.NORMAL));
|
CommandHelper.sendCommand(new BuilderDifficulty(Difficulty.NORMAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void difficultyHard()
|
public static void difficultyHard()
|
||||||
{
|
{
|
||||||
CommandHelper.sendCommand(new BuilderDifficulty(EnumDifficulty.HARD));
|
CommandHelper.sendCommand(new BuilderDifficulty(Difficulty.HARD));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void gamemodeSurvival()
|
public static void gamemodeSurvival()
|
||||||
|
|||||||
Reference in New Issue
Block a user