Configure CI build for GitHub Packages

Also fixed a couple issues based on an analysis
Removed debug souts
This commit is contained in:
Norbi Peti 2020-02-15 00:23:04 +01:00
parent 4952923f9b
commit f19aa41205
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
17 changed files with 276 additions and 404 deletions

445
.gitignore vendored
View file

@ -1,224 +1,221 @@
################# #################
## Eclipse ## Eclipse
################# #################
*.pydevproject *.pydevproject
.metadata/ .metadata/
bin/ bin/
tmp/ tmp/
*.tmp *.tmp
*.bak *.bak
*.swp *.swp
*~.nib *~.nib
local.properties local.properties
.classpath .classpath
.settings/ .settings/
.loadpath .loadpath
target/ target/
.project .project
# External tool builders # External tool builders
.externalToolBuilders/ .externalToolBuilders/
# Locally stored "Eclipse launch configurations" # Locally stored "Eclipse launch configurations"
*.launch *.launch
# CDT-specific # CDT-specific
.cproject .cproject
# PDT-specific # PDT-specific
.buildpath .buildpath
################# #################
## Visual Studio ## Visual Studio
################# #################
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
# User-specific files # User-specific files
*.suo *.suo
*.user *.user
*.sln.docstates *.sln.docstates
# Build results # Build results
[Dd]ebug/ [Dd]ebug/
[Rr]elease/ [Rr]elease/
x64/ x64/
build/ build/
[Bb]in/ [Bb]in/
[Oo]bj/ [Oo]bj/
# MSTest test Results # MSTest test Results
[Tt]est[Rr]esult*/ [Tt]est[Rr]esult*/
[Bb]uild[Ll]og.* [Bb]uild[Ll]og.*
*_i.c *_i.c
*_p.c *_p.c
*.ilk *.ilk
*.meta *.meta
*.obj *.obj
*.pch *.pch
*.pdb *.pdb
*.pgc *.pgc
*.pgd *.pgd
*.rsp *.rsp
*.sbr *.sbr
*.tlb *.tlb
*.tli *.tli
*.tlh *.tlh
*.tmp *.tmp_proj
*.tmp_proj *.log
*.log *.vspscc
*.vspscc *.vssscc
*.vssscc .builds
.builds *.pidb
*.pidb *.scc
*.log
*.scc # Visual C++ cache files
ipch/
# Visual C++ cache files *.aps
ipch/ *.ncb
*.aps *.opensdf
*.ncb *.sdf
*.opensdf *.cachefile
*.sdf
*.cachefile # Visual Studio profiler
*.psess
# Visual Studio profiler *.vsp
*.psess *.vspx
*.vsp
*.vspx # Guidance Automation Toolkit
*.gpState
# Guidance Automation Toolkit
*.gpState # ReSharper is a .NET coding add-in
_ReSharper*/
# ReSharper is a .NET coding add-in *.[Rr]e[Ss]harper
_ReSharper*/
*.[Rr]e[Ss]harper # TeamCity is a build add-in
_TeamCity*
# TeamCity is a build add-in
_TeamCity* # DotCover is a Code Coverage Tool
*.dotCover
# DotCover is a Code Coverage Tool
*.dotCover # NCrunch
*.ncrunch*
# NCrunch .*crunch*.local.xml
*.ncrunch*
.*crunch*.local.xml # Installshield output folder
[Ee]xpress/
# Installshield output folder
[Ee]xpress/ # DocProject is a documentation generator add-in
DocProject/buildhelp/
# DocProject is a documentation generator add-in DocProject/Help/*.HxT
DocProject/buildhelp/ DocProject/Help/*.HxC
DocProject/Help/*.HxT DocProject/Help/*.hhc
DocProject/Help/*.HxC DocProject/Help/*.hhk
DocProject/Help/*.hhc DocProject/Help/*.hhp
DocProject/Help/*.hhk DocProject/Help/Html2
DocProject/Help/*.hhp DocProject/Help/html
DocProject/Help/Html2
DocProject/Help/html # Click-Once directory
publish/
# Click-Once directory
publish/ # Publish Web Output
*.Publish.xml
# Publish Web Output *.pubxml
*.Publish.xml *.publishproj
*.pubxml
*.publishproj # NuGet Packages Directory
## TO!DO: If you have NuGet Package Restore enabled, uncomment the next line
# NuGet Packages Directory #packages/
## TO!DO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/ # Windows Azure Build Output
csx
# Windows Azure Build Output *.build.csdef
csx
*.build.csdef # Windows Store app package directory
AppPackages/
# Windows Store app package directory
AppPackages/ # Others
sql/
# Others *.Cache
sql/ ClientBin/
*.Cache [Ss]tyle[Cc]op.*
ClientBin/ ~$*
[Ss]tyle[Cc]op.* *~
~$* *.dbmdl
*~ *.[Pp]ublish.xml
*.dbmdl *.pfx
*.[Pp]ublish.xml *.publishsettings
*.pfx
*.publishsettings # RIA/Silverlight projects
Generated_Code/
# RIA/Silverlight projects
Generated_Code/ # Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
# Backup & report files from converting an old project file to a newer _UpgradeReport_Files/
# Visual Studio version. Backup files are not needed, because we have git ;-) Backup*/
_UpgradeReport_Files/ UpgradeLog*.XML
Backup*/ UpgradeLog*.htm
UpgradeLog*.XML
UpgradeLog*.htm # SQL Server files
App_Data/*.mdf
# SQL Server files App_Data/*.ldf
App_Data/*.mdf
App_Data/*.ldf #############
## Windows detritus
############# #############
## Windows detritus
############# # Windows image file caches
Thumbs.db
# Windows image file caches ehthumbs.db
Thumbs.db
ehthumbs.db # Folder config file
Desktop.ini
# Folder config file
Desktop.ini # Recycle Bin used on file shares
$RECYCLE.BIN/
# Recycle Bin used on file shares
$RECYCLE.BIN/ # Mac crap
.DS_Store
# Mac crap
.DS_Store
#############
## Python
############# #############
## Python
############# *.py[cod]
*.py[cod] # Packages
*.egg
# Packages *.egg-info
*.egg dist/
*.egg-info eggs/
dist/ parts/
build/ var/
eggs/ sdist/
parts/ develop-eggs/
var/ .installed.cfg
sdist/
develop-eggs/ # Installer logs
.installed.cfg pip-log.txt
# Installer logs # Unit test / coverage reports
pip-log.txt .coverage
.tox
# Unit test / coverage reports
.coverage #Translations
.tox *.mo
#Translations #Mr Developer
*.mo .mr.developer.cfg
.metadata/*
#Mr Developer TheButtonAutoFlair/out/artifacts/Autoflair/Autoflair.jar
.mr.developer.cfg *.iml
.metadata/* *.name
TheButtonAutoFlair/out/artifacts/Autoflair/Autoflair.jar .idea/compiler.xml
#*.iml *.xml
*.name /.apt_generated/
.idea/compiler.xml
*.xml
/.apt_generated/

View file

@ -1,130 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_11">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/annotations" isTestSource="false" generated="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.12-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.github.TBMCPlugins.ChromaCore:Chroma-Core:master-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: net.sourceforge.htmlcleaner:htmlcleaner:2.16" level="project" />
<orderEntry type="library" name="Maven: org.jdom:jdom2:2.0.5" level="project" />
<orderEntry type="library" name="Maven: org.reflections:reflections:0.9.10" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.19.0-GA" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:annotations:2.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:EssentialsX:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: io.papermc:paperlib:1.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:NMSProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:UpdatedMetaProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:1_8_R1Provider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:1_8_R2Provider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:LegacyProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:ReflectionProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:FlattenedProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.palmergames.bukkit.towny:Towny:0.95.2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.milkbowl:VaultAPI:master-89c00e1cb8-1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.12.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.github.webbukkit:Dynmap-Towny:master-0.60-g924051d-7" level="project" />
<orderEntry type="library" name="Maven: com.github.webbukkit:Dynmap:v2.5" level="project" />
<orderEntry type="library" name="Maven: com.nijikokun.bukkit:Permissions:3.1.6" level="project" />
<orderEntry type="library" name="Maven: org.bukkit:bukkit:1.7.10-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: ru.tehkode:PermissionsEx:1.19.1" level="project" />
<orderEntry type="library" name="Maven: de.bananaco:bPermissions:2.9.1" level="project" />
<orderEntry type="library" name="Maven: com.platymuus.bukkit.permissions:PermissionsBukkit:1.6" level="project" />
<orderEntry type="library" name="Maven: org.anjocaido:EssentialsGroupManager:2.10.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-core:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-api:2.8.1" level="project" />
<orderEntry type="library" name="Maven: org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.12-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.github.TBMCPlugins.ChromaCore:Chroma-Core:master-8f6ee349de-1" level="project" />
<orderEntry type="library" name="Maven: net.sourceforge.htmlcleaner:htmlcleaner:2.16" level="project" />
<orderEntry type="library" name="Maven: org.jdom:jdom2:2.0.5" level="project" />
<orderEntry type="library" name="Maven: org.reflections:reflections:0.9.10" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.19.0-GA" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:annotations:2.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:EssentialsX:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: io.papermc:paperlib:1.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:NMSProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:UpdatedMetaProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:1_8_R1Provider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:1_8_R2Provider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:LegacyProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:ReflectionProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:FlattenedProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.palmergames.bukkit.towny:Towny:0.95.2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.milkbowl:VaultAPI:master-89c00e1cb8-1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.12.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.github.webbukkit:Dynmap-Towny:master-0.60-g924051d-7" level="project" />
<orderEntry type="library" name="Maven: com.github.webbukkit:Dynmap:v2.5" level="project" />
<orderEntry type="library" name="Maven: com.nijikokun.bukkit:Permissions:3.1.6" level="project" />
<orderEntry type="library" name="Maven: org.bukkit:bukkit:1.7.10-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: ru.tehkode:PermissionsEx:1.19.1" level="project" />
<orderEntry type="library" name="Maven: de.bananaco:bPermissions:2.9.1" level="project" />
<orderEntry type="library" name="Maven: com.platymuus.bukkit.permissions:PermissionsBukkit:1.6" level="project" />
<orderEntry type="library" name="Maven: org.anjocaido:EssentialsGroupManager:2.10.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-core:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-api:2.8.1" level="project" />
<orderEntry type="library" name="Maven: org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.12-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.github.TBMCPlugins.ChromaCore:Chroma-Core:master-8f6ee349de-1" level="project" />
<orderEntry type="library" name="Maven: net.sourceforge.htmlcleaner:htmlcleaner:2.16" level="project" />
<orderEntry type="library" name="Maven: org.jdom:jdom2:2.0.5" level="project" />
<orderEntry type="library" name="Maven: org.reflections:reflections:0.9.10" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.19.0-GA" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:annotations:2.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:EssentialsX:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: io.papermc:paperlib:1.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:NMSProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:UpdatedMetaProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:1_8_R1Provider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:1_8_R2Provider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:LegacyProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:ReflectionProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:FlattenedProvider:2.17.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.palmergames.bukkit.towny:Towny:0.95.2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.milkbowl:VaultAPI:master-89c00e1cb8-1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.12.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.github.webbukkit:Dynmap-Towny:master-0.60-g924051d-7" level="project" />
<orderEntry type="library" name="Maven: com.github.webbukkit:Dynmap:v2.5" level="project" />
<orderEntry type="library" name="Maven: com.nijikokun.bukkit:Permissions:3.1.6" level="project" />
<orderEntry type="library" name="Maven: org.bukkit:bukkit:1.7.10-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: ru.tehkode:PermissionsEx:1.19.1" level="project" />
<orderEntry type="library" name="Maven: de.bananaco:bPermissions:2.9.1" level="project" />
<orderEntry type="library" name="Maven: com.platymuus.bukkit.permissions:PermissionsBukkit:1.6" level="project" />
<orderEntry type="library" name="Maven: org.anjocaido:EssentialsGroupManager:2.10.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-core:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-api:2.8.1" level="project" />
</component>
</module>

View file

@ -7,6 +7,7 @@ before_install: | # Wget BuildTools and run if cached folder not found
# grep so that download counts don't appear in log files # grep so that download counts don't appear in log files
java -jar BuildTools.jar --rev 1.12.2 | grep -vE "[^/ ]*/[^/ ]*\s*KB\s*$" | grep -v "^\s*$" java -jar BuildTools.jar --rev 1.12.2 | grep -vE "[^/ ]*/[^/ ]*\s*KB\s*$" | grep -v "^\s*$"
fi fi
cp ci/settings.xml $HOME/.m2/
language: java language: java
jdk: jdk:
- oraclejdk8 - oraclejdk8

View file

@ -1 +0,0 @@
apache-maven-3.2.5/bin/mvn install:install-file -Dfile=Towny.jar -DgroupId=com.palmergames -DartifactId=Towny -Dversion=0.90.0.0 -Dpackaging=jar

36
ci/settings.xml Normal file
View file

@ -0,0 +1,36 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<!-- <repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository> -->
<repository>
<id>github</id>
<name>GitHub Towny Apache Maven Packages</name>
<url>https://maven.pkg.github.com/TownyAdvanced/Towny</url>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>NorbiPeti</username>
<password>${env.GHTOKEN}</password>
</server>
</servers>
</settings>

View file

@ -1,10 +0,0 @@
#!/bin/sh
FILENAME=$(find target/ -maxdepth 1 ! -name '*original*' -name '*.jar')
echo Found file: $FILENAME
if [ $1 = 'production' ]; then
echo Production mode
echo $UPLOAD_KEY > upload_key
chmod 400 upload_key
yes | scp -B -i upload_key -o StrictHostKeyChecking=no $FILENAME travis@server.figytuna.com:/minecraft/main/TBMC/pluginupdates
fi

View file

@ -1,6 +1,7 @@
package buttondevteam.chat.components.chatonly; package buttondevteam.chat.components.chatonly;
import buttondevteam.chat.ChatPlayer; import buttondevteam.chat.ChatPlayer;
import buttondevteam.chat.PluginMain;
import buttondevteam.chat.components.formatter.formatting.TellrawEvent; import buttondevteam.chat.components.formatter.formatting.TellrawEvent;
import buttondevteam.chat.components.formatter.formatting.TellrawPart; import buttondevteam.chat.components.formatter.formatting.TellrawPart;
import buttondevteam.core.ComponentManager; import buttondevteam.core.ComponentManager;
@ -20,7 +21,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
* Allows players to enter chat-only mode which puts them into spectator mode and disallows everything besides chatting. * Allows players to enter chat-only mode which puts them into spectator mode and disallows everything besides chatting.
*/ */
@ComponentMetadata(enabledByDefault = false) @ComponentMetadata(enabledByDefault = false)
public class ChatOnlyComponent extends Component implements Listener { public class ChatOnlyComponent extends Component<PluginMain> implements Listener {
@Override @Override
protected void enable() { protected void enable() {
registerListener(this); registerListener(this);

View file

@ -23,7 +23,7 @@ public class SetFlairCommand extends AdminCommandBase {
sender.sendMessage("§cPlayer not found.&r"); sender.sendMessage("§cPlayer not found.&r");
return true; return true;
} }
short ft = 0x00; short ft;
if (flairtime.equalsIgnoreCase("non-presser")) if (flairtime.equalsIgnoreCase("non-presser"))
ft = ChatPlayer.FlairTimeNonPresser; ft = ChatPlayer.FlairTimeNonPresser;
else if (flairtime.equalsIgnoreCase("cant-press")) else if (flairtime.equalsIgnoreCase("cant-press"))

View file

@ -4,7 +4,6 @@ import buttondevteam.chat.commands.ucmds.admin.DebugCommand;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.stream.Collectors;
public final class ChatFormatUtils { public final class ChatFormatUtils {
private ChatFormatUtils() {} private ChatFormatUtils() {}
@ -27,9 +26,6 @@ public final class ChatFormatUtils {
* Check if the given start and end position is inside any of the ranges * Check if the given start and end position is inside any of the ranges
*/ */
static boolean isInRange(int start, int end, ArrayList<int[]> ranges) { static boolean isInRange(int start, int end, ArrayList<int[]> ranges) {
System.out.println("Ranges: " + ranges.stream().map(x -> x[0] + "-" + x[1]).collect(Collectors.joining(", ")));
System.out.println("In range: " + start + " " + end + ": " +
ranges.stream().filter(range -> range[1] >= start && range[0] <= end).map(x -> x[0] + "-" + x[1]).findAny().orElse("none"));
return ranges.stream().anyMatch(range -> range[1] >= start && range[0] <= end); return ranges.stream().anyMatch(range -> range[1] >= start && range[0] <= end);
} }
} }

View file

@ -10,7 +10,7 @@ public class FormattedSection {
public int Start; public int Start;
public int End; public int End;
public FormatSettings Settings; public FormatSettings Settings;
public List<String> Matches = new ArrayList<String>(); public List<String> Matches = new ArrayList<>();
FormattedSection(FormatSettings settings, int start, int end, List<String> matches) { FormattedSection(FormatSettings settings, int start, int end, List<String> matches) {
Start = start; Start = start;

View file

@ -19,7 +19,6 @@ public class RangeMatchProvider extends MatchProviderBase {
this.settings = settings; this.settings = settings;
} }
@SuppressWarnings("DuplicatedCode")
@Override @Override
public FormattedSection getNextSection(String message, ArrayList<int[]> ignoredAreas, ArrayList<int[]> removedCharacters) { public FormattedSection getNextSection(String message, ArrayList<int[]> ignoredAreas, ArrayList<int[]> removedCharacters) {
int i, len; int i, len;

View file

@ -71,6 +71,6 @@ public final class TellrawEvent<T extends TellrawEvent.Action> implements Serial
} }
} }
public static interface Action extends TellrawSerializableEnum { public interface Action extends TellrawSerializableEnum {
} }
} }

View file

@ -48,6 +48,7 @@ public abstract class TellrawSerializer {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@SuppressWarnings("ConstantConditions")
@Override @Override
public void write(JsonWriter writer, Boolean val) throws IOException { public void write(JsonWriter writer, Boolean val) throws IOException {
if (val) if (val)

View file

@ -12,8 +12,6 @@ import lombok.RequiredArgsConstructor;
import lombok.val; import lombok.val;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.lang.reflect.Method;
@CommandClass(helpText = { @CommandClass(helpText = {
"Town Color", // "Town Color", //
"This command allows setting a color for a town.", // "This command allows setting a color for a town.", //
@ -23,18 +21,6 @@ import java.lang.reflect.Method;
@RequiredArgsConstructor @RequiredArgsConstructor
public class TownColorCommand extends UCommandBase { public class TownColorCommand extends UCommandBase {
private final TownColorComponent component; private final TownColorComponent component;
@Override
public String[] getHelpText(Method method, Command2.Subcommand ann) {
StringBuilder cns = new StringBuilder(" <colorname1>");
for (int i = 2; i <= component.colorCount().get(); i++)
cns.append(" [colorname").append(i).append("]");
return new String[] { //
"§6---- Town Color ----", //
"This command allows setting color(s) for a town.", //
"The town will be shown with this color on Dynmap and all players in the town will appear in chat with these colors.", //
"The colors will split the name evenly.", //
};
}
@Command2.Subcommand @Command2.Subcommand
public boolean def(Player player, String... colornames) { public boolean def(Player player, String... colornames) {

View file

@ -1,6 +1,6 @@
name: Chroma-Chat name: Chroma-Chat
main: buttondevteam.chat.PluginMain main: buttondevteam.chat.PluginMain
version: 4.0 version: '4.0'
commands: commands:
u: u:
description: Auto-flair system. Accept or ignore flair. description: Auto-flair system. Accept or ignore flair.

View file

@ -1,15 +1,5 @@
package buttondevteam.chat; package buttondevteam.chat;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.runner.Runner; import org.junit.runner.Runner;
import org.junit.runner.notification.RunNotifier; import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.BlockJUnit4ClassRunner;
@ -20,6 +10,12 @@ import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement; import org.junit.runners.model.Statement;
import org.junit.runners.model.TestClass; import org.junit.runners.model.TestClass;
import java.lang.annotation.*;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/** /**
* Based on {@link Parameterized} * Based on {@link Parameterized}
* *
@ -32,10 +28,10 @@ public class ObjectTestRunner extends Suite {
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD) @Target(ElementType.METHOD)
public static @interface Objects { public @interface Objects {
} }
private class TestClassRunnerForObjects extends BlockJUnit4ClassRunner { private static class TestClassRunnerForObjects extends BlockJUnit4ClassRunner {
private List<Object> objectList; private List<Object> objectList;
private int fParameterSetNumber; private int fParameterSetNumber;
@ -77,13 +73,13 @@ public class ObjectTestRunner extends Suite {
} }
} }
private final ArrayList<Runner> runners = new ArrayList<Runner>(); private final ArrayList<Runner> runners = new ArrayList<>();
/** /**
* Only called reflectively. Do not use programmatically. * Only called reflectively. Do not use programmatically.
*/ */
public ObjectTestRunner(Class<?> klass) throws Throwable { public ObjectTestRunner(Class<?> klass) throws Throwable {
super(klass, Collections.<Runner>emptyList()); super(klass, Collections.emptyList());
List<Object> objectsList = getObjectsList(getTestClass()); List<Object> objectsList = getObjectsList(getTestClass());
for (int i = 0; i < objectsList.size(); i++) for (int i = 0; i < objectsList.size(); i++)
runners.add(new TestClassRunnerForObjects(getTestClass().getJavaClass(), objectsList, i)); runners.add(new TestClassRunnerForObjects(getTestClass().getJavaClass(), objectsList, i));

View file

@ -30,7 +30,7 @@ public class ChatFormatIT {
DebugCommand.DebugMode = true; DebugCommand.DebugMode = true;
PluginMain.permission = Mockito.mock(Permission.class); PluginMain.permission = Mockito.mock(Permission.class);
List<Object> list = new ArrayList<Object>(); List<Object> list = new ArrayList<>();
list.add(new ChatFormatIT(sender, "*test*", new TellrawPart("test").setItalic(true).setColor(Color.White))); list.add(new ChatFormatIT(sender, "*test*", new TellrawPart("test").setItalic(true).setColor(Color.White)));
list.add(new ChatFormatIT(sender, "**test**", new TellrawPart("test").setBold(true).setColor(Color.White))); list.add(new ChatFormatIT(sender, "**test**", new TellrawPart("test").setBold(true).setColor(Color.White)));