Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-08 17:20:24 +01:00
Merge branch 'master' into abstraction
Dieser Commit ist enthalten in:
Commit
5c54e8a08d
@ -45,7 +45,9 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
|
|||||||
private boolean serversideBlockConnections;
|
private boolean serversideBlockConnections;
|
||||||
private boolean reduceBlockStorageMemory;
|
private boolean reduceBlockStorageMemory;
|
||||||
private boolean flowerStemWhenBlockAbove;
|
private boolean flowerStemWhenBlockAbove;
|
||||||
|
private boolean vineClimbFix;
|
||||||
private boolean snowCollisionFix;
|
private boolean snowCollisionFix;
|
||||||
|
private boolean infestedBlocksFix;
|
||||||
private int tabCompleteDelay;
|
private int tabCompleteDelay;
|
||||||
private boolean truncate1_14Books;
|
private boolean truncate1_14Books;
|
||||||
private boolean leftHandedHandling;
|
private boolean leftHandedHandling;
|
||||||
@ -100,7 +102,9 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
|
|||||||
serversideBlockConnections = getBoolean("serverside-blockconnections", false);
|
serversideBlockConnections = getBoolean("serverside-blockconnections", false);
|
||||||
reduceBlockStorageMemory = getBoolean("reduce-blockstorage-memory", false);
|
reduceBlockStorageMemory = getBoolean("reduce-blockstorage-memory", false);
|
||||||
flowerStemWhenBlockAbove = getBoolean("flowerstem-when-block-above", false);
|
flowerStemWhenBlockAbove = getBoolean("flowerstem-when-block-above", false);
|
||||||
|
vineClimbFix = getBoolean("vine-climb-fix", false);
|
||||||
snowCollisionFix = getBoolean("fix-low-snow-collision", false);
|
snowCollisionFix = getBoolean("fix-low-snow-collision", false);
|
||||||
|
infestedBlocksFix = getBoolean("fix-infested-block-breaking", true);
|
||||||
tabCompleteDelay = getInt("1_13-tab-complete-delay", 0);
|
tabCompleteDelay = getInt("1_13-tab-complete-delay", 0);
|
||||||
truncate1_14Books = getBoolean("truncate-1_14-books", false);
|
truncate1_14Books = getBoolean("truncate-1_14-books", false);
|
||||||
leftHandedHandling = getBoolean("left-handed-handling", true);
|
leftHandedHandling = getBoolean("left-handed-handling", true);
|
||||||
@ -232,7 +236,7 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
|
|||||||
@Override
|
@Override
|
||||||
public boolean isAutoTeam() {
|
public boolean isAutoTeam() {
|
||||||
// Collision has to be enabled first
|
// Collision has to be enabled first
|
||||||
return isPreventCollision() && autoTeam;
|
return preventCollision && autoTeam;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -305,11 +309,21 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
|
|||||||
return flowerStemWhenBlockAbove;
|
return flowerStemWhenBlockAbove;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isVineClimbFix() {
|
||||||
|
return vineClimbFix;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSnowCollisionFix() {
|
public boolean isSnowCollisionFix() {
|
||||||
return snowCollisionFix;
|
return snowCollisionFix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isInfestedBlocksFix() {
|
||||||
|
return infestedBlocksFix;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int get1_13TabCompleteDelay() {
|
public int get1_13TabCompleteDelay() {
|
||||||
return tabCompleteDelay;
|
return tabCompleteDelay;
|
||||||
|
@ -280,6 +280,13 @@ public interface ViaVersionConfig {
|
|||||||
*/
|
*/
|
||||||
boolean isStemWhenBlockAbove();
|
boolean isStemWhenBlockAbove();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vines not connected to any blocks will be mapped to air for 1.13+ clients to prevent them from climbing up.
|
||||||
|
*
|
||||||
|
* @return True if enabled
|
||||||
|
*/
|
||||||
|
boolean isVineClimbFix();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When activated, the 1-layer snow will be sent as 2-layer snow to 1.13+ clients to have collision.
|
* When activated, the 1-layer snow will be sent as 2-layer snow to 1.13+ clients to have collision.
|
||||||
*
|
*
|
||||||
@ -287,6 +294,13 @@ public interface ViaVersionConfig {
|
|||||||
*/
|
*/
|
||||||
boolean isSnowCollisionFix();
|
boolean isSnowCollisionFix();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When activated, infested blocks will be mapped to their normal stone variants for 1.13+ clients.
|
||||||
|
*
|
||||||
|
* @return True if enabled
|
||||||
|
*/
|
||||||
|
boolean isInfestedBlocksFix();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When greater than 0, enables tab complete request delaying by x ticks
|
* When greater than 0, enables tab complete request delaying by x ticks
|
||||||
*
|
*
|
||||||
|
@ -249,6 +249,10 @@ public class ConnectionData {
|
|||||||
initActions.addAll(ChorusPlantConnectionHandler.init());
|
initActions.addAll(ChorusPlantConnectionHandler.init());
|
||||||
initActions.add(TripwireConnectionHandler.init());
|
initActions.add(TripwireConnectionHandler.init());
|
||||||
initActions.add(SnowyGrassConnectionHandler.init());
|
initActions.add(SnowyGrassConnectionHandler.init());
|
||||||
|
if (Via.getConfig().isVineClimbFix()) {
|
||||||
|
initActions.add(VineConnectionHandler.init());
|
||||||
|
}
|
||||||
|
|
||||||
for (String key : keyToId.keySet()) {
|
for (String key : keyToId.keySet()) {
|
||||||
WrappedBlockData wrappedBlockData = WrappedBlockData.fromString(key);
|
WrappedBlockData wrappedBlockData = WrappedBlockData.fromString(key);
|
||||||
for (ConnectorInitAction action : initActions) {
|
for (ConnectorInitAction action : initActions) {
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections;
|
||||||
|
|
||||||
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
|
import us.myles.ViaVersion.api.minecraft.BlockFace;
|
||||||
|
import us.myles.ViaVersion.api.minecraft.Position;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
class VineConnectionHandler extends ConnectionHandler {
|
||||||
|
private static final Set<Integer> vines = new HashSet<>();
|
||||||
|
|
||||||
|
static ConnectionData.ConnectorInitAction init() {
|
||||||
|
final VineConnectionHandler connectionHandler = new VineConnectionHandler();
|
||||||
|
return blockData -> {
|
||||||
|
if (!blockData.getMinecraftKey().equals("minecraft:vine")) return;
|
||||||
|
|
||||||
|
vines.add(blockData.getSavedBlockStateId());
|
||||||
|
ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), connectionHandler);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int connect(UserConnection user, Position position, int blockState) {
|
||||||
|
if (isAttachedToBlock(user, position)) return blockState;
|
||||||
|
|
||||||
|
Position upperPos = position.getRelative(BlockFace.TOP);
|
||||||
|
int upperBlock = getBlockData(user, upperPos);
|
||||||
|
if (vines.contains(upperBlock) && isAttachedToBlock(user, upperPos)) return blockState;
|
||||||
|
|
||||||
|
// Map to air if not attached to block, and upper block is also not a vine attached to a block
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isAttachedToBlock(UserConnection user, Position position) {
|
||||||
|
return isAttachedToBlock(user, position, BlockFace.EAST)
|
||||||
|
|| isAttachedToBlock(user, position, BlockFace.WEST)
|
||||||
|
|| isAttachedToBlock(user, position, BlockFace.NORTH)
|
||||||
|
|| isAttachedToBlock(user, position, BlockFace.SOUTH);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isAttachedToBlock(UserConnection user, Position position, BlockFace blockFace) {
|
||||||
|
return ConnectionData.occludingStates.contains(getBlockData(user, position.getRelative(blockFace)));
|
||||||
|
}
|
||||||
|
}
|
@ -141,12 +141,14 @@ public class MappingData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remap infested blocks, as they are instantly breakabale in 1.13+ and can't be broken by those clients on older servers
|
// Remap infested blocks, as they are instantly breakabale in 1.13+ and can't be broken by those clients on older servers
|
||||||
oldToNew[1552] = 1; // stone
|
if (Via.getConfig().isInfestedBlocksFix()) {
|
||||||
oldToNew[1553] = 14; // cobblestone
|
oldToNew[1552] = 1; // stone
|
||||||
oldToNew[1554] = 3983; // stone bricks
|
oldToNew[1553] = 14; // cobblestone
|
||||||
oldToNew[1555] = 3984; // mossy stone bricks
|
oldToNew[1554] = 3983; // stone bricks
|
||||||
oldToNew[1556] = 3985; // cracked stone bricks
|
oldToNew[1555] = 3984; // mossy stone bricks
|
||||||
oldToNew[1557] = 3986; // chiseled stone bricks
|
oldToNew[1556] = 3985; // cracked stone bricks
|
||||||
|
oldToNew[1557] = 3986; // chiseled stone bricks
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,8 @@ disable-1_13-auto-complete: false
|
|||||||
1_13-tab-complete-delay: 0
|
1_13-tab-complete-delay: 0
|
||||||
# For 1.13 clients the smallest (1 layer) snow doesn't have collision, this will send these as 2 snowlayers for 1.13+ clients to prevent them bugging through them
|
# For 1.13 clients the smallest (1 layer) snow doesn't have collision, this will send these as 2 snowlayers for 1.13+ clients to prevent them bugging through them
|
||||||
fix-low-snow-collision: false
|
fix-low-snow-collision: false
|
||||||
|
# Infested blocks are instantly breakable for 1.13+ clients, resulting in them being unable to break them on sub 1.13 servers. This remaps them to their normal stone variants
|
||||||
|
fix-infested-block-breaking: true
|
||||||
# In 1.14 the client page limit has been upped to 100 (from 50). Some anti-exploit plugins ban when clients go higher than 50. This option cuts edited books to 50 pages.
|
# In 1.14 the client page limit has been upped to 100 (from 50). Some anti-exploit plugins ban when clients go higher than 50. This option cuts edited books to 50 pages.
|
||||||
truncate-1_14-books: false
|
truncate-1_14-books: false
|
||||||
# This prevents clients using 1.9-1.13 on 1.8 servers from receiving no knockback/having velocity bugs whilst sneaking under a block.
|
# This prevents clients using 1.9-1.13 on 1.8 servers from receiving no knockback/having velocity bugs whilst sneaking under a block.
|
||||||
@ -133,7 +135,7 @@ fix-1_14-health-nan: true
|
|||||||
# Should 1.15+ clients respawn instantly / without showing a death screen?
|
# Should 1.15+ clients respawn instantly / without showing a death screen?
|
||||||
use-1_15-instant-respawn: false
|
use-1_15-instant-respawn: false
|
||||||
#
|
#
|
||||||
# Enable serverside block-connections for 1.13+ clients
|
# Enable serverside block-connections for 1.13+ clients - all of the options in this section are built around this option
|
||||||
serverside-blockconnections: false
|
serverside-blockconnections: false
|
||||||
# Sets the method for the block connections (world for highly experimental (USE AT OWN RISK) world-level or packet for packet-level)
|
# Sets the method for the block connections (world for highly experimental (USE AT OWN RISK) world-level or packet for packet-level)
|
||||||
blockconnection-method: packet
|
blockconnection-method: packet
|
||||||
@ -142,6 +144,8 @@ reduce-blockstorage-memory: false
|
|||||||
# When activated with serverside-blockconnections, flower parts with blocks above will be sent as stems
|
# When activated with serverside-blockconnections, flower parts with blocks above will be sent as stems
|
||||||
# Useful for lobbyservers where users can't build and those stems are used decoratively
|
# Useful for lobbyservers where users can't build and those stems are used decoratively
|
||||||
flowerstem-when-block-above: false
|
flowerstem-when-block-above: false
|
||||||
|
# Vines that are not connected to blocks will be mapped to air, else 1.13+ would still be able to climb up on them.
|
||||||
|
vine-climb-fix: false
|
||||||
#
|
#
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# 1.9+ CLIENTS ON 1.8 SERVERS OPTIONS #
|
# 1.9+ CLIENTS ON 1.8 SERVERS OPTIONS #
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren