-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf93456
commit 2665e1c
Showing
33 changed files
with
348 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
# Project exclude paths | ||
/.gradle/ | ||
/.idea/ | ||
/build/ | ||
/common/.gradle/ | ||
/common/build/ | ||
/fabric/.gradle/ | ||
/build/classes/java/main/ | ||
/run/ | ||
/.idea/ | ||
/artifacts/ | ||
|
||
/fabric/build/ | ||
/forge/build/ | ||
/fabric/.gradle/ | ||
/forge/.gradle/ | ||
/forge/build/ | ||
/fabric/run/ | ||
/forge/run/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,15 @@ | ||
import net.fabricmc.loom.api.LoomGradleExtensionAPI | ||
|
||
plugins { | ||
java | ||
id("architectury-plugin") version "3.4-SNAPSHOT" | ||
id("dev.architectury.loom") version "1.3-SNAPSHOT" apply false | ||
} | ||
|
||
val minecraftVersion: String by extra | ||
val modVersion: String by extra | ||
|
||
architectury { | ||
minecraft = minecraftVersion | ||
} | ||
val minecraftVersion: String by extra | ||
|
||
subprojects { | ||
apply(plugin = "dev.architectury.loom") | ||
|
||
base { | ||
archivesName.set("PacketFixer-" + project.name) | ||
} | ||
|
||
configure<LoomGradleExtensionAPI> { | ||
silentMojangMappingsLicense() | ||
} | ||
|
||
dependencies { | ||
"minecraft"("com.mojang:minecraft:$minecraftVersion") | ||
"mappings"(project.the<LoomGradleExtensionAPI>().officialMojangMappings()) | ||
} | ||
} | ||
|
||
allprojects { | ||
apply(plugin = "java") | ||
apply(plugin = "architectury-plugin") | ||
|
||
version = modVersion | ||
group = "net.tonimatasdev.packetfixer" | ||
|
||
repositories { | ||
|
||
} | ||
|
||
tasks.withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
} | ||
version = "$modVersion-$minecraftVersion" | ||
group = "net.tonimatasdev" | ||
|
||
java { | ||
withSourcesJar() | ||
} | ||
base.archivesName.set("PacketFixer-" + project.name) | ||
} |
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
common/src/main/java/net/tonimatasdev/packetfixer/PacketFixer.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
fabric/src/main/java/net/tonimatasdev/packetfixerfabric/PacketFixerFabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package net.tonimatasdev.packetfixerfabric; | ||
|
||
import com.mojang.logging.LogUtils; | ||
import net.fabricmc.api.ModInitializer; | ||
import net.tonimatasdev.packetfixer.PacketFixer; | ||
|
||
public class PacketFixerFabric implements ModInitializer { | ||
@Override | ||
public void onInitialize() { | ||
PacketFixer.init(); | ||
LogUtils.getLogger().info("PacketFixer (Fabric) has been initialized successfully"); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...c/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/CustomPayloadC2SPacketMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
|
||
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(value = CustomPayloadC2SPacket.class, priority = 999) | ||
public class CustomPayloadC2SPacketMixin { | ||
@ModifyConstant(method = "<init>(Lnet/minecraft/network/PacketByteBuf;)V", constant = @Constant(intValue = 32767)) | ||
private int newSize(int value) { | ||
return value * 100; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...c/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/CustomPayloadS2CPacketMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(value = CustomPayloadS2CPacket.class, priority = 999) | ||
public class CustomPayloadS2CPacketMixin { | ||
@ModifyConstant(method = "<init>*", constant = @Constant(intValue = 1048576)) | ||
private int newSize(int value) { | ||
return value * 100; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...c/main/java/net/tonimatasdev/packetfixerfabric/mixin/LoginQueryRequestS2CPacketMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
import net.minecraft.network.packet.s2c.login.LoginQueryRequestS2CPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(value = LoginQueryRequestS2CPacket.class, priority = 999) | ||
public class LoginQueryRequestS2CPacketMixin { | ||
@ModifyConstant(method = "<init>(Lnet/minecraft/network/PacketByteBuf;)V", constant = @Constant(intValue = 1048576)) | ||
private int newSize(int value) { | ||
return value * 100; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
.../main/java/net/tonimatasdev/packetfixerfabric/mixin/LoginQueryResponseC2SPacketMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
import net.minecraft.network.PacketByteBuf; | ||
import net.minecraft.network.packet.c2s.login.LoginQueryResponseC2SPacket; | ||
import org.objectweb.asm.Opcodes; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(value = LoginQueryResponseC2SPacket.class, priority = 999) | ||
public class LoginQueryResponseC2SPacketMixin { | ||
|
||
@SuppressWarnings({"UnusedAssignment", "ParameterCanBeLocal"}) | ||
@Redirect(method = "<init>(Lnet/minecraft/network/PacketByteBuf;)V", at = @At(value = "FIELD", target = "Lnet/minecraft/network/packet/c2s/login/LoginQueryResponseC2SPacket;response:Lnet/minecraft/network/PacketByteBuf;", opcode = Opcodes.PUTFIELD)) | ||
private void newSize(LoginQueryResponseC2SPacket instance, PacketByteBuf data, PacketByteBuf value) { | ||
data = value.readNullable((p_238039_) -> { | ||
int i = p_238039_.readableBytes(); | ||
return new PacketByteBuf(p_238039_.readBytes(i)); | ||
}); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/NbtTagSizeTrackerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
import net.minecraft.nbt.NbtTagSizeTracker; | ||
import org.objectweb.asm.Opcodes; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(value = NbtTagSizeTracker.class, priority = 999) | ||
public abstract class NbtTagSizeTrackerMixin { | ||
@Redirect(method = "add", at = @At(value = "FIELD", target = "Lnet/minecraft/nbt/NbtTagSizeTracker;maxBytes:J", opcode = Opcodes.GETFIELD)) | ||
public long accountBits(NbtTagSizeTracker instance) { | ||
return 2097152 * 100; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/PacketEncoderMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
import net.minecraft.network.PacketEncoder; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(value = PacketEncoder.class, priority = 999) | ||
public class PacketEncoderMixin { | ||
@ModifyConstant(method = "encode(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/packet/Packet;Lio/netty/buffer/ByteBuf;)V", constant = @Constant(intValue = 8388608)) | ||
private int newSize(int value) { | ||
return value * 100; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/PacketInflaterMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
import net.minecraft.network.PacketInflater; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(value = PacketInflater.class, priority = 999) | ||
public class PacketInflaterMixin { | ||
@ModifyConstant(method = "decode", constant = @Constant(intValue = 8388608), require = 0) | ||
private int newSize(int value) { | ||
return value * 100; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"required": true, | ||
"package": "net.tonimatasdev.packetfixerfabric.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"mixins": [ | ||
"CustomPayloadC2SPacketMixin", | ||
"CustomPayloadS2CPacketMixin", | ||
"LoginQueryRequestS2CPacketMixin", | ||
"LoginQueryResponseC2SPacketMixin", | ||
"NbtTagSizeTrackerMixin", | ||
"PacketEncoderMixin", | ||
"PacketInflaterMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |
Oops, something went wrong.