From baa789b77aa9b1c1378f91ade2dcded864d0ea30 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 29 Aug 2021 19:22:59 +0700 Subject: [PATCH] More building blocks --- shapenator.js | 36 ++++++++++++++ .../java/ru/dbotthepony/mc/otm/Registry.java | 49 +++++++++++++++++++ .../tags/blocks/mineable/pickaxe.json | 7 ++- .../loot_tables/blocks/matter_cable.json | 15 ------ 4 files changed, 91 insertions(+), 16 deletions(-) delete mode 100644 src/main/resources/data/overdrive_that_matters/loot_tables/blocks/matter_cable.json diff --git a/shapenator.js b/shapenator.js index 65144fead..e4d4aea81 100644 --- a/shapenator.js +++ b/shapenator.js @@ -151,6 +151,42 @@ const facings = [ } } +// просто дропы блоков +{ + const blocks = [ + 'matter_cable', + 'tritanium_block', + 'tritanium_striped_block', + 'carbon_fibre_block', + + 'crate_red', + 'crate_blue', + 'crate_yellow', + 'crate_green', + 'crate_black', + 'crate_pink', + 'crate_purple', + ] + + for (const name of blocks) { + fs.writeFileSync(root_data + 'loot_tables/blocks/' + name + '.json', JSON.stringify({ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "bonus_rolls": 0, + "entries": [ + { + "type": "minecraft:item", + "name": "overdrive_that_matters:" + name + } + ] + } + ] + }, null, '\t')) + } +} + // дропы с машин { const drops = { diff --git a/src/main/java/ru/dbotthepony/mc/otm/Registry.java b/src/main/java/ru/dbotthepony/mc/otm/Registry.java index bb357759e..9b54e1bbb 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/Registry.java +++ b/src/main/java/ru/dbotthepony/mc/otm/Registry.java @@ -109,6 +109,12 @@ public class Registry { public static final ResourceLocation MATTER_BOTTLER = new ResourceLocation(OverdriveThatMatters.MOD_ID, "matter_bottler"); public static final ResourceLocation DRIVE_VIEWER = new ResourceLocation(OverdriveThatMatters.MOD_ID, "drive_viewer"); + // building blocks + public static final ResourceLocation TRITANIUM_BLOCK = new ResourceLocation(OverdriveThatMatters.MOD_ID, "tritanium_block"); + public static final ResourceLocation TRITANIUM_STRIPED_BLOCK = new ResourceLocation(OverdriveThatMatters.MOD_ID, "tritanium_striped_block"); + + public static final ResourceLocation CARBON_FIBRE_BLOCK = new ResourceLocation(OverdriveThatMatters.MOD_ID, "carbon_fibre_block"); + // capabilities public static final ResourceLocation ANDROID_CAPABILITY = new ResourceLocation(OverdriveThatMatters.MOD_ID, "android_capability"); @@ -200,6 +206,30 @@ public class Registry { public static final Block[] CRATES = new Block[Registry.CRATES.length]; + public static final Block TRITANIUM_BLOCK = new Block( + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) + .sound(SoundType.BASALT) + .requiresCorrectToolForDrops() + .explosionResistance(80) + .strength(4) + ); + + public static final Block TRITANIUM_STRIPED_BLOCK = new Block( + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) + .sound(SoundType.BASALT) + .requiresCorrectToolForDrops() + .explosionResistance(80) + .strength(4) + ); + + public static final Block CARBON_FIBRE_BLOCK = new Block( + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) + .sound(SoundType.BASALT) + .requiresCorrectToolForDrops() + .explosionResistance(40) + .strength(3) + ); + static { for (int i = 0; i < Registry.CRATES.length; i++) { CRATES[i] = new Block(BlockBehaviour.Properties.of(Material.METAL, Registry.CRATES[i].color) @@ -221,6 +251,10 @@ public class Registry { MATTER_REPLICATOR.setRegistryName(Names.MATTER_REPLICATOR); MATTER_BOTTLER.setRegistryName(Names.MATTER_BOTTLER); DRIVE_VIEWER.setRegistryName(Names.DRIVE_VIEWER); + + TRITANIUM_BLOCK.setRegistryName(Names.TRITANIUM_BLOCK); + TRITANIUM_STRIPED_BLOCK.setRegistryName(Names.TRITANIUM_STRIPED_BLOCK); + CARBON_FIBRE_BLOCK.setRegistryName(Names.CARBON_FIBRE_BLOCK); } @SubscribeEvent @@ -236,6 +270,9 @@ public class Registry { event.getRegistry().register(MATTER_REPLICATOR); event.getRegistry().register(MATTER_BOTTLER); event.getRegistry().register(DRIVE_VIEWER); + event.getRegistry().register(TRITANIUM_BLOCK); + event.getRegistry().register(TRITANIUM_STRIPED_BLOCK); + event.getRegistry().register(CARBON_FIBRE_BLOCK); for (var crate : CRATES) { event.getRegistry().register(crate); @@ -281,6 +318,10 @@ public class Registry { public static final Item[] CRATES = new Item[Registry.CRATES.length]; + public static final Item TRITANIUM_BLOCK = new BlockItem(Blocks.TRITANIUM_BLOCK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); + public static final Item TRITANIUM_STRIPED_BLOCK = new BlockItem(Blocks.TRITANIUM_STRIPED_BLOCK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); + public static final Item CARBON_FIBRE_BLOCK = new BlockItem(Blocks.CARBON_FIBRE_BLOCK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); + static { for (int i = 0; i < Registry.CRATES.length; i++) { CRATES[i] = new BlockItem(Blocks.CRATES[i], new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); @@ -317,6 +358,10 @@ public class Registry { PORTABLE_DENSE_CONDENSATION_DRIVE.setRegistryName(Names.PORTABLE_DENSE_CONDENSATION_DRIVE); NUTRIENT_PASTE.setRegistryName(Names.NUTRIENT_PASTE); + + TRITANIUM_BLOCK.setRegistryName(Names.TRITANIUM_BLOCK); + TRITANIUM_STRIPED_BLOCK.setRegistryName(Names.TRITANIUM_STRIPED_BLOCK); + CARBON_FIBRE_BLOCK.setRegistryName(Names.CARBON_FIBRE_BLOCK); } @SubscribeEvent @@ -352,6 +397,10 @@ public class Registry { event.getRegistry().register(NUTRIENT_PASTE); + event.getRegistry().register(TRITANIUM_BLOCK); + event.getRegistry().register(TRITANIUM_STRIPED_BLOCK); + event.getRegistry().register(CARBON_FIBRE_BLOCK); + for (var crate : CRATES) { event.getRegistry().register(crate); } diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index 042523ee3..ee9b1390b 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -9,6 +9,11 @@ "overdrive_that_matters:pattern_storage", "overdrive_that_matters:matter_scanner", "overdrive_that_matters:matter_panel", - "overdrive_that_matters:matter_replicator" + "overdrive_that_matters:matter_replicator", + "overdrive_that_matters:matter_bottler", + "overdrive_that_matters:drive_viewer", + "overdrive_that_matters:tritanium_block", + "overdrive_that_matters:tritanium_striped_block", + "overdrive_that_matters:carbon_fibre_block" ] } \ No newline at end of file diff --git a/src/main/resources/data/overdrive_that_matters/loot_tables/blocks/matter_cable.json b/src/main/resources/data/overdrive_that_matters/loot_tables/blocks/matter_cable.json deleted file mode 100644 index 6be3111ea..000000000 --- a/src/main/resources/data/overdrive_that_matters/loot_tables/blocks/matter_cable.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0, - "entries": [ - { - "type": "minecraft:item", - "name": "overdrive_that_matters:matter_cable" - } - ] - } - ] -} \ No newline at end of file