aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EyeOfEnder.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EyeOfEnder.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EyeOfEnder.java.patch194
1 files changed, 194 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EyeOfEnder.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EyeOfEnder.java.patch
new file mode 100644
index 0000000000..4950464192
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EyeOfEnder.java.patch
@@ -0,0 +1,194 @@
+--- a/net/minecraft/world/entity/projectile/EyeOfEnder.java
++++ b/net/minecraft/world/entity/projectile/EyeOfEnder.java
+@@ -19,24 +19,24 @@
+ public class EyeOfEnder extends Entity implements ItemSupplier {
+
+ private static final EntityDataAccessor<ItemStack> DATA_ITEM_STACK = SynchedEntityData.defineId(EyeOfEnder.class, EntityDataSerializers.ITEM_STACK);
+- private double tx;
+- private double ty;
+- private double tz;
+- private int life;
+- private boolean surviveAfterDeath;
++ public double tx;
++ public double ty;
++ public double tz;
++ public int life;
++ public boolean surviveAfterDeath;
+
+- public EyeOfEnder(EntityType<? extends EyeOfEnder> entitytype, Level level) {
+- super(entitytype, level);
++ public EyeOfEnder(EntityType<? extends EyeOfEnder> entityType, Level level) {
++ super(entityType, level);
+ }
+
+- public EyeOfEnder(Level level, double d0, double d1, double d2) {
++ public EyeOfEnder(Level level, double x, double d1, double y) {
+ this(EntityType.EYE_OF_ENDER, level);
+- this.setPos(d0, d1, d2);
++ this.setPos(x, d1, y);
+ }
+
+- public void setItem(ItemStack itemstack) {
+- if (!itemstack.is(Items.ENDER_EYE) || itemstack.hasTag()) {
+- this.getEntityData().set(EyeOfEnder.DATA_ITEM_STACK, itemstack.copyWithCount(1));
++ public void setItem(ItemStack stack) {
++ if (true || !stack.is(Items.ENDER_EYE) || stack.hasTag()) { // CraftBukkit - always allow item changing
++ this.getEntityData().set(EyeOfEnder.DATA_ITEM_STACK, stack.copyWithCount(1));
+ }
+
+ }
+@@ -46,7 +46,6 @@
+ }
+
+ @Override
+- @Override
+ public ItemStack getItem() {
+ ItemStack itemstack = this.getItemRaw();
+
+@@ -54,14 +53,12 @@
+ }
+
+ @Override
+- @Override
+ protected void defineSynchedData() {
+ this.getEntityData().define(EyeOfEnder.DATA_ITEM_STACK, ItemStack.EMPTY);
+ }
+
+ @Override
+- @Override
+- public boolean shouldRenderAtSqrDistance(double d0) {
++ public boolean shouldRenderAtSqrDistance(double distance) {
+ double d1 = this.getBoundingBox().getSize() * 4.0D;
+
+ if (Double.isNaN(d1)) {
+@@ -69,13 +66,13 @@
+ }
+
+ d1 *= 64.0D;
+- return d0 < d1 * d1;
++ return distance < d1 * d1;
+ }
+
+- public void signalTo(BlockPos blockpos) {
+- double d0 = (double) blockpos.getX();
+- int i = blockpos.getY();
+- double d1 = (double) blockpos.getZ();
++ public void signalTo(BlockPos pos) {
++ double d0 = (double) pos.getX();
++ int i = pos.getY();
++ double d1 = (double) pos.getZ();
+ double d2 = d0 - this.getX();
+ double d3 = d1 - this.getZ();
+ double d4 = Math.sqrt(d2 * d2 + d3 * d3);
+@@ -95,13 +92,12 @@
+ }
+
+ @Override
+- @Override
+- public void lerpMotion(double d0, double d1, double d2) {
+- this.setDeltaMovement(d0, d1, d2);
++ public void lerpMotion(double x, double d1, double y) {
++ this.setDeltaMovement(x, d1, y);
+ if (this.xRotO == 0.0F && this.yRotO == 0.0F) {
+- double d3 = Math.sqrt(d0 * d0 + d2 * d2);
++ double d3 = Math.sqrt(x * x + y * y);
+
+- this.setYRot((float) (Mth.atan2(d0, d2) * 57.2957763671875D));
++ this.setYRot((float) (Mth.atan2(x, y) * 57.2957763671875D));
+ this.setXRot((float) (Mth.atan2(d1, d3) * 57.2957763671875D));
+ this.yRotO = this.getYRot();
+ this.xRotO = this.getXRot();
+@@ -110,24 +106,23 @@
+ }
+
+ @Override
+- @Override
+ public void tick() {
+ super.tick();
+- Vec3 vec3 = this.getDeltaMovement();
+- double d0 = this.getX() + vec3.x;
+- double d1 = this.getY() + vec3.y;
+- double d2 = this.getZ() + vec3.z;
+- double d3 = vec3.horizontalDistance();
++ Vec3 vec3d = this.getDeltaMovement();
++ double d0 = this.getX() + vec3d.x;
++ double d1 = this.getY() + vec3d.y;
++ double d2 = this.getZ() + vec3d.z;
++ double d3 = vec3d.horizontalDistance();
+
+- this.setXRot(Projectile.lerpRotation(this.xRotO, (float) (Mth.atan2(vec3.y, d3) * 57.2957763671875D)));
+- this.setYRot(Projectile.lerpRotation(this.yRotO, (float) (Mth.atan2(vec3.x, vec3.z) * 57.2957763671875D)));
++ this.setXRot(Projectile.lerpRotation(this.xRotO, (float) (Mth.atan2(vec3d.y, d3) * 57.2957763671875D)));
++ this.setYRot(Projectile.lerpRotation(this.yRotO, (float) (Mth.atan2(vec3d.x, vec3d.z) * 57.2957763671875D)));
+ if (!this.level().isClientSide) {
+ double d4 = this.tx - d0;
+ double d5 = this.tz - d2;
+ float f = (float) Math.sqrt(d4 * d4 + d5 * d5);
+ float f1 = (float) Mth.atan2(d5, d4);
+ double d6 = Mth.lerp(0.0025D, d3, (double) f);
+- double d7 = vec3.y;
++ double d7 = vec3d.y;
+
+ if (f < 1.0F) {
+ d6 *= 0.8D;
+@@ -136,18 +131,18 @@
+
+ int i = this.getY() < this.ty ? 1 : -1;
+
+- vec3 = new Vec3(Math.cos((double) f1) * d6, d7 + ((double) i - d7) * 0.014999999664723873D, Math.sin((double) f1) * d6);
+- this.setDeltaMovement(vec3);
++ vec3d = new Vec3(Math.cos((double) f1) * d6, d7 + ((double) i - d7) * 0.014999999664723873D, Math.sin((double) f1) * d6);
++ this.setDeltaMovement(vec3d);
+ }
+
+ float f2 = 0.25F;
+
+ if (this.isInWater()) {
+ for (int j = 0; j < 4; ++j) {
+- 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);
+ }
+ } else {
+- this.level().addParticle(ParticleTypes.PORTAL, d0 - vec3.x * 0.25D + this.random.nextDouble() * 0.6D - 0.3D, d1 - vec3.y * 0.25D - 0.5D, d2 - vec3.z * 0.25D + this.random.nextDouble() * 0.6D - 0.3D, vec3.x, vec3.y, vec3.z);
++ this.level().addParticle(ParticleTypes.PORTAL, d0 - vec3d.x * 0.25D + this.random.nextDouble() * 0.6D - 0.3D, d1 - vec3d.y * 0.25D - 0.5D, d2 - vec3d.z * 0.25D + this.random.nextDouble() * 0.6D - 0.3D, vec3d.x, vec3d.y, vec3d.z);
+ }
+
+ if (!this.level().isClientSide) {
+@@ -169,32 +164,28 @@
+ }
+
+ @Override
+- @Override
+- public void addAdditionalSaveData(CompoundTag compoundtag) {
++ public void addAdditionalSaveData(CompoundTag compound) {
+ ItemStack itemstack = this.getItemRaw();
+
+ if (!itemstack.isEmpty()) {
+- compoundtag.put("Item", itemstack.save(new CompoundTag()));
++ compound.put("Item", itemstack.save(new CompoundTag()));
+ }
+
+ }
+
+ @Override
+- @Override
+- public void readAdditionalSaveData(CompoundTag compoundtag) {
+- ItemStack itemstack = ItemStack.of(compoundtag.getCompound("Item"));
++ public void readAdditionalSaveData(CompoundTag compound) {
++ ItemStack itemstack = ItemStack.of(compound.getCompound("Item"));
+
+- this.setItem(itemstack);
++ if (!itemstack.isEmpty()) this.setItem(itemstack); // CraftBukkit - SPIGOT-6103 summon, see also SPIGOT-5474
+ }
+
+ @Override
+- @Override
+ public float getLightLevelDependentMagicValue() {
+ return 1.0F;
+ }
+
+ @Override
+- @Override
+ public boolean isAttackable() {
+ return false;
+ }