Skip to content

Commit

Permalink
Update FabledSkyBlock compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ceze88 committed Oct 25, 2023
1 parent f0398ef commit db2969b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
6 changes: 3 additions & 3 deletions EpicHoppers-Plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@
</dependency>

<dependency>
<groupId>com.songoda</groupId>
<artifactId>skyblock</artifactId>
<version>2.3.30</version>
<groupId>com.craftaro</groupId>
<artifactId>FabledSkyBlock</artifactId>
<version>3.0.0-b6-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
import com.craftaro.epichoppers.tasks.HopTask;
import com.craftaro.epichoppers.utils.Methods;
import com.craftaro.epichoppers.hopper.teleport.TeleportHandlerImpl;
import com.songoda.skyblock.SkyBlock;
import com.songoda.skyblock.permission.BasicPermission;
import com.craftaro.skyblock.SkyBlock;
import com.craftaro.skyblock.permission.BasicPermission;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.craftaro.epichoppers.compatibility;

import com.songoda.skyblock.core.compatibility.CompatibleMaterial;
import com.songoda.skyblock.permission.BasicPermission;
import com.songoda.skyblock.permission.PermissionType;
import com.craftaro.skyblock.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.skyblock.permission.BasicPermission;
import com.craftaro.skyblock.permission.PermissionType;

public class EpicHoppersPermission extends BasicPermission {
public EpicHoppersPermission() {
super("EpicHoppers", CompatibleMaterial.HOPPER, PermissionType.GENERIC);
super("EpicHoppers", XMaterial.HOPPER, PermissionType.GENERIC);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import com.craftaro.epichoppers.containers.CustomContainer;
import com.craftaro.epichoppers.containers.IContainer;
import com.songoda.skyblock.SkyBlock;
import com.songoda.skyblock.core.compatibility.CompatibleMaterial;
import com.songoda.skyblock.stackable.Stackable;
import com.songoda.skyblock.stackable.StackableManager;
import com.craftaro.skyblock.SkyBlock;
import com.craftaro.skyblock.core.compatibility.CompatibleMaterial;
import com.craftaro.skyblock.core.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.skyblock.stackable.Stackable;
import com.craftaro.skyblock.stackable.StackableManager;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;

Expand All @@ -22,14 +23,14 @@ public Container(Block block) {
super();

StackableManager stackableManager = SkyBlock.getInstance().getStackableManager();
CompatibleMaterial compatibleMaterial = CompatibleMaterial.getMaterial(block);
XMaterial xMaterial = XMaterial.matchXMaterial(block.getType());

this.stackable = stackableManager.getStack(block.getLocation(), compatibleMaterial);
this.stackable = stackableManager.getStack(block.getLocation(), xMaterial);
}

@Override
public boolean addToContainer(ItemStack itemToMove) {
if (CompatibleMaterial.getMaterial(itemToMove) != this.stackable.getMaterial()) {
if (XMaterial.matchXMaterial(itemToMove) != this.stackable.getMaterial()) {
return false;
}

Expand All @@ -44,12 +45,12 @@ public boolean addToContainer(ItemStack itemToMove) {

@Override
public ItemStack[] getItems() {
return new ItemStack[]{new ItemStack(this.stackable.getMaterial().getMaterial(), this.stackable.getSize())};
return new ItemStack[]{new ItemStack(this.stackable.getMaterial().parseMaterial(), this.stackable.getSize())};
}

@Override
public void removeFromContainer(ItemStack itemToMove, int amountToMove) {
if (CompatibleMaterial.getMaterial(itemToMove) != this.stackable.getMaterial()) {
if (XMaterial.matchXMaterial(itemToMove) != this.stackable.getMaterial()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.craftaro.epichoppers.hopper.teleport.TeleportTrigger;
import com.craftaro.epichoppers.player.PlayerData;
import com.craftaro.epichoppers.player.SyncType;
import com.songoda.skyblock.SkyBlock;
import com.craftaro.skyblock.SkyBlock;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
Expand Down

0 comments on commit db2969b

Please sign in to comment.