Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5acdae
commit 81dc08b
Showing
2 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/main/java/org/auioc/mcmod/arnicalib/game/event/ClientPlayerEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.auioc.mcmod.arnicalib.game.event; | ||
|
||
import net.minecraft.client.player.LocalPlayer; | ||
import net.minecraftforge.event.entity.player.PlayerEvent; | ||
|
||
public abstract class ClientPlayerEvent extends PlayerEvent { | ||
|
||
private final LocalPlayer clientPlayer; | ||
|
||
public ClientPlayerEvent(LocalPlayer clientPlayer) { | ||
super(clientPlayer); | ||
this.clientPlayer = clientPlayer; | ||
} | ||
|
||
public LocalPlayer getClientPlayer() { | ||
return clientPlayer; | ||
} | ||
|
||
} |
20 changes: 13 additions & 7 deletions
20
src/main/java/org/auioc/mcmod/arnicalib/game/event/ServerPlayerEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
package org.auioc.mcmod.arnicalib.game.event; | ||
|
||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraftforge.event.entity.living.LivingEvent; | ||
import net.minecraftforge.event.entity.player.PlayerEvent; | ||
|
||
public abstract class ServerPlayerEvent extends LivingEvent { | ||
public abstract class ServerPlayerEvent extends PlayerEvent { | ||
|
||
private final ServerPlayer player; | ||
private final ServerPlayer serverPlayer; | ||
|
||
public ServerPlayerEvent(ServerPlayer player) { | ||
super(player); | ||
this.player = player; | ||
public ServerPlayerEvent(ServerPlayer serverPlayer) { | ||
super(serverPlayer); | ||
this.serverPlayer = serverPlayer; | ||
} | ||
|
||
@Override | ||
@Deprecated(since = "5.6.4", forRemoval = true) | ||
public ServerPlayer getPlayer() { | ||
return this.player; | ||
return serverPlayer; | ||
} | ||
|
||
public ServerPlayer getServerPlayer() { | ||
return serverPlayer; | ||
} | ||
|
||
} |