kernitus / BukkitOldCombatMechanics

Spigot plugin to configure combat mechanics for 1.9 onwards
https://www.spigotmc.org/resources/19510/
Mozilla Public License 2.0
179 stars 71 forks source link

Absorption not applicable #639

Closed GGMarket closed 1 year ago

GGMarket commented 1 year ago

Information

20:06:54 ERROR]: Could not pass event EntityDamageByEntityEvent to OldCombatMechanics v2.0.0BETA java.lang.UnsupportedOperationException: ABSORPTION is not applicable to CraftArmorStand at org.bukkit.event.entity.EntityDamageEvent.setDamage(EntityDamageEvent.java:89) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?] at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?] at kernitus.plugin.OldCombatMechanics.module.ModuleOldArmourStrength.onEntityDamage(ModuleOldArmourStrength.java:49) ~[OldCombatMechanics01.jar:?] at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor632.execute(Unknown Source) ~[?:?] at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:git-Purpur-1845] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:678) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callEvent(CraftEventFactory.java:249) ~[purpur-1.19.2.jar:git-Purpur-1845] at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:1173) ~[purpur-1.19.2.jar:git-Purpur-1845] at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:1022) ~[purpur-1.19.2.jar:git-Purpur-1845] at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.handleNonLivingEntityDamageEvent(CraftEventFactory.java:1226) ~[purpur-1.19.2.jar:git-Purpur-1845] at net.minecraft.world.entity.decoration.ArmorStand.hurt(ArmorStand.java:497) ~[?:?] at net.minecraft.world.entity.player.Player.attack(Player.java:1372) ~[?:?] at net.minecraft.server.level.ServerPlayer.attack(ServerPlayer.java:2200) ~[?:?] at net.minecraft.server.network.ServerGamePacketListenerImpl$6.a(ServerGamePacketListenerImpl.java:3081) ~[?:?] at net.minecraft.network.protocol.game.ServerboundInteractPacket$1.dispatch(ServerboundInteractPacket.java:24) ~[?:?] at net.minecraft.network.protocol.game.ServerboundInteractPacket.dispatch(ServerboundInteractPacket.java:80) ~[?:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.handleInteract(ServerGamePacketListenerImpl.java:3000) ~[?:?] at net.minecraft.network.protocol.game.ServerboundInteractPacket.handle(ServerboundInteractPacket.java:67) ~[?:?] at net.minecraft.network.protocol.game.ServerboundInteractPacket.handle(ServerboundInteractPacket.java:12) ~[?:?] at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:51) ~[?:?] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.19.2.jar:git-Purpur-1845] at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?] at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1368) ~[purpur-1.19.2.jar:git-Purpur-1845] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[purpur-1.19.2.jar:git-Purpur-1845] at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?] at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1345) ~[purpur-1.19.2.jar:git-Purpur-1845] at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1338) ~[purpur-1.19.2.jar:git-Purpur-1845] at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?] at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1316) ~[purpur-1.19.2.jar:git-Purpur-1845] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1204) ~[purpur-1.19.2.jar:git-Purpur-1845] at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1845] at java.lang.Thread.run(Thread.java:833) ~[?:?]


<!-- OldCombatMechanics config.yml, please paste it within the backticks (i.e. ```) -->
* OldCombatMechanics config file: 
``` yaml
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

  ############# OldCombatMechanics Plugin by kernitus and Rayzr522 #############
#                                                                           #
# Bukkit Page: http://dev.bukkit.org/bukkit-plugins/oldcombatmechanics/     #
# Spigot Page: https://www.spigotmc.org/resources/oldcombatmechanics.19510/ #
# GitHub Page: https://github.com/kernitus/BukkitOldCombatMechanics/        #
#                                                                           #
#############################################################################

# List of interactive blocks that right clicking on will be ignored
# This is for modules such as sword blocking and disable-elytra
interactive: [crafting_table,enchantment_table,anvil,brewing_stand,trapped_chest,chest,bed,boat,fence_gate,dispenser,dropper,furnace,jukebox,ender_chest,stone_button,wood_button,beacon,tripwire_hook,hopper,daylight_detector,daylight_detector_inverted,item_frame,diode,diode_block_off,diode_block_on,redstone_comparator,redstone_comparator_off,redstone_comparator_on,acacia_door,birch_door,dark_oak_door,jungle_door,spruce_door,wood_door,workbench,bed_block,lever,trap_door,burning_furnace,spruce_fence_gate,birch_fence_gate,jungle_fence_gate,dark_oak_fence_gate,acacia_fence_gate,white_shulker_box,orange_shulker_box,magenta_shulker_box,light_blue_shulker_box,yellow_shulker_box,lime_shulker_box,pink_shulker_box,gray_shulker_box,silver_shulker_box,cyan_shulker_box,purple_shulker_box,blue_shulker_box,brown_shulker_box,green_shulker_box,red_shulker_box,black_shulker_box,barrel]

worlds-is-blacklist: false
# To use the per-world feature you must specify a list of worlds in square brackets []
# If empty, will be enabled in all worlds. Otherwise acts as whitelist / blacklist
# A few examples:
# worlds: [world,survival,creative,SkyWars]
# worlds: [bestWorld]

disable-attack-cooldown:
  # This is to disable the attack cooldown
  enabled: true
  worlds: []
  # What to set the attack speed to. Default for 1.9 is 4, at least 40 is needed for no cooldown.
  generic-attack-speed: 40
  message-enabled: "&aAttack cooldown enabled for %player%"
  message-disabled: "&cAttack cooldown disabled for %player%"
  message-usage: "Usage: &7/ocm toggle [player] [on/off]"

disable-player-collisions:
  # This is to disable player collisions
  # This is now compatible with scoreboard and tablist-editing plugins
  enabled: false
  worlds: []

disable-sword-sweep:
  # This is to disable the sword sweep attack
  # Particle effect is also now removed
  enabled: true
  worlds: []

disable-attack-sounds:
  enabled: false
  worlds: []
  # The sounds that will be blocked by this module
  blocked-sounds:
    - "minecraft:entity.player.attack.strong"
    - "minecraft:entity.player.attack.sweep"
    - "minecraft:entity.player.attack.nodamage"
    - "minecraft:entity.player.attack.knockback"
    - "minecraft:entity.player.attack.crit"
    - "minecraft:entity.player.attack.weak"

disable-crafting:
  # Disable the crafting of specified items
  enabled: true
  worlds: []
  # List of denied items
  denied: [shield]
  # Show the user a message if they try to craft a blacklisted item
  showMessage: true
  message: "&cYou cannot craft that item!"

disable-offhand:
  # Disable the usage of the offhand
  # Won't affect sword-blocking module
  enabled: true
  worlds: []
  # Whether the following list allows items or blocks them
  whitelist: true
  # List of items that should be allowed/blocked
  # Example: [diamond_sword,BOW]
  items: []

old-brewing-stand:
  # Automatically refuels brewing stands
  enabled: true
  worlds: []

no-lapis-enchantments:
  # Automatically adds lapis to enchantment tables upon opening
  enabled: true
  worlds: []
  # Whether to only allow this for players with oldcombatmechanics.nolapis permission
  usePermission: false

disable-elytra:
  # Do not allow players to wear elytra
  enabled: false
  worlds: []

disable-enderpearl-cooldown:
  # Disables enderpearl cooldown
  enabled: true
  worlds: []
  # The cooldown, in seconds
  cooldown: 0
  # Show the user a message if they try to use an enderpearl and the cooldown has not expired yet
  showMessage: true
  message: "&cYou must wait &7%ds&c before using an enderpearl again!"

old-tool-damage:
  # This is to set the tool damage as in pre-1.9
  # IMPORTANT: Also enable disable-sword-sweep module or sweeps will have the damage value of the weapon in hand
  # NOTE: this will modify the damage, however on the item tooltip it will still show the 1.9+ damage
  enabled: true
  worlds: []
  # Use old sharpness calculations, i.e. each level adds 1.25 damage
  # In 1.9+, sharpness adds 1 + 0.5 * level damage
  old-sharpness: true
  # Damage values shown in 1.9 representation (actual damage)
  # In 1.8 the damage tooltip value would be added to 1 'base damage', yielding the values below
  damages:
    # Axe damages
    GOLD_AXE: 4
    WOOD_AXE: 4
    STONE_AXE: 5
    IRON_AXE: 6
    DIAMOND_AXE: 7
    NETHERITE_AXE: 8
    # Shovel damages
    GOLD_SPADE: 2
    WOOD_SPADE: 2
    STONE_SPADE: 3
    IRON_SPADE: 4
    DIAMOND_SPADE: 5
    NETHERITE_SPADE: 6
    # Sword damages
    GOLD_SWORD: 5
    WOOD_SWORD: 5
    STONE_SWORD: 6
    IRON_SWORD: 7
    DIAMOND_SWORD: 8
    NETHERITE_SWORD: 9
    # Pickaxe damages
    GOLD_PICKAXE: 3
    WOOD_PICKAXE: 3
    STONE_PICKAXE: 4
    IRON_PICKAXE: 5
    DIAMOND_PICKAXE: 6
    NETHERITE_PICKAXE: 7
    # Hoe damages
    GOLD_HOE: 1
    WOOD_HOE: 1
    STONE_HOE: 1
    IRON_HOE: 1
    DIAMOND_HOE: 1
    NETHERITE_HOE: 1

sword-blocking:
  # This is to allow players to block with swords again, by getting a shield while they hold right click with a sword
  enabled: true
  worlds: []
  # How often, in ticks, OCM should check if the player is still blocking with a shield, and remove it if not
  # If this is too fast the player will have their shield disappear before they're able to block again causing a slight delay
  # If this is too slow players will have a shield in their hand well after they've stopped blocking
  # 20 ticks = 1 second
  restoreDelay: 40
  # List of items that holding in the offhand while right-clicking with a sword doesn't trigger blocking e.g. bow
  noBlockingItems: []
  # Whether the above list should act as a blacklist (i.e. only items listed stop the blocking mechanic)
  blacklist: true
  # Whether to require players to have oldcombatmechanics.swordblock permission to block with a sword
  use-permission: false

shield-damage-reduction:
  # This module allows changing the damage reduction behaviour of shields
  enabled: true
  # How much damage blocking should reduce
  # Firstly, amount is subtracted, them value is reduced to percentage
  # 1.8 default: (damage - 1) * 50%    1.9 default: 33%   1.11 default: 0%
  # Damage reduction = (damage - damageReductionAmount) * damageReductionPercentage / 100
  generalDamageReductionAmount: 1
  generalDamageReductionPercentage: 50
  # This value works the same but is exclusively for projectile damage
  # Set amount to 0 and percentage to 100 for 1.8 behaviour, i.e. arrows go through shields
  projectileDamageReductionAmount: 1
  projectileDamageReductionPercentage: 50

old-golden-apples:
  # This is to change the behaviour / crafting of golden apples to how it was in pre-1.9
  # WARNING: If on 1.12 or above and you disable this module you must reload the server for the recipe to disappear
  enabled: false
  worlds: []
  # Cooldown between eating the apples, in seconds
  cooldown:
    # The cooldown for normal golden apples
    normal: 0
    # Message when user tries to eat golden apple during cooldown. Leave empty to disable.
    message-normal: "&ePlease wait %seconds%s before eating another golden apple."
    # The cooldown for enchanted golden apples
    enchanted: 0
    # Message when user tries to eat enchanted golden apple during cooldown. Leave empty to disable.
    message-enchanted: "&ePlease wait %seconds%s before eating another enchanted golden apple."
    # Whether the two apple types share a cooldown.
    # If this is true:
    #   1. Eating any apple resets both cooldowns
    #   2. Each apple type can only be eaten when its cooldown time is over
    #      This means that when you eat *any* apple you start two parallel cooldowns: One for enchanted and one
    #      for normal apples. Each type can only be eaten when its cooldown is over.
    #      Once any apple is eaten, both cooldowns are restarted, so you can not eat either type again
    #      before its full cooldown is over.
    #   3. To have the plugin treat normal and enchanted golden apples as having the same cooldown,
    #      then set the same cooldown time and enable shared mode. (This was the old mode)
    # If this is false:
    #   Eating an enchanted apple will prevent any *enchanted* apple type from being eaten before the cooldown is over
    #   Eating a normal apple will prevent any *normal* apple type from being eaten before the normal cooldown is over
    is-shared: false
  # If you want to allow enchanted golden apple crafting
  enchanted-golden-apple-crafting: true
  # Enabling this makes the potion effects gained by eating golden apples
  # and enchanted golden apples the same as it was in pre-1.9
  old-potion-effects: true
  # Potion effects golden apples should apply
  # Duration is in ticks (20 ticks = 1 second)
  # Amplifier is the potion level - 1, so Regeneration IV would be amplifier 3
  gapple-effects:
    regeneration:
      duration: 100
      amplifier: 1
    absorption:
      duration: 2400
      amplifier: 0
  # Potion effects enchanted golden apples should apply
  napple-effects:
    regeneration:
      duration: 600
      amplifier: 4
    damage_resistance:
      duration: 6000
      amplifier: 0
    fire_resistance:
      duration: 6000
      amplifier: 0
    absorption:
      duration: 2400
      amplifier: 0
  # Enable this if you have another plugin which adds a crafting recipe for
  # enchanted golden apples (requires server restart)
  no-conflict-mode: false

old-fishing-knockback:
  # This is to make the knockback of players when they get hit by a fishing bobber the same as it was in pre-1.9
  enabled: true
  worlds: []
  # This makes OCM check if other plugins are stopping the rod damage and follow their choice
  # Set to false to always have rod damage
  checkCancelled: false
  # This is the damage done by the fishing rod attack
  damage: 0.0001
  # Whether the EntityDamageEvent should be used instead of the EntityDamageByEntityEvent
  # Set to true when using plugins like NCP that check range
  useEntityDamageEvent: false
  # This is to cancel dragging in the entity attached to the fishing rod when reeling in, like in 1.8
  # Options: all, players, mobs, none. players allows compatibility with WorldGuard pvp-deny regions
  cancelDraggingIn: players
  # Whether to also give knockback on non-player living entities (e.g. mobs)
  knockbackNonPlayerEntities: false
  # This is the delay in milliseconds in-between rod damage, so the player hit has time to fall back down
  hitCooldown: 1000

fishing-rod-velocity:
  # In 1.9+ fishing rods go 8 blocks instead of 12 blocks
  # This is due to both gravity and initial launch speed
  # Set to true to revert back to the old calculations and gravity
  enabled: true
  worlds: []

projectile-knockback:
  # This adds knockback and/or damage to players when they get hit by snowballs, eggs & enderpearls
  # This has been a Bukkit bug for so long people thought it was vanilla when it was recently patched
  enabled: true
  worlds: []
  # This is the damage done by each projectile
  damage:
    snowball: 0.0001
    egg: 0.0001
    ender_pearl: 0.0001

old-player-knockback:
  # This is to change knockback players receive from attacks.  Default values are as in 1.8.
  #
  # Practice servers tend to use lower knockback, for example:
  # knockback-horizontal: 0.35
  # knockback-vertical: 0.35
  # knockback-vertical-limit: 0.4
  # knockback-extra-horizontal: 0.425
  # knockback-extra-vertical: 0.085
  #
  # Minigame servers use higher vertical knockback and lower horizontal knockback, exact values are unknown.
  enabled: true
  worlds: []
  # Horizontal knockback is reduced by 40% for every successful attack by the player, with no limit
  # Increase to make clicking more important, decrease to make it less important
  knockback-horizontal: 0.4
  # Vertical knockback is not reduced by clicking faster
  # Increase to make clicking less important, decrease to make clicking more important
  knockback-vertical: 0.4
  # Vertical knockback limit is applied after base vertical knockback
  # This limit can be exceeded by sprint hitting or knockback enchantments, from the extra vertical knockback
  knockback-vertical-limit: 0.4
  # Extra horizontal knockback is applied for each level of knockback enchant, and for sprinting
  # Increase to make sprint resetting (w-tapping) more important, decrease to make it less important
  # Increase to make clicking more important, decrease to make clicking less important
  knockback-extra-horizontal: 0.5
  # Extra vertical knockback is applied for each level of knockback enchant, and for sprinting
  # Increase to make sprint resetting (w-tapping) more important, decrease to make it less important
  # Increase to make clicking less important, decrease to make clicking more important
  knockback-extra-vertical: 0.1
  # Should knockback resistance be enabled? (e.g. netherite armour knockback resistance)
  enable-knockback-resistance: false

old-player-regen:
  # This is to make players' regeneration act mostly like it did in pre-1.9
  # Based on https://minecraft.gamepedia.com/Hunger?oldid=948685
  enabled: true
  worlds: []
  # How often a player should regenerate health, in milliseconds (In 1.8: 4 seconds)
  # The foodTickerTimer might not be perfectly accurate so we give it ~10ms of leeway
  interval: 3990
  # How many half-hearts the player should heal by, every seconds specified above
  amount: 1
  # How much exhaustion the player should get from healing. In 1.8: 3    In 1.9: 4    In 1.11: 6
  # If, after adding this, Minecraft finds the value is above 4, it subtracts 4
  # and either reduces saturation or, if saturation is 0, reduces food level by 1 (1/2 a stick)
  exhaustion: 3

old-armour-strength:
  # This is to make armour calculations like in 1.8
  # Based on this: https://minecraft.gamepedia.com/index.php?title=Armor&oldid=909187
  enabled: true
  worlds: [HelloWorld]

old-armour-durability:
  # This makes armour take a constant amount of durability damage (except for explosions)
  enabled: true
  worlds: []
  # By how much to reduce durability every attack. 1.8 default is 1
  reduction: 1

disable-projectile-randomness:
  # This is to remove projectile randomness while firing arrows with a bow
  # This is actually a very old feature and has been in the game for quite some time
  enabled: false
  worlds: []
  # This is the threshold between projectiles' (X,Z) values before they're considered the same and straightened
  # This value is only useful for multishot. The default of 0.1 works at all but extremely shallow angles,
  # where arrows end up bunched together. Set to 1 if you want multishots to all follow the same path.
  epsilon: 0.1

disable-bow-boost:
  # This is to stop players from boosting themselves forward by hitting themselves
  # while running with a punch II arrow from their bow
  # This module simply stops them from hitting themselves with arrows entirely
  enabled: false
  worlds: []

old-potion-effects:
  # This is to restore the 1.8 potion effects and duration
  enabled: true
  worlds: []

  ### DURATION: (in seconds)
  potion-durations:
    regen: # Regeneration
      drinkable:
        base: 45
        II: 22
        extended: 120
      splash:
        base: 33
        II: 16
        extended: 90

    speed: # Swiftness
      drinkable:
        base: 180
        II: 90
        extended: 480
      splash:
        base: 135
        II: 67
        extended: 360

    fire_resistance:
      drinkable:
        base: 180
        extended: 480
      splash:
        base: 135
        extended: 360

    poison:
      drinkable:
        base: 45
        II: 22
        extended: 120
      splash:
        base: 33
        II: 16
        extended: 90

    night_vision:
      drinkable:
        base: 180
        extended: 480
      splash:
        base: 180
        extended: 480

    weakness:
      drinkable:
        base: 90
        extended: 240
      splash:
        base: 90
        extended: 240

    strength:
      drinkable:
        base: 180
        II: 90
        extended: 480
      splash:
        base: 135
        II: 67
        extended: 360

    slowness:
      drinkable:
        base: 90
        extended: 240
      splash:
        base: 67
        extended: 180

    jump: # Leaping
      drinkable:
        base: 180
        II: 90
        extended: 480
      splash:
        base: 135
        II: 67
        extended: 360

    water_breathing:
      drinkable:
        base: 180
        extended: 480
      splash:
        base: 135
        extended: 360

    invisibility:
      drinkable:
        base: 180
        extended: 480
      splash:
        base: 135
        extended: 360

    # 1.9+ potions
    # Turtle Master potion currently incompatible, will just work like default
    luck:
      drinkable:
        base: 300
      splash:
        base: 300

    slow_falling:
      drinkable:
        base: 90
        extended: 240
      splash:
        base: 90
        extended: 240

  # EFFECTS
  # If 'multiplier' is true value is multiplied by base tool damage. If 'addend' it is added.
  # If both true, it is first increased by 1 then multiplied (same as +xx%)
  # Strength potion
  # 1.9: I = +3; II = +6;    1.8: I = +130%; II = +260%
  strength:
    modifier: 1.3
    multiplier: true
    addend: true
  # Weakness potion
  # 1.9 value: -4   1.8 value: -0.5
  weakness:
    modifier: -0.5
    multiplier: false

chorus-fruit:
  # This makes the chorus fruit behaviour configurable
  enabled: false
  worlds: []
  # The maximum distance the fruit can teleport the player. This a PER AXIS value, so this outlines a cube with
  # 2 * max-teleportation-distance as the side length
  # Vanilla default is 8.
  # Setting this to 0 disables chorus fruit teleport.
  # Setting this to a value greater than 8 MIGHT CAUSE CONFLICTS with bukkit's internal anti cheat
  # and *potentially* any other anti-cheat you use. Please make sure this is not an issue before increasing
  # this value.
  max-teleportation-distance: 8
  # Whether to prevent eating the fruit completely. This also prevents the teleportation.
  prevent-eating: false
  # The saturation value of the chorus fruit.
  # Vanilla default is 2.4
  saturation-value: 2.4
  # The hunger value of the chorus fruit.
  # Vanilla default is 4 (2 bars)
  hunger-value: 4

old-burn-delay:
  # This makes it so entities will immediately start to burn when entering fire
  enabled: false
  worlds: []
  # How long, in ticks, entities should be on fire for after not being in direct contact anymore
  fire-ticks: 120

attack-frequency:
  # Allows changing the player invulnerability between hits
  enabled: true
  worlds: []
  # The hit delay to apply. Default for 1.9+ is 20 ticks (1 second)
  playerDelay: 12
  mobDelay: 16

old-critical-hits:
  # Makes critical hits work like in 1.8
  # With a critical hit, the damage will be multiplied by 1.5
  # In 1.9, the user must also not be sprinting for it to be a crit
  enabled: true
  world: []
  # What the damage, after applying potions effects, is multiplied by
  multiplier: 1.5
  # Whether to allow crits while sprinting. 1.8: true, 1.9: false
  allow-sprinting: true

################################
#### SUPPORT SETTINGS BELOW ####
################################
support:
  spartan-cancel-ticks: 1

################################
#### SPECIAL SETTINGS BELOW ####
################################

# This is to toggle the update checker
update-checker:
  enabled: true

# This enables command argument completion when pressing tab
command-completer:
  enabled: true

# This enables debug messages, only enable when troubleshooting
debug:
  enabled: false

# DO NOT CHANGE THIS NUMBER AS IT WILL RESET YOUR CONFIG
config-version: 55

Problem Description

The server is crashing because o the bellow errors, the error ModuleOldArmourStrength.java:49

To Reproduce

Steps to reproduce the behavior: 1. 2. 3. ### Expected Behaviour

Actual Behaviour

GGMarket commented 1 year ago

Kernius Please change this:

@SuppressWarnings("deprecation")
    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
    public void onEntityDamage(EntityDamageEvent e) {
        // 1.8 NMS: Damage = 25 / (damage after blocking * (25 - total armour strength))
        if (!(e.getEntity() instanceof LivingEntity)) return;

        final LivingEntity damagedEntity = (LivingEntity) e.getEntity();

        final Map<EntityDamageEvent.DamageModifier, Double> damageModifiers =
                Arrays.stream(EntityDamageEvent.DamageModifier.values())
                        .filter(e::isApplicable)
                        .collect(Collectors.toMap(m -> m, e::getDamage));

        DefenceUtils.calculateDefenceDamageReduction(damagedEntity, damageModifiers, e.getCause());

        // Set the modifiers back to the event
        damageModifiers.forEach(e::setDamage);

        //damageModifiers.forEach((dm, value) -> debug(dm.name() + ": " + value));
    }
 if (!(e.getEntity() instanceof Player)) return;

Please

kernitus commented 1 year ago

@GGMarket surely absorption can also be had by entities other than players? There should be another way of checking that, i.e. the Damageable interface or whether that specific damage type is applicable.

GGMarket commented 1 year ago

i don't think absorption can be add to another entities, but if you can do this that i said and update to jenkins please?

GGMarket commented 1 year ago

my idea not work same error

[15:56:44 ERROR]: Could not pass event FakeEntityDamageEvent to OldCombatMechanics v2.0.0BETA
java.lang.UnsupportedOperationException: ABSORPTION is not applicable to CraftPlayer{name=GT500}
        at org.bukkit.event.entity.EntityDamageEvent.setDamage(EntityDamageEvent.java:89) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?]
        at kernitus.plugin.OldCombatMechanics.module.ModuleOldArmourStrength.onEntityDamage(ModuleOldArmourStrength.java:50) ~[OldCombatMechanics NONO.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor532.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:git-Purpur-1845]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:678) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at com.gmail.nossr50.util.skills.CombatUtils.callFakeDamageEvent(CombatUtils.java:600) ~[mcmmo CLASSIC.jar:?]
        at com.gmail.nossr50.util.skills.CombatUtils.dealDamage(CombatUtils.java:374) ~[mcmmo CLASSIC.jar:?]
        at com.gmail.nossr50.util.skills.CombatUtils.dealDamage(CombatUtils.java:330) ~[mcmmo CLASSIC.jar:?]
        at com.gmail.nossr50.runnables.skills.BleedTimerTask.run(BleedTimerTask.java:43) ~[mcmmo CLASSIC.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.19.2.jar:git-Purpur-1845]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[purpur-1.19.2.jar:git-Purpur-1845]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1500) ~[purpur-1.19.2.jar:git-Purpur-1845]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:486) ~[purpur-1.19.2.jar:git-Purpur-1845]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1424) ~[purpur-1.19.2.jar:git-Purpur-1845]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1194) ~[purpur-1.19.2.jar:git-Purpur-1845]
        at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1845]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
GGMarket commented 1 year ago

Please fix this

its the only version that work with 1.19.2 without strenght armor bug

GGMarket commented 1 year ago

I understand the error

[13:18:42 ERROR]: Could not pass event FakeEntityDamageEvent to OldCombatMechanics v2.0.0BETA
java.lang.UnsupportedOperationException: ABSORPTION is not applicable to CraftWarden
at org.bukkit.event.entity.EntityDamageEvent.setDamage(EntityDamageEvent.java:89) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?]
at kernitus.plugin.OldCombatMechanics.module.ModuleOldArmourStrength.onEntityDamage(ModuleOldArmourStrength.java:49) ~[OldCombatMechanics BUGADASSO.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor171.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:git-Paper-397]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:672) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at com.gmail.nossr50.util.skills.CombatUtils.callFakeDamageEvent(CombatUtils.java:600) ~[mcmmo CLASSIC.jar:?]
at com.gmail.nossr50.util.skills.CombatUtils.dealDamage(CombatUtils.java:374) ~[mcmmo CLASSIC.jar:?]
at com.gmail.nossr50.util.skills.CombatUtils.dealDamage(CombatUtils.java:330) ~[mcmmo CLASSIC.jar:?]
at com.gmail.nossr50.runnables.skills.BleedTimerTask.run(BleedTimerTask.java:64) ~[mcmmo CLASSIC.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.3.jar:git-Paper-397]
at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[paper-1.19.3.jar:git-Paper-397]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1473) ~[paper-1.19.3.jar:git-Paper-397]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.19.3.jar:git-Paper-397]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1397) ~[paper-1.19.3.jar:git-Paper-397]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.3.jar:git-Paper-397]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.19.3.jar:git-Paper-397]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
[13:18:42 INFO]: Damage: 2.0cause: CUSTOM

The plugin mcmmo add bleeding damage to the entity, and them the error appear I try to fix this way @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void Dmg (EntityDamageEvent e) { if(e.getCause() == DamageCause.CUSTOM) { e.setCancelled(true); } }

but does not work

rayzr522 commented 1 year ago

looks like the issue is that we need to first check that the modifier is present before we attempt to set it: image

let me see if I can whip up a quick fix for this

rayzr522 commented 1 year ago

@GGMarket can you see if you still have the issue w this jar? (you'll have to extract it, as github doesn't allow sharing of .jar files directly)

OldCombatMechanics.zip

if this fixes it, then I will see about getting #643 merged

kernitus commented 1 year ago

@GGMarket please try the test build 135 or newer. The plugin now checks if Absorption is applicable before adding it to the entity.