Search in sources :

Example 6 with EnginePlayer

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);
}
Also used : EnginePlayer(thpmc.vanilla_source.api.player.EnginePlayer)

Example 7 with EnginePlayer

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();
    }
}
Also used : ImplEnginePlayer(thpmc.vanilla_source.impl.ImplEnginePlayer) Player(org.bukkit.entity.Player) EnginePlayer(thpmc.vanilla_source.api.player.EnginePlayer) PacketHandler(thpmc.vanilla_source.nms.PacketHandler) ParallelUniverse(thpmc.vanilla_source.api.world.parallel.ParallelUniverse) ImplEnginePlayer(thpmc.vanilla_source.impl.ImplEnginePlayer) EnginePlayer(thpmc.vanilla_source.api.player.EnginePlayer) ChannelPipeline(io.netty.channel.ChannelPipeline) EventHandler(org.bukkit.event.EventHandler)

Example 8 with EnginePlayer

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);
}
Also used : EnginePlayer(thpmc.vanilla_source.api.player.EnginePlayer)

Aggregations

EnginePlayer (thpmc.vanilla_source.api.player.EnginePlayer)8 Player (org.bukkit.entity.Player)3 ParallelUniverse (thpmc.vanilla_source.api.world.parallel.ParallelUniverse)3 be4rjp.artgui.button (be4rjp.artgui.button)1 Artist (be4rjp.artgui.frame.Artist)1 ArtMenu (be4rjp.artgui.menu.ArtMenu)1 IncompleteRegionException (com.sk89q.worldedit.IncompleteRegionException)1 LocalSession (com.sk89q.worldedit.LocalSession)1 BlockVector3 (com.sk89q.worldedit.math.BlockVector3)1 Region (com.sk89q.worldedit.regions.Region)1 SessionManager (com.sk89q.worldedit.session.SessionManager)1 ChannelPipeline (io.netty.channel.ChannelPipeline)1 Material (org.bukkit.Material)1 World (org.bukkit.World)1 EventHandler (org.bukkit.event.EventHandler)1 Vector (org.bukkit.util.Vector)1 VanillaSource (thpmc.vanilla_source.VanillaSource)1 VanillaSourceAPI (thpmc.vanilla_source.api.VanillaSourceAPI)1 EngineEntity (thpmc.vanilla_source.api.entity.EngineEntity)1 TickBase (thpmc.vanilla_source.api.entity.TickBase)1