geforkt von Mirrors/FastAsyncWorldEdit
Add a config setting to allow creative mode players to override inventory setting.
Dieser Commit ist enthalten in:
Ursprung
89bdd8d9ba
Commit
6abd48ab08
@ -98,6 +98,7 @@ public abstract class LocalConfiguration {
|
|||||||
public boolean noDoubleSlash = false;
|
public boolean noDoubleSlash = false;
|
||||||
public boolean useInventory = false;
|
public boolean useInventory = false;
|
||||||
public boolean useInventoryOverride = false;
|
public boolean useInventoryOverride = false;
|
||||||
|
public boolean useInventoryCreativeOverride = false;
|
||||||
public int navigationWand = ItemID.COMPASS;
|
public int navigationWand = ItemID.COMPASS;
|
||||||
public int navigationWandMaxDistance = 50;
|
public int navigationWandMaxDistance = 50;
|
||||||
public int scriptTimeout = 3000;
|
public int scriptTimeout = 3000;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
package com.sk89q.worldedit;
|
package com.sk89q.worldedit;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import com.sk89q.worldedit.bags.BlockBag;
|
import com.sk89q.worldedit.bags.BlockBag;
|
||||||
import com.sk89q.worldedit.blocks.BlockID;
|
import com.sk89q.worldedit.blocks.BlockID;
|
||||||
import com.sk89q.worldedit.blocks.BlockType;
|
import com.sk89q.worldedit.blocks.BlockType;
|
||||||
@ -669,4 +670,8 @@ public abstract class LocalPlayer {
|
|||||||
public boolean isPlayer() {
|
public boolean isPlayer() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasCreativeMode() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,8 @@ public class WorldEdit {
|
|||||||
// Have the session use inventory if it's enabled and the player
|
// Have the session use inventory if it's enabled and the player
|
||||||
// doesn't have an override
|
// doesn't have an override
|
||||||
session.setUseInventory(config.useInventory
|
session.setUseInventory(config.useInventory
|
||||||
&& !(config.useInventoryOverride
|
&& !((config.useInventoryOverride ||
|
||||||
|
(config.useInventoryCreativeOverride && player.hasCreativeMode()))
|
||||||
&& player.hasPermission("worldedit.inventory.unrestricted")));
|
&& player.hasPermission("worldedit.inventory.unrestricted")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,17 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.bukkit;
|
package com.sk89q.worldedit.bukkit;
|
||||||
|
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.sk89q.util.StringUtil;
|
import com.sk89q.util.StringUtil;
|
||||||
import com.sk89q.worldedit.*;
|
import com.sk89q.worldedit.LocalPlayer;
|
||||||
|
import com.sk89q.worldedit.LocalWorld;
|
||||||
|
import com.sk89q.worldedit.ServerInterface;
|
||||||
|
import com.sk89q.worldedit.Vector;
|
||||||
|
import com.sk89q.worldedit.WorldVector;
|
||||||
import com.sk89q.worldedit.bags.BlockBag;
|
import com.sk89q.worldedit.bags.BlockBag;
|
||||||
import com.sk89q.worldedit.cui.CUIEvent;
|
import com.sk89q.worldedit.cui.CUIEvent;
|
||||||
|
|
||||||
@ -139,4 +145,9 @@ public class BukkitPlayer extends LocalPlayer {
|
|||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCreativeMode() {
|
||||||
|
return player.getGameMode() == GameMode.CREATIVE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,8 @@ public class YAMLConfiguration extends LocalConfiguration {
|
|||||||
useInventory = config.getBoolean("use-inventory.enable", useInventory);
|
useInventory = config.getBoolean("use-inventory.enable", useInventory);
|
||||||
useInventoryOverride = config.getBoolean("use-inventory.allow-override",
|
useInventoryOverride = config.getBoolean("use-inventory.allow-override",
|
||||||
useInventoryOverride);
|
useInventoryOverride);
|
||||||
|
useInventoryCreativeOverride = config.getBoolean("use-inventory.creative-mode-overrides",
|
||||||
|
useInventoryCreativeOverride);
|
||||||
|
|
||||||
navigationWand = config.getInt("navigation-wand.item", navigationWand);
|
navigationWand = config.getInt("navigation-wand.item", navigationWand);
|
||||||
navigationWandMaxDistance = config.getInt("navigation-wand.max-distance", navigationWandMaxDistance);
|
navigationWandMaxDistance = config.getInt("navigation-wand.max-distance", navigationWandMaxDistance);
|
||||||
|
@ -34,6 +34,7 @@ limits:
|
|||||||
use-inventory:
|
use-inventory:
|
||||||
enable: false
|
enable: false
|
||||||
allow-override: true
|
allow-override: true
|
||||||
|
creative-mode-overrides: false
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
log-commands: false
|
log-commands: false
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren