your current location:首页 > news>How to make high versions of RELOADEMC?

How to make high versions of RELOADEMC?

2024-12-10 17:52:21|Myriagame |source:minecraft skins

This tutorial is set by the author to use the CC By-NC-ND protocol.

The profile of the equivalent exchange version reads:

But do you find that the actual test is not as useful as RELOADEMC?what to do?The answer is simple, make one by yourself.

Want to read how to make and maintain your MOD before making a module?(Forge version) (only supports 1.18.x) tutorial.

How to make RELOADEMC instructions?

There is a reloademcccmd.java file in moze_intel.project.network.commands.The instructions at that time were realized

 Package Moze_intel.project.network.Commands;

Import Moze_intel.project.config.customemcparser;

Import Moze_intel.project.emc.emcmapper;

Import Moze_intel.project.network.packethandler;

import network.minecraft.command.commandbase;

import network.minecraft.command.icommandSender;

import network.minecraft.server.minecraftserver;

import network.minecraft.util.textComponenttranslation;

import javax.annotation.nonnull;

Public Class Reloademd EXTENDS CommandBase

{{

@Nonnull

@Override

public string getname ()

{{

Return "RELOADEMC";

}

@Nonnull

@Override

Public String Getusage

{{

Return "/Project Reloademc";

}

@Override

Public Void Execute (@Nonnull Minecraftserver Server, @Nonnull ICommandSender Sender, @Nonnull String [] Params)

{{

Sender.SendMessage (New TextComPonenttranslation ("PE.Command.reload.started");

Emcmapper.Clearmaps ();

Customemcparser.init ();

Emcmapper.map ();

Sender.SendMessage (New TextComPonenttranslation ("PE.Command.reload.Success");

PacketHandler.sendfragMenTemcpackettoall ();

}

@Override

Public int GetrequiredPerMissionLevel ()

{{

Return 4;

}

}

Although most of the methods have changed in the high version, the core method of the instruction has not changed.

1.18.2 instructions as an example:

 package github.com.gengyoubo.la.network.commands; Import com.mojang.brigadier.command;

import com.mojang.brigadier.commanddispatcher;

import com.mojang.brigadier.context.commandContext;

Import Moze_intel.project.config.customemcparser;

Import Moze_intel.project.emcmappinghandler;

Import Moze_intel.project.network.packethandler;

import network.minecraft.commands.comMandsourceStack;

import network.minecraft.commands.commands;

import network.minecraft.network.chansLatablecomponent;

import network.minecraft.server.reloadableServerResources;

import network.minecraft.server.packs.Rsources.RSourceManager;

Import Static Moze_intel.project.emcmappinghandler.Clearemcmap;

Public Class Reloademd Implements Command {{

Public ReloadableServerResources ServerResources;

Public ResourceManager ResourceManager;

@Override

Pbble int run (CommandConText confxt) {{{{{{{{{{,?

CommandSourceStack source = context.getsource ();

Source.SendSuccess

// Execute instruction logic

Clearmcmap ();

Customemcparser.init ();

Emcmappinghandler.map (serverResources, ResourceManager);

Source.SendSuccess

// Send the update package

PacketHandler.sendfragMenTemcpackettoall ();

Return 1;

}

Public Static Void Register (Commanddispatcher Dispatcher) {

Dispatcher.register (

Commands.literal ("Relademc")

.Requires (source-> source.haspermission (4)) // Set the level of permissions at 4

.Executes (New RELOADEMCCMD ())

);

}

}

Its core is

clearmcmap ();

Customemcparser.init ();

Emcmappinghandler.map (serverResources, ResourceManager);

In 1.12.2, it is

Emcmapper.Clearmaps ();

Customemcparser.init ();

Emcmapper.map ();

Maybe you have found that although the name of the class is changed, the core method has not changed.Just write like above.

Demonstrate

Although it is not very different from the RELOAD instruction.But because only EMC is loaded, it is very useful in the integration package!

refer to

/regoademc