mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-14 07:55:57 +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:
@@ -52,8 +52,8 @@ public abstract class GameEntity {
|
||||
|
||||
public abstract void initAbilities();
|
||||
|
||||
public int getEntityType() {
|
||||
return this.getId() >> 24;
|
||||
public EntityType getEntityType() {
|
||||
return EntityIdType.toEntityType(this.getId() >> 24);
|
||||
}
|
||||
|
||||
public abstract int getEntityTypeId();
|
||||
|
||||
@@ -14,6 +14,8 @@ import emu.grasscutter.net.proto.GadgetInteractReqOuterClass.GadgetInteractReq;
|
||||
import emu.grasscutter.net.proto.GatherGadgetInfoOuterClass.GatherGadgetInfo;
|
||||
import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType;
|
||||
import emu.grasscutter.net.proto.SceneGadgetInfoOuterClass.SceneGadgetInfo;
|
||||
import emu.grasscutter.scripts.constants.EventType;
|
||||
import emu.grasscutter.scripts.data.ScriptArgs;
|
||||
import emu.grasscutter.server.packet.send.PacketGadgetInteractRsp;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
|
||||
@@ -57,6 +59,12 @@ public final class GadgetGatherObject extends GadgetContent {
|
||||
GameItem item = new GameItem(itemData, 1);
|
||||
player.getInventory().addItem(item, ActionReason.Gather);
|
||||
|
||||
getGadget()
|
||||
.getScene()
|
||||
.getScriptManager()
|
||||
.callEvent(
|
||||
new ScriptArgs(getGadget().getGroupId(), EventType.EVENT_GATHER, getGadget().getConfigId()));
|
||||
|
||||
getGadget()
|
||||
.getScene()
|
||||
.broadcastPacket(
|
||||
|
||||
Reference in New Issue
Block a user