Skip to content

Commit

Permalink
made a bunch of blocks unable to spawn mobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Oct 9, 2023
1 parent 76fe1ae commit c1ebb92
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class BlockFakeTile extends BlockBasic implements IRegistryEntryProvider,
public static BlockEntityType<BlockEntityFakeBlock> TYPE;
private static Set<Block> 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void loadRecipes(Consumer<FinishedRecipe> 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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Block, BlockState> builder = new StateDefinition.Builder<>(this);
this.type = type;
this.tier = tier;
Expand Down

0 comments on commit c1ebb92

Please sign in to comment.