Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.4' into…
Browse files Browse the repository at this point in the history
… Multiloader-1.20.5
  • Loading branch information
fayer3 committed Oct 21, 2024
2 parents 5750107 + 0148d3b commit a44f7a1
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 12 deletions.
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
compileOnly('com.electronwill.night-config:toml:3.6.6')

//LaunchPopup
implementation 'com.github.fayer3:LaunchPopup:master-SNAPSHOT'
implementation 'com.github.Vivecraft:LaunchPopup:master-SNAPSHOT'
}
// extract the LaunchPopup classes
jar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public class GuiVRControls extends GuiVROptionsBase {
new VROptionEntry(VRSettings.VrOptions.DUMMY, true),
new VROptionEntry(VRSettings.VrOptions.DUMMY, true),
new VROptionEntry(VRSettings.VrOptions.DUMMY, true),
new VROptionEntry(VRSettings.VrOptions.DUMMY),
new VROptionEntry(VRSettings.VrOptions.INGAME_BINDINGS_IN_GUI),
new VROptionEntry(VRSettings.VrOptions.REVERSE_HANDS),
new VROptionEntry(VRSettings.VrOptions.RIGHT_CLICK_DELAY),
new VROptionEntry(VRSettings.VrOptions.INGAME_BINDINGS_IN_GUI),
new VROptionEntry(VRSettings.VrOptions.ALLOW_ADVANCED_BINDINGS),
new VROptionEntry(VRSettings.VrOptions.RIGHT_CLICK_DELAY),
new VROptionEntry(VRSettings.VrOptions.THIRDPERSON_ITEMTRANSFORMS_CUSTOM),
new VROptionEntry(VRSettings.VrOptions.THIRDPERSON_ITEMTRANSFORMS)
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ public static boolean isThirdPersonItems() {
return ClientDataHolderVR.getInstance().vrSettings.overrides.getSetting(VRSettings.VrOptions.THIRDPERSON_ITEMTRANSFORMS).getBoolean();
}

public static boolean isThirdPersonItemsCustom() {
return ClientDataHolderVR.getInstance().vrSettings.overrides.getSetting(VRSettings.VrOptions.THIRDPERSON_ITEMTRANSFORMS_CUSTOM).getBoolean();
}

public static boolean isLimitedSurvivalTeleport() {
return ClientDataHolderVR.getInstance().vrSettings.overrides.getSetting(VRSettings.VrOptions.LIMIT_TELEPORT).getBoolean();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public boolean isCharged() {

public void reset(LocalPlayer player) {
this.isDrawing = false;
this.canDraw = false;
}

public EntryPoint getEntryPoint() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ public enum UpdateType implements OptionEnum<UpdateType> {
public boolean ingameBindingsInGui = false;
@SettingField(VrOptions.THIRDPERSON_ITEMTRANSFORMS)
public boolean thirdPersonItems = false;
@SettingField(VrOptions.THIRDPERSON_ITEMTRANSFORMS_CUSTOM)
public boolean thirdPersonItemsCustom = true;
//

//Locomotion
Expand Down Expand Up @@ -1702,6 +1704,7 @@ String getDisplayString(String prefix, Object value) {
AUTO_SPRINT(false, true), // Auto-sprint
AUTO_SPRINT_THRESHOLD(true, false, 0.5f, 1f, 0.01f, 2), // Auto-sprint Threshold
THIRDPERSON_ITEMTRANSFORMS(false, true), // 3rd person items
THIRDPERSON_ITEMTRANSFORMS_CUSTOM(false, true), // 3rd person items, for items with custom model data
BOW_MODE(false, true) { // Roomscale Bow Mode

@Override
Expand Down Expand Up @@ -2164,6 +2167,7 @@ private ServerOverrides() {
registerSetting(VrOptions.TELEPORT_HORIZ_LIMIT, "teleportLimitHoriz", () -> vrTeleportHorizLimit);
registerSetting(VrOptions.WORLD_SCALE, "worldScale", () -> worldScale);
registerSetting(VrOptions.THIRDPERSON_ITEMTRANSFORMS, "thirdPersonItems", () -> thirdPersonItems);
registerSetting(VrOptions.THIRDPERSON_ITEMTRANSFORMS_CUSTOM, "thirdPersonItemsCustom", () -> thirdPersonItemsCustom);
}

private void registerSetting(VrOptions option, String networkName, Supplier<Object> originalValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import org.vivecraft.client_vr.settings.VRSettings;
import org.vivecraft.client_xr.render_pass.RenderPassType;

import java.util.Arrays;

@Mixin(RenderTarget.class)
public abstract class RenderTargetMixin implements RenderTargetExtension {

Expand Down Expand Up @@ -121,11 +119,11 @@ public String toString() {
if (RenderPassType.isWorldOnly()) {
if (!this.vivecraft$loggedSizeError && (this.width != Minecraft.getInstance().getMainRenderTarget().width || this.height != Minecraft.getInstance().getMainRenderTarget().height)) {
// log a limited StackTrace to find the cause, we don't need to spam the log with full StackTraces
VRSettings.logger.error("Vivecraft: Mismatched RenderTarget size detected, viewport size change was blocked. MainTarget size: {}x{}, RenderTarget size: {}x{}. RenderPass: {}, Stacktrace: {}",
VRSettings.logger.error("Vivecraft: Mismatched RenderTarget size detected, viewport size change was blocked. MainTarget size: {}x{}, RenderTarget size: {}x{}. RenderPass: {}, Stacktrace:",
Minecraft.getInstance().getMainRenderTarget().width,
Minecraft.getInstance().getMainRenderTarget().height,
this.width, this.height, ClientDataHolderVR.getInstance().currentPass,
String.join("\n", Arrays.stream(Thread.currentThread().getStackTrace(), 2, 12).map(Object::toString).toArray(String[]::new)));
new RuntimeException());
this.vivecraft$loggedSizeError = true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,18 @@ public abstract class MinecraftVRMixin implements MinecraftExtension {
return constant;
}

@Inject(at = @At("HEAD"), method = "resizeDisplay")
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;getMainRenderTarget()Lcom/mojang/blaze3d/pipeline/RenderTarget;"), method = "resizeDisplay")
void vivecraft$restoreVanillaState(CallbackInfo ci) {
if (VRState.vrInitialized) {
// restore vanilla post chains before the resize, or it will resize the wrong ones
if (levelRenderer != null) {
((LevelRendererExtension) levelRenderer).vivecraft$restoreVanillaPostChains();
}
RenderPassManager.setVanillaRenderPass();
if (VRState.vrRunning) {
RenderPassManager.setGUIRenderPass();
} else {
RenderPassManager.setVanillaRenderPass();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,16 @@ public abstract class ItemInHandRendererVRMixin implements ItemInHandRendererExt
}

ItemDisplayContext itemDisplayContext;
if ((ClientNetworking.isThirdPersonItems() && !(BowTracker.isBow(pStack) && dh.bowTracker.isActive((LocalPlayer) pPlayer))) || dh.climbTracker.isClaws(pStack)) {

// third person transforms for custom model data items, but not spear, shield and crossbow
boolean hasCMD = pStack.hasTag() && pStack.getTag().getInt("CustomModelData") != 0 &&
rendertype != VivecraftItemRendering.VivecraftItemTransformType.Crossbow &&
rendertype != VivecraftItemRendering.VivecraftItemTransformType.Spear &&
rendertype != VivecraftItemRendering.VivecraftItemTransformType.Shield;

boolean isBow = BowTracker.isBow(pStack) && dh.bowTracker.isActive((LocalPlayer) pPlayer);

if (((ClientNetworking.isThirdPersonItems() || (hasCMD && ClientNetworking.isThirdPersonItemsCustom())) && !isBow) || dh.climbTracker.isClaws(pStack)) {
useLeftHandModelinLeftHand = true; //test
VivecraftItemRendering.applyThirdPersonItemTransforms(pMatrixStack, rendertype, mainHand, pPlayer, pEquippedProgress, pPartialTicks, pStack, pHand);
itemDisplayContext = mainHand ? ItemDisplayContext.THIRD_PERSON_RIGHT_HAND : (useLeftHandModelinLeftHand ? ItemDisplayContext.THIRD_PERSON_LEFT_HAND : ItemDisplayContext.THIRD_PERSON_RIGHT_HAND);
Expand Down
11 changes: 11 additions & 0 deletions common/src/main/java/org/vivecraft/server/ServerNetworking.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ public static void handlePacket(CommonNetworkHelper.PacketDiscriminators packetI
packetConsumer.accept(getVivecraftServerPacket(CommonNetworkHelper.PacketDiscriminators.SETTING_OVERRIDE, array));
}

if (ServerConfig.forceThirdPersonItemsCustom.get()) {
FriendlyByteBuf byteBuf = new FriendlyByteBuf(Unpooled.buffer());
byteBuf.writeUtf("thirdPersonItemsCustom");
byteBuf.writeUtf("" + true);

byte[] array = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(array);
byteBuf.release();
packetConsumer.accept(getVivecraftServerPacket(CommonNetworkHelper.PacketDiscriminators.SETTING_OVERRIDE, array));
}

if (ServerConfig.crawlingEnabled.get()) {
packetConsumer.accept(getVivecraftServerPacket(CommonNetworkHelper.PacketDiscriminators.CRAWL, new byte[0]));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public class ServerConfig {
public static ConfigBuilder.DoubleValue worldscaleMin;

public static ConfigBuilder.BooleanValue forceThirdPersonItems;
public static ConfigBuilder.BooleanValue forceThirdPersonItemsCustom;

public static ConfigBuilder.BooleanValue vrSwitchingEnabled;

Expand Down Expand Up @@ -358,6 +359,10 @@ private static void fixConfig(CommentedConfig config, ConfigSpec.CorrectionListe
.push("thirdPersonItems")
.comment("Forces players to use the raw item position setting")
.define(false);
forceThirdPersonItemsCustom = builder
.push("thirdPersonItemsCustom")
.comment("Forces players to use the raw item position setting, only for items with custom model data")
.define(false);
// end settingOverrides
builder.pop();

Expand Down
2 changes: 2 additions & 0 deletions common/src/main/resources/assets/vivecraft/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
"vivecraft.options.LIMIT_TELEPORT": "Limitiere im Überlebensmodus",
"vivecraft.options.REVERSE_HANDS": "Hände vertauschen",
"vivecraft.options.THIRDPERSON_ITEMTRANSFORMS": "Rohe Gegenstand Position",
"vivecraft.options.THIRDPERSON_ITEMTRANSFORMS_CUSTOM": "Rohe Custom Gegenstand Position",
"vivecraft.options.STENCIL_ON": "Augenschablone nutzen",
"vivecraft.options.BCB_ON": "Körperposition Anzeigen",
"vivecraft.options.WORLD_SCALE": "Welt Skalierung",
Expand Down Expand Up @@ -233,6 +234,7 @@
"vivecraft.options.LIMIT_TELEPORT.tooltip": "Wenn aktiviert, hat der Bogen-Teleporter im Überlebensmodus Einschränkungen. Er wird nicht in der Lage sein, seitlich an Blöcken hochzuspringen, er wird Hunger verbrauchen, und er wird einen Energieriegel haben, der sich mit der Zeit wieder auffüllt.",
"vivecraft.options.REVERSE_HANDS.tooltip": "Tauschen Sie die linke/rechte Hand als dominant.\n An: Links dominant\n Aus: Rechts-dominant\n\nUm die Tastenbelegung zu vertauschen, starten Sie das Spiel neu und stellen Sie sicher, dass die Standardbindungen in SteamVR ausgewählt sind.",
"vivecraft.options.THIRDPERSON_ITEMTRANSFORMS.tooltip": "Bestimmt wie gehaltene Gegenstände transformiert werden.\n An: Benutzt unveränderte 3. Person transformationen.\n Aus: Benutzt adaptierte 1. Person transformationen\n\n3. Person transformationen können besser für Mod Gegenstände funktionieren.",
"vivecraft.options.THIRDPERSON_ITEMTRANSFORMS_CUSTOM.tooltip": "Bestimmt wie gehaltene Gegenstände mit 'Custom Model Data' transformiert werden.\n An: Benutzt unveränderte 3. Person transformationen.\n Aus: Benutzt adaptierte 1. Person transformationen",
"vivecraft.options.STENCIL_ON.tooltip": "Bereiche des Bildschirms außerhalb des FOV ausblenden.\nVerbessert die Leistung.",
"vivecraft.options.BCB_ON.tooltip": "Zeigt Ihre Körperposition als quadratischen Schatten auf dem Boden an.\nDies ist Ihr quadratischer Schatten Kumpel™.\nVerlieren Sie Ihren quadratischen Schatten Kumpel nicht.",
"vivecraft.options.WORLD_SCALE.tooltip": "Skaliert den Spieler in der Welt.\nÜber eins macht Sie größer\nUnd darunter macht es sie kleiner\nUnd die, die Ihnen Ihre Mutter gibt\nmachen überhaupt nichts.",
Expand Down
2 changes: 2 additions & 0 deletions common/src/main/resources/assets/vivecraft/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"vivecraft.options.LIMIT_TELEPORT": "Limit in Survival",
"vivecraft.options.REVERSE_HANDS": "Reverse Hands",
"vivecraft.options.THIRDPERSON_ITEMTRANSFORMS": "Raw Item Positions",
"vivecraft.options.THIRDPERSON_ITEMTRANSFORMS_CUSTOM": "Raw Custom Item Positions",
"vivecraft.options.STENCIL_ON": "Use Eye Stencil",
"vivecraft.options.BCB_ON": "Show Body Position",
"vivecraft.options.WORLD_SCALE": "World Scale",
Expand Down Expand Up @@ -232,6 +233,7 @@
"vivecraft.options.LIMIT_TELEPORT.tooltip": "If enabled the arc teleporter will be have restrictions in survival mode. It will not be able to jump up the side of blocks, it will consume food, and it will have an energy bar that refills over time.",
"vivecraft.options.REVERSE_HANDS.tooltip": "Swap left/right hands as dominant.\n ON: Left dominant\n OFF: Right dominant\n\nTo swap the buttons, restart the game and make sure default bindings are selected in SteamVR.",
"vivecraft.options.THIRDPERSON_ITEMTRANSFORMS.tooltip": "Determines how held items are transformed.\n ON: Use thirdperson transforms unmodified\n OFF: Use firstperson transforms customized\n\nthirdperson transforms may be better for modded items.",
"vivecraft.options.THIRDPERSON_ITEMTRANSFORMS_CUSTOM.tooltip": "Determines how held items with 'Custom Model Data' are transformed.\n ON: Use thirdperson transforms unmodified\n OFF: Use firstperson transforms customized",
"vivecraft.options.STENCIL_ON.tooltip": "Mask out areas of the screen outside the FOV.\nImproves performance.",
"vivecraft.options.BCB_ON.tooltip": "Shows your body position as a square shadow on the ground.\nThis is your Square Shadow Buddy™.\nDo not lose your Square Shadow Buddy.",
"vivecraft.options.WORLD_SCALE.tooltip": "Scales the player in the world.\nAbove one makes you larger\nAnd below one makes you small\nAnd the ones that mother gives you\ndon't do anything at all.",
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minecraft_version=1.20.6
enabled_platforms=fabric,forge,neoforge

archives_base_name=vivecraft
mod_version=1.1.12-b5
mod_version=1.1.14-b1
maven_group=org.vivecraft

architectury_version=12.0.26
Expand Down

0 comments on commit a44f7a1

Please sign in to comment.