Fixed NPE error when dependency plugin not found
Fixed Chat error causing chat prefixes to stop working Updated to QuickShop Reremake 3.0.2 API Dropped filename versioning number.
This commit is contained in:
parent
3a05a15ac6
commit
5334d90daa
BIN
lib/QuickShop-Reremake.3.0.2.jar
Normal file
BIN
lib/QuickShop-Reremake.3.0.2.jar
Normal file
Binary file not shown.
6
pom.xml
6
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.judgetread</groupId>
|
<groupId>com.github.judgetread</groupId>
|
||||||
<artifactId>GriefPreventionQuickShopBridge</artifactId>
|
<artifactId>GriefPreventionQuickShopBridge</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.1.0</version>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
@ -32,6 +32,7 @@
|
|||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@ -41,6 +42,7 @@
|
|||||||
<source>1.8</source>
|
<source>1.8</source>
|
||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
|
<outputFileName>${project.artifactId}</outputFileName>
|
||||||
<!--Use this comments args when compiler is NullPointerException-->
|
<!--Use this comments args when compiler is NullPointerException-->
|
||||||
<!--<forceJavacCompilerUse>true</forceJavacCompilerUse>-->
|
<!--<forceJavacCompilerUse>true</forceJavacCompilerUse>-->
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -143,7 +145,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.maxgamer</groupId>
|
<groupId>org.maxgamer</groupId>
|
||||||
<artifactId>QuickShop</artifactId>
|
<artifactId>QuickShop</artifactId>
|
||||||
<version>Reremake 2.4.9.1</version>
|
<version>Reremake 3.0.2</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${basedir}/lib/QuickShop-Reremake.2.4.9.jar</systemPath>
|
<systemPath>${basedir}/lib/QuickShop-Reremake.2.4.9.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -79,6 +79,11 @@ public class GriefPreventionQuickShopBridge extends JavaPlugin {
|
|||||||
*/
|
*/
|
||||||
private void startup() {
|
private void startup() {
|
||||||
loadHooks();
|
loadHooks();
|
||||||
|
if(griefPrevention == null || quickShop == null){
|
||||||
|
Bukkit.getConsoleSender().sendMessage(" Missing dependency of either GriefPrevention or QuickShop");
|
||||||
|
Bukkit.getConsoleSender().sendMessage(" Unable to ");
|
||||||
|
this.getPluginLoader().disablePlugin(this);
|
||||||
|
}
|
||||||
registerListeners();
|
registerListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,8 +118,8 @@ public class GriefPreventionQuickShopBridge extends JavaPlugin {
|
|||||||
*/
|
*/
|
||||||
private void loadHooks() {
|
private void loadHooks() {
|
||||||
Bukkit.getConsoleSender().sendMessage(" Loading Hooks...");
|
Bukkit.getConsoleSender().sendMessage(" Loading Hooks...");
|
||||||
griefPrevention = hookPlugin(this.getName() + " GriefPrevention");
|
griefPrevention = hookPlugin("GriefPrevention");
|
||||||
quickShop = hookPlugin(this.getName() + " QuickShop");
|
quickShop = hookPlugin("QuickShop");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -135,7 +140,7 @@ public class GriefPreventionQuickShopBridge extends JavaPlugin {
|
|||||||
* @param pluginName String name of the plugin.
|
* @param pluginName String name of the plugin.
|
||||||
* @return Plugin
|
* @return Plugin
|
||||||
*/
|
*/
|
||||||
private @Nullable Plugin hookPlugin(@NotNull @NonNull String pluginName) {
|
private @Nullable Plugin hookPlugin(@NotNull String pluginName) {
|
||||||
@Nullable Plugin thirdPlugin = Bukkit.getPluginManager().getPlugin(pluginName);
|
@Nullable Plugin thirdPlugin = Bukkit.getPluginManager().getPlugin(pluginName);
|
||||||
if (thirdPlugin != null) {
|
if (thirdPlugin != null) {
|
||||||
Bukkit.getConsoleSender().sendMessage(" Hooked: " + pluginName);
|
Bukkit.getConsoleSender().sendMessage(" Hooked: " + pluginName);
|
||||||
|
@ -28,7 +28,7 @@ public class GriefPreventionListener implements Listener {
|
|||||||
/**
|
/**
|
||||||
* GriefPrevention Claim Delete Event
|
* GriefPrevention Claim Delete Event
|
||||||
*
|
*
|
||||||
* @param event
|
* @param event ClaimDeletedEvent
|
||||||
*/
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onClaimDeleteEvent(ClaimDeletedEvent event) {
|
public void onClaimDeleteEvent(ClaimDeletedEvent event) {
|
||||||
@ -40,7 +40,7 @@ public class GriefPreventionListener implements Listener {
|
|||||||
/**
|
/**
|
||||||
* GriefPrevention Claim Expire Event
|
* GriefPrevention Claim Expire Event
|
||||||
*
|
*
|
||||||
* @param event
|
* @param event ClaimExpirationEvent
|
||||||
*/
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onClaimExpireEvent(ClaimExpirationEvent event) {
|
public void onClaimExpireEvent(ClaimExpirationEvent event) {
|
||||||
@ -55,8 +55,8 @@ public class GriefPreventionListener implements Listener {
|
|||||||
*
|
*
|
||||||
* @param claim A GriefPrevention claim
|
* @param claim A GriefPrevention claim
|
||||||
*/
|
*/
|
||||||
private void deleteAllShopsInClaim(final Claim claim) {
|
private void deleteAllShopsInClaim(Claim claim) {
|
||||||
if(claim == null){
|
if(claim == null || claim.equals(null)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,9 +81,9 @@ public class GriefPreventionListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try force saving of chunk ???
|
// Try force saving of chunk ???
|
||||||
loc.getChunk().addPluginChunkTicket(plugin);
|
//loc.getChunk().addPluginChunkTicket(plugin);
|
||||||
shop.delete(false);
|
shop.delete(false);
|
||||||
loc.getChunk().removePluginChunkTicket(plugin);
|
//loc.getChunk().removePluginChunkTicket(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user