Skip to content

Commit

Permalink
chore: More Sonar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CoasterFreakDE committed Jun 11, 2024
1 parent 251814d commit a757d45
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ If you run into any issues,
* [ ] Importer
* [ ] Hopper Input
* [ ] Exporter
* [x] Configurable Network Length
* [ ] Player/Region Whitelist
* [ ] Lands Integration
* [x] Support for 1.20.6
* [x] MySQL, MariaDB, SQLite, PostgreSQL, and H2 support



Expand Down Expand Up @@ -91,12 +93,18 @@ drives:
items: 65536
types: 512

networks:
maxLength: 128 # The maximum length of the network (connected blocks)

storage:
# The storage type to use. Options: "mysql", "mariadb"
type: "mariadb"
# The storage type to use. Options: "mysql", "mariadb", "sqlite", "postgresql", "h2"
# I highly recommend using MySQL/MariaDB or PostgreSQL for production environments.
type: "sqlite"
database: "energeticstorage.db"

# MySQL/MariaDB/PostgreSQL configuration
host: "localhost"
port: 3306
database: "energeticstorage"
username: "root"
password: "password"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public void classloader(PluginClasspathBuilder classpathBuilder) {

try (BufferedReader reader = new BufferedReader(new InputStreamReader(
Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream(".dependencies"))))) {
reader.lines().forEach(dependency -> {
maven.addDependency(new Dependency(new DefaultArtifact(dependency), null));
});
reader.lines().forEach(dependency -> maven.addDependency(new Dependency(new DefaultArtifact(dependency), null)));

maven.addRepository(new RemoteRepository.Builder("flawcra", "default", "https://nexus.flawcra.cc/repository/maven-mirrors/").build());
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import org.bukkit.inventory.meta.ItemMeta
import org.bukkit.inventory.meta.SkullMeta
import org.bukkit.persistence.PersistentDataType
import java.lang.reflect.Field
import java.net.URI
import java.net.URL
import java.util.*

Expand Down Expand Up @@ -290,7 +291,7 @@ class ItemBuilder(material: Material, count: Int = 1, dsl: ItemBuilder.() -> Uni
return textureFromSkinTexture(textureCache[mineSkinUUID] ?: return this)
}

val target = URL("https://api.mineskin.org/get/uuid/$mineSkinUUID")
val target = URI("https://api.mineskin.org/get/uuid/$mineSkinUUID").toURL()
val connection = target.openConnection()
connection.setRequestProperty("User-Agent", "RainbowIslands/1.0")
val inputStream = connection.getInputStream()
Expand Down Expand Up @@ -451,7 +452,7 @@ class ItemBuilder(material: Material, count: Int = 1, dsl: ItemBuilder.() -> Uni
*/
fun clearFlags(): ItemBuilder {
val meta = itemStack.itemMeta
meta.removeItemFlags(*ItemFlag.values())
meta.removeItemFlags(*ItemFlag.entries.toTypedArray())
itemStack.itemMeta = meta
return this
}
Expand Down Expand Up @@ -537,7 +538,7 @@ class ItemBuilder(material: Material, count: Int = 1, dsl: ItemBuilder.() -> Uni
}
return this
}


/**
* Creates a deep copy of the current ItemBuilder object.
Expand Down Expand Up @@ -579,7 +580,7 @@ class ItemBuilder(material: Material, count: Int = 1, dsl: ItemBuilder.() -> Uni
)

fun fromItemStack(itemStack: ItemStack): ItemBuilder {
var mat =
val mat =
if (invalidMaterials.contains(itemStack.type)) Material.GRASS_BLOCK else itemStack.type
val builder = ItemBuilder(mat)
builder.itemStack = itemStack
Expand Down

0 comments on commit a757d45

Please sign in to comment.