Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3;
import org.apache.commons.math3.geometry.euclidean.twod.Line;
Expand Down Expand Up @@ -93,7 +94,7 @@ private static void onParticle(ClientboundLevelParticlesPacket packet) {
case ParticleType<?> type when ParticleTypes.CRIT.equals(type) || ParticleTypes.ENCHANT.equals(type) -> handleBurrowParticle(packet);
case ParticleType<?> type when ParticleTypes.DUST.equals(type) -> handleNextBurrowParticle(packet);
case ParticleType<?> type when ParticleTypes.DRIPPING_LAVA.equals(type) && packet.getCount() == 2 -> handleEchoBurrowParticle(packet);
case null, default -> {}
default -> {}
}
}
}
Expand All @@ -119,7 +120,13 @@ private static void handleBurrowParticle(ClientboundLevelParticlesPacket packet)
*/
private static void handleNextBurrowParticle(ClientboundLevelParticlesPacket packet) {
BlockPos pos = BlockPos.containing(packet.getX(), packet.getY(), packet.getZ());
GriffinBurrow burrow = griffinBurrows.get(pos.below(2));
BlockPos burrowPos;
if (Minecraft.getInstance().level != null) {
burrowPos = Minecraft.getInstance().level.getHeightmapPos(Heightmap.Types.WORLD_SURFACE, pos);
} else {
burrowPos = pos.below(2);
}
GriffinBurrow burrow = griffinBurrows.get(burrowPos);
if (burrow == null) {
return;
}
Expand Down Expand Up @@ -150,6 +157,8 @@ private static void handleEchoBurrowParticle(ClientboundLevelParticlesPacket pac
if (System.currentTimeMillis() > lastEchoTime + 10_000) {
return;
}
if (Minecraft.getInstance().level != null && !Minecraft.getInstance().level.getBlockState(BlockPos.containing(packet.getX(), packet.getY() - 0.25, packet.getZ())).isAir()) return;

if (previousBurrow.echoBurrowDirection == null) {
previousBurrow.echoBurrowDirection = new Vec3[2];
}
Expand Down Expand Up @@ -287,12 +296,12 @@ private static class GriffinBurrow extends Waypoint {
*/
private TriState confirmed = TriState.FALSE;
private final SimpleRegression regression = new SimpleRegression();
private @Nullable Vec3[] nextBurrowLine;
private Vec3 @Nullable[] nextBurrowLine;
/**
* The positions of the last two echo burrow particles.
*/
private @Nullable Vec3[] echoBurrowDirection;
private @Nullable Vec3[] echoBurrowLine;
private @Nullable Vec3 @Nullable[] echoBurrowDirection;
private Vec3 @Nullable[] echoBurrowLine;
private @Nullable BlockPos nextBurrowEstimatedPos;
/**
* The line in the direction of the next burrow estimated by the previous burrow particles.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public class SkyblockerRenderPipelines {
public static void init() {
Renderer.excludePipelineFromBatching(CYLINDER);
Renderer.excludePipelineFromBatching(CIRCLE);
Renderer.excludePipelineFromBatching(LINES_THROUGH_WALLS);
Renderer.excludePipelineFromBatching(RenderPipelines.LINES);
IrisCompatibility.assignPipelines();
}
}
Loading