Skip to content

Commit

Permalink
Merge pull request #3139 from Slimefun/breaking-changes/class-relocation
Browse files Browse the repository at this point in the history
⚠️ BREAKING CHANGES ⚠️ - Relocation of important API classes.
  • Loading branch information
TheBusyBiscuit authored Sep 3, 2021
2 parents d2fe1c3 + 72cbdf8 commit 7b4c9d9
Show file tree
Hide file tree
Showing 547 changed files with 4,254 additions and 4,032 deletions.
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

0 comments on commit 7b4c9d9

Please sign in to comment.