mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 08:56:04 +01:00
Fix Librarian Story Quest (#2218)
* Fix Librarian Story Quest * People die if they are killed You want to die people instead of remove them so they play their sweet death animations. * Nope. I take it back. Scriptlib is the wierd one to think removeEntity removes the entity. * One must stop editing the code directly. * Update EntityType.java * Add warnings per Hartie * Per Hartie, change getEntityType to EntityType
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package emu.grasscutter.game.props;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum EntityIdType {
|
||||
AVATAR(0x01),
|
||||
MONSTER(0x02),
|
||||
@@ -12,10 +15,27 @@ public enum EntityIdType {
|
||||
|
||||
private final int id;
|
||||
|
||||
private static final Map<Integer, EntityType> map = new HashMap<>();
|
||||
|
||||
static {
|
||||
map.put(EntityIdType.AVATAR.getId(),EntityType.Avatar);
|
||||
map.put(EntityIdType.MONSTER.getId(),EntityType.Monster);
|
||||
map.put(EntityIdType.NPC.getId(),EntityType.NPC);
|
||||
map.put(EntityIdType.GADGET.getId(),EntityType.Gadget);
|
||||
map.put(EntityIdType.REGION.getId(),EntityType.Region);
|
||||
map.put(EntityIdType.WEAPON.getId(),EntityType.Equip);
|
||||
map.put(EntityIdType.TEAM.getId(),EntityType.Team);
|
||||
map.put(EntityIdType.MPLEVEL.getId(),EntityType.MPLevel);
|
||||
}
|
||||
|
||||
EntityIdType(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public static EntityType toEntityType(int entityId) {
|
||||
return map.getOrDefault(entityId, EntityType.None);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ public enum EntityType implements IntValueEnum {
|
||||
Screen(64),
|
||||
EchoShell(65),
|
||||
UIInteractGadget(66),
|
||||
Region(98),
|
||||
PlaceHolder(99);
|
||||
|
||||
private static final Int2ObjectMap<EntityType> map = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user