Skip to content
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=1.2.4
# Branch Metadata
branch=26.1
branch=26.2
tagBranch=1.20
compatibleVersions=26.1
compatibleVersions=26.2
compatibleLoaders=fabric
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
10 changes: 5 additions & 5 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[versions]
loom = "1.15-SNAPSHOT"
loom = "1.17-SNAPSHOT"
githubRelease = "2.4.1"
minotaur = "2.+"
curse = "1.1.+"

kaleidoConfig = "0.3.3+1.3.2"

mc = "26.1"
fl = "0.18.4"
yarn = "26.1+build.1"
fapi = "0.144.3+26.1"
mc = "26.2"
fl = "0.19.3"
yarn = "26.2+build.1"
fapi = "0.153.0+26.2"

[plugins]
loom = { id = "net.fabricmc.fabric-loom-remap", version.ref = "loom" }
Expand Down
15 changes: 3 additions & 12 deletions src/main/java/folk/sisby/surveyor/SurveyorCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,7 @@
import org.apache.commons.lang3.text.WordUtils;
import org.jetbrains.annotations.Nullable;

import java.util.BitSet;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;

Expand Down Expand Up @@ -589,7 +580,7 @@ public static void registerCommands(CommandDispatcher<ServerCommandSource> dispa
.suggests((c, b) -> suggestLandmarks(c, b, true))
.then(CommandManager.literal("surveyor:color")
.then(CommandManager.argument("color", StringArgumentType.greedyString())
.suggests((c, s) -> CommandSource.suggestMatching(Formatting.getNames(true, false), s))
.suggests((c, s) -> CommandSource.suggestMatching(Arrays.stream(Formatting.values()).map(Formatting::name).toList(), s))
.executes(c -> execute(c, (s, p, e, f) -> {
try {
return appendColor(p, f, DimensionArgumentType.getDimensionArgument(c, "dim"), WorldLandmarks.GLOBAL, c.getArgument("id", Identifier.class), c.getArgument("color", String.class));
Expand Down Expand Up @@ -756,7 +747,7 @@ public static void registerCommands(CommandDispatcher<ServerCommandSource> dispa
.suggests((c, b) -> suggestLandmarks(c, b, true))
.then(CommandManager.literal("surveyor:color")
.then(CommandManager.argument("color", StringArgumentType.greedyString())
.suggests((c, s) -> CommandSource.suggestMatching(Formatting.getNames(true, false), s))
.suggests((c, s) -> CommandSource.suggestMatching(Arrays.stream(Formatting.values()).map(Formatting::name), s))
.then(CommandManager.argument("dim", DimensionArgumentType.dimension())
.then(CommandManager.argument("owner", UuidArgumentType.uuid())
.suggests(SurveyorCommands::suggestOwners)
Expand Down
38 changes: 19 additions & 19 deletions src/main/java/folk/sisby/surveyor/SurveyorMapIntegration.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,30 @@ public class SurveyorMapIntegration {
public static final Map<RegistryEntry<MapDecorationType>, Item> VANILLA_ICON_STACKS = Map.ofEntries(
Map.entry(MapDecorationTypes.PLAYER, Items.PLAYER_HEAD),
Map.entry(MapDecorationTypes.FRAME, Items.ITEM_FRAME),
Map.entry(MapDecorationTypes.RED_MARKER, Items.RED_DYE),
Map.entry(MapDecorationTypes.BLUE_MARKER, Items.BLUE_DYE),
Map.entry(MapDecorationTypes.RED_MARKER, Items.DYES.red()),
Map.entry(MapDecorationTypes.BLUE_MARKER, Items.DYES.blue()),
Map.entry(MapDecorationTypes.TARGET_X, Items.NETHER_STAR),
Map.entry(MapDecorationTypes.TARGET_POINT, Items.REDSTONE),
Map.entry(MapDecorationTypes.TARGET_POINT, Blocks.REDSTONE_WIRE.asItem()),
Map.entry(MapDecorationTypes.PLAYER_OFF_MAP, Items.PLAYER_HEAD),
Map.entry(MapDecorationTypes.PLAYER_OFF_LIMITS, Items.PLAYER_HEAD),
Map.entry(MapDecorationTypes.MANSION, Items.TOTEM_OF_UNDYING),
Map.entry(MapDecorationTypes.MONUMENT, Items.TRIDENT),
Map.entry(MapDecorationTypes.BANNER_WHITE, Items.WHITE_BANNER),
Map.entry(MapDecorationTypes.BANNER_ORANGE, Items.ORANGE_BANNER),
Map.entry(MapDecorationTypes.BANNER_MAGENTA, Items.MAGENTA_BANNER),
Map.entry(MapDecorationTypes.BANNER_LIGHT_BLUE, Items.LIGHT_BLUE_BANNER),
Map.entry(MapDecorationTypes.BANNER_YELLOW, Items.YELLOW_BANNER),
Map.entry(MapDecorationTypes.BANNER_LIME, Items.LIME_BANNER),
Map.entry(MapDecorationTypes.BANNER_PINK, Items.PINK_BANNER),
Map.entry(MapDecorationTypes.BANNER_GRAY, Items.GRAY_BANNER),
Map.entry(MapDecorationTypes.BANNER_LIGHT_GRAY, Items.LIGHT_GRAY_BANNER),
Map.entry(MapDecorationTypes.BANNER_CYAN, Items.CYAN_BANNER),
Map.entry(MapDecorationTypes.BANNER_PURPLE, Items.PURPLE_BANNER),
Map.entry(MapDecorationTypes.BANNER_BLUE, Items.BLUE_BANNER),
Map.entry(MapDecorationTypes.BANNER_BROWN, Items.BROWN_BANNER),
Map.entry(MapDecorationTypes.BANNER_GREEN, Items.GREEN_BANNER),
Map.entry(MapDecorationTypes.BANNER_RED, Items.RED_BANNER),
Map.entry(MapDecorationTypes.BANNER_BLACK, Items.BLACK_BANNER),
Map.entry(MapDecorationTypes.BANNER_WHITE, Items.BANNERS.white()),
Map.entry(MapDecorationTypes.BANNER_ORANGE, Items.BANNERS.orange()),
Map.entry(MapDecorationTypes.BANNER_MAGENTA, Items.BANNERS.magenta()),
Map.entry(MapDecorationTypes.BANNER_LIGHT_BLUE, Items.BANNERS.lightBlue()),
Map.entry(MapDecorationTypes.BANNER_YELLOW, Items.BANNERS.yellow()),
Map.entry(MapDecorationTypes.BANNER_LIME, Items.BANNERS.lime()),
Map.entry(MapDecorationTypes.BANNER_PINK, Items.BANNERS.pink()),
Map.entry(MapDecorationTypes.BANNER_GRAY, Items.BANNERS.gray()),
Map.entry(MapDecorationTypes.BANNER_LIGHT_GRAY, Items.BANNERS.lightGray()),
Map.entry(MapDecorationTypes.BANNER_CYAN, Items.BANNERS.cyan()),
Map.entry(MapDecorationTypes.BANNER_PURPLE, Items.BANNERS.purple()),
Map.entry(MapDecorationTypes.BANNER_BLUE, Items.BANNERS.blue()),
Map.entry(MapDecorationTypes.BANNER_BROWN, Items.BANNERS.brown()),
Map.entry(MapDecorationTypes.BANNER_GREEN, Items.BANNERS.green()),
Map.entry(MapDecorationTypes.BANNER_RED, Items.BANNERS.red()),
Map.entry(MapDecorationTypes.BANNER_BLACK, Items.BANNERS.black()),
Map.entry(MapDecorationTypes.RED_X, Items.CHEST),
Map.entry(MapDecorationTypes.VILLAGE_DESERT, Items.SANDSTONE),
Map.entry(MapDecorationTypes.VILLAGE_PLAINS, Items.OAK_LOG),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public void onInitializeClient() {
if (!MinecraftClient.getInstance().isInSingleplayer()) WorldTerrain.onChunkUnload(world, chunk);
});
ClientTickEvents.END_LEVEL_TICK.register((world -> {
if (MinecraftClient.getInstance().worldRenderer.getCompletedChunkCount() <= 10 || !MinecraftClient.getInstance().worldRenderer.isTerrainRenderComplete()) return;
if (MinecraftClient.getInstance().worldExtractor.getRenderedSectionCount() <= 10 || !MinecraftClient.getInstance().worldRenderer.isTerrainRenderComplete()) return;
for (WorldChunk chunk : new HashSet<>(LOADING_CHUNKS.get(world.getRegistryKey()))) {
WorldTerrain.onChunkLoad(world, chunk, false);
ClientSummary.of(MinecraftClient.getInstance().getNetworkHandler()).personal.addChunk(world.getRegistryKey(), chunk.getPos(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import net.minecraft.command.permission.PermissionPredicate;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.Text;
import net.minecraft.text.TextColor;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
Expand Down Expand Up @@ -57,7 +58,7 @@ private static int getLandmarks(WorldSummary summary, SurveyorExploration explor
.append(Text.literal(landmark.id().getPath()))
.append(!landmark.components().contains(LandmarkComponentTypes.NAME) ? Text.of("") :
Text.literal(": \"")
.append(landmark.components().get(LandmarkComponentTypes.NAME).copy().styled(s -> s.withColor(landmark.components().contains(LandmarkComponentTypes.COLOR) ? 0xFFFFFF & landmark.components().get(LandmarkComponentTypes.COLOR) : Formatting.GREEN.getColorValue())))
.append(landmark.components().get(LandmarkComponentTypes.NAME).copy().styled(s -> s.withColor(landmark.components().contains(LandmarkComponentTypes.COLOR) ? 0xFFFFFF & landmark.components().get(LandmarkComponentTypes.COLOR) : TextColor.GREEN.getRgb())))
.append(Text.literal("\""))
)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package folk.sisby.surveyor.packet;

import com.mojang.datafixers.util.Pair;
import folk.sisby.surveyor.Surveyor;
import folk.sisby.surveyor.terrain.ChunkSummary;
import folk.sisby.surveyor.terrain.RegionSummary;
Expand All @@ -14,7 +15,6 @@
import net.minecraft.registry.DynamicRegistryManager;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Pair;
import net.minecraft.util.dynamic.Codecs;
import net.minecraft.world.World;

Expand All @@ -26,16 +26,16 @@ public record S2CUpdateRegionPacket(RegistryKey<World> dimension, boolean shared
public static final Id<S2CUpdateRegionPacket> ID = new Id<>(Surveyor.id("s2c_update_region"));
public static final PacketCodec<RegistryByteBuf, S2CUpdateRegionPacket> CODEC = PacketCodec.tuple(
PacketCodec.tuple(
RegistryKey.createPacketCodec(RegistryKeys.WORLD), Pair<RegistryKey<World>, Boolean>::getLeft,
PacketCodecs.BOOLEAN, Pair<RegistryKey<World>, Boolean>::getRight,
RegistryKey.createPacketCodec(RegistryKeys.WORLD), Pair<RegistryKey<World>, Boolean>::getFirst,
PacketCodecs.BOOLEAN, Pair<RegistryKey<World>, Boolean>::getSecond,
Pair::new
), p -> new Pair<>(p.dimension(), p.shared()),
RegionPos.PACKET_CODEC, S2CUpdateRegionPacket::regionPos,
PacketCodecs.INTEGER.collect(PacketCodecs.toList()), S2CUpdateRegionPacket::biomePalette,
PacketCodecs.INTEGER.collect(PacketCodecs.toList()), S2CUpdateRegionPacket::blockPalette,
PacketCodecs.codec(Codecs.BIT_SET), S2CUpdateRegionPacket::set,
PacketCodec.of(ChunkSummary::writeBuf, ChunkSummary::new).collect(PacketCodecs.toList()), S2CUpdateRegionPacket::chunks,
(pair, rp, bi, bl, s, c) -> new S2CUpdateRegionPacket(pair.getLeft(), pair.getRight(), rp, bi, bl, s, c)
(pair, rp, bi, bl, s, c) -> new S2CUpdateRegionPacket(pair.getFirst(), pair.getSecond(), rp, bi, bl, s, c)
);

public static S2CUpdateRegionPacket of(RegistryKey<World> dimension, boolean shared, RegionPos regionPos, RegionSummary summary, BitSet keys) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import net.minecraft.structure.pool.StructurePool;
import net.minecraft.structure.pool.StructurePoolElement;
import net.minecraft.structure.pool.StructurePoolElementType;
import net.minecraft.util.BlockRotation;
import net.minecraft.util.math.BlockRotation;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockBox;
import net.minecraft.util.math.BlockPos;
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 @@ -45,7 +45,7 @@ public static HitResult playerViewRaycast(ServerPlayerEntity player, int renderD
WorldChunk chunk = player.getEntityWorld().getChunkManager().getWorldChunk(ChunkSectionPos.getSectionCoord(pos.getX()), ChunkSectionPos.getSectionCoord(pos.getZ()));
if (chunk == null) {
Vec3d vec3d = innerContext.getStart().subtract(innerContext.getEnd());
return BlockHitResult.createMissed(pos.toCenterPos(), Direction.getFacing(vec3d.x, vec3d.y, vec3d.z), pos);
return BlockHitResult.createMissed(Vec3d.ofCenter(pos), Direction.getFacing(vec3d.x, vec3d.y, vec3d.z), pos);
}
BlockState blockState = chunk.getBlockState(pos);
FluidState fluidState = blockState.getFluidState();
Expand Down