forked from Kolyah35/minecraft-pe-0.6.1
Extremely Big Update - fileshredder
(MAJOR)Added Java Beta/Normal Shading, toggleble in settings Fixed and restored the unused Item Switching Animation, toggleble in tweaks too Added Dynamic Texture for Lava Added option to use Block Outline Selection which was unused normally Added Split Touch Controls into Options Mobs will now drop cooked variants of their meat if they died by fire Fixed Untranslated Strings in Settings (MAJOR) Ravines and Lava/Water pools have been fixed and renabled Tweaked BasicTree to hopefully speed up generation a bit, might disable them temporarily if they keep being slow You can now grow Fancy Oak Trees using saplings.
This commit is contained in:
@@ -102,8 +102,8 @@ void Chicken::dropDeathLoot( /*bool wasKilledByPlayer, int playerBonusLevel*/ )
|
||||
spawnAtLocation(Item::feather->id, 1);
|
||||
}
|
||||
//// and some meat
|
||||
//if (isOnFire()) spawnAtLocation(Item::chicken_cooked->id, 1); //@fire
|
||||
//else
|
||||
if (isOnFire()) spawnAtLocation(Item::chicken_cooked->id, 1); //@fire
|
||||
else
|
||||
spawnAtLocation(Item::chicken_raw->id, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,11 +66,11 @@ void Cow::dropDeathLoot( /*bool wasKilledByPlayer, int playerBonusLevel*/ ) {
|
||||
// and some meat
|
||||
count = random.nextInt(3) + 1;
|
||||
for (int i = 0; i < count; i++) {
|
||||
// if (isOnFire()) { //@fire
|
||||
// spawnAtLocation(Item::beef_cooked->id, 1);
|
||||
// } else {
|
||||
if (isOnFire()) { //@fire
|
||||
spawnAtLocation(Item::beef_cooked->id, 1);
|
||||
} else {
|
||||
spawnAtLocation(Item::beef_raw->id, 1);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ std::string Pig::getDeathSound()
|
||||
int Pig::getDeathLoot()
|
||||
{
|
||||
//@fire
|
||||
//if (isOnFire())
|
||||
// return Item::porkChop_cooked->id;
|
||||
if (isOnFire())
|
||||
return Item::porkChop_cooked->id;
|
||||
return Item::porkChop_raw->id;
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ void CanyonFeature::addTunnel( int xOffs, int zOffs, unsigned char* blocks, floa
|
||||
}
|
||||
}
|
||||
|
||||
void CanyonFeature::addFeature(Level* level, int x, int z, int xOffs, int zOffs,unsigned char* blocks)
|
||||
void CanyonFeature::addFeature(Level* level, int x, int z, int xOffs, int zOffs, unsigned char* blocks, int blocksSize)
|
||||
{
|
||||
if (random.nextInt(15) != 0) return;
|
||||
|
||||
|
||||
@@ -11,8 +11,12 @@ class CanyonFeature: public LargeFeature {
|
||||
|
||||
/*protected*/
|
||||
void addTunnel(int xOffs, int zOffs, unsigned char* blocks, float xCave, float yCave, float zCave, float thickness, float yRot, float xRot, int step, int dist, float yScale);
|
||||
|
||||
/*protected*/
|
||||
void addFeature(Level* level, int x, int z, int xOffs, int zOffs,unsigned char* blocks);
|
||||
void addFeature(Level* level, int x, int z, int xOffs, int zOffs, unsigned char* blocks, int blocksSize);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,7 @@ class LevelChunk;
|
||||
|
||||
#include "../chunk/ChunkSource.h"
|
||||
#include "LargeCaveFeature.h"
|
||||
#include "CanyonFeature.h"
|
||||
#include "synth/PerlinNoise.h"
|
||||
#include "../../../SharedConstants.h"
|
||||
|
||||
@@ -63,6 +64,7 @@ private:
|
||||
public:
|
||||
//Biome** biomes;
|
||||
LargeCaveFeature caveFeature;
|
||||
CanyonFeature canyonFeature;
|
||||
int waterDepths[16+16][16+16];
|
||||
private:
|
||||
ChunkMap chunkMap;
|
||||
@@ -92,6 +94,7 @@ private:
|
||||
float* fi;
|
||||
float* fis;
|
||||
///*private*/ float[] temperatures;
|
||||
float* temperatures; // normally unused like above, but restored this maybe might come handy - shredder
|
||||
};
|
||||
|
||||
class PerformanceTestChunkSource : public ChunkSource
|
||||
|
||||
@@ -17,7 +17,7 @@ class BasicTree : public Feature
|
||||
typedef Feature super;
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
unsigned char axisConversionArray[6];
|
||||
Random *rnd;
|
||||
@@ -25,11 +25,11 @@ private:
|
||||
int origin[3];
|
||||
int height;
|
||||
int trunkHeight;
|
||||
double trunkHeightScale;
|
||||
double branchDensity;
|
||||
double branchSlope;
|
||||
double widthScale;
|
||||
double foliageDensity;
|
||||
float trunkHeightScale;
|
||||
float branchDensity;
|
||||
float branchSlope;
|
||||
float widthScale;
|
||||
float foliageDensity;
|
||||
int trunkWidth;
|
||||
int heightVariance;
|
||||
int foliageHeight;
|
||||
@@ -38,7 +38,7 @@ private:
|
||||
void prepare(){
|
||||
trunkHeight = (int) (height * trunkHeightScale);
|
||||
if (trunkHeight >= height) trunkHeight = height - 1;
|
||||
int clustersPerY = (int) (1.382 + pow(foliageDensity * height / 13.0, 2));
|
||||
int clustersPerY = (int) (1.382f + pow(foliageDensity * height / 13.0, 2));
|
||||
if (clustersPerY < 1) clustersPerY = 1;
|
||||
int **tempFoliageCoords = new int *[clustersPerY * height];
|
||||
for( int i = 0; i < clustersPerY * height; i++ )
|
||||
@@ -68,19 +68,19 @@ private:
|
||||
continue;
|
||||
}
|
||||
|
||||
double originOffset = 0.5;
|
||||
float originOffset = 0.5f;
|
||||
while (num < clustersPerY)
|
||||
{
|
||||
double radius = widthScale * (shapefac * (rnd->nextFloat() + 0.328));
|
||||
double angle = rnd->nextFloat() * 2.0 * 3.14159;
|
||||
float radius = widthScale * (shapefac * (rnd->nextFloat() + 0.328f));
|
||||
float angle = rnd->nextFloat() * 2.0f * 3.14159f;
|
||||
int x = Mth::floor(radius * sin(angle) + origin[0] + originOffset);
|
||||
int z = Mth::floor(radius * cos(angle) + origin[2] + originOffset);
|
||||
int checkStart[] = { x, y, z };
|
||||
int checkEnd[] = { x, y + foliageHeight, z };
|
||||
if (checkLine(checkStart, checkEnd) == -1) {
|
||||
int checkBranchBase[] = { origin[0], origin[1], origin[2] };
|
||||
double distance = sqrt(pow(abs(origin[0] - checkStart[0]), 2.0) + pow(abs(origin[2] - checkStart[2]), 2.0));
|
||||
double branchHeight = distance * branchSlope;
|
||||
float distance = sqrt(pow(abs(origin[0] - checkStart[0]), 2.0f) + pow(abs(origin[2] - checkStart[2]), 2.0f));
|
||||
float branchHeight = distance * branchSlope;
|
||||
if ((checkStart[1] - branchHeight) > trunkTop)
|
||||
{
|
||||
checkBranchBase[1] = trunkTop;
|
||||
@@ -134,7 +134,9 @@ private:
|
||||
offset2 = -rad;
|
||||
while (offset2 <= rad)
|
||||
{
|
||||
double thisdistance = pow(abs(offset1) + 0.5, 2) + pow(abs(offset2) + 0.5, 2);
|
||||
float off1 = (float)offset1 + 0.5f;
|
||||
float off2 = (float)offset2 + 0.5f;
|
||||
float thisdistance = (off1 * off1) + (off2 * off2);
|
||||
if (thisdistance > radius * radius)
|
||||
{
|
||||
offset2++;
|
||||
@@ -159,14 +161,14 @@ private:
|
||||
|
||||
}
|
||||
float treeShape(int y){
|
||||
if (y < (((float) height) * 0.3)) return (float) -1.618;
|
||||
float radius = ((float) height) / ((float) 2.0);
|
||||
float adjacent = (((float) height) / ((float) 2.0)) - y;
|
||||
if (y < (((float) height) * 0.3f)) return (float) -1.618f;
|
||||
float radius = ((float) height) / ((float) 2.0f);
|
||||
float adjacent = (((float) height) / ((float) 2.0f)) - y;
|
||||
float distance;
|
||||
if (adjacent == 0) distance = radius;
|
||||
else if (abs(adjacent) >= radius) distance = (float) 0.0;
|
||||
else if (abs(adjacent) >= radius) distance = (float) 0.0f;
|
||||
else distance = (float) sqrt(pow(abs(radius), 2) - pow(abs(adjacent), 2));
|
||||
distance *= (float) 0.5;
|
||||
distance *= (float) 0.5f;
|
||||
return distance;
|
||||
}
|
||||
float foliageShape(int y){
|
||||
@@ -207,8 +209,8 @@ private:
|
||||
char primsign;
|
||||
if (delta[primidx] > 0) primsign = 1;
|
||||
else primsign = -1;
|
||||
double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]);
|
||||
double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]);
|
||||
float secfac1 = ((float) delta[secidx1]) / ((float) delta[primidx]);
|
||||
float secfac2 = ((float) delta[secidx2]) / ((float) delta[primidx]);
|
||||
int coordinate[] = { 0, 0, 0 };
|
||||
int primoffset = 0;
|
||||
int endoffset = delta[primidx] + primsign;
|
||||
@@ -312,8 +314,8 @@ private:
|
||||
char primsign;
|
||||
if (delta[primidx] > 0) primsign = 1;
|
||||
else primsign = -1;
|
||||
double secfac1 = ((double) delta[secidx1]) / ((double) delta[primidx]);
|
||||
double secfac2 = ((double) delta[secidx2]) / ((double) delta[primidx]);
|
||||
float secfac1 = ((float) delta[secidx1]) / ((float) delta[primidx]);
|
||||
float secfac2 = ((float) delta[secidx2]) / ((float) delta[primidx]);
|
||||
int coordinate[] = { 0, 0, 0 };
|
||||
int primoffset = 0;
|
||||
int endoffset = delta[primidx] + primsign;
|
||||
@@ -331,19 +333,19 @@ private:
|
||||
}
|
||||
primoffset += primsign;
|
||||
}
|
||||
|
||||
|
||||
if (primoffset == endoffset)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
return abs(primoffset);
|
||||
}
|
||||
}
|
||||
bool checkLocation(){
|
||||
|
||||
|
||||
int startPosition[] = { origin[0], origin[1], origin[2] };
|
||||
int endPosition[] = { origin[0], origin[1] + height - 1, origin[2] };
|
||||
|
||||
@@ -373,11 +375,11 @@ private:
|
||||
public:
|
||||
BasicTree(bool doUpdate){
|
||||
axisConversionArray[0] = 2;
|
||||
axisConversionArray[1] = 0;
|
||||
axisConversionArray[2] = 0;
|
||||
axisConversionArray[3] = 1;
|
||||
axisConversionArray[4] = 2;
|
||||
axisConversionArray[5] = 1;
|
||||
axisConversionArray[1] = 0;
|
||||
axisConversionArray[2] = 0;
|
||||
axisConversionArray[3] = 1;
|
||||
axisConversionArray[4] = 2;
|
||||
axisConversionArray[5] = 1;
|
||||
rnd = new Random();
|
||||
origin[0] = 0;
|
||||
origin[1] = 0;
|
||||
@@ -405,7 +407,7 @@ public:
|
||||
delete [] foliageCoords;
|
||||
}
|
||||
|
||||
virtual void init(double heightInit, double widthInit, double foliageDensityInit){
|
||||
virtual void init(float heightInit, float widthInit, float foliageDensityInit){
|
||||
|
||||
heightVariance = (int) (heightInit * 12);
|
||||
if (heightInit > 0.5) foliageHeight = 5;
|
||||
@@ -430,7 +432,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
prepare();
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "../levelgen/feature/SpruceFeature.h"
|
||||
#include "../levelgen/feature/BirchFeature.h"
|
||||
#include "../levelgen/feature/TreeFeature.h"
|
||||
#include "../levelgen/feature/BasicTree.h"
|
||||
|
||||
class Sapling: public Bush
|
||||
{
|
||||
@@ -90,9 +91,9 @@ public:
|
||||
// f = new TreeFeature(true, 4 + random.nextInt(7), TreeTile::JUNGLE_TRUNK, LeafTile::JUNGLE_LEAF, false);
|
||||
// }
|
||||
} else {
|
||||
//if (random->nextInt(10) == 0) {
|
||||
// f = new BasicTree(true);
|
||||
//} else
|
||||
if (random->nextInt(10) == 0) {
|
||||
f = new BasicTree(true);
|
||||
} else
|
||||
f = new TreeFeature(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user