aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrownTrident.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrownTrident.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrownTrident.java.patch211
1 files changed, 211 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrownTrident.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrownTrident.java.patch
new file mode 100644
index 0000000000..d5898ab3fb
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/ThrownTrident.java.patch
@@ -0,0 +1,211 @@
+--- a/net/minecraft/world/entity/projectile/ThrownTrident.java
++++ b/net/minecraft/world/entity/projectile/ThrownTrident.java
+@@ -32,18 +32,17 @@
+ private boolean dealtDamage;
+ public int clientSideReturnTridentTickCount;
+
+- public ThrownTrident(EntityType<? extends ThrownTrident> entitytype, Level level) {
+- super(entitytype, level, ThrownTrident.DEFAULT_ARROW_STACK);
++ public ThrownTrident(EntityType<? extends ThrownTrident> entityType, Level level) {
++ super(entityType, level, ThrownTrident.DEFAULT_ARROW_STACK);
+ }
+
+- public ThrownTrident(Level level, LivingEntity livingentity, ItemStack itemstack) {
+- super(EntityType.TRIDENT, livingentity, level, itemstack);
+- this.entityData.set(ThrownTrident.ID_LOYALTY, (byte) EnchantmentHelper.getLoyalty(itemstack));
+- this.entityData.set(ThrownTrident.ID_FOIL, itemstack.hasFoil());
++ public ThrownTrident(Level level, LivingEntity shooter, ItemStack stack) {
++ super(EntityType.TRIDENT, shooter, level, stack);
++ this.entityData.set(ThrownTrident.ID_LOYALTY, (byte) EnchantmentHelper.getLoyalty(stack));
++ this.entityData.set(ThrownTrident.ID_FOIL, stack.hasFoil());
+ }
+
+ @Override
+- @Override
+ protected void defineSynchedData() {
+ super.defineSynchedData();
+ this.entityData.define(ThrownTrident.ID_LOYALTY, (byte) 0);
+@@ -51,7 +50,6 @@
+ }
+
+ @Override
+- @Override
+ public void tick() {
+ if (this.inGroundTime > 4) {
+ this.dealtDamage = true;
+@@ -69,16 +67,16 @@
+ this.discard();
+ } else {
+ this.setNoPhysics(true);
+- Vec3 vec3 = entity.getEyePosition().subtract(this.position());
++ Vec3 vec3d = entity.getEyePosition().subtract(this.position());
+
+- this.setPosRaw(this.getX(), this.getY() + vec3.y * 0.015D * (double) b0, this.getZ());
++ this.setPosRaw(this.getX(), this.getY() + vec3d.y * 0.015D * (double) b0, this.getZ());
+ if (this.level().isClientSide) {
+ this.yOld = this.getY();
+ }
+
+ double d0 = 0.05D * (double) b0;
+
+- this.setDeltaMovement(this.getDeltaMovement().scale(0.95D).add(vec3.normalize().scale(d0)));
++ this.setDeltaMovement(this.getDeltaMovement().scale(0.95D).add(vec3d.normalize().scale(d0)));
+ if (this.clientSideReturnTridentTickCount == 0) {
+ this.playSound(SoundEvents.TRIDENT_RETURN, 10.0F, 1.0F);
+ }
+@@ -102,28 +100,26 @@
+
+ @Nullable
+ @Override
+- @Override
+- protected EntityHitResult findHitEntity(Vec3 vec3, Vec3 vec31) {
+- return this.dealtDamage ? null : super.findHitEntity(vec3, vec31);
++ protected EntityHitResult findHitEntity(Vec3 startVec, Vec3 endVec) {
++ return this.dealtDamage ? null : super.findHitEntity(startVec, endVec);
+ }
+
+ @Override
+- @Override
+- protected void onHitEntity(EntityHitResult entityhitresult) {
+- Entity entity = entityhitresult.getEntity();
++ protected void onHitEntity(EntityHitResult result) {
++ Entity entity = result.getEntity();
+ float f = 8.0F;
+
+ if (entity instanceof LivingEntity) {
+- LivingEntity livingentity = (LivingEntity) entity;
++ LivingEntity entityliving = (LivingEntity) entity;
+
+- f += EnchantmentHelper.getDamageBonus(this.getPickupItemStackOrigin(), livingentity.getMobType());
++ f += EnchantmentHelper.getDamageBonus(this.getPickupItemStackOrigin(), entityliving.getMobType());
+ }
+
+ Entity entity1 = this.getOwner();
+ DamageSource damagesource = this.damageSources().trident(this, (Entity) (entity1 == null ? this : entity1));
+
+ this.dealtDamage = true;
+- SoundEvent soundevent = SoundEvents.TRIDENT_HIT;
++ SoundEvent soundeffect = SoundEvents.TRIDENT_HIT;
+
+ if (entity.hurt(damagesource, f)) {
+ if (entity.getType() == EntityType.ENDERMAN) {
+@@ -131,14 +127,14 @@
+ }
+
+ if (entity instanceof LivingEntity) {
+- LivingEntity livingentity1 = (LivingEntity) entity;
++ LivingEntity entityliving1 = (LivingEntity) entity;
+
+ if (entity1 instanceof LivingEntity) {
+- EnchantmentHelper.doPostHurtEffects(livingentity1, entity1);
+- EnchantmentHelper.doPostDamageEffects((LivingEntity) entity1, livingentity1);
++ EnchantmentHelper.doPostHurtEffects(entityliving1, entity1);
++ EnchantmentHelper.doPostDamageEffects((LivingEntity) entity1, entityliving1);
+ }
+
+- this.doPostHurtEffects(livingentity1);
++ this.doPostHurtEffects(entityliving1);
+ }
+ } else if (entity.getType().is(EntityTypeTags.DEFLECTS_TRIDENTS)) {
+ this.deflect();
+@@ -149,22 +145,22 @@
+ float f1 = 1.0F;
+
+ if (this.level() instanceof ServerLevel && this.level().isThundering() && this.isChanneling()) {
+- BlockPos blockpos = entity.blockPosition();
++ BlockPos blockposition = entity.blockPosition();
+
+- if (this.level().canSeeSky(blockpos)) {
+- LightningBolt lightningbolt = (LightningBolt) EntityType.LIGHTNING_BOLT.create(this.level());
++ if (this.level().canSeeSky(blockposition)) {
++ LightningBolt entitylightning = (LightningBolt) EntityType.LIGHTNING_BOLT.create(this.level());
+
+- if (lightningbolt != null) {
+- lightningbolt.moveTo(Vec3.atBottomCenterOf(blockpos));
+- lightningbolt.setCause(entity1 instanceof ServerPlayer ? (ServerPlayer) entity1 : null);
+- this.level().addFreshEntity(lightningbolt);
+- soundevent = SoundEvents.TRIDENT_THUNDER;
++ if (entitylightning != null) {
++ entitylightning.moveTo(Vec3.atBottomCenterOf(blockposition));
++ entitylightning.setCause(entity1 instanceof ServerPlayer ? (ServerPlayer) entity1 : null);
++ ((ServerLevel) this.level()).strikeLightning(entitylightning, org.bukkit.event.weather.LightningStrikeEvent.Cause.TRIDENT); // CraftBukkit
++ soundeffect = SoundEvents.TRIDENT_THUNDER;
+ f1 = 5.0F;
+ }
+ }
+ }
+
+- this.playSound(soundevent, f1, 1.0F);
++ this.playSound(soundeffect, f1, 1.0F);
+ }
+
+ public boolean isChanneling() {
+@@ -172,43 +168,37 @@
+ }
+
+ @Override
+- @Override
+ protected boolean tryPickup(Player player) {
+ return super.tryPickup(player) || this.isNoPhysics() && this.ownedBy(player) && player.getInventory().add(this.getPickupItem());
+ }
+
+ @Override
+- @Override
+ protected SoundEvent getDefaultHitGroundSoundEvent() {
+ return SoundEvents.TRIDENT_HIT_GROUND;
+ }
+
+ @Override
+- @Override
+- public void playerTouch(Player player) {
+- if (this.ownedBy(player) || this.getOwner() == null) {
+- super.playerTouch(player);
++ public void playerTouch(Player entity) {
++ if (this.ownedBy(entity) || this.getOwner() == null) {
++ super.playerTouch(entity);
+ }
+
+ }
+
+ @Override
+- @Override
+- public void readAdditionalSaveData(CompoundTag compoundtag) {
+- super.readAdditionalSaveData(compoundtag);
+- this.dealtDamage = compoundtag.getBoolean("DealtDamage");
++ public void readAdditionalSaveData(CompoundTag compound) {
++ super.readAdditionalSaveData(compound);
++ this.dealtDamage = compound.getBoolean("DealtDamage");
+ this.entityData.set(ThrownTrident.ID_LOYALTY, (byte) EnchantmentHelper.getLoyalty(this.getPickupItemStackOrigin()));
+ }
+
+ @Override
+- @Override
+- public void addAdditionalSaveData(CompoundTag compoundtag) {
+- super.addAdditionalSaveData(compoundtag);
+- compoundtag.putBoolean("DealtDamage", this.dealtDamage);
++ public void addAdditionalSaveData(CompoundTag compound) {
++ super.addAdditionalSaveData(compound);
++ compound.putBoolean("DealtDamage", this.dealtDamage);
+ }
+
+ @Override
+- @Override
+ public void tickDespawn() {
+ byte b0 = (Byte) this.entityData.get(ThrownTrident.ID_LOYALTY);
+
+@@ -219,14 +209,12 @@
+ }
+
+ @Override
+- @Override
+ protected float getWaterInertia() {
+ return 0.99F;
+ }
+
+ @Override
+- @Override
+- public boolean shouldRender(double d0, double d1, double d2) {
++ public boolean shouldRender(double x, double d1, double y) {
+ return true;
+ }
+ }