Skip to content

Commit

Permalink
v1.7.0-pre 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jonagamerpro1234 committed Oct 7, 2021
1 parent d938b95 commit 1f0e10d
Show file tree
Hide file tree
Showing 26 changed files with 907 additions and 1,098 deletions.
357 changes: 213 additions & 144 deletions CustomJoinAndQuitMessages/config.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

import com.google.common.collect.ImmutableMap;
import com.iridium.iridiumcolorapi.patterns.GradientPattern;
import com.iridium.iridiumcolorapi.patterns.Pattern;
import com.iridium.iridiumcolorapi.patterns.IPattern;
import com.iridium.iridiumcolorapi.patterns.RainbowPattern;
import com.iridium.iridiumcolorapi.patterns.SolidPattern;

import jss.customjoinandquitmessages.patterns.GradientPattern2;
import jss.customjoinandquitmessages.patterns.PadPattern;
import jss.customjoinandquitmessages.patterns.PadPattern2;
import jss.customjoinandquitmessages.patterns.PadPattern3;
import jss.customjoinandquitmessages.patterns.RainbowPattern2;
import net.md_5.bungee.api.ChatColor;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -63,7 +69,8 @@ public class IridiumColorAPI {
*
* @since 1.0.2
*/
private static final List<Pattern> PATTERNS = Arrays.asList(new GradientPattern(), new SolidPattern(), new RainbowPattern());
private static final List<IPattern> PATTERNS = Arrays.asList(new GradientPattern(), new SolidPattern(), new RainbowPattern(),
new PadPattern(), new PadPattern2(), new PadPattern3(), new RainbowPattern2(), new GradientPattern2());

/**
* Processes a string to add color to it.
Expand All @@ -74,7 +81,7 @@ public class IridiumColorAPI {
*/
@Nonnull
public static String process(@Nonnull String string) {
for (Pattern pattern : PATTERNS) {
for (IPattern pattern : PATTERNS) {
string = pattern.process(string);
}
string = ChatColor.translateAlternateColorCodes('&', string);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,14 @@

import com.iridium.iridiumcolorapi.IridiumColorAPI;

import java.awt.*;
import java.awt.Color;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* Represents a gradient color pattern which can be applied to a String.
*/
public class GradientPattern implements Pattern {
public class GradientPattern implements IPattern {

java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("<GRADIENT:([0-9A-Fa-f]{6})>(.*?)</GRADIENT:([0-9A-Fa-f]{6})>");
Pattern pattern = Pattern.compile("<#:([0-9A-Fa-f]{6})>(.*?)</#:([0-9A-Fa-f]{6})>");


/**
* Applies a gradient pattern to the provided String.
* Output might me the same as the input if this pattern is not present.
*
* @param string The String to which this pattern should be applied to
* @return The new String with applied pattern
*/
public String process(String string) {
Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Represents a color pattern which can be applied to a String.
*/
public interface Pattern {
public interface IPattern {

/**
* Applies this pattern to the provided String.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
import com.iridium.iridiumcolorapi.IridiumColorAPI;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RainbowPattern implements Pattern {
public class RainbowPattern implements IPattern {

java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("<RAINBOW([0-9]{1,3})>(.*?)</RAINBOW>");
Pattern pattern = Pattern.compile("<RAINBOW([0-9]{1,3})>(.*?)</RAINBOW>");

/**
* Applies a rainbow pattern to the provided String.
* Output might me the same as the input if this pattern is not present.
*
* @param string The String to which this pattern should be applied to
* @return The new String with applied pattern
*/
public String process(String string) {
Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
import com.iridium.iridiumcolorapi.IridiumColorAPI;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class SolidPattern implements Pattern {
public class SolidPattern implements IPattern {

java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("<SOLID:([0-9A-Fa-f]{6})>");
Pattern pattern = Pattern.compile("<#([0-9A-Fa-f]{6})>");

/**
* Applies a solid RGB color to the provided String.
* Output might me the same as the input if this pattern is not present.
*
* @param string The String to which this pattern should be applied to
* @return The new String with applied pattern
*/
public String process(String string) {
Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import jss.customjoinandquitmessages.config.ConfigFile;
import jss.customjoinandquitmessages.config.Lang;
import jss.customjoinandquitmessages.config.PreConfigLoader;
import jss.customjoinandquitmessages.events.old.JoinListener;
import jss.customjoinandquitmessages.events.old.SoundsListener;
import jss.customjoinandquitmessages.events.JoinListener;
import jss.customjoinandquitmessages.hook.HooksManager;
import jss.customjoinandquitmessages.utils.EventsUtils;
import jss.customjoinandquitmessages.utils.Logger;
Expand Down Expand Up @@ -103,7 +102,7 @@ public void setupCommands() {

public void setupEvents() {
new JoinListener(this);
new SoundsListener(this);
//new SoundsListener(this);
}

public static CustomJoinAndQuitMessages getPlugin() {
Expand Down
Loading

0 comments on commit 1f0e10d

Please sign in to comment.