- Update minecraft client to work with the recent 1.8 client patch

- Change first-run script to only warn the user about changing the profile
- Bump PORTREV
This commit is contained in:
Kris Moore 2014-09-07 21:21:01 +00:00
parent 68dc0d9a9c
commit b6c0562cd9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=367607
4 changed files with 17 additions and 40 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= minecraft-client
PORTVERSION= 1.7.9
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= games java
MASTER_SITES= http://s3.amazonaws.com/Minecraft.Download/launcher/:minecraft \
http://media-mcw.cursecdn.com/c/c5/:icon
@ -41,8 +41,10 @@ do-install:
-e 's|PREFIX|${PREFIX}|' \
-e 's|JAVA_CMD|${JAVA}|' ${FILESDIR}/minecraft-client \
> ${WRKDIR}/minecraft-client
${SED} -e 's|%%PREFIX%%|${PREFIX}|' ${FILESDIR}/Notifier.java \
> ${WRKDIR}/Notifier.java
${INSTALL_SCRIPT} ${WRKDIR}/minecraft-client ${STAGEDIR}${PREFIX}/bin
${INSTALL_SCRIPT} ${FILESDIR}/minecraft-runtime ${STAGEDIR}${DATADIR}
${INSTALL_DATA} ${FILESDIR}/Notifer.java ${STAGEDIR}${DATADIR}
${INSTALL_DATA} ${WRKDIR}/Notifier.java ${STAGEDIR}${DATADIR}
.include <bsd.port.mk>

View File

@ -4,7 +4,7 @@ import javax.swing.UIManager;
import javax.swing.Icon;
import java.awt.EventQueue;
public class Notifer extends JFrame{
public class Notifier extends JFrame{
//Using a standard Java icon
private Icon optionIcon = UIManager.getIcon("FileView.computerIcon");
@ -16,13 +16,13 @@ public class Notifer extends JFrame{
public void run()
{
//create GUI frame
new Notifer().setVisible(true);
new Notifier().setVisible(true);
}
});
}
public Notifer()
public Notifier()
{
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//setTitle("Simple Dialog Box Example");
@ -31,7 +31,7 @@ public class Notifer extends JFrame{
setLocationRelativeTo(null);
// Show our warning to first time users
JOptionPane.showMessageDialog(this, "After the first time logging in with a new user, you will need to close the Minecraft Launcher and restart before the game will run."
JOptionPane.showMessageDialog(this, "Before starting MineCraft, be sure to open your Profile and set the Java Executable to: '%%PREFIX%%/share/minecraft-client/minecraft-runtime'"
,"Important Notification", JOptionPane.PLAIN_MESSAGE);
System.exit(0);

View File

@ -1,43 +1,18 @@
#!/bin/sh
export JAVA_HOME=JAVA_HOME
# Look for launcher_profiles to fix
if [ -e "${HOME}/.minecraft/launcher_profiles.json" ] ; then
rm ${HOME}/.minecraft/launcher_profiles.json.new 2>/dev/null
# Lets make sure we set the fixed java executable script
while IFS='' read -r line
do
# Skip old javaDir lines
echo $line | grep -q '"javaDir": "'
if [ $? -eq 0 ] ; then continue ; fi
# If not a name line, add and continue
echo $line | grep -q '"name": "'
if [ $? -ne 0 ] ; then
printf "%s\n" "$line" >> ${HOME}/.minecraft/launcher_profiles.json.new
continue
fi
# Found a profile entry, lets add the correct runtime
printf "%s\n" "$line" >> ${HOME}/.minecraft/launcher_profiles.json.new
echo ' "javaDir": "/usr/local/share/minecraft-client/minecraft-runtime",' >> ${HOME}/.minecraft/launcher_profiles.json.new
done < ${HOME}/.minecraft/launcher_profiles.json
# See if we have dangling }
tail -1 ${HOME}/.minecraft/launcher_profiles.json.new | grep -q "^}"
if [ $? -ne 0 ] ; then
printf "}" >> ${HOME}/.minecraft/launcher_profiles.json.new
# The first time warn the user to set the runtime executable in place of java
if [ ! -e "${HOME}/.minecraft/notified-runtime" ] ; then
if [ ! -d "${HOME}/.minecraft" ] ; then
mkdir ${HOME}/.minecraft
fi
touch ${HOME}/.minecraft/notified-runtime 2>/dev/null
mv ${HOME}/.minecraft/launcher_profiles.json.new ${HOME}/.minecraft/launcher_profiles.json
else
# No .minecraft dir, lets display the first time notification
javac -d /tmp /usr/local/share/minecraft-client/Notifer.java
javac -d /tmp /usr/local/share/minecraft-client/Notifier.java
cd /tmp
java Notifer
rm Notifer*.class
# Run this as a background task, so that it appears over the launcher
( sleep 3; java Notifier ; rm Notifier*.class ) &
fi
exec ${JAVA_HOME}/bin/java -Djava.nio.file.spi.DefaultFileSystemProvider=sun.nio.fs.BsdFileSystemProvider \

View File

@ -1,6 +1,6 @@
bin/minecraft-client
%%DATADIR%%/Minecraft.jar
%%DATADIR%%/minecraft-runtime
%%DATADIR%%/Notifer.java
%%DATADIR%%/Notifier.java
share/pixmaps/minecraft-client.png
@dirrm %%DATADIR%%