Skip to content

Commit

Permalink
Merge pull request #127 from gottsch/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
gottsch authored Apr 22, 2020
2 parents 2c3f8b0 + 6e7923c commit f8ac2a2
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Treasure2-1.12.2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package_group=someguyssoftware.treasure2
# user alpha, beta, or v (for version)
mod_version_type=v

mod_version=1.11.0
mod_version=1.11.1

#versions
mc_version=1.12.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class Treasure extends AbstractMod {
// constants
public static final String MODID = "treasure2";
protected static final String NAME = "Treasure2";
protected static final String VERSION = "1.11.0";
protected static final String VERSION = "1.11.1";

public static final String UPDATE_JSON_URL = "https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/master/Treasure2-1.12.2/update.json";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ public GeneratorResult<GeneratorData> generate(World world, Random random, ICoor
// determine size of oasis
int radius = RandomHelper.randomInt(random, MIN_OASIS_RADIUS, MAX_OASIS_RADIUS); // min of 8, so diameter = 16, area = 16x16, same as chunk
AxisAlignedBB oasisBounds = new AxisAlignedBB(coords.add(-radius, 0, -radius).toPos() , coords.add(radius, 0, radius).toPos());
ICoords centerCoords = new Coords(oasisBounds.getCenter());
int width = Math.abs((int) (oasisBounds.maxX - oasisBounds.minX));
int depth = Math.abs((int) (oasisBounds.maxZ - oasisBounds.minZ));
ICoords centerCoords = new Coords((int)(oasisBounds.minX + width * 0.5D), (int)oasisBounds.minY, (int)(oasisBounds.minZ + depth * 0.5D));

centerCoords = WorldInfo.getDryLandSurfaceCoords(world, centerCoords);

generateBase(world, random, coords, radius);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
*
Expand Down Expand Up @@ -370,16 +373,17 @@ public GeneratorResult<GeneratorData> generate(World world, Random random, ICoor
}

private void buildScrub(World world, Random random, AxisAlignedBB witherGroveSize) {
ICoords centerCoords = new Coords(witherGroveSize.getCenter());
// Treasure.logger.debug("adding scrub ...");
int width = Math.abs((int) (witherGroveSize.maxX - witherGroveSize.minX));
int depth = Math.abs((int) (witherGroveSize.maxZ - witherGroveSize.minZ));
ICoords centerCoords = new Coords((int)(witherGroveSize.minX + width * 0.5D), (int)witherGroveSize.minY, (int)(witherGroveSize.minZ + depth * 0.5D));

for (int rockIndex = 0; rockIndex < RandomHelper.randomInt(MIN_SCRUB, MAX_SCRUB); rockIndex++) {
for (int scrubIndex = 0; scrubIndex < RandomHelper.randomInt(MIN_SCRUB, MAX_SCRUB); scrubIndex++) {
int xOffset = (int) (random.nextFloat() * width - (width/2));
int zOffset = (int) (random.nextFloat() * depth - (depth/2));

ICoords surfaceCoords = WorldInfo.getDryLandSurfaceCoords(world, centerCoords.add(xOffset, 0, zOffset).withY(255));

// Treasure.logger.debug("adding scrub at -> {}", surfaceCoords.toShortString());
// check if current block is a dirt, podzol, coarse dirt or sand
Block supportBlock = world.getBlockState(surfaceCoords.down(1).toPos()).getBlock();
if (supportBlock == Blocks.DIRT || supportBlock == Blocks.SAND) {
Expand All @@ -395,18 +399,19 @@ private void buildScrub(World world, Random random, AxisAlignedBB witherGroveSiz
}

private void buildRocks(World world, Random random, AxisAlignedBB witherGroveSize) {
ICoords centerCoords = new Coords(witherGroveSize.getCenter());
// Treasure.logger.debug("adding rocks ...");
int width = Math.abs((int) (witherGroveSize.maxX - witherGroveSize.minX));
int depth = Math.abs((int) (witherGroveSize.maxZ - witherGroveSize.minZ));

ICoords centerCoords = new Coords((int)(witherGroveSize.minX + width * 0.5D), (int)witherGroveSize.minY, (int)(witherGroveSize.minZ + depth * 0.5D));

for (int rockIndex = 0; rockIndex < RandomHelper.randomInt(MIN_ROCKS, MAX_ROCKS); rockIndex++) {
// randomize a position within the aabb
int xOffset = (int) (random.nextFloat() * width - (width/2));
int zOffset = (int) (random.nextFloat() * depth - (depth/2));

ICoords rocksCoords = WorldInfo.getDryLandSurfaceCoords(world, centerCoords.add(xOffset, 0, zOffset).withY(255));
rocksCoords = rocksCoords.down(1);

//Treasure.logger.debug("adding rocks at -> {}", rocksCoords.toShortString());
// check if current block is a tree or any treasure block
if (world.getBlockState(rocksCoords.toPos()).getBlock() instanceof ITreasureBlock) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion Treasure2-1.12.2/src/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"modid": "treasure2",
"name": "Treasure2!",
"description": "",
"version": "1.11.0",
"version": "1.11.1",
"mcversion": "1.12.2",
"url": "",
"updateUrl": "",
Expand Down
7 changes: 4 additions & 3 deletions Treasure2-1.12.2/update.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"homepage": "https://minecraft.curseforge.com/projects/treasure2",
"promos": {
"1.12.2-latest": "1.11.0",
"1.12.2-recommended": "1.11.0"
"1.12.2-latest": "1.11.1",
"1.12.2-recommended": "1.11.1"
},
"1.12.2": {
"0.5.0": "alpha release",
Expand Down Expand Up @@ -36,7 +36,8 @@
"1.8.0": "Added Decay System.\nAdded 8 surface structures.\nAdded SpawnRuins command.\nFixed/enable other spawn commands.\nAdded Spanish translation.\nAdded Russian translation.\nFixed the number of uses a Key has.\nRemoved Lombok library.\nFixed solid base check for Surface/Submerged ruins.\nFixed Wither Tree crash bug.\nUsing GottschCore v1.10.0.\n",
"1.9.0": "Added Spider Chest.\nAdded recipes for all grave/tombstones.\nFixed config white/black lists on change.\nAll logging config options require mc restart.\nAdded config whitelist for dimensions.\nAdded ability to pass template holder into IRuinGenerators.\nUpdated all SpawnCommands to work from Command blocks.\nAdding fill blocks for under structures so there isnt any overhang when on cliffs etc.\nUsing GottschCore v1.11.0.\nAdded 2 surface structures.\nFixed *huge* bug with decay processor not picking the correct rule.\n",
"1.10.0": "Replaced fog blocks with mist particles around gravestone and wither trees.\nAdded Bound Soul mob.\nAdded Collapsing Trap Pit.\nAdded 2 submerged structures.\nAdded beached shipwrecks.\nAdded skeleton, zombie and creeper heads to epic loot table.\nAdded config option to turn off gem ores gen.\nAdded config option to toggle default decay ruleset file enforcement.\nAdded config option to turn off starting book.\nUpdated spanish lang file.\nUsing GottschCore 1.12.1",
"1.11.0": "Added Viking Chest.\nAdded some environmentals to Wither Tree grove.\nAdded Oasis framework and added Desert Oasis.\nAdded 2 surface structures.\nFixed Collpasing Trap Pit in deserts.\nRegistered Ruby and Sapphire with OreDict as gemRuby, gemSappphire.\nFixed loot table error.\nFixed Wither Chest bug.\nResized pearls textures to look more like pearls and less like snowballs."
"1.11.0": "Added Viking Chest.\nAdded some environmentals to Wither Tree grove.\nAdded Oasis framework and added Desert Oasis.\nAdded 2 surface structures.\nFixed Collpasing Trap Pit in deserts.\nRegistered Ruby and Sapphire with OreDict as gemRuby, gemSappphire.\nFixed loot table error.\nFixed Wither Chest bug.\nResized pearls textures to look more like pearls and less like snowballs.",
"1.11.1": "Fixed server error on Wither tree gen."
}
}

0 comments on commit f8ac2a2

Please sign in to comment.