#1209: Clean up various patches

By: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
This commit is contained in:
CraftBukkit/Spigot
2023-06-24 17:15:05 +10:00
parent 0f9e7a497e
commit b97cc9b99f
71 changed files with 662 additions and 719 deletions

View File

@@ -13,30 +13,25 @@
public class EntityAreaEffectCloud extends Entity implements TraceableEntity {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -129,6 +135,22 @@
@@ -44,7 +50,7 @@
private static final float DEFAULT_RADIUS = 3.0F;
public static final float DEFAULT_WIDTH = 6.0F;
public static final float HEIGHT = 0.5F;
- private PotionRegistry potion;
+ public PotionRegistry potion; // CraftBukkit - private -> public
public List<MobEffect> effects;
private final Map<Entity, Integer> victims;
private int duration;
@@ -112,7 +118,7 @@
}
+ // CraftBukkit start accessor methods
+ public void refreshEffects() {
+ if (!this.fixedColor) {
+ this.getEntityData().set(EntityAreaEffectCloud.DATA_COLOR, PotionUtil.getColor((Collection) PotionUtil.getAllEffects(this.potion, this.effects)));
+ }
+ }
+
+ public String getPotionType() {
+ return ((MinecraftKey) BuiltInRegistries.POTION.getKey(this.potion)).toString();
+ }
+
+ public void setPotionType(String string) {
+ setPotion(BuiltInRegistries.POTION.get(new MinecraftKey(string)));
+ }
+ // CraftBukkit end
+
public int getColor() {
return (Integer) this.getEntityData().get(EntityAreaEffectCloud.DATA_COLOR);
}
@@ -263,6 +285,7 @@
- private void updateColor() {
+ public void updateColor() { // Craftbukkit - private -> public
if (this.potion == Potions.EMPTY && this.effects.isEmpty()) {
this.getEntityData().set(EntityAreaEffectCloud.DATA_COLOR, 0);
} else {
@@ -263,6 +269,7 @@
if (!list1.isEmpty()) {
Iterator iterator1 = list1.iterator();
@@ -44,7 +39,7 @@
while (iterator1.hasNext()) {
EntityLiving entityliving = (EntityLiving) iterator1.next();
@@ -272,6 +295,17 @@
@@ -272,6 +279,17 @@
double d8 = d6 * d6 + d7 * d7;
if (d8 <= (double) (f * f)) {
@@ -62,7 +57,7 @@
this.victims.put(entityliving, this.tickCount + this.reapplicationDelay);
Iterator iterator2 = list.iterator();
@@ -281,7 +315,7 @@
@@ -281,7 +299,7 @@
if (mobeffect1.getEffect().isInstantenous()) {
mobeffect1.getEffect().applyInstantenousEffect(this, this.getOwner(), entityliving, mobeffect1.getAmplifier(), 0.5D);
} else {