From f623f4b346787f7738fdc31d6da2ba09fa215e26 Mon Sep 17 00:00:00 2001 From: Reclipse <17797013+ReclipseTheOne@users.noreply.github.com> Date: Sun, 15 Dec 2024 20:24:24 +0200 Subject: [PATCH] NauBio machines --- .../4d58d921702f57799841730d3d537abc5ea398a2 | 7 +++- .../blockentities/BioReactorBlockEntity.java | 37 ++++++++++++++++++ .../blockentities/IncubatorBlockEntity.java | 37 ++++++++++++++++++ .../blockentities/MutatorBlockEntity.java | 38 +++++++++++++++++++ .../content/blocks/BioReactorBlock.java | 24 ++++++++++++ .../nautec/content/blocks/IncubatorBlock.java | 24 ++++++++++++ .../nautec/content/blocks/MutatorBlock.java | 24 ++++++++++++ .../nautec/datagen/EnUsProvider.java | 3 ++ .../nautec/registries/NTBlockEntityTypes.java | 11 ++++++ .../nautec/registries/NTBlocks.java | 8 ++++ 10 files changed, 211 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/portingdeadmods/nautec/content/blockentities/BioReactorBlockEntity.java create mode 100644 src/main/java/com/portingdeadmods/nautec/content/blockentities/IncubatorBlockEntity.java create mode 100644 src/main/java/com/portingdeadmods/nautec/content/blockentities/MutatorBlockEntity.java create mode 100644 src/main/java/com/portingdeadmods/nautec/content/blocks/BioReactorBlock.java create mode 100644 src/main/java/com/portingdeadmods/nautec/content/blocks/IncubatorBlock.java create mode 100644 src/main/java/com/portingdeadmods/nautec/content/blocks/MutatorBlock.java diff --git a/src/generated/resources/.cache/4d58d921702f57799841730d3d537abc5ea398a2 b/src/generated/resources/.cache/4d58d921702f57799841730d3d537abc5ea398a2 index 54c9e1e1..33ae072d 100644 --- a/src/generated/resources/.cache/4d58d921702f57799841730d3d537abc5ea398a2 +++ b/src/generated/resources/.cache/4d58d921702f57799841730d3d537abc5ea398a2 @@ -1,4 +1,4 @@ -// 1.21.1 2024-12-15T13:39:38.358791409 Item Models: nautec +// 1.21.1 2024-12-15T19:07:20.8340143 Item Models: nautec 53692692f57914fc54eb6ebf416ce1cb7789e57b assets/nautec/models/item/air_bottle.json cc6ee3887ec6e0c53216dc681ac7b32b34182253 assets/nautec/models/item/anchor.json 2e336fce57acffa1d0eb621baa30a26f665b4924 assets/nautec/models/item/aquarine_steel_axe.json @@ -24,6 +24,7 @@ f60b23b8ca6d44e339c9c415f53102833b4ff633 assets/nautec/models/item/atlantic_gold a95dff0d56139e74443ee5069394ccbe31bc875a assets/nautec/models/item/atlantic_gold_nugget.json 6338d151fe16332a6bd885776f58d9c9a4ffad62 assets/nautec/models/item/augmentation_station.json f616877025b33a5d417689bd59cba3385b11e5c9 assets/nautec/models/item/augmentation_station_extension.json +cd68bca3502f5a671aa5c4bbd828397047b19b8b assets/nautec/models/item/bio_reactor.json b1e3c9080ae5a0f78b06fa90f3c5da5b3805f842 assets/nautec/models/item/broken_whisk.json cf1524c962ddbbf1cb5e8782d764e71888a03eb1 assets/nautec/models/item/brown_polymer.json 5415b7ed1e075d2bffe7acdd5bc251f77363c0ac assets/nautec/models/item/burnt_coil.json @@ -53,19 +54,21 @@ cb07777d8dcd1c00bea806efc2b7f64c6c13a8c3 assets/nautec/models/item/fishing_stati 490588573d27c343b055c02b137c221a71866aa8 assets/nautec/models/item/gear.json 2b617afc38ea0b797aeba3ca00dfb25f33be4bd3 assets/nautec/models/item/glass_vial.json 1f8f85fa3cfb3f9fada3af0abc3f67b91ee70b81 assets/nautec/models/item/guardian_eye.json +465fff8f345aedd2e37bc4a22fa70756fb069373 assets/nautec/models/item/incubator.json d30193c75aab5ff8f4d4945df8689f575874c0f0 assets/nautec/models/item/laser_channeling_coil.json 644f1395dba609cfe064a66a028001e76dd20ab7 assets/nautec/models/item/laser_junction.json e2a54f360d7c345a624bfd88678359ffce2af94d assets/nautec/models/item/long_distance_laser.json 2a5b3ee493a3b20a37c3f391ebd960de088f2b7c assets/nautec/models/item/mixer.json +420392d152f0164245752585ea3f0e85b95b0cce assets/nautec/models/item/mutator.json c30b2391537fbc383c41aebe69a6eab8b2f9bd31 assets/nautec/models/item/petri_dish.json 888fbf8e3629b4cd0df267581ac130f534f80ac5 assets/nautec/models/item/petri_dish_bacteria.json e8d19ed0a058c92c28efb20a5f8887ff0b78770f assets/nautec/models/item/polished_prismarine.json -113d63fc1bd37fbe0fb477446a06eafa25ce09b1 assets/nautec/models/item/prism_monocle.json 8e22e42d27bc66bc91cc76fd66d0ff5457b585b1 assets/nautec/models/item/prismarine_crystal.json 8b90a03798a28c038b1c16da2f723e90694d182b assets/nautec/models/item/prismarine_crystal_shard.json 09882392c9745a728907f265dd968977ca0f171b assets/nautec/models/item/prismarine_laser_relay.json b01055cbe0dd02e958fe1063758658a9be6b753a assets/nautec/models/item/prismarine_sand.json e0209c5f64b38c19f4b8cc62dc90d23fd5f3bad0 assets/nautec/models/item/prismatic_battery.json +113d63fc1bd37fbe0fb477446a06eafa25ce09b1 assets/nautec/models/item/prism_monocle.json 0441fb5aafacad25af44cc70caad7de17d4d7762 assets/nautec/models/item/rusty_crate.json 546756658cb53a34f117de278d075cbdd09c70ba assets/nautec/models/item/rusty_gear.json 8af43812b6a13031c60720373e6e2aa8b3aa3367 assets/nautec/models/item/salt_water_bucket.json diff --git a/src/main/java/com/portingdeadmods/nautec/content/blockentities/BioReactorBlockEntity.java b/src/main/java/com/portingdeadmods/nautec/content/blockentities/BioReactorBlockEntity.java new file mode 100644 index 00000000..30c2d5e3 --- /dev/null +++ b/src/main/java/com/portingdeadmods/nautec/content/blockentities/BioReactorBlockEntity.java @@ -0,0 +1,37 @@ +package com.portingdeadmods.nautec.content.blockentities; + +import com.portingdeadmods.nautec.api.blockentities.LaserBlockEntity; +import com.portingdeadmods.nautec.capabilities.IOActions; +import com.portingdeadmods.nautec.registries.NTBlockEntityTypes; +import it.unimi.dsi.fastutil.Pair; +import it.unimi.dsi.fastutil.objects.ObjectSet; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.capabilities.BlockCapability; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; + +public class BioReactorBlockEntity extends LaserBlockEntity { + + + public BioReactorBlockEntity(BlockPos blockPos, BlockState blockState) { + super(NTBlockEntityTypes.BIO_REACTOR.get(), blockPos, blockState); + } + + @Override + public ObjectSet getLaserInputs() { + return ObjectSet.of(Direction.UP, Direction.DOWN); + } + + @Override + public ObjectSet getLaserOutputs() { + return ObjectSet.of(); + } + + @Override + public Map> getSidedInteractions(BlockCapability capability) { + return Map.of(); + } +} diff --git a/src/main/java/com/portingdeadmods/nautec/content/blockentities/IncubatorBlockEntity.java b/src/main/java/com/portingdeadmods/nautec/content/blockentities/IncubatorBlockEntity.java new file mode 100644 index 00000000..24d26ef9 --- /dev/null +++ b/src/main/java/com/portingdeadmods/nautec/content/blockentities/IncubatorBlockEntity.java @@ -0,0 +1,37 @@ +package com.portingdeadmods.nautec.content.blockentities; + +import com.portingdeadmods.nautec.api.blockentities.LaserBlockEntity; +import com.portingdeadmods.nautec.capabilities.IOActions; +import com.portingdeadmods.nautec.registries.NTBlockEntityTypes; +import it.unimi.dsi.fastutil.Pair; +import it.unimi.dsi.fastutil.objects.ObjectSet; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.capabilities.BlockCapability; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; + +public class IncubatorBlockEntity extends LaserBlockEntity { + + + public IncubatorBlockEntity(BlockPos blockPos, BlockState blockState) { + super(NTBlockEntityTypes.INCUBATOR.get(), blockPos, blockState); + } + + @Override + public ObjectSet getLaserInputs() { + return ObjectSet.of(Direction.UP, Direction.DOWN); + } + + @Override + public ObjectSet getLaserOutputs() { + return ObjectSet.of(); + } + + @Override + public Map> getSidedInteractions(BlockCapability capability) { + return Map.of(); + } +} diff --git a/src/main/java/com/portingdeadmods/nautec/content/blockentities/MutatorBlockEntity.java b/src/main/java/com/portingdeadmods/nautec/content/blockentities/MutatorBlockEntity.java new file mode 100644 index 00000000..0f458a3e --- /dev/null +++ b/src/main/java/com/portingdeadmods/nautec/content/blockentities/MutatorBlockEntity.java @@ -0,0 +1,38 @@ +package com.portingdeadmods.nautec.content.blockentities; + +import com.portingdeadmods.nautec.api.blockentities.LaserBlockEntity; +import com.portingdeadmods.nautec.capabilities.IOActions; +import com.portingdeadmods.nautec.registries.NTBlockEntityTypes; +import it.unimi.dsi.fastutil.Pair; +import it.unimi.dsi.fastutil.objects.ObjectSet; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.capabilities.BlockCapability; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; + +public class MutatorBlockEntity extends LaserBlockEntity { + + + public MutatorBlockEntity(BlockPos blockPos, BlockState blockState) { + super(NTBlockEntityTypes.MUTATOR.get(), blockPos, blockState); + } + + @Override + public ObjectSet getLaserInputs() { + return ObjectSet.of(Direction.UP, Direction.DOWN); + } + + @Override + public ObjectSet getLaserOutputs() { + return ObjectSet.of(); + } + + @Override + public Map> getSidedInteractions(BlockCapability capability) { + return Map.of(); + } +} diff --git a/src/main/java/com/portingdeadmods/nautec/content/blocks/BioReactorBlock.java b/src/main/java/com/portingdeadmods/nautec/content/blocks/BioReactorBlock.java new file mode 100644 index 00000000..504c1933 --- /dev/null +++ b/src/main/java/com/portingdeadmods/nautec/content/blocks/BioReactorBlock.java @@ -0,0 +1,24 @@ +package com.portingdeadmods.nautec.content.blocks; + +import com.mojang.serialization.MapCodec; +import com.portingdeadmods.nautec.api.blockentities.ContainerBlockEntity; +import com.portingdeadmods.nautec.api.blocks.blockentities.LaserBlock; +import com.portingdeadmods.nautec.registries.NTBlockEntityTypes; +import net.minecraft.world.level.block.BaseEntityBlock; +import net.minecraft.world.level.block.entity.BlockEntityType; + +public class BioReactorBlock extends LaserBlock { + public BioReactorBlock(Properties properties) { + super(properties); + } + + @Override + public BlockEntityType getBlockEntityType() { + return NTBlockEntityTypes.BIO_REACTOR.get(); + } + + @Override + protected MapCodec codec() { + return simpleCodec(BioReactorBlock::new); + } +} diff --git a/src/main/java/com/portingdeadmods/nautec/content/blocks/IncubatorBlock.java b/src/main/java/com/portingdeadmods/nautec/content/blocks/IncubatorBlock.java new file mode 100644 index 00000000..52f5cf1b --- /dev/null +++ b/src/main/java/com/portingdeadmods/nautec/content/blocks/IncubatorBlock.java @@ -0,0 +1,24 @@ +package com.portingdeadmods.nautec.content.blocks; + +import com.mojang.serialization.MapCodec; +import com.portingdeadmods.nautec.api.blockentities.ContainerBlockEntity; +import com.portingdeadmods.nautec.api.blocks.blockentities.LaserBlock; +import com.portingdeadmods.nautec.registries.NTBlockEntityTypes; +import net.minecraft.world.level.block.BaseEntityBlock; +import net.minecraft.world.level.block.entity.BlockEntityType; + +public class IncubatorBlock extends LaserBlock { + public IncubatorBlock(Properties properties) { + super(properties); + } + + @Override + public BlockEntityType getBlockEntityType() { + return NTBlockEntityTypes.INCUBATOR.get(); + } + + @Override + protected MapCodec codec() { + return simpleCodec(IncubatorBlock::new); + } +} diff --git a/src/main/java/com/portingdeadmods/nautec/content/blocks/MutatorBlock.java b/src/main/java/com/portingdeadmods/nautec/content/blocks/MutatorBlock.java new file mode 100644 index 00000000..844eaa39 --- /dev/null +++ b/src/main/java/com/portingdeadmods/nautec/content/blocks/MutatorBlock.java @@ -0,0 +1,24 @@ +package com.portingdeadmods.nautec.content.blocks; + +import com.mojang.serialization.MapCodec; +import com.portingdeadmods.nautec.api.blockentities.ContainerBlockEntity; +import com.portingdeadmods.nautec.api.blocks.blockentities.LaserBlock; +import com.portingdeadmods.nautec.registries.NTBlockEntityTypes; +import net.minecraft.world.level.block.BaseEntityBlock; +import net.minecraft.world.level.block.entity.BlockEntityType; + +public class MutatorBlock extends LaserBlock { + public MutatorBlock(Properties properties) { + super(properties); + } + + @Override + public BlockEntityType getBlockEntityType() { + return NTBlockEntityTypes.MUTATOR.get(); + } + + @Override + protected MapCodec codec() { + return simpleCodec(MutatorBlock::new); + } +} diff --git a/src/main/java/com/portingdeadmods/nautec/datagen/EnUsProvider.java b/src/main/java/com/portingdeadmods/nautec/datagen/EnUsProvider.java index 375ecbc5..1ab84e4c 100644 --- a/src/main/java/com/portingdeadmods/nautec/datagen/EnUsProvider.java +++ b/src/main/java/com/portingdeadmods/nautec/datagen/EnUsProvider.java @@ -104,6 +104,9 @@ protected void addTranslations() { addBlock(NTBlocks.CHARGER, "Charger"); addBlock(NTBlocks.PRISMARINE_SAND, "Prismarine Sand"); addBlock(NTBlocks.CREATIVE_POWER_SOURCE,"Creative Power Source"); + addBlock(NTBlocks.MUTATOR, "Mutator"); + addBlock(NTBlocks.INCUBATOR, "Incubator"); + addBlock(NTBlocks.BIO_REACTOR, "Bio Reactor"); // Multiblock information add("multiblock.info.failed_to_construct", "Missing or invalid block"); diff --git a/src/main/java/com/portingdeadmods/nautec/registries/NTBlockEntityTypes.java b/src/main/java/com/portingdeadmods/nautec/registries/NTBlockEntityTypes.java index 1396ffad..e5b4a0b4 100644 --- a/src/main/java/com/portingdeadmods/nautec/registries/NTBlockEntityTypes.java +++ b/src/main/java/com/portingdeadmods/nautec/registries/NTBlockEntityTypes.java @@ -44,6 +44,17 @@ public final class NTBlockEntityTypes { () -> BlockEntityType.Builder.of(FishingStationBlockEntity::new, NTBlocks.FISHING_STATION.get()).build(null)); + // Biology + public static final Supplier> MUTATOR = BLOCK_ENTITIES.register("mutator", + () -> BlockEntityType.Builder.of(MutatorBlockEntity::new, + NTBlocks.MUTATOR.get()).build(null)); + public static final Supplier> INCUBATOR = BLOCK_ENTITIES.register("incubator", + () -> BlockEntityType.Builder.of(IncubatorBlockEntity::new, + NTBlocks.INCUBATOR.get()).build(null)); + public static final Supplier> BIO_REACTOR = BLOCK_ENTITIES.register("bio_reactor", + () -> BlockEntityType.Builder.of(BioReactorBlockEntity::new, + NTBlocks.BIO_REACTOR.get()).build(null)); + public static final Supplier> CREATIVE_POWER_SOURCE = BLOCK_ENTITIES.register("creative_power_source", () -> BlockEntityType.Builder.of(CreativePowerSourceBlockEntity::new, NTBlocks.CREATIVE_POWER_SOURCE.get()).build(null)); diff --git a/src/main/java/com/portingdeadmods/nautec/registries/NTBlocks.java b/src/main/java/com/portingdeadmods/nautec/registries/NTBlocks.java index 53e2a14e..c9179655 100644 --- a/src/main/java/com/portingdeadmods/nautec/registries/NTBlocks.java +++ b/src/main/java/com/portingdeadmods/nautec/registries/NTBlocks.java @@ -65,6 +65,14 @@ public final class NTBlocks { public static final DeferredBlock FISHING_STATION = registerBlockAndItem("fishing_station", FishingStationBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK)); + // Biology + public static final DeferredBlock MUTATOR = registerBlockAndItem("mutator", MutatorBlock::new, + BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK)); + public static final DeferredBlock INCUBATOR = registerBlockAndItem("incubator", IncubatorBlock::new, + BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK)); + public static final DeferredBlock BIO_REACTOR = registerBlockAndItem("bio_reactor", BioReactorBlock::new, + BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK)); + // MULTIBLOCKS public static final DeferredBlock DRAIN = registerBlockAndItem("deep_sea_drain", DrainBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK));