Skip to content

Commit

Permalink
Merge version 3.2.0 changes from the MC_1.10.x branch
Browse files Browse the repository at this point in the history
  • Loading branch information
maruohon committed Jan 25, 2017
2 parents 2865ef9 + 8f874b8 commit 272420d
Show file tree
Hide file tree
Showing 35 changed files with 1,416 additions and 798 deletions.
5 changes: 2 additions & 3 deletions .gitattributes
Expand Up @@ -11,8 +11,7 @@
.gitignore text eol=lf
build.gradle text eol=lf
gradlew text eol=lf
gradlew.bat text eol=lf
gradle/wrapper/gradle-wrapper.properties text eol=lf
gradle/wrapper/gradle-wrapper.properties text eol=crlf
COPYING.txt text eol=lf
COPYING.LESSER.txt text eol=lf
README.md text eol=lf
Expand All @@ -26,4 +25,4 @@ README.md text eol=lf
*.zip binary
*.jar binary
*.7z binary
*.db binary
*.db binary
6 changes: 3 additions & 3 deletions build.properties
@@ -1,9 +1,9 @@
# Wed Dec 31 00:30:00 EET 2015
group = fi.dy.masa
mod_id = multishot
mod_version = 3.1.8
mod_version = 3.2.0
minecraft_version_out = 1.11.2

minecraft_version = 1.11.2
forge_version = 13.20.0.2201
mappings_version = snapshot_20161227
forge_version = 13.20.0.2214
mappings_version = snapshot_20170113
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 5 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,10 @@
#Tue May 06 21:57:37 CEST 2014
#Sun Jan 22 18:32:49 EET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
<<<<<<< HEAD
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
=======
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
>>>>>>> origin/MC_1.10.x
52 changes: 26 additions & 26 deletions gradlew
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
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
Expand Up @@ -22,7 +22,6 @@ public class Multishot
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
instance = this;
logger = event.getModLog();

proxy.preInit(event.getModConfigurationDirectory());
Expand Down
@@ -1,13 +1,10 @@
package fi.dy.masa.minecraft.mods.multishot.config;

import java.io.File;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.math.MathHelper;

import net.minecraftforge.common.config.Configuration;

import fi.dy.masa.minecraft.mods.multishot.Multishot;
import fi.dy.masa.minecraft.mods.multishot.gui.ScreenGeneric;
import fi.dy.masa.minecraft.mods.multishot.reference.Constants;
Expand All @@ -20,6 +17,7 @@ public class Configs {
private boolean cfgMotionEnabled = false;
private boolean cfgLockControls = false;
private boolean cfgHideGui = false;
private boolean useFreeCamera;
private int cfgGuiPosition = 0;
private int cfgGuiOffsetX = 0;
private int cfgGuiOffsetY = 0;
Expand All @@ -37,6 +35,8 @@ public class Configs {
private int cfgMotionY = 0;
private int cfgRotationYaw = 0; // In 1/100th of a degree/s
private int cfgRotationPitch = 0;
private int freeCameraWidth = 1280;
private int freeCameraHeight = 720;
private String cfgMultishotSavePath;
private String configFile;
private String pointsDir;
Expand Down Expand Up @@ -71,6 +71,7 @@ public void readFromConfiguration()
this.cfgMotionEnabled = cfg.get(category, "motionEnabled", false, "Motion enabled override, disables the Motion hotkey").getBoolean(this.cfgMotionEnabled);
this.cfgLockControls = cfg.get(category, "lockControlsEnabled", false, "Lock the mouse and keyboard controls while in recording or motion mode").getBoolean(this.cfgLockControls);
this.cfgHideGui = cfg.get(category, "hideGuiEnabled", false, "Hide the Multishot GUI (don't display the icons or save messages)").getBoolean(this.cfgHideGui);
this.useFreeCamera = cfg.get(category, "useFreeCamera", false, "Render using a free moving virtual camera").getBoolean();
this.cfgGuiPosition = cfg.get(category, "guiPosition", 0, "Multishot GUI position (0 = Top Right, 1 = Bottom Right, 2 = Bottom Left, 3 = Top Left)").getInt(this.cfgGuiPosition);
this.cfgGuiOffsetX = cfg.get(category, "guiOffsetX", 0, "Multishot GUI horizontal offset").getInt(this.cfgGuiOffsetX);
this.cfgGuiOffsetY = cfg.get(category, "guiOffsetY", 0, "Multishot GUI vertical offset").getInt(this.cfgGuiOffsetY);
Expand All @@ -82,6 +83,8 @@ public void readFromConfiguration()
this.cfgTimerNumShots = cfg.get(category, "timerShots", 0, "Timer length in number of screenshots").getInt(this.cfgTimerNumShots);
this.cfgImgFormat = cfg.get(category, "imgFormat", 0, "Screenshot image format (0 = PNG, 1 = JPG with quality 75, 2 = JPG @ 80, 3 = JPG @ 85, 4 = JPG @ 90, 5 = JPG @ 95)").getInt(this.cfgImgFormat);
this.cfgMultishotSavePath = cfg.get(category, "savePath", "multishot", "The directory where the screenshots will be saved").getString();
this.freeCameraWidth = cfg.get(category, "freeCameraWidth", 1280, "The render width in the free camera mode").getInt();
this.freeCameraHeight = cfg.get(category, "freeCameraHeight", 720, "The render height in the free camera mode").getInt();

category = "motion";
this.cfgMotionMode = cfg.get(category, "motionMode", 0, "Motion mode (0 = Linear, 1 = Circular, 2 = Elliptical, 3 = Path (linear segments), 4 = Path (smooth))").getInt(this.cfgMotionMode);
Expand Down Expand Up @@ -122,6 +125,7 @@ public void writeToConfiguration()
cfg.get(category, "motionEnabled", false, "Motion enabled override, disables the Motion hotkey").set(this.cfgMotionEnabled);
cfg.get(category, "lockControlsEnabled", false, "Lock the mouse and keyboard controls while in recording or motion mode").set(this.cfgLockControls);
cfg.get(category, "hideGuiEnabled", false, "Hide the Multishot GUI (don't display anything while taking screenshots)").set(this.cfgHideGui);
cfg.get(category, "useFreeCamera", false, "Render using a free moving virtual camera").set(this.useFreeCamera);
cfg.get(category, "guiPosition", 0, "Multishot GUI position (0 = Top Right, 1 = Bottom Right, 2 = Bottom Left, 3 = Top Left)").set(this.cfgGuiPosition);
cfg.get(category, "guiOffsetX", 0, "Multishot GUI horizontal offset").set(this.cfgGuiOffsetX);
cfg.get(category, "guiOffsetY", 0, "Multishot GUI vertical offset").set(this.cfgGuiOffsetY);
Expand All @@ -132,6 +136,8 @@ public void writeToConfiguration()
cfg.get(category, "timerReal", 0, "Timer length in real time, in seconds").set(this.cfgTimerRealTime);
cfg.get(category, "timerShots", 0, "Timer length in number of screenshots").set(this.cfgTimerNumShots);
cfg.get(category, "imgFormat", 0, "Screenshot image format (0 = PNG, 1 = JPG with quality 75, 2 = JPG @ 80, 3 = JPG @ 85, 4 = JPG @ 90, 5 = JPG @ 95)").set(this.cfgImgFormat);
cfg.get(category, "freeCameraWidth", 1280, "The render width in the free camera mode").set(this.freeCameraWidth);
cfg.get(category, "freeCameraHeight", 720, "The render height in the free camera mode").set(this.freeCameraHeight);
cfg.get(category, "savePath", "multishot", "The directory where the screenshots will be saved").set(this.cfgMultishotSavePath);

category = "motion";
Expand Down Expand Up @@ -160,6 +166,8 @@ public void validateConfigs()
if (this.cfgImgFormat < 0 || this.cfgImgFormat > 5) { this.cfgImgFormat = 0; } // Screenshot image format (0 = PNG, 1 = JPG with quality 75, 2 = JPG @ 80, 3 = JPG @ 85, 4 = JPG @ 90, 5 = JPG @ 95)
if (this.cfgMotionMode < 0 || this.cfgMotionMode > 4) { this.cfgMotionMode = 0; } // Motion mode (0 = Linear, 1 = Circular, 2 = Elliptical, 3 = Path (linear segments), 4 = Path (smooth))
if (this.cfgMotionSpeed < -1000000 || this.cfgMotionSpeed > 1000000) { this.cfgMotionSpeed = 0; } // max 1000m/s :p
if (this.freeCameraWidth > 8192 || this.freeCameraWidth < 1) { this.freeCameraWidth = 1280; }
if (this.freeCameraHeight > 8192 || this.freeCameraHeight < 1) { this.freeCameraHeight = 720; }

this.cfgMultishotSavePath = StringHelper.fixPath(this.cfgMultishotSavePath);

Expand All @@ -178,6 +186,7 @@ public void resetAllConfigs()
this.cfgMotionEnabled = false;
this.cfgLockControls = false;
this.cfgHideGui = false;
this.useFreeCamera = false;
this.cfgGuiPosition = 0;
// We don't reset the hidden configs here, that would probably get annoying
this.cfgInterval = 0;
Expand All @@ -194,6 +203,8 @@ public void resetAllConfigs()
this.cfgMotionY = 0;
this.cfgRotationYaw = 0; // In 1/100th of a degree/s
this.cfgRotationPitch = 0;
this.freeCameraWidth = 1280;
this.freeCameraHeight = 720;
this.cfgMultishotSavePath = this.getDefaultPath();

this.writeToConfiguration();
Expand Down Expand Up @@ -247,6 +258,15 @@ private void changeValue(int id, int increment)
case Constants.GUI_BUTTON_ID_HIDE_GUI:
this.cfgHideGui = ! this.cfgHideGui;
break;
case Constants.GUI_BUTTON_ID_USE_FREE_CAMERA:
this.useFreeCamera = ! this.useFreeCamera;
break;
case Constants.GUI_BUTTON_ID_FREE_CAMERA_WIDTH:
this.freeCameraWidth = this.clampInt(this.freeCameraWidth, increment, 1, 8192);
break;
case Constants.GUI_BUTTON_ID_FREE_CAMERA_HEIGHT:
this.freeCameraHeight = this.clampInt(this.freeCameraHeight, increment, 1, 8192);
break;
case Constants.GUI_BUTTON_ID_INTERVAL:
this.cfgInterval = this.clampInt(this.cfgInterval, increment, 0, 72000); // max 2h = 7200s
break;
Expand Down Expand Up @@ -384,6 +404,15 @@ public void resetValue(int id)
case Constants.GUI_BUTTON_ID_HIDE_GUI:
this.cfgHideGui = false;
break;
case Constants.GUI_BUTTON_ID_USE_FREE_CAMERA:
this.useFreeCamera = false;
break;
case Constants.GUI_BUTTON_ID_FREE_CAMERA_WIDTH:
this.freeCameraWidth = 1280;
break;
case Constants.GUI_BUTTON_ID_FREE_CAMERA_HEIGHT:
this.freeCameraHeight = 720;
break;
case Constants.GUI_BUTTON_ID_INTERVAL:
this.cfgInterval = 0;
break;
Expand Down Expand Up @@ -489,6 +518,15 @@ public String getDisplayString (int id)
case Constants.GUI_BUTTON_ID_HIDE_GUI:
s = getDisplayStringBoolean(this.cfgHideGui);
break;
case Constants.GUI_BUTTON_ID_USE_FREE_CAMERA:
s = getDisplayStringBoolean(this.useFreeCamera);
break;
case Constants.GUI_BUTTON_ID_FREE_CAMERA_WIDTH:
s = String.valueOf(this.freeCameraWidth);
break;
case Constants.GUI_BUTTON_ID_FREE_CAMERA_HEIGHT:
s = String.valueOf(this.freeCameraHeight);
break;
case Constants.GUI_BUTTON_ID_INTERVAL:
if (this.cfgInterval == 0) { s = I18n.format("multishot.gui.label.off"); }
else { s = String.format("%.1fs", ((float)this.cfgInterval / 10)); }
Expand Down Expand Up @@ -675,6 +713,21 @@ public int getZoom()
return this.cfgZoom;
}

public boolean getUseFreeCamera()
{
return this.useFreeCamera;
}

public int getFreeCameraWidth()
{
return this.freeCameraWidth;
}

public int getFreeCameraHeight()
{
return this.freeCameraHeight;
}

public String getSavePath()
{
return this.cfgMultishotSavePath;
Expand Down

0 comments on commit 272420d

Please sign in to comment.