1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2021-03-10 00:24:05 +01:00
parent 0696991ab0
commit bef0cfb413
3 changed files with 9 additions and 4 deletions

View File

@ -50,6 +50,7 @@
* Fixed #2852
* Fixed some issues with the Book Binder
* Fixed #2805
* Fixed #2861
## Release Candidate 20 (30 Jan 2021)

View File

@ -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

View File

@ -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);
}