[Feature] New Advancements
This commit is contained in:
parent
ed620a1c57
commit
74faf97a93
10 changed files with 149 additions and 12 deletions
|
@ -118,14 +118,14 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
if (itemStack.isEmpty()) return InteractionResult.CONSUME;
|
||||
pedestal.setItem(0, itemStack);
|
||||
level.blockEntityChanged(pos);
|
||||
checkRitual(level, pos);
|
||||
checkRitual(level, player, pos);
|
||||
return InteractionResult.sidedSuccess(level.isClientSide());
|
||||
} else {
|
||||
ItemStack itemStack = pedestal.getItem(0);
|
||||
if (player.addItem(itemStack)) {
|
||||
pedestal.removeItemNoUpdate(0);
|
||||
level.blockEntityChanged(pos);
|
||||
checkRitual(level, pos);
|
||||
checkRitual(level, player, pos);
|
||||
return InteractionResult.sidedSuccess(level.isClientSide());
|
||||
}
|
||||
return InteractionResult.FAIL;
|
||||
|
@ -153,13 +153,13 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
}
|
||||
}
|
||||
|
||||
public void checkRitual(Level world, BlockPos pos) {
|
||||
public void checkRitual(Level world, Player player, BlockPos pos) {
|
||||
MutableBlockPos posMutable = new MutableBlockPos();
|
||||
for (Point point : InfusionRitual.getMap()) {
|
||||
posMutable.set(pos).move(point.x, 0, point.y);
|
||||
BlockState state = world.getBlockState(posMutable);
|
||||
if (state.getBlock() instanceof InfusionPedestal) {
|
||||
((InfusionPedestal) state.getBlock()).checkRitual(world, posMutable);
|
||||
((InfusionPedestal) state.getBlock()).checkRitual(world, player, posMutable);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue