mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Remove unused class
This commit is contained in:
parent
18393d104d
commit
b625824270
1 changed files with 0 additions and 41 deletions
|
@ -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<Entity> abilityTest;
|
|
||||||
|
|
||||||
public PredicatedBlockItem(Block block, Item.Settings settings, Predicate<Entity> 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);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue