From c1ebb923f7d55de4dd5353394ed9333a6d072bf4 Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:04:32 -0400 Subject: [PATCH] made a bunch of blocks unable to spawn mobs --- .../src/main/java/muramasa/antimatter/block/BlockFakeTile.java | 2 +- common/src/main/java/muramasa/antimatter/block/BlockStone.java | 2 +- .../src/main/java/muramasa/antimatter/block/BlockStorage.java | 2 +- .../java/muramasa/antimatter/datagen/loaders/StoneRecipes.java | 2 +- .../src/main/java/muramasa/antimatter/machine/BlockMachine.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/muramasa/antimatter/block/BlockFakeTile.java b/common/src/main/java/muramasa/antimatter/block/BlockFakeTile.java index d7019c7be..b40156320 100644 --- a/common/src/main/java/muramasa/antimatter/block/BlockFakeTile.java +++ b/common/src/main/java/muramasa/antimatter/block/BlockFakeTile.java @@ -27,7 +27,7 @@ public class BlockFakeTile extends BlockBasic implements IRegistryEntryProvider, public static BlockEntityType TYPE; private static Set TILE_SET = new HashSet<>(); public BlockFakeTile(String domain, String id, Properties properties) { - super(domain, id, properties); + super(domain, id, properties.isValidSpawn((blockState, blockGetter, blockPos, object) -> false)); AntimatterAPI.register(IRegistryEntryProvider.class, this); } diff --git a/common/src/main/java/muramasa/antimatter/block/BlockStone.java b/common/src/main/java/muramasa/antimatter/block/BlockStone.java index 60ff0a6f9..4a60ffb52 100644 --- a/common/src/main/java/muramasa/antimatter/block/BlockStone.java +++ b/common/src/main/java/muramasa/antimatter/block/BlockStone.java @@ -17,7 +17,7 @@ public BlockStone(StoneType type) { } public BlockStone(StoneType type, String suffix) { - super(type.getDomain(), type.getId() + "_" + suffix, getProps(type)); + super(type.getDomain(), type.getId() + "_" + suffix, getProps(type).isValidSpawn((blockState, blockGetter, blockPos, object) -> false)); this.type = type; this.suffix = suffix; } diff --git a/common/src/main/java/muramasa/antimatter/block/BlockStorage.java b/common/src/main/java/muramasa/antimatter/block/BlockStorage.java index 57b93efd0..fbd6fea79 100644 --- a/common/src/main/java/muramasa/antimatter/block/BlockStorage.java +++ b/common/src/main/java/muramasa/antimatter/block/BlockStorage.java @@ -32,7 +32,7 @@ public class BlockStorage extends BlockMaterialType implements IItemBlockProvide private static final VoxelShape FRAME_SHAPE = Shapes.box(0.05, 0.0, 0.05, 0.95, 1.0, 0.95); public BlockStorage(String domain, MaterialType type, Material material) { - super(domain, material, type, Properties.of(material == AntimatterMaterials.Wood ? net.minecraft.world.level.material.Material.WOOD : net.minecraft.world.level.material.Material.METAL).strength(type == AntimatterMaterialTypes.FRAME ? 2.0f : 8.0f).sound(material == AntimatterMaterials.Wood ? SoundType.WOOD : SoundType.METAL).requiresCorrectToolForDrops()); + super(domain, material, type, Properties.of(material == AntimatterMaterials.Wood ? net.minecraft.world.level.material.Material.WOOD : net.minecraft.world.level.material.Material.METAL).strength(type == AntimatterMaterialTypes.FRAME ? 2.0f : 8.0f).sound(material == AntimatterMaterials.Wood ? SoundType.WOOD : SoundType.METAL).requiresCorrectToolForDrops().isValidSpawn((blockState, blockGetter, blockPos, object) -> false)); } @Override diff --git a/common/src/main/java/muramasa/antimatter/datagen/loaders/StoneRecipes.java b/common/src/main/java/muramasa/antimatter/datagen/loaders/StoneRecipes.java index c4808eab1..d437539e3 100644 --- a/common/src/main/java/muramasa/antimatter/datagen/loaders/StoneRecipes.java +++ b/common/src/main/java/muramasa/antimatter/datagen/loaders/StoneRecipes.java @@ -32,7 +32,7 @@ public static void loadRecipes(Consumer output, AntimatterRecipe AntimatterAPI.all(StoneType.class).forEach(s -> { Material m = s.getMaterial(); if (m.has(AntimatterMaterialTypes.ROD)){ - provider.addStackRecipe(output, Ref.ID, m.getId() + "_rod", "rods", "has_stone", provider.hasSafeItem(s.getState().getBlock()), AntimatterMaterialTypes.ROD.get(m, 4), ImmutableMap.of('S', s.getState().getBlock()), "S", "S"); + provider.addStackRecipe(output, Ref.ID, s.getId() + "_to_" + m.getId() + "_rod", "rods", "has_stone", provider.hasSafeItem(s.getState().getBlock()), AntimatterMaterialTypes.ROD.get(m, 4), ImmutableMap.of('S', s.getState().getBlock()), "S", "S"); if (s == AntimatterStoneTypes.STONE){ provider.addStackRecipe(output, Ref.ID, m.getId() + "_rod_2", "rods", "has_stone", provider.hasSafeItem(Items.COBBLESTONE), AntimatterMaterialTypes.ROD.get(m, 4), ImmutableMap.of('S', Items.COBBLESTONE), "S", "S"); } diff --git a/common/src/main/java/muramasa/antimatter/machine/BlockMachine.java b/common/src/main/java/muramasa/antimatter/machine/BlockMachine.java index cec6417d0..29db36042 100644 --- a/common/src/main/java/muramasa/antimatter/machine/BlockMachine.java +++ b/common/src/main/java/muramasa/antimatter/machine/BlockMachine.java @@ -79,7 +79,7 @@ public BlockMachine(Machine type, Tier tier) { } public BlockMachine(Machine type, Tier tier, Properties properties) { - super(type.getDomain(), type.getId() + (tier == Tier.NONE ? "" : "_" + tier.getId()), properties); + super(type.getDomain(), type.getId() + (tier == Tier.NONE ? "" : "_" + tier.getId()), properties.isValidSpawn((blockState, blockGetter, blockPos, object) -> false)); StateDefinition.Builder builder = new StateDefinition.Builder<>(this); this.type = type; this.tier = tier;