Added item mapping for torchflower seeds

This commit is contained in:
Intelli 2023-07-12 15:58:47 -06:00
parent b0469924a7
commit d414db1c0b
4 changed files with 48 additions and 16 deletions

View File

@ -180,4 +180,25 @@ public class BukkitAdapter implements BukkitInterface {
return 0;
}
@Override
public Material getPlantSeeds(Material material) {
switch (material) {
case WHEAT:
material = Material.WHEAT_SEEDS;
break;
case PUMPKIN_STEM:
material = Material.PUMPKIN_SEEDS;
break;
case MELON_STEM:
material = Material.MELON_SEEDS;
break;
case BEETROOTS:
material = Material.BEETROOT_SEEDS;
break;
default:
}
return material;
}
}

View File

@ -61,4 +61,6 @@ public interface BukkitInterface {
public int getColor(Sign sign, boolean isFront);
public Material getPlantSeeds(Material material);
}

View File

@ -68,4 +68,28 @@ public class Bukkit_v1_20 extends Bukkit_v1_19 implements BukkitInterface {
return sign.isWaxed();
}
@Override
public Material getPlantSeeds(Material material) {
switch (material) {
case WHEAT:
material = Material.WHEAT_SEEDS;
break;
case PUMPKIN_STEM:
material = Material.PUMPKIN_SEEDS;
break;
case MELON_STEM:
material = Material.MELON_SEEDS;
break;
case BEETROOTS:
material = Material.BEETROOT_SEEDS;
break;
case TORCHFLOWER_CROP:
material = Material.TORCHFLOWER_SEEDS;
break;
default:
}
return material;
}
}

View File

@ -1207,22 +1207,7 @@ public class Util extends Queue {
return material;
}
switch (material) {
case WHEAT:
material = Material.WHEAT_SEEDS;
break;
case PUMPKIN_STEM:
material = Material.PUMPKIN_SEEDS;
break;
case MELON_STEM:
material = Material.MELON_SEEDS;
break;
case BEETROOTS:
material = Material.BEETROOT_SEEDS;
break;
default:
}
material = BukkitAdapter.ADAPTER.getPlantSeeds(material);
if (material.name().contains("WALL_")) {
material = Material.valueOf(material.name().replace("WALL_", ""));
}