Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 75faba7fde
commit b3a8254758
619 changed files with 10708 additions and 8451 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/EntityAreaEffectCloud.java
+++ b/net/minecraft/world/entity/EntityAreaEffectCloud.java
@@ -33,6 +33,12 @@
@@ -32,6 +32,12 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -13,19 +13,19 @@
public class EntityAreaEffectCloud extends Entity {
private static final Logger LOGGER = LogManager.getLogger();
@@ -124,6 +130,22 @@
@@ -127,6 +133,22 @@
}
+ // CraftBukkit start accessor methods
+ public void refreshEffects() {
+ if (!this.hasColor) {
+ this.getDataWatcher().set(EntityAreaEffectCloud.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))); // PAIL: rename
+ if (!this.fixedColor) {
+ this.getDataWatcher().set(EntityAreaEffectCloud.DATA_COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potion, (Collection) this.effects))); // PAIL: rename
+ }
+ }
+
+ public String getType() {
+ return ((MinecraftKey) IRegistry.POTION.getKey(this.potionRegistry)).toString();
+ return ((MinecraftKey) IRegistry.POTION.getKey(this.potion)).toString();
+ }
+
+ public void setType(String string) {
@@ -34,20 +34,20 @@
+ // CraftBukkit end
+
public int getColor() {
return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.COLOR);
return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.DATA_COLOR);
}
@@ -268,6 +290,7 @@
@@ -259,6 +281,7 @@
if (!list1.isEmpty()) {
Iterator iterator2 = list1.iterator();
Iterator iterator1 = list1.iterator();
+ List<LivingEntity> entities = new java.util.ArrayList<LivingEntity>(); // CraftBukkit
while (iterator2.hasNext()) {
EntityLiving entityliving = (EntityLiving) iterator2.next();
while (iterator1.hasNext()) {
EntityLiving entityliving = (EntityLiving) iterator1.next();
@@ -277,6 +300,17 @@
double d2 = d0 * d0 + d1 * d1;
@@ -268,6 +291,17 @@
double d8 = d6 * d6 + d7 * d7;
if (d2 <= (double) (f * f)) {
if (d8 <= (double) (f * f)) {
+ // CraftBukkit start
+ entities.add((LivingEntity) entityliving.getBukkitEntity());
+ }
@@ -59,15 +59,15 @@
+ if (entity instanceof CraftLivingEntity) {
+ EntityLiving entityliving = ((CraftLivingEntity) entity).getHandle();
+ // CraftBukkit end
this.affectedEntities.put(entityliving, this.ticksLived + this.reapplicationDelay);
Iterator iterator3 = list.iterator();
this.victims.put(entityliving, this.tickCount + this.reapplicationDelay);
Iterator iterator2 = list.iterator();
@@ -286,7 +320,7 @@
@@ -277,7 +311,7 @@
if (mobeffect1.getMobEffect().isInstant()) {
mobeffect1.getMobEffect().applyInstantEffect(this, this.getSource(), entityliving, mobeffect1.getAmplifier(), 0.5D);
} else {
- entityliving.addEffect(new MobEffect(mobeffect1));
+ entityliving.addEffect(new MobEffect(mobeffect1), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.AREA_EFFECT_CLOUD); // CraftBukkit
- entityliving.addEffect(new MobEffect(mobeffect1), this);
+ entityliving.addEffect(new MobEffect(mobeffect1), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.AREA_EFFECT_CLOUD); // CraftBukkit
}
}