mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-28 09:48:34 +01:00
Compare commits
3 commits
99e166337b
...
a841121dde
Author | SHA1 | Date | |
---|---|---|---|
|
a841121dde | ||
|
fbdfc2e845 | ||
|
5ce4f9a73c |
9 changed files with 9 additions and 10 deletions
|
@ -64,7 +64,7 @@ public class BlockAtomicReconstructor extends FullyDirectionalBlock.Container im
|
||||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||||
ItemStack heldItem = player.getItemInHand(hand);
|
ItemStack heldItem = player.getItemInHand(hand);
|
||||||
if (this.tryToggleRedstone(world, pos, player)) {
|
if (this.tryToggleRedstone(world, pos, player)) {
|
||||||
return InteractionResult.CONSUME;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
TileEntityAtomicReconstructor reconstructor = (TileEntityAtomicReconstructor) world.getBlockEntity(pos);
|
TileEntityAtomicReconstructor reconstructor = (TileEntityAtomicReconstructor) world.getBlockEntity(pos);
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class BlockBreaker extends FullyDirectionalBlock.Container {
|
||||||
@Override
|
@Override
|
||||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
|
||||||
if (this.tryToggleRedstone(world, pos, player)) {
|
if (this.tryToggleRedstone(world, pos, player)) {
|
||||||
return InteractionResult.CONSUME;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.openGui(world, player, pos, TileEntityBreaker.class);
|
return this.openGui(world, player, pos, TileEntityBreaker.class);
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class BlockDisplayStand extends BlockContainerBase {
|
||||||
heldItem.shrink(1);
|
heldItem.shrink(1);
|
||||||
else
|
else
|
||||||
player.swing(hand, true);
|
player.swing(hand, true);
|
||||||
return InteractionResult.CONSUME;
|
return InteractionResult.SUCCESS;
|
||||||
} else if (ItemUtil.canBeStacked(heldItem, stackThere)) {
|
} else if (ItemUtil.canBeStacked(heldItem, stackThere)) {
|
||||||
int maxTransfer = Math.min(stackThere.getCount(), heldItem.getMaxStackSize() - heldItem.getCount());
|
int maxTransfer = Math.min(stackThere.getCount(), heldItem.getMaxStackSize() - heldItem.getCount());
|
||||||
if (maxTransfer > 0) {
|
if (maxTransfer > 0) {
|
||||||
|
@ -87,7 +87,7 @@ public class BlockDisplayStand extends BlockContainerBase {
|
||||||
ItemStack newStackThere = stackThere.copy();
|
ItemStack newStackThere = stackThere.copy();
|
||||||
newStackThere.shrink(maxTransfer);
|
newStackThere.shrink(maxTransfer);
|
||||||
stand.inv.setStackInSlot(0, newStackThere);
|
stand.inv.setStackInSlot(0, newStackThere);
|
||||||
return InteractionResult.CONSUME;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class BlockDropper extends FullyDirectionalBlock.Container {
|
||||||
@Override
|
@Override
|
||||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||||
if (this.tryToggleRedstone(world, pos, player)) {
|
if (this.tryToggleRedstone(world, pos, player)) {
|
||||||
return InteractionResult.CONSUME;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.openGui(world, player, pos, TileEntityDropper.class);
|
return this.openGui(world, player, pos, TileEntityDropper.class);
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class BlockFireworkBox extends BlockContainerBase {
|
||||||
@Override
|
@Override
|
||||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
|
||||||
if (this.tryToggleRedstone(world, pos, player)) {
|
if (this.tryToggleRedstone(world, pos, player)) {
|
||||||
return InteractionResult.PASS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.openGui(world, player, pos, TileEntityFireworkBox.class);
|
return this.openGui(world, player, pos, TileEntityFireworkBox.class);
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class BlockLongRangeBreaker extends FullyDirectionalBlock.Container {
|
||||||
@Override
|
@Override
|
||||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
|
||||||
if (this.tryToggleRedstone(world, pos, player)) {
|
if (this.tryToggleRedstone(world, pos, player)) {
|
||||||
return InteractionResult.PASS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.openGui(world, player, pos, TileEntityLongRangeBreaker.class);
|
return this.openGui(world, player, pos, TileEntityLongRangeBreaker.class);
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class BlockRangedCollector extends BlockContainerBase {
|
||||||
@Override
|
@Override
|
||||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
|
||||||
if (this.tryToggleRedstone(world, pos, player)) {
|
if (this.tryToggleRedstone(world, pos, player)) {
|
||||||
return InteractionResult.PASS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.openGui(world, player, pos, TileEntityRangedCollector.class);
|
return this.openGui(world, player, pos, TileEntityRangedCollector.class);
|
||||||
|
|
|
@ -59,7 +59,6 @@ public class CommonEvents {
|
||||||
event.setUseItem(Event.Result.DENY);
|
event.setUseItem(Event.Result.DENY);
|
||||||
event.setUseBlock(Event.Result.ALLOW);
|
event.setUseBlock(Event.Result.ALLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"credit": "Made with Blockbench",
|
"credit": "Made with Blockbench",
|
||||||
"textures": {
|
"textures": {
|
||||||
"base": "actuallyadditions:block/base_texture",
|
"base": "actuallyadditions:block/base_texture",
|
||||||
"back": "actuallyadditions:block/farmer_side",
|
"back": "actuallyadditions:block/firework_box_side",
|
||||||
"particle": "actuallyadditions:block/firework_box_side",
|
"particle": "actuallyadditions:block/firework_box_side",
|
||||||
"side": "actuallyadditions:block/firework_box_side",
|
"side": "actuallyadditions:block/firework_box_side",
|
||||||
"top": "actuallyadditions:block/firework_box_top"
|
"top": "actuallyadditions:block/firework_box_top"
|
||||||
|
|
Loading…
Reference in a new issue