Skip to content

Commit b151a8e

Browse files
[CI skip] Merge pull request #104 from Catzy44/fix/latest-sf
Update to RC-28
2 parents 9fb8076 + 6bcfffb commit b151a8e

29 files changed

Lines changed: 207 additions & 134 deletions

pom.xml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<maven.compiler.target>1.8</maven.compiler.target>
2121

2222
<!-- Spigot properties -->
23-
<spigot.version>1.17</spigot.version>
23+
<spigot.version>1.18.1</spigot.version>
2424
<spigot.javadocs>https://hub.spigotmc.org/javadocs/spigot/</spigot.javadocs>
2525

2626
<!-- Default settings for sonarcloud.io -->
@@ -67,7 +67,7 @@
6767
</repository>
6868
<repository>
6969
<id>worldedit-repo</id>
70-
<url>https://maven.sk89q.com/repo/</url>
70+
<url>https://maven.enginehub.org/repo/</url>
7171
</repository>
7272
</repositories>
7373

@@ -202,12 +202,12 @@
202202
<dependency>
203203
<groupId>com.github.TheBusyBiscuit</groupId>
204204
<artifactId>Slimefun4</artifactId>
205-
<version>RC-25</version>
205+
<version>RC-27</version>
206206
<scope>provided</scope>
207207
<exclusions>
208208
<exclusion>
209-
<groupId>io.github.thebusybiscuit</groupId>
210-
<artifactId>cscorelib2</artifactId>
209+
<groupId>io.github.bakedlibs</groupId>
210+
<artifactId>dough-api</artifactId>
211211
</exclusion>
212212
</exclusions>
213213
</dependency>
@@ -233,13 +233,6 @@
233233
<scope>provided</scope>
234234
</dependency>
235235

236-
<dependency>
237-
<groupId>com.github.thebusybiscuit</groupId>
238-
<artifactId>CS-CoreLib2</artifactId>
239-
<version>0.32.1</version>
240-
<scope>compile</scope>
241-
</dependency>
242-
243236
<dependency>
244237
<groupId>io.papermc</groupId>
245238
<artifactId>paperlib</artifactId>

src/main/java/io/github/thebusybiscuit/sensibletoolbox/SensibleToolboxPlugin.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222

2323
import com.comphenix.protocol.ProtocolLib;
2424

25-
import io.github.thebusybiscuit.cscorelib2.protection.ProtectionManager;
26-
import io.github.thebusybiscuit.cscorelib2.updater.GitHubBuildsUpdater;
27-
import io.github.thebusybiscuit.cscorelib2.updater.Updater;
2825
import io.github.thebusybiscuit.sensibletoolbox.api.AccessControl;
2926
import io.github.thebusybiscuit.sensibletoolbox.api.FriendManager;
3027
import io.github.thebusybiscuit.sensibletoolbox.api.MinecraftVersion;
@@ -154,6 +151,10 @@
154151
import io.github.thebusybiscuit.sensibletoolbox.slimefun.SlimefunBridge;
155152
import io.github.thebusybiscuit.sensibletoolbox.utils.ItemGlow;
156153
import io.github.thebusybiscuit.sensibletoolbox.utils.STBUtil;
154+
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.ProtectionManager;
155+
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.GitHubBuildsUpdater;
156+
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.PluginUpdater;
157+
import io.github.thebusybiscuit.slimefun4.libraries.dough.versions.PrefixedVersion;
157158
import io.papermc.lib.PaperLib;
158159

159160
import me.desht.dhutils.DHUtilsException;
@@ -264,7 +265,7 @@ public void onEnable() {
264265
}
265266

266267
if (getConfig().getBoolean("options.auto-update") && getDescription().getVersion().startsWith("DEV - ")) {
267-
Updater updater = new GitHubBuildsUpdater(this, getFile(), "Slimefun/SensibleToolbox/master");
268+
PluginUpdater<PrefixedVersion> updater = new GitHubBuildsUpdater(this, getFile(), "Slimefun/SensibleToolbox/master");
268269
updater.start();
269270
}
270271

src/main/java/io/github/thebusybiscuit/sensibletoolbox/api/MinecraftVersion.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ public enum MinecraftVersion {
4343
*
4444
*/
4545
MINECRAFT_1_17(17, "1.17.x"),
46+
47+
/**
48+
* This constant represents Minecraft (Java Edition) Version 1.18
49+
* (The "Caves and Cliffs: Part II" Update)
50+
*
51+
*/
52+
MINECRAFT_1_18(18, "1.18.x"),
4653

4754
/**
4855
* This constant represents an exceptional state in which we were unable

src/main/java/io/github/thebusybiscuit/sensibletoolbox/api/SensibleToolbox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import org.bukkit.Location;
55
import org.bukkit.block.Block;
66

7-
import io.github.thebusybiscuit.cscorelib2.protection.ProtectionManager;
87
import io.github.thebusybiscuit.sensibletoolbox.SensibleToolboxPlugin;
98
import io.github.thebusybiscuit.sensibletoolbox.api.energy.EnergyNet;
109
import io.github.thebusybiscuit.sensibletoolbox.api.items.BaseSTBBlock;
1110
import io.github.thebusybiscuit.sensibletoolbox.core.storage.LocationManager;
11+
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.ProtectionManager;
1212

1313
/**
1414
* Top-level collection of utility methods for Sensible Toolbox.

src/main/java/io/github/thebusybiscuit/sensibletoolbox/api/items/BaseSTBItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
import org.bukkit.permissions.Permissible;
3535
import org.bukkit.plugin.Plugin;
3636

37-
import io.github.thebusybiscuit.cscorelib2.data.PersistentDataAPI;
3837
import io.github.thebusybiscuit.sensibletoolbox.SensibleToolboxPlugin;
3938
import io.github.thebusybiscuit.sensibletoolbox.api.SensibleToolbox;
4039
import io.github.thebusybiscuit.sensibletoolbox.api.energy.Chargeable;
4140
import io.github.thebusybiscuit.sensibletoolbox.api.gui.InventoryGUIListener;
4241
import io.github.thebusybiscuit.sensibletoolbox.core.STBItemRegistry;
4342
import io.github.thebusybiscuit.sensibletoolbox.utils.ItemGlow;
4443
import io.github.thebusybiscuit.sensibletoolbox.utils.STBUtil;
44+
import io.github.thebusybiscuit.slimefun4.libraries.dough.data.persistent.PersistentDataAPI;
4545

4646
/**
4747
* Represents an STB item. This is the superclass for all STB items.

src/main/java/io/github/thebusybiscuit/sensibletoolbox/blocks/AngelicBlock.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import io.github.thebusybiscuit.sensibletoolbox.SensibleToolboxPlugin;
44
import io.github.thebusybiscuit.sensibletoolbox.api.MinecraftVersion;
5+
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;
56
import org.bukkit.ChatColor;
67
import org.bukkit.Effect;
78
import org.bukkit.Location;
@@ -19,7 +20,6 @@
1920
import org.bukkit.inventory.ShapedRecipe;
2021
import org.bukkit.util.Vector;
2122

22-
import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction;
2323
import io.github.thebusybiscuit.sensibletoolbox.api.SensibleToolbox;
2424
import io.github.thebusybiscuit.sensibletoolbox.api.items.BaseSTBBlock;
2525
import io.github.thebusybiscuit.sensibletoolbox.utils.STBUtil;
@@ -68,7 +68,7 @@ public void onInteractItem(PlayerInteractEvent event) {
6868
Location loc = p.getEyeLocation().add(v);
6969
Block b = loc.getBlock();
7070

71-
if (b.isEmpty() && SensibleToolbox.getProtectionManager().hasPermission(p, b, ProtectableAction.PLACE_BLOCK) && isWithinWorldBounds(b)) {
71+
if (b.isEmpty() && SensibleToolbox.getProtectionManager().hasPermission(p, b, Interaction.PLACE_BLOCK) && isWithinWorldBounds(b)) {
7272
ItemStack stack = event.getItem();
7373

7474
if (stack.getAmount() > 1) {
@@ -102,7 +102,7 @@ public void onBlockDamage(BlockDamageEvent event) {
102102
Player p = event.getPlayer();
103103
Block b = event.getBlock();
104104

105-
if (SensibleToolbox.getProtectionManager().hasPermission(p, b, ProtectableAction.BREAK_BLOCK)) {
105+
if (SensibleToolbox.getProtectionManager().hasPermission(p, b, Interaction.BREAK_BLOCK)) {
106106
b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, b.getType());
107107
breakBlock(false);
108108
STBUtil.giveItems(p, toItemStack());

src/main/java/io/github/thebusybiscuit/sensibletoolbox/blocks/machines/AutoBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.bukkit.inventory.Recipe;
2222
import org.bukkit.inventory.ShapedRecipe;
2323

24-
import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction;
2524
import io.github.thebusybiscuit.sensibletoolbox.api.SensibleToolbox;
2625
import io.github.thebusybiscuit.sensibletoolbox.api.gui.InventoryGUI;
2726
import io.github.thebusybiscuit.sensibletoolbox.api.gui.SlotType;
@@ -35,6 +34,7 @@
3534
import io.github.thebusybiscuit.sensibletoolbox.items.components.ToughMachineFrame;
3635
import io.github.thebusybiscuit.sensibletoolbox.utils.ColoredMaterial;
3736
import io.github.thebusybiscuit.sensibletoolbox.utils.STBUtil;
37+
import io.github.thebusybiscuit.slimefun4.libraries.dough.protection.Interaction;
3838
import me.desht.dhutils.MiscUtil;
3939
import me.desht.dhutils.cuboid.Cuboid;
4040
import me.desht.dhutils.cuboid.CuboidDirection;
@@ -264,7 +264,7 @@ public void onServerTick() {
264264

265265
switch (getBuildMode()) {
266266
case CLEAR:
267-
if (!SensibleToolbox.getProtectionManager().hasPermission(owner, b, ProtectableAction.BREAK_BLOCK)) {
267+
if (!SensibleToolbox.getProtectionManager().hasPermission(owner, b, Interaction.BREAK_BLOCK)) {
268268
setStatus(BuilderStatus.NO_PERMISSION);
269269
return;
270270
}
@@ -290,7 +290,7 @@ public void onServerTick() {
290290
case FILL:
291291
case WALLS:
292292
case FRAME:
293-
if (!SensibleToolbox.getProtectionManager().hasPermission(owner, b, ProtectableAction.PLACE_BLOCK)) {
293+
if (!SensibleToolbox.getProtectionManager().hasPermission(owner, b, Interaction.PLACE_BLOCK)) {
294294
setStatus(BuilderStatus.NO_PERMISSION);
295295
return;
296296
}

src/main/java/io/github/thebusybiscuit/sensibletoolbox/blocks/machines/AutoFarm.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import org.bukkit.inventory.Recipe;
1919
import org.bukkit.inventory.ShapedRecipe;
2020

21-
import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
2221
import io.github.thebusybiscuit.sensibletoolbox.api.items.AutoFarmingMachine;
2322
import io.github.thebusybiscuit.sensibletoolbox.items.IronCombineHoe;
2423
import io.github.thebusybiscuit.sensibletoolbox.items.components.MachineFrame;
24+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
2525

2626
public class AutoFarm extends AutoFarmingMachine {
2727

@@ -133,7 +133,7 @@ protected boolean output(@Nonnull Material m) {
133133
amount = (stack.getMaxStackSize() - stack.getAmount()) > 3 ? (ThreadLocalRandom.current().nextInt(2) + 1) : (stack.getMaxStackSize() - stack.getAmount());
134134
}
135135

136-
setInventoryItem(slot, new CustomItem(stack, stack.getAmount() + amount));
136+
setInventoryItem(slot, new CustomItemStack(stack, stack.getAmount() + amount));
137137
buffer = null;
138138
return true;
139139
}

src/main/java/io/github/thebusybiscuit/sensibletoolbox/blocks/machines/AutoForester.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
import org.bukkit.inventory.Recipe;
1818
import org.bukkit.inventory.ShapedRecipe;
1919

20-
import io.github.thebusybiscuit.cscorelib2.blocks.Vein;
21-
import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
22-
import io.github.thebusybiscuit.cscorelib2.materials.MaterialConverter;
2320
import io.github.thebusybiscuit.sensibletoolbox.api.items.AutoFarmingMachine;
2421
import io.github.thebusybiscuit.sensibletoolbox.items.components.MachineFrame;
22+
import io.github.thebusybiscuit.sensibletoolbox.utils.MaterialConverter;
23+
import io.github.thebusybiscuit.slimefun4.libraries.dough.blocks.Vein;
24+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
2525

2626
public class AutoForester extends AutoFarmingMachine {
2727

@@ -135,7 +135,7 @@ private boolean output(@Nonnull Material m) {
135135
stack = new ItemStack(m);
136136
}
137137

138-
setInventoryItem(slot, new CustomItem(stack, stack.getAmount() + 1));
138+
setInventoryItem(slot, new CustomItemStack(stack, stack.getAmount() + 1));
139139
buffer = null;
140140
return true;
141141
}

src/main/java/io/github/thebusybiscuit/sensibletoolbox/blocks/machines/BigStorageUnit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
import org.bukkit.inventory.ShapedRecipe;
2727
import org.bukkit.metadata.FixedMetadataValue;
2828

29-
import io.github.thebusybiscuit.cscorelib2.inventory.ItemUtils;
3029
import io.github.thebusybiscuit.sensibletoolbox.api.gui.GUIUtil;
3130
import io.github.thebusybiscuit.sensibletoolbox.api.gui.InventoryGUI;
3231
import io.github.thebusybiscuit.sensibletoolbox.api.gui.gadgets.ToggleButton;
3332
import io.github.thebusybiscuit.sensibletoolbox.api.items.AbstractProcessingMachine;
3433
import io.github.thebusybiscuit.sensibletoolbox.utils.BukkitSerialization;
3534
import io.github.thebusybiscuit.sensibletoolbox.utils.STBUtil;
35+
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.ItemUtils;
3636
import me.desht.dhutils.Debugger;
3737

3838
public class BigStorageUnit extends AbstractProcessingMachine {

0 commit comments

Comments
 (0)