forked from Minecraft-AMS/itemscroller-crafting-fix
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: `MASS_CRAFT_SWAPS` use inventory, not only hotbars * debug * style * fix * fix: make sure the fixes are client side * fix: sakura-ryoko#5 * fix: clientbound packet buffer * debug
- Loading branch information
Showing
11 changed files
with
174 additions
and
30 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
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
31 changes: 31 additions & 0 deletions
31
src/main/java/fi/dy/masa/itemscroller/mixin/debug/MixinServerPlayNetworkHandler.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,31 @@ | ||
package fi.dy.masa.itemscroller.mixin.debug; | ||
|
||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.network.packet.c2s.play.ClickSlotC2SPacket; | ||
import net.minecraft.screen.slot.Slot; | ||
import net.minecraft.server.network.ServerPlayNetworkHandler; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import org.objectweb.asm.Opcodes; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ServerPlayNetworkHandler.class) | ||
public class MixinServerPlayNetworkHandler | ||
{ | ||
@Shadow public ServerPlayerEntity player; | ||
|
||
@Inject(method = "onClickSlot", at = @At(value = "JUMP", opcode = Opcodes.IFEQ, ordinal = 2)) | ||
private void beforeSendUpdates(ClickSlotC2SPacket packet, CallbackInfo ci) { | ||
for (Slot slot : this.player.currentScreenHandler.slots) | ||
{ | ||
ItemStack clientStack = this.player.currentScreenHandler.trackedStacks.get(slot.id); | ||
if (!ItemStack.areItemsEqual(slot.getStack(), clientStack)) | ||
{ | ||
System.err.printf("Slot %d desync! Server: %s, Client: %s\n", slot.id, slot.getStack(), clientStack); | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
accessWidener v1 named | ||
accessible field net/minecraft/screen/ScreenHandler trackedStacks Lnet/minecraft/util/collection/DefaultedList; |
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