This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ReefRealm/TradeAndStoreSystem
Add new Store class and update TradeSystem in SkyPVP
- Loading branch information
Showing
2 changed files
with
30 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package net.reefrealm.reefrealmskypvp.store; | ||
|
||
public class Store { | ||
/*TODO | ||
- Add store command | ||
- Buy stuff | ||
*/ | ||
} |
35 changes: 22 additions & 13 deletions
35
src/main/java/net/reefrealm/reefrealmskypvp/trading/TradeSystem.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
package net.reefrealm.reefrealmskypvp.trading; | ||
|
||
public class TradeSystem { | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerInteractEntityEvent; | ||
import org.bukkit.event.player.PlayerInteractEvent; | ||
|
||
public class TradeSystem implements Listener { | ||
|
||
@EventHandler | ||
public void ClickPlayerEvent(PlayerInteractEntityEvent event){ | ||
if (event.getRightClicked() instanceof Player) { | ||
Player player = event.getPlayer(); | ||
Player target = (Player) event.getRightClicked(); | ||
if (player.getItemInHand().getType().equals(Material.EMERALD)) { | ||
player.sendMessage("You have clicked on " + target.getName()); | ||
target.sendMessage(player.getName() + " has clicked on you"); | ||
} | ||
} | ||
|
||
} | ||
|
||
|
||
/*TODO | ||
- Add trade command | ||
- Add trade accept command | ||
- Add trade deny command | ||
- Add trade cancel command | ||
- Add trade list command | ||
- Add trade remove command | ||
- Add trade top command | ||
- Add trade pay command | ||
- Add trade give command | ||
- Add trade take command | ||
*/ | ||
} |