mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-10-31 23:59:33 +01:00
Add config for quick move action patch
This commit is contained in:
parent
2703e849cb
commit
a27808ade1
@ -164,6 +164,11 @@ public class BukkitConfigAPI extends Config implements ViaVersionConfig {
|
||||
public boolean is1_12NBTArrayFix() {
|
||||
return getBoolean("chat-nbt-fix", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_12QuickMoveActionFix() {
|
||||
return getBoolean("quick-move-action-fix", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getBlockedProtocols() {
|
||||
|
@ -64,7 +64,9 @@ public class BukkitViaLoader implements ViaPlatformLoader {
|
||||
/* Providers */
|
||||
Via.getManager().getProviders().use(BulkChunkTranslatorProvider.class, new BukkitViaBulkChunkTranslator());
|
||||
Via.getManager().getProviders().use(MovementTransmitterProvider.class, new BukkitViaMovementTransmitter());
|
||||
Via.getManager().getProviders().use(InvContainerItemProvider.class, new BukkitInvContainerItemProvider());
|
||||
if (plugin.getConf().is1_12QuickMoveActionFix()) {
|
||||
Via.getManager().getProviders().use(InvContainerItemProvider.class, new BukkitInvContainerItemProvider());
|
||||
}
|
||||
Via.getManager().getProviders().use(HandItemProvider.class, new HandItemProvider() {
|
||||
@Override
|
||||
public Item getHandItem(final UserConnection info) {
|
||||
|
@ -10,7 +10,7 @@ import java.net.URL;
|
||||
import java.util.*;
|
||||
|
||||
public class BungeeConfigAPI extends Config implements ViaVersionConfig {
|
||||
private static List<String> UNSUPPORTED = Arrays.asList("nms-player-ticking", "item-cache", "anti-xray-patch");
|
||||
private static List<String> UNSUPPORTED = Arrays.asList("nms-player-ticking", "item-cache", "anti-xray-patch", "quick-move-action-fix");
|
||||
|
||||
public BungeeConfigAPI(File configFile) {
|
||||
super(new File(configFile, "config.yml"));
|
||||
@ -203,6 +203,11 @@ public class BungeeConfigAPI extends Config implements ViaVersionConfig {
|
||||
public boolean is1_12NBTArrayFix() {
|
||||
return getBoolean("chat-nbt-fix", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_12QuickMoveActionFix() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getBlockedProtocols() {
|
||||
|
@ -209,7 +209,14 @@ public interface ViaVersionConfig {
|
||||
* @return True if enabled
|
||||
*/
|
||||
boolean is1_12NBTArrayFix();
|
||||
|
||||
|
||||
/**
|
||||
* Should we fix shift quick move action for 1.12 clients
|
||||
*
|
||||
* @return True if enabled
|
||||
*/
|
||||
boolean is1_12QuickMoveActionFix();
|
||||
|
||||
/**
|
||||
* Get the blocked protocols
|
||||
*
|
||||
|
@ -120,9 +120,13 @@ public class InventoryPackets {
|
||||
handler(new PacketHandler() {
|
||||
@Override
|
||||
public void handle(PacketWrapper wrapper) throws Exception {
|
||||
Item item = wrapper.get(Type.ITEM, 0);
|
||||
if (!Via.getConfig().is1_12QuickMoveActionFix()) {
|
||||
BedRewriter.toServerItem(item);
|
||||
return;
|
||||
}
|
||||
byte button = wrapper.get(Type.BYTE, 0);
|
||||
int mode = wrapper.get(Type.VAR_INT, 0);
|
||||
Item item = wrapper.get(Type.ITEM, 0);
|
||||
// QUICK_MOVE PATCH (Shift + (click/double click))
|
||||
if (mode == 1 && button == 0 && item == null) {
|
||||
short windowId = wrapper.get(Type.UNSIGNED_BYTE, 0);
|
||||
|
@ -84,6 +84,8 @@ hologram-y: -0.96
|
||||
piston-animation-patch: false
|
||||
# Should we fix nbt for 1.12 and above clients in chat messages (causes invalid item)
|
||||
chat-nbt-fix: true
|
||||
# Should we fix shift quick move action for 1.12 clients (causes shift + double click not to work when moving items) (only works on 1.8-1.11.2 bukkit based servers)
|
||||
quick-move-action-fix: true
|
||||
#
|
||||
#----------------------------------------------------------#
|
||||
# 1.9 & 1.10 CLIENTS ON 1.8 SERVERS OPTIONS #
|
||||
|
@ -13,7 +13,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
public class SpongeConfigAPI extends Config implements ViaVersionConfig {
|
||||
private static List<String> UNSUPPORTED = Arrays.asList("anti-xray-patch", "bungee-ping-interval", "bungee-ping-save", "bungee-servers");
|
||||
private static List<String> UNSUPPORTED = Arrays.asList("anti-xray-patch", "bungee-ping-interval", "bungee-ping-save", "bungee-servers", "quick-move-action-fix");
|
||||
private final PluginContainer pluginContainer;
|
||||
|
||||
public SpongeConfigAPI(PluginContainer pluginContainer, File configFile) {
|
||||
@ -185,6 +185,11 @@ public class SpongeConfigAPI extends Config implements ViaVersionConfig {
|
||||
public boolean is1_12NBTArrayFix() {
|
||||
return getBoolean("chat-nbt-fix", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_12QuickMoveActionFix() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getBlockedProtocols() {
|
||||
|
Loading…
Reference in New Issue
Block a user