-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial 1.20.2 work, with MultiLoader
- Loading branch information
1 parent
8c40f9f
commit cc05a03
Showing
79 changed files
with
1,365 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
* text eol=lf | ||
*.bat text eol=crlf | ||
*.patch text eol=lf | ||
*.java text eol=lf | ||
*.gradle text eol=crlf | ||
*.png binary | ||
*.gif binary | ||
*.exe binary | ||
*.dll binary | ||
*.jar binary | ||
*.lzma binary | ||
*.zip binary | ||
*.pyd binary | ||
*.cfg text eol=lf | ||
*.jks binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,96 @@ | ||
plugins { | ||
id 'idea' | ||
id 'net.minecraftforge.gradle' version '[6.0,6.2)' | ||
// Required for NeoGradle | ||
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" | ||
} | ||
|
||
java.toolchain.languageVersion = JavaLanguageVersion.of(17) | ||
|
||
ext.buildnumber="" | ||
if (System.getenv().BUILD_NUMBER) { | ||
ext.buildnumber = ".B" + System.getenv().BUILD_NUMBER | ||
} | ||
|
||
version = "${minecraft_version}-${mod_version}${buildnumber}" | ||
group = "dmillerw.ping" | ||
|
||
base { | ||
archivesName = "Ping" | ||
} | ||
|
||
minecraft { | ||
mappings channel: 'official', version: project.minecraft_version | ||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') | ||
|
||
runs { | ||
client { | ||
workingDirectory project.file('run') | ||
|
||
mods { | ||
"${mod_id}" { | ||
source sourceSets.main | ||
} | ||
} | ||
subprojects { | ||
apply plugin: 'java' | ||
java.toolchain.languageVersion = JavaLanguageVersion.of(17) | ||
java.withSourcesJar() | ||
|
||
jar { | ||
from(rootProject.file("LICENSE")) { | ||
rename { "${it}_${mod_name}" } | ||
} | ||
server { | ||
workingDirectory project.file('run') | ||
manifest { | ||
attributes([ | ||
'Specification-Title' : mod_name, | ||
'Specification-Vendor' : mod_author, | ||
'Specification-Version' : project.jar.archiveVersion, | ||
'Implementation-Title' : project.name, | ||
'Implementation-Version' : project.jar.archiveVersion, | ||
'Implementation-Vendor' : mod_author, | ||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), | ||
'Timestamp' : System.currentTimeMillis(), | ||
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", | ||
'Built-On-Minecraft' : minecraft_version | ||
]) | ||
} | ||
} | ||
|
||
mods { | ||
"${mod_id}" { | ||
source sourceSets.main | ||
} | ||
} | ||
sourcesJar { | ||
from(rootProject.file("LICENSE")) { | ||
rename { "${it}_${mod_name}" } | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" | ||
} | ||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = 'Sponge / Mixin' | ||
url = 'https://repo.spongepowered.org/repository/maven-public/' | ||
} | ||
maven { | ||
name = 'BlameJared Maven (JEI / CraftTweaker / Bookshelf)' | ||
url = 'https://maven.blamejared.com' | ||
} | ||
maven { | ||
name = "Forge Config API Port mod" | ||
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" | ||
} | ||
} | ||
|
||
def resourceTargets = ['META-INF/mods.toml'] | ||
def replaceProperties = [ | ||
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range, | ||
forge_version: forge_version, forge_version_range: forge_version_range, | ||
loader_version_range: loader_version_range, | ||
mod_version: mod_version, | ||
] | ||
tasks.withType(JavaCompile).configureEach { | ||
it.options.encoding = 'UTF-8' | ||
it.options.getRelease().set(17) | ||
} | ||
|
||
processResources { | ||
inputs.properties replaceProperties | ||
replaceProperties.put 'project', project | ||
processResources { | ||
def expandProps = [ | ||
"version": version, | ||
"group": project.group, //Else we target the task's group. | ||
"minecraft_version": minecraft_version, | ||
"forge_version": forge_version, | ||
"forge_loader_version_range": forge_loader_version_range, | ||
"forge_version_range": forge_version_range, | ||
"minecraft_version_range": minecraft_version_range, | ||
"fabric_version": fabric_version, | ||
"fabric_loader_version": fabric_loader_version, | ||
"mod_name": mod_name, | ||
"mod_author": mod_author, | ||
"mod_id": mod_id, | ||
"license": license, | ||
"description": project.description, | ||
"neoforge_version": neoforge_version, | ||
"neoforge_loader_version_range": neoforge_loader_version_range, | ||
"credits": credits | ||
] | ||
|
||
filesMatching(resourceTargets) { | ||
expand replaceProperties | ||
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) { | ||
expand expandProps | ||
} | ||
inputs.properties(expandProps) | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation | ||
// Disables Gradle's custom module metadata from being published to maven. The | ||
// metadata includes mapped dependencies which are not reasonably consumable by | ||
// other mod developers. | ||
tasks.withType(GenerateModuleMetadata).configureEach { | ||
enabled = false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
plugins { | ||
id 'idea' | ||
id 'java' | ||
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' | ||
} | ||
base { | ||
archivesName = "${mod_name}-common-${minecraft_version}" | ||
} | ||
minecraft { | ||
version(minecraft_version) | ||
if(file("src/main/resources/${mod_id}.accesswidener").exists()){ | ||
accessWideners(file("src/main/resources/${mod_id}.accesswidener")) | ||
} | ||
} | ||
|
||
dependencies { | ||
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5' | ||
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' | ||
implementation "fuzs.forgeconfigapiport:forgeconfigapiport-fabric:${forge_config_api_port}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.girafi.ping; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
public class Constants { | ||
public static final String MOD_ID = "ping"; | ||
public static final String MOD_NAME = "Ping"; | ||
public static final Logger LOG = LogManager.getLogger(MOD_NAME); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.girafi.ping; | ||
|
||
import com.girafi.ping.util.TempConfig; | ||
|
||
import java.nio.file.Path; | ||
|
||
public class PingCommon { | ||
private static TempConfig config; | ||
|
||
public static void setConfigFolder (Path configPath) { | ||
config = TempConfig.load(configPath.resolve(Constants.MOD_ID + ".json").toFile()); | ||
} | ||
|
||
public static TempConfig config() { | ||
return config; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
common/src/main/java/com/girafi/ping/client/ClientHandlerBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.girafi.ping.client; | ||
|
||
import com.girafi.ping.data.PingType; | ||
import net.minecraft.client.renderer.ShaderInstance; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.phys.BlockHitResult; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.Objects; | ||
|
||
public class ClientHandlerBase { | ||
public static final ClientHandlerBase INSTANCE = new ClientHandlerBase(); | ||
|
||
@Nullable | ||
public static ShaderInstance rendertypePing; | ||
|
||
public static ShaderInstance getRenderTypePing() { | ||
return Objects.requireNonNull(rendertypePing, "Attempted to call getRenderTypePing before shaders have finished loading."); | ||
} | ||
|
||
public static BlockHitResult raytrace(Player player, double distance) { | ||
float eyeHeight = player.getEyeHeight(); | ||
return (BlockHitResult) player.pick(distance, eyeHeight, false); | ||
} | ||
|
||
public void sendPing(BlockHitResult raytrace, int color, PingType type) { | ||
} | ||
|
||
public void sendPing(PingType type) { | ||
|
||
} | ||
} |
Oops, something went wrong.