-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47641bc
commit 662ddb5
Showing
31 changed files
with
638 additions
and
5 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
src/main/java/com/lumiscosity/rounded/worldgen/OceanRockFeature.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.lumiscosity.rounded.worldgen; | ||
|
||
import com.mojang.serialization.Codec; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
import net.minecraft.util.math.random.Random; | ||
import net.minecraft.world.StructureWorldAccess; | ||
import net.minecraft.world.gen.feature.Feature; | ||
import net.minecraft.world.gen.feature.SimpleBlockFeatureConfig; | ||
import net.minecraft.world.gen.feature.util.FeatureContext; | ||
|
||
public class OceanRockFeature extends Feature<SimpleBlockFeatureConfig> { | ||
public OceanRockFeature(Codec<SimpleBlockFeatureConfig> codec) { | ||
super(codec); | ||
} | ||
|
||
@Override | ||
public boolean generate(FeatureContext<SimpleBlockFeatureConfig> context) { | ||
BlockPos origin = context.getOrigin(); | ||
StructureWorldAccess structureWorldAccess = context.getWorld(); | ||
Random random = context.getRandom(); | ||
|
||
SimpleBlockFeatureConfig SimpleBlockFeatureConfig; | ||
for (SimpleBlockFeatureConfig = context.getConfig(); origin.getY() > structureWorldAccess.getBottomY() + 3; origin = origin.down()) { | ||
if (!structureWorldAccess.isAir(origin.down())) { | ||
BlockState blockState = structureWorldAccess.getBlockState(origin.down()); | ||
if (isSoil(blockState) || isStone(blockState)) { | ||
break; | ||
} | ||
} | ||
} | ||
|
||
if (origin.getY() <= structureWorldAccess.getBottomY() + 9) { | ||
return false; | ||
} else { | ||
int[] heights = { | ||
random.nextInt(7), random.nextInt(8), random.nextInt(7), | ||
random.nextInt(8), random.nextInt(9), random.nextInt(8), | ||
random.nextInt(7), random.nextInt(8), random.nextInt(7) | ||
}; | ||
|
||
BlockPos.Mutable pos = new BlockPos.Mutable(); | ||
for (int i = 0; i < 9; i++) { | ||
pos.set(origin.getX() + i % 3,origin.getY() - random.nextInt(3),origin.getZ() + i / 3); | ||
for (int j = 0; j < heights[i]; j++) { | ||
structureWorldAccess.setBlockState(pos, SimpleBlockFeatureConfig.toPlace().get(random, pos), Block.NOTIFY_ALL); | ||
pos.move(Direction.UP); | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/com/lumiscosity/rounded/worldgen/structure/OceanMonumentGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.lumiscosity.rounded.worldgen.structure; | ||
|
||
public class OceanMonumentGenerator { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/lumiscosity/rounded/worldgen/structure/OceanMonumentStructure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.lumiscosity.rounded.worldgen.structure; | ||
|
||
public class OceanMonumentStructure { | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/resources/data/minecraft/worldgen/structure/monument.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"type": "rounded:ocean_monument", | ||
"biomes": "#minecraft:has_structure/ocean_monument", | ||
"spawn_overrides": { | ||
"axolotls": { | ||
"bounding_box": "full", | ||
"spawns": [] | ||
}, | ||
"monster": { | ||
"bounding_box": "full", | ||
"spawns": [ | ||
{ | ||
"type": "minecraft:guardian", | ||
"maxCount": 4, | ||
"minCount": 2, | ||
"weight": 1 | ||
} | ||
] | ||
}, | ||
"underground_water_creature": { | ||
"bounding_box": "full", | ||
"spawns": [] | ||
} | ||
}, | ||
"step": "surface_structures" | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/resources/data/rounded/advancement/recipes/building_blocks/bladderwrack_block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_log": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "rounded:bladderwrack" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "rounded:bladderwrack_block" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_log" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"rounded:bladderwrack_block" | ||
] | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...esources/data/rounded/advancement/recipes/building_blocks/chiseled_prismarine_bricks.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_log": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "minecraft:prismarine_bricks" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_log" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"rounded:chiseled_prismarine_bricks", | ||
"rounded:stonecutter/chiseled_prismarine_bricks" | ||
] | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...n/resources/data/rounded/advancement/recipes/building_blocks/dead_bladderwrack_block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_log": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "rounded:dead_bladderwrack" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "rounded:dead_bladderwrack_block" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_log" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"rounded:dead_bladderwrack_block" | ||
] | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...resources/data/rounded/advancement/recipes/building_blocks/furnace/smooth_prismarine.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_log": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "minecraft:prismarine" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "rounded:furnace/smooth_prismarine" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_log" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"rounded:furnace/smooth_prismarine" | ||
] | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/resources/data/rounded/advancement/recipes/building_blocks/moisture_detector.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_log": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "rounded:smooth_prismarine" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "rounded:moisture_detector" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_log" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"rounded:moisture_detector" | ||
] | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/resources/data/rounded/advancement/recipes/building_blocks/prismarine_lantern.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_log": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "minecraft:prismarine_crystals" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "rounded:prismarine_lantern" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_log" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"rounded:prismarine_lantern" | ||
] | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...in/resources/data/rounded/advancement/recipes/building_blocks/smooth_prismarine_slab.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_log": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "rounded:smooth_prismarine" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_log" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"rounded:smooth_prismarine_slab", | ||
"rounded:stonecutter/smooth_prismarine_slab" | ||
] | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/resources/data/rounded/loot_table/blocks/bladderwrack.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"type": "minecraft:block", | ||
"pools": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:match_tool", | ||
"predicate": { | ||
"predicates": { | ||
"minecraft:enchantments": [ | ||
{ | ||
"enchantments": "minecraft:silk_touch", | ||
"levels": { | ||
"min": 1 | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "rounded:bladderwrack" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
], | ||
"random_sequence": "rounded:blocks/bladderwrack" | ||
} |
Oops, something went wrong.