Update to 1.13.2
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package exopandora.worldhandler.util;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@FunctionalInterface
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public interface ActionHandler
|
||||
{
|
||||
void run() throws Exception;
|
||||
}
|
||||
@@ -3,25 +3,25 @@ package exopandora.worldhandler.util;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import exopandora.worldhandler.WorldHandler;
|
||||
import exopandora.worldhandler.config.ConfigSettings;
|
||||
import exopandora.worldhandler.config.Config;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class UtilKeyBinding
|
||||
{
|
||||
public static void updatePosKeys()
|
||||
{
|
||||
boolean isRegistered = arePosKeysRegistered();
|
||||
|
||||
if(ConfigSettings.arePosShortcutsEnabled() && !isRegistered)
|
||||
if(Config.getSettings().shortcutKeys() && !isRegistered)
|
||||
{
|
||||
ClientRegistry.registerKeyBinding(WorldHandler.KEY_WORLD_HANDLER_POS1);
|
||||
ClientRegistry.registerKeyBinding(WorldHandler.KEY_WORLD_HANDLER_POS2);
|
||||
}
|
||||
else if(!ConfigSettings.arePosShortcutsEnabled() && isRegistered)
|
||||
else if(!Config.getSettings().shortcutKeys() && isRegistered)
|
||||
{
|
||||
removePosKeys();
|
||||
}
|
||||
@@ -29,11 +29,11 @@ public class UtilKeyBinding
|
||||
|
||||
public static boolean arePosKeysRegistered()
|
||||
{
|
||||
return ArrayUtils.contains(Minecraft.getMinecraft().gameSettings.keyBindings, WorldHandler.KEY_WORLD_HANDLER_POS1) || ArrayUtils.contains(Minecraft.getMinecraft().gameSettings.keyBindings, WorldHandler.KEY_WORLD_HANDLER_POS2);
|
||||
return ArrayUtils.contains(Minecraft.getInstance().gameSettings.keyBindings, WorldHandler.KEY_WORLD_HANDLER_POS1) || ArrayUtils.contains(Minecraft.getInstance().gameSettings.keyBindings, WorldHandler.KEY_WORLD_HANDLER_POS2);
|
||||
}
|
||||
|
||||
public static void removePosKeys()
|
||||
{
|
||||
Minecraft.getMinecraft().gameSettings.keyBindings = ArrayUtils.removeElements(Minecraft.getMinecraft().gameSettings.keyBindings, WorldHandler.KEY_WORLD_HANDLER_POS1, WorldHandler.KEY_WORLD_HANDLER_POS2);
|
||||
Minecraft.getInstance().gameSettings.keyBindings = ArrayUtils.removeElements(Minecraft.getInstance().gameSettings.keyBindings, WorldHandler.KEY_WORLD_HANDLER_POS1, WorldHandler.KEY_WORLD_HANDLER_POS2);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package exopandora.worldhandler.util;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class UtilPlayer
|
||||
{
|
||||
public static boolean canIssueCommand()
|
||||
{
|
||||
return Minecraft.getMinecraft().player.getPermissionLevel() > 0;
|
||||
}
|
||||
|
||||
public static int getPlayerDirection()
|
||||
{
|
||||
return MathHelper.floor((double) (Minecraft.getMinecraft().player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
package exopandora.worldhandler.util;
|
||||
|
||||
import exopandora.worldhandler.config.ConfigSkin;
|
||||
import exopandora.worldhandler.config.Config;
|
||||
import exopandora.worldhandler.format.TextFormatting;
|
||||
import exopandora.worldhandler.helper.ResourceHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class UtilRender
|
||||
{
|
||||
public static void drawWatchIntoGui(Gui gui, int width, int height, long worldTicks, boolean smooth)
|
||||
@@ -27,27 +27,27 @@ public class UtilRender
|
||||
float rotationMinute = (360 / 60) * minute - 180F;
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(width + 5, height + 5, 0F);
|
||||
GlStateManager.scale(0.25F, 0.25F, 0.25F);
|
||||
GlStateManager.translatef(width + 5, height + 5, 0F);
|
||||
GlStateManager.scalef(0.25F, 0.25F, 0.25F);
|
||||
|
||||
GlStateManager.rotate(rotationHour, 0F, 0F, 1F);
|
||||
GlStateManager.rotatef(rotationHour, 0F, 0F, 1F);
|
||||
Gui.drawRect(-1, -1, 1, 11, 0xFF383838);
|
||||
GlStateManager.rotate(-rotationHour, 0F, 0F, 1F);
|
||||
GlStateManager.rotatef(-rotationHour, 0F, 0F, 1F);
|
||||
|
||||
GlStateManager.rotate(rotationMinute, 0F, 0F, 1F);
|
||||
GlStateManager.rotatef(rotationMinute, 0F, 0F, 1F);
|
||||
Gui.drawRect(-1, -1, 1, 15, 0xFF6F6F6F);
|
||||
GlStateManager.rotate(-rotationMinute, 0F, 0F, 1F);
|
||||
GlStateManager.rotatef(-rotationMinute, 0F, 0F, 1F);
|
||||
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.color3f(1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
GlStateManager.color((float) ConfigSkin.getButtonRed() / 255, (float) ConfigSkin.getButtonGreen() / 255, (float) ConfigSkin.getButtonBlue() / 255, 1.0F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceHelper.getIconTexture());
|
||||
GlStateManager.color3f(Config.getSkin().getButtonRedF(), Config.getSkin().getButtonGreenF(), Config.getSkin().getButtonBlueF());
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(ResourceHelper.getIconTexture());
|
||||
|
||||
gui.drawTexturedModalRect(width + 0, height, 48, 0, 10, 10);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.scalef(0.5F, 0.5F, 0.5F);
|
||||
Gui.drawRect((width + 5) * 2 - 1, (height + 4) * 2 + 1, (width + 6) * 2 - 1, (height + 5) * 2 + 1, 0xFF000000);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user