Krypton infusion pedestal fix
This commit is contained in:
parent
ac96841372
commit
105f8cd862
3 changed files with 9 additions and 4 deletions
|
@ -84,7 +84,7 @@ public class InfusionPedestal extends PedestalBlock {
|
|||
BlockState blockState,
|
||||
BlockEntityType<T> blockEntityType
|
||||
) {
|
||||
return InfusionPedestalEntity::tickEnity;
|
||||
return InfusionPedestalEntity::tickEntity;
|
||||
}
|
||||
|
||||
static {
|
||||
|
|
|
@ -52,13 +52,15 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
|||
protected void fromTag(CompoundTag tag) {
|
||||
super.fromTag(tag);
|
||||
if (tag.contains("ritual")) {
|
||||
if (!hasRitual()) {
|
||||
linkedRitual = new InfusionRitual(this, level, worldPosition);
|
||||
}
|
||||
linkedRitual.fromTag(tag.getCompound("ritual"));
|
||||
linkedRitual.configure();
|
||||
}
|
||||
}
|
||||
|
||||
public static <T extends BlockEntity> void tickEnity(
|
||||
public static <T extends BlockEntity> void tickEntity(
|
||||
Level level,
|
||||
BlockPos blockPos,
|
||||
BlockState blockState,
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.chunk.LevelChunk.EntityCreationType;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import java.awt.*;
|
||||
|
@ -56,7 +57,9 @@ public class InfusionRitual implements Container {
|
|||
for (int i = 0; i < catalysts.length; i++) {
|
||||
Point point = PEDESTALS_MAP[i];
|
||||
MutableBlockPos checkPos = worldPos.mutable().move(Direction.EAST, point.x).move(Direction.NORTH, point.y);
|
||||
BlockEntity catalystEntity = world.getBlockEntity(checkPos);
|
||||
BlockEntity catalystEntity = world.isClientSide
|
||||
? world.getChunkAt(checkPos).getBlockEntity(checkPos, EntityCreationType.CHECK)
|
||||
: world.getBlockEntity(checkPos);
|
||||
if (catalystEntity instanceof PedestalBlockEntity) {
|
||||
catalysts[i] = (PedestalBlockEntity) catalystEntity;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue