Skip to content
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

⚠️ BREAKING CHANGES ⚠️ - Relocation of important API classes. #3139

Merged
merged 39 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
986c152
Relocated SlimefunItemStack.java
TheBusyBiscuit Jun 26, 2021
0dd1356
Relocated ItemHandler.java
TheBusyBiscuit Jun 26, 2021
f6890f4
Relocated SlimefunItem.java
TheBusyBiscuit Jun 26, 2021
7714c50
Renamed categories to item groups
TheBusyBiscuit Jun 26, 2021
fc18546
Relocate RecipeType.java
TheBusyBiscuit Jun 26, 2021
8055595
Formatting
TheBusyBiscuit Jun 26, 2021
88fd333
Renamed getByID to getById
TheBusyBiscuit Jun 26, 2021
18a944d
Relocated researches package
TheBusyBiscuit Jun 26, 2021
b4b19d5
More refactoring
TheBusyBiscuit Jun 26, 2021
add3408
Renamed main class
TheBusyBiscuit Jun 26, 2021
e40222f
Merge branch 'master' of https://github.com/Slimefun/Slimefun4.git into
TheBusyBiscuit Jul 14, 2021
0cc9bd9
Progress towards dough
TheBusyBiscuit Jul 14, 2021
51b5d1c
Fixed unit test imports
TheBusyBiscuit Jul 14, 2021
6de1fe8
More progress on dough implementation
TheBusyBiscuit Jul 14, 2021
5abab2e
More dough implementations
TheBusyBiscuit Jul 14, 2021
3a30221
Fixed locale implementation
TheBusyBiscuit Jul 14, 2021
91c6e86
Updated group id of baked-libs
TheBusyBiscuit Jul 14, 2021
cdf379a
Fixed UpdaterService
TheBusyBiscuit Jul 15, 2021
ddd2d21
Finished first transition to dough
TheBusyBiscuit Jul 15, 2021
6175540
Merge branch 'master' of https://github.com/Slimefun/Slimefun4.git in…
TheBusyBiscuit Jul 15, 2021
5ff71c4
Merge branch 'master' of https://github.com/Slimefun/Slimefun4.git into
TheBusyBiscuit Jul 17, 2021
c8c9a35
Fixed Table Saw
TheBusyBiscuit Jul 17, 2021
a2a42a7
Fixed PatternUtils
TheBusyBiscuit Jul 17, 2021
9c0d28e
Updated to CommonPatterns
TheBusyBiscuit Jul 17, 2021
1fbfa63
Merge branch 'master' of https://github.com/Slimefun/Slimefun4.git into
TheBusyBiscuit Jul 25, 2021
633a736
Merge branch 'master' of https://github.com/Slimefun/Slimefun4.git into
TheBusyBiscuit Jul 28, 2021
708aa17
Bump `dough-api` to 1.0.2
TheBusyBiscuit Jul 28, 2021
c0f25ba
Merge branch 'master' of https://github.com/Slimefun/Slimefun4.git into
TheBusyBiscuit Aug 5, 2021
d64f2bb
Merge branch 'master' into breaking-changes/class-relocation
WalshyDev Sep 1, 2021
aa9e7a4
Fix compilation
WalshyDev Sep 1, 2021
0841e1e
Fix naming of setCategory -> setItemGroup
WalshyDev Sep 1, 2021
1513b01
Fix tests
WalshyDev Sep 1, 2021
2519e88
Merge branch 'master' of github.com:Slimefun/Slimefun4 into breaking-…
WalshyDev Sep 2, 2021
39d0080
Fix compilation
WalshyDev Sep 2, 2021
43280f9
Update CHANGELOG
WalshyDev Sep 2, 2021
42d6d25
Merge master
WalshyDev Sep 2, 2021
ffdf9c8
Forgot the util class reee
WalshyDev Sep 2, 2021
02cc920
Fix the other instances of Inventory#isEmpty
WalshyDev Sep 2, 2021
72cbdf8
Merge branch 'master' into breaking-changes/class-relocation
TheBusyBiscuit Sep 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Table of contents
- [Release Candidate 27 (TBD)](#release-candidate-27-tbd)
- [Release Candidate 27 (03 Sep 2021)](#release-candidate-27-03-sep-2021)
- [Release Candidate 26 (20 Jul 2021)](#release-candidate-26-20-jul-2021)
- [Release Candidate 25 (20 Jun 2021)](#release-candidate-25-20-jun-2021)
- [Release Candidate 24 (03 Jun 2021)](#release-candidate-24-03-jun-2021)
Expand Down Expand Up @@ -27,7 +27,20 @@
- [Release Candidate 2 (29 Sep 2019)](#release-candidate-2-29-sep-2019)
- [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019)

## Release Candidate 27 (TBD)
## Release Candidate 27 (03 Sep 2021)

### **Breaking Changes (API)**
This RC brings a lot of breaking changes to the API. For more info on why we did this and what happened [please refer to our PSA](https://github.com/Slimefun/Slimefun4/pull/3139)

* Category has been renamed to ItemGroup.
* All Category / ItemGroup variants have been relocated to `io.github.thebusybiscuit.slimefun4.api.items.groups`
* The SlimefunItem class has been relocated to `io.github.thebusybiscuit.slimefun4.api.items`
* The SlimefunItemStack class has been relocated to `io.github.thebusybiscuit.slimefun4.api.items`
* The ItemHandler class has been relocated to `io.github.thebusybiscuit.slimefun4.api.items`
* The RecipeType class has been relocated to `io.github.thebusybiscuit.slimefun4.api.recipes`
* Research classes have been moved from `io.github.thebusybiscuit.slimefun4.core.researching` to `io.github.thebusybiscuit.slimefun4.api.researches`
* The main class `SlimefunPlugin` was renamed to `Slimefun`
* CS-CoreLib2 was removed and replaced by dough

#### Additions
* A couple more items have their wiki page linked ingame now
Expand All @@ -46,6 +59,7 @@
* Slimefun chains can no longer be placed down
* (API) FlexCategories can now also appear in non-survival Slimefun guides
* Display items from Ancient Altars should no longer despawn so easily/fast
* Research message was modified to also show the category of the item

#### Fixes
* Fixed #3164
Expand Down
62 changes: 31 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<url>https://papermc.io/repo/repository/maven-public</url>
</repository>
<repository>
<!-- CS-CoreLib2, ItemsAdder -->
<!-- ItemsAdder -->
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
Expand Down Expand Up @@ -197,8 +197,8 @@
<!-- Relocate these to avoid clashes and conflicts -->
<relocations>
<relocation>
<pattern>io.github.thebusybiscuit.cscorelib2</pattern>
<shadedPattern>me.mrCookieSlime.Slimefun.cscorelib2</shadedPattern>
<pattern>io.github.bakedlibs.dough</pattern>
<shadedPattern>io.github.thebusybiscuit.slimefun4.libraries.dough</shadedPattern>
</relocation>
<relocation>
<pattern>io.papermc.lib</pattern>
Expand Down Expand Up @@ -344,6 +344,34 @@
<scope>provided</scope>
</dependency>

<!-- Shaded packages -->
<dependency>
<groupId>io.github.baked-libs</groupId>
<artifactId>dough-api</artifactId>
<version>1.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.papermc</groupId>
<artifactId>paperlib</artifactId>
<version>1.0.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-java</artifactId>
<version>3.11.12</version>
<scope>compile</scope>

<exclusions>
<exclusion>
<!-- No need to shade Gson, Spigot does that already -->
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Testing dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -373,34 +401,6 @@
</exclusions>
</dependency>

<!-- Shaded packages -->
<dependency>
<groupId>com.github.thebusybiscuit</groupId>
<artifactId>CS-CoreLib2</artifactId>
<version>0.32.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.papermc</groupId>
<artifactId>paperlib</artifactId>
<version>1.0.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-java</artifactId>
<version>3.11.13</version>
<scope>compile</scope>

<exclusions>
<exclusion>
<!-- No need to shade Gson, Spigot does that already -->
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Third party plugin integrations / soft dependencies -->
<dependency>
<groupId>com.sk89q.worldedit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
import org.bukkit.Location;
import org.bukkit.plugin.Plugin;

import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetProvider;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.papermc.lib.PaperLib;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;

import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker;
import me.mrCookieSlime.Slimefun.api.BlockStorage;

Expand Down Expand Up @@ -68,7 +69,7 @@ public ErrorReport(T throwable, SlimefunAddon addon, Consumer<PrintStream> print
this.throwable = throwable;
this.addon = addon;

SlimefunPlugin.runSync(() -> print(printer));
Slimefun.runSync(() -> print(printer));
}

/**
Expand Down Expand Up @@ -182,7 +183,7 @@ private void print(@Nonnull Consumer<PrintStream> printer) {
stream.println();

stream.println("Slimefun Environment:");
stream.println(" Slimefun v" + SlimefunPlugin.getVersion());
stream.println(" Slimefun v" + Slimefun.getVersion());
stream.println(" Caused by: " + addon.getName() + " v" + addon.getPluginVersion());
stream.println();

Expand Down Expand Up @@ -218,7 +219,7 @@ private void print(@Nonnull Consumer<PrintStream> printer) {

addon.getLogger().log(Level.WARNING, "");
} catch (Exception x) {
addon.getLogger().log(Level.SEVERE, x, () -> "An Error occurred while saving an Error-Report for Slimefun " + SlimefunPlugin.getVersion());
addon.getLogger().log(Level.SEVERE, x, () -> "An Error occurred while saving an Error-Report for Slimefun " + Slimefun.getVersion());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.apache.commons.lang.Validate;
import org.bukkit.Server;

import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.papermc.lib.PaperLib;

/**
Expand All @@ -14,7 +14,7 @@
* @author TheBusyBiscuit
* @author Walshy
*
* @see SlimefunPlugin
* @see Slimefun
*
*/
public enum MinecraftVersion {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;

import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;

/**
* This is a very basic interface that will be used to identify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.apache.commons.lang.Validate;

import io.github.thebusybiscuit.slimefun4.utils.PatternUtils;
import io.github.bakedlibs.dough.common.CommonPatterns;

/**
* This enum represents the branch this Slimefun build is on.
Expand Down Expand Up @@ -50,7 +50,7 @@ public enum SlimefunBranch {
this.name = name;
this.official = official;

if (!PatternUtils.ASCII.matcher(name).matches()) {
if (!CommonPatterns.ASCII.matcher(name).matches()) {
throw new IllegalStateException("The SlimefunBranch enum contains ILLEGAL CHARACTERS. DO NOT TRANSLATE THIS FILE.");
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package io.github.thebusybiscuit.slimefun4.api.events;

import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.enchanting.AutoEnchanter;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import javax.annotation.Nonnull;

import org.apache.commons.lang.Validate;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.ItemStack;

import javax.annotation.Nonnull;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.enchanting.AutoEnchanter;

import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;

/**
* An {@link Event} that is called whenever an {@link AutoEnchanter} is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

import io.github.thebusybiscuit.cscorelib2.blocks.BlockPosition;
import io.github.bakedlibs.dough.blocks.BlockPosition;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineOperation;
import io.github.thebusybiscuit.slimefun4.core.machines.MachineProcessor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import javax.annotation.Nonnull;

import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.enchanting.AutoEnchanter;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.enchanting.AutoEnchanter;

/**
* An {@link Event} that is called whenever an {@link AutoEnchanter} is trying to enchant
* an {@link ItemStack}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import org.bukkit.event.block.BlockEvent;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.BlockPlacer;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;

/**
* This {@link Event} is fired whenever a {@link BlockPlacer} wants to place a {@link Block}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package io.github.thebusybiscuit.slimefun4.api.events;

import io.github.thebusybiscuit.slimefun4.implementation.items.tools.ExplosiveTool;
import java.util.List;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;

import org.apache.commons.lang.Validate;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
Expand All @@ -10,9 +14,7 @@
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.List;
import io.github.thebusybiscuit.slimefun4.implementation.items.tools.ExplosiveTool;

/**
* This {@link Event} is called when an {@link ExplosiveTool} is used to break blocks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

import io.github.thebusybiscuit.slimefun4.core.researching.Research;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.researches.Research;
import io.github.thebusybiscuit.slimefun4.implementation.guide.CheatSheetSlimefunGuide;
import io.github.thebusybiscuit.slimefun4.implementation.guide.SurvivalSlimefunGuide;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;

/**
* This {@link Event} is called whenever a {@link Player} clicks to unlock a {@link Research}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.cscorelib2.data.TriStateOptional;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import io.github.bakedlibs.dough.data.TriStateOptional;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;

import me.mrCookieSlime.Slimefun.api.BlockStorage;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.reactors.Reactor;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;

/**
* The {@link ReactorExplodeEvent} is called whenever a reactor explodes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

import io.github.thebusybiscuit.slimefun4.core.researching.Research;
import io.github.thebusybiscuit.slimefun4.api.researches.Research;

/**
* This {@link Event} is called whenever a {@link Player} unlocks a {@link Research}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import javax.annotation.ParametersAreNonnullByDefault;

import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;

/**
* An {@link IdConflictException} is thrown whenever two Addons try to add
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import org.bukkit.plugin.Plugin;

import io.github.thebusybiscuit.slimefun4.api.items.ItemHandler;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler;

/**
* An {@link IncompatibleItemHandlerException} is thrown whenever a {@link Plugin} tried
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.bukkit.plugin.Plugin;

import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;

/**
* An {@link UnregisteredItemException} is thrown whenever a {@link Plugin} tried to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.core.attributes.DamageableItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;

/**
* A {@link WrongItemStackException} is thrown when someone tries to alter an {@link ItemStack}
Expand Down
Loading