mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Been a while
This commit is contained in:
parent
bd461a6f88
commit
527dfb2b79
@ -98,6 +98,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.Cart
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.CauldronListener;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.CraftingTableListener;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.GrindstoneListener;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.HopperListener;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.resources.GEOResourcesSetup;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.setup.PostSetup;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup;
|
||||
@ -475,6 +476,7 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon {
|
||||
new CauldronListener(this);
|
||||
new GrindstoneListener(this);
|
||||
new CartographyTableListener(this);
|
||||
new HopperListener(this);
|
||||
|
||||
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
||||
new BeeListener(this);
|
||||
|
@ -5,6 +5,7 @@ import java.util.Map;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.VanillaContainer;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
@ -26,7 +27,7 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
|
||||
* @author Linox
|
||||
*
|
||||
*/
|
||||
public class AutoBrewer extends AContainer {
|
||||
public class AutoBrewer extends VanillaContainer {
|
||||
|
||||
private static final Map<Material, PotionType> potionRecipes = new EnumMap<>(Material.class);
|
||||
private static final Map<PotionType, PotionType> fermentations = new EnumMap<>(PotionType.class);
|
||||
|
@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machine
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.VanillaContainer;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -22,7 +23,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
* @author Linox
|
||||
*
|
||||
*/
|
||||
public class AutoDrier extends AContainer implements RecipeDisplayItem {
|
||||
public class AutoDrier extends VanillaContainer implements RecipeDisplayItem {
|
||||
|
||||
private List<ItemStack> recipeList;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.VanillaContainer;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.FurnaceRecipe;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -12,7 +13,7 @@ import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public class ElectricFurnace extends AContainer {
|
||||
public class ElectricFurnace extends VanillaContainer {
|
||||
|
||||
public ElectricFurnace(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, recipeType, recipe);
|
||||
|
@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machine
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.VanillaContainer;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@ -23,7 +24,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
* @see ElectricIngotFactory
|
||||
*
|
||||
*/
|
||||
public class ElectricIngotPulverizer extends AContainer implements RecipeDisplayItem {
|
||||
public class ElectricIngotPulverizer extends VanillaContainer implements RecipeDisplayItem {
|
||||
|
||||
public ElectricIngotPulverizer(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, recipeType, recipe);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.VanillaContainer;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@ -9,7 +10,7 @@ import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public class ElectricOreGrinder extends AContainer implements RecipeDisplayItem {
|
||||
public class ElectricOreGrinder extends VanillaContainer implements RecipeDisplayItem {
|
||||
|
||||
public ElectricOreGrinder(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, recipeType, recipe);
|
||||
|
@ -5,6 +5,7 @@ import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.VanillaContainer;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -35,7 +36,7 @@ import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
|
||||
* @author TheBusyBiscuit
|
||||
*
|
||||
*/
|
||||
public class ElectricSmeltery extends AContainer {
|
||||
public class ElectricSmeltery extends VanillaContainer {
|
||||
|
||||
private static final int[] border = { 4, 5, 6, 7, 8, 13, 31, 40, 41, 42, 43, 44 };
|
||||
private static final int[] inputBorder = { 0, 1, 2, 3, 9, 12, 18, 21, 27, 30, 36, 37, 38, 39 };
|
||||
|
@ -0,0 +1,36 @@
|
||||
package io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.VanillaContainer;
|
||||
import me.mrCookieSlime.Slimefun.api.BlockStorage;
|
||||
|
||||
/**
|
||||
* This {@link Listener} prevents item from being transferred to a
|
||||
* {@link VanillaContainer} using a hopper.
|
||||
*
|
||||
*/
|
||||
|
||||
public class HopperListener implements SlimefunCraftingListener {
|
||||
|
||||
public HopperListener(@Nonnull SlimefunPlugin plugin) {
|
||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void fromHopper(InventoryMoveItemEvent e) {
|
||||
Location loc = e.getDestination().getLocation();
|
||||
if (e.getSource().getType() == InventoryType.HOPPER && loc != null && BlockStorage.hasBlockInfo(loc)) {
|
||||
if (BlockStorage.check(loc.getBlock()) instanceof VanillaContainer) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||
|
||||
public abstract class VanillaContainer extends AContainer {
|
||||
|
||||
@ParametersAreNonnullByDefault
|
||||
public VanillaContainer(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, recipeType, recipe);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user