Skip to content

Commit

Permalink
1.13.6
Browse files Browse the repository at this point in the history
  • Loading branch information
BenceX100 committed Aug 28, 2024
1 parent 7a1bedb commit c803e0a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.artillexstudios</groupId>
<artifactId>AxGraves</artifactId>
<version>1.13.5</version>
<version>1.13.6</version>
<packaging>jar</packaging>

<name>AxGraves</name>
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/com/artillexstudios/axgraves/AxGraves.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.loader.LoaderSettings;
import com.artillexstudios.axapi.libs.boostedyaml.boostedyaml.settings.updater.UpdaterSettings;
import com.artillexstudios.axapi.nms.NMSHandlers;
import com.artillexstudios.axapi.reflection.FastFieldAccessor;
import com.artillexstudios.axapi.utils.FeatureFlags;
import com.artillexstudios.axapi.utils.MessageUtils;
import com.artillexstudios.axgraves.commands.Commands;
Expand All @@ -20,7 +19,6 @@
import com.artillexstudios.axgraves.utils.UpdateNotifier;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.Warning;
import org.bukkit.entity.Player;
import revxrsal.commands.bukkit.BukkitCommandHandler;

Expand Down Expand Up @@ -53,11 +51,7 @@ public void enable() {
getServer().getPluginManager().registerEvents(new DeathListener(), this);
getServer().getPluginManager().registerEvents(new PlayerInteractListener(), this);

Warning.WarningState prevState = Bukkit.getWarningState();
FastFieldAccessor accessor = FastFieldAccessor.forClassField(Bukkit.getServer().getClass().getPackage().getName() + ".CraftServer", "warningState");
accessor.set(Bukkit.getServer(), Warning.WarningState.OFF);
final BukkitCommandHandler handler = BukkitCommandHandler.create(instance);
accessor.set(Bukkit.getServer(), prevState);

handler.register(new Commands());

Expand Down
18 changes: 13 additions & 5 deletions src/main/java/com/artillexstudios/axgraves/grave/Grave.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,22 @@ public void remove() {
if (removed) return;
removed = true;

Scheduler.get().runAt(location, scheduledTask -> {
SpawnedGraves.removeGrave(this);
removeInventory();
if (Bukkit.isPrimaryThread()) {
removeNow();
return;
}

if (entity != null) entity.remove();
if (hologram != null) hologram.remove();
Scheduler.get().runAt(location, scheduledTask -> {
removeNow();
});
}

private void removeNow() {
SpawnedGraves.removeGrave(this);
removeInventory();

if (entity != null) entity.remove();
if (hologram != null) hologram.remove();
}

public void removeInventory() {
Expand Down

0 comments on commit c803e0a

Please sign in to comment.