This repository has been archived by the owner on Jun 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
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
61db74c
commit b10a716
Showing
8 changed files
with
259 additions
and
45 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
48 changes: 47 additions & 1 deletion
48
main/java/io/github/thatsmusic99/headsplus/nms/v1_14_R1_NMS/SearchGUI1_14_R1.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,4 +1,50 @@ | ||
package io.github.thatsmusic99.headsplus.nms.v1_14_R1_NMS; | ||
|
||
public class SearchGUI1_14_R1 { | ||
import io.github.thatsmusic99.headsplus.nms.SearchGUI; | ||
import net.minecraft.server.v1_14_R1.*; | ||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer; | ||
import org.bukkit.entity.Player; | ||
|
||
public class SearchGUI1_14_R1 extends SearchGUI { | ||
public SearchGUI1_14_R1(Player player, AnvilClickEventHandler handler) { | ||
super(player, handler); | ||
} | ||
|
||
private class AnvilContainer extends ContainerAnvil { | ||
public AnvilContainer(EntityHuman entity) { | ||
super(((CraftPlayer)((Player) entity)).getHandle().nextContainerCounter(), entity.inventory); | ||
} | ||
|
||
@Override | ||
public boolean canUse(EntityHuman entityhuman) { | ||
return true; | ||
} | ||
} | ||
|
||
|
||
public void open() { | ||
EntityPlayer p = ((CraftPlayer) getPlayer()).getHandle(); | ||
|
||
AnvilContainer container = new AnvilContainer(p); | ||
|
||
//Set the items to the items from the inventory given | ||
inv = container.getBukkitView().getTopInventory(); | ||
|
||
for (AnvilSlot slot : items.keySet()) { | ||
inv.setItem(slot.getSlot(), items.get(slot)); | ||
} | ||
|
||
//Counter stuff that the game uses to keep track of inventories | ||
int c = p.nextContainerCounter(); | ||
|
||
//Send the packet | ||
// p.playerConnection.sendPacket(new PacketPlayOutOpenWindow(0, container, new ChatMessage("Repairing"))); | ||
//Set their active container to the container | ||
p.activeContainer = container; | ||
|
||
//Set their active container window id to that counter stuff | ||
|
||
//Add the slot listener | ||
p.activeContainer.addSlotListener(p); | ||
} | ||
} |
Oops, something went wrong.