Public Access
This commit is contained in:
1 parent
a9390c3e4c
commit
0de817b28a
3 files changed
+17
-2
No files matched your search
@@ -162,6 +162,9 @@ while Linking Books continue to permit passable floorless destinations.
|
||||
Version 0.2.4 expands Descriptive Book arrival validation with an outward,
|
||||
terrain-aware search for an alternate grounded location near an unsafe target.
|
||||
|
||||
Version 0.2.5 uses dimension-appropriate preview skies for vanilla Nether and
|
||||
End destinations instead of their inherited Overworld biome sky tint.
|
||||
|
||||
The preview code is separated behind a renderer interface and uses an isolated
|
||||
Ponder level populated from server-authoritative destination snapshots.
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ mod_name=Rivencraft
|
||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=LGPL-3.0-or-later
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=0.2.4
|
||||
mod_version=0.2.5
|
||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||
# This should match the base package used for the mod sources.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent;
|
||||
import net.neoforged.neoforge.network.handling.IPayloadContext;
|
||||
@@ -160,10 +161,21 @@ public final class ModNetworking {
|
||||
pos.subtract(origin).offset(negativeRadius, negativeRadius, negativeRadius), state));
|
||||
}
|
||||
}
|
||||
int skyColor = level.getBiome(origin).value().getSkyColor();
|
||||
int skyColor = previewSkyColor(level, origin);
|
||||
PacketDistributor.sendToPlayer(player, new LinkPreviewPayload(skyColor, List.copyOf(blocks)));
|
||||
}
|
||||
|
||||
/** Vanilla Nether and End renderers do not use their biomes' blue Overworld sky tint. */
|
||||
private static int previewSkyColor(ServerLevel level, BlockPos origin) {
|
||||
if (level.dimension().equals(Level.NETHER)) {
|
||||
return 0xFF6B2725;
|
||||
}
|
||||
if (level.dimension().equals(Level.END)) {
|
||||
return 0xFF211835;
|
||||
}
|
||||
return level.getBiome(origin).value().getSkyColor();
|
||||
}
|
||||
|
||||
private static InteractionHand hand(boolean offhand) {
|
||||
return offhand ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user