More compiler fixes
This commit is contained in:
parent
cfa765437c
commit
4f053c161a
20 changed files with 84 additions and 67 deletions
|
@ -3,6 +3,7 @@ package ru.betterend.blocks.entities;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
import ru.betterend.rituals.InfusionRitual;
|
||||
|
||||
|
@ -10,13 +11,21 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
|||
|
||||
private InfusionRitual linkedRitual;
|
||||
|
||||
public InfusionPedestalEntity() {
|
||||
super(EndBlockEntities.INFUSION_PEDESTAL);
|
||||
public InfusionPedestalEntity(BlockPos blockPos, BlockState blockState) {
|
||||
super(EndBlockEntities.INFUSION_PEDESTAL, blockPos, blockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLevel(Level world){
|
||||
super.setLevel(world);
|
||||
if (hasRitual()) {
|
||||
linkedRitual.setLocation(world, this.getBlockPos());
|
||||
} else {
|
||||
linkRitual(new InfusionRitual(this, world, this.getBlockPos()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLevelAndPosition(Level world, BlockPos pos) {
|
||||
super.setLevelAndPosition(world, pos);
|
||||
if (hasRitual()) {
|
||||
linkedRitual.setLocation(world, pos);
|
||||
} else {
|
||||
|
@ -37,11 +46,11 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
protected void tick(Level tickLevel, BlockPos tickPos, BlockState tickState){
|
||||
if (hasRitual()) {
|
||||
linkedRitual.tick();
|
||||
}
|
||||
super.tick();
|
||||
super.tick(tickLevel, tickPos, tickState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
|
|||
private final int maxAge = 314;
|
||||
private int age;
|
||||
|
||||
public PedestalBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||
public PedestalBlockEntity(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState) {
|
||||
super(EndBlockEntities.PEDESTAL, blockPos, blockState);
|
||||
}
|
||||
|
||||
|
@ -132,12 +132,16 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
|
|||
}
|
||||
}
|
||||
|
||||
public static void tick(Level tickLevel, BlockPos tickPos, BlockState tickState, PedestalBlockEntity blockEntity) {
|
||||
if (!blockEntity.isEmpty()) {
|
||||
blockEntity.age++;
|
||||
if (blockEntity.age > blockEntity.maxAge) {
|
||||
blockEntity.age = 0;
|
||||
protected void tick(Level tickLevel, BlockPos tickPos, BlockState tickState){
|
||||
if (!this.isEmpty()) {
|
||||
this.age++;
|
||||
if (this.age > this.maxAge) {
|
||||
this.age = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void tick(Level tickLevel, BlockPos tickPos, BlockState tickState, PedestalBlockEntity blockEntity) {
|
||||
blockEntity.tick(tickLevel, tickPos, tickState);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue