From b625824270d0a3605c98ee5cdf7eb5e3c7e65367 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 28 Feb 2021 12:12:57 +0200 Subject: [PATCH] Remove unused class --- .../unicopia/item/PredicatedBlockItem.java | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/main/java/com/minelittlepony/unicopia/item/PredicatedBlockItem.java diff --git a/src/main/java/com/minelittlepony/unicopia/item/PredicatedBlockItem.java b/src/main/java/com/minelittlepony/unicopia/item/PredicatedBlockItem.java deleted file mode 100644 index 660cbc75..00000000 --- a/src/main/java/com/minelittlepony/unicopia/item/PredicatedBlockItem.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.minelittlepony.unicopia.item; - -import java.util.function.Predicate; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.BlockItem; -import net.minecraft.item.Item; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -public class PredicatedBlockItem extends BlockItem { - - private final Predicate abilityTest; - - public PredicatedBlockItem(Block block, Item.Settings settings, Predicate abilityTest) { - super(block, settings); - - this.abilityTest = abilityTest; - } - - @Override - protected boolean canPlace(ItemPlacementContext context, BlockState state) { - if (context.getPlayer() != null && !(context.getPlayer().abilities.creativeMode || abilityTest.test(context.getPlayer()))) { - return false; - } - return super.canPlace(context, state); - } - - @Override - public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity player) { - if (!(player.abilities.creativeMode || abilityTest.test(player))) { - return false; - } - - return super.canMine(state, world, pos, player); - } -}