mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-26 11:33:07 +00:00
up
This commit is contained in:
1 parent
bc8b4e1068
commit
3caa0d81e4
17 files changed
+99
-125
No files matched your search
@@ -297,12 +297,12 @@ public class CommandEX {
|
||||
return search;
|
||||
}
|
||||
} else {
|
||||
if (arg[0].isEmpty() || arg.length == 1) {
|
||||
if (arg[0] == null || arg[0].isEmpty() || arg.length == 1) {
|
||||
arguments.addAll(normal);
|
||||
if (AllMusic.getConfig().adminList.contains(name)) {
|
||||
arguments.addAll(admin);
|
||||
}
|
||||
if (arg[0].isEmpty()) {
|
||||
if (arg[0] == null || arg[0].isEmpty()) {
|
||||
if (AllMusic.getSearch(name) != null) {
|
||||
return search;
|
||||
}
|
||||
|
||||
@@ -12,9 +12,8 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraftforge.fml.common.network.FMLEventChannel;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -24,14 +23,13 @@ import java.util.Locale;
|
||||
@Mod(modid = "allmusic_server", version = AllMusic.version, acceptableRemoteVersions = "*", acceptedMinecraftVersions = "[1.12,)", serverSideOnly = true)
|
||||
public class AllMusicForge {
|
||||
public static MinecraftServer server;
|
||||
public static SimpleNetworkWrapper channel;
|
||||
public static FMLEventChannel channel;
|
||||
public static final Logger LOGGER = LogManager.getLogger("AllMusic_Server");
|
||||
|
||||
@Mod.EventHandler
|
||||
private void commonSetup(final FMLPreInitializationEvent event) {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
channel = NetworkRegistry.INSTANCE.newSimpleChannel("allmusic:channel");
|
||||
channel.registerMessage(PacketMessageHandler.class, PacketMessage.class, 0, Side.SERVER);
|
||||
channel = NetworkRegistry.INSTANCE.newEventDrivenChannel("allmusic:channel");
|
||||
|
||||
String path = String.format(Locale.ROOT, "config/%s/", "AllMusic3");
|
||||
|
||||
|
||||
@@ -18,8 +18,11 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.network.play.server.SPacketCustomPayload;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -463,7 +466,9 @@ public class SideForge extends ISide {
|
||||
if (players == null)
|
||||
return;
|
||||
try {
|
||||
runTask(() -> AllMusicForge.channel.sendTo(new PacketMessage(data), players));
|
||||
runTask(() -> AllMusicForge.channel.sendTo(new FMLProxyPacket(
|
||||
new SPacketCustomPayload("allmusic:channel", new PacketBuffer(data))
|
||||
), players));
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§c数据发送发生错误");
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -21,8 +21,6 @@ import net.minecraftforge.fml.event.server.FMLServerStartedEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.network.NetworkEvent;
|
||||
import net.minecraftforge.fml.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.network.simple.SimpleChannel;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -34,8 +32,7 @@ import java.util.function.Supplier;
|
||||
@Mod(AllMusicForge.MODID)
|
||||
public class AllMusicForge {
|
||||
public static MinecraftServer server;
|
||||
public static final SimpleChannel channel = NetworkRegistry.newSimpleChannel(new ResourceLocation("allmusic", "channel"),
|
||||
() -> "1.0", s -> true, s -> true);
|
||||
public static final ResourceLocation channel = new ResourceLocation("allmusic", "channel");
|
||||
|
||||
// Define mod id in a common place for everything to reference
|
||||
public static final String MODID = "allmusic_server";
|
||||
@@ -54,8 +51,6 @@ public class AllMusicForge {
|
||||
}
|
||||
|
||||
private void commonSetup(final FMLCommonSetupEvent event) {
|
||||
channel.registerMessage(0, ByteBuf.class, this::enc, this::dec, this::proc);
|
||||
|
||||
String path = String.format(Locale.ROOT, "config/%s/", "AllMusic3");
|
||||
|
||||
AllMusic.log = new LogForge();
|
||||
@@ -64,19 +59,6 @@ public class AllMusicForge {
|
||||
new AllMusic().init(new File(path));
|
||||
}
|
||||
|
||||
private void enc(ByteBuf str, PacketBuffer buffer) {
|
||||
buffer.writeBytes(str);
|
||||
}
|
||||
|
||||
private ByteBuf dec(PacketBuffer buffer) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
private void proc(ByteBuf str, Supplier<NetworkEvent.Context> supplier) {
|
||||
NetworkEvent.Context context = supplier.get();
|
||||
context.setPacketHandled(true);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRegisterCommands(RegisterCommandsEvent event) {
|
||||
CommandDispatcher<CommandSource> dispatcher = event.getDispatcher();
|
||||
|
||||
@@ -18,6 +18,8 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.network.play.client.CCustomPayloadPacket;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.network.PacketDistributor;
|
||||
@@ -465,9 +467,8 @@ public class SideForge extends ISide {
|
||||
if (players == null)
|
||||
return;
|
||||
try {
|
||||
runTask(() -> AllMusicForge.channel.send(PacketDistributor.PLAYER.with(
|
||||
() -> players
|
||||
), data));
|
||||
runTask(() -> PacketDistributor.PLAYER.with( () -> players)
|
||||
.send(new CCustomPayloadPacket(AllMusicForge.channel, new PacketBuffer(data))) );
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§c数据发送发生错误");
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -34,8 +34,7 @@ import java.util.function.Supplier;
|
||||
@Mod(AllMusicForge.MODID)
|
||||
public class AllMusicForge {
|
||||
public static MinecraftServer server;
|
||||
public static final SimpleChannel channel = NetworkRegistry.newSimpleChannel(new ResourceLocation("allmusic", "channel"),
|
||||
() -> "1.0", s -> true, s -> true);
|
||||
public static final ResourceLocation channel = new ResourceLocation("allmusic", "channel");
|
||||
|
||||
// Define mod id in a common place for everything to reference
|
||||
public static final String MODID = "allmusic_server";
|
||||
@@ -54,8 +53,6 @@ public class AllMusicForge {
|
||||
}
|
||||
|
||||
private void commonSetup(final FMLCommonSetupEvent event) {
|
||||
channel.registerMessage(0, String.class, this::enc, this::dec, this::proc);
|
||||
|
||||
String path = String.format(Locale.ROOT, "config/%s/", "AllMusic3");
|
||||
|
||||
AllMusic.log = new LogForge();
|
||||
@@ -64,19 +61,6 @@ public class AllMusicForge {
|
||||
new AllMusic().init(new File(path));
|
||||
}
|
||||
|
||||
private void enc(String str, FriendlyByteBuf buffer) {
|
||||
buffer.writeBytes(str.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
private String dec(FriendlyByteBuf buffer) {
|
||||
return buffer.toString(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
private void proc(String str, Supplier<NetworkEvent.Context> supplier) {
|
||||
NetworkEvent.Context context = supplier.get();
|
||||
context.setPacketHandled(true);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRegisterCommands(RegisterCommandsEvent event) {
|
||||
CommandDispatcher<CommandSourceStack> dispatcher = event.getDispatcher();
|
||||
|
||||
@@ -17,7 +17,9 @@ import com.google.gson.Gson;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.commands.CommandSource;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.network.PacketDistributor;
|
||||
@@ -465,9 +467,10 @@ public class SideForge extends ISide {
|
||||
if (players == null)
|
||||
return;
|
||||
try {
|
||||
runTask(() -> AllMusicForge.channel.send(PacketDistributor.PLAYER.with(
|
||||
runTask(() -> PacketDistributor.PLAYER.with(
|
||||
() -> players
|
||||
), data));
|
||||
).send(new ClientboundCustomPayloadPacket(AllMusicForge.channel,
|
||||
new FriendlyByteBuf(data))));
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§c数据发送发生错误");
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -34,8 +34,7 @@ import java.util.function.Supplier;
|
||||
@Mod(AllMusicForge.MODID)
|
||||
public class AllMusicForge {
|
||||
public static MinecraftServer server;
|
||||
public static final SimpleChannel channel = NetworkRegistry.newSimpleChannel(new ResourceLocation("allmusic", "channel"),
|
||||
() -> "1.0", s -> true, s -> true);
|
||||
public static final ResourceLocation channel = new ResourceLocation("allmusic", "channel");
|
||||
|
||||
// Define mod id in a common place for everything to reference
|
||||
public static final String MODID = "allmusic_server";
|
||||
@@ -54,8 +53,6 @@ public class AllMusicForge {
|
||||
}
|
||||
|
||||
private void commonSetup(final FMLCommonSetupEvent event) {
|
||||
channel.registerMessage(0, String.class, this::enc, this::dec, this::proc);
|
||||
|
||||
String path = String.format(Locale.ROOT, "config/%s/", "AllMusic3");
|
||||
|
||||
AllMusic.log = new LogForge();
|
||||
@@ -64,19 +61,6 @@ public class AllMusicForge {
|
||||
new AllMusic().init(new File(path));
|
||||
}
|
||||
|
||||
private void enc(String str, FriendlyByteBuf buffer) {
|
||||
buffer.writeBytes(str.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
private String dec(FriendlyByteBuf buffer) {
|
||||
return buffer.toString(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
private void proc(String str, Supplier<NetworkEvent.Context> supplier) {
|
||||
NetworkEvent.Context context = supplier.get();
|
||||
context.setPacketHandled(true);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRegisterCommands(RegisterCommandsEvent event) {
|
||||
CommandDispatcher<CommandSourceStack> dispatcher = event.getDispatcher();
|
||||
@@ -90,8 +74,6 @@ public class AllMusicForge {
|
||||
|
||||
AllMusic.start();
|
||||
Tasks.init();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -17,7 +17,9 @@ import com.google.gson.Gson;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.commands.CommandSource;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.network.PacketDistributor;
|
||||
@@ -464,9 +466,10 @@ public class SideForge extends ISide {
|
||||
if (players == null)
|
||||
return;
|
||||
try {
|
||||
runTask(() -> AllMusicForge.channel.send(PacketDistributor.PLAYER.with(
|
||||
runTask(() -> PacketDistributor.PLAYER.with(
|
||||
() -> players
|
||||
), data));
|
||||
).send(new ClientboundCustomPayloadPacket(AllMusicForge.channel,
|
||||
new FriendlyByteBuf(data))));
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§c数据发送发生错误");
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -34,8 +34,7 @@ import java.util.function.Supplier;
|
||||
@Mod(AllMusicForge.MODID)
|
||||
public class AllMusicForge {
|
||||
public static MinecraftServer server;
|
||||
public static final SimpleChannel channel = NetworkRegistry.newSimpleChannel(new ResourceLocation("allmusic", "channel"),
|
||||
() -> "1.0", s -> true, s -> true);
|
||||
public static final ResourceLocation channel = new ResourceLocation("allmusic", "channel");
|
||||
|
||||
// Define mod id in a common place for everything to reference
|
||||
public static final String MODID = "allmusic_server";
|
||||
@@ -54,8 +53,6 @@ public class AllMusicForge {
|
||||
}
|
||||
|
||||
private void commonSetup(final FMLCommonSetupEvent event) {
|
||||
channel.registerMessage(0, String.class, this::enc, this::dec, this::proc);
|
||||
|
||||
String path = String.format(Locale.ROOT, "config/%s/", "AllMusic3");
|
||||
|
||||
AllMusic.log = new LogForge();
|
||||
@@ -64,19 +61,6 @@ public class AllMusicForge {
|
||||
new AllMusic().init(new File(path));
|
||||
}
|
||||
|
||||
private void enc(String str, FriendlyByteBuf buffer) {
|
||||
buffer.writeBytes(str.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
private String dec(FriendlyByteBuf buffer) {
|
||||
return buffer.toString(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
private void proc(String str, Supplier<NetworkEvent.Context> supplier) {
|
||||
NetworkEvent.Context context = supplier.get();
|
||||
context.setPacketHandled(true);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRegisterCommands(RegisterCommandsEvent event) {
|
||||
CommandDispatcher<CommandSourceStack> dispatcher = event.getDispatcher();
|
||||
@@ -90,8 +74,6 @@ public class AllMusicForge {
|
||||
|
||||
AllMusic.start();
|
||||
Tasks.init();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -17,7 +17,9 @@ import com.google.gson.Gson;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.commands.CommandSource;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.network.PacketDistributor;
|
||||
@@ -464,9 +466,10 @@ public class SideForge extends ISide {
|
||||
if (players == null)
|
||||
return;
|
||||
try {
|
||||
runTask(() -> AllMusicForge.channel.send(PacketDistributor.PLAYER.with(
|
||||
runTask(() -> PacketDistributor.PLAYER.with(
|
||||
() -> players
|
||||
), data));
|
||||
).send(new ClientboundCustomPayloadPacket(AllMusicForge.channel,
|
||||
new FriendlyByteBuf(data))));
|
||||
} catch (Exception e) {
|
||||
AllMusic.log.warning("§c数据发送发生错误");
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -90,8 +90,6 @@ public class AllMusicForge {
|
||||
|
||||
AllMusic.start();
|
||||
Tasks.init();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -20,6 +20,7 @@ build
|
||||
# other
|
||||
eclipse
|
||||
run
|
||||
runs
|
||||
|
||||
# Files from Forge MDK
|
||||
forge*changelog.txt
|
||||
@@ -1,22 +1,23 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'eclipse'
|
||||
id 'idea'
|
||||
id 'maven-publish'
|
||||
id 'net.neoforged.gradle.userdev' version '7.0.+'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
id 'net.neoforged.gradle.userdev' version '7.0.109'
|
||||
}
|
||||
|
||||
version = mod_version
|
||||
group = mod_group_id
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
base {
|
||||
archivesName = file_name
|
||||
}
|
||||
|
||||
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
|
||||
// Mojang ships Java 21 to end users starting in 1.20.5, so mods should target Java 21.
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
|
||||
|
||||
// Enable the Jar-in-Jar system for your mod
|
||||
@@ -71,34 +72,41 @@ runs {
|
||||
}
|
||||
}
|
||||
|
||||
jarJar {
|
||||
// Include or exclude dependencies here from runtime configuration
|
||||
dependencies {
|
||||
// Exclude any dependency which begins with 'com.google.gson.'
|
||||
//exclude(dependency('org.gradle:gradle-core:2.2'))
|
||||
}
|
||||
}
|
||||
|
||||
// Include resources generated by data generators.
|
||||
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||
|
||||
// Sets up a dependency configuration called 'localRuntime'.
|
||||
// This configuration should be used instead of 'runtimeOnly' to declare
|
||||
// a dependency that will be present for runtime testing but that is
|
||||
// "optional", meaning it will not be pulled by dependents of this mod.
|
||||
configurations {
|
||||
runtimeClasspath.extendsFrom localRuntime
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Specify the version of Minecraft to use.
|
||||
// Any artifact can be supplied so long as it has a "userdev" classifier artifact and is a compatible patcher artifact.
|
||||
// The "userdev" classifier will be requested and setup by ForgeGradle.
|
||||
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
|
||||
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
|
||||
// Depending on the plugin applied there are several options. We will assume you applied the userdev plugin as shown above.
|
||||
// The group for userdev is net.neoforged, the module name is neoforge, and the version is the same as the neoforge version.
|
||||
// You can however also use the vanilla plugin (net.neoforged.gradle.vanilla) to use a version of Minecraft without the neoforge loader.
|
||||
// And its provides the option to then use net.minecraft as the group, and one of; client, server or joined as the module name, plus the game version as version.
|
||||
// For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
|
||||
implementation "net.neoforged:neoforge:${neo_version}"
|
||||
|
||||
// Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
|
||||
// Example optional mod dependency with JEI
|
||||
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
|
||||
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
|
||||
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")
|
||||
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")
|
||||
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
|
||||
// compileOnly "mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}"
|
||||
// We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it
|
||||
// localRuntime "mezz.jei:jei-${mc_version}-neoforge:${jei_version}"
|
||||
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.+'
|
||||
implementation 'org.xerial:sqlite-jdbc:3.+'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.+"
|
||||
|
||||
jarJar (group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: '[1.9.10, 2.0)')
|
||||
jarJar (group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk7', version: '[1.9.10, 2.0)')
|
||||
jarJar (group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: '[1.9.10, 2.0)')
|
||||
jarJar (group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-common', version: '[1.9.10, 2.0)')
|
||||
jarJar (group: 'com.squareup.okhttp3', name: 'okhttp', version: '[4.10, 5.0)')
|
||||
jarJar (group: 'com.squareup.okio', name: 'okio-jvm', version: '[3.6, 4.0)') {
|
||||
jarJar.pin(it, '3.6.0')
|
||||
@@ -108,7 +116,13 @@ dependencies {
|
||||
// Example mod dependency using a mod jar from ./libs with a flat dir repository
|
||||
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
|
||||
// The group id is ignored when searching -- in this case, it is "blank"
|
||||
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
|
||||
// implementation "blank:coolmod-${mc_version}:${coolmod_version}"
|
||||
|
||||
// Example mod dependency using a file as dependency
|
||||
// implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar")
|
||||
|
||||
// Example project dependency using a sister or child project:
|
||||
// implementation project(":myproject")
|
||||
|
||||
// For more info:
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
@@ -135,11 +149,25 @@ tasks.withType(ProcessResources).configureEach {
|
||||
]
|
||||
inputs.properties replaceProperties
|
||||
|
||||
filesMatching(['META-INF/mods.toml']) {
|
||||
filesMatching(['META-INF/neoforge.mods.toml']) {
|
||||
expand replaceProperties
|
||||
}
|
||||
}
|
||||
|
||||
// Example configuration to allow publishing using the maven-publish plugin
|
||||
publishing {
|
||||
publications {
|
||||
register('mavenJava', MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url "file://${project.projectDir}/repo"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ minecraft_version=1.20.5
|
||||
# as they do not follow standard versioning conventions.
|
||||
minecraft_version_range=[1.20.5,1.21)
|
||||
# The Neo version must agree with the Minecraft version to get a valid artifact
|
||||
neo_version=20.5.3-beta
|
||||
neo_version=20.5.21-beta
|
||||
# The Neo version range can use any version of Neo as bounds
|
||||
neo_version_range=[20.5,)
|
||||
# The loader version range can only use the major version of FML as bounds
|
||||
|
||||
@@ -43,7 +43,7 @@ public class AllMusicForge {
|
||||
private static class HandelPack implements IPayloadHandler<PackData> {
|
||||
@Override
|
||||
public void handle(@NotNull PackData payload, IPayloadContext context) {
|
||||
context.handle(payload);
|
||||
//context.handle(payload);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,11 +65,9 @@ public class AllMusicForge {
|
||||
new AllMusic().init(new File(path));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void register(final RegisterPayloadHandlersEvent event) {
|
||||
final PayloadRegistrar registrar = event.registrar("1.0")
|
||||
.optional();
|
||||
registrar.playBidirectional(PackData.TYPE, PackData.CODEC, new HandelPack());
|
||||
.optional().playToClient(PackData.TYPE, PackData.CODEC, new HandelPack());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
+9
-3
@@ -1,4 +1,4 @@
|
||||
# This is an example mods.toml file. It contains the data relating to the loading mods.
|
||||
# This is an example neoforge.neoforge.mods.toml file. It contains the data relating to the loading mods.
|
||||
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
|
||||
# The overall format is standard TOML format, v0.5.0.
|
||||
# Note that there are a couple of TOML lists in this file.
|
||||
@@ -35,7 +35,7 @@ displayName="${mod_name}" #mandatory
|
||||
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
|
||||
|
||||
# A file name (in the root of the mod JAR) containing a logo for display
|
||||
logoFile="icon.png" #optional
|
||||
#logoFile="examplemod.png" #optional
|
||||
|
||||
# A text field displayed in the mod UI
|
||||
#credits="" #optional
|
||||
@@ -91,4 +91,10 @@ type="required"
|
||||
# This version range declares a minimum of the current minecraft version up to but not including the next major version
|
||||
versionRange="${minecraft_version_range}"
|
||||
ordering="NONE"
|
||||
side="SERVER"
|
||||
side="SERVER"
|
||||
|
||||
# Features are specific properties of the game environment, that you may want to declare you require. This example declares
|
||||
# that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't
|
||||
# stop your mod loading on the server for example.
|
||||
#[features.${mod_id}]
|
||||
#openGLVersion="[3.2,)"
|
||||
Reference in new issue
Block a user