use of thpmc.vanilla_source.api.player.EnginePlayer in project VanillaSource by TheHollowPlanetMC.
the class ParallelStructure method setStructureData.
/**
* この構造物を指定された構造物データで上書きして特定のプレイヤーへ見せる
* @param player 構造物を変化させて見せるプレイヤー
* @param implStructureData 構造物データ
*/
public void setStructureData(Player player, ImplStructureData implStructureData) {
EnginePlayer enginePlayer = EnginePlayer.getParallelPlayer(player);
if (enginePlayer == null)
return;
this.setStructureData(enginePlayer, implStructureData);
}
use of thpmc.vanilla_source.api.player.EnginePlayer in project VanillaSource by TheHollowPlanetMC.
the class PlayerJoinQuitListener method onJoin.
@EventHandler
public void onJoin(PlayerJoinEvent event) {
// Inject packet handler
Player player = event.getPlayer();
EnginePlayer enginePlayer = ImplEnginePlayer.onPlayerJoin(player);
ParallelUniverse universe = VanillaSourceAPI.getInstance().createUniverse(player.getUniqueId().toString());
universe.addPlayer(enginePlayer);
Object wrappedParallelPlayer = ChiyogamiManager.getWrappedParallelPlayer(player);
if (wrappedParallelPlayer != null)
ChiyogamiManager.setCheckFunction(enginePlayer, wrappedParallelPlayer);
PacketHandler packetHandler = new PacketHandler(enginePlayer);
try {
ChannelPipeline pipeline = NMSManager.getNMSHandler().getChannel(player).pipeline();
pipeline.addBefore("packet_handler", VanillaSource.getPlugin().getName() + "PacketInjector:" + player.getName(), packetHandler);
} catch (Exception e) {
e.printStackTrace();
}
}
use of thpmc.vanilla_source.api.player.EnginePlayer in project VanillaSource by TheHollowPlanetMC.
the class ParallelStructure method clearStructureData.
/**
* 適用されている構造物データを消去します
* @param player 構造物を変化させて見せるプレイヤー
* @param chunkUpdate チャンクアップデートのパケットを送信するかどうか
*/
public void clearStructureData(Player player, boolean chunkUpdate) {
EnginePlayer enginePlayer = EnginePlayer.getParallelPlayer(player);
if (enginePlayer == null)
return;
this.clearStructureData(enginePlayer, chunkUpdate);
}
Aggregations