cowshotter

This project is inactive and its default file will likely not work with the most recent version of Minecraft. The author may have abandoned it, or it may have outlived its usefulness.

  1. !/bin/sh
  2. -
  3. Excerpted from "Learn to Program with Minecraft Plugins, CanaryMod Edition",
  4. published by The Pragmatic Bookshelf.
  5. Copyrights apply to this code. It may not be used to create training material,
  6. courses, books, articles, and the like. Contact us if you are in doubt.
  7. We make no guarantees that this code is fit for any purpose.
  8. Visit http://www.pragmaticprogrammer.com/titles/ahmine2 for more book information.
  9. -
  1. Set the variable MCSERVER to $HOME/Desktop/server,
  2. unless it's already set in the environment.
  3. To set it here explicitly, use MCSERVER=your_directory instead of
  4. this next line. : ${MCSERVER:="$HOME/Desktop/server"}

MODS="$MCSERVER"/CanaryMod.jar EZ="$MCSERVER"/lib/EZPlugin.jar if [ "$OS" = "Windows_NT" ] then OSPS=";" else OSPS=":" fi

  1. Make sure that the library jar
  2. exists and is readable if [ ! -e "$MODS" ]; then echo "$MODS doesn't seem to exist. Make sure you have CanaryMod.jar installed at $MCSERVER and run again. If your server is not at $MCSERVER, set your MCSERVER environment variable to point to the correct directory." exit 1 fi

if [ ! -r $EZ ]; then echo "$EZ doesn't seem to exist. Make sure you have EZPlugin.jar installed at $MCSERVER/lib and run again." exit 1 fi

  1. Make the build directories if they aren't there.
  2. Throw away any error if they are. mkdir bin 2>/dev/null mkdir dist 2>/dev/null
  1. Remove any previous build products rm -f bin/*/*.class rm -f dist/*.jar
  1. Get the name of this plugin
  2. from the directory it's in HERE=`pwd` NAME=`basename "$HERE"`
  1. 1. Compile echo "Compiling with javac..." javac -Xlint:deprecation src/*/*.java -d bin -classpath "$MODS$OSPS$EZ" -sourcepath src -g:lines,vars,source || exit 2
  1. 2. Build the jar echo "Creating jar file..." jar -cfm dist/"$NAME.jar" Manifest.txt *.inf -C bin . || exit 3
  1. 3. Copy to server echo "Deploying jar to $MCSERVER/plugins..." test ! -d "$MCSERVER/plugins" && mkdir "$MCSERVER/plugins" cp dist/$NAME.jar "$MCSERVER"/plugins || exit 4

echo "Completed Successfully."


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files

No files uploaded yet.