mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-17 10:24:23 +01:00
Fixed muffin jankyness
This commit is contained in:
parent
c802e7aa56
commit
22bed1ee19
1 changed files with 6 additions and 12 deletions
|
@ -132,22 +132,16 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onBlockHit(BlockHitResult hit) {
|
protected void onBlockHit(BlockHitResult hit) {
|
||||||
BlockState state = getWorld().getBlockState(hit.getBlockPos());
|
BlockPos buttonPos = hit.getBlockPos().offset(hit.getSide());
|
||||||
|
BlockState state = getWorld().getBlockState(buttonPos);
|
||||||
|
|
||||||
BlockState posState = getBlockStateAtPos();
|
|
||||||
if (state.isIn(BlockTags.WOODEN_BUTTONS) && state.getBlock() instanceof ButtonBlock button) {
|
if (state.isIn(BlockTags.WOODEN_BUTTONS) && state.getBlock() instanceof ButtonBlock button) {
|
||||||
button.powerOn(state, getWorld(), hit.getBlockPos());
|
button.powerOn(state, getWorld(), buttonPos);
|
||||||
} else if (posState.isIn(BlockTags.WOODEN_BUTTONS) && posState.getBlock() instanceof ButtonBlock button) {
|
} else if (state.getBlock() instanceof LeverBlock lever) {
|
||||||
button.powerOn(posState, getWorld(), getBlockPos());
|
lever.togglePower(state, getWorld(), buttonPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.getBlock() instanceof LeverBlock lever) {
|
BlockPos belowPos = buttonPos.down();
|
||||||
lever.togglePower(state, getWorld(), hit.getBlockPos());
|
|
||||||
} else if (posState.getBlock() instanceof LeverBlock lever) {
|
|
||||||
lever.togglePower(posState, getWorld(), getBlockPos());
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockPos belowPos = getBlockPos().down();
|
|
||||||
BlockState below = getWorld().getBlockState(belowPos);
|
BlockState below = getWorld().getBlockState(belowPos);
|
||||||
ItemStack stack = getStack();
|
ItemStack stack = getStack();
|
||||||
if (below.getBlock() instanceof HopperBlock hopper) {
|
if (below.getBlock() instanceof HopperBlock hopper) {
|
||||||
|
|
Loading…
Reference in a new issue