Skip to content

Commit

Permalink
fix: empty spell projectile hit entity no longer causes NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
ybw0014 committed Dec 8, 2023
1 parent addfd63 commit 448081c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
19 changes: 7 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
<id>jeff-media-public</id>
<url>https://hub.jeff-media.com/nexus/repository/jeff-media-public/</url>
</repository>
<repository>
<id>sefi-central</id>
<name>Sefiraat</name>
<url>https://sefiraat.jfrog.io/artifactory/default-maven-local</url>
</repository>
<repository>
<id>bg-repo</id>
<url>https://repo.bg-software.com/repository/api/</url>
Expand Down Expand Up @@ -170,9 +165,9 @@

<!-- Supported Plugins -->
<dependency>
<groupId>net.guizhanss</groupId>
<groupId>com.github.SlimefunGuguProject</groupId>
<artifactId>ExoticGarden</artifactId>
<version>171aca2211</version>
<version>edae221160</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -188,9 +183,9 @@
</exclusions>
</dependency>
<dependency>
<groupId>io.github.sefiraat</groupId>
<artifactId>networks</artifactId>
<version>MODIFIED_1.0.7</version>
<groupId>com.github.Sefiraat</groupId>
<artifactId>Networks</artifactId>
<version>3de3c9d608</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -220,7 +215,7 @@

<!-- To be removed, do not use further -->
<dependency>
<groupId>net.guizhanss</groupId>
<groupId>com.github.SlimefunGuguProject</groupId>
<artifactId>InfinityLib</artifactId>
<version>1.3.9</version>
<scope>compile</scope>
Expand All @@ -230,7 +225,7 @@
<dependency>
<groupId>net.guizhanss</groupId>
<artifactId>GuizhanLibPlugin</artifactId>
<version>1.1.1</version>
<version>1.6.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
import io.github.sefiraat.crystamaehistoria.stories.BlockDefinition;
import io.github.thebusybiscuit.slimefun4.libraries.dough.collections.Pair;
import io.github.thebusybiscuit.slimefun4.libraries.paperlib.PaperLib;
import net.guizhanss.guizhanlib.updater.GuizhanBuildsUpdater;
import net.guizhanss.guizhanlibplugin.updater.GuizhanBuildsUpdaterWrapper;
import net.guizhanss.guizhanlibplugin.updater.GuizhanUpdater;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.AdvancedPie;
import org.bukkit.plugin.PluginManager;
Expand Down Expand Up @@ -176,7 +175,7 @@ public void enable() {
}

if (getConfig().getBoolean("auto-update") && getDescription().getVersion().startsWith("Build")) {
GuizhanBuildsUpdaterWrapper.start(this, getFile(), "SlimefunGuguProject", "CrystamaeHistoria", "master", false);
GuizhanUpdater.start(this, getFile(), "SlimefunGuguProject", "CrystamaeHistoria", "master");
}

this.configManager = new ConfigManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public void onFallingBlockLands(EntityChangeBlockEvent event) {
}

private boolean entityHitAllowed(CastInformation castInformation, Entity hitEntity) {
if (hitEntity == null) {
return false;
}
final Player player = Bukkit.getPlayer(castInformation.getCaster());
final Interaction interaction = hitEntity instanceof Player ? Interaction.ATTACK_PLAYER : Interaction.ATTACK_ENTITY;
if (player != null && GeneralUtils.hasPermission(player, hitEntity.getLocation(), interaction)) {
Expand Down

0 comments on commit 448081c

Please sign in to comment.