mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 17:47:34 +01:00
Throw meaningful warnings when wrong Essentials version is used with unsupported mod packs.
This commit is contained in:
parent
82be7546d5
commit
53b1526906
@ -158,10 +158,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
|
|||||||
final int versionNumber = Integer.parseInt(versionMatch.group(1));
|
final int versionNumber = Integer.parseInt(versionMatch.group(1));
|
||||||
if (versionNumber < BUKKIT_VERSION && versionNumber > 100)
|
if (versionNumber < BUKKIT_VERSION && versionNumber > 100)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
|
wrongVersion();
|
||||||
LOGGER.log(Level.SEVERE, _("notRecommendedBukkit"));
|
|
||||||
LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION)));
|
|
||||||
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
|
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -570,6 +567,14 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public void wrongVersion()
|
||||||
|
{
|
||||||
|
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
|
||||||
|
LOGGER.log(Level.SEVERE, _("notRecommendedBukkit"));
|
||||||
|
LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION)));
|
||||||
|
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BukkitScheduler getScheduler()
|
public BukkitScheduler getScheduler()
|
||||||
{
|
{
|
||||||
|
@ -100,6 +100,9 @@ public class Potions
|
|||||||
POTIONS.put("wither", PotionEffectType.WITHER);
|
POTIONS.put("wither", PotionEffectType.WITHER);
|
||||||
ALIASPOTIONS.put("decay", PotionEffectType.WITHER);
|
ALIASPOTIONS.put("decay", PotionEffectType.WITHER);
|
||||||
|
|
||||||
|
|
||||||
|
try // 1.6 update
|
||||||
|
{
|
||||||
POTIONS.put("healthboost", PotionEffectType.HEALTH_BOOST);
|
POTIONS.put("healthboost", PotionEffectType.HEALTH_BOOST);
|
||||||
ALIASPOTIONS.put("boost", PotionEffectType.HEALTH_BOOST);
|
ALIASPOTIONS.put("boost", PotionEffectType.HEALTH_BOOST);
|
||||||
|
|
||||||
@ -109,6 +112,11 @@ public class Potions
|
|||||||
POTIONS.put("saturation", PotionEffectType.SATURATION);
|
POTIONS.put("saturation", PotionEffectType.SATURATION);
|
||||||
ALIASPOTIONS.put("food", PotionEffectType.SATURATION);
|
ALIASPOTIONS.put("food", PotionEffectType.SATURATION);
|
||||||
}
|
}
|
||||||
|
catch (java.lang.NoSuchFieldError e)
|
||||||
|
{
|
||||||
|
Essentials.wrongVersion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static PotionEffectType getByName(String name)
|
public static PotionEffectType getByName(String name)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.earth2me.essentials.utils;
|
package com.earth2me.essentials.utils;
|
||||||
|
|
||||||
|
import com.earth2me.essentials.Essentials;
|
||||||
import static com.earth2me.essentials.I18n._;
|
import static com.earth2me.essentials.I18n._;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -60,7 +61,15 @@ public class LocationUtil
|
|||||||
HOLLOW_MATERIALS.add(Material.FENCE_GATE.getId());
|
HOLLOW_MATERIALS.add(Material.FENCE_GATE.getId());
|
||||||
HOLLOW_MATERIALS.add(Material.WATER_LILY.getId());
|
HOLLOW_MATERIALS.add(Material.WATER_LILY.getId());
|
||||||
HOLLOW_MATERIALS.add(Material.NETHER_WARTS.getId());
|
HOLLOW_MATERIALS.add(Material.NETHER_WARTS.getId());
|
||||||
|
|
||||||
|
try // 1.6 update
|
||||||
|
{
|
||||||
HOLLOW_MATERIALS.add(Material.CARPET.getId());
|
HOLLOW_MATERIALS.add(Material.CARPET.getId());
|
||||||
|
}
|
||||||
|
catch (java.lang.NoSuchFieldError e)
|
||||||
|
{
|
||||||
|
Essentials.wrongVersion();
|
||||||
|
}
|
||||||
|
|
||||||
for (Integer integer : HOLLOW_MATERIALS)
|
for (Integer integer : HOLLOW_MATERIALS)
|
||||||
{
|
{
|
||||||
@ -160,6 +169,7 @@ public class LocationUtil
|
|||||||
public int x;
|
public int x;
|
||||||
public int y;
|
public int y;
|
||||||
public int z;
|
public int z;
|
||||||
|
|
||||||
public Vector3D(int x, int y, int z)
|
public Vector3D(int x, int y, int z)
|
||||||
{
|
{
|
||||||
this.x = x;
|
this.x = x;
|
||||||
|
Loading…
Reference in New Issue
Block a user