Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving target: upcoming version #61

Open
wants to merge 4 commits into
base: 1.22
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ license=LGPL-3.0-or-later
# Mod Version
baseVersion=0.6.25
# Branch Metadata
branch=1.21
branch=1.22
tagBranch=1.20
lumiscosity marked this conversation as resolved.
Show resolved Hide resolved
compatibleVersions=1.21, 1.21.1
compatibleVersions=1.21.2, 1.21.3, 1.21.4
compatibleLoaders=fabric, quilt, neoforge
8 changes: 4 additions & 4 deletions libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ minotaur = "2.+"

kaleidoConfig = "0.3.1+1.3.2"

mc = "1.21.1"
fl = "0.15.11"
yarn = "1.21.1+build.3"
fapi = "0.104.0+1.21.1"
mc = "25w02a"
fl = "0.16.10"
yarn = "25w02a+build.5"
fapi = "0.114.2+1.21.4"

[plugins]
loom = { id = "fabric-loom", version.ref = "loom" }
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/folk/sisby/surveyor/Surveyor.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static void checkStructureExploration(ServerWorld world, ServerPlayerEnti
if (!world.isChunkLoaded(pos.getX() >> 4, pos.getZ() >> 4)) return;
WorldStructureSummary worldStructures = WorldSummary.of(world).structures();
if (worldStructures == null) return;
Registry<Structure> structureRegistry = world.getRegistryManager().get(RegistryKeys.STRUCTURE);
Registry<Structure> structureRegistry = world.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE);
SurveyorExploration exploration = SurveyorExploration.of(player);
Map<Structure, LongSet> structureReferences = world.getChunk(pos.getX() >> 4, pos.getZ() >> 4, ChunkStatus.STRUCTURE_REFERENCES).getStructureReferences();
if (!structureReferences.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
import folk.sisby.surveyor.Surveyor;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.registry.RegistryKey;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.gen.structure.Structure;

public record C2SKnownStructuresPacket(Multimap<RegistryKey<Structure>, ChunkPos> structureKeys) implements C2SPacket {
public static final CustomPayload.Id<C2SKnownStructuresPacket> ID = new CustomPayload.Id<>(Identifier.of(Surveyor.ID, "c2s_known_structures"));
public static final Id<C2SKnownStructuresPacket> ID = new Id<>(Identifier.of(Surveyor.ID, "c2s_known_structures"));
public static final PacketCodec<PacketByteBuf, C2SKnownStructuresPacket> CODEC = SurveyorPacketCodecs.STRUCTURE_KEYS.xmap(C2SKnownStructuresPacket::new, C2SKnownStructuresPacket::structureKeys);

@Override
public CustomPayload.Id<C2SKnownStructuresPacket> getId() {
public Id<C2SKnownStructuresPacket> getId() {
return ID;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
import folk.sisby.surveyor.Surveyor;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.ChunkPos;

import java.util.BitSet;
import java.util.Map;

public record C2SKnownTerrainPacket(Map<ChunkPos, BitSet> regionBits) implements C2SPacket {
public static final CustomPayload.Id<C2SKnownTerrainPacket> ID = new CustomPayload.Id<>(Identifier.of(Surveyor.ID, "known_terrain"));
public static final Id<C2SKnownTerrainPacket> ID = new Id<>(Identifier.of(Surveyor.ID, "known_terrain"));
public static final PacketCodec<PacketByteBuf, C2SKnownTerrainPacket> CODEC = SurveyorPacketCodecs.TERRAIN_KEYS.xmap(C2SKnownTerrainPacket::new, C2SKnownTerrainPacket::regionBits);

@Override
public CustomPayload.Id<C2SKnownTerrainPacket> getId() {
public Id<C2SKnownTerrainPacket> getId() {
return ID;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import it.unimi.dsi.fastutil.longs.LongSet;
import net.minecraft.network.RegistryByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.registry.RegistryKey;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.ChunkPos;
Expand All @@ -16,7 +15,7 @@
import java.util.UUID;

public record S2CGroupChangedPacket(Map<UUID, PlayerSummary> players, Map<ChunkPos, BitSet> regionBits, Map<RegistryKey<Structure>, LongSet> structureKeys) implements S2CPacket {
public static final CustomPayload.Id<S2CGroupChangedPacket> ID = new CustomPayload.Id<>(Identifier.of(Surveyor.ID, "s2c_group_changed"));
public static final Id<S2CGroupChangedPacket> ID = new Id<>(Identifier.of(Surveyor.ID, "s2c_group_changed"));
public static final PacketCodec<RegistryByteBuf, S2CGroupChangedPacket> CODEC = PacketCodec.tuple(
SurveyorPacketCodecs.GROUP_SUMMARIES, S2CGroupChangedPacket::players,
SurveyorPacketCodecs.TERRAIN_KEYS, S2CGroupChangedPacket::regionBits,
Expand All @@ -25,7 +24,7 @@ public record S2CGroupChangedPacket(Map<UUID, PlayerSummary> players, Map<ChunkP
);

@Override
public CustomPayload.Id<S2CGroupChangedPacket> getId() {
public Id<S2CGroupChangedPacket> getId() {
return ID;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
import folk.sisby.surveyor.Surveyor;
import net.minecraft.network.RegistryByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.util.Identifier;

import java.util.Map;
import java.util.UUID;

public record S2CGroupUpdatedPacket(Map<UUID, PlayerSummary> players) implements S2CPacket {
public static final CustomPayload.Id<S2CGroupUpdatedPacket> ID = new CustomPayload.Id<>(Identifier.of(Surveyor.ID, "s2c_group_updated"));
public static final Id<S2CGroupUpdatedPacket> ID = new Id<>(Identifier.of(Surveyor.ID, "s2c_group_updated"));
public static final PacketCodec<RegistryByteBuf, S2CGroupUpdatedPacket> CODEC = SurveyorPacketCodecs.GROUP_SUMMARIES.xmap(S2CGroupUpdatedPacket::new, S2CGroupUpdatedPacket::players);

public static S2CGroupUpdatedPacket of(UUID uuid, PlayerSummary summary) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.codec.PacketCodecs;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.Identifier;
Expand All @@ -23,9 +22,9 @@
import java.util.Map;

public record S2CStructuresAddedPacket(boolean shared, Map<RegistryKey<Structure>, Map<ChunkPos, StructureStartSummary>> structures, Map<RegistryKey<Structure>, RegistryKey<StructureType<?>>> types, Multimap<RegistryKey<Structure>, TagKey<Structure>> tags) implements S2CPacket {
public static final CustomPayload.Id<S2CStructuresAddedPacket> ID = new CustomPayload.Id<>(Identifier.of(Surveyor.ID, "s2c_structures_added"));
public static final Id<S2CStructuresAddedPacket> ID = new Id<>(Identifier.of(Surveyor.ID, "s2c_structures_added"));
public static final PacketCodec<PacketByteBuf, S2CStructuresAddedPacket> CODEC = PacketCodec.tuple(
PacketCodecs.BOOL, S2CStructuresAddedPacket::shared,
PacketCodecs.BOOLEAN, S2CStructuresAddedPacket::shared,
SurveyorPacketCodecs.STRUCTURE_SUMMARIES, S2CStructuresAddedPacket::structures,
SurveyorPacketCodecs.STRUCTURE_TYPES, S2CStructuresAddedPacket::types,
SurveyorPacketCodecs.STRUCTURE_TAGS, S2CStructuresAddedPacket::tags,
Expand Down Expand Up @@ -69,7 +68,7 @@ public List<SurveyorPacket> toPayloads() {
}

@Override
public CustomPayload.Id<S2CStructuresAddedPacket> getId() {
public Id<S2CStructuresAddedPacket> getId() {
return ID;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.codec.PacketCodecs;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.util.Identifier;
import net.minecraft.util.dynamic.Codecs;
import net.minecraft.util.math.ChunkPos;
Expand All @@ -19,9 +18,9 @@
import java.util.List;

public record S2CUpdateRegionPacket(boolean shared, ChunkPos regionPos, List<Integer> biomePalette, List<Integer> blockPalette, BitSet set, List<ChunkSummary> chunks) implements S2CPacket {
public static final CustomPayload.Id<S2CUpdateRegionPacket> ID = new CustomPayload.Id<>(Identifier.of(Surveyor.ID, "s2c_update_region"));
public static final Id<S2CUpdateRegionPacket> ID = new Id<>(Identifier.of(Surveyor.ID, "s2c_update_region"));
public static final PacketCodec<PacketByteBuf, S2CUpdateRegionPacket> CODEC = PacketCodec.tuple(
PacketCodecs.BOOL, S2CUpdateRegionPacket::shared,
PacketCodecs.BOOLEAN, S2CUpdateRegionPacket::shared,
PacketCodecs.VAR_LONG.xmap(ChunkPos::new, ChunkPos::toLong), S2CUpdateRegionPacket::regionPos,
PacketCodecs.INTEGER.collect(PacketCodecs.toList()), S2CUpdateRegionPacket::biomePalette,
PacketCodecs.INTEGER.collect(PacketCodecs.toList()), S2CUpdateRegionPacket::blockPalette,
Expand Down Expand Up @@ -55,7 +54,7 @@ public List<SurveyorPacket> toPayloads() {
}

@Override
public CustomPayload.Id<S2CUpdateRegionPacket> getId() {
public Id<S2CUpdateRegionPacket> getId() {
return ID;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import io.netty.buffer.Unpooled;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;

Expand All @@ -20,7 +19,7 @@
import java.util.Map;

public record SyncLandmarksAddedPacket(Map<LandmarkType<?>, Map<BlockPos, Landmark<?>>> landmarks) implements SyncPacket {
public static final CustomPayload.Id<SyncLandmarksAddedPacket> ID = new CustomPayload.Id<>(Identifier.of(Surveyor.ID, "landmarks_added"));
public static final Id<SyncLandmarksAddedPacket> ID = new Id<>(Identifier.of(Surveyor.ID, "landmarks_added"));
public static final PacketCodec<ByteBuf, SyncLandmarksAddedPacket> CODEC = SurveyorPacketCodecs.LANDMARK_SUMMARIES.xmap(SyncLandmarksAddedPacket::new, SyncLandmarksAddedPacket::landmarks);

public static SyncLandmarksAddedPacket of(Multimap<LandmarkType<?>, BlockPos> keySet, WorldLandmarks summary) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.minecraft.network.RegistryByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.codec.PacketCodecs;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;

Expand All @@ -16,7 +15,7 @@
import java.util.Map;

public record SyncLandmarksRemovedPacket(Multimap<LandmarkType<?>, BlockPos> landmarks) implements SyncPacket {
public static final CustomPayload.Id<SyncLandmarksRemovedPacket> ID = new CustomPayload.Id<>(Identifier.of(Surveyor.ID, "landmarks_removed"));
public static final Id<SyncLandmarksRemovedPacket> ID = new Id<>(Identifier.of(Surveyor.ID, "landmarks_removed"));
public static final PacketCodec<RegistryByteBuf, SyncLandmarksRemovedPacket> CODEC = PacketCodecs.<RegistryByteBuf, LandmarkType<?>, List<BlockPos>, Map<LandmarkType<?>, List<BlockPos>>>map(HashMap::new, PacketCodecs.codec(LandmarkType.CODEC), BlockPos.PACKET_CODEC.collect(PacketCodecs.toList()))
.xmap(MapUtil::asMultiMap, MapUtil::asListMap)
.xmap(SyncLandmarksRemovedPacket::new, SyncLandmarksRemovedPacket::landmarks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected static RegionStructureSummary readNbt(NbtCompound nbt) {
}

public boolean contains(World world, StructureStart start) {
RegistryKey<Structure> key = world.getRegistryManager().get(RegistryKeys.STRUCTURE).getKey(start.getStructure()).orElse(null);
RegistryKey<Structure> key = world.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE).getKey(start.getStructure()).orElse(null);
if (key == null) {
Surveyor.LOGGER.error("Encountered an unregistered structure! {} | {}", start, start.getStructure());
return true;
Expand All @@ -103,7 +103,7 @@ public Multimap<RegistryKey<Structure>, ChunkPos> keySet() {
}

public void put(ServerWorld world, StructureStart start) {
RegistryKey<Structure> key = world.getRegistryManager().get(RegistryKeys.STRUCTURE).getKey(start.getStructure()).orElseThrow();
RegistryKey<Structure> key = world.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE).getKey(start.getStructure()).orElseThrow();
structures.computeIfAbsent(key, k -> new ConcurrentHashMap<>());
ChunkPos pos = start.getPos();
StructureStartSummary summary = summarisePieces(StructureContext.from(world), start);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public final NbtCompound toNbt() {
nbt.putString("id", typeKey.getValue().toString());
nbt.putIntArray("BB", ArrayUtil.ofBlockBox(this.boundingBox));
Direction direction = this.getFacing();
nbt.putInt("O", direction == null ? -1 : direction.getHorizontal());
nbt.putInt("O", direction == null ? -1 : direction.getHorizontalQuarterTurns());
nbt.putInt("GD", this.chainLength);
this.writeNbt(null, nbt); // context only used for writeNbt
return nbt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ public Multimap<RegistryKey<Structure>, ChunkPos> keySet(SurveyorExploration exp
public void put(ServerWorld world, StructureStart start) {
if (Surveyor.CONFIG.structures == SystemMode.FROZEN) return;
ChunkPos rPos = regionPosOf(start.getPos());
RegistryKey<Structure> key = world.getRegistryManager().get(RegistryKeys.STRUCTURE).getKey(start.getStructure()).orElseThrow();
Optional<RegistryKey<StructureType<?>>> type = world.getRegistryManager().get(RegistryKeys.STRUCTURE_TYPE).getKey(start.getStructure().getType());
RegistryKey<Structure> key = world.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE).getKey(start.getStructure()).orElseThrow();
Optional<RegistryKey<StructureType<?>>> type = world.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE_TYPE).getKey(start.getStructure().getType());
if (!start.hasChildren()) {
Surveyor.LOGGER.error("Cowardly refusing to save structure {} as it has no pieces! Report this to the structure mod author!", key.getValue());
return;
Expand All @@ -175,7 +175,7 @@ public void put(ServerWorld world, StructureStart start) {
return;
}
regions.computeIfAbsent(rPos, k -> new RegionStructureSummary()).put(world, start);
List<TagKey<Structure>> tags = world.getRegistryManager().get(RegistryKeys.STRUCTURE).getEntry(start.getStructure()).streamTags().toList();
List<TagKey<Structure>> tags = world.getRegistryManager().getOrThrow(RegistryKeys.STRUCTURE).getEntry(start.getStructure()).streamTags().toList();
structureTypes.put(key, type.orElseThrow());
structureTags.putAll(key, tags);
dirty();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/folk/sisby/surveyor/terrain/ChunkSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public ChunkSummary(World world, WorldChunk chunk, int[] layerHeights, RegistryP
BlockState state = section.getBlockState(x, y, z);
Fluid fluid = state.getFluidState().getFluid();

if (!state.blocksMovement() && fluid.matchesType(Fluids.EMPTY)) {
if (!state.isSolidBlock(world, pos) && fluid.matchesType(Fluids.EMPTY)) {
walkspaceHeight++;
waterDepth = 0;
if (walkspaceHeight >= MINIMUM_AIR_DEPTH && state.getMapColor(world, pos) != MapColor.CLEAR) {
Expand All @@ -76,7 +76,7 @@ public ChunkSummary(World world, WorldChunk chunk, int[] layerHeights, RegistryP
} else { // Blocks Movement or Has Non-Water Fluid.
if (foundFloor == null) {
if (carpetPos.getY() == y + 1) {
foundFloor = new LayerSummary.FloorSummary(carpetPos.getY(), biomePalette.findOrAdd(section.getBiomeEntry(x, carpetPos.getY(), z, world.getBottomY(), world.getTopY()).value()), blockPalette.findOrAdd(carpetBlock), world.getLightLevel(LightType.BLOCK, carpetPos), waterDepth, waterDepth == 0 ? 0 : world.getLightLevel(LightType.BLOCK, pos.up().up(waterDepth)));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for completeness, it's always good to confirm a surveyor update with a hoofprint update as well, just because atlas hides a lot of detail that could become wrong when touching the scanner. I think you're fine here because these are just renames, i can only assume the impl is the same.

Copy link
Author

@lumiscosity lumiscosity Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just got an initial port going but i'm encountering the same rendering issues as in aa4. though considering the fact that hoofprint has way less parts i think i could reasonably try to figure it out, and maybe the solution will work for both

foundFloor = new LayerSummary.FloorSummary(carpetPos.getY(), biomePalette.findOrAdd(section.getBiomeEntry(x, carpetPos.getY(), z, world.getBottomY(), world.getTopYInclusive()).value()), blockPalette.findOrAdd(carpetBlock), world.getLightLevel(LightType.BLOCK, carpetPos), waterDepth, waterDepth == 0 ? 0 : world.getLightLevel(LightType.BLOCK, pos.up().up(waterDepth)));
if (carpetPos.getY() > layerHeights[layerIndex]) { // Actually a floor for the layer above
if (layerFloors[layerIndex - 1][x * 16 + z] == null) layerFloors[layerIndex - 1][x * 16 + z] = foundFloor;
foundFloor = null;
Expand All @@ -85,7 +85,7 @@ public ChunkSummary(World world, WorldChunk chunk, int[] layerHeights, RegistryP
walkspaceHeight = 0;
waterDepth = 0;
} else if (walkspaceHeight >= MINIMUM_AIR_DEPTH && state.getMapColor(world, pos) != MapColor.CLEAR) {
foundFloor = new LayerSummary.FloorSummary(y, biomePalette.findOrAdd(section.getBiomeEntry(x, y, z, world.getBottomY(), world.getTopY()).value()), blockPalette.findOrAdd(state.getBlock()), world.getLightLevel(LightType.BLOCK, pos.up()), waterDepth, waterDepth == 0 ? 0 : world.getLightLevel(LightType.BLOCK, pos.up().up(waterDepth)));
foundFloor = new LayerSummary.FloorSummary(y, biomePalette.findOrAdd(section.getBiomeEntry(x, y, z, world.getBottomY(), world.getTopYInclusive()).value()), blockPalette.findOrAdd(state.getBlock()), world.getLightLevel(LightType.BLOCK, pos.up()), waterDepth, waterDepth == 0 ? 0 : world.getLightLevel(LightType.BLOCK, pos.up().up(waterDepth)));
}
}
if (state.getMapColor(world, pos) != MapColor.CLEAR) { // Don't reset walkspace for glass/barriers/etc.
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/folk/sisby/surveyor/terrain/RegionSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class RegionSummary {
protected boolean dirty = false;

public RegionSummary(DynamicRegistryManager manager) {
biomePalette = new RegistryPalette<>(manager.get(RegistryKeys.BIOME));
blockPalette = new RegistryPalette<>(manager.get(RegistryKeys.BLOCK));
biomePalette = new RegistryPalette<>(manager.getOrThrow(RegistryKeys.BIOME));
blockPalette = new RegistryPalette<>(manager.getOrThrow(RegistryKeys.BLOCK));
}

public static <T, O> List<O> mapIterable(Iterable<T> palette, Function<T, O> mapper) {
Expand Down Expand Up @@ -93,8 +93,8 @@ public static ChunkPos chunkForBit(ChunkPos rPos, int i) {

public static RegionSummary readNbt(NbtCompound nbt, DynamicRegistryManager manager, ChunkPos pos) {
RegionSummary summary = new RegionSummary(manager);
Registry<Biome> biomeRegistry = manager.get(RegistryKeys.BIOME);
Registry<Block> blockRegistry = manager.get(RegistryKeys.BLOCK);
Registry<Biome> biomeRegistry = manager.getOrThrow(RegistryKeys.BIOME);
Registry<Block> blockRegistry = manager.getOrThrow(RegistryKeys.BLOCK);
NbtList biomeList = nbt.getList(KEY_BIOMES, NbtElement.STRING_TYPE);
Map<Integer, Integer> biomeRemap = new Int2IntArrayMap(biomeList.size());
for (int i = 0; i < biomeList.size(); i++) {
Expand Down Expand Up @@ -157,8 +157,8 @@ public void putChunk(World world, WorldChunk chunk) {
}

public NbtCompound writeNbt(DynamicRegistryManager manager, NbtCompound nbt, ChunkPos regionPos) {
Registry<Biome> biomeRegistry = manager.get(RegistryKeys.BIOME);
Registry<Block> blockRegistry = manager.get(RegistryKeys.BLOCK);
Registry<Biome> biomeRegistry = manager.getOrThrow(RegistryKeys.BIOME);
Registry<Block> blockRegistry = manager.getOrThrow(RegistryKeys.BLOCK);
nbt.put(KEY_BIOMES, new NbtList(mapIterable(biomePalette.view(), b -> NbtString.of(biomeRegistry.getId(b).toString())), NbtElement.STRING_TYPE));
nbt.put(KEY_BLOCKS, new NbtList(mapIterable(blockPalette.view(), b -> NbtString.of(blockRegistry.getId(b).toString())), NbtElement.STRING_TYPE));
nbt.putIntArray(KEY_BIOME_WATER, mapIterable(biomePalette.view(), Biome::getWaterColor));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/folk/sisby/surveyor/util/RaycastUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static HitResult playerViewRaycast(ServerPlayerEntity player, int renderD
double y = blockRadius * Math.tan(phi);
double distance;
double bottom = player.getWorld().getBottomY() - cameraPos.y;
double top = player.getWorld().getTopY() - cameraPos.y;
double top = player.getWorld().getTopYInclusive() - cameraPos.y;
if (y < bottom || y > top) { // Distance To Circular Planes
distance = Math.abs(MathHelper.clamp(y, bottom, top) / Math.sin(phi));
} else { // Distance To Curved Surface
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ logoFile = "assets/${modId}/icon.png"
[properties]
"connector:placeholder" = true

[[dependencies.${ modId }]]
[[dependencies."${ modId }"]]
modId = "connector"
type = "required"
versionRange = "*"
ordering = "NONE"
side = "BOTH"

[[dependencies.${ modId }]]
[[dependencies."${ modId }"]]
modId = "neoforge"
type = "required"
versionRange = "*"
ordering = "NONE"
side = "BOTH"

[[dependencies.${ modId }]]
[[dependencies."${ modId }"]]
modId = "minecraft"
type = "required"
versionRange = "[${mc},)"
ordering = "NONE"
side = "BOTH"

[[dependencies.${ modId }]]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why's this a thing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i responded to the comment on the initial issue about this, i initially kept this tweak because that's how the default neoforge mod template does it, and intellij idea throws a warning if the spaces are present.

since it works fine anyways, rolled back the change for now.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll put it in 1.21 instead and merge it over!

[[dependencies."${ modId }"]]
modId = "fabric_api"
type = "required"
versionRange = "[${fapi},)"
Expand Down
Loading