mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Fixed #2861
This commit is contained in:
parent
0696991ab0
commit
bef0cfb413
@ -50,6 +50,7 @@
|
||||
* Fixed #2852
|
||||
* Fixed some issues with the Book Binder
|
||||
* Fixed #2805
|
||||
* Fixed #2861
|
||||
|
||||
## Release Candidate 20 (30 Jan 2021)
|
||||
|
||||
|
@ -46,8 +46,10 @@ public class GEOMiner extends AContainer implements RecipeDisplayItem, HologramO
|
||||
public GEOMiner(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||
super(category, item, recipeType, recipe);
|
||||
|
||||
addItemHandler(onPlace());
|
||||
addItemHandler(onBreak());
|
||||
addItemHandler(onPlace(), onBreak());
|
||||
|
||||
// Unregister the Block handler from AContainer (Fixes #2861)
|
||||
registerBlockHandler(getId(), null);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
@ -936,6 +936,7 @@ public class SlimefunItem implements Placeable {
|
||||
*
|
||||
* @return Whether or not an {@link ItemHandler} was found.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public <T extends ItemHandler> boolean callItemHandler(Class<T> c, Consumer<T> callable) {
|
||||
Optional<ItemHandler> handler = itemhandlers.get(c);
|
||||
|
||||
@ -1185,7 +1186,8 @@ public class SlimefunItem implements Placeable {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Set<ItemHandler> getPublicItemHandlers(Class<? extends ItemHandler> identifier) {
|
||||
@Nonnull
|
||||
public static Set<ItemHandler> getPublicItemHandlers(@Nonnull Class<? extends ItemHandler> identifier) {
|
||||
return SlimefunPlugin.getRegistry().getPublicItemHandlers().computeIfAbsent(identifier, c -> new HashSet<>());
|
||||
}
|
||||
|
||||
@ -1200,7 +1202,7 @@ public class SlimefunItem implements Placeable {
|
||||
* The handler
|
||||
*/
|
||||
@Deprecated
|
||||
public static void registerBlockHandler(String id, me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler handler) {
|
||||
public static void registerBlockHandler(@Nonnull String id, @Nullable me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler handler) {
|
||||
SlimefunPlugin.getRegistry().getBlockHandlers().put(id, handler);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user