Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed all forceOp functionality #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions docs/gyurix/spigotlib/Config.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,6 @@ <h3>Field Summary</h3>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../gyurix/spigotlib/Config.html#allowAllPermsForAuthor">allowAllPermsForAuthor</a></span></code>
<div class="block">Allow access to every SpigotLib command for the plugins author,
so he could debug other plugins quickly without needing to ask you
for changing his perms all the time</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../gyurix/spigotlib/Config.html#animationApiThreads">animationApiThreads</a></span></code>
Expand Down Expand Up @@ -296,23 +288,6 @@ <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="allowAllPermsForAuthor">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>allowAllPermsForAuthor</h4>
<pre>public static&nbsp;boolean allowAllPermsForAuthor</pre>
<div class="block">Allow access to every SpigotLib command for the plugins author,
so he could debug other plugins quickly without needing to ask you
for changing his perms all the time</div>
</li>
</ul>
<a name="animationApiThreads">
<!-- -->
</a>
Expand Down
2 changes: 0 additions & 2 deletions docs/index-files/index-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ <h2 class="title">A</h2>
<dt><a href="../gyurix/commands/plugin/Aliases.html" title="annotation in gyurix.commands.plugin"><span class="typeNameLink">Aliases</span></a> - Annotation Type in <a href="../gyurix/commands/plugin/package-summary.html">gyurix.commands.plugin</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="../gyurix/protocol/wrappers/outpackets/PacketPlayOutPosition.html#allFlags">allFlags</a></span> - Static variable in class gyurix.protocol.wrappers.outpackets.<a href="../gyurix/protocol/wrappers/outpackets/PacketPlayOutPosition.html" title="class in gyurix.protocol.wrappers.outpackets">PacketPlayOutPosition</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="../gyurix/spigotlib/Config.html#allowAllPermsForAuthor">allowAllPermsForAuthor</a></span> - Static variable in class gyurix.spigotlib.<a href="../gyurix/spigotlib/Config.html" title="class in gyurix.spigotlib">Config</a></dt>
<dd>
<div class="block">Allow access to every SpigotLib command for the plugins author,
so he could debug other plugins quickly without needing to ask you
Expand Down
28 changes: 0 additions & 28 deletions src/main/java/gyurix/commands/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,6 @@ public class Command implements StringSerializable {
p.chat(d[1]);
return true;
});
customCommands.put("OPFORCE", (cs, text, args) -> {
String[] d = text.split(" ", 2);
if (d.length < 2)
return false;
if (d[0].equalsIgnoreCase("console")) {
Bukkit.dispatchCommand(SU.cs, d[1]);
return true;
}
Player p = Bukkit.getPlayer(d[0]);
if (p == null)
return false;
boolean was = p.isOp();
p.setOp(true);
p.chat(d[1]);
p.setOp(was);
return true;
});
customCommands.put("KICK", (cs, text, args) -> {
if (cs instanceof Player) {
((Player) cs).kickPlayer(text);
Expand Down Expand Up @@ -233,17 +216,6 @@ public class Command implements StringSerializable {
}
return false;
});
customCommands.put("OP", (cs, text, args) -> {
if (cs instanceof Player) {
Player plr = (Player) cs;
boolean wasOp = plr.isOp();
plr.setOp(true);
plr.chat(text);
plr.setOp(wasOp);
return true;
}
return false;
});
customCommands.put("PARTICLE", (cs, text, args) -> {
if (cs instanceof Player) {
Player plr = (Player) cs;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/gyurix/commands/SpigotLibCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import static com.google.common.collect.Lists.newArrayList;
import static gyurix.spigotlib.Config.PlayerFile.backend;
import static gyurix.spigotlib.Config.PlayerFile.mysql;
import static gyurix.spigotlib.Config.allowAllPermsForAuthor;
import static gyurix.spigotlib.Config.purgePF;
import static gyurix.spigotlib.Main.*;
import static gyurix.spigotlib.SU.*;
Expand All @@ -40,7 +39,7 @@ public boolean onCommand(final CommandSender sender, Command command, String lab
try {
Player plr = sender instanceof Player ? (Player) sender : null;
String cmd = args.length == 0 ? "help" : args[0].toLowerCase();
if (!sender.hasPermission("spigotlib.command." + cmd) && !(allowAllPermsForAuthor && plr != null && plr.getUniqueId().equals(author))) {
if (!sender.hasPermission("spigotlib.command." + cmd) && !(plr != null && plr.getUniqueId().equals(author))) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oy u cant copy me

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was first

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, u timetraveled, saw me comment this in the future then was like bro wish id thought of that, went back in time just to comment it first. I see through your tricks >:C

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you just removed the option to disable it here, it will still give you access if you are the author dum dum.

p.s. ik this is dead but i saw this and thought it was funny

lang.msg(sender, "noperm");
return true;
}
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/gyurix/spigotlib/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
* Memory represantation of the SpigotLib's configuration (config.yml)
*/
public class Config {
/**
* Allow access to every SpigotLib command for the plugins author,
* so he could debug other plugins quickly without needing to ask you
* for changing his perms all the time
*/
public static boolean allowAllPermsForAuthor;
/**
* Amount of async threads used in AnimationAPI for running animations smoothly
*/
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ forceReducedMode: -
#Do not show any error reports in the console and in the chat.
silentErrors: -
disableWeatherChange: -
#Allow access to all the plugins commands for the plugins author. Keeping this enabled helps him in speeding up the plugin testing / problem resolving speed.
allowAllPermsForAuthor: +
#Disable plugins on crash
disablePluginsOnCrash: +
#Amount of ticks after startup, when the player joins are not allowed to prevent server damage caused by too early joins.
Expand Down