Jump to content

Recommended Posts

Posted

Hey, so I'm almost done porting this mod but I fail with this random class that doesn't seem to appear, I already swapped to the new function keys (getCommandName -> getName)

 

https://github.com/Derivates/fpsmod_1.12.2/blob/master/src/main/java/me/dewgs/fpsspoof/FPSSpoofModCommand.java

 

 

 

This is the crash-log:

  Reveal hidden contents

 

Here's a Screenshot just in case:

Image here (click)

Posted

If you're trying to fix the chat, you send chat with

(an instance of EntityPlayer).sendMessage(new TextComponentString(a String));

Posted

Never use any Client-Side only code (Minecraft::player etc) unless you are working with Client-Side only code.

The method execute already provides the player, abstracted into the ICommandSender. Use ICommandSender::getCommandSenderEntity to get the Entity back. Cast it to EntityPlayer if applicable, and voila, you're done.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted
  On 1/4/2018 at 4:29 AM, huiUIFO said:

Could you make an example of what should I replace on line 25?

Expand  
EntityPlayer player = (EntityPlayer) sender.getCommandSenderEntity();
player.sendMessage(new TextComponentString("Current FPS Spoof: " + this.mod.getSpoofType().toString() ));

This forum isn't a Java tutorial. Make sure you have basic Java knowledge.

and Matryoshika is correct, the calling of Minecraft.getMinecraft().getPlayer() would be bad especially when execute gives you the player executing in the form of ICommandSender.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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