Files
CatServer/patches/net/minecraft/entity/projectile/EntityTippedArrow.java.patch
2018-07-20 01:14:44 +08:00

38 lines
1.6 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();
public EntityTippedArrow(World worldIn)
{
@@ -124,6 +124,25 @@
}
}
+ // CraftBukkit start accessor methods
+ public void refreshEffects() {
+ this.dataManager.set(EntityTippedArrow.COLOR, Integer.valueOf(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, Integer.valueOf(PotionUtils.getPotionColorFromEffectList(PotionUtils.mergeEffects(this.potion, this.customPotionEffects))));
+ }
+
+ public boolean isTipped() {
+ return !(this.customPotionEffects.isEmpty() && this.potion == PotionTypes.EMPTY); // PAIL: rename
+ }
+ // CraftBukkit end
+
public int getColor()
{
return ((Integer)this.dataManager.get(COLOR)).intValue();