-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[~+] Plantable Urns, Stone Frames, yada yada
- Loading branch information
1 parent
16d0d3a
commit c3a87f0
Showing
453 changed files
with
14,030 additions
and
21,963 deletions.
There are no files selected for viewing
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
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
46 changes: 46 additions & 0 deletions
46
src/main/java/com/starfish_studios/bbb/item/ChiselItem.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,46 @@ | ||
package com.starfish_studios.bbb.item; | ||
|
||
import com.starfish_studios.bbb.registry.BBBTags; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.HolderSet; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.InteractionResult; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.context.UseOnContext; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.phys.HitResult; | ||
|
||
import java.util.Optional; | ||
import java.util.Random; | ||
|
||
import static com.starfish_studios.bbb.registry.BBBTags.*; | ||
import static com.starfish_studios.bbb.registry.BBBTags.BBBBlockTags.CHISEL_STONE; | ||
|
||
public class ChiselItem extends Item { | ||
private final TagKey<Block> outputBlockTag; | ||
|
||
public ChiselItem(Properties properties, TagKey<Block> outputBlockTag) { | ||
super(properties); | ||
this.outputBlockTag = outputBlockTag; | ||
} | ||
|
||
@Override | ||
public boolean canAttackBlock(BlockState blockState, Level level, BlockPos blockPos, Player player) { | ||
return !player.isCreative(); | ||
} | ||
|
||
@Override | ||
public InteractionResult useOn(UseOnContext useOnContext) { | ||
Level level = useOnContext.getLevel(); | ||
BlockPos blockPos = useOnContext.getClickedPos(); | ||
BlockState blockState = level.getBlockState(blockPos); | ||
|
||
|
||
return InteractionResult.FAIL; | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/starfish_studios/bbb/mixin/BushBlockMixin.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,26 @@ | ||
package com.starfish_studios.bbb.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyReturnValue; | ||
import com.starfish_studios.bbb.block.UrnBlock; | ||
import com.starfish_studios.bbb.registry.BBBTags; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.BlockGetter; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.BushBlock; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(BushBlock.class) | ||
public abstract class BushBlockMixin extends Block { | ||
public BushBlockMixin(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
@ModifyReturnValue(method = "mayPlaceOn", at = @At("RETURN")) | ||
public boolean mayPlaceOn(boolean original, BlockState state, BlockGetter level, BlockPos pos) { | ||
return !original && state.getBlock() instanceof UrnBlock && state.getValue(UrnBlock.SOILED); | ||
} | ||
} |
Oops, something went wrong.