mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Fixed Table Saw
This commit is contained in:
parent
5ff71c4f71
commit
c8c9a35b6a
@ -6,6 +6,7 @@ import java.util.Optional;
|
|||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -32,6 +33,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.OutputChes
|
|||||||
*
|
*
|
||||||
* @author dniym
|
* @author dniym
|
||||||
* @author svr333
|
* @author svr333
|
||||||
|
* @author TheBusyBiscuit
|
||||||
*
|
*
|
||||||
* @see MultiBlockMachine
|
* @see MultiBlockMachine
|
||||||
*
|
*
|
||||||
@ -40,8 +42,9 @@ public class TableSaw extends MultiBlockMachine {
|
|||||||
|
|
||||||
private final List<ItemStack> displayedRecipes = new ArrayList<>();
|
private final List<ItemStack> displayedRecipes = new ArrayList<>();
|
||||||
|
|
||||||
public TableSaw(ItemGroup category, SlimefunItemStack item) {
|
@ParametersAreNonnullByDefault
|
||||||
super(category, item, new ItemStack[] { null, null, null, new ItemStack(Material.SMOOTH_STONE_SLAB), new ItemStack(Material.STONECUTTER), new ItemStack(Material.SMOOTH_STONE_SLAB), null, new ItemStack(Material.IRON_BLOCK), null }, BlockFace.SELF);
|
public TableSaw(ItemGroup group, SlimefunItemStack item) {
|
||||||
|
super(group, item, new ItemStack[] { null, null, null, new ItemStack(Material.SMOOTH_STONE_SLAB), new ItemStack(Material.STONECUTTER), new ItemStack(Material.SMOOTH_STONE_SLAB), null, new ItemStack(Material.IRON_BLOCK), null }, BlockFace.SELF);
|
||||||
|
|
||||||
for (Material log : Tag.LOGS.getValues()) {
|
for (Material log : Tag.LOGS.getValues()) {
|
||||||
Optional<Material> planks = getPlanks(log);
|
Optional<Material> planks = getPlanks(log);
|
||||||
@ -59,8 +62,9 @@ public class TableSaw extends MultiBlockMachine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private @Nonnull Optional<Material> getPlanks(@Nonnull Material log) {
|
private @Nonnull Optional<Material> getPlanks(@Nonnull Material log) {
|
||||||
// TODO: Return plank for corresponding log
|
String materialName = log.name().replace("STRIPPED_", "");
|
||||||
return Optional.empty();
|
materialName = materialName.substring(0, materialName.lastIndexOf('_')) + "_PLANKS";
|
||||||
|
return Optional.ofNullable(Material.getMaterial(materialName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user