mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-26 03:55:28 +01:00
Make InvContainerItemProvider
This commit is contained in:
parent
ce219e208c
commit
343e316e4c
@ -1,10 +1,12 @@
|
|||||||
package us.myles.ViaVersion.bukkit.platform;
|
package us.myles.ViaVersion.bukkit.platform;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
import us.myles.ViaVersion.ViaVersionPlugin;
|
import us.myles.ViaVersion.ViaVersionPlugin;
|
||||||
import us.myles.ViaVersion.api.Via;
|
import us.myles.ViaVersion.api.Via;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
@ -12,9 +14,11 @@ import us.myles.ViaVersion.api.minecraft.item.Item;
|
|||||||
import us.myles.ViaVersion.api.platform.ViaPlatformLoader;
|
import us.myles.ViaVersion.api.platform.ViaPlatformLoader;
|
||||||
import us.myles.ViaVersion.bukkit.listeners.UpdateListener;
|
import us.myles.ViaVersion.bukkit.listeners.UpdateListener;
|
||||||
import us.myles.ViaVersion.bukkit.listeners.protocol1_9to1_8.*;
|
import us.myles.ViaVersion.bukkit.listeners.protocol1_9to1_8.*;
|
||||||
|
import us.myles.ViaVersion.bukkit.providers.BukkitInvContainerItemProvider;
|
||||||
import us.myles.ViaVersion.bukkit.providers.BukkitViaBulkChunkTranslator;
|
import us.myles.ViaVersion.bukkit.providers.BukkitViaBulkChunkTranslator;
|
||||||
import us.myles.ViaVersion.bukkit.providers.BukkitViaMovementTransmitter;
|
import us.myles.ViaVersion.bukkit.providers.BukkitViaMovementTransmitter;
|
||||||
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||||
|
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.providers.InvContainerItemProvider;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.BulkChunkTranslatorProvider;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.BulkChunkTranslatorProvider;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.HandItemProvider;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.HandItemProvider;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
|
||||||
@ -60,6 +64,7 @@ public class BukkitViaLoader implements ViaPlatformLoader {
|
|||||||
/* Providers */
|
/* Providers */
|
||||||
Via.getManager().getProviders().use(BulkChunkTranslatorProvider.class, new BukkitViaBulkChunkTranslator());
|
Via.getManager().getProviders().use(BulkChunkTranslatorProvider.class, new BukkitViaBulkChunkTranslator());
|
||||||
Via.getManager().getProviders().use(MovementTransmitterProvider.class, new BukkitViaMovementTransmitter());
|
Via.getManager().getProviders().use(MovementTransmitterProvider.class, new BukkitViaMovementTransmitter());
|
||||||
|
Via.getManager().getProviders().use(InvContainerItemProvider.class, new BukkitInvContainerItemProvider());
|
||||||
Via.getManager().getProviders().use(HandItemProvider.class, new HandItemProvider() {
|
Via.getManager().getProviders().use(HandItemProvider.class, new HandItemProvider() {
|
||||||
@Override
|
@Override
|
||||||
public Item getHandItem(final UserConnection info) {
|
public Item getHandItem(final UserConnection info) {
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package us.myles.ViaVersion.bukkit.providers;
|
||||||
|
|
||||||
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
|
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.providers.InvContainerItemProvider;
|
||||||
|
|
||||||
|
public class BukkitInvContainerItemProvider extends InvContainerItemProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean registerInvClickPacket(int windowId, short slotId, byte button, short amumber, int mode, UserConnection uconnection) {
|
||||||
|
// TODO: lets add some stuff here :)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -12,6 +12,7 @@ import us.myles.ViaVersion.api.data.UserConnection;
|
|||||||
import us.myles.ViaVersion.api.entities.Entity1_12Types;
|
import us.myles.ViaVersion.api.entities.Entity1_12Types;
|
||||||
import us.myles.ViaVersion.api.minecraft.chunks.Chunk;
|
import us.myles.ViaVersion.api.minecraft.chunks.Chunk;
|
||||||
import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection;
|
import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection;
|
||||||
|
import us.myles.ViaVersion.api.platform.providers.ViaProviders;
|
||||||
import us.myles.ViaVersion.api.protocol.Protocol;
|
import us.myles.ViaVersion.api.protocol.Protocol;
|
||||||
import us.myles.ViaVersion.api.remapper.PacketHandler;
|
import us.myles.ViaVersion.api.remapper.PacketHandler;
|
||||||
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
||||||
@ -19,6 +20,7 @@ import us.myles.ViaVersion.api.type.Type;
|
|||||||
import us.myles.ViaVersion.api.type.types.version.Types1_12;
|
import us.myles.ViaVersion.api.type.types.version.Types1_12;
|
||||||
import us.myles.ViaVersion.packets.State;
|
import us.myles.ViaVersion.packets.State;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.packets.InventoryPackets;
|
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.packets.InventoryPackets;
|
||||||
|
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.providers.InvContainerItemProvider;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.storage.EntityTracker;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4Type;
|
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4Type;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
||||||
@ -385,6 +387,11 @@ public class Protocol1_12To1_11_1 extends Protocol {
|
|||||||
return newId;
|
return newId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void register(ViaProviders providers) {
|
||||||
|
providers.register(InvContainerItemProvider.class, new InvContainerItemProvider());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(UserConnection userConnection) {
|
public void init(UserConnection userConnection) {
|
||||||
userConnection.put(new EntityTracker(userConnection));
|
userConnection.put(new EntityTracker(userConnection));
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package us.myles.ViaVersion.protocols.protocol1_12to1_11_1.providers;
|
||||||
|
|
||||||
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
|
import us.myles.ViaVersion.api.platform.providers.Provider;
|
||||||
|
|
||||||
|
public class InvContainerItemProvider implements Provider {
|
||||||
|
|
||||||
|
public boolean registerInvClickPacket(int windowId, short slotId, byte button, short amumber, int mode, UserConnection uconnection) {
|
||||||
|
return false; // not supported :/ plays very sad violin
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user