本文整理汇总了Java中net.minecraft.client.multiplayer.ChunkProviderClient类的典型用法代码示例。如果您正苦于以下问题:Java ChunkProviderClient类的具体用法?Java ChunkProviderClient怎么用?Java ChunkProviderClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChunkProviderClient类属于net.minecraft.client.multiplayer包,在下文中一共展示了ChunkProviderClient类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: redrawWhenSettingsChange
import net.minecraft.client.multiplayer.ChunkProviderClient; //导入依赖的package包/类
private void redrawWhenSettingsChange() {
IResourceManagerReloadListener redrawFlats = new IResourceManagerReloadListener() {
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {
if (mc.theWorld == null) return;
IChunkProvider cp = mc.theWorld.getChunkProvider();
if (cp instanceof ChunkProviderClient) {
ChunkProviderClient cpc = (ChunkProviderClient) cp;
for (Chunk chunk : cpc.chunkListing) {
FlatChunkLayer fcl = ((IExtraChunkData) chunk).getFlatLayer();
fcl.renderInfo.markDirty(null);
}
}
}
};
((SimpleReloadableResourceManager) mc.getResourceManager()).registerReloadListener(redrawFlats);
}
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:18,代码来源:FlatMod.java
示例2: HookedClientWorld
import net.minecraft.client.multiplayer.ChunkProviderClient; //导入依赖的package包/类
public HookedClientWorld(WorldClient originalWorld) throws IllegalAccessException {
super(InjectionHandler.readFieldOfType(originalWorld, NetHandlerPlayClient.class),
new WorldSettings(originalWorld.getWorldInfo()),
originalWorld.provider.getDimension(), originalWorld.getDifficulty(), originalWorld.profiler);
HookedChunkProviderClient chunkProvider = new HookedChunkProviderClient(this);
// replace the chunk provider with our own!
InjectionHandler.writeFieldOfType(this, chunkProvider, ChunkProviderClient.class);
InjectionHandler.writeFieldOfType(this, chunkProvider, IChunkProvider.class);
SetupWorldProviderProxy();
}
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:15,代码来源:HookedClientWorld.java
示例3: createChunkProvider
import net.minecraft.client.multiplayer.ChunkProviderClient; //导入依赖的package包/类
@Override
protected IChunkProvider createChunkProvider() {
if(this.isRemote)
return new ChunkProviderClient(this);
else
return null;
}
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:8,代码来源:WorldDummy.java
示例4: loadWorld
import net.minecraft.client.multiplayer.ChunkProviderClient; //导入依赖的package包/类
public static void loadWorld()
{
worldName = ""; // The new (multi-)world name is unknown at the moment
wc = mc.theWorld;
tp = mc.thePlayer;
windowContainer = tp.openContainer;
// Is this a different server?
INetworkManager newNM = tp.sendQueue.getNetManager();
if( nm != newNM )
{
// Different server, different world!
chatDebug( "onWorldLoad: different server!" );
nm = newNM;
loadBaseProps();
if( baseProps.getProperty( "AutoStart" ).equals( "true" ) )
start();
else
startOnChange = false;
}
else
{
// Same server, different world!
chatDebug( "onWorldLoad: same server!" );
if( startOnChange )
start();
}
// Hacking the LongHashMap to keep a list of loaded chunks visible
// Using reflexion is not possible because the LongHashMapEntry class is private
Reflexion.StolenField longHashMapField = Reflexion.stealField( ChunkProviderClient.class, LongHashMap.class );
LongHashMap lhm = (LongHashMap) longHashMapField.get(wc.getChunkProvider());
longHashMapField.set(wc.getChunkProvider(), new WDLLongHashMapWrapper(lhm));
}
开发者ID:xurei,项目名称:forge_world_downloader,代码行数:36,代码来源:WDL.java
示例5: saveChunks
import net.minecraft.client.multiplayer.ChunkProviderClient; //导入依赖的package包/类
/** Calls saveChunk for all currently loaded chunks */
public static void saveChunks( )
{
chatDebug( "Saving chunks...");
WDLLongHashMapWrapper chunkMapping = (WDLLongHashMapWrapper) Reflexion.stealField( ChunkProviderClient.class, LongHashMap.class ).get(wc.getChunkProvider());
//LongHashMapEntry[] hashArray = (LongHashMapEntry[]) Reflexion.stealField( LongHashMap.class, LongHashMapEntry[].class ).get(chunkMapping);
WDLSaveProgressReporter progressReporter = new WDLSaveProgressReporter();
progressReporter.start();
/*// Now that we have the HashMap, lets start iterating over it:
for( LongHashMapEntry lhme : hashArray )
{
while( lhme != null )
{
Chunk c = (Chunk) lhme.getValue();*/
for (Chunk c:chunkMapping.getChunks())
{
if( c != null /*&& c.isModified*/ ) // only save filled chunks
{
saveChunk( c );
}
//else
// chatMsg( "Didn't save chunk " + c.xPosition + " " + c.zPosition + " because it is null!");
/*
lhme = lhme.nextEntry; // Get next Entry in this linked list
}
}*/
}
try
{
ThreadedFileIOBase.threadedIOInstance.waitForFinish();
}
catch(Exception e)
{
chatMsg( "Threw exception waiting for asynchronous IO to finish. Hmmm.");
}
chatDebug( "Chunk data saved.");
}
开发者ID:xurei,项目名称:forge_world_downloader,代码行数:42,代码来源:WDL.java
示例6: func_72970_h
import net.minecraft.client.multiplayer.ChunkProviderClient; //导入依赖的package包/类
protected IChunkProvider func_72970_h() {
this.field_73033_b = new ChunkProviderClient(this);
return this.field_73033_b;
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:5,代码来源:WorldClient.java
注:本文中的net.minecraft.client.multiplayer.ChunkProviderClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论