Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Version 1.13-0.9.39-beta
Browse files Browse the repository at this point in the history
This is a Bukkit 1.13 only compatible version. This build may not be
suitable for production environment.

Notes and known bugs:
- The display item above the chest will not be shown
- Potions aren't being named automatically
- If the "shop.auto-sign" option on the config is on, the sign will be
placed facing south, so I suggest turning it off and letting players
place their own signs
- Not all tools duration are being shown on the shop details
- A lot more...
  • Loading branch information
KaiKikuchi committed Aug 10, 2018
1 parent 150f67f commit a89dc69
Show file tree
Hide file tree
Showing 13 changed files with 125 additions and 193 deletions.
50 changes: 4 additions & 46 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.maxgamer</groupId>
<artifactId>QuickShop</artifactId>
<version>0.9.38</version>
<version>1.13-0.9.39-beta</version>

<licenses>
<license>
Expand Down Expand Up @@ -61,19 +61,19 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.9.4-R0.1-SNAPSHOT</version>
<version>1.13-R0.1-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>6.0.0-SNAPSHOT</version>
<version>6.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.5</version>
<version>1.6</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -83,48 +83,6 @@
<scope>system</scope>
<systemPath>${basedir}/lib/HeroChat.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit.craftbukkit.v1_7_R3</groupId>
<artifactId>craftbukkit</artifactId>
<version>v1_7_R3</version>
<scope>system</scope>
<systemPath>${basedir}/lib/craftbukkit-1.7.9-R0.2.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit.craftbukkit.v1_8_R3</groupId>
<artifactId>craftbukkit</artifactId>
<version>v1_8_R3</version>
<scope>system</scope>
<systemPath>${basedir}/lib/craftbukkit-1.8.8-R0.1.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit.craftbukkit.v1_9_R2</groupId>
<artifactId>craftbukkit</artifactId>
<version>v1_9_R2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/craftbukkit-1.9.4-R0.1-SNAPSHOT-latest.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit.craftbukkit.v1_10_R1</groupId>
<artifactId>spigot</artifactId>
<version>v1_10_R1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/spigot-1.10.2-R0.1-SNAPSHOT-latest.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit.craftbukkit.v1_11_R1</groupId>
<artifactId>spigot</artifactId>
<version>v1_11_R1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/spigot-1.11.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bukkit.craftbukkit.v1_12_R1</groupId>
<artifactId>spigot</artifactId>
<version>v1_12_R1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/spigot-1.12-SNAPSHOT.jar</systemPath>
</dependency>
</dependencies>
<properties>
<package>org.maxgamer.quickshop</package>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/maxgamer/quickshop/Command/QS.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ private void create(CommandSender sender, String[] args) {
p.sendMessage(MsgUtil.getMessage("no-double-chests"));
return;
}
if (Util.isBlacklisted(item.getType()) && !p.hasPermission("quickshop.bypass." + item.getTypeId())) {
if (Util.isBlacklisted(item.getType()) && !p.hasPermission("quickshop.bypass." + item.getType().name())) {
p.sendMessage(MsgUtil.getMessage("blacklisted-item"));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ else if (!e.isCancelled() && shop == null && item != null && item.getType() != M
p.sendMessage(MsgUtil.getMessage("no-double-chests"));
return;
}
if (Util.isBlacklisted(item.getType()) && !p.hasPermission("quickshop.bypass." + item.getTypeId())) {
if (Util.isBlacklisted(item.getType()) && !p.hasPermission("quickshop.bypass." + item.getType().name())) {
p.sendMessage(MsgUtil.getMessage("blacklisted-item"));
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/maxgamer/quickshop/QuickShop.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public int getShopLimit(Player p) {
}

public void onEnable() {
NMS.init();
//NMS.init();

instance = this;
saveDefaultConfig(); // Creates the config folder and copies config.yml
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ public boolean isValid() {
}

private void checkDisplay() {
if (plugin.display == false)
/*if (plugin.display == false)
return;
if (getLocation().getWorld() == null)
return; // not loaded
Expand Down Expand Up @@ -626,7 +626,7 @@ private void checkDisplay() {
} else if (item.getLocation().distanceSquared(dispLoc) > 1) {
item.teleport(dispLoc, TeleportCause.PLUGIN);
}
}
}*/
}

public boolean checkDisplayMoved() {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public DisplayItem(Shop shop, ItemStack iStack) {
* Spawns the dummy item on top of the shop.
*/
public void spawn() {
if (shop.getLocation().getWorld() == null)
/*if (shop.getLocation().getWorld() == null)
return;
Location dispLoc = this.getDisplayLocation();
this.item = shop.getLocation().getWorld().dropItem(dispLoc, this.iStack);
Expand All @@ -50,7 +50,7 @@ public void spawn() {
} catch (Exception e) {
e.printStackTrace();
System.out.println("QuickShop version mismatch! This version of QuickShop is incompatible with this version of bukkit! Try update?");
}
}*/
}

/**
Expand Down Expand Up @@ -98,10 +98,10 @@ public boolean removeDupe() {
* Removes the display item.
*/
public void remove() {
if (this.item == null)
/*if (this.item == null)
return;
this.item.remove();
this.item = null;
this.item = null;*/
}

/**
Expand Down
28 changes: 0 additions & 28 deletions src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,34 +375,6 @@ public void run() {
sign.setFacingDirection(bf);
bs.update(true);
shop.setSignText();
/*
* Block b = shop.getLocation().getBlock();
* ItemFrame iFrame = (ItemFrame)
* b.getWorld().spawnEntity(b.getLocation(),
* EntityType.ITEM_FRAME);
*
* BlockFace[] faces = new
* BlockFace[]{BlockFace.NORTH, BlockFace.EAST,
* BlockFace.SOUTH, BlockFace.WEST}; for(BlockFace
* face : faces){ if(face == bf) continue; //This is
* the sign's location iFrame.setFacingDirection(bf,
* true); //iFrame.setItem(shop.getItem());
* ItemStack iStack = shop.getItem().clone();
* iStack.setAmount(0); iFrame.setItem(iStack); /*
* Field handleField =
* iFrame.getClass().getField("entity");
* handleField.setAccessible(true); Object handle =
* handleField.get(iFrame);
*
* ItemStack bukkitStack = shop.getItem();
*
* Field itemStackHandle =
*
* Method setItemStack =
* handle.getClass().getMethod("a", Object.class);
* setItemStack.
*/
// }
}
if (shop instanceof ContainerShop) {
ContainerShop cs = (ContainerShop) shop;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class CustomPotionsName {
private static String[] signFormat, shopInfoFormat;

private CustomPotionsName() {}

/*
public static String getSignName(ItemStack potionItemStack) {
GenericPotionData potion = NMS.getPotionData(potionItemStack);
if (potion==null) {
Expand Down Expand Up @@ -125,7 +125,7 @@ public static String getEffects(ItemStack potionItemStack) {
return sb.toString();
}

*/
public static class Names {
private String sign, full;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ public static void sendShopInfo(Player p, Shop shop) {
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.shop-information"));
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.owner", shop.ownerName()));
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.item", shop.getDataName()));
if (NMS.isPotion(items.getType())) {
/*if (NMS.isPotion(items.getType())) {
String effects = CustomPotionsName.getEffects(items);
if (!effects.isEmpty()) {
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.effects", effects));
}
}
}*/
if (Util.isTool(items.getType())) {
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.damage-percent-remaining", Util.getToolPercentage(items)));
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/maxgamer/quickshop/Util/NMS.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package org.maxgamer.quickshop.Util;

/*
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -27,10 +27,10 @@
import org.maxgamer.quickshop.QuickShop;
import org.maxgamer.quickshop.Util.CustomPotionsName.GenericPotionData;
import org.maxgamer.quickshop.Util.CustomPotionsName.GenericPotionData.Category;

@SuppressWarnings("deprecation")
*/
//@SuppressWarnings("deprecation")
public class NMS {
private static ArrayList<NMSDependent> nmsDependencies = new ArrayList<NMSDependent>();
/*private static ArrayList<NMSDependent> nmsDependencies = new ArrayList<NMSDependent>();
private static int nextId = 0;
private static NMSDependent nms;
Expand Down Expand Up @@ -573,7 +573,7 @@ public static boolean isPotion(Material material) {
public static GenericPotionData getPotionData(ItemStack potion) {
return nms.getPotionData(potion);
}
}*/

/*private static void protect(Item item) {
try {
Expand Down Expand Up @@ -607,7 +607,7 @@ public static GenericPotionData getPotionData(ItemStack potion) {
e.printStackTrace();
}
}*/

/*
private static abstract class NMSDependent {
private String version;
Expand All @@ -632,5 +632,5 @@ public byte[] getNBTBytes(org.bukkit.inventory.ItemStack paramItemStack) {
public org.bukkit.inventory.ItemStack getItemStack(byte[] paramArrayOfByte) {
throw new UnsupportedOperationException();
}
}
}*/
}
Loading

0 comments on commit a89dc69

Please sign in to comment.