diff --git a/src/generated/resources/.cache/4d58d921702f57799841730d3d537abc5ea398a2 b/src/generated/resources/.cache/4d58d921702f57799841730d3d537abc5ea398a2 index f6739f1..66cd3b3 100644 --- a/src/generated/resources/.cache/4d58d921702f57799841730d3d537abc5ea398a2 +++ b/src/generated/resources/.cache/4d58d921702f57799841730d3d537abc5ea398a2 @@ -1,4 +1,4 @@ -// 1.21.1 2024-12-16T16:09:32.176187626 Item Models: nautec +// 1.21.1 2024-12-16T14:22:25.511340001 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,7 +24,6 @@ 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 -77496bd37cb0cd85dfb77e146366322e44bfcd63 assets/nautec/models/item/bacterial_analyzer.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 diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 04268fb..c4c8625 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,20 +1,32 @@ -// 1.21.1 2024-12-16T22:58:24.975013206 Recipes +// 1.21.1 2024-12-16T15:01:51.431041545 Recipes +11639f08778ec1107c05d822f9beaa1f90e3bb32 data/minecraft/advancement/recipes/misc/cast_iron_ingot_blasting.json +5f305b97f7366fc61918bd266d0bacfa386b16c1 data/minecraft/advancement/recipes/misc/cast_iron_nugget_to_ingot.json +c01db9d69b288d37c769cf605b945ebf60a08e21 data/minecraft/advancement/recipes/misc/diving_chestplate.json +36b0d6b627495be6eaf8d6e567f9c95bdb744f14 data/minecraft/advancement/recipes/misc/diving_chestplate_oxygen.json +1f708c5dccdbb5a569e215ac0621ef2c3daa085d data/minecraft/recipe/cast_iron_ingot_blasting.json +5d8fdeabdc238a5b557a2a159a9ccb30e723703b data/minecraft/recipe/cast_iron_nugget_to_ingot.json +83753bf5ab777551fde11d26262c5f2b947f4a64 data/minecraft/recipe/diving_chestplate.json +d9bd5ed8d761638f07ac753459c333be5e11032b data/minecraft/recipe/diving_chestplate_oxygen.json +0eb4bd206062b5348bb5c146f2800fd99b43042b data/minecraft/recipe/dolphin_fin.json +1d373a9d6f1d9a44589095bc5b67e5e237fe7075 data/minecraft/recipe/drowned_lung.json +bc5369ceacc6f35820c4fbddd5f6311d302b19af data/minecraft/recipe/eldritch_heart.json +8476e4500001a8b1e18c57e5add46ab9b1f43493 data/minecraft/recipe/guardian_eye_augment.json ebae64ded4bb31c5b0cf21d6f4a5df5c4bce9ab0 data/nautec/advancement/recipes/building_blocks/brown_polymer_block.json 056382c183d52a8f0d17b4992017b217f7444060 data/nautec/advancement/recipes/building_blocks/brown_polymer_from_block.json e1102abc52970c4638811a9f3aed423c343b2976 data/nautec/advancement/recipes/building_blocks/chiseled_dark_prismarine.json d8aae0b932dc7603a54c5a804f905b6dcf2f77a2 data/nautec/advancement/recipes/building_blocks/dark_prismarine_pillar.json 8c227a8c475e21c750c907230ff6420791f780d6 data/nautec/advancement/recipes/building_blocks/polished_prismarine.json -8bb770fa05d69e050d699a4a8672f2db42c06240 data/nautec/advancement/recipes/misc/aquarine_axe.json -28e66904f03a4812a62ed5be9e913ba5e3c508a9 data/nautec/advancement/recipes/misc/aquarine_boots.json -33edc1c6d4df263ebc3265db02a9684ccf8f952b data/nautec/advancement/recipes/misc/aquarine_chestplate.json -cc2edd2e2205a0ae07ada372f990992886e4d756 data/nautec/advancement/recipes/misc/aquarine_helmet.json -5efd1cc1017c8e021437b92c44f94f177da31ca2 data/nautec/advancement/recipes/misc/aquarine_hoe.json -d6cf868112be7595f9e4a490bdbe0413ee21790b data/nautec/advancement/recipes/misc/aquarine_leggings.json -4ff566ebb9bf4664f68508464ea0f69af5cd1c66 data/nautec/advancement/recipes/misc/aquarine_pickaxe.json -05fb701e03c918e985ea462144eca28154e15d1a data/nautec/advancement/recipes/misc/aquarine_shovel.json +95a4e3198eb7336208d8b7154d8cc815b49ab307 data/nautec/advancement/recipes/misc/aquarine_steel_axe.json +258ad51beb8603bf4731f299aba3d55537bad429 data/nautec/advancement/recipes/misc/aquarine_steel_boots.json +e20dff21299a723c25fe2e3350808d40529d7f21 data/nautec/advancement/recipes/misc/aquarine_steel_chestplate.json 8f2aba847de10d1a879ff6e4a156fe2390120df5 data/nautec/advancement/recipes/misc/aquarine_steel_compound.json -d3a4e78e172af38cb5702831380c2364296e3060 data/nautec/advancement/recipes/misc/aquarine_sword.json -7cc3c716c8022d0c684d5f8cc482383e29943742 data/nautec/advancement/recipes/misc/aquarine_wrench.json +5b2e91896d66bf6f0e8f28036542115a939bdfce data/nautec/advancement/recipes/misc/aquarine_steel_helmet.json +a72b216b5a43dba19e590200c23f4a85d14c8cc9 data/nautec/advancement/recipes/misc/aquarine_steel_hoe.json +01fc6f69c651349f3952713597e24964c5141ad2 data/nautec/advancement/recipes/misc/aquarine_steel_leggings.json +5509d7fb17d6599c0ec7a2289503a9ab63cd1955 data/nautec/advancement/recipes/misc/aquarine_steel_pickaxe.json +1e6bc5788e66699e79d1f89aa8123e7492ba73c7 data/nautec/advancement/recipes/misc/aquarine_steel_shovel.json +04cafdd4ce8f51a56bd335bb540d658f1a233c4f data/nautec/advancement/recipes/misc/aquarine_steel_sword.json +d105bf1507d29e8c1a25eea476d5566745ca84a9 data/nautec/advancement/recipes/misc/aquarine_steel_wrench.json 0ff88a44c7f1679b9540fa694bd324567be25f01 data/nautec/advancement/recipes/misc/aquatic_catalyst.json 4892a02e14ac5f73378727582505c2c6f671e254 data/nautec/advancement/recipes/misc/augmentation_station.json b52be24dd909e8a30bc3be0e4b48f5336cc80fab data/nautec/advancement/recipes/misc/augmentation_station_extension.json @@ -22,22 +34,18 @@ a99cf9516cbb9353b47e68ecf484902406da4333 data/nautec/advancement/recipes/misc/ba da491fad8a32d01009f9cf53c47ae83a49050a21 data/nautec/advancement/recipes/misc/bed_from_brown_polymer.json 738cece82a6cdccabd0c678682ad4366a0c7d1ca data/nautec/advancement/recipes/misc/book_from_brown_polymer.json 0a69ce6ebf4eb3fdd0643da2840333fb3e81731d data/nautec/advancement/recipes/misc/brown_polymer.json -102e9562fe6a4da921dbddff4699fab974b7d757 data/nautec/advancement/recipes/misc/cast_iron_ingot.json -fab289185a5f001325526ff88b1a44f2c6c60664 data/nautec/advancement/recipes/misc/cast_iron_ingot_blasting.json d954dfc419cb2d5ab0e183b4899d93dae7a32422 data/nautec/advancement/recipes/misc/cast_iron_ingot_from_blasting.json d6a6420d783a5714529e18ba05f0382124f3c4e0 data/nautec/advancement/recipes/misc/cast_iron_nugget.json 939b8a71fa717c6f77dc521309a69952dd701da4 data/nautec/advancement/recipes/misc/cast_iron_rod.json 80c335c97a3e51847dd873dc952a31379bb96d95 data/nautec/advancement/recipes/misc/charger.json 0e407f043ba7d3071850b9c532e97b0f709b6e75 data/nautec/advancement/recipes/misc/claw_robot_arm.json dd0c9fe24b3b03c6b1bc8c1f76d4efbd8560d48e data/nautec/advancement/recipes/misc/crowbar.json +a1c9316078b36be46d2b3cfe4bb9bd6929ff08bc data/nautec/advancement/recipes/misc/deep_sea_drain.json +b8ada0e92e270525f1fbabdd97372d76c1a93add data/nautec/advancement/recipes/misc/deep_sea_drain_wall.json 6509407527141fb273373552cb19b6a67bea0f03 data/nautec/advancement/recipes/misc/diving_boots.json -60d00386e1f31969eb4d530ca52a702474284f91 data/nautec/advancement/recipes/misc/diving_chestplate.json -d35045d3c820fd801c27f2775c11fba724d4ad0b data/nautec/advancement/recipes/misc/diving_chestplate_oxygen.json f453783b629e6901fe593efb42e4a537f9a615fd data/nautec/advancement/recipes/misc/diving_helmet.json 45f2ce9aa457103af0b898a510b7e5a279870619 data/nautec/advancement/recipes/misc/diving_leggings.json -904c10cfdd0c6351ee65bd6df33e1f1fd7ea897c data/nautec/advancement/recipes/misc/drain.json -4a060e9070ba237c2fc19d7f62ef29754c46b80d data/nautec/advancement/recipes/misc/drain_wall.json -d3317e2ec05210932441cf9803a819a7701a7f2c data/nautec/advancement/recipes/misc/etching_acid_crafting.json +103976aab16087f503404cfee730b36686b1e36d data/nautec/advancement/recipes/misc/etching_acid_bucket.json 2e227620c2d867bc1e46276896b5281bb34d7eb0 data/nautec/advancement/recipes/misc/glass_vial.json b5d027104efc60967efadd19812ea2fc23fb2924 data/nautec/advancement/recipes/misc/item_frame_from_brown_polymer.json e8c7d011fc8d7584ae12c127a368e794c349cc43 data/nautec/advancement/recipes/misc/laser_junction.json @@ -45,69 +53,61 @@ e8c7d011fc8d7584ae12c127a368e794c349cc43 data/nautec/advancement/recipes/misc/la fa6493a3ef0380850872951ce297171d1708ce63 data/nautec/advancement/recipes/misc/mixer.json 94885315f77dd2362883172287de15e80f1a6e7b data/nautec/advancement/recipes/misc/nautec_guide.json 8b0963164bc58a64ef675d369ac6f4221b8cbebb data/nautec/advancement/recipes/misc/prism_monocle.json -002f4581bd2e95a74b869395702f7a95e2b2c5f5 data/nautec/advancement/recipes/misc/prismarine_relay.json +03abc1a326810daa2cccf6acf1d21a55d776bd8b data/nautec/advancement/recipes/misc/prismarine_laser_relay.json 1eb85648ed5c154f0a465c787ef1cfd4542c3572 data/nautec/advancement/recipes/misc/prismatic_battery.json df1f62063c751d0d6939426505f6bb14f6ae7382 data/nautec/advancement/recipes/misc/whisk.json -83490bc77ed0236455b903949d3ef5ee0430d7ed data/nautec/recipe/aquarine_axe.json -2705880f2aec0f82cf5d58ffa1736dbeea7b7452 data/nautec/recipe/aquarine_boots.json -46d7aad5f5ba6a71f021d3ecdc47ec5078ccbd59 data/nautec/recipe/aquarine_chestplate.json -3b232c689a28fd2cd108b9eede46708b9b851a5b data/nautec/recipe/aquarine_helmet.json -0236a4740a86925405b8bfddf145edbf77c97e52 data/nautec/recipe/aquarine_hoe.json -1e8f331795a5b23402f372dcefa418c258ae6cc6 data/nautec/recipe/aquarine_leggings.json -4f09212df595932bc8949182e8f75fce8414b666 data/nautec/recipe/aquarine_pickaxe.json -7d292436e361119714329a5ae730048a2a6f2e28 data/nautec/recipe/aquarine_shovel.json +83490bc77ed0236455b903949d3ef5ee0430d7ed data/nautec/recipe/aquarine_steel_axe.json +2705880f2aec0f82cf5d58ffa1736dbeea7b7452 data/nautec/recipe/aquarine_steel_boots.json +46d7aad5f5ba6a71f021d3ecdc47ec5078ccbd59 data/nautec/recipe/aquarine_steel_chestplate.json c4fdc4aa2913699bef2463d5c929bc4724d180ae data/nautec/recipe/aquarine_steel_compound.json -ac8c8ef9122a3e1312b101ce23af51ae019143e5 data/nautec/recipe/aquarine_steel_compound_mixing.json -bfb697fd87f2fb761866405c2a58df7aef434ae2 data/nautec/recipe/aquarine_steel_ingot.json -c99f07ec9ec3b3e570ab81f9f6b5890fdcf3930f data/nautec/recipe/aquarine_sword.json -78c4da26cb8c9f272043276502bbd017b1c163ea data/nautec/recipe/aquarine_wrench.json +3b232c689a28fd2cd108b9eede46708b9b851a5b data/nautec/recipe/aquarine_steel_helmet.json +0236a4740a86925405b8bfddf145edbf77c97e52 data/nautec/recipe/aquarine_steel_hoe.json +1e8f331795a5b23402f372dcefa418c258ae6cc6 data/nautec/recipe/aquarine_steel_leggings.json +4f09212df595932bc8949182e8f75fce8414b666 data/nautec/recipe/aquarine_steel_pickaxe.json +7d292436e361119714329a5ae730048a2a6f2e28 data/nautec/recipe/aquarine_steel_shovel.json +c99f07ec9ec3b3e570ab81f9f6b5890fdcf3930f data/nautec/recipe/aquarine_steel_sword.json +78c4da26cb8c9f272043276502bbd017b1c163ea data/nautec/recipe/aquarine_steel_wrench.json e5b299cdc66cfaa5d495fc6677a39188d7e05304 data/nautec/recipe/aquatic_catalyst.json +69ccc6392657a824e91bea60558c69e4f26685f1 data/nautec/recipe/aquatic_catalyst_channeling/corals.json +45a043fa8907c3b7f592f8f8b5947f8ea60134be data/nautec/recipe/aquatic_catalyst_channeling/kelp.json ba5f2ec03f05fc1f52d3c03f544988e459826d69 data/nautec/recipe/augmentation_station.json 9c2bc24537825f94866e46c4d37cd820f1f59cc3 data/nautec/recipe/augmentation_station_extension.json 1ed2e8bdcfab093c605a5a5f7c9fcd6c709be258 data/nautec/recipe/banner_from_brown_polymer.json a9c53478ce9eefdcdd917217c32a19cc7fe8344c data/nautec/recipe/bed_from_brown_polymer.json 8ed31c62db2e3f744332a5027d264e3758d46c82 data/nautec/recipe/book_from_brown_polymer.json -1414dd3fe07a9bcdb87c1dcda433476089f02a10 data/nautec/recipe/brown_polymer.json +b2cb1d73b9e1e2104af451250ff4464197c45531 data/nautec/recipe/brown_polymer.json 6818283cb29f588a3b5c60460db0ac59ff0c287e data/nautec/recipe/brown_polymer_block.json 8234eaba36308abfceeda4158ae8975eb16e3c0b data/nautec/recipe/brown_polymer_from_block.json -5d8fdeabdc238a5b557a2a159a9ccb30e723703b data/nautec/recipe/cast_iron_ingot.json -1f708c5dccdbb5a569e215ac0621ef2c3daa085d data/nautec/recipe/cast_iron_ingot_blasting.json ac856492b21e9245de0ba2edcbeda8bc2b06c7fd data/nautec/recipe/cast_iron_ingot_from_blasting.json 0e7ac319099e484ba772e18754213fe7009a42cd data/nautec/recipe/cast_iron_nugget.json 159c149c6f81da00b9f2f73c993f1cf7383786c5 data/nautec/recipe/cast_iron_rod.json a1104a2fca829ca101471417232e05510e405423 data/nautec/recipe/charger.json 8f563bd85ef2e4f655ed27548b35967961ce4035 data/nautec/recipe/chiseled_dark_prismarine.json 7cb4ad5a479e5690ce11e6025ce01a38090012c7 data/nautec/recipe/claw_robot_arm.json -69ccc6392657a824e91bea60558c69e4f26685f1 data/nautec/recipe/corals.json -92b1c892b837a6f4a88591b221bc580fa73ee881 data/nautec/recipe/crate.json f540636f940eb6cab30e9e30319f69ef3a76899b data/nautec/recipe/crowbar.json b4db622a427960600d52b7e951f21cfeab52ca7b data/nautec/recipe/dark_prismarine_pillar.json +cfc02afe736a2867e27a155b5dc8d9f9c9f0f491 data/nautec/recipe/deep_sea_drain.json +039b28f455c293cbe02315c52abc2093c0c52e30 data/nautec/recipe/deep_sea_drain_wall.json 374e9e369089bee2db4da1d961a2a11a93f7e88f data/nautec/recipe/diving_boots.json -83753bf5ab777551fde11d26262c5f2b947f4a64 data/nautec/recipe/diving_chestplate.json -d9bd5ed8d761638f07ac753459c333be5e11032b data/nautec/recipe/diving_chestplate_oxygen.json ad76d1e18615e634a5fd16459f0d0efaeea97cd2 data/nautec/recipe/diving_helmet.json 7ebba94ed073b518f596623e5c9f3e44d80c3ffa data/nautec/recipe/diving_leggings.json -0eb4bd206062b5348bb5c146f2800fd99b43042b data/nautec/recipe/dolphin_fin.json -cfc02afe736a2867e27a155b5dc8d9f9c9f0f491 data/nautec/recipe/drain.json -039b28f455c293cbe02315c52abc2093c0c52e30 data/nautec/recipe/drain_wall.json -1d373a9d6f1d9a44589095bc5b67e5e237fe7075 data/nautec/recipe/drowned_lung.json -9374bb4c1bb1a3e8eb1312ee701560a68be7d033 data/nautec/recipe/eas.json -bc5369ceacc6f35820c4fbddd5f6311d302b19af data/nautec/recipe/eldritch_heart.json -4c6919bb450e81c7560fd15529ef566e0c3690dc data/nautec/recipe/etching_acid_crafting.json -b00568e1261638147c0e1f2433821bb6aa9f42b9 data/nautec/recipe/etching_acid_mixing.json -26b45ba49569a3744a9e7685f679a7da10b08d93 data/nautec/recipe/gear.json +4c6919bb450e81c7560fd15529ef566e0c3690dc data/nautec/recipe/etching_acid_bucket.json fe30c6078bd52f68fa02455d52d2eb51b8718c16 data/nautec/recipe/glass_vial.json -8476e4500001a8b1e18c57e5add46ab9b1f43493 data/nautec/recipe/guardian_eye.json +0e781b8c85808d8ee2691a5c39404da2b6a8f061 data/nautec/recipe/item_etching/ancient_valve_to_valve.json +92b1c892b837a6f4a88591b221bc580fa73ee881 data/nautec/recipe/item_etching/rusty_crate_to_crate.json +26b45ba49569a3744a9e7685f679a7da10b08d93 data/nautec/recipe/item_etching/rusty_gear_to_gear.json 38e5ac85f700956260714f824d8f5688c5385d39 data/nautec/recipe/item_frame_from_brown_polymer.json -45a043fa8907c3b7f592f8f8b5947f8ea60134be data/nautec/recipe/kelp.json -a4bdb97abe0834d405f7584452f78242585e02ff data/nautec/recipe/laser_channeling_coil.json +bfb697fd87f2fb761866405c2a58df7aef434ae2 data/nautec/recipe/item_transformation/aquarine_steel_compound_to_aquarine_steel_ingot.json +a4bdb97abe0834d405f7584452f78242585e02ff data/nautec/recipe/item_transformation/burnt_coil_to_laser_channeling_coil.json 3ff56013c9c1926be24f71bdb57c93527ef7ee28 data/nautec/recipe/laser_junction.json 11d23344db3f6e98c1520328fd6c883bccd8ca57 data/nautec/recipe/long_distance_laser.json 4925f952a200ae56a4e1ad04a45897be4988aad4 data/nautec/recipe/mixer.json +9374bb4c1bb1a3e8eb1312ee701560a68be7d033 data/nautec/recipe/mixing/dried_kelp_slime_ball_prismarine_crystals_seagrass.json +b00568e1261638147c0e1f2433821bb6aa9f42b9 data/nautec/recipe/mixing/pufferfish_gunpowder_bone_meal.json +ac8c8ef9122a3e1312b101ce23af51ae019143e5 data/nautec/recipe/mixing/raw_iron_prismarine_crystals_to_aquarine_steel_compound.json 674df651148d747a200794f496996b82ca94e72f data/nautec/recipe/nautec_guide.json f9596d9be4a76ba5e91496e7396018daa20cccfc data/nautec/recipe/polished_prismarine.json 4fe8f6115c759c654e132afedec76d846f0a89d5 data/nautec/recipe/prism_monocle.json -ac628b97c097227e3af94f13cbe35a2cf3ee3124 data/nautec/recipe/prismarine_relay.json +ac628b97c097227e3af94f13cbe35a2cf3ee3124 data/nautec/recipe/prismarine_laser_relay.json 4745c9855337a311cb5b7211168927a61645d193 data/nautec/recipe/prismatic_battery.json -0e781b8c85808d8ee2691a5c39404da2b6a8f061 data/nautec/recipe/valve.json 266c89a0698de108847ad3b60be50d230822cee4 data/nautec/recipe/whisk.json diff --git a/src/main/java/com/portingdeadmods/nautec/content/blockentities/BreakerBlockEntity.java b/src/main/java/com/portingdeadmods/nautec/content/blockentities/BreakerBlockEntity.java new file mode 100644 index 0000000..ceb6ff0 --- /dev/null +++ b/src/main/java/com/portingdeadmods/nautec/content/blockentities/BreakerBlockEntity.java @@ -0,0 +1,81 @@ +package com.portingdeadmods.nautec.content.blockentities; + +import com.portingdeadmods.nautec.NTConfig; +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.server.level.ServerLevel; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.storage.loot.LootParams; +import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; +import net.minecraft.world.level.storage.loot.parameters.LootContextParams; +import net.minecraft.world.phys.Vec3; +import net.neoforged.neoforge.capabilities.BlockCapability; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.Map; + +public class BreakerBlockEntity extends LaserBlockEntity { + private boolean running; + private int counter; + public BreakerBlockEntity(BlockPos blockPos, BlockState blockState) { + super(NTBlockEntityTypes.BREAKER_BLOCK.get(), blockPos, blockState); + } + + @Override + public ObjectSet getLaserInputs() { + return ObjectSet.of(Direction.UP, Direction.DOWN, Direction.EAST, Direction.NORTH,Direction.WEST, Direction.SOUTH); + } + + @Override + public ObjectSet getLaserOutputs() { + return ObjectSet.of(); + } + + @Override + public Map> getSidedInteractions(BlockCapability capability) { + return Map.of(); + } + + @Override + public void commonTick() { + super.commonTick(); + if (level instanceof ServerLevel && getPower() >= 1){ + if (running) { + if (counter >= 20) { + counter = 0; + running = false; + spawnLoot(); + } + counter++; + } else running = true; + } + } + + private void spawnLoot() { + BlockState block = level.getBlockState(worldPosition.below()); + List stacks = block.getDrops(new LootParams.Builder((ServerLevel) level).withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(worldPosition)).withParameter(LootContextParams.TOOL, Items.DIAMOND_PICKAXE.getDefaultInstance())); + if (!stacks.isEmpty()) { + level.removeBlock(worldPosition.below(), false); + for (ItemStack stack : stacks) { + Vec3 pos = getItemSpawnPos(); + ItemEntity itemEntity = new ItemEntity(level, pos.x, pos.y, pos.z, stack); + level.addFreshEntity(itemEntity); + } + } + + } + private Vec3 getItemSpawnPos(){ + return new Vec3(worldPosition.getX() + 0.5, worldPosition.getY() + 1.5, worldPosition.getZ() + 0.5); + } +} diff --git a/src/main/java/com/portingdeadmods/nautec/content/blocks/BreakerBlock.java b/src/main/java/com/portingdeadmods/nautec/content/blocks/BreakerBlock.java new file mode 100644 index 0000000..3355db1 --- /dev/null +++ b/src/main/java/com/portingdeadmods/nautec/content/blocks/BreakerBlock.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 BreakerBlock extends LaserBlock { + public BreakerBlock(Properties properties) { + super(properties); + } + + @Override + public BlockEntityType getBlockEntityType() { + return NTBlockEntityTypes.BREAKER_BLOCK.get(); + } + + @Override + protected MapCodec codec() { + return simpleCodec(BreakerBlock::new); + } +} diff --git a/src/main/java/com/portingdeadmods/nautec/registries/NTBlockEntityTypes.java b/src/main/java/com/portingdeadmods/nautec/registries/NTBlockEntityTypes.java index f8390e6..db44e12 100644 --- a/src/main/java/com/portingdeadmods/nautec/registries/NTBlockEntityTypes.java +++ b/src/main/java/com/portingdeadmods/nautec/registries/NTBlockEntityTypes.java @@ -46,6 +46,9 @@ public final class NTBlockEntityTypes { public static final Supplier> OIL_BARREL = BLOCK_ENTITIES.register("oil_barrel", () -> BlockEntityType.Builder.of(OilBarrelBlockEntity::new, NTBlocks.OIL_BARREL.get()).build(null)); + public static final Supplier> BREAKER_BLOCK = BLOCK_ENTITIES.register("breaker", + () -> BlockEntityType.Builder.of(BreakerBlockEntity::new, + NTBlocks.BREAKER_BLOCK.get()).build(null)); // Biology public static final Supplier> MUTATOR = BLOCK_ENTITIES.register("mutator", diff --git a/src/main/java/com/portingdeadmods/nautec/registries/NTBlocks.java b/src/main/java/com/portingdeadmods/nautec/registries/NTBlocks.java index 9b23772..fe505a2 100644 --- a/src/main/java/com/portingdeadmods/nautec/registries/NTBlocks.java +++ b/src/main/java/com/portingdeadmods/nautec/registries/NTBlocks.java @@ -67,6 +67,8 @@ public final class NTBlocks { BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK)); public static final DeferredBlock FISHING_STATION = registerBlockAndItem("fishing_station", FishingStationBlock::new, BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK)); + public static final DeferredBlock BREAKER_BLOCK = registerBlockAndItem("breaker", BreakerBlock::new, + BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_BLOCK)); // Biology public static final DeferredBlock MUTATOR = registerBlockAndItem("mutator", MutatorBlock::new,