diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrowableProjectile.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrowableProjectile.java.patch | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrowableProjectile.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrowableProjectile.java.patch new file mode 100644 index 0000000000..8a80fdc246 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrowableProjectile.java.patch @@ -0,0 +1,128 @@ +--- a/net/minecraft/world/entity/projectile/ThrowableProjectile.java ++++ b/net/minecraft/world/entity/projectile/ThrowableProjectile.java +@@ -8,30 +8,29 @@ + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.entity.BlockEntity; + import net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.phys.BlockHitResult; + import net.minecraft.world.phys.HitResult; + import net.minecraft.world.phys.Vec3; + + public abstract class ThrowableProjectile extends Projectile { + +- protected ThrowableProjectile(EntityType<? extends ThrowableProjectile> entitytype, Level level) { +- super(entitytype, level); ++ protected ThrowableProjectile(EntityType<? extends ThrowableProjectile> entityType, Level level) { ++ super(entityType, level); + } + +- protected ThrowableProjectile(EntityType<? extends ThrowableProjectile> entitytype, double d0, double d1, double d2, Level level) { +- this(entitytype, level); +- this.setPos(d0, d1, d2); ++ protected ThrowableProjectile(EntityType<? extends ThrowableProjectile> entityType, double x, double d1, double y, Level world) { ++ this(entityType, world); ++ this.setPos(x, d1, y); + } + +- protected ThrowableProjectile(EntityType<? extends ThrowableProjectile> entitytype, LivingEntity livingentity, Level level) { +- this(entitytype, livingentity.getX(), livingentity.getEyeY() - 0.10000000149011612D, livingentity.getZ(), level); +- this.setOwner(livingentity); ++ protected ThrowableProjectile(EntityType<? extends ThrowableProjectile> entityType, LivingEntity shooter, Level level) { ++ this(entityType, shooter.getX(), shooter.getEyeY() - 0.10000000149011612D, shooter.getZ(), level); ++ this.setOwner(shooter); + } + + @Override +- @Override +- public boolean shouldRenderAtSqrDistance(double d0) { ++ public boolean shouldRenderAtSqrDistance(double distance) { + double d1 = this.getBoundingBox().getSize() * 4.0D; + + if (Double.isNaN(d1)) { +@@ -39,43 +38,42 @@ + } + + d1 *= 64.0D; +- return d0 < d1 * d1; ++ return distance < d1 * d1; + } + + @Override +- @Override + public void tick() { + super.tick(); +- HitResult hitresult = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity); ++ HitResult movingobjectposition = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity); + boolean flag = false; + +- if (hitresult.getType() == HitResult.Type.BLOCK) { +- BlockPos blockpos = ((BlockHitResult) hitresult).getBlockPos(); +- BlockState blockstate = this.level().getBlockState(blockpos); ++ if (movingobjectposition.getType() == HitResult.EnumMovingObjectType.BLOCK) { ++ BlockPos blockposition = ((BlockHitResult) movingobjectposition).getBlockPos(); ++ IBlockData iblockdata = this.level().getBlockState(blockposition); + +- if (blockstate.is(Blocks.NETHER_PORTAL)) { +- this.handleInsidePortal(blockpos); ++ if (iblockdata.is(Blocks.NETHER_PORTAL)) { ++ this.handleInsidePortal(blockposition); + flag = true; +- } else if (blockstate.is(Blocks.END_GATEWAY)) { +- BlockEntity blockentity = this.level().getBlockEntity(blockpos); ++ } else if (iblockdata.is(Blocks.END_GATEWAY)) { ++ BlockEntity tileentity = this.level().getBlockEntity(blockposition); + +- if (blockentity instanceof TheEndGatewayBlockEntity && TheEndGatewayBlockEntity.canEntityTeleport(this)) { +- TheEndGatewayBlockEntity.teleportEntity(this.level(), blockpos, blockstate, this, (TheEndGatewayBlockEntity) blockentity); ++ if (tileentity instanceof TheEndGatewayBlockEntity && TheEndGatewayBlockEntity.canEntityTeleport(this)) { ++ TheEndGatewayBlockEntity.teleportEntity(this.level(), blockposition, iblockdata, this, (TheEndGatewayBlockEntity) tileentity); + } + + flag = true; + } + } + +- if (hitresult.getType() != HitResult.Type.MISS && !flag) { +- this.onHit(hitresult); ++ if (movingobjectposition.getType() != HitResult.EnumMovingObjectType.MISS && !flag) { ++ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event + } + + this.checkInsideBlocks(); +- Vec3 vec3 = this.getDeltaMovement(); +- double d0 = this.getX() + vec3.x; +- double d1 = this.getY() + vec3.y; +- double d2 = this.getZ() + vec3.z; ++ Vec3 vec3d = this.getDeltaMovement(); ++ double d0 = this.getX() + vec3d.x; ++ double d1 = this.getY() + vec3d.y; ++ double d2 = this.getZ() + vec3d.z; + + this.updateRotation(); + float f; +@@ -84,7 +82,7 @@ + for (int i = 0; i < 4; ++i) { + float f1 = 0.25F; + +- this.level().addParticle(ParticleTypes.BUBBLE, d0 - vec3.x * 0.25D, d1 - vec3.y * 0.25D, d2 - vec3.z * 0.25D, vec3.x, vec3.y, vec3.z); ++ this.level().addParticle(ParticleTypes.BUBBLE, d0 - vec3d.x * 0.25D, d1 - vec3d.y * 0.25D, d2 - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z); + } + + f = 0.8F; +@@ -92,11 +90,11 @@ + f = 0.99F; + } + +- this.setDeltaMovement(vec3.scale((double) f)); ++ this.setDeltaMovement(vec3d.scale((double) f)); + if (!this.isNoGravity()) { +- Vec3 vec31 = this.getDeltaMovement(); ++ Vec3 vec3d1 = this.getDeltaMovement(); + +- this.setDeltaMovement(vec31.x, vec31.y - (double) this.getGravity(), vec31.z); ++ this.setDeltaMovement(vec3d1.x, vec3d1.y - (double) this.getGravity(), vec3d1.z); + } + + this.setPos(d0, d1, d2); |