diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 5226c4f5..0390817a 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -18,6 +18,7 @@ c67498a81f8dd53770da51df45192b171cdd234c assets/bloodmagic/blockstates/dungeon_b 8b568926830785a5cb848fb36d4ae01e67590501 assets/bloodmagic/blockstates/dungeon_brick_stairs.json 6c10c79909e008b960f2d78543f55847eec7a226 assets/bloodmagic/blockstates/dungeon_brick_wall.json 8a04e502b6965d912793699d61071e44428fceb8 assets/bloodmagic/blockstates/dungeon_eye.json +fe31978b41dc50c21f413c81410221f657fd4d23 assets/bloodmagic/blockstates/dungeon_ore.json 388af5c6d34f62d66d987760871c64793df84a37 assets/bloodmagic/blockstates/dungeon_pillar_cap.json 8d8d58ad890f339b75dbdfc710b30dc00eed2ef3 assets/bloodmagic/blockstates/dungeon_pillar_center.json 48e7b0533fa722eb66956e01de661ebac6470da7 assets/bloodmagic/blockstates/dungeon_pillar_special.json @@ -52,7 +53,7 @@ e6d9cf699667aaa47efff37b2b033895dee29c15 assets/bloodmagic/blockstates/waterritu 42f26f715bddd16c069f9b51e3767b36477c8908 assets/bloodmagic/blockstates/woodtilepath.json 3c6ce233dae6c1307d9016406c324bbe844b4e1e assets/bloodmagic/blockstates/wornstonebrickpath.json d59655f12d1724b73b77c373fb6864fcff69db12 assets/bloodmagic/blockstates/wornstonetilepath.json -d3b0f3df0b83423d59343a185b28f6de543b64bb assets/bloodmagic/lang/en_us.json +e7aab24fc4aa77601119478854ad929a1f384132 assets/bloodmagic/lang/en_us.json 34445195b9f2459475cde53454bc8e37d32865d7 assets/bloodmagic/models/block/accelerationrune.json bcdbccc49d4509571be6988762ab87126275a4c8 assets/bloodmagic/models/block/airritualstone.json adf6c0b1e25451609486dc8c8cfbd9cf0f8c67f4 assets/bloodmagic/models/block/alchemicalreactionchamber.json @@ -113,6 +114,7 @@ ffb2021036b74d29fca5fc706885f3e1399c2950 assets/bloodmagic/models/block/dungeon_ a7d371e5d0efefae2729131bda16120bfe477bb8 assets/bloodmagic/models/block/dungeon_brick_wall_side.json bd152efd619489661cac86a80190bf9e88c86363 assets/bloodmagic/models/block/dungeon_brick_wall_side_tall.json 19ae530a34eb5cee35dc7b9cdd51c9c2d61fdc9e assets/bloodmagic/models/block/dungeon_eye.json +61eb4e5ede53a8278d2d95fbeb40dc01424f2895 assets/bloodmagic/models/block/dungeon_ore.json a4449c1d14c46bcda58b542c3efdddadff15bedc assets/bloodmagic/models/block/dungeon_pillar_cap.json 1752cc99d0c334016bebd0e8027b8abe3ca5d7e8 assets/bloodmagic/models/block/dungeon_pillar_cap_down.json f171162bb4b86e70f2b2f13f3393704d295a4d86 assets/bloodmagic/models/block/dungeon_pillar_cap_east.json @@ -205,6 +207,7 @@ f866879eed9f1bd7eebac14495de599ca3ad855d assets/bloodmagic/models/item/dungeon_b 2ec6a2c66e88981ff54e74035bb3adb1ec4f6396 assets/bloodmagic/models/item/dungeon_brick_stairs.json 098a26f4e9222c801f9a17a6db1b266ad4085003 assets/bloodmagic/models/item/dungeon_brick_wall.json 0a48c4fd74036702ae2d72a9b2333c2bdf5ab31b assets/bloodmagic/models/item/dungeon_eye.json +95a45fae0890e626aa5e5ff85b9884bd30087244 assets/bloodmagic/models/item/dungeon_ore.json ba5c610437b7d3a84820109c32d204310ff41fd7 assets/bloodmagic/models/item/dungeon_pillar_cap.json d098a544e7b9918a45106c2cbc5e10baea66502a assets/bloodmagic/models/item/dungeon_pillar_center.json 5284f1cc7508546c66669564182fe5056053333d assets/bloodmagic/models/item/dungeon_pillar_special.json @@ -214,6 +217,7 @@ d098a544e7b9918a45106c2cbc5e10baea66502a assets/bloodmagic/models/item/dungeon_p f3b763d6edc3c75655797481f05e02d409f481d9 assets/bloodmagic/models/item/dungeon_polished_wall.json 2ecba4811bd02698f6a34b5cdd9160426f7bda63 assets/bloodmagic/models/item/dungeon_smallbrick.json 2d7a8a3ed9f91a5bf5c277c6342c69e97692d347 assets/bloodmagic/models/item/dungeon_stone.json +027369d4162f28a808223ca7b22bdb68de28f290 assets/bloodmagic/models/item/dungeon_tester.json 6186d2045f87b1e6cc7006226993a93b63d650ff assets/bloodmagic/models/item/dungeon_tile.json 21e8a4fa93ba249684e0624a10a6f0f00ff6d194 assets/bloodmagic/models/item/dungeon_tilespecial.json 10aceefca3ad3f0da773cb317c4effc6c06051ea assets/bloodmagic/models/item/duskritualstone.json @@ -413,6 +417,7 @@ be050ff812ae62793e3c51d7c2ab343294ede7f0 data/bloodmagic/loot_tables/blocks/dung 0d30aeb91425e2419abf555e9baab34475f45afc data/bloodmagic/loot_tables/blocks/dungeon_brick_stairs.json fa335aded871280065ca02db79d6de59ced7f6c9 data/bloodmagic/loot_tables/blocks/dungeon_brick_wall.json 47baa958866616d96eb39e2671a4cf488e0abae2 data/bloodmagic/loot_tables/blocks/dungeon_eye.json +234675dab5d5ff7e1fec0e13cede1f141811fc92 data/bloodmagic/loot_tables/blocks/dungeon_ore.json 53864c213b973e67006cda4596877bcdd3474396 data/bloodmagic/loot_tables/blocks/dungeon_pillar_cap.json db8be3b67639ab451d0a28e0674240094ceea046 data/bloodmagic/loot_tables/blocks/dungeon_pillar_center.json c3deab4dd4ef8c1cf6f217d660ea07e5d7bd8555 data/bloodmagic/loot_tables/blocks/dungeon_pillar_special.json diff --git a/src/generated/resources/assets/bloodmagic/blockstates/dungeon_ore.json b/src/generated/resources/assets/bloodmagic/blockstates/dungeon_ore.json new file mode 100644 index 00000000..a44ddeae --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/blockstates/dungeon_ore.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "bloodmagic:block/dungeon_ore" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/lang/en_us.json b/src/generated/resources/assets/bloodmagic/lang/en_us.json index e6065ae3..4599f71d 100644 --- a/src/generated/resources/assets/bloodmagic/lang/en_us.json +++ b/src/generated/resources/assets/bloodmagic/lang/en_us.json @@ -22,6 +22,7 @@ "block.bloodmagic.dungeon_brick_stairs": "Demon Brick Stairs", "block.bloodmagic.dungeon_brick_wall": "Demon Brick Wall", "block.bloodmagic.dungeon_eye": "Demon Eye", + "block.bloodmagic.dungeon_ore": "Demonite", "block.bloodmagic.dungeon_pillar_cap": "Demon Stone Pillar Cap", "block.bloodmagic.dungeon_pillar_center": "Demon Stone Pillar", "block.bloodmagic.dungeon_pillar_special": "Accented Demon Stone Pillar", diff --git a/src/generated/resources/assets/bloodmagic/models/block/dungeon_ore.json b/src/generated/resources/assets/bloodmagic/models/block/dungeon_ore.json new file mode 100644 index 00000000..93254ada --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/block/dungeon_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "bloodmagic:block/dungeon/dungeon_ore" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/dungeon_ore.json b/src/generated/resources/assets/bloodmagic/models/item/dungeon_ore.json new file mode 100644 index 00000000..64362081 --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/dungeon_ore.json @@ -0,0 +1,3 @@ +{ + "parent": "bloodmagic:block/dungeon_ore" +} \ No newline at end of file diff --git a/src/generated/resources/assets/bloodmagic/models/item/dungeon_tester.json b/src/generated/resources/assets/bloodmagic/models/item/dungeon_tester.json new file mode 100644 index 00000000..c5cafd38 --- /dev/null +++ b/src/generated/resources/assets/bloodmagic/models/item/dungeon_tester.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "bloodmagic:item/dungeon_tester" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/bloodmagic/loot_tables/blocks/dungeon_ore.json b/src/generated/resources/data/bloodmagic/loot_tables/blocks/dungeon_ore.json new file mode 100644 index 00000000..666396e2 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/loot_tables/blocks/dungeon_ore.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "bloodmagic:dungeon_ore" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/java/wayoftime/bloodmagic/BloodMagic.java b/src/main/java/wayoftime/bloodmagic/BloodMagic.java index 716bb7ad..dc0d09f5 100644 --- a/src/main/java/wayoftime/bloodmagic/BloodMagic.java +++ b/src/main/java/wayoftime/bloodmagic/BloodMagic.java @@ -53,6 +53,7 @@ import wayoftime.bloodmagic.network.BloodMagicPacketHandler; import wayoftime.bloodmagic.potion.BloodMagicPotions; import wayoftime.bloodmagic.registry.ModTranquilityHandlers; import wayoftime.bloodmagic.ritual.RitualManager; +import wayoftime.bloodmagic.structures.ModDungeons; import wayoftime.bloodmagic.tile.TileAlchemicalReactionChamber; import wayoftime.bloodmagic.tile.TileAlchemyArray; import wayoftime.bloodmagic.tile.TileAlchemyTable; @@ -127,6 +128,7 @@ public class BloodMagic context.registerConfig(ModConfig.Type.CLIENT, ConfigManager.CLIENT_SPEC); ModTranquilityHandlers.init(); + ModDungeons.init(); } private void registerRecipes(RegistryEvent.Register> event) diff --git a/src/main/java/wayoftime/bloodmagic/common/block/BloodMagicBlocks.java b/src/main/java/wayoftime/bloodmagic/common/block/BloodMagicBlocks.java index 62e75d65..46b19644 100644 --- a/src/main/java/wayoftime/bloodmagic/common/block/BloodMagicBlocks.java +++ b/src/main/java/wayoftime/bloodmagic/common/block/BloodMagicBlocks.java @@ -117,6 +117,7 @@ public class BloodMagicBlocks public static final RegistryObject DUNGEON_BRICK_1 = DUNGEONBLOCKS.register("dungeon_brick1", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool())); public static final RegistryObject DUNGEON_BRICK_2 = DUNGEONBLOCKS.register("dungeon_brick2", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool())); public static final RegistryObject DUNGEON_BRICK_3 = DUNGEONBLOCKS.register("dungeon_brick3", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool())); + public static final RegistryObject DUNGEON_ORE = DUNGEONBLOCKS.register("dungeon_ore", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool())); public static final RegistryObject DUNGEON_STONE = BLOCKS.register("dungeon_stone", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool())); public static final RegistryObject DUNGEON_EYE = DUNGEONBLOCKS.register("dungeon_eye", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool().setLightLevel((state) -> { diff --git a/src/main/java/wayoftime/bloodmagic/common/data/GeneratorLanguage.java b/src/main/java/wayoftime/bloodmagic/common/data/GeneratorLanguage.java index 991329f5..63a59469 100644 --- a/src/main/java/wayoftime/bloodmagic/common/data/GeneratorLanguage.java +++ b/src/main/java/wayoftime/bloodmagic/common/data/GeneratorLanguage.java @@ -366,6 +366,8 @@ public class GeneratorLanguage extends LanguageProvider addBlock(BloodMagicBlocks.DUNGEON_PILLAR_SPECIAL, "Accented Demon Stone Pillar"); addBlock(BloodMagicBlocks.DUNGEON_EYE, "Demon Eye"); + addBlock(BloodMagicBlocks.DUNGEON_ORE, "Demonite"); + // Item names addItem(BloodMagicItems.WEAK_BLOOD_ORB, "Weak Blood Orb"); addItem(BloodMagicItems.APPRENTICE_BLOOD_ORB, "Apprentice Blood Orb"); diff --git a/src/main/java/wayoftime/bloodmagic/common/item/BloodMagicItems.java b/src/main/java/wayoftime/bloodmagic/common/item/BloodMagicItems.java index bedc581c..a9b53118 100644 --- a/src/main/java/wayoftime/bloodmagic/common/item/BloodMagicItems.java +++ b/src/main/java/wayoftime/bloodmagic/common/item/BloodMagicItems.java @@ -31,6 +31,7 @@ import wayoftime.bloodmagic.common.registration.impl.BloodOrbDeferredRegister; import wayoftime.bloodmagic.common.registration.impl.BloodOrbRegistryObject; import wayoftime.bloodmagic.orb.BloodOrb; import wayoftime.bloodmagic.ritual.EnumRuneType; +import wayoftime.bloodmagic.structures.ItemDungeonTester; import wayoftime.bloodmagic.will.EnumDemonWillType; public class BloodMagicItems @@ -231,4 +232,9 @@ public class BloodMagicItems public static final RegistryObject DUNGEON_POLISHED_WALL_BLOCK = ITEMS.register("dungeon_polished_wall", () -> new BlockItem(BloodMagicBlocks.DUNGEON_POLISHED_WALL.get(), new Item.Properties().group(BloodMagic.TAB))); public static final RegistryObject DUNGEON_BRICK_GATE_BLOCK = ITEMS.register("dungeon_brick_gate", () -> new BlockItem(BloodMagicBlocks.DUNGEON_BRICK_GATE.get(), new Item.Properties().group(BloodMagic.TAB))); public static final RegistryObject DUNGEON_POLISHED_GATE_BLOCK = ITEMS.register("dungeon_polished_gate", () -> new BlockItem(BloodMagicBlocks.DUNGEON_POLISHED_GATE.get(), new Item.Properties().group(BloodMagic.TAB))); + + public static final RegistryObject DUNGEON_ORE_BLOCK = ITEMS.register("dungeon_ore", () -> new BlockItem(BloodMagicBlocks.DUNGEON_ORE.get(), new Item.Properties().group(BloodMagic.TAB))); + + public static final RegistryObject DUNGEON_TESTER = BASICITEMS.register("dungeon_tester", ItemDungeonTester::new); + } diff --git a/src/main/java/wayoftime/bloodmagic/gson/SerializerBase.java b/src/main/java/wayoftime/bloodmagic/gson/SerializerBase.java new file mode 100644 index 00000000..80bd8135 --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/gson/SerializerBase.java @@ -0,0 +1,28 @@ +package wayoftime.bloodmagic.gson; + +import java.lang.reflect.Type; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; + +public abstract class SerializerBase implements JsonDeserializer, JsonSerializer +{ + @Override + public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) + throws JsonParseException + { + return context.deserialize(json, getType()); + } + + @Override + public JsonElement serialize(T src, Type typeOfSrc, JsonSerializationContext context) + { + return context.serialize(src); + } + + public abstract Class getType(); +} diff --git a/src/main/java/wayoftime/bloodmagic/gson/Serializers.java b/src/main/java/wayoftime/bloodmagic/gson/Serializers.java new file mode 100644 index 00000000..41f6d28d --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/gson/Serializers.java @@ -0,0 +1,128 @@ +package wayoftime.bloodmagic.gson; + +import java.lang.reflect.Type; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; + +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.IDataSerializer; +import net.minecraft.util.Direction; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.registries.ForgeRegistries; +import wayoftime.bloodmagic.will.EnumDemonWillType; + +public class Serializers +{ + // Data serializers + public static final IDataSerializer WILL_TYPE_SERIALIZER = new IDataSerializer() + { + @Override + public void write(PacketBuffer buf, EnumDemonWillType value) + { + buf.writeEnumValue(value); + } + + @Override + public EnumDemonWillType read(PacketBuffer buf) + { + return buf.readEnumValue(EnumDemonWillType.class); + } + + @Override + public DataParameter createKey(int id) + { + return new DataParameter<>(id, this); + } + + @Override + public EnumDemonWillType copyValue(EnumDemonWillType value) + { + return EnumDemonWillType.valueOf(value.name()); + } + }; + + // Serializers + public static final SerializerBase FACING_SERIALIZER = new SerializerBase() + { + @Override + public Class getType() + { + return Direction.class; + } + + @Override + public Direction deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) + throws JsonParseException + { + return Direction.byName(json.getAsString()); + } + }; + public static final SerializerBase RESOURCELOCATION_SERIALIZER = new SerializerBase() + { + @Override + public Class getType() + { + return ResourceLocation.class; + } + + @Override + public ResourceLocation deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) + throws JsonParseException + { + String domain = json.getAsJsonObject().get("domain").getAsString(); + String path = json.getAsJsonObject().get("path").getAsString(); + return new ResourceLocation(domain, path); + } + + @Override + public JsonElement serialize(ResourceLocation src, Type typeOfSrc, JsonSerializationContext context) + { + JsonObject object = new JsonObject(); + object.addProperty("domain", src.getNamespace()); + object.addProperty("path", src.getPath()); + return object; + } + }; + public static final SerializerBase ITEMMETA_SERIALIZER = new SerializerBase() + { + @Override + public Class getType() + { + return ItemStack.class; + } + + @Override + public ItemStack deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) + throws JsonParseException + { + ResourceLocation registryName = context.deserialize(json.getAsJsonObject().get("registryName").getAsJsonObject(), ResourceLocation.class); + int meta = json.getAsJsonObject().get("meta").getAsInt(); + return new ItemStack(ForgeRegistries.ITEMS.getValue(registryName), 1); + } + + @Override + public JsonElement serialize(ItemStack src, Type typeOfSrc, JsonSerializationContext context) + { + JsonObject jsonObject = new JsonObject(); + jsonObject.add("registryName", context.serialize(src.getItem().getRegistryName())); + jsonObject.addProperty("meta", src.getDamage()); + return jsonObject; + } + }; + + public static final Gson GSON = new GsonBuilder().serializeNulls().setPrettyPrinting().disableHtmlEscaping().registerTypeAdapter(FACING_SERIALIZER.getType(), FACING_SERIALIZER).registerTypeAdapter(RESOURCELOCATION_SERIALIZER.getType(), RESOURCELOCATION_SERIALIZER).registerTypeAdapter(ITEMMETA_SERIALIZER.getType(), ITEMMETA_SERIALIZER).create(); + + static + { + DataSerializers.registerSerializer(WILL_TYPE_SERIALIZER); + } +} \ No newline at end of file diff --git a/src/main/java/wayoftime/bloodmagic/structures/Dungeon.java b/src/main/java/wayoftime/bloodmagic/structures/Dungeon.java new file mode 100644 index 00000000..add4a1ff --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/structures/Dungeon.java @@ -0,0 +1,196 @@ +package wayoftime.bloodmagic.structures; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +import org.apache.commons.lang3.tuple.Pair; + +import net.minecraft.util.Direction; +import net.minecraft.util.Mirror; +import net.minecraft.util.Rotation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.server.ServerWorld; +import wayoftime.bloodmagic.ritual.AreaDescriptor; +import wayoftime.bloodmagic.util.BMLog; + +public class Dungeon +{ + public static boolean placeStructureAtPosition(Random rand, ServerWorld world, BlockPos pos) + { + long startTime = System.nanoTime(); + + Map> availableDoorMap = new HashMap<>(); // Map of doors. The EnumFacing indicates + // what way this door faces. + List descriptorList = new ArrayList<>(); + Map> roomMap = new HashMap<>(); // Placement positions in terms + // of actual positions + + PlacementSettings settings = new PlacementSettings(); + Mirror mir = Mirror.NONE; + + settings.setMirror(mir); + + Rotation rot = Rotation.NONE; + + settings.setRotation(rot); + settings.setIgnoreEntities(true); + settings.setChunk(null); + +// settings.setReplacedBlock(null); + +// settings.setIgnoreStructureBlock(false); + settings.func_215223_c(true); + +// PlacementSettings placementsettings = (new PlacementSettings()).setMirror(this.mirror).setRotation(this.rotation).setIgnoreEntities(this.ignoreEntities).setChunk((ChunkPos)null); +// if (this.integrity < 1.0F) { +// placementsettings.clearProcessors().addProcessor(new IntegrityProcessor(MathHelper.clamp(this.integrity, 0.0F, 1.0F))).setRandom(func_214074_b(this.seed)); +// } +// +// BlockPos blockpos2 = blockpos.add(this.position); +// p_242689_3_.func_237144_a_(p_242689_1_, blockpos2, placementsettings, func_214074_b(this.seed)); + + DungeonRoom room = getRandomRoom(rand); + roomMap.put(pos, Pair.of(room, settings.copy())); + descriptorList.addAll(room.getAreaDescriptors(settings, pos)); + for (Direction facing : Direction.values()) + { + if (availableDoorMap.containsKey(facing)) + { + List doorList = availableDoorMap.get(facing); + doorList.addAll(room.getDoorOffsetsForFacing(settings, facing, pos)); + } else + { + List doorList = room.getDoorOffsetsForFacing(settings, facing, pos); + availableDoorMap.put(facing, doorList); + } + } + + // Initial AreaDescriptors and door positions are initialized. Time for fun! + for (int i = 0; i < 100; i++) + { + List facingList = new ArrayList<>(); + for (Entry> entry : availableDoorMap.entrySet()) + { + if (entry.getValue() != null && !entry.getValue().isEmpty()) + { + facingList.add(entry.getKey()); + } + } + + Collections.shuffle(facingList); // Shuffle the list so that it is random what is chosen + + Pair removedDoor1 = null; + Pair removedDoor2 = null; + BlockPos roomLocation = null; + + for (Direction doorFacing : facingList) + { + Direction oppositeDoorFacing = doorFacing.getOpposite(); + List availableDoorList = availableDoorMap.get(doorFacing); // May need to copy here + Collections.shuffle(availableDoorList); + + settings.setRotation(Rotation.values()[rand.nextInt(Rotation.values().length)]); // Same for the Mirror + DungeonRoom testingRoom = getRandomRoom(rand); + + List otherDoorList = testingRoom.getDoorOffsetsForFacing(settings, oppositeDoorFacing, BlockPos.ZERO); + if (otherDoorList != null && !otherDoorList.isEmpty()) + { + // See if one of these doors works. + Collections.shuffle(otherDoorList); + BlockPos testDoor = otherDoorList.get(0); + testDoor: for (BlockPos availableDoor : availableDoorList) + { + // TODO: Test if it fits, then add the doors to the list. + roomLocation = availableDoor.subtract(testDoor).add(doorFacing.getDirectionVec()); + + List descriptors = testingRoom.getAreaDescriptors(settings, roomLocation); + for (AreaDescriptor testDesc : descriptors) + { + for (AreaDescriptor currentDesc : descriptorList) + { + if (testDesc.intersects(currentDesc)) + { + break testDoor; + } + } + } + + roomMap.put(roomLocation, Pair.of(testingRoom, settings.copy())); + descriptorList.addAll(descriptors); + removedDoor1 = Pair.of(doorFacing, availableDoor); + removedDoor2 = Pair.of(oppositeDoorFacing, testDoor.add(roomLocation)); + + room = testingRoom; + + } + + break; + } + +// Collections.shuffle(otherDoorList); + } + + if (removedDoor1 != null) + { + for (Direction facing : Direction.values()) + { + if (availableDoorMap.containsKey(facing)) + { + List doorList = availableDoorMap.get(facing); + doorList.addAll(room.getDoorOffsetsForFacing(settings, facing, roomLocation)); + } else + { + List doorList = room.getDoorOffsetsForFacing(settings, facing, roomLocation); + availableDoorMap.put(facing, doorList); + } + } + + Direction face = removedDoor1.getKey(); + if (availableDoorMap.containsKey(face)) + { + availableDoorMap.get(face).remove(removedDoor1.getRight()); + } + } + + if (removedDoor2 != null) + { + Direction face = removedDoor2.getKey(); + if (availableDoorMap.containsKey(face)) + { + availableDoorMap.get(face).remove(removedDoor2.getRight()); + } + } + } + + long endTime = System.nanoTime(); + + long duration = (endTime - startTime); // divide by 1000000 to get milliseconds. + BMLog.DEBUG.info("Duration: " + duration + "(ns), " + duration / 1000000 + "(ms)"); + + // Building what I've got + for (Entry> entry : roomMap.entrySet()) + { + BlockPos placementPos = entry.getKey(); + DungeonRoom placedRoom = entry.getValue().getKey(); + PlacementSettings placementSettings = entry.getValue().getValue(); + + placedRoom.placeStructureAtPosition(rand, placementSettings, world, placementPos); + } + + System.out.println(roomMap.size()); + + return false; + } + + public static DungeonRoom getRandomRoom(Random rand) + { +// System.out.println("Dungeon size: " + DungeonRoomRegistry.dungeonWeightMap.size()); + return DungeonRoomRegistry.getRandomDungeonRoom(rand); + } +} diff --git a/src/main/java/wayoftime/bloodmagic/structures/DungeonRoom.java b/src/main/java/wayoftime/bloodmagic/structures/DungeonRoom.java new file mode 100644 index 00000000..9e2dc086 --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/structures/DungeonRoom.java @@ -0,0 +1,78 @@ +package wayoftime.bloodmagic.structures; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +import net.minecraft.util.Direction; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.server.ServerWorld; +import wayoftime.bloodmagic.ritual.AreaDescriptor; + +public class DungeonRoom +{ + public int dungeonWeight = 1; + public Map structureMap = new HashMap<>(); + + public Map> doorMap = new HashMap<>(); // Map of doors. The EnumFacing indicates what way + // this door faces. + public List descriptorList = new ArrayList<>(); + + public DungeonRoom(Map structureMap, Map> doorMap, List descriptorList) + { + this.structureMap = structureMap; + this.doorMap = doorMap; + this.descriptorList = descriptorList; + } + + public List getAreaDescriptors(PlacementSettings settings, BlockPos offset) + { + List newList = new ArrayList<>(); + + for (AreaDescriptor desc : descriptorList) + { + newList.add(desc.rotateDescriptor(settings).offset(offset)); + } + + return newList; + } + + public List getDoorOffsetsForFacing(PlacementSettings settings, Direction facing, BlockPos offset) + { + List offsetList = new ArrayList<>(); + +// Direction originalFacing = DungeonUtil.rotate(settings.getMirror(), settings.getRotation(), facing); + Direction originalFacing = DungeonUtil.reverseRotate(settings.getMirror(), settings.getRotation(), facing); +// Direction originalFacing = facing; + if (doorMap.containsKey(originalFacing)) + { + List doorList = doorMap.get(originalFacing); + for (BlockPos doorPos : doorList) + { + offsetList.add(Template.transformedBlockPos(settings, doorPos).add(offset)); + } + } + + return offsetList; + } + + public boolean placeStructureAtPosition(Random rand, PlacementSettings settings, ServerWorld world, BlockPos pos) + { + for (Entry entry : structureMap.entrySet()) + { + ResourceLocation location = new ResourceLocation(entry.getKey()); + DungeonStructure structure = new DungeonStructure(location); + BlockPos offsetPos = Template.transformedBlockPos(settings, entry.getValue()); + + structure.placeStructureAtPosition(rand, settings, world, pos.add(offsetPos)); + } + + return true; + } +} diff --git a/src/main/java/wayoftime/bloodmagic/structures/DungeonRoomLoader.java b/src/main/java/wayoftime/bloodmagic/structures/DungeonRoomLoader.java new file mode 100644 index 00000000..9eabeb69 --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/structures/DungeonRoomLoader.java @@ -0,0 +1,102 @@ +package wayoftime.bloodmagic.structures; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.Writer; +import java.net.URL; +import java.util.List; +import java.util.Random; + +import org.apache.commons.io.IOUtils; + +import com.google.common.base.Charsets; +import com.google.common.io.Resources; +import com.google.common.reflect.TypeToken; + +import net.minecraft.util.ResourceLocation; +import wayoftime.bloodmagic.BloodMagic; +import wayoftime.bloodmagic.gson.Serializers; + +public class DungeonRoomLoader +{ + public static void saveDungeons() + { + for (DungeonRoom room : DungeonRoomRegistry.dungeonWeightMap.keySet()) + { + saveSingleDungeon(room); + } + } + + public static void saveSingleDungeon(DungeonRoom room) + { + String json = Serializers.GSON.toJson(room); + + Writer writer; + try + { + File file = new File("config/BloodMagic/schematics"); + file.mkdirs(); + + writer = new FileWriter("config/BloodMagic/schematics/" + new Random().nextInt() + ".json"); + writer.write(json); + writer.close(); + } catch (IOException e) + { + e.printStackTrace(); + } + } + + public static void loadDungeons() + { + try + { +// System.out.println("LOADING DEMON DUNGEONS"); + + URL schematicURL = DungeonRoomLoader.class.getResource(resLocToResourcePath(new ResourceLocation("bloodmagic:schematics"))); + List schematics = Serializers.GSON.fromJson(Resources.toString(schematicURL, Charsets.UTF_8), new TypeToken>() + { + }.getType()); + for (String schematicKey : schematics) + { + ResourceLocation schematic = new ResourceLocation(schematicKey); + URL dungeonURL = DungeonRoomLoader.class.getResource(resLocToResourcePath(schematic)); + DungeonRoom dungeonRoom = Serializers.GSON.fromJson(Resources.toString(dungeonURL, Charsets.UTF_8), DungeonRoom.class); + DungeonRoomRegistry.registerDungeonRoom(dungeonRoom, Math.max(1, dungeonRoom.dungeonWeight)); + } + + System.out.println("# schematics: " + schematics.size()); + + } catch (Exception e) + { + e.printStackTrace(); + } + } + + public static void test() + { + ResourceLocation id = new ResourceLocation(BloodMagic.MODID, "testGson"); + String s = id.getNamespace(); + String s1 = id.getPath(); + InputStream inputstream = null; + + try + { + inputstream = DungeonRoomLoader.class.getResourceAsStream("/assets/" + s + "/schematics/" + s1 + ".nbt"); +// this.readTemplateFromStream(s1, inputstream); + return; + } catch (Throwable var10) + { + + } finally + { + IOUtils.closeQuietly(inputstream); + } + } + + public static String resLocToResourcePath(ResourceLocation resourceLocation) + { + return "/assets/" + resourceLocation.getNamespace() + "/schematics/" + resourceLocation.getPath() + ".json"; + } +} \ No newline at end of file diff --git a/src/main/java/wayoftime/bloodmagic/structures/DungeonRoomRegistry.java b/src/main/java/wayoftime/bloodmagic/structures/DungeonRoomRegistry.java new file mode 100644 index 00000000..4a8f46f2 --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/structures/DungeonRoomRegistry.java @@ -0,0 +1,33 @@ +package wayoftime.bloodmagic.structures; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +public class DungeonRoomRegistry +{ + public static Map dungeonWeightMap = new HashMap<>(); + private static int totalWeight = 0; + + public static void registerDungeonRoom(DungeonRoom room, int weight) + { + dungeonWeightMap.put(room, weight); + totalWeight += weight; + } + + public static DungeonRoom getRandomDungeonRoom(Random rand) + { + int wantedWeight = rand.nextInt(totalWeight); + for (Entry entry : dungeonWeightMap.entrySet()) + { + wantedWeight -= entry.getValue(); + if (wantedWeight < 0) + { + return entry.getKey(); + } + } + + return null; + } +} \ No newline at end of file diff --git a/src/main/java/wayoftime/bloodmagic/structures/DungeonStructure.java b/src/main/java/wayoftime/bloodmagic/structures/DungeonStructure.java new file mode 100644 index 00000000..d041243c --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/structures/DungeonStructure.java @@ -0,0 +1,56 @@ +package wayoftime.bloodmagic.structures; + +import java.util.Random; + +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.TemplateManager; +import net.minecraft.world.server.ServerWorld; +import wayoftime.bloodmagic.util.BMLog; + +public class DungeonStructure +{ + public ResourceLocation resource; + + public DungeonStructure(ResourceLocation resource) + { + this.resource = resource; + } + + public boolean placeStructureAtPosition(Random rand, PlacementSettings settings, ServerWorld world, BlockPos pos) + { + + if (pos == null) + return false; + + MinecraftServer minecraftserver = world.getServer(); + TemplateManager templatemanager = world.getStructureTemplateManager(); + + Template template = templatemanager.getTemplate(resource); + + if (template == null) + { + System.out.println("Invalid template for location: " + resource); + BMLog.DEBUG.warn("Invalid template for location: " + resource); + return false; + } + +// settings.func_189946_a(MathHelper.clamp_float(schema.integrity, 0.0F, 1.0F)); + + BlockPos offset = Template.transformedBlockPos(settings, new BlockPos(0, 0, 0)); + BlockPos finalPos = pos.add(offset); +// template.addBlocksToWorldChunk(world, finalPos, settings); + template.func_237144_a_(world, finalPos, settings, rand); +// template.func_237152_b_(world, finalPos, settings, rand); + + return true; + } + + public DungeonStructure copy() + { + return new DungeonStructure(resource); + } +} diff --git a/src/main/java/wayoftime/bloodmagic/structures/DungeonTester.java b/src/main/java/wayoftime/bloodmagic/structures/DungeonTester.java new file mode 100644 index 00000000..1a452c3a --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/structures/DungeonTester.java @@ -0,0 +1,106 @@ +package wayoftime.bloodmagic.structures; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import net.minecraft.block.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.util.Mirror; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Rotation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.server.ServerWorld; +import wayoftime.bloodmagic.BloodMagic; + +public class DungeonTester +{ + public static void testDungeonGeneration(ServerWorld world, BlockPos pos) + { + + } + + public static void testDungeonElementWithOutput(ServerWorld world, BlockPos pos) + { +// Dungeon.placeStructureAtPosition(new Random(), world, pos); + ResourceLocation resource = new ResourceLocation(BloodMagic.MODID, "t_corridor"); + +// DungeonStructure structure = new DungeonStructure(resource); +// Map structureMap = new HashMap(); +// structureMap.put(structure, new BlockPos(0, 0, 0)); + + Map structureMap = new HashMap(); + structureMap.put(resource.toString(), BlockPos.ZERO); + +// Map> doorMap = new HashMap>(); +// List descriptorList = new ArrayList(); +// descriptorList.add(new AreaDescriptor.Rectangle(new BlockPos(0, 0, 0), 11, 5, 8)); +// +// DungeonUtil.addRoom(doorMap, Direction.NORTH, new BlockPos(5, 0, 0)); +// DungeonUtil.addRoom(doorMap, Direction.EAST, new BlockPos(10, 0, 5)); +// DungeonUtil.addRoom(doorMap, Direction.WEST, new BlockPos(0, 0, 5)); +// +// DungeonRoom room = new DungeonRoom(structureMap, doorMap, descriptorList); + + DungeonRoom room = Dungeon.getRandomRoom(new Random()); + + PlacementSettings settings = new PlacementSettings(); + + Mirror mir = Mirror.NONE; + settings.setMirror(mir); + + net.minecraft.util.Rotation rot = Rotation.NONE; + settings.setRotation(rot); + + settings.setIgnoreEntities(true); + settings.setChunk((ChunkPos) null); + settings.func_215223_c(true); +// settings.setReplacedBlock((Block) null); +// settings.setIgnoreStructureBlock(false); + + int i = 0; + + for (Mirror mirror : Mirror.values()) + { + System.out.print("Mirror: " + mirror + '\n'); + int j = 0; + for (Rotation rotation : Rotation.values()) + { + System.out.print("Rotation: " + rotation + '\n'); + settings.setRotation(rotation); + settings.setMirror(mirror); + + BlockPos offsetPos = pos.add(i * 32, 0, j * 32); + room.placeStructureAtPosition(new Random(), settings, world, offsetPos); + + world.setBlockState(offsetPos, Blocks.REDSTONE_BLOCK.getDefaultState(), 3); + +// List descriptors = room.getAreaDescriptors(settings, offsetPos); +// for (AreaDescriptor desc : descriptors) +// { +// List posList = desc.getContainedPositions(new BlockPos(0, 0, 0)); +// for (BlockPos placePos : posList) +// { +// world.setBlockState(placePos, Blocks.REDSTONE_BLOCK.getDefaultState()); +// } +// } + +// for (Direction facing : Direction.HORIZONTALS) + for (int k = 0; k < 4; k++) + { + Direction facing = Direction.byHorizontalIndex(k); + List doorList = room.getDoorOffsetsForFacing(settings, facing, offsetPos); + for (BlockPos doorPos : doorList) + { + System.out.print("Door at " + doorPos + " facing " + facing + '\n'); + } + } + j++; + } + i++; + } + } +} diff --git a/src/main/java/wayoftime/bloodmagic/structures/DungeonUtil.java b/src/main/java/wayoftime/bloodmagic/structures/DungeonUtil.java new file mode 100644 index 00000000..e302e03d --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/structures/DungeonUtil.java @@ -0,0 +1,55 @@ +package wayoftime.bloodmagic.structures; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import net.minecraft.util.Direction; +import net.minecraft.util.Mirror; +import net.minecraft.util.Rotation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.gen.feature.template.PlacementSettings; + +public class DungeonUtil +{ + public static Direction rotate(Mirror mirror, Rotation rotation, Direction original) + { + return rotation.rotate(mirror.mirror(original)); + } + + public static Direction reverseRotate(Mirror mirror, Rotation rotation, Direction original) + { + return mirror.mirror(getOppositeRotation(rotation).rotate(original)); + } + + public static Direction getFacingForSettings(PlacementSettings settings, Direction original) + { + return rotate(settings.getMirror(), settings.getRotation(), original); + } + + public static Rotation getOppositeRotation(Rotation rotation) + { + switch (rotation) + { + case CLOCKWISE_90: + return Rotation.COUNTERCLOCKWISE_90; + case COUNTERCLOCKWISE_90: + return Rotation.CLOCKWISE_90; + default: + return rotation; + } + } + + public static void addRoom(Map> doorMap, Direction facing, BlockPos offsetPos) + { + if (doorMap.containsKey(facing)) + { + doorMap.get(facing).add(offsetPos); + } else + { + List doorList = new ArrayList<>(); + doorList.add(offsetPos); + doorMap.put(facing, doorList); + } + } +} diff --git a/src/main/java/wayoftime/bloodmagic/structures/ItemDungeonTester.java b/src/main/java/wayoftime/bloodmagic/structures/ItemDungeonTester.java new file mode 100644 index 00000000..d5527888 --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/structures/ItemDungeonTester.java @@ -0,0 +1,29 @@ +package wayoftime.bloodmagic.structures; + +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.world.World; +import net.minecraft.world.server.ServerWorld; +import wayoftime.bloodmagic.BloodMagic; + +public class ItemDungeonTester extends Item +{ + public ItemDungeonTester() + { + super(new Item.Properties().maxStackSize(1).group(BloodMagic.TAB)); + } + + @Override + public ActionResult onItemRightClick(World world, PlayerEntity player, Hand hand) + { + if (!world.isRemote && world instanceof ServerWorld) + { + System.out.println("Test"); + DungeonTester.testDungeonElementWithOutput((ServerWorld) world, player.getPosition()); + } + return super.onItemRightClick(world, player, hand); + } +} diff --git a/src/main/java/wayoftime/bloodmagic/structures/ModDungeons.java b/src/main/java/wayoftime/bloodmagic/structures/ModDungeons.java new file mode 100644 index 00000000..6c066b6e --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/structures/ModDungeons.java @@ -0,0 +1,28 @@ +package wayoftime.bloodmagic.structures; + +public class ModDungeons +{ + public static void init() + { +// ResourceLocation resource = new ResourceLocation(Constants.Mod.MODID, "HallChest1"); +// +// Map structureMap = new HashMap(); +// structureMap.put(resource.toString(), new BlockPos(0, 0, 0)); +// +// Map> doorMap = new HashMap>(); +// List descriptorList = new ArrayList(); +// descriptorList.add(new AreaDescriptor.Rectangle(new BlockPos(0, 0, 0), 12, 5, 9)); +// +// DungeonUtil.addRoom(doorMap, EnumFacing.EAST, new BlockPos(11, 0, 4)); +// DungeonUtil.addRoom(doorMap, EnumFacing.WEST, new BlockPos(0, 0, 4)); +// +// DungeonRoom room = new DungeonRoom(structureMap, doorMap, descriptorList); +// DungeonRoomLoader.saveSingleDungeon(room); +// +// DungeonRoomRegistry.registerDungeonRoom(room, 1); +// +// DungeonRoomLoader.saveDungeons(); + + DungeonRoomLoader.loadDungeons(); + } +} diff --git a/src/main/resources/assets/bloodmagic/schematics/four_way_corridor.json b/src/main/resources/assets/bloodmagic/schematics/four_way_corridor.json new file mode 100644 index 00000000..620a3d0f --- /dev/null +++ b/src/main/resources/assets/bloodmagic/schematics/four_way_corridor.json @@ -0,0 +1,56 @@ +{ + "dungeonWeight": 4, + "structureMap": { + "bloodmagic:four_way_corridor": { + "x": 0, + "y": 0, + "z": 0 + } + }, + "doorMap": { + "north": [ + { + "x": 5, + "y": 0, + "z": 0 + } + ], + "south": [ + { + "x": 5, + "y": 0, + "z": 10 + } + ], + "west": [ + { + "x": 0, + "y": 0, + "z": 5 + } + ], + "east": [ + { + "x": 10, + "y": 0, + "z": 5 + } + ] + }, + "descriptorList": [ + { + "minimumOffset": { + "x": 0, + "y": 0, + "z": 0 + }, + "maximumOffset": { + "x": 11, + "y": 6, + "z": 11 + }, + "blockPosCache": [], + "cache": true + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/schematics/four_way_corridor_loot.json b/src/main/resources/assets/bloodmagic/schematics/four_way_corridor_loot.json new file mode 100644 index 00000000..6ceff35d --- /dev/null +++ b/src/main/resources/assets/bloodmagic/schematics/four_way_corridor_loot.json @@ -0,0 +1,56 @@ +{ + "dungeonWeight": 1, + "structureMap": { + "bloodmagic:four_way_corridor_loot": { + "x": 0, + "y": 0, + "z": 0 + } + }, + "doorMap": { + "north": [ + { + "x": 5, + "y": 5, + "z": 0 + } + ], + "south": [ + { + "x": 5, + "y": 5, + "z": 10 + } + ], + "west": [ + { + "x": 0, + "y": 5, + "z": 5 + } + ], + "east": [ + { + "x": 10, + "y": 5, + "z": 5 + } + ] + }, + "descriptorList": [ + { + "minimumOffset": { + "x": 0, + "y": 0, + "z": 0 + }, + "maximumOffset": { + "x": 11, + "y": 11, + "z": 11 + }, + "blockPosCache": [], + "cache": true + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/schematics/ore_hold_1.json b/src/main/resources/assets/bloodmagic/schematics/ore_hold_1.json new file mode 100644 index 00000000..42d9f1a6 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/schematics/ore_hold_1.json @@ -0,0 +1,69 @@ +{ + "dungeonWeight": 8, + "structureMap": { + "bloodmagic:ore_hold_1": { + "x": 0, + "y": 0, + "z": 0 + } + }, + "doorMap": { + "north": [ + { + "x": 5, + "y": 0, + "z": 0 + }, + { + "x": 2, + "y": 5, + "z": 0 + }, + { + "x": 12, + "y": 5, + "z": 0 + } + ], + "south": [ + { + "x": 5, + "y": 0, + "z": 14 + }, + { + "x": 2, + "y": 5, + "z": 14 + }, + { + "x": 12, + "y": 5, + "z": 14 + } + ], + "west": [ + { + "x": 0, + "y": 5, + "z": 7 + } + ] + }, + "descriptorList": [ + { + "minimumOffset": { + "x": 0, + "y": 0, + "z": 0 + }, + "maximumOffset": { + "x": 15, + "y": 12, + "z": 15 + }, + "blockPosCache": [], + "cache": true + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/schematics/schematics.json b/src/main/resources/assets/bloodmagic/schematics/schematics.json new file mode 100644 index 00000000..309877d8 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/schematics/schematics.json @@ -0,0 +1,3 @@ +[ + "bloodmagic:t_corridor" +] \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/schematics/straight_corridor.json b/src/main/resources/assets/bloodmagic/schematics/straight_corridor.json new file mode 100644 index 00000000..7bfc97e8 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/schematics/straight_corridor.json @@ -0,0 +1,42 @@ +{ + "dungeonWeight": 4, + "structureMap": { + "bloodmagic:straight_corridor": { + "x": 0, + "y": 0, + "z": 0 + } + }, + "doorMap": { + "west": [ + { + "x": 0, + "y": 0, + "z": 2 + } + ], + "east": [ + { + "x": 10, + "y": 0, + "z": 2 + } + ] + }, + "descriptorList": [ + { + "minimumOffset": { + "x": 0, + "y": 0, + "z": 0 + }, + "maximumOffset": { + "x": 11, + "y": 5, + "z": 5 + }, + "blockPosCache": [], + "cache": true + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/schematics/t_corridor.json b/src/main/resources/assets/bloodmagic/schematics/t_corridor.json new file mode 100644 index 00000000..4fc3ec4a --- /dev/null +++ b/src/main/resources/assets/bloodmagic/schematics/t_corridor.json @@ -0,0 +1,49 @@ +{ + "dungeonWeight": 12, + "structureMap": { + "bloodmagic:t_corridor": { + "x": 0, + "y": 0, + "z": 0 + } + }, + "doorMap": { + "north": [ + { + "x": 5, + "y": 0, + "z": 0 + } + ], + "west": [ + { + "x": 0, + "y": 0, + "z": 5 + } + ], + "east": [ + { + "x": 10, + "y": 0, + "z": 5 + } + ] + }, + "descriptorList": [ + { + "minimumOffset": { + "x": 0, + "y": 0, + "z": 0 + }, + "maximumOffset": { + "x": 11, + "y": 5, + "z": 8 + }, + "blockPosCache": [], + "cache": true + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/textures/block/dungeon/dungeon_ore.png b/src/main/resources/assets/bloodmagic/textures/block/dungeon/dungeon_ore.png new file mode 100644 index 00000000..3771f3a2 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/block/dungeon/dungeon_ore.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/item/dungeon_tester.png b/src/main/resources/assets/bloodmagic/textures/item/dungeon_tester.png new file mode 100644 index 00000000..8a46b4d1 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/item/dungeon_tester.png differ diff --git a/src/main/resources/data/bloodmagic/structures/four_way_corridor.nbt b/src/main/resources/data/bloodmagic/structures/four_way_corridor.nbt new file mode 100644 index 00000000..e8a47680 Binary files /dev/null and b/src/main/resources/data/bloodmagic/structures/four_way_corridor.nbt differ diff --git a/src/main/resources/data/bloodmagic/structures/four_way_corridor_loot.nbt b/src/main/resources/data/bloodmagic/structures/four_way_corridor_loot.nbt new file mode 100644 index 00000000..2fdf1a41 Binary files /dev/null and b/src/main/resources/data/bloodmagic/structures/four_way_corridor_loot.nbt differ diff --git a/src/main/resources/data/bloodmagic/structures/ore_hold_1.nbt b/src/main/resources/data/bloodmagic/structures/ore_hold_1.nbt new file mode 100644 index 00000000..6ecc7b1e Binary files /dev/null and b/src/main/resources/data/bloodmagic/structures/ore_hold_1.nbt differ diff --git a/src/main/resources/data/bloodmagic/structures/straight_corridor.nbt b/src/main/resources/data/bloodmagic/structures/straight_corridor.nbt new file mode 100644 index 00000000..0f244757 Binary files /dev/null and b/src/main/resources/data/bloodmagic/structures/straight_corridor.nbt differ diff --git a/src/main/resources/data/bloodmagic/structures/t_corridor.nbt b/src/main/resources/data/bloodmagic/structures/t_corridor.nbt new file mode 100644 index 00000000..a9caf7e5 Binary files /dev/null and b/src/main/resources/data/bloodmagic/structures/t_corridor.nbt differ