当前位置: 首页>>代码示例>>Java>>正文


Java ChunkWatchEvent.Watch方法代码示例

本文整理汇总了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());
}
 
开发者ID:TheXFactor117,项目名称:Loot-Slash-Conquer,代码行数:8,代码来源:CapabilityChunkLevel.java

示例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);
    }
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:14,代码来源:SifEvents.java

示例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()));
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:11,代码来源:FlatNet.java

示例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);
    }
}
 
开发者ID:Dynious,项目名称:Biota,代码行数:11,代码来源:CommonEventHandler.java

示例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);

}
 
开发者ID:ternsip,项目名称:StabilizerMod,代码行数:6,代码来源:Stabilizermod.java

示例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);
}
 
开发者ID:tyronx,项目名称:vintagetg,代码行数:6,代码来源:VCraftWorld.java

示例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);
}
 
开发者ID:tyronx,项目名称:vintagecraft,代码行数:6,代码来源:VCraftWorld.java


注:本文中的net.minecraftforge.event.world.ChunkWatchEvent.Watch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。