Public Access
This commit is contained in:
1 parent
16208c02a4
commit
00ed05e51a
6 files changed
+80
-7
No files matched your search
@@ -301,6 +301,11 @@ Version 0.2.16.6 makes Linking and Descriptive Book screens non-pausing. The
|
|||||||
integrated server now continues ticking in single-player while a book is open,
|
integrated server now continues ticking in single-player while a book is open,
|
||||||
allowing live preview chunks to generate and stream into the snapshot.
|
allowing live preview chunks to generate and stream into the snapshot.
|
||||||
|
|
||||||
|
Version 0.2.16.7 handles configured movement bindings directly in both book
|
||||||
|
screens while Explore mode is active. Movement, jump, and sneak now move the
|
||||||
|
remote camera even though Minecraft suspends normal gameplay key states while
|
||||||
|
a GUI is open.
|
||||||
|
|
||||||
The preview code is separated behind a renderer interface and uses an isolated
|
The preview code is separated behind a renderer interface and uses an isolated
|
||||||
Ponder level populated from server-authoritative destination snapshots.
|
Ponder level populated from server-authoritative destination snapshots.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ mod_name=Rivencraft
|
|||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# 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
|
mod_license=LGPL-3.0-or-later
|
||||||
# The mod version. Rivencraft uses the x.y.z.b policy documented in README.md.
|
# The mod version. Rivencraft uses the x.y.z.b policy documented in README.md.
|
||||||
mod_version=0.2.16.6
|
mod_version=0.2.16.7
|
||||||
immersive_portals_version=6.0.7
|
immersive_portals_version=6.0.7
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# 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.
|
# This should match the base package used for the mod sources.
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public interface DestinationPreviewRenderer extends AutoCloseable {
|
|||||||
default boolean isExploring() { return false; }
|
default boolean isExploring() { return false; }
|
||||||
default void setExploring(boolean exploring) { }
|
default void setExploring(boolean exploring) { }
|
||||||
default void rotate(double deltaX, double deltaY) { }
|
default void rotate(double deltaX, double deltaY) { }
|
||||||
|
default boolean keyPressed(int keyCode, int scanCode) { return false; }
|
||||||
|
default boolean keyReleased(int keyCode, int scanCode) { return false; }
|
||||||
default void resetView() { }
|
default void resetView() { }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+48
-6
@@ -29,6 +29,12 @@ public final class ImmersivePortalsDestinationPreviewRenderer implements Destina
|
|||||||
private int ticks;
|
private int ticks;
|
||||||
private boolean exploring;
|
private boolean exploring;
|
||||||
private boolean hasCompletedFrame;
|
private boolean hasCompletedFrame;
|
||||||
|
private boolean movingForward;
|
||||||
|
private boolean movingBackward;
|
||||||
|
private boolean movingLeft;
|
||||||
|
private boolean movingRight;
|
||||||
|
private boolean movingUp;
|
||||||
|
private boolean movingDown;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void accept(LinkPreviewPayload payload) {
|
public void accept(LinkPreviewPayload payload) {
|
||||||
@@ -42,12 +48,9 @@ public final class ImmersivePortalsDestinationPreviewRenderer implements Destina
|
|||||||
if (!exploring || cameraPosition == null) {
|
if (!exploring || cameraPosition == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double forward = (minecraft.options.keyUp.isDown() ? 1.0D : 0.0D)
|
double forward = (movingForward ? 1.0D : 0.0D) - (movingBackward ? 1.0D : 0.0D);
|
||||||
- (minecraft.options.keyDown.isDown() ? 1.0D : 0.0D);
|
double strafe = (movingRight ? 1.0D : 0.0D) - (movingLeft ? 1.0D : 0.0D);
|
||||||
double strafe = (minecraft.options.keyRight.isDown() ? 1.0D : 0.0D)
|
double vertical = (movingUp ? 1.0D : 0.0D) - (movingDown ? 1.0D : 0.0D);
|
||||||
- (minecraft.options.keyLeft.isDown() ? 1.0D : 0.0D);
|
|
||||||
double vertical = (minecraft.options.keyJump.isDown() ? 1.0D : 0.0D)
|
|
||||||
- (minecraft.options.keyShift.isDown() ? 1.0D : 0.0D);
|
|
||||||
double radians = Math.toRadians(yaw);
|
double radians = Math.toRadians(yaw);
|
||||||
Vec3 motion = new Vec3(
|
Vec3 motion = new Vec3(
|
||||||
-Math.sin(radians) * forward + Math.cos(radians) * strafe,
|
-Math.sin(radians) * forward + Math.cos(radians) * strafe,
|
||||||
@@ -135,9 +138,47 @@ public final class ImmersivePortalsDestinationPreviewRenderer implements Destina
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyPressed(int keyCode, int scanCode) {
|
||||||
|
if (!exploring) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (minecraft.options.keyUp.matches(keyCode, scanCode)) movingForward = true;
|
||||||
|
else if (minecraft.options.keyDown.matches(keyCode, scanCode)) movingBackward = true;
|
||||||
|
else if (minecraft.options.keyLeft.matches(keyCode, scanCode)) movingLeft = true;
|
||||||
|
else if (minecraft.options.keyRight.matches(keyCode, scanCode)) movingRight = true;
|
||||||
|
else if (minecraft.options.keyJump.matches(keyCode, scanCode)) movingUp = true;
|
||||||
|
else if (minecraft.options.keyShift.matches(keyCode, scanCode)) movingDown = true;
|
||||||
|
else return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyReleased(int keyCode, int scanCode) {
|
||||||
|
boolean handled = true;
|
||||||
|
if (minecraft.options.keyUp.matches(keyCode, scanCode)) movingForward = false;
|
||||||
|
else if (minecraft.options.keyDown.matches(keyCode, scanCode)) movingBackward = false;
|
||||||
|
else if (minecraft.options.keyLeft.matches(keyCode, scanCode)) movingLeft = false;
|
||||||
|
else if (minecraft.options.keyRight.matches(keyCode, scanCode)) movingRight = false;
|
||||||
|
else if (minecraft.options.keyJump.matches(keyCode, scanCode)) movingUp = false;
|
||||||
|
else if (minecraft.options.keyShift.matches(keyCode, scanCode)) movingDown = false;
|
||||||
|
else handled = false;
|
||||||
|
return handled;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearMovement() {
|
||||||
|
movingForward = false;
|
||||||
|
movingBackward = false;
|
||||||
|
movingLeft = false;
|
||||||
|
movingRight = false;
|
||||||
|
movingUp = false;
|
||||||
|
movingDown = false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resetView() {
|
public void resetView() {
|
||||||
exploring = false;
|
exploring = false;
|
||||||
|
clearMovement();
|
||||||
if (destination != null) {
|
if (destination != null) {
|
||||||
cameraPosition = Vec3.atCenterOf(destination.origin()).add(0.0D, 2.0D, ORBIT_RADIUS);
|
cameraPosition = Vec3.atCenterOf(destination.origin()).add(0.0D, 2.0D, ORBIT_RADIUS);
|
||||||
yaw = destination.yaw();
|
yaw = destination.yaw();
|
||||||
@@ -147,6 +188,7 @@ public final class ImmersivePortalsDestinationPreviewRenderer implements Destina
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
clearMovement();
|
||||||
hasCompletedFrame = false;
|
hasCompletedFrame = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,6 +181,18 @@ public final class DescriptiveBookScreen extends Screen {
|
|||||||
return super.mouseDragged(mouseX, mouseY, button, dragX, dragY);
|
return super.mouseDragged(mouseX, mouseY, button, dragX, dragY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
|
||||||
|
return preview != null && preview.keyPressed(keyCode, scanCode)
|
||||||
|
|| super.keyPressed(keyCode, scanCode, modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyReleased(int keyCode, int scanCode, int modifiers) {
|
||||||
|
return preview != null && preview.keyReleased(keyCode, scanCode)
|
||||||
|
|| super.keyReleased(keyCode, scanCode, modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
private void toggleExploration() {
|
private void toggleExploration() {
|
||||||
preview.setExploring(!preview.isExploring());
|
preview.setExploring(!preview.isExploring());
|
||||||
exploreButton.setMessage(Component.translatable(preview.isExploring()
|
exploreButton.setMessage(Component.translatable(preview.isExploring()
|
||||||
|
|||||||
@@ -181,6 +181,18 @@ public final class LinkingBookScreen extends Screen {
|
|||||||
return super.mouseDragged(mouseX, mouseY, button, dragX, dragY);
|
return super.mouseDragged(mouseX, mouseY, button, dragX, dragY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
|
||||||
|
return preview != null && preview.keyPressed(keyCode, scanCode)
|
||||||
|
|| super.keyPressed(keyCode, scanCode, modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyReleased(int keyCode, int scanCode, int modifiers) {
|
||||||
|
return preview != null && preview.keyReleased(keyCode, scanCode)
|
||||||
|
|| super.keyReleased(keyCode, scanCode, modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
private void toggleExploration() {
|
private void toggleExploration() {
|
||||||
preview.setExploring(!preview.isExploring());
|
preview.setExploring(!preview.isExploring());
|
||||||
exploreButton.setMessage(Component.translatable(preview.isExploring()
|
exploreButton.setMessage(Component.translatable(preview.isExploring()
|
||||||
|
|||||||
Reference in new issue
Block a user