Function optimisation
This commit is contained in:
parent
bca0994652
commit
7d178dedb0
3 changed files with 8 additions and 4 deletions
|
@ -68,6 +68,9 @@ public class EternalPedestal extends PedestalBlock {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void activate(World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
|
||||
BlockState updated = super.getStateForNeighborUpdate(state, direction, newState, world, pos, posFrom);
|
||||
|
|
|
@ -61,6 +61,9 @@ public class InfusionPedestal extends PedestalBlock {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void activate(World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {}
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView world) {
|
||||
return new InfusionPedestalEntity();
|
||||
|
|
|
@ -114,9 +114,7 @@ public class PedestalBlock extends BlockBaseNotFull implements BlockEntityProvid
|
|||
ItemStack itemStack = player.getStackInHand(hand);
|
||||
if (itemStack.isEmpty()) return ActionResult.CONSUME;
|
||||
pedestal.setStack(0, itemStack.split(1));
|
||||
if (!(this instanceof InfusionPedestal)) {
|
||||
activate(world, pos, player, hit);
|
||||
}
|
||||
activate(world, pos, player, hit);
|
||||
return ActionResult.SUCCESS;
|
||||
} else {
|
||||
ItemStack itemStack = pedestal.getStack(0);
|
||||
|
@ -130,7 +128,7 @@ public class PedestalBlock extends BlockBaseNotFull implements BlockEntityProvid
|
|||
return ActionResult.PASS;
|
||||
}
|
||||
|
||||
private void activate(World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
|
||||
protected void activate(World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
|
||||
Mutable mut = new Mutable();
|
||||
Point[] points = InfusionRitual.getMap();
|
||||
for (Point p: points) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue