Rename package name from org.zhdev to net.zhira
This commit is contained in:
parent
cc7f16f941
commit
6ab7e89561
61 changed files with 314 additions and 192 deletions
|
|
@ -1,9 +1,12 @@
|
|||
<project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>org.zhdev.varioutil</groupId>
|
||||
<groupId>net.zhira.varioutil</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package org.zhdev.varioutil;
|
||||
package net.zhira.varioutil;
|
||||
|
||||
import org.zhdev.varioutil.config.Config;
|
||||
import org.zhdev.varioutil.config.ConfigException;
|
||||
import org.zhdev.varioutil.language.Language;
|
||||
import org.zhdev.varioutil.sql.SqlAdapter;
|
||||
import org.zhdev.varioutil.util.ResourceUtils;
|
||||
import net.zhira.varioutil.config.Config;
|
||||
import net.zhira.varioutil.config.ConfigException;
|
||||
import net.zhira.varioutil.language.Language;
|
||||
import net.zhira.varioutil.util.ResourceUtils;
|
||||
import net.zhira.varioutil.sql.SqlAdapter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
|
@ -26,7 +26,7 @@ public interface PreparedPlugin {
|
|||
|
||||
default Path loadConfig(Config config, String pathname, boolean resourcePreload) {
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
Path path = Paths.get(pathname);
|
||||
Path path = Paths.get(getDataDirectory().toString() + '/' + pathname);
|
||||
try (InputStream stream = ResourceUtils.getResource(pathname, classLoader)) {
|
||||
if (stream != null) {
|
||||
if (resourcePreload) {
|
||||
|
|
@ -1,13 +1,21 @@
|
|||
package org.zhdev.varioutil.util;
|
||||
package net.zhira.varioutil.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class ColorUtils {
|
||||
public static final char COLOR_CHAR = '§';
|
||||
|
||||
private static final Map<String, Pattern> COMPILED_PATTERNS = new HashMap<>();
|
||||
|
||||
private static Pattern getPattern(String regexp) {
|
||||
return COMPILED_PATTERNS.computeIfAbsent(regexp, s -> Pattern.compile(regexp));
|
||||
}
|
||||
|
||||
public static void translateAlternateColorCodes(StringBuilder builder, char replaceChar) {
|
||||
Matcher m = Pattern.compile(Pattern.quote(String.valueOf(replaceChar)) + "(#[0-9a-fA-F]{6})").matcher(builder);
|
||||
Matcher m = getPattern(Pattern.quote(String.valueOf(replaceChar)) + "(#[0-9a-fA-F]{6})").matcher(builder);
|
||||
int start = 0;
|
||||
while (m.find(start)) {
|
||||
String hex = m.group(1);
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package org.zhdev.varioutil.util;
|
||||
package net.zhira.varioutil.util;
|
||||
|
||||
import org.zhdev.varioutil.config.ConfigSection;
|
||||
import org.zhdev.varioutil.language.Language;
|
||||
import org.zhdev.varioutil.sql.*;
|
||||
import net.zhira.varioutil.config.ConfigSection;
|
||||
import net.zhira.varioutil.language.Language;
|
||||
import net.zhira.varioutil.sql.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
Loading…
Add table
Add a link
Reference in a new issue