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,
|
BlockState blockState,
|
||||||
BlockEntityType<T> blockEntityType
|
BlockEntityType<T> blockEntityType
|
||||||
) {
|
) {
|
||||||
return InfusionPedestalEntity::tickEnity;
|
return InfusionPedestalEntity::tickEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -52,13 +52,15 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
||||||
protected void fromTag(CompoundTag tag) {
|
protected void fromTag(CompoundTag tag) {
|
||||||
super.fromTag(tag);
|
super.fromTag(tag);
|
||||||
if (tag.contains("ritual")) {
|
if (tag.contains("ritual")) {
|
||||||
linkedRitual = new InfusionRitual(this, level, worldPosition);
|
if (!hasRitual()) {
|
||||||
|
linkedRitual = new InfusionRitual(this, level, worldPosition);
|
||||||
|
}
|
||||||
linkedRitual.fromTag(tag.getCompound("ritual"));
|
linkedRitual.fromTag(tag.getCompound("ritual"));
|
||||||
linkedRitual.configure();
|
linkedRitual.configure();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T extends BlockEntity> void tickEnity(
|
public static <T extends BlockEntity> void tickEntity(
|
||||||
Level level,
|
Level level,
|
||||||
BlockPos blockPos,
|
BlockPos blockPos,
|
||||||
BlockState blockState,
|
BlockState blockState,
|
||||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.world.level.chunk.LevelChunk.EntityCreationType;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
@ -56,7 +57,9 @@ public class InfusionRitual implements Container {
|
||||||
for (int i = 0; i < catalysts.length; i++) {
|
for (int i = 0; i < catalysts.length; i++) {
|
||||||
Point point = PEDESTALS_MAP[i];
|
Point point = PEDESTALS_MAP[i];
|
||||||
MutableBlockPos checkPos = worldPos.mutable().move(Direction.EAST, point.x).move(Direction.NORTH, point.y);
|
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) {
|
if (catalystEntity instanceof PedestalBlockEntity) {
|
||||||
catalysts[i] = (PedestalBlockEntity) catalystEntity;
|
catalysts[i] = (PedestalBlockEntity) catalystEntity;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue