use of net.minecraft.world.chunk.storage.ExtendedBlockStorage in project Engine by VoltzEngine-Project.
the class ChunkProviderEmpty method generateZBridge.
private void generateZBridge(Chunk chunk, int chunkX, int chunkZ, int y_base) {
int l = y_base >> 4;
ExtendedBlockStorage extendedblockstorage = chunk.getBlockStorageArray()[l];
if (extendedblockstorage == null) {
extendedblockstorage = new ExtendedBlockStorage(y_base, !this.worldObj.provider.hasNoSky);
chunk.getBlockStorageArray()[l] = extendedblockstorage;
}
int k = y_base + 10;
for (int cx = 6; cx < 10; ++cx) {
for (int cz = 0; cz < 16; ++cz) {
if (cx == 6 || cx == 9)
extendedblockstorage.func_150818_a(cx, k & 15, cz, Blocks.stonebrick);
else
extendedblockstorage.func_150818_a(cx, k & 15, cz, Blocks.planks);
}
}
}
use of net.minecraft.world.chunk.storage.ExtendedBlockStorage in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class PhysicsObject method detectBlockPositions.
// Generates the blockPos array; must be loaded DIRECTLY after the chunks are setup
public void detectBlockPositions() {
// int minChunkX = claimedChunks[0][0].xPosition;
// int minChunkZ = claimedChunks[0][0].zPosition;
int chunkX, chunkZ, index, x, y, z;
Chunk chunk;
ExtendedBlockStorage storage;
for (chunkX = claimedChunks.length - 1; chunkX > -1; chunkX--) {
for (chunkZ = claimedChunks[0].length - 1; chunkZ > -1; chunkZ--) {
chunk = claimedChunks[chunkX][chunkZ];
if (chunk != null && ownedChunks.chunkOccupiedInLocal[chunkX][chunkZ]) {
for (index = 0; index < 16; index++) {
storage = chunk.getBlockStorageArray()[index];
if (storage != null) {
for (y = 0; y < 16; y++) {
for (x = 0; x < 16; x++) {
for (z = 0; z < 16; z++) {
if (storage.data.storage.getAt(y << 8 | z << 4 | x) != ValkyrienWarfareMod.airStateIndex) {
BlockPos pos = new BlockPos(chunk.xPosition * 16 + x, index * 16 + y, chunk.zPosition * 16 + z);
blockPositions.add(pos);
if (!worldObj.isRemote) {
if (BlockForce.basicForces.isBlockProvidingForce(worldObj.getBlockState(pos), pos, worldObj)) {
physicsProcessor.activeForcePositions.add(pos);
}
}
}
}
}
}
}
}
}
}
}
}
use of net.minecraft.world.chunk.storage.ExtendedBlockStorage in project BetterWithAddons by DaedalusGame.
the class PatientiaHandler method customRandomTick.
private void customRandomTick(WorldServer world) {
if (world.getWorldInfo().getTerrainType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
return;
}
int i = world.getGameRules().getInt("randomTickSpeed");
if (i > 0) {
Iterator<Chunk> iterator = world.getPersistentChunkIterable(world.getPlayerChunkMap().getChunkIterator());
while (iterator.hasNext()) {
Chunk chunk = iterator.next();
int j = chunk.x * 16;
int k = chunk.z * 16;
for (ExtendedBlockStorage extendedblockstorage : chunk.getBlockStorageArray()) {
if (extendedblockstorage != Chunk.NULL_BLOCK_STORAGE && extendedblockstorage.needsRandomTick()) {
for (int i1 = 0; i1 < i; ++i1) {
this.updateLCG = this.updateLCG * 3 + 1013904223;
int j1 = this.updateLCG >> 2;
int k1 = j1 & 15;
int l1 = j1 >> 8 & 15;
int i2 = j1 >> 16 & 15;
IBlockState iblockstate = extendedblockstorage.get(k1, i2, l1);
Block block = iblockstate.getBlock();
if (getTickRandomly(block)) {
MinecraftForge.EVENT_BUS.post(new RandomBlockTickEvent(world, new BlockPos(k1 + j, i2 + extendedblockstorage.getYLocation(), l1 + k), iblockstate, world.rand));
}
}
}
}
}
}
}
Aggregations