the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 227 lines 4.5 kB view raw
1#include "stdafx.h" 2#include "Arrays.h" 3#include "net.minecraft.world.level.h" 4#include "net.minecraft.world.phys.h" 5#include "EmptyLevelChunk.h" 6 7EmptyLevelChunk::EmptyLevelChunk(Level *level, int x, int z) : LevelChunk(level,x,z) 8{ 9 dontSave = true; 10 // Set this as fully post-processed, so we don't try and run post-processing on any edge chunks that will overlap into real chunks 11 terrainPopulated = LevelChunk::sTerrainPopulatedAllNeighbours | LevelChunk::sTerrainPostPostProcessed; 12} 13 14EmptyLevelChunk::EmptyLevelChunk(Level *level, byteArray blocks, int x, int z): LevelChunk(level,blocks,x,z) 15{ 16 dontSave = true; 17 delete [] blocks.data; 18 // Set this as fully post-processed, so we don't try and run post-processing on any edge chunks that will overlap into real chunks 19 terrainPopulated = LevelChunk::sTerrainPopulatedAllNeighbours | LevelChunk::sTerrainPostPostProcessed; 20} 21 22bool EmptyLevelChunk::isAt(int x, int z) 23{ 24 return x == this->x && z == this->z; 25} 26 27int EmptyLevelChunk::getHeightmap(int x, int z) 28{ 29 return 0; 30} 31 32void EmptyLevelChunk::recalcBlockLights() 33{ 34} 35 36void EmptyLevelChunk::recalcHeightmapOnly() 37{ 38} 39 40void EmptyLevelChunk::recalcHeightmap() 41{ 42} 43 44void EmptyLevelChunk::lightLava() 45{ 46} 47 48int EmptyLevelChunk::getTile(int x, int y, int z) 49{ 50 return 0; 51} 52 53bool EmptyLevelChunk::setTileAndData(int x, int y, int z, int _tile, int _data) 54{ 55 return true; 56} 57 58bool EmptyLevelChunk::setTile(int x, int y, int z, int _tile) 59{ 60 return true; 61} 62 63int EmptyLevelChunk::getData(int x, int y, int z) 64{ 65 return 0; 66} 67 68bool EmptyLevelChunk::setData(int x, int y, int z, int val, int mask, bool *maskedBitsChanged) 69{ 70 *maskedBitsChanged = true; 71 return false; 72} 73 74int EmptyLevelChunk::getBrightness(LightLayer::variety layer, int x, int y, int z) 75{ 76 return 0; 77} 78 79// 4J added 80void EmptyLevelChunk::getNeighbourBrightnesses(int *brightnesses, LightLayer::variety layer, int x, int y, int z) 81{ 82 for(int i = 0; i < 6; i++ ) 83 { 84 brightnesses[i] = 0; 85 } 86} 87 88void EmptyLevelChunk::setBrightness(LightLayer::variety layer, int x, int y, int z, int brightness) 89{ 90} 91 92int EmptyLevelChunk::getRawBrightness(int x, int y, int z, int skyDampen) 93{ 94 return 0; 95} 96 97void EmptyLevelChunk::addEntity(shared_ptr<Entity> e) 98{ 99} 100 101void EmptyLevelChunk::removeEntity(shared_ptr<Entity> e) 102{ 103} 104 105void EmptyLevelChunk::removeEntity(shared_ptr<Entity> e, int yc) 106{ 107} 108 109bool EmptyLevelChunk::isSkyLit(int x, int y, int z) 110{ 111 return false; 112} 113 114void EmptyLevelChunk::skyBrightnessChanged() 115{ 116} 117 118shared_ptr<TileEntity> EmptyLevelChunk::getTileEntity(int x, int y, int z) 119{ 120 return shared_ptr<TileEntity>(); 121} 122 123void EmptyLevelChunk::addTileEntity(shared_ptr<TileEntity> te) 124{ 125} 126 127void EmptyLevelChunk::setTileEntity(int x, int y, int z, shared_ptr<TileEntity> tileEntity) 128{ 129} 130 131void EmptyLevelChunk::removeTileEntity(int x, int y, int z) 132{ 133} 134 135void EmptyLevelChunk::load() 136{ 137} 138 139void EmptyLevelChunk::unload(bool unloadTileEntities) // 4J - added parameter 140{ 141} 142 143bool EmptyLevelChunk::containsPlayer() 144{ 145 return false; 146} 147 148void EmptyLevelChunk::markUnsaved() 149{ 150} 151 152void EmptyLevelChunk::getEntities(shared_ptr<Entity> except, AABB bb, vector<shared_ptr<Entity> > &es, EntitySelector *selector) 153{ 154} 155 156void EmptyLevelChunk::getEntitiesOfClass(const type_info& ec, AABB bb, vector<shared_ptr<Entity> > &es, EntitySelector *selector) 157{ 158} 159 160int EmptyLevelChunk::countEntities() 161{ 162 return 0; 163} 164 165bool EmptyLevelChunk::shouldSave(bool force) 166{ 167 return false; 168} 169 170void EmptyLevelChunk::setBlocks(byteArray newBlocks, int sub) 171{ 172} 173 174int EmptyLevelChunk::getBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting/* = true*/) 175{ 176 int xs = x1 - x0; 177 int ys = y1 - y0; 178 int zs = z1 - z0; 179 180 int s = xs * ys * zs; 181 int len; 182 if( includeLighting ) 183 { 184 len = s + s / 2 * 3; 185 } 186 else 187 { 188 len = s + s / 2; 189 } 190 191 192 Arrays::fill(data, p, p + len, (byte) 0); 193 return len; 194} 195 196int EmptyLevelChunk::setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting/* = true*/) 197{ 198 int xs = x1 - x0; 199 int ys = y1 - y0; 200 int zs = z1 - z0; 201 202 int s = xs * ys * zs; 203 if( includeLighting ) 204 { 205 return s + s / 2 * 3; 206 } 207 else 208 { 209 return s + s / 2; 210 } 211} 212 213bool EmptyLevelChunk::testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p) 214{ 215 return false; 216} 217 218Random *EmptyLevelChunk::getRandom(__int64 l) 219{ 220 return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); 221} 222 223bool EmptyLevelChunk::isEmpty() 224{ 225 return true; 226} 227