Skip to content

Commit

Permalink
#bugFixed: 修复了能量节点(PowerNode)的渲染问题
Browse files Browse the repository at this point in the history
  • Loading branch information
HeChuQIU committed Dec 10, 2023
1 parent a9cdeac commit 08dd991
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ public void render(PowerNodeBlockEntity pBlockEntity, float pPartialTick, PoseSt

@Override
public boolean shouldRenderOffScreen(PowerNodeBlockEntity pBlockEntity) {
return true;
return true;
}

@Override
public int getViewDistance() {
return 64;
return 256;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.phys.AABB;
import org.slf4j.Logger;

import java.util.List;
Expand Down Expand Up @@ -75,6 +76,18 @@ public List<PowerNodeBeamSection> getBeamSections() {
return (List<PowerNodeBeamSection>) this.beamSections;
}

/**
* Return an {@link AABB} that controls the visible scope of a {@link BlockEntityWithoutLevelRenderer} associated with this {@link BlockEntity}
* Defaults to the collision bounding box {@link BlockState#getCollisionShape(BlockGetter, BlockPos)} associated with the block
* at this location.
*
* @return an appropriately size {@link AABB} for the {@link BlockEntity}
*/
@Override
public AABB getRenderBoundingBox() {
return INFINITE_EXTENT_AABB;
}

public static class PowerNodeBeamSection {
private int height;

Expand Down

0 comments on commit 08dd991

Please sign in to comment.