Skip to content

Commit

Permalink
Update Packet Exploit Patch for Bibliocraft
Browse files Browse the repository at this point in the history
Changes:
- Don't kick players from their singleplayer world
- Make exceptions for empty maps in addition to the original filled maps

Fixes #225 for real
  • Loading branch information
DrParadox7 committed Nov 21, 2023
1 parent c97e6f9 commit 696c9c9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.mitchej123.hodgepodge.mixins.late.bibliocraft;

import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemEmptyMap;
import net.minecraft.item.ItemMap;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
Expand Down Expand Up @@ -68,7 +70,9 @@ public class MixinBibliocraftPatchPacketExploits {
NBTTagList inventoryTagList = tags.getTagList("Inventory", 10);
if (inventoryTagList == null) return;
for (int i = 0; i < inventoryTagList.tagCount(); i++) {
if (!(ItemStack.loadItemStackFromNBT(inventoryTagList.getCompoundTagAt(i)).getItem() instanceof ItemMap)) {
Item itemChecks = ItemStack.loadItemStackFromNBT(inventoryTagList.getCompoundTagAt(i)).getItem();

if (!(itemChecks instanceof ItemMap || itemChecks instanceof ItemEmptyMap)) {
kickAndWarn(player, c, "BiblioFrameGive");
}
}
Expand Down

0 comments on commit 696c9c9

Please sign in to comment.