mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Merge branch 'master' into fix/hologram-dupes
This commit is contained in:
commit
e7557ca680
112
.github/ISSUE_TEMPLATE/bug-report-beta.yaml
vendored
112
.github/ISSUE_TEMPLATE/bug-report-beta.yaml
vendored
@ -1,73 +1,119 @@
|
|||||||
name: Bug Report (Beta)
|
name: Bug Report (Beta)
|
||||||
about: Report a Bug or an Issue with Slimefun 4.
|
description: Report a Bug or an Issue with Slimefun 4.
|
||||||
labels: ['\U0001F3AF Needs testing', '\U0001F41E Bug Report']
|
labels: ['🎯 Needs testing', '🐞 Bug Report']
|
||||||
|
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- id: description
|
||||||
attributes:
|
type: textarea
|
||||||
value: '## Thanks for reporting a bug!'
|
|
||||||
- type: textarea
|
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
attributes:
|
attributes:
|
||||||
label: ':round_pushpin: Description'
|
label: '📍 Description'
|
||||||
description: |
|
description: |
|
||||||
A clear and detailed description of what went wrong.
|
A clear and detailed description of what went wrong.
|
||||||
The more information you can provide, the easier we can handle this problem.
|
The more information you can provide, the easier we can handle this problem.
|
||||||
- type: textarea
|
placeholder: |
|
||||||
|
(example)
|
||||||
|
When trying to do [...], I expected [...] to happen but [...] happened instead.
|
||||||
|
I am pretty sure this is not intended and should be fixed.
|
||||||
|
|
||||||
|
- id: reproduction-steps
|
||||||
|
type: textarea
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
attributes:
|
attributes:
|
||||||
label: ':bookmark_tabs: Reproduction Steps'
|
label: '📑 Reproduction Steps'
|
||||||
description: |
|
description: |
|
||||||
Tell us the exact steps to reproduce this issue, the more detailed the easier we can reproduce it.
|
Tell us the exact steps to reproduce this issue, the more detailed the easier we can reproduce it.
|
||||||
Youtube Videos and Screenshots are recommended!
|
placeholder: |
|
||||||
value: |
|
(example)
|
||||||
1.
|
1. Craft [...]
|
||||||
2.
|
2. Right click with that item on a workbench
|
||||||
3.
|
3. The workbench explodes
|
||||||
- type: textarea
|
|
||||||
|
- id: expected-behaviour
|
||||||
|
type: textarea
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
attributes:
|
attributes:
|
||||||
label: ':bulb: Expected Behavior'
|
label: '💡 Expected Behavior'
|
||||||
description: |
|
description: |
|
||||||
What were you expecting to happen?
|
What were you expecting to happen?
|
||||||
What do you think would have been the correct behaviour?
|
What do you think would have been the correct behaviour?
|
||||||
- type: textarea
|
placeholder: |
|
||||||
|
I expected [...] to happen.
|
||||||
|
|
||||||
|
- id: media
|
||||||
|
type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: ':scroll: Server Log'
|
label: '📷 Screenshots / Videos'
|
||||||
description: |
|
description: |
|
||||||
Take a look at your Server Log and post any errors you can find via https://pastebin.com/
|
Videos and Screenshots help illustrate issues the best.
|
||||||
|
If you can capture any footage of the bug happening, it would help us out a lot!
|
||||||
|
|
||||||
|
- id: server-log
|
||||||
|
type: input
|
||||||
|
attributes:
|
||||||
|
label: '📜 Server Log'
|
||||||
|
description: |
|
||||||
|
Take a look at your Server Log and upload any error messages from Slimefun
|
||||||
|
to a pasting site (e.g. https://pastebin.com/)
|
||||||
If you are unsure about it, post your full log, you can find it under /logs/latest.log
|
If you are unsure about it, post your full log, you can find it under /logs/latest.log
|
||||||
- type: textarea
|
placeholder: https://pastebin.com/...
|
||||||
|
|
||||||
|
- id: error-reports
|
||||||
|
type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: ':open_file_folder: /error-reports/ Folder'
|
label: '📂 `/error-reports/` folder'
|
||||||
description: |
|
description: |
|
||||||
Check the folder /plugins/Slimefun/error-reports/ and upload any files inside that folder.
|
Check the folder `/plugins/Slimefun/error-reports/` and upload any files inside that folder
|
||||||
You can also post these files via https://pastebin.com/
|
to a pasting site (e.g. https://pastebin.com/)
|
||||||
- type: dropdown
|
placeholder: https://pastebin.com/...
|
||||||
|
|
||||||
|
- id: server-software
|
||||||
|
type: dropdown
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
attributes:
|
attributes:
|
||||||
label: ':video_game: Minecraft Version'
|
label: '💻 Server Software'
|
||||||
|
description: 'Please select the software your Server is running on'
|
||||||
|
options:
|
||||||
|
- Spigot
|
||||||
|
- Paper
|
||||||
|
- Tuinity
|
||||||
|
- Purpur
|
||||||
|
- Other
|
||||||
|
|
||||||
|
- id: minecraft-version
|
||||||
|
type: dropdown
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
attributes:
|
||||||
|
label: '🎮 Minecraft Version'
|
||||||
description: 'Please select the Minecraft version of the server'
|
description: 'Please select the Minecraft version of the server'
|
||||||
options:
|
options:
|
||||||
#- 1.17.x
|
#- 1.17.x
|
||||||
- 1.16.x
|
- 1.16.x
|
||||||
- 1.15.x
|
- 1.15.x
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- Older
|
- (Older versions are not supported)
|
||||||
- type: textarea
|
|
||||||
|
- id: slimefun-version
|
||||||
|
type: textarea
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
attributes:
|
attributes:
|
||||||
label: ':compass: Environment'
|
label: '⭐ Slimefun version'
|
||||||
description: |
|
description: |
|
||||||
Any issue without the exact version numbers will be closed!
|
**"latest" is not a version number, we need the exact version.**
|
||||||
"latest" IS NOT A VERSION NUMBER.
|
We recommend running "/sf versions" and uploading a screenshot of that.
|
||||||
We recommend running "/sf versions" and showing us a screenshot of that.
|
|
||||||
Make sure that the screenshot covers the entire output of that command.
|
Make sure that the screenshot covers the entire output of that command.
|
||||||
If your issue is related to other plugins, make sure to include the versions of these plugins too!
|
If your issue is related to other plugins, make sure to include the versions of these plugins too!
|
||||||
|
placeholder: Slimefun version [...]
|
||||||
|
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
- Server software:
|
## ❤️ Thank you for submitting a bug report!
|
||||||
- Slimefun version:
|
If anyone who sees this has some additional info which can help reproduce or track down this issue,
|
||||||
|
please comment down below. Any help is appreciated!
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package io.github.thebusybiscuit.slimefun4.api.items;
|
package io.github.thebusybiscuit.slimefun4.api.items;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
@ -9,8 +12,6 @@ import io.github.thebusybiscuit.cscorelib2.config.Config;
|
|||||||
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
|
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
|
||||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a Setting for a {@link SlimefunItem} that can be modified via
|
* This class represents a Setting for a {@link SlimefunItem} that can be modified via
|
||||||
* the {@code Items.yml} {@link Config} file.
|
* the {@code Items.yml} {@link Config} file.
|
||||||
@ -91,6 +92,16 @@ public class ItemSetting<T> {
|
|||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This returns the associated {@link SlimefunItem} for this {@link ItemSetting}.
|
||||||
|
*
|
||||||
|
* @return The associated {@link SlimefunItem}
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
protected SlimefunItem getItem() {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This returns the <strong>current</strong> value of this {@link ItemSetting}.
|
* This returns the <strong>current</strong> value of this {@link ItemSetting}.
|
||||||
*
|
*
|
||||||
@ -188,4 +199,19 @@ public class ItemSetting<T> {
|
|||||||
return getClass().getSimpleName() + " {" + getKey() + " = " + currentValue + " (default: " + getDefaultValue() + ")";
|
return getClass().getSimpleName() + " {" + getKey() + " = " + currentValue + " (default: " + getDefaultValue() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final int hashCode() {
|
||||||
|
return Objects.hash(item, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final boolean equals(Object obj) {
|
||||||
|
if (obj instanceof ItemSetting) {
|
||||||
|
ItemSetting<?> setting = (ItemSetting<?>) obj;
|
||||||
|
return Objects.equals(getKey(), setting.getKey()) && Objects.equals(getItem(), setting.getItem());
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,5 @@
|
|||||||
package io.github.thebusybiscuit.slimefun4.implementation.items.magical.talismans;
|
package io.github.thebusybiscuit.slimefun4.implementation.items.magical.talismans;
|
||||||
|
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting;
|
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
|
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.settings.TalismanEnchantment;
|
|
||||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
|
||||||
import org.apache.commons.lang.Validate;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.enchantments.Enchantment;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -20,6 +7,21 @@ import java.util.concurrent.ThreadLocalRandom;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.Validate;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.implementation.settings.TalismanEnchantment;
|
||||||
|
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link MagicianTalisman} is a special kind of {@link Talisman} which awards a {@link Player}
|
* The {@link MagicianTalisman} is a special kind of {@link Talisman} which awards a {@link Player}
|
||||||
* with an extra {@link Enchantment} when they enchant their {@link ItemStack}.
|
* with an extra {@link Enchantment} when they enchant their {@link ItemStack}.
|
||||||
@ -48,9 +50,14 @@ public class MagicianTalisman extends Talisman {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
if (!enchantments.isEmpty()) {
|
if (!enchantments.isEmpty()) {
|
||||||
|
// Fixes #3007 - This is a Set, so every Enchantment should only be contained in here once.
|
||||||
addItemSetting(enchantments.toArray(new ItemSetting[0]));
|
addItemSetting(enchantments.toArray(new ItemSetting[0]));
|
||||||
}
|
}
|
||||||
|
} catch (Exception x) {
|
||||||
|
SlimefunPlugin.logger().log(Level.SEVERE, x, () -> "The following Exception was thrown when initializing the settings for " + toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user