本文整理汇总了Java中net.minecraftforge.event.world.ChunkWatchEvent.Watch方法的典型用法代码示例。如果您正苦于以下问题:Java ChunkWatchEvent.Watch方法的具体用法?Java ChunkWatchEvent.Watch怎么用?Java ChunkWatchEvent.Watch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.event.world.ChunkWatchEvent
的用法示例。
在下文中一共展示了ChunkWatchEvent.Watch方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onChunkWatch
import net.minecraftforge.event.world.ChunkWatchEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onChunkWatch(ChunkWatchEvent.Watch event)
{
IChunkLevel chunkLevel = getChunkLevel(event.getPlayer().getEntityWorld(), event.getChunk());
LootSlashConquer.network.sendTo(new PacketUpdateChunkLevel(chunkLevel.getChunkPos().x, chunkLevel.getChunkPos().z, chunkLevel.getChunkLevel()), event.getPlayer());
}
示例2: onChunkWatch
import net.minecraftforge.event.world.ChunkWatchEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onChunkWatch(ChunkWatchEvent.Watch e)
{
try
{
GlobalChunkPos pos = new GlobalChunkPos(e.getChunk().x, e.getChunk().z, e.getPlayer().dimension);
NetworkManager.sendTo(new CPacketSyncSif(pos, PurMag.INSTANCE.sif_storage.get(pos)), e.getPlayer());
}
catch (Exception ex)
{
PurMag.INSTANCE.log.error("Can't sync the SIF chunk data with player!", ex);
}
}
示例3: playerWatchesChunk
import net.minecraftforge.event.world.ChunkWatchEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void playerWatchesChunk(ChunkWatchEvent.Watch event) {
Chunk chunk = event.player.worldObj.getChunkFromChunkCoords(event.chunk.chunkXPos, event.chunk.chunkZPos);
IExtraChunkData ecd = (IExtraChunkData) chunk;
FlatChunkLayer layer = ecd.getFlatLayer();
if (layer.isEmpty()) return;
SyncWrite sw = new SyncWrite();
layer.iterate(sw);
send(event.player, build(sw.finish()));
}
示例4: onPlayWatchChunk
import net.minecraftforge.event.world.ChunkWatchEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayWatchChunk(ChunkWatchEvent.Watch event)
{
Chunk chunk = event.player.worldObj.getChunkFromChunkCoords(event.chunk.chunkXPos, event.chunk.chunkZPos);
BioSystem bioSystem = BioSystemHandler.getBioSystem(event.player.worldObj, chunk);
if (bioSystem != null)
{
NetworkHandler.INSTANCE.sendTo(new MessageBioSystemUpdate(bioSystem), event.player);
}
}
示例5: watchChunk
import net.minecraftforge.event.world.ChunkWatchEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void watchChunk(ChunkWatchEvent.Watch event) {
registrant.register(event.player.worldObj, event.chunk.chunkXPos, event.chunk.chunkZPos);
}
示例6: onChunkWatch
import net.minecraftforge.event.world.ChunkWatchEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onChunkWatch(ChunkWatchEvent.Watch event) {
long index = ChunkPos2Index(event.chunk.chunkXPos, event.chunk.chunkZPos);
VintageTG.packetPipeline.sendTo(new ChunkPutNbt(index, VintageTG.proxy.getChunkNbt(index)), event.player);
}
示例7: onChunkWatch
import net.minecraftforge.event.world.ChunkWatchEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onChunkWatch(ChunkWatchEvent.Watch event) {
long index = ChunkPos2Index(event.chunk.chunkXPos, event.chunk.chunkZPos);
VintageCraft.packetPipeline.sendTo(new ChunkPutNbtPacket(index, VintageCraft.proxy.getChunkNbt(index)), event.player);
}