Skip to content

Commit

Permalink
do some platform upgrades based on latest 1.19 platform
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercoms committed Jun 17, 2022
1 parent 839da27 commit 78f2023
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 61 deletions.
5 changes: 4 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 40,7 @@ dependencies {
}
implementation(libs.maven.artifact)

runtimeOnly(libs.slf4j.jdk14)
runtimeOnly("com.lmax:disruptor:3.4.4")

testImplementation(libs.bundles.junit)
testImplementation(kotlin("test"))
Expand Down Expand Up @@ -185,6 185,9 @@ tasks.jar {
"Specification-Version" to libs.versions.api.get(),
"Specification-Vendor" to "Bukkit Team"
)
for (tld in setOf("net", "com", "org")) {
attributes("$tld/bukkit", "Sealed" to true)
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 14,6 @@ gluegen = "2.3.2"
jocl = "2.3.2"
naether = "0.15.8"
maven-artifact = "3.8.1"
slf4j = "1.7.25"
junit-core = "4.13.1"
junit-ext = "5.7.2"
hamcrest = "2.2"
Expand All @@ -34,7 33,6 @@ jocl = { module = "org.jogamp.jocl:jocl-main", version.ref = "jocl" }

naether = { module = "com.tobedevoured.naether:core", version.ref = "naether" }
maven-artifact = { module = "org.apache.maven:maven-artifact", version.ref = "maven-artifact" }
slf4j-jdk14 = { module = "org.slf4j:slf4j-jdk14", version.ref = "slf4j" }
jansi = { module = "org.fusesource.jansi:jansi", version.ref = "jansi" }
jline = { module = "jline:jline", version.ref = "jline" }
fastutil = { module = "co.aikar:fastutil-lite", version.ref = "fastutil" }
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/glowstone/block/GlowBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 342,7 @@ public byte getData() {
}

public void setData(byte data) {
setData(data, true);
}

public void setData(byte data, boolean applyPhysics) {
Expand Down
22 changes: 10 additions & 12 deletions src/main/java/net/glowstone/util/CompatibilityBundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 18,16 @@
public enum CompatibilityBundle {
CRAFTBUKKIT(
Stream.of(
new Library("org.xerial", "sqlite-jdbc", "3.30.1",
LibraryManager.HashAlgorithm.SHA1, "456f2e23fd0e6a615db6e738b01b9d69456d738c"),
new Library("mysql", "mysql-connector-java", "5.1.48",
LibraryManager.HashAlgorithm.SHA1, "9140be77aafa5050bf4bb936d560cbacb5a6b5c1"),
new Library("org.apache.logging.log4j", "log4j-slf4j-impl", "2.8.1",
LibraryManager.HashAlgorithm.SHA1, "709b07000087f3a0dec1bc4b5e05281499588cae"),
new Library("org.apache.logging.log4j", "log4j-core", "2.8.1",
LibraryManager.HashAlgorithm.SHA1, "4ac28ff2f1ddf05dae3043a190451e8c46b73c31"),
new Library("org.apache.logging.log4j", "log4j-iostreams", "2.8.1",
LibraryManager.HashAlgorithm.SHA1, "dab5403f14a8a7c553850066f9979563d19c1632"),
new Library("org.apache.commons", "commons-lang3", "3.5",
LibraryManager.HashAlgorithm.SHA1, "6c6c702c89bfff3cd9e80b04d668c5e190d588c6")
new Library("org.xerial", "sqlite-jdbc", "3.36.0.3",
LibraryManager.HashAlgorithm.SHA1, "7fa71c4dfab806490cb909714fb41373ec552c29"),
new Library("mysql", "mysql-connector-java", "8.0.29",
LibraryManager.HashAlgorithm.SHA1, "016bfffda393ac4fe56f0985f1f035b37d3fc48f\n"),
new Library("org.apache.logging.log4j", "log4j-slf4j18-impl", "2.17.1",
LibraryManager.HashAlgorithm.SHA1, "ca499d751f4ddd8afb016ef698c30be0da1d09f7"),
new Library("org.apache.logging.log4j", "log4j-core", "2.17.1",
LibraryManager.HashAlgorithm.SHA1, "779f60f3844dadc3ef597976fcb1e5127b1f343d"),
new Library("org.apache.logging.log4j", "log4j-iostreams", "2.17.1",
LibraryManager.HashAlgorithm.SHA1, "6ebd6d2186fae85d294b5d1994d711242d314427")
)
.collect(ImmutableMap.toImmutableMap(Library::getLibraryKey, Function.identity()))
),
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/net/glowstone/util/InventoryUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 1,6 @@
package net.glowstone.util;

import com.google.common.base.Preconditions;
import net.glowstone.EventFactory;
import net.glowstone.entity.GlowPlayer;
import org.bukkit.GameMode;
Expand All @@ -26,6 27,27 @@ public class InventoryUtil {
public static final Collection<ItemStack> NO_ITEMS_COLLECTION = Collections.emptyList();
public static final ImmutableItemStack EMPTY_STACK = new ImmutableItemStack(Material.AIR, 0);

/**
* Defaults stack size to 1, with no extra data.
*
* @param type item material
*/
public static ItemStack createItem(@NotNull final Material type) {
Preconditions.checkArgument(type.isItem());
return new ItemStack(type);
}

/**
* An item stack with no extra data.
*
* @param type item material
* @param amount stack size
*/
public static ItemStack createItem(@NotNull final Material type, final int amount){
Preconditions.checkArgument(type.isItem());
return new ItemStack(type, amount);
}

/**
* Checks whether the given ItemStack is empty.
*
Expand Down
29 changes: 0 additions & 29 deletions src/main/resources/log4j.xml

This file was deleted.

40 changes: 40 additions & 0 deletions src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 1,40 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Configuration status="WARN" shutdownHook="disable">
<Appenders>
<RollingRandomAccessFile name="File" fileName="logs/server.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout>
<LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] {%msg}%n%xEx{full}">
<!-- Log root without prefix -->
<!-- Disable prefix for various plugins that bypass the plugin logger -->
<PatternMatch key=",com.sk89q.,ru.tehkode.,Minecraft.AWE"
pattern="[%d{HH:mm:ss}] [%t/%level]: {%msg}%n%xEx{full}" />
</LoggerNamePatternSelector>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy />
<OnStartupTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy max="1000"/>
</RollingRandomAccessFile>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout>
<LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] {%msg}%n%xEx{full}}">
<!-- Log root without prefix -->
<!-- Disable prefix for various plugins that bypass the plugin logger -->
<PatternMatch key=",,com.sk89q.,ru.tehkode.,Minecraft.AWE"
pattern="%highlightError{[%d{HH:mm:ss} %level]: {%msg}%n%xEx{full}}" />
</LoggerNamePatternSelector>
</PatternLayout>
</Console>
<Async name="Async">
<AppenderRef ref="File"/>
<AppenderRef ref="Console" level="info"/>
</Async>
</Appenders>

<Loggers>
<Root level="info">
<AppenderRef ref="Async"/>
</Root>
</Loggers>
</Configuration>
17 changes: 0 additions & 17 deletions src/test/resources/log4j.xml

This file was deleted.

14 changes: 14 additions & 0 deletions src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Configuration status="WARN" shutdownHook="disable">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%-5p %c{1} - %m%n" />
</Console>
</Appenders>

<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

0 comments on commit 78f2023

Please sign in to comment.