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

remove custom math classes #188

Closed
Closed
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ij_json_space_before_comma = false
ij_json_spaces_within_braces = false
ij_json_spaces_within_brackets = false
ij_json_wrap_long_lines = false
indent_size = 2

[*.java]
ij_java_align_consecutive_assignments = false
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ libs/

.classpath
.project
.idea/
.idea/*
!.idea/inspectionProfiles/
!.idea/scopes/
classes/
.metadata
.vscode
Expand Down
96 changes: 96 additions & 0 deletions .idea/inspectionProfiles/VivecraftMod_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/scopes/java_awt.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/scopes/jetbrains_annotations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/scopes/scope_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/scopes/vivecraft.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/scopes/vivecraft_common_main_mixin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 19 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ subprojects {

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.officialMojangMappings()
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.18.2+build.4:v2"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-1.20.1:2023.08.20@zip")
}
implementation("org.lwjgl:lwjgl-openvr:3.3.1")
implementation("org.lwjgl:lwjgl-openvr:3.3.1:natives-linux")
implementation("org.lwjgl:lwjgl-openvr:3.3.1:natives-macos")
Expand Down Expand Up @@ -80,6 +80,11 @@ allprojects {
}
}

maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}

exclusiveContent {
forRepository {
maven {
Expand Down Expand Up @@ -120,7 +125,16 @@ allprojects {
maven { url = "https://maven.terraformersmc.com/" }
maven { url = "https://maven.cafeteria.dev/releases/" }
maven { url = "https://maven.gegy.dev" }
maven { url = "https://modmaven.dev" }
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
maven {
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = "https://maven.blamejared.com/"
}
exclusiveContent {
forRepository {
maven {
Expand Down
3 changes: 3 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ dependencies {
//LaunchPopup
implementation 'com.github.fayer3:LaunchPopup:master-SNAPSHOT'

// MixinExtras
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:0.2.0-rc.5"))

}
// extract the LaunchPopup classes
jar {
Expand Down
10 changes: 5 additions & 5 deletions common/src/main/java/org/vivecraft/MixinConfig.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.vivecraft;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
Expand All @@ -15,6 +13,8 @@
import java.util.List;
import java.util.Set;

import static org.vivecraft.common.utils.Utils.logger;

public class MixinConfig implements IMixinConfigPlugin {

@Override
Expand Down Expand Up @@ -50,7 +50,7 @@ public void onLoad(String mixinPackage) {
@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
if (!Xplat.isModLoadedSuccess()) {
LogManager.getLogger().log(Level.WARN, "not loading '" + mixinClassName + "' because mod failed to load completely");
logger.warn("not loading '{}' because mod failed to load completely", mixinClassName);
return false;
}

Expand All @@ -65,7 +65,7 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
try {
MixinService.getService().getBytecodeProvider().getClassNode(neededClass);
ClassNode node = MixinService.getService().getBytecodeProvider().getClassNode(targetClassName);
return node.fields.stream().anyMatch(field -> field.name.equals("chunkRenderList"));
return node.fields.stream().anyMatch(field -> "chunkRenderList".equals(field.name));
} catch (ClassNotFoundException | IOException e) {
return false;
}
Expand All @@ -76,7 +76,7 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
MixinService.getService().getBytecodeProvider().getClassNode(neededClass);
return true;
} catch (ClassNotFoundException | IOException e) {
LogManager.getLogger().log(Level.INFO, "Vivecraft: skipping mixin '" + mixinClassName + "'");
logger.info("skipping mixin '{}'", mixinClassName);
return false;
}
}
Expand Down
8 changes: 5 additions & 3 deletions common/src/main/java/org/vivecraft/client/ClientAPIImpl.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package org.vivecraft.client;

import org.vivecraft.api_beta.client.VivecraftClientAPI;
import org.vivecraft.client_vr.VRState;
import org.vivecraft.client_xr.render_pass.RenderPassType;

import static org.vivecraft.client_vr.VRState.vrInitialized;
import static org.vivecraft.client_vr.VRState.vrRunning;

public final class ClientAPIImpl implements VivecraftClientAPI {

public static final ClientAPIImpl INSTANCE = new ClientAPIImpl();
Expand All @@ -13,12 +15,12 @@ private ClientAPIImpl() {

@Override
public boolean isVrInitialized() {
return VRState.vrInitialized;
return vrInitialized;
}

@Override
public boolean isVrActive() {
return VRState.vrRunning;
return vrRunning;
}

@Override
Expand Down
Loading