From 30a026ab0c7160d32a87394e479100d5b60629be Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Tue, 25 Jan 2022 18:58:37 +0100 Subject: [PATCH] Patch D - Safety check for schematicannon entities - Some tagging --- src/generated/resources/.cache/cache | 12 ++++++++++-- .../forge/tags/blocks/ores_in_ground/deepslate.json | 6 ++++++ .../forge/tags/blocks/ores_in_ground/stone.json | 6 ++++++ .../data/forge/tags/blocks/storage_blocks.json | 1 + .../forge/tags/blocks/storage_blocks/raw_zinc.json | 6 ++++++ .../forge/tags/items/ores_in_ground/deepslate.json | 6 ++++++ .../data/forge/tags/items/ores_in_ground/stone.json | 6 ++++++ .../data/forge/tags/items/raw_materials.json | 6 ++++++ .../data/forge/tags/items/raw_materials/zinc.json | 6 ++++++ .../data/forge/tags/items/storage_blocks.json | 1 + .../forge/tags/items/storage_blocks/raw_zinc.json | 6 ++++++ src/main/java/com/simibubi/create/AllBlocks.java | 9 ++++++--- src/main/java/com/simibubi/create/AllItems.java | 3 ++- src/main/java/com/simibubi/create/AllTags.java | 13 +++++++++---- src/main/java/com/simibubi/create/Create.java | 2 +- .../content/schematics/block/LaunchedItem.java | 3 ++- 16 files changed, 80 insertions(+), 12 deletions(-) create mode 100644 src/generated/resources/data/forge/tags/blocks/ores_in_ground/deepslate.json create mode 100644 src/generated/resources/data/forge/tags/blocks/ores_in_ground/stone.json create mode 100644 src/generated/resources/data/forge/tags/blocks/storage_blocks/raw_zinc.json create mode 100644 src/generated/resources/data/forge/tags/items/ores_in_ground/deepslate.json create mode 100644 src/generated/resources/data/forge/tags/items/ores_in_ground/stone.json create mode 100644 src/generated/resources/data/forge/tags/items/raw_materials.json create mode 100644 src/generated/resources/data/forge/tags/items/raw_materials/zinc.json create mode 100644 src/generated/resources/data/forge/tags/items/storage_blocks/raw_zinc.json diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index d9b6c2d9e..a1855cc4f 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -5219,8 +5219,11 @@ d063e12c9ef75f39518c6d129ea35d833464d547 data/create/tags/items/toolboxes.json 81d3eb40b048160fcc2d6bb7ff12b49276297efd data/forge/tags/blocks/glass_panes.json 6eec92869baa44d3ac53aec6a7a92c15147b59f0 data/forge/tags/blocks/ores.json 6eec92869baa44d3ac53aec6a7a92c15147b59f0 data/forge/tags/blocks/ores/zinc.json -9f7a428085b1aac66da32a43e9d51c7efc1f0d81 data/forge/tags/blocks/storage_blocks.json +9fc688d8fac1033c7b8f4b8de1138e56d2faf527 data/forge/tags/blocks/ores_in_ground/deepslate.json +d5ea262a0f5fb210612d22521818e26cf08e591a data/forge/tags/blocks/ores_in_ground/stone.json +66065a698fca917446a0fb766593dbcc77fabeac data/forge/tags/blocks/storage_blocks.json ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/blocks/storage_blocks/brass.json +823d05187626797205381d4620a84abda3bc8f89 data/forge/tags/blocks/storage_blocks/raw_zinc.json 7f71a774800111e50b42de0e6159ed2d2a807d32 data/forge/tags/blocks/storage_blocks/zinc.json 6b73c57912934d09233ad2966110968a6109f2c9 data/forge/tags/fluids/chocolate.json 391c9b2be5740aea943a8a5fe27eb327e2d973b0 data/forge/tags/fluids/honey.json @@ -5238,13 +5241,18 @@ cc82188fe8d986f4457301ed4f75ae833d263601 data/forge/tags/items/nuggets/brass.jso 0d8cb5092ee6ec01ea09324c80d649ba05549799 data/forge/tags/items/nuggets/zinc.json 6eec92869baa44d3ac53aec6a7a92c15147b59f0 data/forge/tags/items/ores.json 6eec92869baa44d3ac53aec6a7a92c15147b59f0 data/forge/tags/items/ores/zinc.json +9fc688d8fac1033c7b8f4b8de1138e56d2faf527 data/forge/tags/items/ores_in_ground/deepslate.json +d5ea262a0f5fb210612d22521818e26cf08e591a data/forge/tags/items/ores_in_ground/stone.json 5d5ec04a61ff2b1ad19210e2859a9c96cc246ef8 data/forge/tags/items/plates.json 39f0d70ec10597e85df7c4783bbc5e0e4a5ffb80 data/forge/tags/items/plates/brass.json c3dab5fe379bc1b7b10d4a0ba7009eee1b75a27c data/forge/tags/items/plates/copper.json fb9bfb4c84ed9cf2da8c4b2fbc4cd4d9f37d3016 data/forge/tags/items/plates/gold.json 04d947ed7a5066f3cfe75a8dc564fe2dca8a9c93 data/forge/tags/items/plates/iron.json -9f7a428085b1aac66da32a43e9d51c7efc1f0d81 data/forge/tags/items/storage_blocks.json +dc96331cded39b2d2f24853f4dd6c1f6f3863115 data/forge/tags/items/raw_materials.json +dc96331cded39b2d2f24853f4dd6c1f6f3863115 data/forge/tags/items/raw_materials/zinc.json +66065a698fca917446a0fb766593dbcc77fabeac data/forge/tags/items/storage_blocks.json ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/items/storage_blocks/brass.json +823d05187626797205381d4620a84abda3bc8f89 data/forge/tags/items/storage_blocks/raw_zinc.json 7f71a774800111e50b42de0e6159ed2d2a807d32 data/forge/tags/items/storage_blocks/zinc.json 2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/azalea_root_replaceable.json 9f7a428085b1aac66da32a43e9d51c7efc1f0d81 data/minecraft/tags/blocks/beacon_base_blocks.json diff --git a/src/generated/resources/data/forge/tags/blocks/ores_in_ground/deepslate.json b/src/generated/resources/data/forge/tags/blocks/ores_in_ground/deepslate.json new file mode 100644 index 000000000..dff61786a --- /dev/null +++ b/src/generated/resources/data/forge/tags/blocks/ores_in_ground/deepslate.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:deepslate_zinc_ore" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/blocks/ores_in_ground/stone.json b/src/generated/resources/data/forge/tags/blocks/ores_in_ground/stone.json new file mode 100644 index 000000000..9389dcb95 --- /dev/null +++ b/src/generated/resources/data/forge/tags/blocks/ores_in_ground/stone.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:zinc_ore" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/blocks/storage_blocks.json b/src/generated/resources/data/forge/tags/blocks/storage_blocks.json index a1b3ce3d3..914bc595f 100644 --- a/src/generated/resources/data/forge/tags/blocks/storage_blocks.json +++ b/src/generated/resources/data/forge/tags/blocks/storage_blocks.json @@ -1,6 +1,7 @@ { "replace": false, "values": [ + "create:raw_zinc_block", "create:zinc_block", "create:brass_block" ] diff --git a/src/generated/resources/data/forge/tags/blocks/storage_blocks/raw_zinc.json b/src/generated/resources/data/forge/tags/blocks/storage_blocks/raw_zinc.json new file mode 100644 index 000000000..a699dcb5e --- /dev/null +++ b/src/generated/resources/data/forge/tags/blocks/storage_blocks/raw_zinc.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:raw_zinc_block" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/items/ores_in_ground/deepslate.json b/src/generated/resources/data/forge/tags/items/ores_in_ground/deepslate.json new file mode 100644 index 000000000..dff61786a --- /dev/null +++ b/src/generated/resources/data/forge/tags/items/ores_in_ground/deepslate.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:deepslate_zinc_ore" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/items/ores_in_ground/stone.json b/src/generated/resources/data/forge/tags/items/ores_in_ground/stone.json new file mode 100644 index 000000000..9389dcb95 --- /dev/null +++ b/src/generated/resources/data/forge/tags/items/ores_in_ground/stone.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:zinc_ore" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/items/raw_materials.json b/src/generated/resources/data/forge/tags/items/raw_materials.json new file mode 100644 index 000000000..24c13e1ce --- /dev/null +++ b/src/generated/resources/data/forge/tags/items/raw_materials.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:raw_zinc" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/items/raw_materials/zinc.json b/src/generated/resources/data/forge/tags/items/raw_materials/zinc.json new file mode 100644 index 000000000..24c13e1ce --- /dev/null +++ b/src/generated/resources/data/forge/tags/items/raw_materials/zinc.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:raw_zinc" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/items/storage_blocks.json b/src/generated/resources/data/forge/tags/items/storage_blocks.json index a1b3ce3d3..914bc595f 100644 --- a/src/generated/resources/data/forge/tags/items/storage_blocks.json +++ b/src/generated/resources/data/forge/tags/items/storage_blocks.json @@ -1,6 +1,7 @@ { "replace": false, "values": [ + "create:raw_zinc_block", "create:zinc_block", "create:brass_block" ] diff --git a/src/generated/resources/data/forge/tags/items/storage_blocks/raw_zinc.json b/src/generated/resources/data/forge/tags/items/storage_blocks/raw_zinc.json new file mode 100644 index 000000000..a699dcb5e --- /dev/null +++ b/src/generated/resources/data/forge/tags/items/storage_blocks/raw_zinc.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:raw_zinc_block" + ] +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 4f037a837..60f0bb6fc 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -1525,7 +1525,7 @@ public class AllBlocks { .apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)))))) .tag(BlockTags.NEEDS_IRON_TOOL) .tag(Tags.Blocks.ORES) - .transform(tagBlockAndItem("ores/zinc")) + .transform(tagBlockAndItem("ores/zinc", "ores_in_ground/stone")) .tag(Tags.Items.ORES) .build() .register(); @@ -1541,7 +1541,7 @@ public class AllBlocks { .apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE)))))) .tag(BlockTags.NEEDS_IRON_TOOL) .tag(Tags.Blocks.ORES) - .transform(tagBlockAndItem("ores/zinc")) + .transform(tagBlockAndItem("ores/zinc", "ores_in_ground/deepslate")) .tag(Tags.Items.ORES) .build() .register(); @@ -1550,9 +1550,12 @@ public class AllBlocks { .initialProperties(() -> Blocks.RAW_GOLD_BLOCK) .properties(p -> p.requiresCorrectToolForDrops()) .transform(pickaxeOnly()) + .tag(Tags.Blocks.STORAGE_BLOCKS) .tag(BlockTags.NEEDS_IRON_TOOL) .lang("Block of Raw Zinc") - .simpleItem() + .transform(tagBlockAndItem("storage_blocks/raw_zinc")) + .tag(Tags.Items.STORAGE_BLOCKS) + .build() .register(); public static final BlockEntry ZINC_BLOCK = REGISTRATE.block("zinc_block", p -> new Block(p)) diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index 3b2bc2c57..255cb1a9a 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -142,7 +142,8 @@ public class AllItems { .lang("Builder's Tea") .register(); - public static final ItemEntry RAW_ZINC = ingredient("raw_zinc"); + public static final ItemEntry RAW_ZINC = + taggedIngredient("raw_zinc", forgeItemTag("raw_materials/zinc"), forgeItemTag("raw_materials")); public static final ItemEntry ANDESITE_ALLOY = ingredient("andesite_alloy"), ZINC_INGOT = taggedIngredient("zinc_ingot", forgeItemTag("ingots/zinc"), CREATE_INGOTS.tag), diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index 3b3175e93..c7922a7f9 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -68,10 +68,15 @@ public class AllTags { } public static NonNullFunction, ItemBuilder>> tagBlockAndItem( - String path) { - return b -> b.tag(forgeBlockTag(path)) - .item() - .tag(forgeItemTag(path)); + String... path) { + return b -> { + for (String p : path) + b.tag(forgeBlockTag(p)); + ItemBuilder> item = b.item(); + for (String p : path) + item.tag(forgeItemTag(p)); + return item; + }; } public enum NameSpace { diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index d852fac67..5aa61c54c 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -57,7 +57,7 @@ public class Create { public static final String ID = "create"; public static final String NAME = "Create"; - public static final String VERSION = "0.4c"; + public static final String VERSION = "0.4d"; public static final Logger LOGGER = LogManager.getLogger(); diff --git a/src/main/java/com/simibubi/create/content/schematics/block/LaunchedItem.java b/src/main/java/com/simibubi/create/content/schematics/block/LaunchedItem.java index 482b93360..99f97cf6f 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/LaunchedItem.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/LaunchedItem.java @@ -204,7 +204,8 @@ public abstract class LaunchedItem { @Override void place(Level world) { - world.addFreshEntity(entity); + if (entity != null) + world.addFreshEntity(entity); } }