Update to Minecraft 1.21

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-06-14 01:05:00 +10:00
parent 7c6204e1a9
commit eed041d629
255 changed files with 3585 additions and 3261 deletions

View File

@@ -21,6 +21,7 @@ import net.minecraft.world.entity.projectile.EntityTippedArrow;
import net.minecraft.world.entity.projectile.IProjectile;
import net.minecraft.world.level.block.BlockDispenser;
import net.minecraft.world.level.block.entity.TileEntityDispenser;
import net.minecraft.world.phys.Vec3D;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -90,12 +91,12 @@ public class CraftBlockProjectileSource implements BlockProjectileSource {
}
} else if (AbstractArrow.class.isAssignableFrom(projectile)) {
if (TippedArrow.class.isAssignableFrom(projectile)) {
launch = new EntityTippedArrow(world, iposition.x(), iposition.y(), iposition.z(), new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.ARROW));
launch = new EntityTippedArrow(world, iposition.x(), iposition.y(), iposition.z(), new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.ARROW), null);
((Arrow) launch.getBukkitEntity()).setBasePotionType(PotionType.WATER);
} else if (SpectralArrow.class.isAssignableFrom(projectile)) {
launch = new EntitySpectralArrow(world, iposition.x(), iposition.y(), iposition.z(), new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.SPECTRAL_ARROW));
launch = new EntitySpectralArrow(world, iposition.x(), iposition.y(), iposition.z(), new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.SPECTRAL_ARROW), null);
} else {
launch = new EntityTippedArrow(world, iposition.x(), iposition.y(), iposition.z(), new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.ARROW));
launch = new EntityTippedArrow(world, iposition.x(), iposition.y(), iposition.z(), new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.ARROW), null);
}
((EntityArrow) launch).pickup = EntityArrow.PickupStatus.ALLOWED;
((EntityArrow) launch).projectileSource = this;
@@ -109,23 +110,17 @@ public class CraftBlockProjectileSource implements BlockProjectileSource {
double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getStepZ();
if (SmallFireball.class.isAssignableFrom(projectile)) {
launch = new EntitySmallFireball(world, null, d0, d1, d2);
launch = new EntitySmallFireball(world, null, new Vec3D(d0, d1, d2));
} else if (WitherSkull.class.isAssignableFrom(projectile)) {
launch = EntityTypes.WITHER_SKULL.create(world);
launch.setPos(d0, d1, d2);
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
((EntityFireball) launch).xPower = d3 / d6 * 0.1D;
((EntityFireball) launch).yPower = d4 / d6 * 0.1D;
((EntityFireball) launch).zPower = d5 / d6 * 0.1D;
((EntityFireball) launch).assignDirectionalMovement(new Vec3D(d3, d4, d5), 0.1D);
} else {
launch = EntityTypes.FIREBALL.create(world);
launch.setPos(d0, d1, d2);
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
((EntityFireball) launch).xPower = d3 / d6 * 0.1D;
((EntityFireball) launch).yPower = d4 / d6 * 0.1D;
((EntityFireball) launch).zPower = d5 / d6 * 0.1D;
((EntityFireball) launch).assignDirectionalMovement(new Vec3D(d3, d4, d5), 0.1D);
}
((EntityFireball) launch).projectileSource = this;