1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Merge branch 'master' into tags

This commit is contained in:
TheBusyBiscuit 2020-09-13 23:39:10 +02:00 committed by GitHub
commit 8652f45b0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 74 deletions

View File

@ -15,6 +15,22 @@ If you encounter an issue which has already been reported, please don't open a n
It would be awesome though if you could post a comment on the existing issue which explains how you were able to reproduce this yourself. It would be awesome though if you could post a comment on the existing issue which explains how you were able to reproduce this yourself.
The more context and information we get, the easier we can fix it. The more context and information we get, the easier we can fix it.
## :toolbox: How to compile Slimefun4
Slimefun is written in Java and uses [Maven](https://maven.apache.org/) for compilation.<br>
To compile Slimefun yourself, follow these steps:
1. Clone the project via git<br>
`$ git clone https://github.com/Slimefun/Slimefun4/`
2. Compile the project using Maven<br>
`$ mvn clean package`
3. Extract the compiled `Slimefun-v4.X-UNOFFICIAL.jar` from your `/target/` directory.
If you are already using an IDE, make sure to import the project via git and set it up as a *Maven project*.
Then you should be able build it via Maven using the goals `clean package`.
If you have any further questions, then please join our [Discord Support Server](#discord) and ask your questions in the `#programming-help` channel.<br>
**Note that we will not accept any bug reports from custom-compiled versions of Slimefun**.
## :hammer_and_wrench: 2. Pull Requests: Bug Fixes ## :hammer_and_wrench: 2. Pull Requests: Bug Fixes
Bugs that have been reported need to be fixed of course.<br> Bugs that have been reported need to be fixed of course.<br>
Any open Issue on our [Issues Tracker](https://github.com/Slimefun/Slimefun4/issues) is waiting to be fixed. Any open Issue on our [Issues Tracker](https://github.com/Slimefun/Slimefun4/issues) is waiting to be fixed.
@ -23,7 +39,7 @@ This is an Open-Source project and we love Pull Requests.
So if you have an idea on how to approach a known issue, feel free to make a [Pull Request](https://github.com/Slimefun/Slimefun4/pulls) which fixes this bug. So if you have an idea on how to approach a known issue, feel free to make a [Pull Request](https://github.com/Slimefun/Slimefun4/pulls) which fixes this bug.
You can also comment on the existing Issue, proposing your idea or communicating that you wanna work on this. You can also comment on the existing Issue, proposing your idea or communicating that you wanna work on this.
## :toolbox: 3. Pull Requests: Additions/Changes ## :wrench: 3. Pull Requests: Additions/Changes
Slimefun is an Open-Source project and anyone is allowed to make changes or add content to this plugin! Slimefun is an Open-Source project and anyone is allowed to make changes or add content to this plugin!
Please visit our [Discord Server](https://github.com/Slimefun/Slimefun4#discord) and share your ideas first, we hate to reject changes because the community disagrees.<br> Please visit our [Discord Server](https://github.com/Slimefun/Slimefun4#discord) and share your ideas first, we hate to reject changes because the community disagrees.<br>
@ -66,8 +82,9 @@ To prevent any accidents from happening, please contact us on our [Discord Serve
#### Documentation #### Documentation
Code documentation is also a great way to improve the maintainability of the project. Code documentation is also a great way to improve the maintainability of the project.
Every class and every public method should have a Javadocs tag assigned to it. 1. Every class and every public method should have a Javadocs section assigned to it.
Classes should also include an "author" tag to indicate who worked on that class. 2. Classes should also include an `@author` tag to indicate who worked on that class.
3. Methods and parameters should be annotated with `@Nullable` or `@Nonnull` to indicate whether or not null values are accepted.
Feel free to visit our [Javadocs](https://slimefun.github.io/javadocs/Slimefun4/docs/overview-summary.html) Feel free to visit our [Javadocs](https://slimefun.github.io/javadocs/Slimefun4/docs/overview-summary.html)
@ -76,4 +93,4 @@ Unit Tests help us test the project to work as intended in an automated manner.<
More or better Unit Tests are always good to have, so feel free to submit a Test and place it in our [src/test/java](https://github.com/Slimefun/Slimefun4/tree/master/src/test/java/io/github/thebusybiscuit/slimefun4/testing) directory More or better Unit Tests are always good to have, so feel free to submit a Test and place it in our [src/test/java](https://github.com/Slimefun/Slimefun4/tree/master/src/test/java/io/github/thebusybiscuit/slimefun4/testing) directory
We are using [Junit 5 - Jupiter](https://github.com/junit-team/junit5/) and [MockBukkit](https://github.com/seeseemelk/MockBukkit) as our testing environment.<br> We are using [Junit 5 - Jupiter](https://github.com/junit-team/junit5/) and [MockBukkit](https://github.com/seeseemelk/MockBukkit) as our testing environment.<br>
Every new Unit Test should have a "DisplayName" annotation with a plain text description on what the Unit Test tests. Every new Unit Test should have a `@DisplayName` annotation with a plain text description on what the Unit Test tests.

View File

@ -34,6 +34,9 @@
#### Fixes #### Fixes
* Fixed #2300 * Fixed #2300
* Fixed #2296 * Fixed #2296
* Fixed colors of Cheat Sheet Slimefun Guide
* Fixed Cheat Sheet Slimefun Guide being unable to open the settings menu via shift + right click
* Fixed #2320
* Fixed #2238 * Fixed #2238
## Release Candidate 16 (07 Sep 2020) ## Release Candidate 16 (07 Sep 2020)

View File

@ -19,6 +19,7 @@ Check out our [Addons](https://github.com/Slimefun/Slimefun4/wiki/Addons), you m
* **[Bug Tracker](https://github.com/Slimefun/Slimefun4/issues)** * **[Bug Tracker](https://github.com/Slimefun/Slimefun4/issues)**
* **[Wiki](https://github.com/Slimefun/Slimefun4/wiki)** * **[Wiki](https://github.com/Slimefun/Slimefun4/wiki)**
* **[FAQ](https://github.com/Slimefun/Slimefun4/wiki/FAQ)** * **[FAQ](https://github.com/Slimefun/Slimefun4/wiki/FAQ)**
* **[How to contribute](https://github.com/Slimefun/Slimefun4/blob/master/.github/CONTRIBUTING.md)**
## Download Slimefun 4 ## Download Slimefun 4
(See also: [How to install Slimefun](https://github.com/Slimefun/Slimefun4/wiki/Installing-Slimefun)) (See also: [How to install Slimefun](https://github.com/Slimefun/Slimefun4/wiki/Installing-Slimefun))
@ -66,7 +67,7 @@ Well, we asked some users on our [Discord server](#discord) to send us some scre
| *Screenshot provided by GalaxyKat11#3816* | *Screenshot provided by TamThan#7987* | *Screenshot provided by Kilaruna#4981* | | *Screenshot provided by GalaxyKat11#3816* | *Screenshot provided by TamThan#7987* | *Screenshot provided by Kilaruna#4981* |
## Discord ## Discord
You can find Slimefun's community on Discord and connect with **over 2000** users of this plugin from all over the world.<br> You can find Slimefun's community on Discord and connect with **over 2500** users of this plugin from all over the world.<br>
Click the badge down below to join the server for suggestions/questions or other discussions about this plugin.<br> Click the badge down below to join the server for suggestions/questions or other discussions about this plugin.<br>
We are also hosting a community event every so often, join us to find out more.<br> We are also hosting a community event every so often, join us to find out more.<br>
**Important**: We do **not** accept bug reports on discord, please use our [Issue Tracker](https://github.com/Slimefun/Slimefun4/issues) to submit bug reports! **Important**: We do **not** accept bug reports on discord, please use our [Issue Tracker](https://github.com/Slimefun/Slimefun4/issues) to submit bug reports!
@ -102,49 +103,10 @@ The wiki is entirely community-run, so if you find an article missing, feel free
## Contributing to this project ## Contributing to this project
Slimefun 4 is an Open-Source project and licensed under Slimefun 4 is an Open-Source project and licensed under
[GNU GPLv3](https://github.com/Slimefun/Slimefun4/blob/master/LICENSE).<br> [GNU GPLv3](https://github.com/Slimefun/Slimefun4/blob/master/LICENSE).<br>
Over 100 people have already contributed to this amazing project. You guys are awesome.<br> Over 150+ people have already contributed to this amazing project. You guys are awesome.<br>
Please consider helping us maintain this project too, your engagement keeps the project alive <3. Please consider helping us maintain this project too, your engagement keeps the project alive <3.
### Translations You can find more info on how to contribute to this project in our [CONTRIBUTING.md](https://github.com/Slimefun/Slimefun4/blob/master/.github/CONTRIBUTING.md).
Slimefun4 has recently added support for translations, note that translations are still _work in progress_.<br>
So not everything may be available for translation yet.<br>
[Read more...](https://github.com/Slimefun/Slimefun4/wiki/Translating-Slimefun)
### Pull requests
This is an open-source community project, so **your contributions keep this plugin alive!**<br>
Pull Requests can be fixes, changes or even additions, but please keep in mind that if you add too much content to Slimefun 4, you should maybe consider making an Addon for it instead ([Developer Guide](https://github.com/Slimefun/Slimefun4/wiki/Developer-Guide)).
#### Compiling
Slimefun is written in Java and uses [Maven](https://maven.apache.org/) for compilation.<br>
To compile Slimefun yourself, follow these steps:
1. Clone the project via git<br>
`$ git clone https://github.com/Slimefun/Slimefun4/`
2. Compile the project using Maven<br>
`$ mvn clean package`
If you are already using an IDE, make sure to import the project via git and set it as a *Maven project*. Then you should be able build it via Maven using the goals `clean package`.
If you have any further questions, then please join our [Discord Support Server](#discord) and ask your questions in the `#programming-help` channel. Note that we will not accept any bug reports from custom-compiled versions of Slimefun.
### Code Quality
Slimefun uses [Sonarcloud.io](https://sonarcloud.io/dashboard?id=TheBusyBiscuit_Slimefun4) to monitor Code Quality.
| [Overall Maintainability](https://sonarcloud.io/documentation/user-guide/metric-definitions/#maintainability) | "Code Smells" | "Technical Debt" | Test Coverage |
| ---- | ---- | ---- | ---- |
| [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=TheBusyBiscuit_Slimefun4&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=TheBusyBiscuit_Slimefun4) | [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=TheBusyBiscuit_Slimefun4&metric=code_smells)](https://sonarcloud.io/dashboard?id=TheBusyBiscuit_Slimefun4) | [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=TheBusyBiscuit_Slimefun4&metric=sqale_index)](https://sonarcloud.io/dashboard?id=TheBusyBiscuit_Slimefun4) | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=TheBusyBiscuit_Slimefun4&metric=coverage)](https://sonarcloud.io/dashboard?id=TheBusyBiscuit_Slimefun4) |
##### "Code Smells"
Code Smells are portions of the source code that are confusing, lack documentation or are just done very badly in general. These code smells should be held to a bare minimum.
_Please contact us on [Discord](#discord) before working on any code smells. Some design patterns may not be changed abruptly because an addon might depend on them._
##### "Technical Debt"
Technical Debt is basically an estimate for how long it would take to fix all issues and code smells.
##### Test Coverage
Slimefun now also uses Automated Tests to determine whether an update could break something. The coverage shows how much these tests cover. Higher coverage means less breaking changes and as a result also better and more reliable builds.
Due to this being a very huge project though, getting to `100% coverage` is probably close to impossible. But increasing that number even slightly still helps. So feel free to write Unit Tests for Slimefun and place them in the [/src/test/java/](https://github.com/Slimefun/Slimefun4/tree/master/src/test/java) folder.
## Disclaimers ## Disclaimers
Slimefun4 uses various systems that collect usage information or download automatic updates as well as the latest information about the project. Slimefun4 uses various systems that collect usage information or download automatic updates as well as the latest information about the project.

View File

@ -304,7 +304,7 @@
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId> <artifactId>junit-jupiter</artifactId>
<version>5.6.2</version> <version>5.7.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -45,6 +45,9 @@ public class MultiBlock {
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) {
SUPPORTED_TAGS.add(Tag.WOODEN_FENCES); SUPPORTED_TAGS.add(Tag.WOODEN_FENCES);
} }
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) {
SUPPORTED_TAGS.add(Tag.FIRE);
}
} }
@Nonnull @Nonnull

View File

@ -38,7 +38,7 @@ public abstract class MedicalSupply<T extends ItemHandler> extends SimpleSlimefu
if (n.hasPotionEffect(PotionEffectType.WEAKNESS)) n.removePotionEffect(PotionEffectType.WEAKNESS); if (n.hasPotionEffect(PotionEffectType.WEAKNESS)) n.removePotionEffect(PotionEffectType.WEAKNESS);
if (n.hasPotionEffect(PotionEffectType.CONFUSION)) n.removePotionEffect(PotionEffectType.CONFUSION); if (n.hasPotionEffect(PotionEffectType.CONFUSION)) n.removePotionEffect(PotionEffectType.CONFUSION);
if (n.hasPotionEffect(PotionEffectType.BLINDNESS)) n.removePotionEffect(PotionEffectType.BLINDNESS); if (n.hasPotionEffect(PotionEffectType.BLINDNESS)) n.removePotionEffect(PotionEffectType.BLINDNESS);
if (n.hasPotionEffect(PotionEffectType.BAD_OMEN)) n.removePotionEffect(PotionEffectType.BLINDNESS); if (n.hasPotionEffect(PotionEffectType.BAD_OMEN)) n.removePotionEffect(PotionEffectType.BAD_OMEN);
} }
/** /**

View File

@ -71,13 +71,6 @@ public class BlockListener implements Listener {
} }
BlockStorage.addBlockInfo(e.getBlock(), "id", sfItem.getID(), true); BlockStorage.addBlockInfo(e.getBlock(), "id", sfItem.getID(), true);
SlimefunBlockHandler blockHandler = SlimefunPlugin.getRegistry().getBlockHandlers().get(sfItem.getID());
if (blockHandler != null) {
blockHandler.onPlace(e.getPlayer(), e.getBlock(), sfItem);
}
sfItem.callItemHandler(BlockPlaceHandler.class, handler -> handler.onPlayerPlace(e)); sfItem.callItemHandler(BlockPlaceHandler.class, handler -> handler.onPlayerPlace(e));
} }
} }

View File

@ -4,7 +4,6 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason;
@ -22,24 +21,6 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.UnregisterReason;
@FunctionalInterface @FunctionalInterface
public interface SlimefunBlockHandler { public interface SlimefunBlockHandler {
/**
* This method gets called when the {@link Block} is placed.
* Use this method to initialize block data.
*
* @deprecated Use a {@link BlockPlaceHandler} instead
*
* @param p
* The {@link Player} who placed it
* @param b
* The {@link Block} that was placed
* @param item
* The {@link SlimefunItem} that will be stored inside the {@link Block}
*/
@Deprecated
default void onPlace(Player p, Block b, SlimefunItem item) {
// This has been deprecated
}
/** /**
* This method gets called when the {@link Block} is broken. * This method gets called when the {@link Block} is broken.
* The {@link Player} will be null if the {@link Block} exploded * The {@link Player} will be null if the {@link Block} exploded

View File

@ -93,6 +93,7 @@ public final class TestUtilities {
server.createMaterialTag(NamespacedKey.minecraft("beds"), Material.RED_BED, Material.BLUE_BED); server.createMaterialTag(NamespacedKey.minecraft("beds"), Material.RED_BED, Material.BLUE_BED);
server.createMaterialTag(NamespacedKey.minecraft("fishes"), Material.COD, Material.SALMON); server.createMaterialTag(NamespacedKey.minecraft("fishes"), Material.COD, Material.SALMON);
server.createMaterialTag(NamespacedKey.minecraft("doors"), Material.OAK_DOOR, Material.IRON_DOOR); server.createMaterialTag(NamespacedKey.minecraft("doors"), Material.OAK_DOOR, Material.IRON_DOOR);
server.createMaterialTag(NamespacedKey.minecraft("fire"), Material.FIRE, Material.SOUL_FIRE);
} }
} }