mirror of
https://github.com/Anime-Game-Servers/AGSLunarCore.git
synced 2025-02-17 02:07:59 +00:00
Limit some types of items that the player can get
This commit is contained in:
parent
107c592522
commit
b2f9168076
@ -10,13 +10,13 @@ public enum ItemMainType {
|
||||
AvatarCard (2),
|
||||
Equipment (3, InventoryTabType.EQUIPMENT),
|
||||
Relic (4, InventoryTabType.RELIC),
|
||||
Usable (5),
|
||||
Material (6),
|
||||
Mission (7),
|
||||
Usable (5, InventoryTabType.MATERIAL),
|
||||
Material (6, InventoryTabType.MATERIAL),
|
||||
Mission (7, InventoryTabType.MATERIAL),
|
||||
Display (8);
|
||||
|
||||
private int val;
|
||||
private InventoryTabType tabType = InventoryTabType.MATERIAL;
|
||||
private InventoryTabType tabType;
|
||||
|
||||
private ItemMainType(int value) {
|
||||
this.val = value;
|
||||
|
@ -58,11 +58,11 @@ public class Inventory extends BasePlayerManager {
|
||||
// Inventory tabs
|
||||
|
||||
public InventoryTab getTabByItemType(ItemMainType type) {
|
||||
if (type == null) return null;
|
||||
return getTab(type.getTabType());
|
||||
}
|
||||
|
||||
public InventoryTab getTab(InventoryTabType type) {
|
||||
if (type == null) return null;
|
||||
return this.inventoryTypes.get(type.getVal());
|
||||
}
|
||||
|
||||
@ -207,6 +207,11 @@ public class Inventory extends BasePlayerManager {
|
||||
getPlayer().addHeadIcon(item.getItemId());
|
||||
return item;
|
||||
}
|
||||
|
||||
// Skip if not food item
|
||||
if (subType != ItemSubType.Food) {
|
||||
return null;
|
||||
}
|
||||
default:
|
||||
if (tab == null) {
|
||||
return null;
|
||||
|
@ -4,9 +4,10 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum InventoryTabType {
|
||||
MATERIAL (0),
|
||||
EQUIPMENT (1),
|
||||
RELIC (2);
|
||||
NONE (0),
|
||||
MATERIAL (1),
|
||||
EQUIPMENT (2),
|
||||
RELIC (3);
|
||||
|
||||
private int val;
|
||||
|
||||
|
@ -31,8 +31,6 @@ public class CmdIdUtils {
|
||||
* Packet ids that will NOT be caught by the spam filter
|
||||
*/
|
||||
public static final IntSet ALLOWED_FILTER_PACKETS = IntOpenHashSet.of(
|
||||
CmdId.PlayerGetTokenCsReq,
|
||||
CmdId.PlayerLoginCsReq,
|
||||
CmdId.PlayerHeartBeatCsReq,
|
||||
CmdId.GetMissionStatusCsReq,
|
||||
CmdId.GetMissionStatusCsReq,
|
||||
|
Loading…
x
Reference in New Issue
Block a user