Skip to content

Commit

Permalink
1.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BenceX100 committed Nov 8, 2024
1 parent 84a47a7 commit cecbedb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 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.15.0</version>
<version>1.15.1</version>
<packaging>jar</packaging>

<name>AxGraves</name>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/artillexstudios/axgraves/AxGraves.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void enable() {
public void disable() {
TickGraves.stop();
SaveGraves.stop();

for (Grave grave : SpawnedGraves.getGraves()) {
if (!CONFIG.getBoolean("save-graves.enabled", true))
grave.remove();
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/artillexstudios/axgraves/grave/Grave.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import dev.triumphteam.gui.guis.Gui;
import dev.triumphteam.gui.guis.StorageGui;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
Expand Down Expand Up @@ -168,7 +169,7 @@ public void interact(@NotNull Player opener, org.bukkit.inventory.EquipmentSlot
}

if (slot.equals(org.bukkit.inventory.EquipmentSlot.HAND) && opener.isSneaking()) {
if(opener.getGameMode() == GameMode.SPECTATOR) return;
if (opener.getGameMode() == GameMode.SPECTATOR) return;
if (!CONFIG.getBoolean("enable-instant-pickup", true)) return;
if (CONFIG.getBoolean("instant-pickup-only-own", false) && !opener.getUniqueId().equals(player.getUniqueId())) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public static void saveToFile() {
array.add(obj);
}

try (FileWriter fw = new FileWriter(new File(AxGraves.getInstance().getDataFolder(), "data.json"))){
File file = new File(AxGraves.getInstance().getDataFolder(), "data.json");
try (FileWriter fw = new FileWriter(file)) {
gson.toJson(array, fw);
} catch (Exception ex) {
ex.printStackTrace();
Expand All @@ -87,6 +88,7 @@ public static void loadFromFile() {
for (JsonElement el : array) {
JsonObject obj = el.getAsJsonObject();
Location location = Serializers.LOCATION.deserialize(obj.get("location").getAsString());
if (location == null || location.getWorld() == null) continue;
OfflinePlayer owner = Bukkit.getOfflinePlayer(UUID.fromString(obj.get("owner").getAsString()));
String itStr = obj.get("items").getAsString();
ItemStack[] items = Serializers.ITEM_ARRAY.deserialize(Base64.getDecoder().decode(itStr));
Expand Down

0 comments on commit cecbedb

Please sign in to comment.