mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-21 19:34:42 +01:00
Fix player fields not being set
line seps r weird
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
package emu.grasscutter.server.event.entity;
|
||||
|
||||
import emu.grasscutter.game.entity.GameEntity;
|
||||
import emu.grasscutter.game.props.ElementType;
|
||||
import emu.grasscutter.server.event.Cancellable;
|
||||
import emu.grasscutter.server.event.types.EntityEvent;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
public final class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||
@Getter @Setter private float damage;
|
||||
@Getter @Setter private ElementType attackElementType;
|
||||
@Getter @Nullable private final GameEntity damager;
|
||||
|
||||
public EntityDamageEvent(
|
||||
GameEntity entity,
|
||||
float damage,
|
||||
ElementType attackElementType,
|
||||
@Nullable GameEntity damager) {
|
||||
super(entity);
|
||||
|
||||
this.damage = damage;
|
||||
this.attackElementType = attackElementType;
|
||||
this.damager = damager;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.server.event.entity;
|
||||
|
||||
import emu.grasscutter.game.entity.GameEntity;
|
||||
import emu.grasscutter.game.props.ElementType;
|
||||
import emu.grasscutter.server.event.Cancellable;
|
||||
import emu.grasscutter.server.event.types.EntityEvent;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
public final class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||
@Getter @Setter private float damage;
|
||||
@Getter @Setter private ElementType attackElementType;
|
||||
@Getter @Nullable private final GameEntity damager;
|
||||
|
||||
public EntityDamageEvent(
|
||||
GameEntity entity,
|
||||
float damage,
|
||||
ElementType attackElementType,
|
||||
@Nullable GameEntity damager) {
|
||||
super(entity);
|
||||
|
||||
this.damage = damage;
|
||||
this.attackElementType = attackElementType;
|
||||
this.damager = damager;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,58 +1,58 @@
|
||||
package emu.grasscutter.server.event.player;
|
||||
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.world.data.TeleportProperties;
|
||||
import emu.grasscutter.server.event.Cancellable;
|
||||
import emu.grasscutter.server.event.types.PlayerEvent;
|
||||
import emu.grasscutter.utils.Position;
|
||||
|
||||
public final class PlayerTeleportEvent extends PlayerEvent implements Cancellable {
|
||||
private final TeleportProperties properties;
|
||||
private final Position from;
|
||||
|
||||
public PlayerTeleportEvent(Player player, TeleportProperties properties, Position from) {
|
||||
super(player);
|
||||
|
||||
this.properties = properties;
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
public TeleportType getTeleportType() {
|
||||
return this.properties.getTeleportType();
|
||||
}
|
||||
|
||||
public Position getSource() {
|
||||
return this.from;
|
||||
}
|
||||
|
||||
public Position getDestination() {
|
||||
return this.properties.getTeleportTo();
|
||||
}
|
||||
|
||||
public void setDestination(Position to) {
|
||||
this.properties.setTeleportTo(to);
|
||||
}
|
||||
|
||||
public enum TeleportType {
|
||||
/** There is no specified reason to teleport. */
|
||||
INTERNAL,
|
||||
|
||||
/** The player has asked to teleport to a waypoint. */
|
||||
WAYPOINT,
|
||||
|
||||
/** The player has asked to teleport using the map. */
|
||||
MAP,
|
||||
|
||||
/** The player has asked to teleport into a dungeon. */
|
||||
DUNGEON,
|
||||
|
||||
/** The player has asked to teleport using the command. */
|
||||
COMMAND,
|
||||
|
||||
/** A script has teleported the player. */
|
||||
SCRIPT,
|
||||
|
||||
/** The client has requested to teleport. (script) */
|
||||
CLIENT
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.server.event.player;
|
||||
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.world.data.TeleportProperties;
|
||||
import emu.grasscutter.server.event.Cancellable;
|
||||
import emu.grasscutter.server.event.types.PlayerEvent;
|
||||
import emu.grasscutter.utils.Position;
|
||||
|
||||
public final class PlayerTeleportEvent extends PlayerEvent implements Cancellable {
|
||||
private final TeleportProperties properties;
|
||||
private final Position from;
|
||||
|
||||
public PlayerTeleportEvent(Player player, TeleportProperties properties, Position from) {
|
||||
super(player);
|
||||
|
||||
this.properties = properties;
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
public TeleportType getTeleportType() {
|
||||
return this.properties.getTeleportType();
|
||||
}
|
||||
|
||||
public Position getSource() {
|
||||
return this.from;
|
||||
}
|
||||
|
||||
public Position getDestination() {
|
||||
return this.properties.getTeleportTo();
|
||||
}
|
||||
|
||||
public void setDestination(Position to) {
|
||||
this.properties.setTeleportTo(to);
|
||||
}
|
||||
|
||||
public enum TeleportType {
|
||||
/** There is no specified reason to teleport. */
|
||||
INTERNAL,
|
||||
|
||||
/** The player has asked to teleport to a waypoint. */
|
||||
WAYPOINT,
|
||||
|
||||
/** The player has asked to teleport using the map. */
|
||||
MAP,
|
||||
|
||||
/** The player has asked to teleport into a dungeon. */
|
||||
DUNGEON,
|
||||
|
||||
/** The player has asked to teleport using the command. */
|
||||
COMMAND,
|
||||
|
||||
/** A script has teleported the player. */
|
||||
SCRIPT,
|
||||
|
||||
/** The client has requested to teleport. (script) */
|
||||
CLIENT
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user