mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-10-31 23:59:33 +01:00
Start implementing inv update task
This commit is contained in:
parent
b2669129f2
commit
976c418c9e
@ -0,0 +1,22 @@
|
||||
package us.myles.ViaVersion.bukkit.protocol1_12to1_11_1;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import us.myles.ViaVersion.bukkit.providers.BukkitInvContainerItemProvider;
|
||||
|
||||
public class BukkitInvContainerUpdateTask implements Runnable {
|
||||
|
||||
private BukkitInvContainerItemProvider provider;
|
||||
private UUID uuid;
|
||||
|
||||
public BukkitInvContainerUpdateTask(BukkitInvContainerItemProvider provider, UUID uuid) {
|
||||
this.provider = provider;
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO Auto-generated method stub
|
||||
provider.onTaskExecuted(uuid);
|
||||
}
|
||||
}
|
@ -1,15 +1,28 @@
|
||||
package us.myles.ViaVersion.bukkit.providers;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import us.myles.ViaVersion.api.data.UserConnection;
|
||||
import us.myles.ViaVersion.bukkit.protocol1_12to1_11_1.BukkitInvContainerUpdateTask;
|
||||
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.providers.InvContainerItemProvider;
|
||||
|
||||
public class BukkitInvContainerItemProvider extends InvContainerItemProvider {
|
||||
|
||||
private static Map<UUID, BukkitInvContainerUpdateTask> updateTasks = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
public boolean registerInvClickPacket(short windowId, short slotId, short anumber, UserConnection uconnection) {
|
||||
ProtocolInfo info = uconnection.get(ProtocolInfo.class);
|
||||
// TODO: lets add some stuff here :)
|
||||
//http://wiki.vg/index.php?title=Protocol&oldid=13223#Click_Window
|
||||
System.out.println("QUICK ACTION windowId: " + windowId + " slotId: " + slotId + " button: " + 0 + " anumber: " + anumber + " mode: " + 1);
|
||||
// http://wiki.vg/index.php?title=Protocol&oldid=13223#Click_Window
|
||||
System.out.println("info: " + info + " QUICK ACTION windowId: " + windowId + " slotId: " + slotId + " button: " + 0 + " anumber: " + anumber + " mode: " + 1);
|
||||
return false; // change to true once supported
|
||||
}
|
||||
|
||||
public void onTaskExecuted(UUID uuid) {
|
||||
updateTasks.remove(uuid);
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package us.myles.ViaVersion.protocols.protocol1_12to1_11_1.storage;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class InvItemStorage {
|
||||
|
||||
private short windowId;
|
||||
private short slotId;
|
||||
private short actionNumber;
|
||||
}
|
Loading…
Reference in New Issue
Block a user