Confirmedusers, editor, Administrators
886
edits
CreativeMD (talk | contribs) |
|||
Line 84: | Line 84: | ||
public class TrampolineBlock : Block | public class TrampolineBlock : Block | ||
{ | { | ||
public override void | public override void OnEntityCollide(IWorldAccessor world, Entity entity, BlockPos pos, BlockFacing facing, Vec3d collideSpeed, bool isImpact) | ||
{ | { | ||
if (isImpact && facing.Axis == EnumAxis.Y) | if (isImpact && facing.Axis == EnumAxis.Y) | ||
{ | { | ||
world.PlaySoundAt(tickSound, entity.Pos.X, entity.Pos.Y, entity.Pos.Z); | |||
entity.Pos.Motion.Y *= -0.8; | entity.Pos.Motion.Y *= -0.8; | ||
} | } | ||
Line 130: | Line 131: | ||
public AssetLocation tickSound = new AssetLocation("game", "tick"); | public AssetLocation tickSound = new AssetLocation("game", "tick"); | ||
public override void OnEntityCollide(IWorldAccessor world, Entity entity, BlockPos pos, BlockFacing facing, bool isImpact) | public override void OnEntityCollide(IWorldAccessor world, Entity entity, BlockPos pos, BlockFacing facing, Vec3d collideSpeed, bool isImpact) | ||
{ | { | ||
if (isImpact && facing.Axis == EnumAxis.Y) | if (isImpact && facing.Axis == EnumAxis.Y) |