add 1.21 1.21.1 1.21.3 1.21.4 1.21.5
This commit is contained in:
parent
c7e60c6eb4
commit
5cdb14f841
106
build.gradle
106
build.gradle
@ -22,51 +22,24 @@ minecraft {
|
||||
reobf = false
|
||||
copyIdeResources = true
|
||||
runs {
|
||||
configureEach {
|
||||
workingDirectory project.file('run')
|
||||
property 'forge.logging.markers', 'REGISTRIES'
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
}
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
property 'forge.logging.markers', 'REGISTRIES'
|
||||
property 'forge.logging.console.level', 'info'
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
mods {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
workingDirectory project.file('run')
|
||||
property 'forge.logging.markers', 'REGISTRIES'
|
||||
property 'forge.logging.console.level', 'info'
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
mods {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
args '--nogui'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gameTestServer {
|
||||
workingDirectory project.file('run')
|
||||
property 'forge.logging.markers', 'REGISTRIES'
|
||||
property 'forge.logging.console.level', 'info'
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
mods {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
data {
|
||||
workingDirectory project.file('run')
|
||||
property 'forge.logging.markers', 'REGISTRIES'
|
||||
workingDirectory project.file('run-data')
|
||||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||
mods {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -75,22 +48,23 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft ("net.minecraftforge:forge:${minecraft_version}-${forge_version}")
|
||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||
implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } }
|
||||
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
|
||||
}
|
||||
|
||||
def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta']
|
||||
def replaceProperties = [minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
|
||||
|
||||
tasks.named('processResources', ProcessResources).configure {
|
||||
var 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_id : mod_id, mod_name: mod_name, mod_license: mod_license,
|
||||
mod_version: mod_version,
|
||||
mod_authors : mod_authors, mod_description: mod_description]
|
||||
processResources {
|
||||
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
|
||||
mod_authors : mod_authors, mod_description: mod_description,
|
||||
]
|
||||
inputs.properties replaceProperties
|
||||
replaceProperties.put 'project', project
|
||||
|
||||
filesMatching(resourceTargets) {
|
||||
expand replaceProperties
|
||||
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
|
||||
expand replaceProperties + [project: project]
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,36 +73,42 @@ mixin {
|
||||
config "${mod_id}.mixins.json"
|
||||
}
|
||||
|
||||
java{
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
jar {
|
||||
tasks.named('jar', Jar).configure {
|
||||
manifest {
|
||||
attributes(["Specification-Title" : mod_id,
|
||||
"Specification-Vendor" : mod_authors,
|
||||
"Specification-Version" : "1",
|
||||
"Implementation-Title" : project.name,
|
||||
"Implementation-Version" : project.jar.archiveVersion,
|
||||
"Implementation-Vendor" : mod_authors,
|
||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")])
|
||||
attributes([
|
||||
'Specification-Title' : mod_id,
|
||||
'Specification-Vendor' : mod_authors,
|
||||
'Specification-Version' : '1',
|
||||
'Implementation-Title' : project.name,
|
||||
'Implementation-Version': project.jar.archiveVersion,
|
||||
'Implementation-Vendor' : mod_authors,
|
||||
"MixinConfigs" : "${mod_id}.mixins.json"
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
jar.finalizedBy('reobfJar')
|
||||
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact jar
|
||||
register('mavenJava', MavenPublication) {
|
||||
from components.java
|
||||
groupId = mod_group_id
|
||||
artifactId = mod_id
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
name = "Disk"
|
||||
url = uri("D:/git/maven-repository-raw")
|
||||
}
|
||||
}
|
||||
repositories {}
|
||||
}
|
||||
|
||||
idea.module { downloadJavadoc = downloadSources = true }
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
sourceSets.each {
|
||||
def dir = layout.buildDirectory.dir("sourcesSets/$it.name")
|
||||
|
@ -1,10 +1,10 @@
|
||||
org.gradle.jvmargs=-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=1024m
|
||||
systemProp.file.encoding=UTF-8
|
||||
minecraft_version=1.21
|
||||
minecraft_version_range=[1.21,1.22)
|
||||
minecraft_version_range=[1.21,1.21.6)
|
||||
forge_version=51.0.0
|
||||
forge_version_range=[51,)
|
||||
loader_version_range=[51,)
|
||||
forge_version_range=[50,)
|
||||
loader_version_range=[50,)
|
||||
mapping_channel=official
|
||||
mapping_version=1.21
|
||||
mod_id=enchantmentdoesnotconflict
|
||||
|
@ -6,6 +6,7 @@ import com.mojang.logging.LogUtils;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
@ -17,8 +18,9 @@ public class EnchantmentDoNotConflictForge {
|
||||
public static final String MODID = "enchantmentdoesnotconflict";
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
public EnchantmentDoNotConflictForge(FMLJavaModLoadingContext context) {
|
||||
context.getModEventBus().addListener(this::commonSetup);
|
||||
public EnchantmentDoNotConflictForge() {
|
||||
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||
modEventBus.addListener(this::commonSetup);
|
||||
MinecraftForge.EVENT_BUS.addListener(this::onPlayerLogin);
|
||||
}
|
||||
|
||||
|
@ -44,18 +44,17 @@ public class ModConfig {
|
||||
ModConfig.instance = instance;
|
||||
}
|
||||
|
||||
public static Map<String, List<String>> load() {
|
||||
public static void load() {
|
||||
try {
|
||||
if (Files.exists(CONFIG_PATH)) {
|
||||
return GSON.fromJson(Files.newBufferedReader(CONFIG_PATH), TYPE);
|
||||
setInstance(GSON.fromJson(Files.newBufferedReader(CONFIG_PATH), TYPE));
|
||||
return;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOGGER.error(e.getMessage(),e);
|
||||
}
|
||||
Map<String, List<String>> modConfig = getDefData();
|
||||
setInstance(modConfig);
|
||||
setInstance(getDefData());
|
||||
save();
|
||||
return modConfig;
|
||||
}
|
||||
|
||||
public static void save() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "com.mingliqiye.minecraft.enchantment.conflict.mixin",
|
||||
"refmap": "enchantmentdoesnotconflict.mixins.refmap.json",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"EnchantmentMixin"
|
||||
@ -9,7 +8,7 @@
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"minVersion": "0.8",
|
||||
"minVersion": "0.8.5",
|
||||
"overwrites": {
|
||||
"requireAnnotations": true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user