Crystal colors fix
This commit is contained in:
parent
ef3b286103
commit
fc3b6ea5b2
2 changed files with 6 additions and 6 deletions
|
@ -44,7 +44,8 @@ public class EternalCrystalRenderer {
|
|||
matrices.popPose();
|
||||
}
|
||||
|
||||
public static float[] colors(float delta) {
|
||||
public static float[] colors(int age) {
|
||||
double delta = age * 0.01;
|
||||
int index = MHelper.floor(delta);
|
||||
int index2 = (index + 1) & 3;
|
||||
delta -= index;
|
||||
|
|
|
@ -30,15 +30,15 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(T blockEntity, float tickDelta, PoseStack matrices,
|
||||
MultiBufferSource vertexConsumers, int light, int overlay) {
|
||||
|
||||
public void render(T blockEntity, float tickDelta, PoseStack matrices, MultiBufferSource vertexConsumers, int light, int overlay) {
|
||||
Level world = blockEntity.getLevel();
|
||||
if (world == null || blockEntity.isEmpty()) return;
|
||||
|
||||
BlockState state = world.getBlockState(blockEntity.getBlockPos());
|
||||
if (!(state.getBlock() instanceof PedestalBlock)) return;
|
||||
|
||||
System.out.println(state.getBlock());
|
||||
|
||||
ItemStack activeItem = blockEntity.getItem(0);
|
||||
|
||||
matrices.pushPose();
|
||||
|
@ -47,8 +47,7 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
|
|||
BakedModel model = minecraft.getItemRenderer().getModel(activeItem, world, null, 0);
|
||||
Vector3f translate = model.getTransforms().ground.translation;
|
||||
PedestalBlock pedestal = (PedestalBlock) state.getBlock();
|
||||
matrices.translate(translate.x(), translate.y(), translate.z());
|
||||
matrices.translate(0.5, pedestal.getHeight(state), 0.5);
|
||||
matrices.translate(translate.x() + 0.5, translate.y() + pedestal.getHeight(state), translate.z() + 0.5);
|
||||
if (activeItem.getItem() instanceof BlockItem) {
|
||||
matrices.scale(1.5F, 1.5F, 1.5F);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue