Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4.7.0
with:
distribution: adopt
java-version: 17
distribution: temurin
java-version: 25
- name: Build LimboFilter
run: ./gradlew build
- name: Upload LimboFilter
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4.7.0
with:
distribution: adopt
java-version: 17
distribution: temurin
java-version: 25
- name: Build LimboFilter
run: ./gradlew build
- name: Upload LimboFilter
Expand Down
26 changes: 8 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
plugins {
id("java")
id("checkstyle")
id("com.github.spotbugs").version("6.1.7")
id("org.cadixdev.licenser").version("0.6.1")
id("com.gradleup.shadow").version("8.3.6")
id("com.github.spotbugs").version("6.4.8")
id("net.minecraftforge.licenser").version("1.2.0")
id("com.gradleup.shadow").version("9.4.0")
}

setGroup("net.elytrium")
Expand All @@ -16,8 +16,8 @@ compileJava {
}

java {
setSourceCompatibility(JavaVersion.VERSION_17)
setTargetCompatibility(JavaVersion.VERSION_17)
setSourceCompatibility(JavaVersion.VERSION_21)
setTargetCompatibility(JavaVersion.VERSION_21)
}

repositories {
Expand Down Expand Up @@ -66,7 +66,6 @@ license {
}

checkstyle {
setToolVersion("10.1")
setConfigFile(file("${this.getRootDir()}/config/checkstyle/checkstyle.xml"))
setConfigProperties("configDirectory": "${this.getRootDir()}/config/checkstyle")

Expand Down Expand Up @@ -103,16 +102,7 @@ sourceSets.main.getJava().srcDir(
assemble.dependsOn(shadowJar)

String getCurrentShortRevision() {
OutputStream outputStream = new ByteArrayOutputStream()
exec {
if (System.getProperty("os.name").toLowerCase().contains("win")) {
commandLine("cmd", "/c", "git rev-parse --short HEAD")
} else {
commandLine("bash", "-c", "git rev-parse --short HEAD")
}

setStandardOutput(outputStream)
}

return outputStream.toString().trim()
return System.getProperty("os.name").toLowerCase().contains("win")
? ["cmd", "/c", "git rev-parse --short HEAD"].execute().text.trim()
: ["bash", "-c", "git rev-parse --short HEAD"].execute().text.trim()
}
3 changes: 3 additions & 0 deletions config/spotbugs/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
<Match>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Bug pattern="AT_STALE_THREAD_WRITE_OF_PRIMITIVE"/>
</Match>
</FindBugsFilter>
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
limboapiVersion=1.1.27
velocityVersion=3.4.0-SNAPSHOT
velocityVersion=3.5.0-SNAPSHOT
nettyVersion=4.1.86.Final
fastutilVersion=8.5.11
log4jVersion=2.19.0
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions src/main/java/net/elytrium/limbofilter/LimboFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.scheduler.ScheduledTask;
import com.velocitypowered.proxy.console.VelocityConsole;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOError;
Expand Down Expand Up @@ -164,7 +163,6 @@ public void onProxyInitialization(ProxyInitializeEvent event) {
Configurator.setLevel(consoleLogger.getName(), consoleLogger.getLevel());
}

@SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH", justification = "LEGACY_AMPERSAND can't be null in velocity.")
public void reload() {
Settings.IMP.reload(this.configFile, Settings.IMP.PREFIX);

Expand Down Expand Up @@ -299,6 +297,7 @@ public void reload() {
new PacketMapping(0x16, ProtocolVersion.MINECRAFT_1_20_5, false),
new PacketMapping(0x18, ProtocolVersion.MINECRAFT_1_21_2, false),
new PacketMapping(0x19, ProtocolVersion.MINECRAFT_1_21_6, false),
new PacketMapping(0x1A, ProtocolVersion.MINECRAFT_26_1, false),
})
.registerPacket(PacketDirection.CLIENTBOUND, SetEntityMetadata.class, null, new PacketMapping[]{
new PacketMapping(0x1C, ProtocolVersion.MINIMUM_VERSION, true),
Expand All @@ -318,6 +317,7 @@ public void reload() {
new PacketMapping(0x5D, ProtocolVersion.MINECRAFT_1_21_2, true),
new PacketMapping(0x5C, ProtocolVersion.MINECRAFT_1_21_5, true),
new PacketMapping(0x61, ProtocolVersion.MINECRAFT_1_21_9, true),
new PacketMapping(0x63, ProtocolVersion.MINECRAFT_26_1, true),
})
.registerPacket(PacketDirection.CLIENTBOUND, SpawnEntity.class, null, new PacketMapping[]{
new PacketMapping(0x0E, ProtocolVersion.MINIMUM_VERSION, true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.velocitypowered.proxy.protocol.MinecraftPacket;
import com.velocitypowered.proxy.protocol.ProtocolUtils;
import io.netty.buffer.ByteBuf;
import net.elytrium.limbofilter.protocol.data.PackedVector;

public class Interact implements MinecraftPacket {

Expand All @@ -35,7 +36,15 @@ public class Interact implements MinecraftPacket {

@Override
public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion protocolVersion) {
if (protocolVersion.compareTo(ProtocolVersion.MINECRAFT_1_7_6) > 0) {
if (protocolVersion.compareTo(ProtocolVersion.MINECRAFT_26_1) >= 0) {
this.entityId = ProtocolUtils.readVarInt(buf);
this.hand = ProtocolUtils.readVarInt(buf);
PackedVector target = PackedVector.read(buf);
this.targetX = (float) target.x();
this.targetY = (float) target.y();
this.targetZ = (float) target.z();
this.sneaking = buf.readBoolean();
} else if (protocolVersion.compareTo(ProtocolVersion.MINECRAFT_1_7_6) > 0) {
this.entityId = ProtocolUtils.readVarInt(buf);
this.type = ProtocolUtils.readVarInt(buf);
if (this.type == 2) {
Expand Down
Loading