本文整理汇总了Java中net.minecraft.world.chunk.EmptyChunk类的典型用法代码示例。如果您正苦于以下问题:Java EmptyChunk类的具体用法?Java EmptyChunk怎么用?Java EmptyChunk使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EmptyChunk类属于net.minecraft.world.chunk包,在下文中一共展示了EmptyChunk类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLoadedChunk
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
@Override
public Chunk getLoadedChunk(int x, int z) {
Chunk tryget = super.getLoadedChunk(x, z);
if (tryget == null &&
m_modPrefix != null &&
x == m_remoteChunkX &&
z == m_remoteChunkZ &&
Util.isPrefixInCallStack(m_modPrefix))
{
// some mods use this to check if a chunk is loaded client side...
// but they don't actually use the chunk so just give them *something*
return new EmptyChunk(m_world, 0, 0);
} else {
return tryget;
}
}
示例2: syncRead
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
static boolean syncRead(ByteBuf buff, EntityPlayer player) {
boolean first = true;
while (true) {
byte state = buff.readByte();
if (state == 0) return true;
if (state != 1) {
log("Corrupt data sync packet!?");
return true;
}
Coord at = readCoord(buff, player);
if (first && at.getChunk() instanceof EmptyChunk) {
return false;
}
first = false;
EnumFacing side = readSide(buff);
FlatFace face = readFace(buff);
if (face == null) continue;
Flat.setWithNotification(at, side, face, FlatChunkLayer.FLAGS_SEAMLESS);
}
}
示例3: ChunkProviderServer
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_)
{
this.dummyChunk = new EmptyChunk(p_i1520_1_, 0, 0);
this.worldObj = p_i1520_1_;
this.chunkLoader = p_i1520_2_;
this.serverChunkGenerator = p_i1520_3_;
}
示例4: onChunkUnLoad
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
@SubscribeEvent
public void onChunkUnLoad(ChunkEvent.Unload event)
{
if(event.getChunk() instanceof EmptyChunk)
return;
for(WorldExtension extension : worldMap.get(event.world))
extension.unloadChunk(event.getChunk());
if(event.world.isRemote)
removeChunk(event.world, event.getChunk());
}
示例5: set
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public FlatFace set(Coord at, EnumFacing dir, FlatFace face, byte flags) {
if (chunk instanceof EmptyChunk) {
Core.logWarning("FlatLayer.set called on empty chunk", chunk);
}
if (face == FlatFaceAir.INSTANCE) {
face = null;
}
final int slabY = at.y >> 4;
final int localY = at.y & 0xF;
final int localX = at.x & 0xF;
final int localZ = at.z & 0xF;
Slab slab = slabIndex(slabY);
short index = index(localX, localY, localZ, dir);
if (index == -1) {
return FlatFaceAir.INSTANCE;
}
int oSet = slab.set;
Slab newSlab = slab.set(index, face, at, flags);
if (slab != newSlab) {
slabs[slabY] = newSlab;
}
set += newSlab.set - oSet;
FlatFace ret = slab.get(index);
renderInfo.markDirty(at);
if ((flags & FLAG_SYNC) > 0) {
addChange(at, dir);
}
if ((flags & FLAG_NOTIFY_NEIGHBORS) > 0) {
Flat.onFaceChanged(at, dir);
}
chunk.setChunkModified();
return ret;
}
示例6: ChunkProviderServer
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public ChunkProviderServer(World world, IChunkLoader loader, IChunkProvider provider) {
this.defaultEmptyChunk = new EmptyChunk(world, 0, 0);
this.worldObj = world;
this.currentChunkLoader = loader;
this.currentChunkProvider = provider;
// TODO: Do a static calc to speed things up if possible. Need
// to find out if this assumption is safe.
this.worryAboutSpawn = this.worldObj.provider.canRespawnHere()
&& DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId);
}
示例7: ChunkProviderServer
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public ChunkProviderServer(WorldServer par1WorldServer, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider)
{
this.defaultEmptyChunk = new EmptyChunk(par1WorldServer, 0, 0);
this.worldObj = par1WorldServer;
this.currentChunkLoader = par2IChunkLoader;
this.currentChunkProvider = par3IChunkProvider;
}
示例8: ChunkProviderServer
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_)
{
this.initialTick = MinecraftServer.currentTick; // Cauldron keep track of when the loader was created
this.defaultEmptyChunk = new EmptyChunk(p_i1520_1_, 0, 0);
this.worldObj = p_i1520_1_;
this.currentChunkLoader = p_i1520_2_;
this.currentChunkProvider = p_i1520_3_;
}
示例9: ChunkProviderServer
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_)
{
this.defaultEmptyChunk = new EmptyChunk(p_i1520_1_, 0, 0);
this.worldObj = p_i1520_1_;
this.currentChunkLoader = p_i1520_2_;
this.currentChunkProvider = p_i1520_3_;
}
示例10: provideChunk
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
@Override
public Chunk provideChunk(int i, int j) {
//Don't generate any further than 5 chunks
if (Math.abs(i) > size || Math.abs(j) > size)
return new EmptyChunk(this.worldObj, i, j);
Chunk chunk = new Chunk(this.worldObj, i, j);
//Generate an layerd chunk
for (int k = 0; k < 1; ++k)
{
int l = k >> 4;
ExtendedBlockStorage extendedblockstorage = chunk.getBlockStorageArray()[l];
if (extendedblockstorage == null)
{
extendedblockstorage = new ExtendedBlockStorage(k, !this.worldObj.provider.hasNoSky);
chunk.getBlockStorageArray()[l] = extendedblockstorage;
}
for (int i1 = 0; i1 < 16; ++i1)
{
for (int j1 = 0; j1 < 16; ++j1)
{
extendedblockstorage.setExtBlockID(i1, k & 15, j1, Block.grass.blockID);
}
}
}
chunk.generateSkylightMap();
return chunk;
}
示例11: ChunkProviderClient
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public ChunkProviderClient(World worldIn)
{
this.blankChunk = new EmptyChunk(worldIn, 0, 0);
this.worldObj = worldIn;
}
示例12: ChunkProviderClient
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public ChunkProviderClient(World par1World)
{
this.blankChunk = new EmptyChunk(par1World, 0, 0);
this.worldObj = par1World;
}
示例13: updateWaterOpacity
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
private void updateWaterOpacity()
{
if (this.mc.getIntegratedServer() != null)
{
Config.waterOpacityChanged = true;
}
byte opacity = 3;
if (this.ofClearWater)
{
opacity = 1;
}
BlockUtils.setLightOpacity(Blocks.water, opacity);
BlockUtils.setLightOpacity(Blocks.flowing_water, opacity);
if (this.mc.theWorld != null)
{
IChunkProvider cp = this.mc.theWorld.getChunkProvider();
if (cp != null)
{
for (int x = -512; x < 512; ++x)
{
for (int z = -512; z < 512; ++z)
{
if (cp.chunkExists(x, z))
{
Chunk c = cp.provideChunk(x, z);
if (c != null && !(c instanceof EmptyChunk))
{
ExtendedBlockStorage[] ebss = c.getBlockStorageArray();
for (int i = 0; i < ebss.length; ++i)
{
ExtendedBlockStorage ebs = ebss[i];
if (ebs != null)
{
NibbleArray na = ebs.getSkylightArray();
if (na != null)
{
byte[] data = na.data;
for (int d = 0; d < data.length; ++d)
{
data[d] = 0;
}
}
}
}
c.generateSkylightMap();
}
}
}
}
this.mc.renderGlobal.loadRenderers();
}
}
}
示例14: updateWaterOpacity
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public void updateWaterOpacity()
{
byte opacity = 3;
if (Config.isClearWater())
{
opacity = 1;
}
BlockUtils.setLightOpacity(Blocks.water, opacity);
BlockUtils.setLightOpacity(Blocks.flowing_water, opacity);
IChunkProvider cp = this.chunkProvider;
if (cp != null)
{
for (int x = -512; x < 512; ++x)
{
for (int z = -512; z < 512; ++z)
{
if (cp.chunkExists(x, z))
{
Chunk c = cp.provideChunk(x, z);
if (c != null && !(c instanceof EmptyChunk))
{
ExtendedBlockStorage[] ebss = c.getBlockStorageArray();
for (int i = 0; i < ebss.length; ++i)
{
ExtendedBlockStorage ebs = ebss[i];
if (ebs != null)
{
NibbleArray na = ebs.getSkylightArray();
if (na != null)
{
byte[] data = na.data;
for (int d = 0; d < data.length; ++d)
{
data[d] = 0;
}
}
}
}
c.generateSkylightMap();
}
}
}
}
}
}
示例15: ChunkProviderClient
import net.minecraft.world.chunk.EmptyChunk; //导入依赖的package包/类
public ChunkProviderClient(World p_i1184_1_)
{
this.blankChunk = new EmptyChunk(p_i1184_1_, 0, 0);
this.worldObj = p_i1184_1_;
}