mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-30 03:53:50 +00:00
Monsters should not drop items inside dungeons
This commit is contained in:
parent
7e377dff59
commit
286ab545e9
@ -375,8 +375,8 @@ public class Scene {
|
|||||||
this.broadcastPacket(new PacketLifeStateChangeNotify(attackerId, target, LifeState.LIFE_DEAD));
|
this.broadcastPacket(new PacketLifeStateChangeNotify(attackerId, target, LifeState.LIFE_DEAD));
|
||||||
|
|
||||||
// Reward drop
|
// Reward drop
|
||||||
if (target instanceof EntityMonster) {
|
if (target instanceof EntityMonster && this.getSceneType() != SceneType.SCENE_WORLD) {
|
||||||
Grasscutter.getGameServer().getDropManager().callDrop((EntityMonster) target);
|
getWorld().getServer().getDropManager().callDrop((EntityMonster) target);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.removeEntity(target);
|
this.removeEntity(target);
|
||||||
|
@ -27,6 +27,7 @@ import emu.grasscutter.net.proto.AttackResultOuterClass.AttackResult;
|
|||||||
import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType;
|
import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType;
|
||||||
import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType;
|
import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType;
|
||||||
import emu.grasscutter.scripts.data.SceneConfig;
|
import emu.grasscutter.scripts.data.SceneConfig;
|
||||||
|
import emu.grasscutter.server.game.GameServer;
|
||||||
import emu.grasscutter.server.packet.send.PacketDelTeamEntityNotify;
|
import emu.grasscutter.server.packet.send.PacketDelTeamEntityNotify;
|
||||||
import emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify;
|
import emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify;
|
||||||
import emu.grasscutter.server.packet.send.PacketLifeStateChangeNotify;
|
import emu.grasscutter.server.packet.send.PacketLifeStateChangeNotify;
|
||||||
@ -44,6 +45,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
|
|||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||||
|
|
||||||
public class World implements Iterable<Player> {
|
public class World implements Iterable<Player> {
|
||||||
|
private final GameServer server;
|
||||||
private final Player owner;
|
private final Player owner;
|
||||||
private final List<Player> players;
|
private final List<Player> players;
|
||||||
private final Int2ObjectMap<Scene> scenes;
|
private final Int2ObjectMap<Scene> scenes;
|
||||||
@ -61,6 +63,7 @@ public class World implements Iterable<Player> {
|
|||||||
|
|
||||||
public World(Player player, boolean isMultiplayer) {
|
public World(Player player, boolean isMultiplayer) {
|
||||||
this.owner = player;
|
this.owner = player;
|
||||||
|
this.server = player.getServer();
|
||||||
this.players = Collections.synchronizedList(new ArrayList<>());
|
this.players = Collections.synchronizedList(new ArrayList<>());
|
||||||
this.scenes = Int2ObjectMaps.synchronize(new Int2ObjectOpenHashMap<>());
|
this.scenes = Int2ObjectMaps.synchronize(new Int2ObjectOpenHashMap<>());
|
||||||
|
|
||||||
@ -75,6 +78,10 @@ public class World implements Iterable<Player> {
|
|||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GameServer getServer() {
|
||||||
|
return server;
|
||||||
|
}
|
||||||
|
|
||||||
public int getLevelEntityId() {
|
public int getLevelEntityId() {
|
||||||
return levelEntityId;
|
return levelEntityId;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user