Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I have a few commands on my mod that i don't want regular players using. Until i work out how to set permissions (or build a permission manager if i have to) i want to restrict these commands to OP, while letting players use other commands.

 

it's worth noting that i have one command with several functions based on the first argument (/wallet set..... /wallet pay... etc)

 

so at the start of each command that i want to restrict. i need to check if the player is OP. Can someone tell me how to do this please?

 

 

don't you just hate being a Nooby modder? At the stage where tutorials aren't spoon feeding you through to releasing a mod, leaving you to ask many, many questions that seem to have simple answers?

MinecraftServer.getServer().getConfigurationManager().getOppedPlayers().getGameProfileFromName(player.getName()) != null

 

Alos this:

MinecraftServer.getServer().isSinglePlayer()

 

For SP you will want to give full perm, ay?

1.7.10 is no longer supported by forge, you are on your own.

FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().canSendCommands((<ENTITYPLAYERMP>).getGameProfile())

 

That should work on servers and in the case of single player, respect if cheats are enabled.

This is the same on 1.7.10 and 1.8

  • Author

MinecraftServer.getServer().getConfigurationManager().getOppedPlayers().getGameProfileFromName(player.getName()) != null

 

Alos this:

MinecraftServer.getServer().isSinglePlayer()

 

For SP you will want to give full perm, ay?

 

"getOppedPlayers()" apparently isn't a method 0.o thoughts?

  • Author

FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().canSendCommands((<ENTITYPLAYERMP>).getGameProfile())

 

That should work on servers and in the case of single player, respect if cheats are enabled.

This is the same on 1.7.10 and 1.8

 

"canSendCommands()" apaprently doesn't exist either :/

Update your mappings then, in your build.gradle put

mappings = "stable_12"

in the

minecraft {
  // Stuff
}

section.

 

Then re-setupDecompWorkspace

  • Author

Update your mappings then, in your build.gradle put

mappings = "stable_12"

in the

minecraft {
  // Stuff
}

section.

 

Then re-setupDecompWorkspace

 

okay, i'll do this now. could you explain what this does? (so i know when it might be necessary for future ref.)

  • Author

Use the one I gave you, if canSendCommands still isn't there, try func_152596_g

 

This works like a charm :) thanks

  • Author

Use the one I gave you, if canSendCommands still isn't there, try func_152596_g

 

this resolved that issue, but func_152596_g is causing gradlew build to fail :/ thoughts?

 

I'm so damn close to releasing my mod!

Try re-running gradle eclipse (Assuming you use eclipse, idea if not)

Refresh your workspace so the referenced libraries are up to date.

If func_152596_g turns into an error, replace it with canSendCommands

Try building your mod.

  • Author

Try re-running gradle eclipse (Assuming you use eclipse, idea if not)

Refresh your workspace so the referenced libraries are up to date.

If func_152596_g turns into an error, replace it with canSendCommands

Try building your mod.

 

thank you, this fixed it :)

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.