mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-27 05:17:56 +01:00
Scheme-a-version
- Fix Resources not being closed properly - Change versioning scheme to match Create - Add LICENSE to built jar - Fix mods.toml version sync - Move JOML code to non-src directory - Update Gradle - Organize imports
This commit is contained in:
parent
0a671b8f43
commit
a42c027b6f
95 changed files with 50 additions and 56 deletions
67
build.gradle
67
build.gradle
|
@ -11,10 +11,10 @@ buildscript {
|
|||
classpath "org.parchmentmc:librarian:${librarian_version}"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.matthewprenger.cursegradle' version "${cursegradle_version}"
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
apply plugin: 'org.parchmentmc.librarian.forgegradle'
|
||||
apply plugin: 'eclipse'
|
||||
|
@ -24,11 +24,10 @@ apply plugin: 'org.spongepowered.mixin'
|
|||
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equalsIgnoreCase('false');
|
||||
|
||||
ext.buildNumber = System.getenv('BUILD_NUMBER')
|
||||
if (buildNumber == null) buildNumber = 'custom'
|
||||
|
||||
version = "${mc_update_version}-${mod_version}" + (dev ? ".${buildNumber}" : '')
|
||||
group = 'com.jozufozu.flywheel'
|
||||
archivesBaseName = 'flywheel-forge'
|
||||
archivesBaseName = "flywheel-forge-${artifact_minecraft_version}"
|
||||
version = mod_version + (dev && buildNumber != null ? "-${buildNumber}" : '')
|
||||
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
|
||||
|
@ -36,7 +35,6 @@ println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getPro
|
|||
minecraft {
|
||||
mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
|
||||
|
||||
|
||||
runs {
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
|
@ -89,10 +87,6 @@ minecraft {
|
|||
}
|
||||
}
|
||||
|
||||
mixin {
|
||||
add sourceSets.main, 'flywheel.refmap.json'
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url 'https://www.cursemaven.com'
|
||||
|
@ -130,53 +124,64 @@ dependencies {
|
|||
}
|
||||
}
|
||||
|
||||
// Example for how to get properties into the manifest for reading by the runtime..
|
||||
processResources {
|
||||
inputs.property 'version', mod_version
|
||||
|
||||
filesMatching('META-INF/mods.toml') {
|
||||
expand 'version': mod_version
|
||||
}
|
||||
}
|
||||
|
||||
mixin {
|
||||
add sourceSets.main, 'flywheel.refmap.json'
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes([
|
||||
'Specification-Title' : 'flywheel',
|
||||
//'Specification-Vendor': 'flywheel authors',
|
||||
'Specification-Version' : '1', // We are version 1 of ourselves
|
||||
'Implementation-Title' : project.name,
|
||||
'Implementation-Version' : project.version,
|
||||
'Implementation-Title' : project.jar.baseName,
|
||||
'Implementation-Version' : project.jar.archiveVersion,
|
||||
//'Implementation-Vendor': 'flywheel authors',
|
||||
'MixinConfigs' : 'flywheel.mixins.json',
|
||||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||
'MixinConfigs' : 'flywheel.mixins.json'
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
jar.finalizedBy('reobfJar')
|
||||
|
||||
javadoc {
|
||||
source = [sourceSets.main.allJava]
|
||||
// prevent java 8's strict doclint for javadocs from failing builds
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from sourceSets.main.allSource
|
||||
archiveBaseName.set(project.archivesBaseName)
|
||||
archiveVersion.set("${project.version}")
|
||||
archiveClassifier.set('sources')
|
||||
java {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
from javadoc.destinationDir
|
||||
archiveClassifier.set('javadoc')
|
||||
void addLicense(jarTask) {
|
||||
jarTask.from('LICENSE') {
|
||||
rename { "${it}_${project.archivesBaseName}" }
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives jar, sourcesJar, javadocJar
|
||||
}
|
||||
jar.finalizedBy('reobfJar')
|
||||
addLicense(jar)
|
||||
|
||||
publishing {
|
||||
tasks.publish.dependsOn 'build'
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact jar
|
||||
artifact sourcesJar
|
||||
artifact javadocJar
|
||||
artifactId = archivesBaseName
|
||||
|
||||
from components.java
|
||||
fg.component(it)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ org.gradle.daemon = false
|
|||
|
||||
# mod version info
|
||||
mod_version = 0.6.4
|
||||
mc_update_version = 1.18
|
||||
artifact_minecraft_version = 1.18.2
|
||||
|
||||
minecraft_version = 1.18.2
|
||||
forge_version = 40.1.60
|
||||
|
||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
10
gradlew
vendored
10
gradlew
vendored
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -32,10 +32,10 @@
|
|||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
|
|
|
@ -7,8 +7,8 @@ import org.slf4j.Logger;
|
|||
import com.jozufozu.flywheel.api.FlywheelWorld;
|
||||
import com.jozufozu.flywheel.backend.gl.versioned.GlCompat;
|
||||
import com.jozufozu.flywheel.backend.instancing.ParallelTaskEngine;
|
||||
import com.jozufozu.flywheel.config.FlwConfig;
|
||||
import com.jozufozu.flywheel.config.BackendType;
|
||||
import com.jozufozu.flywheel.config.FlwConfig;
|
||||
import com.jozufozu.flywheel.core.shader.ProgramSpec;
|
||||
import com.mojang.logging.LogUtils;
|
||||
|
||||
|
|
|
@ -96,10 +96,8 @@ public class Loader implements ResourceManagerReloadListener {
|
|||
Collection<ResourceLocation> programSpecs = manager.listResources(PROGRAM_DIR, s -> s.endsWith(".json"));
|
||||
|
||||
for (ResourceLocation location : programSpecs) {
|
||||
try {
|
||||
Resource file = manager.getResource(location);
|
||||
|
||||
String s = StringUtil.readToString(file.getInputStream());
|
||||
try (Resource resource = manager.getResource(location)) {
|
||||
String s = StringUtil.readToString(resource.getInputStream());
|
||||
|
||||
ResourceLocation specName = ResourceUtil.trim(location, PROGRAM_DIR, ".json");
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ import net.minecraft.network.chat.MutableComponent;
|
|||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraftforge.client.event.RegisterClientCommandsEvent;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
|
||||
public class FlwCommands {
|
||||
public static void registerClientCommands(RegisterClientCommandsEvent event) {
|
||||
|
|
|
@ -36,16 +36,14 @@ public class ShaderSources implements SourceFinder {
|
|||
});
|
||||
|
||||
for (ResourceLocation location : allShaders) {
|
||||
try {
|
||||
Resource resource = manager.getResource(location);
|
||||
|
||||
try (Resource resource = manager.getResource(location)) {
|
||||
String source = StringUtil.readToString(resource.getInputStream());
|
||||
|
||||
ResourceLocation name = ResourceUtil.removePrefixUnchecked(location, SHADER_DIR);
|
||||
|
||||
shaderSources.put(name, new SourceFile(this, name, source));
|
||||
} catch (IOException e) {
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
package com.jozufozu.flywheel.core.vertex;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import com.jozufozu.flywheel.api.vertex.ShadedVertexList;
|
||||
import com.jozufozu.flywheel.api.vertex.VertexList;
|
||||
import com.jozufozu.flywheel.util.RenderMath;
|
||||
import com.mojang.blaze3d.platform.MemoryTracker;
|
||||
|
||||
public class BlockVertexListUnsafe extends AbstractVertexList {
|
||||
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
package com.jozufozu.flywheel.core.vertex;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
|
||||
import com.jozufozu.flywheel.api.vertex.VertexList;
|
||||
import com.jozufozu.flywheel.util.RenderMath;
|
||||
import com.mojang.blaze3d.platform.MemoryTracker;
|
||||
|
||||
public class PosTexNormalVertexListUnsafe extends AbstractVertexList {
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.jozufozu.flywheel.util;
|
|||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiConsumer;
|
||||
|
|
|
@ -5,7 +5,7 @@ license = "MIT"
|
|||
|
||||
[[mods]]
|
||||
modId = "flywheel"
|
||||
version = "${file.jarVersion}"
|
||||
version = "${version}"
|
||||
displayName = "Flywheel"
|
||||
logoFile = "logo.png"
|
||||
displayURL = "https://www.curseforge.com/minecraft/mc-mods/flywheel"
|
||||
|
|
Loading…
Reference in a new issue