Files
CatServer/patches/net/minecraft/entity/projectile/EntityTippedArrow.java.patch
2019-02-24 22:29:41 +08:00

44 lines
1.8 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityTippedArrow.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityTippedArrow.java
@@ -26,7 +26,7 @@
{
private static final DataParameter<Integer> COLOR = EntityDataManager.<Integer>createKey(EntityTippedArrow.class, DataSerializers.VARINT);
private PotionType potion = PotionTypes.EMPTY;
- private final Set<PotionEffect> customPotionEffects = Sets.<PotionEffect>newHashSet();
+ public final Set<PotionEffect> customPotionEffects = Sets.<PotionEffect>newHashSet();
private boolean fixedColor;
public EntityTippedArrow(World worldIn)
@@ -146,12 +146,30 @@
}
}
+ // CraftBukkit start accessor methods
+ public void refreshEffects() {
+ this.getDataManager().set(EntityTippedArrow.COLOR, PotionUtils.getPotionColorFromEffectList(PotionUtils.mergeEffects(this.potion, this.customPotionEffects)));
+ }
+
+ public String getType() {
+ return PotionType.REGISTRY.getNameForObject(this.potion).toString();
+ }
+
+ public void setType(String string) {
+ this.potion = PotionType.REGISTRY.getObject(new ResourceLocation(string));
+ this.dataManager.set(EntityTippedArrow.COLOR, PotionUtils.getPotionColorFromEffectList(PotionUtils.mergeEffects(this.potion, this.customPotionEffects)));
+ }
+
+ public boolean isTipped() {
+ return !(this.customPotionEffects.isEmpty() && this.potion == PotionTypes.EMPTY);
+ }
+
public int getColor()
{
return ((Integer)this.dataManager.get(COLOR)).intValue();
}
- private void setFixedColor(int p_191507_1_)
+ public void setFixedColor(int p_191507_1_)
{
this.fixedColor = true;
this.dataManager.set(COLOR, Integer.valueOf(p_191507_1_));