Skip to content
Merged

Dev #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ org.gradle.caching=true
org.gradle.configuration-cache=true
minecraft_version=26.1.2
minecraft_version_range=[26.1,26.2]
neo_version=26.1.2.44-beta
neo_version=26.1.2.75

## Mod Properties

mod_id=cakesticklib
mod_name=CakeStickLib
mod_license=Ora Et Labora License
mod_version=1.11
mod_version=1.11.1
mod_group_id=com.devdyna.cakestick
mod_authors=DevDyna
mod_description=A standalone port of Synergy API to unify most of the code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ default InteractionResult bucketAction(ItemStack item, BlockState blockState, Le
if (level.isClientSide())
return InteractionResult.SUCCESS;

if (FluidUtil.interactWithFluidHandler(player, hand, level, blockPos, blockHitResult.getDirection()))
if (FluidUtil.interactWithFluidHandler(player, hand, level, blockPos, blockHitResult.getDirection(),null))
return InteractionResult.SUCCESS;

return InteractionResult.PASS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.IntegerProperty;

Expand Down Expand Up @@ -54,5 +55,42 @@ public BlockState state() {
public BlockState state(Direction d) {
return level.getBlockState(pos.relative(d));
}

public Block block() {
return state().getBlock();
}

public Block block(Direction d) {
return state(d).getBlock();
}

public Context modify(BlockPos pos) {
return modify(pos, player());
}

public boolean is(BlockPos pos) {
return pos().equals(pos);
}

public boolean is(BlockState state) {
return is(state.getBlock());
}

public boolean is(Block block) {
return state().is(block);
}

public boolean is(Direction dir,Block block) {
return state(dir).is(block);
}

public Context modify(Player player) {
return modify(pos(), player);
}

public Context modify(BlockPos pos, Player player) {
return of(level(), pos, player);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ public static List<ItemStack> checkReplant(Level level, BlockPos pos, @Nullable
var ctx = Harvestable.Context.of(level, pos, player);

if (harvestable.canHarvest(ctx)) {
var items = harvestable.getItemsResult(ctx);// required to prevent to harvest AIR
harvestable.replant(ctx);
return harvestable.getItemsResult(ctx);
return items;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class LootTableHelper {
/**
* mainly useful to define valid blocks on Datagen SubLootBlocksProvider
*/
public List<Block> getValidBlocks(DeferredRegister.Blocks... blocks) {
public static List<Block> getValidBlocks(DeferredRegister.Blocks... blocks) {
List<Block> result = new ArrayList<>();
List.of(blocks).forEach(t -> result.addAll(t.getEntries()
.stream()
Expand Down
Loading