Revert "Refactor and rename to Thresholds"
This reverts commit cd9d548806
.
This commit is contained in:
parent
cd9d548806
commit
858f359d4b
578 changed files with 215113 additions and 214942 deletions
|
@ -0,0 +1,38 @@
|
|||
package dev.zontreck.otemod.items;
|
||||
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.item.SimpleFoiledItem;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraft.world.level.Explosion;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
|
||||
public class UnstableSingularity extends SimpleFoiledItem
|
||||
{
|
||||
|
||||
public UnstableSingularity(Properties pProperties) {
|
||||
super(pProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InteractionResult useOn(UseOnContext pContext) {
|
||||
BlockState block = pContext.getLevel().getBlockState(pContext.getClickedPos());
|
||||
|
||||
if(block.getBlock().defaultDestroyTime() < 0)
|
||||
{
|
||||
pContext.getLevel().explode(pContext.getPlayer(), pContext.getClickedPos().getX(), pContext.getClickedPos().getY(), pContext.getClickedPos().getZ(), 16, true, Level.ExplosionInteraction.TNT);
|
||||
|
||||
pContext.getLevel().setBlock(pContext.getClickedPos(), Blocks.AIR.defaultBlockState(), 0, 0);
|
||||
|
||||
pContext.getItemInHand().shrink(1);
|
||||
|
||||
}
|
||||
|
||||
return InteractionResult.CONSUME;
|
||||
|
||||
}
|
||||
}
|
Reference in a new issue