|
25 | 25 | import java.util.logging.Level; |
26 | 26 | import java.util.logging.LogRecord; |
27 | 27 |
|
| 28 | +import com.google.common.cache.CacheBuilder; |
28 | 29 | import com.zachsthings.netevents.NetEventsPlugin; |
29 | 30 | import net.gravitydevelopment.updater.Updater; |
30 | 31 | import org.bukkit.ChatColor; |
@@ -160,19 +161,30 @@ public void onEnable() { |
160 | 161 | return; |
161 | 162 | } |
162 | 163 | try { |
| 164 | + try { |
| 165 | + CacheBuilder.class.getMethod("maximumSize", long.class); |
| 166 | + } catch (NoSuchMethodException e) { |
| 167 | + getLogger().severe("================================================================================="); |
| 168 | + getLogger().severe("As of version 1.23, PEX is only compatible with versions of Minecraft 1.8 or greater. " + |
| 169 | + "Please downgrade to the most recent 1.22.x series version of PEX to continue."); |
| 170 | + getLogger().severe("================================================================================="); |
| 171 | + getPluginLoader().disablePlugin(this); |
| 172 | + return; |
| 173 | + } |
| 174 | + |
163 | 175 | if (this.permissionsManager == null) { |
164 | 176 | this.permissionsManager = new PermissionManager(config, getLogger(), this); |
165 | 177 | } |
166 | 178 |
|
167 | 179 | try { |
168 | 180 | OfflinePlayer.class.getMethod("getUniqueId"); |
169 | 181 | } catch (NoSuchMethodException e) { |
170 | | - getLogger().severe("============================================================================================"); |
| 182 | + getLogger().severe("================================================================================="); |
171 | 183 | getLogger().severe("As of version 1.21, PEX requires a version of Bukkit with UUID support to function (>1.7.5). Please download a non-UUID version of PermissionsEx to continue."); |
172 | 184 | getLogger().severe("Beginning reversion of potential invalid UUID conversion"); |
173 | 185 | getPermissionsManager().getBackend().revertUUID(); |
174 | 186 | getLogger().severe("Reversion complete, disabling. PermissionsEx will not work until downgrade is complete"); |
175 | | - getLogger().severe("============================================================================================"); |
| 187 | + getLogger().severe("================================================================================="); |
176 | 188 | getPluginLoader().disablePlugin(this); |
177 | 189 | return; |
178 | 190 | } |
|
0 commit comments