mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-21 11:35:16 +01:00
abstraction viaversion
This commit is contained in:
parent
1ab937d220
commit
f04dd5aac0
@ -9,13 +9,13 @@ plugins {
|
||||
|
||||
group = "com.github.creeper123123321.viafabric"
|
||||
val gitVersion: groovy.lang.Closure<Any> by extra
|
||||
version = "0.1.0-SNAPSHOT+" + try {
|
||||
version = "0.2.0-SNAPSHOT+" + try {
|
||||
gitVersion()
|
||||
} catch (e: Exception) {
|
||||
"unknown"
|
||||
}
|
||||
extra.set("archivesBaseName", "ViaFabric")
|
||||
description = "Client-side and server-side ViaVersion for Fabric"
|
||||
description = "Client-side and server-side ViaVersion implementation for Fabric"
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
@ -46,8 +46,8 @@ tasks.named<ProcessResources>("processResources") {
|
||||
|
||||
dependencies {
|
||||
// transitive = false because Guava is conflicting on runClient
|
||||
compile("us.myles:viaversion:2.1.4-19w40a") { isTransitive = false }
|
||||
include("us.myles:viaversion:2.1.4-19w40a")
|
||||
compile("us.myles:viaversion:3.0.0-SNAPSHOT") { isTransitive = false }
|
||||
include("us.myles:viaversion:3.0.0-SNAPSHOT")
|
||||
|
||||
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
package com.github.creeper123123321.viafabric.platform;
|
||||
|
||||
import us.myles.ViaVersion.api.ViaVersionConfig;
|
||||
import us.myles.ViaVersion.AbstractViaConfig;
|
||||
import us.myles.ViaVersion.util.Config;
|
||||
|
||||
import java.io.File;
|
||||
@ -33,7 +33,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class VRViaConfig extends Config implements ViaVersionConfig {
|
||||
public class VRViaConfig extends AbstractViaConfig {
|
||||
// Based on Sponge ViaVersion
|
||||
private static List<String> UNSUPPORTED = Arrays.asList("anti-xray-patch", "bungee-ping-interval",
|
||||
"bungee-ping-save", "bungee-servers", "quick-move-action-fix", "nms-player-ticking",
|
||||
@ -61,117 +61,11 @@ public class VRViaConfig extends Config implements ViaVersionConfig {
|
||||
return UNSUPPORTED;
|
||||
}
|
||||
|
||||
public boolean isCheckForUpdates() {
|
||||
return getBoolean("checkforupdates", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPreventCollision() {
|
||||
return getBoolean("prevent-collision", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNewEffectIndicator() {
|
||||
return getBoolean("use-new-effect-indicator", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowNewDeathMessages() {
|
||||
return getBoolean("use-new-deathmessages", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuppressMetadataErrors() {
|
||||
return getBoolean("suppress-metadata-errors", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShieldBlocking() {
|
||||
return getBoolean("shield-blocking", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHologramPatch() {
|
||||
return getBoolean("hologram-patch", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPistonAnimationPatch() {
|
||||
return getBoolean("piston-animation-patch", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBossbarPatch() {
|
||||
return getBoolean("bossbar-patch", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBossbarAntiflicker() {
|
||||
return getBoolean("bossbar-anti-flicker", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean isUnknownEntitiesSuppressed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getHologramYOffset() {
|
||||
return getDouble("hologram-y", -0.96D);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean isBlockBreakPatch() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxPPS() {
|
||||
return getInt("max-pps", 800);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMaxPPSKickMessage() {
|
||||
return getString("max-pps-kick-msg", "Sending packets too fast? lag?");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTrackingPeriod() {
|
||||
return getInt("tracking-period", 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarningPPS() {
|
||||
return getInt("tracking-warning-pps", 120);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxWarnings() {
|
||||
return getInt("tracking-max-warnings", 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMaxWarningsKickMessage() {
|
||||
return getString("tracking-max-kick-msg", "You are sending too many packets, :(");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAntiXRay() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSendSupportedVersions() {
|
||||
return getBoolean("send-supported-versions", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStimulatePlayerTick() {
|
||||
return getBoolean("simulate-pt", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemCache() {
|
||||
return false;
|
||||
@ -182,111 +76,16 @@ public class VRViaConfig extends Config implements ViaVersionConfig {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplacePistons() {
|
||||
return getBoolean("replace-pistons", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPistonReplacementId() {
|
||||
return getInt("replacement-piston-id", 0);
|
||||
}
|
||||
|
||||
public boolean isAutoTeam() {
|
||||
// Collision has to be enabled first
|
||||
return isPreventCollision() && getBoolean("auto-team", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForceJsonTransform() {
|
||||
return getBoolean("force-json-transform", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_12NBTArrayFix() {
|
||||
return getBoolean("chat-nbt-fix", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_12QuickMoveActionFix() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getBlockedProtocols() {
|
||||
return getIntegerList("block-protocols");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockedDisconnectMsg() {
|
||||
return getString("block-disconnect-msg", "You are using an unsupported Minecraft version!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReloadDisconnectMsg() {
|
||||
return getString("reload-disconnect-msg", "Server reload, please rejoin!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_13TeamColourFix() {
|
||||
return getBoolean("team-colour-fix", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuppress1_13ConversionErrors() {
|
||||
return getBoolean("suppress-1_13-conversion-errors", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMinimizeCooldown() {
|
||||
return this.getBoolean("minimize-cooldown", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDisable1_13AutoComplete() {
|
||||
return this.getBoolean("disable-1_13-auto-complete", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isServersideBlockConnections() {
|
||||
return this.getBoolean("serverside-blockconnections", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockConnectionMethod() {
|
||||
return "packet";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReduceBlockStorageMemory() {
|
||||
return this.getBoolean("reduce-blockstorage-memory", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStemWhenBlockAbove() {
|
||||
return this.getBoolean("flowerstem-when-block-above", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSnowCollisionFix() {
|
||||
return this.getBoolean("fix-low-snow-collision", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int get1_13TabCompleteDelay() {
|
||||
return this.getInt("1_13-tab-complete-delay", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTruncate1_14Books() {
|
||||
return this.getBoolean("truncate-1_14-books", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLeftHandedHandling() {
|
||||
return this.getBoolean("left-handed-handling", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_9HitboxFix() {
|
||||
return false;
|
||||
@ -296,19 +95,4 @@ public class VRViaConfig extends Config implements ViaVersionConfig {
|
||||
public boolean is1_14HitboxFix() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNonFullBlockLightFix() {
|
||||
return this.getBoolean("fix-non-full-blocklight", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_14HealthNaNFix() {
|
||||
return this.getBoolean("fix-1_14-health-nan", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean is1_15InstantRespawn() {
|
||||
return this.getBoolean("use-1_15-instant-respawn", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
"issues": "https://github.com/ViaVersion/ViaFabric/issues",
|
||||
"sources": "https://github.com/ViaVersion/ViaFabric"
|
||||
},
|
||||
"icon": "assets/viaversion/textures/logo.png",
|
||||
"environment": "*",
|
||||
"authors": [
|
||||
"creeper123123321"
|
||||
@ -27,7 +26,8 @@
|
||||
"fabricloader": ">=0.4.0",
|
||||
"fabric-textures-v0": "*",
|
||||
"fabric-resource-loader-v0": "*",
|
||||
"fabric-commands-v0": "*"
|
||||
"fabric-commands-v0": "*",
|
||||
"viaversion": ">=3.0.0-SNAPSHOT"
|
||||
},
|
||||
"recommends": {
|
||||
"cotton-client-commands": "*"
|
||||
|
Loading…
Reference in New Issue
Block a user