1
0
mirror of https://github.com/chylex/Hardcore-Ender-Expansion-2.git synced 2025-04-14 12:15:44 +02:00

Define Stronghold size & update Stone Brick palette and checks

This commit is contained in:
chylex 2019-02-09 10:02:02 +01:00
parent 2a5a8048f9
commit e7921103e7
2 changed files with 16 additions and 7 deletions
src/main/java/chylex/hee/game/world/feature/stronghold

View File

@ -35,8 +35,10 @@ import chylex.hee.game.world.feature.stronghold.piece.StrongholdRoom_Trap_TallIn
import chylex.hee.game.world.structure.IBlockPicker.Weighted.Companion.Weighted
import chylex.hee.game.world.structure.file.PaletteBuilder
import chylex.hee.game.world.structure.file.PaletteMappings
import chylex.hee.game.world.util.Size
import chylex.hee.init.ModBlocks
import chylex.hee.system.Resource
import net.minecraft.block.Block
import net.minecraft.init.Blocks
import net.minecraft.init.Items
import net.minecraft.item.EnumDyeColor
@ -47,13 +49,15 @@ import net.minecraft.util.EnumFacing.SOUTH
import net.minecraft.util.EnumFacing.WEST
object StrongholdPieces{
val STRUCTURE_SIZE = Size(256, 32, 256)
val PALETTE_ENTRY_STONE_BRICK = Weighted(
555 to FutureBlocks.STONE_BRICKS,
150 to FutureBlocks.MOSSY_STONE_BRICKS,
150 to FutureBlocks.CRACKED_STONE_BRICKS,
70 to FutureBlocks.INFESTED_STONE_BRICKS,
45 to FutureBlocks.INFESTED_MOSSY_STONE_BRICKS,
30 to FutureBlocks.INFESTED_CRACKED_STONE_BRICKS
610 to FutureBlocks.STONE_BRICKS,
175 to FutureBlocks.MOSSY_STONE_BRICKS,
175 to FutureBlocks.CRACKED_STONE_BRICKS,
20 to FutureBlocks.INFESTED_STONE_BRICKS,
12 to FutureBlocks.INFESTED_MOSSY_STONE_BRICKS,
8 to FutureBlocks.INFESTED_CRACKED_STONE_BRICKS
)
val PALETTE = with(PaletteBuilder()){
@ -120,6 +124,10 @@ object StrongholdPieces{
build()
}
fun isStoneBrick(block: Block): Boolean{
return block === Blocks.STONEBRICK || block === Blocks.MONSTER_EGG
}
val LOOT_GENERIC = Resource.Custom("chests/stronghold_generic")
val LOOT_LIBRARY_MAIN = Resource.Custom("chests/stronghold_library_main")
val LOOT_LIBRARY_SECOND = Resource.Custom("chests/stronghold_library_second")

View File

@ -1,4 +1,5 @@
package chylex.hee.game.world.feature.stronghold.piece
import chylex.hee.game.world.feature.stronghold.StrongholdPieces
import chylex.hee.game.world.feature.stronghold.connection.StrongholdRoomConnection
import chylex.hee.game.world.structure.IStructureWorld
import chylex.hee.game.world.structure.piece.IStructurePieceConnection
@ -42,7 +43,7 @@ class StrongholdRoom_Main_Scriptorium(file: String) : StrongholdAbstractPieceFro
if (world.isAir(testPos) && (isInAir || Facing4.any { !world.isAir(testPos.offset(it)) })){
val below = world.getBlock(testPos.down())
if (below === Blocks.BOOKSHELF || below === Blocks.STONEBRICK || below === Blocks.MONSTER_EGG || below === Blocks.STONE_SLAB){
if (below === Blocks.BOOKSHELF || below === Blocks.STONE_SLAB || StrongholdPieces.isStoneBrick(below)){
if (isInAir && rand.nextInt(4) == 0 && world.isAir(testPos.up())){
world.setBlock(testPos.up(), ModBlocks.ANCIENT_COBWEB)
}