Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 00:00:28 +01:00
Start implementing inv update task
Dieser Commit ist enthalten in:
Ursprung
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;
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren