-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add custom dimension with own portal, add new custom structures (Vlad…
…ik House, Storage Platform), add new dependency into build.gradle (CustomPortalAPI) and refactor mythril staff throw item
- Loading branch information
Vladyslav Potapenko
committed
Dec 28, 2022
1 parent
c587a4e
commit 1ff722b
Showing
23 changed files
with
369 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
34 changes: 34 additions & 0 deletions
34
src/main/java/me/nylestroke/nylemod/world/dimension/ModDimensions.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,34 @@ | ||
package me.nylestroke.nylemod.world.dimension; | ||
|
||
import me.nylestroke.nylemod.NylemodExample; | ||
import me.nylestroke.nylemod.block.ModBlocks; | ||
import me.nylestroke.nylemod.fluid.ModFluids; | ||
import net.kyrptonaught.customportalapi.api.CustomPortalBuilder; | ||
import net.minecraft.block.Blocks; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.Registry; | ||
import net.minecraft.util.registry.RegistryKey; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.dimension.DimensionType; | ||
|
||
public class ModDimensions { | ||
|
||
public static final RegistryKey<World> LAGUNA_DIMENSION_KEY = RegistryKey.of(Registry.WORLD_KEY, | ||
new Identifier(NylemodExample.MOD_ID, "laguna")); | ||
|
||
public static final RegistryKey<DimensionType> LAGUNA_TYPE_KEY = RegistryKey.of(Registry.DIMENSION_TYPE_KEY, | ||
LAGUNA_DIMENSION_KEY.getValue()); | ||
|
||
public static void registerDimensions() { | ||
NylemodExample.LOGGER.debug("Registering ModDimensions for: " + NylemodExample.MOD_ID); | ||
|
||
CustomPortalBuilder.beginPortal() | ||
.frameBlock(ModBlocks.MYTHRIL_BLOCK) | ||
.destDimID(LAGUNA_DIMENSION_KEY.getValue()) | ||
.tintColor(240, 160, 60) | ||
.lightWithFluid(ModFluids.HONEY_STILL) | ||
.onlyLightInOverworld() | ||
.registerPortal(); | ||
} | ||
|
||
} |
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,12 @@ | ||
{ | ||
"type": "nylemod:laguna", | ||
"generator": { | ||
"type": "minecraft:noise", | ||
"seed": -485105919, | ||
"settings": "minecraft:overworld", | ||
"biome_source": { | ||
"type": "minecraft:fixed", | ||
"biome": "minecraft:plains" | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/resources/data/nylemod/dimension_type/laguna.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,16 @@ | ||
{ | ||
"ultrawarm": false, | ||
"natural": true, | ||
"piglin_safe": false, | ||
"respawn_anchor_works": false, | ||
"bed_works": false, | ||
"has_raids": true, | ||
"has_skylight": true, | ||
"has_ceiling": false, | ||
"coordinate_scale": 1, | ||
"ambient_light": 0, | ||
"logical_height": 256, | ||
"infiniburn": "#minecraft:infiniburn_overworld", | ||
"min_y": 0, | ||
"height": 256 | ||
} |
Binary file added
BIN
+3.28 KB
src/main/resources/data/nylemod/structures/diamond_storage_platform.nbt
Binary file not shown.
Binary file added
BIN
+3.26 KB
src/main/resources/data/nylemod/structures/emerald_storage_platform.nbt
Binary file not shown.
Binary file added
BIN
+3.33 KB
src/main/resources/data/nylemod/structures/mythril_storage_platform.nbt
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions
17
src/main/resources/data/nylemod/tags/worldgen/biome/has_structure/storage_platform.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,17 @@ | ||
{ | ||
"replace": false, | ||
|
||
"_comment": " This biome tag can specify the biome directly. Or specify another biome tag by starting with # ", | ||
"values": [ | ||
"#minecraft:is_jungle", | ||
"#minecraft:is_forest", | ||
"#minecraft:is_taiga", | ||
"minecraft:desert", | ||
"minecraft:plains", | ||
"minecraft:snowy_plains", | ||
"minecraft:sunflower_plains", | ||
"minecraft:savanna", | ||
"minecraft:savanna_plateau", | ||
"minecraft:windswept_savanna" | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/resources/data/nylemod/tags/worldgen/biome/has_structure/vladik_house.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,17 @@ | ||
{ | ||
"replace": false, | ||
|
||
"_comment": " This biome tag can specify the biome directly. Or specify another biome tag by starting with # ", | ||
"values": [ | ||
"#minecraft:is_jungle", | ||
"#minecraft:is_forest", | ||
"#minecraft:is_taiga", | ||
"minecraft:desert", | ||
"minecraft:plains", | ||
"minecraft:snowy_plains", | ||
"minecraft:sunflower_plains", | ||
"minecraft:savanna", | ||
"minecraft:savanna_plateau", | ||
"minecraft:windswept_savanna" | ||
] | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/resources/data/nylemod/worldgen/configured_structure_feature/storage_platform.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,39 @@ | ||
{ | ||
// The base structure class to use for the behavior of the structure. (Like extra terrain checks and such) | ||
"type": "minecraft:village", | ||
|
||
"config": { | ||
// the path to the template pool json file to use | ||
"start_pool": "nylemod:storage_platform/start_pool", | ||
|
||
// This is how many pieces away from the starting piece a piece of the structure can spawn | ||
// Think of it like the length of the branch of the structure | ||
"size": 2 | ||
}, | ||
|
||
// The biome tag to use for what biomes that this structure can spawn in" | ||
"biomes": "#nylemod:has_structure/storage_platform", | ||
|
||
// If true, land will be add around the bottom of the structure. (Based on the starting piece's y value) | ||
"adapt_noise": true, | ||
|
||
// What mobs can spawn over time in the structure. | ||
// Make sure you add the mob to the right category (monster, creature, etc) | ||
"spawn_overrides": { | ||
"monster": { | ||
"bounding_box": "piece", | ||
"spawns": [] | ||
}, | ||
"creature": { | ||
"bounding_box": "piece", | ||
"spawns": [ | ||
{ | ||
"type": "minecraft:parrot", | ||
"weight": 1, | ||
"minCount": 1, | ||
"maxCount": 4 | ||
} | ||
] | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/resources/data/nylemod/worldgen/configured_structure_feature/vladik_house.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,39 @@ | ||
{ | ||
// The base structure class to use for the behavior of the structure. (Like extra terrain checks and such) | ||
"type": "minecraft:village", | ||
|
||
"config": { | ||
// the path to the template pool json file to use | ||
"start_pool": "nylemod:vladik_house/start_pool", | ||
|
||
// This is how many pieces away from the starting piece a piece of the structure can spawn | ||
// Think of it like the length of the branch of the structure | ||
"size": 2 | ||
}, | ||
|
||
// The biome tag to use for what biomes that this structure can spawn in" | ||
"biomes": "#nylemod:has_structure/vladik_house", | ||
|
||
// If true, land will be add around the bottom of the structure. (Based on the starting piece's y value) | ||
"adapt_noise": true, | ||
|
||
// What mobs can spawn over time in the structure. | ||
// Make sure you add the mob to the right category (monster, creature, etc) | ||
"spawn_overrides": { | ||
"monster": { | ||
"bounding_box": "piece", | ||
"spawns": [] | ||
}, | ||
"creature": { | ||
"bounding_box": "piece", | ||
"spawns": [ | ||
{ | ||
"type": "minecraft:parrot", | ||
"weight": 1, | ||
"minCount": 1, | ||
"maxCount": 4 | ||
} | ||
] | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/resources/data/nylemod/worldgen/structure_set/storage_platform.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,24 @@ | ||
{ | ||
// What structures to pick to try and spawn if a spot passes the placement check. | ||
// If two or more structures in this list can spawn in a biome at a spot, a random one based on weight is chosen to spawn | ||
"structures": [ | ||
{ | ||
"structure": "nylemod:storage_platform", | ||
"weight": 1 | ||
} | ||
], | ||
"placement": { | ||
// Make sure this is unique and does not match any other structure set's salt | ||
"salt": 728402846, | ||
|
||
// The average distance apart in chunks for spawn attempts | ||
"spacing": 21, | ||
|
||
// Minimum distance apart in chunks for spawn attempts | ||
// MUST ALWAYS BE SMALLER THAN spacing ABOVE | ||
"separation": 9, | ||
|
||
// The kind of placement to use. The other kind is ring based like strongholds use. | ||
"type": "minecraft:random_spread" | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/resources/data/nylemod/worldgen/structure_set/vladik_house.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,24 @@ | ||
{ | ||
// What structures to pick to try and spawn if a spot passes the placement check. | ||
// If two or more structures in this list can spawn in a biome at a spot, a random one based on weight is chosen to spawn | ||
"structures": [ | ||
{ | ||
"structure": "nylemod:vladik_house", | ||
"weight": 1 | ||
} | ||
], | ||
"placement": { | ||
// Make sure this is unique and does not match any other structure set's salt | ||
"salt": 355441213, | ||
|
||
// The average distance apart in chunks for spawn attempts | ||
"spacing": 19, | ||
|
||
// Minimum distance apart in chunks for spawn attempts | ||
// MUST ALWAYS BE SMALLER THAN spacing ABOVE | ||
"separation": 7, | ||
|
||
// The kind of placement to use. The other kind is ring based like strongholds use. | ||
"type": "minecraft:random_spread" | ||
} | ||
} |
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
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
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
36 changes: 36 additions & 0 deletions
36
src/main/resources/data/nylemod/worldgen/template_pool/storage_platform/side_pool.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,36 @@ | ||
{ | ||
// More info on template pools can be found here: https://minecraft.gamepedia.com/Custom_world_generation#JSON_format_8 | ||
// Yes, worldgen json files can have comments. Minecraft does "lenient" parsing of these json files. | ||
|
||
"name": "nylemod:storage_platform/side_pool", | ||
"fallback": "minecraft:empty", | ||
"elements": [ | ||
{ | ||
"weight": 1, | ||
"element": { | ||
"location": "nylemod:diamond_storage_platform", | ||
"processors": "minecraft:empty", | ||
"projection": "rigid", | ||
"element_type": "minecraft:single_pool_element" | ||
} | ||
}, | ||
{ | ||
"weight": 1, | ||
"element": { | ||
"location": "nylemod:emerald_storage_platform", | ||
"processors": "minecraft:empty", | ||
"projection": "rigid", | ||
"element_type": "minecraft:single_pool_element" | ||
} | ||
}, | ||
{ | ||
"weight": 1, | ||
"element": { | ||
"location": "nylemod:mythril_storage_platform", | ||
"processors": "minecraft:empty", | ||
"projection": "rigid", | ||
"element_type": "minecraft:single_pool_element" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.