Jump to content

Proxxo

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Proxxo

  1. Thanks, that really looks like what I need. Yeah, I am probably spoiled by stackoverflow.com.
  2. Hi Draco, thank you for taking the time to read and post to my question. Of course I know that I could just copy and paste files with java - do you assume that devs posting questions here don't know that? Perhaps my question was not clear enough. I am looking for the Forge-way to copy the current and nearby chunks of a player into a new world file. Is there something like chunk.saveToDisk() or an API to save into .dat or .mca files?
  3. Hi modders, I want to be able to "clone" parts of the world the player currently stand in. The cloned world should be saved as a new map on the client. First of, I just want to create a new single player map file. Is this possible with Forge? I have looked into the article of WorldSavedData but as far as I can say its intention is not to be used to create new worlds. Also, creating a new world generator does not seem to fit my scenario. I want the new map to be created while the player is in game. Does anyone know how to start? Thanks.
  4. Hi jabelar, thank you very much for this insights into the development process of Forge and Minecraft. Constantly working on my mod to keep it up to date with the latest Forge version was something that came into my mind when I read @Draco18s post. I will do my best. However, Forge is a great project and it's exciting to learn some fundamental different concepts compared to what I used in the past.
  5. Implementing client-only commands works like this: 1. Implement ICommand I created an example command that will show the current time to a user like this: public class GetTimeCommand implements ICommand { @Override public int compareTo(ICommand arg0) { return 0; } @Override public String getName() { return "realtime"; } @Override public String getUsage(ICommandSender sender) { return "/realtime"; } @Override public List<String> getAliases() { List<String> aliases = Lists.<String>newArrayList(); aliases.add("/realtime"); return aliases; } @Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); String time = dateFormat.format(new Date(System.currentTimeMillis())); sender.sendMessage(format(net.minecraft.util.text.TextFormatting.DARK_GREEN, time)); } @Override public boolean checkPermission(MinecraftServer server, ICommandSender sender) { return true; } @Override public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos targetPos) { return null; } @Override public boolean isUsernameIndex(String[] args, int index) { return false; } private TextComponentTranslation format(TextFormatting color, String str, Object... args) { TextComponentTranslation ret = new TextComponentTranslation(str, args); ret.getStyle().setColor(color); return ret; } } 2. Register your command Find a good place to register your command(s) at mod start up. I decided to first implement proxies for server and client like described in the Docs: https://mcforge.readthedocs.io/en/latest/concepts/sides/. Then, in my ClientProxy class, I put command registrations into the preInit event handler: public class ClientProxy extends CommonProxy { @Override public void preInit(FMLPreInitializationEvent e) { ClientCommandHandler.instance.registerCommand(new GetTimeCommand()); } ... } Thats it. In game, I can now input "/realtime" in chat and get the current time displayed.
  6. Thanks for your clarifications. I guess I first need to get more comfortable with these fast evolving Java ecosystems. I will post the answer to my own question after I found all code puzzle pieces to get client-only commands up and ready.
  7. Hi Draco, thanks for your quick post. Because of changes in the api. I do not assume that all classes (i.e. ClientCommandHandler) in version 1.7.x are still existing in 1.12. Or they may got renamed. Or deprecated. This sounds crazy to me . Is every build of forge a release version that people use in production? Coming from c# world, I am familiar with apis that update their documentation on every major/minor release. Intermediate work or bugfixes are handled in separate releases / hotfixes etc. Is this not the case with forge? When I look at the github pages, it seems that this may have changed, or am I wrong? https://github.com/MinecraftForge/MinecraftForge/releases Thanks for this tip. If there is no documentation about this, it seems that I have no other choise.
  8. Hi Forge community, I'm quite new to forge mod development and still searching for the single point of truth tutorial / documentation for Forge 1.12. I would like to implement a mod with various client-only commands (i.e. /realtime - displays the current time in players chat). Searching for "command" in the Docs section of this site unfortunaly does not display any useful resources for me. After using Google, I found various sites using a "ClientCommandHandler". But I can't see if this class is supported in 1.12 and if so, how to use it to register and execute client-only commands. Could anyone post a tutorial or some hints how I could start? And a last question: does an online java doc existst for the forge classes where I can browse around to explore all possibilities that I have with forge? Hope to be welcomed by forge community Proxxo
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.