Skip to content

Commit 45d889d

Browse files
Merge pull request #538 from ItzKatze/master
GUIMaterial & little Stats Menus improvements
2 parents b49aec7 + 43ddc36 commit 45d889d

21 files changed

Lines changed: 235 additions & 289 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package net.swofty.type.generic.gui.inventory.item;
2+
3+
import net.minestom.server.item.Material;
4+
import org.jetbrains.annotations.Nullable;
5+
6+
public record GUIMaterial(Material material, @Nullable String texture) {
7+
public GUIMaterial(Material material) {
8+
this(material, null);
9+
}
10+
11+
public GUIMaterial(@Nullable String texture) {
12+
this(Material.PLAYER_HEAD, texture);
13+
}
14+
15+
public boolean hasTexture() {
16+
return texture != null && !texture.isEmpty();
17+
}
18+
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/chest/DoubleChest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import net.minestom.server.inventory.InventoryType;
77
import net.minestom.server.item.ItemStack;
88
import net.minestom.server.tag.Tag;
9+
import org.jetbrains.annotations.NotNull;
910

1011
import java.util.ArrayList;
1112
import java.util.Arrays;
@@ -14,7 +15,7 @@
1415

1516
public class DoubleChest implements Chest {
1617

17-
private static final Tag<List<ItemStack>> ITEMS_TAG = Tag.ItemStack("configuration/skyblock/items").list();
18+
private static final Tag<@NotNull List<ItemStack>> ITEMS_TAG = Tag.ItemStack("configuration/skyblock/items").list();
1819
private final Instance instance;
1920
private final Point leftPosition;
2021
private final Point rightPosition;

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/chest/SingleChest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import net.minestom.server.inventory.InventoryType;
66
import net.minestom.server.item.ItemStack;
77
import net.minestom.server.tag.Tag;
8+
import org.jetbrains.annotations.NotNull;
89

910
import java.util.Arrays;
1011
import java.util.List;
1112

1213
public class SingleChest implements Chest {
1314

14-
private static final Tag<List<ItemStack>> ITEMS_TAG = Tag.ItemStack("configuration/skyblock/items").list();
15+
private static final Tag<@NotNull List<ItemStack>> ITEMS_TAG = Tag.ItemStack("configuration/skyblock/items").list();
1516

1617
private final Instance instance;
1718
private final Point position;
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package net.swofty.type.skyblockgeneric.entity.mob;
22

33
import net.minestom.server.entity.EntityType;
4-
import net.minestom.server.item.Material;
4+
import net.swofty.type.generic.gui.inventory.item.GUIMaterial;
55

66
public abstract class BestiaryMob extends SkyBlockMob {
77
public BestiaryMob(EntityType entityType) {
@@ -11,6 +11,5 @@ public BestiaryMob(EntityType entityType) {
1111
public abstract int getMaxBestiaryTier();
1212
public abstract int getBestiaryBracket();
1313
public abstract String getMobID();
14-
public abstract Material getDisplayItem();
15-
public abstract String getTexture();
14+
public abstract GUIMaterial getGuiMaterial();
1615
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/entity/mob/mobs/hub/MobGraveyardZombie.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
import net.swofty.commons.item.ItemType;
1111
import net.swofty.commons.statistics.ItemStatistic;
1212
import net.swofty.commons.statistics.ItemStatistics;
13+
import net.swofty.type.generic.gui.inventory.item.GUIMaterial;
1314
import net.swofty.type.skyblockgeneric.entity.mob.BestiaryMob;
1415
import net.swofty.type.skyblockgeneric.entity.mob.ai.ClosestEntityRegionTarget;
1516
import net.swofty.type.skyblockgeneric.entity.mob.ai.MeleeAttackWithinRegionGoal;
1617
import net.swofty.type.skyblockgeneric.entity.mob.ai.RandomRegionStrollGoal;
1718
import net.swofty.type.skyblockgeneric.entity.mob.impl.RegionPopulator;
19+
import net.swofty.type.skyblockgeneric.gui.inventories.sbmenu.bestiary.GUIBestiaryMob;
1820
import net.swofty.type.skyblockgeneric.loottable.OtherLoot;
1921
import net.swofty.type.skyblockgeneric.loottable.SkyBlockLootTable;
2022
import net.swofty.type.skyblockgeneric.region.RegionType;
@@ -120,13 +122,8 @@ public String getMobID() {
120122
}
121123

122124
@Override
123-
public Material getDisplayItem() {
124-
return Material.ZOMBIE_HEAD;
125-
}
126-
127-
@Override
128-
public String getTexture() {
129-
return "";
125+
public GUIMaterial getGuiMaterial() {
126+
return new GUIMaterial(Material.ZOMBIE_HEAD);
130127
}
131128

132129
@Override

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/entity/mob/mobs/hub/MobGraveyardZombieVillager.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import net.swofty.commons.item.ItemType;
1111
import net.swofty.commons.statistics.ItemStatistic;
1212
import net.swofty.commons.statistics.ItemStatistics;
13+
import net.swofty.type.generic.gui.inventory.item.GUIMaterial;
1314
import net.swofty.type.skyblockgeneric.entity.mob.BestiaryMob;
1415
import net.swofty.type.skyblockgeneric.entity.mob.ai.ClosestEntityRegionTarget;
1516
import net.swofty.type.skyblockgeneric.entity.mob.ai.MeleeAttackWithinRegionGoal;
@@ -122,13 +123,8 @@ public String getMobID() {
122123
}
123124

124125
@Override
125-
public Material getDisplayItem() {
126-
return Material.PLAYER_HEAD;
127-
}
128-
129-
@Override
130-
public String getTexture() {
131-
return "69198f410a10f99314aa0fbe9a3db10697bbc1c011f019507d96673c64217f5a";
126+
public GUIMaterial getGuiMaterial() {
127+
return new GUIMaterial("69198f410a10f99314aa0fbe9a3db10697bbc1c011f019507d96673c64217f5a");
132128
}
133129

134130
@Override

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/entity/mob/mobs/hub/MobRuinsOldWolf.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import net.swofty.commons.item.ItemType;
1111
import net.swofty.commons.statistics.ItemStatistic;
1212
import net.swofty.commons.statistics.ItemStatistics;
13+
import net.swofty.type.generic.gui.inventory.item.GUIMaterial;
1314
import net.swofty.type.skyblockgeneric.entity.mob.BestiaryMob;
1415
import net.swofty.type.skyblockgeneric.entity.mob.ai.ClosestEntityRegionTarget;
1516
import net.swofty.type.skyblockgeneric.entity.mob.ai.MeleeAttackWithinRegionGoal;
@@ -128,12 +129,7 @@ public String getMobID() {
128129
}
129130

130131
@Override
131-
public Material getDisplayItem() {
132-
return Material.PLAYER_HEAD;
133-
}
134-
135-
@Override
136-
public String getTexture() {
137-
return "d359537c15534f61c1cd886bc118774ed22280e7cdab6613870160aad4ca39";
132+
public GUIMaterial getGuiMaterial() {
133+
return new GUIMaterial("d359537c15534f61c1cd886bc118774ed22280e7cdab6613870160aad4ca39");
138134
}
139135
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/entity/mob/mobs/hub/MobRuinsWolf.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import net.swofty.commons.item.ItemType;
1111
import net.swofty.commons.statistics.ItemStatistic;
1212
import net.swofty.commons.statistics.ItemStatistics;
13+
import net.swofty.type.generic.gui.inventory.item.GUIMaterial;
1314
import net.swofty.type.skyblockgeneric.entity.mob.BestiaryMob;
1415
import net.swofty.type.skyblockgeneric.entity.mob.ai.ClosestEntityRegionTarget;
1516
import net.swofty.type.skyblockgeneric.entity.mob.ai.MeleeAttackWithinRegionGoal;
@@ -129,12 +130,7 @@ public String getMobID() {
129130
}
130131

131132
@Override
132-
public Material getDisplayItem() {
133-
return Material.PLAYER_HEAD;
134-
}
135-
136-
@Override
137-
public String getTexture() {
138-
return "f4cb7a6bf6c32c49f2589147e6f0f888e9e35875dd1ea2a8af379ca710589e6b";
133+
public GUIMaterial getGuiMaterial() {
134+
return new GUIMaterial("f4cb7a6bf6c32c49f2589147e6f0f888e9e35875dd1ea2a8af379ca710589e6b");
139135
}
140136
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/entity/mob/mobs/island/MobZombie_1.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import net.swofty.commons.item.ItemType;
1111
import net.swofty.commons.statistics.ItemStatistic;
1212
import net.swofty.commons.statistics.ItemStatistics;
13+
import net.swofty.type.generic.gui.inventory.item.GUIMaterial;
1314
import net.swofty.type.skyblockgeneric.entity.mob.BestiaryMob;
1415
import net.swofty.type.skyblockgeneric.entity.mob.ai.MeleeAttackWithinRegionGoal;
1516
import net.swofty.type.skyblockgeneric.entity.mob.ai.RandomRegionStrollGoal;
@@ -114,13 +115,8 @@ public String getMobID() {
114115
}
115116

116117
@Override
117-
public Material getDisplayItem() {
118-
return Material.ZOMBIE_HEAD;
119-
}
120-
121-
@Override
122-
public String getTexture() {
123-
return "";
118+
public GUIMaterial getGuiMaterial() {
119+
return new GUIMaterial(Material.ZOMBIE_HEAD);
124120
}
125121

126122
@Override

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/event/actions/custom/levels/ActionChangeHypixelXP.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
public class ActionChangeHypixelXP implements HypixelEventClass {
1616

17-
1817
@HypixelEvent(node = EventNodes.CUSTOM, requireDataLoaded = true)
1918
public void run(SkyBlockXPModificationEvent event) {
2019
if (event.getNewXP() <= event.getOldXP()) return;

0 commit comments

Comments
 (0)