Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
astei committed Jun 23, 2022
1 parent 943a27e commit 8d957c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation include("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT")

// Include LazyDFU so starting the server and client at the same time doesn't turn my computer into a fighter jet
// modRuntimeOnly "com.github.astei:lazydfu:${project.lazydfu_version}"
}

test {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ minecraft_version=1.19
yarn_mappings=1.19+build.1
loader_version=0.14.6
# Runtime
lazydfu_version=0.1.2
lazydfu_version=0.1.3
# Mod Properties
mod_version=0.2.0
mod_version=0.2.1-SNAPSHOT
maven_group=me.steinborn
archives_base_name=krypton
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ public static int getVarIntLength(int value) {
*/
@Overwrite
public PacketByteBuf writeString(String string, int i) {
if (string.length() > i) {
throw new EncoderException("String too big (was " + string.length() + " characters, max " + i + ")");
}
int utf8Bytes = ByteBufUtil.utf8Bytes(string);
if (utf8Bytes > i) {
throw new EncoderException("String too big (was " + utf8Bytes + " bytes encoded, max " + i + ")");
if (utf8Bytes > i * 3) {
throw new EncoderException("String too big (was " + utf8Bytes + " bytes encoded, max " + (i * 3) + ")");
} else {
this.writeVarInt(utf8Bytes);
this.writeCharSequence(string, StandardCharsets.UTF_8);
Expand Down

0 comments on commit 8d957c9

Please sign in to comment.