-
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.
- Loading branch information
Showing
32 changed files
with
952 additions
and
3 deletions.
There are no files selected for viewing
12 changes: 11 additions & 1 deletion
12
src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924
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 |
---|---|---|
@@ -1,3 +1,13 @@ | ||
// 1.20.4 2024-09-08T20:21:52.127306 Registries | ||
// 1.20.4 2024-09-09T00:59:44.9842061 Registries | ||
477b95f83609ea2dd8482f82a4f56c4042d89de8 data/enhancedstonebricks/worldgen/structure/mod_desert_relic_structure.json | ||
d50999a6a95e11bb9cad8aec620930eb3070282c data/enhancedstonebricks/worldgen/structure/mod_end_relic_structure.json | ||
5db3f100eafa46928bdd7e00df605a7253661164 data/enhancedstonebricks/worldgen/structure/mod_nether_relic_structure.json | ||
50cceb240ed48390865fc3cb6fd93e31cd8ad610 data/enhancedstonebricks/worldgen/structure/mod_ocean_relic_structure.json | ||
5db3f100eafa46928bdd7e00df605a7253661164 data/enhancedstonebricks/worldgen/structure/mod_soul_relic_structure.json | ||
32e1b6be17e0534660d235c27886abc933c37ea5 data/enhancedstonebricks/worldgen/structure/mod_vitality_relic_structure.json | ||
9bd304efc7a5d834dd1ee6fb1a2e76e8ca34c747 data/enhancedstonebricks/worldgen/structure_set/mod_desert_relic_structure.json | ||
357a30f14d144bd9046eec07e8b6a5a3ebe3c148 data/enhancedstonebricks/worldgen/structure_set/mod_end_relic_structure.json | ||
46d9684c8d5de3d70294ed4ec096d3020dcc4ebd data/enhancedstonebricks/worldgen/structure_set/mod_nether_relic_structure.json | ||
a04a27f7b76f34c43ba6543542dfc86b78d310be data/enhancedstonebricks/worldgen/structure_set/mod_ocean_relic_structure.json | ||
13e2453e7afa368c62bae5fdb61137b000b1f84e data/enhancedstonebricks/worldgen/structure_set/mod_soul_relic_structure.json | ||
e121c9154b99f141d6e22eee9308f900b98e2e64 data/enhancedstonebricks/worldgen/structure_set/mod_vitality_relic_structure.json |
6 changes: 6 additions & 0 deletions
6
...erated/resources/data/enhancedstonebricks/worldgen/structure/mod_end_relic_structure.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,6 @@ | ||
{ | ||
"type": "enhancedstonebricks:mod_desert_relic_structure", | ||
"biomes": "#forge:is_cold/end", | ||
"spawn_overrides": {}, | ||
"step": "surface_structures" | ||
} |
6 changes: 6 additions & 0 deletions
6
...ted/resources/data/enhancedstonebricks/worldgen/structure/mod_nether_relic_structure.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,6 @@ | ||
{ | ||
"type": "enhancedstonebricks:mod_desert_relic_structure", | ||
"biomes": "#forge:is_dry/nether", | ||
"spawn_overrides": {}, | ||
"step": "surface_structures" | ||
} |
6 changes: 6 additions & 0 deletions
6
...ated/resources/data/enhancedstonebricks/worldgen/structure/mod_ocean_relic_structure.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,6 @@ | ||
{ | ||
"type": "enhancedstonebricks:mod_desert_relic_structure", | ||
"biomes": "#minecraft:has_structure/ruined_portal_ocean", | ||
"spawn_overrides": {}, | ||
"step": "surface_structures" | ||
} |
6 changes: 6 additions & 0 deletions
6
...rated/resources/data/enhancedstonebricks/worldgen/structure/mod_soul_relic_structure.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,6 @@ | ||
{ | ||
"type": "enhancedstonebricks:mod_desert_relic_structure", | ||
"biomes": "#forge:is_dry/nether", | ||
"spawn_overrides": {}, | ||
"step": "surface_structures" | ||
} |
6 changes: 6 additions & 0 deletions
6
...d/resources/data/enhancedstonebricks/worldgen/structure/mod_vitality_relic_structure.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,6 @@ | ||
{ | ||
"type": "enhancedstonebricks:mod_desert_relic_structure", | ||
"biomes": "#minecraft:is_forest", | ||
"spawn_overrides": {}, | ||
"step": "surface_structures" | ||
} |
14 changes: 14 additions & 0 deletions
14
...ed/resources/data/enhancedstonebricks/worldgen/structure_set/mod_end_relic_structure.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,14 @@ | ||
{ | ||
"placement": { | ||
"type": "minecraft:random_spread", | ||
"salt": 98715357, | ||
"separation": 8, | ||
"spacing": 28 | ||
}, | ||
"structures": [ | ||
{ | ||
"structure": "enhancedstonebricks:mod_end_relic_structure", | ||
"weight": 1 | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
...resources/data/enhancedstonebricks/worldgen/structure_set/mod_nether_relic_structure.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,14 @@ | ||
{ | ||
"placement": { | ||
"type": "minecraft:random_spread", | ||
"salt": 65423147, | ||
"separation": 8, | ||
"spacing": 28 | ||
}, | ||
"structures": [ | ||
{ | ||
"structure": "enhancedstonebricks:mod_nether_relic_structure", | ||
"weight": 1 | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
.../resources/data/enhancedstonebricks/worldgen/structure_set/mod_ocean_relic_structure.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,14 @@ | ||
{ | ||
"placement": { | ||
"type": "minecraft:random_spread", | ||
"salt": 15489653, | ||
"separation": 8, | ||
"spacing": 28 | ||
}, | ||
"structures": [ | ||
{ | ||
"structure": "enhancedstonebricks:mod_ocean_relic_structure", | ||
"weight": 1 | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
...d/resources/data/enhancedstonebricks/worldgen/structure_set/mod_soul_relic_structure.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,14 @@ | ||
{ | ||
"placement": { | ||
"type": "minecraft:random_spread", | ||
"salt": 78435694, | ||
"separation": 8, | ||
"spacing": 28 | ||
}, | ||
"structures": [ | ||
{ | ||
"structure": "enhancedstonebricks:mod_soul_relic_structure", | ||
"weight": 1 | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
...sources/data/enhancedstonebricks/worldgen/structure_set/mod_vitality_relic_structure.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,14 @@ | ||
{ | ||
"placement": { | ||
"type": "minecraft:random_spread", | ||
"salt": 87364230, | ||
"separation": 8, | ||
"spacing": 28 | ||
}, | ||
"structures": [ | ||
{ | ||
"structure": "enhancedstonebricks:mod_vitality_relic_structure", | ||
"weight": 1 | ||
} | ||
] | ||
} |
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
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
112 changes: 112 additions & 0 deletions
112
.../java/net/rswfb/enhancedstonebricks/world/structure/piece/ModEndRelicStructurePieces.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,112 @@ | ||
package net.rswfb.enhancedstonebricks.world.structure.piece; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.util.RandomSource; | ||
import net.minecraft.world.level.ChunkPos; | ||
import net.minecraft.world.level.ServerLevelAccessor; | ||
import net.minecraft.world.level.StructureManager; | ||
import net.minecraft.world.level.WorldGenLevel; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.block.Mirror; | ||
import net.minecraft.world.level.block.Rotation; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.entity.ChestBlockEntity; | ||
import net.minecraft.world.level.chunk.ChunkGenerator; | ||
import net.minecraft.world.level.levelgen.Heightmap; | ||
import net.minecraft.world.level.levelgen.structure.BoundingBox; | ||
import net.minecraft.world.level.levelgen.structure.StructurePieceAccessor; | ||
import net.minecraft.world.level.levelgen.structure.TemplateStructurePiece; | ||
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.BlockIgnoreProcessor; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager; | ||
import net.minecraft.world.level.storage.loot.BuiltInLootTables; | ||
import net.rswfb.enhancedstonebricks.ExampleMod; | ||
import net.rswfb.enhancedstonebricks.world.structure.*; | ||
|
||
import java.util.Map; | ||
|
||
public class ModEndRelicStructurePieces { | ||
static final ResourceLocation STRUCTURE_LOCATION_MOD_END_RELIC_STRUCTURE = new ResourceLocation(ExampleMod.MODID,"mod_end_relic_structure"); | ||
static final Map<ResourceLocation, BlockPos> PIVOTS = ImmutableMap.of( | ||
STRUCTURE_LOCATION_MOD_END_RELIC_STRUCTURE, new BlockPos(4, 0, 4) | ||
); | ||
static final Map<ResourceLocation, BlockPos> OFFSETS = ImmutableMap.of( | ||
STRUCTURE_LOCATION_MOD_END_RELIC_STRUCTURE, BlockPos.ZERO | ||
); | ||
|
||
public static void addPieces( | ||
StructureTemplateManager pStructureTemplateManager, BlockPos pStartPos, Rotation pRotation, StructurePieceAccessor pPieces, RandomSource pRandom | ||
) { | ||
pPieces.addPiece(new ModEndRelicStructurePieces.ModEndRelicStructurePiece(pStructureTemplateManager, STRUCTURE_LOCATION_MOD_END_RELIC_STRUCTURE, pStartPos, pRotation, 0)); | ||
} | ||
|
||
public static class ModEndRelicStructurePiece extends TemplateStructurePiece { | ||
|
||
public ModEndRelicStructurePiece(StructureTemplateManager pStructureTemplateManager, ResourceLocation pLocation, BlockPos pStartPos, Rotation pRotation, int pDown) { | ||
super(ModStructurePieceTypes.MOD_END_RELIC_STRUCTURE_PIECE.get(), 0, pStructureTemplateManager, pLocation, pLocation.toString(), | ||
makeSettings(pRotation, pLocation), | ||
makePosition(pLocation, pStartPos, pDown) | ||
); | ||
} | ||
|
||
|
||
public ModEndRelicStructurePiece(StructureTemplateManager pStructureTemplateManager, CompoundTag pTag) { | ||
super(ModStructurePieceTypes.MOD_END_RELIC_STRUCTURE_PIECE.get(), pTag, pStructureTemplateManager, resourceLocation -> makeSettings(Rotation.valueOf(pTag.getString("Rot")), resourceLocation)); | ||
} | ||
|
||
private static StructurePlaceSettings makeSettings(Rotation pRotation, ResourceLocation pLocation) { | ||
return new StructurePlaceSettings() | ||
.setRotation(pRotation) | ||
.setMirror(Mirror.NONE) | ||
.setRotationPivot(ModEndRelicStructurePieces.PIVOTS.get(pLocation)) | ||
.addProcessor(BlockIgnoreProcessor.STRUCTURE_BLOCK); | ||
} | ||
|
||
private static BlockPos makePosition(ResourceLocation pLocation, BlockPos pPos, int pDown) { | ||
return pPos.offset(ModEndRelicStructurePieces.OFFSETS.get(pLocation)).below(pDown); | ||
} | ||
@Override | ||
protected void addAdditionalSaveData(StructurePieceSerializationContext pContext, CompoundTag pTag) { | ||
super.addAdditionalSaveData(pContext, pTag); | ||
pTag.putString("Rot", this.placeSettings.getRotation().name()); | ||
} | ||
|
||
@Override | ||
protected void handleDataMarker(String pName, BlockPos pPos, ServerLevelAccessor pLevel, RandomSource pRandom, BoundingBox pBox) { | ||
if ("chest".equals(pName)) { | ||
pLevel.setBlock(pPos, Blocks.AIR.defaultBlockState(), 3); | ||
BlockEntity blockentity = pLevel.getBlockEntity(pPos.below()); | ||
if (blockentity instanceof ChestBlockEntity) { | ||
((ChestBlockEntity)blockentity).setLootTable(BuiltInLootTables.IGLOO_CHEST, pRandom.nextLong()); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void postProcess( | ||
WorldGenLevel pLevel, | ||
StructureManager pStructureManager, | ||
ChunkGenerator pGenerator, | ||
RandomSource pRandom, | ||
BoundingBox pBox, | ||
ChunkPos pChunkPos, | ||
BlockPos pPos | ||
) { | ||
ResourceLocation resourceLocation = new ResourceLocation(this.templateName); | ||
StructurePlaceSettings structureplacesettings = makeSettings(this.placeSettings.getRotation(), resourceLocation); | ||
BlockPos blockpos = ModEndRelicStructurePieces.OFFSETS.get(resourceLocation); | ||
BlockPos blockpos1 = this.templatePosition | ||
.offset(StructureTemplate.calculateRelativePosition(structureplacesettings, new BlockPos(3 - blockpos.getX(), 0, -blockpos.getZ()))); | ||
int i = pLevel.getHeight(Heightmap.Types.WORLD_SURFACE_WG, blockpos1.getX(), blockpos1.getZ()); | ||
BlockPos blockpos2 = this.templatePosition; | ||
this.templatePosition = this.templatePosition.offset(0, i - 90 - 1, 0); | ||
super.postProcess(pLevel, pStructureManager, pGenerator, pRandom, pBox, pChunkPos, pPos); | ||
this.templatePosition = blockpos2; | ||
} | ||
} | ||
} |
Oops, something went wrong.