Downgrade JDK version to 15 for compatibility

This commit is contained in:
Gabriel Tofvesson 2021-05-20 00:44:55 +02:00
parent 711bcb1c70
commit 9405176e09
4 changed files with 10 additions and 5 deletions

2
.idea/misc.xml generated
View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_16" project-jdk-name="16" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_15" project-jdk-name="15 (2)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -6,7 +6,7 @@
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="16" jdkType="JavaSDK" />
<orderEntry type="jdk" jdkName="15 (2)" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="spigot-1.15.5-R0.1" level="project" />
</component>

View File

@ -98,7 +98,8 @@ public class SearchCommandExecutor extends ConfigurableCommandExecutor<SearchCon
return true;
}
if (result instanceof final DoubleChest dChest) {
if (result instanceof DoubleChest) {
final DoubleChest dChest = (DoubleChest) result;
// Black magic to make chest lid animation behave for double chests
try {

View File

@ -56,9 +56,13 @@ public class StackReplaceListener implements Listener {
@EventHandler
public void onPlayerThrowSnowballEvent(final ProjectileLaunchEvent event) {
if (event.getEntity() instanceof final ThrowableProjectile projectile &&
projectile.getShooter() instanceof final Player thrower) {
if (event.getEntity() instanceof ThrowableProjectile &&
event.getEntity().getShooter() instanceof Player) {
final ThrowableProjectile projectile = (ThrowableProjectile) event.getEntity();
final Player thrower = (Player) event.getEntity().getShooter();
assert thrower != null;
final PlayerInventory inventory = thrower.getInventory();
final ItemStack stack = projectile.getItem();