3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 18:40:05 +01:00

Fix missing prefixes

Dieser Commit ist enthalten in:
NotMyFault 2019-04-11 15:13:15 +02:00
Ursprung 5af506de02
Commit d49be8047c

Datei anzeigen

@ -20,6 +20,7 @@
package com.sk89q.worldedit.extension.factory.parser; package com.sk89q.worldedit.extension.factory.parser;
import com.boydti.fawe.command.SuggestInputParseException; import com.boydti.fawe.command.SuggestInputParseException;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.jnbt.JSON2NBT; import com.boydti.fawe.jnbt.JSON2NBT;
import com.boydti.fawe.jnbt.NBTException; import com.boydti.fawe.jnbt.NBTException;
import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.MathMan;
@ -228,7 +229,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
BaseItem item = slottable.getItem(slot); BaseItem item = slottable.getItem(slot);
if (!item.getType().hasBlockType()) { if (!item.getType().hasBlockType()) {
throw new InputParseException("You're not holding a block!"); throw new InputParseException(BBC.getPrefix() + "You're not holding a block!");
} }
state = item.getType().getBlockType().getDefaultState(); state = item.getType().getBlockType().getDefaultState();
nbt = item.getNbtData(); nbt = item.getNbtData();
@ -236,7 +237,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
BlockType type = BlockTypes.parse(typeString.toLowerCase()); BlockType type = BlockTypes.parse(typeString.toLowerCase());
if (type != null) state = type.getDefaultState(); if (type != null) state = type.getDefaultState();
if (state == null) { if (state == null) {
throw new NoMatchException("Does not match a valid block type: '" + input + "'"); throw new NoMatchException(BBC.getPrefix() + "Does not match a valid block type: '" + input + "'");
} }
} }
// if (nbt == null) nbt = state.getNbtData(); // if (nbt == null) nbt = state.getNbtData();
@ -281,7 +282,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
Platform capability = worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS); Platform capability = worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS);
if (!capability.isValidMobType(mobName)) { if (!capability.isValidMobType(mobName)) {
final String finalMobName = mobName.toLowerCase(); final String finalMobName = mobName.toLowerCase();
throw new SuggestInputParseException("Unknown mob type '" + mobName + "'", mobName, () -> Stream.of(MobType.values()) throw new SuggestInputParseException(BBC.getPrefix() + "Unknown mob type '" + mobName + "'", mobName, () -> Stream.of(MobType.values())
.map(m -> m.getName().toLowerCase()) .map(m -> m.getName().toLowerCase())
.filter(s -> s.startsWith(finalMobName)) .filter(s -> s.startsWith(finalMobName))
.collect(Collectors.toList())); .collect(Collectors.toList()));
@ -308,12 +309,12 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
if (context.isRestricted()) { if (context.isRestricted()) {
Actor actor = context.requireActor(); Actor actor = context.requireActor();
if (!actor.hasPermission("worldedit.anyblock") && worldEdit.getConfiguration().checkDisallowedBlocks(holder)) { if (!actor.hasPermission("worldedit.anyblock") && worldEdit.getConfiguration().checkDisallowedBlocks(holder)) {
throw new DisallowedUsageException("You are not allowed to use '" + holder + "'"); throw new DisallowedUsageException(BBC.getPrefix() + "You are not allowed to use '" + holder + "'");
} }
CompoundTag nbt = holder.getNbtData(); CompoundTag nbt = holder.getNbtData();
if (nbt != null) { if (nbt != null) {
if (!actor.hasPermission("worldedit.anyblock")) { if (!actor.hasPermission("worldedit.anyblock")) {
throw new DisallowedUsageException("You are not allowed to nbt'"); throw new DisallowedUsageException(BBC.getPrefix() + "You are not allowed to nbt'");
} }
} }
} }