Class OwnedBlock<T extends SefiBlock<T>>
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
dev.sefiraat.sefilib.slimefun.items.SefiSlimefunItem<T>
dev.sefiraat.sefilib.slimefun.blocks.SefiBlock<T>
dev.sefiraat.sefilib.slimefun.blocks.OwnedBlock<T>
- Type Parameters:
T- The type ofSlimefunItemthat is used to create this block.
- All Implemented Interfaces:
io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
This block will, when placed, register it's placing player as its owner.
It will also check for the owner after a restart.
-
Field Summary
Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOwnedBlock(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe) Creates a newOwnedBlock.protectedOwnedBlock(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) Creates a newOwnedBlock. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterBlockPlaced(BlockPlaceEvent event) This method is called after the block is placed and after the owner is set.getOwner(io.github.bakedlibs.dough.blocks.BlockPosition blockPosition) Gets the owner of the given block.Gets the owner of the given block.getThis()Returns this objectprotected voidonBlockPlaced(BlockPlaceEvent event) This method fires when the block is placed.protected voidonTick(Block block, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem item, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config data) This method is called each time the block is ticked and should not be overridden.protected voidonTickAfterOwner(Block block, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem item, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config data) This method is called after the owner is set and should be overridden to add your own code to handle block ticking.voidSets the owner of the given block.voidSets the owner of the given block.Methods inherited from class dev.sefiraat.sefilib.slimefun.blocks.SefiBlock
isAllowAndroids, isAllowBlockPlacers, isAllowExplosions, isSync, onPlayerBreaksBlock, onPlayerRightClickBlock, onUniqueTick, preRegister, setAllowAndroids, setAllowBlockPlacers, setAllowExplosions, setSyncMethods inherited from class dev.sefiraat.sefilib.slimefun.items.SefiSlimefunItem
registerItemMethods inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addItemHandler, addItemSetting, addOfficialWikipage, callItemHandler, canUse, equals, error, getAddon, getBlockTicker, getById, getByItem, getDrops, getDrops, getHandlers, getId, getItem, getItemGroup, getItemName, getItemSetting, getItemSettings, getRecipe, getRecipeOutput, getRecipeType, getResearch, getState, getWikipage, hashCode, hasResearch, info, isDisabled, isDisabledIn, isDisenchantable, isEnchantable, isHidden, isItem, isItemStackImmutable, isTicking, isUseableInWorkbench, load, postRegister, register, sendDeprecationWarning, setHidden, setItemGroup, setRecipe, setRecipeOutput, setRecipeType, setResearch, setUseableInWorkbench, toString, warnMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreaking
-
Constructor Details
-
OwnedBlock
protected OwnedBlock(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe) Creates a newOwnedBlock.- Parameters:
itemGroup- TheItemGroupthis block belongs to.item- TheSlimefunItemStackthat is used to create this block.recipeType- TheRecipeTypeof this block.recipe- The recipe of this block.
-
OwnedBlock
protected OwnedBlock(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe, @Nullable ItemStack recipeOutput) Creates a newOwnedBlock.- Parameters:
itemGroup- TheItemGroupthis block belongs to.item- TheSlimefunItemStackthat is used to create this block.recipeType- TheRecipeTypeof this block.recipe- The recipe of this block.recipeOutput- The recipe output of this block.
-
-
Method Details
-
getThis
Returns this object -
onBlockPlaced
This method fires when the block is placed. Should not be overridden, instead useafterBlockPlaced(BlockPlaceEvent)- Overrides:
onBlockPlacedin classSefiBlock<T extends SefiBlock<T>>- Parameters:
event- TheBlockPlaceEventthat triggered this.
-
afterBlockPlaced
This method is called after the block is placed and after the owner is set. Override to add your own code to handle block placement.- Parameters:
event- TheBlockPlaceEventthat triggered this.
-
onTick
@ParametersAreNonnullByDefault protected void onTick(Block block, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem item, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config data) This method is called each time the block is ticked and should not be overridden. Instead, useonTickAfterOwner(Block, SlimefunItem, Config) -
onTickAfterOwner
@ParametersAreNonnullByDefault protected void onTickAfterOwner(Block block, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem item, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config data) This method is called after the owner is set and should be overridden to add your own code to handle block ticking.- Parameters:
block- TheBlockthat is being ticked.item- TheSlimefunItemthat is being ticked.data- TheConfigfrom BlockStorage
-
getOwner
Gets the owner of the given block.- Parameters:
block- TheBlockthat is being checked.- Returns:
- The owner of the block.
-
getOwner
@Nullable public OfflinePlayer getOwner(@Nonnull io.github.bakedlibs.dough.blocks.BlockPosition blockPosition) Gets the owner of the given block.- Parameters:
blockPosition- TheBlockPositionof the block that is being checked.- Returns:
- The owner of the block.
-
setOwner
Sets the owner of the given block. -
setOwner
public void setOwner(@Nonnull io.github.bakedlibs.dough.blocks.BlockPosition blockPosition, @Nonnull Player player) Sets the owner of the given block.- Parameters:
blockPosition- TheBlockPositionof the block that to set the owner of.player- ThePlayerthat is being set as the owner.
-