1. fonkfader
  2. EmeraldEconLink

Commits

fonkfader  committed d7c2ced

- fix dupe bug in inventory holders

  • Participants
  • Parent commits f2dbdd8
  • Branches default

Comments (0)

Files changed (21)

File bin/me/fonkfader/EmeraldEconLink/Checks$2.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/Checks$3.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/Checks$4.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/Checks.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/Commands.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/ContenerListener$1.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/ContenerListener$2.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/ContenerListener$3.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/ContenerListener$4.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/ContenerListener$5.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/ContenerListener$6.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/ContenerListener$7.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/ContenerListener$8.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/ContenerListener.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/DropsListeners.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/EmeraldEconLink.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/Signs.class

  • Ignore whitespace
Binary file modified.

File bin/me/fonkfader/EmeraldEconLink/Utils.class

  • Ignore whitespace
Binary file modified.

File bin/plugin.yml

View file
  • Ignore whitespace
-main: me.fonkfader.EmeraldEconLink.EmeraldEconLink
-name: EmeraldEconLink
-version: 2.1.2
-author: Fonkfader
-description: use items as currency.
-softdepend : [Vault]
-commands:
-  eel:
-    description : withdraw bank account into money
-    aliases: cash
-    usage: |
-      /eel [add/take/send/info] [amount] (item) (player)
-      Example: /eel send 100 player
-      Example: /eel add 100 
-permissions:
-  eel.*:
-    description: Gives access to all EmeraldsEconLink commands
-    children:
-      eel.take: true
-      eel.add: true
-      eel.send: true
-      eel.change: true
-      eel.info: true
-  eel.add:
-    description: Allows you to add currency to account
-    default: false
-  eel.take:
-    description: Allows you to take currency from account
-    default: false
-  eel.send:
-    description: Allows you to send money to other players
-    default: false
-  eel.change:
-    description: Allows you to change your currency.
-    default: false
-  eel.info:
-    description: Allows you to send money to other players
-    default: false
-  eel.dispenser.*:
-    description: Gives access to all signs.
-    children:
-      eel.dispenser.add: true
-      eel.dispenser.take: true
-      eel.dispenser.change: true
-  eel.dispenser.add:
-    description: Allows you to add currency to account in dispenser signs
-    default: false
-  eel.dispenser.take:
-    description: Allows you to take currency from account in dispenser signs
-    default: false
-  eel.dispenser.change:
-    description: Allows you to change currency on change signs
-    default: false
-  eel.dispenser.create.*:
-    description: Gives access to all signs creation
-    children:
-      eel.dispenser.create.add: true
-      eel.dispenser.create.take: true
-      eel.dispenser.create.change: true
-  eel.dispenser.create.add:
-    description: Allows you to create dispenser deposit sign
-    default: false
-  eel.dispenser.create.take:
-    description: Allows you to create dispenser take sign
-    default: false
-  eel.dispenser.create.change:
-    description: Allows you to create change sign
-    default: false
-  eel.reload:
-    description: Allows acces to /eel reload command
+main: me.fonkfader.EmeraldEconLink.EmeraldEconLink
+name: EmeraldEconLink
+version: 2.1.2
+author: Fonkfader
+description: use items as currency.
+softdepend : [Vault]
+commands:
+  eel:
+    description : withdraw bank account into money
+    aliases: cash
+    usage: |
+      /eel [add/take/send/info] [amount] (item) (player)
+      Example: /eel send 100 player
+      Example: /eel add 100 
+permissions:
+  eel.*:
+    description: Gives access to all EmeraldsEconLink commands
+    children:
+      eel.take: true
+      eel.add: true
+      eel.send: true
+      eel.change: true
+      eel.info: true
+  eel.add:
+    description: Allows you to add currency to account
+    default: false
+  eel.take:
+    description: Allows you to take currency from account
+    default: false
+  eel.send:
+    description: Allows you to send money to other players
+    default: false
+  eel.change:
+    description: Allows you to change your currency.
+    default: false
+  eel.info:
+    description: Allows you to send money to other players
+    default: false
+  eel.dispenser.*:
+    description: Gives access to all signs.
+    children:
+      eel.dispenser.add: true
+      eel.dispenser.take: true
+      eel.dispenser.change: true
+  eel.dispenser.add:
+    description: Allows you to add currency to account in dispenser signs
+    default: false
+  eel.dispenser.take:
+    description: Allows you to take currency from account in dispenser signs
+    default: false
+  eel.dispenser.change:
+    description: Allows you to change currency on change signs
+    default: false
+  eel.dispenser.create.*:
+    description: Gives access to all signs creation
+    children:
+      eel.dispenser.create.add: true
+      eel.dispenser.create.take: true
+      eel.dispenser.create.change: true
+  eel.dispenser.create.add:
+    description: Allows you to create dispenser deposit sign
+    default: false
+  eel.dispenser.create.take:
+    description: Allows you to create dispenser take sign
+    default: false
+  eel.dispenser.create.change:
+    description: Allows you to create change sign
+    default: false
+  eel.reload:
+    description: Allows acces to /eel reload command
     default: false

File src/me/fonkfader/EmeraldEconLink/ContenerListener.java

View file
  • Ignore whitespace
 		final Player p = (Player) e.getWhoClicked();
 		final String name = p.getName();
 		String skname = null;
+		int itemId2 = 0;
+		int cost2 = 0;
+		if (e.getCurrentItem() != null) {
+			int item = e.getCursor().getTypeId();
+
+			for (int i = 0; i < Configuration.itemsId.size(); i++) {
+				if (item == Configuration.itemsId.get(i)) {
+					itemId2 = Configuration.itemsId.get(i);
+					cost2 = Configuration.itemsCost.get(i);
+				}
+			}
+			for (int i = 0; i < Configuration.blocksId.size(); i++) {
+				if (item == Configuration.blocksId.get(i)) {
+					itemId2 = Configuration.blocksId.get(i);
+					cost2 = Utils.blockcost(Configuration.itemsCanBeBlock
+							.get(i));
+				}
+			}
+		}
 
 		if (e.isCancelled()) {
 			return;
 							&& (e.getCursor().getType().getId() == itemId)) {
 
 						// si le slot cliqu� est vide
-						if (e.getCurrentItem().getType().getId() != itemId) {
-
+						if (e.getCurrentItem().getType().getId() == 0) {
 							if (e.isShiftClick() == true) {
 								return;
 							} else if (e.isRightClick()) {
 											amountOnCursor));
 								}
 							}
-							// si le slot contient deja l'item
+
+						} else if ((e.getCurrentItem().getType().getId() != 0)
+								&& (e.getCurrentItem().getType().getId() != itemId)) {
+
+							if (e.isShiftClick() == true) {
+								return;
+							} else {
+
+								EmeraldEconLink.econ.withdrawPlayer(name,
+										amountOnCursor);
+
+								if (!Configuration.DisableChatMessage) {
+									p.sendMessage(Utils.messageRemove(p,
+											amountOnCursor));
+								}
+							}
+
 						} else if (e.getCurrentItem().getType().getId() == itemId) {
 
 							if (e.isShiftClick()) {
 													name,
 													Utils.howManyItemsCanHold(
 															p, itemId) * cost);
+
 									if (!Configuration.DisableChatMessage) {
 
 										p.sendMessage(Utils.messageAdd(
 						}
 						// fonctionnement pour le credit, pas besoins de check
 					} else if ((e.getRawSlot() < (slot - 36))
-							&& (e.getCursor().getType().getId() != itemId)) {
+							&& (e.getCursor().getType().getId() == 0)) {
 
 						if (e.getCurrentItem().getType().getId() == itemId) {
 
 									}
 								} else
 									return;
-							} else if (e.isRightClick()) {
+							} else if ((e.isRightClick())) {
 
 								int amount4 = (e.getCurrentItem().getAmount() / 2)
 										* cost;
 										p.sendMessage(Utils.messageAdd(p,
 												amount5));
 									}
+									if ((e.getCursor().getTypeId() == itemId2)
+											&& (itemId2 != 0)) {
+
+										EmeraldEconLink.econ.withdrawPlayer(
+												name, e.getCursor().getAmount()
+														* cost2);
+										if (!Configuration.DisableChatMessage) {
+
+											p.sendMessage(Utils.messageRemove(
+													p, e.getCursor()
+															.getAmount()
+															* cost2));
+										}
+									}
 								} else {
+
 									EmeraldEconLink.econ.depositPlayer(name,
 											amount4);
 
 										p.sendMessage(Utils.messageAdd(p,
 												amount4));
 									}
+									if ((e.getCursor().getTypeId() == itemId2)
+											&& (itemId2 != 0)) {
+
+										EmeraldEconLink.econ.withdrawPlayer(
+												name, e.getCursor().getAmount()
+														* cost2);
+										if (!Configuration.DisableChatMessage) {
+
+											p.sendMessage(Utils.messageRemove(
+													p, e.getCursor()
+															.getAmount()
+															* cost2));
+										}
+									}
 								}
 							} else {
 								EmeraldEconLink.econ.depositPlayer(name,
 									p.sendMessage(Utils.messageAdd(p,
 											amountInSlot));
 								}
+								if ((e.getCursor().getTypeId() == itemId2)
+										&& (itemId2 != 0)) {
+									EmeraldEconLink.econ.withdrawPlayer(name, e
+											.getCursor().getAmount() * cost2);
+									if (!Configuration.DisableChatMessage) {
+
+										p.sendMessage(Utils.messageRemove(p, e
+												.getCursor().getAmount()
+												* cost2));
+									}
+								}
 							}
 						}
 						// si il y a shiftclic depuis l'inventaire du joueur
-					} else if ((e.getRawSlot() > (slot - 37))
+					} else if ((e.getRawSlot() < (slot - 36))
+							&& (e.getCursor().getType().getId() != 0)
+							&& (e.getCursor().getType().getId() != 0)) {
+
+						if (e.getCurrentItem().getType().getId() == itemId) {
+
+							if (e.isShiftClick()) {
+
+								int getAmount = e.getCurrentItem().getAmount();
+
+								if (getAmount <= Utils.howManyItemsCanHold(p,
+										itemId)) {
+
+									EmeraldEconLink.econ.depositPlayer(name,
+											amountInSlot);
+
+									if (!Configuration.DisableChatMessage) {
+
+										p.sendMessage(Utils.messageAdd(p,
+												amountInSlot));
+									}
+								} else if ((Utils
+										.howManyItemsCanHold(p, itemId) < getAmount)
+										&& (Utils
+												.howManyItemsCanHold(p, itemId) > 0)) {
+
+									EmeraldEconLink.econ
+											.depositPlayer(
+													name,
+													Utils.howManyItemsCanHold(
+															p, itemId) * cost);
+
+									if (!Configuration.DisableChatMessage) {
+										p.sendMessage(Utils.messageAdd(
+												p,
+												Utils.howManyItemsCanHold(p,
+														itemId) * cost));
+									}
+								} else
+									return;
+							} else if ((e.isRightClick())) {
+
+								int amount4 = (e.getCurrentItem().getAmount())
+										* cost;
+
+								EmeraldEconLink.econ.depositPlayer(name,
+										amount4);
+
+								if (!Configuration.DisableChatMessage) {
+
+									p.sendMessage(Utils.messageAdd(p, amount4));
+								}
+								if ((e.getCursor().getTypeId() == itemId2)
+										&& (itemId2 != 0)) {
+
+									EmeraldEconLink.econ.withdrawPlayer(name, e
+											.getCursor().getAmount() * cost2);
+									if (!Configuration.DisableChatMessage) {
+
+										p.sendMessage(Utils.messageRemove(p, e
+												.getCursor().getAmount()
+												* cost2));
+									}
+								}
+
+							} else {
+								EmeraldEconLink.econ.depositPlayer(name,
+										amountInSlot);
+
+								if (!Configuration.DisableChatMessage) {
+
+									p.sendMessage(Utils.messageAdd(p,
+											amountInSlot));
+								}
+								if ((e.getCursor().getTypeId() == itemId2)
+										&& (itemId2 != 0)) {
+									EmeraldEconLink.econ.withdrawPlayer(name, e
+											.getCursor().getAmount() * cost2);
+									if (!Configuration.DisableChatMessage) {
+
+										p.sendMessage(Utils.messageRemove(p, e
+												.getCursor().getAmount()
+												* cost2));
+									}
+								}
+							}
+						}
+						// si il y a shiftclic depuis l'inventaire du joueur
+
+					}
+
+					else if ((e.getRawSlot() > (slot - 37))
 							&& (e.getCurrentItem().getType().getId() == itemId)
 							&& (e.isShiftClick())) {
 

File src/plugin.yml

View file
  • Ignore whitespace
-main: me.fonkfader.EmeraldEconLink.EmeraldEconLink
-name: EmeraldEconLink
-version: 2.1.2
-author: Fonkfader
-description: use items as currency.
-softdepend : [Vault]
-commands:
-  eel:
-    description : withdraw bank account into money
-    aliases: cash
-    usage: |
-      /eel [add/take/send/info] [amount] (item) (player)
-      Example: /eel send 100 player
-      Example: /eel add 100 
-permissions:
-  eel.*:
-    description: Gives access to all EmeraldsEconLink commands
-    children:
-      eel.take: true
-      eel.add: true
-      eel.send: true
-      eel.change: true
-      eel.info: true
-  eel.add:
-    description: Allows you to add currency to account
-    default: false
-  eel.take:
-    description: Allows you to take currency from account
-    default: false
-  eel.send:
-    description: Allows you to send money to other players
-    default: false
-  eel.change:
-    description: Allows you to change your currency.
-    default: false
-  eel.info:
-    description: Allows you to send money to other players
-    default: false
-  eel.dispenser.*:
-    description: Gives access to all signs.
-    children:
-      eel.dispenser.add: true
-      eel.dispenser.take: true
-      eel.dispenser.change: true
-  eel.dispenser.add:
-    description: Allows you to add currency to account in dispenser signs
-    default: false
-  eel.dispenser.take:
-    description: Allows you to take currency from account in dispenser signs
-    default: false
-  eel.dispenser.change:
-    description: Allows you to change currency on change signs
-    default: false
-  eel.dispenser.create.*:
-    description: Gives access to all signs creation
-    children:
-      eel.dispenser.create.add: true
-      eel.dispenser.create.take: true
-      eel.dispenser.create.change: true
-  eel.dispenser.create.add:
-    description: Allows you to create dispenser deposit sign
-    default: false
-  eel.dispenser.create.take:
-    description: Allows you to create dispenser take sign
-    default: false
-  eel.dispenser.create.change:
-    description: Allows you to create change sign
-    default: false
-  eel.reload:
-    description: Allows acces to /eel reload command
+main: me.fonkfader.EmeraldEconLink.EmeraldEconLink
+name: EmeraldEconLink
+version: 2.1.2
+author: Fonkfader
+description: use items as currency.
+softdepend : [Vault]
+commands:
+  eel:
+    description : withdraw bank account into money
+    aliases: cash
+    usage: |
+      /eel [add/take/send/info] [amount] (item) (player)
+      Example: /eel send 100 player
+      Example: /eel add 100 
+permissions:
+  eel.*:
+    description: Gives access to all EmeraldsEconLink commands
+    children:
+      eel.take: true
+      eel.add: true
+      eel.send: true
+      eel.change: true
+      eel.info: true
+  eel.add:
+    description: Allows you to add currency to account
+    default: false
+  eel.take:
+    description: Allows you to take currency from account
+    default: false
+  eel.send:
+    description: Allows you to send money to other players
+    default: false
+  eel.change:
+    description: Allows you to change your currency.
+    default: false
+  eel.info:
+    description: Allows you to send money to other players
+    default: false
+  eel.dispenser.*:
+    description: Gives access to all signs.
+    children:
+      eel.dispenser.add: true
+      eel.dispenser.take: true
+      eel.dispenser.change: true
+  eel.dispenser.add:
+    description: Allows you to add currency to account in dispenser signs
+    default: false
+  eel.dispenser.take:
+    description: Allows you to take currency from account in dispenser signs
+    default: false
+  eel.dispenser.change:
+    description: Allows you to change currency on change signs
+    default: false
+  eel.dispenser.create.*:
+    description: Gives access to all signs creation
+    children:
+      eel.dispenser.create.add: true
+      eel.dispenser.create.take: true
+      eel.dispenser.create.change: true
+  eel.dispenser.create.add:
+    description: Allows you to create dispenser deposit sign
+    default: false
+  eel.dispenser.create.take:
+    description: Allows you to create dispenser take sign
+    default: false
+  eel.dispenser.create.change:
+    description: Allows you to create change sign
+    default: false
+  eel.reload:
+    description: Allows acces to /eel reload command
     default: false