diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/config/SingleItemParser.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/config/SingleItemParser.java index 20a4583d..074068bc 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/config/SingleItemParser.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/config/SingleItemParser.java @@ -41,6 +41,10 @@ public class SingleItemParser { public SingleItemParser(String id, Section section, Map> functionMap) { this.id = id; + if (section == null) { + this.material = "AIR"; + return; + } this.material = section.getString("material"); analyze(section, functionMap); } diff --git a/core/src/main/java/net/momirealms/customfishing/bukkit/totem/ActivatedTotem.java b/core/src/main/java/net/momirealms/customfishing/bukkit/totem/ActivatedTotem.java index fe7edaac..8860f56b 100644 --- a/core/src/main/java/net/momirealms/customfishing/bukkit/totem/ActivatedTotem.java +++ b/core/src/main/java/net/momirealms/customfishing/bukkit/totem/ActivatedTotem.java @@ -41,15 +41,16 @@ public class ActivatedTotem { private final double radius; public ActivatedTotem(Player activator, Location coreLocation, TotemConfig config) { + this.coreLocation = coreLocation.clone().add(0.5,0.5,0.5); this.context = Context.player(activator, true) - .arg(ContextKeys.LOCATION, coreLocation) + .arg(ContextKeys.LOCATION, this.coreLocation) + .arg(ContextKeys.OTHER_LOCATION, this.coreLocation) .arg(ContextKeys.X, coreLocation.getBlockX()) .arg(ContextKeys.Y, coreLocation.getBlockY()) .arg(ContextKeys.Z, coreLocation.getBlockZ()) .arg(ContextKeys.ID, config.id()); this.subTasks = new ArrayList<>(); this.expireTime = (long) (System.currentTimeMillis() + config.duration().evaluate(context) * 1000L); - this.coreLocation = coreLocation.clone().add(0.5,0,0.5); this.totemConfig = config; this.radius = config.radius().evaluate(context); for (TotemParticle particleSetting : config.particleSettings()) {