Permalink
Browse files

Added line function

Also implement recommended .gitattributes
  • Loading branch information...
1 parent 99fce91 commit 2be38d60d52a0c24aadc085dcea3bcec055eee9e @brianbutton brianbutton committed Dec 29, 2012
View
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
Oops, something went wrong.
View
@@ -1,10 +1,10 @@
-@rem needs this lein.bat https://github.com/technomancy/leiningen/blob/master/bin/lein.bat
- @rem put it in PATH
-
-@echo off
-
-rem every time you make a change in this project you should run this .bat file to put the updated .jar into the local repository
-
-set JAVA_CMD="c:\program files\java\jdk1.6.0_31\bin\java.exe"
-call lein install
+@rem needs this lein.bat https://github.com/technomancy/leiningen/blob/master/bin/lein.bat
+ @rem put it in PATH
+
+@echo off
+
+rem every time you make a change in this project you should run this .bat file to put the updated .jar into the local repository
+
+set JAVA_CMD="c:\program files\java\jdk1.6.0_31\bin\java.exe"
+call lein install
if NOT "%1" == "nopause" @pause
View
@@ -1,16 +1,16 @@
-@rem needs this lein.bat https://github.com/technomancy/leiningen/blob/master/bin/lein.bat
- @rem put it in PATH
-
-@echo off
-set JAVA_CMD="c:\program files\java\jdk1.6.0_31\bin\java.exe"
-call lein uberjar
-
-set deployDIR=deploy
-rem %deployDIR% is a folder link to your running server's plugin folder
-rem you make it by running this cmd: mklink /d deploy c:\craftbukkit\plugins\
-if EXIST "%deployDIR%" (
- move target\cljminecraft-*standalone.jar %deployDIR%\cljminecraft.jar
- if ERRORLEVEL 1 echo FAILED, make sure bukkit isn't running (so the plugin .jar isn't in locked)
- )
-
-if NOT "%1" == "nopause" @pause
+@rem needs this lein.bat https://github.com/technomancy/leiningen/blob/master/bin/lein.bat
+ @rem put it in PATH
+
+@echo off
+set JAVA_CMD="c:\program files\java\jdk1.6.0_31\bin\java.exe"
+call lein uberjar
+
+set deployDIR=deploy
+rem %deployDIR% is a folder link to your running server's plugin folder
+rem you make it by running this cmd: mklink /d deploy c:\craftbukkit\plugins\
+if EXIST "%deployDIR%" (
+ move target\cljminecraft-*standalone.jar %deployDIR%\cljminecraft.jar
+ if ERRORLEVEL 1 echo FAILED, make sure bukkit isn't running (so the plugin .jar isn't in locked)
+ )
+
+if NOT "%1" == "nopause" @pause
View
@@ -1,6 +1,6 @@
-call lein_uberjar.bat nopause
-call lein_into_repo.bat nopause
-
-
-if NOT "%1" == "nopause" @pause
-
+call lein_uberjar.bat nopause
+call lein_into_repo.bat nopause
+
+
+if NOT "%1" == "nopause" @pause
+
@@ -213,6 +213,21 @@
ctx [mark]
(update-in ctx [:marks mark] {}))
+
+(defn line
+ "This returns a set of points for a line"
+ [xt yt zt]
+ (if (= [xt yt zt] [0 0 0])
+ '([0 0 0])
+ (let [q (max (Math/abs xt) (Math/abs yt) (Math/abs zt))
+ m (/ yt q)
+ n (/ zt q)
+ o (/ xt q)]
+ (for [qi (range q)]
+ [(Math/round (double (* o qi)))
+ (Math/round (double (* m qi)))
+ (Math/round (double (* n qi)))]))))
+
;; to be finished......
(defaction line-to-mark
"Draw a line directly to a given mark from current point"
@@ -12,5 +12,5 @@
(defmacro bug
"as in bug in code/coding when this is reached"
- [fmt & args]
- `(.sendMessage (Bukkit/getConsoleSender) (format ~(str "[BUG]" ChatColor/RED (.getName *ns*) ChatColor/RESET ":" ChatColor/BLUE (:line (meta &form)) ChatColor/RESET " - " fmt) ~@args)))
+ [fmt & args]
+ `(.sendMessage (Bukkit/getConsoleSender) (format ~(str "[BUG]" ChatColor/RED (.getName *ns*) ChatColor/RESET ":" ChatColor/BLUE (:line (meta &form)) ChatColor/RESET " - " fmt) ~@args)))
@@ -1,7 +1,7 @@
(ns cljminecraft.util
(:require [clojure.set :as set])
(:require [cljminecraft.logging :as log])
- (:import (java.net ServerSocket InetSocketAddress))
+ (:import (java.net ServerSocket InetSocketAddress))
(:import (java.io IOException))
)

0 comments on commit 2be38d6

Please sign in to comment.