mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 11:36:43 +01:00
Muffins should bounce off of entities
This commit is contained in:
parent
c84a38cefb
commit
e0f6ab8937
1 changed files with 12 additions and 0 deletions
|
@ -20,6 +20,7 @@ import net.minecraft.sound.SoundCategory;
|
|||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.EntityHitResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.GameRules;
|
||||
|
@ -86,6 +87,17 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEntityHit(EntityHitResult hit) {
|
||||
if (isBouncy()) {
|
||||
setVelocity(getVelocity().multiply(-0.1, -0.3, -0.1));
|
||||
setYaw(getYaw() + 180);
|
||||
prevYaw += 180;
|
||||
return;
|
||||
}
|
||||
super.onEntityHit(hit);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBlockHit(BlockHitResult hit) {
|
||||
BlockState state = world.getBlockState(hit.getBlockPos());
|
||||
|
|
Loading…
Reference in a new issue