Created
April 27, 2012 15:12
-
-
Save bgnori/2510047 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nori@akagi]~/Desktop/work/cloft/cloft% git diff fc57adc48b1e7b44f8371dae47365d96c8705c99 | |
diff --git a/src/cloft/core.clj b/src/cloft/core.clj | |
index 3bd0a13..db68730 100644 | |
--- a/src/cloft/core.clj | |
+++ b/src/cloft/core.clj | |
@@ -487,10 +487,15 @@ | |
(defn player-interact-entity-event [evt] | |
(let [target (.getRightClicked evt)] | |
- (letfn [(d [n] | |
- (.dropItem (.getWorld target) | |
- (.getLocation target) | |
- (ItemStack. n 1)))] | |
+ (letfn [(d | |
+ ([n] | |
+ (.dropItem (.getWorld target) | |
+ (.getLocation target) | |
+ (ItemStack. n 1))) | |
+ ([n m] | |
+ (.dropItem (.getWorld target) | |
+ (.getLocation target) | |
+ (ItemStack. (int n) (int 1) (short 0) (byte m)))))] | |
(cond | |
(= Material/STRING (.getType (.getItemInHand (.getPlayer evt)))) | |
(let [player (.getPlayer evt)] | |
@@ -536,6 +541,8 @@ | |
(c/consume-item (.getPlayer evt))) | |
; right-click chicken -> rail | |
(instance? Chicken target) (d 66) | |
+ ; right-click pig -> cocoa | |
+ (instance? Pig target) (d 351 (byte 3)) | |
; right-click cow -> charcoal | |
(instance? Cow target) (d 263) | |
; right-click villager -> cake |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment