3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 13:00:06 +01:00

Enable support of PotionMeta on SPLASH_POTION, LINGERING_POTION and TIPPED_ARROW.

Dieser Commit ist enthalten in:
Melair 2016-03-02 17:51:36 +00:00 committet von md_5
Ursprung 31caee5a94
Commit 9056e66554
3 geänderte Dateien mit 9 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -76,6 +76,9 @@ public final class CraftItemFactory implements ItemFactory {
case LEATHER_BOOTS: case LEATHER_BOOTS:
return meta instanceof CraftMetaLeatherArmor ? meta : new CraftMetaLeatherArmor(meta); return meta instanceof CraftMetaLeatherArmor ? meta : new CraftMetaLeatherArmor(meta);
case POTION: case POTION:
case SPLASH_POTION:
case LINGERING_POTION:
case TIPPED_ARROW:
return meta instanceof CraftMetaPotion ? meta : new CraftMetaPotion(meta); return meta instanceof CraftMetaPotion ? meta : new CraftMetaPotion(meta);
case MAP: case MAP:
return meta instanceof CraftMetaMap ? meta : new CraftMetaMap(meta); return meta instanceof CraftMetaMap ? meta : new CraftMetaMap(meta);

Datei anzeigen

@ -338,6 +338,9 @@ public final class CraftItemStack extends ItemStack {
case LEATHER_BOOTS: case LEATHER_BOOTS:
return new CraftMetaLeatherArmor(item.getTag()); return new CraftMetaLeatherArmor(item.getTag());
case POTION: case POTION:
case SPLASH_POTION:
case LINGERING_POTION:
case TIPPED_ARROW:
return new CraftMetaPotion(item.getTag()); return new CraftMetaPotion(item.getTag());
case MAP: case MAP:
return new CraftMetaMap(item.getTag()); return new CraftMetaMap(item.getTag());

Datei anzeigen

@ -109,6 +109,9 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
boolean applicableTo(Material type) { boolean applicableTo(Material type) {
switch(type) { switch(type) {
case POTION: case POTION:
case SPLASH_POTION:
case LINGERING_POTION:
case TIPPED_ARROW:
return true; return true;
default: default:
return false; return false;