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