mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 05:02:18 +00:00
More compile cleanups. (#5139)
This commit is contained in:
1 parent
dbf649225a
commit
3f743887e7
71 files changed
+901
-411
No files matched your search
@@ -41,12 +41,12 @@ public class TextComponentHelper
|
||||
{
|
||||
if (isVanillaClient(source))
|
||||
{
|
||||
return new TextComponentString(LanguageMap.getInstance().translateKey(translation, args));
|
||||
return new TextComponentString(String.format(LanguageMap.getInstance().translateKey(translation), args));
|
||||
}
|
||||
return new TextComponentTranslation(translation, args);
|
||||
}
|
||||
|
||||
private static boolean isVanillaClient(ICommandSender sender)
|
||||
private static boolean isVanillaClient(ICommandSource sender)
|
||||
{
|
||||
if (sender instanceof EntityPlayerMP)
|
||||
{
|
||||
|
||||
@@ -22,8 +22,10 @@ package net.minecraftforge.server.console;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.FutureTask;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -60,7 +62,7 @@ final class ConsoleCommandCompleter implements Completer
|
||||
}
|
||||
|
||||
final String input = buffer;
|
||||
Future<List<String>> tabComplete = this.server.callFromMainThread(() -> this.server.getTabCompletions(this.server, input, this.server.getPosition(), false));
|
||||
Future<List<String>> tabComplete = new FutureTask<>(() -> Collections.emptyList());// TODO commands this.server.callFromMainThread(() -> this.server.getTabCompletions(this.server, input, this.server.getPosition(), false));
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -71,9 +71,9 @@ public final class TerminalHandler
|
||||
|
||||
line = line.trim();
|
||||
if (!line.isEmpty())
|
||||
{
|
||||
{/* TODO Commands
|
||||
server.addPendingCommand(line, server);
|
||||
}
|
||||
*/}
|
||||
}
|
||||
}
|
||||
catch (UserInterruptException e)
|
||||
|
||||
@@ -21,7 +21,6 @@ package net.minecraftforge.server.permission;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.server.permission.context.IContext;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -72,7 +71,7 @@ public enum DefaultPermissionHandler implements IPermissionHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
MinecraftServer server = null; // TODO FMLCommonHandler FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
return server != null && server.getPlayerList().canSendCommands(profile);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,15 +22,18 @@ package net.minecraftforge.server.permission;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.server.permission.context.IContext;
|
||||
import net.minecraftforge.server.permission.context.PlayerContext;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class PermissionAPI
|
||||
{
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
private static IPermissionHandler permissionHandler = DefaultPermissionHandler.INSTANCE;
|
||||
|
||||
/**
|
||||
@@ -39,8 +42,8 @@ public class PermissionAPI
|
||||
public static void setPermissionHandler(IPermissionHandler handler)
|
||||
{
|
||||
Preconditions.checkNotNull(handler, "Permission handler can't be null!");
|
||||
Preconditions.checkState(Loader.instance().getLoaderState().ordinal() <= LoaderState.PREINITIALIZATION.ordinal(), "Can't register after IPermissionHandler PreInit!");
|
||||
FMLLog.log.warn("Replacing {} with {}", permissionHandler.getClass().getName(), handler.getClass().getName());
|
||||
// TODO Loader states Preconditions.checkState(Loader.instance().getLoaderState().ordinal() <= LoaderState.PREINITIALIZATION.ordinal(), "Can't register after IPermissionHandler PreInit!");
|
||||
LOGGER.warn("Replacing {} with {}", permissionHandler.getClass().getName(), handler.getClass().getName());
|
||||
permissionHandler = handler;
|
||||
}
|
||||
|
||||
@@ -62,7 +65,7 @@ public class PermissionAPI
|
||||
Preconditions.checkNotNull(level, "Permission level can't be null!");
|
||||
Preconditions.checkNotNull(desc, "Permission description can't be null!");
|
||||
Preconditions.checkArgument(!node.isEmpty(), "Permission node can't be empty!");
|
||||
Preconditions.checkState(Loader.instance().getLoaderState().ordinal() > LoaderState.PREINITIALIZATION.ordinal(), "Can't register permission nodes before Init!");
|
||||
// TODO Loader states Preconditions.checkState(Loader.instance().getLoaderState().ordinal() > LoaderState.PREINITIALIZATION.ordinal(), "Can't register permission nodes before Init!");
|
||||
permissionHandler.registerNode(node, level, desc);
|
||||
return node;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user