forked from maruohon/malilib
-
Notifications
You must be signed in to change notification settings - Fork 30
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
a610220
commit cd2cac3
Showing
41 changed files
with
1,595 additions
and
273 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
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 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 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
12 changes: 12 additions & 0 deletions
12
src/main/java/fi/dy/masa/malilib/mixin/test/IMixinDataQueryHandler.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,12 @@ | ||
package fi.dy.masa.malilib.mixin.test; | ||
|
||
import net.minecraft.client.network.DataQueryHandler; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(DataQueryHandler.class) | ||
public interface IMixinDataQueryHandler | ||
{ | ||
@Accessor("expectedTransactionId") | ||
int malilib_currentTransactionId(); | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/fi/dy/masa/malilib/mixin/test/MixinClientPlayNetworkHandler_NbtQuery.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,25 @@ | ||
package fi.dy.masa.malilib.mixin.test; | ||
|
||
import net.minecraft.client.network.ClientPlayNetworkHandler; | ||
import net.minecraft.nbt.NbtCompound; | ||
import net.minecraft.network.packet.s2c.play.NbtQueryResponseS2CPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import fi.dy.masa.malilib.MaLiLibConfigs; | ||
import fi.dy.masa.malilib.test.TestDataSync; | ||
|
||
@Mixin(ClientPlayNetworkHandler.class) | ||
public class MixinClientPlayNetworkHandler_NbtQuery | ||
{ | ||
@Inject(method = "onNbtQueryResponse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/DataQueryHandler;handleQueryResponse(ILnet/minecraft/nbt/NbtCompound;)Z")) | ||
private void onQueryResponse(NbtQueryResponseS2CPacket packet, CallbackInfo ci) | ||
{ | ||
if (MaLiLibConfigs.Test.TEST_CONFIG_BOOLEAN.getBooleanValue()) | ||
{ | ||
TestDataSync.getInstance().handleVanillaQueryNbt(packet.getTransactionId(), packet.getNbt() != null ? packet.getNbt() : new NbtCompound()); | ||
} | ||
} | ||
} |
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 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 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 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
Oops, something went wrong.