mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 17:39:52 -05:00
Fixing errors for NullPointerException when sign can't create.
Former-commit-id: 424e321aac6d102fcc5b58678f24ae898cb7dc5c [formerly 0642d7965cb59b3124f8425427ddf7267a75dc58] Former-commit-id: 1db3ddf433cc1931ff9c6e387891652cea29f3ca
This commit is contained in:
1 parent
ff3be1284a
commit
77338ff670
5 files changed
+15
-3
No files matched your search
@@ -922,6 +922,7 @@ public class QS implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
sender.sendMessage(ChatColor.RED + "QuickShop Statistics...");
|
||||
sender.sendMessage(ChatColor.GREEN + "Server UniqueID: " + QuickShop.getUniqueID().toString());
|
||||
sender.sendMessage(ChatColor.GREEN + "" + (buying + selling) + " shops in " + chunks
|
||||
+ " chunks spread over " + worlds + " worlds.");
|
||||
sender.sendMessage(ChatColor.GREEN + "" + doubles + " double shops. ");
|
||||
|
||||
@@ -522,6 +522,11 @@ public class ContainerShop implements Shop {
|
||||
public void setSignText() {
|
||||
if (Util.isLoaded(this.getLocation()) == false)
|
||||
return;
|
||||
if (!Util.canBeShop(this.getLocation().getBlock())) {
|
||||
this.onUnload();
|
||||
this.delete();
|
||||
Util.debugLog("We are removed a shop cause it nolonger had InventoryHolder.");
|
||||
}
|
||||
String[] lines = new String[4];
|
||||
lines[0] = MsgUtil.getMessage("signs.header", this.ownerName());
|
||||
if (this.isSelling()) {
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ShopManager {
|
||||
boolean isWaterLogged = false;
|
||||
if (info.getSignBlock().getType() == Material.WATER)
|
||||
isWaterLogged = true;
|
||||
final BlockFace bf = info.getLocation().getBlock().getFace(info.getSignBlock());
|
||||
|
||||
info.getSignBlock().setType(Util.getSignMaterial());
|
||||
BlockState bs = info.getSignBlock().getState();
|
||||
if (isWaterLogged) {
|
||||
@@ -81,8 +81,11 @@ public class ShopManager {
|
||||
waterable.setWaterlogged(true); // Looks like sign directly put in water
|
||||
}
|
||||
org.bukkit.block.data.type.WallSign signBlockDataType = (org.bukkit.block.data.type.WallSign) bs.getBlockData();
|
||||
signBlockDataType.setFacing(bf);
|
||||
bs.setBlockData(signBlockDataType);
|
||||
BlockFace bf = info.getLocation().getBlock().getFace(info.getSignBlock());
|
||||
if (bf != null) {
|
||||
signBlockDataType.setFacing(bf);
|
||||
bs.setBlockData(signBlockDataType);
|
||||
}
|
||||
bs.update(true);
|
||||
shop.setSignText();
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ public class Paste {
|
||||
finalReport.append("QuickShop:\n");
|
||||
finalReport.append("\tVersion: " + QuickShop.getVersion() + "\n");
|
||||
finalReport.append("\tFork: " + plugin.getFork() + "\n");
|
||||
finalReport.append("\tServer ID: " + QuickShop.getUniqueID().toString() + "\n");
|
||||
finalReport.append("\tOpenInv Hook: " + (plugin.getOpenInvPlugin() == null ? "Disabled" : "Enabled") + "\n");
|
||||
finalReport.append("\tMV Hook: " + (plugin.getMvPlugin() == null ? "Disabled" : "Enabled") + "\n");
|
||||
//finalReport.append("Fork: "+plugin.+"\n");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.maxgamer.quickshop.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Filter;
|
||||
import java.util.logging.Level;
|
||||
@@ -113,6 +114,7 @@ public class SentryErrorReporter {
|
||||
|
||||
private boolean checkWasCauseByQS(Throwable throwable) {
|
||||
StackTraceElement[] stackTraces = throwable.getStackTrace();
|
||||
Arrays.stream(stackTraces).f
|
||||
for (StackTraceElement stackTraceElement : stackTraces) {
|
||||
boolean byqs = stackTraceElement.getClassName().contains("org.maxgamer.quickshop");
|
||||
if (byqs) {
|
||||
|
||||
Reference in new issue
Block a user