Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update for 1.2

  • Loading branch information...
commit 1948f575f1997bcb2994bbed36394d421a9ef4c8 1 parent fa241ed
Oliver Brown authored
12 SpoutTrade.iml
@@ -10,9 +10,17 @@
10 10 </content>
11 11 <orderEntry type="inheritedJdk" />
12 12 <orderEntry type="sourceFolder" forTests="false" />
13   - <orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:craftbukkit:1.1-R4" level="project" />
  13 + <orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:craftbukkit:1.1-R6" level="project" />
  14 + <orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.1-R6" level="project" />
  15 + <orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:minecraft-server:1.1_02" level="project" />
  16 + <orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.jopt-simple:jopt-simple:3.2" level="project" />
  17 + <orderEntry type="library" scope="PROVIDED" name="Maven: jline:jline:0.9.94" level="project" />
  18 + <orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:3.8.1" level="project" />
  19 + <orderEntry type="library" scope="PROVIDED" name="Maven: org.xerial:sqlite-jdbc:3.7.2" level="project" />
  20 + <orderEntry type="library" scope="PROVIDED" name="Maven: mysql:mysql-connector-java:5.1.14" level="project" />
  21 + <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.1" level="project" />
14 22 <orderEntry type="library" scope="PROVIDED" name="Maven: org.getspout:spoutpluginapi:dev-SNAPSHOT" level="project" />
15   - <orderEntry type="library" name="Maven: net.ark3l:InventoryUtils:1.0.0-SNAPSHOT" level="project" />
  23 + <orderEntry type="library" name="Maven: net.ark3l:InventoryUtils:1.1.0-SNAPSHOT" level="project" />
16 24 </component>
17 25 <component name="org.twodividedbyzero.idea.findbugs">
18 26 <option name="_basePreferences">
6 pom.xml
@@ -6,7 +6,7 @@
6 6
7 7 <groupId>net.ark3l</groupId>
8 8 <artifactId>SpoutTrade</artifactId>
9   - <version>1.0.0-SNAPSHOT</version>
  9 + <version>1.4.8-SNAPSHOT</version>
10 10 <name>SpoutTrade</name>
11 11 <url>http://www.github.com/Mytatrea/SpoutTrade</url>
12 12 <description>GUI based item trading for Spout</description>
@@ -50,7 +50,7 @@
50 50 <dependency>
51 51 <groupId>org.bukkit</groupId>
52 52 <artifactId>craftbukkit</artifactId>
53   - <version>1.1-R4</version>
  53 + <version>1.1-R6</version>
54 54 <type>jar</type>
55 55 <scope>provided</scope>
56 56 </dependency>
@@ -64,7 +64,7 @@
64 64 <dependency>
65 65 <groupId>net.ark3l</groupId>
66 66 <artifactId>InventoryUtils</artifactId>
67   - <version>1.0.0-SNAPSHOT</version>
  67 + <version>1.1.0-SNAPSHOT</version>
68 68 <type>jar</type>
69 69 <scope>compile</scope>
70 70 </dependency>
19 src/main/java/net/ark3l/SpoutTrade/Listeners/SpoutTradeInventoryListener.java
@@ -22,14 +22,17 @@
22 22 import net.ark3l.SpoutTrade.SpoutTrade;
23 23 import net.ark3l.SpoutTrade.Trade.Trade;
24 24 import net.ark3l.SpoutTrade.Trade.TradeManager;
  25 +import org.bukkit.entity.HumanEntity;
  26 +import org.bukkit.entity.Player;
25 27 import org.bukkit.event.Event;
26 28 import org.bukkit.event.EventHandler;
27 29 import org.bukkit.event.EventPriority;
28 30 import org.bukkit.event.Listener;
  31 +import org.bukkit.event.inventory.InventoryClickEvent;
  32 +import org.bukkit.event.inventory.InventoryCloseEvent;
  33 +import org.bukkit.event.inventory.InventoryType;
29 34 import org.bukkit.inventory.Inventory;
30 35 import org.bukkit.inventory.ItemStack;
31   -import org.getspout.spoutapi.event.inventory.InventoryClickEvent;
32   -import org.getspout.spoutapi.event.inventory.InventoryCloseEvent;
33 36 import org.getspout.spoutapi.event.inventory.InventorySlotType;
34 37 import org.getspout.spoutapi.player.SpoutPlayer;
35 38
@@ -53,18 +56,24 @@ public SpoutTradeInventoryListener(SpoutTrade instance) {
53 56 @EventHandler(priority = EventPriority.HIGHEST)
54 57 public void onInventoryClick(InventoryClickEvent event) {
55 58 Event.Result result;
56   - SpoutPlayer player = (SpoutPlayer) event.getPlayer();
  59 +
  60 + HumanEntity he = event.getWhoClicked();
  61 + if(!(he instanceof Player)) {
  62 + return;
  63 + }
  64 +
  65 + SpoutPlayer player = (SpoutPlayer) he;
57 66
58 67 // ditch the event early on if the player isn't trading to avoid unnecessary work
59 68 if (!plugin.getTradeManager().isTrading(player)) {
60 69 return;
61   - } else if (event.isShiftClick() || event.getSlotType() == InventorySlotType.OUTSIDE) {
  70 + } else if (event.isShiftClick() || event.getSlotType().equals(InventoryType.SlotType.OUTSIDE)) {
62 71 event.setResult(Event.Result.DENY);
63 72 return;
64 73 }
65 74
66 75 ItemStack cursor = event.getCursor();
67   - ItemStack item = event.getItem();
  76 + ItemStack item = event.getCurrentItem();
68 77
69 78 // That would be pretty pointless....
70 79 if (cursor == null && item == null) {
2  src/main/resources/plugin.yml
... ... @@ -1,7 +1,7 @@
1 1 name: SpoutTrade
2 2 author: Arkel (Oliver Brown)
3 3 main: net.ark3l.SpoutTrade.SpoutTrade
4   -version: 1.4.7
  4 +version: 1.4.8
5 5 depend: [Spout]
6 6 commands:
7 7 trade:

0 comments on commit 1948f57

Please sign in to comment.
Something went wrong with that request. Please try again.