SPIGOT-3491: Add option to bypass permissions in advancements
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -1,15 +1,47 @@
|
||||
--- a/net/minecraft/server/AdvancementRewards.java
|
||||
+++ b/net/minecraft/server/AdvancementRewards.java
|
||||
@@ -98,7 +98,7 @@
|
||||
}
|
||||
@@ -66,7 +66,24 @@
|
||||
CustomFunction customfunction = this.e.a(minecraftserver.aL());
|
||||
|
||||
public boolean getSendCommandFeedback() {
|
||||
- return minecraftserver.worldServer[0].getGameRules().getBoolean("commandBlockOutput");
|
||||
+ return minecraftserver.worlds.get(0).getGameRules().getBoolean("commandBlockOutput"); // CraftBukkit
|
||||
if (customfunction != null) {
|
||||
- ICommandListener icommandlistener = new ICommandListener() {
|
||||
+ // CraftBukkit start
|
||||
+ ICommandListener icommandlistener = new AdvancementCommandListener(entityplayer, minecraftserver);
|
||||
+
|
||||
+ minecraftserver.aL().a(customfunction, icommandlistener);
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public static class AdvancementCommandListener implements ICommandListener {
|
||||
+
|
||||
+ private final EntityPlayer entityplayer;
|
||||
+ private final MinecraftServer minecraftserver;
|
||||
+
|
||||
+ public AdvancementCommandListener(EntityPlayer entityplayer, MinecraftServer minecraftserver) {
|
||||
+ this.entityplayer = entityplayer;
|
||||
+ this.minecraftserver = minecraftserver;
|
||||
+ }
|
||||
+
|
||||
public String getName() {
|
||||
return entityplayer.getName();
|
||||
}
|
||||
@@ -108,12 +125,8 @@
|
||||
public MinecraftServer C_() {
|
||||
return entityplayer.C_();
|
||||
}
|
||||
- };
|
||||
-
|
||||
- minecraftserver.aL().a(customfunction, icommandlistener);
|
||||
- }
|
||||
-
|
||||
- }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
public void a(CommandObjectiveExecutor.EnumCommandResult commandobjectiveexecutor_enumcommandresult, int i) {
|
||||
@@ -156,7 +156,7 @@
|
||||
public String toString() {
|
||||
return "AdvancementRewards{experience=" + this.b + ", loot=" + Arrays.toString(this.c) + ", recipes=" + Arrays.toString(this.d) + ", function=" + this.e + '}';
|
||||
@@ -156,7 +169,7 @@
|
||||
return new AdvancementRewards(i, aminecraftkey, aminecraftkey1, customfunction_a);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user