mirror of
https://github.com/PaperMC/Waterfall.git
synced 2024-11-28 13:15:31 +01:00
Resolve broken build
This commit is contained in:
parent
7fcb9fbf8c
commit
035090d894
@ -1,41 +1,19 @@
|
|||||||
From 6faee71d0df54f06ac032590ffc4c98bc65dabde Mon Sep 17 00:00:00 2001
|
From e2fcb32f71ba30705a7b4ee18b4d72986ddde9a1 Mon Sep 17 00:00:00 2001
|
||||||
From: Tux <write@imaginarycode.com>
|
From: Tux <write@imaginarycode.com>
|
||||||
Date: Thu, 19 May 2016 17:36:31 -0600
|
Date: Thu, 19 May 2016 17:36:31 -0600
|
||||||
Subject: [PATCH] Better unit tests for Chat API
|
Subject: [PATCH] Better unit tests for Chat API
|
||||||
|
|
||||||
|
|
||||||
diff --git a/chat/src/test/java/net/md_5/bungee/api/chat/TranslatableComponentTest.java b/chat/src/test/java/net/md_5/bungee/api/chat/TranslatableComponentTest.java
|
diff --git a/chat/src/test/java/net/md_5/bungee/api/chat/TranslatableComponentTest.java b/chat/src/test/java/net/md_5/bungee/api/chat/TranslatableComponentTest.java
|
||||||
index 0837c672..7d1ee8e7 100644
|
index 0837c672..38147e2a 100644
|
||||||
--- a/chat/src/test/java/net/md_5/bungee/api/chat/TranslatableComponentTest.java
|
--- a/chat/src/test/java/net/md_5/bungee/api/chat/TranslatableComponentTest.java
|
||||||
+++ b/chat/src/test/java/net/md_5/bungee/api/chat/TranslatableComponentTest.java
|
+++ b/chat/src/test/java/net/md_5/bungee/api/chat/TranslatableComponentTest.java
|
||||||
@@ -3,6 +3,8 @@ package net.md_5.bungee.api.chat;
|
@@ -13,4 +13,12 @@ public class TranslatableComponentTest
|
||||||
import org.junit.Test;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
+import java.util.List;
|
|
||||||
+
|
|
||||||
public class TranslatableComponentTest
|
|
||||||
{
|
|
||||||
|
|
||||||
@@ -13,4 +15,25 @@ public class TranslatableComponentTest
|
|
||||||
assertEquals( "Test string with 2 placeholders: aoeu", testComponent.toPlainText() );
|
assertEquals( "Test string with 2 placeholders: aoeu", testComponent.toPlainText() );
|
||||||
assertEquals( "§fTest string with §f2§f placeholders: §faoeu", testComponent.toLegacyText() );
|
assertEquals( "§fTest string with §f2§f placeholders: §faoeu", testComponent.toLegacyText() );
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Test
|
+ @Test
|
||||||
+ public void testDuplicateNullWithDoesntThrowException() {
|
|
||||||
+ TranslatableComponent component = new TranslatableComponent("Test") {
|
|
||||||
+ @Override
|
|
||||||
+ public List<BaseComponent> getExtra() {
|
|
||||||
+ return null;
|
|
||||||
+ }
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ TranslatableComponent copy = new TranslatableComponent(component);
|
|
||||||
+ // The fact that we don't throw an exception means it's working as intended.
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Test
|
|
||||||
+ public void testEscapedPercentInPlainText()
|
+ public void testEscapedPercentInPlainText()
|
||||||
+ {
|
+ {
|
||||||
+ TranslatableComponent testComponent = new TranslatableComponent( "Test string with %% sign" );
|
+ TranslatableComponent testComponent = new TranslatableComponent( "Test string with %% sign" );
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 2ec3795f6c430ff2c933b566b224d17b5657bb2b Mon Sep 17 00:00:00 2001
|
From 27e23e906fd1a377fb74fe8797664333eddcf16c Mon Sep 17 00:00:00 2001
|
||||||
From: Minecrell <dev@minecrell.net>
|
From: Minecrell <dev@minecrell.net>
|
||||||
Date: Fri, 22 Sep 2017 12:46:47 +0200
|
Date: Fri, 22 Sep 2017 12:46:47 +0200
|
||||||
Subject: [PATCH] Use Log4j2 for logging and TerminalConsoleAppender for
|
Subject: [PATCH] Use Log4j2 for logging and TerminalConsoleAppender for
|
||||||
@ -395,7 +395,7 @@ index 00000000..a8a94749
|
|||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
index c84389cd..c71b7c4d 100644
|
index c84389cd..08699416 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
|
||||||
@@ -45,7 +45,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
@@ -45,7 +45,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
@ -406,7 +406,13 @@ index c84389cd..c71b7c4d 100644
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.Synchronized;
|
import lombok.Synchronized;
|
||||||
@@ -78,8 +77,6 @@ import net.md_5.bungee.compress.CompressFactory;
|
@@ -72,14 +71,11 @@ import net.md_5.bungee.command.CommandEnd;
|
||||||
|
import net.md_5.bungee.command.CommandIP;
|
||||||
|
import net.md_5.bungee.command.CommandPerms;
|
||||||
|
import net.md_5.bungee.command.CommandReload;
|
||||||
|
-import net.md_5.bungee.command.ConsoleCommandCompleter;
|
||||||
|
import net.md_5.bungee.command.ConsoleCommandSender;
|
||||||
|
import net.md_5.bungee.compress.CompressFactory;
|
||||||
import net.md_5.bungee.conf.Configuration;
|
import net.md_5.bungee.conf.Configuration;
|
||||||
import net.md_5.bungee.conf.YamlConfig;
|
import net.md_5.bungee.conf.YamlConfig;
|
||||||
import net.md_5.bungee.forge.ForgeConstants;
|
import net.md_5.bungee.forge.ForgeConstants;
|
||||||
@ -415,7 +421,7 @@ index c84389cd..c71b7c4d 100644
|
|||||||
import net.md_5.bungee.module.ModuleManager;
|
import net.md_5.bungee.module.ModuleManager;
|
||||||
import net.md_5.bungee.netty.PipelineUtils;
|
import net.md_5.bungee.netty.PipelineUtils;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
@@ -89,7 +86,6 @@ import net.md_5.bungee.protocol.packet.PluginMessage;
|
@@ -89,7 +85,6 @@ import net.md_5.bungee.protocol.packet.PluginMessage;
|
||||||
import net.md_5.bungee.query.RemoteQuery;
|
import net.md_5.bungee.query.RemoteQuery;
|
||||||
import net.md_5.bungee.scheduler.BungeeScheduler;
|
import net.md_5.bungee.scheduler.BungeeScheduler;
|
||||||
import net.md_5.bungee.util.CaseInsensitiveMap;
|
import net.md_5.bungee.util.CaseInsensitiveMap;
|
||||||
@ -423,7 +429,7 @@ index c84389cd..c71b7c4d 100644
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Main BungeeCord proxy class.
|
* Main BungeeCord proxy class.
|
||||||
@@ -145,8 +141,12 @@ public class BungeeCord extends ProxyServer
|
@@ -145,8 +140,12 @@ public class BungeeCord extends ProxyServer
|
||||||
private final File pluginsFolder = new File( "plugins" );
|
private final File pluginsFolder = new File( "plugins" );
|
||||||
@Getter
|
@Getter
|
||||||
private final BungeeScheduler scheduler = new BungeeScheduler();
|
private final BungeeScheduler scheduler = new BungeeScheduler();
|
||||||
@ -436,7 +442,7 @@ index c84389cd..c71b7c4d 100644
|
|||||||
@Getter
|
@Getter
|
||||||
private final Logger logger;
|
private final Logger logger;
|
||||||
public final Gson gson = new GsonBuilder()
|
public final Gson gson = new GsonBuilder()
|
||||||
@@ -191,6 +191,8 @@ public class BungeeCord extends ProxyServer
|
@@ -191,6 +190,8 @@ public class BungeeCord extends ProxyServer
|
||||||
}
|
}
|
||||||
reloadMessages();
|
reloadMessages();
|
||||||
|
|
||||||
@ -445,7 +451,7 @@ index c84389cd..c71b7c4d 100644
|
|||||||
// This is a workaround for quite possibly the weirdest bug I have ever encountered in my life!
|
// This is a workaround for quite possibly the weirdest bug I have ever encountered in my life!
|
||||||
// When jansi attempts to extract its natives, by default it tries to extract a specific version,
|
// When jansi attempts to extract its natives, by default it tries to extract a specific version,
|
||||||
// using the loading class's implementation version. Normally this works completely fine,
|
// using the loading class's implementation version. Normally this works completely fine,
|
||||||
@@ -209,6 +211,9 @@ public class BungeeCord extends ProxyServer
|
@@ -209,6 +210,9 @@ public class BungeeCord extends ProxyServer
|
||||||
logger = new BungeeLogger( "BungeeCord", "proxy.log", consoleReader );
|
logger = new BungeeLogger( "BungeeCord", "proxy.log", consoleReader );
|
||||||
System.setErr( new PrintStream( new LoggingOutputStream( logger, Level.SEVERE ), true ) );
|
System.setErr( new PrintStream( new LoggingOutputStream( logger, Level.SEVERE ), true ) );
|
||||||
System.setOut( new PrintStream( new LoggingOutputStream( logger, Level.INFO ), true ) );
|
System.setOut( new PrintStream( new LoggingOutputStream( logger, Level.INFO ), true ) );
|
||||||
@ -455,6 +461,37 @@ index c84389cd..c71b7c4d 100644
|
|||||||
|
|
||||||
if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) )
|
if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) )
|
||||||
{
|
{
|
||||||
|
diff --git a/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandCompleter.java b/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandCompleter.java
|
||||||
|
deleted file mode 100644
|
||||||
|
index bd52d880..00000000
|
||||||
|
--- a/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandCompleter.java
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,25 +0,0 @@
|
||||||
|
-package net.md_5.bungee.command;
|
||||||
|
-
|
||||||
|
-import java.util.ArrayList;
|
||||||
|
-import java.util.List;
|
||||||
|
-import jline.console.completer.Completer;
|
||||||
|
-import lombok.RequiredArgsConstructor;
|
||||||
|
-import net.md_5.bungee.api.ProxyServer;
|
||||||
|
-
|
||||||
|
-@RequiredArgsConstructor
|
||||||
|
-public class ConsoleCommandCompleter implements Completer
|
||||||
|
-{
|
||||||
|
-
|
||||||
|
- private final ProxyServer proxy;
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public int complete(String buffer, int cursor, List<CharSequence> candidates)
|
||||||
|
- {
|
||||||
|
- List<String> suggestions = new ArrayList<>();
|
||||||
|
- proxy.getPluginManager().dispatchCommand( proxy.getConsole(), buffer, suggestions );
|
||||||
|
- candidates.addAll( suggestions );
|
||||||
|
-
|
||||||
|
- int lastSpace = buffer.lastIndexOf( ' ' );
|
||||||
|
- return ( lastSpace == -1 ) ? cursor - buffer.length() : cursor - ( buffer.length() - lastSpace - 1 );
|
||||||
|
- }
|
||||||
|
-}
|
||||||
diff --git a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java b/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java
|
diff --git a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java b/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java
|
||||||
index 10366c88..8c5cc949 100644
|
index 10366c88..8c5cc949 100644
|
||||||
--- a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java
|
--- a/proxy/src/main/java/net/md_5/bungee/module/ModuleManager.java
|
||||||
|
Loading…
Reference in New Issue
Block a user