Skip to content

Commit

Permalink
Forge 1.8 update
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandoislas committed Jun 11, 2016
1 parent 8c893a4 commit b0a4b08
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 80 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Gradle
build/
.gradle/
run/

# Eclipse
eclipse/
Expand Down
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
}
}

apply plugin: 'forge'
apply plugin: 'net.minecraftforge.gradle.forge'

version = System.getenv('DRONE_BRANCH') == "develop" ? "dev-" + System.getenv('DRONE_BUILD_NUMBER') : "1.7.10-1.0.0"
version = System.getenv('DRONE_BRANCH') == "develop" ? "dev-" + System.getenv('DRONE_BUILD_NUMBER') : "1.8.9-1.1.0"
group= "com.rolandoislas.multihotbar" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "multihotbar"

minecraft {
version = "1.7.10-10.13.4.1558-1.7.10"
runDir = "eclipse"
version = "1.8.9-11.15.1.1722"
runDir = "run"
mappings = "stable_20"
}

jar {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jun 08 01:02:21 MST 2016
#Fri Jun 10 22:08:34 MST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
52 changes: 26 additions & 26 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,30 @@
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
Expand All @@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down
8 changes: 4 additions & 4 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

Expand Down Expand Up @@ -46,7 +46,7 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rolandoislas/multihotbar/Config.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.rolandoislas.multihotbar;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.rolandoislas.multihotbar;

import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;

import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;
import org.lwjgl.opengl.GL11;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.rolandoislas.multihotbar;

import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

/**
* Created by Rolando on 6/8/2016.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.rolandoislas.multihotbar;

import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;

import java.util.Map;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rolandoislas/multihotbar/GuiConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Created by Rolando on 6/10/2016.
*/
public class GuiConfig extends cpw.mods.fml.client.config.GuiConfig {
public class GuiConfig extends net.minecraftforge.fml.client.config.GuiConfig {
public GuiConfig(GuiScreen parentScreen) {
super(parentScreen,
new ConfigElement(Config.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rolandoislas/multihotbar/GuiFactory.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.rolandoislas.multihotbar;

import cpw.mods.fml.client.IModGuiFactory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.fml.client.IModGuiFactory;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private void drawDouble(int index) {

public static int[] getHotbarCoords(int index) {
Minecraft minecraft = Minecraft.getMinecraft();
ScaledResolution scaledResolution = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
ScaledResolution scaledResolution = new ScaledResolution(minecraft);
int[] coords = new int[2];
if (Config.numberOfHotbars == 1) {
coords[0] = scaledResolution.getScaledWidth() / 2 - HOTBAR_WIDTH / 2;
Expand Down Expand Up @@ -133,9 +133,9 @@ private void drawItems(int index) {
if (item != null) {
int itemX = getXForSlot(i);
int itemY = getYForSlot(i);
RenderItem.getInstance().renderItemAndEffectIntoGUI(minecraft.fontRenderer, minecraft.getTextureManager(), item,
itemX, itemY);
RenderItem.getInstance().renderItemOverlayIntoGUI(minecraft.fontRenderer, minecraft.getTextureManager(), item, itemX, itemY);
// RenderItem.getInstance().renderItemAndEffectIntoGUI(minecraft.fontRenderer, minecraft.getTextureManager(), item,
//itemX, itemY);
//RenderItem.getInstance().renderItemOverlayIntoGUI(minecraft.fontRenderer, minecraft.getTextureManager(), item, itemX, itemY);
}
}
RenderHelper.disableStandardItemLighting();
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/rolandoislas/multihotbar/HotbarLogic.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.rolandoislas.multihotbar;

import cpw.mods.fml.common.gameevent.InputEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;

/**
* Created by Rolando on 6/7/2016.
Expand All @@ -14,10 +13,10 @@ public void mouseEvent(MouseEvent event) {
// Scrolled
if (event.dwheel != 0) {
// Handle hotbar selector scroll
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
// Scrolled right
if (event.dwheel < 0) {
if (KeyBindings.scrollModifier.getIsKeyPressed())
if (KeyBindings.scrollModifier.isKeyDown())
moveSelectionToNextHotbar();
else if (player.inventory.currentItem < Config.numberOfHotbars * 9 - 1)
player.inventory.currentItem++;
Expand All @@ -26,7 +25,7 @@ else if (player.inventory.currentItem < Config.numberOfHotbars * 9 - 1)
}
// Scrolled left
else {
if (KeyBindings.scrollModifier.getIsKeyPressed())
if (KeyBindings.scrollModifier.isKeyDown())
moveSelectionToPreviousHotbar();
else if (player.inventory.currentItem > 0)
player.inventory.currentItem--;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/rolandoislas/multihotbar/KeyBindings.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.rolandoislas.multihotbar;

import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import org.lwjgl.input.Keyboard;

/**
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/com/rolandoislas/multihotbar/MultiHotbar.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.rolandoislas.multihotbar;

import com.rolandoislas.multihotbar.proxy.CommonProxy;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkCheckHandler;
import cpw.mods.fml.relauncher.Side;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkCheckHandler;
import net.minecraftforge.fml.relauncher.Side;

import java.util.Map;

Expand All @@ -26,19 +25,19 @@ public class MultiHotbar
serverSide = "com.rolandoislas.multihotbar.proxy.CommonProxy")
public static CommonProxy proxy;

@EventHandler
@Mod.EventHandler
@SuppressWarnings("unused")
public void preInit(FMLPreInitializationEvent event) {
proxy.preInit(event);
}

@EventHandler
@Mod.EventHandler
@SuppressWarnings("unused")
public void init(FMLInitializationEvent event) {
proxy.init(event);
}

@EventHandler
@Mod.EventHandler
@SuppressWarnings("unused")
public void postInit(FMLPostInitializationEvent event) {
proxy.postInit(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import com.rolandoislas.multihotbar.EventHandlerClient;
import com.rolandoislas.multihotbar.KeyBindings;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

/**
* Created by Rolando on 6/6/2016.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import com.rolandoislas.multihotbar.Config;
import com.rolandoislas.multihotbar.EventHandlerCommon;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

/**
* Created by Rolando on 6/6/2016.
Expand Down

0 comments on commit b0a4b08

Please sign in to comment.