1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Merge branch 'master' into feature/auto-crafters

This commit is contained in:
TheBusyBiscuit 2021-03-17 10:54:37 +01:00 committed by GitHub
commit 320ee27b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 116 additions and 74 deletions

View File

@ -11,12 +11,12 @@ jobs:
steps: steps:
- name: Approve via actions - name: Approve via actions
uses: hmarr/auto-approve-action@v2.0.0 uses: hmarr/auto-approve-action@v2.1.0
if: github.actor == 'gitlocalize-app[bot]' if: github.actor == 'gitlocalize-app[bot]'
with: with:
github-token: "${{ secrets.GITHUB_TOKEN }}" github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve via TheBusyBot - name: Approve via TheBusyBot
uses: hmarr/auto-approve-action@v2.0.0 uses: hmarr/auto-approve-action@v2.1.0
if: github.actor == 'gitlocalize-app[bot]' || github.actor == 'renovate[bot]' if: github.actor == 'gitlocalize-app[bot]' || github.actor == 'renovate[bot]'
with: with:
github-token: "${{ secrets.ACCESS_TOKEN }}" github-token: "${{ secrets.ACCESS_TOKEN }}"

View File

@ -29,9 +29,11 @@
* Added Enhanced Auto Crafter * Added Enhanced Auto Crafter
#### Changes #### Changes
* Changed item order in guide for the Villager Rune and Nether Goo (All runes are now grouped together)
#### Fixes #### Fixes
* Fixed #1161 * Fixed #1161
* Fixed #2862
## Release Candidate 21 (14 Mar 2021) ## Release Candidate 21 (14 Mar 2021)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#21 https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#21

View File

@ -93,7 +93,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.SoulboundList
import io.github.thebusybiscuit.slimefun4.implementation.listeners.TalismanListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.TalismanListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.VampireBladeListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.VampireBladeListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.VillagerTradingListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.VillagerTradingListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.WorldListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.AnvilListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.AnvilListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.BrewingStandListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.BrewingStandListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.CartographyTableListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting.CartographyTableListener;
@ -667,9 +666,6 @@ public final class SlimefunPlugin extends JavaPlugin implements SlimefunAddon {
// Handle Slimefun Guide being given on Join // Handle Slimefun Guide being given on Join
new SlimefunGuideListener(this, config.getBoolean("guide.receive-on-first-join")); new SlimefunGuideListener(this, config.getBoolean("guide.receive-on-first-join"));
// Load/Unload Worlds in Slimefun
new WorldListener(this);
// Clear the Slimefun Guide History upon Player Leaving // Clear the Slimefun Guide History upon Player Leaving
new PlayerProfileListener(this); new PlayerProfileListener(this);
} }

View File

@ -1,5 +1,8 @@
package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines; package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Particle; import org.bukkit.Particle;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -12,6 +15,7 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent;
import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
@ -20,6 +24,7 @@ import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock;
import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker;
import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler;
import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
@ -34,20 +39,27 @@ public class AutoBreeder extends SlimefunItem implements InventoryBlock, EnergyN
// We wanna strip the Slimefun Item id here // We wanna strip the Slimefun Item id here
private static final ItemStack organicFood = new ItemStackWrapper(SlimefunItems.ORGANIC_FOOD); private static final ItemStack organicFood = new ItemStackWrapper(SlimefunItems.ORGANIC_FOOD);
@ParametersAreNonnullByDefault
public AutoBreeder(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { public AutoBreeder(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe); super(category, item, recipeType, recipe);
addItemHandler(onBreak());
createPreset(this, this::constructMenu); createPreset(this, this::constructMenu);
}
registerBlockHandler(getId(), (p, b, tool, reason) -> { @Nonnull
private ItemHandler onBreak() {
return new SimpleBlockBreakHandler() {
@Override
public void onBlockBreak(Block b) {
BlockMenu inv = BlockStorage.getInventory(b); BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) { if (inv != null) {
inv.dropItems(b.getLocation(), getInputSlots()); inv.dropItems(b.getLocation(), getInputSlots());
} }
}
return true; };
});
} }
protected void constructMenu(BlockMenuPreset preset) { protected void constructMenu(BlockMenuPreset preset) {
@ -114,7 +126,7 @@ public class AutoBreeder extends SlimefunItem implements InventoryBlock, EnergyN
} }
} }
private boolean canBreed(Entity n) { private boolean canBreed(@Nonnull Entity n) {
if (n.isValid() && n instanceof Animals) { if (n.isValid() && n instanceof Animals) {
Animals animal = (Animals) n; Animals animal = (Animals) n;

View File

@ -1,5 +1,19 @@
package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines; package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction;
import io.github.thebusybiscuit.slimefun4.core.attributes.NotHopperable; import io.github.thebusybiscuit.slimefun4.core.attributes.NotHopperable;
@ -12,25 +26,10 @@ import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu; import me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow; import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
/** /**
* The {@link ElectricSmeltery} is an electric version of the standard {@link Smeltery}. * The {@link ElectricSmeltery} is an electric version of the standard {@link Smeltery}.
@ -102,19 +101,6 @@ public class ElectricSmeltery extends AContainer implements NotHopperable {
} }
} }
}; };
registerBlockHandler(getId(), (p, b, tool, reason) -> {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
inv.dropItems(b.getLocation(), getInputSlots());
inv.dropItems(b.getLocation(), getOutputSlots());
}
progress.remove(b);
processing.remove(b);
return true;
});
} }
@Nonnull @Nonnull

View File

@ -18,7 +18,9 @@ import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.blocks.Vein; import io.github.thebusybiscuit.cscorelib2.blocks.Vein;
import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType;
import io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
@ -59,18 +61,24 @@ public class FluidPump extends SimpleSlimefunItem<BlockTicker> implements Invent
public FluidPump(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { public FluidPump(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe); super(category, item, recipeType, recipe);
addItemHandler(onBreak());
createPreset(this, this::constructMenu); createPreset(this, this::constructMenu);
}
registerBlockHandler(getId(), (p, b, stack, reason) -> { @Nonnull
private BlockBreakHandler onBreak() {
return new SimpleBlockBreakHandler() {
@Override
public void onBlockBreak(Block b) {
BlockMenu inv = BlockStorage.getInventory(b); BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) { if (inv != null) {
inv.dropItems(b.getLocation(), getInputSlots()); inv.dropItems(b.getLocation(), getInputSlots());
inv.dropItems(b.getLocation(), getOutputSlots()); inv.dropItems(b.getLocation(), getOutputSlots());
} }
}
return true; };
});
} }
private void constructMenu(@Nonnull BlockMenuPreset preset) { private void constructMenu(@Nonnull BlockMenuPreset preset) {

View File

@ -1,5 +1,6 @@
package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.accelerators; package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.accelerators;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
import org.bukkit.Material; import org.bukkit.Material;
@ -8,7 +9,9 @@ import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent; import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType;
import io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Lists.RecipeType;
@ -29,17 +32,23 @@ public abstract class AbstractGrowthAccelerator extends SlimefunItem implements
public AbstractGrowthAccelerator(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { public AbstractGrowthAccelerator(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe); super(category, item, recipeType, recipe);
addItemHandler(onBreak());
createPreset(this, this::constructMenu); createPreset(this, this::constructMenu);
}
registerBlockHandler(getId(), (p, b, tool, reason) -> { @Nonnull
private BlockBreakHandler onBreak() {
return new SimpleBlockBreakHandler() {
@Override
public void onBlockBreak(Block b) {
BlockMenu inv = BlockStorage.getInventory(b); BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) { if (inv != null) {
inv.dropItems(b.getLocation(), getInputSlots()); inv.dropItems(b.getLocation(), getInputSlots());
} }
}
return true; };
});
} }
private void constructMenu(BlockMenuPreset preset) { private void constructMenu(BlockMenuPreset preset) {

View File

@ -2,6 +2,9 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machine
import java.util.Iterator; import java.util.Iterator;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
@ -14,17 +17,27 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler; import io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler;
import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType; import io.github.thebusybiscuit.slimefun4.core.networks.energy.EnergyNetComponentType;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.KnowledgeFlask;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock;
import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker; import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker;
import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler;
import me.mrCookieSlime.Slimefun.api.BlockStorage; import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
/**
* The {@link ExpCollector} is a machine which picks up any nearby {@link ExperienceOrb}
* and produces a {@link KnowledgeFlask}.
*
* @author TheBusyBiscuit
*
*/
public class ExpCollector extends SlimefunItem implements InventoryBlock, EnergyNetComponent { public class ExpCollector extends SlimefunItem implements InventoryBlock, EnergyNetComponent {
private final int[] border = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }; private final int[] border = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 };
@ -32,23 +45,16 @@ public class ExpCollector extends SlimefunItem implements InventoryBlock, Energy
private static final int ENERGY_CONSUMPTION = 10; private static final int ENERGY_CONSUMPTION = 10;
private static final String DATA_KEY = "stored-exp"; private static final String DATA_KEY = "stored-exp";
@ParametersAreNonnullByDefault
public ExpCollector(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { public ExpCollector(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe); super(category, item, recipeType, recipe);
createPreset(this, this::constructMenu); createPreset(this, this::constructMenu);
addItemHandler(onPlace()); addItemHandler(onPlace(), onBreak());
registerBlockHandler(getId(), (p, b, stack, reason) -> {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
inv.dropItems(b.getLocation(), getOutputSlots());
}
return true;
});
} }
@Nonnull
private BlockPlaceHandler onPlace() { private BlockPlaceHandler onPlace() {
return new BlockPlaceHandler(false) { return new BlockPlaceHandler(false) {
@ -59,6 +65,21 @@ public class ExpCollector extends SlimefunItem implements InventoryBlock, Energy
}; };
} }
@Nonnull
private ItemHandler onBreak() {
return new SimpleBlockBreakHandler() {
@Override
public void onBlockBreak(Block b) {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
inv.dropItems(b.getLocation(), getOutputSlots());
}
}
};
}
@Override @Override
public int[] getInputSlots() { public int[] getInputSlots() {
return new int[0]; return new int[0];

View File

@ -35,6 +35,13 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
/**
* The {@link GEOMiner} is an electrical machine that allows you to obtain a {@link GEOResource}.
*
* @author TheBusyBiscuit
*
* @see GEOResource
*/
public class GEOMiner extends AContainer implements RecipeDisplayItem, HologramOwner { public class GEOMiner extends AContainer implements RecipeDisplayItem, HologramOwner {
private static final int[] BORDER = { 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 35, 36, 44, 45, 53 }; private static final int[] BORDER = { 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 35, 36, 44, 45, 53 };
@ -47,9 +54,6 @@ public class GEOMiner extends AContainer implements RecipeDisplayItem, HologramO
super(category, item, recipeType, recipe); super(category, item, recipeType, recipe);
addItemHandler(onPlace(), onBreak()); addItemHandler(onPlace(), onBreak());
// Unregister the Block handler from AContainer (Fixes #2861)
registerBlockHandler(getId(), null);
} }
@Nonnull @Nonnull

View File

@ -2571,14 +2571,14 @@ public final class SlimefunItemSetup {
} }
if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_16)) {
new StrangeNetherGoo(categories.magicalResources, SlimefunItems.STRANGE_NETHER_GOO, RecipeType.BARTER_DROP,
new ItemStack[] {null, null, null, null, new CustomItem(HeadTexture.PIGLIN_HEAD.getAsItemStack(), "&fPiglin"), null, null, null, null})
.register(plugin);
new VillagerRune(categories.magicalResources, SlimefunItems.VILLAGER_RUNE, RecipeType.ANCIENT_ALTAR, new VillagerRune(categories.magicalResources, SlimefunItems.VILLAGER_RUNE, RecipeType.ANCIENT_ALTAR,
new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.STRANGE_NETHER_GOO, SlimefunItems.FIRE_RUNE, SlimefunItems.STRANGE_NETHER_GOO, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3}, new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.STRANGE_NETHER_GOO, SlimefunItems.FIRE_RUNE, SlimefunItems.STRANGE_NETHER_GOO, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3},
new SlimefunItemStack(SlimefunItems.VILLAGER_RUNE, 3)) new SlimefunItemStack(SlimefunItems.VILLAGER_RUNE, 3))
.register(plugin); .register(plugin);
new StrangeNetherGoo(categories.magicalResources, SlimefunItems.STRANGE_NETHER_GOO, RecipeType.BARTER_DROP,
new ItemStack[] {null, null, null, null, new CustomItem(HeadTexture.PIGLIN_HEAD.getAsItemStack(), "&fPiglin"), null, null, null, null})
.register(plugin);
} }
new ElytraCap(categories.magicalArmor, SlimefunItems.ELYTRA_CAP, RecipeType.ARMOR_FORGE, new ElytraCap(categories.magicalArmor, SlimefunItems.ELYTRA_CAP, RecipeType.ARMOR_FORGE,

View File

@ -4,6 +4,7 @@ import java.util.logging.Level;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.WorldListener;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
@ -57,6 +58,9 @@ public class SlimefunStartupTask implements Runnable {
} }
} }
// Load/Unload Worlds, only after all plugins have started up. Fixes #2862
new WorldListener(this.plugin);
// Only load this Listener if the corresponding items are enabled // Only load this Listener if the corresponding items are enabled
if (isEnabled("ELEVATOR_PLATE", "GPS_ACTIVATION_DEVICE_SHARED", "GPS_ACTIVATION_DEVICE_PERSONAL")) { if (isEnabled("ELEVATOR_PLATE", "GPS_ACTIVATION_DEVICE_SHARED", "GPS_ACTIVATION_DEVICE_PERSONAL")) {
new TeleporterListener(plugin); new TeleporterListener(plugin);