Skript

Skript

743k Downloads

functions not properly unloading

EquipableMC opened this issue ยท 2 comments

commented

Skript/Server Version

[02:28:11 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[02:28:11 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[02:28:11 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[02:28:11 INFO]: [Skript] Server Version: 1.20.6-148-20f5165 (MC: 1.20.6)
[02:28:11 INFO]: [Skript] Skript Version: 2.9.0-pre1 (skriptlang-github)
[02:28:11 INFO]: [Skript] Installed Skript Addons: 
[02:28:11 INFO]: [Skript]  - skript-placeholders v1.6.0 (https://github.com/APickledWalrus/skript-placeholders)
[02:28:11 INFO]: [Skript]  - skript-gui v1.3 (https://github.com/APickledWalrus/skript-gui)
[02:28:11 INFO]: [Skript]  - skript-particle v1.3.1 (https://github.com/sovdeeth/skript-particle)
[02:28:11 INFO]: [Skript]  - DiSky v4.17.3
[02:28:11 INFO]: [Skript]  - skript-yaml v1.5
[02:28:11 INFO]: [Skript]  - skript-reflect v2.4-for-2.9-beta (https://github.com/SkriptLang/skript-reflect)
[02:28:11 INFO]: [Skript]  - SkBee v3.5.6 (https://github.com/ShaneBeee/SkBee)
[02:28:11 INFO]: [Skript]  - skript-citizens v1.0.0
[02:28:11 INFO]: [Skript] Installed dependencies: 
[02:28:11 INFO]: [Skript]  - Vault v1.7.3-b131
[02:28:11 INFO]: [Skript]  - WorldGuard v7.0.10+d9424b1

Bug Description

you have a function in one script file, then delete it and move it to another, then reload the old file then reload the new file, it shouldn't say a global function named "x" already exists
small note: x is just a placeholder

Expected Behavior

its supposed to unload properly and not throw the global function named "x" already exists
small note: x is just a placeholder

Steps to Reproduce

  1. make 2 script files (make sure they have some other code in it)
  2. put a function in one of them, reload both.
  3. move the function from file 1 to file 2.
  4. reload file 1 then file 2

Errors or Screenshots

image

Other

Snippet code I used regarding that function:

import:
    org.bukkit.inventory.meta.ItemMeta
    org.bukkit.attribute.AttributeModifier
    org.bukkit.attribute.Attribute
    org.bukkit.inventory.EquipmentSlot
    org.bukkit.inventory.ItemFlag
    org.bukkit.inventory.ItemStack
    com.google.common.collect.ImmutableMultimap
    java.util.UUID
    
function hideAllFlags(item: item) :: item:
    set {_meta} to {_item}.getItemMeta()
    {_meta}.setAttributeModifiers(ImmutableMultimap.of())
    {_meta}.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(UUID.randomUUID(), "generic.attackDamage", 0.1, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND))
    {_meta}.setUnbreakable(true)
    {_meta}.addItemFlags(ItemFlag.values())
    {_item}.setItemMeta({_meta})
    return {_item}

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

i can't reproduce this on 2.8.7 or 2.9.0-pre1, whether using sk reload all or reloading the old script then the new script. I also verified the function works correctly after reload via effect commands.

commented

nevermind SkEditor kept breaking and wasn't uploading files through SFTP properly (closing this now)