mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-27 14:13:11 +02:00
Disable the MultiClientProtocolWaterLilyPatch with unit tests.
This commit is contained in:
parent
01aaccbf54
commit
e8cf861150
@ -10,27 +10,24 @@ import fr.neatmonster.nocheatplus.components.registry.activation.Activation;
|
||||
*/
|
||||
public class ActivationUtil {
|
||||
|
||||
private static final String ERROR_NEED_CONDITION_OR = "Must use setConditionOR() with this method.";
|
||||
|
||||
/**
|
||||
* Auxiliary method to activate with any of the typical protocol support
|
||||
* plugins existing (currently: ViaVersion, ProtocolSupport).
|
||||
* Auxiliary method to get an Activation instance that activates with any of
|
||||
* the typical protocol support plugins existing (currently: ViaVersion,
|
||||
* ProtocolSupport).
|
||||
*
|
||||
* @param activation
|
||||
* @return The given Activation instance.
|
||||
* @throws IllegalArgumentException
|
||||
* If getConditionOr does not return true.
|
||||
* @return An activation instance for any of the typical multi protocol
|
||||
* support plugins.
|
||||
*/
|
||||
public static Activation addMultiProtocolSupportPlugins(Activation activation) {
|
||||
// TODO: Typically there is more confinement necessary, more specific naming will be needed.
|
||||
if (!activation.getConditionsOR()) {
|
||||
throw new IllegalArgumentException(ERROR_NEED_CONDITION_OR);
|
||||
}
|
||||
// ViaVersion
|
||||
activation.pluginExist("ViaVersion");
|
||||
// ProtocolSupport
|
||||
activation.pluginExist("ProtocolSupport");
|
||||
return activation;
|
||||
public static Activation getMultiProtocolSupportPluginActivation() {
|
||||
return new Activation()
|
||||
.setConditionsOR()
|
||||
|
||||
// ViaVersion
|
||||
.pluginExist("ViaVersion")
|
||||
// ProtocolSupport
|
||||
.pluginExist("ProtocolSupport")
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,12 +19,13 @@ public class MultiClientProtocolWaterLilyPatch extends AbstractBlockPropertiesPa
|
||||
|
||||
public MultiClientProtocolWaterLilyPatch() {
|
||||
activation
|
||||
.neutralDescription("WATER_LILY block shape patch for multi client protocol support around 1.7.x - 1.11.x.")
|
||||
.neutralDescription("WATER_LILY block shape patch for multi client protocol support around 1.7.x - 1.12.x.")
|
||||
.advertise(true)
|
||||
.setConditionsOR()
|
||||
.setConditionsAND()
|
||||
.notUnitTest()
|
||||
.condition(ActivationUtil.getMultiProtocolSupportPluginActivation())
|
||||
// TODO: Other/More ?
|
||||
;
|
||||
ActivationUtil.addMultiProtocolSupportPlugins(activation);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user