Disable the MultiClientProtocolWaterLilyPatch with unit tests.

This commit is contained in:
asofold 2018-01-15 22:00:17 +01:00
parent 01aaccbf54
commit e8cf861150
2 changed files with 18 additions and 20 deletions

View File

@ -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")
;
}
}

View File

@ -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