-
-
Notifications
You must be signed in to change notification settings - Fork 416
Blocking Components #8217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev/feature
Are you sure you want to change the base?
Blocking Components #8217
Conversation
…leComponents # Conflicts: # src/main/java/ch/njol/skript/Skript.java # src/main/resources/lang/default.lang
…leComponents # Conflicts: # src/main/java/ch/njol/skript/util/slot/EquipmentSlot.java
…leComponents # Conflicts: # src/main/java/ch/njol/skript/Skript.java # src/main/java/ch/njol/skript/bukkitutil/SoundUtils.java # src/main/resources/lang/default.lang
…leComponents # Conflicts: # src/main/java/ch/njol/skript/Skript.java # src/main/java/ch/njol/skript/util/slot/EquipmentSlot.java # src/main/resources/lang/default.lang
…leComponents # Conflicts: # src/main/resources/lang/default.lang
…leComponents # Conflicts: # src/main/java/ch/njol/skript/registrations/Feature.java # src/main/resources/lang/default.lang
…Component # Conflicts: # src/main/java/ch/njol/skript/Skript.java # src/main/java/ch/njol/skript/classes/data/BukkitClasses.java # src/main/java/ch/njol/skript/lang/function/Function.java # src/main/java/ch/njol/skript/registrations/Feature.java # src/main/java/ch/njol/skript/util/ItemSource.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/ComponentUtils.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/ComponentWrapper.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/ItemComponentModule.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/EquippableModule.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/EquippableWrapper.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompDamage.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompDispensable.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompInteract.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompShearable.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompSwapEquipment.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompDamageable.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompDispensable.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompInteract.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompShearable.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompSwapEquipment.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompCameraOverlay.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompEntities.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompEquipSound.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompModel.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompShearSound.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompSlot.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquippableComponent.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprSecBlankEquipComp.java # src/main/java/org/skriptlang/skript/bukkit/itemcomponents/generic/ExprItemCompCopy.java # src/main/resources/lang/default.lang
| infoBuilder( | ||
| ExprBlockCompBypass.class, | ||
| DamageType.class, | ||
| "[blocking] damage type bypass[es]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "[blocking] damage type bypass[es]", | |
| "bypassing damage type[s]", |
|
|
||
| @Name("Blocking Component - Damage Type Bypass") | ||
| @Description(""" | ||
| The damage type that can bypass when the item is blocking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The damage type that can bypass when the item is blocking. | |
| The damage type that can bypass the damage reduction from blocking with this item. |
|
|
||
| @Name("Blocking Component - Delay Time") | ||
| @Description(""" | ||
| The amount of time before an item can block an attack after starting to block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this affect the blocking animation speed? If so I think that should be mentioned. No clue if it does.
| public static void register(SyntaxRegistry registry) { | ||
| registry.register( | ||
| SyntaxRegistry.EXPRESSION, | ||
| infoBuilder(ExprBlockCompDelay.class, Timespan.class, "blocking delay time[s]", "blockingcomponents", true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| infoBuilder(ExprBlockCompDelay.class, Timespan.class, "blocking delay time[s]", "blockingcomponents", true) | |
| infoBuilder(ExprBlockCompDelay.class, Timespan.class, "blocking delay [time[s]]", "blockingcomponents", true) |
| @Example("set the item damage function of {_item} to a custom damage function") | ||
| @RequiredPlugins("Minecraft 1.21.5+") | ||
| @Since("INSERT VERSION") | ||
| public class ExprBlockCompDamageFunction extends SimplePropertyExpression<BlockingWrapper, DamageFunctionWrapper> implements BlockingExperimentalSyntax { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove concept of damage function as discussed
| infoBuilder( | ||
| ExprReductionDamageTypes.class, | ||
| DamageType.class, | ||
| "[damage] reduction damage types", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "[damage] reduction damage types", | |
| "(reduced|blocked) damage types", |
| set {_reductions::*} to the damage reductions of {_item} | ||
| set {_amounts::*} to the reduction factor amounts of {_reductions::*} | ||
| """) | ||
| @Example("set the damage reduction factor of (the damage reductions of {_item}) to 0.5") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @Example("set the damage reduction factor of (the damage reductions of {_item}) to 0.5") | |
| @Example("set the damage reduction factor of (the damage reductions of {_item}) to 50%") |
| infoBuilder( | ||
| ExprReductionFactor.class, | ||
| Float.class, | ||
| "[damage] reduction factor [amount[s]]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "[damage] reduction factor [amount[s]]", | |
| "(proportional|percentage) [damage] reduction[s]", |
|
|
||
| @Name("Blank Blocking Component") | ||
| @Description(""" | ||
| Gets a blank blocking component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to mention the defaults! Also not sure this should be "blank" if it's full of default values?
|
|
||
| @Name("Custom Damage Reduction") | ||
| @Description(""" | ||
| Gets a custom damage reduction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaults?
Problem
Skript does not have support for Blocking Components, otherwise known as BlocksAttacks. Skript should include this since it's vanilla.
Solution
Adds
BlockingWrapperthat extendsComponentWrapperand handles modifying data of the underlyingBlocksAttackscomponent.Adds
DamageFunctionWrapperthat wrapsItemDamageFunction. This handles changing data of the wrappedItemDamageFunction. This can be created with a parentingBlockingWrapperto specify that any changes made to the underlyingItemDamageFunctionshould take place on theBlockingWrapper. Using the wrapper to change theItemDamageFunctionof anyBlockingWrappershould not presume to be the parent, as it can and should be used on multipleBlockingWrappers.Adds
DamageReductionWrapperthat wrapsDamageReduction. This handles changing data of the wrappedDamageReduction. This can be created with a parentingBlockingWrapperto specify that any changes made to the underlyingDamageReductionshould take place on theBlockingWrapper. Using the wrapper to change theDamageReductions of anyBlockingWrappershould not presume to be the parent, as it can and should be used on multipleBlockingWrappers.Adds builders for
BlocksAttacks,ItemDamageFunction, andDamageReductionas there was no way to convert an existing finalized object back into the builder provided by Paper.Adds
BlockingExperimentalSyntaxfor all related syntax elements. This component, just like every other, are experimental.Adds all syntax elements that correlate to retrieving and modifying
BlockingWrappers,DamageFunctionWrappers, andDamageReductionWrappersTesting Completed
BlockingComponents.skSupporting Information
N/A
Completes: none
Related: none