Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad861b10bb | ||
|
|
db5b7f89f6 |
@@ -56,7 +56,7 @@ public class PlaceholderManager {
|
|||||||
@NotNull final String identifier) {
|
@NotNull final String identifier) {
|
||||||
Optional<PlaceholderEntry> matching = REGISTERED_PLACEHOLDERS.stream().filter(expansion -> expansion.getIdentifier().equalsIgnoreCase(identifier)).findFirst();
|
Optional<PlaceholderEntry> matching = REGISTERED_PLACEHOLDERS.stream().filter(expansion -> expansion.getIdentifier().equalsIgnoreCase(identifier)).findFirst();
|
||||||
if (matching.isEmpty()) {
|
if (matching.isEmpty()) {
|
||||||
return null;
|
return "";
|
||||||
}
|
}
|
||||||
PlaceholderEntry entry = matching.get();
|
PlaceholderEntry entry = matching.get();
|
||||||
if (player == null && entry.requiresPlayer()) {
|
if (player == null && entry.requiresPlayer()) {
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ class EcoLoadableJSONConfig(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun createFile() {
|
override fun createFile() {
|
||||||
val resourcePath = resourcePath
|
|
||||||
val inputStream = source.getResourceAsStream(resourcePath)!!
|
val inputStream = source.getResourceAsStream(resourcePath)!!
|
||||||
val outFile = File(this.plugin.dataFolder, resourcePath)
|
val outFile = File(this.plugin.dataFolder, resourcePath)
|
||||||
val lastIndex = resourcePath.lastIndexOf('/')
|
val lastIndex = resourcePath.lastIndexOf('/')
|
||||||
@@ -37,11 +36,7 @@ class EcoLoadableJSONConfig(
|
|||||||
}
|
}
|
||||||
if (!outFile.exists()) {
|
if (!outFile.exists()) {
|
||||||
val out: OutputStream = FileOutputStream(outFile)
|
val out: OutputStream = FileOutputStream(outFile)
|
||||||
val buf = ByteArray(1024)
|
inputStream.copyTo(out, 1024)
|
||||||
var len: Int
|
|
||||||
while (inputStream.read(buf).also { len = it } > 0) {
|
|
||||||
out.write(buf, 0, len)
|
|
||||||
}
|
|
||||||
out.close()
|
out.close()
|
||||||
inputStream.close()
|
inputStream.close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ open class EcoLoadableYamlConfig(
|
|||||||
}
|
}
|
||||||
|
|
||||||
final override fun createFile() {
|
final override fun createFile() {
|
||||||
val resourcePath = resourcePath
|
|
||||||
val inputStream = source.getResourceAsStream(resourcePath)!!
|
val inputStream = source.getResourceAsStream(resourcePath)!!
|
||||||
val outFile = File(this.plugin.dataFolder, resourcePath)
|
val outFile = File(this.plugin.dataFolder, resourcePath)
|
||||||
val lastIndex = resourcePath.lastIndexOf('/')
|
val lastIndex = resourcePath.lastIndexOf('/')
|
||||||
@@ -41,11 +40,7 @@ open class EcoLoadableYamlConfig(
|
|||||||
}
|
}
|
||||||
if (!outFile.exists()) {
|
if (!outFile.exists()) {
|
||||||
val out: OutputStream = FileOutputStream(outFile)
|
val out: OutputStream = FileOutputStream(outFile)
|
||||||
val buf = ByteArray(1024)
|
inputStream.copyTo(out, 1024)
|
||||||
var len: Int
|
|
||||||
while (inputStream.read(buf).also { len = it } > 0) {
|
|
||||||
out.write(buf, 0, len)
|
|
||||||
}
|
|
||||||
out.close()
|
out.close()
|
||||||
inputStream.close()
|
inputStream.close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
version = 6.5.1
|
version = 6.5.2
|
||||||
plugin-name = eco
|
plugin-name = eco
|
||||||
Reference in New Issue
Block a user