Infusion rituals
This commit is contained in:
parent
1e4b7377f2
commit
bdf3d0afb1
9 changed files with 68 additions and 4 deletions
|
@ -4,11 +4,16 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
import ru.betterend.rituals.EternalRitual;
|
||||
|
||||
public class EternalPedestalEntity extends PedestalBlockEntity {
|
||||
private EternalRitual linkedRitual;
|
||||
|
||||
public EternalPedestalEntity() {
|
||||
super(EndBlockEntities.ETERNAL_PEDESTAL);
|
||||
}
|
||||
|
||||
public boolean hasRitual() {
|
||||
return this.linkedRitual != null;
|
||||
}
|
||||
|
|
|
@ -4,12 +4,17 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
import ru.betterend.rituals.InfusionRitual;
|
||||
|
||||
public class InfusionPedestalEntity extends PedestalBlockEntity {
|
||||
|
||||
private InfusionRitual linkedRitual;
|
||||
|
||||
public InfusionPedestalEntity() {
|
||||
super(EndBlockEntities.INFUSION_PEDESTAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLocation(World world, BlockPos pos) {
|
||||
super.setLocation(world, pos);
|
||||
|
@ -38,6 +43,11 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
|||
super.tick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toInitialChunkDataTag() {
|
||||
return this.toTag(new CompoundTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromTag(BlockState state, CompoundTag tag) {
|
||||
super.fromTag(state, tag);
|
||||
|
|
|
@ -2,6 +2,7 @@ package ru.betterend.blocks.entities;
|
|||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -22,6 +23,10 @@ public class PedestalBlockEntity extends BlockEntity implements Inventory, Ticka
|
|||
super(EndBlockEntities.PEDESTAL);
|
||||
}
|
||||
|
||||
public PedestalBlockEntity(BlockEntityType<?> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return this.age;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import ru.betterend.client.render.BeamRenderer;
|
|||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class PedestalItemRenderer extends BlockEntityRenderer<PedestalBlockEntity> {
|
||||
public class PedestalItemRenderer<T extends PedestalBlockEntity> extends BlockEntityRenderer<T> {
|
||||
private static final Identifier BEAM_TEXTURE = new Identifier("textures/entity/end_gateway_beam.png");
|
||||
|
||||
public PedestalItemRenderer(BlockEntityRenderDispatcher dispatcher) {
|
||||
|
@ -34,7 +34,7 @@ public class PedestalItemRenderer extends BlockEntityRenderer<PedestalBlockEntit
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(PedestalBlockEntity blockEntity, float tickDelta, MatrixStack matrices,
|
||||
public void render(T blockEntity, float tickDelta, MatrixStack matrices,
|
||||
VertexConsumerProvider vertexConsumers, int light, int overlay) {
|
||||
|
||||
if (blockEntity.isEmpty()) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue