Skip to content

Commit

Permalink
fix network net working
Browse files Browse the repository at this point in the history
  • Loading branch information
MelanX committed Jun 20, 2024
1 parent 8f073b8 commit ac762cd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Build and publish to maven
uses: gradle/actions/setup-gradle@v3
with:
arguments: clean build publish curseforge modrinth
arguments: clean build publish curseforge modrinth --no-configuration-cache
env:
GIT_COMMIT: ${{ github.sha }}
GIT_PREVIOUS_COMMIT: ${{ github.event.before }}
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugins {
id 'maven-publish'
id 'net.darkhax.curseforgegradle' version '1.1.18'
id 'com.modrinth.minotaur' version '2.+'
id 'net.neoforged.moddev' version '0.1.74'
id 'net.neoforged.moddev' version '0.1.94'
}

version = getVersion(minecraft_version + "-" + base_version, new URL(remote_maven + "/" + group.replace('.', '/') + "/" + name + "/maven-metadata.xml"))
Expand Down Expand Up @@ -52,6 +52,8 @@ neoForge {
mappingsVersion = project.parchment_mappings_version
}

accessTransformers.add('src/main/resources/META-INF/accesstransformer.cfg')

runs {
client {
client()
Expand Down Expand Up @@ -112,7 +114,6 @@ tasks.withType(ProcessResources).configureEach {
}
}

// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/de/melanx/simplebackups/SimpleBackups.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,18 @@
import de.melanx.simplebackups.config.CommonConfig;
import de.melanx.simplebackups.config.ServerConfig;
import de.melanx.simplebackups.network.Pause;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent;
import net.neoforged.neoforge.network.handling.IPayloadContext;
import net.neoforged.neoforge.network.handling.IPayloadHandler;
import net.neoforged.neoforge.network.registration.PayloadRegistrar;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.stream.Stream;

@Mod(SimpleBackups.MODID)
public class SimpleBackups {

Expand Down Expand Up @@ -50,5 +43,6 @@ private void onRegisterPayloadHandler(RegisterPayloadHandlersEvent event) {
}

private void setup(FMLCommonSetupEvent event) {
// NO-OP
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import com.mojang.brigadier.builder.ArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import de.melanx.simplebackups.BackupData;
import de.melanx.simplebackups.SimpleBackups;
import de.melanx.simplebackups.network.Pause;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.neoforged.neoforge.network.PacketDistributor;

public class PauseCommand implements Command<CommandSourceStack> {

Expand All @@ -29,7 +30,7 @@ private PauseCommand(boolean paused) {
public int run(CommandContext<CommandSourceStack> context) {
BackupData data = BackupData.get(context.getSource().getServer());
data.setPaused(this.paused);
// SimpleBackups.network().pause(this.paused);
PacketDistributor.sendToAllPlayers(new Pause(this.paused));
return this.paused ? 1 : 0;
}
}
42 changes: 0 additions & 42 deletions src/main/java/de/melanx/simplebackups/network/SimpleNetwork.java

This file was deleted.

0 comments on commit ac762cd

Please sign in to comment.