-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
96 additions
and
67 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...src/main/java/org/allaymc/server/block/component/leaves/BlockLeavesBaseComponentImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.allaymc.server.block.component.leaves; | ||
|
||
import org.allaymc.api.block.BlockBehavior; | ||
import org.allaymc.api.block.data.BlockStateWithPos; | ||
import org.allaymc.api.block.type.BlockType; | ||
import org.allaymc.api.item.ItemStack; | ||
import org.allaymc.api.item.type.ItemTypes; | ||
import org.allaymc.api.utils.Utils; | ||
import org.allaymc.server.block.component.common.BlockBaseComponentImpl; | ||
|
||
/** | ||
* Allay Project 2024/7/10 | ||
* | ||
* @author daoge_cmd | ||
*/ | ||
public class BlockLeavesBaseComponentImpl extends BlockBaseComponentImpl { | ||
|
||
public BlockLeavesBaseComponentImpl(BlockType<? extends BlockBehavior> blockType) { | ||
super(blockType); | ||
} | ||
|
||
@Override | ||
public ItemStack[] getDrops(BlockStateWithPos blockState, ItemStack usedItem) { | ||
if (usedItem.getItemType() == ItemTypes.SHEARS_TYPE) { | ||
return new ItemStack[]{blockState.blockState().toItemStack()}; | ||
} | ||
// TODO: Drop saplings | ||
// https://minecraft.fandom.com/zh/wiki/%E6%A0%91%E5%8F%B6#%E8%8E%B7%E5%8F%96 | ||
return Utils.EMPTY_ITEM_STACK_ARRAY; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters