3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 16:12:42 +01:00

Start implementing inv update task

Dieser Commit ist enthalten in:
mmxw11 2017-09-25 16:13:56 +03:00
Ursprung b2669129f2
Commit 976c418c9e
3 geänderte Dateien mit 50 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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;
}