Skip to content

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BenceX100 committed Nov 23, 2023
1 parent fc18c08 commit b553dd1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 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.2.0</version>
<version>1.2.1</version>
<packaging>jar</packaging>

<name>AxGraves</name>
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/artillexstudios/axgraves/grave/Grave.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;

import static com.artillexstudios.axgraves.AxGraves.CONFIG;
import static com.artillexstudios.axgraves.AxGraves.MESSAGES;
Expand All @@ -48,14 +50,17 @@ public Grave(Location loc, @NotNull Player player, @NotNull Inventory inventory,
this.location = LocationUtils.getCenterOf(loc);
this.player = player;
this.playerName = player.getName();

final ItemStack[] items = Arrays.stream(inventory.getContents()).filter(Objects::nonNull).toArray(ItemStack[]::new);
this.gui = Gui.storage()
.title(StringUtils.format(MESSAGES.getString("gui-name").replace("%player%", playerName)))
.rows(4)
.rows(items.length % 9 == 0 ? items.length / 9 : 1 + (items.length / 9))
.create();

this.storedXP = storedXP;
this.spawned = System.currentTimeMillis();

for (ItemStack it : inventory.getContents()) {
for (ItemStack it : items) {
if (it == null) continue;
if (BlacklistUtils.isBlacklisted(it)) continue;

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ blacklisted-items:
material: "barrier"
name-contains: "Banned item's name"


# do not edit
version: 3

0 comments on commit b553dd1

Please sign in to comment.