From 478b4dac4aa7230b724981303db98b2a0cfd127b Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Sat, 8 Aug 2020 18:59:58 -0500 Subject: [PATCH] Exp Optimize with inteallj --- .../api/0007-IntellaJ-Optimize-Imports.patch | 7360 ++++ patches/api/0008-IntellaJ-Code-Clean-Up.patch | 415 + .../0030-IntellaJ-Optimize-Imports.patch | 16107 ++++++++ .../server/0031-IntellaJ-Code-Clean-Up.patch | 32417 ++++++++++++++++ 4 files changed, 56299 insertions(+) create mode 100644 patches/api/0007-IntellaJ-Optimize-Imports.patch create mode 100644 patches/api/0008-IntellaJ-Code-Clean-Up.patch create mode 100644 patches/server/0030-IntellaJ-Optimize-Imports.patch create mode 100644 patches/server/0031-IntellaJ-Code-Clean-Up.patch diff --git a/patches/api/0007-IntellaJ-Optimize-Imports.patch b/patches/api/0007-IntellaJ-Optimize-Imports.patch new file mode 100644 index 00000000..3c5302a6 --- /dev/null +++ b/patches/api/0007-IntellaJ-Optimize-Imports.patch @@ -0,0 +1,7360 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Bud Gidiere +Date: Sat, 8 Aug 2020 18:11:46 -0500 +Subject: [PATCH] IntellaJ Optimize Imports + +Do not try to update this. Just rebuild it. + +diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java +index dfaa266ff53e43ad48dc5a5a5657fe70600f539a..6a7276d37a903a3254bf02864ebdaa6cad41fba8 100644 +--- a/src/main/java/co/aikar/timings/FullServerTickHandler.java ++++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java +@@ -1,10 +1,10 @@ + package co.aikar.timings; + +-import static co.aikar.timings.TimingsManager.*; +- + import org.bukkit.Bukkit; + import org.jetbrains.annotations.NotNull; + ++import static co.aikar.timings.TimingsManager.*; ++ + public class FullServerTickHandler extends TimingHandler { + private static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null); + final TimingData minuteData; +diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java +index 4e6e1b8e8aeb07e34536941d2cbfc25e5cfa6c27..c23ba7dac929662ebe58bf7fd8376c9a13629082 100644 +--- a/src/main/java/co/aikar/timings/TimedEventExecutor.java ++++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java +@@ -29,11 +29,11 @@ import org.bukkit.event.EventException; + import org.bukkit.event.Listener; + import org.bukkit.plugin.EventExecutor; + import org.bukkit.plugin.Plugin; +- +-import java.lang.reflect.Method; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.lang.reflect.Method; ++ + public class TimedEventExecutor implements EventExecutor { + + private final EventExecutor executor; +diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java +index a5d13a1e44edb861f45c83a9b4309fbf799d407d..3ae8a7f792d26d6daaf8687c8e99d38dbb9480a2 100644 +--- a/src/main/java/co/aikar/timings/TimingData.java ++++ b/src/main/java/co/aikar/timings/TimingData.java +@@ -23,9 +23,10 @@ + */ + package co.aikar.timings; + +-import java.util.List; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + import static co.aikar.util.JSONUtil.toArray; + + /** +diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java +index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..cf0c249edf83e80aaa98d230abfc4866c0412f51 100644 +--- a/src/main/java/co/aikar/timings/TimingHandler.java ++++ b/src/main/java/co/aikar/timings/TimingHandler.java +@@ -25,6 +25,9 @@ package co.aikar.timings; + + import co.aikar.util.LoadingIntMap; + import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; ++import org.bukkit.Bukkit; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + import java.util.ArrayDeque; + import java.util.Deque; +@@ -32,10 +35,6 @@ import java.util.concurrent.atomic.AtomicInteger; + import java.util.logging.Level; + import java.util.logging.Logger; + +-import org.bukkit.Bukkit; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; +- + class TimingHandler implements Timing { + + private static AtomicInteger idPool = new AtomicInteger(1); +diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java +index 203cda0f9a4dea4f28a21ea9ee8db7a7369842e3..6460637a354c8b39401e03ec2ac76db27e7ea2cb 100644 +--- a/src/main/java/co/aikar/timings/TimingHistory.java ++++ b/src/main/java/co/aikar/timings/TimingHistory.java +@@ -24,6 +24,8 @@ + package co.aikar.timings; + + import co.aikar.timings.TimingHistory.RegionData.RegionId; ++import co.aikar.util.LoadingMap; ++import co.aikar.util.MRUMapCache; + import com.google.common.base.Function; + import com.google.common.collect.Sets; + import org.bukkit.Bukkit; +@@ -34,18 +36,12 @@ import org.bukkit.block.BlockState; + import org.bukkit.entity.Entity; + import org.bukkit.entity.EntityType; + import org.bukkit.entity.Player; +-import co.aikar.util.LoadingMap; +-import co.aikar.util.MRUMapCache; +- +-import java.lang.management.ManagementFactory; +-import java.util.Collection; +-import java.util.EnumMap; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.lang.management.ManagementFactory; ++import java.util.*; ++ + import static co.aikar.timings.TimingsManager.FULL_SERVER_TICK; + import static co.aikar.timings.TimingsManager.MINUTE_REPORTS; + import static co.aikar.util.JSONUtil.*; +diff --git a/src/main/java/co/aikar/timings/TimingHistoryEntry.java b/src/main/java/co/aikar/timings/TimingHistoryEntry.java +index 86d5ac6bd0d7d0003688761aceb3f3343575319f..ba61030cb48a17b19f7cd87940825b4bbb455b6c 100644 +--- a/src/main/java/co/aikar/timings/TimingHistoryEntry.java ++++ b/src/main/java/co/aikar/timings/TimingHistoryEntry.java +@@ -24,9 +24,9 @@ + package co.aikar.timings; + + import com.google.common.base.Function; ++import org.jetbrains.annotations.NotNull; + + import java.util.List; +-import org.jetbrains.annotations.NotNull; + + import static co.aikar.util.JSONUtil.toArrayMapper; + +diff --git a/src/main/java/co/aikar/timings/TimingIdentifier.java b/src/main/java/co/aikar/timings/TimingIdentifier.java +index df142a89b8c43acb81eb383eac0ef048a1f49a6e..73b21cce092a694dfb8240e2bccd38c576f63bd4 100644 +--- a/src/main/java/co/aikar/timings/TimingIdentifier.java ++++ b/src/main/java/co/aikar/timings/TimingIdentifier.java +@@ -24,16 +24,12 @@ + package co.aikar.timings; + + import co.aikar.util.LoadingMap; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.List; +-import java.util.Map; +-import java.util.Objects; ++import java.util.*; + import java.util.concurrent.ConcurrentHashMap; + import java.util.concurrent.atomic.AtomicInteger; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + /** + *

Used as a basis for fast HashMap key comparisons for the Timing Map.

+diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java +index da76e1aaee1dee794e38ddd4e0a28e0071e90bbf..e8e33d9e4b743084e881bb53d0e6d12394bede22 100644 +--- a/src/main/java/co/aikar/timings/Timings.java ++++ b/src/main/java/co/aikar/timings/Timings.java +@@ -30,12 +30,12 @@ import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + import org.bukkit.command.CommandSender; + import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + import java.util.List; + import java.util.Queue; + import java.util.logging.Level; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + @SuppressWarnings({"UnusedDeclaration", "WeakerAccess", "SameParameterValue"}) + public final class Timings { +diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java +index f7c2245a310a084367ff25db539b3c967d5cb141..07a1e449b8b205e3285daa2c3223a87a30c2a912 100644 +--- a/src/main/java/co/aikar/timings/TimingsCommand.java ++++ b/src/main/java/co/aikar/timings/TimingsCommand.java +@@ -29,11 +29,10 @@ import org.bukkit.ChatColor; + import org.bukkit.command.CommandSender; + import org.bukkit.command.defaults.BukkitCommand; + import org.bukkit.util.StringUtil; ++import org.jetbrains.annotations.NotNull; + + import java.util.ArrayList; + import java.util.List; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + + public class TimingsCommand extends BukkitCommand { +diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java +index ef824d701c97cad8b31e76ad98c94fc4367a7eda..bdc419426588f7b8b31370c4e4f62f0b4893626f 100644 +--- a/src/main/java/co/aikar/timings/TimingsManager.java ++++ b/src/main/java/co/aikar/timings/TimingsManager.java +@@ -30,15 +30,14 @@ import org.bukkit.Server; + import org.bukkit.command.Command; + import org.bukkit.plugin.Plugin; + import org.bukkit.plugin.java.PluginClassLoader; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import java.util.Map; + import java.util.concurrent.ConcurrentHashMap; + import java.util.logging.Level; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + public final class TimingsManager { + static final Map TIMING_MAP = LoadingMap.of( +diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java +index 8c49d67e2656dcac0758c0908897736b49435bf8..b990887db3a96193ba24d065ef667916e69a7b47 100644 +--- a/src/main/java/co/aikar/timings/TimingsReportListener.java ++++ b/src/main/java/co/aikar/timings/TimingsReportListener.java +@@ -7,11 +7,11 @@ import org.bukkit.command.CommandSender; + import org.bukkit.command.ConsoleCommandSender; + import org.bukkit.command.MessageCommandSender; + import org.bukkit.command.RemoteConsoleCommandSender; +- +-import java.util.List; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + @SuppressWarnings("WeakerAccess") + public class TimingsReportListener implements MessageCommandSender { + private final List senders; +diff --git a/src/main/java/co/aikar/util/Counter.java b/src/main/java/co/aikar/util/Counter.java +index 80155072d1004e34e04342d434cf7d75f0b7e29d..ecc5ec682f888374fb6216ff9844934a47bfcd46 100644 +--- a/src/main/java/co/aikar/util/Counter.java ++++ b/src/main/java/co/aikar/util/Counter.java +@@ -1,11 +1,11 @@ + package co.aikar.util; + + import com.google.common.collect.ForwardingMap; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + import java.util.HashMap; + import java.util.Map; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + public class Counter extends ForwardingMap { + private final Map counts = new HashMap<>(); +diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java +index 190bf0598442c89c2a1c93ad7c8c1a29797304ae..7b0cf8a89d65f175df47a7dff0aa800ef91bc95c 100644 +--- a/src/main/java/co/aikar/util/JSONUtil.java ++++ b/src/main/java/co/aikar/util/JSONUtil.java +@@ -5,10 +5,7 @@ import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; +-import org.json.simple.JSONArray; +-import org.json.simple.JSONObject; + +-import java.util.ArrayList; + import java.util.LinkedHashMap; + import java.util.List; + import java.util.Map; +diff --git a/src/main/java/co/aikar/util/LoadingMap.java b/src/main/java/co/aikar/util/LoadingMap.java +index aedbb03321886cb267879d7994653e447b485f6a..43b2c68faa3fe379e4554d5f4d427795bfdb2673 100644 +--- a/src/main/java/co/aikar/util/LoadingMap.java ++++ b/src/main/java/co/aikar/util/LoadingMap.java +@@ -23,18 +23,13 @@ + */ + package co.aikar.util; + +-import com.google.common.base.Preconditions; +-import java.lang.reflect.Constructor; +-import java.util.AbstractMap; +-import java.util.Collection; +-import java.util.HashMap; +-import java.util.IdentityHashMap; +-import java.util.Map; +-import java.util.Set; +-import java.util.function.Function; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.lang.reflect.Constructor; ++import java.util.*; ++import java.util.function.Function; ++ + /** + * Allows you to pass a Loader function that when a key is accessed that doesn't exists, + * automatically loads the entry into the map by calling the loader Function. +diff --git a/src/main/java/co/aikar/util/MRUMapCache.java b/src/main/java/co/aikar/util/MRUMapCache.java +index 5989ee21297935651b0edd44b8239e655eaef1d9..40aebdd0cc726a26c5ef1b486d05c4f2f022cdb9 100644 +--- a/src/main/java/co/aikar/util/MRUMapCache.java ++++ b/src/main/java/co/aikar/util/MRUMapCache.java +@@ -23,12 +23,13 @@ + */ + package co.aikar.util; + ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ + import java.util.AbstractMap; + import java.util.Collection; + import java.util.Map; + import java.util.Set; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + /** + * Implements a Most Recently Used cache in front of a backing map, to quickly access the last accessed result. +diff --git a/src/main/java/com/destroystokyo/paper/ClientOption.java b/src/main/java/com/destroystokyo/paper/ClientOption.java +index 9dad814cf51bc59ec5dfbf14474fea6557de38aa..266f19d5c1cae13d7aac8b20cc169348a43026c1 100644 +--- a/src/main/java/com/destroystokyo/paper/ClientOption.java ++++ b/src/main/java/com/destroystokyo/paper/ClientOption.java +@@ -1,8 +1,7 @@ + package com.destroystokyo.paper; + +-import org.jetbrains.annotations.NotNull; +- + import org.bukkit.inventory.MainHand; ++import org.jetbrains.annotations.NotNull; + + public final class ClientOption { + +diff --git a/src/main/java/com/destroystokyo/paper/HeightmapType.java b/src/main/java/com/destroystokyo/paper/HeightmapType.java +index 709e44ea1b14ab6917501c928e689cc6cbdf4bb4..f7ab13cd5f34928a4534366291f9b0f8a0f54309 100644 +--- a/src/main/java/com/destroystokyo/paper/HeightmapType.java ++++ b/src/main/java/com/destroystokyo/paper/HeightmapType.java +@@ -1,6 +1,8 @@ + package com.destroystokyo.paper; + +-import org.bukkit.*; ++import org.bukkit.HeightMap; ++import org.bukkit.Location; ++import org.bukkit.World; + + /** + * Enumeration of different heightmap types maintained by the server. Generally using these maps is much faster +diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java +index 53c36e30e8f500c9bf58e6b12585d44cc5c9e9e2..551598e2869607c4008a15d63a71895214863502 100644 +--- a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java ++++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java +@@ -13,6 +13,8 @@ import org.bukkit.block.Block; + import org.bukkit.block.BlockState; + import org.bukkit.block.data.BlockData; + import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + import java.util.ArrayList; + import java.util.Collection; +@@ -21,8 +23,6 @@ import java.util.Set; + import java.util.function.Predicate; + import java.util.stream.Collectors; + import java.util.stream.Stream; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + public class MaterialSetTag implements Tag { + +diff --git a/src/main/java/com/destroystokyo/paper/NamespacedTag.java b/src/main/java/com/destroystokyo/paper/NamespacedTag.java +index 28f3fda950999a9c964a3608042ca60567ae1d6a..edff8763a3e1612b3e046176b88c6d716910c773 100644 +--- a/src/main/java/com/destroystokyo/paper/NamespacedTag.java ++++ b/src/main/java/com/destroystokyo/paper/NamespacedTag.java +@@ -1,11 +1,12 @@ + package com.destroystokyo.paper; + + import com.google.common.base.Preconditions; ++import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; ++ + import java.util.Locale; + import java.util.UUID; + import java.util.regex.Pattern; +-import org.bukkit.plugin.Plugin; +-import org.jetbrains.annotations.NotNull; + + /** + * Represents a String based key pertaining to a tagged entry. Consists of two components - a namespace +diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java +index 06f1602f5b327705f726d0a99dd6b95e1554d382..d5d2fa20ed54e4989d0120c9239d3b54b7985a3b 100644 +--- a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java ++++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java +@@ -7,11 +7,11 @@ import org.bukkit.Particle; + import org.bukkit.World; + import org.bukkit.entity.Player; + import org.bukkit.util.NumberConversions; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + import java.util.Collection; + import java.util.List; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + /** + * Helps prepare a particle to be sent to players. +diff --git a/src/main/java/com/destroystokyo/paper/Title.java b/src/main/java/com/destroystokyo/paper/Title.java +index 4fe18540f77143ee7cd7e94d3aa279ae744289e4..edb162532a1e958e95f7142150fe0a0208f4aaac 100644 +--- a/src/main/java/com/destroystokyo/paper/Title.java ++++ b/src/main/java/com/destroystokyo/paper/Title.java +@@ -2,14 +2,11 @@ package com.destroystokyo.paper; + + import net.md_5.bungee.api.chat.BaseComponent; + import net.md_5.bungee.api.chat.TextComponent; +- + import org.bukkit.entity.Player; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + +-import static com.google.common.base.Preconditions.checkArgument; +-import static com.google.common.base.Preconditions.checkNotNull; +-import static com.google.common.base.Preconditions.checkState; ++import static com.google.common.base.Preconditions.*; + + /** + * Represents a title to may be sent to a {@link Player}. +diff --git a/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java +index e2a6f9c3881ff9d7373ac30e60009200432555aa..b4df01be1c0b81331b1472070b6cdae65d1bbe40 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java ++++ b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java +@@ -3,11 +3,11 @@ package com.destroystokyo.paper.entity; + import org.bukkit.Location; + import org.bukkit.entity.LivingEntity; + import org.bukkit.entity.Mob; +- +-import java.util.List; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Handles pathfinding operations for an Entity + */ +diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/Goal.java b/src/main/java/com/destroystokyo/paper/entity/ai/Goal.java +index c57c5416c88e2070a082403ab0dda9d7f08d2a57..ffe307d1159d16d595fac6cee829cfabdddde75a 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/ai/Goal.java ++++ b/src/main/java/com/destroystokyo/paper/entity/ai/Goal.java +@@ -1,11 +1,10 @@ + package com.destroystokyo.paper.entity.ai; + ++import org.bukkit.entity.Mob; + import org.jetbrains.annotations.NotNull; + + import java.util.EnumSet; + +-import org.bukkit.entity.Mob; +- + /** + * Represents an AI goal of an entity + */ +diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/GoalKey.java b/src/main/java/com/destroystokyo/paper/entity/ai/GoalKey.java +index 9cd98c6fcfa3eb439d9013ef76ef4661175a0e5a..9e1bea85d467af759ce19bc4e8841c80810ebb00 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/ai/GoalKey.java ++++ b/src/main/java/com/destroystokyo/paper/entity/ai/GoalKey.java +@@ -1,14 +1,12 @@ + package com.destroystokyo.paper.entity.ai; + + import com.google.common.base.Objects; +- ++import org.bukkit.NamespacedKey; ++import org.bukkit.entity.Mob; + import org.jetbrains.annotations.NotNull; + + import java.util.StringJoiner; + +-import org.bukkit.NamespacedKey; +-import org.bukkit.entity.Mob; +- + /** + * + * Used to identify a Goal. Consists of a {@link NamespacedKey} and the type of mob the goal can be applied to +diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoals.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoals.java +index e21f7574763dd4f13794f91bbef192ef66a8f5e9..50049eddf64cb559da852272d177c03c62685050 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoals.java ++++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoals.java +@@ -1,12 +1,11 @@ + package com.destroystokyo.paper.entity.ai; + ++import org.bukkit.entity.Mob; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + + import java.util.Collection; + +-import org.bukkit.entity.Mob; +- + /** + * Represents a part of the "brain" of a mob. It tracks all tasks (running or not), allows adding and removing goals + */ +diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java +index d7f1b2c84aebe8ed04084b9249ed08d5e52a6ecd..9824514ab806669405e0a6d168027d22100a3e4c 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java ++++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java +@@ -1,7 +1,6 @@ + package com.destroystokyo.paper.entity.ai; + + import com.destroystokyo.paper.entity.RangedEntity; +- + import org.bukkit.NamespacedKey; + import org.bukkit.entity.*; + +diff --git a/src/main/java/com/destroystokyo/paper/entity/villager/Reputation.java b/src/main/java/com/destroystokyo/paper/entity/villager/Reputation.java +index 1cc9ef255df888cb7dd7f7f2c5014e818d1be613..d94fe15ecebbf9ad2fe711c8c3c81ccdcbf641d0 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/villager/Reputation.java ++++ b/src/main/java/com/destroystokyo/paper/entity/villager/Reputation.java +@@ -1,9 +1,10 @@ + package com.destroystokyo.paper.entity.villager; + + import com.google.common.base.Preconditions; +-import java.util.Map; + import org.jetbrains.annotations.NotNull; + ++import java.util.Map; ++ + /** + * A reputation score for a player on a villager. + */ +diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java +index 118c7b6772a52c250649af2a9286f483f43da385..87c79e7e60ebd288ad2b097d9bbaca243b525745 100644 +--- a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java +@@ -6,11 +6,11 @@ import org.bukkit.entity.LivingEntity; + import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.bukkit.event.entity.EntityEvent; +- +-import java.util.Collection; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++ + /** + * Fired when a DragonFireball collides with a block/entity and spawns an AreaEffectCloud + */ +diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java +index f530a3d9314e17d1da896cac633f6a422258d9a9..84ee5904b450d0b7e024039875d8a18cf10b03aa 100644 +--- a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java +@@ -24,10 +24,8 @@ + package com.destroystokyo.paper.event.entity; + + import org.bukkit.entity.Enderman; +-import org.bukkit.entity.Entity; + import org.bukkit.entity.Player; + import org.bukkit.event.Cancellable; +-import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.bukkit.event.entity.EntityEvent; + import org.jetbrains.annotations.NotNull; +diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java +index 806112a8b5a7ce31166675f5b074ceaf42e364b6..bed4727417f57337b1f2f5b09e3c7efbbc01e635 100644 +--- a/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java +@@ -1,9 +1,7 @@ + package com.destroystokyo.paper.event.entity; + + import org.bukkit.entity.Enderman; +-import org.bukkit.entity.Entity; + import org.bukkit.event.Cancellable; +-import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.bukkit.event.entity.EntityEvent; + import org.jetbrains.annotations.NotNull; +diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java +index 07660202e41ee86f1b66bad3335cf6fe126e7f9c..a8c4c1cee9ed97523458e21995dd2a87818c4ca7 100644 +--- a/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java +@@ -1,7 +1,6 @@ + package com.destroystokyo.paper.event.entity; + + import org.bukkit.entity.Entity; +-import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.bukkit.event.entity.EntityEvent; + import org.jetbrains.annotations.NotNull; +diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java +index e5dbbd660409bae0d3b96e83390511d3a423a52e..d23773d9013bfa4da085b91669e39768fb6e8800 100644 +--- a/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java +@@ -1,7 +1,6 @@ + package com.destroystokyo.paper.event.entity; + + import org.bukkit.entity.Entity; +-import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.bukkit.event.entity.EntityEvent; + import org.jetbrains.annotations.NotNull; +diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java +index 3b725a489008d333630af166d2be5fc48168a6b9..ed3a6e3280f1bcfc8bd6d03b3b3b5c14ba164f9d 100644 +--- a/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java +@@ -5,11 +5,10 @@ import org.bukkit.entity.Entity; + import org.bukkit.entity.LightningStrike; + import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; +-import org.bukkit.event.entity.EntityEvent; + import org.bukkit.event.entity.EntityTransformEvent; ++import org.jetbrains.annotations.NotNull; + + import java.util.Collections; +-import org.jetbrains.annotations.NotNull; + + /** + * Fired when lightning strikes an entity +diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java +index 112a0dbf522b8e74ce882678434923814e6b187f..1a89870e118aae3fd7c0b7f218c14f51083d1946 100644 +--- a/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java +@@ -2,7 +2,6 @@ package com.destroystokyo.paper.event.entity; + + import org.bukkit.entity.Player; + import org.bukkit.event.Cancellable; +-import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.bukkit.event.player.PlayerEvent; + import org.jetbrains.annotations.NotNull; +diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java +index 5b28e9b1daba7834af67dbc193dd656bedd9a994..80d5c32d40ad75b95d842c90e73ebcc00bbeb8fe 100644 +--- a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java ++++ b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java +@@ -1,9 +1,5 @@ + package com.destroystokyo.paper.event.executor; + +-import java.lang.invoke.MethodHandle; +-import java.lang.invoke.MethodHandles; +-import java.lang.reflect.Method; +- + import com.destroystokyo.paper.util.SneakyThrow; + import org.bukkit.event.Event; + import org.bukkit.event.EventException; +@@ -11,6 +7,10 @@ import org.bukkit.event.Listener; + import org.bukkit.plugin.EventExecutor; + import org.jetbrains.annotations.NotNull; + ++import java.lang.invoke.MethodHandle; ++import java.lang.invoke.MethodHandles; ++import java.lang.reflect.Method; ++ + public class MethodHandleEventExecutor implements EventExecutor { + private final Class eventClass; + private final MethodHandle handle; +diff --git a/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java +index c83672427324bd068ed52916f700b68446a226f6..e7e7c039366f8871ea5dee92de5a40d03048e967 100644 +--- a/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java ++++ b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java +@@ -1,20 +1,18 @@ + package com.destroystokyo.paper.event.executor; + +-import java.lang.invoke.MethodHandle; +-import java.lang.invoke.MethodHandles; +-import java.lang.reflect.Method; +-import java.lang.reflect.Modifier; +- + import com.destroystokyo.paper.util.SneakyThrow; + import com.google.common.base.Preconditions; +- +-import org.bukkit.Bukkit; + import org.bukkit.event.Event; + import org.bukkit.event.EventException; + import org.bukkit.event.Listener; + import org.bukkit.plugin.EventExecutor; + import org.jetbrains.annotations.NotNull; + ++import java.lang.invoke.MethodHandle; ++import java.lang.invoke.MethodHandles; ++import java.lang.reflect.Method; ++import java.lang.reflect.Modifier; ++ + public class StaticMethodHandleEventExecutor implements EventExecutor { + private final Class eventClass; + private final MethodHandle handle; +diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java +index b6e7d8ee8d903ebf975d60bec0e08603d9a49fdb..59680263ad4520deccfdb2d5209450df2e4f7bff 100644 +--- a/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java ++++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java +@@ -1,14 +1,14 @@ + package com.destroystokyo.paper.event.executor.asm; + +-import java.lang.reflect.Method; +-import java.util.concurrent.atomic.AtomicInteger; +- + import org.bukkit.plugin.EventExecutor; + import org.jetbrains.annotations.NotNull; + import org.objectweb.asm.ClassWriter; + import org.objectweb.asm.Type; + import org.objectweb.asm.commons.GeneratorAdapter; + ++import java.lang.reflect.Method; ++import java.util.concurrent.atomic.AtomicInteger; ++ + import static org.objectweb.asm.Opcodes.*; + + public class ASMEventExecutorGenerator { +diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java +index beed9e6e07a9080f1c059e08220839090553d0a4..f79685b48bb581277a6891927988b6f7a4389dc4 100644 +--- a/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java ++++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java +@@ -1,6 +1,5 @@ + package com.destroystokyo.paper.event.executor.asm; + +-import com.destroystokyo.paper.utils.UnsafeUtils; + import org.jetbrains.annotations.NotNull; + + public interface ClassDefiner { +diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java +index ac99477e9f2c08041aeff31abc1d1edee58d0a67..b5da4610e08ee9b07845fd31a25052cef4d56c28 100644 +--- a/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java ++++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java +@@ -1,13 +1,10 @@ + package com.destroystokyo.paper.event.executor.asm; + +-import java.util.concurrent.ConcurrentHashMap; +-import java.util.concurrent.ConcurrentMap; +- + import com.google.common.base.Preconditions; +- + import com.google.common.collect.MapMaker; + import org.jetbrains.annotations.NotNull; +-import org.objectweb.asm.Type; ++ ++import java.util.concurrent.ConcurrentMap; + + public class SafeClassDefiner implements ClassDefiner { + /* default */ static final SafeClassDefiner INSTANCE = new SafeClassDefiner(); +diff --git a/src/main/java/com/destroystokyo/paper/event/inventory/PrepareGrindstoneEvent.java b/src/main/java/com/destroystokyo/paper/event/inventory/PrepareGrindstoneEvent.java +index 449e8c06f8434b59d49a76481fa60c5c49e80579..7a144854ec8998e758bf2327d30d8165fbf39e0f 100644 +--- a/src/main/java/com/destroystokyo/paper/event/inventory/PrepareGrindstoneEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/inventory/PrepareGrindstoneEvent.java +@@ -1,7 +1,5 @@ + package com.destroystokyo.paper.event.inventory; + +-import org.bukkit.event.HandlerList; +-import org.bukkit.event.inventory.InventoryEvent; + import org.bukkit.inventory.GrindstoneInventory; + import org.bukkit.inventory.InventoryView; + import org.bukkit.inventory.ItemStack; +diff --git a/src/main/java/com/destroystokyo/paper/event/inventory/PrepareResultEvent.java b/src/main/java/com/destroystokyo/paper/event/inventory/PrepareResultEvent.java +index 045ce9ec3c9134aced5f5235b760ac85599d16c6..d8da8903d28ad715e0768fa5c58906540762ca0e 100644 +--- a/src/main/java/com/destroystokyo/paper/event/inventory/PrepareResultEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/inventory/PrepareResultEvent.java +@@ -2,7 +2,6 @@ package com.destroystokyo.paper.event.inventory; + + import org.bukkit.event.HandlerList; + import org.bukkit.event.inventory.InventoryEvent; +-import org.bukkit.event.inventory.InventoryType; + import org.bukkit.inventory.InventoryView; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; +diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java +index 2827a100275f8e1316b5d06c14662d41ca1bd5fa..15271e14fae0140d23fed672895555299c88cd17 100644 +--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java +@@ -5,13 +5,13 @@ import org.bukkit.entity.Player; + import org.bukkit.event.HandlerList; + import org.bukkit.event.player.PlayerEvent; + import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + import java.util.Arrays; + import java.util.Collections; + import java.util.HashSet; + import java.util.Set; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + import static org.bukkit.Material.*; + +diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerClientOptionsChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerClientOptionsChangeEvent.java +index f7f171c4ee0b8339b2f8fbe82442d65f17202f28..be9201fd83ab274b34cd933e5158c4de96491675 100644 +--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerClientOptionsChangeEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerClientOptionsChangeEvent.java +@@ -3,13 +3,11 @@ package com.destroystokyo.paper.event.player; + import com.destroystokyo.paper.ClientOption; + import com.destroystokyo.paper.ClientOption.ChatVisibility; + import com.destroystokyo.paper.SkinParts; +- +-import org.jetbrains.annotations.NotNull; +- + import org.bukkit.entity.Player; + import org.bukkit.event.HandlerList; + import org.bukkit.event.player.PlayerEvent; + import org.bukkit.inventory.MainHand; ++import org.jetbrains.annotations.NotNull; + + /** + * Called when the player changes his client settings +diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java +index 12c1c6fe9dc8dc5f5faf6dcf99f6857219ef22b8..aa3576d746f2add8887e3b3aee0e265c232600d3 100644 +--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java +@@ -2,10 +2,10 @@ package com.destroystokyo.paper.event.player; + + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; + + import java.net.InetAddress; + import java.util.UUID; +-import org.jetbrains.annotations.NotNull; + + /** + *

+diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java +index f0bb4e31cc25eab2359fa9873bbf960346721701..39cb6d136fe920ee9519f81ecf360f618d29fdd2 100644 +--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java +@@ -4,11 +4,11 @@ import org.apache.commons.lang.Validate; + import org.bukkit.event.Cancellable; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; +- +-import java.util.UUID; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.UUID; ++ + /** + * This event is fired during a player handshake. + * +diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java +index f7beb22d5105157940b39efe594ace9d4cb153f5..d117956ca6026ad676e1aa551b4f10ca83be0b7e 100644 +--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java +@@ -26,7 +26,6 @@ package com.destroystokyo.paper.event.player; + import org.bukkit.entity.ExperienceOrb; + import org.bukkit.entity.Player; + import org.bukkit.event.Cancellable; +-import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.bukkit.event.player.PlayerEvent; + import org.jetbrains.annotations.NotNull; +diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java +index 5d04a22fd6964d8d44a2aa069c9629722893b1f4..5cf47f7ffd039add8bcdce9e08f52b2fc5aafcc6 100644 +--- a/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java +@@ -25,7 +25,6 @@ package com.destroystokyo.paper.event.player; + + import org.bukkit.entity.Player; + import org.bukkit.event.Cancellable; +-import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.bukkit.event.player.PlayerEvent; + import org.bukkit.inventory.ItemStack; +diff --git a/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java +index 71f36e9cae209ec6861835a5e76e018de959040a..1829bddee1e7518bde021b527b39c5f3f4b2e002 100644 +--- a/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java +@@ -27,9 +27,9 @@ import com.destroystokyo.paper.profile.PlayerProfile; + import com.destroystokyo.paper.profile.ProfileProperty; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; + + import java.util.Set; +-import org.jetbrains.annotations.NotNull; + + /** + * Fired once a profiles additional properties (such as textures) has been filled +diff --git a/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java +index 8df37c07cd55ddf110d1dd68183d7b697f7a6756..1666c8e7ed11e8a7af02b202cc7482d5c8db0bd0 100644 +--- a/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java +@@ -4,7 +4,6 @@ import com.destroystokyo.paper.profile.PlayerProfile; + import org.bukkit.Bukkit; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; +- + import org.jetbrains.annotations.NotNull; + + /** +diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java +index 021bc86310a06f84b39459e0eb8927802726399c..b2af8715bd50f196f88f7f75f473996c23df03f2 100644 +--- a/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java +@@ -27,9 +27,9 @@ import com.destroystokyo.paper.profile.PlayerProfile; + import com.destroystokyo.paper.profile.ProfileProperty; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; + + import java.util.Collection; +-import org.jetbrains.annotations.NotNull; + + /** + * Fired when the server is requesting to fill in properties of an incomplete profile, such as textures. +diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java +index 4dcf6242c9acc62d030a94f67b78729ed29f8c85..ed30b291cd5c406779e10b28c10d8577b46cd3a1 100644 +--- a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java +@@ -1,17 +1,15 @@ + package com.destroystokyo.paper.event.profile; + +-import com.destroystokyo.paper.profile.PlayerProfile; + import com.destroystokyo.paper.profile.ProfileProperty; +-import com.google.common.collect.ArrayListMultimap; + import org.bukkit.Bukkit; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + import java.util.HashSet; + import java.util.Set; + import java.util.UUID; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + /** + * Allows a plugin to intercept a Profile Lookup for a Profile by name +diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java +index 619ed37169c126a8c75d02699a04728bac49d10d..94b1dfe3e4813e58a46360f6b5140c1fbbfa8b82 100644 +--- a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java +@@ -23,7 +23,6 @@ + + package com.destroystokyo.paper.event.server; + +-import com.google.common.collect.ImmutableList; + import org.apache.commons.lang.Validate; + import org.bukkit.Location; + import org.bukkit.command.Command; +@@ -31,11 +30,11 @@ import org.bukkit.command.CommandSender; + import org.bukkit.event.Cancellable; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + import java.util.ArrayList; + import java.util.List; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + /** + * Allows plugins to compute tab completion results asynchronously. If this event provides completions, then the standard synchronous process will not be fired to populate the results. However, the synchronous TabCompleteEvent will fire with the Async results. +diff --git a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java +index 0cc5dd57342c12c0561c2b6ea0f803efb236855e..3e9974795f021aea2a61eb7ca911dbeec7c34b4e 100644 +--- a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java +@@ -1,7 +1,5 @@ + package com.destroystokyo.paper.event.server; + +-import static java.util.Objects.requireNonNull; +- + import com.destroystokyo.paper.network.StatusClient; + import com.destroystokyo.paper.profile.PlayerProfile; + import org.bukkit.Bukkit; +@@ -9,16 +7,13 @@ import org.bukkit.entity.Player; + import org.bukkit.event.Cancellable; + import org.bukkit.event.server.ServerListPingEvent; + import org.bukkit.util.CachedServerIcon; +- +-import java.util.ArrayList; +-import java.util.Iterator; +-import java.util.List; +-import java.util.NoSuchElementException; +-import java.util.UUID; +- + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.*; ++ ++import static java.util.Objects.requireNonNull; ++ + /** + * Extended version of {@link ServerListPingEvent} that allows full control + * of the response sent to the client. +diff --git a/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java +index 2f573299a9a817a98372817a1de8bf641aaca956..fd8f760b7ac8feda03ce5ea663b76b6cb2cf93d6 100644 +--- a/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java +@@ -1,11 +1,10 @@ + package com.destroystokyo.paper.event.server; + ++import com.destroystokyo.paper.exception.ServerException; + import com.google.common.base.Preconditions; +-import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; +-import com.destroystokyo.paper.exception.ServerException; + import org.jetbrains.annotations.NotNull; + + /** +diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java b/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java +index 410b24139535cd5d8439ad581c43c61b5757fbf6..fc3863b6d93577aa001213d4175e39b7929dc7d0 100644 +--- a/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java ++++ b/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java +@@ -4,7 +4,7 @@ import org.bukkit.event.Event; + import org.bukkit.event.Listener; + import org.bukkit.plugin.Plugin; + +-import static com.google.common.base.Preconditions.*; ++import static com.google.common.base.Preconditions.checkNotNull; + + /** + * Exception thrown when a server event listener throws an exception +diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java b/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java +index e762ed0dbad51625e65fef2e1898679108459a36..5dbd79cd9a7ec76c1daecd2d77ebc9c0dce9cdd8 100644 +--- a/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java ++++ b/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java +@@ -1,7 +1,7 @@ + package com.destroystokyo.paper.exception; + +-import org.bukkit.Bukkit; + import com.destroystokyo.paper.event.server.ServerExceptionEvent; ++import org.bukkit.Bukkit; + + /** + * Thrown when the internal server throws a recoverable exception. +diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java +index 6defac287d0214fdf99418d979144050cc1e53bc..be3f92e3c6bcefe8b78da701b75121275001882e 100644 +--- a/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java ++++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java +@@ -1,10 +1,8 @@ + package com.destroystokyo.paper.exception; + +-import com.google.common.base.Preconditions; +-import org.apache.commons.lang.Validate; + import org.bukkit.plugin.Plugin; + +-import static com.google.common.base.Preconditions.*; ++import static com.google.common.base.Preconditions.checkNotNull; + + /** + * Wrapper exception for all cases to which a plugin can be immediately blamed for +diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java +index 89e132525cfae0ce979e37b3e2793df781e47227..f58d9065dd7c39a8e1b70b8ddf20df59e8b4d5c2 100644 +--- a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java ++++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java +@@ -3,7 +3,7 @@ package com.destroystokyo.paper.exception; + import org.bukkit.entity.Player; + import org.bukkit.plugin.Plugin; + +-import static com.google.common.base.Preconditions.*; ++import static com.google.common.base.Preconditions.checkNotNull; + + /** + * Thrown when an incoming plugin message channel throws an exception +diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java +index 97815eeb231cf0706b34fa47a4f7d1bb786305b4..3856d438db29a3d142cffdb36c61db71117e0c80 100644 +--- a/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java +@@ -2,11 +2,11 @@ package com.destroystokyo.paper.loottable; + + import org.bukkit.entity.Player; + import org.bukkit.loot.Lootable; +- +-import java.util.UUID; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.UUID; ++ + /** + * Represents an Inventory that contains a Loot Table associated to it that will + * automatically fill on first open. +diff --git a/src/main/java/com/destroystokyo/paper/network/NetworkClient.java b/src/main/java/com/destroystokyo/paper/network/NetworkClient.java +index 7b2af1bd72dfbcf4e962a982940fc49b851aa04f..f5b3732941ab177096c47796576888c39ebecd66 100644 +--- a/src/main/java/com/destroystokyo/paper/network/NetworkClient.java ++++ b/src/main/java/com/destroystokyo/paper/network/NetworkClient.java +@@ -1,10 +1,10 @@ + package com.destroystokyo.paper.network; + +-import java.net.InetSocketAddress; +- + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.net.InetSocketAddress; ++ + /** + * Represents a client connected to the server. + */ +diff --git a/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java +index 2ef9a7bd55e2c9cf8cb20d5f77282676ae11181f..2a0fbc4e293d7e99f66f8df5124f6aef98d54f6e 100644 +--- a/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java ++++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java +@@ -1,10 +1,11 @@ + package com.destroystokyo.paper.profile; + ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ + import java.util.Collection; + import java.util.Set; + import java.util.UUID; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + /** + * Represents a players profile for the game, such as UUID, Name, and textures. +diff --git a/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java b/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java +index 7b3b6ef533d32169fbeca389bd61cfc6b0e0faee..c50530a03f689be01b6b1482685a09516a4f4cb9 100644 +--- a/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java ++++ b/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java +@@ -1,11 +1,11 @@ + package com.destroystokyo.paper.profile; + + import com.google.common.base.Preconditions; +- +-import java.util.Objects; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Objects; ++ + /** + * Represents a property on a {@link PlayerProfile} + */ +diff --git a/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java b/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java +index 5bb677ce585b856b3d3e589e29786a29619c56a7..ccac3221fba1bc18a475402beca232bd7b3141f5 100644 +--- a/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java ++++ b/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java +@@ -1,10 +1,11 @@ + package com.destroystokyo.paper.utils; + +-import java.util.concurrent.ConcurrentLinkedQueue; +-import java.util.concurrent.atomic.LongAdder; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.concurrent.ConcurrentLinkedQueue; ++import java.util.concurrent.atomic.LongAdder; ++ + public class CachedSizeConcurrentLinkedQueue extends ConcurrentLinkedQueue { + private final LongAdder cachedSize = new LongAdder(); + +diff --git a/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java +index 76f2cb9cd99cad2a9484eab2becd8c36f1dd91b3..0e883d852d105180cd1bc82e8deceb8ccaadb58e 100644 +--- a/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java ++++ b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java +@@ -1,11 +1,11 @@ + package com.destroystokyo.paper.utils; + + import org.bukkit.plugin.PluginDescriptionFile; ++import org.jetbrains.annotations.NotNull; + + import java.util.logging.Level; + import java.util.logging.LogManager; + import java.util.logging.Logger; +-import org.jetbrains.annotations.NotNull; + + /** + * Prevents plugins (e.g. Essentials) from changing the parent of the plugin logger. +diff --git a/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java b/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java +index ff58b8875a07b34de02b9b479ff3e6daf66d7832..074de9ebca9abd6191bdd27e1e8f44abf2090f13 100644 +--- a/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java ++++ b/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java +@@ -1,11 +1,10 @@ + package dev.tr7zw.yatopia.events; + +-import java.util.UUID; +- ++import com.mojang.authlib.GameProfile; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + +-import com.mojang.authlib.GameProfile; ++import java.util.UUID; + + public class GameProfileLookupEvent extends Event { + private static final HandlerList handlers = new HandlerList(); +diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java +index e7563acf43fdf4f3f3c44b76441757f81e971117..bbc710b093f9536af8f2055fabd4559797ddd1e7 100644 +--- a/src/main/java/org/bukkit/Art.java ++++ b/src/main/java/org/bukkit/Art.java +@@ -1,11 +1,12 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.HashMap; + import org.apache.commons.lang.Validate; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++ + /** + * Represents the art on a painting + */ +diff --git a/src/main/java/org/bukkit/BanEntry.java b/src/main/java/org/bukkit/BanEntry.java +index 2cf11ca4f67480b5e03d2dad0d3ee9283cddc48a..30c8b0a0c62f4a68163d905d27c62a15facc9ffb 100644 +--- a/src/main/java/org/bukkit/BanEntry.java ++++ b/src/main/java/org/bukkit/BanEntry.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import java.util.Date; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Date; ++ + /** + * A single entry from a ban list. This may represent either a player ban or + * an IP ban. +diff --git a/src/main/java/org/bukkit/BanList.java b/src/main/java/org/bukkit/BanList.java +index 96ef22fe879c7be4f67bbb4d60c45ad11764dd5b..f506b644ad1aad53f9b41a642e37dfb5746212aa 100644 +--- a/src/main/java/org/bukkit/BanList.java ++++ b/src/main/java/org/bukkit/BanList.java +@@ -1,10 +1,11 @@ + package org.bukkit; + +-import java.util.Date; +-import java.util.Set; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Date; ++import java.util.Set; ++ + /** + * A ban list, containing bans of some {@link Type}. + */ +diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java +index 537e7fc9273b7e4ecc88eaad5b1a69d3864740d0..de5a8bafa69909b1eacff821652bc050d1f1052c 100644 +--- a/src/main/java/org/bukkit/Bukkit.java ++++ b/src/main/java/org/bukkit/Bukkit.java +@@ -1,26 +1,10 @@ + package org.bukkit; + + import com.google.common.collect.ImmutableList; +-import java.awt.image.BufferedImage; +-import java.io.File; +-import java.io.Serializable; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.UUID; +-import java.util.function.Consumer; +-import java.util.logging.Logger; + import org.bukkit.Warning.WarningState; + import org.bukkit.advancement.Advancement; + import org.bukkit.block.data.BlockData; +-import org.bukkit.boss.BarColor; +-import org.bukkit.boss.BarFlag; +-import org.bukkit.boss.BarStyle; +-import org.bukkit.boss.BossBar; +-import org.bukkit.boss.KeyedBossBar; ++import org.bukkit.boss.*; + import org.bukkit.command.CommandException; + import org.bukkit.command.CommandSender; + import org.bukkit.command.ConsoleCommandSender; +@@ -31,12 +15,7 @@ import org.bukkit.event.inventory.InventoryType; + import org.bukkit.event.server.ServerListPingEvent; + import org.bukkit.generator.ChunkGenerator; + import org.bukkit.help.HelpMap; +-import org.bukkit.inventory.Inventory; +-import org.bukkit.inventory.InventoryHolder; +-import org.bukkit.inventory.ItemFactory; +-import org.bukkit.inventory.ItemStack; +-import org.bukkit.inventory.Merchant; +-import org.bukkit.inventory.Recipe; ++import org.bukkit.inventory.*; + import org.bukkit.inventory.meta.ItemMeta; + import org.bukkit.loot.LootTable; + import org.bukkit.map.MapView; +@@ -51,6 +30,13 @@ import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.awt.image.BufferedImage; ++import java.io.File; ++import java.io.Serializable; ++import java.util.*; ++import java.util.function.Consumer; ++import java.util.logging.Logger; ++ + /** + * Represents the Bukkit core, for version and Server singleton handling + */ +diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java +index 06bdfddb7b1acb7bb7b347ad1aa13bff0c823ab1..b6af03b10bb7eee717703489f2dd62c59db57381 100644 +--- a/src/main/java/org/bukkit/ChatColor.java ++++ b/src/main/java/org/bukkit/ChatColor.java +@@ -1,13 +1,14 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; +-import java.util.regex.Pattern; + import org.apache.commons.lang.Validate; + import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++import java.util.regex.Pattern; ++ + /** + * All supported color values for chat + */ +diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java +index 11b691cf59b4a72493c91055fd8c46d7681b4527..4662505ec026bb47cf333152617861303d3fc2b8 100644 +--- a/src/main/java/org/bukkit/Chunk.java ++++ b/src/main/java/org/bukkit/Chunk.java +@@ -1,6 +1,5 @@ + package org.bukkit; + +-import java.util.Collection; + import org.bukkit.block.Block; + import org.bukkit.block.BlockState; + import org.bukkit.block.data.BlockData; +@@ -8,6 +7,8 @@ import org.bukkit.entity.Entity; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++ + /** + * Represents a chunk of blocks + */ +diff --git a/src/main/java/org/bukkit/CoalType.java b/src/main/java/org/bukkit/CoalType.java +index c07499dbdd49d70717dbd674d97b6dbcfd7e9d5b..fecdf6763ae1289f84f6fb6bbd5757e39cc8bb25 100644 +--- a/src/main/java/org/bukkit/CoalType.java ++++ b/src/main/java/org/bukkit/CoalType.java +@@ -1,9 +1,10 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents the two types of coal + */ +diff --git a/src/main/java/org/bukkit/Color.java b/src/main/java/org/bukkit/Color.java +index deae003b7e9a96bbf1c0167d3e1d864e61b07f82..a0c4535901de29653cc10f8ec7b1349160d27256 100644 +--- a/src/main/java/org/bukkit/Color.java ++++ b/src/main/java/org/bukkit/Color.java +@@ -1,12 +1,13 @@ + package org.bukkit; + + import com.google.common.collect.ImmutableMap; +-import java.util.Map; + import org.apache.commons.lang.Validate; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.configuration.serialization.SerializableAs; + import org.jetbrains.annotations.NotNull; + ++import java.util.Map; ++ + /** + * A container for a color palette. This class is immutable; the set methods + * return a new color. The color names listed as fields are HTML4 standards, +diff --git a/src/main/java/org/bukkit/CropState.java b/src/main/java/org/bukkit/CropState.java +index fb4832fb796a38c0f5f51cf80a67259924f2c607..26cc005e6c2d26fbdd740baa0c9307df7de9d016 100644 +--- a/src/main/java/org/bukkit/CropState.java ++++ b/src/main/java/org/bukkit/CropState.java +@@ -1,9 +1,10 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents the different growth states of crops + */ +diff --git a/src/main/java/org/bukkit/Difficulty.java b/src/main/java/org/bukkit/Difficulty.java +index 3f6cbefc2b1414ba2dad709e79288013b3ef73be..b177e2ddd423986c921d5a1b22a75a37f066c970 100644 +--- a/src/main/java/org/bukkit/Difficulty.java ++++ b/src/main/java/org/bukkit/Difficulty.java +@@ -1,9 +1,10 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents the various difficulty levels that are available. + */ +diff --git a/src/main/java/org/bukkit/DyeColor.java b/src/main/java/org/bukkit/DyeColor.java +index bd213cabddd8752e609544f24cfba95405726155..9bf31a7ffe10e010a8e0ddc6461bd36f32b7a665 100644 +--- a/src/main/java/org/bukkit/DyeColor.java ++++ b/src/main/java/org/bukkit/DyeColor.java +@@ -1,10 +1,11 @@ + package org.bukkit; + + import com.google.common.collect.ImmutableMap; +-import java.util.Map; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * All supported color values for dyes and cloth + */ +diff --git a/src/main/java/org/bukkit/Effect.java b/src/main/java/org/bukkit/Effect.java +index d0c812c72967469122f7f276ced31cfb0e9482dc..6cdac6da8803393a1b92f97682f6ea2ba9f17122 100644 +--- a/src/main/java/org/bukkit/Effect.java ++++ b/src/main/java/org/bukkit/Effect.java +@@ -1,12 +1,13 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.bukkit.block.BlockFace; + import org.bukkit.potion.Potion; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * A list of effects that the server is able to send to players. + */ +diff --git a/src/main/java/org/bukkit/EntityEffect.java b/src/main/java/org/bukkit/EntityEffect.java +index 0d8ee0cb1aae826fae0a920cdbf4152550c7375c..52617422c933357f154b9feb15860767cdf46fe7 100644 +--- a/src/main/java/org/bukkit/EntityEffect.java ++++ b/src/main/java/org/bukkit/EntityEffect.java +@@ -1,25 +1,6 @@ + package org.bukkit; + +-import org.bukkit.entity.Ageable; +-import org.bukkit.entity.ArmorStand; +-import org.bukkit.entity.Cat; +-import org.bukkit.entity.Dolphin; +-import org.bukkit.entity.Entity; +-import org.bukkit.entity.Firework; +-import org.bukkit.entity.Fox; +-import org.bukkit.entity.Guardian; +-import org.bukkit.entity.IronGolem; +-import org.bukkit.entity.LivingEntity; +-import org.bukkit.entity.Player; +-import org.bukkit.entity.Rabbit; +-import org.bukkit.entity.Ravager; +-import org.bukkit.entity.Squid; +-import org.bukkit.entity.Tameable; +-import org.bukkit.entity.TippedArrow; +-import org.bukkit.entity.Villager; +-import org.bukkit.entity.Witch; +-import org.bukkit.entity.Wolf; +-import org.bukkit.entity.ZombieVillager; ++import org.bukkit.entity.*; + import org.jetbrains.annotations.NotNull; + + /** +diff --git a/src/main/java/org/bukkit/FireworkEffect.java b/src/main/java/org/bukkit/FireworkEffect.java +index 0ae437c0c5052780bd0c78cdd542f62d75796527..bd0d18d24b94f7412782749e94f73958396bc363 100644 +--- a/src/main/java/org/bukkit/FireworkEffect.java ++++ b/src/main/java/org/bukkit/FireworkEffect.java +@@ -2,13 +2,14 @@ package org.bukkit; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; +-import java.util.List; +-import java.util.Map; + import org.apache.commons.lang.Validate; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.configuration.serialization.SerializableAs; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++import java.util.Map; ++ + /** + * Represents a single firework effect. + */ +diff --git a/src/main/java/org/bukkit/GameMode.java b/src/main/java/org/bukkit/GameMode.java +index 938c3217f92e6d3ef9a637269c469f8359af6347..a2cb54fc8a3327fb8806ed35240d8ffb32ab21e6 100644 +--- a/src/main/java/org/bukkit/GameMode.java ++++ b/src/main/java/org/bukkit/GameMode.java +@@ -1,10 +1,11 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.bukkit.entity.HumanEntity; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents the various type of game modes that {@link HumanEntity}s may + * have +diff --git a/src/main/java/org/bukkit/GameRule.java b/src/main/java/org/bukkit/GameRule.java +index 720fe9f51753be28633ea380e732f676b3be4315..618b3419a5aa3198cb5f035dbb74a2ac03d393e6 100644 +--- a/src/main/java/org/bukkit/GameRule.java ++++ b/src/main/java/org/bukkit/GameRule.java +@@ -1,11 +1,12 @@ + package org.bukkit; + + import com.google.common.base.Preconditions; +-import java.util.HashMap; +-import java.util.Map; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++import java.util.Map; ++ + /** + * GameRules dictate certain behavior within Minecraft itself + *
+diff --git a/src/main/java/org/bukkit/GrassSpecies.java b/src/main/java/org/bukkit/GrassSpecies.java +index f9c9ae463aacd593e3aa9caf037ea1e23d56c780..280ab1c5c45be7f3094a2d6f4dca20240be4dd7b 100644 +--- a/src/main/java/org/bukkit/GrassSpecies.java ++++ b/src/main/java/org/bukkit/GrassSpecies.java +@@ -1,9 +1,10 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents the different types of grass. + */ +diff --git a/src/main/java/org/bukkit/Instrument.java b/src/main/java/org/bukkit/Instrument.java +index 92194803bcdfbcfdb99567835906ce9219eabd04..dbd66fe1271e8455334f9b57ca9c14fb193d130b 100644 +--- a/src/main/java/org/bukkit/Instrument.java ++++ b/src/main/java/org/bukkit/Instrument.java +@@ -1,9 +1,10 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + public enum Instrument { + + /** +diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java +index ec9eb042ee8354d17f8ad4230c4acc5fcb46f894..14f93ff9b7d650fbfbd6a0e697bf526085810817 100644 +--- a/src/main/java/org/bukkit/Location.java ++++ b/src/main/java/org/bukkit/Location.java +@@ -1,25 +1,22 @@ + package org.bukkit; + + import com.google.common.base.Preconditions; +-import java.lang.ref.Reference; +-import java.lang.ref.WeakReference; +-import com.google.common.base.Preconditions; // Paper +-import java.util.HashMap; +-import java.util.Map; + import org.bukkit.block.Block; + import org.bukkit.configuration.serialization.ConfigurationSerializable; +-import org.bukkit.entity.Entity; // Paper ++import org.bukkit.entity.Entity; ++import org.bukkit.entity.LivingEntity; ++import org.bukkit.entity.Player; + import org.bukkit.util.NumberConversions; + import org.bukkit.util.Vector; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + +-// Paper start ++import java.lang.ref.Reference; ++import java.lang.ref.WeakReference; + import java.util.Collection; ++import java.util.HashMap; ++import java.util.Map; + import java.util.function.Predicate; +-import org.bukkit.entity.Entity; +-import org.bukkit.entity.LivingEntity; +-import org.bukkit.entity.Player; + // Paper end + + /** +diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java +index 3a8438fb674006a5cbfd977a1cd016117691f0ee..e9fc4d578f57fd29966632d6a3ae4f69d84774eb 100644 +--- a/src/main/java/org/bukkit/Material.java ++++ b/src/main/java/org/bukkit/Material.java +@@ -1,87 +1,18 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.lang.reflect.Constructor; +-import java.util.Locale; +-import java.util.Map; +-import java.util.function.Consumer; + import org.apache.commons.lang.Validate; +-import org.bukkit.block.data.Ageable; +-import org.bukkit.block.data.AnaloguePowerable; +-import org.bukkit.block.data.Bisected; +-import org.bukkit.block.data.BlockData; +-import org.bukkit.block.data.Directional; +-import org.bukkit.block.data.Levelled; +-import org.bukkit.block.data.Lightable; +-import org.bukkit.block.data.MultipleFacing; +-import org.bukkit.block.data.Orientable; +-import org.bukkit.block.data.Powerable; +-import org.bukkit.block.data.Rail; +-import org.bukkit.block.data.Rotatable; +-import org.bukkit.block.data.Snowable; +-import org.bukkit.block.data.Waterlogged; +-import org.bukkit.block.data.type.Bamboo; +-import org.bukkit.block.data.type.Bed; +-import org.bukkit.block.data.type.Beehive; +-import org.bukkit.block.data.type.Bell; +-import org.bukkit.block.data.type.BrewingStand; +-import org.bukkit.block.data.type.BubbleColumn; +-import org.bukkit.block.data.type.Cake; +-import org.bukkit.block.data.type.Campfire; +-import org.bukkit.block.data.type.Chest; +-import org.bukkit.block.data.type.Cocoa; +-import org.bukkit.block.data.type.CommandBlock; +-import org.bukkit.block.data.type.Comparator; +-import org.bukkit.block.data.type.CoralWallFan; +-import org.bukkit.block.data.type.DaylightDetector; +-import org.bukkit.block.data.type.Dispenser; +-import org.bukkit.block.data.type.Door; +-import org.bukkit.block.data.type.EndPortalFrame; +-import org.bukkit.block.data.type.EnderChest; +-import org.bukkit.block.data.type.Farmland; +-import org.bukkit.block.data.type.Fence; +-import org.bukkit.block.data.type.Fire; +-import org.bukkit.block.data.type.Furnace; +-import org.bukkit.block.data.type.Gate; +-import org.bukkit.block.data.type.GlassPane; +-import org.bukkit.block.data.type.Grindstone; +-import org.bukkit.block.data.type.Hopper; +-import org.bukkit.block.data.type.Jigsaw; +-import org.bukkit.block.data.type.Jukebox; +-import org.bukkit.block.data.type.Ladder; +-import org.bukkit.block.data.type.Lantern; +-import org.bukkit.block.data.type.Leaves; +-import org.bukkit.block.data.type.Lectern; +-import org.bukkit.block.data.type.NoteBlock; +-import org.bukkit.block.data.type.Observer; +-import org.bukkit.block.data.type.Piston; +-import org.bukkit.block.data.type.PistonHead; +-import org.bukkit.block.data.type.RedstoneRail; +-import org.bukkit.block.data.type.RedstoneWallTorch; +-import org.bukkit.block.data.type.RedstoneWire; +-import org.bukkit.block.data.type.Repeater; +-import org.bukkit.block.data.type.RespawnAnchor; +-import org.bukkit.block.data.type.Sapling; +-import org.bukkit.block.data.type.Scaffolding; +-import org.bukkit.block.data.type.SeaPickle; +-import org.bukkit.block.data.type.Sign; +-import org.bukkit.block.data.type.Slab; +-import org.bukkit.block.data.type.Snow; +-import org.bukkit.block.data.type.Stairs; +-import org.bukkit.block.data.type.StructureBlock; +-import org.bukkit.block.data.type.Switch; +-import org.bukkit.block.data.type.TNT; +-import org.bukkit.block.data.type.TechnicalPiston; +-import org.bukkit.block.data.type.TrapDoor; +-import org.bukkit.block.data.type.Tripwire; +-import org.bukkit.block.data.type.TripwireHook; +-import org.bukkit.block.data.type.TurtleEgg; +-import org.bukkit.block.data.type.Wall; +-import org.bukkit.block.data.type.WallSign; ++import org.bukkit.block.data.*; ++import org.bukkit.block.data.type.*; + import org.bukkit.material.MaterialData; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.lang.reflect.Constructor; ++import java.util.Locale; ++import java.util.Map; ++import java.util.function.Consumer; ++ + /** + * An enum of all material IDs accepted by the official server and client + */ +diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java +index 620a962df6d871c7a3b7728030a05ade772135c2..94de79b15353920ecb09b13807201ada70ee96d7 100644 +--- a/src/main/java/org/bukkit/NamespacedKey.java ++++ b/src/main/java/org/bukkit/NamespacedKey.java +@@ -1,11 +1,12 @@ + package org.bukkit; + + import com.google.common.base.Preconditions; ++import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; ++ + import java.util.Locale; + import java.util.UUID; + import java.util.regex.Pattern; +-import org.bukkit.plugin.Plugin; +-import org.jetbrains.annotations.NotNull; + + /** + * Represents a String based key which consists of two components - a namespace +diff --git a/src/main/java/org/bukkit/Note.java b/src/main/java/org/bukkit/Note.java +index b1c86aefb6481695959db81da70ee5452567cbf3..9885fc7dc2baa31f207e4c1681f94a9d383db381 100644 +--- a/src/main/java/org/bukkit/Note.java ++++ b/src/main/java/org/bukkit/Note.java +@@ -1,11 +1,12 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.apache.commons.lang.Validate; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * A note class to store a specific note. + */ +diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java +index 3afd5f5c0208a4ee93b5dbfc2aab2b9d2e8a7544..067e20e99c69fe743a9eeae78612ebd3e5698280 100644 +--- a/src/main/java/org/bukkit/OfflinePlayer.java ++++ b/src/main/java/org/bukkit/OfflinePlayer.java +@@ -1,6 +1,5 @@ + package org.bukkit; + +-import java.util.UUID; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.entity.AnimalTamer; + import org.bukkit.entity.EntityType; +@@ -9,6 +8,8 @@ import org.bukkit.permissions.ServerOperator; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.UUID; ++ + public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable { + + /** +diff --git a/src/main/java/org/bukkit/Raid.java b/src/main/java/org/bukkit/Raid.java +index 983a8c20a06d2b509602b27f49c090598b8ecc42..1890f5a0c4462ae6f43d1f4595ff33919b15fda5 100644 +--- a/src/main/java/org/bukkit/Raid.java ++++ b/src/main/java/org/bukkit/Raid.java +@@ -1,10 +1,11 @@ + package org.bukkit; + ++import org.bukkit.entity.Raider; ++import org.jetbrains.annotations.NotNull; ++ + import java.util.List; + import java.util.Set; + import java.util.UUID; +-import org.bukkit.entity.Raider; +-import org.jetbrains.annotations.NotNull; + + /** + * Represents a raid event. +diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java +index 91544ade419ddc3c1c4e7393b2d8aa5c64f1b916..495c36aee4c2590c62355d62daa8787ea057d191 100644 +--- a/src/main/java/org/bukkit/Registry.java ++++ b/src/main/java/org/bukkit/Registry.java +@@ -2,10 +2,6 @@ package org.bukkit; + + import com.google.common.base.Predicates; + import com.google.common.collect.ImmutableMap; +-import java.util.Arrays; +-import java.util.Iterator; +-import java.util.Map; +-import java.util.function.Predicate; + import org.bukkit.advancement.Advancement; + import org.bukkit.attribute.Attribute; + import org.bukkit.block.Biome; +@@ -18,6 +14,11 @@ import org.bukkit.loot.LootTables; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Arrays; ++import java.util.Iterator; ++import java.util.Map; ++import java.util.function.Predicate; ++ + /** + * Represents a registry of Bukkit objects that may be retrieved by + * {@link NamespacedKey}. +diff --git a/src/main/java/org/bukkit/SandstoneType.java b/src/main/java/org/bukkit/SandstoneType.java +index 6277451c3c6c551078c237cd767b6d70c4f585ea..17e6bf40b639fb4595c4871f4ff8a47582959a5b 100644 +--- a/src/main/java/org/bukkit/SandstoneType.java ++++ b/src/main/java/org/bukkit/SandstoneType.java +@@ -1,9 +1,10 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents the three different types of Sandstone + */ +diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java +index 1eb935b3ba88918f04a075d47b0f514ddc8f2499..49dc27a23957c2a8fdcafc11bbfa19fcb88e0540 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -1,26 +1,10 @@ + package org.bukkit; + + import com.google.common.collect.ImmutableList; +-import java.awt.image.BufferedImage; +-import java.io.File; +-import java.io.Serializable; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.UUID; +-import java.util.function.Consumer; +-import java.util.logging.Logger; + import org.bukkit.Warning.WarningState; + import org.bukkit.advancement.Advancement; + import org.bukkit.block.data.BlockData; +-import org.bukkit.boss.BarColor; +-import org.bukkit.boss.BarFlag; +-import org.bukkit.boss.BarStyle; +-import org.bukkit.boss.BossBar; +-import org.bukkit.boss.KeyedBossBar; ++import org.bukkit.boss.*; + import org.bukkit.command.CommandException; + import org.bukkit.command.CommandSender; + import org.bukkit.command.ConsoleCommandSender; +@@ -31,12 +15,7 @@ import org.bukkit.event.inventory.InventoryType; + import org.bukkit.event.server.ServerListPingEvent; + import org.bukkit.generator.ChunkGenerator; + import org.bukkit.help.HelpMap; +-import org.bukkit.inventory.Inventory; +-import org.bukkit.inventory.InventoryHolder; +-import org.bukkit.inventory.ItemFactory; +-import org.bukkit.inventory.ItemStack; +-import org.bukkit.inventory.Merchant; +-import org.bukkit.inventory.Recipe; ++import org.bukkit.inventory.*; + import org.bukkit.inventory.meta.ItemMeta; + import org.bukkit.loot.LootTable; + import org.bukkit.map.MapView; +@@ -52,6 +31,13 @@ import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.awt.image.BufferedImage; ++import java.io.File; ++import java.io.Serializable; ++import java.util.*; ++import java.util.function.Consumer; ++import java.util.logging.Logger; ++ + /** + * Represents a server implementation. + */ +diff --git a/src/main/java/org/bukkit/Statistic.java b/src/main/java/org/bukkit/Statistic.java +index 5cb41f417eb87d4aecd61de30f2a44cec5a9a4cd..6e6b0c0d895189d54f413318896dc0b6c8325fe4 100644 +--- a/src/main/java/org/bukkit/Statistic.java ++++ b/src/main/java/org/bukkit/Statistic.java +@@ -1,8 +1,9 @@ + package org.bukkit; + +-import java.util.Locale; + import org.jetbrains.annotations.NotNull; + ++import java.util.Locale; ++ + /** + * Represents a countable statistic, which is tracked by the server. + */ +diff --git a/src/main/java/org/bukkit/StructureType.java b/src/main/java/org/bukkit/StructureType.java +index 8acb2b9de398ab5f4b18c46e9ab9eb964df8be3f..6b047565135acc4e5d869127079ec5e82b0f1df4 100644 +--- a/src/main/java/org/bukkit/StructureType.java ++++ b/src/main/java/org/bukkit/StructureType.java +@@ -2,14 +2,15 @@ package org.bukkit; + + import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableMap; +-import java.util.HashMap; +-import java.util.Map; +-import java.util.Objects; + import org.apache.commons.lang.Validate; + import org.bukkit.map.MapCursor; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++import java.util.Map; ++import java.util.Objects; ++ + /** + * This class handles the creation and storage of all structure types for + * Bukkit. Structure Types are the different kinds of structures that can be +diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java +index 8ad4bd9ac9c19f92822a5562ca909e2fd293ee46..341d912d6bc1b58d5847447d17fa7f8e82ee7db2 100644 +--- a/src/main/java/org/bukkit/Tag.java ++++ b/src/main/java/org/bukkit/Tag.java +@@ -1,8 +1,9 @@ + package org.bukkit; + +-import java.util.Set; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * Represents a tag that may be defined by the server or a resource pack to + * group like things together. +diff --git a/src/main/java/org/bukkit/TreeSpecies.java b/src/main/java/org/bukkit/TreeSpecies.java +index 2b177f98a74612ddc192745bcbb689ebdb1e104a..1c4ed7e2286c164882cd7598bd6dcbee080c6ad4 100644 +--- a/src/main/java/org/bukkit/TreeSpecies.java ++++ b/src/main/java/org/bukkit/TreeSpecies.java +@@ -1,9 +1,10 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents the different species of trees regardless of size. + */ +diff --git a/src/main/java/org/bukkit/Warning.java b/src/main/java/org/bukkit/Warning.java +index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..62d6a927fdf3dd177ade65b4062a00a8c1d70a35 100644 +--- a/src/main/java/org/bukkit/Warning.java ++++ b/src/main/java/org/bukkit/Warning.java +@@ -1,13 +1,14 @@ + package org.bukkit; + + import com.google.common.collect.ImmutableMap; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ + import java.lang.annotation.ElementType; + import java.lang.annotation.Retention; + import java.lang.annotation.RetentionPolicy; + import java.lang.annotation.Target; + import java.util.Map; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + /** + * This designates the warning state for a specific item. +diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java +index 75c9225bd07b4c4b6dcd702c52294a7637eb6884..ffcd103f689d2632972ae171fe79d8316ce1768c 100644 +--- a/src/main/java/org/bukkit/World.java ++++ b/src/main/java/org/bukkit/World.java +@@ -1,30 +1,11 @@ + package org.bukkit; + +-import java.io.File; +- +-import org.bukkit.event.entity.CreatureSpawnEvent; +-import org.bukkit.generator.ChunkGenerator; +- +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.UUID; +-import java.util.function.Predicate; + import org.bukkit.block.Biome; + import org.bukkit.block.Block; + import org.bukkit.block.data.BlockData; + import org.bukkit.boss.DragonBattle; +-import org.bukkit.entity.AbstractArrow; +-import org.bukkit.entity.Arrow; +-import org.bukkit.entity.Entity; +-import org.bukkit.entity.EntityType; +-import org.bukkit.entity.FallingBlock; +-import org.bukkit.entity.Item; +-import org.bukkit.entity.LightningStrike; +-import org.bukkit.entity.LivingEntity; +-import org.bukkit.entity.Player; ++import org.bukkit.entity.*; ++import org.bukkit.event.entity.CreatureSpawnEvent; + import org.bukkit.generator.BlockPopulator; + import org.bukkit.generator.ChunkGenerator; + import org.bukkit.inventory.ItemStack; +@@ -40,6 +21,10 @@ import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.io.File; ++import java.util.*; ++import java.util.function.Predicate; ++ + /** + * Represents a world, which may contain entities, chunks and blocks + */ +diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java +index 6e6945dd4c770be04ec09da3958fae751717527a..d94b0564b662e6ab5332fd81aeb00672e1718032 100644 +--- a/src/main/java/org/bukkit/WorldCreator.java ++++ b/src/main/java/org/bukkit/WorldCreator.java +@@ -1,12 +1,13 @@ + package org.bukkit; + +-import java.util.Random; + import org.bukkit.command.CommandSender; + import org.bukkit.generator.ChunkGenerator; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Random; ++ + /** + * Represents various types of options that may be used to create a world. + */ +diff --git a/src/main/java/org/bukkit/WorldType.java b/src/main/java/org/bukkit/WorldType.java +index c48b5579f78760e93dc0ca71223ea5a5ce394873..9f6ac5333a190fcac342fc332dd6592f24205ef0 100644 +--- a/src/main/java/org/bukkit/WorldType.java ++++ b/src/main/java/org/bukkit/WorldType.java +@@ -1,10 +1,11 @@ + package org.bukkit; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents various types of worlds that may exist + */ +diff --git a/src/main/java/org/bukkit/advancement/Advancement.java b/src/main/java/org/bukkit/advancement/Advancement.java +index 7c5009974ac8d64d0e738e60cec45acb0d4ca89a..e4665e99b954f6b78374fb543be86d9f5eb64ee7 100644 +--- a/src/main/java/org/bukkit/advancement/Advancement.java ++++ b/src/main/java/org/bukkit/advancement/Advancement.java +@@ -1,9 +1,10 @@ + package org.bukkit.advancement; + +-import java.util.Collection; + import org.bukkit.Keyed; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++ + /** + * Represents an advancement that may be awarded to a player. This class is not + * reference safe as the underlying advancement may be reloaded. +diff --git a/src/main/java/org/bukkit/advancement/AdvancementProgress.java b/src/main/java/org/bukkit/advancement/AdvancementProgress.java +index f9bc179da071e7bd57cefc50d6763317fb643b74..00823dc9b8bde870a0447becb8d89d51e6f73547 100644 +--- a/src/main/java/org/bukkit/advancement/AdvancementProgress.java ++++ b/src/main/java/org/bukkit/advancement/AdvancementProgress.java +@@ -1,10 +1,11 @@ + package org.bukkit.advancement; + +-import java.util.Collection; +-import java.util.Date; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++import java.util.Date; ++ + /** + * The individual status of an advancement for a player. This class is not + * reference safe as the underlying advancement may be reloaded. +diff --git a/src/main/java/org/bukkit/attribute/AttributeInstance.java b/src/main/java/org/bukkit/attribute/AttributeInstance.java +index f08ee26cc4d479e1bfc5264b8cbe721315de91f2..18bafb04e6e946c05be27a6f71ed75a4bb80db7c 100644 +--- a/src/main/java/org/bukkit/attribute/AttributeInstance.java ++++ b/src/main/java/org/bukkit/attribute/AttributeInstance.java +@@ -1,8 +1,9 @@ + package org.bukkit.attribute; + +-import java.util.Collection; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++ + /** + * Represents a mutable instance of an attribute and its associated modifiers + * and values. +diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java +index f0dff145a8c5ae729de5e5f547fff60333c6501e..014e2ebd343130c6c484201c641f65956e210ee6 100644 +--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java ++++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java +@@ -1,9 +1,5 @@ + package org.bukkit.attribute; + +-import java.util.HashMap; +-import java.util.Map; +-import java.util.Objects; +-import java.util.UUID; + import org.apache.commons.lang.Validate; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.inventory.EquipmentSlot; +@@ -11,6 +7,11 @@ import org.bukkit.util.NumberConversions; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++import java.util.Map; ++import java.util.Objects; ++import java.util.UUID; ++ + /** + * Concrete implementation of an attribute modifier. + */ +diff --git a/src/main/java/org/bukkit/block/Banner.java b/src/main/java/org/bukkit/block/Banner.java +index e6eb3c04b9fa6cd232f95dd5851d365234972efd..9313ea62db43fc3960a1650862349f3cca30d258 100644 +--- a/src/main/java/org/bukkit/block/Banner.java ++++ b/src/main/java/org/bukkit/block/Banner.java +@@ -1,10 +1,11 @@ + package org.bukkit.block; + +-import java.util.List; + import org.bukkit.DyeColor; + import org.bukkit.block.banner.Pattern; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Represents a captured state of a banner. + */ +diff --git a/src/main/java/org/bukkit/block/Beacon.java b/src/main/java/org/bukkit/block/Beacon.java +index 6349fa9da3f96df3553fb9552c1cab95338cecb0..e85183e91b4de88d5674bd34f53a58f26e8a2a42 100644 +--- a/src/main/java/org/bukkit/block/Beacon.java ++++ b/src/main/java/org/bukkit/block/Beacon.java +@@ -1,6 +1,5 @@ + package org.bukkit.block; + +-import java.util.Collection; + import org.bukkit.Nameable; + import org.bukkit.entity.LivingEntity; + import org.bukkit.potion.PotionEffect; +@@ -8,6 +7,8 @@ import org.bukkit.potion.PotionEffectType; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++ + /** + * Represents a captured state of a beacon. + */ +diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java +index 52a527bb5f6e5b133d9f75556bf72242928b703b..7a303067958c774b420aa91de186e1a435f8b4ee 100644 +--- a/src/main/java/org/bukkit/block/Biome.java ++++ b/src/main/java/org/bukkit/block/Biome.java +@@ -1,10 +1,11 @@ + package org.bukkit.block; + +-import java.util.Locale; + import org.bukkit.Keyed; + import org.bukkit.NamespacedKey; + import org.jetbrains.annotations.NotNull; + ++import java.util.Locale; ++ + /** + * Holds all accepted Biomes in the default server + */ +diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java +index 999f2a362c62cf58752d9c3d378aafe6754d2aaf..297e60157ce3eca48716248b11daae7ad85f709a 100644 +--- a/src/main/java/org/bukkit/block/Block.java ++++ b/src/main/java/org/bukkit/block/Block.java +@@ -1,12 +1,6 @@ + package org.bukkit.block; + +-import java.util.Collection; +- +-import org.bukkit.Chunk; +-import org.bukkit.FluidCollisionMode; +-import org.bukkit.Location; +-import org.bukkit.Material; +-import org.bukkit.World; ++import org.bukkit.*; + import org.bukkit.block.data.Bisected; + import org.bukkit.block.data.BlockData; + import org.bukkit.entity.Entity; +@@ -19,6 +13,8 @@ import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++ + /** + * Represents a block. This is a live object, and only one Block may exist for + * any given location in a world. The state of the block may change +diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java +index db6affbc78106b2d93b41953b624a0bca0ca1d72..cb9380acda62e20fba4bbca08126e1d932f0bee3 100644 +--- a/src/main/java/org/bukkit/block/Chest.java ++++ b/src/main/java/org/bukkit/block/Chest.java +@@ -1,9 +1,7 @@ + package org.bukkit.block; + +-import com.destroystokyo.paper.loottable.LootableBlockInventory; // Paper +-import org.bukkit.Nameable; // Paper ++import com.destroystokyo.paper.loottable.LootableBlockInventory; + import org.bukkit.inventory.Inventory; +-import org.bukkit.loot.Lootable; + import org.jetbrains.annotations.NotNull; + + /** +diff --git a/src/main/java/org/bukkit/block/Dispenser.java b/src/main/java/org/bukkit/block/Dispenser.java +index 07af1a3f011d4b96275f919d302ac367198e923e..66f39dd6252ab2d3938ff08caa9f7f90cc8aaf8f 100644 +--- a/src/main/java/org/bukkit/block/Dispenser.java ++++ b/src/main/java/org/bukkit/block/Dispenser.java +@@ -2,7 +2,6 @@ package org.bukkit.block; + + import com.destroystokyo.paper.loottable.LootableBlockInventory; + import org.bukkit.Nameable; +-import org.bukkit.loot.Lootable; + import org.bukkit.projectiles.BlockProjectileSource; + import org.jetbrains.annotations.Nullable; + +diff --git a/src/main/java/org/bukkit/block/Dropper.java b/src/main/java/org/bukkit/block/Dropper.java +index c76202321e29ad67597ca3017eb8d9baf6787383..4c1930410a172c649ad7900089264481fc154f28 100644 +--- a/src/main/java/org/bukkit/block/Dropper.java ++++ b/src/main/java/org/bukkit/block/Dropper.java +@@ -1,7 +1,6 @@ + package org.bukkit.block; + + import com.destroystokyo.paper.loottable.LootableBlockInventory; +-import org.bukkit.loot.Lootable; + + /** + * Represents a captured state of a dropper. +diff --git a/src/main/java/org/bukkit/block/EntityBlockStorage.java b/src/main/java/org/bukkit/block/EntityBlockStorage.java +index f3f8d765d5d487aa14edf0b88c32608fb804c331..46ced8da164ce79336fb91169630d3334883ff7d 100644 +--- a/src/main/java/org/bukkit/block/EntityBlockStorage.java ++++ b/src/main/java/org/bukkit/block/EntityBlockStorage.java +@@ -1,9 +1,10 @@ + package org.bukkit.block; + +-import java.util.List; + import org.bukkit.entity.Entity; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Represents a captured state of a block which stores entities. + * +diff --git a/src/main/java/org/bukkit/block/Hopper.java b/src/main/java/org/bukkit/block/Hopper.java +index 7ade312f180b7e30871d3a3240c76325cc369c26..58b6bed58a623b77a15e739d32b2057d7956a9c9 100644 +--- a/src/main/java/org/bukkit/block/Hopper.java ++++ b/src/main/java/org/bukkit/block/Hopper.java +@@ -1,7 +1,6 @@ + package org.bukkit.block; + + import com.destroystokyo.paper.loottable.LootableBlockInventory; +-import org.bukkit.loot.Lootable; + + /** + * Represents a captured state of a hopper. +diff --git a/src/main/java/org/bukkit/block/PistonMoveReaction.java b/src/main/java/org/bukkit/block/PistonMoveReaction.java +index b90f5dc345ad2cdd3ae353dc57f42a14c231d18a..02df8868246b1ac883c600a921388284f791f241 100644 +--- a/src/main/java/org/bukkit/block/PistonMoveReaction.java ++++ b/src/main/java/org/bukkit/block/PistonMoveReaction.java +@@ -1,8 +1,9 @@ + package org.bukkit.block; + ++import org.jetbrains.annotations.Nullable; ++ + import java.util.HashMap; + import java.util.Map; +-import org.jetbrains.annotations.Nullable; + + /** + * Represents how a block or entity will react when interacting with a piston +diff --git a/src/main/java/org/bukkit/block/ShulkerBox.java b/src/main/java/org/bukkit/block/ShulkerBox.java +index 172f383fea619127324fec2b043639fd0683f135..4be2b7719c632c640668f5af951643e223e78e44 100644 +--- a/src/main/java/org/bukkit/block/ShulkerBox.java ++++ b/src/main/java/org/bukkit/block/ShulkerBox.java +@@ -2,7 +2,6 @@ package org.bukkit.block; + + import com.destroystokyo.paper.loottable.LootableBlockInventory; + import org.bukkit.DyeColor; +-import org.bukkit.loot.Lootable; + import org.jetbrains.annotations.NotNull; + + /** +diff --git a/src/main/java/org/bukkit/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java +index a6914f01e01e9103702185f92b0209b3c84c152a..5d07bf9a002dd8758d0998c899cf9a7e27ed9a92 100644 +--- a/src/main/java/org/bukkit/block/Skull.java ++++ b/src/main/java/org/bukkit/block/Skull.java +@@ -1,5 +1,6 @@ + package org.bukkit.block; + ++import com.destroystokyo.paper.profile.PlayerProfile; + import org.bukkit.Material; + import org.bukkit.OfflinePlayer; + import org.bukkit.SkullType; +@@ -7,7 +8,6 @@ import org.bukkit.block.data.BlockData; + import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; +-import com.destroystokyo.paper.profile.PlayerProfile; // Paper + + /** + * Represents a captured state of a skull block. +diff --git a/src/main/java/org/bukkit/block/banner/Pattern.java b/src/main/java/org/bukkit/block/banner/Pattern.java +index 5c293ab0b7505267dda019c3e60d3b053c0fdd27..e5327b59cfb7b5ed547e34a8c02d293a9b6fd22d 100644 +--- a/src/main/java/org/bukkit/block/banner/Pattern.java ++++ b/src/main/java/org/bukkit/block/banner/Pattern.java +@@ -1,13 +1,14 @@ + package org.bukkit.block.banner; + + import com.google.common.collect.ImmutableMap; +-import java.util.Map; +-import java.util.NoSuchElementException; + import org.bukkit.DyeColor; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.configuration.serialization.SerializableAs; + import org.jetbrains.annotations.NotNull; + ++import java.util.Map; ++import java.util.NoSuchElementException; ++ + @SerializableAs("Pattern") + public class Pattern implements ConfigurationSerializable { + +diff --git a/src/main/java/org/bukkit/block/banner/PatternType.java b/src/main/java/org/bukkit/block/banner/PatternType.java +index e6ce94ed2a4d64204aac60c4b2dc138f258e4720..d53ee8f7f10aef1a1629a2b094c0a5a22e858132 100644 +--- a/src/main/java/org/bukkit/block/banner/PatternType.java ++++ b/src/main/java/org/bukkit/block/banner/PatternType.java +@@ -1,11 +1,12 @@ + package org.bukkit.block.banner; + +-import java.util.HashMap; +-import java.util.Map; + import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++import java.util.Map; ++ + public enum PatternType { + BASE("b"), + SQUARE_BOTTOM_LEFT("bl"), +diff --git a/src/main/java/org/bukkit/block/data/Directional.java b/src/main/java/org/bukkit/block/data/Directional.java +index 825ff08ddd1d0b2448a3ccc2e821af4ae6c97048..4cd48c762a10c523564a63d2296baf3f00d56ced 100644 +--- a/src/main/java/org/bukkit/block/data/Directional.java ++++ b/src/main/java/org/bukkit/block/data/Directional.java +@@ -1,9 +1,10 @@ + package org.bukkit.block.data; + +-import java.util.Set; + import org.bukkit.block.BlockFace; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * 'facing' represents the face towards which the block is pointing. + *
+diff --git a/src/main/java/org/bukkit/block/data/MultipleFacing.java b/src/main/java/org/bukkit/block/data/MultipleFacing.java +index e10a52555b21f176bd89c0bbb0a7719ab13b0507..48db270aff771277af95628691cfb2a012627569 100644 +--- a/src/main/java/org/bukkit/block/data/MultipleFacing.java ++++ b/src/main/java/org/bukkit/block/data/MultipleFacing.java +@@ -1,9 +1,10 @@ + package org.bukkit.block.data; + +-import java.util.Set; + import org.bukkit.block.BlockFace; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * This class encompasses the 'north', 'east', 'south', 'west', 'up', 'down' + * boolean flags which are used to set which faces of the block textures are +diff --git a/src/main/java/org/bukkit/block/data/Orientable.java b/src/main/java/org/bukkit/block/data/Orientable.java +index 5b4561a16583347578f7eb8d5e0d8c24c693bd98..5c7df38a619c90144e9b19a4b887b0442a10eee3 100644 +--- a/src/main/java/org/bukkit/block/data/Orientable.java ++++ b/src/main/java/org/bukkit/block/data/Orientable.java +@@ -1,9 +1,10 @@ + package org.bukkit.block.data; + +-import java.util.Set; + import org.bukkit.Axis; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * 'axis' represents the axis along whilst this block is oriented. + *
+diff --git a/src/main/java/org/bukkit/block/data/Rail.java b/src/main/java/org/bukkit/block/data/Rail.java +index b89938800152df6d3b83639dfd03058106d8fe41..e8300a7414b61699b458eb410fa3fd4b0d0b9ab7 100644 +--- a/src/main/java/org/bukkit/block/data/Rail.java ++++ b/src/main/java/org/bukkit/block/data/Rail.java +@@ -1,8 +1,9 @@ + package org.bukkit.block.data; + +-import java.util.Set; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * 'shape' represents the current layout of a minecart rail. + *
+diff --git a/src/main/java/org/bukkit/block/data/type/BrewingStand.java b/src/main/java/org/bukkit/block/data/type/BrewingStand.java +index 6a7687d5248eff11fca1e41d1cc6be2ffde1aab0..57e892911d93c288c6f8dd1a0ec0ee0e913e3ede 100644 +--- a/src/main/java/org/bukkit/block/data/type/BrewingStand.java ++++ b/src/main/java/org/bukkit/block/data/type/BrewingStand.java +@@ -1,9 +1,10 @@ + package org.bukkit.block.data.type; + +-import java.util.Set; + import org.bukkit.block.data.BlockData; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * Interface to the 'has_bottle_0', 'has_bottle_1', 'has_bottle_2' flags on a + * brewing stand which indicate which bottles are rendered on the outside. +diff --git a/src/main/java/org/bukkit/block/data/type/RedstoneWire.java b/src/main/java/org/bukkit/block/data/type/RedstoneWire.java +index ba8a80ee3ea3975e358b56f38255913fd1342af5..f3e98e4b96758ccf1bef7c18b05809fb15017b4c 100644 +--- a/src/main/java/org/bukkit/block/data/type/RedstoneWire.java ++++ b/src/main/java/org/bukkit/block/data/type/RedstoneWire.java +@@ -1,10 +1,11 @@ + package org.bukkit.block.data.type; + +-import java.util.Set; + import org.bukkit.block.BlockFace; + import org.bukkit.block.data.AnaloguePowerable; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * 'north', 'east', 'south', 'west' represent the types of connections this + * redstone wire has to adjacent blocks. +diff --git a/src/main/java/org/bukkit/block/data/type/TrapDoor.java b/src/main/java/org/bukkit/block/data/type/TrapDoor.java +index 13876b37984dc35bf7424128116a24528c549638..a4f17715bfa495cd0ad88c31dc13bf993323b4a5 100644 +--- a/src/main/java/org/bukkit/block/data/type/TrapDoor.java ++++ b/src/main/java/org/bukkit/block/data/type/TrapDoor.java +@@ -1,10 +1,6 @@ + package org.bukkit.block.data.type; + +-import org.bukkit.block.data.Bisected; +-import org.bukkit.block.data.Directional; +-import org.bukkit.block.data.Openable; +-import org.bukkit.block.data.Powerable; +-import org.bukkit.block.data.Waterlogged; ++import org.bukkit.block.data.*; + + public interface TrapDoor extends Bisected, Directional, Openable, Powerable, Waterlogged { + } +diff --git a/src/main/java/org/bukkit/boss/BossBar.java b/src/main/java/org/bukkit/boss/BossBar.java +index 70274f2e2a1d6f27c4febd9d5d5fa3ee1b49f100..1d3398500bab55fdf04f890cdc3c62d29dd2303b 100644 +--- a/src/main/java/org/bukkit/boss/BossBar.java ++++ b/src/main/java/org/bukkit/boss/BossBar.java +@@ -1,10 +1,11 @@ + package org.bukkit.boss; + +-import java.util.List; + import org.bukkit.entity.Player; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + public interface BossBar { + + /** +diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java +index c10fc8d2386301bc2caddcdb1cd18566bcaa8689..7013fdab5474905d59d238f1f16e5a4f49b15d5e 100644 +--- a/src/main/java/org/bukkit/command/Command.java ++++ b/src/main/java/org/bukkit/command/Command.java +@@ -1,16 +1,8 @@ + package org.bukkit.command; + + import com.google.common.collect.ImmutableList; +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.List; +-import java.util.Set; + import org.apache.commons.lang.Validate; +-import org.bukkit.Bukkit; +-import org.bukkit.ChatColor; +-import org.bukkit.GameRule; +-import org.bukkit.Location; +-import org.bukkit.Server; ++import org.bukkit.*; + import org.bukkit.entity.Player; + import org.bukkit.entity.minecart.CommandMinecart; + import org.bukkit.permissions.Permissible; +@@ -19,6 +11,11 @@ import org.bukkit.util.StringUtil; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.List; ++import java.util.Set; ++ + /** + * Represents a Command, which executes various tasks upon user input + */ +diff --git a/src/main/java/org/bukkit/command/CommandMap.java b/src/main/java/org/bukkit/command/CommandMap.java +index 864c263bbd4dd6dd7c37a74b39b1a40a884d0731..6150d764d7dd47005242c210cfdb755378091c44 100644 +--- a/src/main/java/org/bukkit/command/CommandMap.java ++++ b/src/main/java/org/bukkit/command/CommandMap.java +@@ -1,10 +1,11 @@ + package org.bukkit.command; + +-import java.util.List; + import org.bukkit.Location; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + public interface CommandMap { + + /** +diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java +index 9d4f553c04784cca63901a56a7aea62a5cae1d72..b21531e3a382c6ba8adabe0a5ec6ed860f5a27ea 100644 +--- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java ++++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java +@@ -1,12 +1,12 @@ + package org.bukkit.command; + +-import java.util.ArrayList; +-import java.util.regex.Matcher; // Paper +-import java.util.regex.Pattern; // Paper +- + import org.bukkit.Bukkit; + import org.jetbrains.annotations.NotNull; + ++import java.util.ArrayList; ++import java.util.regex.Matcher; ++import java.util.regex.Pattern; ++ + public class FormattedCommandAlias extends Command { + private final String[] formatStrings; + +diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java +index ca1893e9fb41baae0d103f1a925e33f3dfa273be..2e852d6ec00f7a58bf77841bb8ca94deb114f5c2 100644 +--- a/src/main/java/org/bukkit/command/MessageCommandSender.java ++++ b/src/main/java/org/bukkit/command/MessageCommandSender.java +@@ -7,9 +7,9 @@ import org.bukkit.permissions.Permission; + import org.bukkit.permissions.PermissionAttachment; + import org.bukkit.permissions.PermissionAttachmentInfo; + import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; + + import java.util.Set; +-import org.jetbrains.annotations.NotNull; + + /** + * For when all you care about is just messaging +diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java +index 7f153000eee0f563ee4f1e3c218aadb5b6a33a97..81e33a1c7b4ce99596109109ae7670b727365094 100644 +--- a/src/main/java/org/bukkit/command/PluginCommand.java ++++ b/src/main/java/org/bukkit/command/PluginCommand.java +@@ -1,11 +1,12 @@ + package org.bukkit.command; + +-import java.util.List; + import org.apache.commons.lang.Validate; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Represents a {@link Command} belonging to a plugin + */ +diff --git a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java +index a542c4bb3c973bbe4b976642feccde6a4d90cb7b..2f776eacaaa37a5e052a8dc11f43fa1dd3045dd1 100644 +--- a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java ++++ b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java +@@ -1,12 +1,13 @@ + package org.bukkit.command; + ++import org.bukkit.Bukkit; ++import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; ++ + import java.util.ArrayList; + import java.util.List; + import java.util.Map; + import java.util.Map.Entry; +-import org.bukkit.Bukkit; +-import org.bukkit.plugin.Plugin; +-import org.jetbrains.annotations.NotNull; + + public class PluginCommandYamlParser { + +diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java +index 460fda05a62b12db2edcfb7ea8b2a5dd8e4b110d..fcbc298043614da5f4bd849e9f65961da276e15e 100644 +--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java ++++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java +@@ -1,30 +1,19 @@ + package org.bukkit.command; + +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.HashMap; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +- + import com.destroystokyo.paper.event.server.ServerExceptionEvent; + import com.destroystokyo.paper.exception.ServerCommandException; + import com.destroystokyo.paper.exception.ServerTabCompleteException; + import org.apache.commons.lang.Validate; + import org.bukkit.Location; + import org.bukkit.Server; +-import org.bukkit.command.defaults.BukkitCommand; +-import org.bukkit.command.defaults.HelpCommand; +-import org.bukkit.command.defaults.PluginsCommand; +-import org.bukkit.command.defaults.ReloadCommand; +-import org.bukkit.command.defaults.VersionCommand; ++import org.bukkit.command.defaults.*; + import org.bukkit.entity.Player; + import org.bukkit.util.StringUtil; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.*; ++ + public class SimpleCommandMap implements CommandMap { + protected final Map knownCommands = new HashMap(); + private final Server server; +diff --git a/src/main/java/org/bukkit/command/TabCompleter.java b/src/main/java/org/bukkit/command/TabCompleter.java +index e9cf71f5ce9d7fd193c7423300ddbf5c77c9accf..80127fda31e25974c445b5e932130740c1621cad 100644 +--- a/src/main/java/org/bukkit/command/TabCompleter.java ++++ b/src/main/java/org/bukkit/command/TabCompleter.java +@@ -1,9 +1,10 @@ + package org.bukkit.command; + +-import java.util.List; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Represents a class which can suggest tab completions for commands. + */ +diff --git a/src/main/java/org/bukkit/command/defaults/BukkitCommand.java b/src/main/java/org/bukkit/command/defaults/BukkitCommand.java +index cb032d038f52e6b9cf51c203cfc01cc4a7622772..a776bf9e511ec8eca8e59b5966fe7e676fccc5d6 100644 +--- a/src/main/java/org/bukkit/command/defaults/BukkitCommand.java ++++ b/src/main/java/org/bukkit/command/defaults/BukkitCommand.java +@@ -1,9 +1,10 @@ + package org.bukkit.command.defaults; + +-import java.util.List; + import org.bukkit.command.Command; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + public abstract class BukkitCommand extends Command { + protected BukkitCommand(@NotNull String name) { + super(name); +diff --git a/src/main/java/org/bukkit/command/defaults/HelpCommand.java b/src/main/java/org/bukkit/command/defaults/HelpCommand.java +index 98027fdd8dbd2c0ed84a065f7b991738ee397a66..e9da1efa1229ef0ffad16478dcb0679731585104 100644 +--- a/src/main/java/org/bukkit/command/defaults/HelpCommand.java ++++ b/src/main/java/org/bukkit/command/defaults/HelpCommand.java +@@ -1,13 +1,6 @@ + package org.bukkit.command.defaults; + + import com.google.common.collect.ImmutableList; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.TreeSet; + import org.apache.commons.lang.ArrayUtils; + import org.apache.commons.lang.StringUtils; + import org.apache.commons.lang.Validate; +@@ -24,6 +17,8 @@ import org.bukkit.util.ChatPaginator; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.*; ++ + public class HelpCommand extends BukkitCommand { + public HelpCommand() { + super("help"); +diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +index cbcdca042b54531fdf45e8631c4bbe8c74f68341..423ad250e06acb3a57a8a618e8d52f9a9d92483b 100644 +--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java ++++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +@@ -1,24 +1,19 @@ + package org.bukkit.command.defaults; + +-import java.util.Arrays; +-import java.util.Collections; +-import java.util.List; +-import java.util.Map; +-import java.util.TreeMap; +- +-import org.bukkit.Bukkit; +-import org.bukkit.ChatColor; +-import org.bukkit.command.CommandSender; +-import org.bukkit.plugin.Plugin; +-import org.jetbrains.annotations.NotNull; +-// Spigot start + import net.md_5.bungee.api.chat.BaseComponent; + import net.md_5.bungee.api.chat.ClickEvent; + import net.md_5.bungee.api.chat.ComponentBuilder; +-import net.md_5.bungee.api.chat.HoverEvent; + import net.md_5.bungee.api.chat.ComponentBuilder.FormatRetention; ++import net.md_5.bungee.api.chat.HoverEvent; ++import org.bukkit.Bukkit; ++import org.bukkit.ChatColor; ++import org.bukkit.command.CommandSender; + import org.bukkit.entity.Player; ++import org.bukkit.plugin.Plugin; + import org.bukkit.plugin.PluginDescriptionFile; ++import org.jetbrains.annotations.NotNull; ++ ++import java.util.*; + // Spigot end + + public class PluginsCommand extends BukkitCommand { +diff --git a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java +index 0c7ba0718de2b93d013968ca0fec34ffd423990f..4557d88d4970c672210062cd0f96e195f93f2219 100644 +--- a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java ++++ b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java +@@ -1,14 +1,14 @@ + package org.bukkit.command.defaults; + +-import java.util.Arrays; +-import java.util.Collections; +-import java.util.List; + import org.bukkit.Bukkit; + import org.bukkit.ChatColor; + import org.bukkit.command.Command; + import org.bukkit.command.CommandSender; + import org.jetbrains.annotations.NotNull; + ++import java.util.Arrays; ++import java.util.List; ++ + public class ReloadCommand extends BukkitCommand { + public ReloadCommand(@NotNull String name) { + super(name); +diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java +index a47ed6b290c051ff076900028b929745aac0ba55..96f5242c37142eed55fba90f8dc712c92aeaee88 100644 +--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java ++++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java +@@ -1,22 +1,12 @@ + package org.bukkit.command.defaults; + +-import com.destroystokyo.paper.util.VersionFetcher; // Paper - version supplier ++import com.destroystokyo.paper.util.VersionFetcher; + import com.google.common.base.Charsets; + import com.google.common.collect.ImmutableList; + import com.google.common.io.Resources; + import com.google.gson.Gson; + import com.google.gson.JsonObject; + import com.google.gson.JsonSyntaxException; +-import java.io.BufferedReader; +-import java.io.IOException; +-import java.net.URL; +-import java.net.URLEncoder; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.HashSet; +-import java.util.List; +-import java.util.Set; +-import java.util.concurrent.locks.ReentrantLock; + import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + import org.bukkit.ChatColor; +@@ -26,6 +16,13 @@ import org.bukkit.plugin.PluginDescriptionFile; + import org.bukkit.util.StringUtil; + import org.jetbrains.annotations.NotNull; + ++import java.io.BufferedReader; ++import java.io.IOException; ++import java.net.URL; ++import java.net.URLEncoder; ++import java.util.*; ++import java.util.concurrent.locks.ReentrantLock; ++ + public class VersionCommand extends BukkitCommand { + private VersionFetcher versionFetcher; + private VersionFetcher getVersionFetcher() { // lazy load because unsafe isn't available at command registration +diff --git a/src/main/java/org/bukkit/configuration/Configuration.java b/src/main/java/org/bukkit/configuration/Configuration.java +index f12a98b1beb20a039f9830a00be89742a307d9ad..8d27175296f3d36f02b2b3d2138cc5f22af7b40c 100644 +--- a/src/main/java/org/bukkit/configuration/Configuration.java ++++ b/src/main/java/org/bukkit/configuration/Configuration.java +@@ -1,9 +1,10 @@ + package org.bukkit.configuration; + +-import java.util.Map; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents a source of configurable options and settings + */ +diff --git a/src/main/java/org/bukkit/configuration/ConfigurationSection.java b/src/main/java/org/bukkit/configuration/ConfigurationSection.java +index 5a6e621d5876ce1ec5c5fb5559cb2bfa01ecba20..05222f3099a050e174a347c63c120b42bb54c87f 100644 +--- a/src/main/java/org/bukkit/configuration/ConfigurationSection.java ++++ b/src/main/java/org/bukkit/configuration/ConfigurationSection.java +@@ -1,8 +1,5 @@ + package org.bukkit.configuration; + +-import java.util.List; +-import java.util.Map; +-import java.util.Set; + import org.bukkit.Color; + import org.bukkit.Location; + import org.bukkit.OfflinePlayer; +@@ -12,6 +9,10 @@ import org.bukkit.util.Vector; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++import java.util.Map; ++import java.util.Set; ++ + /** + * Represents a section of a {@link Configuration} + */ +diff --git a/src/main/java/org/bukkit/configuration/MemoryConfiguration.java b/src/main/java/org/bukkit/configuration/MemoryConfiguration.java +index 010a97fee25233929e933aafad9a34a15bc4b847..59382f4a57265fc960505635fb09b978d987f853 100644 +--- a/src/main/java/org/bukkit/configuration/MemoryConfiguration.java ++++ b/src/main/java/org/bukkit/configuration/MemoryConfiguration.java +@@ -1,10 +1,11 @@ + package org.bukkit.configuration; + +-import java.util.Map; + import org.apache.commons.lang.Validate; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * This is a {@link Configuration} implementation that does not save or load + * from any source, and stores all values in memory only. +diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java +index f03dec0c9e489bb3deac760fd11970055998cf59..82ed6a1fbf73bf3199ceda47f87aba332a3abca1 100644 +--- a/src/main/java/org/bukkit/configuration/MemorySection.java ++++ b/src/main/java/org/bukkit/configuration/MemorySection.java +@@ -1,12 +1,5 @@ + package org.bukkit.configuration; + +-import static org.bukkit.util.NumberConversions.*; +-import java.util.ArrayList; +-import java.util.LinkedHashMap; +-import java.util.LinkedHashSet; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; + import org.apache.commons.lang.Validate; + import org.bukkit.Color; + import org.bukkit.Location; +@@ -17,6 +10,10 @@ import org.bukkit.util.Vector; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.*; ++ ++import static org.bukkit.util.NumberConversions.*; ++ + /** + * A type of {@link ConfigurationSection} that is stored in memory. + */ +diff --git a/src/main/java/org/bukkit/configuration/file/FileConfiguration.java b/src/main/java/org/bukkit/configuration/file/FileConfiguration.java +index 581889ffa2afbf17ca2ebe2905f2a041fe760cd8..fad42b6efd5022ca67381be473bfd31060400832 100644 +--- a/src/main/java/org/bukkit/configuration/file/FileConfiguration.java ++++ b/src/main/java/org/bukkit/configuration/file/FileConfiguration.java +@@ -2,16 +2,6 @@ package org.bukkit.configuration.file; + + import com.google.common.base.Charsets; + import com.google.common.io.Files; +-import java.io.BufferedReader; +-import java.io.File; +-import java.io.FileInputStream; +-import java.io.FileNotFoundException; +-import java.io.FileOutputStream; +-import java.io.IOException; +-import java.io.InputStreamReader; +-import java.io.OutputStreamWriter; +-import java.io.Reader; +-import java.io.Writer; + import org.apache.commons.lang.Validate; + import org.bukkit.configuration.Configuration; + import org.bukkit.configuration.InvalidConfigurationException; +@@ -19,6 +9,8 @@ import org.bukkit.configuration.MemoryConfiguration; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.io.*; ++ + /** + * This is a base class for all File based implementations of {@link + * Configuration} +diff --git a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java +index be8d35f1560b1e751f3c3102b9ae094ed61fe911..555c6f37d5b9daf0f7231070ee79fcfd36e87bfc 100644 +--- a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java ++++ b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java +@@ -1,11 +1,5 @@ + package org.bukkit.configuration.file; + +-import java.io.File; +-import java.io.FileNotFoundException; +-import java.io.IOException; +-import java.io.Reader; +-import java.util.Map; +-import java.util.logging.Level; + import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + import org.bukkit.configuration.Configuration; +@@ -18,6 +12,13 @@ import org.yaml.snakeyaml.Yaml; + import org.yaml.snakeyaml.error.YAMLException; + import org.yaml.snakeyaml.representer.Representer; + ++import java.io.File; ++import java.io.FileNotFoundException; ++import java.io.IOException; ++import java.io.Reader; ++import java.util.Map; ++import java.util.logging.Level; ++ + /** + * An implementation of {@link Configuration} which saves all files in Yaml. + * Note that this implementation is not synchronized. +diff --git a/src/main/java/org/bukkit/configuration/file/YamlConstructor.java b/src/main/java/org/bukkit/configuration/file/YamlConstructor.java +index c8466a29a22d6f685e856feaa8e1990aa35ae72c..7de54663e6f9dd861ed8aea716f70eae010a4372 100644 +--- a/src/main/java/org/bukkit/configuration/file/YamlConstructor.java ++++ b/src/main/java/org/bukkit/configuration/file/YamlConstructor.java +@@ -1,7 +1,5 @@ + package org.bukkit.configuration.file; + +-import java.util.LinkedHashMap; +-import java.util.Map; + import org.bukkit.configuration.serialization.ConfigurationSerialization; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; +@@ -10,6 +8,9 @@ import org.yaml.snakeyaml.error.YAMLException; + import org.yaml.snakeyaml.nodes.Node; + import org.yaml.snakeyaml.nodes.Tag; + ++import java.util.LinkedHashMap; ++import java.util.Map; ++ + public class YamlConstructor extends SafeConstructor { + + public YamlConstructor() { +diff --git a/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java b/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java +index f03da36223c7b73678c58f17b49f42f670dd29a3..dc78a24b328b6f409f8d3a34ffc45fb35b74d581 100644 +--- a/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java ++++ b/src/main/java/org/bukkit/configuration/file/YamlRepresenter.java +@@ -1,7 +1,5 @@ + package org.bukkit.configuration.file; + +-import java.util.LinkedHashMap; +-import java.util.Map; + import org.bukkit.configuration.ConfigurationSection; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.configuration.serialization.ConfigurationSerialization; +@@ -9,6 +7,9 @@ import org.jetbrains.annotations.NotNull; + import org.yaml.snakeyaml.nodes.Node; + import org.yaml.snakeyaml.representer.Representer; + ++import java.util.LinkedHashMap; ++import java.util.Map; ++ + public class YamlRepresenter extends Representer { + + public YamlRepresenter() { +diff --git a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java +index 177944d4e8cf37d7f9a8884cafdeefd7c3b3d78b..a666db15e5cbd9c2939d17cbab3f82be7020b7c1 100644 +--- a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java ++++ b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java +@@ -1,8 +1,9 @@ + package org.bukkit.configuration.serialization; + +-import java.util.Map; + import org.jetbrains.annotations.NotNull; + ++import java.util.Map; ++ + /** + * Represents an object that may be serialized. + *

+diff --git a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java +index 8c9b4f6967e4f9264c653be84cb821c1f8bb0753..92775fcf96e409100b674013ebcedd48a32b567f 100644 +--- a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java ++++ b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java +@@ -1,13 +1,5 @@ + package org.bukkit.configuration.serialization; + +-import java.lang.reflect.Constructor; +-import java.lang.reflect.InvocationTargetException; +-import java.lang.reflect.Method; +-import java.lang.reflect.Modifier; +-import java.util.HashMap; +-import java.util.Map; +-import java.util.logging.Level; +-import java.util.logging.Logger; + import org.apache.commons.lang.Validate; + import org.bukkit.Color; + import org.bukkit.FireworkEffect; +@@ -23,6 +15,15 @@ import org.bukkit.util.Vector; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.lang.reflect.Constructor; ++import java.lang.reflect.InvocationTargetException; ++import java.lang.reflect.Method; ++import java.lang.reflect.Modifier; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.logging.Level; ++import java.util.logging.Logger; ++ + /** + * Utility class for storing and retrieving classes for {@link Configuration}. + */ +diff --git a/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java b/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java +index 13839611610258263fd6ea6a62e67fd21f5e4be8..2fa5d2dfef0710add52185889a5c7e984a540cd5 100644 +--- a/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java ++++ b/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java +@@ -1,10 +1,11 @@ + package org.bukkit.configuration.serialization; + ++import org.jetbrains.annotations.NotNull; ++ + import java.lang.annotation.ElementType; + import java.lang.annotation.Retention; + import java.lang.annotation.RetentionPolicy; + import java.lang.annotation.Target; +-import org.jetbrains.annotations.NotNull; + + /** + * Applies to a {@link ConfigurationSerializable} that will delegate all +diff --git a/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java b/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java +index 725685ed346a6b378869341c474dfcd9e8f296fb..9f4e7950491e5a94ddd8e552c22c7899ecd571ac 100644 +--- a/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java ++++ b/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java +@@ -1,10 +1,11 @@ + package org.bukkit.configuration.serialization; + ++import org.jetbrains.annotations.NotNull; ++ + import java.lang.annotation.ElementType; + import java.lang.annotation.Retention; + import java.lang.annotation.RetentionPolicy; + import java.lang.annotation.Target; +-import org.jetbrains.annotations.NotNull; + + /** + * Represents an "alias" that a {@link ConfigurationSerializable} may be +diff --git a/src/main/java/org/bukkit/conversations/Conversation.java b/src/main/java/org/bukkit/conversations/Conversation.java +index bf2407c838bc20197802687c150d513f4e86ed2b..cb77dbd3c48aa33631ec16d82a039d5be019af08 100644 +--- a/src/main/java/org/bukkit/conversations/Conversation.java ++++ b/src/main/java/org/bukkit/conversations/Conversation.java +@@ -1,12 +1,13 @@ + package org.bukkit.conversations; + ++import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ + import java.util.ArrayList; + import java.util.HashMap; + import java.util.List; + import java.util.Map; +-import org.bukkit.plugin.Plugin; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + /** + * The Conversation class is responsible for tracking the current state of a +diff --git a/src/main/java/org/bukkit/conversations/ConversationAbandonedEvent.java b/src/main/java/org/bukkit/conversations/ConversationAbandonedEvent.java +index 0d67fe0c00e886def63edf72c3af3e4e5b7b3ea2..5c634789db28a3a3cbed550563a7173ec7d8ef3c 100644 +--- a/src/main/java/org/bukkit/conversations/ConversationAbandonedEvent.java ++++ b/src/main/java/org/bukkit/conversations/ConversationAbandonedEvent.java +@@ -1,9 +1,10 @@ + package org.bukkit.conversations; + +-import java.util.EventObject; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.EventObject; ++ + /** + * ConversationAbandonedEvent contains information about an abandoned + * conversation. +diff --git a/src/main/java/org/bukkit/conversations/ConversationAbandonedListener.java b/src/main/java/org/bukkit/conversations/ConversationAbandonedListener.java +index 451121e7dfdd6f58c0649a509b1770c1d3752480..48585ce53d77775e21df82e5d66fd6ddd1f0d34b 100644 +--- a/src/main/java/org/bukkit/conversations/ConversationAbandonedListener.java ++++ b/src/main/java/org/bukkit/conversations/ConversationAbandonedListener.java +@@ -1,8 +1,9 @@ + package org.bukkit.conversations; + +-import java.util.EventListener; + import org.jetbrains.annotations.NotNull; + ++import java.util.EventListener; ++ + /** + */ + public interface ConversationAbandonedListener extends EventListener { +diff --git a/src/main/java/org/bukkit/conversations/ConversationContext.java b/src/main/java/org/bukkit/conversations/ConversationContext.java +index 5bc0d36fe2a0f0e8f1cd3fb077f6b2285d60cbf4..b192b03be44404eb03b8f6ed4b8cc5f4f65d2562 100644 +--- a/src/main/java/org/bukkit/conversations/ConversationContext.java ++++ b/src/main/java/org/bukkit/conversations/ConversationContext.java +@@ -1,10 +1,11 @@ + package org.bukkit.conversations; + +-import java.util.Map; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * A ConversationContext provides continuity between nodes in the prompt graph + * by giving the developer access to the subject of the conversation and a +diff --git a/src/main/java/org/bukkit/conversations/ConversationFactory.java b/src/main/java/org/bukkit/conversations/ConversationFactory.java +index 58009e1e7a9cbbba1b0db43cd81eddc19c710687..c629f10fcb0f9574011ac9cf6c41903d92623467 100644 +--- a/src/main/java/org/bukkit/conversations/ConversationFactory.java ++++ b/src/main/java/org/bukkit/conversations/ConversationFactory.java +@@ -1,14 +1,15 @@ + package org.bukkit.conversations; + +-import java.util.ArrayList; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; + import org.bukkit.entity.Player; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.ArrayList; ++import java.util.HashMap; ++import java.util.List; ++import java.util.Map; ++ + /** + * A ConversationFactory is responsible for creating a {@link Conversation} + * from a predefined template. A ConversationFactory is typically created when +diff --git a/src/main/java/org/bukkit/conversations/FixedSetPrompt.java b/src/main/java/org/bukkit/conversations/FixedSetPrompt.java +index 9bf3336faea731c495bc7f64558654769731d6e1..544bc3768c1436f1a8c8809191ee163273e3f21f 100644 +--- a/src/main/java/org/bukkit/conversations/FixedSetPrompt.java ++++ b/src/main/java/org/bukkit/conversations/FixedSetPrompt.java +@@ -1,10 +1,11 @@ + package org.bukkit.conversations; + +-import java.util.Arrays; +-import java.util.List; + import org.apache.commons.lang.StringUtils; + import org.jetbrains.annotations.NotNull; + ++import java.util.Arrays; ++import java.util.List; ++ + /** + * FixedSetPrompt is the base class for any prompt that requires a fixed set + * response from the user. +diff --git a/src/main/java/org/bukkit/conversations/RegexPrompt.java b/src/main/java/org/bukkit/conversations/RegexPrompt.java +index 6b3f1e4591d68fe6698cd960b97b04c82f67366d..3de2a5897481e8429a741d30885e790de0e533f6 100644 +--- a/src/main/java/org/bukkit/conversations/RegexPrompt.java ++++ b/src/main/java/org/bukkit/conversations/RegexPrompt.java +@@ -1,8 +1,9 @@ + package org.bukkit.conversations; + +-import java.util.regex.Pattern; + import org.jetbrains.annotations.NotNull; + ++import java.util.regex.Pattern; ++ + /** + * RegexPrompt is the base class for any prompt that requires an input + * validated by a regular expression. +diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java +index b833ef63fbe01271ceb2bd83a9eb4a84c9912761..f61fc5faf2e8a663272c7b5f63cdc3b612dec2ea 100644 +--- a/src/main/java/org/bukkit/enchantments/Enchantment.java ++++ b/src/main/java/org/bukkit/enchantments/Enchantment.java +@@ -1,7 +1,5 @@ + package org.bukkit.enchantments; + +-import java.util.HashMap; +-import java.util.Map; + import org.bukkit.Keyed; + import org.bukkit.NamespacedKey; + import org.bukkit.inventory.ItemStack; +@@ -9,6 +7,9 @@ import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++import java.util.Map; ++ + /** + * The various type of enchantments that may be added to armour or weapons + */ +diff --git a/src/main/java/org/bukkit/entity/AnimalTamer.java b/src/main/java/org/bukkit/entity/AnimalTamer.java +index 2e17b2d4f759531fbe9ee8e9b00c839186af09ca..9f1eed9ba5b1a613681b3887e83ab6785a82c414 100644 +--- a/src/main/java/org/bukkit/entity/AnimalTamer.java ++++ b/src/main/java/org/bukkit/entity/AnimalTamer.java +@@ -1,9 +1,10 @@ + package org.bukkit.entity; + +-import java.util.UUID; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.UUID; ++ + public interface AnimalTamer { + + /** +diff --git a/src/main/java/org/bukkit/entity/Animals.java b/src/main/java/org/bukkit/entity/Animals.java +index 1047481e418f6cde50ff477950b2c65e16e50e32..3d4f8c3d4614f013952797160eb71b37628c792f 100644 +--- a/src/main/java/org/bukkit/entity/Animals.java ++++ b/src/main/java/org/bukkit/entity/Animals.java +@@ -1,8 +1,9 @@ + package org.bukkit.entity; + +-import java.util.UUID; + import org.jetbrains.annotations.Nullable; + ++import java.util.UUID; ++ + /** + * Represents an Animal. + */ +diff --git a/src/main/java/org/bukkit/entity/AreaEffectCloud.java b/src/main/java/org/bukkit/entity/AreaEffectCloud.java +index bca9d3659f6fceeca4b7fecbc7034d6fdbc4581e..977d9d0e8c9eec14c08bf6d284853ab98d1530f8 100644 +--- a/src/main/java/org/bukkit/entity/AreaEffectCloud.java ++++ b/src/main/java/org/bukkit/entity/AreaEffectCloud.java +@@ -1,6 +1,5 @@ + package org.bukkit.entity; + +-import java.util.List; + import org.bukkit.Color; + import org.bukkit.Particle; + import org.bukkit.potion.PotionData; +@@ -10,6 +9,8 @@ import org.bukkit.projectiles.ProjectileSource; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Represents an area effect cloud which will imbue a potion effect onto + * entities which enter it. +diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java +index ec8443b67014c0129256c9227cc89686422b9217..6ea47e5628eddc1f256aae5fee09064a1f39a073 100644 +--- a/src/main/java/org/bukkit/entity/Arrow.java ++++ b/src/main/java/org/bukkit/entity/Arrow.java +@@ -1,6 +1,5 @@ + package org.bukkit.entity; + +-import java.util.List; + import org.bukkit.Color; + import org.bukkit.potion.PotionData; + import org.bukkit.potion.PotionEffect; +@@ -8,6 +7,8 @@ import org.bukkit.potion.PotionEffectType; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + public interface Arrow extends AbstractArrow { + + /** +diff --git a/src/main/java/org/bukkit/entity/ComplexLivingEntity.java b/src/main/java/org/bukkit/entity/ComplexLivingEntity.java +index 2151e3bac040b0dd47c67ffe3a9de6dc45e9d62c..038bcb6dc7cedf134b9b49837ff864814a322748 100644 +--- a/src/main/java/org/bukkit/entity/ComplexLivingEntity.java ++++ b/src/main/java/org/bukkit/entity/ComplexLivingEntity.java +@@ -1,8 +1,9 @@ + package org.bukkit.entity; + +-import java.util.Set; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * Represents a complex living entity - one that is made up of various smaller + * parts +diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java +index 801815e64bb281dbd480258db24a36892f485990..285d3c40c3a332e665121a5631df3f828b204627 100644 +--- a/src/main/java/org/bukkit/entity/Entity.java ++++ b/src/main/java/org/bukkit/entity/Entity.java +@@ -1,14 +1,6 @@ + package org.bukkit.entity; + +-import java.util.List; +-import java.util.Set; +-import java.util.UUID; +-import org.bukkit.Chunk; // Paper +-import org.bukkit.EntityEffect; +-import org.bukkit.Location; +-import org.bukkit.Nameable; +-import org.bukkit.Server; +-import org.bukkit.World; ++import org.bukkit.*; + import org.bukkit.block.BlockFace; + import org.bukkit.block.PistonMoveReaction; + import org.bukkit.command.CommandSender; +@@ -23,6 +15,10 @@ import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++import java.util.Set; ++import java.util.UUID; ++ + /** + * Represents a base entity in the world + */ +diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java +index 98ebed7d90e99fa4d333d2c2b51c61418c4e5188..de60a4b51fd68de7fdd3f24f8bd49b94fcb93646 100644 +--- a/src/main/java/org/bukkit/entity/EntityType.java ++++ b/src/main/java/org/bukkit/entity/EntityType.java +@@ -1,25 +1,20 @@ + package org.bukkit.entity; + + import com.google.common.base.Preconditions; +-import java.util.HashMap; +-import java.util.Map; + import org.bukkit.Keyed; + import org.bukkit.Location; + import org.bukkit.NamespacedKey; + import org.bukkit.World; +-import org.bukkit.entity.minecart.CommandMinecart; +-import org.bukkit.entity.minecart.ExplosiveMinecart; +-import org.bukkit.entity.minecart.HopperMinecart; +-import org.bukkit.entity.minecart.PoweredMinecart; +-import org.bukkit.entity.minecart.RideableMinecart; +-import org.bukkit.entity.minecart.SpawnerMinecart; +-import org.bukkit.entity.minecart.StorageMinecart; ++import org.bukkit.entity.minecart.*; + import org.bukkit.inventory.ItemStack; + import org.bukkit.potion.PotionEffectType; + import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++import java.util.Map; ++ + public enum EntityType implements Keyed { + + // These strings MUST match the strings in nms.EntityTypes and are case sensitive. +diff --git a/src/main/java/org/bukkit/entity/ExperienceOrb.java b/src/main/java/org/bukkit/entity/ExperienceOrb.java +index dec70bbfaf73a9d525b2c45682b804c684e1645b..36f0b5a004b9d22d673632009cbb161e811540a7 100644 +--- a/src/main/java/org/bukkit/entity/ExperienceOrb.java ++++ b/src/main/java/org/bukkit/entity/ExperienceOrb.java +@@ -1,7 +1,7 @@ + package org.bukkit.entity; + + import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; // Paper ++import org.jetbrains.annotations.Nullable; + + /** + * Represents an Experience Orb. +diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java +index d3998c61af0c5fb1189ae7829e8cdfbef0cd3f97..f1728dbcafd7dcedadad7a44088edf2a1038d6b0 100644 +--- a/src/main/java/org/bukkit/entity/HumanEntity.java ++++ b/src/main/java/org/bukkit/entity/HumanEntity.java +@@ -1,21 +1,16 @@ + package org.bukkit.entity; + +-import java.util.Collection; +-import java.util.Set; + import org.bukkit.GameMode; + import org.bukkit.Location; + import org.bukkit.Material; + import org.bukkit.NamespacedKey; +-import org.bukkit.inventory.Inventory; +-import org.bukkit.inventory.InventoryHolder; +-import org.bukkit.inventory.InventoryView; +-import org.bukkit.inventory.ItemStack; +-import org.bukkit.inventory.MainHand; +-import org.bukkit.inventory.Merchant; +-import org.bukkit.inventory.PlayerInventory; ++import org.bukkit.inventory.*; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++import java.util.Set; ++ + /** + * Represents a human entity, such as an NPC or a player + */ +diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java +index acd80d812fe88dee3978d19b24149e9fe0ac596b..6b8dd87fe4e4535075d81ac1bfc87a4d787a7a56 100644 +--- a/src/main/java/org/bukkit/entity/Item.java ++++ b/src/main/java/org/bukkit/entity/Item.java +@@ -2,9 +2,8 @@ package org.bukkit.entity; + + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; +- +-// Paper start + import org.jetbrains.annotations.Nullable; ++ + import java.util.UUID; + // Paper end + +diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java +index a60523cc9c05396ce5c3ebabd231f3ca374c3efe..ba66273873a7692de0316068fe2b8bb0455bcbba 100644 +--- a/src/main/java/org/bukkit/entity/LivingEntity.java ++++ b/src/main/java/org/bukkit/entity/LivingEntity.java +@@ -1,9 +1,5 @@ + package org.bukkit.entity; + +-import java.util.Collection; +-import java.util.List; +-import java.util.Set; +-import java.util.UUID; + import org.bukkit.FluidCollisionMode; + import org.bukkit.Location; + import org.bukkit.Material; +@@ -21,6 +17,11 @@ import org.bukkit.util.Vector; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++import java.util.List; ++import java.util.Set; ++import java.util.UUID; ++ + /** + * Represents a living entity, such as a monster or player + */ +diff --git a/src/main/java/org/bukkit/entity/Phantom.java b/src/main/java/org/bukkit/entity/Phantom.java +index ed4d417c2deefb78807cb61b01df5afcd334d754..e5a5b49564d523a05a02be3e8de558cba81e953c 100644 +--- a/src/main/java/org/bukkit/entity/Phantom.java ++++ b/src/main/java/org/bukkit/entity/Phantom.java +@@ -1,6 +1,5 @@ + package org.bukkit.entity; + +-import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + + /** +diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java +index b584f8b15f7ee36b42bba0e0bae721aae8f6f14b..3ca3fb8b59eaf82851aad998d5b6b2af7e26896a 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -1,25 +1,9 @@ + package org.bukkit.entity; + +-import java.net.InetSocketAddress; +-import com.destroystokyo.paper.ClientOption; // Paper +-import com.destroystokyo.paper.Title; // Paper +-import com.destroystokyo.paper.profile.PlayerProfile; // Paper +-import java.util.Date; // Paper +-import org.bukkit.BanEntry; // Paper +-import org.bukkit.BanList; // Paper +-import org.bukkit.Bukkit; // Paper +-import org.bukkit.DyeColor; +-import org.bukkit.Effect; +-import org.bukkit.GameMode; +-import org.bukkit.Instrument; +-import org.bukkit.Location; +-import org.bukkit.Material; +-import org.bukkit.Note; +-import org.bukkit.OfflinePlayer; +-import org.bukkit.Particle; +-import org.bukkit.Sound; +-import org.bukkit.SoundCategory; +-import org.bukkit.WeatherType; ++import com.destroystokyo.paper.ClientOption; ++import com.destroystokyo.paper.Title; ++import com.destroystokyo.paper.profile.PlayerProfile; ++import org.bukkit.*; + import org.bukkit.advancement.Advancement; + import org.bukkit.advancement.AdvancementProgress; + import org.bukkit.block.data.BlockData; +@@ -33,6 +17,9 @@ import org.bukkit.scoreboard.Scoreboard; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.net.InetSocketAddress; ++import java.util.Date; ++ + /** + * Represents a player, connected or not + */ +diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java +index 1c367f78eadf24850061a84ce63b950b79d3c435..cb9b5053cb9d351a34f34d7c3c00363c4ea65053 100644 +--- a/src/main/java/org/bukkit/entity/Skeleton.java ++++ b/src/main/java/org/bukkit/entity/Skeleton.java +@@ -1,8 +1,8 @@ + package org.bukkit.entity; + ++import com.destroystokyo.paper.entity.RangedEntity; + import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; +-import com.destroystokyo.paper.entity.RangedEntity; + + /** + * Represents a Skeleton. +diff --git a/src/main/java/org/bukkit/entity/Tameable.java b/src/main/java/org/bukkit/entity/Tameable.java +index 65e68da98ab66ed781bce2f0dbe0913be48d2990..48a5abbc44e31568e614f95dbe1eff8344f46b31 100644 +--- a/src/main/java/org/bukkit/entity/Tameable.java ++++ b/src/main/java/org/bukkit/entity/Tameable.java +@@ -1,6 +1,5 @@ + package org.bukkit.entity; + +-import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + + public interface Tameable extends Animals { +diff --git a/src/main/java/org/bukkit/entity/ThrownPotion.java b/src/main/java/org/bukkit/entity/ThrownPotion.java +index 10a3c297bd87ad3ab4555054858f47a479e76e1a..b703788a00c80f494812caa363c2174fe9c06e91 100644 +--- a/src/main/java/org/bukkit/entity/ThrownPotion.java ++++ b/src/main/java/org/bukkit/entity/ThrownPotion.java +@@ -1,10 +1,11 @@ + package org.bukkit.entity; + +-import java.util.Collection; + import org.bukkit.inventory.ItemStack; + import org.bukkit.potion.PotionEffect; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++ + /** + * Represents a thrown potion bottle + */ +diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java +index c8777a476e38ef5e72b6709761990a339eb43d2b..f2ae3c836197d07ef35d5a0a3473a2be297b409d 100644 +--- a/src/main/java/org/bukkit/entity/Villager.java ++++ b/src/main/java/org/bukkit/entity/Villager.java +@@ -1,13 +1,14 @@ + package org.bukkit.entity; + +-import java.util.Locale; +-import java.util.Map; // Paper +-import java.util.UUID; // Paper + import org.bukkit.Keyed; + import org.bukkit.Location; + import org.bukkit.NamespacedKey; + import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; // Paper ++import org.jetbrains.annotations.Nullable; ++ ++import java.util.Locale; ++import java.util.Map; ++import java.util.UUID; + + /** + * Represents a villager NPC +diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java +index cd8d0a20e52ad35f659175e0d24a1dc0e92023b9..7be855e4206e13e91965fc5acabf8363b602b05b 100644 +--- a/src/main/java/org/bukkit/entity/Witch.java ++++ b/src/main/java/org/bukkit/entity/Witch.java +@@ -1,8 +1,6 @@ + package org.bukkit.entity; + + import com.destroystokyo.paper.entity.RangedEntity; +- +-// Paper start + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.Nullable; + // Paper end +diff --git a/src/main/java/org/bukkit/entity/memory/MemoryKey.java b/src/main/java/org/bukkit/entity/memory/MemoryKey.java +index 3aa8a30a5f95d44ad26240778bb2c33005c494e4..5be328b74699a07d5740009b182b160a81243068 100644 +--- a/src/main/java/org/bukkit/entity/memory/MemoryKey.java ++++ b/src/main/java/org/bukkit/entity/memory/MemoryKey.java +@@ -1,16 +1,13 @@ + package org.bukkit.entity.memory; + +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Map; +-import java.util.Set; +-import java.util.UUID; + import org.bukkit.Keyed; + import org.bukkit.Location; + import org.bukkit.NamespacedKey; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.*; ++ + /** + * Represents a key used for accessing memory values of a + * {@link org.bukkit.entity.LivingEntity}. +diff --git a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java +index db69687a7ad4b18d17ab1677cae5d8dd4dcd3678..4cb69fed09e5641c074087d7841eb8b84b5cda80 100644 +--- a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java ++++ b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java +@@ -3,7 +3,6 @@ package org.bukkit.entity.minecart; + import com.destroystokyo.paper.loottable.LootableEntityInventory; + import org.bukkit.entity.Minecart; + import org.bukkit.inventory.InventoryHolder; +-import org.bukkit.loot.Lootable; + + /** + * Represents a Minecart with a Hopper inside it +diff --git a/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java +index 238d118f7788b13cd86b7e9ea3a0fc38e2e09715..7416d30e283b03473170a268a01765b135e2ceac 100644 +--- a/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java ++++ b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java +@@ -3,7 +3,6 @@ package org.bukkit.entity.minecart; + import com.destroystokyo.paper.loottable.LootableEntityInventory; + import org.bukkit.entity.Minecart; + import org.bukkit.inventory.InventoryHolder; +-import org.bukkit.loot.Lootable; + + /** + * Represents a minecart with a chest. These types of {@link Minecart +diff --git a/src/main/java/org/bukkit/event/HandlerList.java b/src/main/java/org/bukkit/event/HandlerList.java +index ed78cca71f83b296d082d0af147ca8d622c7606a..e73e8d4c347d63f22211a9eb5105bd1bbdc24fcb 100644 +--- a/src/main/java/org/bukkit/event/HandlerList.java ++++ b/src/main/java/org/bukkit/event/HandlerList.java +@@ -1,15 +1,12 @@ + package org.bukkit.event; + +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.EnumMap; +-import java.util.List; +-import java.util.ListIterator; +-import java.util.Map.Entry; + import org.bukkit.plugin.Plugin; + import org.bukkit.plugin.RegisteredListener; + import org.jetbrains.annotations.NotNull; + ++import java.util.*; ++import java.util.Map.Entry; ++ + /** + * A list of event handlers, stored per-event. Based on lahwran's fevents. + */ +diff --git a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java b/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java +index a0f6f1af304190b4c5db4b284d460f625eeb7801..4151fb144b14acbe1329d8a2b4b3a3b631c1847d 100644 +--- a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java ++++ b/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java +@@ -1,6 +1,5 @@ + package org.bukkit.event.block; + +-import java.util.List; + import org.bukkit.block.Block; + import org.bukkit.block.BlockState; + import org.bukkit.entity.Item; +@@ -9,6 +8,8 @@ import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Called if a block broken by a player drops an item. + * +diff --git a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java +index 44f7f6939a27b9a0a796d91eac4b7c97ec90a643..857f061a818691626442d2c3a5614360109d16b4 100644 +--- a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java ++++ b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java +@@ -1,11 +1,12 @@ + package org.bukkit.event.block; + +-import java.util.List; + import org.bukkit.block.Block; + import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Called when a block explodes + */ +diff --git a/src/main/java/org/bukkit/event/block/BlockFertilizeEvent.java b/src/main/java/org/bukkit/event/block/BlockFertilizeEvent.java +index 695309b4b7ef269ba2496408a5f874f61cd6c445..958c13826832bf90adad17faba6a674a83c27ac5 100644 +--- a/src/main/java/org/bukkit/event/block/BlockFertilizeEvent.java ++++ b/src/main/java/org/bukkit/event/block/BlockFertilizeEvent.java +@@ -1,6 +1,5 @@ + package org.bukkit.event.block; + +-import java.util.List; + import org.bukkit.block.Block; + import org.bukkit.block.BlockState; + import org.bukkit.entity.Player; +@@ -10,6 +9,8 @@ import org.bukkit.event.world.StructureGrowEvent; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Called with the block changes resulting from a player fertilizing a given + * block with bonemeal. Will be called after the applicable +diff --git a/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java +index 8460aa4f5e211fb0a6ab11f7487d38dba927e1da..9234b3023513aff076e4387413b26650bcda68d8 100644 +--- a/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java ++++ b/src/main/java/org/bukkit/event/block/BlockMultiPlaceEvent.java +@@ -1,13 +1,14 @@ + package org.bukkit.event.block; + + import com.google.common.collect.ImmutableList; +-import java.util.List; + import org.bukkit.block.Block; + import org.bukkit.block.BlockState; + import org.bukkit.entity.Player; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Fired when a single block placement action of a player triggers the + * creation of multiple blocks(e.g. placing a bed block). The block returned +diff --git a/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java +index 40ddc364971af1f266ee367f4d09d83a8e914e23..6437f76b2524b83341bebf9def6a189916b08398 100644 +--- a/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java ++++ b/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java +@@ -1,13 +1,14 @@ + package org.bukkit.event.block; + +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.List; + import org.bukkit.block.Block; + import org.bukkit.block.BlockFace; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.List; ++ + /** + * Called when a piston extends + */ +diff --git a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java +index 340fa397e68c024df380a28db21545a0c83d9fa6..44bfdb1db130a3a75317d2f2b053040fed074d43 100644 +--- a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java ++++ b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java +@@ -1,12 +1,13 @@ + package org.bukkit.event.block; + +-import java.util.List; + import org.bukkit.Location; + import org.bukkit.block.Block; + import org.bukkit.block.BlockFace; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Called when a piston retracts + */ +diff --git a/src/main/java/org/bukkit/event/block/SpongeAbsorbEvent.java b/src/main/java/org/bukkit/event/block/SpongeAbsorbEvent.java +index 7029cfcd00ed5d9c7f06898ec2b81238ec775a70..260c8f0bfaeb4ff28202a38c035216866666b6e6 100644 +--- a/src/main/java/org/bukkit/event/block/SpongeAbsorbEvent.java ++++ b/src/main/java/org/bukkit/event/block/SpongeAbsorbEvent.java +@@ -1,6 +1,5 @@ + package org.bukkit.event.block; + +-import java.util.List; + import org.bukkit.Material; + import org.bukkit.block.Block; + import org.bukkit.block.BlockState; +@@ -8,6 +7,8 @@ import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Called when a sponge absorbs water from the world. + *
+diff --git a/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java b/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java +index 251342c3cc6204f47ef1efb5724302a776359f4d..3242454af320225e7f2e2a543ce6785a25f837bd 100644 +--- a/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java ++++ b/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java +@@ -1,9 +1,8 @@ + package org.bukkit.event.command; + + import org.bukkit.command.CommandSender; +-import org.bukkit.event.HandlerList; + import org.bukkit.event.Event; +- ++import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + +diff --git a/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java b/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java +index b898fdefc77e961b03977c1dd70fb8b8bf320871..4b9f97ddd2f6f31afb5f673f04fba60b26869682 100644 +--- a/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java ++++ b/src/main/java/org/bukkit/event/enchantment/EnchantItemEvent.java +@@ -1,7 +1,5 @@ + package org.bukkit.event.enchantment; + +-import java.util.HashMap; +-import java.util.Map; + import org.apache.commons.lang.Validate; + import org.bukkit.block.Block; + import org.bukkit.enchantments.Enchantment; +@@ -13,6 +11,9 @@ import org.bukkit.inventory.InventoryView; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; + ++import java.util.HashMap; ++import java.util.Map; ++ + /** + * Called when an ItemStack is successfully enchanted (currently at + * enchantment table) +diff --git a/src/main/java/org/bukkit/event/entity/AreaEffectCloudApplyEvent.java b/src/main/java/org/bukkit/event/entity/AreaEffectCloudApplyEvent.java +index a37febd0d4dd5b733e9ee72628fdf9395fec4367..8fd408e56fe6ca25e70cd4f96bdbaee98d6d7858 100644 +--- a/src/main/java/org/bukkit/event/entity/AreaEffectCloudApplyEvent.java ++++ b/src/main/java/org/bukkit/event/entity/AreaEffectCloudApplyEvent.java +@@ -1,12 +1,13 @@ + package org.bukkit.event.entity; + +-import java.util.List; + import org.bukkit.entity.AreaEffectCloud; + import org.bukkit.entity.LivingEntity; + import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Called when a lingering potion applies it's effects. Happens + * once every 5 ticks +diff --git a/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java b/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java +index 397baaefd2fb45ae9d50b7b9bd5276e6ad980f20..0f20ae139997ef6896ce0924463c1cea3c26ddae 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java +@@ -1,6 +1,5 @@ + package org.bukkit.event.entity; + +-import java.util.List; + import org.bukkit.PortalType; + import org.bukkit.block.BlockState; + import org.bukkit.entity.LivingEntity; +@@ -9,6 +8,8 @@ import org.bukkit.event.HandlerList; + import org.bukkit.event.world.PortalCreateEvent; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Thrown when a Living Entity creates a portal in a world. + * +diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java +index 461727dc7f06efb3550fc370e0db5bd04ba89711..040375843a670f3ae319025b0089641db1133485 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java +@@ -1,12 +1,13 @@ + package org.bukkit.event.entity; + + import com.google.common.base.Function; +-import java.util.Map; + import org.bukkit.block.Block; + import org.bukkit.entity.Entity; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Called when an entity is damaged by a block + */ +diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java +index 869bad7405ec7fa67728e90d8b9f2e11b542611f..cd1ae3aef868f8f673b3de88284d494f9e1a419a 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java +@@ -1,10 +1,11 @@ + package org.bukkit.event.entity; + + import com.google.common.base.Function; +-import java.util.Map; + import org.bukkit.entity.Entity; + import org.jetbrains.annotations.NotNull; + ++import java.util.Map; ++ + /** + * Called when an entity is damaged by an entity + */ +diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +index feec8b1e15cd407b7a50cfcfaba11374c0e37e82..e1f6581e45637745b12ce7dbc8f2286735b7ff73 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +@@ -3,8 +3,6 @@ package org.bukkit.event.entity; + import com.google.common.base.Function; + import com.google.common.base.Functions; + import com.google.common.collect.ImmutableMap; +-import java.util.EnumMap; +-import java.util.Map; + import org.apache.commons.lang.Validate; + import org.bukkit.Material; + import org.bukkit.entity.Entity; +@@ -13,6 +11,9 @@ import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.EnumMap; ++import java.util.Map; ++ + /** + * Stores data for damage events + */ +diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java +index e19a3df9aa2204b44c0b029bda141ae6306f60a1..df7855b073e05cca07739f4cf151eba0159c4e59 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java +@@ -1,12 +1,13 @@ + package org.bukkit.event.entity; + +-import java.util.List; + import org.bukkit.entity.LivingEntity; + import org.bukkit.event.HandlerList; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Thrown whenever a LivingEntity dies + */ +diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java +index 10d0e18dfd423b108fe381e8142867eb10399359..2894f71c2e2e765f5943f179840c8adababf3a20 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java +@@ -1,6 +1,5 @@ + package org.bukkit.event.entity; + +-import java.util.List; + import org.bukkit.Location; + import org.bukkit.block.Block; + import org.bukkit.entity.Entity; +@@ -8,6 +7,8 @@ import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Called when an entity explodes + */ +diff --git a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java +index 37dbc12eb47060ebf0f6a18960d036bd27ce3740..88b4f684140d0b698e823f77dd95a8f3e085a64e 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java +@@ -2,7 +2,6 @@ package org.bukkit.event.entity; + + import org.bukkit.entity.Entity; + import org.bukkit.entity.LivingEntity; +-import org.bukkit.entity.Projectile; // Paper + import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.bukkit.inventory.ItemStack; +diff --git a/src/main/java/org/bukkit/event/entity/EntityTransformEvent.java b/src/main/java/org/bukkit/event/entity/EntityTransformEvent.java +index 1370380ae28fced98239798bbf54d2a7ea9274ae..8f5c554b48b991827604de0e1587e6dc58ca3887 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityTransformEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityTransformEvent.java +@@ -1,12 +1,13 @@ + package org.bukkit.event.entity; + +-import java.util.Collections; +-import java.util.List; + import org.bukkit.entity.Entity; + import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collections; ++import java.util.List; ++ + /** + * Called when an entity is about to be replaced by another entity. + */ +diff --git a/src/main/java/org/bukkit/event/entity/PigZapEvent.java b/src/main/java/org/bukkit/event/entity/PigZapEvent.java +index d3949edfc736b3d67a627ef378748b374769e183..f7829a522e17228431022c2923bdd6c9f3ba2ed3 100644 +--- a/src/main/java/org/bukkit/event/entity/PigZapEvent.java ++++ b/src/main/java/org/bukkit/event/entity/PigZapEvent.java +@@ -1,13 +1,10 @@ + package org.bukkit.event.entity; + +-import java.util.Collections; +-import org.bukkit.entity.Entity; + import com.destroystokyo.paper.event.entity.EntityZapEvent; + import org.bukkit.entity.LightningStrike; + import org.bukkit.entity.Pig; + import org.bukkit.entity.PigZombie; + import org.bukkit.event.Cancellable; +-import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + + /** +diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +index 3a743430acb5eecc4d8db068fa62fe6d38a249e5..9a25a58d260b440a4ff07b715b8652aec8a6bb12 100644 +--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java ++++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +@@ -1,13 +1,13 @@ + package org.bukkit.event.entity; + +-import java.util.List; +- + import org.bukkit.GameMode; + import org.bukkit.entity.Player; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Thrown whenever a {@link Player} dies + */ +diff --git a/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java b/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java +index 90d7e8141a18ec7dd97288e90803e37591a51a4f..f4f4ef18198c1fc40826df8f1327e0c8d6cbc69d 100644 +--- a/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java ++++ b/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java +@@ -1,8 +1,5 @@ + package org.bukkit.event.entity; + +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.Map; + import org.apache.commons.lang.Validate; + import org.bukkit.entity.LivingEntity; + import org.bukkit.entity.ThrownPotion; +@@ -10,6 +7,10 @@ import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.Map; ++ + /** + * Called when a splash potion hits an area + */ +diff --git a/src/main/java/org/bukkit/event/inventory/InventoryDragEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryDragEvent.java +index 856e945c516f2d379e3a88b3ca533fc5ad73bc33..1302313d5b86296996c5dddb8e757186f5d73042 100644 +--- a/src/main/java/org/bukkit/event/inventory/InventoryDragEvent.java ++++ b/src/main/java/org/bukkit/event/inventory/InventoryDragEvent.java +@@ -1,9 +1,6 @@ + package org.bukkit.event.inventory; + + import com.google.common.collect.ImmutableSet; +-import java.util.Collections; +-import java.util.Map; +-import java.util.Set; + import org.apache.commons.lang.Validate; + import org.bukkit.Location; + import org.bukkit.entity.HumanEntity; +@@ -17,6 +14,10 @@ import org.bukkit.scheduler.BukkitScheduler; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collections; ++import java.util.Map; ++import java.util.Set; ++ + /** + * This event is called when the player drags an item in their cursor across + * the inventory. The ItemStack is distributed across the slots the +diff --git a/src/main/java/org/bukkit/event/inventory/InventoryEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryEvent.java +index 5d3fe64ab9c5d6a9d0525495c52b77cedcb880b0..b4a1f58054ec0801c6a00c5ac8f63127ad3db103 100644 +--- a/src/main/java/org/bukkit/event/inventory/InventoryEvent.java ++++ b/src/main/java/org/bukkit/event/inventory/InventoryEvent.java +@@ -1,7 +1,6 @@ + + package org.bukkit.event.inventory; + +-import java.util.List; + import org.bukkit.entity.HumanEntity; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; +@@ -9,6 +8,8 @@ import org.bukkit.inventory.Inventory; + import org.bukkit.inventory.InventoryView; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Represents a player related inventory event + */ +diff --git a/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java b/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java +index f1f6f4ab4f81a3f21e757fef4a30b00e94371f8d..04e9626ef920f90a8e287a36e003bc4c4a6c5ede 100644 +--- a/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java ++++ b/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java +@@ -1,7 +1,6 @@ + package org.bukkit.event.inventory; + + import com.destroystokyo.paper.event.inventory.PrepareResultEvent; +-import org.bukkit.event.HandlerList; + import org.bukkit.inventory.AnvilInventory; + import org.bukkit.inventory.InventoryView; + import org.bukkit.inventory.ItemStack; +diff --git a/src/main/java/org/bukkit/event/inventory/PrepareSmithingEvent.java b/src/main/java/org/bukkit/event/inventory/PrepareSmithingEvent.java +index 0bc0ca4f96c800e9c46c61710f44446691d8b93f..4c8659b479842853739b43d685f5bc82820639c7 100644 +--- a/src/main/java/org/bukkit/event/inventory/PrepareSmithingEvent.java ++++ b/src/main/java/org/bukkit/event/inventory/PrepareSmithingEvent.java +@@ -1,7 +1,6 @@ + package org.bukkit.event.inventory; + + import com.destroystokyo.paper.event.inventory.PrepareResultEvent; +-import org.bukkit.event.HandlerList; + import org.bukkit.inventory.InventoryView; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.SmithingInventory; +diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java +index 9c68c3f2d61500479f48b80264f625aaae2f3204..6aa5ad507159f6ff78a9e9d25e8a547cb9276200 100644 +--- a/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java ++++ b/src/main/java/org/bukkit/event/player/AsyncPlayerChatEvent.java +@@ -1,12 +1,13 @@ + package org.bukkit.event.player; + +-import java.util.IllegalFormatException; +-import java.util.Set; + import org.bukkit.entity.Player; + import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.IllegalFormatException; ++import java.util.Set; ++ + /** + * This event will sometimes fire synchronously, depending on how it was + * triggered. +diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +index e5b811229830e4d55b08ab18bedec1494ff342ac..dd67f4ca29258f7b4ac5ae96af32ca494fc00aff 100644 +--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java ++++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +@@ -1,14 +1,14 @@ + package org.bukkit.event.player; + +-import java.net.InetAddress; +-import java.util.UUID; +- + import com.destroystokyo.paper.profile.PlayerProfile; + import org.bukkit.Bukkit; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.net.InetAddress; ++import java.util.UUID; ++ + /** + * Stores details for players attempting to log in. + *

+diff --git a/src/main/java/org/bukkit/event/player/PlayerChatEvent.java b/src/main/java/org/bukkit/event/player/PlayerChatEvent.java +index 8ea56aac752544f798728b429e7152afbee497e4..4cc54eeecb1ea4a9915115da35da04a61c9dfea5 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerChatEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerChatEvent.java +@@ -1,7 +1,5 @@ + package org.bukkit.event.player; + +-import java.util.HashSet; +-import java.util.Set; + import org.apache.commons.lang.Validate; + import org.bukkit.Warning; + import org.bukkit.entity.Player; +@@ -9,6 +7,9 @@ import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.HashSet; ++import java.util.Set; ++ + /** + * Holds information for player chat and commands + * +diff --git a/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java b/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java +index 0b99c7fb228660878b3f4b8c1beb58d82489701e..e58ea31c1b3633461db50cb96d7b4f6fb0354836 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerChatTabCompleteEvent.java +@@ -1,12 +1,13 @@ + package org.bukkit.event.player; + +-import java.util.Collection; + import org.apache.commons.lang.Validate; + import org.bukkit.Warning; + import org.bukkit.entity.Player; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++ + /** + * Called when a player attempts to tab-complete a chat message. + * +diff --git a/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java b/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java +index a6dae91073ffc054d616d73941ff4d033989f5f3..a794c57b0b6ef35101aa8b7cc75e9f8556bc33b8 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java +@@ -1,13 +1,14 @@ + package org.bukkit.event.player; + +-import java.util.HashSet; +-import java.util.Set; + import org.apache.commons.lang.Validate; + import org.bukkit.entity.Player; + import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.HashSet; ++import java.util.Set; ++ + /** + * This event is called whenever a player runs a command (by placing a slash + * at the start of their message). It is called early in the command handling +diff --git a/src/main/java/org/bukkit/event/player/PlayerCommandSendEvent.java b/src/main/java/org/bukkit/event/player/PlayerCommandSendEvent.java +index 762825997f1c6249de4ba5a0618d94bd1ec9ef33..2d41822428fd5175a3a6beac46be79ac7e7f30f5 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerCommandSendEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerCommandSendEvent.java +@@ -1,10 +1,11 @@ + package org.bukkit.event.player; + +-import java.util.Collection; + import org.bukkit.entity.Player; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++ + /** + * This event is called when the list of available server commands is sent to + * the player. +diff --git a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java +index 7c340f539c31a431d7d9204a8135e0bfc31863a8..9c38e6af6e647a371dc5c3f8c4ca04c22e591382 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java +@@ -1,11 +1,10 @@ + package org.bukkit.event.player; + +-import org.bukkit.entity.Entity; // Paper ++import org.bukkit.entity.Entity; + import org.bukkit.entity.Player; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; +- +-import org.jetbrains.annotations.Nullable; // Paper ++import org.jetbrains.annotations.Nullable; + + /** + * Called when a players experience changes naturally +diff --git a/src/main/java/org/bukkit/event/player/PlayerHarvestBlockEvent.java b/src/main/java/org/bukkit/event/player/PlayerHarvestBlockEvent.java +index 0ee86dca0452483bbc08d7b253c952adea29742c..31ebd67a094688878b333df6020c78edfab32278 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerHarvestBlockEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerHarvestBlockEvent.java +@@ -1,6 +1,5 @@ + package org.bukkit.event.player; + +-import java.util.List; + import org.bukkit.block.Block; + import org.bukkit.entity.Player; + import org.bukkit.event.Cancellable; +@@ -8,6 +7,8 @@ import org.bukkit.event.HandlerList; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * This event is called whenever a player harvests a block. + *
+diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +index 084ca8cfcb7381bfa4fa6280748cf9b81210a9c1..51e997476730e45ca5ca6796fb043c73fc0a87bd 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +@@ -1,10 +1,11 @@ + package org.bukkit.event.player; + +-import java.net.InetAddress; + import org.bukkit.entity.Player; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.net.InetAddress; ++ + /** + * Stores details for players attempting to log in. + *
+diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java +index fb066251f793ec3b41bfc075b9478901b15ee549..fc7d5786a6e79b0063d9d1bbc77f9d3f7f7261be 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java +@@ -1,12 +1,13 @@ + package org.bukkit.event.player; + +-import java.net.InetAddress; +-import java.util.UUID; + import org.bukkit.Warning; + import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.net.InetAddress; ++import java.util.UUID; ++ + /** + * Stores details for players attempting to log in + * +diff --git a/src/main/java/org/bukkit/event/raid/RaidFinishEvent.java b/src/main/java/org/bukkit/event/raid/RaidFinishEvent.java +index f0d280b8c1c1db802c420fe77a77f4b9871f281e..74d5739a8db0ff8744bb2c68cc980734b397abd8 100644 +--- a/src/main/java/org/bukkit/event/raid/RaidFinishEvent.java ++++ b/src/main/java/org/bukkit/event/raid/RaidFinishEvent.java +@@ -1,13 +1,14 @@ + package org.bukkit.event.raid; + +-import java.util.Collections; +-import java.util.List; + import org.bukkit.Raid; + import org.bukkit.World; + import org.bukkit.entity.Player; + import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collections; ++import java.util.List; ++ + /** + * This event is called when a {@link Raid} was complete with a clear result. + */ +diff --git a/src/main/java/org/bukkit/event/raid/RaidSpawnWaveEvent.java b/src/main/java/org/bukkit/event/raid/RaidSpawnWaveEvent.java +index cd58dd7de781823804701fc023706e805c0142a8..e9ae947f6a01a874e3ef2b2a56b4726bf64edccb 100644 +--- a/src/main/java/org/bukkit/event/raid/RaidSpawnWaveEvent.java ++++ b/src/main/java/org/bukkit/event/raid/RaidSpawnWaveEvent.java +@@ -1,7 +1,5 @@ + package org.bukkit.event.raid; + +-import java.util.Collections; +-import java.util.List; + import org.bukkit.Raid; + import org.bukkit.World; + import org.bukkit.entity.Raider; +@@ -9,6 +7,9 @@ import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collections; ++import java.util.List; ++ + /** + * Called when a raid wave spawns. + */ +diff --git a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java +index 03bfca9d368bbe4b7c1353d52c883e756bf69bda..8887b2b2fdb64eb99ed3b147ee77d52141ab107b 100644 +--- a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java ++++ b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java +@@ -1,12 +1,13 @@ + package org.bukkit.event.server; + +-import java.util.Set; + import org.bukkit.command.CommandSender; + import org.bukkit.event.Cancellable; + import org.bukkit.event.HandlerList; + import org.bukkit.event.player.AsyncPlayerChatEvent; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * Event triggered for server broadcast messages such as from + * {@link org.bukkit.Server#broadcast(String, String)}. +diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +index 7a2a58bac8e721c3f0c64f69f77be07a51f76d58..f3e4b9cf12bc805d86e96c60c7301b31eac0e130 100644 +--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java ++++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +@@ -1,7 +1,5 @@ + package org.bukkit.event.server; + +-import java.net.InetAddress; +-import java.util.Iterator; + import org.apache.commons.lang.Validate; + import org.bukkit.UndefinedNullability; + import org.bukkit.entity.Player; +@@ -9,6 +7,9 @@ import org.bukkit.event.HandlerList; + import org.bukkit.util.CachedServerIcon; + import org.jetbrains.annotations.NotNull; + ++import java.net.InetAddress; ++import java.util.Iterator; ++ + /** + * Called when a server list ping is coming in. Displayed players can be + * checked and removed by {@link #iterator() iterating} over this event. +diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java +index f96c4ba53ab41ea66d4f9a4d54eeabb63f992b58..0823f1c044205e3670d79d60758b1187ee290f69 100644 +--- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java ++++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java +@@ -1,7 +1,5 @@ + package org.bukkit.event.server; + +-import java.util.ArrayList; +-import java.util.List; + import org.apache.commons.lang.Validate; + import org.bukkit.command.CommandSender; + import org.bukkit.event.Cancellable; +@@ -11,6 +9,9 @@ import org.bukkit.event.player.PlayerCommandSendEvent; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.ArrayList; ++import java.util.List; ++ + /** + * Called when a {@link CommandSender} of any description (ie: player or + * console) attempts to tab complete. +diff --git a/src/main/java/org/bukkit/event/world/LootGenerateEvent.java b/src/main/java/org/bukkit/event/world/LootGenerateEvent.java +index e051dc8b94893a0aa729996695aae91de57f3acd..bb3e634dfc02b48a8e33b72058fda0822a4bf884 100644 +--- a/src/main/java/org/bukkit/event/world/LootGenerateEvent.java ++++ b/src/main/java/org/bukkit/event/world/LootGenerateEvent.java +@@ -1,7 +1,5 @@ + package org.bukkit.event.world; + +-import java.util.Collection; +-import java.util.List; + import org.bukkit.World; + import org.bukkit.entity.Entity; + import org.bukkit.event.Cancellable; +@@ -14,6 +12,9 @@ import org.bukkit.loot.LootTable; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++import java.util.List; ++ + /** + * Called when a {@link LootTable} is generated in the world for an + * {@link InventoryHolder}. +diff --git a/src/main/java/org/bukkit/event/world/PortalCreateEvent.java b/src/main/java/org/bukkit/event/world/PortalCreateEvent.java +index 579f017474ff22f0991ca884c35cdde7e14a94dc..85f395ed5b5bf479936feac1b27e790a78571142 100644 +--- a/src/main/java/org/bukkit/event/world/PortalCreateEvent.java ++++ b/src/main/java/org/bukkit/event/world/PortalCreateEvent.java +@@ -1,6 +1,5 @@ + package org.bukkit.event.world; + +-import java.util.List; + import org.bukkit.World; + import org.bukkit.block.BlockState; + import org.bukkit.entity.Entity; +@@ -9,6 +8,8 @@ import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Called when a portal is created + */ +diff --git a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java +index 7af8d6e51c824cf0592b722b834f1d4986e3cc08..67b78850d0cb8923cccf3d9f22e08406272e861d 100644 +--- a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java ++++ b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java +@@ -1,6 +1,5 @@ + package org.bukkit.event.world; + +-import java.util.List; + import org.bukkit.Location; + import org.bukkit.TreeType; + import org.bukkit.block.BlockState; +@@ -10,6 +9,8 @@ import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Event that is called when an organic structure attempts to grow (Sapling {@literal ->} + * Tree), (Mushroom {@literal ->} Huge Mushroom), naturally or using bonemeal. +diff --git a/src/main/java/org/bukkit/generator/BlockPopulator.java b/src/main/java/org/bukkit/generator/BlockPopulator.java +index e5e3a6a548630ce79fb90d96a40f66af3d5508ee..0b868107d7960c0d9dfd3e280c22e0d4e9de30ba 100644 +--- a/src/main/java/org/bukkit/generator/BlockPopulator.java ++++ b/src/main/java/org/bukkit/generator/BlockPopulator.java +@@ -1,10 +1,11 @@ + package org.bukkit.generator; + +-import java.util.Random; + import org.bukkit.Chunk; + import org.bukkit.World; + import org.jetbrains.annotations.NotNull; + ++import java.util.Random; ++ + /** + * A block populator is responsible for generating a small area of blocks. + *

+diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java +index 5ba77d40a38e5e592ee265e4fbd510043a0b4345..80963c51573ab92a3301e94fdb8082490a75deb8 100644 +--- a/src/main/java/org/bukkit/generator/ChunkGenerator.java ++++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java +@@ -1,8 +1,5 @@ + package org.bukkit.generator; + +-import java.util.ArrayList; +-import java.util.List; +-import java.util.Random; + import org.bukkit.Bukkit; + import org.bukkit.Location; + import org.bukkit.Material; +@@ -14,6 +11,10 @@ import org.bukkit.material.MaterialData; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.ArrayList; ++import java.util.List; ++import java.util.Random; ++ + /** + * A chunk generator is responsible for the initial shaping of an entire + * chunk. For example, the nether chunk generator should shape netherrack and +diff --git a/src/main/java/org/bukkit/help/HelpMap.java b/src/main/java/org/bukkit/help/HelpMap.java +index 48997b5c8ef15f11328868e35b487d2b64975ab0..7a8795f80de93a0f3c5d78cd874de10a4d71fcd6 100644 +--- a/src/main/java/org/bukkit/help/HelpMap.java ++++ b/src/main/java/org/bukkit/help/HelpMap.java +@@ -1,10 +1,11 @@ + package org.bukkit.help; + +-import java.util.Collection; +-import java.util.List; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++import java.util.List; ++ + /** + * The HelpMap tracks all help topics registered in a Bukkit server. When the + * server starts up or is reloaded, help is processed and topics are added in +diff --git a/src/main/java/org/bukkit/help/HelpTopicComparator.java b/src/main/java/org/bukkit/help/HelpTopicComparator.java +index 75bb69283f509e8f4fec772714a509a51be9de19..45f14e04142d63e1b3ef2be6e20dd9c815e5b84e 100644 +--- a/src/main/java/org/bukkit/help/HelpTopicComparator.java ++++ b/src/main/java/org/bukkit/help/HelpTopicComparator.java +@@ -1,8 +1,9 @@ + package org.bukkit.help; + +-import java.util.Comparator; + import org.jetbrains.annotations.NotNull; + ++import java.util.Comparator; ++ + /** + * Used to impose a custom total ordering on help topics. + *

+diff --git a/src/main/java/org/bukkit/help/IndexHelpTopic.java b/src/main/java/org/bukkit/help/IndexHelpTopic.java +index 88a812d66b7eea7389103b9c2776a8adcfc141c7..f24d7235561c0f917f596b699ebdb6a46eb3fd71 100644 +--- a/src/main/java/org/bukkit/help/IndexHelpTopic.java ++++ b/src/main/java/org/bukkit/help/IndexHelpTopic.java +@@ -1,6 +1,5 @@ + package org.bukkit.help; + +-import java.util.Collection; + import org.bukkit.ChatColor; + import org.bukkit.command.CommandSender; + import org.bukkit.command.ConsoleCommandSender; +@@ -9,6 +8,8 @@ import org.bukkit.util.ChatPaginator; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++ + /** + * This help topic generates a list of other help topics. This class is useful + * for adding your own index help topics. To enforce a particular order, use a +diff --git a/src/main/java/org/bukkit/inventory/CookingRecipe.java b/src/main/java/org/bukkit/inventory/CookingRecipe.java +index 6f251252aa96f202139103c657a81c71a0ffbfaf..62ae78a7ddaf6ee70fde222621d3f13559de6595 100644 +--- a/src/main/java/org/bukkit/inventory/CookingRecipe.java ++++ b/src/main/java/org/bukkit/inventory/CookingRecipe.java +@@ -1,12 +1,13 @@ + package org.bukkit.inventory; + + import com.google.common.base.Preconditions; +-import java.util.Collections; + import org.bukkit.Keyed; + import org.bukkit.Material; + import org.bukkit.NamespacedKey; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collections; ++ + /** + * Represents a cooking recipe. + * @param type of recipe +diff --git a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java +index 1d442dc16cbb0fed21714d47007f3f11e30c57d4..860363507f4c5f7ffb5e8b65a4f6cec1cdfbc0b6 100644 +--- a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java ++++ b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java +@@ -1,11 +1,12 @@ + package org.bukkit.inventory; + +-import java.util.Collections; + import org.bukkit.Material; + import org.bukkit.NamespacedKey; + import org.bukkit.material.MaterialData; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collections; ++ + /** + * Represents a furnace recipe. + */ +diff --git a/src/main/java/org/bukkit/inventory/GrindstoneInventory.java b/src/main/java/org/bukkit/inventory/GrindstoneInventory.java +index 1c750108f55a0a31ad23433b333e0ea486a63ff2..d09a45c9730990084f9f96a837b8a7db968be20e 100644 +--- a/src/main/java/org/bukkit/inventory/GrindstoneInventory.java ++++ b/src/main/java/org/bukkit/inventory/GrindstoneInventory.java +@@ -1,6 +1,6 @@ + package org.bukkit.inventory; + +-import org.jetbrains.annotations.Nullable; // Paper ++import org.jetbrains.annotations.Nullable; + + /** + * Interface to the inventory of a Grindstone. +diff --git a/src/main/java/org/bukkit/inventory/HorseInventory.java b/src/main/java/org/bukkit/inventory/HorseInventory.java +index 53498debe4cfb80592ef3025270bc8e5df4a5fec..e14c1277c3051acd1aa47658f58e3ef3e4a3662f 100644 +--- a/src/main/java/org/bukkit/inventory/HorseInventory.java ++++ b/src/main/java/org/bukkit/inventory/HorseInventory.java +@@ -1,7 +1,5 @@ + package org.bukkit.inventory; + +-import org.jetbrains.annotations.Nullable; +- + /** + * An interface to the inventory of a Horse. + */ +diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java +index 753c052291afb0455df8298ea3a8209778ba400f..3a0643b918a3c7d303f71c495bed8c1e9575e23f 100644 +--- a/src/main/java/org/bukkit/inventory/Inventory.java ++++ b/src/main/java/org/bukkit/inventory/Inventory.java +@@ -1,8 +1,5 @@ + package org.bukkit.inventory; + +-import java.util.HashMap; +-import java.util.List; +-import java.util.ListIterator; + import org.bukkit.Location; + import org.bukkit.Material; + import org.bukkit.entity.HumanEntity; +@@ -11,6 +8,10 @@ import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++import java.util.List; ++import java.util.ListIterator; ++ + /** + * Interface to the various inventories. Behavior relating to {@link + * Material#AIR} is unspecified. +diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java +index b93df6bea4af1b2d4123be031adecf030bcc3893..428ceabb5355794317c855e962d7988c8b837c7f 100644 +--- a/src/main/java/org/bukkit/inventory/ItemStack.java ++++ b/src/main/java/org/bukkit/inventory/ItemStack.java +@@ -1,10 +1,6 @@ + package org.bukkit.inventory; + + import com.google.common.collect.ImmutableMap; +-import java.util.LinkedHashMap; +-import java.util.List; // Paper +-import java.util.Map; +-import java.util.Set; // Paper + import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + import org.bukkit.Material; +@@ -18,6 +14,11 @@ import org.bukkit.material.MaterialData; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.LinkedHashMap; ++import java.util.List; ++import java.util.Map; ++import java.util.Set; ++ + /** + * Represents a stack of items. + *

+diff --git a/src/main/java/org/bukkit/inventory/Merchant.java b/src/main/java/org/bukkit/inventory/Merchant.java +index 9861bcedde6e63009d0775c57c63893aaf7870fa..e879a5278e6c25edf0668e347d6b07f5aeea45e1 100644 +--- a/src/main/java/org/bukkit/inventory/Merchant.java ++++ b/src/main/java/org/bukkit/inventory/Merchant.java +@@ -1,10 +1,11 @@ + package org.bukkit.inventory; + +-import java.util.List; + import org.bukkit.entity.HumanEntity; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Represents a merchant. A merchant is a special type of inventory which can + * facilitate custom trades between items. +diff --git a/src/main/java/org/bukkit/inventory/MerchantRecipe.java b/src/main/java/org/bukkit/inventory/MerchantRecipe.java +index 1fb4a1c53791776f9c5a952a592f15fc35cb2703..149e63b3a6ec6c71554850b28a787b83bb729e25 100644 +--- a/src/main/java/org/bukkit/inventory/MerchantRecipe.java ++++ b/src/main/java/org/bukkit/inventory/MerchantRecipe.java +@@ -1,9 +1,10 @@ + package org.bukkit.inventory; + + import com.google.common.base.Preconditions; ++import org.jetbrains.annotations.NotNull; ++ + import java.util.ArrayList; + import java.util.List; +-import org.jetbrains.annotations.NotNull; + + /** + * Represents a merchant's trade. +diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java +index 3d325cab6b106ce8617e321d7a733eca91ba93e5..92255656afc140220522261f82ed4b954d542dd8 100644 +--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java ++++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java +@@ -1,16 +1,13 @@ + package org.bukkit.inventory; + + import com.google.common.base.Preconditions; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Collections; +-import java.util.List; +-import java.util.Objects; +-import java.util.function.Predicate; + import org.bukkit.Material; + import org.bukkit.Tag; + import org.jetbrains.annotations.NotNull; + ++import java.util.*; ++import java.util.function.Predicate; ++ + /** + * Represents a potential item match within a recipe. All choices within a + * recipe must be satisfied for it to be craftable. +diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java +index 222a12baa8e93ad686ab59426653f066d5876e38..62d20e28aa26f9d7dedac126f8c2e4e22845c080 100644 +--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java ++++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java +@@ -1,9 +1,6 @@ + package org.bukkit.inventory; + + import com.google.common.base.Preconditions; +-import java.util.Collections; +-import java.util.HashMap; +-import java.util.Map; + import org.apache.commons.lang.Validate; + import org.bukkit.Keyed; + import org.bukkit.Material; +@@ -11,6 +8,10 @@ import org.bukkit.NamespacedKey; + import org.bukkit.material.MaterialData; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collections; ++import java.util.HashMap; ++import java.util.Map; ++ + /** + * Represents a shaped (ie normal) crafting recipe. + */ +diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +index ddcf84e6609abe8379cca2ff99983ce3efbab805..9d71e03be3342a3204725ed4aff56a2847373335 100644 +--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java ++++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +@@ -1,10 +1,6 @@ + package org.bukkit.inventory; + + import com.google.common.base.Preconditions; +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; + import org.apache.commons.lang.Validate; + import org.bukkit.Keyed; + import org.bukkit.Material; +@@ -12,6 +8,11 @@ import org.bukkit.NamespacedKey; + import org.bukkit.material.MaterialData; + import org.jetbrains.annotations.NotNull; + ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.Iterator; ++import java.util.List; ++ + /** + * Represents a shapeless recipe, where the arrangement of the ingredients on + * the crafting grid does not matter. +diff --git a/src/main/java/org/bukkit/inventory/StonecutterInventory.java b/src/main/java/org/bukkit/inventory/StonecutterInventory.java +index e7a8e7188bf8b9840de56dc80c2b79d64a9389cb..160b44f36f5b0f985e4c1aa31e53b8ce6d9614bd 100644 +--- a/src/main/java/org/bukkit/inventory/StonecutterInventory.java ++++ b/src/main/java/org/bukkit/inventory/StonecutterInventory.java +@@ -1,6 +1,6 @@ + package org.bukkit.inventory; + +-import org.jetbrains.annotations.Nullable; // Paper ++import org.jetbrains.annotations.Nullable; + + /** + * Interface to the inventory of a Stonecutter. +diff --git a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java +index d8ef781d6b025790ce9d2a9782e6ef2a47cc8e62..9c59aec2525e1a71def39fd3dc71d40dc0b55dcb 100644 +--- a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java ++++ b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java +@@ -1,12 +1,13 @@ + package org.bukkit.inventory; + + import com.google.common.base.Preconditions; +-import java.util.Collections; + import org.bukkit.Keyed; + import org.bukkit.Material; + import org.bukkit.NamespacedKey; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collections; ++ + /** + * Represents a Stonecutting recipe. + */ +diff --git a/src/main/java/org/bukkit/inventory/meta/BannerMeta.java b/src/main/java/org/bukkit/inventory/meta/BannerMeta.java +index 4739d2ecc26e7e4adc1b297013da98e12fe58783..c8c8f4405bf892a61ebd8cdc28ae91d588ef8f76 100644 +--- a/src/main/java/org/bukkit/inventory/meta/BannerMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/BannerMeta.java +@@ -1,11 +1,12 @@ + package org.bukkit.inventory.meta; + +-import java.util.List; + import org.bukkit.DyeColor; + import org.bukkit.block.banner.Pattern; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + public interface BannerMeta extends ItemMeta { + + /** +diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java +index 94852d50e88d0594b84b581cd627174043629995..4ad51d1cf1ad4ea1ea703dbb0fc7c8dd020e074d 100644 +--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java +@@ -1,11 +1,12 @@ + package org.bukkit.inventory.meta; + +-import java.util.List; + import net.md_5.bungee.api.chat.BaseComponent; + import org.bukkit.Material; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Represents a book ({@link Material#WRITABLE_BOOK} or {@link + * Material#WRITTEN_BOOK}) that can have a title, an author, and pages. +diff --git a/src/main/java/org/bukkit/inventory/meta/CrossbowMeta.java b/src/main/java/org/bukkit/inventory/meta/CrossbowMeta.java +index 35c6594fd1040a1af1029e7260e5e3a9307b107d..6dcdb271166d3a3ff601f93b156e78ab8c72955b 100644 +--- a/src/main/java/org/bukkit/inventory/meta/CrossbowMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/CrossbowMeta.java +@@ -1,10 +1,11 @@ + package org.bukkit.inventory.meta; + +-import java.util.List; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + public interface CrossbowMeta extends ItemMeta { + + /** +diff --git a/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java b/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java +index aae2ed2ec4498101ce78b7f96fed1b8c341ffc4f..1b786f24140a5767228c9bef228a864c5c9f6fc5 100644 +--- a/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/EnchantmentStorageMeta.java +@@ -1,10 +1,11 @@ + package org.bukkit.inventory.meta; + +-import java.util.Map; + import org.bukkit.Material; + import org.bukkit.enchantments.Enchantment; + import org.jetbrains.annotations.NotNull; + ++import java.util.Map; ++ + /** + * EnchantmentMeta is specific to items that can store enchantments, as + * opposed to being enchanted. {@link Material#ENCHANTED_BOOK} is an example +diff --git a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java +index fe23948170ccb101d58730d0066233d334022331..ded985ec52eb8045a896aef57b4b65236a78bc91 100644 +--- a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java +@@ -1,10 +1,11 @@ + package org.bukkit.inventory.meta; + +-import java.util.List; + import org.bukkit.FireworkEffect; + import org.bukkit.Material; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Represents a {@link Material#FIREWORK_ROCKET} and its effects. + */ +diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +index 5db838cab09888c3b3537e122e0e381a78e1dbb7..1e3ff677d26b9ecec398266ee82ef5a91699e291 100644 +--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +@@ -1,10 +1,6 @@ + package org.bukkit.inventory.meta; + + import com.google.common.collect.Multimap; +-import java.util.Collection; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; + import org.bukkit.attribute.Attribute; + import org.bukkit.attribute.AttributeModifier; + import org.bukkit.configuration.serialization.ConfigurationSerializable; +@@ -16,6 +12,11 @@ import org.bukkit.persistence.PersistentDataHolder; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++import java.util.List; ++import java.util.Map; ++import java.util.Set; ++ + /** + * This type represents the storage mechanism for auxiliary item data. + *

+diff --git a/src/main/java/org/bukkit/inventory/meta/KnowledgeBookMeta.java b/src/main/java/org/bukkit/inventory/meta/KnowledgeBookMeta.java +index 736c60c71d112e8c017473a93091b4e5336a996f..594cefd3ee790c550b98bfaaf67dc0fcb915bc03 100644 +--- a/src/main/java/org/bukkit/inventory/meta/KnowledgeBookMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/KnowledgeBookMeta.java +@@ -1,9 +1,10 @@ + package org.bukkit.inventory.meta; + +-import java.util.List; + import org.bukkit.NamespacedKey; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + public interface KnowledgeBookMeta extends ItemMeta { + + /** +diff --git a/src/main/java/org/bukkit/inventory/meta/PotionMeta.java b/src/main/java/org/bukkit/inventory/meta/PotionMeta.java +index 1056849dc3a0dc91c5485a0c55ef96ad3aa187c4..ec61fba71c0028708b01177b6ce819703edf49e0 100644 +--- a/src/main/java/org/bukkit/inventory/meta/PotionMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/PotionMeta.java +@@ -1,6 +1,5 @@ + package org.bukkit.inventory.meta; + +-import java.util.List; + import org.bukkit.Color; + import org.bukkit.potion.PotionData; + import org.bukkit.potion.PotionEffect; +@@ -8,6 +7,8 @@ import org.bukkit.potion.PotionEffectType; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Represents a potion or item that can have custom effects. + */ +diff --git a/src/main/java/org/bukkit/inventory/meta/SuspiciousStewMeta.java b/src/main/java/org/bukkit/inventory/meta/SuspiciousStewMeta.java +index c2f4282c188e7d8041459cb3acaad674443ba147..68fcc6086406577738d2c3195850cf832b180cc8 100644 +--- a/src/main/java/org/bukkit/inventory/meta/SuspiciousStewMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/SuspiciousStewMeta.java +@@ -1,10 +1,11 @@ + package org.bukkit.inventory.meta; + +-import java.util.List; + import org.bukkit.potion.PotionEffect; + import org.bukkit.potion.PotionEffectType; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * Represents a suspicious stew that can have custom effects. + */ +diff --git a/src/main/java/org/bukkit/loot/LootTable.java b/src/main/java/org/bukkit/loot/LootTable.java +index 73aa119b6e2d0d02c9c60ec5157573ceaabf4e3b..b391b55de8ab54b8d13a430038731a3fa4c0f65c 100644 +--- a/src/main/java/org/bukkit/loot/LootTable.java ++++ b/src/main/java/org/bukkit/loot/LootTable.java +@@ -1,12 +1,13 @@ + package org.bukkit.loot; + +-import java.util.Collection; +-import java.util.Random; + import org.bukkit.Keyed; + import org.bukkit.inventory.Inventory; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++import java.util.Random; ++ + /** + * LootTables are technical files that represent what items should be in + * naturally generated containers, what items should be dropped when killing a +diff --git a/src/main/java/org/bukkit/map/MapCanvas.java b/src/main/java/org/bukkit/map/MapCanvas.java +index cc1714019d7a6c230948dc62dae5ba19b95f2fe7..5f039d15daa27513ac4f400de6776bdfed9b5737 100644 +--- a/src/main/java/org/bukkit/map/MapCanvas.java ++++ b/src/main/java/org/bukkit/map/MapCanvas.java +@@ -1,8 +1,9 @@ + package org.bukkit.map; + +-import java.awt.Image; + import org.jetbrains.annotations.NotNull; + ++import java.awt.*; ++ + /** + * Represents a canvas for drawing to a map. Each canvas is associated with a + * specific {@link MapRenderer} and represents that renderer's layer on the +diff --git a/src/main/java/org/bukkit/map/MapCursorCollection.java b/src/main/java/org/bukkit/map/MapCursorCollection.java +index 4dba721aefe4fc6699b3b4bfa7ecb0b19c2a2a1a..be0683ba61d4839500956d89236f9ec9c91b9ffa 100644 +--- a/src/main/java/org/bukkit/map/MapCursorCollection.java ++++ b/src/main/java/org/bukkit/map/MapCursorCollection.java +@@ -1,10 +1,11 @@ + package org.bukkit.map; + +-import java.util.ArrayList; +-import java.util.List; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.ArrayList; ++import java.util.List; ++ + /** + * Represents all the map cursors on a {@link MapCanvas}. Like MapCanvas, a + * MapCursorCollection is linked to a specific {@link MapRenderer}. +diff --git a/src/main/java/org/bukkit/map/MapFont.java b/src/main/java/org/bukkit/map/MapFont.java +index 2d599c8f3ef1df4c1bde87e502f794984b9401bc..1092c58315e52683b79c43ee01541c4ea22d7904 100644 +--- a/src/main/java/org/bukkit/map/MapFont.java ++++ b/src/main/java/org/bukkit/map/MapFont.java +@@ -1,10 +1,11 @@ + package org.bukkit.map; + +-import java.util.HashMap; + import org.bukkit.ChatColor; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++ + /** + * Represents a bitmap font drawable to a map. + */ +diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java +index 95fe3f4d081053a6cf484e4ef07b474f2dc2ab02..36d9b177623a2ec0588ff0637e1d9f7e3f2dc7be 100644 +--- a/src/main/java/org/bukkit/map/MapPalette.java ++++ b/src/main/java/org/bukkit/map/MapPalette.java +@@ -1,12 +1,11 @@ + package org.bukkit.map; + +-import java.awt.Color; +-import java.awt.Graphics2D; +-import java.awt.Image; +-import java.awt.image.BufferedImage; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.awt.*; ++import java.awt.image.BufferedImage; ++ + /** + * Represents the palette that map items use. + *

+diff --git a/src/main/java/org/bukkit/map/MapView.java b/src/main/java/org/bukkit/map/MapView.java +index 9b8b68b66dc15b06800251702c2722623c8462a0..5873ced977965613df67621d25a46b38a30f03a9 100644 +--- a/src/main/java/org/bukkit/map/MapView.java ++++ b/src/main/java/org/bukkit/map/MapView.java +@@ -1,11 +1,12 @@ + package org.bukkit.map; + +-import java.util.List; + import org.bukkit.World; + import org.bukkit.inventory.meta.MapMeta; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.List; ++ + /** + * Represents a map item. + */ +diff --git a/src/main/java/org/bukkit/material/MonsterEggs.java b/src/main/java/org/bukkit/material/MonsterEggs.java +index 2fac218f1e237d4b867c1e6215fe40151dcceaf0..b424b622602e0a7a32ee8006570c85017b301594 100644 +--- a/src/main/java/org/bukkit/material/MonsterEggs.java ++++ b/src/main/java/org/bukkit/material/MonsterEggs.java +@@ -1,8 +1,9 @@ + package org.bukkit.material; + ++import org.bukkit.Material; ++ + import java.util.ArrayList; + import java.util.List; +-import org.bukkit.Material; + + /** + * Represents the different types of monster eggs +diff --git a/src/main/java/org/bukkit/material/Mushroom.java b/src/main/java/org/bukkit/material/Mushroom.java +index 543b76c8a659a488c3e87d7b59b2f14cf7d651f1..2b45156ee38abd9ec5a350fa59dfbef61bf07d90 100644 +--- a/src/main/java/org/bukkit/material/Mushroom.java ++++ b/src/main/java/org/bukkit/material/Mushroom.java +@@ -1,12 +1,13 @@ + package org.bukkit.material; + +-import java.util.EnumSet; +-import java.util.Set; + import org.apache.commons.lang.Validate; + import org.bukkit.Material; + import org.bukkit.block.BlockFace; + import org.bukkit.material.types.MushroomBlockTexture; + ++import java.util.EnumSet; ++import java.util.Set; ++ + /** + * Represents a huge mushroom block with certain combinations of faces set to + * cap, pores or stem. +diff --git a/src/main/java/org/bukkit/material/SmoothBrick.java b/src/main/java/org/bukkit/material/SmoothBrick.java +index e4812b7cef9847745d147aad87181c4eb903f5df..6ab768762c77bb0c40cf9df94a7b4203dda5dde5 100644 +--- a/src/main/java/org/bukkit/material/SmoothBrick.java ++++ b/src/main/java/org/bukkit/material/SmoothBrick.java +@@ -1,8 +1,9 @@ + package org.bukkit.material; + ++import org.bukkit.Material; ++ + import java.util.ArrayList; + import java.util.List; +-import org.bukkit.Material; + + /** + * Represents the different types of smooth bricks. +diff --git a/src/main/java/org/bukkit/material/Step.java b/src/main/java/org/bukkit/material/Step.java +index 9f502e7ee05d0512e190a1722cc112ece068c4e2..2b20e77dfded15b0b68159b6941ccfbcd3a814a3 100644 +--- a/src/main/java/org/bukkit/material/Step.java ++++ b/src/main/java/org/bukkit/material/Step.java +@@ -1,8 +1,9 @@ + package org.bukkit.material; + ++import org.bukkit.Material; ++ + import java.util.ArrayList; + import java.util.List; +-import org.bukkit.Material; + + /** + * Represents the different types of steps. +diff --git a/src/main/java/org/bukkit/material/TexturedMaterial.java b/src/main/java/org/bukkit/material/TexturedMaterial.java +index 6e0a834794453eff7b3efc93e90c9bf49ef7c688..7b30258c8eb102dcaa396d6eec75607bc9077eb1 100644 +--- a/src/main/java/org/bukkit/material/TexturedMaterial.java ++++ b/src/main/java/org/bukkit/material/TexturedMaterial.java +@@ -1,8 +1,9 @@ + package org.bukkit.material; + +-import java.util.List; + import org.bukkit.Material; + ++import java.util.List; ++ + /** + * Represents textured materials like steps and smooth bricks + * +diff --git a/src/main/java/org/bukkit/material/Vine.java b/src/main/java/org/bukkit/material/Vine.java +index 07a4f3b1511e274affe751aad2b9020b49df815f..f6e660aa788558920ba29dd8d39449481fb2e77e 100644 +--- a/src/main/java/org/bukkit/material/Vine.java ++++ b/src/main/java/org/bukkit/material/Vine.java +@@ -1,10 +1,11 @@ + package org.bukkit.material; + +-import java.util.Arrays; +-import java.util.EnumSet; + import org.bukkit.Material; + import org.bukkit.block.BlockFace; + ++import java.util.Arrays; ++import java.util.EnumSet; ++ + /** + * Represents a vine + * +diff --git a/src/main/java/org/bukkit/material/types/MushroomBlockTexture.java b/src/main/java/org/bukkit/material/types/MushroomBlockTexture.java +index 0ea9c6b2420a0f990bd1fdf50fc015e37a7060d8..24c2073dda1cf9423cf008aca0c4d815b2fc36a4 100644 +--- a/src/main/java/org/bukkit/material/types/MushroomBlockTexture.java ++++ b/src/main/java/org/bukkit/material/types/MushroomBlockTexture.java +@@ -1,10 +1,11 @@ + package org.bukkit.material.types; + + import com.google.common.collect.Maps; +-import java.util.Map; + import org.bukkit.block.BlockFace; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + /** + * Represents the different textured blocks of mushroom. + */ +diff --git a/src/main/java/org/bukkit/metadata/LazyMetadataValue.java b/src/main/java/org/bukkit/metadata/LazyMetadataValue.java +index 86e0e3767e6e711bd58660a102e98c917a585b1b..de4b317e76f7c949e29952ba979aaab778f04792 100644 +--- a/src/main/java/org/bukkit/metadata/LazyMetadataValue.java ++++ b/src/main/java/org/bukkit/metadata/LazyMetadataValue.java +@@ -1,12 +1,13 @@ + package org.bukkit.metadata; + +-import java.lang.ref.SoftReference; +-import java.util.concurrent.Callable; + import org.apache.commons.lang.Validate; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.lang.ref.SoftReference; ++import java.util.concurrent.Callable; ++ + /** + * The LazyMetadataValue class implements a type of metadata that is not + * computed until another plugin asks for it. +diff --git a/src/main/java/org/bukkit/metadata/MetadataStore.java b/src/main/java/org/bukkit/metadata/MetadataStore.java +index 29f86fa938c2758cbdf8dec22519a18c3e119818..1ebba41f4a10faf4bd1120f71455400904698456 100644 +--- a/src/main/java/org/bukkit/metadata/MetadataStore.java ++++ b/src/main/java/org/bukkit/metadata/MetadataStore.java +@@ -1,9 +1,10 @@ + package org.bukkit.metadata; + +-import java.util.List; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + public interface MetadataStore { + /** + * Adds a metadata value to an object. +diff --git a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +index abbe545af572687a0399c2387434863cd2b70f68..9a40bea9e4b0a6123e33a4bc49774c841c28a5b5 100644 +--- a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java ++++ b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +@@ -1,17 +1,11 @@ + package org.bukkit.metadata; + +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.HashMap; +-import java.util.Iterator; // Paper +-import java.util.List; +-import java.util.Map; +-import java.util.WeakHashMap; + import org.apache.commons.lang.Validate; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + ++import java.util.*; ++ + public abstract class MetadataStoreBase { + private Map> metadataMap = new java.util.concurrent.ConcurrentHashMap>(); // Paper + +diff --git a/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java b/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java +index b90d09f57bdab627abdf8a54438b1b531f2c6827..d14dec86eff1a1a8778befa7457c5a3653f2f557 100644 +--- a/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java ++++ b/src/main/java/org/bukkit/metadata/MetadataValueAdapter.java +@@ -1,12 +1,13 @@ + package org.bukkit.metadata; + +-import java.lang.ref.WeakReference; + import org.apache.commons.lang.Validate; + import org.bukkit.plugin.Plugin; + import org.bukkit.util.NumberConversions; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.lang.ref.WeakReference; ++ + /** + * Optional base class for facilitating MetadataValue implementations. + *

+diff --git a/src/main/java/org/bukkit/metadata/Metadatable.java b/src/main/java/org/bukkit/metadata/Metadatable.java +index b35f41a15fc729d62474a0b38d59ca7895951f2c..891e516083cc7261d238144662dd6cdc3f1db863 100644 +--- a/src/main/java/org/bukkit/metadata/Metadatable.java ++++ b/src/main/java/org/bukkit/metadata/Metadatable.java +@@ -1,9 +1,10 @@ + package org.bukkit.metadata; + +-import java.util.List; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + ++import java.util.List; ++ + /** + * This interface is implemented by all objects that can provide metadata + * about themselves. +diff --git a/src/main/java/org/bukkit/permissions/Permissible.java b/src/main/java/org/bukkit/permissions/Permissible.java +index 228421154913116069c20323afb519bdde2134df..2fe3d7e9971d882764e2918ff1c1a593f40a3321 100644 +--- a/src/main/java/org/bukkit/permissions/Permissible.java ++++ b/src/main/java/org/bukkit/permissions/Permissible.java +@@ -1,10 +1,11 @@ + package org.bukkit.permissions; + +-import java.util.Set; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Set; ++ + /** + * Represents an object that may be assigned permissions + */ +diff --git a/src/main/java/org/bukkit/permissions/PermissibleBase.java b/src/main/java/org/bukkit/permissions/PermissibleBase.java +index c94e4cdb5785d5dfcb704c4adabda0b19a20ec7d..945573f6a7a82f849f15a525761f0a7ec867c400 100644 +--- a/src/main/java/org/bukkit/permissions/PermissibleBase.java ++++ b/src/main/java/org/bukkit/permissions/PermissibleBase.java +@@ -1,17 +1,13 @@ + package org.bukkit.permissions; + +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.LinkedList; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.logging.Level; + import org.bukkit.Bukkit; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.*; ++import java.util.logging.Level; ++ + /** + * Base Permissible for use in any Permissible object via proxy or extension + */ +diff --git a/src/main/java/org/bukkit/permissions/Permission.java b/src/main/java/org/bukkit/permissions/Permission.java +index 91d45b965724bc3ecf9697b88bafa88c010e9ada..71e5f3e3b2b70f83a8707bba28847436c5cf1948 100644 +--- a/src/main/java/org/bukkit/permissions/Permission.java ++++ b/src/main/java/org/bukkit/permissions/Permission.java +@@ -1,17 +1,14 @@ + package org.bukkit.permissions; + +-import java.util.ArrayList; +-import java.util.LinkedHashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.logging.Level; + import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + import org.bukkit.plugin.PluginManager; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.*; ++import java.util.logging.Level; ++ + /** + * Represents a unique permission that may be attached to a {@link + * Permissible} +diff --git a/src/main/java/org/bukkit/permissions/PermissionAttachment.java b/src/main/java/org/bukkit/permissions/PermissionAttachment.java +index cd8ac371a16173e2415c2628a96c1dc3c6ca895d..8ab583927799da4c2603ac827fe52495f2dbdfa8 100644 +--- a/src/main/java/org/bukkit/permissions/PermissionAttachment.java ++++ b/src/main/java/org/bukkit/permissions/PermissionAttachment.java +@@ -1,11 +1,12 @@ + package org.bukkit.permissions; + +-import java.util.LinkedHashMap; +-import java.util.Map; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.LinkedHashMap; ++import java.util.Map; ++ + /** + * Holds information about a permission attachment on a {@link Permissible} + * object +diff --git a/src/main/java/org/bukkit/permissions/PermissionDefault.java b/src/main/java/org/bukkit/permissions/PermissionDefault.java +index 449df7c798084669c1f39cbeb5c72c4b17a67162..3380f2f20f21cc0f34c3c661fe902ce05cd59d54 100644 +--- a/src/main/java/org/bukkit/permissions/PermissionDefault.java ++++ b/src/main/java/org/bukkit/permissions/PermissionDefault.java +@@ -1,10 +1,11 @@ + package org.bukkit.permissions; + +-import java.util.HashMap; +-import java.util.Map; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.HashMap; ++import java.util.Map; ++ + /** + * Represents the possible default values for permissions + */ +diff --git a/src/main/java/org/bukkit/persistence/PersistentDataContainer.java b/src/main/java/org/bukkit/persistence/PersistentDataContainer.java +index bf2a957be52d86d07d7d303c86bd3da5fe0a16c0..ebf6252749d7e3e4e36537f0650a6181769bc728 100644 +--- a/src/main/java/org/bukkit/persistence/PersistentDataContainer.java ++++ b/src/main/java/org/bukkit/persistence/PersistentDataContainer.java +@@ -1,10 +1,11 @@ + package org.bukkit.persistence; + +-import java.util.Set; + import org.bukkit.NamespacedKey; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Set; ++ + /** + * This interface represents a map like object, capable of storing custom tags + * in it. +diff --git a/src/main/java/org/bukkit/plugin/EventExecutor.java b/src/main/java/org/bukkit/plugin/EventExecutor.java +index 9026e108ccd3a88aee1267ee275137befa646455..a879801e435e6fc0f78c5ae440d1342298fea729 100644 +--- a/src/main/java/org/bukkit/plugin/EventExecutor.java ++++ b/src/main/java/org/bukkit/plugin/EventExecutor.java +@@ -1,22 +1,20 @@ + package org.bukkit.plugin; + ++import com.destroystokyo.paper.event.executor.MethodHandleEventExecutor; ++import com.destroystokyo.paper.event.executor.StaticMethodHandleEventExecutor; ++import com.destroystokyo.paper.event.executor.asm.ASMEventExecutorGenerator; ++import com.destroystokyo.paper.event.executor.asm.ClassDefiner; ++import com.google.common.base.Preconditions; + import org.bukkit.event.Event; + import org.bukkit.event.EventException; + import org.bukkit.event.Listener; + import org.jetbrains.annotations.NotNull; + +-// Paper start + import java.lang.reflect.Method; + import java.lang.reflect.Modifier; + import java.util.concurrent.ConcurrentHashMap; + import java.util.concurrent.ConcurrentMap; + import java.util.function.Function; +- +-import com.destroystokyo.paper.event.executor.MethodHandleEventExecutor; +-import com.destroystokyo.paper.event.executor.StaticMethodHandleEventExecutor; +-import com.destroystokyo.paper.event.executor.asm.ASMEventExecutorGenerator; +-import com.destroystokyo.paper.event.executor.asm.ClassDefiner; +-import com.google.common.base.Preconditions; + // Paper end + + /** +diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java +index 79890c68f1ad31f951dfdbd9a16dac500ec58c40..9bb6821f881f1c43a03410d4e92afeb308e3f962 100644 +--- a/src/main/java/org/bukkit/plugin/Plugin.java ++++ b/src/main/java/org/bukkit/plugin/Plugin.java +@@ -1,8 +1,5 @@ + package org.bukkit.plugin; + +-import java.io.File; +-import java.io.InputStream; +-import java.util.logging.Logger; + import org.bukkit.Server; + import org.bukkit.command.TabExecutor; + import org.bukkit.configuration.file.FileConfiguration; +@@ -10,6 +7,10 @@ import org.bukkit.generator.ChunkGenerator; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.io.File; ++import java.io.InputStream; ++import java.util.logging.Logger; ++ + /** + * Represents a Plugin + *

+diff --git a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java +index f78a7df6e2edbbbaeb0edf4330125b2c2fa39a57..9d7ba043bf971e78f30ba751ea036ea54b54fe7d 100644 +--- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java ++++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java +@@ -3,20 +3,7 @@ package org.bukkit.plugin; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.ImmutableSet; +-import java.io.InputStream; +-import java.io.Reader; +-import java.io.Writer; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.regex.Pattern; +-import org.bukkit.command.Command; +-import org.bukkit.command.CommandExecutor; +-import org.bukkit.command.CommandSender; +-import org.bukkit.command.PluginCommand; +-import org.bukkit.command.TabCompleter; ++import org.bukkit.command.*; + import org.bukkit.permissions.Permissible; + import org.bukkit.permissions.Permission; + import org.bukkit.permissions.PermissionDefault; +@@ -29,6 +16,12 @@ import org.yaml.snakeyaml.constructor.SafeConstructor; + import org.yaml.snakeyaml.nodes.Node; + import org.yaml.snakeyaml.nodes.Tag; + ++import java.io.InputStream; ++import java.io.Reader; ++import java.io.Writer; ++import java.util.*; ++import java.util.regex.Pattern; ++ + /** + * This type is the runtime-container for the information in the plugin.yml. + * All plugins must have a respective plugin.yml. For plugins written in java +diff --git a/src/main/java/org/bukkit/plugin/PluginLoader.java b/src/main/java/org/bukkit/plugin/PluginLoader.java +index 6ab9cd8213cbe35943748dcf42948d5fc048c84c..65ffd55db5aaa8bb337d9b892d4c222e915291fa 100644 +--- a/src/main/java/org/bukkit/plugin/PluginLoader.java ++++ b/src/main/java/org/bukkit/plugin/PluginLoader.java +@@ -1,12 +1,13 @@ + package org.bukkit.plugin; + ++import org.bukkit.event.Event; ++import org.bukkit.event.Listener; ++import org.jetbrains.annotations.NotNull; ++ + import java.io.File; + import java.util.Map; + import java.util.Set; + import java.util.regex.Pattern; +-import org.bukkit.event.Event; +-import org.bukkit.event.Listener; +-import org.jetbrains.annotations.NotNull; + + /** + * Represents a plugin loader, which handles direct access to specific types +diff --git a/src/main/java/org/bukkit/plugin/PluginLogger.java b/src/main/java/org/bukkit/plugin/PluginLogger.java +index 0182370014e0dc8b74759933ab984d16678f6ec3..533f0b6f8145884de006ea2525dbc9a288d3ce22 100644 +--- a/src/main/java/org/bukkit/plugin/PluginLogger.java ++++ b/src/main/java/org/bukkit/plugin/PluginLogger.java +@@ -1,9 +1,10 @@ + package org.bukkit.plugin; + ++import org.jetbrains.annotations.NotNull; ++ + import java.util.logging.Level; + import java.util.logging.LogRecord; + import java.util.logging.Logger; +-import org.jetbrains.annotations.NotNull; + + /** + * The PluginLogger class is a modified {@link Logger} that prepends all +diff --git a/src/main/java/org/bukkit/plugin/PluginManager.java b/src/main/java/org/bukkit/plugin/PluginManager.java +index 86cc5025ad98f7a752c51713b7cd6a39d5136ecc..7a02175fd4f28a4d45607308218bf2fce09c659e 100644 +--- a/src/main/java/org/bukkit/plugin/PluginManager.java ++++ b/src/main/java/org/bukkit/plugin/PluginManager.java +@@ -1,7 +1,5 @@ + package org.bukkit.plugin; + +-import java.io.File; +-import java.util.Set; + import org.bukkit.event.Event; + import org.bukkit.event.EventPriority; + import org.bukkit.event.Listener; +@@ -11,6 +9,9 @@ import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.io.File; ++import java.util.Set; ++ + /** + * Handles all plugin management from the Server + */ +diff --git a/src/main/java/org/bukkit/plugin/RegisteredListener.java b/src/main/java/org/bukkit/plugin/RegisteredListener.java +index 419aec56b0e3fa8bcec2ea7f340caa3456b57d00..a3b3a056b9659cc06aea7859f2fe017e25648cdb 100644 +--- a/src/main/java/org/bukkit/plugin/RegisteredListener.java ++++ b/src/main/java/org/bukkit/plugin/RegisteredListener.java +@@ -1,10 +1,6 @@ + package org.bukkit.plugin; + +-import org.bukkit.event.Cancellable; +-import org.bukkit.event.Event; +-import org.bukkit.event.EventException; +-import org.bukkit.event.EventPriority; +-import org.bukkit.event.Listener; ++import org.bukkit.event.*; + import org.jetbrains.annotations.NotNull; + + /** +diff --git a/src/main/java/org/bukkit/plugin/ServicesManager.java b/src/main/java/org/bukkit/plugin/ServicesManager.java +index 9e2f00572af099d3556f210819a65ee9fa2bc0d5..185b644b122b7696d7d7bc9662758fae8d879724 100644 +--- a/src/main/java/org/bukkit/plugin/ServicesManager.java ++++ b/src/main/java/org/bukkit/plugin/ServicesManager.java +@@ -1,10 +1,11 @@ + package org.bukkit.plugin; + +-import java.util.Collection; +-import java.util.List; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Collection; ++import java.util.List; ++ + /** + * Manages services and service providers. Services are an interface + * specifying a list of methods that a provider must implement. Providers are +diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java +index 26685f59b235ea5b4c4fb7ae21acb5149edaa2b3..f6de2ae1eac3466ab0c6d2a02164bb757ebd95eb 100644 +--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java ++++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java +@@ -1,32 +1,13 @@ + package org.bukkit.plugin; + ++import com.destroystokyo.paper.event.server.ServerExceptionEvent; ++import com.destroystokyo.paper.exception.ServerEventException; ++import com.destroystokyo.paper.exception.ServerPluginEnableDisableException; + import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableSet; + import com.google.common.graph.GraphBuilder; + import com.google.common.graph.Graphs; + import com.google.common.graph.MutableGraph; +-import java.io.File; +-import java.lang.reflect.Constructor; +-import java.lang.reflect.Method; +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Iterator; +-import java.util.LinkedHashMap; +-import java.util.LinkedHashSet; +-import java.util.LinkedList; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.WeakHashMap; +-import java.util.logging.Level; +-import java.util.regex.Matcher; +-import java.util.regex.Pattern; +- +-import com.destroystokyo.paper.event.server.ServerExceptionEvent; +-import com.destroystokyo.paper.exception.ServerEventException; +-import com.destroystokyo.paper.exception.ServerPluginEnableDisableException; + import org.apache.commons.lang.Validate; + import org.bukkit.Server; + import org.bukkit.World; +@@ -44,6 +25,14 @@ import org.bukkit.util.FileUtil; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.io.File; ++import java.lang.reflect.Constructor; ++import java.lang.reflect.Method; ++import java.util.*; ++import java.util.logging.Level; ++import java.util.regex.Matcher; ++import java.util.regex.Pattern; ++ + /** + * Handles all plugin management from the Server + */ +diff --git a/src/main/java/org/bukkit/plugin/SimpleServicesManager.java b/src/main/java/org/bukkit/plugin/SimpleServicesManager.java +index f3dd8490230b85be7e03f7c0f0c20b476e1574fd..aaa95ca8b99d62b3dfb7b689e09d077b75aa90b5 100644 +--- a/src/main/java/org/bukkit/plugin/SimpleServicesManager.java ++++ b/src/main/java/org/bukkit/plugin/SimpleServicesManager.java +@@ -2,20 +2,14 @@ package org.bukkit.plugin; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableSet; +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.HashMap; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.NoSuchElementException; +-import java.util.Set; + import org.bukkit.Bukkit; + import org.bukkit.event.server.ServiceRegisterEvent; + import org.bukkit.event.server.ServiceUnregisterEvent; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.*; ++ + /** + * A simple services manager. + */ +diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +index 04fa3991f6ce4e9dad804f28fc6c947695857089..eb0ed9763a48e73fa0c36790660a79092687ff82 100644 +--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java ++++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +@@ -1,18 +1,6 @@ + package org.bukkit.plugin.java; + + import com.google.common.base.Charsets; +-import java.io.File; +-import java.io.FileOutputStream; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.InputStreamReader; +-import java.io.OutputStream; +-import java.io.Reader; +-import java.net.URL; +-import java.net.URLConnection; +-import java.util.List; +-import java.util.logging.Level; +-import java.util.logging.Logger; + import org.apache.commons.lang.Validate; + import org.bukkit.Server; + import org.bukkit.command.Command; +@@ -24,10 +12,16 @@ import org.bukkit.generator.ChunkGenerator; + import org.bukkit.plugin.PluginBase; + import org.bukkit.plugin.PluginDescriptionFile; + import org.bukkit.plugin.PluginLoader; +-import org.bukkit.plugin.PluginLogger; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.io.*; ++import java.net.URL; ++import java.net.URLConnection; ++import java.util.List; ++import java.util.logging.Level; ++import java.util.logging.Logger; ++ + /** + * Represents a Java plugin + */ +diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +index 384edf9890dfbd1cddfdcac4db1ebe9a4d761f78..adc3f55122feaa2b1af786d34ded7a2900d03438 100644 +--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java ++++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +@@ -1,23 +1,5 @@ + package org.bukkit.plugin.java; + +-import java.io.File; +-import java.io.FileNotFoundException; +-import java.io.IOException; +-import java.io.InputStream; +-import java.lang.reflect.InvocationTargetException; +-import java.lang.reflect.Method; +-import java.util.Arrays; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.concurrent.ConcurrentHashMap; +-import java.util.concurrent.CopyOnWriteArrayList; +-import java.util.jar.JarEntry; +-import java.util.jar.JarFile; +-import java.util.logging.Level; +-import java.util.regex.Pattern; + import org.apache.commons.lang.Validate; + import org.bukkit.Server; + import org.bukkit.Warning; +@@ -25,26 +7,28 @@ import org.bukkit.Warning.WarningState; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.configuration.serialization.ConfigurationSerialization; + import org.bukkit.event.Event; +-import org.bukkit.event.EventException; + import org.bukkit.event.EventHandler; + import org.bukkit.event.Listener; + import org.bukkit.event.server.PluginDisableEvent; + import org.bukkit.event.server.PluginEnableEvent; +-import org.bukkit.plugin.AuthorNagException; +-import org.bukkit.plugin.EventExecutor; +-import org.bukkit.plugin.InvalidDescriptionException; +-import org.bukkit.plugin.InvalidPluginException; +-import org.bukkit.plugin.Plugin; +-import org.bukkit.plugin.PluginDescriptionFile; +-import org.bukkit.plugin.PluginLoader; +-import org.bukkit.plugin.RegisteredListener; +-import org.bukkit.plugin.TimedRegisteredListener; +-import org.bukkit.plugin.UnknownDependencyException; ++import org.bukkit.plugin.*; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; +-import org.spigotmc.CustomTimingsHandler; // Spigot + import org.yaml.snakeyaml.error.YAMLException; + ++import java.io.File; ++import java.io.FileNotFoundException; ++import java.io.IOException; ++import java.io.InputStream; ++import java.lang.reflect.Method; ++import java.util.*; ++import java.util.concurrent.ConcurrentHashMap; ++import java.util.concurrent.CopyOnWriteArrayList; ++import java.util.jar.JarEntry; ++import java.util.jar.JarFile; ++import java.util.logging.Level; ++import java.util.regex.Pattern; ++ + /** + * Represents a Java plugin loader, allowing plugins in the form of .jar + */ +diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +index 62f7a6817da079513f471e36cd79739d36a36d86..571e68010c3e76dd7ea777fd55ad5ce36af96262 100644 +--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java ++++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +@@ -1,6 +1,13 @@ + package org.bukkit.plugin.java; + + import com.google.common.io.ByteStreams; ++import org.apache.commons.lang.Validate; ++import org.bukkit.plugin.InvalidPluginException; ++import org.bukkit.plugin.PluginDescriptionFile; ++import org.bukkit.plugin.SimplePluginManager; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ + import java.io.File; + import java.io.IOException; + import java.io.InputStream; +@@ -18,12 +25,6 @@ import java.util.jar.JarEntry; + import java.util.jar.JarFile; + import java.util.jar.Manifest; + import java.util.logging.Level; +-import org.apache.commons.lang.Validate; +-import org.bukkit.plugin.InvalidPluginException; +-import org.bukkit.plugin.PluginDescriptionFile; +-import org.bukkit.plugin.SimplePluginManager; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; + + /** + * A ClassLoader for plugins, to allow shared classes across multiple plugins +diff --git a/src/main/java/org/bukkit/plugin/messaging/Messenger.java b/src/main/java/org/bukkit/plugin/messaging/Messenger.java +index 682c77188436d696d4dafbc70cf131d5c921e94d..1493bc1bec3269e9521438f8d0840ef2c056e674 100644 +--- a/src/main/java/org/bukkit/plugin/messaging/Messenger.java ++++ b/src/main/java/org/bukkit/plugin/messaging/Messenger.java +@@ -1,11 +1,12 @@ + package org.bukkit.plugin.messaging; + +-import java.util.Set; + import org.bukkit.NamespacedKey; + import org.bukkit.entity.Player; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * A class responsible for managing the registrations of plugin channels and + * their listeners. +diff --git a/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java b/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java +index b84b37fe27d84574dc5897285f1d9a1437bd322c..0fec28682598d14ff7b0948b1a3733f6e23ae539 100644 +--- a/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java ++++ b/src/main/java/org/bukkit/plugin/messaging/PluginMessageRecipient.java +@@ -1,9 +1,10 @@ + package org.bukkit.plugin.messaging; + +-import java.util.Set; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + ++import java.util.Set; ++ + /** + * Represents a possible recipient for a Plugin Message. + */ +diff --git a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java +index 6fda7f3aa68e76af64362e9afed70fc6a5e92986..0635fb216d510a15b8e61c38a5108741ab342ecc 100644 +--- a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java ++++ b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java +@@ -2,16 +2,13 @@ package org.bukkit.plugin.messaging; + + import com.google.common.collect.ImmutableSet; + import com.google.common.collect.ImmutableSet.Builder; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Locale; +-import java.util.Map; +-import java.util.Set; +-import java.util.logging.Level; + import org.bukkit.entity.Player; + import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; + ++import java.util.*; ++import java.util.logging.Level; ++ + /** + * Standard implementation to {@link Messenger} + */ +diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java +index ac02ae4fc179483b4ac3d1adc41684a8426197eb..b1397a08d281ed8fb0b22e87520988e8f069ba45 100644 +--- a/src/main/java/org/bukkit/potion/Potion.java ++++ b/src/main/java/org/bukkit/potion/Potion.java +@@ -1,6 +1,5 @@ + package org.bukkit.potion; + +-import java.util.Collection; + import org.apache.commons.lang.Validate; + import org.bukkit.Material; + import org.bukkit.entity.LivingEntity; +@@ -8,6 +7,8 @@ import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.meta.PotionMeta; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++ + /** + * Potion Adapter for pre-1.9 data values + * see @PotionMeta for 1.9+ +diff --git a/src/main/java/org/bukkit/potion/PotionBrewer.java b/src/main/java/org/bukkit/potion/PotionBrewer.java +index d21f407cc16cfd709c1cabf408e8d8d16aba7e1a..254bd6f3e8d13932076421ad918702841d1cc839 100644 +--- a/src/main/java/org/bukkit/potion/PotionBrewer.java ++++ b/src/main/java/org/bukkit/potion/PotionBrewer.java +@@ -1,8 +1,9 @@ + package org.bukkit.potion; + +-import java.util.Collection; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++ + /** + * Represents a brewer that can create {@link PotionEffect}s. + */ +diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java +index 74767751199bce03d63f2a9524712656193f850c..76376bc21ce7f13cb09ef94afabb672731742b83 100644 +--- a/src/main/java/org/bukkit/potion/PotionEffect.java ++++ b/src/main/java/org/bukkit/potion/PotionEffect.java +@@ -1,8 +1,6 @@ + package org.bukkit.potion; + + import com.google.common.collect.ImmutableMap; +-import java.util.Map; +-import java.util.NoSuchElementException; + import org.apache.commons.lang.Validate; + import org.bukkit.Color; + import org.bukkit.configuration.serialization.ConfigurationSerializable; +@@ -12,6 +10,9 @@ import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++import java.util.NoSuchElementException; ++ + /** + * Represents a potion effect, that can be added to a {@link LivingEntity}. A + * potion effect has a duration that it will last for, an amplifier that will +diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java +index b5790aaac67f5b73f941147008d21a92d716b254..0e9e16ee08deb20da11dfe1d00bc69093a8ee04d 100644 +--- a/src/main/java/org/bukkit/potion/PotionEffectType.java ++++ b/src/main/java/org/bukkit/potion/PotionEffectType.java +@@ -1,13 +1,14 @@ + package org.bukkit.potion; + +-import java.util.Arrays; +-import java.util.HashMap; +-import java.util.Map; + import org.apache.commons.lang.Validate; + import org.bukkit.Color; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Arrays; ++import java.util.HashMap; ++import java.util.Map; ++ + /** + * Represents a type of potion and its effect on an entity. + */ +diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java +index ac140fc2c638e22e06b2920db3e376ab9e8c3733..91d757a1ce940cb244f496e69d11fe96de6e3284 100644 +--- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java ++++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java +@@ -1,11 +1,12 @@ + package org.bukkit.scheduler; + ++import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; ++ + import java.util.List; + import java.util.concurrent.Callable; + import java.util.concurrent.Future; + import java.util.function.Consumer; +-import org.bukkit.plugin.Plugin; +-import org.jetbrains.annotations.NotNull; + + public interface BukkitScheduler { + +diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java +index 4bfaaea78c9b6aa5d392629aa943d26dbe6a7d4a..3f1fcf3a1295b2cac0dbd2a42eaa0c69853e2095 100644 +--- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java ++++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java +@@ -1,10 +1,11 @@ + package org.bukkit.scoreboard; + +-import java.util.Set; + import org.bukkit.OfflinePlayer; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Set; ++ + /** + * A scoreboard + */ +diff --git a/src/main/java/org/bukkit/scoreboard/ScoreboardManager.java b/src/main/java/org/bukkit/scoreboard/ScoreboardManager.java +index 3c0740797a2ad3b165c8a69596d275dbc710feca..255977c2fb13fe6e67ae516e452beb2448c72f09 100644 +--- a/src/main/java/org/bukkit/scoreboard/ScoreboardManager.java ++++ b/src/main/java/org/bukkit/scoreboard/ScoreboardManager.java +@@ -1,8 +1,9 @@ + package org.bukkit.scoreboard; + +-import java.lang.ref.WeakReference; + import org.jetbrains.annotations.NotNull; + ++import java.lang.ref.WeakReference; ++ + /** + * Manager of Scoreboards + */ +diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java +index da01d2926cc8a2485a3349ac1ebb32cad20e287c..bea978aeb553566f25a94d7c3f718109d960af89 100644 +--- a/src/main/java/org/bukkit/scoreboard/Team.java ++++ b/src/main/java/org/bukkit/scoreboard/Team.java +@@ -1,12 +1,13 @@ + package org.bukkit.scoreboard; + +-import java.util.Set; + import org.bukkit.ChatColor; + import org.bukkit.OfflinePlayer; + import org.bukkit.potion.PotionEffectType; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Set; ++ + /** + * A team on a scoreboard that has a common display theme and other + * properties. This team is only relevant to the display of the associated +diff --git a/src/main/java/org/bukkit/util/BlockIterator.java b/src/main/java/org/bukkit/util/BlockIterator.java +index 8a377e1413a0034da8e8f03e25d1e3d6e2cf6f92..4df279970524faf2201098bffdb3b009883f2608 100644 +--- a/src/main/java/org/bukkit/util/BlockIterator.java ++++ b/src/main/java/org/bukkit/util/BlockIterator.java +@@ -1,8 +1,5 @@ + package org.bukkit.util; + +-import static org.bukkit.util.NumberConversions.*; +-import java.util.Iterator; +-import java.util.NoSuchElementException; + import org.bukkit.Location; + import org.bukkit.World; + import org.bukkit.block.Block; +@@ -10,6 +7,12 @@ import org.bukkit.block.BlockFace; + import org.bukkit.entity.LivingEntity; + import org.jetbrains.annotations.NotNull; + ++import java.util.Iterator; ++import java.util.NoSuchElementException; ++ ++import static org.bukkit.util.NumberConversions.floor; ++import static org.bukkit.util.NumberConversions.round; ++ + /** + * This class performs ray tracing and iterates along blocks on a line + */ +diff --git a/src/main/java/org/bukkit/util/BlockVector.java b/src/main/java/org/bukkit/util/BlockVector.java +index eddc7248903fe3672010c04c0684f9ae3e8559e4..eb3c87dad970ce6e161199419fde6a1fbfc53ad3 100644 +--- a/src/main/java/org/bukkit/util/BlockVector.java ++++ b/src/main/java/org/bukkit/util/BlockVector.java +@@ -1,9 +1,10 @@ + package org.bukkit.util; + +-import java.util.Map; + import org.bukkit.configuration.serialization.SerializableAs; + import org.jetbrains.annotations.NotNull; + ++import java.util.Map; ++ + /** + * A vector with a hash function that floors the X, Y, Z components, a la + * BlockVector in WorldEdit. BlockVectors can be used in hash sets and +diff --git a/src/main/java/org/bukkit/util/BoundingBox.java b/src/main/java/org/bukkit/util/BoundingBox.java +index 01f80020b12c7b4637e5c22f7277a0268fe40cd2..be64e9e6f54e6497c9b6fd5397bc1962be7f3f3d 100644 +--- a/src/main/java/org/bukkit/util/BoundingBox.java ++++ b/src/main/java/org/bukkit/util/BoundingBox.java +@@ -1,8 +1,5 @@ + package org.bukkit.util; + +-import java.util.LinkedHashMap; +-import java.util.Map; +-import java.util.Objects; + import org.apache.commons.lang.Validate; + import org.bukkit.Location; + import org.bukkit.block.Block; +@@ -12,6 +9,10 @@ import org.bukkit.configuration.serialization.SerializableAs; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.LinkedHashMap; ++import java.util.Map; ++import java.util.Objects; ++ + /** + * A mutable axis aligned bounding box (AABB). + *

+diff --git a/src/main/java/org/bukkit/util/ChatPaginator.java b/src/main/java/org/bukkit/util/ChatPaginator.java +index 1f510211813836c7a891b14fb8262b75d1d1fce7..04358f17e9b2d28c3f6ddfd6a664110ae74755bf 100644 +--- a/src/main/java/org/bukkit/util/ChatPaginator.java ++++ b/src/main/java/org/bukkit/util/ChatPaginator.java +@@ -1,12 +1,13 @@ + package org.bukkit.util; + +-import java.util.Arrays; +-import java.util.LinkedList; +-import java.util.List; + import org.bukkit.ChatColor; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Arrays; ++import java.util.LinkedList; ++import java.util.List; ++ + /** + * The ChatPaginator takes a raw string of arbitrary length and breaks it down + * into an array of strings appropriate for displaying on the Minecraft player +diff --git a/src/main/java/org/bukkit/util/FileUtil.java b/src/main/java/org/bukkit/util/FileUtil.java +index 6e2352a3084daf05c16cc5ca86b4fa9e8b1c1e4d..3ea60d7f544a4d741f68189faa8614c56dd18ddd 100644 +--- a/src/main/java/org/bukkit/util/FileUtil.java ++++ b/src/main/java/org/bukkit/util/FileUtil.java +@@ -1,11 +1,12 @@ + package org.bukkit.util; + ++import org.jetbrains.annotations.NotNull; ++ + import java.io.File; + import java.io.FileInputStream; + import java.io.FileOutputStream; + import java.io.IOException; + import java.nio.channels.FileChannel; +-import org.jetbrains.annotations.NotNull; + + /** + * Class containing file utilities +diff --git a/src/main/java/org/bukkit/util/RayTraceResult.java b/src/main/java/org/bukkit/util/RayTraceResult.java +index 19c52a2a62068f5f4af4184e24defa0f7c1005a7..29869f846337a6833b033b7d2ccd4ff368c334e9 100644 +--- a/src/main/java/org/bukkit/util/RayTraceResult.java ++++ b/src/main/java/org/bukkit/util/RayTraceResult.java +@@ -1,6 +1,5 @@ + package org.bukkit.util; + +-import java.util.Objects; + import org.apache.commons.lang.Validate; + import org.bukkit.block.Block; + import org.bukkit.block.BlockFace; +@@ -8,6 +7,8 @@ import org.bukkit.entity.Entity; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Objects; ++ + /** + * The hit result of a ray trace. + *

+diff --git a/src/main/java/org/bukkit/util/StringUtil.java b/src/main/java/org/bukkit/util/StringUtil.java +index 458d5ebdf6c42d695985202dd6d7df626fcc5972..ff80e69f202941015c6b2bed93e54c2fbc7f8178 100644 +--- a/src/main/java/org/bukkit/util/StringUtil.java ++++ b/src/main/java/org/bukkit/util/StringUtil.java +@@ -1,9 +1,10 @@ + package org.bukkit.util; + +-import java.util.Collection; + import org.apache.commons.lang.Validate; + import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++ + public class StringUtil { + + /** +diff --git a/src/main/java/org/bukkit/util/Vector.java b/src/main/java/org/bukkit/util/Vector.java +index bdfb9623b74ea73a3d343b20fc1369cc797880c5..e77873a189b5228614807ddaadd04ee1f7a5b626 100644 +--- a/src/main/java/org/bukkit/util/Vector.java ++++ b/src/main/java/org/bukkit/util/Vector.java +@@ -2,15 +2,16 @@ package org.bukkit.util; + + import com.google.common.base.Preconditions; + import com.google.common.primitives.Doubles; +-import java.util.LinkedHashMap; +-import java.util.Map; +-import java.util.Random; + import org.bukkit.Location; + import org.bukkit.World; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.configuration.serialization.SerializableAs; + import org.jetbrains.annotations.NotNull; + ++import java.util.LinkedHashMap; ++import java.util.Map; ++import java.util.Random; ++ + /** + * Represents a mutable vector. Because the components of Vectors are mutable, + * storing Vectors long term may be dangerous if passing code modifies the +diff --git a/src/main/java/org/bukkit/util/io/BukkitObjectInputStream.java b/src/main/java/org/bukkit/util/io/BukkitObjectInputStream.java +index 0f8eb97bd5e2f8b0f0cc03f7c4342aae06c4520c..e5d45a99bc999a8ce9e493364a40358d666c09eb 100644 +--- a/src/main/java/org/bukkit/util/io/BukkitObjectInputStream.java ++++ b/src/main/java/org/bukkit/util/io/BukkitObjectInputStream.java +@@ -1,10 +1,11 @@ + package org.bukkit.util.io; + ++import org.bukkit.configuration.serialization.ConfigurationSerializable; ++import org.bukkit.configuration.serialization.ConfigurationSerialization; ++ + import java.io.IOException; + import java.io.InputStream; + import java.io.ObjectInputStream; +-import org.bukkit.configuration.serialization.ConfigurationSerializable; +-import org.bukkit.configuration.serialization.ConfigurationSerialization; + + /** + * This class is designed to be used in conjunction with the {@link +diff --git a/src/main/java/org/bukkit/util/io/BukkitObjectOutputStream.java b/src/main/java/org/bukkit/util/io/BukkitObjectOutputStream.java +index dd1b9ee5f57773f07924aa311823fd8d63195cb2..4527d83b7a857e2a4e306eb911eb0d1e1f1ce4fb 100644 +--- a/src/main/java/org/bukkit/util/io/BukkitObjectOutputStream.java ++++ b/src/main/java/org/bukkit/util/io/BukkitObjectOutputStream.java +@@ -1,10 +1,11 @@ + package org.bukkit.util.io; + ++import org.bukkit.configuration.serialization.ConfigurationSerializable; ++ + import java.io.IOException; + import java.io.ObjectOutputStream; + import java.io.OutputStream; + import java.io.Serializable; +-import org.bukkit.configuration.serialization.ConfigurationSerializable; + + /** + * This class is designed to be used in conjunction with the {@link +diff --git a/src/main/java/org/bukkit/util/io/Wrapper.java b/src/main/java/org/bukkit/util/io/Wrapper.java +index c3496dc8ba124cfdd23f0fe14d17f8f7cea7c955..a6a39398a21ee65b2e1f688b2c43ef5d27c5cd8f 100644 +--- a/src/main/java/org/bukkit/util/io/Wrapper.java ++++ b/src/main/java/org/bukkit/util/io/Wrapper.java +@@ -1,12 +1,13 @@ + package org.bukkit.util.io; + + import com.google.common.collect.ImmutableMap; +-import java.io.Serializable; +-import java.util.Map; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.configuration.serialization.ConfigurationSerialization; + import org.jetbrains.annotations.NotNull; + ++import java.io.Serializable; ++import java.util.Map; ++ + final class Wrapper & Serializable> implements Serializable { + private static final long serialVersionUID = -986209235411767547L; + +diff --git a/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java b/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java +index 520b65f9e6774f2fb8307311e5144128353cf777..971a806792c4ec356ebbd1248bb099c785e2d504 100644 +--- a/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java ++++ b/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java +@@ -1,9 +1,10 @@ + package org.bukkit.util.noise; + +-import java.util.Random; + import org.bukkit.World; + import org.jetbrains.annotations.NotNull; + ++import java.util.Random; ++ + /** + * Generates noise using the "classic" perlin generator + * +diff --git a/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java b/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java +index af7e01188ee767858ba760089b2aceab0bc9626a..6114a1aca8d9ccbd43820a4799a8cbfb513aae82 100644 +--- a/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java ++++ b/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java +@@ -1,9 +1,10 @@ + package org.bukkit.util.noise; + +-import java.util.Random; + import org.bukkit.World; + import org.jetbrains.annotations.NotNull; + ++import java.util.Random; ++ + /** + * Creates perlin noise through unbiased octaves + */ +diff --git a/src/main/java/org/bukkit/util/noise/SimplexNoiseGenerator.java b/src/main/java/org/bukkit/util/noise/SimplexNoiseGenerator.java +index 775d8f40322e9ed6702eb23bf50f35442d673c30..51c24a6cca9d4164ff3d3cabc45b73dc7104275d 100644 +--- a/src/main/java/org/bukkit/util/noise/SimplexNoiseGenerator.java ++++ b/src/main/java/org/bukkit/util/noise/SimplexNoiseGenerator.java +@@ -1,10 +1,11 @@ + // CHECKSTYLE:OFF + package org.bukkit.util.noise; + +-import java.util.Random; + import org.bukkit.World; + import org.jetbrains.annotations.NotNull; + ++import java.util.Random; ++ + /** + * Generates simplex-based noise. + *

+diff --git a/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java b/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java +index 6cc15431e1b288df1830adac936a7648c6834b3e..d1f8a764520586ad0f20d1a812ec8b6d68e56faf 100644 +--- a/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java ++++ b/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java +@@ -1,9 +1,10 @@ + package org.bukkit.util.noise; + +-import java.util.Random; + import org.bukkit.World; + import org.jetbrains.annotations.NotNull; + ++import java.util.Random; ++ + /** + * Creates simplex noise through unbiased octaves + */ +diff --git a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java +index 8e481e3815f5645ee92f0d229e5ff25c8fc9a6c2..268deda1fe314474f8d3e9a53163cfb5675a17a8 100644 +--- a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java ++++ b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java +@@ -1,12 +1,13 @@ + package org.bukkit.util.permissions; + +-import java.util.Map; + import org.bukkit.Bukkit; + import org.bukkit.permissions.Permission; + import org.bukkit.permissions.PermissionDefault; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + ++import java.util.Map; ++ + public final class DefaultPermissions { + private static final String ROOT = "craftbukkit"; + private static final String LEGACY_PREFIX = "craft"; +diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java +index 3cbe5c2bb55dead7968a6f165ef267e3e2931061..8c58a8ce9f9cfc8f94ca315962a9a09cab95b9d4 100644 +--- a/src/main/java/org/spigotmc/CustomTimingsHandler.java ++++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java +@@ -23,18 +23,13 @@ + */ + package org.spigotmc; + +-import java.io.PrintStream; +-import java.util.Queue; +-import java.util.concurrent.ConcurrentLinkedQueue; +-import org.bukkit.Bukkit; +-import org.bukkit.World; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; +-import org.bukkit.plugin.AuthorNagException; +-import org.bukkit.plugin.Plugin; + import co.aikar.timings.Timing; + import co.aikar.timings.Timings; + import co.aikar.timings.TimingsManager; ++import org.bukkit.Bukkit; ++import org.bukkit.plugin.AuthorNagException; ++import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; + + import java.lang.reflect.InvocationTargetException; + import java.lang.reflect.Method; +diff --git a/src/test/java/org/bukkit/ArtTest.java b/src/test/java/org/bukkit/ArtTest.java +index 2e9249a6d48edfe2339cbb4c8cc799cf551381fd..5db12e167056627dda88c6a1599040b0d11b1191 100644 +--- a/src/test/java/org/bukkit/ArtTest.java ++++ b/src/test/java/org/bukkit/ArtTest.java +@@ -1,9 +1,11 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.Matchers.greaterThan; ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + public class ArtTest { + + @Test(expected = IllegalArgumentException.class) +diff --git a/src/test/java/org/bukkit/BukkitMirrorTest.java b/src/test/java/org/bukkit/BukkitMirrorTest.java +index 2dfada66067d79b84cd490eadbe0178e8cd8c260..383fb750ade53ff959a38125981e5d48f0304e96 100644 +--- a/src/test/java/org/bukkit/BukkitMirrorTest.java ++++ b/src/test/java/org/bukkit/BukkitMirrorTest.java +@@ -1,13 +1,7 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.base.Function; + import com.google.common.collect.Lists; +-import java.lang.reflect.Method; +-import java.lang.reflect.Modifier; +-import java.util.Arrays; +-import java.util.List; + import org.junit.Before; + import org.junit.Test; + import org.junit.runner.RunWith; +@@ -15,6 +9,14 @@ import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + ++import java.lang.reflect.Method; ++import java.lang.reflect.Modifier; ++import java.util.Arrays; ++import java.util.List; ++ ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + @RunWith(Parameterized.class) + public class BukkitMirrorTest { + +diff --git a/src/test/java/org/bukkit/ChatColorTest.java b/src/test/java/org/bukkit/ChatColorTest.java +index 2a8c8c729850c65dcc5f681267ee7e543b927d7e..a39d52e724879a97ca09ebe215897f3ece302552 100644 +--- a/src/test/java/org/bukkit/ChatColorTest.java ++++ b/src/test/java/org/bukkit/ChatColorTest.java +@@ -1,9 +1,11 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.hamcrest.CoreMatchers.nullValue; ++import static org.junit.Assert.assertThat; ++ + public class ChatColorTest { + + @Test +diff --git a/src/test/java/org/bukkit/ChatPaginatorTest.java b/src/test/java/org/bukkit/ChatPaginatorTest.java +index d38e64f0995bb4fb142c4a3317d6e3bca2b3bb75..f74a9326d6545e34786f278609707a8568462be0 100644 +--- a/src/test/java/org/bukkit/ChatPaginatorTest.java ++++ b/src/test/java/org/bukkit/ChatPaginatorTest.java +@@ -1,10 +1,11 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.bukkit.util.ChatPaginator; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class ChatPaginatorTest { + @Test + public void testWordWrap1() { +diff --git a/src/test/java/org/bukkit/CoalTypeTest.java b/src/test/java/org/bukkit/CoalTypeTest.java +index b90f10c4ef89a4c155e6f9a6a3b674d149ac7296..5d29b36f2ecdd1e7e9b0dd65e66806ec91c1d4e3 100644 +--- a/src/test/java/org/bukkit/CoalTypeTest.java ++++ b/src/test/java/org/bukkit/CoalTypeTest.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class CoalTypeTest { + @Test + public void getByData() { +diff --git a/src/test/java/org/bukkit/ColorTest.java b/src/test/java/org/bukkit/ColorTest.java +index 70183fdb7f06e6ec3a64d93737f26bcbeb485e84..dfbc9c8d194f556b4ab9a8fd4cf154242a195f72 100644 +--- a/src/test/java/org/bukkit/ColorTest.java ++++ b/src/test/java/org/bukkit/ColorTest.java +@@ -1,10 +1,11 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import org.bukkit.configuration.file.YamlConfiguration; + import org.junit.Test; + ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.assertThat; ++ + @SuppressWarnings("javadoc") + public class ColorTest { + static class TestColor { +diff --git a/src/test/java/org/bukkit/CropStateTest.java b/src/test/java/org/bukkit/CropStateTest.java +index 5cd9d6d2d768f72034cac722e11f8835be426b5e..e348647097dc6686044d9c8299955731ee69564c 100644 +--- a/src/test/java/org/bukkit/CropStateTest.java ++++ b/src/test/java/org/bukkit/CropStateTest.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class CropStateTest { + @Test + public void getByData() { +diff --git a/src/test/java/org/bukkit/DifficultyTest.java b/src/test/java/org/bukkit/DifficultyTest.java +index d7fe8d39a466a41c92cd928dd78e9d7a4281f825..fb90006ad3b41df0debbaf8e9e381e020115a578 100644 +--- a/src/test/java/org/bukkit/DifficultyTest.java ++++ b/src/test/java/org/bukkit/DifficultyTest.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class DifficultyTest { + @Test + public void getByValue() { +diff --git a/src/test/java/org/bukkit/DyeColorTest.java b/src/test/java/org/bukkit/DyeColorTest.java +index e56d9439a2c4aa029263d68cb435bec63ce87574..9e2e2f1a5861fc6d8bad1d5ede248725dcd553ed 100644 +--- a/src/test/java/org/bukkit/DyeColorTest.java ++++ b/src/test/java/org/bukkit/DyeColorTest.java +@@ -1,9 +1,5 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; +-import java.util.ArrayList; +-import java.util.List; + import org.bukkit.material.Colorable; + import org.bukkit.material.Dye; + import org.bukkit.material.Wool; +@@ -13,6 +9,12 @@ import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.ArrayList; ++import java.util.List; ++ ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + @RunWith(Parameterized.class) + public class DyeColorTest { + +diff --git a/src/test/java/org/bukkit/EffectTest.java b/src/test/java/org/bukkit/EffectTest.java +index 54e621e86e8fe3414099494d419929b282b33489..8ee419916fcb4f00da484e34bcfb4f7db6202363 100644 +--- a/src/test/java/org/bukkit/EffectTest.java ++++ b/src/test/java/org/bukkit/EffectTest.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class EffectTest { + @Test + public void getById() { +diff --git a/src/test/java/org/bukkit/GameModeTest.java b/src/test/java/org/bukkit/GameModeTest.java +index 1c53e8ed8ba2a7fe9a51771b80bd6d0cb358adda..14d1789ff8d5abbd0948c348b5bf9ed409c0eeec 100644 +--- a/src/test/java/org/bukkit/GameModeTest.java ++++ b/src/test/java/org/bukkit/GameModeTest.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class GameModeTest { + @Test + public void getByValue() { +diff --git a/src/test/java/org/bukkit/GrassSpeciesTest.java b/src/test/java/org/bukkit/GrassSpeciesTest.java +index 39f1b899ea9c5389b42dda058949fcae1e2bbe84..b14074b3de7a5ba6feb84311f2673033b51ebc48 100644 +--- a/src/test/java/org/bukkit/GrassSpeciesTest.java ++++ b/src/test/java/org/bukkit/GrassSpeciesTest.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class GrassSpeciesTest { + @Test + public void getByData() { +diff --git a/src/test/java/org/bukkit/InstrumentTest.java b/src/test/java/org/bukkit/InstrumentTest.java +index f6d261ae50aa264d4ad35b8e465aba778dcabda4..7131d538c854c21586f4ba472ea0227b928f40fc 100644 +--- a/src/test/java/org/bukkit/InstrumentTest.java ++++ b/src/test/java/org/bukkit/InstrumentTest.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class InstrumentTest { + @Test + public void getByType() { +diff --git a/src/test/java/org/bukkit/LocationTest.java b/src/test/java/org/bukkit/LocationTest.java +index 887305c05c3e53079347502c187984ca3e42a1f8..a5b56467755d87c270a7f84fc2326e7a92343bc1 100644 +--- a/src/test/java/org/bukkit/LocationTest.java ++++ b/src/test/java/org/bukkit/LocationTest.java +@@ -1,10 +1,6 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.ImmutableList; +-import java.util.List; +-import java.util.Random; + import org.bukkit.util.Vector; + import org.junit.Test; + import org.junit.runner.RunWith; +@@ -12,6 +8,13 @@ import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.List; ++import java.util.Random; ++ ++import static org.hamcrest.Matchers.closeTo; ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + @RunWith(Parameterized.class) + public class LocationTest { + private static final double delta = 1.0 / 1000000; +diff --git a/src/test/java/org/bukkit/MaterialTest.java b/src/test/java/org/bukkit/MaterialTest.java +index 6b0eaaadf9772a4850cb70cea2bfe72a81a47a04..fbf4fc6d53c3f30cecb725de10cc4cfd69e6c849 100644 +--- a/src/test/java/org/bukkit/MaterialTest.java ++++ b/src/test/java/org/bukkit/MaterialTest.java +@@ -1,10 +1,12 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import org.bukkit.material.MaterialData; + import org.junit.Test; + ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.assertNull; ++import static org.junit.Assert.assertThat; ++ + public class MaterialTest { + @Test + public void getByName() { +diff --git a/src/test/java/org/bukkit/NoteTest.java b/src/test/java/org/bukkit/NoteTest.java +index 0db4bfa43ae7d941c4be35ff89bdc6ce8471602b..c8e5cca912e1e6393cc00c1eb7334385c4e0ddf1 100644 +--- a/src/test/java/org/bukkit/NoteTest.java ++++ b/src/test/java/org/bukkit/NoteTest.java +@@ -1,11 +1,14 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.Lists; +-import java.util.Collection; + import org.junit.Test; + ++import java.util.Collection; ++ ++import static org.hamcrest.CoreMatchers.is; ++import static org.hamcrest.CoreMatchers.nullValue; ++import static org.junit.Assert.*; ++ + public class NoteTest { + @Test + public void getToneByData() { +diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java +index 5f9d348241210689eaf41a39ace5948e7a237b12..d33d974923ef176bd8246ca8a11e80ae5846b8e1 100644 +--- a/src/test/java/org/bukkit/TestServer.java ++++ b/src/test/java/org/bukkit/TestServer.java +@@ -1,14 +1,15 @@ + package org.bukkit; + + import com.google.common.collect.ImmutableMap; ++import org.bukkit.command.SimpleCommandMap; ++import org.bukkit.plugin.PluginManager; ++import org.bukkit.plugin.SimplePluginManager; ++ + import java.lang.reflect.InvocationHandler; + import java.lang.reflect.Method; + import java.lang.reflect.Proxy; + import java.util.Map; + import java.util.logging.Logger; +-import org.bukkit.command.SimpleCommandMap; +-import org.bukkit.plugin.PluginManager; +-import org.bukkit.plugin.SimplePluginManager; + + public final class TestServer implements InvocationHandler { + private static interface MethodHandler { +diff --git a/src/test/java/org/bukkit/TestWorld.java b/src/test/java/org/bukkit/TestWorld.java +index beb15c7c813d8d9b6ff6f88a2826c06533ccd725..50d35e37a632ea3c377680ececdfd1317e017f67 100644 +--- a/src/test/java/org/bukkit/TestWorld.java ++++ b/src/test/java/org/bukkit/TestWorld.java +@@ -1,6 +1,7 @@ + package org.bukkit; + + import com.google.common.collect.ImmutableMap; ++ + import java.lang.reflect.InvocationHandler; + import java.lang.reflect.Method; + import java.lang.reflect.Proxy; +diff --git a/src/test/java/org/bukkit/TreeSpeciesTest.java b/src/test/java/org/bukkit/TreeSpeciesTest.java +index 51e956cc5ea6f856664c0b85daaf6070073d1ec8..3ec69a706bd489131c30c11fa921fb11aa6c2cc0 100644 +--- a/src/test/java/org/bukkit/TreeSpeciesTest.java ++++ b/src/test/java/org/bukkit/TreeSpeciesTest.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class TreeSpeciesTest { + @Test + public void getByData() { +diff --git a/src/test/java/org/bukkit/WorldTypeTest.java b/src/test/java/org/bukkit/WorldTypeTest.java +index 3c5f7b8a7062629b3c1ebab365986e42f5284ba5..d22c5ed2ac27be6bc159c793e201c805f7f6b3be 100644 +--- a/src/test/java/org/bukkit/WorldTypeTest.java ++++ b/src/test/java/org/bukkit/WorldTypeTest.java +@@ -1,9 +1,10 @@ + package org.bukkit; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class WorldTypeTest { + @Test + public void getByName() { +diff --git a/src/test/java/org/bukkit/configuration/ConfigurationSectionTest.java b/src/test/java/org/bukkit/configuration/ConfigurationSectionTest.java +index 4356b907116e3eec848135b3d8a9ba939ecea1ff..158ed98ea76579d4efb15c7a502961b96bbcc7d9 100644 +--- a/src/test/java/org/bukkit/configuration/ConfigurationSectionTest.java ++++ b/src/test/java/org/bukkit/configuration/ConfigurationSectionTest.java +@@ -1,16 +1,14 @@ + package org.bukkit.configuration; + +-import static org.junit.Assert.*; +-import java.util.Arrays; +-import java.util.HashMap; +-import java.util.LinkedHashMap; +-import java.util.List; +-import java.util.Map; + import org.bukkit.Material; + import org.bukkit.inventory.ItemStack; + import org.bukkit.util.Vector; + import org.junit.Test; + ++import java.util.*; ++ ++import static org.junit.Assert.*; ++ + public abstract class ConfigurationSectionTest { + public abstract ConfigurationSection getConfigurationSection(); + +diff --git a/src/test/java/org/bukkit/configuration/ConfigurationTest.java b/src/test/java/org/bukkit/configuration/ConfigurationTest.java +index 94eb854e94d005b2429183a9dced69e85053bf28..e98fd66ef85dd057fafee8d4978cd2a62bd5cbd3 100644 +--- a/src/test/java/org/bukkit/configuration/ConfigurationTest.java ++++ b/src/test/java/org/bukkit/configuration/ConfigurationTest.java +@@ -1,15 +1,12 @@ + package org.bukkit.configuration; + +-import static org.junit.Assert.*; +-import java.util.Arrays; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.LinkedHashMap; +-import java.util.Map; +-import java.util.Set; + import org.bukkit.util.Vector; + import org.junit.Test; + ++import java.util.*; ++ ++import static org.junit.Assert.*; ++ + public abstract class ConfigurationTest { + public abstract Configuration getConfig(); + +diff --git a/src/test/java/org/bukkit/configuration/file/FileConfigurationTest.java b/src/test/java/org/bukkit/configuration/file/FileConfigurationTest.java +index a996753b9385f06049fb8ab2786db5fd681f88f0..03c4f3096986e659d045ea66c4c8a818347926c5 100644 +--- a/src/test/java/org/bukkit/configuration/file/FileConfigurationTest.java ++++ b/src/test/java/org/bukkit/configuration/file/FileConfigurationTest.java +@@ -1,15 +1,17 @@ + package org.bukkit.configuration.file; + +-import static org.junit.Assert.*; +-import java.io.BufferedWriter; +-import java.io.File; +-import java.io.FileWriter; +-import java.util.Map; + import org.bukkit.configuration.MemoryConfigurationTest; + import org.junit.Rule; + import org.junit.Test; + import org.junit.rules.TemporaryFolder; + ++import java.io.BufferedWriter; ++import java.io.File; ++import java.io.FileWriter; ++import java.util.Map; ++ ++import static org.junit.Assert.*; ++ + public abstract class FileConfigurationTest extends MemoryConfigurationTest { + @Rule + public TemporaryFolder testFolder = new TemporaryFolder(); +diff --git a/src/test/java/org/bukkit/configuration/file/YamlConfigurationTest.java b/src/test/java/org/bukkit/configuration/file/YamlConfigurationTest.java +index 06ac381b5cf7284cac71e0f8148bf2fe1841428b..1a7601cf2a5efb626c20c4a54a8e9b838df5d4a6 100644 +--- a/src/test/java/org/bukkit/configuration/file/YamlConfigurationTest.java ++++ b/src/test/java/org/bukkit/configuration/file/YamlConfigurationTest.java +@@ -1,8 +1,9 @@ + package org.bukkit.configuration.file; + +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.junit.Assert.assertEquals; ++ + public class YamlConfigurationTest extends FileConfigurationTest { + + @Override +diff --git a/src/test/java/org/bukkit/conversations/ConversationContextTest.java b/src/test/java/org/bukkit/conversations/ConversationContextTest.java +index 3780a47c1f48d47b39a0e8a36c64044b366f8cc0..6920a1464e8bef1cde045389e1845ba23782286b 100644 +--- a/src/test/java/org/bukkit/conversations/ConversationContextTest.java ++++ b/src/test/java/org/bukkit/conversations/ConversationContextTest.java +@@ -1,9 +1,11 @@ + package org.bukkit.conversations; + +-import static org.junit.Assert.*; ++import org.junit.Test; ++ + import java.util.HashMap; + import java.util.Map; +-import org.junit.Test; ++ ++import static org.junit.Assert.assertEquals; + + /** + */ +diff --git a/src/test/java/org/bukkit/conversations/ConversationTest.java b/src/test/java/org/bukkit/conversations/ConversationTest.java +index c448dc724d65f4b6a4cf52a6213f712b4c06d82e..00a73cd55a166207665384f7915c448f78feaabc 100644 +--- a/src/test/java/org/bukkit/conversations/ConversationTest.java ++++ b/src/test/java/org/bukkit/conversations/ConversationTest.java +@@ -1,9 +1,10 @@ + package org.bukkit.conversations; + +-import static org.junit.Assert.*; + import org.bukkit.plugin.TestPlugin; + import org.junit.Test; + ++import static org.junit.Assert.*; ++ + /** + */ + public class ConversationTest { +diff --git a/src/test/java/org/bukkit/conversations/FakeConversable.java b/src/test/java/org/bukkit/conversations/FakeConversable.java +index 1e6b48c7724254571189cdfa367d741796630942..53c55051717e23bb985bddc6fc4df9c3e7cbf730 100644 +--- a/src/test/java/org/bukkit/conversations/FakeConversable.java ++++ b/src/test/java/org/bukkit/conversations/FakeConversable.java +@@ -1,12 +1,13 @@ + package org.bukkit.conversations; + +-import java.util.Set; + import org.bukkit.Server; + import org.bukkit.permissions.Permission; + import org.bukkit.permissions.PermissionAttachment; + import org.bukkit.permissions.PermissionAttachmentInfo; + import org.bukkit.plugin.Plugin; + ++import java.util.Set; ++ + /** + */ + public class FakeConversable implements Conversable { +diff --git a/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java b/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java +index 6093e9865b004c8fa4aed0bd0c291a4c77ca8b84..d2ab96681a5e704fe721ee6fde3acb931218e134 100644 +--- a/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java ++++ b/src/test/java/org/bukkit/conversations/ValidatingPromptTest.java +@@ -1,8 +1,9 @@ + package org.bukkit.conversations; + +-import static org.junit.Assert.*; + import org.junit.Test; + ++import static org.junit.Assert.*; ++ + /** + */ + public class ValidatingPromptTest { +diff --git a/src/test/java/org/bukkit/entity/memory/MemoryKeyTest.java b/src/test/java/org/bukkit/entity/memory/MemoryKeyTest.java +index b955f6a7adc65a5d1557df3d15fdeb1916ad3cad..4ce86dc9c8f37ba46e7be966d754592f07448cdf 100644 +--- a/src/test/java/org/bukkit/entity/memory/MemoryKeyTest.java ++++ b/src/test/java/org/bukkit/entity/memory/MemoryKeyTest.java +@@ -1,11 +1,12 @@ + package org.bukkit.entity.memory; + +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.NamespacedKey; + import org.junit.Assert; + import org.junit.Test; + ++import java.util.Arrays; ++import java.util.List; ++ + public class MemoryKeyTest { + + @Test +diff --git a/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java b/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java +index dd5fb243b7af23115908a534bec13e8f455f64b2..66008139243be58101354e2194f6d876de97213f 100644 +--- a/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java ++++ b/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java +@@ -1,12 +1,13 @@ + package org.bukkit.event; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.ImmutableList; + import org.bukkit.event.player.PlayerChatTabCompleteEvent; + import org.bukkit.plugin.messaging.TestPlayer; + import org.junit.Test; + ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.assertThat; ++ + public class PlayerChatTabCompleteEventTest { + + @Test +diff --git a/src/test/java/org/bukkit/materials/MaterialDataTest.java b/src/test/java/org/bukkit/materials/MaterialDataTest.java +index a935ae4a25b7955416652bf8c4690a804f12e903..496dee3ef9c0932b17c1a222bdfde3c85a7d8a91 100644 +--- a/src/test/java/org/bukkit/materials/MaterialDataTest.java ++++ b/src/test/java/org/bukkit/materials/MaterialDataTest.java +@@ -1,27 +1,17 @@ + package org.bukkit.materials; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import org.bukkit.CropState; + import org.bukkit.Material; + import org.bukkit.NetherWartsState; + import org.bukkit.TreeSpecies; + import org.bukkit.block.BlockFace; +-import org.bukkit.material.Comparator; +-import org.bukkit.material.Crops; +-import org.bukkit.material.Diode; +-import org.bukkit.material.Door; +-import org.bukkit.material.Hopper; +-import org.bukkit.material.Leaves; +-import org.bukkit.material.Mushroom; +-import org.bukkit.material.NetherWarts; +-import org.bukkit.material.Sapling; +-import org.bukkit.material.Tree; +-import org.bukkit.material.Wood; +-import org.bukkit.material.WoodenStep; ++import org.bukkit.material.*; + import org.bukkit.material.types.MushroomBlockTexture; + import org.junit.Test; + ++import static org.hamcrest.Matchers.equalTo; ++import static org.junit.Assert.assertThat; ++ + public class MaterialDataTest { + + @Test +diff --git a/src/test/java/org/bukkit/metadata/FixedMetadataValueTest.java b/src/test/java/org/bukkit/metadata/FixedMetadataValueTest.java +index e8cea99fd0eb966e60b0a8e1ebceca6dce6ff50a..bd93263180a57e64ede728cc8de74b0046879a53 100644 +--- a/src/test/java/org/bukkit/metadata/FixedMetadataValueTest.java ++++ b/src/test/java/org/bukkit/metadata/FixedMetadataValueTest.java +@@ -1,10 +1,12 @@ + package org.bukkit.metadata; + +-import static org.junit.Assert.*; + import org.bukkit.plugin.Plugin; + import org.bukkit.plugin.TestPlugin; + import org.junit.Test; + ++import static org.junit.Assert.assertEquals; ++import static org.junit.Assert.assertSame; ++ + public class FixedMetadataValueTest { + private Plugin plugin = new TestPlugin("X"); + private FixedMetadataValue subject; +diff --git a/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java b/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java +index bc8a18eea6c0c61ad07bdc44b2a7c38f84117da6..113369efb6157fec390f81228f893d80eba05031 100644 +--- a/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java ++++ b/src/test/java/org/bukkit/metadata/LazyMetadataValueTest.java +@@ -1,10 +1,12 @@ + package org.bukkit.metadata; + +-import static org.junit.Assert.*; +-import java.util.concurrent.Callable; + import org.bukkit.plugin.TestPlugin; + import org.junit.Test; + ++import java.util.concurrent.Callable; ++ ++import static org.junit.Assert.assertEquals; ++ + public class LazyMetadataValueTest { + private LazyMetadataValue subject; + private TestPlugin plugin = new TestPlugin("x"); +diff --git a/src/test/java/org/bukkit/metadata/MetadataConversionTest.java b/src/test/java/org/bukkit/metadata/MetadataConversionTest.java +index a9c10a2fd9fb37f2f7223fed138b2e2bfdaaef12..a595cc8d674edf74982b7361b9d1a989e673511c 100644 +--- a/src/test/java/org/bukkit/metadata/MetadataConversionTest.java ++++ b/src/test/java/org/bukkit/metadata/MetadataConversionTest.java +@@ -15,11 +15,12 @@ + + package org.bukkit.metadata; + +-import static org.junit.Assert.*; + import org.bukkit.plugin.Plugin; + import org.bukkit.plugin.TestPlugin; + import org.junit.Test; + ++import static org.junit.Assert.assertEquals; ++ + /** + */ + public class MetadataConversionTest { +diff --git a/src/test/java/org/bukkit/metadata/MetadataStoreTest.java b/src/test/java/org/bukkit/metadata/MetadataStoreTest.java +index 12373ff16ca71bc437929ea5c4486c2c6bd93d09..3a721ab124218407b7032da554f75e7b62ff09b2 100644 +--- a/src/test/java/org/bukkit/metadata/MetadataStoreTest.java ++++ b/src/test/java/org/bukkit/metadata/MetadataStoreTest.java +@@ -1,12 +1,14 @@ + package org.bukkit.metadata; + +-import static org.junit.Assert.*; +-import java.util.List; +-import java.util.concurrent.Callable; + import org.bukkit.plugin.Plugin; + import org.bukkit.plugin.TestPlugin; + import org.junit.Test; + ++import java.util.List; ++import java.util.concurrent.Callable; ++ ++import static org.junit.Assert.*; ++ + public class MetadataStoreTest { + private Plugin pluginX = new TestPlugin("x"); + private Plugin pluginY = new TestPlugin("y"); +diff --git a/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java b/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java +index c1e78568a86525e922a49a802aa5da85b4b6ae4a..63a01e8a111c283c437fe8ea28d4e7360efc6da1 100644 +--- a/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java ++++ b/src/test/java/org/bukkit/metadata/MetadataValueAdapterTest.java +@@ -1,10 +1,11 @@ + package org.bukkit.metadata; + +-import static org.junit.Assert.*; + import org.bukkit.plugin.Plugin; + import org.bukkit.plugin.TestPlugin; + import org.junit.Test; + ++import static org.junit.Assert.assertEquals; ++ + public class MetadataValueAdapterTest { + private TestPlugin plugin = new TestPlugin("x"); + +diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java +index 1941c9f49e9514c1236c5f4ea9f7af47f7be85c5..5be4f5ab1bec14529bf0d290398b1b5f32d545c1 100644 +--- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java ++++ b/src/test/java/org/bukkit/plugin/PluginManagerTest.java +@@ -1,7 +1,5 @@ + package org.bukkit.plugin; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import org.bukkit.TestServer; + import org.bukkit.event.Event; + import org.bukkit.event.TestEvent; +@@ -9,6 +7,9 @@ import org.bukkit.permissions.Permission; + import org.junit.After; + import org.junit.Test; + ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.assertThat; ++ + public class PluginManagerTest { + private class MutableObject { + volatile Object value = null; +diff --git a/src/test/java/org/bukkit/plugin/TestPlugin.java b/src/test/java/org/bukkit/plugin/TestPlugin.java +index 6d450897187e810070f633e832034763a102a0b0..d870ca7fc1f2e11eac04c8b2c54710d0b8360c10 100644 +--- a/src/test/java/org/bukkit/plugin/TestPlugin.java ++++ b/src/test/java/org/bukkit/plugin/TestPlugin.java +@@ -1,14 +1,15 @@ + package org.bukkit.plugin; + +-import java.io.File; +-import java.io.InputStream; +-import java.util.List; + import org.bukkit.Server; + import org.bukkit.command.Command; + import org.bukkit.command.CommandSender; + import org.bukkit.configuration.file.FileConfiguration; + import org.bukkit.generator.ChunkGenerator; + ++import java.io.File; ++import java.io.InputStream; ++import java.util.List; ++ + public class TestPlugin extends PluginBase { + private boolean enabled = true; + +diff --git a/src/test/java/org/bukkit/plugin/TimedRegisteredListenerTest.java b/src/test/java/org/bukkit/plugin/TimedRegisteredListenerTest.java +index 351fc4a9f45745984d1d4811ba836959a3f3eadb..42c6ddb84048a18067a601fc20c31b0b0cf3ab53 100644 +--- a/src/test/java/org/bukkit/plugin/TimedRegisteredListenerTest.java ++++ b/src/test/java/org/bukkit/plugin/TimedRegisteredListenerTest.java +@@ -1,7 +1,5 @@ + package org.bukkit.plugin; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import org.bukkit.event.Event; + import org.bukkit.event.EventException; + import org.bukkit.event.EventPriority; +@@ -12,6 +10,9 @@ import org.bukkit.event.player.PlayerInteractEvent; + import org.bukkit.event.player.PlayerMoveEvent; + import org.junit.Test; + ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + public class TimedRegisteredListenerTest { + + @Test +diff --git a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java +index 7e2335ed8acc692af1e70eddcf97ee7a56e30f68..72bccc0fae5fe2d7537d34cba8b92f44a7185470 100644 +--- a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java ++++ b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java +@@ -1,13 +1,16 @@ + package org.bukkit.plugin.messaging; + +-import static org.hamcrest.CoreMatchers.*; +-import static org.junit.Assert.*; +-import java.util.Collection; + import org.bukkit.entity.Player; + import org.bukkit.plugin.TestPlugin; + import org.junit.Assert; + import org.junit.Test; + ++import java.util.Collection; ++ ++import static org.hamcrest.CoreMatchers.hasItems; ++import static org.hamcrest.CoreMatchers.is; ++import static org.junit.Assert.*; ++ + public class StandardMessengerTest { + public StandardMessenger getMessenger() { + return new StandardMessenger(); +diff --git a/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java b/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java +index 7a5b6108d56b8350d1aa419caf25fe6c653066b4..123ead4807487c220ad4df8991b58ba3bbe70375 100644 +--- a/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java ++++ b/src/test/java/org/bukkit/plugin/messaging/TestMessageListener.java +@@ -1,8 +1,10 @@ + package org.bukkit.plugin.messaging; + +-import static org.junit.Assert.*; + import org.bukkit.entity.Player; + ++import static org.junit.Assert.assertArrayEquals; ++import static org.junit.Assert.assertEquals; ++ + public class TestMessageListener implements PluginMessageListener { + private final String channel; + private final byte[] message; +diff --git a/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java b/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java +index 1b7642dc1c55c6bf87018b67d8c368478c0b9ca1..7c3c2d1063ba66f89992f29a6520578c673de434 100644 +--- a/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java ++++ b/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java +@@ -1,11 +1,12 @@ + package org.bukkit.plugin.messaging; + ++import org.bukkit.entity.Player; ++ + import java.lang.reflect.Constructor; + import java.lang.reflect.InvocationHandler; + import java.lang.reflect.Method; + import java.lang.reflect.Proxy; + import java.util.HashMap; +-import org.bukkit.entity.Player; + + + public final class TestPlayer implements InvocationHandler { +diff --git a/src/test/java/org/bukkit/util/BoundingBoxTest.java b/src/test/java/org/bukkit/util/BoundingBoxTest.java +index 2d50a9ed66d40c9c538f5e767d9e128394f5dc3b..8f6899db65914ef71c89a850c3446376e76b1023 100644 +--- a/src/test/java/org/bukkit/util/BoundingBoxTest.java ++++ b/src/test/java/org/bukkit/util/BoundingBoxTest.java +@@ -1,12 +1,14 @@ + package org.bukkit.util; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; +-import java.util.Map; + import org.bukkit.Location; + import org.bukkit.block.BlockFace; + import org.junit.Test; + ++import java.util.Map; ++ ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.assertThat; ++ + public class BoundingBoxTest { + + private static final double delta = 1.0 / 1000000; +diff --git a/src/test/java/org/bukkit/util/StringUtilStartsWithTest.java b/src/test/java/org/bukkit/util/StringUtilStartsWithTest.java +index 229c67c769f50ba68b4d9681f984b4bc668619c2..2e6af3a7389a51dce97ed57bb86661fb8907ae10 100644 +--- a/src/test/java/org/bukkit/util/StringUtilStartsWithTest.java ++++ b/src/test/java/org/bukkit/util/StringUtilStartsWithTest.java +@@ -1,15 +1,17 @@ + package org.bukkit.util; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.ImmutableList; +-import java.util.List; + import org.junit.Test; + import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.List; ++ ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + @RunWith(Parameterized.class) + public class StringUtilStartsWithTest { + +diff --git a/src/test/java/org/bukkit/util/StringUtilTest.java b/src/test/java/org/bukkit/util/StringUtilTest.java +index 6476dd2d1b6d37c3390400d8dea94016b309d69f..e269e7615cf88930f84fb73fe461f1bbe2387203 100644 +--- a/src/test/java/org/bukkit/util/StringUtilTest.java ++++ b/src/test/java/org/bukkit/util/StringUtilTest.java +@@ -1,12 +1,15 @@ + package org.bukkit.util; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.ImmutableList; ++import org.junit.Test; ++ + import java.util.ArrayList; + import java.util.Arrays; + import java.util.List; +-import org.junit.Test; ++ ++import static org.hamcrest.Matchers.is; ++import static org.hamcrest.Matchers.sameInstance; ++import static org.junit.Assert.assertThat; + + public class StringUtilTest { + +diff --git a/src/test/java/org/bukkit/util/VectorTest.java b/src/test/java/org/bukkit/util/VectorTest.java +index 9b846deba8eb3ff43c444da70a9d7ca3d1b43b0a..1bdc75e6c07142ea8e862ffbaeac05baadf678fd 100644 +--- a/src/test/java/org/bukkit/util/VectorTest.java ++++ b/src/test/java/org/bukkit/util/VectorTest.java +@@ -1,9 +1,10 @@ + package org.bukkit.util; + +-import static org.junit.Assert.*; + import org.bukkit.block.BlockFace; + import org.junit.Test; + ++import static org.junit.Assert.*; ++ + public class VectorTest { + + @Test +diff --git a/src/test/java/org/bukkit/util/io/BukkitObjectStreamTest.java b/src/test/java/org/bukkit/util/io/BukkitObjectStreamTest.java +index d3edb72ff83d68b86390b0e9f7e40035482f353a..2f42b8bf14c6ed01a430096e36fc3fcc0026fc2a 100644 +--- a/src/test/java/org/bukkit/util/io/BukkitObjectStreamTest.java ++++ b/src/test/java/org/bukkit/util/io/BukkitObjectStreamTest.java +@@ -1,14 +1,6 @@ + package org.bukkit.util.io; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.ImmutableList; +-import java.io.ByteArrayInputStream; +-import java.io.ByteArrayOutputStream; +-import java.io.IOException; +-import java.io.ObjectInputStream; +-import java.io.ObjectOutputStream; +-import java.util.List; + import org.bukkit.Color; + import org.bukkit.FireworkEffect; + import org.bukkit.FireworkEffect.Type; +@@ -22,6 +14,12 @@ import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder; + ++import java.io.*; ++import java.util.List; ++ ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + @RunWith(Parameterized.class) + public class BukkitObjectStreamTest { + diff --git a/patches/api/0008-IntellaJ-Code-Clean-Up.patch b/patches/api/0008-IntellaJ-Code-Clean-Up.patch new file mode 100644 index 00000000..d66bd62e --- /dev/null +++ b/patches/api/0008-IntellaJ-Code-Clean-Up.patch @@ -0,0 +1,415 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Bud Gidiere +Date: Sat, 8 Aug 2020 18:32:49 -0500 +Subject: [PATCH] IntellaJ Code Clean Up + +Do not try to update this. Just rebuild it. + +diff --git a/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java +index 9db0056ab94145819628b3ad8d8d26130d117fcf..b27281a6538cb223f6dffbf3859366dedbbf75f1 100644 +--- a/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java ++++ b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java +@@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull; + public class SneakyThrow { + + public static void sneaky(@NotNull Throwable exception) { +- SneakyThrow.throwSneaky(exception); ++ SneakyThrow.throwSneaky(exception); + } + + @SuppressWarnings("unchecked") +diff --git a/src/main/java/org/bukkit/Color.java b/src/main/java/org/bukkit/Color.java +index a0c4535901de29653cc10f8ec7b1349160d27256..b874623c0b3c9f342d4d099d6a0bd5dfedadd308 100644 +--- a/src/main/java/org/bukkit/Color.java ++++ b/src/main/java/org/bukkit/Color.java +@@ -323,7 +323,7 @@ public final class Color implements ConfigurationSerializable { + @Override + @NotNull + public Map serialize() { +- return ImmutableMap.of( ++ return ImmutableMap.of( + "RED", getRed(), + "BLUE", getBlue(), + "GREEN", getGreen() +diff --git a/src/main/java/org/bukkit/FireworkEffect.java b/src/main/java/org/bukkit/FireworkEffect.java +index bd0d18d24b94f7412782749e94f73958396bc363..31cd3923cf88ed6f862bd67a3331217de4e3164f 100644 +--- a/src/main/java/org/bukkit/FireworkEffect.java ++++ b/src/main/java/org/bukkit/FireworkEffect.java +@@ -287,7 +287,7 @@ public final class FireworkEffect implements ConfigurationSerializable { + flicker, + trail, + colors.build(), +- fadeColors == null ? ImmutableList.of() : fadeColors.build(), ++ fadeColors == null ? ImmutableList.of() : fadeColors.build(), + type + ); + } +@@ -386,7 +386,7 @@ public final class FireworkEffect implements ConfigurationSerializable { + @NotNull + @Override + public Map serialize() { +- return ImmutableMap.of( ++ return ImmutableMap.of( + FLICKER, flicker, + TRAIL, trail, + COLORS, colors, +diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java +index 495c36aee4c2590c62355d62daa8787ea057d191..2f91103a7615e7049031e70665e871d54e707841 100644 +--- a/src/main/java/org/bukkit/Registry.java ++++ b/src/main/java/org/bukkit/Registry.java +@@ -174,7 +174,7 @@ public interface Registry extends Iterable { + private final Map map; + + protected SimpleRegistry(@NotNull Class type) { +- this(type, Predicates.alwaysTrue()); ++ this(type, Predicates.alwaysTrue()); + } + + protected SimpleRegistry(@NotNull Class type, @NotNull Predicate predicate) { +diff --git a/src/main/java/org/bukkit/block/banner/Pattern.java b/src/main/java/org/bukkit/block/banner/Pattern.java +index e5327b59cfb7b5ed547e34a8c02d293a9b6fd22d..4de1b440cdab5dd53cdde26074c2b19690f08039 100644 +--- a/src/main/java/org/bukkit/block/banner/Pattern.java ++++ b/src/main/java/org/bukkit/block/banner/Pattern.java +@@ -51,7 +51,7 @@ public class Pattern implements ConfigurationSerializable { + @NotNull + @Override + public Map serialize() { +- return ImmutableMap.of( ++ return ImmutableMap.of( + COLOR, color.toString(), + PATTERN, pattern.getIdentifier() + ); +diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java +index fcbc298043614da5f4bd849e9f65961da276e15e..839bc98509faa25cbbc8d0d6a312c485ce7e36af 100644 +--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java ++++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java +@@ -227,7 +227,7 @@ public class SimpleCommandMap implements CommandMap { + return null; + } + +- String[] args = cmdLine.substring(spaceIndex + 1, cmdLine.length()).split(" ", -1); ++ String[] args = cmdLine.substring(spaceIndex + 1).split(" ", -1); + + try { + return target.tabComplete(sender, commandName, args, location); +diff --git a/src/main/java/org/bukkit/command/defaults/HelpCommand.java b/src/main/java/org/bukkit/command/defaults/HelpCommand.java +index e9da1efa1229ef0ffad16478dcb0679731585104..a3a2acd3cc2effc7b29075be597913c6d58bf0e8 100644 +--- a/src/main/java/org/bukkit/command/defaults/HelpCommand.java ++++ b/src/main/java/org/bukkit/command/defaults/HelpCommand.java +@@ -24,7 +24,7 @@ public class HelpCommand extends BukkitCommand { + super("help"); + this.description = "Shows the help menu"; + this.usageMessage = "/help \n/help \n/help "; +- this.setAliases(Arrays.asList(new String[]{"?"})); ++ this.setAliases(Arrays.asList("?")); + this.setPermission("bukkit.command.help"); + } + +diff --git a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java +index 555c6f37d5b9daf0f7231070ee79fcfd36e87bfc..b3bb35d0b0f134fb1ce0c6e9ac4cf88edaf34950 100644 +--- a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java ++++ b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java +@@ -55,7 +55,7 @@ public class YamlConfiguration extends FileConfiguration { + Map input; + try { + loaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE); // SPIGOT-5881: Not ideal, but was default pre SnakeYAML 1.26 +- input = (Map) yaml.load(contents); ++ input = yaml.load(contents); + } catch (YAMLException e) { + throw new InvalidConfigurationException(e); + } catch (ClassCastException e) { +diff --git a/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java b/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java +index f4f4ef18198c1fc40826df8f1327e0c8d6cbc69d..6fa5256ad04996aec1109af790d6accca18c2be1 100644 +--- a/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java ++++ b/src/main/java/org/bukkit/event/entity/PotionSplashEvent.java +@@ -38,7 +38,7 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable + */ + @NotNull + public ThrownPotion getPotion() { +- return (ThrownPotion) getEntity(); ++ return getEntity(); + } + + /** +diff --git a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java +index 860363507f4c5f7ffb5e8b65a4f6cec1cdfbc0b6..490cd398fe120744e3e3d415a732cd758a0d35ec 100644 +--- a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java ++++ b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java +@@ -97,6 +97,6 @@ public class FurnaceRecipe extends CookingRecipe { + @NotNull + @Override + public FurnaceRecipe setInputChoice(@NotNull RecipeChoice input) { +- return (FurnaceRecipe) super.setInputChoice(input); ++ return super.setInputChoice(input); + } + } +diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java +index 428ceabb5355794317c855e962d7988c8b837c7f..0ee6b21151c306dbaed267e49dc4a3289bc1e962 100644 +--- a/src/main/java/org/bukkit/inventory/ItemStack.java ++++ b/src/main/java/org/bukkit/inventory/ItemStack.java +@@ -354,7 +354,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { + */ + @NotNull + public Map getEnchantments() { +- return meta == null ? ImmutableMap.of() : meta.getEnchants(); ++ return meta == null ? ImmutableMap.of() : meta.getEnchants(); + } + + /** +@@ -492,7 +492,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { + + Material type; + if (version < 0) { +- type = Material.getMaterial(Material.LEGACY_PREFIX + (String) args.get("type")); ++ type = Material.getMaterial(Material.LEGACY_PREFIX + args.get("type")); + + byte dataVal = (type != null && type.getMaxDurability() == 0) ? (byte) damage : 0; // Actually durable items get a 0 passed into conversion + type = Bukkit.getUnsafe().fromLegacy(new MaterialData(type, dataVal), true); +diff --git a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java +index 9c59aec2525e1a71def39fd3dc71d40dc0b55dcb..42ccc6468d5f3430b9f6294f18c27bf216acfc47 100644 +--- a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java ++++ b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java +@@ -73,7 +73,7 @@ public class StonecuttingRecipe implements Recipe, Keyed { + @NotNull + public StonecuttingRecipe setInputChoice(@NotNull RecipeChoice input) { + this.ingredient = input; +- return (StonecuttingRecipe) this; ++ return this; + } + + /** +diff --git a/src/main/java/org/bukkit/material/Mushroom.java b/src/main/java/org/bukkit/material/Mushroom.java +index 2b45156ee38abd9ec5a350fa59dfbef61bf07d90..2313d8f4d6bdfb3c86919d2c76bc2fccfec07337 100644 +--- a/src/main/java/org/bukkit/material/Mushroom.java ++++ b/src/main/java/org/bukkit/material/Mushroom.java +@@ -106,7 +106,7 @@ public class Mushroom extends MaterialData { + */ + @Deprecated + public void setStem() { +- setData((byte) MushroomBlockTexture.STEM_SIDES.getData()); ++ setData(MushroomBlockTexture.STEM_SIDES.getData()); + } + + /** +diff --git a/src/main/java/org/bukkit/material/Wood.java b/src/main/java/org/bukkit/material/Wood.java +index 5d51c9286dbf71ff4bb8717d5e83431b1815770e..aa5ab880c9063d01e4cb3bec4bcaae8501f58d07 100644 +--- a/src/main/java/org/bukkit/material/Wood.java ++++ b/src/main/java/org/bukkit/material/Wood.java +@@ -74,7 +74,7 @@ public class Wood extends MaterialData { + switch (getItemType()) { + case LEGACY_WOOD: + case LEGACY_WOOD_DOUBLE_STEP: +- return TreeSpecies.getByData((byte) getData()); ++ return TreeSpecies.getByData(getData()); + case LEGACY_LOG: + case LEGACY_LEAVES: + return TreeSpecies.getByData((byte) (getData() & 0x3)); +diff --git a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +index 9a40bea9e4b0a6123e33a4bc49774c841c28a5b5..80524019873e6b334e1a29b312f10886e3d4fcb9 100644 +--- a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java ++++ b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +@@ -136,9 +136,7 @@ public abstract class MetadataStoreBase { + Validate.notNull(owningPlugin, "Plugin cannot be null"); + for (Iterator> iterator = metadataMap.values().iterator(); iterator.hasNext(); ) { + Map values = iterator.next(); +- if (values.containsKey(owningPlugin)) { +- values.remove(owningPlugin); +- } ++ values.remove(owningPlugin); + if (values.isEmpty()) { + iterator.remove(); + } +diff --git a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java +index 9d7ba043bf971e78f30ba751ea036ea54b54fe7d..3ca512bef3d31af56aee17e78c4ebe3bcf6ebde9 100644 +--- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java ++++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java +@@ -849,7 +849,7 @@ public final class PluginDescriptionFile { + public List getPermissions() { + if (permissions == null) { + if (lazyPermissions == null) { +- permissions = ImmutableList.of(); ++ permissions = ImmutableList.of(); + } else { + permissions = ImmutableList.copyOf(Permission.loadPermissions(lazyPermissions, "Permission node '%s' in plugin description file for " + getFullName() + " is invalid", defaultPerm)); + lazyPermissions = null; +@@ -1005,15 +1005,15 @@ public final class PluginDescriptionFile { + } + + if (map.get("commands") != null) { +- ImmutableMap.Builder> commandsBuilder = ImmutableMap.>builder(); ++ ImmutableMap.Builder> commandsBuilder = ImmutableMap.builder(); + try { + for (Map.Entry command : ((Map) map.get("commands")).entrySet()) { +- ImmutableMap.Builder commandBuilder = ImmutableMap.builder(); ++ ImmutableMap.Builder commandBuilder = ImmutableMap.builder(); + if (command.getValue() != null) { + for (Map.Entry commandEntry : ((Map) command.getValue()).entrySet()) { + if (commandEntry.getValue() instanceof Iterable) { + // This prevents internal alias list changes +- ImmutableList.Builder commandSubList = ImmutableList.builder(); ++ ImmutableList.Builder commandSubList = ImmutableList.builder(); + for (Object commandSubListItem : (Iterable) commandEntry.getValue()) { + if (commandSubListItem != null) { + commandSubList.add(commandSubListItem); +@@ -1060,7 +1060,7 @@ public final class PluginDescriptionFile { + } + + if (map.get("authors") != null) { +- ImmutableList.Builder authorsBuilder = ImmutableList.builder(); ++ ImmutableList.Builder authorsBuilder = ImmutableList.builder(); + if (map.get("author") != null) { + authorsBuilder.add(map.get("author").toString()); + } +@@ -1077,11 +1077,11 @@ public final class PluginDescriptionFile { + } else if (map.get("author") != null) { + authors = ImmutableList.of(map.get("author").toString()); + } else { +- authors = ImmutableList.of(); ++ authors = ImmutableList.of(); + } + + if (map.get("contributors") != null) { +- ImmutableList.Builder contributorsBuilder = ImmutableList.builder(); ++ ImmutableList.Builder contributorsBuilder = ImmutableList.builder(); + try { + for (Object o : (Iterable) map.get("contributors")) { + contributorsBuilder.add(o.toString()); +@@ -1091,7 +1091,7 @@ public final class PluginDescriptionFile { + } + contributors = contributorsBuilder.build(); + } else { +- contributors = ImmutableList.of(); ++ contributors = ImmutableList.of(); + } + + if (map.get("default-permission") != null) { +@@ -1138,7 +1138,7 @@ public final class PluginDescriptionFile { + return ImmutableList.of(); + } + +- final ImmutableList.Builder builder = ImmutableList.builder(); ++ final ImmutableList.Builder builder = ImmutableList.builder(); + try { + for (final Object entry : (Iterable) value) { + builder.add(entry.toString().replace(' ', '_')); +diff --git a/src/main/java/org/bukkit/plugin/SimpleServicesManager.java b/src/main/java/org/bukkit/plugin/SimpleServicesManager.java +index aaa95ca8b99d62b3dfb7b689e09d077b75aa90b5..093dcc0ec5df5ab683636a15697a85abb6d3a4e3 100644 +--- a/src/main/java/org/bukkit/plugin/SimpleServicesManager.java ++++ b/src/main/java/org/bukkit/plugin/SimpleServicesManager.java +@@ -242,7 +242,7 @@ public class SimpleServicesManager implements ServicesManager { + @Override + @NotNull + public List> getRegistrations(@NotNull Plugin plugin) { +- ImmutableList.Builder> ret = ImmutableList.>builder(); ++ ImmutableList.Builder> ret = ImmutableList.builder(); + synchronized (providers) { + for (List> registered : providers.values()) { + for (RegisteredServiceProvider provider : registered) { +@@ -272,10 +272,10 @@ public class SimpleServicesManager implements ServicesManager { + List> registered = providers.get(service); + + if (registered == null) { +- return ImmutableList.>of(); ++ return ImmutableList.of(); + } + +- ret = ImmutableList.>builder(); ++ ret = ImmutableList.builder(); + + for (RegisteredServiceProvider provider : registered) { + ret.add((RegisteredServiceProvider) provider); +@@ -295,7 +295,7 @@ public class SimpleServicesManager implements ServicesManager { + @NotNull + public Set> getKnownServices() { + synchronized (providers) { +- return ImmutableSet.>copyOf(providers.keySet()); ++ return ImmutableSet.copyOf(providers.keySet()); + } + } + +diff --git a/src/test/java/org/bukkit/ChatColorTest.java b/src/test/java/org/bukkit/ChatColorTest.java +index a39d52e724879a97ca09ebe215897f3ece302552..027be750a811d4681407221405430255047064b1 100644 +--- a/src/test/java/org/bukkit/ChatColorTest.java ++++ b/src/test/java/org/bukkit/ChatColorTest.java +@@ -17,7 +17,7 @@ public class ChatColorTest { + + @Test(expected = IllegalArgumentException.class) + public void getByStringWithNull() { +- ChatColor.getByChar((String) null); ++ ChatColor.getByChar(null); + } + + @Test(expected = IllegalArgumentException.class) +diff --git a/src/test/java/org/bukkit/LocationTest.java b/src/test/java/org/bukkit/LocationTest.java +index a5b56467755d87c270a7f84fc2326e7a92343bc1..804b91c617e4d73b43db6d02c5a48a3d2ffa25df 100644 +--- a/src/test/java/org/bukkit/LocationTest.java ++++ b/src/test/java/org/bukkit/LocationTest.java +@@ -43,7 +43,7 @@ public class LocationTest { + public static List data() { + Random RANDOM = new Random(1L); // Test is deterministic + int r = 0; +- return ImmutableList.of( ++ return ImmutableList.of( + new Object[]{"X", + 1, 0, 0, + 270, 0 +diff --git a/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java b/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java +index 66008139243be58101354e2194f6d876de97213f..4347062453e6c583ec67d039249ebc39f48dd025 100644 +--- a/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java ++++ b/src/test/java/org/bukkit/event/PlayerChatTabCompleteEventTest.java +@@ -22,6 +22,6 @@ public class PlayerChatTabCompleteEventTest { + } + + private String getToken(String message) { +- return new PlayerChatTabCompleteEvent(TestPlayer.getInstance(), message, ImmutableList.of()).getLastToken(); ++ return new PlayerChatTabCompleteEvent(TestPlayer.getInstance(), message, ImmutableList.of()).getLastToken(); + } + } +diff --git a/src/test/java/org/bukkit/util/StringUtilStartsWithTest.java b/src/test/java/org/bukkit/util/StringUtilStartsWithTest.java +index 2e6af3a7389a51dce97ed57bb86661fb8907ae10..2a2f18f4f59456b1e5f66b8c0c67d83cb70491ad 100644 +--- a/src/test/java/org/bukkit/util/StringUtilStartsWithTest.java ++++ b/src/test/java/org/bukkit/util/StringUtilStartsWithTest.java +@@ -17,7 +17,7 @@ public class StringUtilStartsWithTest { + + @Parameters(name = "{index}: {0} startsWith {1} == {2}") + public static List data() { +- return ImmutableList.of( ++ return ImmutableList.of( + new Object[] { + "Apple", + "Apples", +diff --git a/src/test/java/org/bukkit/util/StringUtilTest.java b/src/test/java/org/bukkit/util/StringUtilTest.java +index e269e7615cf88930f84fb73fe461f1bbe2387203..84c08fc7d54e41d71bdfb49c556f890dce421412 100644 +--- a/src/test/java/org/bukkit/util/StringUtilTest.java ++++ b/src/test/java/org/bukkit/util/StringUtilTest.java +@@ -25,7 +25,7 @@ public class StringUtilTest { + + @Test(expected = IllegalArgumentException.class) + public void nullCollectionTest() { +- StringUtil.copyPartialMatches("Token", ImmutableList.of(), null); ++ StringUtil.copyPartialMatches("Token", ImmutableList.of(), null); + } + + @Test(expected = IllegalArgumentException.class) +@@ -35,7 +35,7 @@ public class StringUtilTest { + + @Test(expected = IllegalArgumentException.class) + public void nullTokenTest() { +- StringUtil.copyPartialMatches(null, ImmutableList.of(), new ArrayList()); ++ StringUtil.copyPartialMatches(null, ImmutableList.of(), new ArrayList()); + } + + @Test +diff --git a/src/test/java/org/bukkit/util/io/BukkitObjectStreamTest.java b/src/test/java/org/bukkit/util/io/BukkitObjectStreamTest.java +index 2f42b8bf14c6ed01a430096e36fc3fcc0026fc2a..ab83aa3685137d3d0bd3a6fe12ae4e01b89dfc3d 100644 +--- a/src/test/java/org/bukkit/util/io/BukkitObjectStreamTest.java ++++ b/src/test/java/org/bukkit/util/io/BukkitObjectStreamTest.java +@@ -25,7 +25,7 @@ public class BukkitObjectStreamTest { + + @Parameters(name = "{index}: {0}") + public static List data() { +- return ImmutableList.of( ++ return ImmutableList.of( + new Object[] { + Color.class.getName(), + "rO0ABXNyADZjb20uZ29vZ2xlLmNvbW1vbi5jb2xsZWN0LkltbXV0YWJsZUxpc3QkU2VyaWFsaXplZEZvcm0AAAAAAAAAAAIAAVsACGVsZW1lbnRzdAATW0xqYXZhL2xhbmcvT2JqZWN0O3hwdXIAE1tMamF2YS5sYW5nLk9iamVjdDuQzlifEHMpbAIAAHhwAAAABXNyABpvcmcuYnVra2l0LnV0aWwuaW8uV3JhcHBlcvJQR+zxEm8FAgABTAADbWFwdAAPTGphdmEvdXRpbC9NYXA7eHBzcgA1Y29tLmdvb2dsZS5jb21tb24uY29sbGVjdC5JbW11dGFibGVNYXAkU2VyaWFsaXplZEZvcm0AAAAAAAAAAAIAAlsABGtleXNxAH4AAVsABnZhbHVlc3EAfgABeHB1cQB+AAMAAAAEdAACPT10AANSRUR0AARCTFVFdAAFR1JFRU51cQB+AAMAAAAEdAAFQ29sb3JzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAA/3NxAH4AEQAAAP9zcQB+ABEAAAD/c3EAfgAFc3EAfgAIdXEAfgADAAAABHEAfgALcQB+AAxxAH4ADXEAfgAOdXEAfgADAAAABHEAfgAQc3EAfgARAAAAAHNxAH4AEQAAAIBzcQB+ABEAAACAc3EAfgAFc3EAfgAIdXEAfgADAAAABHEAfgALcQB+AAxxAH4ADXEAfgAOdXEAfgADAAAABHEAfgAQc3EAfgARAAAAgHNxAH4AEQAAAIBxAH4AGnNxAH4ABXNxAH4ACHVxAH4AAwAAAARxAH4AC3EAfgAMcQB+AA1xAH4ADnVxAH4AAwAAAARxAH4AEHNxAH4AEQAAAP9xAH4AGnEAfgAac3EAfgAFc3EAfgAIdXEAfgADAAAABHEAfgALcQB+AAxxAH4ADXEAfgAOdXEAfgADAAAABHEAfgAQc3EAfgARAAAA/3EAfgAac3EAfgARAAAApQ==", diff --git a/patches/server/0030-IntellaJ-Optimize-Imports.patch b/patches/server/0030-IntellaJ-Optimize-Imports.patch new file mode 100644 index 00000000..f3a8f3a2 --- /dev/null +++ b/patches/server/0030-IntellaJ-Optimize-Imports.patch @@ -0,0 +1,16107 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Bud Gidiere +Date: Sat, 8 Aug 2020 18:07:00 -0500 +Subject: [PATCH] IntellaJ Optimize Imports + +Do not try to update this. Just rebuild it. + +diff --git a/src/main/java/app/akarin/server/Config.java b/src/main/java/app/akarin/server/Config.java +index 358ac3361c814b7cf5f9650a6a49c6efce7dd56a..90408487112519791540f9d7968e7e0b1f541472 100644 +--- a/src/main/java/app/akarin/server/Config.java ++++ b/src/main/java/app/akarin/server/Config.java +@@ -1,15 +1,13 @@ + package app.akarin.server; + ++import dev.tr7zw.yatopia.YatopiaConfig; + import org.bukkit.Bukkit; + import org.bukkit.configuration.ConfigurationSection; + import org.bukkit.configuration.file.YamlConfiguration; + +-import dev.tr7zw.yatopia.YatopiaConfig; +- + import java.io.File; + import java.lang.reflect.Method; + import java.lang.reflect.Modifier; +-import java.util.List; + import java.util.logging.Level; + + public final class Config { +diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java +index 85b25eace786fa0d7694afa405f9d2bdf4937b6e..6c65b2fddf70d51735ecf7fab4548f4279e13a5d 100644 +--- a/src/main/java/co/aikar/timings/MinecraftTimings.java ++++ b/src/main/java/co/aikar/timings/MinecraftTimings.java +@@ -2,11 +2,10 @@ package co.aikar.timings; + + import com.google.common.collect.MapMaker; + import net.minecraft.server.*; ++import org.bukkit.craftbukkit.scheduler.CraftTask; + import org.bukkit.plugin.Plugin; + import org.bukkit.scheduler.BukkitTask; + +-import org.bukkit.craftbukkit.scheduler.CraftTask; +- + import java.util.Map; + + // TODO: Re-implement missing timers +diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java +index 6a110318441a16cc3ff7dfa2364768279b16358f..25418d5de822c5ce31380c1b8ae0fb43883e0ac6 100644 +--- a/src/main/java/co/aikar/timings/TimingsExport.java ++++ b/src/main/java/co/aikar/timings/TimingsExport.java +@@ -53,12 +53,7 @@ import java.util.logging.Level; + import java.util.zip.GZIPOutputStream; + + import static co.aikar.timings.TimingsManager.HISTORY; +-import static co.aikar.util.JSONUtil.appendObjectData; +-import static co.aikar.util.JSONUtil.createObject; +-import static co.aikar.util.JSONUtil.pair; +-import static co.aikar.util.JSONUtil.toArray; +-import static co.aikar.util.JSONUtil.toArrayMapper; +-import static co.aikar.util.JSONUtil.toObjectMapper; ++import static co.aikar.util.JSONUtil.*; + + @SuppressWarnings({"rawtypes", "SuppressionAnnotation"}) + public class TimingsExport extends Thread { +diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java +index 98a898f8b8469969e5eb388edb818e519ff68681..27c863ea9d6a91ef7298da5fbd85135b66ff4e73 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java ++++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java +@@ -1,7 +1,7 @@ + package com.destroystokyo.paper; + +-import com.destroystokyo.paper.io.chunk.ChunkTaskManager; + import com.destroystokyo.paper.io.SyncLoadFinder; ++import com.destroystokyo.paper.io.chunk.ChunkTaskManager; + import com.google.common.base.Functions; + import com.google.common.collect.Iterables; + import com.google.common.collect.Lists; +@@ -32,7 +32,6 @@ import java.io.StringWriter; + import java.time.LocalDateTime; + import java.time.format.DateTimeFormatter; + import java.util.*; +-import java.util.stream.Collectors; + + public class PaperCommand extends Command { + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index 1febe2aff4eab2f15e9bc4b21e6d0c350f122c87..fd1e9518ff6555a347b3d14eb510d7be896c9f94 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -1,8 +1,20 @@ + package com.destroystokyo.paper; + ++import co.aikar.timings.Timings; ++import co.aikar.timings.TimingsManager; + import com.destroystokyo.paper.io.chunk.ChunkTaskManager; + import com.google.common.base.Strings; + import com.google.common.base.Throwables; ++import com.google.common.collect.Lists; ++import net.minecraft.server.MinecraftServer; ++import org.bukkit.Bukkit; ++import org.bukkit.ChatColor; ++import org.bukkit.command.Command; ++import org.bukkit.configuration.ConfigurationSection; ++import org.bukkit.configuration.InvalidConfigurationException; ++import org.bukkit.configuration.file.YamlConfiguration; ++import org.spigotmc.SpigotConfig; ++import org.spigotmc.WatchdogThread; + + import java.io.File; + import java.io.IOException; +@@ -17,19 +29,6 @@ import java.util.concurrent.TimeUnit; + import java.util.logging.Level; + import java.util.regex.Pattern; + +-import com.google.common.collect.Lists; +-import net.minecraft.server.MinecraftServer; +-import org.bukkit.Bukkit; +-import org.bukkit.ChatColor; +-import org.bukkit.command.Command; +-import org.bukkit.configuration.ConfigurationSection; +-import org.bukkit.configuration.InvalidConfigurationException; +-import org.bukkit.configuration.file.YamlConfiguration; +-import co.aikar.timings.Timings; +-import co.aikar.timings.TimingsManager; +-import org.spigotmc.SpigotConfig; +-import org.spigotmc.WatchdogThread; +- + public class PaperConfig { + + private static File CONFIG_FILE; +diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +index 60d6469b8115f57a0b117aaef56c8192b7621104..1a0cfc3b768f0b7ccd6b73c1759764ef960a8135 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java ++++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +@@ -3,11 +3,15 @@ package com.destroystokyo.paper; + import com.destroystokyo.paper.util.VersionFetcher; + import com.google.common.base.Charsets; + import com.google.common.io.Resources; +-import com.google.gson.*; ++import com.google.gson.Gson; ++import com.google.gson.JsonObject; ++import com.google.gson.JsonSyntaxException; + + import javax.annotation.Nonnull; + import javax.annotation.Nullable; +-import java.io.*; ++import java.io.BufferedReader; ++import java.io.IOException; ++import java.io.InputStreamReader; + import java.net.HttpURLConnection; + import java.net.URL; + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index c2d5f7d22beb4c4829dfcb55fa842eaf727e906c..b8f3e91d17d2e260401f3a06ef0fb7327d42f059 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -1,11 +1,5 @@ + package com.destroystokyo.paper; + +-import java.util.Arrays; +-import java.util.EnumMap; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; +- + import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray.EngineMode; + import org.bukkit.Bukkit; + import org.bukkit.Material; +@@ -13,6 +7,8 @@ import org.bukkit.configuration.ConfigurationSection; + import org.bukkit.configuration.file.YamlConfiguration; + import org.spigotmc.SpigotWorldConfig; + ++import java.util.*; ++ + import static com.destroystokyo.paper.PaperConfig.log; + import static com.destroystokyo.paper.PaperConfig.logError; + +diff --git a/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java +index f699ce18ca044f813e194ef2786b7ea853ea86e7..033c1339ad70de046c54b2efc1736f8783c147c2 100644 +--- a/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java ++++ b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java +@@ -1,9 +1,9 @@ + package com.destroystokyo.paper; + +-import com.google.common.base.Preconditions; +-import org.bukkit.craftbukkit.scheduler.CraftTask; + import com.destroystokyo.paper.event.server.ServerExceptionEvent; + import com.destroystokyo.paper.exception.ServerSchedulerException; ++import com.google.common.base.Preconditions; ++import org.bukkit.craftbukkit.scheduler.CraftTask; + + /** + * Reporting wrapper to catch exceptions not natively +diff --git a/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java b/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java +index aac3f66cb23d260729c2a48d8710a9de2346aa22..0a2520e4372baa98b91398a1818fccafbe006746 100644 +--- a/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java ++++ b/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java +@@ -3,6 +3,10 @@ package com.destroystokyo.paper; + import com.google.common.base.MoreObjects; + import com.google.gson.Gson; + import com.google.gson.JsonSyntaxException; ++import org.bukkit.Bukkit; ++ ++import javax.annotation.Nonnull; ++import javax.annotation.Nullable; + import java.io.BufferedReader; + import java.io.BufferedWriter; + import java.io.IOException; +@@ -14,10 +18,6 @@ import java.nio.file.StandardOpenOption; + import java.util.Objects; + import java.util.logging.Level; + import java.util.logging.Logger; +-import org.bukkit.Bukkit; +- +-import javax.annotation.Nonnull; +-import javax.annotation.Nullable; + + public enum VersionHistoryManager { + INSTANCE; +diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java +index df7e4183d8842f5be8ae9d0698f8fa90742ff43c..87483f14d546d3557b3add5fde30672eab0690c2 100644 +--- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java ++++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java +@@ -1,14 +1,6 @@ + package com.destroystokyo.paper.antixray; + +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.Chunk; +-import net.minecraft.server.ChunkSection; +-import net.minecraft.server.EnumDirection; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IChunkAccess; +-import net.minecraft.server.PacketPlayOutMapChunk; +-import net.minecraft.server.PlayerInteractManager; +-import net.minecraft.server.World; ++import net.minecraft.server.*; + + public class ChunkPacketBlockController { + +diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +index c0d7767adb996edf9f645be591e4eee1d1dddf97..604c3811ee915f1624e7098cccead7b9f703aa78 100644 +--- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java ++++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +@@ -1,17 +1,16 @@ + package com.destroystokyo.paper.antixray; + ++import com.destroystokyo.paper.PaperWorldConfig; ++import net.minecraft.server.*; ++import org.bukkit.Bukkit; ++import org.bukkit.World.Environment; ++ + import java.util.ArrayList; + import java.util.HashSet; + import java.util.List; + import java.util.Set; + import java.util.concurrent.Executor; + +-import net.minecraft.server.*; +-import org.bukkit.Bukkit; +-import org.bukkit.World.Environment; +- +-import com.destroystokyo.paper.PaperWorldConfig; +- + public final class ChunkPacketBlockControllerAntiXray extends ChunkPacketBlockController { + + private final Executor executor; +diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java +index 7b12014db0abd9c4b89f58ceaaa7d9dd032b027a..6e72904dfd1ead41ddfaf81abfe589216d9dddeb 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java ++++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java +@@ -1,24 +1,15 @@ + package com.destroystokyo.paper.entity.ai; + +-import com.google.common.collect.BiMap; +-import com.google.common.collect.HashBiMap; +- + import com.destroystokyo.paper.entity.RangedEntity; +-import com.destroystokyo.paper.entity.ai.GoalKey; +-import com.destroystokyo.paper.entity.ai.GoalType; + import com.destroystokyo.paper.util.set.OptimizedSmallEnumSet; +- +-import net.minecraft.server.*; // intentional star import ++import com.google.common.collect.BiMap; ++import com.google.common.collect.HashBiMap; ++import net.minecraft.server.*; ++import org.bukkit.NamespacedKey; ++import org.bukkit.entity.*; + + import java.lang.reflect.Constructor; +-import java.util.EnumSet; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Map; +-import java.util.Set; +- +-import org.bukkit.NamespacedKey; +-import org.bukkit.entity.*; // intentional star import ++import java.util.*; + + public class MobGoalHelper { + +diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/PaperCustomGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/PaperCustomGoal.java +index 5720feaaf92fc8b6a70e7f6e2d25163c42d231c1..ab9103b239cd79c05a697ca50104412b7f266115 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/ai/PaperCustomGoal.java ++++ b/src/main/java/com/destroystokyo/paper/entity/ai/PaperCustomGoal.java +@@ -1,7 +1,6 @@ + package com.destroystokyo.paper.entity.ai; + + import net.minecraft.server.PathfinderGoal; +- + import org.bukkit.entity.Mob; + + /** +diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java b/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java +index 45b383f4d118d076e41c42b5b158b2a3713341a8..5d04c63384729b697e5f72aa0bd69c5237595504 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java ++++ b/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java +@@ -3,19 +3,11 @@ package com.destroystokyo.paper.entity.ai; + import net.minecraft.server.PathfinderGoal; + import net.minecraft.server.PathfinderGoalSelector; + import net.minecraft.server.PathfinderGoalWrapped; +- +-import java.util.Collection; +-import java.util.EnumSet; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.LinkedList; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +- + import org.bukkit.craftbukkit.entity.CraftMob; + import org.bukkit.entity.Mob; + ++import java.util.*; ++ + public class PaperMobGoals implements MobGoals { + + private final Map> instanceCache = new HashMap<>(); +diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/PaperVanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/PaperVanillaGoal.java +index 2988e3d1b37d73b6d1ef514acd237e88a5cc079e..57ed9276dea3ff001e864ef467733ea7e63fbea3 100644 +--- a/src/main/java/com/destroystokyo/paper/entity/ai/PaperVanillaGoal.java ++++ b/src/main/java/com/destroystokyo/paper/entity/ai/PaperVanillaGoal.java +@@ -1,11 +1,10 @@ + package com.destroystokyo.paper.entity.ai; + + import net.minecraft.server.PathfinderGoal; ++import org.bukkit.entity.Mob; + + import java.util.EnumSet; + +-import org.bukkit.entity.Mob; +- + /** + * Wraps vanilla in api + */ +diff --git a/src/main/java/com/destroystokyo/paper/gui/GraphColor.java b/src/main/java/com/destroystokyo/paper/gui/GraphColor.java +index a4e641fdcccd3efcd1a2865dc6dc28d50671b995..b91edf034a0efe3659b104180cf3f20c64142df7 100644 +--- a/src/main/java/com/destroystokyo/paper/gui/GraphColor.java ++++ b/src/main/java/com/destroystokyo/paper/gui/GraphColor.java +@@ -1,6 +1,6 @@ + package com.destroystokyo.paper.gui; + +-import java.awt.Color; ++import java.awt.*; + + public class GraphColor { + private static final Color[] colorLine = new Color[101]; +diff --git a/src/main/java/com/destroystokyo/paper/gui/GraphData.java b/src/main/java/com/destroystokyo/paper/gui/GraphData.java +index 186fc722965e403f76b1480e1c2381fc34e29049..3ec7a1ac40aee54854a662540ecb5726c5773acc 100644 +--- a/src/main/java/com/destroystokyo/paper/gui/GraphData.java ++++ b/src/main/java/com/destroystokyo/paper/gui/GraphData.java +@@ -1,6 +1,6 @@ + package com.destroystokyo.paper.gui; + +-import java.awt.Color; ++import java.awt.*; + + public class GraphData { + private long total; +diff --git a/src/main/java/com/destroystokyo/paper/gui/GuiStatsComponent.java b/src/main/java/com/destroystokyo/paper/gui/GuiStatsComponent.java +index 0f29ad583e798c09b2fe3f568ed50cbc719e40e2..4c8c46f59d48f7658a344c4f53c64eb4a2effd87 100644 +--- a/src/main/java/com/destroystokyo/paper/gui/GuiStatsComponent.java ++++ b/src/main/java/com/destroystokyo/paper/gui/GuiStatsComponent.java +@@ -2,10 +2,8 @@ package com.destroystokyo.paper.gui; + + import net.minecraft.server.MinecraftServer; + +-import javax.swing.JPanel; +-import javax.swing.Timer; +-import java.awt.BorderLayout; +-import java.awt.Dimension; ++import javax.swing.*; ++import java.awt.*; + + public class GuiStatsComponent extends JPanel { + private final Timer timer; +diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java +index e463a86a6ad6c4f2885f4df159411bad294e1208..689330cc46cc83ff4500334e7d8108ec85bf4a86 100644 +--- a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java ++++ b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java +@@ -2,13 +2,10 @@ package com.destroystokyo.paper.gui; + + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.SystemUtils; +-import org.bukkit.Bukkit; + +-import javax.swing.DefaultListCellRenderer; +-import javax.swing.DefaultListSelectionModel; +-import javax.swing.JList; ++import javax.swing.*; + import javax.swing.border.EmptyBorder; +-import java.awt.Dimension; ++import java.awt.*; + import java.text.DecimalFormat; + import java.text.DecimalFormatSymbols; + import java.util.Locale; +diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java b/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java +index c3e54da4ab6440811aab2f9dd1e218802ac13285..9461f95941957f7956e939aa3c8a68d8f9e12d77 100644 +--- a/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java ++++ b/src/main/java/com/destroystokyo/paper/gui/RAMGraph.java +@@ -1,15 +1,7 @@ + package com.destroystokyo.paper.gui; + +-import javax.swing.JComponent; +-import javax.swing.SwingUtilities; +-import javax.swing.Timer; +-import javax.swing.ToolTipManager; +-import java.awt.Color; +-import java.awt.Dimension; +-import java.awt.Graphics; +-import java.awt.MouseInfo; +-import java.awt.Point; +-import java.awt.PointerInfo; ++import javax.swing.*; ++import java.awt.*; + import java.awt.event.MouseAdapter; + import java.awt.event.MouseEvent; + import java.text.SimpleDateFormat; +diff --git a/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java +index 1917d7be7dfddc93c95b9fd864cf13f9a24c8f96..6962d0874d2b91ccec06f27acc2e99c822a86ac8 100644 +--- a/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java ++++ b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java +@@ -1,10 +1,6 @@ + package com.destroystokyo.paper.io; + +-import net.minecraft.server.ChunkCoordIntPair; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.RegionFile; +-import net.minecraft.server.WorldServer; ++import net.minecraft.server.*; + import org.apache.logging.log4j.Logger; + + import java.io.IOException; +diff --git a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java +index 6ccaf3491923f3092819f71c362045bba4952093..f4288b0ae09ca3a8bc8412093a73d01937ddb544 100644 +--- a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java ++++ b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java +@@ -5,7 +5,6 @@ import com.google.gson.JsonObject; + import com.mojang.datafixers.util.Pair; + import it.unimi.dsi.fastutil.longs.Long2IntMap; + import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; +-import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; + import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; + import net.minecraft.server.World; + +diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java +index 6367092663a213793367ccb65733afc119e4883c..7d697662b7777bfb200c0efb3f69b9c9cbc2b022 100644 +--- a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java ++++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java +@@ -1,8 +1,8 @@ + package com.destroystokyo.paper.io.chunk; + + import co.aikar.timings.Timing; +-import com.destroystokyo.paper.io.PaperFileIOThread; + import com.destroystokyo.paper.io.IOUtil; ++import com.destroystokyo.paper.io.PaperFileIOThread; + import net.minecraft.server.ChunkCoordIntPair; + import net.minecraft.server.ChunkRegionLoader; + import net.minecraft.server.PlayerChunkMap; +diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java +index 60312b85f9e7070378458f29afee0ebb7850d8a5..df83cd02ed3c47754063af86b2a214709b0373d0 100644 +--- a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java ++++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java +@@ -1,11 +1,10 @@ + package com.destroystokyo.paper.io.chunk; + + import co.aikar.timings.Timing; +-import com.destroystokyo.paper.io.PaperFileIOThread; + import com.destroystokyo.paper.io.IOUtil; ++import com.destroystokyo.paper.io.PaperFileIOThread; + import com.destroystokyo.paper.io.PrioritizedTaskQueue; + import net.minecraft.server.ChunkRegionLoader; +-import net.minecraft.server.IAsyncTaskHandler; + import net.minecraft.server.IChunkAccess; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.WorldServer; +diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java +index bcb7ce2692c5bc1a6214c3a384949666107864fb..815b630a01c91af0cb7738a0c4f9bb0604d94ecc 100644 +--- a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java ++++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java +@@ -1,19 +1,10 @@ + package com.destroystokyo.paper.io.chunk; + +-import com.destroystokyo.paper.io.PaperFileIOThread; + import com.destroystokyo.paper.io.IOUtil; ++import com.destroystokyo.paper.io.PaperFileIOThread; + import com.destroystokyo.paper.io.PrioritizedTaskQueue; + import com.destroystokyo.paper.io.QueueExecutorThread; +-import it.unimi.dsi.fastutil.longs.Long2ObjectMap; +-import net.minecraft.server.ChunkCoordIntPair; +-import net.minecraft.server.ChunkRegionLoader; +-import net.minecraft.server.ChunkStatus; +-import net.minecraft.server.IAsyncTaskHandler; +-import net.minecraft.server.IChunkAccess; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.PlayerChunk; +-import net.minecraft.server.WorldServer; ++import net.minecraft.server.*; + import org.apache.commons.lang.StringUtils; + import org.apache.logging.log4j.Level; + import org.bukkit.Bukkit; +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java +index b5401eaf974857455c17c3f9cfdedf2eb4bde321..faa835b79d4e668b973ccc2a543d7928f8db93ab 100644 +--- a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java +@@ -1,7 +1,9 @@ + package com.destroystokyo.paper.loottable; + + import com.destroystokyo.paper.PaperWorldConfig; +-import net.minecraft.server.*; ++import net.minecraft.server.EntityHuman; ++import net.minecraft.server.NBTTagCompound; ++import net.minecraft.server.NBTTagList; + import org.bukkit.entity.Player; + import org.bukkit.loot.LootTable; + +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java +index 8c1fa60a55570be91ab5ea63cb2005caa09e3600..2d7cd434374c904e6621110d617da5655002118a 100644 +--- a/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java +@@ -2,7 +2,6 @@ package com.destroystokyo.paper.loottable; + + import net.minecraft.server.Entity; + import net.minecraft.server.EntityMinecartContainer; +-import net.minecraft.server.MinecraftKey; + import net.minecraft.server.World; + import org.bukkit.Bukkit; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java +index a1923aff2b5e2e867670a5a064a767915fc1cc2a..f75042e7b7a00bd4da3c56c4ddf65d27fac2c119 100644 +--- a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java +@@ -1,7 +1,6 @@ + package com.destroystokyo.paper.loottable; + + import net.minecraft.server.MCUtil; +-import net.minecraft.server.MinecraftKey; + import net.minecraft.server.TileEntityLootable; + import net.minecraft.server.World; + import org.bukkit.Bukkit; +diff --git a/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java +index 74c012fd40491f1d870fbc1aa8c318a2197eb106..4306de5611c488fa7ac7f3ed5a68afcb628f60d8 100644 +--- a/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java ++++ b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java +@@ -5,9 +5,8 @@ import net.minecraft.server.MinecraftServer; + import org.apache.commons.lang3.StringUtils; + import org.bukkit.ChatColor; + +-import java.net.InetSocketAddress; +- + import javax.annotation.Nullable; ++import java.net.InetSocketAddress; + + public final class PaperLegacyStatusClient implements StatusClient { + +diff --git a/src/main/java/com/destroystokyo/paper/network/PaperNetworkClient.java b/src/main/java/com/destroystokyo/paper/network/PaperNetworkClient.java +index 5caca6439d2135e34880d501397fe2ea197d7249..2295f22d78971147443e8a7b8ecee64dfc7eb937 100644 +--- a/src/main/java/com/destroystokyo/paper/network/PaperNetworkClient.java ++++ b/src/main/java/com/destroystokyo/paper/network/PaperNetworkClient.java +@@ -2,9 +2,8 @@ package com.destroystokyo.paper.network; + + import net.minecraft.server.NetworkManager; + +-import java.net.InetSocketAddress; +- + import javax.annotation.Nullable; ++import java.net.InetSocketAddress; + + public class PaperNetworkClient implements NetworkClient { + +diff --git a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java +index 26ddf92f86fccc2b2562f7abf4788d1ed6b73205..dfec5882598f09492e9a17de25774a4c6c04da7a 100644 +--- a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java ++++ b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java +@@ -11,11 +11,10 @@ import net.minecraft.server.PacketStatusOutServerInfo; + import net.minecraft.server.ServerPing; + import org.bukkit.craftbukkit.util.CraftChatMessage; + ++import javax.annotation.Nonnull; + import java.util.List; + import java.util.UUID; + +-import javax.annotation.Nonnull; +- + public final class StandardPaperServerListPingEventImpl extends PaperServerListPingEventImpl { + + private static final GameProfile[] EMPTY_PROFILES = new GameProfile[0]; +diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +index 0c5f2a010f30eb32bea273d7e65b0741016480e5..1152644a390decd48395f6b2e60887aafaf66ac4 100644 +--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java ++++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +@@ -5,24 +5,17 @@ import com.google.common.base.Charsets; + import com.mojang.authlib.GameProfile; + import com.mojang.authlib.properties.Property; + import com.mojang.authlib.properties.PropertyMap; +- + import dev.tr7zw.yatopia.events.GameProfileLookupEvent; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.UserCache; + import org.apache.commons.lang3.Validate; +- + import org.bukkit.Bukkit; + import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.spigotmc.SpigotConfig; + + import javax.annotation.Nonnull; + import javax.annotation.Nullable; +-import java.util.AbstractSet; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.Objects; +-import java.util.Set; +-import java.util.UUID; ++import java.util.*; + + public class CraftPlayerProfile implements PlayerProfile { + +diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java +index 5c7d2ee19243d0911a3a00af3ae42078a2ccba94..f3c8fc22bd1bfce1d40608de17dafc854c907171 100644 +--- a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java ++++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java +@@ -1,8 +1,8 @@ + package com.destroystokyo.paper.profile; + +-import com.mojang.authlib.Environment; + import com.destroystokyo.paper.event.profile.FillProfileEvent; + import com.destroystokyo.paper.event.profile.PreFillProfileEvent; ++import com.mojang.authlib.Environment; + import com.mojang.authlib.GameProfile; + import com.mojang.authlib.minecraft.MinecraftProfileTexture; + import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +diff --git a/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java +index fdd8708f974700c7cde6e436c2f189d94d336f1f..2f6d79f8ce9e3392b98286b9568bcda4bc7d88aa 100644 +--- a/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java ++++ b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java +@@ -7,14 +7,13 @@ import com.mojang.authlib.properties.Property; + import net.minecraft.server.MinecraftKey; + import net.minecraft.server.PacketDataSerializer; + ++import javax.crypto.Mac; ++import javax.crypto.spec.SecretKeySpec; + import java.net.InetAddress; + import java.security.InvalidKeyException; + import java.security.MessageDigest; + import java.security.NoSuchAlgorithmException; + +-import javax.crypto.Mac; +-import javax.crypto.spec.SecretKeySpec; +- + public class VelocityProxy { + private static final int SUPPORTED_FORWARDING_VERSION = 1; + public static final MinecraftKey PLAYER_INFO_CHANNEL = new MinecraftKey("velocity", "player_info"); +diff --git a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java +index 253b73cfc597d4c7106d969be7b18c68166128ae..62403feec70ca2aedcd0928bd22b8d05d08b2d7e 100644 +--- a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java ++++ b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java +@@ -1,30 +1,11 @@ + package com.destroystokyo.paper.server.ticklist; + +-import net.minecraft.server.MCUtil; +-import net.minecraft.server.MinecraftServer; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; + import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.ChunkCoordIntPair; +-import net.minecraft.server.ChunkProviderServer; +-import net.minecraft.server.CrashReport; +-import net.minecraft.server.CrashReportSystemDetails; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.NBTTagList; +-import net.minecraft.server.NextTickListEntry; +-import net.minecraft.server.ReportedException; +-import net.minecraft.server.StructureBoundingBox; +-import net.minecraft.server.TickListPriority; +-import net.minecraft.server.TickListServer; +-import net.minecraft.server.WorldServer; +-import java.util.ArrayDeque; +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.Comparator; +-import java.util.Iterator; +-import java.util.List; ++import net.minecraft.server.*; ++ ++import java.util.*; + import java.util.function.Consumer; + import java.util.function.Function; + import java.util.function.Predicate; +diff --git a/src/main/java/com/destroystokyo/paper/server/ticklist/TickListServerInterval.java b/src/main/java/com/destroystokyo/paper/server/ticklist/TickListServerInterval.java +index 13cf1a55a9babbffccbca1acfbe1c496e8925521..ffba88a3dbf78052e4b9314fae8c67d07bd55b9f 100644 +--- a/src/main/java/com/destroystokyo/paper/server/ticklist/TickListServerInterval.java ++++ b/src/main/java/com/destroystokyo/paper/server/ticklist/TickListServerInterval.java +@@ -3,6 +3,7 @@ package com.destroystokyo.paper.server.ticklist; + import com.destroystokyo.paper.util.set.LinkedSortedSet; + import net.minecraft.server.NextTickListEntry; + import net.minecraft.server.TickListPriority; ++ + import java.util.Comparator; + + // represents a set of entries to tick at a specified time +diff --git a/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java b/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java +index 9ebd7ecb7a0ac73ccacf34c097056598bb5d26e8..bb1e0b6c8d98a221a2f60cba454f9d5fe81c39ab 100644 +--- a/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java ++++ b/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java +@@ -7,10 +7,10 @@ import net.minecraft.server.ChunkCoordIntPair; + import net.minecraft.server.EntityPlayer; + import net.minecraft.server.SectionPosition; + import org.spigotmc.AsyncCatcher; ++ + import java.util.HashMap; + import java.util.List; + import java.util.Map; +-import java.util.Set; + + /** @author Spottedleaf */ + public final class PlayerMobDistanceMap { +diff --git a/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java b/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java +index 4f13d3ff8391793a99f067189f854078334499c6..132f8d476620e03388f4f2d9e31cf0d9d0d77ac0 100644 +--- a/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java ++++ b/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java +@@ -2,6 +2,7 @@ package com.destroystokyo.paper.util; + + import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; + import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; ++ + import java.lang.ref.WeakReference; + import java.util.Iterator; + +diff --git a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java +index b69803cbf2db2781aa050b145bf88468254880ae..9989cf178c781b3a8651b828870b3983018e2251 100644 +--- a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java ++++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java +@@ -1,21 +1,13 @@ + package com.destroystokyo.paper.util; + +-import java.util.List; +-import java.util.Map; +-import java.util.concurrent.ThreadLocalRandom; +- +-import org.bukkit.event.block.BlockRedstoneEvent; +- + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; ++import net.minecraft.server.*; ++import org.bukkit.event.block.BlockRedstoneEvent; + +-import net.minecraft.server.Block; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.BlockRedstoneWire; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.Items; +-import net.minecraft.server.ItemStack; +-import net.minecraft.server.World; ++import java.util.List; ++import java.util.Map; ++import java.util.concurrent.ThreadLocalRandom; + + /** + * Used for the faster redstone algorithm. +diff --git a/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java b/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java +index 7bab31a312463cc963d9621cdc543a281459bd32..f6b1059a67d48a8326dfd3b84016610873dc1b49 100644 +--- a/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java ++++ b/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java +@@ -4,6 +4,7 @@ import com.destroystokyo.paper.util.concurrent.WeakSeqLock; + import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap; + import it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator; ++ + import java.util.ArrayList; + import java.util.Collection; + import java.util.List; +diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java b/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java +index 4eac0577862450e0e3299f5579f9ff6759b0256d..98d958544c03c35b8a9388a23c67ab695ef4a90a 100644 +--- a/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java ++++ b/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java +@@ -2,7 +2,7 @@ package com.destroystokyo.paper.util.maplist; + + import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; + import net.minecraft.server.Chunk; +-import net.minecraft.server.MCUtil; ++ + import java.util.Arrays; + import java.util.Iterator; + import java.util.NoSuchElementException; +diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java +index cdda74564ced196ae577a64782236c2bfe36e433..66f84c6ab08221b8db3be382df4372301c9bd8e9 100644 +--- a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java ++++ b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java +@@ -2,6 +2,7 @@ package com.destroystokyo.paper.util.maplist; + + import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; + import net.minecraft.server.Entity; ++ + import java.util.Arrays; + import java.util.Iterator; + import java.util.NoSuchElementException; +diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java +index 84ef8d9ecab4745a90504718f803110b9e2dbf65..79da166d52ccc9eaf557592178d3a2d150730e8f 100644 +--- a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java ++++ b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java +@@ -5,6 +5,7 @@ import it.unimi.dsi.fastutil.shorts.Short2LongOpenHashMap; + import net.minecraft.server.ChunkSection; + import net.minecraft.server.DataPaletteGlobal; + import net.minecraft.server.IBlockData; ++ + import java.util.Arrays; + + /** +diff --git a/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java +index 1330df2c1d3c4f52dad0adeb169409eb412814ab..53e14a76629bc349a93adb558d6c8818f574c7d4 100644 +--- a/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java ++++ b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java +@@ -8,6 +8,7 @@ import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap; + import net.minecraft.server.ChunkCoordIntPair; + import net.minecraft.server.MCUtil; + import net.minecraft.server.MinecraftServer; ++ + import javax.annotation.Nullable; + import java.util.Iterator; + +diff --git a/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java b/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java +index e51104e65a07b6ea7bbbcbb6afb066ef6401cc5b..3a317dbd9ff86c943ab97116f3e9c05b445a61b0 100644 +--- a/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java ++++ b/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java +@@ -2,6 +2,7 @@ package com.destroystokyo.paper.util.misc; + + import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; + import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; ++ + import java.lang.ref.WeakReference; + + /** @author Spottedleaf */ +diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +index 8e182fdd69dba6e1c52e2f6a893534d77fb3bfaa..cfddb85b5321e0fe5808e9bf52c9f8981983d443 100644 +--- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java ++++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +@@ -3,12 +3,7 @@ package com.mojang.authlib.yggdrasil; + import com.google.common.base.Strings; + import com.google.common.collect.Iterables; + import com.google.common.collect.Sets; +-import com.mojang.authlib.Agent; +-import com.mojang.authlib.Environment; +-import com.mojang.authlib.GameProfile; +-import com.mojang.authlib.GameProfileRepository; +-import com.mojang.authlib.HttpAuthenticationService; +-import com.mojang.authlib.ProfileLookupCallback; ++import com.mojang.authlib.*; + import com.mojang.authlib.exceptions.AuthenticationException; + import com.mojang.authlib.yggdrasil.response.ProfileSearchResultsResponse; + import org.apache.logging.log4j.LogManager; +diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java +index ca0d664487a65a4768f0e65af6a320fd1875de8f..debd9ee0ec1af6481dbe7d0e732c7b2c8cc979ac 100644 +--- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java ++++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java +@@ -1,6 +1,7 @@ + package com.mojang.brigadier.tree; + + // CHECKSTYLE:OFF ++ + import com.google.common.collect.ComparisonChain; + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; +@@ -14,17 +15,14 @@ import com.mojang.brigadier.context.CommandContextBuilder; + import com.mojang.brigadier.exceptions.CommandSyntaxException; + import com.mojang.brigadier.suggestion.Suggestions; + import com.mojang.brigadier.suggestion.SuggestionsBuilder; ++import net.minecraft.server.CommandListenerWrapper; + + import java.util.Collection; + import java.util.Collections; +-import java.util.LinkedHashMap; + import java.util.Map; + import java.util.Set; + import java.util.concurrent.CompletableFuture; + import java.util.function.Predicate; +-import java.util.stream.Collectors; +- +-import net.minecraft.server.CommandListenerWrapper; // CraftBukkit + + public abstract class CommandNode implements Comparable> { + private Map> children = Maps.newTreeMap(); //Paper - Switch to tree map for automatic sorting +diff --git a/src/main/java/com/mojang/datafixers/util/Either.java b/src/main/java/com/mojang/datafixers/util/Either.java +index 3f65fe71024928e35111fc6719a290aab9a6859e..9f4f02d96b872d49237ddd062d902b9928de1fc9 100644 +--- a/src/main/java/com/mojang/datafixers/util/Either.java ++++ b/src/main/java/com/mojang/datafixers/util/Either.java +@@ -2,11 +2,7 @@ + // Licensed under the MIT license. + package com.mojang.datafixers.util; + +-import com.mojang.datafixers.kinds.App; +-import com.mojang.datafixers.kinds.Applicative; +-import com.mojang.datafixers.kinds.CocartesianLike; +-import com.mojang.datafixers.kinds.K1; +-import com.mojang.datafixers.kinds.Traversable; ++import com.mojang.datafixers.kinds.*; + + import java.util.Objects; + import java.util.Optional; +diff --git a/src/main/java/com/proximyst/rainforest/RainforestCommand.java b/src/main/java/com/proximyst/rainforest/RainforestCommand.java +index 9e26fa3bff387e362a6748266df8742cf5682af6..86550dfcc77dce295ecdffee6f83e9eb697fdf3b 100644 +--- a/src/main/java/com/proximyst/rainforest/RainforestCommand.java ++++ b/src/main/java/com/proximyst/rainforest/RainforestCommand.java +@@ -1,10 +1,6 @@ + package com.proximyst.rainforest; + + import com.destroystokyo.paper.PaperCommand; +-import java.io.File; +-import java.util.Collections; +-import java.util.List; +-import java.util.Locale; + import net.md_5.bungee.api.ChatColor; + import net.md_5.bungee.api.chat.ComponentBuilder; + import net.minecraft.server.MinecraftServer; +@@ -13,6 +9,11 @@ import org.bukkit.Location; + import org.bukkit.command.Command; + import org.bukkit.command.CommandSender; + ++import java.io.File; ++import java.util.Collections; ++import java.util.List; ++import java.util.Locale; ++ + public class RainforestCommand extends Command { + public RainforestCommand(String name) { + super(name); +diff --git a/src/main/java/com/proximyst/rainforest/RainforestConfig.java b/src/main/java/com/proximyst/rainforest/RainforestConfig.java +index 04f5751f7972ed04f97c3f911277a30f14344801..5855bb241841ea1295cf97dac97413213442550a 100644 +--- a/src/main/java/com/proximyst/rainforest/RainforestConfig.java ++++ b/src/main/java/com/proximyst/rainforest/RainforestConfig.java +@@ -1,24 +1,22 @@ + package com.proximyst.rainforest; + + import com.google.common.base.Throwables; ++import dev.tr7zw.yatopia.YatopiaConfig; ++import net.minecraft.server.MinecraftServer; ++import org.bukkit.Bukkit; ++import org.bukkit.command.Command; ++import org.bukkit.configuration.file.YamlConfiguration; ++ + import java.io.File; + import java.io.IOException; + import java.lang.reflect.InvocationTargetException; + import java.lang.reflect.Method; + import java.lang.reflect.Modifier; +-import java.util.HashMap; + import java.util.List; + import java.util.Map; + import java.util.concurrent.TimeUnit; + import java.util.logging.Level; + import java.util.regex.Pattern; +-import net.minecraft.server.MinecraftServer; +-import org.bukkit.Bukkit; +-import org.bukkit.command.Command; +-import org.bukkit.configuration.InvalidConfigurationException; +-import org.bukkit.configuration.file.YamlConfiguration; +- +-import dev.tr7zw.yatopia.YatopiaConfig; + + // Based on PaperConfig + public final class RainforestConfig { +diff --git a/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java b/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java +index 22d920686418e86aec8be37f125123682af023a3..9a9fe8f4e440b7bc66fd19a4915fc4360146c225 100644 +--- a/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java ++++ b/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java +@@ -1,11 +1,12 @@ + package com.proximyst.rainforest; + +-import static com.proximyst.rainforest.RainforestConfig.log; +- + import com.destroystokyo.paper.PaperWorldConfig; +-import java.util.List; + import org.bukkit.configuration.file.YamlConfiguration; + ++import java.util.List; ++ ++import static com.proximyst.rainforest.RainforestConfig.log; ++ + // Based on PaperWorldConfig + public final class RainforestWorldConfig { + private final String worldName; +diff --git a/src/main/java/com/tuinity/tuinity/chunk/SingleThreadChunkRegionManager.java b/src/main/java/com/tuinity/tuinity/chunk/SingleThreadChunkRegionManager.java +index f599725e17d2ec6020e9fff0ec55f4d14a5c0844..5fb61b126428a12166bc3453a83a802093e1f43a 100644 +--- a/src/main/java/com/tuinity/tuinity/chunk/SingleThreadChunkRegionManager.java ++++ b/src/main/java/com/tuinity/tuinity/chunk/SingleThreadChunkRegionManager.java +@@ -2,13 +2,13 @@ package com.tuinity.tuinity.chunk; + + import co.aikar.timings.MinecraftTimings; + import co.aikar.timings.Timing; +-import com.google.common.collect.Iterators; + import com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet; + import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; + import it.unimi.dsi.fastutil.objects.ReferenceLinkedOpenHashSet; + import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; + import net.minecraft.server.MCUtil; + import net.minecraft.server.WorldServer; ++ + import java.util.ArrayList; + import java.util.EnumMap; + import java.util.Iterator; +diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +index 1c7b858ed53f853541724e8d3fdae4e0e82e5d4f..26959488c92193c30fa9992a705e61103ccfd322 100644 +--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java ++++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +@@ -5,10 +5,10 @@ import net.minecraft.server.TicketType; + import org.bukkit.Bukkit; + import org.bukkit.configuration.ConfigurationSection; + import org.bukkit.configuration.file.YamlConfiguration; ++ + import java.io.File; + import java.lang.reflect.Method; + import java.lang.reflect.Modifier; +-import java.util.List; + import java.util.logging.Level; + + public final class TuinityConfig { +diff --git a/src/main/java/com/tuinity/tuinity/util/CachedLists.java b/src/main/java/com/tuinity/tuinity/util/CachedLists.java +index a54f516ba72806c0470259436f889faa8f6e7586..59e0dcac498a6ca1f761aa00cf5fbb660a454a33 100644 +--- a/src/main/java/com/tuinity/tuinity/util/CachedLists.java ++++ b/src/main/java/com/tuinity/tuinity/util/CachedLists.java +@@ -4,6 +4,7 @@ import net.minecraft.server.AxisAlignedBB; + import net.minecraft.server.Entity; + import org.bukkit.Bukkit; + import org.bukkit.craftbukkit.util.UnsafeList; ++ + import java.util.List; + + public class CachedLists { +diff --git a/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java b/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java +index b0f1e21e6e34f2a339fdec5f0f951a103599ac2d..f4aba8398bdf49a94061955821e8562fe60c4564 100644 +--- a/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java ++++ b/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java +@@ -3,6 +3,7 @@ package com.tuinity.tuinity.util.maplist; + import it.unimi.dsi.fastutil.objects.Reference2IntLinkedOpenHashMap; + import it.unimi.dsi.fastutil.objects.Reference2IntMap; + import it.unimi.dsi.fastutil.objects.ReferenceLinkedOpenHashSet; ++ + import java.util.Arrays; + import java.util.NoSuchElementException; + +diff --git a/src/main/java/com/tuinity/tuinity/voxel/AABBVoxelShape.java b/src/main/java/com/tuinity/tuinity/voxel/AABBVoxelShape.java +index 76593df295e5f462adcbc223d791316a849fffeb..2fb99e8626b962184854c2850d0507f7606617a5 100644 +--- a/src/main/java/com/tuinity/tuinity/voxel/AABBVoxelShape.java ++++ b/src/main/java/com/tuinity/tuinity/voxel/AABBVoxelShape.java +@@ -6,6 +6,7 @@ import net.minecraft.server.AxisAlignedBB; + import net.minecraft.server.EnumDirection; + import net.minecraft.server.VoxelShape; + import net.minecraft.server.VoxelShapes; ++ + import java.util.ArrayList; + import java.util.List; + +diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java +index 1c1d624065162ef5b97ed5ff3d0a24b73975ed2e..d022cf1498ed371eaad779b849aac4bc1065f7a8 100644 +--- a/src/main/java/de/minebench/origami/OrigamiConfig.java ++++ b/src/main/java/de/minebench/origami/OrigamiConfig.java +@@ -1,14 +1,11 @@ + package de.minebench.origami; + +-import org.bukkit.Bukkit; +-import org.bukkit.configuration.file.YamlConfiguration; +- + import dev.tr7zw.yatopia.YatopiaConfig; ++import org.bukkit.configuration.file.YamlConfiguration; + + import java.io.File; + import java.lang.reflect.Method; + import java.lang.reflect.Modifier; +-import java.util.logging.Level; + + public final class OrigamiConfig { + +diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java b/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java +index 1e88bc1a89eada5008ffe88f7ed32e107b2fb10c..c58ab7f9030bb2a3f6af3a7f327a5e7654972c9f 100644 +--- a/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java ++++ b/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java +@@ -1,26 +1,18 @@ + package dev.tr7zw.yatopia; + +-import java.io.File; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Locale; +- ++import com.google.common.base.Functions; ++import com.google.common.collect.Iterables; ++import com.google.common.collect.Lists; ++import net.minecraft.server.MinecraftKey; ++import net.minecraft.server.MinecraftServer; + import org.bukkit.Bukkit; + import org.bukkit.ChatColor; + import org.bukkit.Location; + import org.bukkit.command.Command; + import org.bukkit.command.CommandSender; + +-import com.google.common.base.Functions; +-import com.google.common.collect.Iterables; +-import com.google.common.collect.Lists; +- +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.MinecraftServer; ++import java.io.File; ++import java.util.*; + + public class YatopiaCommand extends Command { + +diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java +index 40f0bc601f0d11b0bfb15162fce17aaa70991f14..55282c0eab3d60b7c83c5772ba266b697248c711 100644 +--- a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java ++++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java +@@ -1,36 +1,24 @@ + package dev.tr7zw.yatopia; + +-import com.destroystokyo.paper.io.chunk.ChunkTaskManager; +-import com.google.common.base.Strings; + import com.google.common.base.Throwables; ++import net.minecraft.server.MinecraftServer; ++import org.bukkit.Bukkit; ++import org.bukkit.command.Command; ++import org.bukkit.configuration.InvalidConfigurationException; ++import org.bukkit.configuration.file.YamlConfiguration; + + import java.io.File; + import java.io.IOException; + import java.lang.reflect.InvocationTargetException; + import java.lang.reflect.Method; + import java.lang.reflect.Modifier; +-import java.nio.charset.StandardCharsets; + import java.util.HashMap; + import java.util.List; + import java.util.Map; +-import java.util.Set; + import java.util.concurrent.TimeUnit; + import java.util.logging.Level; + import java.util.regex.Pattern; + +-import com.google.common.collect.Lists; +-import net.minecraft.server.MinecraftServer; +-import org.bukkit.Bukkit; +-import org.bukkit.ChatColor; +-import org.bukkit.command.Command; +-import org.bukkit.configuration.ConfigurationSection; +-import org.bukkit.configuration.InvalidConfigurationException; +-import org.bukkit.configuration.file.YamlConfiguration; +-import co.aikar.timings.Timings; +-import co.aikar.timings.TimingsManager; +-import org.spigotmc.SpigotConfig; +-import org.spigotmc.WatchdogThread; +- + public class YatopiaConfig { + + public static File CONFIG_FILE; +diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaVersionFetcher.java b/src/main/java/dev/tr7zw/yatopia/YatopiaVersionFetcher.java +index 523e3b50d535e91afe8b14fdb53966da030963dc..a2c92daeab053dd3785b8389a101c21fcfb73eef 100644 +--- a/src/main/java/dev/tr7zw/yatopia/YatopiaVersionFetcher.java ++++ b/src/main/java/dev/tr7zw/yatopia/YatopiaVersionFetcher.java +@@ -1,9 +1,9 @@ + package dev.tr7zw.yatopia; + +-import javax.annotation.Nonnull; +- + import com.destroystokyo.paper.util.VersionFetcher; + ++import javax.annotation.Nonnull; ++ + public class YatopiaVersionFetcher implements VersionFetcher { + + @Override +diff --git a/src/main/java/me/jellysquid/mods/lithium/common/world/noise/SimplexNoiseCache.java b/src/main/java/me/jellysquid/mods/lithium/common/world/noise/SimplexNoiseCache.java +index 167498cfab7aed0deb32232082ae06a123b7a039..a28486e5ad4a86bd02219f1db696d8049b6955bf 100644 +--- a/src/main/java/me/jellysquid/mods/lithium/common/world/noise/SimplexNoiseCache.java ++++ b/src/main/java/me/jellysquid/mods/lithium/common/world/noise/SimplexNoiseCache.java +@@ -1,12 +1,12 @@ + package me.jellysquid.mods.lithium.common.world.noise; + +-import java.util.Arrays; +- + import it.unimi.dsi.fastutil.HashCommon; + import net.minecraft.server.ChunkCoordIntPair; + import net.minecraft.server.MathHelper; + import net.minecraft.server.NoiseGenerator3Handler; + ++import java.util.Arrays; ++ + /** + * A cache for the End's noise generator that caches computed values. Through the caching, we can eliminate a large + * amount of overhead in computing the noise values several hundred thousand times per chunk. This code uses the same +diff --git a/src/main/java/net/minecraft/server/Advancement.java b/src/main/java/net/minecraft/server/Advancement.java +index 315a03cf5e64264523ce95ce7b9ffe7c450e1e5b..9f48cfb84cd3fccc408d908db37d27f1bad6368d 100644 +--- a/src/main/java/net/minecraft/server/Advancement.java ++++ b/src/main/java/net/minecraft/server/Advancement.java +@@ -6,6 +6,9 @@ import com.google.common.collect.Sets; + import com.google.gson.JsonArray; + import com.google.gson.JsonObject; + import com.google.gson.JsonSyntaxException; ++import org.apache.commons.lang3.ArrayUtils; ++ ++import javax.annotation.Nullable; + import java.util.Arrays; + import java.util.Iterator; + import java.util.Map; +@@ -13,8 +16,6 @@ import java.util.Map.Entry; + import java.util.Set; + import java.util.function.Consumer; + import java.util.function.Function; +-import javax.annotation.Nullable; +-import org.apache.commons.lang3.ArrayUtils; + + public class Advancement { + +diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +index 5442c28c56f933c63bd611f579d0392876ecc2ef..2a2b7a1d6a2813740cc9aae6bc911cea659543e6 100644 +--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java ++++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +@@ -15,25 +15,18 @@ import com.google.gson.stream.JsonReader; + import com.mojang.datafixers.DataFixer; + import com.mojang.serialization.Dynamic; + import com.mojang.serialization.JsonOps; +-import java.io.File; +-import java.io.FileOutputStream; +-import java.io.IOException; +-import java.io.OutputStreamWriter; +-import java.io.StringReader; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; ++import java.io.*; + import java.nio.charset.StandardCharsets; +-import java.util.Comparator; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; ++import java.util.*; + import java.util.Map.Entry; +-import java.util.Set; + import java.util.concurrent.ExecutorService; + import java.util.concurrent.Executors; + import java.util.stream.Collectors; + import java.util.stream.Stream; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class AdvancementDataPlayer { + +diff --git a/src/main/java/net/minecraft/server/AdvancementDataWorld.java b/src/main/java/net/minecraft/server/AdvancementDataWorld.java +index a70e42f2d5055fde4b39f990f76f5e89ef707d4c..e1192141d802509ace1fc2c7d11a3c24a0c36e37 100644 +--- a/src/main/java/net/minecraft/server/AdvancementDataWorld.java ++++ b/src/main/java/net/minecraft/server/AdvancementDataWorld.java +@@ -1,19 +1,16 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; +-import com.google.gson.Gson; +-import com.google.gson.GsonBuilder; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; +-import com.google.gson.JsonParseException; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.Map; +-import javax.annotation.Nullable; ++import com.google.gson.*; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + import org.spigotmc.SpigotConfig; + ++import javax.annotation.Nullable; ++import java.util.Collection; ++import java.util.Iterator; ++import java.util.Map; ++ + public class AdvancementDataWorld extends ResourceDataJson { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/Advancements.java b/src/main/java/net/minecraft/server/Advancements.java +index 2fed42a5aec165a67a1480e822376e66244c31c8..b1adbc542936a6d30759123d72e23eabb39fb48c 100644 +--- a/src/main/java/net/minecraft/server/Advancements.java ++++ b/src/main/java/net/minecraft/server/Advancements.java +@@ -4,14 +4,15 @@ import com.google.common.base.Function; + import com.google.common.base.Functions; + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.util.Collection; + import java.util.Iterator; + import java.util.Map; + import java.util.Map.Entry; + import java.util.Set; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class Advancements { + +diff --git a/src/main/java/net/minecraft/server/ArgumentBlock.java b/src/main/java/net/minecraft/server/ArgumentBlock.java +index e1894fe66911adb991989ff5322d2a9e9446fce7..9bd7ded6e5682991ba62e10d54f9f0d2b21e7279 100644 +--- a/src/main/java/net/minecraft/server/ArgumentBlock.java ++++ b/src/main/java/net/minecraft/server/ArgumentBlock.java +@@ -3,13 +3,11 @@ package net.minecraft.server; + import com.google.common.collect.Maps; + import com.google.common.collect.UnmodifiableIterator; + import com.mojang.brigadier.StringReader; +-import com.mojang.brigadier.exceptions.CommandSyntaxException; +-import com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType; +-import com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType; +-import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; +-import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; ++import com.mojang.brigadier.exceptions.*; + import com.mojang.brigadier.suggestion.Suggestions; + import com.mojang.brigadier.suggestion.SuggestionsBuilder; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Locale; + import java.util.Map; +@@ -17,7 +15,6 @@ import java.util.Map.Entry; + import java.util.Optional; + import java.util.concurrent.CompletableFuture; + import java.util.function.BiFunction; +-import javax.annotation.Nullable; + + public class ArgumentBlock { + +diff --git a/src/main/java/net/minecraft/server/ArgumentEntity.java b/src/main/java/net/minecraft/server/ArgumentEntity.java +index 1194f91a51f87bc461af039fe0819aaf3e5c8bdd..af275a63b2ba583f6a07d606a1b66fca409efd61 100644 +--- a/src/main/java/net/minecraft/server/ArgumentEntity.java ++++ b/src/main/java/net/minecraft/server/ArgumentEntity.java +@@ -9,6 +9,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; + import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; + import com.mojang.brigadier.suggestion.Suggestions; + import com.mojang.brigadier.suggestion.SuggestionsBuilder; ++ + import java.util.Arrays; + import java.util.Collection; + import java.util.List; +diff --git a/src/main/java/net/minecraft/server/ArgumentParserSelector.java b/src/main/java/net/minecraft/server/ArgumentParserSelector.java +index 0b222c8be84d28280a08c79b98484220a8727f7d..f1c630da24dfad324bb439e647948434f0c61e39 100644 +--- a/src/main/java/net/minecraft/server/ArgumentParserSelector.java ++++ b/src/main/java/net/minecraft/server/ArgumentParserSelector.java +@@ -7,17 +7,13 @@ import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; + import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; + import com.mojang.brigadier.suggestion.Suggestions; + import com.mojang.brigadier.suggestion.SuggestionsBuilder; ++ ++import javax.annotation.Nullable; + import java.util.Collections; + import java.util.List; + import java.util.UUID; + import java.util.concurrent.CompletableFuture; +-import java.util.function.BiConsumer; +-import java.util.function.BiFunction; +-import java.util.function.Consumer; +-import java.util.function.Function; +-import java.util.function.Predicate; +-import java.util.function.ToDoubleFunction; +-import javax.annotation.Nullable; ++import java.util.function.*; + + public class ArgumentParserSelector { + +diff --git a/src/main/java/net/minecraft/server/ArraySetSorted.java b/src/main/java/net/minecraft/server/ArraySetSorted.java +index 7db6b5850b91588eb4d91f0d7e8b5dbbcb95b7cb..1a099dcdda23f9f64316e9f3a986ba1e93360deb 100644 +--- a/src/main/java/net/minecraft/server/ArraySetSorted.java ++++ b/src/main/java/net/minecraft/server/ArraySetSorted.java +@@ -1,11 +1,8 @@ + package net.minecraft.server; + + import it.unimi.dsi.fastutil.objects.ObjectArrays; +-import java.util.AbstractSet; +-import java.util.Arrays; +-import java.util.Comparator; +-import java.util.Iterator; +-import java.util.NoSuchElementException; ++ ++import java.util.*; + + public class ArraySetSorted extends AbstractSet { + +diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java +index 661331bc005ba1c6ba6c6a4df22e0205bfd2b660..7b391d5694e6531adabb0a843e4563ad045bb64c 100644 +--- a/src/main/java/net/minecraft/server/AxisAlignedBB.java ++++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Optional; +-import javax.annotation.Nullable; + + public class AxisAlignedBB { + +diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java +index e69b7dbc7a954374f9e2374ffe7faebfed2b0644..e4b62eab1262f035395366cc5a5d0893975596d6 100644 +--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java ++++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java +@@ -2,8 +2,9 @@ package net.minecraft.server; + + import com.google.common.base.MoreObjects; + import com.mojang.serialization.Codec; +-import java.util.stream.IntStream; ++ + import javax.annotation.concurrent.Immutable; ++import java.util.stream.IntStream; + + @Immutable + public class BaseBlockPosition implements Comparable { +diff --git a/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java b/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java +index 51203fd30bfee57ef8d52d0360a64a7e1d6c65a3..0b8fa6dafa6e8cab5cb5bfdb657b3e8d92285450 100644 +--- a/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java ++++ b/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java +@@ -1,12 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; +-import java.util.Optional; +-import java.util.function.Predicate; +-// CraftBukkit start +-import org.bukkit.craftbukkit.entity.CraftLivingEntity; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.EntityTargetEvent; ++ ++import java.util.Optional; ++import java.util.function.Predicate; + // CraftBukkit end + + public class BehaviorAttackTargetForget extends Behavior { +diff --git a/src/main/java/net/minecraft/server/BehaviorAttackTargetSet.java b/src/main/java/net/minecraft/server/BehaviorAttackTargetSet.java +index f75b17e7174888cec8d9e1b6adc760c715e25a05..c6fbe5c1f6c627c1fe6da557fd1b21504893035e 100644 +--- a/src/main/java/net/minecraft/server/BehaviorAttackTargetSet.java ++++ b/src/main/java/net/minecraft/server/BehaviorAttackTargetSet.java +@@ -1,13 +1,13 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; +-import java.util.Optional; +-import java.util.function.Function; +-import java.util.function.Predicate; +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftLivingEntity; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.EntityTargetEvent; ++ ++import java.util.Optional; ++import java.util.function.Function; ++import java.util.function.Predicate; + // CraftBukkit end + + public class BehaviorAttackTargetSet extends Behavior { +diff --git a/src/main/java/net/minecraft/server/BehaviorCareer.java b/src/main/java/net/minecraft/server/BehaviorCareer.java +index 2bc482b2bfcfa0b5188d7edad9896536f3e0e91f..cee88035cc54a50da7a586cbdb7dfd62595716ec 100644 +--- a/src/main/java/net/minecraft/server/BehaviorCareer.java ++++ b/src/main/java/net/minecraft/server/BehaviorCareer.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; +-import java.util.Optional; +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftVillager; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.VillagerCareerChangeEvent; ++ ++import java.util.Optional; + // CraftBukkit end + + public class BehaviorCareer extends Behavior { +diff --git a/src/main/java/net/minecraft/server/BehaviorFarm.java b/src/main/java/net/minecraft/server/BehaviorFarm.java +index 54a555509e3d83e9749609dc35897ad151bca681..9f2350c5b20f9e611c1ccadc01b7acb6815880bc 100644 +--- a/src/main/java/net/minecraft/server/BehaviorFarm.java ++++ b/src/main/java/net/minecraft/server/BehaviorFarm.java +@@ -2,8 +2,9 @@ package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Lists; +-import java.util.List; ++ + import javax.annotation.Nullable; ++import java.util.List; + + public class BehaviorFarm extends Behavior { + +diff --git a/src/main/java/net/minecraft/server/BehaviorGate.java b/src/main/java/net/minecraft/server/BehaviorGate.java +index 46e910581210421c8699637431804dc2f43eb4a6..f6e60fc77cfe40dd3824abb9aaa4d8e76d8edd97 100644 +--- a/src/main/java/net/minecraft/server/BehaviorGate.java ++++ b/src/main/java/net/minecraft/server/BehaviorGate.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.mojang.datafixers.util.Pair; ++ + import java.util.List; + import java.util.Map; + import java.util.Set; +diff --git a/src/main/java/net/minecraft/server/BehaviorMakeLove.java b/src/main/java/net/minecraft/server/BehaviorMakeLove.java +index d9a4d88408eb522fe1463c5adf105b002d14bb49..498a4fca2b21e04dc329a74d85a6dce9a4e4937f 100644 +--- a/src/main/java/net/minecraft/server/BehaviorMakeLove.java ++++ b/src/main/java/net/minecraft/server/BehaviorMakeLove.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; ++ + import java.util.Optional; + + public class BehaviorMakeLove extends Behavior { +diff --git a/src/main/java/net/minecraft/server/BehaviorProfession.java b/src/main/java/net/minecraft/server/BehaviorProfession.java +index f502b5b71d35cb755a8f13b81c0c33551e291225..35258f55f26a960b1cd1b4a53cacfebba99c5c8e 100644 +--- a/src/main/java/net/minecraft/server/BehaviorProfession.java ++++ b/src/main/java/net/minecraft/server/BehaviorProfession.java +@@ -1,7 +1,6 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftVillager; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.VillagerCareerChangeEvent; +diff --git a/src/main/java/net/minecraft/server/BehaviorSleep.java b/src/main/java/net/minecraft/server/BehaviorSleep.java +index 615a06497588e07fa2b71194a5836ef6360bf0ca..d219c4fcdcff31aa1dc2d471262d7fafe4cd5b5e 100644 +--- a/src/main/java/net/minecraft/server/BehaviorSleep.java ++++ b/src/main/java/net/minecraft/server/BehaviorSleep.java +@@ -2,6 +2,7 @@ package net.minecraft.server; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; ++ + import java.util.List; + import java.util.Optional; + +diff --git a/src/main/java/net/minecraft/server/BehaviorWork.java b/src/main/java/net/minecraft/server/BehaviorWork.java +index 3418d5463192d5f2763ad5dad9442e66827cbdf7..de2a448764e02e3a3434fdf4c1a36921ef411607 100644 +--- a/src/main/java/net/minecraft/server/BehaviorWork.java ++++ b/src/main/java/net/minecraft/server/BehaviorWork.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; ++ + import java.util.Optional; + + public class BehaviorWork extends Behavior { +diff --git a/src/main/java/net/minecraft/server/BehaviorWorkComposter.java b/src/main/java/net/minecraft/server/BehaviorWorkComposter.java +index cedd2a26cd373c10835df104206defdc50405a62..eba9f9a401a40ac4ad964e8f9fffb973a0022a82 100644 +--- a/src/main/java/net/minecraft/server/BehaviorWorkComposter.java ++++ b/src/main/java/net/minecraft/server/BehaviorWorkComposter.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableList; ++ + import java.util.List; + import java.util.Optional; + +diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java +index bfaba96eb56dd98a67d2c2179335ae48dcbe3849..d78b5cc7075a37bcf572c2043fa252bb624861a7 100644 +--- a/src/main/java/net/minecraft/server/BiomeBase.java ++++ b/src/main/java/net/minecraft/server/BiomeBase.java +@@ -8,14 +8,12 @@ import com.mojang.serialization.Codec; + import com.mojang.serialization.codecs.RecordCodecBuilder; + import it.unimi.dsi.fastutil.longs.Long2FloatLinkedOpenHashMap; + import me.jellysquid.mods.lithium.common.util.collections.HashedList; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; + import java.util.*; +-import java.util.function.Function; +-import java.util.stream.Collectors; + import java.util.stream.Stream; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class BiomeBase { + +diff --git a/src/main/java/net/minecraft/server/BiomeStorage.java b/src/main/java/net/minecraft/server/BiomeStorage.java +index 49114864e3cd7ef48b827220939c5069d3b8ca3a..11b47ebc3a49927f4c704b111254b6b1e67dd1d0 100644 +--- a/src/main/java/net/minecraft/server/BiomeStorage.java ++++ b/src/main/java/net/minecraft/server/BiomeStorage.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; ++ + public class BiomeStorage implements BiomeManager.Provider { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java +index 09bb2f8b8d2451a41a1b1e77b8dfb6417748c20d..c16b64b30066bdff4e93c2b728c1825d11457daf 100644 +--- a/src/main/java/net/minecraft/server/Block.java ++++ b/src/main/java/net/minecraft/server/Block.java +@@ -4,12 +4,13 @@ import com.google.common.cache.CacheBuilder; + import com.google.common.cache.CacheLoader; + import com.google.common.cache.LoadingCache; + import it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.stream.Stream; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class Block extends BlockBase implements IMaterial { + +diff --git a/src/main/java/net/minecraft/server/BlockBamboo.java b/src/main/java/net/minecraft/server/BlockBamboo.java +index 14790c1674fd4fa6baca8f0d694e9b02e6b3d0a0..53eb9241dd7a36506261401aec0b1ed91e97ced3 100644 +--- a/src/main/java/net/minecraft/server/BlockBamboo.java ++++ b/src/main/java/net/minecraft/server/BlockBamboo.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; + import javax.annotation.Nullable; ++import java.util.Random; + + public class BlockBamboo extends Block implements IBlockFragilePlantElement { + +diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java +index 93e33a5418ab11a6e968b2c05e7a9f9dc616e2dc..809ec5f8fba12929a62a7a0fab843f5a4ed6b461 100644 +--- a/src/main/java/net/minecraft/server/BlockBase.java ++++ b/src/main/java/net/minecraft/server/BlockBase.java +@@ -2,14 +2,14 @@ package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; + import com.mojang.serialization.MapCodec; +-import java.util.Arrays; ++ ++import javax.annotation.Nullable; + import java.util.Collections; + import java.util.List; + import java.util.Random; + import java.util.function.Function; + import java.util.function.Predicate; + import java.util.function.ToIntFunction; +-import javax.annotation.Nullable; + + public abstract class BlockBase { + +diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java +index e7bd9061cceba284443b75cc5506e1b9f2ef42e8..f0a622585124cb149aa031c64757b34894bf1d44 100644 +--- a/src/main/java/net/minecraft/server/BlockBed.java ++++ b/src/main/java/net/minecraft/server/BlockBed.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.List; + import java.util.Optional; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + +diff --git a/src/main/java/net/minecraft/server/BlockBeehive.java b/src/main/java/net/minecraft/server/BlockBeehive.java +index 7e2c63e4731ac2d234d5f90eb80d314cdede07ca..6a4d63139ebce442b3dc9f89c05cf17430e40e1e 100644 +--- a/src/main/java/net/minecraft/server/BlockBeehive.java ++++ b/src/main/java/net/minecraft/server/BlockBeehive.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Random; +-import javax.annotation.Nullable; + + public class BlockBeehive extends BlockTileEntity { + +diff --git a/src/main/java/net/minecraft/server/BlockButtonAbstract.java b/src/main/java/net/minecraft/server/BlockButtonAbstract.java +index da6b90cbe6caaf19b98670feb731511dd7dcf904..1dba8e8c34005f9e9b28a32b24647cc538da06be 100644 +--- a/src/main/java/net/minecraft/server/BlockButtonAbstract.java ++++ b/src/main/java/net/minecraft/server/BlockButtonAbstract.java +@@ -1,12 +1,11 @@ + package net.minecraft.server; + +-import java.util.List; +-import java.util.Random; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.event.block.BlockRedstoneEvent; + import org.bukkit.event.entity.EntityInteractEvent; ++ ++import javax.annotation.Nullable; ++import java.util.List; ++import java.util.Random; + // CraftBukkit end + + public abstract class BlockButtonAbstract extends BlockAttachable { +diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java +index 13e4517bd04096001ca1caf32b9949abb3cf9c7f..ce0797fdc43bbb7b5a2bd67632db04209be40124 100644 +--- a/src/main/java/net/minecraft/server/BlockCactus.java ++++ b/src/main/java/net/minecraft/server/BlockCactus.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ + import java.util.Iterator; + import java.util.Random; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit +- + public class BlockCactus extends Block { + + public static final BlockStateInteger AGE = BlockProperties.aj; +diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java +index 11e02ffdaaec2203b83125ff28cddf2784237d7c..e7581cc1a41fb5dd85a7d56c62bb73792dde931c 100644 +--- a/src/main/java/net/minecraft/server/BlockCampfire.java ++++ b/src/main/java/net/minecraft/server/BlockCampfire.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Optional; + import java.util.Random; +-import javax.annotation.Nullable; + + public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged { + +diff --git a/src/main/java/net/minecraft/server/BlockCauldron.java b/src/main/java/net/minecraft/server/BlockCauldron.java +index 9fed3883828e7d6ca917a5eca7a7a3e37582f983..f7eaeb70aff716665e2da84eab5da6657adeade7 100644 +--- a/src/main/java/net/minecraft/server/BlockCauldron.java ++++ b/src/main/java/net/minecraft/server/BlockCauldron.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.event.block.CauldronLevelChangeEvent; // CraftBukkit ++import org.bukkit.event.block.CauldronLevelChangeEvent; + + public class BlockCauldron extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java +index dba774018ccd88d75f3a69ceee10fd4691fcfdb6..80b46fe0841c694f2de6fb912d646f3bcdd86a40 100644 +--- a/src/main/java/net/minecraft/server/BlockChest.java ++++ b/src/main/java/net/minecraft/server/BlockChest.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Optional; + import java.util.function.BiPredicate; + import java.util.function.Supplier; +-import javax.annotation.Nullable; + + public class BlockChest extends BlockChestAbstract implements IBlockWaterlogged { + +diff --git a/src/main/java/net/minecraft/server/BlockChorusFlower.java b/src/main/java/net/minecraft/server/BlockChorusFlower.java +index c6cb947d2bd53501e4779537f3ccdd926433fe76..5bc4726f9aaa7eb27d107053ad48880bc2e3c36c 100644 +--- a/src/main/java/net/minecraft/server/BlockChorusFlower.java ++++ b/src/main/java/net/minecraft/server/BlockChorusFlower.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Random; +-import javax.annotation.Nullable; +- +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class BlockChorusFlower extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockCocoa.java b/src/main/java/net/minecraft/server/BlockCocoa.java +index 5f00a69d4e596886a44c953900f36c991d43d6b6..4b3bbbba66b86a63d9fbd913f1c3a3fb765a0429 100644 +--- a/src/main/java/net/minecraft/server/BlockCocoa.java ++++ b/src/main/java/net/minecraft/server/BlockCocoa.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + +-import java.util.Random; +-import javax.annotation.Nullable; ++import org.bukkit.craftbukkit.event.CraftEventFactory; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import javax.annotation.Nullable; ++import java.util.Random; + + public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePlantElement { + +diff --git a/src/main/java/net/minecraft/server/BlockCommand.java b/src/main/java/net/minecraft/server/BlockCommand.java +index 6b353a99c04e0312f520f8559c05ddaf51c26aaf..0d69bdee165b37c88bcdd8e19160e3d4b1c253f1 100644 +--- a/src/main/java/net/minecraft/server/BlockCommand.java ++++ b/src/main/java/net/minecraft/server/BlockCommand.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + +-import java.util.Random; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; ++import org.bukkit.event.block.BlockRedstoneEvent; + +-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit ++import java.util.Random; + + public class BlockCommand extends BlockTileEntity { + +diff --git a/src/main/java/net/minecraft/server/BlockComposter.java b/src/main/java/net/minecraft/server/BlockComposter.java +index c4e3a306446163903a269cdb1b1d65480f7d1dce..0a7137b096db1807950f0b6754ff2644df97892d 100644 +--- a/src/main/java/net/minecraft/server/BlockComposter.java ++++ b/src/main/java/net/minecraft/server/BlockComposter.java +@@ -2,11 +2,11 @@ package net.minecraft.server; + + import it.unimi.dsi.fastutil.objects.Object2FloatMap; + import it.unimi.dsi.fastutil.objects.Object2FloatOpenHashMap; +-import java.util.Random; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.craftbukkit.inventory.CraftBlockInventoryHolder; + import org.bukkit.craftbukkit.util.DummyGeneratorAccess; ++ ++import javax.annotation.Nullable; ++import java.util.Random; + // CraftBukkit end + + public class BlockComposter extends Block implements IInventoryHolder { +diff --git a/src/main/java/net/minecraft/server/BlockCoral.java b/src/main/java/net/minecraft/server/BlockCoral.java +index 4611577966e19836311098d5b1a2d1e596327466..ead4fa9c767e07cac7e031c2f2c5ed18cdbd723f 100644 +--- a/src/main/java/net/minecraft/server/BlockCoral.java ++++ b/src/main/java/net/minecraft/server/BlockCoral.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; + import javax.annotation.Nullable; ++import java.util.Random; + + public class BlockCoral extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java +index a9897d4c8b3ef864b050b20eb7d1cee2c889aafb..45f8f1b9fb05f5598d0ae493d6394b314c01a0d1 100644 +--- a/src/main/java/net/minecraft/server/BlockCrops.java ++++ b/src/main/java/net/minecraft/server/BlockCrops.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + +-import java.util.Random; ++import org.bukkit.craftbukkit.event.CraftEventFactory; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import java.util.Random; + + public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement { + +diff --git a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java +index 682e3222435e68c38d91f430f224cae1b52db8cf..4dc2546db159ea770b07295962e11315f255fc37 100644 +--- a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java ++++ b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + +-import java.util.Random; ++import org.bukkit.craftbukkit.event.CraftEventFactory; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import java.util.Random; + + public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + +diff --git a/src/main/java/net/minecraft/server/BlockDispenser.java b/src/main/java/net/minecraft/server/BlockDispenser.java +index 34f33777258ae4c3e9c15b236d329b2c89d2bc69..65e41ce3363638d7b7062a3de974527e1e7ea692 100644 +--- a/src/main/java/net/minecraft/server/BlockDispenser.java ++++ b/src/main/java/net/minecraft/server/BlockDispenser.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; ++ + import java.util.Map; + import java.util.Random; + +diff --git a/src/main/java/net/minecraft/server/BlockDoor.java b/src/main/java/net/minecraft/server/BlockDoor.java +index 9d28c00cb1c1e6aff0a4a3c5201b1aae7f887d9f..c32cdc4856e1a0062796f7b25402357418d85a44 100644 +--- a/src/main/java/net/minecraft/server/BlockDoor.java ++++ b/src/main/java/net/minecraft/server/BlockDoor.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; ++import org.bukkit.event.block.BlockRedstoneEvent; + +-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit ++import javax.annotation.Nullable; + + public class BlockDoor extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockDragonEgg.java b/src/main/java/net/minecraft/server/BlockDragonEgg.java +index ee397cb7fd4160da31efd200ad3db19644abc494..7ea9155c4bf91516fd555c64253daeb8b3e9a42a 100644 +--- a/src/main/java/net/minecraft/server/BlockDragonEgg.java ++++ b/src/main/java/net/minecraft/server/BlockDragonEgg.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit ++import org.bukkit.event.block.BlockFromToEvent; + + public class BlockDragonEgg extends BlockFalling { + +diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java +index a8875a9a5fa6b285b41f3de1bc81c44f35ea5cce..41bbb8d9d2f9da2a71a95e00b0048aa62deb0429 100644 +--- a/src/main/java/net/minecraft/server/BlockFire.java ++++ b/src/main/java/net/minecraft/server/BlockFire.java +@@ -1,16 +1,15 @@ + package net.minecraft.server; + ++import com.destroystokyo.paper.event.block.TNTPrimeEvent; + import it.unimi.dsi.fastutil.objects.Object2IntMap; + import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +-import com.destroystokyo.paper.event.block.TNTPrimeEvent; // Paper - TNTPrimeEvent +-import java.util.Map; +-import java.util.Random; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.block.CraftBlockState; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.block.BlockBurnEvent; + import org.bukkit.event.block.BlockFadeEvent; ++ ++import java.util.Map; ++import java.util.Random; + // CraftBukkit end + + public class BlockFire extends BlockFireAbstract { +diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java +index a28ac8b00b22a8c7afc2b64f9720a4e32b653e5f..335750d4a247c8898ffec3512f3b3453b4e84340 100644 +--- a/src/main/java/net/minecraft/server/BlockFluids.java ++++ b/src/main/java/net/minecraft/server/BlockFluids.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ + import java.util.Collections; + import java.util.List; + import java.util.Random; +diff --git a/src/main/java/net/minecraft/server/BlockIce.java b/src/main/java/net/minecraft/server/BlockIce.java +index aba5c6b8713c04302632bd1d289fd968c9e0607a..7b74d7f6fe8d198664d09463b0c28bce076075c6 100644 +--- a/src/main/java/net/minecraft/server/BlockIce.java ++++ b/src/main/java/net/minecraft/server/BlockIce.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; + import javax.annotation.Nullable; ++import java.util.Random; + + public class BlockIce extends BlockHalfTransparent { + +diff --git a/src/main/java/net/minecraft/server/BlockLeaves.java b/src/main/java/net/minecraft/server/BlockLeaves.java +index 468d0bf193f9a90e734ff413b223e83d431113e7..03d0c9ca4facbac2c573e86938cece0942b2369d 100644 +--- a/src/main/java/net/minecraft/server/BlockLeaves.java ++++ b/src/main/java/net/minecraft/server/BlockLeaves.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + +-import java.util.Random; ++import org.bukkit.event.block.LeavesDecayEvent; + +-import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit ++import java.util.Random; + + public class BlockLeaves extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockLectern.java b/src/main/java/net/minecraft/server/BlockLectern.java +index 87bdc49f90eee5c45ffee1d8fd5085198339fe9c..7e5d3384b7fbb1be218bbb1259e9b5ec55ed69c0 100644 +--- a/src/main/java/net/minecraft/server/BlockLectern.java ++++ b/src/main/java/net/minecraft/server/BlockLectern.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; + import javax.annotation.Nullable; ++import java.util.Random; + + public class BlockLectern extends BlockTileEntity { + +diff --git a/src/main/java/net/minecraft/server/BlockLever.java b/src/main/java/net/minecraft/server/BlockLever.java +index 641c543c5d177ee4a4644609a89982953075270f..f1e38e4f1d95b07f45f4201b6093adf0ed7e0b55 100644 +--- a/src/main/java/net/minecraft/server/BlockLever.java ++++ b/src/main/java/net/minecraft/server/BlockLever.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit ++import org.bukkit.event.block.BlockRedstoneEvent; + + public class BlockLever extends BlockAttachable { + +diff --git a/src/main/java/net/minecraft/server/BlockMinecartDetector.java b/src/main/java/net/minecraft/server/BlockMinecartDetector.java +index b8e91fca957c8a39c9fbf4f87c089c4ce710c8e0..f8a91f5e3cb75ac2fbee6f2cb951ade66006a93e 100644 +--- a/src/main/java/net/minecraft/server/BlockMinecartDetector.java ++++ b/src/main/java/net/minecraft/server/BlockMinecartDetector.java +@@ -1,12 +1,12 @@ + package net.minecraft.server; + ++import org.bukkit.event.block.BlockRedstoneEvent; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Random; + import java.util.function.Predicate; +-import javax.annotation.Nullable; +- +-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit + + public class BlockMinecartDetector extends BlockMinecartTrackAbstract { + +diff --git a/src/main/java/net/minecraft/server/BlockMonsterEggs.java b/src/main/java/net/minecraft/server/BlockMonsterEggs.java +index 159416e307daac88dfe85fcb8cc9292ef7fb92d4..a8d48e3e9be1ed0a7bc61d73795a8c8ae5dfacfc 100644 +--- a/src/main/java/net/minecraft/server/BlockMonsterEggs.java ++++ b/src/main/java/net/minecraft/server/BlockMonsterEggs.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; +-import java.util.Map; ++import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; + +-import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; // CraftBukkit ++import java.util.Map; + + public class BlockMonsterEggs extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java +index a52444463f527ec402d6b975f322782a6864d5bb..45c721e59c8d2639b154c948b9f6a540a88da83e 100644 +--- a/src/main/java/net/minecraft/server/BlockMushroom.java ++++ b/src/main/java/net/minecraft/server/BlockMushroom.java +@@ -1,10 +1,9 @@ + package net.minecraft.server; + ++import org.bukkit.TreeType; ++ + import java.util.Iterator; + import java.util.Random; +- +-// CraftBukkit start +-import org.bukkit.TreeType; + // CraftBukkit end + + public class BlockMushroom extends BlockPlant implements IBlockFragilePlantElement { +diff --git a/src/main/java/net/minecraft/server/BlockObserver.java b/src/main/java/net/minecraft/server/BlockObserver.java +index 7dfe632523f7fc4426a035b6bf23917b2ea80389..595851324fc06ebb5b590b67b53ba7437665a794 100644 +--- a/src/main/java/net/minecraft/server/BlockObserver.java ++++ b/src/main/java/net/minecraft/server/BlockObserver.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + +-import java.util.Random; ++import org.bukkit.craftbukkit.event.CraftEventFactory; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import java.util.Random; + + public class BlockObserver extends BlockDirectional { + +diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java +index 3d6f8d948d293ca57bf158bcd1f58e289d937fb5..c03d519d937bca13e9c4750de3a56603c44e72df 100644 +--- a/src/main/java/net/minecraft/server/BlockPiston.java ++++ b/src/main/java/net/minecraft/server/BlockPiston.java +@@ -1,18 +1,17 @@ + package net.minecraft.server; + ++import com.google.common.collect.ImmutableList; + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; ++import org.bukkit.craftbukkit.block.CraftBlock; ++import org.bukkit.event.block.BlockPistonExtendEvent; ++import org.bukkit.event.block.BlockPistonRetractEvent; ++ ++import java.util.AbstractList; + import java.util.Iterator; + import java.util.List; + import java.util.Map; + import java.util.Map.Entry; +- +-// CraftBukkit start +-import com.google.common.collect.ImmutableList; +-import java.util.AbstractList; +-import org.bukkit.craftbukkit.block.CraftBlock; +-import org.bukkit.event.block.BlockPistonRetractEvent; +-import org.bukkit.event.block.BlockPistonExtendEvent; + // CraftBukkit end + + public class BlockPiston extends BlockDirectional { +diff --git a/src/main/java/net/minecraft/server/BlockPistonMoving.java b/src/main/java/net/minecraft/server/BlockPistonMoving.java +index bf76615d720911fa3f31efb05fa49f2a1ec239ac..29ea9b650b3fbed4d2f4bc9332ce26d92ce2e01e 100644 +--- a/src/main/java/net/minecraft/server/BlockPistonMoving.java ++++ b/src/main/java/net/minecraft/server/BlockPistonMoving.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Collections; + import java.util.List; +-import javax.annotation.Nullable; + + public class BlockPistonMoving extends BlockTileEntity { + +diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java +index 77f8d5e6662fa75e622f07b3e6efae04c38735fe..f044de840b24055b24f0a039e18331c13161511d 100644 +--- a/src/main/java/net/minecraft/server/BlockPortal.java ++++ b/src/main/java/net/minecraft/server/BlockPortal.java +@@ -1,14 +1,13 @@ + package net.minecraft.server; + + import com.google.common.cache.LoadingCache; +-import java.util.Random; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.block.CraftBlockState; + import org.bukkit.event.entity.EntityPortalEnterEvent; + import org.bukkit.event.world.PortalCreateEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Random; + // CraftBukkit end + + public class BlockPortal extends Block { +diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java +index c77f71b6de87757900b3734feda819754e9408b1..ea42b2a0ebfabe57055785f95b018e2d2c2bfa7a 100644 +--- a/src/main/java/net/minecraft/server/BlockPosition.java ++++ b/src/main/java/net/minecraft/server/BlockPosition.java +@@ -2,15 +2,16 @@ package net.minecraft.server; + + import com.google.common.collect.AbstractIterator; + import com.mojang.serialization.Codec; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.concurrent.Immutable; + import java.util.Optional; + import java.util.Random; + import java.util.function.Predicate; + import java.util.stream.IntStream; + import java.util.stream.Stream; + import java.util.stream.StreamSupport; +-import javax.annotation.concurrent.Immutable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + @Immutable + public class BlockPosition extends BaseBlockPosition { +diff --git a/src/main/java/net/minecraft/server/BlockPoweredRail.java b/src/main/java/net/minecraft/server/BlockPoweredRail.java +index d39b87b17694290b5f62191e59e5c1098c4f0a37..3b5c097defd83e3f82b695312fae3ded536f1f55 100644 +--- a/src/main/java/net/minecraft/server/BlockPoweredRail.java ++++ b/src/main/java/net/minecraft/server/BlockPoweredRail.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import org.bukkit.craftbukkit.event.CraftEventFactory; + + public class BlockPoweredRail extends BlockMinecartTrackAbstract { + +diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java b/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java +index 2878c5aa7f9f90859d8a661664765fa62e68ee2e..d163ec51b5477be2fa94767835962ab341b61b6f 100644 +--- a/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java ++++ b/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + +-import java.util.Random; ++import org.bukkit.event.block.BlockRedstoneEvent; + +-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit ++import java.util.Random; + + public abstract class BlockPressurePlateAbstract extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java b/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java +index ef79fbb628c4eaffe9d34de6129d6e833aac7c76..af29ceacd6d57d955dcca7b0a11559d97ffc9d96 100644 +--- a/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java ++++ b/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.event.entity.EntityInteractEvent; ++ + import java.util.Iterator; + import java.util.List; + +-import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit +- + public class BlockPressurePlateBinary extends BlockPressurePlateAbstract { + + public static final BlockStateBoolean POWERED = BlockProperties.w; +diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java b/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java +index e358cce6fad4b71c199bcd432dfcd6e393a7ad3c..f76dd0f7f2d6a68aad2f19b2e926138c9c0c0ad0 100644 +--- a/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java ++++ b/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit ++import org.bukkit.event.entity.EntityInteractEvent; + + public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract { + +diff --git a/src/main/java/net/minecraft/server/BlockPumpkinCarved.java b/src/main/java/net/minecraft/server/BlockPumpkinCarved.java +index c8ef631e1e77ea534e782b35027c2ca5ea57aaa3..f07d09348145f795c3788ffb4577c30a7b2e5bb6 100644 +--- a/src/main/java/net/minecraft/server/BlockPumpkinCarved.java ++++ b/src/main/java/net/minecraft/server/BlockPumpkinCarved.java +@@ -1,13 +1,11 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.util.BlockStateListPopulator; +-import org.bukkit.event.block.BlockRedstoneEvent; + import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.function.Predicate; + // CraftBukkit end + + public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWearable { +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneComparator.java b/src/main/java/net/minecraft/server/BlockRedstoneComparator.java +index 3e771f6d770932b8b71b9e13c3adf71ac9249709..70595d2a00fef8664224060865adb7cc6fc89c0e 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneComparator.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneComparator.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + import java.util.List; + import java.util.Random; +-import javax.annotation.Nullable; +- +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity { + +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java +index 22a1863ca88ce41ff5f899821c252ca7f2e87f63..154d217a27c490542e36f41b547e4905e728fb8f 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + +-import java.util.Random; +-import javax.annotation.Nullable; ++import org.bukkit.craftbukkit.event.CraftEventFactory; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import javax.annotation.Nullable; ++import java.util.Random; + + public class BlockRedstoneLamp extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneOre.java b/src/main/java/net/minecraft/server/BlockRedstoneOre.java +index e31a3890df554552c9db72396ef43de7af428388..7a4a481135e1457716bbe606571d143da27e654b 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneOre.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneOre.java +@@ -1,10 +1,9 @@ + package net.minecraft.server; + +-import java.util.Random; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.EntityInteractEvent; ++ ++import java.util.Random; + // CraftBukkit end + + public class BlockRedstoneOre extends Block { +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +index a63a60348fe45f63deec6fcb27b6be09cd2f088c..520a34550f58f35eeaf6cb62a3f0edc64abb1451 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +@@ -1,12 +1,8 @@ + package net.minecraft.server; + +-import com.google.common.collect.Lists; +-import java.util.List; +-import java.util.Map; +-import java.util.Random; +-import java.util.WeakHashMap; ++import org.bukkit.event.block.BlockRedstoneEvent; + +-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit ++import java.util.Random; + + public class BlockRedstoneTorch extends BlockTorch { + +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java +index 6abc3d4cfbe8f5cc1dbe83031d90ee8df3b2f914..f9cb85492078aec72eae938af8db2c371e9e489c 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java +@@ -1,17 +1,16 @@ + package net.minecraft.server; + +-import com.destroystokyo.paper.PaperConfig; + import com.destroystokyo.paper.util.RedstoneWireTurbo; + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; + import com.google.common.collect.UnmodifiableIterator; ++import org.bukkit.event.block.BlockRedstoneEvent; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Map; + import java.util.Set; +-import javax.annotation.Nullable; +- +-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit + + public class BlockRedstoneWire extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java +index e08af2850f2da35b62cbf1203f3f5ffcf759565a..de5ee6c9af67b7ce82c5b3699120f649fdd69652 100644 +--- a/src/main/java/net/minecraft/server/BlockSapling.java ++++ b/src/main/java/net/minecraft/server/BlockSapling.java +@@ -1,12 +1,11 @@ + package net.minecraft.server; + +-import java.util.Random; +- +-// CraftBukkit start + import org.bukkit.Location; + import org.bukkit.TreeType; + import org.bukkit.block.BlockState; + import org.bukkit.event.world.StructureGrowEvent; ++ ++import java.util.Random; + // CraftBukkit end + + public class BlockSapling extends BlockPlant implements IBlockFragilePlantElement { +diff --git a/src/main/java/net/minecraft/server/BlockSnow.java b/src/main/java/net/minecraft/server/BlockSnow.java +index 66f188c9eb6431eedfd655a1dd4a35b5141e7196..fd254e83a2a18a45a1f3fef65d08d3a1e3e2116a 100644 +--- a/src/main/java/net/minecraft/server/BlockSnow.java ++++ b/src/main/java/net/minecraft/server/BlockSnow.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; + import javax.annotation.Nullable; ++import java.util.Random; + + public class BlockSnow extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java +index a315e2628c35ee713b68741c6e52c4b140c05f27..f80e60c924228f84a785840bc9da75a016787d65 100644 +--- a/src/main/java/net/minecraft/server/BlockSoil.java ++++ b/src/main/java/net/minecraft/server/BlockSoil.java +@@ -1,11 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++import org.bukkit.event.entity.EntityInteractEvent; ++ + import java.util.Iterator; + import java.util.Random; +- +-// CraftBukkit start +-import org.bukkit.event.entity.EntityInteractEvent; +-import org.bukkit.craftbukkit.event.CraftEventFactory; + // CraftBukkit end + + public class BlockSoil extends Block { +diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java +index 362750bd85bc65c304f5fece344ecdeddebaf4ee..9407c67c2b21473d5a7456f074a9860829d88393 100644 +--- a/src/main/java/net/minecraft/server/BlockSponge.java ++++ b/src/main/java/net/minecraft/server/BlockSponge.java +@@ -1,12 +1,12 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import java.util.Queue; +-// CraftBukkit start +-import java.util.List; + import org.bukkit.craftbukkit.block.CraftBlockState; + import org.bukkit.craftbukkit.util.BlockStateListPopulator; + import org.bukkit.event.block.SpongeAbsorbEvent; ++ ++import java.util.List; ++import java.util.Queue; + // CraftBukkit end + + public class BlockSponge extends Block { +diff --git a/src/main/java/net/minecraft/server/BlockStateBoolean.java b/src/main/java/net/minecraft/server/BlockStateBoolean.java +index 4ca8db630434915de4eaeac6c4ecd60714d7f5d9..bbaed354286c2233373f13edfd2574316b5d5434 100644 +--- a/src/main/java/net/minecraft/server/BlockStateBoolean.java ++++ b/src/main/java/net/minecraft/server/BlockStateBoolean.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableSet; ++ + import java.util.Collection; + import java.util.Optional; + +diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java +index 7eeb71accaae99d4398b6f24b1e9ef5a2b95b00a..71b594ccc2a68e5f0a3066b6daa9ec6e879aec01 100644 +--- a/src/main/java/net/minecraft/server/BlockStateEnum.java ++++ b/src/main/java/net/minecraft/server/BlockStateEnum.java +@@ -7,7 +7,6 @@ import com.google.common.collect.Maps; + + import java.util.*; + import java.util.function.Predicate; +-import java.util.stream.Collectors; + + public class BlockStateEnum & INamable> extends IBlockState { + +diff --git a/src/main/java/net/minecraft/server/BlockStateInteger.java b/src/main/java/net/minecraft/server/BlockStateInteger.java +index 36b84446e96faefad3b783f73df74e0f3bce8255..0d8f485ff910b8aa54b45b60453bc871d3441543 100644 +--- a/src/main/java/net/minecraft/server/BlockStateInteger.java ++++ b/src/main/java/net/minecraft/server/BlockStateInteger.java +@@ -2,6 +2,7 @@ package net.minecraft.server; + + import com.google.common.collect.ImmutableSet; + import com.google.common.collect.Sets; ++ + import java.util.Collection; + import java.util.Optional; + import java.util.Set; +diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java +index c6b8c37f076c0a5ce11d5187b059ea1ab5c03369..ce99f308689c8073bf4b6dd65604016aa0102f60 100644 +--- a/src/main/java/net/minecraft/server/BlockStem.java ++++ b/src/main/java/net/minecraft/server/BlockStem.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + +-import java.util.Random; ++import org.bukkit.craftbukkit.event.CraftEventFactory; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import java.util.Random; + + public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { + +diff --git a/src/main/java/net/minecraft/server/BlockSweetBerryBush.java b/src/main/java/net/minecraft/server/BlockSweetBerryBush.java +index 3aa46479dcc462b62026195eb6f5abe8a193c443..679d4dd446efad0a8927f66cf3cd84802a3b08af 100644 +--- a/src/main/java/net/minecraft/server/BlockSweetBerryBush.java ++++ b/src/main/java/net/minecraft/server/BlockSweetBerryBush.java +@@ -1,12 +1,12 @@ + package net.minecraft.server; + +-import java.util.Random; +-// CraftBukkit start +-import java.util.Collections; + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.event.player.PlayerHarvestBlockEvent; ++ ++import java.util.Collections; ++import java.util.Random; + // CraftBukkit end + + public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement { +diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java +index 7b601955f3fd36f06c838b896b455a606954d980..1f54c5e97adc0de5db11d7ec0708f5796fedd453 100644 +--- a/src/main/java/net/minecraft/server/BlockTNT.java ++++ b/src/main/java/net/minecraft/server/BlockTNT.java +@@ -1,7 +1,8 @@ + package net.minecraft.server; + ++import com.destroystokyo.paper.event.block.TNTPrimeEvent; ++ + import javax.annotation.Nullable; +-import com.destroystokyo.paper.event.block.TNTPrimeEvent; // Paper - TNTPrimeEvent + + public class BlockTNT extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockTrapdoor.java b/src/main/java/net/minecraft/server/BlockTrapdoor.java +index 313b1bdd2cb78564e09ba7fa05ccfc8d7ab1c373..49b3f24162067a28f7886c3ab3bde8c031371350 100644 +--- a/src/main/java/net/minecraft/server/BlockTrapdoor.java ++++ b/src/main/java/net/minecraft/server/BlockTrapdoor.java +@@ -1,7 +1,8 @@ + package net.minecraft.server; + ++import org.bukkit.event.block.BlockRedstoneEvent; ++ + import javax.annotation.Nullable; +-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit + + public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterlogged { + +diff --git a/src/main/java/net/minecraft/server/BlockTripwire.java b/src/main/java/net/minecraft/server/BlockTripwire.java +index 5c401f28191c83b1a121d8cef4a5d8b2e681de49..e04bf62581a5d0fca29bf2d49bab7c3d37fe7cfa 100644 +--- a/src/main/java/net/minecraft/server/BlockTripwire.java ++++ b/src/main/java/net/minecraft/server/BlockTripwire.java +@@ -1,12 +1,12 @@ + package net.minecraft.server; + ++import org.bukkit.event.entity.EntityInteractEvent; ++ + import java.util.Iterator; + import java.util.List; + import java.util.Map; + import java.util.Random; + +-import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit +- + public class BlockTripwire extends Block { + + public static final BlockStateBoolean POWERED = BlockProperties.w; +diff --git a/src/main/java/net/minecraft/server/BlockTripwireHook.java b/src/main/java/net/minecraft/server/BlockTripwireHook.java +index dd30810569325096d35a367c4348e09f1463b2a9..fabc713798e7292d376db4ba74d2820ed18bd4e8 100644 +--- a/src/main/java/net/minecraft/server/BlockTripwireHook.java ++++ b/src/main/java/net/minecraft/server/BlockTripwireHook.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + + import com.google.common.base.MoreObjects; +-import java.util.Random; +-import javax.annotation.Nullable; ++import org.bukkit.event.block.BlockRedstoneEvent; + +-import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit ++import javax.annotation.Nullable; ++import java.util.Random; + + public class BlockTripwireHook extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java +index 553c8affab6228cb187549deb5b34f79ba8f912c..77478d89afd0dcaef3b726b1e320a72bbd30e04e 100644 +--- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java ++++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java +@@ -1,12 +1,11 @@ + package net.minecraft.server; + +-import java.util.Random; +-import javax.annotation.Nullable; + import org.bukkit.craftbukkit.block.CraftBlock; +- +-// CraftBukkit start +-import org.bukkit.event.entity.EntityInteractEvent; + import org.bukkit.craftbukkit.event.CraftEventFactory; ++import org.bukkit.event.entity.EntityInteractEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Random; + // CraftBukkit end + + public class BlockTurtleEgg extends Block { +diff --git a/src/main/java/net/minecraft/server/BlockVine.java b/src/main/java/net/minecraft/server/BlockVine.java +index b580caace70428b079fdc35b4e96ad87c9a1c057..48bbf6d3b5dcbe6c188066dd2ef9219dc903f19c 100644 +--- a/src/main/java/net/minecraft/server/BlockVine.java ++++ b/src/main/java/net/minecraft/server/BlockVine.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Map; + import java.util.Random; +-import javax.annotation.Nullable; +- +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class BlockVine extends Block { + +diff --git a/src/main/java/net/minecraft/server/BlockWitherSkull.java b/src/main/java/net/minecraft/server/BlockWitherSkull.java +index 5551da3bebeb87bc4037f0d4d59aaf4f05351760..c17ec61f589b7177af7ae44aa1f018d6e9f9aa1a 100644 +--- a/src/main/java/net/minecraft/server/BlockWitherSkull.java ++++ b/src/main/java/net/minecraft/server/BlockWitherSkull.java +@@ -1,11 +1,10 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.util.BlockStateListPopulator; + import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; + // CraftBukkit end + + public class BlockWitherSkull extends BlockSkull { +diff --git a/src/main/java/net/minecraft/server/BossBattleCustom.java b/src/main/java/net/minecraft/server/BossBattleCustom.java +index 00b1d1bd873c6fe5e1c26973e2b09dd688e4b150..722a2b229a2ecea9da0d59ab6c471b24394a1996 100644 +--- a/src/main/java/net/minecraft/server/BossBattleCustom.java ++++ b/src/main/java/net/minecraft/server/BossBattleCustom.java +@@ -1,14 +1,13 @@ + package net.minecraft.server; + + import com.google.common.collect.Sets; ++import org.bukkit.boss.KeyedBossBar; ++import org.bukkit.craftbukkit.boss.CraftKeyedBossbar; ++ + import java.util.Collection; + import java.util.Iterator; + import java.util.Set; + import java.util.UUID; +- +-// CraftBukkit start +-import org.bukkit.boss.KeyedBossBar; +-import org.bukkit.craftbukkit.boss.CraftKeyedBossbar; + // CraftBukkit end + + public class BossBattleCustom extends BossBattleServer { +diff --git a/src/main/java/net/minecraft/server/ChatHexColor.java b/src/main/java/net/minecraft/server/ChatHexColor.java +index 3cb6ad020da3018f4392b0791e50e6c2ebee869a..5e7f063f5e7a4f41554d13042726fb8b981365e3 100644 +--- a/src/main/java/net/minecraft/server/ChatHexColor.java ++++ b/src/main/java/net/minecraft/server/ChatHexColor.java +@@ -1,11 +1,12 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; ++ ++import javax.annotation.Nullable; + import java.util.Map; + import java.util.Objects; + import java.util.function.Function; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public final class ChatHexColor { + +diff --git a/src/main/java/net/minecraft/server/ChatModifier.java b/src/main/java/net/minecraft/server/ChatModifier.java +index 9ce4fb103daaf71d399edc6abe422ef6580f3987..84d773375bedda460ba5da09e66cfb176f8a73e6 100644 +--- a/src/main/java/net/minecraft/server/ChatModifier.java ++++ b/src/main/java/net/minecraft/server/ChatModifier.java +@@ -1,16 +1,10 @@ + package net.minecraft.server; + +-import com.google.gson.JsonDeserializationContext; +-import com.google.gson.JsonDeserializer; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; +-import com.google.gson.JsonParseException; +-import com.google.gson.JsonSerializationContext; +-import com.google.gson.JsonSerializer; +-import com.google.gson.JsonSyntaxException; ++import com.google.gson.*; ++ ++import javax.annotation.Nullable; + import java.lang.reflect.Type; + import java.util.Objects; +-import javax.annotation.Nullable; + + public class ChatModifier { + +diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java +index 9d313fdefef21fca61a6ba58a5d2feb3251ffc09..d1d3ed44bf3ad0dc44d268b66df77051aa195fb8 100644 +--- a/src/main/java/net/minecraft/server/Chunk.java ++++ b/src/main/java/net/minecraft/server/Chunk.java +@@ -7,21 +7,17 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; + import it.unimi.dsi.fastutil.longs.LongSet; + import it.unimi.dsi.fastutil.shorts.ShortList; + import it.unimi.dsi.fastutil.shorts.ShortListIterator; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; ++import java.util.*; + import java.util.Map.Entry; +-import java.util.Set; + import java.util.function.Consumer; + import java.util.function.Predicate; + import java.util.function.Supplier; + import java.util.stream.Stream; + import java.util.stream.StreamSupport; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class Chunk implements IChunkAccess { + +diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java +index 8eecdcde510661ec3a13a25a04ba394f6b6dc012..e49bdf51a50ef368d11f4436acad81b0360b2129 100644 +--- a/src/main/java/net/minecraft/server/ChunkCache.java ++++ b/src/main/java/net/minecraft/server/ChunkCache.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.function.Predicate; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public class ChunkCache implements IBlockAccess, ICollisionAccess { + +diff --git a/src/main/java/net/minecraft/server/ChunkConverter.java b/src/main/java/net/minecraft/server/ChunkConverter.java +index 5366314e5f889b5b8d7740bbd0f024d9b7b9d643..c52ff505f31036c00a67d4bf85302d73b3fd923e 100644 +--- a/src/main/java/net/minecraft/server/ChunkConverter.java ++++ b/src/main/java/net/minecraft/server/ChunkConverter.java +@@ -5,15 +5,11 @@ import com.google.common.collect.Sets; + import it.unimi.dsi.fastutil.objects.ObjectIterator; + import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; + import it.unimi.dsi.fastutil.objects.ObjectSet; +-import java.util.EnumSet; +-import java.util.IdentityHashMap; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import java.util.*; ++ + public class ChunkConverter { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +index b7093f1682d152988a54ffc5e5579d2f0ce10ad4..939551c5a8dd3272723f164fc3bf6336fee78171 100644 +--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java ++++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Spliterators.AbstractSpliterator; + import java.util.function.Consumer; + import java.util.stream.Stream; + import java.util.stream.StreamSupport; +-import javax.annotation.Nullable; + + public class ChunkCoordIntPair { + +diff --git a/src/main/java/net/minecraft/server/ChunkEmpty.java b/src/main/java/net/minecraft/server/ChunkEmpty.java +index fd49438961451987bd102a85484be24b341d946b..46f7f64edb26345118da9112bd6f85cf4f7e76b2 100644 +--- a/src/main/java/net/minecraft/server/ChunkEmpty.java ++++ b/src/main/java/net/minecraft/server/ChunkEmpty.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Arrays; + import java.util.List; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class ChunkEmpty extends Chunk { + +diff --git a/src/main/java/net/minecraft/server/ChunkGenerator.java b/src/main/java/net/minecraft/server/ChunkGenerator.java +index ee6726e5c664115417c6397aa153315c8eb835a9..43b80b6667839a2769c14508fcdef71d829dc949 100644 +--- a/src/main/java/net/minecraft/server/ChunkGenerator.java ++++ b/src/main/java/net/minecraft/server/ChunkGenerator.java +@@ -2,13 +2,10 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import com.mojang.serialization.Codec; +-import java.util.BitSet; +-import java.util.Iterator; +-import java.util.List; +-import java.util.ListIterator; +-import java.util.Random; +-import java.util.function.Function; ++ + import javax.annotation.Nullable; ++import java.util.*; ++import java.util.function.Function; + + public abstract class ChunkGenerator { + +diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +index 448745b9e499b86f3ce6938c0f0fb0fbb222a781..e6eb96017bfda10971708f59b0fd009b8905837e 100644 +--- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java ++++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +@@ -7,12 +7,12 @@ import it.unimi.dsi.fastutil.objects.ObjectList; + import it.unimi.dsi.fastutil.objects.ObjectListIterator; + import me.jellysquid.mods.lithium.common.world.noise.SimplexNoiseCache; + ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Random; + import java.util.function.Predicate; + import java.util.stream.IntStream; +-import javax.annotation.Nullable; + + public final class ChunkGeneratorAbstract extends ChunkGenerator { + +diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java +index 46fc70bd9878ca089c446619f97b997c9bb27eec..eabc303195f6cc560a4c3ad33e07bcd3abb3bce7 100644 +--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java ++++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java +@@ -1,29 +1,19 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableList; +-import com.google.common.collect.Sets; + import com.mojang.datafixers.util.Either; +-import it.unimi.dsi.fastutil.longs.Long2ByteMap; +-import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap; +-import it.unimi.dsi.fastutil.longs.Long2IntMap; +-import it.unimi.dsi.fastutil.longs.Long2IntMaps; +-import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; +-import it.unimi.dsi.fastutil.longs.Long2ObjectMap; ++import it.unimi.dsi.fastutil.longs.*; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap.Entry; +-import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +-import it.unimi.dsi.fastutil.longs.LongIterator; +-import it.unimi.dsi.fastutil.longs.LongOpenHashSet; +-import it.unimi.dsi.fastutil.longs.LongSet; + import it.unimi.dsi.fastutil.objects.ObjectIterator; + import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; + import it.unimi.dsi.fastutil.objects.ObjectSet; +-import java.util.Set; +-import java.util.concurrent.CompletableFuture; +-import java.util.concurrent.Executor; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-import org.spigotmc.AsyncCatcher; // Paper ++import org.spigotmc.AsyncCatcher; ++ ++import javax.annotation.Nullable; ++import java.util.concurrent.CompletableFuture; ++import java.util.concurrent.Executor; + + public abstract class ChunkMapDistance { + +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index c12f4326f68020fbb140e97f0ef43ddcf5a71072..22f96def107223b07dd4b3b89b65cb103a061741 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -1,13 +1,13 @@ + package net.minecraft.server; + + import com.google.common.annotations.VisibleForTesting; +-import com.google.common.collect.Lists; + import com.mojang.datafixers.DataFixer; + import com.mojang.datafixers.util.Either; ++ ++import javax.annotation.Nullable; + import java.io.File; + import java.io.IOException; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import java.util.Optional; + import java.util.concurrent.CompletableFuture; +@@ -16,10 +16,6 @@ import java.util.function.BooleanSupplier; + import java.util.function.Consumer; + import java.util.function.Function; + import java.util.function.Supplier; +-import javax.annotation.Nullable; +-import com.destroystokyo.paper.exception.ServerInternalException; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class ChunkProviderServer extends IChunkProvider { + +diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +index 8a7296f691008dc35502165ec694c70a145247df..6c117070ba321a1a59c97fd638c54b9126a48333 100644 +--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +@@ -1,25 +1,18 @@ + package net.minecraft.server; + +-import co.aikar.timings.Timings; + import com.google.common.collect.Maps; + import it.unimi.dsi.fastutil.longs.LongOpenHashSet; + import it.unimi.dsi.fastutil.longs.LongSet; + import it.unimi.dsi.fastutil.shorts.ShortList; + import it.unimi.dsi.fastutil.shorts.ShortListIterator; +-import java.util.ArrayDeque; // Paper +-import java.util.Arrays; +-import java.util.BitSet; +-import java.util.EnumSet; +-import java.util.Iterator; +-import java.util.Locale; +-import java.util.Map; +-import java.util.Map.Entry; +-import java.util.Objects; +-import java.util.function.Function; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.Map.Entry; ++import java.util.function.Function; ++ + public class ChunkRegionLoader { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java +index cf54336b8618071056ab8bf1ac13bbe6d29ced0e..bdfbd1c51aa25b06ecb4abfc0012712cbbcafaa7 100644 +--- a/src/main/java/net/minecraft/server/ChunkSection.java ++++ b/src/main/java/net/minecraft/server/ChunkSection.java +@@ -1,8 +1,9 @@ + package net.minecraft.server; + +-import java.util.function.Predicate; +-import com.destroystokyo.paper.antixray.ChunkPacketInfo; // Paper - Anti-Xray - Add chunk packet info ++import com.destroystokyo.paper.antixray.ChunkPacketInfo; ++ + import javax.annotation.Nullable; ++import java.util.function.Predicate; + + public class ChunkSection { + +diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java +index 7e32a2eab92500857e8cc07837f106dc28b371ea..aa4c400e214775fb1e6bfefd11713c1ff9418ddf 100644 +--- a/src/main/java/net/minecraft/server/ChunkStatus.java ++++ b/src/main/java/net/minecraft/server/ChunkStatus.java +@@ -5,12 +5,13 @@ import com.google.common.collect.Lists; + import com.mojang.datafixers.util.Either; + import it.unimi.dsi.fastutil.ints.IntArrayList; + import it.unimi.dsi.fastutil.ints.IntList; ++ ++import javax.annotation.Nullable; + import java.util.Collections; + import java.util.EnumSet; + import java.util.List; + import java.util.concurrent.CompletableFuture; + import java.util.function.Function; +-import javax.annotation.Nullable; + + public class ChunkStatus { + +diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java +index 7f3401d5d7878e4a0f407e92bf110dbe7c7868a6..75818cd3f54dcd362f78842a640ce17f4c5913ef 100644 +--- a/src/main/java/net/minecraft/server/CombatTracker.java ++++ b/src/main/java/net/minecraft/server/CombatTracker.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Optional; +-import javax.annotation.Nullable; + + public class CombatTracker { + +diff --git a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java +index 3820acd65f3cd488dba964e6d9c458852570f4a0..1a802f7f8b6842858e936b73421240cf67fa38b9 100644 +--- a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java ++++ b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + ++import org.bukkit.command.CommandSender; ++ ++import javax.annotation.Nullable; + import java.text.SimpleDateFormat; + import java.util.Date; + import java.util.UUID; +-import javax.annotation.Nullable; +-import org.bukkit.command.CommandSender; + + public abstract class CommandBlockListenerAbstract implements ICommandListener { + +diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java +index 4e2a5a5b152b9d0eeba39bb4073d28890df0e757..c11ba2f1c4cfea9d32a432e473a2a82f06a1356a 100644 +--- a/src/main/java/net/minecraft/server/CommandDispatcher.java ++++ b/src/main/java/net/minecraft/server/CommandDispatcher.java +@@ -1,5 +1,6 @@ + package net.minecraft.server; + ++import com.google.common.base.Joiner; + import com.google.common.collect.Maps; + import com.mojang.brigadier.ParseResults; + import com.mojang.brigadier.StringReader; +@@ -10,19 +11,17 @@ import com.mojang.brigadier.builder.RequiredArgumentBuilder; + import com.mojang.brigadier.exceptions.CommandSyntaxException; + import com.mojang.brigadier.tree.CommandNode; + import com.mojang.brigadier.tree.RootCommandNode; +-import java.util.Iterator; +-import java.util.Map; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; ++import org.bukkit.event.player.PlayerCommandSendEvent; ++import org.bukkit.event.server.ServerCommandEvent; + +-// CraftBukkit start +-import com.google.common.base.Joiner; ++import javax.annotation.Nullable; + import java.util.Collection; ++import java.util.Iterator; + import java.util.LinkedHashSet; +-import org.bukkit.event.player.PlayerCommandSendEvent; +-import org.bukkit.event.server.ServerCommandEvent; ++import java.util.Map; ++import java.util.function.Predicate; + // CraftBukkit end + + public class CommandDispatcher { +diff --git a/src/main/java/net/minecraft/server/CommandEffect.java b/src/main/java/net/minecraft/server/CommandEffect.java +index ee1e642b22736b2b9b9f59cc7f2c3e9edc98796b..ddb9948d3f729dff5daa039f6fba099d46333012 100644 +--- a/src/main/java/net/minecraft/server/CommandEffect.java ++++ b/src/main/java/net/minecraft/server/CommandEffect.java +@@ -8,9 +8,10 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder; + import com.mojang.brigadier.builder.RequiredArgumentBuilder; + import com.mojang.brigadier.exceptions.CommandSyntaxException; + import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; ++ ++import javax.annotation.Nullable; + import java.util.Collection; + import java.util.Iterator; +-import javax.annotation.Nullable; + + public class CommandEffect { + +diff --git a/src/main/java/net/minecraft/server/CommandGamemode.java b/src/main/java/net/minecraft/server/CommandGamemode.java +index 8400fa356dd2c5a76ac7741d114bf066af8043c5..9ae005dbce25bc1abf5ee6c60aff7707c77691c7 100644 +--- a/src/main/java/net/minecraft/server/CommandGamemode.java ++++ b/src/main/java/net/minecraft/server/CommandGamemode.java +@@ -3,6 +3,7 @@ package net.minecraft.server; + import com.mojang.brigadier.arguments.ArgumentType; + import com.mojang.brigadier.builder.LiteralArgumentBuilder; + import com.mojang.brigadier.context.CommandContext; ++ + import java.util.Collection; + import java.util.Collections; + import java.util.Iterator; +diff --git a/src/main/java/net/minecraft/server/CommandListenerWrapper.java b/src/main/java/net/minecraft/server/CommandListenerWrapper.java +index a4995ddc82100bc460cd2021dcfa8389769d5da0..2829ea1b689286314c1d0c5579abd0c553aca405 100644 +--- a/src/main/java/net/minecraft/server/CommandListenerWrapper.java ++++ b/src/main/java/net/minecraft/server/CommandListenerWrapper.java +@@ -8,13 +8,14 @@ import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; + import com.mojang.brigadier.suggestion.Suggestions; + import com.mojang.brigadier.suggestion.SuggestionsBuilder; + import com.mojang.brigadier.tree.CommandNode; ++ ++import javax.annotation.Nullable; + import java.util.Collection; + import java.util.Iterator; + import java.util.Set; + import java.util.concurrent.CompletableFuture; + import java.util.function.BinaryOperator; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public class CommandListenerWrapper implements ICompletionProvider, com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource { // Paper + +diff --git a/src/main/java/net/minecraft/server/CommandReload.java b/src/main/java/net/minecraft/server/CommandReload.java +index 2e215558e862b4ddd8262b754cd4c51ba7e52946..0767395f07990f88d88ca1a8d9666ed7181c65f8 100644 +--- a/src/main/java/net/minecraft/server/CommandReload.java ++++ b/src/main/java/net/minecraft/server/CommandReload.java +@@ -2,11 +2,12 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import com.mojang.brigadier.builder.LiteralArgumentBuilder; +-import java.util.Collection; +-import java.util.Iterator; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import java.util.Collection; ++import java.util.Iterator; ++ + public class CommandReload { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/CommandSpreadPlayers.java b/src/main/java/net/minecraft/server/CommandSpreadPlayers.java +index c9f4b69874e693c8e5c3346f09db7b5014dcfb63..2a1baa58de9a1061e45dea46486ea8696d95d7d2 100644 +--- a/src/main/java/net/minecraft/server/CommandSpreadPlayers.java ++++ b/src/main/java/net/minecraft/server/CommandSpreadPlayers.java +@@ -10,12 +10,8 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder; + import com.mojang.brigadier.builder.RequiredArgumentBuilder; + import com.mojang.brigadier.exceptions.CommandSyntaxException; + import com.mojang.brigadier.exceptions.Dynamic4CommandExceptionType; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.Locale; +-import java.util.Map; +-import java.util.Random; +-import java.util.Set; ++ ++import java.util.*; + + public class CommandSpreadPlayers { + +diff --git a/src/main/java/net/minecraft/server/CommandTeleport.java b/src/main/java/net/minecraft/server/CommandTeleport.java +index 203373c3bb97d331ff6c6b9e21ae4cbc8b173fe6..c0934df435089d020c2e637ec6329d9bf9276c0f 100644 +--- a/src/main/java/net/minecraft/server/CommandTeleport.java ++++ b/src/main/java/net/minecraft/server/CommandTeleport.java +@@ -6,16 +6,12 @@ import com.mojang.brigadier.builder.RequiredArgumentBuilder; + import com.mojang.brigadier.exceptions.CommandSyntaxException; + import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; + import com.mojang.brigadier.tree.LiteralCommandNode; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.EnumSet; +-import java.util.Iterator; +-import java.util.Set; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.Location; + import org.bukkit.craftbukkit.CraftWorld; + import org.bukkit.event.entity.EntityTeleportEvent; ++ ++import javax.annotation.Nullable; ++import java.util.*; + // CraftBukkit end + + public class CommandTeleport { +diff --git a/src/main/java/net/minecraft/server/CommandTime.java b/src/main/java/net/minecraft/server/CommandTime.java +index b1fe8d51dc78ad4d8c08108c5bd8f95eefe2f953..97ea1e66ed7d5d85cf52b8eecc93abfc5c807166 100644 +--- a/src/main/java/net/minecraft/server/CommandTime.java ++++ b/src/main/java/net/minecraft/server/CommandTime.java +@@ -3,10 +3,10 @@ package net.minecraft.server; + import com.mojang.brigadier.arguments.ArgumentType; + import com.mojang.brigadier.arguments.IntegerArgumentType; + import com.mojang.brigadier.builder.LiteralArgumentBuilder; +-import java.util.Iterator; +-// CraftBukkit start + import org.bukkit.Bukkit; + import org.bukkit.event.world.TimeSkipEvent; ++ ++import java.util.Iterator; + // CrafBukkit end + + public class CommandTime { +diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java +index 44db4851e2e6901e816b34c2037d00948c0a2008..bd6e5f85f7cab597f1e7e076fe4305efbdf598b8 100644 +--- a/src/main/java/net/minecraft/server/Container.java ++++ b/src/main/java/net/minecraft/server/Container.java +@@ -1,22 +1,17 @@ + package net.minecraft.server; + ++import com.google.common.base.Preconditions; + import com.google.common.collect.Lists; + import com.google.common.collect.Sets; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Set; +-import javax.annotation.Nullable; +- +-// CraftBukkit start +-import com.google.common.base.Preconditions; +-import java.util.HashMap; +-import java.util.Map; + import org.bukkit.craftbukkit.inventory.CraftInventory; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.event.Event.Result; + import org.bukkit.event.inventory.InventoryDragEvent; + import org.bukkit.event.inventory.InventoryType; + import org.bukkit.inventory.InventoryView; ++ ++import javax.annotation.Nullable; ++import java.util.*; + // CraftBukkit end + + public abstract class Container { +diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java +index fc2038df89f25c07f6f853f6df41fe9b203c3585..2b55aa0f3444c3c5c3233083cb3693e4ccac3b6d 100644 +--- a/src/main/java/net/minecraft/server/ContainerAnvil.java ++++ b/src/main/java/net/minecraft/server/ContainerAnvil.java +@@ -1,13 +1,12 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.Map; + import org.apache.commons.lang3.StringUtils; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.inventory.CraftInventoryView; ++ ++import java.util.Iterator; ++import java.util.Map; + // CraftBukkit end + + public class ContainerAnvil extends ContainerAnvilAbstract { +diff --git a/src/main/java/net/minecraft/server/ContainerBeacon.java b/src/main/java/net/minecraft/server/ContainerBeacon.java +index 288390bf9210f0fcc7c85e3093a4924614dc1573..15e2f03d11ec35477401daa5e104ea76fd5de82b 100644 +--- a/src/main/java/net/minecraft/server/ContainerBeacon.java ++++ b/src/main/java/net/minecraft/server/ContainerBeacon.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit ++import org.bukkit.craftbukkit.inventory.CraftInventoryView; + + public class ContainerBeacon extends Container { + +diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTable.java b/src/main/java/net/minecraft/server/ContainerEnchantTable.java +index 6b0e2c7fe0386b97b513be84d22bbcae7bb57ae8..3722c14e2491cd929cad00f9bd971a1fc2f56694 100644 +--- a/src/main/java/net/minecraft/server/ContainerEnchantTable.java ++++ b/src/main/java/net/minecraft/server/ContainerEnchantTable.java +@@ -1,11 +1,5 @@ + package net.minecraft.server; + +-import java.util.List; +-import java.util.Random; +- +-// CraftBukkit start +-import java.util.Collections; +-import java.util.Map; + import org.bukkit.Location; + import org.bukkit.NamespacedKey; + import org.bukkit.craftbukkit.inventory.CraftInventoryEnchanting; +@@ -13,9 +7,13 @@ import org.bukkit.craftbukkit.inventory.CraftInventoryView; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; + import org.bukkit.enchantments.EnchantmentOffer; ++import org.bukkit.entity.Player; + import org.bukkit.event.enchantment.EnchantItemEvent; + import org.bukkit.event.enchantment.PrepareItemEnchantEvent; +-import org.bukkit.entity.Player; ++ ++import java.util.List; ++import java.util.Map; ++import java.util.Random; + // CraftBukkit end + + public class ContainerEnchantTable extends Container { +diff --git a/src/main/java/net/minecraft/server/ContainerGrindstone.java b/src/main/java/net/minecraft/server/ContainerGrindstone.java +index 869353bdcda753f90872a5fbad7adfa9d25447a7..667099bb130038b88bc2e1c4be076e8d725a5601 100644 +--- a/src/main/java/net/minecraft/server/ContainerGrindstone.java ++++ b/src/main/java/net/minecraft/server/ContainerGrindstone.java +@@ -1,15 +1,14 @@ + package net.minecraft.server; + +-import java.util.HashMap; +-import java.util.Iterator; +-import java.util.Map; +-import java.util.Map.Entry; +-import java.util.stream.Collectors; +-// CraftBukkit start + import org.bukkit.Location; + import org.bukkit.craftbukkit.inventory.CraftInventoryGrindstone; + import org.bukkit.craftbukkit.inventory.CraftInventoryView; + import org.bukkit.entity.Player; ++ ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.Map; ++import java.util.Map.Entry; + // CraftBukkit end + + public class ContainerGrindstone extends Container { +diff --git a/src/main/java/net/minecraft/server/ContainerMerchant.java b/src/main/java/net/minecraft/server/ContainerMerchant.java +index a63446048d9930ea017e417618012239df354a31..d7f3f1dabf5cef892ff51566bbacd286bc18fd1e 100644 +--- a/src/main/java/net/minecraft/server/ContainerMerchant.java ++++ b/src/main/java/net/minecraft/server/ContainerMerchant.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit ++import org.bukkit.craftbukkit.inventory.CraftInventoryView; + + public class ContainerMerchant extends Container { + +diff --git a/src/main/java/net/minecraft/server/ContainerSmithing.java b/src/main/java/net/minecraft/server/ContainerSmithing.java +index 38fb4717e7f52bb41a58e74207fc828c58a3c14c..b541ee24b5bf4b5fb5cd1a6e197fa76b3e3596c3 100644 +--- a/src/main/java/net/minecraft/server/ContainerSmithing.java ++++ b/src/main/java/net/minecraft/server/ContainerSmithing.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + +-import java.util.List; +-import javax.annotation.Nullable; ++import org.bukkit.craftbukkit.inventory.CraftInventoryView; + +-import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit ++import javax.annotation.Nullable; ++import java.util.List; + + public class ContainerSmithing extends ContainerAnvilAbstract { + +diff --git a/src/main/java/net/minecraft/server/ContainerStonecutter.java b/src/main/java/net/minecraft/server/ContainerStonecutter.java +index a235f6406dc06ceafea6fbe429bf595da2fea07c..0e1630424aa112df9e602f782cc430c8ffb95d4a 100644 +--- a/src/main/java/net/minecraft/server/ContainerStonecutter.java ++++ b/src/main/java/net/minecraft/server/ContainerStonecutter.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import java.util.List; +-// CraftBukkit start + import org.bukkit.craftbukkit.inventory.CraftInventoryStonecutter; + import org.bukkit.craftbukkit.inventory.CraftInventoryView; + import org.bukkit.entity.Player; ++ ++import java.util.List; + // CraftBukkit end + + public class ContainerStonecutter extends Container { +diff --git a/src/main/java/net/minecraft/server/ContainerWorkbench.java b/src/main/java/net/minecraft/server/ContainerWorkbench.java +index 0700af8f1141eab1a996c5aea78c1aaa19484514..7d6a2cc31e9082c33ac8fab99721639c280c54be 100644 +--- a/src/main/java/net/minecraft/server/ContainerWorkbench.java ++++ b/src/main/java/net/minecraft/server/ContainerWorkbench.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + +-import java.util.Optional; +-// CraftBukkit start + import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting; + import org.bukkit.craftbukkit.inventory.CraftInventoryView; ++ ++import java.util.Optional; + // CraftBukkit end + + public class ContainerWorkbench extends ContainerRecipeBook { +diff --git a/src/main/java/net/minecraft/server/Convertable.java b/src/main/java/net/minecraft/server/Convertable.java +index 079304e8b1abb2c37febef536b1dd9f76e5ad47d..c0f2e44c6c54e22f32d5df6cbc9e926387749383 100644 +--- a/src/main/java/net/minecraft/server/Convertable.java ++++ b/src/main/java/net/minecraft/server/Convertable.java +@@ -9,12 +9,11 @@ import com.mojang.serialization.DataResult; + import com.mojang.serialization.Dynamic; + import com.mojang.serialization.DynamicOps; + import com.mojang.serialization.Lifecycle; +-import java.io.File; +-import java.io.FileInputStream; +-import java.io.FileOutputStream; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.OutputStream; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; ++import java.io.*; + import java.nio.file.Files; + import java.nio.file.LinkOption; + import java.time.format.DateTimeFormatter; +@@ -24,9 +23,6 @@ import java.time.temporal.ChronoField; + import java.util.Map; + import java.util.Optional; + import java.util.function.BiFunction; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class Convertable { + +diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java +index 7de6e116a7e301754c637b68be39c30f610a04d7..83b8f9a7419db0dd7b9ffb36652290fbdafb3d8d 100644 +--- a/src/main/java/net/minecraft/server/CraftingManager.java ++++ b/src/main/java/net/minecraft/server/CraftingManager.java +@@ -1,23 +1,16 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; +-import com.google.common.collect.ImmutableMap.Builder; + import com.google.common.collect.Maps; +-import com.google.gson.Gson; +-import com.google.gson.GsonBuilder; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; +-import com.google.gson.JsonParseException; +-import com.google.gson.JsonSyntaxException; ++import com.google.gson.*; ++import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; + + import java.util.*; + import java.util.Map.Entry; + import java.util.stream.Collectors; + import java.util.stream.Stream; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; +- +-import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; // CraftBukkit + + public class CraftingManager extends ResourceDataJson { + +diff --git a/src/main/java/net/minecraft/server/CrashReport.java b/src/main/java/net/minecraft/server/CrashReport.java +index 7b5b8fcac615ab517b4dd8ad9fab17d635f716bc..8e48cbf130d1033f8ea65bbbe90384782b04f283 100644 +--- a/src/main/java/net/minecraft/server/CrashReport.java ++++ b/src/main/java/net/minecraft/server/CrashReport.java +@@ -1,11 +1,12 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import java.io.File; +-import java.io.FileOutputStream; +-import java.io.OutputStreamWriter; +-import java.io.PrintWriter; +-import java.io.StringWriter; ++import org.apache.commons.io.IOUtils; ++import org.apache.commons.lang3.ArrayUtils; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import java.io.*; + import java.nio.charset.StandardCharsets; + import java.text.SimpleDateFormat; + import java.util.Date; +@@ -14,10 +15,6 @@ import java.util.List; + import java.util.StringJoiner; + import java.util.concurrent.CompletionException; + import java.util.stream.Collectors; +-import org.apache.commons.io.IOUtils; +-import org.apache.commons.lang3.ArrayUtils; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class CrashReport { + +diff --git a/src/main/java/net/minecraft/server/CriterionTriggerAbstract.java b/src/main/java/net/minecraft/server/CriterionTriggerAbstract.java +index 5fd81933f8ba30d165fb3fdf25aaf94917637539..3d9054b44fcaac45f3d37ec1b3b7cd66a55aaccc 100644 +--- a/src/main/java/net/minecraft/server/CriterionTriggerAbstract.java ++++ b/src/main/java/net/minecraft/server/CriterionTriggerAbstract.java +@@ -1,12 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import com.google.common.collect.Maps; + import com.google.common.collect.Sets; + import com.google.gson.JsonObject; ++ + import java.util.Iterator; + import java.util.List; +-import java.util.Map; + import java.util.Set; + import java.util.function.Predicate; + +diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java +index 67e1b153a6f2ff9547dd03fcf4abcbea851e69f9..759dbd50d584ed2e1ff836c90526d50d59d15691 100644 +--- a/src/main/java/net/minecraft/server/CustomFunction.java ++++ b/src/main/java/net/minecraft/server/CustomFunction.java +@@ -4,10 +4,11 @@ import com.google.common.collect.Lists; + import com.mojang.brigadier.ParseResults; + import com.mojang.brigadier.StringReader; + import com.mojang.brigadier.exceptions.CommandSyntaxException; ++ ++import javax.annotation.Nullable; + import java.util.ArrayDeque; + import java.util.List; + import java.util.Optional; +-import javax.annotation.Nullable; + + public class CustomFunction { + +diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java +index ddfd127d0e618d373086caf2c0ce6ca218a0b021..52150f3b71552ecbd721e464be1533a759309d25 100644 +--- a/src/main/java/net/minecraft/server/CustomFunctionData.java ++++ b/src/main/java/net/minecraft/server/CustomFunctionData.java +@@ -1,11 +1,8 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import java.util.ArrayDeque; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Optional; ++ ++import java.util.*; + + public class CustomFunctionData { + +diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java +index ed817893e6955059d026b0466c2fcd20a879769b..d109499e811123d623bed4315201bcfd71ea77fe 100644 +--- a/src/main/java/net/minecraft/server/DataBits.java ++++ b/src/main/java/net/minecraft/server/DataBits.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + +-import java.util.function.IntConsumer; +-import javax.annotation.Nullable; + import org.apache.commons.lang3.Validate; + ++import javax.annotation.Nullable; ++import java.util.function.IntConsumer; ++ + public class DataBits { + + private static final int[] a = new int[]{-1, -1, 0, Integer.MIN_VALUE, 0, 0, 1431655765, 1431655765, 0, Integer.MIN_VALUE, 0, 1, 858993459, 858993459, 0, 715827882, 715827882, 0, 613566756, 613566756, 0, Integer.MIN_VALUE, 0, 2, 477218588, 477218588, 0, 429496729, 429496729, 0, 390451572, 390451572, 0, 357913941, 357913941, 0, 330382099, 330382099, 0, 306783378, 306783378, 0, 286331153, 286331153, 0, Integer.MIN_VALUE, 0, 3, 252645135, 252645135, 0, 238609294, 238609294, 0, 226050910, 226050910, 0, 214748364, 214748364, 0, 204522252, 204522252, 0, 195225786, 195225786, 0, 186737708, 186737708, 0, 178956970, 178956970, 0, 171798691, 171798691, 0, 165191049, 165191049, 0, 159072862, 159072862, 0, 153391689, 153391689, 0, 148102320, 148102320, 0, 143165576, 143165576, 0, 138547332, 138547332, 0, Integer.MIN_VALUE, 0, 4, 130150524, 130150524, 0, 126322567, 126322567, 0, 122713351, 122713351, 0, 119304647, 119304647, 0, 116080197, 116080197, 0, 113025455, 113025455, 0, 110127366, 110127366, 0, 107374182, 107374182, 0, 104755299, 104755299, 0, 102261126, 102261126, 0, 99882960, 99882960, 0, 97612893, 97612893, 0, 95443717, 95443717, 0, 93368854, 93368854, 0, 91382282, 91382282, 0, 89478485, 89478485, 0, 87652393, 87652393, 0, 85899345, 85899345, 0, 84215045, 84215045, 0, 82595524, 82595524, 0, 81037118, 81037118, 0, 79536431, 79536431, 0, 78090314, 78090314, 0, 76695844, 76695844, 0, 75350303, 75350303, 0, 74051160, 74051160, 0, 72796055, 72796055, 0, 71582788, 71582788, 0, 70409299, 70409299, 0, 69273666, 69273666, 0, 68174084, 68174084, 0, Integer.MIN_VALUE, 0, 5}; +diff --git a/src/main/java/net/minecraft/server/DataConverterFlatten.java b/src/main/java/net/minecraft/server/DataConverterFlatten.java +index a68829e2c671632fa0c642cf14b4e7c4e5e50c92..8d1f58aa2601fa79f68731b68e9a8e09629efeb7 100644 +--- a/src/main/java/net/minecraft/server/DataConverterFlatten.java ++++ b/src/main/java/net/minecraft/server/DataConverterFlatten.java +@@ -2,23 +2,17 @@ package net.minecraft.server; + + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; +-import com.mojang.datafixers.DSL; +-import com.mojang.datafixers.DataFix; +-import com.mojang.datafixers.DataFixUtils; +-import com.mojang.datafixers.OpticFinder; +-import com.mojang.datafixers.TypeRewriteRule; +-import com.mojang.datafixers.Typed; ++import com.mojang.datafixers.*; + import com.mojang.datafixers.schemas.Schema; + import com.mojang.datafixers.types.Type; + import com.mojang.datafixers.util.Pair; + import com.mojang.serialization.Dynamic; + ++import javax.annotation.Nullable; + import java.util.HashSet; + import java.util.Map; + import java.util.Optional; + import java.util.Set; +-import java.util.stream.Collectors; +-import javax.annotation.Nullable; + + public class DataConverterFlatten extends DataFix { + +diff --git a/src/main/java/net/minecraft/server/DataConverterMap.java b/src/main/java/net/minecraft/server/DataConverterMap.java +index 2a3bcf8066047ba0b54d6de4d6988fba33773a0b..85bb4850b79f15f07fdf723e79a236d755b8b330 100644 +--- a/src/main/java/net/minecraft/server/DataConverterMap.java ++++ b/src/main/java/net/minecraft/server/DataConverterMap.java +@@ -1,14 +1,11 @@ + package net.minecraft.server; + +-import com.mojang.datafixers.DSL; +-import com.mojang.datafixers.DataFix; +-import com.mojang.datafixers.OpticFinder; +-import com.mojang.datafixers.TypeRewriteRule; +-import com.mojang.datafixers.Typed; ++import com.mojang.datafixers.*; + import com.mojang.datafixers.schemas.Schema; + import com.mojang.datafixers.types.Type; + import com.mojang.datafixers.util.Pair; + import com.mojang.serialization.Dynamic; ++ + import java.util.Objects; + import java.util.Optional; + +diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java +index 5d807082281527c78a08d01430e42b3ecee6d2cf..6953ca641f8a7a8481254cadda2ad83cd809767a 100644 +--- a/src/main/java/net/minecraft/server/DataConverterRegistry.java ++++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java +@@ -6,6 +6,7 @@ import com.mojang.datafixers.DataFixer; + import com.mojang.datafixers.DataFixerBuilder; + import com.mojang.datafixers.Typed; + import com.mojang.datafixers.schemas.Schema; ++ + import java.util.Map; + import java.util.Objects; + import java.util.function.BiFunction; +diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java +index 75b721933ccbe8edc1cd7ea5cc4562214e26b66d..f37489d87afe759664152d76de03cca08e2cfe7d 100644 +--- a/src/main/java/net/minecraft/server/DataPalette.java ++++ b/src/main/java/net/minecraft/server/DataPalette.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.function.Predicate; + import javax.annotation.Nullable; ++import java.util.function.Predicate; + + public interface DataPalette { + +diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java +index 52948a84b89554646c9ec1fd13d6d3c9e7cbf996..eada694a8e57284bdda477ccca2c250285c34fcd 100644 +--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java ++++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java +@@ -1,14 +1,12 @@ + package net.minecraft.server; + ++import com.destroystokyo.paper.antixray.ChunkPacketInfo; + import it.unimi.dsi.fastutil.ints.Int2IntMap; + import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; +-import com.destroystokyo.paper.antixray.ChunkPacketInfo; // Paper - Anti-Xray - Add chunk packet info +-import java.util.Arrays; +-import java.util.Objects; ++ + import java.util.concurrent.locks.ReentrantLock; + import java.util.function.Function; + import java.util.function.Predicate; +-import java.util.stream.Collectors; + + public class DataPaletteBlock implements DataPaletteExpandable { + +diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java +index d8147567b4dfdc48b86f6349fca084fdb4381c42..d3105bf3dd35ad26d3df64c03174cedcdfaca178 100644 +--- a/src/main/java/net/minecraft/server/DataWatcher.java ++++ b/src/main/java/net/minecraft/server/DataWatcher.java +@@ -4,19 +4,14 @@ import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import io.netty.handler.codec.DecoderException; + import io.netty.handler.codec.EncoderException; +-import java.io.IOException; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.concurrent.locks.ReadWriteLock; +-import java.util.concurrent.locks.ReentrantReadWriteLock; +-import javax.annotation.Nullable; + import org.apache.commons.lang3.ObjectUtils; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; ++import java.io.IOException; ++import java.util.*; ++ + public class DataWatcher { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java +index 73f4d52f24d042e287dab351edd4bfa4e22046b4..7ae538a6a7a9766f8443c0dd7cf908a028d3f9bb 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/DedicatedServer.java +@@ -1,38 +1,28 @@ + package net.minecraft.server; + ++import co.aikar.timings.MinecraftTimings; + import com.google.common.base.Strings; +-import com.google.common.collect.Lists; + import com.mojang.authlib.GameProfile; + import com.mojang.authlib.GameProfileRepository; + import com.mojang.authlib.minecraft.MinecraftSessionService; + import com.mojang.datafixers.DataFixer; +-import java.io.BufferedReader; ++import org.apache.logging.log4j.Level; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++import org.bukkit.command.CommandSender; ++import org.bukkit.craftbukkit.util.Waitable; ++import org.bukkit.event.server.RemoteServerCommandEvent; ++import org.bukkit.event.server.ServerCommandEvent; ++ ++import javax.annotation.Nullable; + import java.io.File; + import java.io.IOException; +-import java.io.InputStreamReader; + import java.net.InetAddress; + import java.net.Proxy; +-import java.nio.charset.StandardCharsets; +-import java.util.Collections; +-import java.util.List; + import java.util.Locale; + import java.util.Optional; + import java.util.function.BooleanSupplier; + import java.util.regex.Pattern; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import java.io.PrintStream; +-import org.apache.logging.log4j.Level; +- +-import org.bukkit.command.CommandSender; +-import org.bukkit.craftbukkit.LoggerOutputStream; +-import co.aikar.timings.MinecraftTimings; // Paper +-import org.bukkit.event.server.ServerCommandEvent; +-import org.bukkit.craftbukkit.util.Waitable; +-import org.bukkit.event.server.RemoteServerCommandEvent; + // CraftBukkit end + + public class DedicatedServer extends MinecraftServer implements IMinecraftServer { +diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java +index 6786fd0947724069366a2375c710ec518a92f2b1..addfec76b34a0af11e70d74ca8540155ba7254a3 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java ++++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java +@@ -1,8 +1,9 @@ + package net.minecraft.server; + ++import joptsimple.OptionSet; ++ + import java.util.Properties; + import java.util.concurrent.TimeUnit; +-import joptsimple.OptionSet; // CraftBukkit + + public class DedicatedServerProperties extends PropertyManager { + +diff --git a/src/main/java/net/minecraft/server/DedicatedServerSettings.java b/src/main/java/net/minecraft/server/DedicatedServerSettings.java +index 34f2ba53dadd69b48077db6da1aada32cb65bb70..659b302de68d8c5ec598aa499955aa05275d76a9 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServerSettings.java ++++ b/src/main/java/net/minecraft/server/DedicatedServerSettings.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + +-import java.util.function.UnaryOperator; +-// CraftBukkit start +-import java.io.File; + import joptsimple.OptionSet; ++ ++import java.io.File; ++import java.util.function.UnaryOperator; + // CraftBukkit end + + public class DedicatedServerSettings { +diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java +index 25323eccfe0cffd6e6d17dab111d9a473e11333f..4bc8c48576ca91bd4efe02c94eaa4b8f1f740b2c 100644 +--- a/src/main/java/net/minecraft/server/DefinedStructure.java ++++ b/src/main/java/net/minecraft/server/DefinedStructure.java +@@ -4,9 +4,8 @@ import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import com.mojang.datafixers.util.Pair; + +-import java.util.*; +-import java.util.stream.Collectors; + import javax.annotation.Nullable; ++import java.util.*; + + public class DefinedStructure { + +diff --git a/src/main/java/net/minecraft/server/DefinedStructureManager.java b/src/main/java/net/minecraft/server/DefinedStructureManager.java +index 595789d2ba8571f8375a17cabd26a06040523849..162b6989ff3b2ab0513910ad86b84dc6d29bad81 100644 +--- a/src/main/java/net/minecraft/server/DefinedStructureManager.java ++++ b/src/main/java/net/minecraft/server/DefinedStructureManager.java +@@ -2,19 +2,15 @@ package net.minecraft.server; + + import com.google.common.collect.Maps; + import com.mojang.datafixers.DataFixer; +-import java.io.FileInputStream; +-import java.io.FileNotFoundException; +-import java.io.FileOutputStream; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.OutputStream; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; ++import java.io.*; + import java.nio.file.Files; + import java.nio.file.InvalidPathException; + import java.nio.file.LinkOption; + import java.util.Map; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class DefinedStructureManager { + +diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorShears.java b/src/main/java/net/minecraft/server/DispenseBehaviorShears.java +index fbd961f6d306c9173839412f48ac0698a65a3461..db743d81ea4cda5cafcccd01f3f120da9449dca4 100644 +--- a/src/main/java/net/minecraft/server/DispenseBehaviorShears.java ++++ b/src/main/java/net/minecraft/server/DispenseBehaviorShears.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.List; +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.event.block.BlockDispenseEvent; ++ ++import java.util.Iterator; ++import java.util.List; + // CraftBukkit end + + public class DispenseBehaviorShears extends DispenseBehaviorMaybe { +diff --git a/src/main/java/net/minecraft/server/DispenserRegistry.java b/src/main/java/net/minecraft/server/DispenserRegistry.java +index fdb11cfc423f64a358a0ba7a828b338c11388cae..8aabda32c5bd474e6ff6e2c08d97063ac44c5ce9 100644 +--- a/src/main/java/net/minecraft/server/DispenserRegistry.java ++++ b/src/main/java/net/minecraft/server/DispenserRegistry.java +@@ -1,20 +1,12 @@ + package net.minecraft.server; + ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.io.PrintStream; + import java.util.Set; + import java.util.TreeSet; + import java.util.function.Function; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import java.util.List; +-import org.bukkit.Location; +-import org.bukkit.TreeType; +-import org.bukkit.craftbukkit.inventory.CraftItemStack; +-import org.bukkit.craftbukkit.util.DummyGeneratorAccess; +-import org.bukkit.event.block.BlockDispenseEvent; +-import org.bukkit.event.world.StructureGrowEvent; + // CraftBukkit end + + public class DispenserRegistry { +diff --git a/src/main/java/net/minecraft/server/DragonControllerManager.java b/src/main/java/net/minecraft/server/DragonControllerManager.java +index 551387dc06a42bf7e45fe09f59fd92133edcad89..504761ac9fde42edb4cbaf28136d6f6e41c7a843 100644 +--- a/src/main/java/net/minecraft/server/DragonControllerManager.java ++++ b/src/main/java/net/minecraft/server/DragonControllerManager.java +@@ -2,7 +2,6 @@ package net.minecraft.server; + + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftEnderDragon; + import org.bukkit.event.entity.EnderDragonChangePhaseEvent; + // CraftBukkit end +diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java +index ac546ff959510a2d0120c24c90bf13ff83873161..892be05e196ffed7c8bd59fff0cba89a614f5d66 100644 +--- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java ++++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; ++ + public class DragonControllerStrafe extends AbstractDragonController { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/EULA.java b/src/main/java/net/minecraft/server/EULA.java +index e70da06948abf2aa2223a037aeb5f58fb0a466e3..30921ef96de4e98316634e2a55307b13b0c28f65 100644 +--- a/src/main/java/net/minecraft/server/EULA.java ++++ b/src/main/java/net/minecraft/server/EULA.java +@@ -1,14 +1,14 @@ + package net.minecraft.server; + ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.io.File; + import java.io.InputStream; + import java.io.OutputStream; + import java.nio.file.Files; + import java.util.Properties; + +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; +- + public class EULA { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/EnchantmentFrostWalker.java b/src/main/java/net/minecraft/server/EnchantmentFrostWalker.java +index 176be2e4d0d23d3e7967b6e0e99d060a96b3d976..4d769a513216c56ae93944cd99d091fa3ad97e51 100644 +--- a/src/main/java/net/minecraft/server/EnchantmentFrostWalker.java ++++ b/src/main/java/net/minecraft/server/EnchantmentFrostWalker.java +@@ -1,9 +1,6 @@ + package net.minecraft.server; + + import java.util.Iterator; +-// CraftBukkit start +-import org.bukkit.craftbukkit.util.CraftMagicNumbers; +-import org.bukkit.event.block.EntityBlockFormEvent; + // CraftBukkit end + + public class EnchantmentFrostWalker extends Enchantment { +diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java +index 7a4768c32c426ef3cf16904e0f565a7f8fdc753f..ed7692c65b54e7b0f37794f6bd07141e32122d67 100644 +--- a/src/main/java/net/minecraft/server/EnchantmentManager.java ++++ b/src/main/java/net/minecraft/server/EnchantmentManager.java +@@ -2,17 +2,14 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Map.Entry; +-import java.util.Random; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; + import org.apache.commons.lang3.mutable.MutableFloat; + import org.apache.commons.lang3.mutable.MutableInt; + ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.Map.Entry; ++import java.util.function.Predicate; ++ + public class EnchantmentManager { + + public static int getEnchantmentLevel(Enchantment enchantment, ItemStack itemstack) { +diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java +index e2c1de7ab246f1b4c8add06c513afc2eca97d796..589f00d27255aa1b227fea7c19a27862321c83ef 100644 +--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java ++++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java +@@ -1,21 +1,13 @@ + package net.minecraft.server; + +-import com.google.common.collect.ContiguousSet; +-import com.google.common.collect.DiscreteDomain; +-import com.google.common.collect.Lists; +-import com.google.common.collect.Range; +-import com.google.common.collect.Sets; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Random; +-import java.util.Set; +-import java.util.UUID; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; ++import com.google.common.collect.*; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.function.Predicate; ++ + public class EnderDragonBattle { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index de745c8678f5dca0a939afcd45f2cab5fae3c4f1..1779f7756a7093b558bcfc7ce96559558b911a92 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -2,11 +2,10 @@ package net.minecraft.server; + + import co.aikar.timings.MinecraftTimings; + import co.aikar.timings.Timing; +-import dev.tr7zw.yatopia.YatopiaConfig; +- + import com.google.common.collect.Iterables; + import com.google.common.collect.Lists; + import com.google.common.collect.Sets; ++import dev.tr7zw.yatopia.YatopiaConfig; + import it.unimi.dsi.fastutil.objects.Object2DoubleArrayMap; + import it.unimi.dsi.fastutil.objects.Object2DoubleMap; + import org.apache.logging.log4j.LogManager; +@@ -23,12 +22,7 @@ import org.bukkit.entity.Hanging; + import org.bukkit.entity.LivingEntity; + import org.bukkit.entity.Pose; + import org.bukkit.entity.Vehicle; +-import org.bukkit.event.entity.EntityAirChangeEvent; +-import org.bukkit.event.entity.EntityCombustByEntityEvent; +-import org.bukkit.event.entity.EntityCombustEvent; +-import org.bukkit.event.entity.EntityDropItemEvent; +-import org.bukkit.event.entity.EntityPortalEvent; +-import org.bukkit.event.entity.EntityPoseChangeEvent; ++import org.bukkit.event.entity.*; + import org.bukkit.event.hanging.HangingBreakByEntityEvent; + import org.bukkit.event.player.PlayerTeleportEvent; + import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; +@@ -37,16 +31,7 @@ import org.bukkit.event.vehicle.VehicleExitEvent; + import org.bukkit.plugin.PluginManager; + + import javax.annotation.Nullable; +-import java.util.Arrays; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Locale; +-import java.util.Optional; +-import java.util.Random; +-import java.util.Set; +-import java.util.UUID; ++import java.util.*; + import java.util.concurrent.atomic.AtomicInteger; + import java.util.stream.Stream; + +diff --git a/src/main/java/net/minecraft/server/EntityAnimal.java b/src/main/java/net/minecraft/server/EntityAnimal.java +index b1a41ca53462e50dc0d5cabfcd91579908c07b62..2b7caab9e4b150b260603b0d2481f3d2e94f6fea 100644 +--- a/src/main/java/net/minecraft/server/EntityAnimal.java ++++ b/src/main/java/net/minecraft/server/EntityAnimal.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + +-import java.util.Random; +-import java.util.UUID; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.EntityEnterLoveModeEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Random; ++import java.util.UUID; + // CraftBukkit end + + public abstract class EntityAnimal extends EntityAgeable { +diff --git a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java +index a6721a8872a5aae52eb39118bc490b2d2ea0a980..5a9157697e9b3b9dbd78aa20561c030957fd1243 100644 +--- a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java ++++ b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java +@@ -4,18 +4,14 @@ import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import com.mojang.brigadier.StringReader; + import com.mojang.brigadier.exceptions.CommandSyntaxException; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Map.Entry; +-import java.util.UUID; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftLivingEntity; + import org.bukkit.entity.LivingEntity; ++ ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.Map.Entry; + // CraftBukkit end + + public class EntityAreaEffectCloud extends Entity { +diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java +index 98b0f1efb506803dfd213ad45a48adb365094a83..c4257b33f28a8cb6c99ad34d9226422e5ef4bfc0 100644 +--- a/src/main/java/net/minecraft/server/EntityArmorStand.java ++++ b/src/main/java/net/minecraft/server/EntityArmorStand.java +@@ -1,17 +1,16 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.List; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; +- +-// CraftBukkit start +-import org.bukkit.inventory.EquipmentSlot; + import org.bukkit.craftbukkit.CraftEquipmentSlot; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.entity.ArmorStand; + import org.bukkit.entity.Player; + import org.bukkit.event.player.PlayerArmorStandManipulateEvent; ++import org.bukkit.inventory.EquipmentSlot; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.List; ++import java.util.function.Predicate; + // CraftBukkit end + + public class EntityArmorStand extends EntityLiving { +diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java +index 0d43eb8e1712d1b98888db7579bc343ccb1e8989..2a659eb7bc7766663828a6547da9c1b3944a90a2 100644 +--- a/src/main/java/net/minecraft/server/EntityArrow.java ++++ b/src/main/java/net/minecraft/server/EntityArrow.java +@@ -2,15 +2,14 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import it.unimi.dsi.fastutil.ints.IntOpenHashSet; ++import org.bukkit.event.entity.EntityCombustByEntityEvent; ++import org.bukkit.event.player.PlayerPickupArrowEvent; ++ ++import javax.annotation.Nullable; + import java.util.Arrays; + import java.util.Collection; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; +- +-// CraftBukkit start +-import org.bukkit.event.entity.EntityCombustByEntityEvent; +-import org.bukkit.event.player.PlayerPickupArrowEvent; + // CraftBukkit end + + public abstract class EntityArrow extends IProjectile { +diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java +index 3dd3b8913e345471f971c4ef55bb91200eb50a33..781cadf1471cf8aa405af406bc9ae8db01d6eb8f 100644 +--- a/src/main/java/net/minecraft/server/EntityBat.java ++++ b/src/main/java/net/minecraft/server/EntityBat.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + import java.time.LocalDate; + import java.time.temporal.ChronoField; + import java.util.Random; +-import javax.annotation.Nullable; +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class EntityBat extends EntityAmbient { + +diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java +index c4c3ef500b9b8465644a0b7712f43ba35ad3acc1..776f4df79ac8ffad2e876e400df131f5c5691faf 100644 +--- a/src/main/java/net/minecraft/server/EntityBee.java ++++ b/src/main/java/net/minecraft/server/EntityBee.java +@@ -1,16 +1,12 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import java.util.Comparator; +-import java.util.EnumSet; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Optional; +-import java.util.UUID; ++ ++import javax.annotation.Nullable; ++import java.util.*; + import java.util.function.Predicate; + import java.util.stream.Collectors; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityBird { + +diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java +index 409e0ac0a2aaccda29f7cc146dbccdd45de80e9f..e762b4db13286bd7d973d240ca3da95b9bbab57f 100644 +--- a/src/main/java/net/minecraft/server/EntityBoat.java ++++ b/src/main/java/net/minecraft/server/EntityBoat.java +@@ -1,16 +1,15 @@ + package net.minecraft.server; + + import com.google.common.collect.UnmodifiableIterator; +-import java.util.List; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.Location; + import org.bukkit.entity.Vehicle; + import org.bukkit.event.vehicle.VehicleDamageEvent; + import org.bukkit.event.vehicle.VehicleDestroyEvent; + import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; + import org.bukkit.event.vehicle.VehicleMoveEvent; ++ ++import javax.annotation.Nullable; ++import java.util.List; + // CraftBukkit end + + public class EntityBoat extends Entity { +diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java +index 20497c3962a2d025b11f66b4659402c9217825cf..2fad3a1ae884726f431d8e5f5106134dec322309 100644 +--- a/src/main/java/net/minecraft/server/EntityCat.java ++++ b/src/main/java/net/minecraft/server/EntityCat.java +@@ -1,12 +1,13 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Map; + import java.util.Random; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class EntityCat extends EntityTameableAnimal { + +diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java +index 5e7f3af37b7cb068183fc2a7637b4c770fd5f936..46c64aa6b0676635a48452818a99322a396f0441 100644 +--- a/src/main/java/net/minecraft/server/EntityCreeper.java ++++ b/src/main/java/net/minecraft/server/EntityCreeper.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + +-import java.util.Collection; +-import java.util.Iterator; +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.CreatureSpawnEvent; + import org.bukkit.event.entity.ExplosionPrimeEvent; ++ ++import java.util.Collection; ++import java.util.Iterator; + // CraftBukkit end + + public class EntityCreeper extends EntityMonster { +diff --git a/src/main/java/net/minecraft/server/EntityDolphin.java b/src/main/java/net/minecraft/server/EntityDolphin.java +index 053ca43e5089b098be1aaf48519848ecb04428bc..f0adab12020fa8adb2483cad7f945c4b66763cba 100644 +--- a/src/main/java/net/minecraft/server/EntityDolphin.java ++++ b/src/main/java/net/minecraft/server/EntityDolphin.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.EnumSet; + import java.util.List; + import java.util.Random; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class EntityDolphin extends EntityWaterAnimal { + +diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java +index e6425bdf1a85e773f5555db1aebe7e159f7cd37c..d8a8c62daa9bceb98ec70f745c351e6d162d35d8 100644 +--- a/src/main/java/net/minecraft/server/EntityDrowned.java ++++ b/src/main/java/net/minecraft/server/EntityDrowned.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.EnumSet; + import java.util.Random; +-import javax.annotation.Nullable; + + public class EntityDrowned extends EntityZombie implements IRangedEntity { + +diff --git a/src/main/java/net/minecraft/server/EntityEnderCrystal.java b/src/main/java/net/minecraft/server/EntityEnderCrystal.java +index 21dfe7f4251300873f2c305c1a02467b86d1bcfe..be5c79102e6dcb60061267c3d9a5a97386d09ccc 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderCrystal.java ++++ b/src/main/java/net/minecraft/server/EntityEnderCrystal.java +@@ -1,11 +1,10 @@ + package net.minecraft.server; + +-import java.util.Optional; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.ExplosionPrimeEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Optional; + // CraftBukkit end + + public class EntityEnderCrystal extends Entity { +diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java +index e7f897c1fb5f45c5b22ca315874a2cd8d8d2c838..c1d52acec510ea20273fc7dc83ae6453ea42990e 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java ++++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java +@@ -1,17 +1,16 @@ + package net.minecraft.server; + ++import com.destroystokyo.paper.event.block.TNTPrimeEvent; + import com.google.common.collect.Lists; +-import java.util.Iterator; +-import java.util.List; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-// CraftBukkit start + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.event.entity.EntityExplodeEvent; + import org.bukkit.event.entity.EntityRegainHealthEvent; +-// CraftBukkit end +-import com.destroystokyo.paper.event.block.TNTPrimeEvent; // Paper - TNTPrimeEvent ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.List; + + // PAIL: Fixme + public class EntityEnderDragon extends EntityInsentient implements IMonster { +diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java +index 12f18a971e50a63cc527ec56faf389beba4c23c5..290e1e198ec76c3fc08e273371e9d7ab3375df9f 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderPearl.java ++++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.Bukkit; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.CreatureSpawnEvent; + import org.bukkit.event.player.PlayerTeleportEvent; ++ ++import javax.annotation.Nullable; + // CraftBukkit end + + public class EntityEnderPearl extends EntityProjectileThrowable { +diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java +index b61de33513989a9097e2729f0bd733dda687644d..e3f0067ca9981257279d0288c878ccb7786dcb82 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderman.java ++++ b/src/main/java/net/minecraft/server/EntityEnderman.java +@@ -1,12 +1,13 @@ + package net.minecraft.server; + ++import com.destroystokyo.paper.event.entity.EndermanEscapeEvent; ++ ++import javax.annotation.Nullable; + import java.util.EnumSet; + import java.util.Optional; +-import com.destroystokyo.paper.event.entity.EndermanEscapeEvent; // Paper + import java.util.Random; + import java.util.UUID; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class EntityEnderman extends EntityMonster implements IEntityAngerable { + +diff --git a/src/main/java/net/minecraft/server/EntityEvokerFangs.java b/src/main/java/net/minecraft/server/EntityEvokerFangs.java +index 31dbd21db0ba92cba3bc7816147f41d5eb53c57b..8f68721caa79fbc7ac517e24688be6bfc09b953b 100644 +--- a/src/main/java/net/minecraft/server/EntityEvokerFangs.java ++++ b/src/main/java/net/minecraft/server/EntityEvokerFangs.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.UUID; +-import javax.annotation.Nullable; + + public class EntityEvokerFangs extends Entity { + +diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java +index f01a8743ab1220052d5dafac679b9381679f632c..1e69d270c9a13a9d34e6a9abd4f1c9715d96a447 100644 +--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java ++++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + +-import java.util.Map.Entry; +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; +-import org.bukkit.event.entity.EntityTargetLivingEntityEvent; + import org.bukkit.event.entity.EntityTargetEvent; ++import org.bukkit.event.entity.EntityTargetLivingEntityEvent; ++ ++import java.util.Map.Entry; + // CraftBukkit end + + public class EntityExperienceOrb extends Entity { +diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java +index 6697b94550054ebbc8d4b3761bd9f36eb7e4ba8a..9c6ee54e4efd7c6f49cb179c4fa57b10895eb96a 100644 +--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java ++++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ + import java.util.Iterator; + import java.util.List; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit +- + public class EntityFallingBlock extends Entity { + + private IBlockData block; +diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java +index 5c737d605219bcb0c509f10e62550981f7cdb03f..e54df71af1420e275e13960de621e79c073c2708 100644 +--- a/src/main/java/net/minecraft/server/EntityFireball.java ++++ b/src/main/java/net/minecraft/server/EntityFireball.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import org.bukkit.craftbukkit.event.CraftEventFactory; + + public abstract class EntityFireball extends IProjectile { + +diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java +index 451f0544513bdeeca24755f9dafe6604dd944a28..a6e55a9754cd1970a928732f85f6b88315ce6620 100644 +--- a/src/main/java/net/minecraft/server/EntityFireworks.java ++++ b/src/main/java/net/minecraft/server/EntityFireworks.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.OptionalInt; +-import javax.annotation.Nullable; +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class EntityFireworks extends IProjectile { + +diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java +index 93aea1a9cd484271c61f7818f16488d2d3924898..a9602613fa80a4ba65ce749c6780b202392457ab 100644 +--- a/src/main/java/net/minecraft/server/EntityFishingHook.java ++++ b/src/main/java/net/minecraft/server/EntityFishingHook.java +@@ -1,15 +1,11 @@ + package net.minecraft.server; + +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Random; +-import javax.annotation.Nullable; +-// CraftBukkit start +-import org.bukkit.entity.Player; + import org.bukkit.entity.FishHook; ++import org.bukkit.entity.Player; + import org.bukkit.event.player.PlayerFishEvent; ++ ++import javax.annotation.Nullable; ++import java.util.*; + // CraftBukkit end + + public class EntityFishingHook extends IProjectile { +diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java +index 3b1d958d12025ec42c904e17b25c0c179fc2182b..1ee54cc1d2ef08d05e89e1289c7f232f460d1ac3 100644 +--- a/src/main/java/net/minecraft/server/EntityFox.java ++++ b/src/main/java/net/minecraft/server/EntityFox.java +@@ -2,10 +2,9 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + ++import javax.annotation.Nullable; + import java.util.*; + import java.util.function.Predicate; +-import java.util.stream.Collectors; +-import javax.annotation.Nullable; + + public class EntityFox extends EntityAnimal { + +diff --git a/src/main/java/net/minecraft/server/EntityHanging.java b/src/main/java/net/minecraft/server/EntityHanging.java +index 06cf11af972f7762de43dc1df18a431a62787111..ace78adfb5baf462d4b511d84f17beb11607ce62 100644 +--- a/src/main/java/net/minecraft/server/EntityHanging.java ++++ b/src/main/java/net/minecraft/server/EntityHanging.java +@@ -1,13 +1,12 @@ + package net.minecraft.server; + +-import java.util.function.Predicate; +-import javax.annotation.Nullable; + import org.apache.commons.lang3.Validate; +- +-// CraftBukkit start + import org.bukkit.entity.Hanging; + import org.bukkit.event.hanging.HangingBreakByEntityEvent; + import org.bukkit.event.hanging.HangingBreakEvent; ++ ++import javax.annotation.Nullable; ++import java.util.function.Predicate; + // CraftBukkit end + + public abstract class EntityHanging extends Entity { +diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java +index 97570b4521758a84c36e41f80653a17789ad4b60..9f47392e115e20e307e2e79fc3ec5bf03c2d90cd 100644 +--- a/src/main/java/net/minecraft/server/EntityHoglin.java ++++ b/src/main/java/net/minecraft/server/EntityHoglin.java +@@ -2,9 +2,10 @@ package net.minecraft.server; + + import com.google.common.collect.ImmutableList; + import com.mojang.serialization.Dynamic; ++ ++import javax.annotation.Nullable; + import java.util.Collection; + import java.util.Random; +-import javax.annotation.Nullable; + + public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + +diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java +index 364697e0155012c300219ad94a3995809e6c2f8f..8de9b17292bc69e603d5e3ef1f5e82d594f08804 100644 +--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java ++++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java +@@ -1,12 +1,13 @@ + package net.minecraft.server; + + import com.google.common.collect.UnmodifiableIterator; ++import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Optional; + import java.util.UUID; + import java.util.function.Predicate; +-import javax.annotation.Nullable; +-import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit + + public abstract class EntityHorseAbstract extends EntityAnimal implements IInventoryListener, IJumpable, ISaddleable { + +diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java +index 3966bf7160ef5a7ec6944397ffbf51f583875860..c6bc8dda20d4789499184b651092199de0c0c333 100644 +--- a/src/main/java/net/minecraft/server/EntityHuman.java ++++ b/src/main/java/net/minecraft/server/EntityHuman.java +@@ -5,18 +5,6 @@ import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Lists; + import com.mojang.authlib.GameProfile; + import com.mojang.datafixers.util.Either; +-import java.nio.charset.StandardCharsets; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Optional; +-import java.util.OptionalInt; +-import java.util.UUID; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.craftbukkit.util.CraftVector; + import org.bukkit.entity.Item; +@@ -26,7 +14,11 @@ import org.bukkit.event.entity.EntityCombustByEntityEvent; + import org.bukkit.event.player.PlayerBedLeaveEvent; + import org.bukkit.event.player.PlayerDropItemEvent; + import org.bukkit.event.player.PlayerVelocityEvent; +-import org.bukkit.util.Vector; ++ ++import javax.annotation.Nullable; ++import java.nio.charset.StandardCharsets; ++import java.util.*; ++import java.util.function.Predicate; + // CraftBukkit end + + public abstract class EntityHuman extends EntityLiving { +diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java +index 7c9bb358c9967e6c7c02b96e17764f2418df7979..e65447a0867abbd60dd2ebf6b9961cb9a5216bb7 100644 +--- a/src/main/java/net/minecraft/server/EntityInsentient.java ++++ b/src/main/java/net/minecraft/server/EntityInsentient.java +@@ -1,25 +1,13 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; +-import java.util.Arrays; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Optional; +-import java.util.Random; +-import java.util.UUID; +-import javax.annotation.Nullable; +- +-// CraftBukkit start +-import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.craftbukkit.entity.CraftLivingEntity; +-import org.bukkit.event.entity.CreatureSpawnEvent; +-import org.bukkit.event.entity.EntityCombustByEntityEvent; +-import org.bukkit.event.entity.EntityTargetLivingEntityEvent; +-import org.bukkit.event.entity.EntityTargetEvent; +-import org.bukkit.event.entity.EntityTransformEvent; +-import org.bukkit.event.entity.EntityUnleashEvent; ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++import org.bukkit.event.entity.*; + import org.bukkit.event.entity.EntityUnleashEvent.UnleashReason; ++ ++import javax.annotation.Nullable; ++import java.util.*; + // CraftBukkit end + + public abstract class EntityInsentient extends EntityLiving { +diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java +index e38a675be7e6a4cbb1f2f7606bf84ac570bb5985..a7373a63cb11822ca83728d6740f39180833856e 100644 +--- a/src/main/java/net/minecraft/server/EntityIronGolem.java ++++ b/src/main/java/net/minecraft/server/EntityIronGolem.java +@@ -1,12 +1,13 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableList; ++ ++import javax.annotation.Nullable; + import java.util.Comparator; + import java.util.Iterator; + import java.util.List; + import java.util.UUID; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public class EntityIronGolem extends EntityGolem implements IEntityAngerable { + +diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java +index 6869b688810cc72da01f164db1f0853d59752597..ebedb11ad7f281601abb26da6b035f1103e1fc98 100644 +--- a/src/main/java/net/minecraft/server/EntityItem.java ++++ b/src/main/java/net/minecraft/server/EntityItem.java +@@ -1,16 +1,15 @@ + package net.minecraft.server; + ++import org.bukkit.Material; ++import org.bukkit.event.entity.EntityPickupItemEvent; ++import org.bukkit.event.player.PlayerAttemptPickupItemEvent; ++import org.bukkit.event.player.PlayerPickupItemEvent; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Objects; + import java.util.UUID; +-import javax.annotation.Nullable; +-// CraftBukkit start +-import org.bukkit.Material; // Paper +-import org.bukkit.event.entity.EntityPickupItemEvent; +-import org.bukkit.event.player.PlayerPickupItemEvent; +-// CraftBukkit end +-import org.bukkit.event.player.PlayerAttemptPickupItemEvent; // Paper + + public class EntityItem extends Entity { + +diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java +index e20915578720f6d18955a4ddc6fb436af807acb3..e38f5d1ab2764e85aefc3398d29170c806250148 100644 +--- a/src/main/java/net/minecraft/server/EntityItemFrame.java ++++ b/src/main/java/net/minecraft/server/EntityItemFrame.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; + import org.apache.commons.lang3.Validate; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; ++ + public class EntityItemFrame extends EntityHanging { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/EntityLargeFireball.java b/src/main/java/net/minecraft/server/EntityLargeFireball.java +index b4b0dfbc70f91f74f9792b835ec2f8d5af41c311..0ff812f8da4db0ca9cf65792805d8e61ab99ba57 100644 +--- a/src/main/java/net/minecraft/server/EntityLargeFireball.java ++++ b/src/main/java/net/minecraft/server/EntityLargeFireball.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit ++import org.bukkit.event.entity.ExplosionPrimeEvent; + + public class EntityLargeFireball extends EntityFireballFireball { + +diff --git a/src/main/java/net/minecraft/server/EntityLeash.java b/src/main/java/net/minecraft/server/EntityLeash.java +index 34b41ab9cf65ac8a7a29f1d3d23c86f6707a436a..99052f026f2d24300ab0a1b7c6b8b134d6800995 100644 +--- a/src/main/java/net/minecraft/server/EntityLeash.java ++++ b/src/main/java/net/minecraft/server/EntityLeash.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; +- +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class EntityLeash extends EntityHanging { + +diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java +index b1b8748fa95aab25562c2f5397cb6454737fa508..71cc6953091119dda28003a8199e981440483c72 100644 +--- a/src/main/java/net/minecraft/server/EntityLightning.java ++++ b/src/main/java/net/minecraft/server/EntityLightning.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + import java.util.Collection; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; +- +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class EntityLightning extends Entity { + +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index ef77e7864e7e49684a9bd2a7c9f07717800e3e89..a37badcd92afd03a4b622048921618dbca2db8b4 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + +-import com.destroystokyo.paper.event.player.PlayerArmorChangeEvent; // Paper ++import com.destroystokyo.paper.event.player.PlayerArmorChangeEvent; ++import com.google.common.base.Function; + import com.google.common.base.Objects; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; +@@ -10,39 +11,20 @@ import com.mojang.datafixers.util.Pair; + import com.mojang.serialization.DataResult; + import com.mojang.serialization.Dynamic; + import com.mojang.serialization.DynamicOps; +-import java.util.Collection; +-import java.util.ConcurrentModificationException; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Optional; +-import java.util.Random; +-import java.util.UUID; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import java.util.ArrayList; +-import java.util.HashSet; +-import java.util.Set; +-import com.google.common.base.Function; + import org.bukkit.Location; + import org.bukkit.craftbukkit.attribute.CraftAttributeMap; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.entity.LivingEntity; + import org.bukkit.entity.Player; +-import org.bukkit.event.entity.EntityDamageEvent; ++import org.bukkit.event.entity.*; + import org.bukkit.event.entity.EntityDamageEvent.DamageModifier; +-import org.bukkit.event.entity.EntityPotionEffectEvent; +-import org.bukkit.event.entity.EntityRegainHealthEvent; +-import org.bukkit.event.entity.EntityResurrectEvent; +-import org.bukkit.event.entity.EntityTeleportEvent; + import org.bukkit.event.player.PlayerItemConsumeEvent; +-// CraftBukkit end + +-import co.aikar.timings.MinecraftTimings; // Paper ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.function.Predicate; + + public abstract class EntityLiving extends Entity { + +diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java +index 4fe769c761949c40bbb923cde5dfe1709843921f..039a74ee15bc1bf562f782b46f797dddccf9e04e 100644 +--- a/src/main/java/net/minecraft/server/EntityLlama.java ++++ b/src/main/java/net/minecraft/server/EntityLlama.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Iterator; + import javax.annotation.Nullable; ++import java.util.Iterator; + + public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEntity { + +diff --git a/src/main/java/net/minecraft/server/EntityLlamaTrader.java b/src/main/java/net/minecraft/server/EntityLlamaTrader.java +index 11008c4323d16fc989c0e68978741113b3b57268..45661626586674b35d81bc92b268549aa9b50f1f 100644 +--- a/src/main/java/net/minecraft/server/EntityLlamaTrader.java ++++ b/src/main/java/net/minecraft/server/EntityLlamaTrader.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.EnumSet; + import javax.annotation.Nullable; ++import java.util.EnumSet; + + public class EntityLlamaTrader extends EntityLlama { + +diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +index 6e038905ea6e5245190e5970481195ba668f3247..0f57985d9b4fc8d31e87b50284200aead6b4dd7e 100644 +--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java ++++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +@@ -5,18 +5,17 @@ import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Maps; + import com.google.common.collect.UnmodifiableIterator; + import com.mojang.datafixers.util.Pair; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.Location; + import org.bukkit.entity.Vehicle; + import org.bukkit.event.vehicle.VehicleDamageEvent; + import org.bukkit.event.vehicle.VehicleDestroyEvent; + import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; + import org.bukkit.util.Vector; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; + // CraftBukkit end + + public abstract class EntityMinecartAbstract extends Entity { +diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java +index ca4b142f9a62a14c6fa9b2f865fa0c9f7b2ecbed..ff7763a62a57a1f73d385ca161efd5a26c6d8711 100644 +--- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java ++++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java +@@ -1,13 +1,13 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import javax.annotation.Nullable; +-// CraftBukkit start +-import java.util.List; + import org.bukkit.Location; + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; + import org.bukkit.inventory.InventoryHolder; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.List; + // CraftBukkit end + + public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements IInventory, ITileInventory { +diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java +index 23ef033067e388b7b7b2a981df8655e240a30594..6b66c54d6f45fb9034e13576e383bf3a0009e99a 100644 +--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java ++++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java +@@ -1,12 +1,12 @@ + package net.minecraft.server; + +-import java.util.Optional; +-import java.util.Random; +-import java.util.UUID; + import org.apache.commons.lang3.tuple.Pair; +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.EntityTransformEvent; ++ ++import java.util.Optional; ++import java.util.Random; ++import java.util.UUID; + // CraftBukkit end + + public class EntityMushroomCow extends EntityCow implements IShearable { +diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java +index 9c1f019f911a1b91bbfa431e1558dec790624050..ea4da16de36a1680bcc8eae06c59899d607976a1 100644 +--- a/src/main/java/net/minecraft/server/EntityOcelot.java ++++ b/src/main/java/net/minecraft/server/EntityOcelot.java +@@ -1,8 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; +-import java.util.function.Predicate; + import javax.annotation.Nullable; ++import java.util.Random; + + public class EntityOcelot extends EntityAnimal { + +diff --git a/src/main/java/net/minecraft/server/EntityPainting.java b/src/main/java/net/minecraft/server/EntityPainting.java +index ce9d414f2ad92d1392057827fff6dad631b5fd10..53dd219b0ee41090ac7ab417301d7098783e5fee 100644 +--- a/src/main/java/net/minecraft/server/EntityPainting.java ++++ b/src/main/java/net/minecraft/server/EntityPainting.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; + + public class EntityPainting extends EntityHanging { + +diff --git a/src/main/java/net/minecraft/server/EntityPanda.java b/src/main/java/net/minecraft/server/EntityPanda.java +index 5697761087f6661e4d63fcbfeadfe9a8c56a17b5..12f7020ec7abbefaa876dc8b0a424603c0605687 100644 +--- a/src/main/java/net/minecraft/server/EntityPanda.java ++++ b/src/main/java/net/minecraft/server/EntityPanda.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.event.entity.EntityTargetEvent; ++ ++import javax.annotation.Nullable; + import java.util.*; + import java.util.function.Predicate; +-import javax.annotation.Nullable; +- +-import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit + + public class EntityPanda extends EntityAnimal { + +diff --git a/src/main/java/net/minecraft/server/EntityParrot.java b/src/main/java/net/minecraft/server/EntityParrot.java +index 2172fcefbc0d1c41cf2715a63015659a706e57ec..6d313783838103c848b3375ac29ccd8b33a27430 100644 +--- a/src/main/java/net/minecraft/server/EntityParrot.java ++++ b/src/main/java/net/minecraft/server/EntityParrot.java +@@ -3,12 +3,13 @@ package net.minecraft.server; + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; ++ ++import javax.annotation.Nullable; + import java.util.List; + import java.util.Map; + import java.util.Random; + import java.util.Set; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class EntityParrot extends EntityPerchable implements EntityBird { + +diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java +index 3cb78924daa48c3a0a3e5c9c64ef6e726d79a798..1d6fd36a0ea06db7dd74f6d14ac2effe93b9ac74 100644 +--- a/src/main/java/net/minecraft/server/EntityPhantom.java ++++ b/src/main/java/net/minecraft/server/EntityPhantom.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Comparator; + import java.util.EnumSet; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; + + public class EntityPhantom extends EntityFlying implements IMonster { + +diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java +index cd0a94794e8969937f7f8408e0fb46c1684abc00..13b95af73c1f7f09b8d41cb4350792e9300fda1a 100644 +--- a/src/main/java/net/minecraft/server/EntityPig.java ++++ b/src/main/java/net/minecraft/server/EntityPig.java +@@ -1,10 +1,9 @@ + package net.minecraft.server; + + import com.google.common.collect.UnmodifiableIterator; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + // CraftBukkit end + + public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { +diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java +index e97997c28667ee4d3110df2b47a851aa37f0d4bc..c5dcaabdcf701c0dac3660562512d0c5c869b726 100644 +--- a/src/main/java/net/minecraft/server/EntityPigZombie.java ++++ b/src/main/java/net/minecraft/server/EntityPigZombie.java +@@ -2,9 +2,9 @@ package net.minecraft.server; + + import org.bukkit.event.entity.EntityTargetEvent; + ++import javax.annotation.Nullable; + import java.util.Random; + import java.util.UUID; +-import javax.annotation.Nullable; + + public class EntityPigZombie extends EntityZombie implements IEntityAngerable { + +diff --git a/src/main/java/net/minecraft/server/EntityPiglin.java b/src/main/java/net/minecraft/server/EntityPiglin.java +index a8e3e3e4b0b4f9af2f5ac551072a0e2caa644d07..f6e58838b5008fe091cff4eb3bf08f5026dd7880 100644 +--- a/src/main/java/net/minecraft/server/EntityPiglin.java ++++ b/src/main/java/net/minecraft/server/EntityPiglin.java +@@ -2,11 +2,12 @@ package net.minecraft.server; + + import com.google.common.collect.ImmutableList; + import com.mojang.serialization.Dynamic; ++ ++import javax.annotation.Nullable; + import java.util.Collection; + import java.util.List; + import java.util.Random; + import java.util.UUID; +-import javax.annotation.Nullable; + + public class EntityPiglin extends EntityMonster implements ICrossbow { + +diff --git a/src/main/java/net/minecraft/server/EntityPillager.java b/src/main/java/net/minecraft/server/EntityPillager.java +index f73c30ae49e6a80004ead1a134b4457a3c2a48fc..f0cc1d75d91064c5bf8c0655067bd34ccf6d4dba 100644 +--- a/src/main/java/net/minecraft/server/EntityPillager.java ++++ b/src/main/java/net/minecraft/server/EntityPillager.java +@@ -1,8 +1,9 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; +-import java.util.Map; ++ + import javax.annotation.Nullable; ++import java.util.Map; + + public class EntityPillager extends EntityIllagerAbstract implements ICrossbow { + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index 597419c23721059378943970b55d7a0dcb535037..69db19af3246ec61b710ab273c5a9fe5b172ed93 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -1,26 +1,13 @@ + package net.minecraft.server; + + import com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent; ++import com.destroystokyo.paper.event.player.PlayerClientOptionsChangeEvent; + import com.google.common.collect.Lists; +-import com.destroystokyo.paper.event.player.PlayerClientOptionsChangeEvent; // Paper + import com.mojang.authlib.GameProfile; + import com.mojang.datafixers.util.Either; + import com.mojang.serialization.DataResult; +-import java.util.ArrayDeque; // Paper +-import java.util.Collection; +-import java.util.Deque; // Paper +-import java.util.Iterator; +-import java.util.List; +-import java.util.OptionalInt; +-import java.util.Random; +-import java.util.UUID; +-import java.util.concurrent.CompletableFuture; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import com.google.common.base.Preconditions; + import org.bukkit.Bukkit; + import org.bukkit.GameMode; + import org.bukkit.Location; +@@ -30,14 +17,13 @@ import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.event.inventory.InventoryType; +-import org.bukkit.event.player.PlayerChangedMainHandEvent; +-import org.bukkit.event.player.PlayerChangedWorldEvent; +-import org.bukkit.event.player.PlayerGameModeChangeEvent; +-import org.bukkit.event.player.PlayerLocaleChangeEvent; +-import org.bukkit.event.player.PlayerPortalEvent; +-import org.bukkit.event.player.PlayerTeleportEvent; ++import org.bukkit.event.player.*; + import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; + import org.bukkit.inventory.MainHand; ++ ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.concurrent.CompletableFuture; + // CraftBukkit end + + public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java +index c7416602c19c6a0675c414b5af4452ed5df3827b..cc5a362346427070980b4cbf8ab18313d82aa669 100644 +--- a/src/main/java/net/minecraft/server/EntityPotion.java ++++ b/src/main/java/net/minecraft/server/EntityPotion.java +@@ -1,15 +1,15 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.List; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; +-// CraftBukkit start +-import java.util.HashMap; +-import java.util.Map; + import org.bukkit.craftbukkit.entity.CraftLivingEntity; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.entity.LivingEntity; ++ ++import javax.annotation.Nullable; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import java.util.function.Predicate; + // CraftBukkit end + + public class EntityPotion extends EntityProjectileThrowable { +diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java +index baf4405380c70581a3ed457cb8d12153160f8d1d..911182863c171c8e2faeb9375d1515d4be353b42 100644 +--- a/src/main/java/net/minecraft/server/EntityRabbit.java ++++ b/src/main/java/net/minecraft/server/EntityRabbit.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; + import javax.annotation.Nullable; ++import java.util.Random; + + public class EntityRabbit extends EntityAnimal { + +diff --git a/src/main/java/net/minecraft/server/EntityRaider.java b/src/main/java/net/minecraft/server/EntityRaider.java +index 751873c20ef74daa1e1f7278e8364a22be18504c..42f8d85c460a74f7f7c3277c44ed4648cd56a013 100644 +--- a/src/main/java/net/minecraft/server/EntityRaider.java ++++ b/src/main/java/net/minecraft/server/EntityRaider.java +@@ -1,13 +1,10 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import java.util.EnumSet; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Objects; +-import java.util.Optional; +-import java.util.function.Predicate; ++ + import javax.annotation.Nullable; ++import java.util.*; ++import java.util.function.Predicate; + + public abstract class EntityRaider extends EntityMonsterPatrolling { + +diff --git a/src/main/java/net/minecraft/server/EntityRavager.java b/src/main/java/net/minecraft/server/EntityRavager.java +index 9734845c16ab9ebbd3c5db089f782c2775ea428e..6bdf90f43a1b683bbbb188cbb4a03f522b138c8e 100644 +--- a/src/main/java/net/minecraft/server/EntityRavager.java ++++ b/src/main/java/net/minecraft/server/EntityRavager.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class EntityRavager extends EntityRaider { + +diff --git a/src/main/java/net/minecraft/server/EntitySelector.java b/src/main/java/net/minecraft/server/EntitySelector.java +index c5d1dfa0660ba94412664974adae56ecffda0b45..0d0dd4f580ec6a5f3c49e619ed6a53f5dc94b735 100644 +--- a/src/main/java/net/minecraft/server/EntitySelector.java ++++ b/src/main/java/net/minecraft/server/EntitySelector.java +@@ -2,6 +2,8 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import com.mojang.brigadier.exceptions.CommandSyntaxException; ++ ++import javax.annotation.Nullable; + import java.util.Collections; + import java.util.Iterator; + import java.util.List; +@@ -9,7 +11,6 @@ import java.util.UUID; + import java.util.function.BiConsumer; + import java.util.function.Function; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class EntitySelector { + +diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java +index bb8183ce9fd62178c4941ed0ff885eb717e3c8e9..a41d55ba3f3ae8a3f62f152ac178e114e72cb6a4 100644 +--- a/src/main/java/net/minecraft/server/EntitySheep.java ++++ b/src/main/java/net/minecraft/server/EntitySheep.java +@@ -1,15 +1,15 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; +- +-import java.util.*; +-import java.util.stream.Collectors; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.SheepRegrowWoolEvent; + import org.bukkit.inventory.InventoryView; ++ ++import javax.annotation.Nullable; ++import java.util.HashMap; ++import java.util.Map; ++import java.util.Optional; ++import java.util.Random; + // CraftBukkit end + + public class EntitySheep extends EntityAnimal implements IShearable { +diff --git a/src/main/java/net/minecraft/server/EntityShulker.java b/src/main/java/net/minecraft/server/EntityShulker.java +index afc4cf4960ed2aaf17121209fec89ab9eb365083..75541b1c1515f4d008038d41c886b02c3c89bd49 100644 +--- a/src/main/java/net/minecraft/server/EntityShulker.java ++++ b/src/main/java/net/minecraft/server/EntityShulker.java +@@ -1,14 +1,10 @@ + package net.minecraft.server; + +-import java.util.EnumSet; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Optional; +-import java.util.UUID; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.Location; + import org.bukkit.event.entity.EntityTeleportEvent; ++ ++import javax.annotation.Nullable; ++import java.util.*; + // CraftBukkit end + + public class EntityShulker extends EntityGolem implements IMonster { +diff --git a/src/main/java/net/minecraft/server/EntityShulkerBullet.java b/src/main/java/net/minecraft/server/EntityShulkerBullet.java +index ff5a3fdd5ce601967b10c1056302e3a4555a9a40..64a127f3d51ba34996e40eec72c0911f64394e98 100644 +--- a/src/main/java/net/minecraft/server/EntityShulkerBullet.java ++++ b/src/main/java/net/minecraft/server/EntityShulkerBullet.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ ++import javax.annotation.Nullable; + import java.util.List; + import java.util.UUID; +-import javax.annotation.Nullable; + + public class EntityShulkerBullet extends IProjectile { + +diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +index 84f83d48a8c41a26289ce0995aa9f5fd332c0ccb..531ff5246e1f2a0862617752bdf0707d33970227 100644 +--- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java ++++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.time.LocalDate; + import java.time.temporal.ChronoField; +-import javax.annotation.Nullable; + + public abstract class EntitySkeletonAbstract extends EntityMonster implements IRangedEntity { + +diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java +index a4642cc7390b08580d00689a853d59e3e1ef6496..58d811d75fa12d4f37fb0309787b9c136c79ad09 100644 +--- a/src/main/java/net/minecraft/server/EntitySlime.java ++++ b/src/main/java/net/minecraft/server/EntitySlime.java +@@ -1,22 +1,20 @@ + package net.minecraft.server; + +-import java.util.EnumSet; +-import java.util.Random; +-import javax.annotation.Nullable; +-// Paper start + import com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent; + import com.destroystokyo.paper.event.entity.SlimeSwimEvent; + import com.destroystokyo.paper.event.entity.SlimeTargetLivingEntityEvent; + import com.destroystokyo.paper.event.entity.SlimeWanderEvent; ++import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.entity.LivingEntity; + import org.bukkit.entity.Slime; +-// Paper end +-// CraftBukkit start +-import java.util.ArrayList; +-import java.util.List; +-import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.EntityTransformEvent; + import org.bukkit.event.entity.SlimeSplitEvent; ++ ++import javax.annotation.Nullable; ++import java.util.ArrayList; ++import java.util.EnumSet; ++import java.util.List; ++import java.util.Random; + // CraftBukkit end + + public class EntitySlime extends EntityInsentient implements IMonster { +diff --git a/src/main/java/net/minecraft/server/EntitySmallFireball.java b/src/main/java/net/minecraft/server/EntitySmallFireball.java +index 92efb29534243ffb4c5bdd944d54037710358e20..8c006ba920e4ae89c9534b16f3b11042036ce936 100644 +--- a/src/main/java/net/minecraft/server/EntitySmallFireball.java ++++ b/src/main/java/net/minecraft/server/EntitySmallFireball.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.event.entity.EntityCombustByEntityEvent; // CraftBukkit ++import org.bukkit.event.entity.EntityCombustByEntityEvent; + + public class EntitySmallFireball extends EntityFireballFireball { + +diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java +index 15b886d9b399f534779ec72057b66134047ec85f..f391889deddc248b06b7e4e20b9208f98aab91bc 100644 +--- a/src/main/java/net/minecraft/server/EntitySnowman.java ++++ b/src/main/java/net/minecraft/server/EntitySnowman.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + // CraftBukkit end + + public class EntitySnowman extends EntityGolem implements IShearable, IRangedEntity { +diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java +index f6a677200210ea5035ab6d2c1022cc737c8fd1c4..53405c4479ad8787a4222008011aaf4d8dccdca7 100644 +--- a/src/main/java/net/minecraft/server/EntitySpider.java ++++ b/src/main/java/net/minecraft/server/EntitySpider.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; + import javax.annotation.Nullable; ++import java.util.Random; + + public class EntitySpider extends EntityMonster { + +diff --git a/src/main/java/net/minecraft/server/EntityStrider.java b/src/main/java/net/minecraft/server/EntityStrider.java +index c123e9fe97f1c0da0c6807e17df497a31749c1b3..f6bf51c17ae158e2d65ea65e885ecebe11037ba8 100644 +--- a/src/main/java/net/minecraft/server/EntityStrider.java ++++ b/src/main/java/net/minecraft/server/EntityStrider.java +@@ -2,10 +2,11 @@ package net.minecraft.server; + + import com.google.common.collect.Sets; + import com.google.common.collect.UnmodifiableIterator; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Random; + import java.util.Set; +-import javax.annotation.Nullable; + + public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleable { + +diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +index 57ac6469ecdf3d89a538f01ecde5f3bd5a28c18f..d85139e4acd58eb0c521f9942cbe13541b2db490 100644 +--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java ++++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +@@ -1,7 +1,8 @@ + package net.minecraft.server; + ++import org.bukkit.event.entity.ExplosionPrimeEvent; ++ + import javax.annotation.Nullable; +-import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit + + public class EntityTNTPrimed extends Entity { + +diff --git a/src/main/java/net/minecraft/server/EntityTippedArrow.java b/src/main/java/net/minecraft/server/EntityTippedArrow.java +index 85d5b68cfe9aee258a2331788b133a92911a9c11..2828cf35df63cf4d8478aab74ef7e7a1e7d57d9d 100644 +--- a/src/main/java/net/minecraft/server/EntityTippedArrow.java ++++ b/src/main/java/net/minecraft/server/EntityTippedArrow.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.Sets; ++ + import java.util.Collection; + import java.util.Iterator; + import java.util.Set; +diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +index f148bc2bb8fdb7e76c8c42a29017a0c62a222990..ea0890a8c8f2c575fca384f909ce15dfe4ddf9f7 100644 +--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +@@ -2,19 +2,13 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import com.mojang.datafixers.util.Pair; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.HashSet; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Set; +-import java.util.function.Consumer; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start + import org.bukkit.entity.Player; + import org.bukkit.event.player.PlayerVelocityEvent; ++ ++import java.util.*; ++import java.util.function.Consumer; + // CraftBukkit end + + public class EntityTrackerEntry { +diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java +index 06333b69539a86b14b6b1efa5fee19b5bdfacfdf..1959155080fe2a2fb19227c884d598719528b140 100644 +--- a/src/main/java/net/minecraft/server/EntityTurtle.java ++++ b/src/main/java/net/minecraft/server/EntityTurtle.java +@@ -1,11 +1,12 @@ + package net.minecraft.server; + + import com.google.common.collect.Sets; ++ ++import javax.annotation.Nullable; + import java.util.EnumSet; + import java.util.Random; + import java.util.Set; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class EntityTurtle extends EntityAnimal { + +diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java +index 18a806ebbf092b904983691529ce5edf2da4e6db..85c784ceea900d65de136da8c7ac718f26127456 100644 +--- a/src/main/java/net/minecraft/server/EntityTypes.java ++++ b/src/main/java/net/minecraft/server/EntityTypes.java +@@ -1,15 +1,15 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableSet; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.util.Optional; +-import java.util.Set; // Paper +-import java.util.Map; // Paper ++import java.util.Set; + import java.util.UUID; + import java.util.function.Function; + import java.util.stream.Stream; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class EntityTypes { + +diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java +index 99a98e37ebd292f8fb1c3613348bd6dd51e9191b..3af1ad56464ee6d0c43f8a2fcba993e398036829 100644 +--- a/src/main/java/net/minecraft/server/EntityVex.java ++++ b/src/main/java/net/minecraft/server/EntityVex.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + +-import java.util.EnumSet; +-import javax.annotation.Nullable; + import org.bukkit.event.entity.EntityTargetEvent; + ++import javax.annotation.Nullable; ++import java.util.EnumSet; ++ + public class EntityVex extends EntityMonster { + + protected static final DataWatcherObject b = DataWatcher.a(EntityVex.class, DataWatcherRegistry.a); +diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java +index 2fb7f23275acad54d2f5e2ecd57d5bbb333facbe..52bab44807674a5f7aee105d015f639b8aef9829 100644 +--- a/src/main/java/net/minecraft/server/EntityVillager.java ++++ b/src/main/java/net/minecraft/server/EntityVillager.java +@@ -7,24 +7,18 @@ import com.mojang.datafixers.util.Pair; + import com.mojang.serialization.DataResult; + import com.mojang.serialization.Dynamic; + import com.mojang.serialization.DynamicOps; +- + import dev.tr7zw.yatopia.YatopiaConfig; + import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +- +-import java.util.*; +-import java.util.function.BiPredicate; +-import java.util.stream.Collectors; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.Logger; +-// CraftBukkit start + import org.bukkit.Bukkit; +-import org.bukkit.craftbukkit.entity.CraftVillager; + import org.bukkit.craftbukkit.event.CraftEventFactory; +-import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; + import org.bukkit.entity.Villager; + import org.bukkit.event.entity.EntityTransformEvent; +-import org.bukkit.event.entity.VillagerAcquireTradeEvent; + import org.bukkit.event.entity.VillagerReplenishTradeEvent; ++ ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.function.BiPredicate; + // CraftBukkit end + + public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder { +diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java +index 81823b5d5ef17479583fda0121c95091175fdf1e..c15feba3c54c5b8610f16cceada91cf9077a8701 100644 +--- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java ++++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java +@@ -1,15 +1,15 @@ + package net.minecraft.server; + + import com.google.common.collect.Sets; +-import java.util.Iterator; +-import java.util.Set; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.Bukkit; + import org.bukkit.craftbukkit.inventory.CraftMerchant; + import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; + import org.bukkit.entity.AbstractVillager; + import org.bukkit.event.entity.VillagerAcquireTradeEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.Set; + // CraftBukkit end + + public abstract class EntityVillagerAbstract extends EntityAgeable implements NPC, IMerchant { +diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java +index a0841cfaf950508b73b43a5fadbc1796015e5dbb..3116488509862fc82b0b9172957af812d96bcf80 100644 +--- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java ++++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java +@@ -1,12 +1,12 @@ + package net.minecraft.server; + +-import java.util.EnumSet; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.Bukkit; + import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; + import org.bukkit.entity.AbstractVillager; + import org.bukkit.event.entity.VillagerAcquireTradeEvent; ++ ++import javax.annotation.Nullable; ++import java.util.EnumSet; + // CraftBukkit end + + public class EntityVillagerTrader extends EntityVillagerAbstract { +diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java +index 58315906b641ba46ce73b6fefc43ea333bb0a088..66851778820759547f17288dc82ec58114592257 100644 +--- a/src/main/java/net/minecraft/server/EntityVindicator.java ++++ b/src/main/java/net/minecraft/server/EntityVindicator.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; ++ ++import javax.annotation.Nullable; + import java.util.EnumSet; + import java.util.Map; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class EntityVindicator extends EntityIllagerAbstract { + +diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java +index e8d8935b8ef2db0d4405ee1ff8e2f0f2e17a91b3..32ff8f7dbe910ae9457e73fa75aaa749103cb6cb 100644 +--- a/src/main/java/net/minecraft/server/EntityWitch.java ++++ b/src/main/java/net/minecraft/server/EntityWitch.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + + // Paper start ++ + import com.destroystokyo.paper.event.entity.WitchReadyPotionEvent; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.entity.Witch; +-// Paper end + + import java.util.Iterator; + import java.util.List; +diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java +index 1074995e8c8a83f6cdb94019123fbffa309d5e08..8c7bfe19f95cc757397bc496087df8dcd88351c4 100644 +--- a/src/main/java/net/minecraft/server/EntityWither.java ++++ b/src/main/java/net/minecraft/server/EntityWither.java +@@ -1,16 +1,15 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableList; +-import java.util.EnumSet; +-import java.util.List; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.EntityRegainHealthEvent; + import org.bukkit.event.entity.EntityTargetEvent; + import org.bukkit.event.entity.ExplosionPrimeEvent; ++ ++import javax.annotation.Nullable; ++import java.util.EnumSet; ++import java.util.List; ++import java.util.function.Predicate; + // CraftBukkit end + + public class EntityWither extends EntityMonster implements IRangedEntity { +diff --git a/src/main/java/net/minecraft/server/EntityWitherSkull.java b/src/main/java/net/minecraft/server/EntityWitherSkull.java +index 72d59adce78943ce47e91301fe17e96ec3579fa6..3839e63b7981f7d6225e9ade7f0be21427ffa8e9 100644 +--- a/src/main/java/net/minecraft/server/EntityWitherSkull.java ++++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit ++import org.bukkit.event.entity.ExplosionPrimeEvent; + + public class EntityWitherSkull extends EntityFireball { + +diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java +index 5b519fa394707f6f21b241689daa6d2abf360df7..5f8a74a433fe69eb5eb528663e290279cf3239f4 100644 +--- a/src/main/java/net/minecraft/server/EntityWolf.java ++++ b/src/main/java/net/minecraft/server/EntityWolf.java +@@ -1,12 +1,11 @@ + package net.minecraft.server; + +-import java.util.UUID; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.EntityTargetEvent.TargetReason; ++ ++import javax.annotation.Nullable; ++import java.util.UUID; ++import java.util.function.Predicate; + // CraftBukkit end + + public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java +index 8784da7ca664b93c4ce1d3e63bb841229f4616df..e18a2b7b25bd6b30e73ce675849520c1250833dd 100644 +--- a/src/main/java/net/minecraft/server/EntityZombie.java ++++ b/src/main/java/net/minecraft/server/EntityZombie.java +@@ -1,21 +1,20 @@ + package net.minecraft.server; + + import com.mojang.serialization.DynamicOps; +-import java.time.LocalDate; +-import java.time.temporal.ChronoField; +-import java.util.List; +-import java.util.Random; +-import java.util.UUID; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.entity.Zombie; + import org.bukkit.event.entity.CreatureSpawnEvent; + import org.bukkit.event.entity.EntityCombustByEntityEvent; + import org.bukkit.event.entity.EntityTargetEvent; + import org.bukkit.event.entity.EntityTransformEvent; ++ ++import javax.annotation.Nullable; ++import java.time.LocalDate; ++import java.time.temporal.ChronoField; ++import java.util.List; ++import java.util.Random; ++import java.util.UUID; ++import java.util.function.Predicate; + // CraftBukkit end + + public class EntityZombie extends EntityMonster { +diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java +index 9b920332bd397f9711f0c99702245d54b9d3841b..c3acf82e8396a554c4e56df33731c8f891117879 100644 +--- a/src/main/java/net/minecraft/server/EntityZombieVillager.java ++++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java +@@ -2,13 +2,13 @@ package net.minecraft.server; + + import com.mojang.serialization.DataResult; + import com.mojang.serialization.Dynamic; +-import java.util.UUID; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.Logger; +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.entity.ZombieVillager; + import org.bukkit.event.entity.EntityTransformEvent; ++ ++import javax.annotation.Nullable; ++import java.util.UUID; + // CraftBukkit end + + public class EntityZombieVillager extends EntityZombie implements VillagerDataHolder { +diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java +index 1aa9d9fd074c186b209696ee46e0dda181372f4b..a02f87750d8a0dc617bebd8c7f4db33f1d050b3d 100644 +--- a/src/main/java/net/minecraft/server/EnumDirection.java ++++ b/src/main/java/net/minecraft/server/EnumDirection.java +@@ -4,16 +4,12 @@ import com.google.common.collect.Iterators; + import com.mojang.serialization.Codec; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +-import java.util.Arrays; +-import java.util.Comparator; +-import java.util.Iterator; +-import java.util.Locale; +-import java.util.Map; +-import java.util.Random; ++ ++import javax.annotation.Nullable; ++import java.util.*; + import java.util.function.Predicate; + import java.util.stream.Collectors; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public enum EnumDirection implements INamable { + +diff --git a/src/main/java/net/minecraft/server/EnumProtocol.java b/src/main/java/net/minecraft/server/EnumProtocol.java +index ec3c8ec6a7c0a835d0bab9872d0ead68b2ff54df..4e856e3bccf667bdfb426331e3c3b3b68119a9ad 100644 +--- a/src/main/java/net/minecraft/server/EnumProtocol.java ++++ b/src/main/java/net/minecraft/server/EnumProtocol.java +@@ -5,11 +5,12 @@ import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import it.unimi.dsi.fastutil.objects.Object2IntMap; + import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; ++import org.apache.logging.log4j.LogManager; ++ ++import javax.annotation.Nullable; + import java.util.List; + import java.util.Map; + import java.util.function.Supplier; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; + + public enum EnumProtocol { + +diff --git a/src/main/java/net/minecraft/server/ExpirableListEntry.java b/src/main/java/net/minecraft/server/ExpirableListEntry.java +index 8aa38f805dec83f8ba07d0b78d64c9c9d066ace1..749f85cadadb662bea70fc89d2b41988d7b6ebde 100644 +--- a/src/main/java/net/minecraft/server/ExpirableListEntry.java ++++ b/src/main/java/net/minecraft/server/ExpirableListEntry.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + + import com.google.gson.JsonObject; ++ ++import javax.annotation.Nullable; + import java.text.ParseException; + import java.text.SimpleDateFormat; + import java.util.Date; +-import javax.annotation.Nullable; + + public abstract class ExpirableListEntry extends JsonListEntry { + +diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java +index 35f5be9ef91f8d91ca66c52640719b2fdf52bbfd..15224fc323b66c4f33f487a994590df043db4f52 100644 +--- a/src/main/java/net/minecraft/server/Explosion.java ++++ b/src/main/java/net/minecraft/server/Explosion.java +@@ -6,20 +6,13 @@ import com.google.common.collect.Sets; + import com.mojang.datafixers.util.Pair; + import it.unimi.dsi.fastutil.objects.ObjectArrayList; + import it.unimi.dsi.fastutil.objects.ObjectListIterator; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Optional; +-import java.util.Random; +-import java.util.Set; +-import javax.annotation.Nullable; +- +-// CraftBukkit start +-import org.bukkit.craftbukkit.event.CraftEventFactory; +-import org.bukkit.event.entity.EntityExplodeEvent; + import org.bukkit.Location; ++import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.block.BlockExplodeEvent; ++import org.bukkit.event.entity.EntityExplodeEvent; ++ ++import javax.annotation.Nullable; ++import java.util.*; + // CraftBukkit end + + public class Explosion { +diff --git a/src/main/java/net/minecraft/server/Fluid.java b/src/main/java/net/minecraft/server/Fluid.java +index 8ffc5db509867c585e90ea12d8509dcd0b1435e0..2189477e59e4695278c891ce14ec3f6797249caa 100644 +--- a/src/main/java/net/minecraft/server/Fluid.java ++++ b/src/main/java/net/minecraft/server/Fluid.java +@@ -3,6 +3,7 @@ package net.minecraft.server; + import com.google.common.collect.ImmutableMap; + import com.mojang.serialization.Codec; + import com.mojang.serialization.MapCodec; ++ + import java.util.Random; + + public final class Fluid extends IBlockDataHolder { +diff --git a/src/main/java/net/minecraft/server/FluidTypeFlowing.java b/src/main/java/net/minecraft/server/FluidTypeFlowing.java +index d72a88e9275eb00eed35b6467538a46e5cee32d5..7e97b5dffc1228b30f4e75789398b7b616d68447 100644 +--- a/src/main/java/net/minecraft/server/FluidTypeFlowing.java ++++ b/src/main/java/net/minecraft/server/FluidTypeFlowing.java +@@ -7,16 +7,16 @@ import it.unimi.dsi.fastutil.shorts.Short2BooleanMap; + import it.unimi.dsi.fastutil.shorts.Short2BooleanOpenHashMap; + import it.unimi.dsi.fastutil.shorts.Short2ObjectMap; + import it.unimi.dsi.fastutil.shorts.Short2ObjectOpenHashMap; +-import java.util.Iterator; +-import java.util.Map; +-import java.util.Map.Entry; +-// CraftBukkit start + import org.bukkit.block.BlockFace; + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.block.data.CraftBlockData; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.block.BlockFromToEvent; + import org.bukkit.event.block.FluidLevelChangeEvent; ++ ++import java.util.Iterator; ++import java.util.Map; ++import java.util.Map.Entry; + // CraftBukkit end + + public abstract class FluidTypeFlowing extends FluidType { +diff --git a/src/main/java/net/minecraft/server/FurnaceRecipe.java b/src/main/java/net/minecraft/server/FurnaceRecipe.java +index 0b15f25303c05b5d1dd04434ebd52c7af1ade2d2..c0f7def983d53e661b229a0a7eb44251665f2793 100644 +--- a/src/main/java/net/minecraft/server/FurnaceRecipe.java ++++ b/src/main/java/net/minecraft/server/FurnaceRecipe.java +@@ -1,12 +1,10 @@ + package net.minecraft.server; + + // CraftBukkit start +-import java.util.ArrayList; +-import java.util.List; ++ + import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.inventory.CraftRecipe; +-import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; + import org.bukkit.inventory.Recipe; + // CraftBukkit end +diff --git a/src/main/java/net/minecraft/server/GameProfileBanEntry.java b/src/main/java/net/minecraft/server/GameProfileBanEntry.java +index 120c71766d3f0c2fcfbf5210b4b6c8c013a8a7b0..c07122cf7df7d3f86c00574bec508dadb2f49151 100644 +--- a/src/main/java/net/minecraft/server/GameProfileBanEntry.java ++++ b/src/main/java/net/minecraft/server/GameProfileBanEntry.java +@@ -2,10 +2,11 @@ package net.minecraft.server; + + import com.google.gson.JsonObject; + import com.mojang.authlib.GameProfile; ++ ++import javax.annotation.Nullable; + import java.util.Date; + import java.util.Objects; + import java.util.UUID; +-import javax.annotation.Nullable; + + public class GameProfileBanEntry extends ExpirableListEntry { + +diff --git a/src/main/java/net/minecraft/server/GameProfileSerializer.java b/src/main/java/net/minecraft/server/GameProfileSerializer.java +index 1fe44d4a1a1895f5715c720f9d7d7acb10e50f61..66a10de0bd9d2901c4e5cc5398f19c20b70e6c56 100644 +--- a/src/main/java/net/minecraft/server/GameProfileSerializer.java ++++ b/src/main/java/net/minecraft/server/GameProfileSerializer.java +@@ -7,13 +7,14 @@ import com.mojang.authlib.GameProfile; + import com.mojang.authlib.properties.Property; + import com.mojang.datafixers.DataFixer; + import com.mojang.serialization.Dynamic; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Map.Entry; + import java.util.Optional; + import java.util.UUID; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public final class GameProfileSerializer { + +diff --git a/src/main/java/net/minecraft/server/GameRules.java b/src/main/java/net/minecraft/server/GameRules.java +index dec56f5fe2d01564905c19a907eceea11abd42de..2510cfbd7bc96824fc660d02a80fe55f376853a6 100644 +--- a/src/main/java/net/minecraft/server/GameRules.java ++++ b/src/main/java/net/minecraft/server/GameRules.java +@@ -8,6 +8,10 @@ import com.mojang.brigadier.arguments.IntegerArgumentType; + import com.mojang.brigadier.builder.RequiredArgumentBuilder; + import com.mojang.brigadier.context.CommandContext; + import com.mojang.serialization.DynamicLike; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.util.Comparator; + import java.util.Iterator; + import java.util.Map; +@@ -15,9 +19,6 @@ import java.util.Map.Entry; + import java.util.function.BiConsumer; + import java.util.function.Function; + import java.util.function.Supplier; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class GameRules { + +diff --git a/src/main/java/net/minecraft/server/GuiStatsComponent.java b/src/main/java/net/minecraft/server/GuiStatsComponent.java +index 859e31c63f94bdc7729c6d475990750b76e24b9c..decb89a87a85f26fa30574dc077e0f61910a1fe6 100644 +--- a/src/main/java/net/minecraft/server/GuiStatsComponent.java ++++ b/src/main/java/net/minecraft/server/GuiStatsComponent.java +@@ -1,13 +1,10 @@ + package net.minecraft.server; + +-import java.awt.Color; +-import java.awt.Dimension; +-import java.awt.Graphics; ++import javax.swing.*; ++import java.awt.*; + import java.text.DecimalFormat; + import java.text.DecimalFormatSymbols; + import java.util.Locale; +-import javax.swing.JComponent; +-import javax.swing.Timer; + + public class GuiStatsComponent extends JComponent { + +diff --git a/src/main/java/net/minecraft/server/HeightMap.java b/src/main/java/net/minecraft/server/HeightMap.java +index a43c4ca3ea2e0dbf34a177592daed18c64bb14d3..1fdc709f5dcb873a20cebc3fe788e2a6bd5a641e 100644 +--- a/src/main/java/net/minecraft/server/HeightMap.java ++++ b/src/main/java/net/minecraft/server/HeightMap.java +@@ -5,11 +5,12 @@ import com.mojang.serialization.Codec; + import it.unimi.dsi.fastutil.objects.ObjectArrayList; + import it.unimi.dsi.fastutil.objects.ObjectList; + import it.unimi.dsi.fastutil.objects.ObjectListIterator; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Map; + import java.util.Set; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class HeightMap { + +diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +index fb4c5ae4011e104848bab9e9141d9e90a5cb45ca..94f9b2036573b035db6bc9625412f09185d22181 100644 +--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java ++++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +@@ -1,13 +1,14 @@ + package net.minecraft.server; + + import com.google.common.collect.Queues; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.util.Queue; + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; + import java.util.concurrent.locks.LockSupport; + import java.util.function.BooleanSupplier; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public abstract class IAsyncTaskHandler implements Mailbox, Executor { + +diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java +index a59df0e48a9bcbb32c51ec0013f634d474f68e52..54f48ebc0a1add4183ad1a02e21d8025550f1cdb 100644 +--- a/src/main/java/net/minecraft/server/IBlockAccess.java ++++ b/src/main/java/net/minecraft/server/IBlockAccess.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.function.BiFunction; + import java.util.function.Function; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public interface IBlockAccess { + +diff --git a/src/main/java/net/minecraft/server/IBlockState.java b/src/main/java/net/minecraft/server/IBlockState.java +index 6550b55067db31dbbc903fe17a13849383651c5a..6dde34c3ce51ec7f3c06567c9675fe3bfab4610d 100644 +--- a/src/main/java/net/minecraft/server/IBlockState.java ++++ b/src/main/java/net/minecraft/server/IBlockState.java +@@ -3,6 +3,7 @@ package net.minecraft.server; + import com.google.common.base.MoreObjects; + import com.mojang.serialization.Codec; + import com.mojang.serialization.DataResult; ++ + import java.util.Collection; + import java.util.Optional; + import java.util.stream.Stream; +diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java +index 94a6d0ad76b10b8790ffb2019bf6972472b04c3d..9fa95225ff3a31db29236a55bb7ad4a6b700e62e 100644 +--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java ++++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java +@@ -1,18 +1,11 @@ + package net.minecraft.server; + +-import com.google.gson.Gson; +-import com.google.gson.GsonBuilder; +-import com.google.gson.JsonArray; +-import com.google.gson.JsonDeserializationContext; +-import com.google.gson.JsonDeserializer; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; +-import com.google.gson.JsonParseException; +-import com.google.gson.JsonPrimitive; +-import com.google.gson.JsonSerializationContext; +-import com.google.gson.JsonSerializer; ++import com.google.common.collect.Streams; ++import com.google.gson.*; + import com.google.gson.stream.JsonReader; + import com.mojang.brigadier.Message; ++ ++import javax.annotation.Nullable; + import java.io.IOException; + import java.io.StringReader; + import java.lang.reflect.Field; +@@ -21,9 +14,6 @@ import java.util.Iterator; + import java.util.List; + import java.util.Map.Entry; + import java.util.Optional; +-import javax.annotation.Nullable; +-// CraftBukkit start +-import com.google.common.collect.Streams; + import java.util.stream.Stream; + + public interface IChatBaseComponent extends Message, IChatFormatted, Iterable { +diff --git a/src/main/java/net/minecraft/server/IChunkAccess.java b/src/main/java/net/minecraft/server/IChunkAccess.java +index 930cd8106412b362650c77a69ea5f945043c92c7..854edaf19962dd0d6d5dc47cdad8e025fb1fb6d1 100644 +--- a/src/main/java/net/minecraft/server/IChunkAccess.java ++++ b/src/main/java/net/minecraft/server/IChunkAccess.java +@@ -2,13 +2,14 @@ package net.minecraft.server; + + import it.unimi.dsi.fastutil.shorts.ShortArrayList; + import it.unimi.dsi.fastutil.shorts.ShortList; ++import org.apache.logging.log4j.LogManager; ++ ++import javax.annotation.Nullable; + import java.util.Collection; + import java.util.Map; + import java.util.Map.Entry; + import java.util.Set; + import java.util.stream.Stream; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; + + public interface IChunkAccess extends IBlockAccess, IStructureAccess { + +diff --git a/src/main/java/net/minecraft/server/IChunkLoader.java b/src/main/java/net/minecraft/server/IChunkLoader.java +index 5601088cd5024a40e8296bab979f43de924c2b62..69d138f2bb4625ff96223c8d70217c3ffef6de5d 100644 +--- a/src/main/java/net/minecraft/server/IChunkLoader.java ++++ b/src/main/java/net/minecraft/server/IChunkLoader.java +@@ -1,14 +1,11 @@ + package net.minecraft.server; + + import com.mojang.datafixers.DataFixer; ++ ++import javax.annotation.Nullable; + import java.io.File; + import java.io.IOException; +-// Paper start +-import java.util.concurrent.CompletableFuture; +-import java.util.concurrent.CompletionException; +-// Paper end + import java.util.function.Supplier; +-import javax.annotation.Nullable; + + public class IChunkLoader implements AutoCloseable { + +diff --git a/src/main/java/net/minecraft/server/ICollisionAccess.java b/src/main/java/net/minecraft/server/ICollisionAccess.java +index 3ce2f7497a9e12082b70525ad2aaf5e0828cc068..37d5c492a1cfa137abfd3b801a7f1020e5289e00 100644 +--- a/src/main/java/net/minecraft/server/ICollisionAccess.java ++++ b/src/main/java/net/minecraft/server/ICollisionAccess.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.function.BiPredicate; + import java.util.function.Predicate; + import java.util.stream.Stream; + import java.util.stream.StreamSupport; +-import javax.annotation.Nullable; + + public interface ICollisionAccess extends IBlockAccess { + +diff --git a/src/main/java/net/minecraft/server/IDispenseBehavior.java b/src/main/java/net/minecraft/server/IDispenseBehavior.java +index 660f44975a003ea68ddad59899618485fdaf5487..1ec06c6f02f40fb3bf29e0f11ddcbb4338d83cb1 100644 +--- a/src/main/java/net/minecraft/server/IDispenseBehavior.java ++++ b/src/main/java/net/minecraft/server/IDispenseBehavior.java +@@ -1,16 +1,15 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.List; +-import java.util.Random; +-// CraftBukkit start + import org.bukkit.Location; + import org.bukkit.TreeType; +-import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.util.DummyGeneratorAccess; + import org.bukkit.event.block.BlockDispenseEvent; + import org.bukkit.event.world.StructureGrowEvent; ++ ++import java.util.Iterator; ++import java.util.List; ++import java.util.Random; + // CraftBukkit end + + public interface IDispenseBehavior { +diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java +index 0edcb775e965a3d6539d44e49480068deafab7a5..09e2ecb035fc724f35304460b67f303637b2860a 100644 +--- a/src/main/java/net/minecraft/server/IEntityAccess.java ++++ b/src/main/java/net/minecraft/server/IEntityAccess.java +@@ -1,13 +1,14 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Objects; + import java.util.UUID; + import java.util.function.Predicate; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public interface IEntityAccess { + +diff --git a/src/main/java/net/minecraft/server/IEntityAngerable.java b/src/main/java/net/minecraft/server/IEntityAngerable.java +index d2b8bf5c1c92469a878755dd2d90b0291ae53e37..d8b8670c83816b2233a61b451cec4b08d21101c3 100644 +--- a/src/main/java/net/minecraft/server/IEntityAngerable.java ++++ b/src/main/java/net/minecraft/server/IEntityAngerable.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Objects; + import java.util.UUID; +-import javax.annotation.Nullable; + + public interface IEntityAngerable { + +diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java +index a52dd0c021e264a57a62bde27ea9d2a6a97e2335..3873b29900485a40bbc464580e1e69aec767528c 100644 +--- a/src/main/java/net/minecraft/server/IEntitySelector.java ++++ b/src/main/java/net/minecraft/server/IEntitySelector.java +@@ -1,8 +1,9 @@ + package net.minecraft.server; + + import com.google.common.base.Predicates; +-import java.util.function.Predicate; ++ + import javax.annotation.Nullable; ++import java.util.function.Predicate; + + public final class IEntitySelector { + +diff --git a/src/main/java/net/minecraft/server/IHopper.java b/src/main/java/net/minecraft/server/IHopper.java +index 84dcf4a0c5020f54f233e514a101e608d70286d5..2553abbfa05f0c6537c5ec92694b3c0704adad5c 100644 +--- a/src/main/java/net/minecraft/server/IHopper.java ++++ b/src/main/java/net/minecraft/server/IHopper.java +@@ -1,7 +1,5 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; +- + public interface IHopper extends IInventory { + + VoxelShape a = Block.a(2.0D, 11.0D, 2.0D, 14.0D, 16.0D, 14.0D); +diff --git a/src/main/java/net/minecraft/server/IInventory.java b/src/main/java/net/minecraft/server/IInventory.java +index 46b88056b852a7f91d32862dea7bd3a7ea4a1226..8c6568019517336fc30c5f4e694e06c730639017 100644 +--- a/src/main/java/net/minecraft/server/IInventory.java ++++ b/src/main/java/net/minecraft/server/IInventory.java +@@ -1,7 +1,8 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.entity.CraftHumanEntity; ++ + import java.util.Set; +-import org.bukkit.craftbukkit.entity.CraftHumanEntity; // CraftBukkit + + public interface IInventory extends Clearable { + +diff --git a/src/main/java/net/minecraft/server/IMerchant.java b/src/main/java/net/minecraft/server/IMerchant.java +index f69132b6b87dfad47738661fff097d8f1346f4a5..904756d92590ecb3e49c08ffe4e4cdc4c1a99d65 100644 +--- a/src/main/java/net/minecraft/server/IMerchant.java ++++ b/src/main/java/net/minecraft/server/IMerchant.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.OptionalInt; + import javax.annotation.Nullable; ++import java.util.OptionalInt; + + public interface IMerchant { + +diff --git a/src/main/java/net/minecraft/server/IOWorker.java b/src/main/java/net/minecraft/server/IOWorker.java +index 620acc318d67a7317e3c40b24f2015aff5907be2..907916f8ce8021b0f0007bb6e1cda9287163d0cc 100644 +--- a/src/main/java/net/minecraft/server/IOWorker.java ++++ b/src/main/java/net/minecraft/server/IOWorker.java +@@ -2,6 +2,10 @@ package net.minecraft.server; + + import com.google.common.collect.Maps; + import com.mojang.datafixers.util.Either; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.io.File; + import java.io.IOException; + import java.util.ArrayList; +@@ -14,9 +18,6 @@ import java.util.concurrent.CompletionException; + import java.util.concurrent.atomic.AtomicBoolean; + import java.util.function.Function; + import java.util.function.Supplier; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class IOWorker implements AutoCloseable { + +diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java +index f538189aead404e97254ad3c9ca7bde1901791d8..28f53508f91b6a3412b8b3cfb8f7e70f0727053f 100644 +--- a/src/main/java/net/minecraft/server/IProjectile.java ++++ b/src/main/java/net/minecraft/server/IProjectile.java +@@ -1,11 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.projectiles.ProjectileSource; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.UUID; +-import javax.annotation.Nullable; +- +-// CraftBukkit start +-import org.bukkit.projectiles.ProjectileSource; + // CraftBukkit end + + public abstract class IProjectile extends Entity { +diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java +index b6d6905260cdd32873010f24ef5a3505e66159be..a2475bd55975445fc1e412d45720d5d1ff0e4553 100644 +--- a/src/main/java/net/minecraft/server/IWorldReader.java ++++ b/src/main/java/net/minecraft/server/IWorldReader.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.stream.Stream; + import javax.annotation.Nullable; ++import java.util.stream.Stream; + + public interface IWorldReader extends IBlockLightAccess, ICollisionAccess, BiomeManager.Provider { + +diff --git a/src/main/java/net/minecraft/server/InventoryCraftResult.java b/src/main/java/net/minecraft/server/InventoryCraftResult.java +index ff35cb2bd68335eba6af8bf5e6bd90916f358e01..0948a829e72d26f47f4578fb3defc7dedf92c917 100644 +--- a/src/main/java/net/minecraft/server/InventoryCraftResult.java ++++ b/src/main/java/net/minecraft/server/InventoryCraftResult.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.Location; + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; + // CraftBukkit end + + public class InventoryCraftResult implements IInventory, RecipeHolder { +diff --git a/src/main/java/net/minecraft/server/InventoryCrafting.java b/src/main/java/net/minecraft/server/InventoryCrafting.java +index 0dd7a8708c7ae8b494cae8da57de089bb32c7d4a..1e29bf073058291b80d0a41b91b6e1690a861535 100644 +--- a/src/main/java/net/minecraft/server/InventoryCrafting.java ++++ b/src/main/java/net/minecraft/server/InventoryCrafting.java +@@ -1,13 +1,12 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-// CraftBukkit start +-import java.util.List; + import org.bukkit.Location; +- + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; + import org.bukkit.event.inventory.InventoryType; ++ ++import java.util.Iterator; ++import java.util.List; + // CraftBukkit end + + public class InventoryCrafting implements IInventory, AutoRecipeOutput { +diff --git a/src/main/java/net/minecraft/server/InventoryLargeChest.java b/src/main/java/net/minecraft/server/InventoryLargeChest.java +index d41f04ff36a437531f86abdad82efecd36f1b786..9c26d5d0475fc0dfe6ee9cb8df46772aa19194f4 100644 +--- a/src/main/java/net/minecraft/server/InventoryLargeChest.java ++++ b/src/main/java/net/minecraft/server/InventoryLargeChest.java +@@ -1,12 +1,13 @@ + package net.minecraft.server; + + // CraftBukkit start +-import java.util.ArrayList; +-import java.util.List; +-import org.bukkit.Location; + ++import org.bukkit.Location; + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; ++ ++import java.util.ArrayList; ++import java.util.List; + // CraftBukkit end + + public class InventoryLargeChest implements IInventory { +diff --git a/src/main/java/net/minecraft/server/InventoryMerchant.java b/src/main/java/net/minecraft/server/InventoryMerchant.java +index 8f17a346deec7a3a7cacb516fcab04954e4b1824..9da614417d915d410335cf9bbcfca9343c36dd55 100644 +--- a/src/main/java/net/minecraft/server/InventoryMerchant.java ++++ b/src/main/java/net/minecraft/server/InventoryMerchant.java +@@ -1,13 +1,13 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import javax.annotation.Nullable; +-// CraftBukkit start +-import java.util.List; + import org.bukkit.Location; +-import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.craftbukkit.entity.CraftAbstractVillager; ++import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.List; + // CraftBukkit end + + public class InventoryMerchant implements IInventory { +diff --git a/src/main/java/net/minecraft/server/InventorySubcontainer.java b/src/main/java/net/minecraft/server/InventorySubcontainer.java +index 4cf5dad0939ecb636752e19ad19aec2c882d5efc..b9d1c0d48c2fd0e2b423b99447a4b8d551077f08 100644 +--- a/src/main/java/net/minecraft/server/InventorySubcontainer.java ++++ b/src/main/java/net/minecraft/server/InventorySubcontainer.java +@@ -1,16 +1,13 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++import org.bukkit.Location; ++import org.bukkit.craftbukkit.entity.CraftHumanEntity; ++import org.bukkit.entity.HumanEntity; + + import java.util.ArrayList; + import java.util.Iterator; + import java.util.List; +-import java.util.stream.Collectors; +- +-// CraftBukkit start +-import org.bukkit.Location; +-import org.bukkit.craftbukkit.entity.CraftHumanEntity; +-import org.bukkit.entity.HumanEntity; + // CraftBukkit end + + public class InventorySubcontainer implements IInventory, AutoRecipeOutput { +diff --git a/src/main/java/net/minecraft/server/ItemArmor.java b/src/main/java/net/minecraft/server/ItemArmor.java +index 885458d54c97ad597d84ebb414884bf9fc1e0d86..9aeecdafeed5b4bd7b13b91cfa71456e0719bcf0 100644 +--- a/src/main/java/net/minecraft/server/ItemArmor.java ++++ b/src/main/java/net/minecraft/server/ItemArmor.java +@@ -3,12 +3,11 @@ package net.minecraft.server; + import com.google.common.collect.ImmutableMultimap; + import com.google.common.collect.ImmutableMultimap.Builder; + import com.google.common.collect.Multimap; +-import java.util.List; +-import java.util.UUID; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.event.block.BlockDispenseArmorEvent; ++ ++import java.util.List; ++import java.util.UUID; + // CraftBukkit end + + public class ItemArmor extends Item implements ItemWearable { +diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java +index 63d2294da4f0da628e62b782b71e34cb3eb959b5..8425d58ccae4d1462e225ef7f0e4d25ce26ac43c 100644 +--- a/src/main/java/net/minecraft/server/ItemBlock.java ++++ b/src/main/java/net/minecraft/server/ItemBlock.java +@@ -1,12 +1,12 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.Map; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.block.data.CraftBlockData; + import org.bukkit.event.block.BlockCanBuildEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.Map; + // CraftBukkit end + + public class ItemBlock extends Item { +diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java +index 120bf8436fd82294c339add2e7bff1cda8311aea..6697cfb7cf32cc2a86993a9d59aec056ac493c30 100644 +--- a/src/main/java/net/minecraft/server/ItemBucket.java ++++ b/src/main/java/net/minecraft/server/ItemBucket.java +@@ -1,12 +1,12 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.util.DummyGeneratorAccess; + import org.bukkit.event.player.PlayerBucketEmptyEvent; + import org.bukkit.event.player.PlayerBucketFillEvent; ++ ++import javax.annotation.Nullable; + // CraftBukkit end + + public class ItemBucket extends Item { +diff --git a/src/main/java/net/minecraft/server/ItemCrossbow.java b/src/main/java/net/minecraft/server/ItemCrossbow.java +index 728767356ba82a77cc87040db5a7aef88c1ea8e1..4e5d09d2d43aca5cfd7f284120043293e82009a3 100644 +--- a/src/main/java/net/minecraft/server/ItemCrossbow.java ++++ b/src/main/java/net/minecraft/server/ItemCrossbow.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ + import java.util.List; + import java.util.Random; + import java.util.function.Predicate; +diff --git a/src/main/java/net/minecraft/server/ItemDebugStick.java b/src/main/java/net/minecraft/server/ItemDebugStick.java +index 138dc40c4080ee6c345cb99d5a8fa26e2cb472be..480dbd68605a0d2ff6423ddb99a75b5a516ab600 100644 +--- a/src/main/java/net/minecraft/server/ItemDebugStick.java ++++ b/src/main/java/net/minecraft/server/ItemDebugStick.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Collection; + import javax.annotation.Nullable; ++import java.util.Collection; + + public class ItemDebugStick extends Item { + +diff --git a/src/main/java/net/minecraft/server/ItemDye.java b/src/main/java/net/minecraft/server/ItemDye.java +index b885d66717c44ca128874b7c0887f8efe4bda183..64e63663e65bc4ab1e975f9b61c547fb270eb092 100644 +--- a/src/main/java/net/minecraft/server/ItemDye.java ++++ b/src/main/java/net/minecraft/server/ItemDye.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; +-import java.util.Map; ++import org.bukkit.event.entity.SheepDyeWoolEvent; + +-import org.bukkit.event.entity.SheepDyeWoolEvent; // CraftBukkit ++import java.util.Map; + + public class ItemDye extends Item { + +diff --git a/src/main/java/net/minecraft/server/ItemFireworks.java b/src/main/java/net/minecraft/server/ItemFireworks.java +index 886b6006c0691afb85de605bb4f5dfc05b440878..cf232cb18bf320011f588602e42c0e20b52fe70c 100644 +--- a/src/main/java/net/minecraft/server/ItemFireworks.java ++++ b/src/main/java/net/minecraft/server/ItemFireworks.java +@@ -1,7 +1,6 @@ + package net.minecraft.server; + + import java.util.ArrayList; +-import java.util.Arrays; + import java.util.Comparator; + import java.util.List; + +diff --git a/src/main/java/net/minecraft/server/ItemFishingRod.java b/src/main/java/net/minecraft/server/ItemFishingRod.java +index 427c593be79fc26d5b8a1b5b60987d15b25f93ed..1b0146413e80c5a0df594da3def26e7118d874ee 100644 +--- a/src/main/java/net/minecraft/server/ItemFishingRod.java ++++ b/src/main/java/net/minecraft/server/ItemFishingRod.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.event.player.PlayerFishEvent; // CraftBukkit ++import org.bukkit.event.player.PlayerFishEvent; + + public class ItemFishingRod extends Item implements ItemVanishable { + +diff --git a/src/main/java/net/minecraft/server/ItemLeash.java b/src/main/java/net/minecraft/server/ItemLeash.java +index aadceb34a09729b883ff1fcabfafdc02b4448bff..7d58e32a257174053e73a5de0a31d055b90316cf 100644 +--- a/src/main/java/net/minecraft/server/ItemLeash.java ++++ b/src/main/java/net/minecraft/server/ItemLeash.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.event.hanging.HangingPlaceEvent; ++ + import java.util.Iterator; + import java.util.List; + +-import org.bukkit.event.hanging.HangingPlaceEvent; // CraftBukkit +- + public class ItemLeash extends Item { + + public ItemLeash(Item.Info item_info) { +diff --git a/src/main/java/net/minecraft/server/ItemMonsterEgg.java b/src/main/java/net/minecraft/server/ItemMonsterEgg.java +index 6d83210806aafd00f45dc44c6723b818c5b1fba1..cb88147e34f66a65d5da4db2637a28746c2eff87 100644 +--- a/src/main/java/net/minecraft/server/ItemMonsterEgg.java ++++ b/src/main/java/net/minecraft/server/ItemMonsterEgg.java +@@ -2,10 +2,11 @@ package net.minecraft.server; + + import com.google.common.collect.Iterables; + import com.google.common.collect.Maps; ++ ++import javax.annotation.Nullable; + import java.util.Map; + import java.util.Objects; + import java.util.Optional; +-import javax.annotation.Nullable; + + public class ItemMonsterEgg extends Item { + +diff --git a/src/main/java/net/minecraft/server/ItemRecord.java b/src/main/java/net/minecraft/server/ItemRecord.java +index 3e49b2c9db37ddba1c6bdd544877d5e7cd67141e..13b9bd8ece4aaa804d8d79b902d3ec63a737de87 100644 +--- a/src/main/java/net/minecraft/server/ItemRecord.java ++++ b/src/main/java/net/minecraft/server/ItemRecord.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; ++ + import java.util.Map; + + public class ItemRecord extends Item { +diff --git a/src/main/java/net/minecraft/server/ItemSkullPlayer.java b/src/main/java/net/minecraft/server/ItemSkullPlayer.java +index 61f4cf9cc62a1b2ba59137b8682cb58834b4abcc..d08946bb977a3e949fc2178ed12e84152551a635 100644 +--- a/src/main/java/net/minecraft/server/ItemSkullPlayer.java ++++ b/src/main/java/net/minecraft/server/ItemSkullPlayer.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + + import com.mojang.authlib.GameProfile; +-import java.util.UUID; + import org.apache.commons.lang3.StringUtils; + ++import java.util.UUID; ++ + public class ItemSkullPlayer extends ItemBlockWallable { + + public ItemSkullPlayer(Block block, Block block1, Item.Info item_info) { +diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java +index 3c56053e3075173edd22eccb277f51a12287ab56..9529eb584b1d5f4549d4f376a2d4894a65f05c6d 100644 +--- a/src/main/java/net/minecraft/server/ItemStack.java ++++ b/src/main/java/net/minecraft/server/ItemStack.java +@@ -6,26 +6,10 @@ import com.google.gson.JsonParseException; + import com.mojang.brigadier.StringReader; + import com.mojang.brigadier.exceptions.CommandSyntaxException; + import com.mojang.serialization.Codec; ++import com.mojang.serialization.Dynamic; + import com.mojang.serialization.codecs.RecordCodecBuilder; +-import java.text.DecimalFormat; +-import java.text.DecimalFormatSymbols; +-import java.util.Collections; +-import java.util.Comparator; +-import java.util.Locale; +-import java.util.Objects; +-import java.util.Optional; +-import java.util.Random; +-import java.util.function.Consumer; +-import java.util.function.Predicate; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import com.mojang.serialization.Dynamic; +-import java.util.List; +-import java.util.Map; +- + import org.bukkit.Location; + import org.bukkit.TreeType; + import org.bukkit.block.BlockState; +@@ -37,6 +21,13 @@ import org.bukkit.entity.Player; + import org.bukkit.event.block.BlockFertilizeEvent; + import org.bukkit.event.player.PlayerItemDamageEvent; + import org.bukkit.event.world.StructureGrowEvent; ++ ++import javax.annotation.Nullable; ++import java.text.DecimalFormat; ++import java.text.DecimalFormatSymbols; ++import java.util.*; ++import java.util.function.Consumer; ++import java.util.function.Predicate; + // CraftBukkit end + + public final class ItemStack { +diff --git a/src/main/java/net/minecraft/server/ItemWorldMap.java b/src/main/java/net/minecraft/server/ItemWorldMap.java +index faa556d4358bc9890ae80c18ee10c38a8d46548e..0f342d972f94852d057e39f0c24baf46b21c0d52 100644 +--- a/src/main/java/net/minecraft/server/ItemWorldMap.java ++++ b/src/main/java/net/minecraft/server/ItemWorldMap.java +@@ -4,11 +4,10 @@ import com.google.common.collect.Iterables; + import com.google.common.collect.LinkedHashMultiset; + import com.google.common.collect.Multiset; + import com.google.common.collect.Multisets; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.Bukkit; + import org.bukkit.event.server.MapInitializeEvent; ++ ++import javax.annotation.Nullable; + // CraftBukkit end + + public class ItemWorldMap extends ItemWorldMapBase { +diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java +index 6d7452d05c648cdee50b2077aec6f100449b8229..da52912a4ae8d23d1fa14a2a1b4fdcba26c2500e 100644 +--- a/src/main/java/net/minecraft/server/JsonList.java ++++ b/src/main/java/net/minecraft/server/JsonList.java +@@ -1,29 +1,24 @@ + package net.minecraft.server; + +-import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import com.google.common.io.Files; +-import com.google.gson.Gson; +-import com.google.gson.GsonBuilder; +-import com.google.gson.JsonArray; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; ++import com.google.gson.*; ++import org.apache.commons.io.IOUtils; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.io.BufferedReader; + import java.io.BufferedWriter; + import java.io.File; + import java.io.IOException; +-import java.lang.reflect.ParameterizedType; // Paper +-import java.lang.reflect.Type; // Paper ++import java.lang.reflect.ParameterizedType; ++import java.lang.reflect.Type; + import java.nio.charset.StandardCharsets; + import java.util.Collection; + import java.util.Iterator; + import java.util.List; + import java.util.Map; +-import javax.annotation.Nullable; +- +-import org.apache.commons.io.IOUtils; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public abstract class JsonList> { + +diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java +index 4a49fe4cc600e2b70963302ddae0c4479849f3f5..c9f277c06d29741fbab92c77dadf0b53cc84911a 100644 +--- a/src/main/java/net/minecraft/server/LegacyPingHandler.java ++++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java +@@ -1,17 +1,17 @@ + package net.minecraft.server; + + import com.destroystokyo.paper.network.PaperLegacyStatusClient; +- + import io.netty.buffer.ByteBuf; + import io.netty.buffer.Unpooled; + import io.netty.channel.ChannelFutureListener; + import io.netty.channel.ChannelHandlerContext; + import io.netty.channel.ChannelInboundHandlerAdapter; +-import java.net.InetSocketAddress; +-import java.nio.charset.StandardCharsets; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import java.net.InetSocketAddress; ++import java.nio.charset.StandardCharsets; ++ + public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/LightEngineLayer.java b/src/main/java/net/minecraft/server/LightEngineLayer.java +index b5d5dd1075fd6aabbfbbd60f219b76593fc54a76..56c2ee99ab1d2ec28befaf3383e83a8f70fbdb20 100644 +--- a/src/main/java/net/minecraft/server/LightEngineLayer.java ++++ b/src/main/java/net/minecraft/server/LightEngineLayer.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + +-import java.util.Arrays; +-import javax.annotation.Nullable; + import org.apache.commons.lang3.mutable.MutableInt; + ++import javax.annotation.Nullable; ++import java.util.Arrays; ++ + public abstract class LightEngineLayer, S extends LightEngineStorage> extends LightEngineGraph implements LightEngineLayerEventListener { + + private static final EnumDirection[] e = EnumDirection.values(); +diff --git a/src/main/java/net/minecraft/server/LightEngineStorage.java b/src/main/java/net/minecraft/server/LightEngineStorage.java +index e0bbfe1422cbad811ecb43d7436380d86b0f8abc..e06de856b8d889c4235cb0a443d9df808cfe34d3 100644 +--- a/src/main/java/net/minecraft/server/LightEngineStorage.java ++++ b/src/main/java/net/minecraft/server/LightEngineStorage.java +@@ -1,13 +1,9 @@ + package net.minecraft.server; + +-import it.unimi.dsi.fastutil.longs.Long2ObjectMap; ++import it.unimi.dsi.fastutil.longs.*; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap.Entry; +-import it.unimi.dsi.fastutil.longs.Long2ObjectMaps; +-import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +-import it.unimi.dsi.fastutil.longs.LongIterator; +-import it.unimi.dsi.fastutil.longs.LongOpenHashSet; +-import it.unimi.dsi.fastutil.longs.LongSet; + import it.unimi.dsi.fastutil.objects.ObjectIterator; ++ + import javax.annotation.Nullable; + + public abstract class LightEngineStorage> extends LightEngineGraphSection { +diff --git a/src/main/java/net/minecraft/server/LightEngineStorageArray.java b/src/main/java/net/minecraft/server/LightEngineStorageArray.java +index 549c2551c2b59730bf53a80f8706d388d96ad932..cee30e695c378acba0aab9ae66094914364ea3c9 100644 +--- a/src/main/java/net/minecraft/server/LightEngineStorageArray.java ++++ b/src/main/java/net/minecraft/server/LightEngineStorageArray.java +@@ -1,6 +1,5 @@ + package net.minecraft.server; + +-import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; + import javax.annotation.Nullable; + + public abstract class LightEngineStorageArray> { +diff --git a/src/main/java/net/minecraft/server/LightEngineStorageBlock.java b/src/main/java/net/minecraft/server/LightEngineStorageBlock.java +index 5b7b7506f5d1a7578fb54a578891324dfcec3f03..c6362f6ba91c5f945e1d3ce1e5b095771eebd55b 100644 +--- a/src/main/java/net/minecraft/server/LightEngineStorageBlock.java ++++ b/src/main/java/net/minecraft/server/LightEngineStorageBlock.java +@@ -1,7 +1,5 @@ + package net.minecraft.server; + +-import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +- + public class LightEngineStorageBlock extends LightEngineStorage { + + protected LightEngineStorageBlock(ILightAccess ilightaccess) { +diff --git a/src/main/java/net/minecraft/server/LightEngineStorageSky.java b/src/main/java/net/minecraft/server/LightEngineStorageSky.java +index 944094e8e770cc8c0205ef2aa6c48fff55d74639..d29e1edffd6c27b351eebb385ceac23db6101713 100644 +--- a/src/main/java/net/minecraft/server/LightEngineStorageSky.java ++++ b/src/main/java/net/minecraft/server/LightEngineStorageSky.java +@@ -1,10 +1,9 @@ + package net.minecraft.server; + +-import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; +-import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; + import it.unimi.dsi.fastutil.longs.LongIterator; + import it.unimi.dsi.fastutil.longs.LongOpenHashSet; + import it.unimi.dsi.fastutil.longs.LongSet; ++ + import java.util.Arrays; + + public class LightEngineStorageSky extends LightEngineStorage { +diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java +index cc22d89d540a4f86e11d7d09ad2be7fcf070f43d..adc7e6b6c0a8bec4dc0d2c9bf39a459578bdd41d 100644 +--- a/src/main/java/net/minecraft/server/LightEngineThreaded.java ++++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java +@@ -1,15 +1,12 @@ + package net.minecraft.server; + +-import com.mojang.datafixers.util.Pair; +-import it.unimi.dsi.fastutil.objects.ObjectArrayList; +-import it.unimi.dsi.fastutil.objects.ObjectList; +-import it.unimi.dsi.fastutil.objects.ObjectListIterator; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.atomic.AtomicBoolean; + import java.util.function.IntSupplier; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class LightEngineThreaded extends LightEngine implements AutoCloseable { + +diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java +index c83ba9d9869f8ba51df17963d530536d2a08c263..b87b989a4dfd1abe160842071b435d19bdd8942e 100644 +--- a/src/main/java/net/minecraft/server/LocaleLanguage.java ++++ b/src/main/java/net/minecraft/server/LocaleLanguage.java +@@ -6,6 +6,9 @@ import com.google.gson.Gson; + import com.google.gson.JsonElement; + import com.google.gson.JsonObject; + import com.google.gson.JsonParseException; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.io.IOException; + import java.io.InputStream; + import java.io.InputStreamReader; +@@ -15,8 +18,6 @@ import java.util.Map; + import java.util.Map.Entry; + import java.util.function.BiConsumer; + import java.util.regex.Pattern; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public abstract class LocaleLanguage { + +diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java +index b46122a57b60888b20ec6602bb89df898ff981a4..656ba5b0621aa3f5a3208a4e08692a381522f437 100644 +--- a/src/main/java/net/minecraft/server/LoginListener.java ++++ b/src/main/java/net/minecraft/server/LoginListener.java +@@ -4,6 +4,16 @@ import com.destroystokyo.paper.profile.CraftPlayerProfile; + import com.destroystokyo.paper.profile.PlayerProfile; + import com.mojang.authlib.GameProfile; + import com.mojang.authlib.exceptions.AuthenticationUnavailableException; ++import io.netty.buffer.Unpooled; ++import org.apache.commons.lang3.Validate; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++import org.bukkit.craftbukkit.util.Waitable; ++import org.bukkit.event.player.AsyncPlayerPreLoginEvent; ++import org.bukkit.event.player.PlayerPreLoginEvent; ++ ++import javax.annotation.Nullable; ++import javax.crypto.SecretKey; + import java.math.BigInteger; + import java.net.InetAddress; + import java.net.InetSocketAddress; +@@ -13,19 +23,6 @@ import java.util.Arrays; + import java.util.Random; + import java.util.UUID; + import java.util.concurrent.atomic.AtomicInteger; +-import javax.annotation.Nullable; +-import javax.crypto.SecretKey; +-import org.apache.commons.lang3.Validate; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import org.bukkit.Bukkit; +-import org.bukkit.craftbukkit.util.Waitable; +-import org.bukkit.event.player.AsyncPlayerPreLoginEvent; +-import org.bukkit.event.player.PlayerPreLoginEvent; +-// CraftBukkit end +-import io.netty.buffer.Unpooled; // Paper + + public class LoginListener implements PacketLoginInListener { + +diff --git a/src/main/java/net/minecraft/server/LootEnchantFunction.java b/src/main/java/net/minecraft/server/LootEnchantFunction.java +index 53c37b4a79a6bbd0d6b62ee0aa224f5cb32c9fbd..5da2f615e1a67cfca13609910576098daa741a82 100644 +--- a/src/main/java/net/minecraft/server/LootEnchantFunction.java ++++ b/src/main/java/net/minecraft/server/LootEnchantFunction.java +@@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableSet; + import com.google.gson.JsonDeserializationContext; + import com.google.gson.JsonObject; + import com.google.gson.JsonSerializationContext; ++ + import java.util.Set; + + public class LootEnchantFunction extends LootItemFunctionConditional { +diff --git a/src/main/java/net/minecraft/server/LootEntryAbstract.java b/src/main/java/net/minecraft/server/LootEntryAbstract.java +index 788078c209b8bcbd551cf0a52eb6172928d7b5f9..39227fd450c32ea58439f6ad1d310f2c518ad109 100644 +--- a/src/main/java/net/minecraft/server/LootEntryAbstract.java ++++ b/src/main/java/net/minecraft/server/LootEntryAbstract.java +@@ -4,6 +4,7 @@ import com.google.common.collect.Lists; + import com.google.gson.JsonDeserializationContext; + import com.google.gson.JsonObject; + import com.google.gson.JsonSerializationContext; ++ + import java.util.List; + import java.util.function.Predicate; + +diff --git a/src/main/java/net/minecraft/server/LootItemConditionRandomChanceWithLooting.java b/src/main/java/net/minecraft/server/LootItemConditionRandomChanceWithLooting.java +index be735fe49317cb70b0f77d567a3714faca4b60ae..fb285b3fb92af4eb4c867e44253fa7cd3d3c87fc 100644 +--- a/src/main/java/net/minecraft/server/LootItemConditionRandomChanceWithLooting.java ++++ b/src/main/java/net/minecraft/server/LootItemConditionRandomChanceWithLooting.java +@@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableSet; + import com.google.gson.JsonDeserializationContext; + import com.google.gson.JsonObject; + import com.google.gson.JsonSerializationContext; ++ + import java.util.Set; + + public class LootItemConditionRandomChanceWithLooting implements LootItemCondition { +diff --git a/src/main/java/net/minecraft/server/LootItemConditionSurvivesExplosion.java b/src/main/java/net/minecraft/server/LootItemConditionSurvivesExplosion.java +index 873a177cdc13a7b04cea5af81c178e82a32d307b..bb75895189ddcef1a5376b328bf2fed0ec148079 100644 +--- a/src/main/java/net/minecraft/server/LootItemConditionSurvivesExplosion.java ++++ b/src/main/java/net/minecraft/server/LootItemConditionSurvivesExplosion.java +@@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableSet; + import com.google.gson.JsonDeserializationContext; + import com.google.gson.JsonObject; + import com.google.gson.JsonSerializationContext; ++ + import java.util.Random; + import java.util.Set; + +diff --git a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java +index 30f21e3ff7eed3c7291e01b94cc0f66fd48756d0..cccd0b1a4cc7505b3a63b117e25ad8e8e0b949e4 100644 +--- a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java ++++ b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java +@@ -4,11 +4,12 @@ import com.google.common.collect.ImmutableSet; + import com.google.gson.JsonDeserializationContext; + import com.google.gson.JsonObject; + import com.google.gson.JsonSerializationContext; +-import java.util.Locale; +-import java.util.Set; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import java.util.Locale; ++import java.util.Set; ++ + public class LootItemFunctionExplorationMap extends LootItemFunctionConditional { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java +index ca18d3156fd2b10f8ee48ff02f6f47e6e649200b..3aced0cb32f3a4f11efda79e40b6f8cd5045b295 100644 +--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java ++++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java +@@ -4,10 +4,11 @@ import com.google.common.collect.Lists; + import com.google.gson.JsonDeserializationContext; + import com.google.gson.JsonObject; + import com.google.gson.JsonSerializationContext; ++import org.apache.commons.lang3.ArrayUtils; ++ + import java.util.List; + import java.util.function.BiFunction; + import java.util.function.Consumer; +-import org.apache.commons.lang3.ArrayUtils; + + public abstract class LootSelectorEntry extends LootEntryAbstract { + +diff --git a/src/main/java/net/minecraft/server/LootTable.java b/src/main/java/net/minecraft/server/LootTable.java +index 424144fc4c2fdec628ff0c0207f21b0c56d96501..451cec0df56e1153c1c8c9ae554530fbc77ad312 100644 +--- a/src/main/java/net/minecraft/server/LootTable.java ++++ b/src/main/java/net/minecraft/server/LootTable.java +@@ -1,25 +1,18 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import com.google.gson.JsonDeserializationContext; +-import com.google.gson.JsonDeserializer; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; +-import com.google.gson.JsonParseException; +-import com.google.gson.JsonSerializationContext; +-import com.google.gson.JsonSerializer; +-import java.lang.reflect.Type; +-import java.util.*; +-import java.util.function.BiFunction; +-import java.util.function.Consumer; ++import com.google.gson.*; + import org.apache.commons.lang3.ArrayUtils; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-// CraftBukkit start +-import java.util.stream.Collectors; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.event.world.LootGenerateEvent; ++ ++import java.lang.reflect.Type; ++import java.util.*; ++import java.util.function.BiFunction; ++import java.util.function.Consumer; + // CraftBukkit end + + public class LootTable { +diff --git a/src/main/java/net/minecraft/server/LootTableRegistry.java b/src/main/java/net/minecraft/server/LootTableRegistry.java +index 43452f663eab54e094e8feab1e9f2266efe82e16..2c456bc34ca9eb56534f68f4844057a852f5ca8a 100644 +--- a/src/main/java/net/minecraft/server/LootTableRegistry.java ++++ b/src/main/java/net/minecraft/server/LootTableRegistry.java +@@ -4,11 +4,12 @@ import com.google.common.collect.ImmutableMap; + import com.google.common.collect.ImmutableMap.Builder; + import com.google.gson.Gson; + import com.google.gson.JsonElement; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.util.Map; + import java.util.Set; + import java.util.function.Function; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class LootTableRegistry extends ResourceDataJson { + +diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java +index 284448e6fe9c1c2649ac852cbf9efb7aa00ba3de..14f91c7e67e92b6407a789835378db76a2ecd797 100644 +--- a/src/main/java/net/minecraft/server/MCUtil.java ++++ b/src/main/java/net/minecraft/server/MCUtil.java +@@ -4,7 +4,6 @@ import com.destroystokyo.paper.block.TargetBlockInfo; + import com.destroystokyo.paper.profile.CraftPlayerProfile; + import com.destroystokyo.paper.profile.PlayerProfile; + import com.google.common.util.concurrent.ThreadFactoryBuilder; +-import org.apache.commons.lang.exception.ExceptionUtils; + import com.google.gson.JsonArray; + import com.google.gson.JsonObject; + import com.google.gson.internal.Streams; +@@ -12,6 +11,7 @@ import com.google.gson.stream.JsonWriter; + import com.mojang.authlib.GameProfile; + import com.mojang.datafixers.util.Either; + import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; ++import org.apache.commons.lang.exception.ExceptionUtils; + import org.bukkit.Location; + import org.bukkit.block.BlockFace; + import org.bukkit.craftbukkit.CraftWorld; +@@ -25,12 +25,7 @@ import java.util.ArrayList; + import java.util.List; + import java.util.Queue; + import java.util.Set; +-import java.util.concurrent.CompletableFuture; +-import java.util.concurrent.ExecutionException; +-import java.util.concurrent.LinkedBlockingQueue; +-import java.util.concurrent.ThreadPoolExecutor; +-import java.util.concurrent.TimeUnit; +-import java.util.concurrent.TimeoutException; ++import java.util.concurrent.*; + import java.util.concurrent.atomic.AtomicBoolean; + import java.util.function.BiConsumer; + import java.util.function.Consumer; +diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java +index c426d1ed14177326c774d44c248f38229b3ad5be..2ddd36aa4b7c6835261012c5b70570898c2877e7 100644 +--- a/src/main/java/net/minecraft/server/Main.java ++++ b/src/main/java/net/minecraft/server/Main.java +@@ -5,9 +5,11 @@ import com.mojang.authlib.GameProfileRepository; + import com.mojang.authlib.minecraft.MinecraftSessionService; + import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; + import com.mojang.datafixers.DataFixer; +-import com.mojang.serialization.DynamicOps; +-import com.mojang.serialization.Lifecycle; +-import java.awt.GraphicsEnvironment; ++import joptsimple.OptionSet; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import java.awt.*; + import java.io.File; + import java.net.Proxy; + import java.nio.file.Paths; +@@ -15,12 +17,6 @@ import java.util.Optional; + import java.util.UUID; + import java.util.concurrent.CompletableFuture; + import java.util.function.BooleanSupplier; +-import joptsimple.NonOptionArgumentSpec; +-import joptsimple.OptionParser; +-import joptsimple.OptionSet; +-import joptsimple.OptionSpec; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class Main { + +diff --git a/src/main/java/net/minecraft/server/MerchantRecipe.java b/src/main/java/net/minecraft/server/MerchantRecipe.java +index e42382a5c385c27b6322b03e87870eb20b21cb22..154a8bd5b17c79b4b3ff4d15ed43332f37528c2c 100644 +--- a/src/main/java/net/minecraft/server/MerchantRecipe.java ++++ b/src/main/java/net/minecraft/server/MerchantRecipe.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; // CraftBukkit ++import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; + + public class MerchantRecipe { + +diff --git a/src/main/java/net/minecraft/server/MinecartTrackLogic.java b/src/main/java/net/minecraft/server/MinecartTrackLogic.java +index e0be3a425aae51e1aced8eb6d8a5e84fc9315e3a..6faccf602f22a2b58064ba2342bf2c6adc1b79f2 100644 +--- a/src/main/java/net/minecraft/server/MinecartTrackLogic.java ++++ b/src/main/java/net/minecraft/server/MinecartTrackLogic.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; + + public class MinecartTrackLogic { + +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 26ee6e9219059c9f7175148e934d2adec2b336a0..067956fdd37e058dbf94c04d1d19de7084f32e23 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1,13 +1,8 @@ + package net.minecraft.server; + ++import co.aikar.timings.MinecraftTimings; + import com.google.common.base.Splitter; +-import com.google.common.collect.ImmutableList; +-import co.aikar.timings.Timings; +-import com.destroystokyo.paper.event.server.PaperServerListPingEvent; +-import com.google.common.base.Stopwatch; +-import com.google.common.collect.Lists; +-import com.google.common.collect.Maps; +-import com.google.common.collect.Sets; ++import com.google.common.collect.*; + import com.mojang.authlib.GameProfile; + import com.mojang.authlib.GameProfileRepository; + import com.mojang.authlib.minecraft.MinecraftSessionService; +@@ -18,6 +13,15 @@ import io.netty.buffer.ByteBuf; + import io.netty.buffer.ByteBufOutputStream; + import io.netty.buffer.Unpooled; + import it.unimi.dsi.fastutil.longs.LongIterator; ++import joptsimple.OptionSet; ++import org.apache.commons.lang3.Validate; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++import org.bukkit.event.server.ServerLoadEvent; ++import org.spigotmc.SlackActivityAccountant; ++ ++import javax.annotation.Nullable; ++import javax.imageio.ImageIO; + import java.awt.image.BufferedImage; + import java.io.BufferedWriter; + import java.io.File; +@@ -41,22 +45,6 @@ import java.util.concurrent.atomic.AtomicReference; + import java.util.function.BooleanSupplier; + import java.util.function.Function; + import java.util.stream.Stream; +-import javax.annotation.Nullable; +-import javax.imageio.ImageIO; +-import org.apache.commons.lang3.Validate; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; +-// CraftBukkit start +-import com.google.common.collect.ImmutableSet; +-// import jline.console.ConsoleReader; // Paper +-import joptsimple.OptionSet; +-import org.bukkit.Bukkit; +-import org.bukkit.craftbukkit.CraftServer; +-import org.bukkit.craftbukkit.Main; +-import org.bukkit.event.server.ServerLoadEvent; +-// CraftBukkit end +-import co.aikar.timings.MinecraftTimings; // Paper +-import org.spigotmc.SlackActivityAccountant; // Spigot + + public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable { + +diff --git a/src/main/java/net/minecraft/server/MobEffectList.java b/src/main/java/net/minecraft/server/MobEffectList.java +index 08911c9aacbd60a1fe4d19650f4335a4cce4084e..a6c18f175e0dbc1c03e5c9750a0e184b7d5c6ede 100644 +--- a/src/main/java/net/minecraft/server/MobEffectList.java ++++ b/src/main/java/net/minecraft/server/MobEffectList.java +@@ -1,15 +1,14 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Map; + import java.util.Map.Entry; + import java.util.UUID; +-import javax.annotation.Nullable; +- +-// CraftBukkit start +-import org.bukkit.craftbukkit.event.CraftEventFactory; +-import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; + // CraftBukkit end + + public class MobEffectList { +diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +index 17e5e1f191efd91b0797826cb96e5f230d622a0d..2a7846b0ea96638e5b519f92e6d20a96c12d25b0 100644 +--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java ++++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +@@ -1,12 +1,13 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Optional; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public abstract class MobSpawnerAbstract { + +diff --git a/src/main/java/net/minecraft/server/MobSpawnerTrader.java b/src/main/java/net/minecraft/server/MobSpawnerTrader.java +index 736b794f8268858e2e63a3aafef328b443386989..55758e608cd439bd55b71d80408e9f1dec57d967 100644 +--- a/src/main/java/net/minecraft/server/MobSpawnerTrader.java ++++ b/src/main/java/net/minecraft/server/MobSpawnerTrader.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Optional; + import java.util.Random; +-import javax.annotation.Nullable; + + public class MobSpawnerTrader implements MobSpawner { + +diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +index c948e590eeff0aea53573532f8c507d638cc0bdf..1dd0276f409c4d82d9932582847cd128c3a668a2 100644 +--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java ++++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +@@ -1,17 +1,10 @@ + package net.minecraft.server; + +-import java.io.BufferedInputStream; +-import java.io.BufferedOutputStream; +-import java.io.DataInput; +-import java.io.DataInputStream; +-import java.io.DataOutput; +-import java.io.DataOutputStream; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.OutputStream; ++import io.netty.buffer.ByteBufInputStream; ++ ++import java.io.*; + import java.util.zip.GZIPInputStream; + import java.util.zip.GZIPOutputStream; +-import io.netty.buffer.ByteBufInputStream; // Paper + + public class NBTCompressedStreamTools { + +diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java +index d7ba2db6380d04d732888420a86a396e009b84c8..b62311247d1b8b02d2239de972a5a1450a973ef2 100644 +--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java ++++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java +@@ -1,11 +1,12 @@ + package net.minecraft.server; + ++import org.apache.commons.lang3.ArrayUtils; ++ + import java.io.DataInput; + import java.io.DataOutput; + import java.io.IOException; + import java.util.Arrays; + import java.util.List; +-import org.apache.commons.lang3.ArrayUtils; + + public class NBTTagByteArray extends NBTList { + +diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java +index 436f40bcd7817bedde4f6570c7c47dba7ff7034f..2b044b9807826034b3b94c45b26b7c0882b53d2c 100644 +--- a/src/main/java/net/minecraft/server/NBTTagCompound.java ++++ b/src/main/java/net/minecraft/server/NBTTagCompound.java +@@ -2,26 +2,18 @@ package net.minecraft.server; + + import com.google.common.base.Strings; + import com.google.common.collect.Lists; +-import com.google.common.collect.Maps; + import com.mojang.serialization.Codec; + import com.mojang.serialization.DataResult; + import com.mojang.serialization.Dynamic; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.io.DataInput; + import java.io.DataOutput; + import java.io.IOException; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.HashMap; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Objects; +-import java.util.Set; +-import java.util.UUID; ++import java.util.*; + import java.util.regex.Pattern; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class NBTTagCompound implements NBTBase { + +diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java +index eb3fc6db692b3be8cf6adea5eacc405b3c317f04..48ef35fb282395b1fa609ef4e2e9511abb7cf641 100644 +--- a/src/main/java/net/minecraft/server/NBTTagIntArray.java ++++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java +@@ -1,11 +1,12 @@ + package net.minecraft.server; + ++import org.apache.commons.lang3.ArrayUtils; ++ + import java.io.DataInput; + import java.io.DataOutput; + import java.io.IOException; + import java.util.Arrays; + import java.util.List; +-import org.apache.commons.lang3.ArrayUtils; + + public class NBTTagIntArray extends NBTList { + +diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java +index ad4807e0bdd6409bd798f995da8f43cec1d0b385..3a04a1eda9c12d5b5ffdea7dafdf93a410a404b0 100644 +--- a/src/main/java/net/minecraft/server/NBTTagList.java ++++ b/src/main/java/net/minecraft/server/NBTTagList.java +@@ -5,6 +5,7 @@ import com.google.common.collect.Iterables; + import com.google.common.collect.Lists; + import it.unimi.dsi.fastutil.bytes.ByteOpenHashSet; + import it.unimi.dsi.fastutil.bytes.ByteSet; ++ + import java.io.DataInput; + import java.io.DataOutput; + import java.io.IOException; +diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +index 376427eee7774a26da53ac041ae197bd982bafce..04552de8d42d9bd75fd37f7ef13ee275a2ead931 100644 +--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java ++++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +@@ -8,14 +8,15 @@ import com.mojang.authlib.Agent; + import com.mojang.authlib.GameProfile; + import com.mojang.authlib.ProfileLookupCallback; + import com.mojang.authlib.yggdrasil.ProfileNotFoundException; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.io.File; + import java.io.IOException; + import java.nio.charset.StandardCharsets; + import java.text.ParseException; + import java.util.*; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class NameReferencingFileConverter { + +diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java +index 2dac507e9e0044a32ae54ea57eada0de04c1467d..b0eeeb9827d523c878d1e84fde8f5036476fdf2e 100644 +--- a/src/main/java/net/minecraft/server/NavigationAbstract.java ++++ b/src/main/java/net/minecraft/server/NavigationAbstract.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableSet; ++ ++import javax.annotation.Nullable; + import java.util.Set; + import java.util.stream.Collectors; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public abstract class NavigationAbstract { + +diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java +index 946c9f05af3091e227efd7c1399c4d947710f722..773d51f0bbef5f4473bba99ea176b37739de862a 100644 +--- a/src/main/java/net/minecraft/server/NetworkManager.java ++++ b/src/main/java/net/minecraft/server/NetworkManager.java +@@ -2,31 +2,27 @@ package net.minecraft.server; + + import com.google.common.collect.Queues; + import com.google.common.util.concurrent.ThreadFactoryBuilder; +-import io.netty.channel.Channel; +-import io.netty.channel.ChannelFuture; +-import io.netty.channel.ChannelFutureListener; +-import io.netty.channel.ChannelHandlerContext; +-import io.netty.channel.DefaultEventLoopGroup; +-import io.netty.channel.SimpleChannelInboundHandler; ++import io.netty.channel.*; + import io.netty.channel.epoll.EpollEventLoopGroup; + import io.netty.channel.local.LocalChannel; + import io.netty.channel.local.LocalServerChannel; + import io.netty.channel.nio.NioEventLoopGroup; +-import io.netty.handler.codec.EncoderException; // Paper ++import io.netty.handler.codec.EncoderException; + import io.netty.handler.timeout.TimeoutException; + import io.netty.util.AttributeKey; + import io.netty.util.concurrent.Future; + import io.netty.util.concurrent.GenericFutureListener; +-import java.net.SocketAddress; +-import java.util.Queue; +-import javax.annotation.Nullable; +-import javax.crypto.SecretKey; + import org.apache.commons.lang3.Validate; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + import org.apache.logging.log4j.Marker; + import org.apache.logging.log4j.MarkerManager; + ++import javax.annotation.Nullable; ++import javax.crypto.SecretKey; ++import java.net.SocketAddress; ++import java.util.Queue; ++ + public class NetworkManager extends SimpleChannelInboundHandler> { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java +index a9795394c9b17f9f0ce4c4f9c8f51a48e950418e..09398d1740b1ad0752183578294ee8f5453b84fd 100644 +--- a/src/main/java/net/minecraft/server/NibbleArray.java ++++ b/src/main/java/net/minecraft/server/NibbleArray.java +@@ -1,6 +1,6 @@ + package net.minecraft.server; + +-import com.destroystokyo.paper.util.pooled.PooledObjects; // Paper ++import com.destroystokyo.paper.util.pooled.PooledObjects; + + import javax.annotation.Nonnull; + import javax.annotation.Nullable; +diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java +index 545dbe6ddcce1d172f465b4a7ab85654ee5fdbb4..5d792e036848ed42973fc125fa4ab5e5688945d1 100644 +--- a/src/main/java/net/minecraft/server/Packet.java ++++ b/src/main/java/net/minecraft/server/Packet.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + +-import io.netty.channel.ChannelFuture; // Paper ++import io.netty.channel.ChannelFuture; ++ + import java.io.IOException; + + public interface Packet { +diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java +index 31e7fb56206a522a335f5e78afd09324d1c38864..d410843fe0c0d20cc374eac676c8f34a0a8aef2f 100644 +--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java ++++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java +@@ -10,11 +10,9 @@ import io.netty.buffer.ByteBufOutputStream; + import io.netty.handler.codec.DecoderException; + import io.netty.handler.codec.EncoderException; + import io.netty.util.ByteProcessor; +-import java.io.DataInput; +-import java.io.DataOutput; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.OutputStream; ++ ++import javax.annotation.Nullable; ++import java.io.*; + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.channels.FileChannel; +@@ -24,9 +22,6 @@ import java.nio.charset.Charset; + import java.nio.charset.StandardCharsets; + import java.util.Date; + import java.util.UUID; +-import javax.annotation.Nullable; +- +-import org.bukkit.craftbukkit.inventory.CraftItemStack; // CraftBukkit + + public class PacketDataSerializer extends ByteBuf { + +diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java +index b0cfef52cbb5e23beae528668e4e98cedecf603c..7deab4d4e40156590eada8f49b7e078efe924b44 100644 +--- a/src/main/java/net/minecraft/server/PacketEncoder.java ++++ b/src/main/java/net/minecraft/server/PacketEncoder.java +@@ -3,12 +3,13 @@ package net.minecraft.server; + import io.netty.buffer.ByteBuf; + import io.netty.channel.ChannelHandlerContext; + import io.netty.handler.codec.MessageToByteEncoder; +-import java.io.IOException; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + import org.apache.logging.log4j.Marker; + import org.apache.logging.log4j.MarkerManager; + ++import java.io.IOException; ++ + public class PacketEncoder extends MessageToByteEncoder> { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +index 51970a4f134e29f5d2bf681d83aeeda916fe9195..79363155ce48746db8cb749358efad07e91b2f3d 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java ++++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.io.IOException; + import javax.annotation.Nullable; ++import java.io.IOException; + + public class PacketPlayInUseEntity implements Packet { + +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutLightUpdate.java b/src/main/java/net/minecraft/server/PacketPlayOutLightUpdate.java +index a22f0cccecc85b4e4fe4603bcfa213f15c23db69..2400beb4128c9de380bf55476731359f83557c1b 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutLightUpdate.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutLightUpdate.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import io.netty.channel.ChannelFuture; // Paper ++import io.netty.channel.ChannelFuture; + + import java.io.IOException; + import java.util.Iterator; +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +index e0ee524093e63e902cc7aea3c82e226438d4deb6..5309ef7abbd243e1fa753139f175e9824d11802c 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +@@ -1,14 +1,15 @@ + package net.minecraft.server; + +-import com.destroystokyo.paper.antixray.ChunkPacketInfo; // Paper - Anti-Xray - Add chunk packet info ++import com.destroystokyo.paper.antixray.ChunkPacketInfo; + import com.google.common.collect.Lists; + import io.netty.buffer.ByteBuf; + import io.netty.buffer.Unpooled; ++ ++import javax.annotation.Nullable; + import java.io.IOException; + import java.util.Iterator; + import java.util.List; + import java.util.Map.Entry; +-import javax.annotation.Nullable; + + public class PacketPlayOutMapChunk implements Packet { + +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +index 99dc43159f240135957aee35f6129f19419c6c25..27cf029e0704d59481621543fb1283767f166e2d 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ + import java.io.IOException; + import java.util.Collection; + import java.util.Iterator; +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java +index 535056c64ef866e645b1bfbd149b50c53cb64485..4edf99eb64be454eae25da128a81795038ca8f97 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.io.IOException; + import javax.annotation.Nullable; ++import java.io.IOException; + + public class PacketPlayOutTitle implements Packet { + +diff --git a/src/main/java/net/minecraft/server/PacketSplitter.java b/src/main/java/net/minecraft/server/PacketSplitter.java +index 2aaa8770edfd8acc6861c23176e405863858b275..660f3f69b7c982ac4b5859844cc6d72a49d8f375 100644 +--- a/src/main/java/net/minecraft/server/PacketSplitter.java ++++ b/src/main/java/net/minecraft/server/PacketSplitter.java +@@ -5,6 +5,7 @@ import io.netty.buffer.Unpooled; + import io.netty.channel.ChannelHandlerContext; + import io.netty.handler.codec.ByteToMessageDecoder; + import io.netty.handler.codec.CorruptedFrameException; ++ + import java.util.List; + + public class PacketSplitter extends ByteToMessageDecoder { +diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java +index b98d094422f09ddffe09bac7cf1a9c7e92ae5aa6..ce17341ee7a4c26d48a2cc49a2cf412505185c91 100644 +--- a/src/main/java/net/minecraft/server/PacketStatusListener.java ++++ b/src/main/java/net/minecraft/server/PacketStatusListener.java +@@ -1,12 +1,6 @@ + package net.minecraft.server; + + // CraftBukkit start +-import com.mojang.authlib.GameProfile; +-import java.net.InetSocketAddress; +-import java.util.Iterator; +-import org.bukkit.craftbukkit.util.CraftChatMessage; +-import org.bukkit.craftbukkit.util.CraftIconCache; +-import org.bukkit.entity.Player; + // CraftBukkit end + + public class PacketStatusListener implements PacketStatusInListener { +diff --git a/src/main/java/net/minecraft/server/PairedQueue.java b/src/main/java/net/minecraft/server/PairedQueue.java +index 2369afb4f37863c5c59456e46c48ad0d32f9eeb7..d18359567b46e4bbd807ad8eeadb8bfeff533bf8 100644 +--- a/src/main/java/net/minecraft/server/PairedQueue.java ++++ b/src/main/java/net/minecraft/server/PairedQueue.java +@@ -1,13 +1,10 @@ + package net.minecraft.server; + + import com.google.common.collect.Queues; +-import java.util.Collection; +-import java.util.Iterator; ++ ++import javax.annotation.Nullable; + import java.util.List; + import java.util.Queue; +-import java.util.stream.Collectors; +-import java.util.stream.IntStream; +-import javax.annotation.Nullable; + + public interface PairedQueue { + +diff --git a/src/main/java/net/minecraft/server/PathEntity.java b/src/main/java/net/minecraft/server/PathEntity.java +index 9154c01a22bc7b6d2dd390bb7b6e21ef52c8006c..d786c3d2eb4e06e20b5125b7ef8fa7d929eb4d01 100644 +--- a/src/main/java/net/minecraft/server/PathEntity.java ++++ b/src/main/java/net/minecraft/server/PathEntity.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.List; + import javax.annotation.Nullable; ++import java.util.List; + + public class PathEntity { + +diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java +index 9b2d23ef1c9369cf15f9f12161c28199fbf4f373..4dca3cd3447ed58f597db33f40da5a2df3c3cd82 100644 +--- a/src/main/java/net/minecraft/server/Pathfinder.java ++++ b/src/main/java/net/minecraft/server/Pathfinder.java +@@ -2,16 +2,12 @@ package net.minecraft.server; + + import com.google.common.collect.ImmutableSet; + import com.google.common.collect.Lists; +-import com.google.common.collect.Sets; ++ ++import javax.annotation.Nullable; + import java.util.Comparator; +-import java.util.Iterator; + import java.util.List; + import java.util.Map; +-import java.util.Optional; + import java.util.Set; +-import java.util.function.Function; +-import java.util.stream.Collectors; +-import javax.annotation.Nullable; + + public class Pathfinder { + +diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java +index 8f26cb20b8c63f2809838c97528cef62ec39bcdb..dc62b66a5bb31002b897d9db4633e7c2d34cfa01 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoal.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoal.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + +-import com.destroystokyo.paper.util.set.OptimizedSmallEnumSet; // Paper - remove streams from pathfindergoalselector ++import com.destroystokyo.paper.util.set.OptimizedSmallEnumSet; ++ + import java.util.EnumSet; + + public abstract class PathfinderGoal { +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java +index b7e1e7e35a33cf6a476b11284ebdb0cdda524af2..e7d10a87dc83de567bba0545570c8a7dd96bfb77 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java +@@ -1,10 +1,9 @@ + package net.minecraft.server; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ + import java.util.EnumSet; + import java.util.function.Predicate; +- +-// CraftBukkit start +-import org.bukkit.craftbukkit.event.CraftEventFactory; + // CraftBukkit end + + public class PathfinderGoalEatTile extends PathfinderGoal { +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java b/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java +index 514dbf29aa74ac896a183cab84c233f26c41f813..2eb4eab78cf7f8205092982ab1278188085ecd80 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + +-import java.util.EnumSet; +-// CraftBukkit start + import org.bukkit.Location; + import org.bukkit.craftbukkit.entity.CraftEntity; + import org.bukkit.event.entity.EntityTeleportEvent; ++ ++import java.util.EnumSet; + // CraftBukkit end + + public class PathfinderGoalFollowOwner extends PathfinderGoal { +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java +index c0721c7fe479c8f753b8f48197a70dcd1ecfef5f..dee689e4c792d94d5f313aa44e0568648a8fe949 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java +@@ -1,8 +1,8 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.EnumSet; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class PathfinderGoalNearestAttackableTarget extends PathfinderGoalTarget { + +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java +index a55a8ef6e110821c6c7c28a28d9e053e5e84adfa..30eab63fc900b4c92458d033cd26c9bf01575411 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.EnumSet; + import javax.annotation.Nullable; ++import java.util.EnumSet; + + public class PathfinderGoalPanic extends PathfinderGoal { + +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java +index 29efbdd2ca77833e6be59e5b5b4c38633e43588d..b27679e5993177d550a7a2727fc3bcda5afe15b5 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + +-import java.util.Random; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.event.entity.EntityInteractEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Random; + // CraftBukkit end + + public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +index 2378a833cd31d703db462dd6f55a5cb858796b8d..3d791a74c37193dbf76d6b0a3d428d94a988d39f 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +@@ -1,17 +1,13 @@ + package net.minecraft.server; + +-import com.destroystokyo.paper.util.set.OptimizedSmallEnumSet; // Paper - remove streams from pathfindergoalselector ++import com.destroystokyo.paper.util.set.OptimizedSmallEnumSet; + import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; + +-import java.util.EnumMap; +-import java.util.EnumSet; +-import java.util.Iterator; // Paper - remove streams from pathfindergoalselector +-import java.util.Map; +-import java.util.Set; ++import java.util.*; + import java.util.function.Supplier; + import java.util.stream.Stream; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class PathfinderGoalSelector { + +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalTarget.java +index 29822c19496e3927eb9a061869872f4fee525254..6d1b9348e95ce154a1cae31e7f67a6213a1d3803 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalTarget.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalTarget.java +@@ -1,7 +1,8 @@ + package net.minecraft.server; + ++import org.bukkit.event.entity.EntityTargetEvent; ++ + import javax.annotation.Nullable; +-import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit + + public abstract class PathfinderGoalTarget extends PathfinderGoal { + +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java +index b115f40b0b11e89184960a5cce5b8295030469e9..c6feca04953a946aff4936bfd85b0e45c612a01c 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + +-import java.util.EnumSet; +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftLivingEntity; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.EntityTargetEvent; + import org.bukkit.event.entity.EntityTargetLivingEntityEvent; ++ ++import java.util.EnumSet; + // CraftBukkit end + + public class PathfinderGoalTempt extends PathfinderGoal { +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java +index 112d8bab65bf41263a477c5faa717687fe8a2bc9..85e63bc6f46637e8a4c0fec77a61f9cadef815a5 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.EnumSet; + import javax.annotation.Nullable; ++import java.util.EnumSet; + + public class PathfinderGoalWrapped extends PathfinderGoal { + +diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java +index 279ca87d8826ea2696ffc08d4b52c55a5e7bd392..af25ec2b833fa10a7d27c4cf91c505aee85bffe6 100644 +--- a/src/main/java/net/minecraft/server/PathfinderNormal.java ++++ b/src/main/java/net/minecraft/server/PathfinderNormal.java +@@ -4,14 +4,12 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; + import it.unimi.dsi.fastutil.objects.Object2BooleanMap; + import it.unimi.dsi.fastutil.objects.Object2BooleanOpenHashMap; +-import com.google.common.collect.Sets; +- + import it.unimi.dsi.fastutil.objects.Reference2ReferenceMap; + import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap; + ++import javax.annotation.Nullable; + import java.util.EnumSet; + import java.util.Iterator; +-import javax.annotation.Nullable; + + public class PathfinderNormal extends PathfinderAbstract { + +diff --git a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java +index af09e1926fb6f3b780a5063b2e2e00da4cdc8ce6..c855ca15a6b2e463de48a86738d5182d28b32c20 100644 +--- a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java ++++ b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.function.Predicate; + import javax.annotation.Nullable; ++import java.util.function.Predicate; + + public class PathfinderTargetCondition { + +diff --git a/src/main/java/net/minecraft/server/PersistentRaid.java b/src/main/java/net/minecraft/server/PersistentRaid.java +index 64e5c6d1e4273dd5dc9fffe70f4f57d73d72f659..56f766ebddb0727b1edab918bc34151155bfa7a0 100644 +--- a/src/main/java/net/minecraft/server/PersistentRaid.java ++++ b/src/main/java/net/minecraft/server/PersistentRaid.java +@@ -1,11 +1,12 @@ + package net.minecraft.server; + + import com.google.common.collect.Maps; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Map; + import java.util.stream.Collectors; +-import javax.annotation.Nullable; + + public class PersistentRaid extends PersistentBase { + +diff --git a/src/main/java/net/minecraft/server/PersistentScoreboard.java b/src/main/java/net/minecraft/server/PersistentScoreboard.java +index a08c54da92d87fcd24ef8e2556901d3b1977c5ea..2b705fbcc68741237ad158888b1f27bcb5751b38 100644 +--- a/src/main/java/net/minecraft/server/PersistentScoreboard.java ++++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + +-import java.util.Collection; +-import java.util.Iterator; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import java.util.Collection; ++import java.util.Iterator; ++ + public class PersistentScoreboard extends PersistentBase { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/PersistentStructureLegacy.java b/src/main/java/net/minecraft/server/PersistentStructureLegacy.java +index 75f2da314b348ccf807975d9a7faeb71934a6e3b..a263559c2136743a4549ae630fc8a50b445abe45 100644 +--- a/src/main/java/net/minecraft/server/PersistentStructureLegacy.java ++++ b/src/main/java/net/minecraft/server/PersistentStructureLegacy.java +@@ -5,12 +5,13 @@ import com.google.common.collect.Maps; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; + import it.unimi.dsi.fastutil.longs.LongArrayList; ++ ++import javax.annotation.Nullable; + import java.io.IOException; + import java.util.Iterator; + import java.util.List; + import java.util.Locale; + import java.util.Map; +-import javax.annotation.Nullable; + + public class PersistentStructureLegacy { + +diff --git a/src/main/java/net/minecraft/server/PiglinAI.java b/src/main/java/net/minecraft/server/PiglinAI.java +index 313c383920213cc1eb5525dab4a1665a087abf6f..e219d23643fb01227fca8b83011525b23cbf4600 100644 +--- a/src/main/java/net/minecraft/server/PiglinAI.java ++++ b/src/main/java/net/minecraft/server/PiglinAI.java +@@ -3,12 +3,8 @@ package net.minecraft.server; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableSet; + import com.mojang.datafixers.util.Pair; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Optional; +-import java.util.Random; +-import java.util.Set; ++ ++import java.util.*; + + public class PiglinAI { + +diff --git a/src/main/java/net/minecraft/server/PistonExtendsChecker.java b/src/main/java/net/minecraft/server/PistonExtendsChecker.java +index 4fd1a98e8309bec2ef270ac70c4d79d143002b86..194a0a7bf3d48909ffe9322f0ad6b4e84cddd956 100644 +--- a/src/main/java/net/minecraft/server/PistonExtendsChecker.java ++++ b/src/main/java/net/minecraft/server/PistonExtendsChecker.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ + import java.util.List; + + public class PistonExtendsChecker { +diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java +index a90c97603e5e9fa5639f6ff1f8462b3323ecc428..b0997aa1b6d03f98042a8293eb7be702ba559f4a 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/PlayerChunk.java +@@ -1,6 +1,8 @@ + package net.minecraft.server; + + import com.mojang.datafixers.util.Either; ++ ++import javax.annotation.Nullable; + import java.util.List; + import java.util.Map; + import java.util.Optional; +@@ -9,7 +11,6 @@ import java.util.concurrent.atomic.AtomicReferenceArray; + import java.util.function.IntConsumer; + import java.util.function.IntSupplier; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public class PlayerChunk { + +diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java +index 74998ea20176c2753a0ebb03833f13f3f58a186a..af489b49985c90178d5231ea46869152e89614e2 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +@@ -1,26 +1,25 @@ + package net.minecraft.server; + +-import co.aikar.timings.Timing; // Paper +-import com.destroystokyo.paper.PaperWorldConfig; // Paper ++import co.aikar.timings.Timing; ++import com.destroystokyo.paper.PaperWorldConfig; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.Iterables; +-import com.google.common.collect.ComparisonChain; // Paper + import com.google.common.collect.Lists; +-import com.google.common.collect.Queues; +-import com.google.common.collect.Sets; + import com.mojang.datafixers.DataFixer; + import com.mojang.datafixers.util.Either; + import it.unimi.dsi.fastutil.ints.Int2ObjectMap; + import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +-import it.unimi.dsi.fastutil.longs.Long2ByteMap; +-import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap; +-import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; ++import it.unimi.dsi.fastutil.longs.*; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap.Entry; +-import it.unimi.dsi.fastutil.longs.LongIterator; +-import it.unimi.dsi.fastutil.longs.LongOpenHashSet; +-import it.unimi.dsi.fastutil.longs.LongSet; + import it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator; + import it.unimi.dsi.fastutil.objects.ObjectIterator; ++import org.apache.commons.lang3.mutable.MutableBoolean; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++import org.bukkit.entity.Player; ++import org.spigotmc.AsyncCatcher; ++ ++import javax.annotation.Nullable; + import java.io.File; + import java.io.IOException; + import java.io.Writer; +@@ -30,19 +29,8 @@ import java.util.concurrent.CompletableFuture; + import java.util.concurrent.CompletionException; + import java.util.concurrent.Executor; + import java.util.concurrent.atomic.AtomicInteger; +-import java.util.function.BooleanSupplier; +-import java.util.function.Consumer; +-import java.util.function.IntFunction; +-import java.util.function.IntSupplier; +-import java.util.function.Supplier; +-import java.util.stream.Collectors; ++import java.util.function.*; + import java.util.stream.Stream; +-import javax.annotation.Nullable; +-import org.apache.commons.lang3.mutable.MutableBoolean; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; +-import org.bukkit.entity.Player; // CraftBukkit +-import org.spigotmc.AsyncCatcher; + + public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 85bf9f9e5b4e75f17b8affdaac48d6e3183ed7de..ad56cb830d81c5d02bd338c004a788891becb095 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -1,5 +1,7 @@ + package net.minecraft.server; + ++import co.aikar.timings.MinecraftTimings; ++import com.destroystokyo.paper.event.player.PlayerJumpEvent; + import com.google.common.primitives.Doubles; + import com.google.common.primitives.Floats; + import com.mojang.brigadier.ParseResults; +@@ -8,20 +10,9 @@ import io.netty.util.concurrent.Future; + import io.netty.util.concurrent.GenericFutureListener; + import it.unimi.dsi.fastutil.ints.Int2ShortMap; + import it.unimi.dsi.fastutil.ints.Int2ShortOpenHashMap; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.Optional; +-import java.util.Set; +-import java.util.stream.Stream; +-import javax.annotation.Nullable; +-import org.apache.commons.lang3.StringEscapeUtils; + import org.apache.commons.lang3.StringUtils; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import java.util.concurrent.ExecutionException; +-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import org.bukkit.Location; + import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.bukkit.craftbukkit.event.CraftEventFactory; +@@ -34,34 +25,22 @@ import org.bukkit.entity.Player; + import org.bukkit.event.Event; + import org.bukkit.event.block.Action; + import org.bukkit.event.block.SignChangeEvent; +-import org.bukkit.event.inventory.ClickType; +-import org.bukkit.event.inventory.CraftItemEvent; +-import org.bukkit.event.inventory.InventoryAction; +-import org.bukkit.event.inventory.InventoryClickEvent; +-import org.bukkit.event.inventory.InventoryCreativeEvent; ++import org.bukkit.event.inventory.*; + import org.bukkit.event.inventory.InventoryType.SlotType; +-import org.bukkit.event.player.AsyncPlayerChatEvent; +-import org.bukkit.event.player.PlayerAnimationEvent; +-import org.bukkit.event.player.PlayerChatEvent; +-import org.bukkit.event.player.PlayerCommandPreprocessEvent; +-import org.bukkit.event.player.PlayerInteractAtEntityEvent; +-import org.bukkit.event.player.PlayerInteractEntityEvent; +-import org.bukkit.event.player.PlayerItemHeldEvent; +-import org.bukkit.event.player.PlayerKickEvent; +-import org.bukkit.event.player.PlayerMoveEvent; +-import org.bukkit.event.player.PlayerResourcePackStatusEvent; +-import org.bukkit.event.player.PlayerSwapHandItemsEvent; +-import org.bukkit.event.player.PlayerTeleportEvent; +-import org.bukkit.event.player.PlayerToggleFlightEvent; +-import org.bukkit.event.player.PlayerToggleSneakEvent; +-import org.bukkit.event.player.PlayerToggleSprintEvent; ++import org.bukkit.event.player.*; + import org.bukkit.inventory.CraftingInventory; + import org.bukkit.inventory.EquipmentSlot; + import org.bukkit.inventory.InventoryView; + import org.bukkit.util.NumberConversions; +-import com.destroystokyo.paper.event.player.IllegalPacketEvent; // Paper +-import com.destroystokyo.paper.event.player.PlayerJumpEvent; // Paper +-import co.aikar.timings.MinecraftTimings; // Paper ++ ++import javax.annotation.Nullable; ++import java.util.Collections; ++import java.util.Iterator; ++import java.util.Optional; ++import java.util.Set; ++import java.util.concurrent.ExecutionException; ++import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; ++import java.util.stream.Stream; + // CraftBukkit end + + public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java +index e698dd22607b2b2c4068c5bfb03ac53eb5bac080..a0658cda96d3a2796fb940cd947aa708aaae24b7 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java ++++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + ++import co.aikar.timings.MinecraftTimings; ++import co.aikar.timings.Timing; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-import co.aikar.timings.MinecraftTimings; // Paper +-import co.aikar.timings.Timing; // Paper + + public class PlayerConnectionUtils { + +diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java +index f5de49e3e384b1d2926197e72992ace51d2967b6..52b465ae49c602d8b52878c12d1aab37c003259a 100644 +--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java ++++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java +@@ -1,16 +1,16 @@ + package net.minecraft.server; + +-import java.util.Objects; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-// CraftBukkit start +-import java.util.ArrayList; + import org.bukkit.craftbukkit.block.CraftBlock; +-import org.bukkit.event.block.BlockBreakEvent; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.Event; + import org.bukkit.event.block.Action; ++import org.bukkit.event.block.BlockBreakEvent; + import org.bukkit.event.player.PlayerInteractEvent; ++ ++import java.util.ArrayList; ++import java.util.Objects; + // CraftBukkit end + + public class PlayerInteractManager { +diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java +index 3b65711b91c51ac7b4b5b2b0144ffd279fe60eeb..b7fe6425a6c830b2b63710b3c4c3c6e70df5268f 100644 +--- a/src/main/java/net/minecraft/server/PlayerInventory.java ++++ b/src/main/java/net/minecraft/server/PlayerInventory.java +@@ -1,15 +1,14 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableList; +-import java.util.Iterator; +-import java.util.List; +-import java.util.function.Predicate; +- +-// CraftBukkit start +-import java.util.ArrayList; + import org.bukkit.Location; + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; ++ ++import java.util.ArrayList; ++import java.util.Iterator; ++import java.util.List; ++import java.util.function.Predicate; + // CraftBukkit end + + public class PlayerInventory implements IInventory, INamableTileEntity { +diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java +index c10a1d15bcfe0cb1c2ff6ee7f2881bc2040bcd1d..35a0725e7124918765d3188d0774516d3fe7c152 100644 +--- a/src/main/java/net/minecraft/server/PlayerList.java ++++ b/src/main/java/net/minecraft/server/PlayerList.java +@@ -1,6 +1,8 @@ + package net.minecraft.server; + + import co.aikar.timings.MinecraftTimings; ++import com.google.common.base.Predicate; ++import com.google.common.collect.Iterables; + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; +@@ -8,42 +10,24 @@ import com.mojang.authlib.GameProfile; + import com.mojang.serialization.DataResult; + import com.mojang.serialization.Dynamic; + import io.netty.buffer.Unpooled; +-import java.io.File; +-import java.net.SocketAddress; +-import java.text.SimpleDateFormat; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Optional; +-import java.util.Set; +-import java.util.UUID; +-import java.util.concurrent.CompletableFuture; +-import java.util.concurrent.TimeUnit; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import com.google.common.base.Predicate; +-import com.google.common.collect.Iterables; +- +-import org.bukkit.craftbukkit.CraftServer; +-import org.bukkit.craftbukkit.CraftWorld; +- + import org.bukkit.Bukkit; + import org.bukkit.Location; ++import org.bukkit.craftbukkit.CraftServer; ++import org.bukkit.craftbukkit.CraftWorld; + import org.bukkit.craftbukkit.util.CraftChatMessage; + import org.bukkit.entity.Player; +-import org.bukkit.event.player.PlayerChangedWorldEvent; +-import org.bukkit.event.player.PlayerPortalEvent; +-import org.bukkit.event.player.PlayerJoinEvent; +-import org.bukkit.event.player.PlayerLoginEvent; +-import org.bukkit.event.player.PlayerQuitEvent; +-import org.bukkit.event.player.PlayerRespawnEvent; +-import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +-import org.bukkit.util.Vector; ++import org.bukkit.event.player.*; + import org.spigotmc.event.player.PlayerSpawnLocationEvent; ++ ++import javax.annotation.Nullable; ++import java.io.File; ++import java.net.SocketAddress; ++import java.text.SimpleDateFormat; ++import java.util.*; ++import java.util.concurrent.CompletableFuture; ++import java.util.concurrent.TimeUnit; + // CraftBukkit end + + public abstract class PlayerList { +diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java +index 68f693de5eaa5eaa8dc65230ffa95556530c2368..0b4a0052a25470033326f7533880a14eaccd6321 100644 +--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java ++++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java +@@ -1,11 +1,11 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Comparator; + import java.util.List; + import java.util.Optional; + import java.util.Random; + import java.util.stream.Collectors; +-import javax.annotation.Nullable; + + public class PortalTravelAgent { + +diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java +index bf4172be525d5bdd7c152117afce8bf00106a139..a448fa6418e6e56df70dc53fec2e5582def5593e 100644 +--- a/src/main/java/net/minecraft/server/PotionUtil.java ++++ b/src/main/java/net/minecraft/server/PotionUtil.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ ++import javax.annotation.Nullable; + import java.util.Collection; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; + + public class PotionUtil { + +diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java +index 729455ce53944a9afaaa3e30052ab44f2a87cad9..cea260df46d9300d95182d72cec2a1ea15ff8625 100644 +--- a/src/main/java/net/minecraft/server/PropertyManager.java ++++ b/src/main/java/net/minecraft/server/PropertyManager.java +@@ -1,6 +1,11 @@ + package net.minecraft.server; + + import com.google.common.base.MoreObjects; ++import joptsimple.OptionSet; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.io.IOException; + import java.io.InputStream; + import java.io.OutputStream; +@@ -11,11 +16,6 @@ import java.util.function.Function; + import java.util.function.IntFunction; + import java.util.function.Supplier; + import java.util.function.UnaryOperator; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; +- +-import joptsimple.OptionSet; // CraftBukkit + + public abstract class PropertyManager> { + +diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java +index 6ac9f437e853957e19be077bb2c78eef0dbbbf01..5e34bb8a0619ca3ac170db5e94fb9597ee271e46 100644 +--- a/src/main/java/net/minecraft/server/ProtoChunk.java ++++ b/src/main/java/net/minecraft/server/ProtoChunk.java +@@ -7,20 +7,14 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; + import it.unimi.dsi.fastutil.longs.LongSet; + import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; + import it.unimi.dsi.fastutil.shorts.ShortList; +-import java.util.BitSet; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.EnumSet; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Map.Entry; +-import java.util.Set; +-import java.util.stream.Stream; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.Map.Entry; ++import java.util.stream.Stream; ++ + public class ProtoChunk implements IChunkAccess { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/ProtoChunkExtension.java b/src/main/java/net/minecraft/server/ProtoChunkExtension.java +index 9f91c02b444874e690eacb0cfa0c810168c8bb46..c154b40f6ee4fda14debea94ae41ae24c5423633 100644 +--- a/src/main/java/net/minecraft/server/ProtoChunkExtension.java ++++ b/src/main/java/net/minecraft/server/ProtoChunkExtension.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + + import it.unimi.dsi.fastutil.longs.LongSet; ++ ++import javax.annotation.Nullable; + import java.util.BitSet; + import java.util.Map; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public class ProtoChunkExtension extends ProtoChunk { + +diff --git a/src/main/java/net/minecraft/server/Raid.java b/src/main/java/net/minecraft/server/Raid.java +index 54731f78c844e5ae7484949f8621946de8562dea..8fb4513944de5bbdf08443d6c1e20ae2d0548686 100644 +--- a/src/main/java/net/minecraft/server/Raid.java ++++ b/src/main/java/net/minecraft/server/Raid.java +@@ -2,20 +2,11 @@ package net.minecraft.server; + + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; +-import java.util.Collection; +-import java.util.Comparator; +-import java.util.HashSet; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Locale; +-import java.util.Map; +-import java.util.Optional; +-import java.util.Random; +-import java.util.Set; +-import java.util.UUID; ++ ++import javax.annotation.Nullable; ++import java.util.*; + import java.util.function.Predicate; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public class Raid { + +diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java +index dc89c707b10c5544eca06a634a625bce0dd778f0..1584f6e83abd213309ea9dde2f567329eae0f8ed 100644 +--- a/src/main/java/net/minecraft/server/RandomPositionGenerator.java ++++ b/src/main/java/net/minecraft/server/RandomPositionGenerator.java +@@ -1,9 +1,9 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Random; + import java.util.function.Predicate; + import java.util.function.ToDoubleFunction; +-import javax.annotation.Nullable; + + public class RandomPositionGenerator { + +diff --git a/src/main/java/net/minecraft/server/RecipeBook.java b/src/main/java/net/minecraft/server/RecipeBook.java +index 0d27b76b66660b1764132bf0f1ca357a136978d7..badd7fb485b7d9783dc721e54bc5284ba5e54c81 100644 +--- a/src/main/java/net/minecraft/server/RecipeBook.java ++++ b/src/main/java/net/minecraft/server/RecipeBook.java +@@ -1,8 +1,9 @@ + package net.minecraft.server; + + import com.google.common.collect.Sets; +-import java.util.Set; ++ + import javax.annotation.Nullable; ++import java.util.Set; + + public class RecipeBook { + +diff --git a/src/main/java/net/minecraft/server/RecipeBookServer.java b/src/main/java/net/minecraft/server/RecipeBookServer.java +index 3235b26648d99a71e734e0d6ba2351ca9d9f4f30..03778e6381fe6b9d6264774fae7acba483474947 100644 +--- a/src/main/java/net/minecraft/server/RecipeBookServer.java ++++ b/src/main/java/net/minecraft/server/RecipeBookServer.java +@@ -1,15 +1,12 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Optional; +-import java.util.function.Consumer; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import java.util.*; ++import java.util.function.Consumer; + + public class RecipeBookServer extends RecipeBook { + +diff --git a/src/main/java/net/minecraft/server/RecipeItemStack.java b/src/main/java/net/minecraft/server/RecipeItemStack.java +index 31a06a908234f8d98c90ded33ba14c281a40db81..43c86b27b811f1fe5e3578973637f8d9bd20d246 100644 +--- a/src/main/java/net/minecraft/server/RecipeItemStack.java ++++ b/src/main/java/net/minecraft/server/RecipeItemStack.java +@@ -1,20 +1,16 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; +-import com.google.gson.JsonArray; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; +-import com.google.gson.JsonParseException; +-import com.google.gson.JsonSyntaxException; ++import com.google.gson.*; + import it.unimi.dsi.fastutil.ints.IntArrayList; + import it.unimi.dsi.fastutil.ints.IntComparators; + import it.unimi.dsi.fastutil.ints.IntList; + ++import javax.annotation.Nullable; + import java.util.*; + import java.util.function.Predicate; + import java.util.stream.Stream; + import java.util.stream.StreamSupport; +-import javax.annotation.Nullable; + + public final class RecipeItemStack implements Predicate { + +diff --git a/src/main/java/net/minecraft/server/RecipeSmithing.java b/src/main/java/net/minecraft/server/RecipeSmithing.java +index 035e4bfa8713637ca9cca05411d55f2d1b8be188..02c972d6e882fba22fc3f0285244bb848ad443aa 100644 +--- a/src/main/java/net/minecraft/server/RecipeSmithing.java ++++ b/src/main/java/net/minecraft/server/RecipeSmithing.java +@@ -2,7 +2,6 @@ package net.minecraft.server; + + import com.google.gson.JsonElement; + import com.google.gson.JsonObject; +-// CraftBukkit start + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.inventory.CraftRecipe; + import org.bukkit.craftbukkit.inventory.CraftSmithingRecipe; +diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java +index 7f2382a89547802bcb38eb5a785c69183827716e..2a36e621898ea4b70184130d57fa7db72aa4486f 100644 +--- a/src/main/java/net/minecraft/server/RegionFile.java ++++ b/src/main/java/net/minecraft/server/RegionFile.java +@@ -1,15 +1,10 @@ + package net.minecraft.server; + +-import java.io.BufferedInputStream; +-import java.io.BufferedOutputStream; +-import java.io.ByteArrayInputStream; +-import java.io.ByteArrayOutputStream; +-import java.io.DataInputStream; +-import java.io.DataOutputStream; +-import java.io.File; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.OutputStream; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; ++import java.io.*; + import java.nio.ByteBuffer; + import java.nio.IntBuffer; + import java.nio.channels.FileChannel; +@@ -17,11 +12,7 @@ import java.nio.file.Files; + import java.nio.file.LinkOption; + import java.nio.file.StandardCopyOption; + import java.nio.file.StandardOpenOption; +-import java.util.zip.InflaterInputStream; // Paper +- +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; ++import java.util.zip.InflaterInputStream; + + public class RegionFile implements AutoCloseable { + +diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java +index 60b4171a3aa2a8b216aba13738c84ac9d7f3b49e..50822874f484dc35c75195add9a478b23a4f96db 100644 +--- a/src/main/java/net/minecraft/server/RegionFileCache.java ++++ b/src/main/java/net/minecraft/server/RegionFileCache.java +@@ -2,12 +2,9 @@ package net.minecraft.server; + + import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; + import it.unimi.dsi.fastutil.objects.ObjectIterator; +-import java.io.DataInputStream; +-import java.io.DataOutput; +-import java.io.DataOutputStream; +-import java.io.File; +-import java.io.IOException; ++ + import javax.annotation.Nullable; ++import java.io.*; + + public class RegionFileCache implements AutoCloseable { // Paper - no final + +diff --git a/src/main/java/net/minecraft/server/RegionFileCompression.java b/src/main/java/net/minecraft/server/RegionFileCompression.java +index 29137f495942d810e61fadc33178999ad57fdcc0..a4c1eb60ab7349cb3146018642cc753f403b61d9 100644 +--- a/src/main/java/net/minecraft/server/RegionFileCompression.java ++++ b/src/main/java/net/minecraft/server/RegionFileCompression.java +@@ -2,6 +2,8 @@ package net.minecraft.server; + + import it.unimi.dsi.fastutil.ints.Int2ObjectMap; + import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; ++ ++import javax.annotation.Nullable; + import java.io.IOException; + import java.io.InputStream; + import java.io.OutputStream; +@@ -9,7 +11,6 @@ import java.util.zip.DeflaterOutputStream; + import java.util.zip.GZIPInputStream; + import java.util.zip.GZIPOutputStream; + import java.util.zip.InflaterInputStream; +-import javax.annotation.Nullable; + + public class RegionFileCompression { + +diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java +index bd0ff1e43a07a3332f9ade49fec2f76275a25c7f..41e1f7c8e22fadc7fe45e03f480f5ee9fef192b2 100644 +--- a/src/main/java/net/minecraft/server/RegionFileSection.java ++++ b/src/main/java/net/minecraft/server/RegionFileSection.java +@@ -3,23 +3,20 @@ package net.minecraft.server; + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Maps; + import com.mojang.datafixers.DataFixer; +-import com.mojang.serialization.Codec; +-import com.mojang.serialization.DataResult; +-import com.mojang.serialization.Dynamic; +-import com.mojang.serialization.DynamicOps; +-import com.mojang.serialization.OptionalDynamic; ++import com.mojang.serialization.*; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; + import it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.io.File; + import java.io.IOException; + import java.util.Map; + import java.util.Optional; + import java.util.function.BooleanSupplier; + import java.util.function.Function; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class RegionFileSection extends RegionFileCache implements AutoCloseable { // Paper - nuke IOWorker + +diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +index 478d252953c65792df9f0068a4c1afd1985151ab..43180bb5b7fb6de1455bbe11b25925e28bd04826 100644 +--- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java ++++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +@@ -1,12 +1,13 @@ + package net.minecraft.server; + ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.util.Collections; + import java.util.List; + import java.util.Random; + import java.util.function.Predicate; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class RegionLimitedWorldAccess implements GeneratorAccessSeed { + +diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java +index 60948afa4ead71010dc27c7cef3e5acdb0ba005a..636709f303401e528a539837917dac959d7e383b 100644 +--- a/src/main/java/net/minecraft/server/RegistryBlockID.java ++++ b/src/main/java/net/minecraft/server/RegistryBlockID.java +@@ -3,10 +3,11 @@ package net.minecraft.server; + import com.google.common.base.Predicates; + import com.google.common.collect.Iterators; + import com.google.common.collect.Lists; ++ ++import javax.annotation.Nullable; + import java.util.IdentityHashMap; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; + + public class RegistryBlockID implements Registry { + +diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java +index f9692408a1d177ba4668261070d7610ecfb53a7b..7cf11307b18d66186bc592568f2ea0833a57faab 100644 +--- a/src/main/java/net/minecraft/server/RegistryID.java ++++ b/src/main/java/net/minecraft/server/RegistryID.java +@@ -2,9 +2,10 @@ package net.minecraft.server; + + import com.google.common.base.Predicates; + import com.google.common.collect.Iterators; ++ ++import javax.annotation.Nullable; + import java.util.Arrays; + import java.util.Iterator; +-import javax.annotation.Nullable; + + public class RegistryID implements Registry { + +diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java +index ba36ab19dbb13c33c6b0cdc30b1109d01c84b1da..075e250f451f64b91e748d42fdf4ceed91bf4667 100644 +--- a/src/main/java/net/minecraft/server/RegistryMaterials.java ++++ b/src/main/java/net/minecraft/server/RegistryMaterials.java +@@ -1,27 +1,19 @@ + package net.minecraft.server; + +-import com.google.common.collect.BiMap; +-import com.google.common.collect.HashBiMap; +-import com.google.common.collect.ImmutableList; ++import com.google.common.collect.*; + import com.google.common.collect.ImmutableList.Builder; +-import com.google.common.collect.ImmutableMap; +-import com.google.common.collect.Sets; + import com.mojang.datafixers.util.Pair; + import com.mojang.serialization.Codec; + import com.mojang.serialization.Lifecycle; + import com.mojang.serialization.MapCodec; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.Map.Entry; +-import java.util.Optional; +-import java.util.Random; +-import java.util.Set; +-import javax.annotation.Nullable; + import org.apache.commons.lang3.Validate; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.Map.Entry; ++ + public class RegistryMaterials extends IRegistryWritable { + + protected static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java +index e550b8428245ef2bc0265ae6267bb7e1cabec35c..8d9b6be9088a86966d36c14b2d4163b3b2c23867 100644 +--- a/src/main/java/net/minecraft/server/RemoteControlListener.java ++++ b/src/main/java/net/minecraft/server/RemoteControlListener.java +@@ -1,6 +1,9 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.io.IOException; + import java.net.InetAddress; + import java.net.ServerSocket; +@@ -8,8 +11,6 @@ import java.net.Socket; + import java.net.SocketTimeoutException; + import java.util.Iterator; + import java.util.List; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class RemoteControlListener extends RemoteConnectionThread { + +diff --git a/src/main/java/net/minecraft/server/Reputation.java b/src/main/java/net/minecraft/server/Reputation.java +index dffac0dc85fe7d093c58663f91ad687a6be50ad5..8c155b4a649b783996161991f04f7a130d354666 100644 +--- a/src/main/java/net/minecraft/server/Reputation.java ++++ b/src/main/java/net/minecraft/server/Reputation.java +@@ -10,17 +10,9 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap; + import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry; + import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; + import it.unimi.dsi.fastutil.objects.ObjectIterator; +-import java.util.Arrays; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Random; +-import java.util.Set; +-import java.util.UUID; ++ ++import java.util.*; + import java.util.function.Predicate; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + + public class Reputation { +diff --git a/src/main/java/net/minecraft/server/ReputationType.java b/src/main/java/net/minecraft/server/ReputationType.java +index 73ad45295efbdfb5bd37a7743e17f8f210d3efbf..35b9248af248f0a37013d9f938c29ca779903c23 100644 +--- a/src/main/java/net/minecraft/server/ReputationType.java ++++ b/src/main/java/net/minecraft/server/ReputationType.java +@@ -1,10 +1,11 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; ++ ++import javax.annotation.Nullable; + import java.util.Map; + import java.util.function.Function; + import java.util.stream.Stream; +-import javax.annotation.Nullable; + + public enum ReputationType { + +diff --git a/src/main/java/net/minecraft/server/ScoreboardServer.java b/src/main/java/net/minecraft/server/ScoreboardServer.java +index 929397a4ca8af8aba24c36bd6fc8ed0071982b64..cf15f7038ab4c392623b39ef676d3a24227f6e51 100644 +--- a/src/main/java/net/minecraft/server/ScoreboardServer.java ++++ b/src/main/java/net/minecraft/server/ScoreboardServer.java +@@ -2,11 +2,12 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import com.google.common.collect.Sets; ++ ++import javax.annotation.Nullable; + import java.util.Arrays; + import java.util.Iterator; + import java.util.List; + import java.util.Set; +-import javax.annotation.Nullable; + + public class ScoreboardServer extends Scoreboard { + +diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java +index 0438126662e7c635d9a4f7b8c54fe7c50403ffe8..d8efb35f1c22c1ed495461d73f2ec124ce542e24 100644 +--- a/src/main/java/net/minecraft/server/ServerConnection.java ++++ b/src/main/java/net/minecraft/server/ServerConnection.java +@@ -3,28 +3,23 @@ package net.minecraft.server; + import com.google.common.collect.Lists; + import com.google.common.util.concurrent.ThreadFactoryBuilder; + import io.netty.bootstrap.ServerBootstrap; +-import io.netty.channel.Channel; +-import io.netty.channel.ChannelException; +-import io.netty.channel.ChannelFuture; +-import io.netty.channel.ChannelInitializer; +-import io.netty.channel.ChannelOption; +-import io.netty.channel.EventLoopGroup; ++import io.netty.channel.*; + import io.netty.channel.epoll.Epoll; + import io.netty.channel.epoll.EpollEventLoopGroup; + import io.netty.channel.epoll.EpollServerSocketChannel; + import io.netty.channel.nio.NioEventLoopGroup; +-import io.netty.channel.socket.ServerSocketChannel; + import io.netty.channel.socket.nio.NioServerSocketChannel; +-import io.netty.handler.flush.FlushConsolidationHandler; // Paper ++import io.netty.handler.flush.FlushConsolidationHandler; + import io.netty.handler.timeout.ReadTimeoutHandler; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.io.IOException; + import java.net.InetAddress; + import java.util.Collections; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class ServerConnection { + +diff --git a/src/main/java/net/minecraft/server/ServerGUI.java b/src/main/java/net/minecraft/server/ServerGUI.java +index 76ed8e87d3213080109205489c786d6bdbe08908..fe87c689d774666c0d39af80ca54aba259e954e6 100644 +--- a/src/main/java/net/minecraft/server/ServerGUI.java ++++ b/src/main/java/net/minecraft/server/ServerGUI.java +@@ -2,33 +2,22 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import com.mojang.util.QueueLogAppender; +-import java.awt.BorderLayout; +-import java.awt.Component; +-import java.awt.Dimension; +-import java.awt.Font; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.swing.*; ++import javax.swing.border.EtchedBorder; ++import javax.swing.border.TitledBorder; ++import javax.swing.text.AttributeSet; ++import javax.swing.text.BadLocationException; ++import javax.swing.text.Document; ++import java.awt.*; + import java.awt.event.FocusAdapter; + import java.awt.event.FocusEvent; + import java.awt.event.WindowAdapter; + import java.awt.event.WindowEvent; + import java.util.Collection; + import java.util.concurrent.atomic.AtomicBoolean; +-import javax.swing.JComponent; +-import javax.swing.JFrame; +-import javax.swing.JList; +-import javax.swing.JPanel; +-import javax.swing.JScrollBar; +-import javax.swing.JScrollPane; +-import javax.swing.JTextArea; +-import javax.swing.JTextField; +-import javax.swing.SwingUtilities; +-import javax.swing.UIManager; +-import javax.swing.border.EtchedBorder; +-import javax.swing.border.TitledBorder; +-import javax.swing.text.AttributeSet; +-import javax.swing.text.BadLocationException; +-import javax.swing.text.Document; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class ServerGUI extends JComponent { + +diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java +index ea52e89bd965afbd74f15b0e2974657319c28e4a..e5b69c561f3ff2e76351f784d970f77d381f284d 100644 +--- a/src/main/java/net/minecraft/server/ServerPing.java ++++ b/src/main/java/net/minecraft/server/ServerPing.java +@@ -1,14 +1,8 @@ + package net.minecraft.server; + +-import com.google.gson.JsonArray; +-import com.google.gson.JsonDeserializationContext; +-import com.google.gson.JsonDeserializer; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; +-import com.google.gson.JsonParseException; +-import com.google.gson.JsonSerializationContext; +-import com.google.gson.JsonSerializer; ++import com.google.gson.*; + import com.mojang.authlib.GameProfile; ++ + import java.lang.reflect.Type; + import java.util.UUID; + +diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java +index 5f222d8b90951c61e77ab7032f8728772ba8ab9d..48a6f61bfd7408f2bdebcdd9bf07bde1c750209a 100644 +--- a/src/main/java/net/minecraft/server/ServerStatisticManager.java ++++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java +@@ -12,6 +12,9 @@ import com.mojang.datafixers.DataFixer; + import it.unimi.dsi.fastutil.objects.Object2IntMap; + import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; + import it.unimi.dsi.fastutil.objects.ObjectIterator; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.io.File; + import java.io.IOException; + import java.io.StringReader; +@@ -20,13 +23,9 @@ import java.util.Map; + import java.util.Map.Entry; + import java.util.Optional; + import java.util.Set; +-import java.util.Map.Entry; + import java.util.concurrent.ExecutorService; + import java.util.concurrent.Executors; + +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; +- + public class ServerStatisticManager extends StatisticManager { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/ShapedRecipes.java b/src/main/java/net/minecraft/server/ShapedRecipes.java +index f9f65b30c66e46b00ec34976bc08380459eef270..05e39e5a9a6d8a89a4087429b7944de74d94dab1 100644 +--- a/src/main/java/net/minecraft/server/ShapedRecipes.java ++++ b/src/main/java/net/minecraft/server/ShapedRecipes.java +@@ -3,23 +3,16 @@ package net.minecraft.server; + import com.google.common.annotations.VisibleForTesting; + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; +-import com.google.gson.JsonArray; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; +-import com.google.gson.JsonParseException; +-import com.google.gson.JsonSyntaxException; +-import java.util.Iterator; +-import java.util.Map; +-import java.util.Map.Entry; +-import java.util.Set; +-// CraftBukkit start +-import java.util.ArrayList; +-import java.util.List; ++import com.google.gson.*; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.inventory.CraftRecipe; + import org.bukkit.craftbukkit.inventory.CraftShapedRecipe; +-import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.RecipeChoice; ++ ++import java.util.Iterator; ++import java.util.Map; ++import java.util.Map.Entry; ++import java.util.Set; + // CraftBukkit end + + public class ShapedRecipes implements RecipeCrafting { +diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java +index fb481e65862b4aaa08e2302a517fdd8253d63812..9f14514ef9b16fbf473c1ee04c141cb0dbf7c7e4 100644 +--- a/src/main/java/net/minecraft/server/ShapelessRecipes.java ++++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java +@@ -3,12 +3,11 @@ package net.minecraft.server; + import com.google.gson.JsonArray; + import com.google.gson.JsonObject; + import com.google.gson.JsonParseException; +-import it.unimi.dsi.fastutil.ints.IntList; +-import java.util.Iterator; +-// CraftBukkit start + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.inventory.CraftRecipe; + import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe; ++ ++import java.util.Iterator; + // CraftBukkit end + + public class ShapelessRecipes implements RecipeCrafting { +diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java +index 9af08eed145e527e3bcb4f2f5ab1804f53a4bbb6..600b508846d2e6654c74b61b04b7ef9c6095e856 100644 +--- a/src/main/java/net/minecraft/server/SpawnerCreature.java ++++ b/src/main/java/net/minecraft/server/SpawnerCreature.java +@@ -1,19 +1,16 @@ + package net.minecraft.server; + ++import com.destroystokyo.paper.exception.ServerInternalException; + import it.unimi.dsi.fastutil.objects.Object2IntMap; + import it.unimi.dsi.fastutil.objects.Object2IntMaps; + import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +- +-import java.util.*; +-import java.util.function.Consumer; +-import java.util.stream.Stream; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import com.destroystokyo.paper.exception.ServerInternalException; + import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; ++ ++import javax.annotation.Nullable; ++import java.util.*; ++import java.util.function.Consumer; + // CraftBukkit end + + public final class SpawnerCreature { +diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java +index 512afdfcbaab630a291d1aa120a90e554855d34f..f9200b8e6f915b401dc35ac88da31948b18aa551 100644 +--- a/src/main/java/net/minecraft/server/StructureGenerator.java ++++ b/src/main/java/net/minecraft/server/StructureGenerator.java +@@ -5,13 +5,14 @@ import com.google.common.collect.HashBiMap; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.Maps; + import com.mojang.serialization.Codec; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.util.Collections; + import java.util.List; + import java.util.Locale; + import java.util.Map; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public abstract class StructureGenerator { + +diff --git a/src/main/java/net/minecraft/server/StructureManager.java b/src/main/java/net/minecraft/server/StructureManager.java +index 6c7804ac0e994ec03b95eda7a24139b65a59db7e..88247c3d65733b7c07d52497740cb8f1b39f8b74 100644 +--- a/src/main/java/net/minecraft/server/StructureManager.java ++++ b/src/main/java/net/minecraft/server/StructureManager.java +@@ -1,8 +1,7 @@ + package net.minecraft.server; + +-import com.mojang.datafixers.DataFixUtils; +-import java.util.stream.Stream; + import javax.annotation.Nullable; ++import java.util.stream.Stream; + + public class StructureManager { + +diff --git a/src/main/java/net/minecraft/server/StructureSettings.java b/src/main/java/net/minecraft/server/StructureSettings.java +index 7bd9fa4811dae2a43bd8e51ab23766155921e5af..a5be5d4d9ea2429279594e8aa4664a6cf1b33d1c 100644 +--- a/src/main/java/net/minecraft/server/StructureSettings.java ++++ b/src/main/java/net/minecraft/server/StructureSettings.java +@@ -4,10 +4,10 @@ import com.google.common.collect.ImmutableMap; + import com.google.common.collect.Maps; + import com.mojang.serialization.Codec; + import com.mojang.serialization.codecs.RecordCodecBuilder; +-import java.util.Iterator; ++ ++import javax.annotation.Nullable; + import java.util.Map; + import java.util.Optional; +-import javax.annotation.Nullable; + + public class StructureSettings { + +diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java +index 91ebcea452707f5d64e2b61a76b42fcdbf40fdee..cfaab66b1e7d8dd54340af2956d24de426e0baad 100644 +--- a/src/main/java/net/minecraft/server/SystemUtils.java ++++ b/src/main/java/net/minecraft/server/SystemUtils.java +@@ -8,27 +8,17 @@ import com.mojang.datafixers.DataFixUtils; + import com.mojang.datafixers.types.Type; + import com.mojang.serialization.DataResult; + import it.unimi.dsi.fastutil.Hash.Strategy; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; + import java.io.File; + import java.lang.management.ManagementFactory; + import java.lang.management.RuntimeMXBean; + import java.time.Instant; +-import java.util.Arrays; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Locale; +-import java.util.Map; ++import java.util.*; + import java.util.Map.Entry; +-import java.util.Optional; +-import java.util.Random; +-import java.util.UUID; +-import java.util.concurrent.CompletableFuture; +-import java.util.concurrent.CompletionException; +-import java.util.concurrent.Executor; +-import java.util.concurrent.ExecutorService; +-import java.util.concurrent.Executors; +-import java.util.concurrent.ForkJoinPool; +-import java.util.concurrent.ForkJoinWorkerThread; +-import java.util.concurrent.TimeUnit; ++import java.util.concurrent.*; + import java.util.concurrent.atomic.AtomicInteger; + import java.util.function.Consumer; + import java.util.function.LongSupplier; +@@ -37,9 +27,6 @@ import java.util.stream.Collector; + import java.util.stream.Collectors; + import java.util.stream.IntStream; + import java.util.stream.Stream; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class SystemUtils { + +diff --git a/src/main/java/net/minecraft/server/TagRegistry.java b/src/main/java/net/minecraft/server/TagRegistry.java +index c836cd8f7945d9209c71ca7f1afebb43b931da18..0cce20c6115e9ef5eb0bba678951cb8a60013ec9 100644 +--- a/src/main/java/net/minecraft/server/TagRegistry.java ++++ b/src/main/java/net/minecraft/server/TagRegistry.java +@@ -2,6 +2,7 @@ package net.minecraft.server; + + import com.google.common.collect.HashMultimap; + import com.google.common.collect.Multimap; ++ + import java.util.Map; + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; +diff --git a/src/main/java/net/minecraft/server/TagsServer.java b/src/main/java/net/minecraft/server/TagsServer.java +index 1d1c79fc3e72e0b5eca072ec0fd150b4f7f6af86..c312f892153b81a6ba6ffdf6fcffb8ae5257be5a 100644 +--- a/src/main/java/net/minecraft/server/TagsServer.java ++++ b/src/main/java/net/minecraft/server/TagsServer.java +@@ -3,6 +3,7 @@ package net.minecraft.server; + import com.google.common.collect.ImmutableSet; + import com.google.common.collect.ImmutableSet.Builder; + import com.google.common.collect.Maps; ++ + import java.util.Iterator; + import java.util.Map; + import java.util.Map.Entry; +diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java +index cd30215dc098068ae034117c409cb295ebca58c1..68e3314de4c0be6ab54594c0533ed69f37a5e9ce 100644 +--- a/src/main/java/net/minecraft/server/ThreadedMailbox.java ++++ b/src/main/java/net/minecraft/server/ThreadedMailbox.java +@@ -1,12 +1,13 @@ + package net.minecraft.server; + + import it.unimi.dsi.fastutil.ints.Int2BooleanFunction; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.util.concurrent.ConcurrentLinkedQueue; + import java.util.concurrent.Executor; + import java.util.concurrent.RejectedExecutionException; + import java.util.concurrent.atomic.AtomicInteger; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class ThreadedMailbox implements Mailbox, AutoCloseable, Runnable { + +diff --git a/src/main/java/net/minecraft/server/TickListChunk.java b/src/main/java/net/minecraft/server/TickListChunk.java +index 8af1229c3da63a838b0bec1cafde1e41cf5cf551..56bd6ba96ea4331dbe1275840fded27428ea8fc3 100644 +--- a/src/main/java/net/minecraft/server/TickListChunk.java ++++ b/src/main/java/net/minecraft/server/TickListChunk.java +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ + import java.util.Iterator; + import java.util.List; + import java.util.function.Function; +diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java +index 721476be8f5cb1753605c1b09ea7ba87daae2725..454beb548ca3eb05e9ae39c8a4fb2ab25137ed69 100644 +--- a/src/main/java/net/minecraft/server/TickListServer.java ++++ b/src/main/java/net/minecraft/server/TickListServer.java +@@ -3,17 +3,12 @@ package net.minecraft.server; + import com.google.common.collect.Lists; + import com.google.common.collect.Queues; + import com.google.common.collect.Sets; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Queue; +-import java.util.Set; +-import java.util.TreeSet; ++ ++import javax.annotation.Nullable; ++import java.util.*; + import java.util.function.Consumer; + import java.util.function.Function; + import java.util.function.Predicate; +-import javax.annotation.Nullable; + + public class TickListServer implements TickList { + +diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java +index e1f1d6e33fd76bd11eb23e78457ba711bf9d5cde..3f9201d2ae8fa86cfb2707bc3c4c9266dcf76dfe 100644 +--- a/src/main/java/net/minecraft/server/TileEntity.java ++++ b/src/main/java/net/minecraft/server/TileEntity.java +@@ -1,16 +1,15 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; ++import co.aikar.timings.MinecraftTimings; ++import co.aikar.timings.Timing; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + import org.apache.logging.log4j.util.Supplier; +-// CraftBukkit start + import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer; + import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry; + import org.bukkit.inventory.InventoryHolder; +-// CraftBukkit end +-import co.aikar.timings.MinecraftTimings; // Paper +-import co.aikar.timings.Timing; // Paper ++ ++import javax.annotation.Nullable; + + public abstract class TileEntity implements KeyedObject, Cloneable { // Paper // Tuinity + +diff --git a/src/main/java/net/minecraft/server/TileEntityBanner.java b/src/main/java/net/minecraft/server/TileEntityBanner.java +index 5397d8a69a0326cf73fe0ee1175d1871cac3769d..94a3f51d35930e86507490aaa942921dd4277cd6 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBanner.java ++++ b/src/main/java/net/minecraft/server/TileEntityBanner.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + + import com.mojang.datafixers.util.Pair; ++ ++import javax.annotation.Nullable; + import java.util.List; + import java.util.function.Supplier; +-import javax.annotation.Nullable; + + public class TileEntityBanner extends TileEntity implements INamableTileEntity { + +diff --git a/src/main/java/net/minecraft/server/TileEntityBarrel.java b/src/main/java/net/minecraft/server/TileEntityBarrel.java +index f70faa39a88dfe49c5abfcfb7ce9f80a065c4655..b7f1418aa0f10024159994cc57c67762c6a1bbd2 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBarrel.java ++++ b/src/main/java/net/minecraft/server/TileEntityBarrel.java +@@ -1,16 +1,12 @@ + package net.minecraft.server; + + // CraftBukkit start +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.List; +-import org.bukkit.Location; +-import org.bukkit.block.Barrel; +-import org.bukkit.block.Lectern; +-import org.bukkit.craftbukkit.block.CraftBlock; ++ + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; +-import org.bukkit.inventory.InventoryHolder; ++ ++import java.util.ArrayList; ++import java.util.List; + // CraftBukkit end + + public class TileEntityBarrel extends TileEntityLootable { +diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java +index e109223f3f445f8b7d881853206f7bba9fd05b8b..1c91cc5ce28e936e62a5276ed82ddfebb2f233e6 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBeacon.java ++++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java +@@ -1,21 +1,14 @@ + package net.minecraft.server; + ++import com.destroystokyo.paper.event.block.BeaconEffectEvent; + import com.google.common.collect.Lists; +- +-import java.util.*; +-import java.util.stream.Collectors; +-import javax.annotation.Nullable; +- +-// CraftBukkit start +-import org.bukkit.craftbukkit.entity.CraftHumanEntity; +-import org.bukkit.craftbukkit.potion.CraftPotionUtil; +-import org.bukkit.entity.HumanEntity; +-import org.bukkit.potion.PotionEffect; +-// CraftBukkit end +-// Paper start + import org.bukkit.craftbukkit.event.CraftEventFactory; ++import org.bukkit.craftbukkit.potion.CraftPotionUtil; + import org.bukkit.entity.Player; +-import com.destroystokyo.paper.event.block.BeaconEffectEvent; ++import org.bukkit.potion.PotionEffect; ++ ++import javax.annotation.Nullable; ++import java.util.*; + // Paper end + + public class TileEntityBeacon extends TileEntity implements ITileInventory, ITickable { +diff --git a/src/main/java/net/minecraft/server/TileEntityBeehive.java b/src/main/java/net/minecraft/server/TileEntityBeehive.java +index 9da356de6b98e4b9c48ee9ea23647c2e292adea9..ce66802b437b57e0f6a66be3c6d69b36228a4afc 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBeehive.java ++++ b/src/main/java/net/minecraft/server/TileEntityBeehive.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; +-import javax.annotation.Nullable; + + public class TileEntityBeehive extends TileEntity implements ITickable { + +diff --git a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java +index e38a494d7b1aa03b5644a54e9ba9139aa43eb759..568bde484cdfe2e2f4a55fe6fd5616263c0e4c37 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java ++++ b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java +@@ -1,17 +1,16 @@ + package net.minecraft.server; + +-import java.util.Arrays; +-import java.util.Iterator; +-import javax.annotation.Nullable; +- +-// CraftBukkit start +-import java.util.List; + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.entity.HumanEntity; + import org.bukkit.event.inventory.BrewEvent; + import org.bukkit.event.inventory.BrewingStandFuelEvent; + import org.bukkit.inventory.InventoryHolder; ++ ++import javax.annotation.Nullable; ++import java.util.Arrays; ++import java.util.Iterator; ++import java.util.List; + // CraftBukkit end + + public class TileEntityBrewingStand extends TileEntityContainer implements IWorldInventory, ITickable { +diff --git a/src/main/java/net/minecraft/server/TileEntityCampfire.java b/src/main/java/net/minecraft/server/TileEntityCampfire.java +index 1d002341652f34100c033b84afd958e0e6aace97..d3fb2f4a190742441e88c497ff5f915055b4df19 100644 +--- a/src/main/java/net/minecraft/server/TileEntityCampfire.java ++++ b/src/main/java/net/minecraft/server/TileEntityCampfire.java +@@ -1,12 +1,12 @@ + package net.minecraft.server; + +-import java.util.Optional; +-import java.util.Random; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.event.block.BlockCookEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Optional; ++import java.util.Random; + // CraftBukkit end + + public class TileEntityCampfire extends TileEntity implements Clearable, ITickable { +diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java +index 0a73895999f6e680cc89746b8573a596d91749d2..2e638f09369f5041222f57cdef2fbb903da9ba88 100644 +--- a/src/main/java/net/minecraft/server/TileEntityChest.java ++++ b/src/main/java/net/minecraft/server/TileEntityChest.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.List; +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; ++ ++import java.util.Iterator; ++import java.util.List; + // CraftBukkit end + + public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITickable +diff --git a/src/main/java/net/minecraft/server/TileEntityConduit.java b/src/main/java/net/minecraft/server/TileEntityConduit.java +index 7e9470caa568ccd5857b8f5c774b6d2651f6f96c..adbfb11064fe38648588b167e1f9db2130a6a0da 100644 +--- a/src/main/java/net/minecraft/server/TileEntityConduit.java ++++ b/src/main/java/net/minecraft/server/TileEntityConduit.java +@@ -1,14 +1,14 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++import org.bukkit.craftbukkit.block.CraftBlock; ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.List; + import java.util.Random; + import java.util.UUID; +-import javax.annotation.Nullable; +-// CraftBukkit start +-import org.bukkit.craftbukkit.block.CraftBlock; +-import org.bukkit.craftbukkit.event.CraftEventFactory; + // CraftBukkit end + + public class TileEntityConduit extends TileEntity implements ITickable { +diff --git a/src/main/java/net/minecraft/server/TileEntityDispenser.java b/src/main/java/net/minecraft/server/TileEntityDispenser.java +index 6ea4bc31151bce2bdd3376a889029c4b999befac..2fdee45e359d21fd73a1748ec0e534a6260c1588 100644 +--- a/src/main/java/net/minecraft/server/TileEntityDispenser.java ++++ b/src/main/java/net/minecraft/server/TileEntityDispenser.java +@@ -1,11 +1,10 @@ + package net.minecraft.server; + +-import java.util.Random; +-// CraftBukkit start +-import java.util.List; +- + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; ++ ++import java.util.List; ++import java.util.Random; + // CraftBukkit end + + public class TileEntityDispenser extends TileEntityLootable { +diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java +index 89537dec8ed278e79e078cb2fd3d3e839cdbab59..159db8d095f9abed59348594147a640cec96889f 100644 +--- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java ++++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java +@@ -1,16 +1,16 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.List; +-import java.util.Random; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-// CraftBukkit start + import org.bukkit.Bukkit; + import org.bukkit.Location; + import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.bukkit.event.player.PlayerTeleportEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Random; + // CraftBukkit end + + public class TileEntityEndGateway extends TileEntityEnderPortal implements ITickable { +diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java +index eded99b59beb7d6fe759b21fa7d3082057c741d4..497ca14dd5c6df02dfce897820967c3f6094a255 100644 +--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java ++++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java +@@ -5,12 +5,6 @@ import com.google.common.collect.Maps; + import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry; + import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; + import it.unimi.dsi.fastutil.objects.ObjectIterator; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import javax.annotation.Nullable; +-// CraftBukkit start +-import java.util.List; + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.craftbukkit.inventory.CraftItemStack; +@@ -19,6 +13,11 @@ import org.bukkit.entity.Player; + import org.bukkit.event.inventory.FurnaceBurnEvent; + import org.bukkit.event.inventory.FurnaceExtractEvent; + import org.bukkit.event.inventory.FurnaceSmeltEvent; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; + // CraftBukkit end + + public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable { +diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java +index a5a8528db91c15afcf8c77d5e4727c8e0212bb63..4285e9e4c1064468922b66d8cafbd102827f7f24 100644 +--- a/src/main/java/net/minecraft/server/TileEntityHopper.java ++++ b/src/main/java/net/minecraft/server/TileEntityHopper.java +@@ -1,20 +1,17 @@ + package net.minecraft.server; + +-import java.util.Iterator; +-import java.util.List; +-import java.util.Optional; +-import java.util.function.Supplier; +-import java.util.stream.Collectors; +-import java.util.stream.IntStream; +-import javax.annotation.Nullable; +- +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.entity.HumanEntity; + import org.bukkit.event.inventory.InventoryMoveItemEvent; + import org.bukkit.event.inventory.InventoryPickupItemEvent; + import org.bukkit.inventory.Inventory; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.List; ++import java.util.function.Supplier; ++import java.util.stream.IntStream; + // CraftBukkit end + + public class TileEntityHopper extends TileEntityLootable implements IHopper, ITickable { +diff --git a/src/main/java/net/minecraft/server/TileEntityLectern.java b/src/main/java/net/minecraft/server/TileEntityLectern.java +index b955d5d6619d6b9c64559937df6aa619fb4c8c04..0651a733c7d18606e637fae3ab6602e544dd92da 100644 +--- a/src/main/java/net/minecraft/server/TileEntityLectern.java ++++ b/src/main/java/net/minecraft/server/TileEntityLectern.java +@@ -1,17 +1,16 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; +-// CraftBukkit start +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.List; +-import java.util.UUID; + import org.bukkit.Location; + import org.bukkit.block.Lectern; +-import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; + import org.bukkit.inventory.InventoryHolder; ++ ++import javax.annotation.Nullable; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.List; ++import java.util.UUID; + // CraftBukkit end + + public class TileEntityLectern extends TileEntity implements Clearable, ITileInventory, ICommandListener { // CraftBukkit - ICommandListener +diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java +index 81651778fe1e81273ecdf7cdd511c84b5f3e1d40..634f7a444e98537a6895c2ac2a892f9f39e2fde9 100644 +--- a/src/main/java/net/minecraft/server/TileEntityLootable.java ++++ b/src/main/java/net/minecraft/server/TileEntityLootable.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; + import javax.annotation.Nullable; ++import java.util.Random; + + public abstract class TileEntityLootable extends TileEntityContainer { + +diff --git a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java +index 9459efde54d507231b4aacb7cba14e9905ebb4d7..9eee9c250d4b6cf28951cf9c0cee961268947320 100644 +--- a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java ++++ b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java +@@ -1,12 +1,11 @@ + package net.minecraft.server; + +-import java.util.Arrays; +-import java.util.List; +-import java.util.stream.IntStream; +-import javax.annotation.Nullable; +-// CraftBukkit start + import org.bukkit.craftbukkit.entity.CraftHumanEntity; + import org.bukkit.entity.HumanEntity; ++ ++import javax.annotation.Nullable; ++import java.util.Arrays; ++import java.util.List; + // CraftBukkit end + + public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory, ITickable { +diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java +index c4b0d8720e71c7bf2cac7ed962b8fd33cf0b49b3..fa63d9c7eae6f38a953176be8bcf1125094c3c52 100644 +--- a/src/main/java/net/minecraft/server/TileEntitySign.java ++++ b/src/main/java/net/minecraft/server/TileEntitySign.java +@@ -1,8 +1,9 @@ + package net.minecraft.server; + + import com.mojang.brigadier.exceptions.CommandSyntaxException; +-import java.util.UUID; ++ + import javax.annotation.Nullable; ++import java.util.UUID; + + public class TileEntitySign extends TileEntity implements ICommandListener { // CraftBukkit - implements + +diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java +index ceb1f18a49ebc8fbac270d9f221fa44f9baea216..b9def7587a1dad2acce3509cc7b82e9768f8b1bc 100644 +--- a/src/main/java/net/minecraft/server/TileEntitySkull.java ++++ b/src/main/java/net/minecraft/server/TileEntitySkull.java +@@ -1,32 +1,23 @@ + package net.minecraft.server; + +-import com.google.common.collect.Iterables; +-import com.mojang.authlib.GameProfile; +-import com.mojang.authlib.minecraft.MinecraftSessionService; +-import com.mojang.authlib.properties.Property; +- +-import dev.tr7zw.yatopia.events.GameProfileLookupEvent; +- +-import java.util.UUID; +-import javax.annotation.Nullable; +- +-import org.bukkit.Bukkit; +- +-// Spigot start + import com.google.common.base.Predicate; +-import com.google.common.cache.LoadingCache; + import com.google.common.cache.CacheBuilder; + import com.google.common.cache.CacheLoader; ++import com.google.common.cache.LoadingCache; ++import com.google.common.collect.Iterables; + import com.google.common.util.concurrent.Futures; +-import java.util.concurrent.Executors; +-import java.util.concurrent.ExecutorService; +-import java.util.concurrent.Future; +-import java.util.concurrent.TimeUnit; +- + import com.google.common.util.concurrent.ThreadFactoryBuilder; + import com.mojang.authlib.Agent; ++import com.mojang.authlib.GameProfile; + import com.mojang.authlib.ProfileLookupCallback; +-import java.util.concurrent.Callable; ++import com.mojang.authlib.minecraft.MinecraftSessionService; ++import com.mojang.authlib.properties.Property; ++import dev.tr7zw.yatopia.events.GameProfileLookupEvent; ++import org.bukkit.Bukkit; ++ ++import javax.annotation.Nullable; ++import java.util.UUID; ++import java.util.concurrent.*; + // Spigot end + + public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Paper - remove tickable +diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java +index 2cdc6cf8ce06103b2c042f512e53567d95994202..d9421dc1afc86c8f1f4acacbe23a70ac8143bb19 100644 +--- a/src/main/java/net/minecraft/server/UserCache.java ++++ b/src/main/java/net/minecraft/server/UserCache.java +@@ -2,42 +2,22 @@ package net.minecraft.server; + + import com.google.common.collect.Iterators; + import com.google.common.collect.Lists; +-import com.google.common.collect.Maps; + import com.google.common.io.Files; +-import com.google.gson.Gson; +-import com.google.gson.GsonBuilder; +-import com.google.gson.JsonDeserializationContext; +-import com.google.gson.JsonDeserializer; +-import com.google.gson.JsonElement; +-import com.google.gson.JsonObject; +-import com.google.gson.JsonParseException; +-import com.google.gson.JsonSerializationContext; +-import com.google.gson.JsonSerializer; ++import com.google.gson.*; + import com.google.gson.reflect.TypeToken; + import com.mojang.authlib.Agent; + import com.mojang.authlib.GameProfile; + import com.mojang.authlib.GameProfileRepository; + import com.mojang.authlib.ProfileLookupCallback; +-import java.io.BufferedReader; +-import java.io.BufferedWriter; +-import java.io.File; +-import java.io.FileNotFoundException; +-import java.io.IOException; +-import java.io.Reader; ++import org.apache.commons.io.IOUtils; ++ ++import javax.annotation.Nullable; ++import java.io.*; + import java.lang.reflect.Type; + import java.nio.charset.StandardCharsets; + import java.text.ParseException; + import java.text.SimpleDateFormat; +-import java.util.Calendar; +-import java.util.Date; +-import java.util.Deque; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Locale; +-import java.util.Map; +-import java.util.UUID; +-import javax.annotation.Nullable; +-import org.apache.commons.io.IOUtils; ++import java.util.*; + + public class UserCache { + +diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java +index f1e791c87457bcdf31a70f6f06bf865f556f12e7..1e75251c2a47f524ad7f2dbb864674c7707bc58b 100644 +--- a/src/main/java/net/minecraft/server/VillagePlace.java ++++ b/src/main/java/net/minecraft/server/VillagePlace.java +@@ -6,13 +6,9 @@ import it.unimi.dsi.fastutil.longs.Long2ByteMap; + import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap; + import it.unimi.dsi.fastutil.longs.LongOpenHashSet; + import it.unimi.dsi.fastutil.longs.LongSet; ++ + import java.io.File; +-import java.util.Collections; +-import java.util.Comparator; +-import java.util.List; +-import java.util.Optional; +-import java.util.Random; +-import java.util.Set; ++import java.util.*; + import java.util.function.BiConsumer; + import java.util.function.BooleanSupplier; + import java.util.function.Predicate; +diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java +index b1081e441023f5d24091321b1267b5651adeb331..31783b9b1fe53ccb3ae39149bc066037b3074843 100644 +--- a/src/main/java/net/minecraft/server/VillageSiege.java ++++ b/src/main/java/net/minecraft/server/VillageSiege.java +@@ -2,8 +2,8 @@ package net.minecraft.server; + + import com.destroystokyo.paper.exception.ServerInternalException; + +-import java.util.Iterator; + import javax.annotation.Nullable; ++import java.util.Iterator; + + public class VillageSiege implements MobSpawner { + +diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java +index d0c2ec4050458e26d1bd85cc09b1a3fdca8488c6..9eb3996a0e927276327402653de395f6cfa3669f 100644 +--- a/src/main/java/net/minecraft/server/VillagerTrades.java ++++ b/src/main/java/net/minecraft/server/VillagerTrades.java +@@ -5,12 +5,13 @@ import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import it.unimi.dsi.fastutil.ints.Int2ObjectMap; + import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; ++ ++import javax.annotation.Nullable; + import java.util.List; + import java.util.Locale; + import java.util.Map; + import java.util.Random; + import java.util.stream.Collectors; +-import javax.annotation.Nullable; + + public class VillagerTrades { + +diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java +index 3a98e242e06ad3a936b9c3a110c66238d172323e..f7a647ce5ae20843f2b2274857cd71eca399fa46 100644 +--- a/src/main/java/net/minecraft/server/VoxelShape.java ++++ b/src/main/java/net/minecraft/server/VoxelShape.java +@@ -3,8 +3,9 @@ package net.minecraft.server; + import com.google.common.collect.Lists; + import com.google.common.math.DoubleMath; + import it.unimi.dsi.fastutil.doubles.DoubleList; +-import java.util.List; ++ + import javax.annotation.Nullable; ++import java.util.List; + + public abstract class VoxelShape { + +diff --git a/src/main/java/net/minecraft/server/VoxelShapeArray.java b/src/main/java/net/minecraft/server/VoxelShapeArray.java +index 8d68c783f6d8c1dae62c0d3ed34e305785169579..ee8b29fabcd706dfd324732daf22035848109aac 100644 +--- a/src/main/java/net/minecraft/server/VoxelShapeArray.java ++++ b/src/main/java/net/minecraft/server/VoxelShapeArray.java +@@ -2,8 +2,8 @@ package net.minecraft.server; + + import it.unimi.dsi.fastutil.doubles.DoubleArrayList; + import it.unimi.dsi.fastutil.doubles.DoubleList; ++ + import java.util.Arrays; +-import java.util.List; + + public final class VoxelShapeArray extends VoxelShape { + +diff --git a/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java b/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java +index e841611bb7c36dffec44bb9e74a0a9657a113263..30d9414d20617c3b6f58994f4268a81461b1d011 100644 +--- a/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java ++++ b/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java +@@ -1,10 +1,10 @@ + package net.minecraft.server; + ++import javax.annotation.Nullable; + import java.util.Objects; + import java.util.Spliterators.AbstractSpliterator; + import java.util.function.BiPredicate; + import java.util.function.Consumer; +-import javax.annotation.Nullable; + + public class VoxelShapeSpliterator extends AbstractSpliterator { + +diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java +index 34a180361e817b5cbd37d206fbc7cfd5ad2a468b..fa35fe79d1d35a6862151aca0dba09237236227d 100644 +--- a/src/main/java/net/minecraft/server/VoxelShapes.java ++++ b/src/main/java/net/minecraft/server/VoxelShapes.java +@@ -5,7 +5,7 @@ import com.google.common.math.DoubleMath; + import com.google.common.math.IntMath; + import it.unimi.dsi.fastutil.doubles.DoubleArrayList; + import it.unimi.dsi.fastutil.doubles.DoubleList; +-import java.util.Arrays; ++ + import java.util.Iterator; + import java.util.Objects; + import java.util.stream.Stream; +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index 2977dadc19fa6bcafaa6f44a883eec235db8653d..f4058e70aea8295942c16041e0eb332b59894cd2 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -1,33 +1,15 @@ + package net.minecraft.server; + +-import co.aikar.timings.Timing; +-import co.aikar.timings.Timings; +-import me.jellysquid.mods.lithium.common.util.collections.HashedList; +- +-import com.destroystokyo.paper.antixray.ChunkPacketBlockController; // Paper - Anti-Xray +-import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray; // Paper - Anti-Xray ++import com.destroystokyo.paper.antixray.ChunkPacketBlockController; ++import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray; + import com.destroystokyo.paper.event.server.ServerExceptionEvent; + import com.destroystokyo.paper.exception.ServerInternalException; +-import com.google.common.base.MoreObjects; + import com.google.common.collect.Lists; + import com.mojang.serialization.Codec; + import com.proximyst.rainforest.RainforestWorldConfig; +-import java.io.IOException; +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Random; +-import java.util.function.Consumer; +-import java.util.function.Predicate; +-import java.util.function.Supplier; +-import javax.annotation.Nullable; ++import me.jellysquid.mods.lithium.common.util.collections.HashedList; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import java.util.HashMap; +-import java.util.Map; + import org.bukkit.Bukkit; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.CraftWorld; +@@ -35,6 +17,13 @@ import org.bukkit.craftbukkit.block.CapturedBlockState; + import org.bukkit.craftbukkit.block.CraftBlockState; + import org.bukkit.craftbukkit.block.data.CraftBlockData; + import org.bukkit.event.block.BlockPhysicsEvent; ++ ++import javax.annotation.Nullable; ++import java.io.IOException; ++import java.util.*; ++import java.util.function.Consumer; ++import java.util.function.Predicate; ++import java.util.function.Supplier; + // CraftBukkit end + + public abstract class World implements GeneratorAccess, AutoCloseable { +diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java +index 5cba3b0e613bb6c016c4441ebb931be9dba8db4e..b9c4e82524f842475811eae5bbe4547d12f2ceba 100644 +--- a/src/main/java/net/minecraft/server/WorldBorder.java ++++ b/src/main/java/net/minecraft/server/WorldBorder.java +@@ -2,6 +2,7 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import com.mojang.serialization.DynamicLike; ++ + import java.util.Iterator; + import java.util.List; + +diff --git a/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java b/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java +index 631a028dd262476f257c382f488320fee42584cd..0f00d4c9bdf09eece00547c8a66db2e90eff1e5a 100644 +--- a/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java ++++ b/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java +@@ -2,6 +2,7 @@ package net.minecraft.server; + + import com.google.common.collect.ImmutableList; + import com.mojang.serialization.Codec; ++ + import java.util.List; + + public class WorldChunkManagerTheEnd extends WorldChunkManager { +diff --git a/src/main/java/net/minecraft/server/WorldDataServer.java b/src/main/java/net/minecraft/server/WorldDataServer.java +index 51cec9739c1409a2865d1aef7488acdb2079c88c..98e70eb333793e7d28d77c9ad3627453d469c6e8 100644 +--- a/src/main/java/net/minecraft/server/WorldDataServer.java ++++ b/src/main/java/net/minecraft/server/WorldDataServer.java +@@ -6,17 +6,17 @@ import com.mojang.datafixers.DataFixer; + import com.mojang.serialization.DataResult; + import com.mojang.serialization.Dynamic; + import com.mojang.serialization.Lifecycle; +-import java.util.LinkedHashSet; +-import java.util.Set; +-import java.util.UUID; +-import java.util.stream.Collectors; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +-// CraftBukkit start + import org.bukkit.Bukkit; + import org.bukkit.event.weather.ThunderChangeEvent; + import org.bukkit.event.weather.WeatherChangeEvent; ++ ++import javax.annotation.Nullable; ++import java.util.LinkedHashSet; ++import java.util.Set; ++import java.util.UUID; ++import java.util.stream.Collectors; + // CraftBukkit end + + public class WorldDataServer implements IWorldDataServer, SaveData { +diff --git a/src/main/java/net/minecraft/server/WorldGenMegaTreeProvider.java b/src/main/java/net/minecraft/server/WorldGenMegaTreeProvider.java +index 2830c53c23e516ec0a2aec72084fdd1007274833..4000ba57175bcf8ac940573f3685ca27303ef707 100644 +--- a/src/main/java/net/minecraft/server/WorldGenMegaTreeProvider.java ++++ b/src/main/java/net/minecraft/server/WorldGenMegaTreeProvider.java +@@ -1,7 +1,7 @@ + package net.minecraft.server; + +-import java.util.Random; + import javax.annotation.Nullable; ++import java.util.Random; + + public abstract class WorldGenMegaTreeProvider extends WorldGenTreeProvider { + +diff --git a/src/main/java/net/minecraft/server/WorldGenTreeProvider.java b/src/main/java/net/minecraft/server/WorldGenTreeProvider.java +index ce1cd82e6c9e4a41622f3c10e812003f4f273a6f..6e340b2581529dc52b739d43e58c74c80f5c1b01 100644 +--- a/src/main/java/net/minecraft/server/WorldGenTreeProvider.java ++++ b/src/main/java/net/minecraft/server/WorldGenTreeProvider.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + ++import org.bukkit.TreeType; ++ ++import javax.annotation.Nullable; + import java.util.Iterator; + import java.util.Random; +-import javax.annotation.Nullable; +-import org.bukkit.TreeType; // CraftBukkit + + public abstract class WorldGenTreeProvider { + +diff --git a/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java b/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java +index ae77805f71c6c574d92f39c51b1e48f2138e9ab6..3891835ccbda8cd3569b1054ec5873c1fb8e6ab1 100644 +--- a/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java ++++ b/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java +@@ -1,9 +1,10 @@ + package net.minecraft.server; + +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import javax.annotation.Nullable; ++ + public class WorldLoadListenerLogger implements WorldLoadListener { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java +index 3b1779f8220afc61d4d63926bcda0c27b44dd96e..e3bcf63922639db39e83c8b6b1ad65b948295644 100644 +--- a/src/main/java/net/minecraft/server/WorldMap.java ++++ b/src/main/java/net/minecraft/server/WorldMap.java +@@ -4,22 +4,20 @@ import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import com.mojang.serialization.DataResult; + import com.mojang.serialization.Dynamic; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import java.util.UUID; +- + import org.bukkit.Bukkit; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.CraftWorld; + import org.bukkit.craftbukkit.map.CraftMapView; + import org.bukkit.craftbukkit.util.CraftChatMessage; + import org.bukkit.entity.Player; ++ ++import javax.annotation.Nullable; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import java.util.UUID; + // CraftBukkit end + + public class WorldMap extends PersistentBase { +diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java +index b14f3d44a76ccac791b7be353bb2899fc59f70ec..484058ca6e5aea094a36f6e4e0d2c3106ec2da73 100644 +--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java ++++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java +@@ -1,21 +1,14 @@ + package net.minecraft.server; + + import com.mojang.datafixers.DataFixer; +-import java.io.File; +-import java.io.FileInputStream; +-import java.io.FileOutputStream; +-import java.io.InputStream; +-import java.io.OutputStream; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; ++import org.bukkit.craftbukkit.entity.CraftPlayer; + +-// CraftBukkit start +-import java.util.UUID; ++import javax.annotation.Nullable; ++import java.io.*; + import java.util.concurrent.ExecutorService; + import java.util.concurrent.Executors; +- +-import org.bukkit.craftbukkit.entity.CraftPlayer; + // CraftBukkit end + + public class WorldNBTStorage { +diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java +index a2a25cf6a43a1f59a80c997e2980f2bb8e6b3817..045605b71a74a1ea3a29e622bb790bdd690d33dc 100644 +--- a/src/main/java/net/minecraft/server/WorldPersistentData.java ++++ b/src/main/java/net/minecraft/server/WorldPersistentData.java +@@ -2,18 +2,14 @@ package net.minecraft.server; + + import com.google.common.collect.Maps; + import com.mojang.datafixers.DataFixer; +-import java.io.DataInputStream; +-import java.io.File; +-import java.io.FileInputStream; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.PushbackInputStream; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ ++import javax.annotation.Nullable; ++import java.io.*; + import java.util.Iterator; + import java.util.Map; + import java.util.function.Supplier; +-import javax.annotation.Nullable; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class WorldPersistentData { + +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 3782d329dc62a9e834f16a9009f4102b5b4aad6f..7b16515ad249fac5e9dcf12e1a59a4699005b247 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -1,39 +1,17 @@ + package net.minecraft.server; + ++import co.aikar.timings.TimingHistory; ++import com.destroystokyo.paper.PaperWorldConfig; + import com.google.common.annotations.VisibleForTesting; +-import com.google.common.collect.ImmutableList; +-import com.google.common.collect.Iterables; +-import co.aikar.timings.TimingHistory; // Paper +-import co.aikar.timings.Timings; // Paper +- +-import com.destroystokyo.paper.PaperWorldConfig; // Paper +-import com.google.common.collect.Lists; +-import com.google.common.collect.Maps; +-import com.google.common.collect.Queues; +-import com.google.common.collect.Sets; ++import com.google.common.collect.*; + import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap; + import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +-import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry; + import it.unimi.dsi.fastutil.longs.LongSet; + import it.unimi.dsi.fastutil.longs.LongSets; + import it.unimi.dsi.fastutil.objects.ObjectIterator; + import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; +-import java.io.BufferedWriter; +-import java.io.IOException; +-import java.io.Writer; +-import java.nio.file.Files; +-import java.util.*; +-import java.util.concurrent.Executor; +-import java.util.function.BooleanSupplier; +-import java.util.function.Predicate; +-import java.util.stream.Collectors; +-import javax.annotation.Nonnull; +-import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- +-// CraftBukkit start +-import java.util.logging.Level; + import org.bukkit.Bukkit; + import org.bukkit.WeatherType; + import org.bukkit.craftbukkit.event.CraftEventFactory; +@@ -42,6 +20,18 @@ import org.bukkit.event.entity.CreatureSpawnEvent; + import org.bukkit.event.server.MapInitializeEvent; + import org.bukkit.event.weather.LightningStrikeEvent; + import org.bukkit.event.world.TimeSkipEvent; ++ ++import javax.annotation.Nonnull; ++import javax.annotation.Nullable; ++import java.io.BufferedWriter; ++import java.io.IOException; ++import java.io.Writer; ++import java.nio.file.Files; ++import java.util.*; ++import java.util.concurrent.Executor; ++import java.util.function.BooleanSupplier; ++import java.util.function.Predicate; ++import java.util.logging.Level; + // CraftBukkit end + + public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/WorldUpgrader.java b/src/main/java/net/minecraft/server/WorldUpgrader.java +index 888dae2d5ee8a71e83dd24e5f3c6bc8513016f9d..61adf30422dd7c7d0444696e0aaf25ea2baf3a1c 100644 +--- a/src/main/java/net/minecraft/server/WorldUpgrader.java ++++ b/src/main/java/net/minecraft/server/WorldUpgrader.java +@@ -1,16 +1,15 @@ + package net.minecraft.server; + +-import com.google.common.collect.ImmutableList; +-import com.google.common.collect.ImmutableMap; ++import com.google.common.collect.*; + import com.google.common.collect.ImmutableMap.Builder; +-import com.google.common.collect.ImmutableSet; +-import com.google.common.collect.Lists; +-import com.google.common.collect.UnmodifiableIterator; + import com.google.common.util.concurrent.ThreadFactoryBuilder; + import com.mojang.datafixers.DataFixer; + import it.unimi.dsi.fastutil.objects.Object2FloatMap; + import it.unimi.dsi.fastutil.objects.Object2FloatMaps; + import it.unimi.dsi.fastutil.objects.Object2FloatOpenCustomHashMap; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.io.File; + import java.io.IOException; + import java.util.List; +@@ -18,8 +17,6 @@ import java.util.ListIterator; + import java.util.concurrent.ThreadFactory; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class WorldUpgrader { + +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index 7cde55ae407012b3445f11b07a0ebc9d00e031e3..23cbd9a980ce65c99cdfd1cbade3ffa5796a1e7f 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -1,7 +1,9 @@ + package net.pl3x.purpur; + + import org.bukkit.configuration.ConfigurationSection; ++ + import java.util.List; ++ + import static net.pl3x.purpur.PurpurConfig.log; + + public class PurpurWorldConfig { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +index 06e42b7db5385f9a357183552259e7b4491d9fd0..523314656144ce4a79a788130152ddfcdba7b252 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +@@ -2,27 +2,7 @@ package org.bukkit.craftbukkit; + + import com.google.common.base.Preconditions; + import com.google.common.base.Predicates; +-import java.lang.ref.WeakReference; +-import java.util.Arrays; +-import java.util.Collection; +-import java.util.function.Predicate; +-import net.minecraft.server.BiomeStorage; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.Blocks; +-import net.minecraft.server.ChunkCoordIntPair; +-import net.minecraft.server.ChunkSection; +-import net.minecraft.server.DataPaletteBlock; +-import net.minecraft.server.EnumSkyBlock; +-import net.minecraft.server.GameProfileSerializer; +-import net.minecraft.server.HeightMap; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.LightEngine; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.NibbleArray; +-import net.minecraft.server.SectionPosition; +-import net.minecraft.server.SeededRandom; +-import net.minecraft.server.WorldChunkManager; +-import net.minecraft.server.WorldServer; ++import net.minecraft.server.*; + import org.bukkit.Chunk; + import org.bukkit.ChunkSnapshot; + import org.bukkit.World; +@@ -35,6 +15,11 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.entity.Entity; + import org.bukkit.plugin.Plugin; + ++import java.lang.ref.WeakReference; ++import java.util.Arrays; ++import java.util.Collection; ++import java.util.function.Predicate; ++ + public class CraftChunk implements Chunk { + private WeakReference weakChunk; + private final WorldServer worldServer; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +index 31c81b4b52f79892de5c1315358ec161c5a0c204..9f3ff7b613ea0b69519999346eb63390b5e00a05 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +@@ -2,12 +2,7 @@ package org.bukkit.craftbukkit; + + import com.google.common.base.Preconditions; + import com.google.common.base.Predicates; +-import java.util.function.Predicate; +-import net.minecraft.server.BiomeStorage; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.DataPaletteBlock; +-import net.minecraft.server.HeightMap; +-import net.minecraft.server.IBlockData; ++import net.minecraft.server.*; + import org.bukkit.ChunkSnapshot; + import org.bukkit.Material; + import org.bukkit.block.Biome; +@@ -16,6 +11,8 @@ import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.block.data.CraftBlockData; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + ++import java.util.function.Predicate; ++ + /** + * Represents a static, thread-safe snapshot of chunk of blocks + * Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering) +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftCrashReport.java b/src/main/java/org/bukkit/craftbukkit/CraftCrashReport.java +index 7511e38130f38703164395a670f12d1af648ff04..54b9b61f814a4987406661a1eacd7a1ffbd26924 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftCrashReport.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftCrashReport.java +@@ -1,10 +1,5 @@ + package org.bukkit.craftbukkit; + +-import java.io.PrintWriter; +-import java.io.StringWriter; +-import java.util.Arrays; +-import java.util.Collection; +-import java.util.Map; + import net.minecraft.server.CrashReportCallable; + import net.minecraft.server.MinecraftServer; + import org.bukkit.Bukkit; +@@ -14,6 +9,12 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.plugin.Plugin; + import org.bukkit.plugin.PluginDescriptionFile; + ++import java.io.PrintWriter; ++import java.io.StringWriter; ++import java.util.Arrays; ++import java.util.Collection; ++import java.util.Map; ++ + public class CraftCrashReport implements CrashReportCallable { + + @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftIpBanEntry.java b/src/main/java/org/bukkit/craftbukkit/CraftIpBanEntry.java +index 372404cd185d2e85617db673edcd8eeab4401f2b..040a779017cf33192d17913b26651d246e95d4d0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftIpBanEntry.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftIpBanEntry.java +@@ -1,12 +1,13 @@ + package org.bukkit.craftbukkit; + +-import java.io.IOException; +-import java.util.Date; +-import java.util.logging.Level; + import net.minecraft.server.IpBanEntry; + import net.minecraft.server.IpBanList; + import org.bukkit.Bukkit; + ++import java.io.IOException; ++import java.util.Date; ++import java.util.logging.Level; ++ + public final class CraftIpBanEntry implements org.bukkit.BanEntry { + private final IpBanList list; + private final String target; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java +index 101a32555a632f8c023594319a76861b794d1a46..af277342d96367cb7c6e9f80a0120181d7297024 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java +@@ -1,17 +1,18 @@ + package org.bukkit.craftbukkit; + + import com.google.common.collect.ImmutableSet; +-import java.io.IOException; +-import java.net.InetSocketAddress; +-import java.util.Date; +-import java.util.Set; +-import java.util.logging.Level; + import net.minecraft.server.IpBanEntry; + import net.minecraft.server.IpBanList; + import org.apache.commons.lang.StringUtils; + import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + ++import java.io.IOException; ++import java.net.InetSocketAddress; ++import java.util.Date; ++import java.util.Set; ++import java.util.logging.Level; ++ + public class CraftIpBanList implements org.bukkit.BanList { + private final IpBanList list; + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java +index 584ca998e077a0a8aef5be05f5b4f15879aab397..3ff9fa7173d64950769db96c41f9b7d651d6e3b0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java +@@ -1,20 +1,6 @@ + package org.bukkit.craftbukkit; + +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.List; +-import java.util.Random; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.DamageSource; +-import net.minecraft.server.Entity; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.IInventory; +-import net.minecraft.server.LootContextParameter; +-import net.minecraft.server.LootContextParameterSet; +-import net.minecraft.server.LootContextParameters; +-import net.minecraft.server.LootTable; +-import net.minecraft.server.LootTableInfo; +-import net.minecraft.server.WorldServer; ++import net.minecraft.server.*; + import org.bukkit.Location; + import org.bukkit.NamespacedKey; + import org.bukkit.craftbukkit.entity.CraftEntity; +@@ -25,6 +11,11 @@ import org.bukkit.inventory.Inventory; + import org.bukkit.inventory.ItemStack; + import org.bukkit.loot.LootContext; + ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.List; ++import java.util.Random; ++ + public class CraftLootTable implements org.bukkit.loot.LootTable { + + private final LootTable handle; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +index 5770d4183c1b9ab6119a25930283c0235250ed6e..1b2f7dc78d8f969169718d289662361c50a38327 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +@@ -1,22 +1,11 @@ + package org.bukkit.craftbukkit; + + import com.mojang.authlib.GameProfile; +-import java.io.File; +-import java.util.LinkedHashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.UUID; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.ServerStatisticManager; + import net.minecraft.server.WhiteListEntry; + import net.minecraft.server.WorldNBTStorage; +-import org.bukkit.BanList; +-import org.bukkit.Bukkit; +-import org.bukkit.Location; +-import org.bukkit.Material; +-import org.bukkit.OfflinePlayer; +-import org.bukkit.Server; +-import org.bukkit.Statistic; ++import org.bukkit.*; + import org.bukkit.configuration.serialization.ConfigurationSerializable; + import org.bukkit.configuration.serialization.SerializableAs; + import org.bukkit.entity.EntityType; +@@ -24,6 +13,12 @@ import org.bukkit.entity.Player; + import org.bukkit.metadata.MetadataValue; + import org.bukkit.plugin.Plugin; + ++import java.io.File; ++import java.util.LinkedHashMap; ++import java.util.List; ++import java.util.Map; ++import java.util.UUID; ++ + @SerializableAs("Player") + public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializable { + private final GameProfile profile; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftParticle.java b/src/main/java/org/bukkit/craftbukkit/CraftParticle.java +index 54800bbed574655db8bae174c85cb3f5e9602434..caf28d3450324af516e6805e9b8668af7ab4a6d3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftParticle.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftParticle.java +@@ -3,15 +3,7 @@ package org.bukkit.craftbukkit; + import com.google.common.base.Preconditions; + import com.google.common.collect.BiMap; + import com.google.common.collect.HashBiMap; +-import java.util.HashMap; +-import java.util.Map; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.ParticleParam; +-import net.minecraft.server.ParticleParamBlock; +-import net.minecraft.server.ParticleParamItem; +-import net.minecraft.server.ParticleParamRedstone; +-import net.minecraft.server.ParticleType; ++import net.minecraft.server.*; + import org.bukkit.Color; + import org.bukkit.Particle; + import org.bukkit.block.data.BlockData; +@@ -21,6 +13,9 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.ItemStack; + import org.bukkit.material.MaterialData; + ++import java.util.HashMap; ++import java.util.Map; ++ + public enum CraftParticle { + + EXPLOSION_NORMAL("poof"), +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java +index bbe91bca15ee1506ff9ea33169286fa2ed2dd267..62964b62ea3f9e1dbee670c991f475b5299d3520 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java +@@ -1,13 +1,14 @@ + package org.bukkit.craftbukkit; + + import com.mojang.authlib.GameProfile; +-import java.io.IOException; +-import java.util.Date; +-import java.util.logging.Level; + import net.minecraft.server.GameProfileBanEntry; + import net.minecraft.server.GameProfileBanList; + import org.bukkit.Bukkit; + ++import java.io.IOException; ++import java.util.Date; ++import java.util.logging.Level; ++ + public final class CraftProfileBanEntry implements org.bukkit.BanEntry { + private final GameProfileBanList list; + private final GameProfile profile; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java +index 492a5bad8549d781e3aee47f22421da186d45760..6239d96d78c35d1231d68b5f60fdb7dbb9214585 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java +@@ -2,11 +2,6 @@ package org.bukkit.craftbukkit; + + import com.google.common.collect.ImmutableSet; + import com.mojang.authlib.GameProfile; +-import java.io.IOException; +-import java.util.Date; +-import java.util.Set; +-import java.util.UUID; +-import java.util.logging.Level; + import net.minecraft.server.GameProfileBanEntry; + import net.minecraft.server.GameProfileBanList; + import net.minecraft.server.JsonListEntry; +@@ -15,6 +10,12 @@ import org.apache.commons.lang.StringUtils; + import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + ++import java.io.IOException; ++import java.util.Date; ++import java.util.Set; ++import java.util.UUID; ++import java.util.logging.Level; ++ + public class CraftProfileBanList implements org.bukkit.BanList { + private final GameProfileBanList list; + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRaid.java b/src/main/java/org/bukkit/craftbukkit/CraftRaid.java +index 360a4901f5159a3f0606214f1abf2f8cee2ecbe1..96b4380d6bbda6b52259440b33d56b3d3bede4ef 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftRaid.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftRaid.java +@@ -2,11 +2,6 @@ package org.bukkit.craftbukkit; + + import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableList; +-import java.util.Collections; +-import java.util.List; +-import java.util.Set; +-import java.util.UUID; +-import java.util.function.Function; + import net.minecraft.server.BlockPosition; + import net.minecraft.server.EntityRaider; + import net.minecraft.server.World; +@@ -14,6 +9,12 @@ import org.bukkit.Location; + import org.bukkit.Raid; + import org.bukkit.entity.Raider; + ++import java.util.Collections; ++import java.util.List; ++import java.util.Set; ++import java.util.UUID; ++import java.util.function.Function; ++ + public final class CraftRaid implements Raid { + + private final net.minecraft.server.Raid handle; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 24b0fe67f2ea0a109fa32feb6ced0290cac7e8b7..f35258fdc19a0fdb5940e3bd2339427cb1ca8a45 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -3,11 +3,7 @@ package org.bukkit.craftbukkit; + import com.google.common.base.Charsets; + import com.google.common.base.Function; + import com.google.common.base.Preconditions; +-import com.google.common.collect.ImmutableList; +-import com.google.common.collect.ImmutableSet; +-import com.google.common.collect.Iterators; +-import com.google.common.collect.Lists; +-import com.google.common.collect.MapMaker; ++import com.google.common.collect.*; + import com.mojang.authlib.GameProfile; + import com.mojang.brigadier.StringReader; + import com.mojang.brigadier.exceptions.CommandSyntaxException; +@@ -19,106 +15,18 @@ import io.netty.buffer.ByteBuf; + import io.netty.buffer.ByteBufOutputStream; + import io.netty.buffer.Unpooled; + import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; +-import java.awt.image.BufferedImage; +-import java.io.File; +-import java.io.FileInputStream; +-import java.io.FileNotFoundException; +-import java.io.IOException; +-import java.io.InputStreamReader; +-import java.nio.ByteBuffer; +-import java.nio.charset.StandardCharsets; +-import java.util.*; +-import java.util.function.Consumer; +-import java.util.logging.Level; +-import java.util.logging.Logger; +-import javax.imageio.ImageIO; +-//import jline.console.ConsoleReader; // Paper +-import net.minecraft.server.Advancement; +-import net.minecraft.server.ArgumentEntity; +-import net.minecraft.server.BiomeManager; +-import net.minecraft.server.Block; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.BossBattleCustom; +-import net.minecraft.server.CommandDispatcher; +-import net.minecraft.server.CommandListenerWrapper; +-import net.minecraft.server.CommandReload; +-import net.minecraft.server.Convertable; +-import net.minecraft.server.DataConverterRegistry; +-import net.minecraft.server.DedicatedPlayerList; +-import net.minecraft.server.DedicatedServer; +-import net.minecraft.server.DedicatedServerProperties; +-import net.minecraft.server.DedicatedServerSettings; +-import net.minecraft.server.DimensionManager; +-import net.minecraft.server.DynamicOpsNBT; +-import net.minecraft.server.Enchantments; +-import net.minecraft.server.EntityPlayer; +-import net.minecraft.server.EnumDifficulty; +-import net.minecraft.server.EnumGamemode; +-import net.minecraft.server.GameRules; +-import net.minecraft.server.GeneratorSettings; +-import net.minecraft.server.IRecipe; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.IRegistryCustom; +-import net.minecraft.server.Item; +-import net.minecraft.server.ItemWorldMap; +-import net.minecraft.server.Items; +-import net.minecraft.server.JsonListEntry; +-import net.minecraft.server.LootTableRegistry; +-import net.minecraft.server.MapIcon; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.MobEffects; +-import net.minecraft.server.MobSpawner; +-import net.minecraft.server.MobSpawnerCat; +-import net.minecraft.server.MobSpawnerPatrol; +-import net.minecraft.server.MobSpawnerPhantom; +-import net.minecraft.server.MobSpawnerTrader; +-import net.minecraft.server.NBTBase; +-import net.minecraft.server.PlayerList; +-import net.minecraft.server.RegistryMaterials; +-import net.minecraft.server.RegistryReadOps; +-import net.minecraft.server.ResourceKey; +-import net.minecraft.server.SaveData; +-import net.minecraft.server.ServerCommand; +-import net.minecraft.server.TagsServer; +-import net.minecraft.server.TicketType; +-import net.minecraft.server.Vec3D; +-import net.minecraft.server.VillageSiege; +-import net.minecraft.server.WorldDataServer; +-import net.minecraft.server.WorldDimension; +-import net.minecraft.server.WorldMap; +-import net.minecraft.server.WorldNBTStorage; +-import net.minecraft.server.WorldServer; +-import net.minecraft.server.WorldSettings; ++import net.md_5.bungee.api.chat.BaseComponent; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.apache.commons.lang3.StringUtils; +-import org.bukkit.BanList; +-import org.bukkit.Bukkit; +-import org.bukkit.ChatColor; +-import org.bukkit.GameMode; +-import org.bukkit.Keyed; +-import org.bukkit.Location; +-import org.bukkit.NamespacedKey; +-import org.bukkit.OfflinePlayer; +-import org.bukkit.Server; +-import org.bukkit.StructureType; +-import org.bukkit.UnsafeValues; +-import org.bukkit.Warning.WarningState; ++import org.bukkit.*; + import org.bukkit.World; ++import org.bukkit.Warning.WarningState; + import org.bukkit.World.Environment; +-import org.bukkit.WorldCreator; + import org.bukkit.block.data.BlockData; +-import org.bukkit.boss.BarColor; +-import org.bukkit.boss.BarFlag; +-import org.bukkit.boss.BarStyle; +-import org.bukkit.boss.BossBar; +-import org.bukkit.boss.KeyedBossBar; +-import org.bukkit.command.Command; ++import org.bukkit.boss.*; + import org.bukkit.command.CommandException; +-import org.bukkit.command.CommandSender; +-import org.bukkit.command.ConsoleCommandSender; +-import org.bukkit.command.PluginCommand; +-import org.bukkit.command.SimpleCommandMap; ++import org.bukkit.command.*; + import org.bukkit.configuration.ConfigurationSection; + import org.bukkit.configuration.file.YamlConfiguration; + import org.bukkit.configuration.serialization.ConfigurationSerialization; +@@ -132,19 +40,7 @@ import org.bukkit.craftbukkit.command.VanillaCommandWrapper; + import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.bukkit.craftbukkit.generator.CraftChunkData; + import org.bukkit.craftbukkit.help.SimpleHelpMap; +-import org.bukkit.craftbukkit.inventory.CraftBlastingRecipe; +-import org.bukkit.craftbukkit.inventory.CraftCampfireRecipe; +-import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe; +-import org.bukkit.craftbukkit.inventory.CraftItemFactory; +-import org.bukkit.craftbukkit.inventory.CraftItemStack; +-import org.bukkit.craftbukkit.inventory.CraftMerchantCustom; +-import org.bukkit.craftbukkit.inventory.CraftRecipe; +-import org.bukkit.craftbukkit.inventory.CraftShapedRecipe; +-import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe; +-import org.bukkit.craftbukkit.inventory.CraftSmithingRecipe; +-import org.bukkit.craftbukkit.inventory.CraftSmokingRecipe; +-import org.bukkit.craftbukkit.inventory.CraftStonecuttingRecipe; +-import org.bukkit.craftbukkit.inventory.RecipeIterator; ++import org.bukkit.craftbukkit.inventory.*; + import org.bukkit.craftbukkit.inventory.util.CraftInventoryCreator; + import org.bukkit.craftbukkit.map.CraftMapView; + import org.bukkit.craftbukkit.metadata.EntityMetadataStore; +@@ -155,16 +51,11 @@ import org.bukkit.craftbukkit.scheduler.CraftScheduler; + import org.bukkit.craftbukkit.scoreboard.CraftScoreboardManager; + import org.bukkit.craftbukkit.tag.CraftBlockTag; + import org.bukkit.craftbukkit.tag.CraftItemTag; +-import org.bukkit.craftbukkit.util.CraftChatMessage; +-import org.bukkit.craftbukkit.util.CraftIconCache; +-import org.bukkit.craftbukkit.util.CraftMagicNumbers; +-import org.bukkit.craftbukkit.util.CraftNamespacedKey; +-import org.bukkit.craftbukkit.util.DatFileFilter; +-import org.bukkit.craftbukkit.util.Versioning; ++import org.bukkit.craftbukkit.util.*; + import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions; + import org.bukkit.entity.Entity; + import org.bukkit.entity.Player; +-import org.bukkit.event.command.UnknownCommandEvent; // Paper ++import org.bukkit.event.command.UnknownCommandEvent; + import org.bukkit.event.inventory.InventoryType; + import org.bukkit.event.player.PlayerChatTabCompleteEvent; + import org.bukkit.event.server.BroadcastMessageEvent; +@@ -175,30 +66,14 @@ import org.bukkit.event.world.WorldLoadEvent; + import org.bukkit.event.world.WorldUnloadEvent; + import org.bukkit.generator.ChunkGenerator; + import org.bukkit.help.HelpMap; +-import org.bukkit.inventory.BlastingRecipe; +-import org.bukkit.inventory.CampfireRecipe; +-import org.bukkit.inventory.ComplexRecipe; + import org.bukkit.inventory.FurnaceRecipe; +-import org.bukkit.inventory.Inventory; +-import org.bukkit.inventory.InventoryHolder; + import org.bukkit.inventory.ItemStack; +-import org.bukkit.inventory.Merchant; +-import org.bukkit.inventory.Recipe; +-import org.bukkit.inventory.ShapedRecipe; +-import org.bukkit.inventory.ShapelessRecipe; +-import org.bukkit.inventory.SmithingRecipe; +-import org.bukkit.inventory.SmokingRecipe; +-import org.bukkit.inventory.StonecuttingRecipe; ++import org.bukkit.inventory.*; + import org.bukkit.loot.LootTable; + import org.bukkit.map.MapView; + import org.bukkit.permissions.Permissible; + import org.bukkit.permissions.Permission; +-import org.bukkit.plugin.Plugin; +-import org.bukkit.plugin.PluginLoadOrder; +-import org.bukkit.plugin.PluginManager; +-import org.bukkit.plugin.ServicesManager; +-import org.bukkit.plugin.SimplePluginManager; +-import org.bukkit.plugin.SimpleServicesManager; ++import org.bukkit.plugin.*; + import org.bukkit.plugin.java.JavaPluginLoader; + import org.bukkit.plugin.messaging.Messenger; + import org.bukkit.plugin.messaging.StandardMessenger; +@@ -211,10 +86,17 @@ import org.yaml.snakeyaml.Yaml; + import org.yaml.snakeyaml.constructor.SafeConstructor; + import org.yaml.snakeyaml.error.MarkedYAMLException; + +-import net.md_5.bungee.api.chat.BaseComponent; // Spigot +- +-import javax.annotation.Nullable; // Paper +-import javax.annotation.Nonnull; // Paper ++import javax.annotation.Nonnull; ++import javax.annotation.Nullable; ++import javax.imageio.ImageIO; ++import java.awt.image.BufferedImage; ++import java.io.*; ++import java.nio.ByteBuffer; ++import java.nio.charset.StandardCharsets; ++import java.util.*; ++import java.util.function.Consumer; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + public final class CraftServer implements Server { + private final String serverName = "Yatopia"; // Paper // Tuinity // Yatopia +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java +index 2758eee2be30ce7df40a98d396b0a810b00d703a..2a0d035b7c16ac96213319a963dc9da253fa219f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java +@@ -3,13 +3,7 @@ package org.bukkit.craftbukkit; + import com.google.common.base.Preconditions; + import com.google.common.collect.BiMap; + import com.google.common.collect.ImmutableBiMap; +-import net.minecraft.server.Block; +-import net.minecraft.server.EntityTypes; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.Item; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.ServerStatisticManager; +-import net.minecraft.server.StatisticList; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.Material; + import org.bukkit.Statistic; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 077f4793cd121701ea3912a1f601508827fa98dc..ad8627fd5e04d93ba78f0e0dbeba956f1d5d9fee 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -5,112 +5,15 @@ import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap; +-import java.io.File; +-import java.io.IOException; +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.Objects; +-import java.util.Random; +-import java.util.Set; +-import java.util.UUID; +-import java.util.concurrent.CompletableFuture; +-import java.util.function.Predicate; +-import java.util.stream.Collectors; +-import net.minecraft.server.ArraySetSorted; +-import net.minecraft.server.AxisAlignedBB; +-import net.minecraft.server.BiomeBase; +-import net.minecraft.server.BiomeDecoratorGroups; +-import net.minecraft.server.BlockChorusFlower; +-import net.minecraft.server.BlockDiodeAbstract; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.Blocks; +-import net.minecraft.server.ChunkCoordIntPair; +-import net.minecraft.server.ChunkMapDistance; +-import net.minecraft.server.ChunkStatus; +-import net.minecraft.server.EntityAreaEffectCloud; +-import net.minecraft.server.EntityArmorStand; +-import net.minecraft.server.EntityArrow; +-import net.minecraft.server.EntityBoat; +-import net.minecraft.server.EntityEgg; +-import net.minecraft.server.EntityEnderSignal; +-import net.minecraft.server.EntityEvokerFangs; +-import net.minecraft.server.EntityExperienceOrb; +-import net.minecraft.server.EntityFallingBlock; +-import net.minecraft.server.EntityFireball; +-import net.minecraft.server.EntityFireworks; +-import net.minecraft.server.EntityHanging; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.EntityInsentient; +-import net.minecraft.server.EntityItem; +-import net.minecraft.server.EntityItemFrame; +-import net.minecraft.server.EntityLeash; +-import net.minecraft.server.EntityLightning; +-import net.minecraft.server.EntityMinecartChest; +-import net.minecraft.server.EntityMinecartCommandBlock; +-import net.minecraft.server.EntityMinecartFurnace; +-import net.minecraft.server.EntityMinecartHopper; +-import net.minecraft.server.EntityMinecartMobSpawner; +-import net.minecraft.server.EntityMinecartRideable; +-import net.minecraft.server.EntityMinecartTNT; +-import net.minecraft.server.EntityPainting; +-import net.minecraft.server.EntityPotion; +-import net.minecraft.server.EntitySnowball; +-import net.minecraft.server.EntityTNTPrimed; +-import net.minecraft.server.EntityTippedArrow; +-import net.minecraft.server.EntityTypes; +-import net.minecraft.server.EntityZombie; +-import net.minecraft.server.EnumDifficulty; +-import net.minecraft.server.EnumDirection; +-import net.minecraft.server.EnumMobSpawn; +-import net.minecraft.server.Explosion; +-import net.minecraft.server.GameRules; +-import net.minecraft.server.GroupDataEntity; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IChunkAccess; +-import net.minecraft.server.MCUtil; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.MovingObjectPosition; +-import net.minecraft.server.PacketPlayOutCustomSoundEffect; +-import net.minecraft.server.PacketPlayOutUpdateTime; +-import net.minecraft.server.PacketPlayOutWorldEvent; +-import net.minecraft.server.PersistentRaid; +-import net.minecraft.server.PlayerChunk; +-import net.minecraft.server.ProtoChunkExtension; +-import net.minecraft.server.RayTrace; +-import net.minecraft.server.SavedFile; + import net.minecraft.server.SoundCategory; +-import net.minecraft.server.StructureGenerator; +-import net.minecraft.server.Ticket; +-import net.minecraft.server.TicketType; +-import net.minecraft.server.Unit; +-import net.minecraft.server.Vec3D; +-import net.minecraft.server.WorldGenFeatureHugeFungiConfiguration; +-import net.minecraft.server.WorldGenerator; +-import net.minecraft.server.WorldServer; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; +-import org.bukkit.BlockChangeDelegate; +-import org.bukkit.Bukkit; + import org.bukkit.Chunk; +-import org.bukkit.ChunkSnapshot; +-import org.bukkit.Difficulty; +-import org.bukkit.Effect; +-import org.bukkit.FluidCollisionMode; +-import org.bukkit.GameRule; +-import org.bukkit.Location; + import org.bukkit.Particle; + import org.bukkit.Raid; +-import org.bukkit.Sound; +-import org.bukkit.StructureType; +-import org.bukkit.TreeType; + import org.bukkit.World; + import org.bukkit.WorldBorder; ++import org.bukkit.*; + import org.bukkit.block.Biome; + import org.bukkit.block.Block; + import org.bukkit.block.BlockFace; +@@ -128,129 +31,9 @@ import org.bukkit.craftbukkit.metadata.BlockMetadataStore; + import org.bukkit.craftbukkit.potion.CraftPotionUtil; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.craftbukkit.util.CraftRayTraceResult; +-import org.bukkit.entity.AbstractArrow; +-import org.bukkit.entity.AbstractHorse; +-import org.bukkit.entity.AbstractVillager; +-import org.bukkit.entity.Ambient; +-import org.bukkit.entity.AreaEffectCloud; +-import org.bukkit.entity.ArmorStand; +-import org.bukkit.entity.Arrow; +-import org.bukkit.entity.Bat; +-import org.bukkit.entity.Bee; +-import org.bukkit.entity.Blaze; +-import org.bukkit.entity.Boat; +-import org.bukkit.entity.Cat; +-import org.bukkit.entity.CaveSpider; +-import org.bukkit.entity.ChestedHorse; +-import org.bukkit.entity.Chicken; +-import org.bukkit.entity.Cod; +-import org.bukkit.entity.ComplexLivingEntity; +-import org.bukkit.entity.Cow; +-import org.bukkit.entity.Creeper; +-import org.bukkit.entity.Dolphin; +-import org.bukkit.entity.Donkey; +-import org.bukkit.entity.DragonFireball; +-import org.bukkit.entity.Drowned; +-import org.bukkit.entity.Egg; +-import org.bukkit.entity.ElderGuardian; +-import org.bukkit.entity.EnderCrystal; +-import org.bukkit.entity.EnderDragon; +-import org.bukkit.entity.EnderPearl; +-import org.bukkit.entity.EnderSignal; +-import org.bukkit.entity.Enderman; +-import org.bukkit.entity.Endermite; + import org.bukkit.entity.Entity; +-import org.bukkit.entity.EntityType; +-import org.bukkit.entity.Evoker; +-import org.bukkit.entity.EvokerFangs; +-import org.bukkit.entity.ExperienceOrb; +-import org.bukkit.entity.FallingBlock; +-import org.bukkit.entity.Fireball; +-import org.bukkit.entity.Firework; +-import org.bukkit.entity.Fish; +-import org.bukkit.entity.Fox; +-import org.bukkit.entity.Ghast; +-import org.bukkit.entity.Giant; +-import org.bukkit.entity.Golem; +-import org.bukkit.entity.Guardian; +-import org.bukkit.entity.Hanging; +-import org.bukkit.entity.Hoglin; +-import org.bukkit.entity.HumanEntity; +-import org.bukkit.entity.Husk; +-import org.bukkit.entity.Illager; +-import org.bukkit.entity.Illusioner; +-import org.bukkit.entity.IronGolem; +-import org.bukkit.entity.ItemFrame; +-import org.bukkit.entity.LeashHitch; +-import org.bukkit.entity.LightningStrike; +-import org.bukkit.entity.LingeringPotion; +-import org.bukkit.entity.LivingEntity; +-import org.bukkit.entity.Llama; +-import org.bukkit.entity.LlamaSpit; +-import org.bukkit.entity.MagmaCube; +-import org.bukkit.entity.Minecart; +-import org.bukkit.entity.Mule; +-import org.bukkit.entity.MushroomCow; +-import org.bukkit.entity.Ocelot; +-import org.bukkit.entity.Painting; +-import org.bukkit.entity.Panda; +-import org.bukkit.entity.Parrot; +-import org.bukkit.entity.Phantom; +-import org.bukkit.entity.Pig; +-import org.bukkit.entity.PigZombie; +-import org.bukkit.entity.Piglin; +-import org.bukkit.entity.Pillager; +-import org.bukkit.entity.Player; +-import org.bukkit.entity.PolarBear; +-import org.bukkit.entity.Projectile; +-import org.bukkit.entity.PufferFish; +-import org.bukkit.entity.Rabbit; +-import org.bukkit.entity.Ravager; +-import org.bukkit.entity.Salmon; +-import org.bukkit.entity.Sheep; +-import org.bukkit.entity.Shulker; +-import org.bukkit.entity.ShulkerBullet; +-import org.bukkit.entity.Silverfish; +-import org.bukkit.entity.Skeleton; +-import org.bukkit.entity.SkeletonHorse; +-import org.bukkit.entity.Slime; +-import org.bukkit.entity.SmallFireball; +-import org.bukkit.entity.Snowball; +-import org.bukkit.entity.Snowman; +-import org.bukkit.entity.SpectralArrow; +-import org.bukkit.entity.Spellcaster; +-import org.bukkit.entity.Spider; +-import org.bukkit.entity.Squid; +-import org.bukkit.entity.Stray; +-import org.bukkit.entity.Strider; +-import org.bukkit.entity.TNTPrimed; +-import org.bukkit.entity.Tameable; +-import org.bukkit.entity.ThrownExpBottle; +-import org.bukkit.entity.ThrownPotion; +-import org.bukkit.entity.TippedArrow; +-import org.bukkit.entity.TraderLlama; +-import org.bukkit.entity.Trident; +-import org.bukkit.entity.TropicalFish; +-import org.bukkit.entity.Turtle; +-import org.bukkit.entity.Vex; +-import org.bukkit.entity.Villager; +-import org.bukkit.entity.Vindicator; +-import org.bukkit.entity.WanderingTrader; +-import org.bukkit.entity.Witch; +-import org.bukkit.entity.Wither; +-import org.bukkit.entity.WitherSkeleton; +-import org.bukkit.entity.WitherSkull; +-import org.bukkit.entity.Wolf; +-import org.bukkit.entity.Zoglin; +-import org.bukkit.entity.Zombie; +-import org.bukkit.entity.ZombieHorse; +-import org.bukkit.entity.ZombieVillager; +-import org.bukkit.entity.minecart.CommandMinecart; +-import org.bukkit.entity.minecart.ExplosiveMinecart; +-import org.bukkit.entity.minecart.HopperMinecart; +-import org.bukkit.entity.minecart.PoweredMinecart; +-import org.bukkit.entity.minecart.SpawnerMinecart; +-import org.bukkit.entity.minecart.StorageMinecart; ++import org.bukkit.entity.*; ++import org.bukkit.entity.minecart.*; + import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; + import org.bukkit.event.world.SpawnChangeEvent; + import org.bukkit.event.world.TimeSkipEvent; +@@ -268,6 +51,12 @@ import org.bukkit.util.Consumer; + import org.bukkit.util.RayTraceResult; + import org.bukkit.util.Vector; + ++import java.io.File; ++import java.io.IOException; ++import java.util.*; ++import java.util.concurrent.CompletableFuture; ++import java.util.function.Predicate; ++ + public class CraftWorld implements World { + public static final int CUSTOM_DIMENSION_OFFSET = 10; + +diff --git a/src/main/java/org/bukkit/craftbukkit/LoggerOutputStream.java b/src/main/java/org/bukkit/craftbukkit/LoggerOutputStream.java +index 93526ab602afe9640c73cd70c619065d86dc1abe..acaaee6cace19b751775e98cafe451345bd7489f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/LoggerOutputStream.java ++++ b/src/main/java/org/bukkit/craftbukkit/LoggerOutputStream.java +@@ -1,10 +1,11 @@ + package org.bukkit.craftbukkit; + +-import java.io.ByteArrayOutputStream; +-import java.io.IOException; + import org.apache.logging.log4j.Level; + import org.apache.logging.log4j.Logger; + ++import java.io.ByteArrayOutputStream; ++import java.io.IOException; ++ + public class LoggerOutputStream extends ByteArrayOutputStream { + private final String separator = System.getProperty("line.separator"); + private final Logger logger; +diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java +index 6820905bf16eb4e8a97615a7ef49b6d3337ab247..2c7d17ca65ca8444101de83008d546e65a4ae9e6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/Main.java ++++ b/src/main/java/org/bukkit/craftbukkit/Main.java +@@ -1,5 +1,9 @@ + package org.bukkit.craftbukkit; + ++import joptsimple.OptionParser; ++import joptsimple.OptionSet; ++import net.minecrell.terminalconsole.TerminalConsoleAppender; ++ + import java.io.File; + import java.io.IOException; + import java.text.SimpleDateFormat; +@@ -7,12 +11,8 @@ import java.util.Arrays; + import java.util.Calendar; + import java.util.Date; + import java.util.List; +-import java.util.concurrent.TimeUnit; + import java.util.logging.Level; + import java.util.logging.Logger; +-import joptsimple.OptionParser; +-import joptsimple.OptionSet; +-import net.minecrell.terminalconsole.TerminalConsoleAppender; // Paper + + public class Main { + public static boolean useJline = true; +diff --git a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java +index a5aadf2850f273e258f84b6c7bc9ca3649fb884d..11630549332ca910fa6ec82f8b0e58001b619140 100644 +--- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java ++++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java +@@ -1,11 +1,12 @@ + package org.bukkit.craftbukkit.advancement; + +-import java.util.Collection; +-import java.util.Collections; + import net.minecraft.server.Advancement; + import org.bukkit.NamespacedKey; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; + ++import java.util.Collection; ++import java.util.Collections; ++ + public class CraftAdvancement implements org.bukkit.advancement.Advancement { + + private final Advancement handle; +diff --git a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementProgress.java b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementProgress.java +index 60fc5aff80697cb4c85080350542c0f46056f74a..0f261a3b6bcee776ac9c691e05209909fde202f1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementProgress.java ++++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementProgress.java +@@ -1,14 +1,15 @@ + package org.bukkit.craftbukkit.advancement; + + import com.google.common.collect.Lists; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.Date; + import net.minecraft.server.AdvancementDataPlayer; + import net.minecraft.server.CriterionProgress; + import org.bukkit.advancement.Advancement; + import org.bukkit.advancement.AdvancementProgress; + ++import java.util.Collection; ++import java.util.Collections; ++import java.util.Date; ++ + public class CraftAdvancementProgress implements AdvancementProgress { + + private final CraftAdvancement advancement; +diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java +index a7c500323b52b532edf1f7fbaa0637efa527a4e8..6ac92a6b87edfb232efcc3881bfce385f10eb76f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java ++++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java +@@ -1,13 +1,14 @@ + package org.bukkit.craftbukkit.attribute; + + import com.google.common.base.Preconditions; +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.List; + import org.bukkit.attribute.Attribute; + import org.bukkit.attribute.AttributeInstance; + import org.bukkit.attribute.AttributeModifier; + ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.List; ++ + public class CraftAttributeInstance implements AttributeInstance { + + private final net.minecraft.server.AttributeModifiable handle; +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java +index 27bd1916e060bcf8989597f1594c129131fd0aed..bb537efd2f7916e4e9bb258fcff41d1a2aff6103 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java +@@ -1,16 +1,11 @@ + package org.bukkit.craftbukkit.block; + +-import java.util.Random; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.EntityBee; +-import net.minecraft.server.EntityTypes; +-import net.minecraft.server.GeneratorAccess; +-import net.minecraft.server.TileEntity; +-import net.minecraft.server.TileEntityBeehive; +-import net.minecraft.server.World; ++import net.minecraft.server.*; + import org.bukkit.Material; + import org.bukkit.block.Block; + ++import java.util.Random; ++ + public final class CapturedBlockState extends CraftBlockState { + + private final boolean treeBlock; +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java +index 754205636b02f388ce5e885258b228f8a373a9f5..f98a342ef107799f8f47dc54908fbd4437d1d039 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java +@@ -1,13 +1,7 @@ + package org.bukkit.craftbukkit.block; + + import com.google.common.base.Preconditions; +-import java.util.ArrayList; +-import java.util.List; +-import net.minecraft.server.BlockBannerAbstract; +-import net.minecraft.server.EnumColor; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.NBTTagList; +-import net.minecraft.server.TileEntityBanner; ++import net.minecraft.server.*; + import org.bukkit.DyeColor; + import org.bukkit.Material; + import org.bukkit.block.Banner; +@@ -15,6 +9,9 @@ import org.bukkit.block.Block; + import org.bukkit.block.banner.Pattern; + import org.bukkit.block.banner.PatternType; + ++import java.util.ArrayList; ++import java.util.List; ++ + public class CraftBanner extends CraftBlockEntityState implements Banner { + + private DyeColor base; +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +index 21ebceafbf27125761aa08cfe0785f6f05c77592..f65a2c602d7fd46d8c2d6d3810ed0d45475f66c5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +@@ -1,12 +1,6 @@ + package org.bukkit.craftbukkit.block; + +-import java.util.ArrayList; +-import java.util.Collection; +-import net.minecraft.server.ChestLock; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.MobEffectList; +-import net.minecraft.server.TileEntity; +-import net.minecraft.server.TileEntityBeacon; ++import net.minecraft.server.*; + import org.bukkit.Material; + import org.bukkit.block.Beacon; + import org.bukkit.block.Block; +@@ -15,6 +9,9 @@ import org.bukkit.entity.LivingEntity; + import org.bukkit.potion.PotionEffect; + import org.bukkit.potion.PotionEffectType; + ++import java.util.ArrayList; ++import java.util.Collection; ++ + public class CraftBeacon extends CraftBlockEntityState implements Beacon { + + public CraftBeacon(final Block block) { +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java +index 0ffec81155fcf80b80360ffa8e4a6895095f84d7..70bacea68ed0286c5a746a24cafa222673449743 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.block; + + import com.google.common.base.Preconditions; +-import java.util.ArrayList; +-import java.util.List; + import net.minecraft.server.BlockPosition; + import net.minecraft.server.Entity; + import net.minecraft.server.TileEntityBeehive; +@@ -14,6 +12,9 @@ import org.bukkit.block.Block; + import org.bukkit.craftbukkit.entity.CraftBee; + import org.bukkit.entity.Bee; + ++import java.util.ArrayList; ++import java.util.List; ++ + public class CraftBeehive extends CraftBlockEntityState implements Beehive { + + public CraftBeehive(final Block block) { +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +index 6a681a8efc64417b0a2945d8fe3c1287c7d5e358..bbe1cb40f188a65e0a4665f6ca8bbab25311b03d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +@@ -1,41 +1,14 @@ + package org.bukkit.craftbukkit.block; + + import com.google.common.base.Preconditions; +- +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.Collections; +-import java.util.List; +-import java.util.stream.Collectors; +-import net.minecraft.server.AxisAlignedBB; +-import net.minecraft.server.BiomeBase; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.BlockRedstoneWire; +-import net.minecraft.server.BlockTileEntity; +-import net.minecraft.server.Blocks; +-import net.minecraft.server.EnumDirection; +-import net.minecraft.server.EnumSkyBlock; +-import net.minecraft.server.GeneratorAccess; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.MovingObjectPosition; +-import net.minecraft.server.RayTrace; +-import net.minecraft.server.TileEntity; +-import net.minecraft.server.Vec3D; +-import net.minecraft.server.VoxelShape; +-import net.minecraft.server.WorldServer; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.Chunk; +-import org.bukkit.FluidCollisionMode; +-import org.bukkit.Location; + import org.bukkit.Material; + import org.bukkit.World; +-import org.bukkit.block.Biome; ++import org.bukkit.*; + import org.bukkit.block.Block; +-import org.bukkit.block.BlockFace; +-import org.bukkit.block.BlockState; +-import org.bukkit.block.PistonMoveReaction; ++import org.bukkit.block.*; + import org.bukkit.block.data.BlockData; + import org.bukkit.craftbukkit.CraftFluidCollisionMode; + import org.bukkit.craftbukkit.CraftWorld; +@@ -53,6 +26,11 @@ import org.bukkit.util.BoundingBox; + import org.bukkit.util.RayTraceResult; + import org.bukkit.util.Vector; + ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.Collections; ++import java.util.List; ++ + public class CraftBlock implements Block { + private final net.minecraft.server.GeneratorAccess world; + private final BlockPosition position; +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +index c51c43573faa33ca5a10e76cb0f6aa9bc301f118..a3380b9bc574ebd77c31f7d275a17d1f7ec8bc38 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.block; + + import com.google.common.base.Preconditions; +-import java.util.List; + import net.minecraft.server.BlockPosition; + import net.minecraft.server.GeneratorAccess; + import net.minecraft.server.IBlockData; +@@ -12,7 +11,6 @@ import org.bukkit.World; + import org.bukkit.block.Block; + import org.bukkit.block.BlockState; + import org.bukkit.block.data.BlockData; +-import org.bukkit.craftbukkit.CraftChunk; + import org.bukkit.craftbukkit.CraftWorld; + import org.bukkit.craftbukkit.block.data.CraftBlockData; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; +@@ -21,6 +19,8 @@ import org.bukkit.material.MaterialData; + import org.bukkit.metadata.MetadataValue; + import org.bukkit.plugin.Plugin; + ++import java.util.List; ++ + public class CraftBlockState implements BlockState { + protected final CraftWorld world; + private final BlockPosition position; +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +index 31585e9bb825fbd84e30b7c026da57734a3698b3..251ad6ef51ed58ef9e7bb818e281d106a266cf56 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +@@ -1,10 +1,7 @@ + package org.bukkit.craftbukkit.block; + +-import net.minecraft.server.BlockChest; +-import net.minecraft.server.Blocks; +-import net.minecraft.server.ITileInventory; +-import net.minecraft.server.SoundEffects; +-import net.minecraft.server.TileEntityChest; ++import com.destroystokyo.paper.loottable.PaperLootableBlockInventory; ++import net.minecraft.server.*; + import org.bukkit.Material; + import org.bukkit.block.Block; + import org.bukkit.block.Chest; +@@ -12,7 +9,6 @@ import org.bukkit.craftbukkit.CraftWorld; + import org.bukkit.craftbukkit.inventory.CraftInventory; + import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest; + import org.bukkit.inventory.Inventory; +-import com.destroystokyo.paper.loottable.PaperLootableBlockInventory; // Paper + + public class CraftChest extends CraftLootable implements Chest, PaperLootableBlockInventory { // Paper + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftEndGateway.java b/src/main/java/org/bukkit/craftbukkit/block/CraftEndGateway.java +index 54287744e1385fe74a80e3f04d2cdc20f37e5541..90efa1220ddb6f3a562f96a862c922936a828272 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftEndGateway.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftEndGateway.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.block; + +-import java.util.Objects; + import net.minecraft.server.BlockPosition; + import net.minecraft.server.TileEntityEndGateway; + import org.bukkit.Location; +@@ -8,6 +7,8 @@ import org.bukkit.Material; + import org.bukkit.block.Block; + import org.bukkit.block.EndGateway; + ++import java.util.Objects; ++ + public class CraftEndGateway extends CraftBlockEntityState implements EndGateway { + + public CraftEndGateway(Block block) { +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java +index 6f20b9ac76bc0d9f5f7c769af39103f4ac8d5ae7..035447cf0bdab65e4b835fbbebe496dbf1e6fdee 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java +@@ -1,10 +1,6 @@ + package org.bukkit.craftbukkit.block; + +-import net.minecraft.server.BlockJukeBox; +-import net.minecraft.server.Blocks; +-import net.minecraft.server.ItemStack; +-import net.minecraft.server.TileEntity; +-import net.minecraft.server.TileEntityJukeBox; ++import net.minecraft.server.*; + import org.bukkit.Effect; + import org.bukkit.Material; + import org.bukkit.block.Block; +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java +index 10bc0b0944bdd7f6db2bb2cd4f329be0e23e3cea..fb9e71f57543f840b41918c9c9ff991511385032 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java +@@ -1,10 +1,6 @@ + package org.bukkit.craftbukkit.block; + +-import net.minecraft.server.BlockShulkerBox; +-import net.minecraft.server.SoundCategory; +-import net.minecraft.server.SoundEffects; +-import net.minecraft.server.TileEntityShulkerBox; +-import net.minecraft.server.World; ++import net.minecraft.server.*; + import org.bukkit.DyeColor; + import org.bukkit.Material; + import org.bukkit.block.Block; +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +index ecc32c2fb1e8e1ac03074102b982adb4cda169db..c6a20a2a121597ad8aada3e023d3195f412ab030 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +@@ -17,6 +17,7 @@ import org.bukkit.block.data.BlockData; + import org.bukkit.block.data.Directional; + import org.bukkit.block.data.Rotatable; + import org.bukkit.craftbukkit.entity.CraftPlayer; ++ + import javax.annotation.Nullable; + + public class CraftSkull extends CraftBlockEntityState implements Skull { +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftStructureBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftStructureBlock.java +index 15e01f615e5f7bf5f611159a3d529e8c78cdd84e..1a059ecb93ade09e723527d7cd58e3530e66ee8f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftStructureBlock.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftStructureBlock.java +@@ -1,11 +1,7 @@ + package org.bukkit.craftbukkit.block; + + import com.google.common.base.Preconditions; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.BlockPropertyStructureMode; +-import net.minecraft.server.EnumBlockMirror; +-import net.minecraft.server.EnumBlockRotation; +-import net.minecraft.server.TileEntityStructure; ++import net.minecraft.server.*; + import org.apache.commons.lang3.Validate; + import org.bukkit.Material; + import org.bukkit.block.Block; +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +index 4045e3c194048d66ada0a15a9c208f8dbac5285e..782c50c392222bb47de7c16b569257df4ed0d04c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -7,29 +7,18 @@ import com.google.common.collect.HashBiMap; + import com.google.common.collect.ImmutableSet; + import com.mojang.brigadier.StringReader; + import com.mojang.brigadier.exceptions.CommandSyntaxException; +-import java.util.HashMap; +-import java.util.Map; +-import java.util.Set; +-import java.util.StringJoiner; +-import java.util.stream.Collectors; +-import net.minecraft.server.ArgumentBlock; +-import net.minecraft.server.Block; +-import net.minecraft.server.BlockStateBoolean; +-import net.minecraft.server.BlockStateEnum; +-import net.minecraft.server.BlockStateInteger; +-import net.minecraft.server.EnumDirection; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IBlockDataHolder; +-import net.minecraft.server.IBlockState; +-import net.minecraft.server.INamable; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.NBTTagCompound; ++import net.minecraft.server.*; + import org.bukkit.Material; + import org.bukkit.block.BlockFace; + import org.bukkit.block.data.BlockData; + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + ++import java.util.HashMap; ++import java.util.Map; ++import java.util.Set; ++import java.util.StringJoiner; ++ + public class CraftBlockData implements BlockData { + + private IBlockData state; +diff --git a/src/main/java/org/bukkit/craftbukkit/boss/CraftBossBar.java b/src/main/java/org/bukkit/craftbukkit/boss/CraftBossBar.java +index 7771cd6d04f08c4756cbb157d6c04bbb2fc960f9..f9c2d38fd9b329ae77c116ee12f02a5ec9e2f7fb 100644 +--- a/src/main/java/org/bukkit/craftbukkit/boss/CraftBossBar.java ++++ b/src/main/java/org/bukkit/craftbukkit/boss/CraftBossBar.java +@@ -2,11 +2,6 @@ package org.bukkit.craftbukkit.boss; + + import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableList; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.function.Consumer; +-import java.util.function.Supplier; + import net.minecraft.server.BossBattle; + import net.minecraft.server.BossBattleServer; + import net.minecraft.server.EntityPlayer; +@@ -19,6 +14,12 @@ import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.bukkit.craftbukkit.util.CraftChatMessage; + import org.bukkit.entity.Player; + ++import java.util.HashMap; ++import java.util.List; ++import java.util.Map; ++import java.util.function.Consumer; ++import java.util.function.Supplier; ++ + public class CraftBossBar implements BossBar { + + private final BossBattleServer handle; +diff --git a/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java +index e16ecdea7d27424053b3f21378af054b2f808eca..08090858492b3a4788a0156e1ca1ba85c992544d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java +@@ -10,13 +10,14 @@ import com.mojang.brigadier.suggestion.SuggestionProvider; + import com.mojang.brigadier.suggestion.Suggestions; + import com.mojang.brigadier.suggestion.SuggestionsBuilder; + import com.mojang.brigadier.tree.LiteralCommandNode; +-import java.util.List; +-import java.util.concurrent.CompletableFuture; +-import java.util.function.Predicate; + import net.minecraft.server.CommandListenerWrapper; + import org.bukkit.command.Command; + import org.bukkit.craftbukkit.CraftServer; + ++import java.util.List; ++import java.util.concurrent.CompletableFuture; ++import java.util.function.Predicate; ++ + public class BukkitCommandWrapper implements com.mojang.brigadier.Command, Predicate, SuggestionProvider, com.destroystokyo.paper.brigadier.BukkitBrigadierCommand { // Paper + + private final CraftServer server; +diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java +index 88acfeb8fa1a82f7a896a181ac57b435454656df..cf8b91e77fe400bf122e70c6a7cc146cf968442b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java +@@ -1,12 +1,5 @@ + package org.bukkit.craftbukkit.command; + +-import java.util.EnumMap; +-import java.util.Map; +-//import jline.Terminal; +-import org.bukkit.Bukkit; +-import org.bukkit.ChatColor; +-import org.bukkit.command.ConsoleCommandSender; +-import org.bukkit.craftbukkit.CraftServer; + //import org.fusesource.jansi.Ansi; + //import org.fusesource.jansi.Ansi.Attribute; + +diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +index f276cdcaacc2fd2650a2ddccbbf190421a20c2bd..fa3755aa9bb206bbcdab124741f6d6c2551fd033 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +@@ -1,21 +1,19 @@ + package org.bukkit.craftbukkit.command; + +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.List; +-import java.util.concurrent.ExecutionException; +-import java.util.logging.Level; ++import net.minecraft.server.DedicatedServer; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.util.Waitable; +- +-// Paper start - JLine update +-import net.minecraft.server.DedicatedServer; // Paper ++import org.bukkit.event.server.TabCompleteEvent; + import org.jline.reader.Candidate; + import org.jline.reader.Completer; + import org.jline.reader.LineReader; + import org.jline.reader.ParsedLine; +-// Paper end +-import org.bukkit.event.server.TabCompleteEvent; ++ ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.List; ++import java.util.concurrent.ExecutionException; ++import java.util.logging.Level; + + public class ConsoleCommandCompleter implements Completer { + private final DedicatedServer server; // Paper - CraftServer -> DedicatedServer +diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftCommandMap.java b/src/main/java/org/bukkit/craftbukkit/command/CraftCommandMap.java +index 2fd69c0f915f1c3cb1c410d5dab0498f05d5c888..e8902262eb0edb422d3fd052bae2e0ef638b64ee 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/CraftCommandMap.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/CraftCommandMap.java +@@ -1,10 +1,11 @@ + package org.bukkit.craftbukkit.command; + +-import java.util.Map; + import org.bukkit.Server; + import org.bukkit.command.Command; + import org.bukkit.command.SimpleCommandMap; + ++import java.util.Map; ++ + public class CraftCommandMap extends SimpleCommandMap { + + public CraftCommandMap(Server server) { +diff --git a/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java +index ce2c5c38c3df124ca1569cbd7cec62a9cf11f3d5..563e01a9bd187030aea586856df141a871638435 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java +@@ -1,7 +1,6 @@ + + package org.bukkit.craftbukkit.command; + +-import java.util.Set; + import net.minecraft.server.CommandListenerWrapper; + import org.bukkit.Server; + import org.bukkit.command.CommandSender; +@@ -11,6 +10,8 @@ import org.bukkit.permissions.PermissionAttachment; + import org.bukkit.permissions.PermissionAttachmentInfo; + import org.bukkit.plugin.Plugin; + ++import java.util.Set; ++ + public class ProxiedNativeCommandSender implements ProxiedCommandSender { + + private final CommandListenerWrapper orig; +diff --git a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java +index 9776746a0a45a8e60b22c6a72ba91572c33922ff..e512df675cc01a7ff5d50cdec0ba08f23b454d6e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.command; + +-import java.util.Set; + import org.bukkit.Bukkit; + import org.bukkit.Server; + import org.bukkit.command.CommandSender; +@@ -10,6 +9,8 @@ import org.bukkit.permissions.PermissionAttachment; + import org.bukkit.permissions.PermissionAttachmentInfo; + import org.bukkit.plugin.Plugin; + ++import java.util.Set; ++ + public abstract class ServerCommandSender implements CommandSender { + private static PermissibleBase blockPermInst; + private final PermissibleBase perm; +diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +index 3c610a889f371f54b0f456266d14538fc3ff03ac..9f7ead4c0fc24fb7412a4164741a3fd57617e198 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +@@ -4,21 +4,10 @@ import com.google.common.base.Joiner; + import com.mojang.brigadier.ParseResults; + import com.mojang.brigadier.suggestion.Suggestion; + import com.mojang.brigadier.tree.CommandNode; +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.List; +-import net.minecraft.server.CommandDispatcher; +-import net.minecraft.server.CommandListenerWrapper; +-import net.minecraft.server.DedicatedServer; +-import net.minecraft.server.EntityMinecartCommandBlock; +-import net.minecraft.server.MinecraftServer; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.Location; +-import org.bukkit.command.BlockCommandSender; +-import org.bukkit.command.CommandSender; +-import org.bukkit.command.ConsoleCommandSender; +-import org.bukkit.command.ProxiedCommandSender; +-import org.bukkit.command.RemoteConsoleCommandSender; ++import org.bukkit.command.*; + import org.bukkit.command.defaults.BukkitCommand; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.entity.CraftMinecartCommand; +@@ -26,6 +15,10 @@ import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.bukkit.entity.Player; + import org.bukkit.entity.minecart.CommandMinecart; + ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.List; ++ + public final class VanillaCommandWrapper extends BukkitCommand { + + private final CommandDispatcher dispatcher; +diff --git a/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java b/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java +index 72127dde54cd9f128b83a44d9fcdd1f9014f49a1..0e584c04c8deb199e573e6eefb3dcfe5eec7d54c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java ++++ b/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java +@@ -1,12 +1,13 @@ + package org.bukkit.craftbukkit.conversations; + +-import java.util.LinkedList; +-import java.util.logging.Level; + import org.bukkit.Bukkit; + import org.bukkit.conversations.Conversation; + import org.bukkit.conversations.ConversationAbandonedEvent; + import org.bukkit.conversations.ManuallyAbandonedConversationCanceller; + ++import java.util.LinkedList; ++import java.util.logging.Level; ++ + /** + */ + public class ConversationTracker { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +index 218a2190d1203ca0fbc2a5ad87e145f436aac314..ed3ff7880a075fdab86098b198b10add9dfd6684 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +@@ -1,17 +1,17 @@ + package org.bukkit.craftbukkit.entity; + +-import java.util.UUID; + import net.minecraft.server.EntityHorseAbstract; + import net.minecraft.server.GenericAttributes; + import org.apache.commons.lang.Validate; + import org.bukkit.craftbukkit.CraftServer; +-import org.bukkit.craftbukkit.inventory.CraftInventoryAbstractHorse; + import org.bukkit.craftbukkit.inventory.CraftSaddledInventory; + import org.bukkit.entity.AbstractHorse; + import org.bukkit.entity.AnimalTamer; + import org.bukkit.entity.Horse; + import org.bukkit.inventory.AbstractHorseInventory; + ++import java.util.UUID; ++ + public abstract class CraftAbstractHorse extends CraftAnimals implements AbstractHorse { + + public CraftAbstractHorse(CraftServer server, EntityHorseAbstract entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java +index 18520fec054b3bcdf73aaca95c665e7a1254b76f..c6ba1e913868dfb41fea539d284fad3d17f46282 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.entity; + +-import java.util.List; + import net.minecraft.server.EntityVillager; + import net.minecraft.server.EntityVillagerAbstract; + import org.bukkit.craftbukkit.CraftServer; +@@ -12,6 +11,8 @@ import org.bukkit.inventory.Inventory; + import org.bukkit.inventory.InventoryHolder; + import org.bukkit.inventory.MerchantRecipe; + ++import java.util.List; ++ + public class CraftAbstractVillager extends CraftAgeable implements AbstractVillager, InventoryHolder { + + public CraftAbstractVillager(CraftServer server, EntityVillagerAbstract entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java +index 599db583b19fb085d55319903e35b853d1d3719e..d7b8ae59d32bf76fdb5060b384f9fb39692ab4dd 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java +@@ -1,11 +1,12 @@ + package org.bukkit.craftbukkit.entity; + + import com.google.common.base.Preconditions; +-import java.util.UUID; + import net.minecraft.server.EntityAnimal; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.entity.Animals; + ++import java.util.UUID; ++ + public class CraftAnimals extends CraftAgeable implements Animals { + + public CraftAnimals(CraftServer server, EntityAnimal entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java +index ab6cbf560040a3650ac6320659897cb0c8ecec6d..6593347c49963a70be100a109be9d3aa934b572d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.entity; + + import com.google.common.collect.ImmutableList; +-import java.util.List; + import net.minecraft.server.EntityAreaEffectCloud; + import net.minecraft.server.EntityLiving; + import net.minecraft.server.MobEffect; +@@ -20,6 +19,8 @@ import org.bukkit.potion.PotionEffect; + import org.bukkit.potion.PotionEffectType; + import org.bukkit.projectiles.ProjectileSource; + ++import java.util.List; ++ + public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud { + + public CraftAreaEffectCloud(CraftServer server, EntityAreaEffectCloud entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java +index 4947249da2d507163de90f92ff59d9b08213eafd..66c618dff4787a0fad0e8c6c9933838dd1c589ba 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.entity; + + import net.minecraft.server.EntityInsentient; +-import net.minecraft.server.EntityLiving; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.entity.ComplexLivingEntity; + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java +index e8eb5f9f269effcc369237491ed543e17119afdb..289f231d1fbf2922a9d5bca96485e08659ff9a9c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java +@@ -2,7 +2,6 @@ package org.bukkit.craftbukkit.entity; + + import com.google.common.collect.ImmutableSet; + import com.google.common.collect.ImmutableSet.Builder; +-import java.util.Set; + import net.minecraft.server.DragonControllerPhase; + import net.minecraft.server.EntityComplexPart; + import net.minecraft.server.EntityEnderDragon; +@@ -14,6 +13,8 @@ import org.bukkit.entity.ComplexEntityPart; + import org.bukkit.entity.EnderDragon; + import org.bukkit.entity.EntityType; + ++import java.util.Set; ++ + public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderDragon { + + public CraftEnderDragon(CraftServer server, EntityEnderDragon entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +index 6f18a789805163de63561569e84d9fa1b3dabb61..6b33a1e2c1f793df363697f868cbaeae01bc15f0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +@@ -3,149 +3,10 @@ package org.bukkit.craftbukkit.entity; + import com.google.common.base.Function; + import com.google.common.base.Preconditions; + import com.google.common.collect.Lists; +-import java.util.List; +-import java.util.Set; +-import java.util.UUID; +-import net.minecraft.server.AxisAlignedBB; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.DamageSource; +-import net.minecraft.server.Entity; +-import net.minecraft.server.EntityAmbient; +-import net.minecraft.server.EntityAnimal; +-import net.minecraft.server.EntityAreaEffectCloud; +-import net.minecraft.server.EntityArmorStand; +-import net.minecraft.server.EntityArrow; +-import net.minecraft.server.EntityBat; +-import net.minecraft.server.EntityBee; +-import net.minecraft.server.EntityBlaze; +-import net.minecraft.server.EntityBoat; +-import net.minecraft.server.EntityCat; +-import net.minecraft.server.EntityCaveSpider; +-import net.minecraft.server.EntityChicken; +-import net.minecraft.server.EntityCod; +-import net.minecraft.server.EntityComplexPart; +-import net.minecraft.server.EntityCow; +-import net.minecraft.server.EntityCreature; +-import net.minecraft.server.EntityCreeper; +-import net.minecraft.server.EntityDolphin; +-import net.minecraft.server.EntityDragonFireball; +-import net.minecraft.server.EntityDrowned; +-import net.minecraft.server.EntityEgg; +-import net.minecraft.server.EntityEnderCrystal; +-import net.minecraft.server.EntityEnderDragon; +-import net.minecraft.server.EntityEnderPearl; +-import net.minecraft.server.EntityEnderSignal; +-import net.minecraft.server.EntityEnderman; +-import net.minecraft.server.EntityEndermite; +-import net.minecraft.server.EntityEvoker; +-import net.minecraft.server.EntityEvokerFangs; +-import net.minecraft.server.EntityExperienceOrb; +-import net.minecraft.server.EntityFallingBlock; +-import net.minecraft.server.EntityFireball; +-import net.minecraft.server.EntityFireworks; +-import net.minecraft.server.EntityFish; +-import net.minecraft.server.EntityFishingHook; +-import net.minecraft.server.EntityFlying; +-import net.minecraft.server.EntityFox; +-import net.minecraft.server.EntityGhast; +-import net.minecraft.server.EntityGiantZombie; +-import net.minecraft.server.EntityGolem; +-import net.minecraft.server.EntityGuardian; +-import net.minecraft.server.EntityGuardianElder; +-import net.minecraft.server.EntityHanging; +-import net.minecraft.server.EntityHoglin; +-import net.minecraft.server.EntityHorse; +-import net.minecraft.server.EntityHorseAbstract; +-import net.minecraft.server.EntityHorseChestedAbstract; +-import net.minecraft.server.EntityHorseDonkey; +-import net.minecraft.server.EntityHorseMule; +-import net.minecraft.server.EntityHorseSkeleton; +-import net.minecraft.server.EntityHorseZombie; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.EntityIllagerAbstract; +-import net.minecraft.server.EntityIllagerIllusioner; +-import net.minecraft.server.EntityIllagerWizard; +-import net.minecraft.server.EntityIronGolem; +-import net.minecraft.server.EntityItem; +-import net.minecraft.server.EntityItemFrame; +-import net.minecraft.server.EntityLargeFireball; +-import net.minecraft.server.EntityLeash; +-import net.minecraft.server.EntityLightning; +-import net.minecraft.server.EntityLiving; +-import net.minecraft.server.EntityLlama; +-import net.minecraft.server.EntityLlamaSpit; +-import net.minecraft.server.EntityLlamaTrader; +-import net.minecraft.server.EntityMagmaCube; +-import net.minecraft.server.EntityMinecartAbstract; +-import net.minecraft.server.EntityMinecartChest; +-import net.minecraft.server.EntityMinecartCommandBlock; +-import net.minecraft.server.EntityMinecartFurnace; +-import net.minecraft.server.EntityMinecartHopper; +-import net.minecraft.server.EntityMinecartMobSpawner; +-import net.minecraft.server.EntityMinecartRideable; +-import net.minecraft.server.EntityMinecartTNT; +-import net.minecraft.server.EntityMonster; +-import net.minecraft.server.EntityMushroomCow; +-import net.minecraft.server.EntityOcelot; +-import net.minecraft.server.EntityPainting; +-import net.minecraft.server.EntityPanda; +-import net.minecraft.server.EntityParrot; +-import net.minecraft.server.EntityPhantom; +-import net.minecraft.server.EntityPig; +-import net.minecraft.server.EntityPigZombie; +-import net.minecraft.server.EntityPiglin; +-import net.minecraft.server.EntityPillager; +-import net.minecraft.server.EntityPlayer; +-import net.minecraft.server.EntityPolarBear; +-import net.minecraft.server.EntityPotion; +-import net.minecraft.server.EntityProjectile; +-import net.minecraft.server.EntityPufferFish; +-import net.minecraft.server.EntityRabbit; +-import net.minecraft.server.EntityRavager; +-import net.minecraft.server.EntitySalmon; +-import net.minecraft.server.EntitySheep; +-import net.minecraft.server.EntityShulker; +-import net.minecraft.server.EntityShulkerBullet; +-import net.minecraft.server.EntitySilverfish; +-import net.minecraft.server.EntitySkeletonAbstract; +-import net.minecraft.server.EntitySkeletonStray; +-import net.minecraft.server.EntitySkeletonWither; +-import net.minecraft.server.EntitySlime; +-import net.minecraft.server.EntitySmallFireball; +-import net.minecraft.server.EntitySnowball; +-import net.minecraft.server.EntitySnowman; +-import net.minecraft.server.EntitySpectralArrow; +-import net.minecraft.server.EntitySpider; +-import net.minecraft.server.EntitySquid; +-import net.minecraft.server.EntityStrider; +-import net.minecraft.server.EntityTNTPrimed; +-import net.minecraft.server.EntityTameableAnimal; +-import net.minecraft.server.EntityThrownExpBottle; +-import net.minecraft.server.EntityThrownTrident; +-import net.minecraft.server.EntityTippedArrow; +-import net.minecraft.server.EntityTropicalFish; +-import net.minecraft.server.EntityTurtle; +-import net.minecraft.server.EntityVex; +-import net.minecraft.server.EntityVillager; +-import net.minecraft.server.EntityVillagerAbstract; +-import net.minecraft.server.EntityVillagerTrader; +-import net.minecraft.server.EntityVindicator; +-import net.minecraft.server.EntityWaterAnimal; +-import net.minecraft.server.EntityWitch; +-import net.minecraft.server.EntityWither; +-import net.minecraft.server.EntityWitherSkull; +-import net.minecraft.server.EntityWolf; +-import net.minecraft.server.EntityZoglin; +-import net.minecraft.server.EntityZombie; +-import net.minecraft.server.EntityZombieHusk; +-import net.minecraft.server.EntityZombieVillager; +-import net.minecraft.server.IChatBaseComponent; +-import net.minecraft.server.NBTTagCompound; +-import org.bukkit.Chunk; // Paper +-import org.bukkit.EntityEffect; +-import org.bukkit.Location; +-import org.bukkit.Server; ++import net.minecraft.server.*; ++import org.bukkit.Chunk; + import org.bukkit.World; ++import org.bukkit.*; + import org.bukkit.block.BlockFace; + import org.bukkit.block.PistonMoveReaction; + import org.bukkit.craftbukkit.CraftServer; +@@ -159,16 +20,16 @@ import org.bukkit.entity.Pose; + import org.bukkit.event.entity.EntityDamageEvent; + import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; + import org.bukkit.metadata.MetadataValue; +-import org.bukkit.permissions.PermissibleBase; +-import org.bukkit.permissions.Permission; +-import org.bukkit.permissions.PermissionAttachment; +-import org.bukkit.permissions.PermissionAttachmentInfo; +-import org.bukkit.permissions.ServerOperator; ++import org.bukkit.permissions.*; + import org.bukkit.plugin.Plugin; + import org.bukkit.util.BoundingBox; + import org.bukkit.util.NumberConversions; + import org.bukkit.util.Vector; + ++import java.util.List; ++import java.util.Set; ++import java.util.UUID; ++ + public abstract class CraftEntity implements org.bukkit.entity.Entity { + private static PermissibleBase perm; + private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +index 97fdf356034dd6b063519474fca6e4d947e6b886..f1437d2c508c82eba3cd614d61c9ca1b60166404 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.entity; + + import net.minecraft.server.EntityFireball; +-import net.minecraft.server.MathHelper; + import org.apache.commons.lang.Validate; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.entity.EntityType; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +index f3066e6c781bcee72c235abcef5060fb080892d5..618b96769d4c99983db6d35c0539412cd70d2eb8 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.entity; + +-import java.util.Random; + import net.minecraft.server.EntityFireworks; + import net.minecraft.server.ItemStack; + import net.minecraft.server.Items; +@@ -11,6 +10,8 @@ import org.bukkit.entity.EntityType; + import org.bukkit.entity.Firework; + import org.bukkit.inventory.meta.FireworkMeta; + ++import java.util.Random; ++ + public class CraftFirework extends CraftProjectile implements Firework { + + private final Random random = new Random(); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java +index 0b73a448604177dcc2b4c4dc77c7186dfc397135..7a2e186336defb8020b91cc55d154e024e461223 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java +@@ -1,14 +1,15 @@ + package org.bukkit.craftbukkit.entity; + + import com.google.common.base.Preconditions; +-import java.util.Optional; +-import java.util.UUID; + import net.minecraft.server.EntityFox; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.entity.AnimalTamer; + import org.bukkit.entity.EntityType; + import org.bukkit.entity.Fox; + ++import java.util.Optional; ++import java.util.UUID; ++ + public class CraftFox extends CraftAnimals implements Fox { + + public CraftFox(CraftServer server, EntityFox entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +index fef2035fe5564645d786d042dceedb10ca8b59ce..a2e283b941f399380551920a0533f7cdc15df8f5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +@@ -2,36 +2,7 @@ package org.bukkit.craftbukkit.entity; + + import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableSet; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Collection; +-import java.util.Optional; +-import java.util.Set; +-import net.minecraft.server.BlockBed; +-import net.minecraft.server.BlockEnchantmentTable; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.BlockWorkbench; +-import net.minecraft.server.Blocks; +-import net.minecraft.server.ChatComponentText; +-import net.minecraft.server.Container; +-import net.minecraft.server.Containers; +-import net.minecraft.server.CraftingManager; +-import net.minecraft.server.Entity; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.EntityPlayer; +-import net.minecraft.server.EntityTypes; +-import net.minecraft.server.EnumMainHand; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IChatBaseComponent; +-import net.minecraft.server.IMerchant; +-import net.minecraft.server.IRecipe; +-import net.minecraft.server.ITileInventory; +-import net.minecraft.server.ItemCooldown; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.PacketPlayInCloseWindow; +-import net.minecraft.server.PacketPlayOutOpenWindow; +-import net.minecraft.server.TileEntity; +-import net.minecraft.server.TileEntityContainer; ++import net.minecraft.server.*; + import org.bukkit.GameMode; + import org.bukkit.Location; + import org.bukkit.Material; +@@ -39,31 +10,23 @@ import org.bukkit.NamespacedKey; + import org.bukkit.block.Block; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.event.CraftEventFactory; +-import org.bukkit.craftbukkit.inventory.CraftContainer; +-import org.bukkit.craftbukkit.inventory.CraftInventory; +-import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest; +-import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer; +-import org.bukkit.craftbukkit.inventory.CraftInventoryView; +-import org.bukkit.craftbukkit.inventory.CraftItemStack; +-import org.bukkit.craftbukkit.inventory.CraftMerchantCustom; ++import org.bukkit.craftbukkit.inventory.*; + import org.bukkit.craftbukkit.util.CraftChatMessage; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; + import org.bukkit.entity.HumanEntity; + import org.bukkit.entity.Villager; +-import org.bukkit.inventory.EntityEquipment; +-import org.bukkit.inventory.Inventory; +-import org.bukkit.inventory.InventoryView; + import org.bukkit.inventory.ItemStack; +-import org.bukkit.inventory.MainHand; +-import org.bukkit.inventory.Merchant; + import org.bukkit.inventory.PlayerInventory; ++import org.bukkit.inventory.*; + import org.bukkit.permissions.PermissibleBase; + import org.bukkit.permissions.Permission; + import org.bukkit.permissions.PermissionAttachment; + import org.bukkit.permissions.PermissionAttachmentInfo; + import org.bukkit.plugin.Plugin; + ++import java.util.*; ++ + public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { + private CraftInventoryPlayer inventory; + private final CraftInventory enderChest; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +index cb756b1ba0438045904a1b3fe8e827e8f1e105bd..0797782298ac903929c2f46c556a7d6a7a8d2262 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +@@ -8,7 +8,6 @@ import org.bukkit.entity.EntityType; + import org.bukkit.entity.Item; + import org.bukkit.inventory.ItemStack; + +-// Paper start + import javax.annotation.Nullable; + import java.util.UUID; + // Paper end +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java +index 8a43416ae2a9b923e3fa2b207931cb48cdb6bbd2..e36af9de1263fa07e523451f0a6efc667e9111a7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java +@@ -1,11 +1,6 @@ + package org.bukkit.craftbukkit.entity; + +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.EntityHanging; +-import net.minecraft.server.EntityItemFrame; +-import net.minecraft.server.EnumDirection; +-import net.minecraft.server.ItemStack; +-import net.minecraft.server.WorldServer; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.Rotation; + import org.bukkit.block.BlockFace; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +index 3777aba5f32f58f4620d4fe496af4e641ff8c858..d9d4ba1f0b9e47b8632b2488f7a639e303b392d6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +@@ -2,42 +2,7 @@ package org.bukkit.craftbukkit.entity; + + import com.google.common.base.Preconditions; + import com.google.common.collect.Sets; +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Set; +-import java.util.UUID; +-import net.minecraft.server.DamageSource; +-import net.minecraft.server.EntityArmorStand; +-import net.minecraft.server.EntityArrow; +-import net.minecraft.server.EntityDragonFireball; +-import net.minecraft.server.EntityEgg; +-import net.minecraft.server.EntityEnderPearl; +-import net.minecraft.server.EntityFireball; +-import net.minecraft.server.EntityFireworks; +-import net.minecraft.server.EntityFishingHook; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.EntityInsentient; +-import net.minecraft.server.EntityLargeFireball; +-import net.minecraft.server.EntityLiving; +-import net.minecraft.server.EntityLlamaSpit; +-import net.minecraft.server.EntityPotion; +-import net.minecraft.server.EntityProjectile; +-import net.minecraft.server.EntityShulkerBullet; +-import net.minecraft.server.EntitySmallFireball; +-import net.minecraft.server.EntitySnowball; +-import net.minecraft.server.EntitySpectralArrow; +-import net.minecraft.server.EntityThrownExpBottle; +-import net.minecraft.server.EntityThrownTrident; +-import net.minecraft.server.EntityTippedArrow; +-import net.minecraft.server.EntityTypes; +-import net.minecraft.server.EntityWither; +-import net.minecraft.server.EntityWitherSkull; +-import net.minecraft.server.EnumHand; +-import net.minecraft.server.GenericAttributes; +-import net.minecraft.server.MobEffect; +-import net.minecraft.server.MobEffectList; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.FluidCollisionMode; + import org.bukkit.Location; +@@ -52,30 +17,8 @@ import org.bukkit.craftbukkit.entity.memory.CraftMemoryMapper; + import org.bukkit.craftbukkit.inventory.CraftEntityEquipment; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.potion.CraftPotionUtil; +-import org.bukkit.entity.AbstractArrow; +-import org.bukkit.entity.DragonFireball; +-import org.bukkit.entity.Egg; +-import org.bukkit.entity.EnderPearl; + import org.bukkit.entity.Entity; +-import org.bukkit.entity.EntityType; +-import org.bukkit.entity.Fireball; +-import org.bukkit.entity.Firework; +-import org.bukkit.entity.FishHook; +-import org.bukkit.entity.HumanEntity; +-import org.bukkit.entity.LingeringPotion; +-import org.bukkit.entity.LivingEntity; +-import org.bukkit.entity.LlamaSpit; +-import org.bukkit.entity.Player; +-import org.bukkit.entity.Projectile; +-import org.bukkit.entity.ShulkerBullet; +-import org.bukkit.entity.SmallFireball; +-import org.bukkit.entity.Snowball; +-import org.bukkit.entity.SpectralArrow; +-import org.bukkit.entity.ThrownExpBottle; +-import org.bukkit.entity.ThrownPotion; +-import org.bukkit.entity.TippedArrow; +-import org.bukkit.entity.Trident; +-import org.bukkit.entity.WitherSkull; ++import org.bukkit.entity.*; + import org.bukkit.entity.memory.MemoryKey; + import org.bukkit.event.entity.EntityPotionEffectEvent; + import org.bukkit.event.player.PlayerTeleportEvent; +@@ -89,6 +32,8 @@ import org.bukkit.util.BlockIterator; + import org.bukkit.util.RayTraceResult; + import org.bukkit.util.Vector; + ++import java.util.*; ++ + public class CraftLivingEntity extends CraftEntity implements LivingEntity { + private CraftEntityEquipment equipment; + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java +index ab4807b2cd3cdcd61d8ac4ae2825df69dd2b7c64..6cf5d3a3bc91e11110a35ea52d8172307d862e09 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java +@@ -1,6 +1,6 @@ + package org.bukkit.craftbukkit.entity; + +-import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; // Paper ++import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; + import net.minecraft.server.EntityMinecartChest; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.inventory.CraftInventory; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java +index 89affac56d40ed4b20d5ddd668d0f820bad72a3f..430ce5f831e1e15ea054338098f05f685f9cc388 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.entity; + +-import java.util.Set; + import net.minecraft.server.EntityMinecartCommandBlock; + import org.bukkit.Bukkit; + import org.bukkit.Server; +@@ -14,6 +13,8 @@ import org.bukkit.permissions.PermissionAttachment; + import org.bukkit.permissions.PermissionAttachmentInfo; + import org.bukkit.plugin.Plugin; + ++import java.util.Set; ++ + public class CraftMinecartCommand extends CraftMinecart implements CommandMinecart { + private final PermissibleBase perm = new PermissibleBase(this); + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +index f5b31237fc6e62345edcc3d6b02ff9e94237ae31..326478d8e79bec0f5523badae09f0279b6faf99e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +@@ -1,6 +1,6 @@ + package org.bukkit.craftbukkit.entity; + +-import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; // Paper ++import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; + import net.minecraft.server.EntityMinecartHopper; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.inventory.CraftInventory; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index adf918fd757fe3147f897de3ade64a9adf1d3203..3dbf0254047bc0c8a0bb06091b7e4407f285832c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -1,8 +1,8 @@ + package org.bukkit.craftbukkit.entity; + ++import com.destroystokyo.paper.ClientOption; + import com.destroystokyo.paper.ClientOption.ChatVisibility; + import com.destroystokyo.paper.PaperSkinParts; +-import com.destroystokyo.paper.ClientOption; + import com.destroystokyo.paper.Title; + import com.destroystokyo.paper.profile.CraftPlayerProfile; + import com.destroystokyo.paper.profile.PlayerProfile; +@@ -11,99 +11,21 @@ import com.google.common.collect.ImmutableSet; + import com.google.common.io.BaseEncoding; + import com.mojang.authlib.GameProfile; + import io.netty.buffer.Unpooled; +-import java.io.ByteArrayOutputStream; +-import java.io.IOException; +-import java.lang.ref.WeakReference; +-import java.net.InetSocketAddress; +-import java.net.SocketAddress; +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.LinkedHashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.Optional; +-import java.util.Set; +-import java.util.UUID; +-import java.util.WeakHashMap; +-import java.util.logging.Level; +-import java.util.logging.Logger; +-import javax.annotation.Nullable; +-import net.minecraft.server.AdvancementDataPlayer; +-import net.minecraft.server.AdvancementProgress; +-import net.minecraft.server.AttributeMapBase; +-import net.minecraft.server.AttributeModifiable; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.ChatComponentText; +-import net.minecraft.server.ChatMessageType; +-import net.minecraft.server.Container; +-import net.minecraft.server.Entity; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.EntityLiving; +-import net.minecraft.server.EntityPlayer; +-import net.minecraft.server.EnumColor; +-import net.minecraft.server.EnumGamemode; +-import net.minecraft.server.GenericAttributes; +-import net.minecraft.server.IChatBaseComponent; +-import net.minecraft.server.MCUtil; +-import net.minecraft.server.MapIcon; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.PacketDataSerializer; +-import net.minecraft.server.PacketPlayOutBlockChange; +-import net.minecraft.server.PacketPlayOutChat; +-import net.minecraft.server.PacketPlayOutCustomPayload; +-import net.minecraft.server.PacketPlayOutCustomSoundEffect; +-import net.minecraft.server.PacketPlayOutExperience; +-import net.minecraft.server.PacketPlayOutMap; +-import net.minecraft.server.PacketPlayOutNamedSoundEffect; +-import net.minecraft.server.PacketPlayOutPlayerInfo; +-import net.minecraft.server.PacketPlayOutPlayerListHeaderFooter; +-import net.minecraft.server.PacketPlayOutSpawnPosition; +-import net.minecraft.server.PacketPlayOutStopSound; +-import net.minecraft.server.PacketPlayOutTitle; +-import net.minecraft.server.PacketPlayOutUpdateAttributes; +-import net.minecraft.server.PacketPlayOutUpdateHealth; +-import net.minecraft.server.PacketPlayOutWorldEvent; +-import net.minecraft.server.PacketPlayOutWorldParticles; +-import net.minecraft.server.PlayerChunkMap; +-import net.minecraft.server.PlayerConnection; +-import net.minecraft.server.SystemUtils; +-import net.minecraft.server.TileEntitySign; +-import net.minecraft.server.Vec3D; +-import net.minecraft.server.WhiteListEntry; +-import net.minecraft.server.WorldServer; ++import net.md_5.bungee.api.chat.BaseComponent; ++import net.minecraft.server.*; + import org.apache.commons.lang.NotImplementedException; + import org.apache.commons.lang.Validate; +-import org.bukkit.BanList; +-import org.bukkit.Bukkit; +-import org.bukkit.DyeColor; +-import org.bukkit.Effect; +-import org.bukkit.GameMode; +-import org.bukkit.Instrument; +-import org.bukkit.Location; + import org.bukkit.Material; +-import org.bukkit.NamespacedKey; +-import org.bukkit.Note; +-import org.bukkit.OfflinePlayer; + import org.bukkit.Particle; +-import org.bukkit.Sound; + import org.bukkit.Statistic; +-import org.bukkit.WeatherType; + import org.bukkit.World; ++import org.bukkit.*; + import org.bukkit.block.data.BlockData; + import org.bukkit.configuration.serialization.DelegateDeserialization; + import org.bukkit.conversations.Conversation; + import org.bukkit.conversations.ConversationAbandonedEvent; + import org.bukkit.conversations.ManuallyAbandonedConversationCanceller; +-import org.bukkit.craftbukkit.CraftEffect; +-import org.bukkit.craftbukkit.CraftOfflinePlayer; +-import org.bukkit.craftbukkit.CraftParticle; +-import org.bukkit.craftbukkit.CraftServer; +-import org.bukkit.craftbukkit.CraftSound; +-import org.bukkit.craftbukkit.CraftStatistic; +-import org.bukkit.craftbukkit.CraftWorld; ++import org.bukkit.craftbukkit.*; + import org.bukkit.craftbukkit.advancement.CraftAdvancement; + import org.bukkit.craftbukkit.advancement.CraftAdvancementProgress; + import org.bukkit.craftbukkit.block.CraftSign; +@@ -129,7 +51,15 @@ import org.bukkit.plugin.Plugin; + import org.bukkit.plugin.messaging.StandardMessenger; + import org.bukkit.scoreboard.Scoreboard; + +-import net.md_5.bungee.api.chat.BaseComponent; // Spigot ++import javax.annotation.Nullable; ++import java.io.ByteArrayOutputStream; ++import java.io.IOException; ++import java.lang.ref.WeakReference; ++import java.net.InetSocketAddress; ++import java.net.SocketAddress; ++import java.util.*; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + @DelegateDeserialization(CraftOfflinePlayer.class) + public class CraftPlayer extends CraftHumanEntity implements Player { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java +index 6a642155cf387f7d0e2cf9bdf1a78c62aef8205b..eaef6458d62093667c620a267a0bcd1d5761fef4 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java +@@ -1,12 +1,13 @@ + package org.bukkit.craftbukkit.entity; + +-import java.util.UUID; + import net.minecraft.server.EntityTameableAnimal; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.entity.AnimalTamer; + import org.bukkit.entity.Creature; + import org.bukkit.entity.Tameable; + ++import java.util.UUID; ++ + public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creature { + public CraftTameableAnimal(CraftServer server, EntityTameableAnimal entity) { + super(server, entity); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +index 2400f33093639dcf70884b939da2426a8821f1b9..d23f625d17f96237ffa85c335456b0d86dd12706 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.entity; + + import com.google.common.collect.ImmutableList; +-import java.util.Collection; + import net.minecraft.server.EntityPotion; + import net.minecraft.server.MobEffect; + import net.minecraft.server.PotionUtil; +@@ -15,6 +14,8 @@ import org.bukkit.entity.ThrownPotion; + import org.bukkit.inventory.ItemStack; + import org.bukkit.potion.PotionEffect; + ++import java.util.Collection; ++ + public class CraftThrownPotion extends CraftProjectile implements ThrownPotion { + public CraftThrownPotion(CraftServer server, EntityPotion entity) { + super(server, entity); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java +index ecdaa2b97f48486362eedded188fec4246117d8e..dabe6775f5b8a00cba52a4a304201a5762141a76 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.entity; + + import com.google.common.collect.ImmutableList; +-import java.util.List; + import net.minecraft.server.EntityTippedArrow; + import net.minecraft.server.MobEffect; + import net.minecraft.server.MobEffectList; +@@ -15,6 +14,8 @@ import org.bukkit.potion.PotionData; + import org.bukkit.potion.PotionEffect; + import org.bukkit.potion.PotionEffectType; + ++import java.util.List; ++ + public class CraftTippedArrow extends CraftArrow implements Arrow { + + public CraftTippedArrow(CraftServer server, EntityTippedArrow entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java +index 9243381a2fbdf255b3772000ba1c4653871ab976..5c6523bfa26d94da2eaade55aea740c436a5138e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java +@@ -1,13 +1,14 @@ + package org.bukkit.craftbukkit.entity; + +-import java.util.HashMap; +-import java.util.Map; + import net.minecraft.server.EntityTropicalFish; + import org.bukkit.DyeColor; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.entity.EntityType; + import org.bukkit.entity.TropicalFish; + ++import java.util.HashMap; ++import java.util.Map; ++ + public class CraftTropicalFish extends CraftFish implements TropicalFish { + + public CraftTropicalFish(CraftServer server, EntityTropicalFish entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +index 85a7406048a5d44b8e26d7949feacb7ec12c575c..a9ead9a050998bca4f855ad31d669e5aa0c4fdfd 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +@@ -1,19 +1,9 @@ + package org.bukkit.craftbukkit.entity; + +-import com.destroystokyo.paper.entity.villager.Reputation; // Paper ++import com.destroystokyo.paper.entity.villager.Reputation; + import com.google.common.base.Preconditions; +-import com.google.common.collect.Maps; // Paper +- +-import java.util.HashMap; +-import java.util.Locale; +-import net.minecraft.server.BlockBed; +-import net.minecraft.server.BlockPosition; +-import java.util.Map; // Paper +-import java.util.UUID; // Paper +-import net.minecraft.server.EntityVillager; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.VillagerProfession; ++import com.google.common.collect.Maps; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.Location; + import org.bukkit.craftbukkit.CraftServer; +@@ -21,6 +11,11 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; + import org.bukkit.entity.EntityType; + import org.bukkit.entity.Villager; + ++import java.util.HashMap; ++import java.util.Locale; ++import java.util.Map; ++import java.util.UUID; ++ + public class CraftVillager extends CraftAbstractVillager implements Villager { + + public CraftVillager(CraftServer server, EntityVillager entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java +index 2c8f157a928c6a05575eb2760be2b40cc3fda293..60d3135d5a503a982bea7f3738f2439c57244057 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.entity; + + import com.google.common.base.Preconditions; +-import java.util.Locale; +-import java.util.UUID; + import net.minecraft.server.EntityZombieVillager; + import net.minecraft.server.IRegistry; + import net.minecraft.server.MinecraftKey; +@@ -16,6 +14,9 @@ import org.bukkit.entity.EntityType; + import org.bukkit.entity.Villager; + import org.bukkit.entity.ZombieVillager; + ++import java.util.Locale; ++import java.util.UUID; ++ + public class CraftVillagerZombie extends CraftZombie implements ZombieVillager { + + public CraftVillagerZombie(CraftServer server, EntityZombieVillager entity) { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java +index b43a2bbd5bfd613887a7ae1519f6e729faf9bcc2..e1f23f1a5cf535129b150edaaae7b0e754cd2442 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java +@@ -1,14 +1,13 @@ + package org.bukkit.craftbukkit.entity; + +-import net.minecraft.server.EntityWitch; +-import org.bukkit.craftbukkit.CraftServer; +-import org.bukkit.entity.EntityType; +-import org.bukkit.entity.Witch; +-// Paper start + import com.destroystokyo.paper.entity.CraftRangedEntity; + import com.google.common.base.Preconditions; ++import net.minecraft.server.EntityWitch; + import org.bukkit.Material; ++import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.inventory.CraftItemStack; ++import org.bukkit.entity.EntityType; ++import org.bukkit.entity.Witch; + import org.bukkit.inventory.ItemStack; + // Paper end + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java b/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java +index 0616cdf196d734312b3ce62e4e032119a9b46499..e96c9887cf6900ef75d289ab97533635fb9244b9 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.entity.memory; + +-import java.util.UUID; + import net.minecraft.server.BlockPosition; + import net.minecraft.server.GlobalPos; + import org.bukkit.Bukkit; +@@ -8,6 +7,8 @@ import org.bukkit.Location; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.CraftWorld; + ++import java.util.UUID; ++ + public final class CraftMemoryMapper { + + private CraftMemoryMapper() {} +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +index 6b01f0493c4905142c2c2038e8e57adc3d37c02b..a3fc8c0b641f0224affc399a73ef55f324c336b4 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -4,85 +4,18 @@ import com.google.common.base.Function; + import com.google.common.base.Functions; + import com.google.common.collect.Lists; + import com.mojang.datafixers.util.Either; +-import java.net.InetAddress; +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.EnumMap; +-import java.util.List; +-import java.util.Map; +-import java.util.stream.Collectors; +-import javax.annotation.Nullable; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.BlockPropertyInstrument; +-import net.minecraft.server.ChatMessage; +-import net.minecraft.server.ChatModifier; +-import net.minecraft.server.Container; +-import net.minecraft.server.ContainerMerchant; +-import net.minecraft.server.DamageSource; + import net.minecraft.server.Entity; +-import net.minecraft.server.EntityAnimal; +-import net.minecraft.server.EntityAreaEffectCloud; +-import net.minecraft.server.EntityDamageSource; +-import net.minecraft.server.EntityDamageSourceIndirect; +-import net.minecraft.server.EntityEnderCrystal; +-import net.minecraft.server.EntityEnderDragon; +-import net.minecraft.server.EntityExperienceOrb; +-import net.minecraft.server.EntityFireworks; +-import net.minecraft.server.EntityGhast; +-import net.minecraft.server.EntityGolem; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.EntityInsentient; +-import net.minecraft.server.EntityItem; +-import net.minecraft.server.EntityLiving; +-import net.minecraft.server.EntityMonster; +-import net.minecraft.server.EntityPlayer; +-import net.minecraft.server.EntityPotion; +-import net.minecraft.server.EntityRaider; +-import net.minecraft.server.EntitySlime; +-import net.minecraft.server.EntityStrider; +-import net.minecraft.server.EntityTypes; +-import net.minecraft.server.EntityVillager; +-import net.minecraft.server.EntityWaterAnimal; +-import net.minecraft.server.EnumDirection; +-import net.minecraft.server.EnumHand; +-import net.minecraft.server.EnumItemSlot; +-import net.minecraft.server.Explosion; +-import net.minecraft.server.GeneratorAccess; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IChatBaseComponent; +-import net.minecraft.server.IInventory; +-import net.minecraft.server.IProjectile; +-import net.minecraft.server.ItemActionContext; +-import net.minecraft.server.ItemStack; +-import net.minecraft.server.Items; +-import net.minecraft.server.LootContextParameters; +-import net.minecraft.server.LootTable; +-import net.minecraft.server.LootTableInfo; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.MobEffect; +-import net.minecraft.server.MovingObjectPosition; +-import net.minecraft.server.MovingObjectPositionBlock; +-import net.minecraft.server.MovingObjectPositionEntity; + import net.minecraft.server.NPC; +-import net.minecraft.server.PacketPlayInCloseWindow; + import net.minecraft.server.Raid; +-import net.minecraft.server.Unit; + import net.minecraft.server.World; +-import net.minecraft.server.WorldServer; +-import org.bukkit.Bukkit; +-import org.bukkit.Location; ++import net.minecraft.server.*; + import org.bukkit.Material; +-import org.bukkit.NamespacedKey; +-import org.bukkit.Server; ++import org.bukkit.*; + import org.bukkit.Statistic.Type; + import org.bukkit.block.Block; + import org.bukkit.block.BlockFace; + import org.bukkit.block.BlockState; +-import org.bukkit.craftbukkit.CraftLootTable; +-import org.bukkit.craftbukkit.CraftRaid; +-import org.bukkit.craftbukkit.CraftServer; +-import org.bukkit.craftbukkit.CraftStatistic; +-import org.bukkit.craftbukkit.CraftWorld; ++import org.bukkit.craftbukkit.*; + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.craftbukkit.block.CraftBlockState; + import org.bukkit.craftbukkit.block.data.CraftBlockData; +@@ -97,116 +30,21 @@ import org.bukkit.craftbukkit.potion.CraftPotionUtil; + import org.bukkit.craftbukkit.util.CraftDamageSource; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; +-import org.bukkit.entity.AbstractHorse; +-import org.bukkit.entity.Animals; +-import org.bukkit.entity.AreaEffectCloud; +-import org.bukkit.entity.Bat; +-import org.bukkit.entity.Creeper; +-import org.bukkit.entity.EntityType; +-import org.bukkit.entity.ExperienceOrb; +-import org.bukkit.entity.Firework; +-import org.bukkit.entity.HumanEntity; + import org.bukkit.entity.Item; +-import org.bukkit.entity.LightningStrike; +-import org.bukkit.entity.LivingEntity; +-import org.bukkit.entity.Pig; +-import org.bukkit.entity.PigZombie; +-import org.bukkit.entity.Player; +-import org.bukkit.entity.Projectile; +-import org.bukkit.entity.Raider; +-import org.bukkit.entity.Strider; +-import org.bukkit.entity.ThrownExpBottle; +-import org.bukkit.entity.ThrownPotion; +-import org.bukkit.entity.Vehicle; +-import org.bukkit.entity.Villager; ++import org.bukkit.entity.*; + import org.bukkit.entity.Villager.Profession; +-import org.bukkit.entity.ExperienceOrb; // Paper + import org.bukkit.event.Cancellable; + import org.bukkit.event.Event; + import org.bukkit.event.Event.Result; +-import org.bukkit.event.block.Action; +-import org.bukkit.event.block.BlockDamageEvent; +-import org.bukkit.event.block.BlockDropItemEvent; +-import org.bukkit.event.block.BlockFadeEvent; +-import org.bukkit.event.block.BlockFormEvent; +-import org.bukkit.event.block.BlockGrowEvent; +-import org.bukkit.event.block.BlockIgniteEvent; ++import org.bukkit.event.block.*; + import org.bukkit.event.block.BlockIgniteEvent.IgniteCause; +-import org.bukkit.event.block.BlockMultiPlaceEvent; +-import org.bukkit.event.block.BlockPhysicsEvent; +-import org.bukkit.event.block.BlockPlaceEvent; +-import org.bukkit.event.block.BlockRedstoneEvent; +-import org.bukkit.event.block.BlockShearEntityEvent; +-import org.bukkit.event.block.BlockSpreadEvent; +-import org.bukkit.event.block.EntityBlockFormEvent; +-import org.bukkit.event.block.FluidLevelChangeEvent; +-import org.bukkit.event.block.MoistureChangeEvent; +-import org.bukkit.event.block.NotePlayEvent; +-import org.bukkit.event.entity.AreaEffectCloudApplyEvent; +-import org.bukkit.event.entity.BatToggleSleepEvent; +-import org.bukkit.event.entity.CreatureSpawnEvent; ++import org.bukkit.event.entity.*; + import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +-import org.bukkit.event.entity.CreeperPowerEvent; +-import org.bukkit.event.entity.EntityBreakDoorEvent; +-import org.bukkit.event.entity.EntityBreedEvent; +-import org.bukkit.event.entity.EntityChangeBlockEvent; +-import org.bukkit.event.entity.EntityDamageByBlockEvent; +-import org.bukkit.event.entity.EntityDamageByEntityEvent; +-import org.bukkit.event.entity.EntityDamageEvent; + import org.bukkit.event.entity.EntityDamageEvent.DamageCause; + import org.bukkit.event.entity.EntityDamageEvent.DamageModifier; +-import org.bukkit.event.entity.EntityDeathEvent; +-import org.bukkit.event.entity.EntityEnterLoveModeEvent; +-import org.bukkit.event.entity.EntityPickupItemEvent; +-import org.bukkit.event.entity.EntityPlaceEvent; +-import org.bukkit.event.entity.EntityPortalEvent; +-import org.bukkit.event.entity.EntityPotionEffectEvent; +-import org.bukkit.event.entity.EntityShootBowEvent; +-import org.bukkit.event.entity.EntitySpawnEvent; +-import org.bukkit.event.entity.EntityTameEvent; +-import org.bukkit.event.entity.EntityTargetEvent; +-import org.bukkit.event.entity.EntityTargetLivingEntityEvent; +-import org.bukkit.event.entity.EntityToggleGlideEvent; +-import org.bukkit.event.entity.EntityToggleSwimEvent; +-import org.bukkit.event.entity.EntityTransformEvent; +-import org.bukkit.event.entity.ExpBottleEvent; +-import org.bukkit.event.entity.FireworkExplodeEvent; +-import org.bukkit.event.entity.FoodLevelChangeEvent; +-import org.bukkit.event.entity.HorseJumpEvent; +-import org.bukkit.event.entity.ItemDespawnEvent; +-import org.bukkit.event.entity.ItemMergeEvent; +-import org.bukkit.event.entity.ItemSpawnEvent; +-import org.bukkit.event.entity.LingeringPotionSplashEvent; +-import org.bukkit.event.entity.PigZapEvent; +-import org.bukkit.event.entity.PlayerDeathEvent; +-import org.bukkit.event.entity.PlayerLeashEntityEvent; +-import org.bukkit.event.entity.PotionSplashEvent; +-import org.bukkit.event.entity.ProjectileHitEvent; +-import org.bukkit.event.entity.ProjectileLaunchEvent; +-import org.bukkit.event.entity.StriderTemperatureChangeEvent; +-import org.bukkit.event.entity.VillagerCareerChangeEvent; +-import org.bukkit.event.inventory.InventoryCloseEvent; +-import org.bukkit.event.inventory.InventoryOpenEvent; +-import org.bukkit.event.inventory.PrepareAnvilEvent; +-import org.bukkit.event.inventory.PrepareItemCraftEvent; +-import org.bukkit.event.inventory.PrepareSmithingEvent; +-import org.bukkit.event.inventory.TradeSelectEvent; +-import org.bukkit.event.player.PlayerBedEnterEvent; ++import org.bukkit.event.inventory.*; ++import org.bukkit.event.player.*; + import org.bukkit.event.player.PlayerBedEnterEvent.BedEnterResult; +-import org.bukkit.event.player.PlayerBucketEmptyEvent; +-import org.bukkit.event.player.PlayerBucketFillEvent; +-import org.bukkit.event.player.PlayerEditBookEvent; +-import org.bukkit.event.player.PlayerEvent; +-import org.bukkit.event.player.PlayerExpChangeEvent; +-import org.bukkit.event.player.PlayerHarvestBlockEvent; +-import org.bukkit.event.player.PlayerInteractEvent; +-import org.bukkit.event.player.PlayerItemBreakEvent; +-import org.bukkit.event.player.PlayerItemMendEvent; +-import org.bukkit.event.player.PlayerLevelChangeEvent; +-import org.bukkit.event.player.PlayerRecipeDiscoverEvent; +-import org.bukkit.event.player.PlayerShearEntityEvent; +-import org.bukkit.event.player.PlayerStatisticIncrementEvent; +-import org.bukkit.event.player.PlayerUnleashEntityEvent; + import org.bukkit.event.raid.RaidFinishEvent; + import org.bukkit.event.raid.RaidSpawnWaveEvent; + import org.bukkit.event.raid.RaidStopEvent; +@@ -218,9 +56,11 @@ import org.bukkit.inventory.EquipmentSlot; + import org.bukkit.inventory.InventoryView; + import org.bukkit.inventory.meta.BookMeta; + import org.bukkit.potion.PotionEffect; +-import org.bukkit.projectiles.ProjectileSource; + +-import org.bukkit.event.entity.SpawnerSpawnEvent; // Spigot ++import javax.annotation.Nullable; ++import java.net.InetAddress; ++import java.util.*; ++import java.util.stream.Collectors; + + public class CraftEventFactory { + public static final DamageSource MELTING = CraftDamageSource.copyOf(DamageSource.BURN); +diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java +index ab43c97e8fdcb977ed6349e4163e8ba115588adf..baa14fe42eb07cdc10cf58580478af585f680697 100644 +--- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java ++++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java +@@ -1,7 +1,5 @@ + package org.bukkit.craftbukkit.generator; + +-import java.util.HashSet; +-import java.util.Set; + import net.minecraft.server.BlockPosition; + import net.minecraft.server.Blocks; + import net.minecraft.server.ChunkSection; +@@ -14,6 +12,9 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.generator.ChunkGenerator; + import org.bukkit.material.MaterialData; + ++import java.util.HashSet; ++import java.util.Set; ++ + /** + * Data to be used for the block types and data in a newly generated chunk. + */ +diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +index b53d44f0c2dd5f4f2033d4017ee9d6e2d0b6e7ae..afdec465f7b739e8f54b2d2127dd1725997e71a2 100644 +--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java ++++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +@@ -2,39 +2,16 @@ package org.bukkit.craftbukkit.generator; + + import com.google.common.base.Preconditions; + import com.mojang.serialization.Codec; +-import java.util.List; +-import java.util.Random; +-import net.minecraft.server.BiomeBase; +-import net.minecraft.server.BiomeManager; +-import net.minecraft.server.BiomeStorage; +-import net.minecraft.server.Block; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.ChunkSection; +-import net.minecraft.server.DefinedStructureManager; +-import net.minecraft.server.DimensionManager; +-import net.minecraft.server.EnumCreatureType; +-import net.minecraft.server.GeneratorAccess; +-import net.minecraft.server.HeightMap; +-import net.minecraft.server.IBlockAccess; +-import net.minecraft.server.IChunkAccess; +-import net.minecraft.server.ITileEntity; +-import net.minecraft.server.ProtoChunk; +-import net.minecraft.server.RegionLimitedWorldAccess; +-import net.minecraft.server.RegistryMaterials; +-import net.minecraft.server.StructureManager; +-import net.minecraft.server.StructureSettings; +-import net.minecraft.server.TileEntity; +-import net.minecraft.server.WorldChunkManager; +-import net.minecraft.server.WorldDimension; +-import net.minecraft.server.WorldGenStage; +-import net.minecraft.server.WorldServer; +-import org.bukkit.World; ++import net.minecraft.server.*; + import org.bukkit.block.Biome; + import org.bukkit.craftbukkit.block.CraftBlock; + import org.bukkit.generator.ChunkGenerator; + import org.bukkit.generator.ChunkGenerator.BiomeGrid; + import org.bukkit.generator.ChunkGenerator.ChunkData; + ++import java.util.List; ++import java.util.Random; ++ + public class CustomChunkGenerator extends InternalChunkGenerator { + private final net.minecraft.server.ChunkGenerator delegate; + private final ChunkGenerator generator; +diff --git a/src/main/java/org/bukkit/craftbukkit/help/CustomIndexHelpTopic.java b/src/main/java/org/bukkit/craftbukkit/help/CustomIndexHelpTopic.java +index 77134d74bdfe9a56e858deb4cdbdef0b1b7ebc58..2089a5f524220178ca231dd569ab0a963552d5be 100644 +--- a/src/main/java/org/bukkit/craftbukkit/help/CustomIndexHelpTopic.java ++++ b/src/main/java/org/bukkit/craftbukkit/help/CustomIndexHelpTopic.java +@@ -1,13 +1,14 @@ + package org.bukkit.craftbukkit.help; + +-import java.util.HashSet; +-import java.util.LinkedList; +-import java.util.List; + import org.bukkit.command.CommandSender; + import org.bukkit.help.HelpMap; + import org.bukkit.help.HelpTopic; + import org.bukkit.help.IndexHelpTopic; + ++import java.util.HashSet; ++import java.util.LinkedList; ++import java.util.List; ++ + /** + */ + public class CustomIndexHelpTopic extends IndexHelpTopic { +diff --git a/src/main/java/org/bukkit/craftbukkit/help/HelpYamlReader.java b/src/main/java/org/bukkit/craftbukkit/help/HelpYamlReader.java +index d3f17d4cde99c4948244f53e6f54326e4f180b99..4b710c12045aa19a42bd62c9008b19dc2b62ff99 100644 +--- a/src/main/java/org/bukkit/craftbukkit/help/HelpYamlReader.java ++++ b/src/main/java/org/bukkit/craftbukkit/help/HelpYamlReader.java +@@ -1,17 +1,18 @@ + package org.bukkit.craftbukkit.help; + + import com.google.common.base.Charsets; ++import org.bukkit.ChatColor; ++import org.bukkit.Server; ++import org.bukkit.configuration.ConfigurationSection; ++import org.bukkit.configuration.file.YamlConfiguration; ++import org.bukkit.help.HelpTopic; ++ + import java.io.File; + import java.io.IOException; + import java.io.InputStreamReader; + import java.util.LinkedList; + import java.util.List; + import java.util.logging.Level; +-import org.bukkit.ChatColor; +-import org.bukkit.Server; +-import org.bukkit.configuration.ConfigurationSection; +-import org.bukkit.configuration.file.YamlConfiguration; +-import org.bukkit.help.HelpTopic; + + /** + * HelpYamlReader is responsible for processing the contents of the help.yml file. +diff --git a/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java b/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java +index 2358ba5bdc64f6c003a2b9f5f36364bf2328a0a8..4a554b5727112cdd8528dfd0df032c049ec77b5e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java ++++ b/src/main/java/org/bukkit/craftbukkit/help/SimpleHelpMap.java +@@ -3,28 +3,13 @@ package org.bukkit.craftbukkit.help; + import com.google.common.base.Predicate; + import com.google.common.base.Predicates; + import com.google.common.collect.Collections2; +-import java.util.Collection; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.TreeMap; +-import java.util.TreeSet; +-import org.bukkit.command.Command; +-import org.bukkit.command.CommandExecutor; +-import org.bukkit.command.MultipleCommandAlias; +-import org.bukkit.command.PluginCommand; +-import org.bukkit.command.PluginIdentifiableCommand; ++import org.bukkit.command.*; + import org.bukkit.command.defaults.BukkitCommand; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.command.VanillaCommandWrapper; +-import org.bukkit.help.GenericCommandHelpTopic; +-import org.bukkit.help.HelpMap; +-import org.bukkit.help.HelpTopic; +-import org.bukkit.help.HelpTopicComparator; +-import org.bukkit.help.HelpTopicFactory; +-import org.bukkit.help.IndexHelpTopic; ++import org.bukkit.help.*; ++ ++import java.util.*; + + /** + * Standard implementation of {@link HelpMap} for CraftBukkit servers. +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +index 8c714c7430c0a6b8fd7f4a158d9a271e1642bd7a..22102f154964dafd1ee61eae85fdd7006237c9e5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +@@ -1,34 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + +-import net.minecraft.server.ChatComponentText; +-import net.minecraft.server.Container; +-import net.minecraft.server.ContainerAnvil; +-import net.minecraft.server.ContainerBeacon; +-import net.minecraft.server.ContainerBlastFurnace; +-import net.minecraft.server.ContainerBrewingStand; +-import net.minecraft.server.ContainerCartography; +-import net.minecraft.server.ContainerChest; +-import net.minecraft.server.ContainerDispenser; +-import net.minecraft.server.ContainerEnchantTable; +-import net.minecraft.server.ContainerFurnaceFurnace; +-import net.minecraft.server.ContainerGrindstone; +-import net.minecraft.server.ContainerHopper; +-import net.minecraft.server.ContainerLectern; +-import net.minecraft.server.ContainerLoom; +-import net.minecraft.server.ContainerMerchant; +-import net.minecraft.server.ContainerProperties; +-import net.minecraft.server.ContainerShulkerBox; +-import net.minecraft.server.ContainerSmithing; +-import net.minecraft.server.ContainerSmoker; +-import net.minecraft.server.ContainerStonecutter; +-import net.minecraft.server.ContainerWorkbench; +-import net.minecraft.server.Containers; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.IInventory; +-import net.minecraft.server.ItemStack; +-import net.minecraft.server.PacketPlayOutOpenWindow; +-import net.minecraft.server.PlayerInventory; +-import net.minecraft.server.Slot; ++import net.minecraft.server.*; + import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.bukkit.entity.HumanEntity; + import org.bukkit.event.inventory.InventoryType; +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +index 7fa5aaff44b44b60d0ddcf08f7e94dbeef4de422..afb6129036c4dd633bb4ecb3b55bb808bb47c751 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +@@ -1,23 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + +-import java.util.HashMap; +-import java.util.List; +-import java.util.ListIterator; +-import net.minecraft.server.IHopper; +-import net.minecraft.server.IInventory; +-import net.minecraft.server.InventoryCrafting; +-import net.minecraft.server.InventoryEnderChest; +-import net.minecraft.server.InventoryMerchant; +-import net.minecraft.server.PlayerInventory; +-import net.minecraft.server.TileEntityBarrel; +-import net.minecraft.server.TileEntityBlastFurnace; +-import net.minecraft.server.TileEntityBrewingStand; +-import net.minecraft.server.TileEntityDispenser; +-import net.minecraft.server.TileEntityDropper; +-import net.minecraft.server.TileEntityFurnace; +-import net.minecraft.server.TileEntityLectern; +-import net.minecraft.server.TileEntityShulkerBox; +-import net.minecraft.server.TileEntitySmoker; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.Location; + import org.bukkit.Material; +@@ -28,6 +11,10 @@ import org.bukkit.inventory.Inventory; + import org.bukkit.inventory.InventoryHolder; + import org.bukkit.inventory.ItemStack; + ++import java.util.HashMap; ++import java.util.List; ++import java.util.ListIterator; ++ + public class CraftInventory implements Inventory { + protected final IInventory inventory; + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java +index 3cf4cd5fa8d7075f7fcc4fd33b002b554ae2cf71..947556832791dcc633c7318c041e694bd45d8b8c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java +@@ -1,13 +1,14 @@ + package org.bukkit.craftbukkit.inventory; + +-import java.util.Arrays; +-import java.util.List; + import net.minecraft.server.IInventory; + import net.minecraft.server.IRecipe; + import org.bukkit.inventory.CraftingInventory; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.Recipe; + ++import java.util.Arrays; ++import java.util.List; ++ + public class CraftInventoryCrafting extends CraftInventory implements CraftingInventory { + private final IInventory resultInventory; + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java +index e1dfdb23f7d755b19cf14c0bf15358095406e9a0..09ba087b7b32ae3a38187a7174444c2a9b1fba3e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java +@@ -1,8 +1,5 @@ + package org.bukkit.craftbukkit.inventory; + +-import java.util.ArrayList; +-import java.util.Iterator; +-import java.util.List; + import net.minecraft.server.EntityHuman; + import net.minecraft.server.IInventory; + import net.minecraft.server.ItemStack; +@@ -14,6 +11,10 @@ import org.bukkit.entity.HumanEntity; + import org.bukkit.event.inventory.InventoryType; + import org.bukkit.inventory.InventoryHolder; + ++import java.util.ArrayList; ++import java.util.Iterator; ++import java.util.List; ++ + public class CraftInventoryCustom extends CraftInventory { + public CraftInventoryCustom(InventoryHolder owner, InventoryType type) { + super(new MinecraftInventory(owner, type)); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +index addb8ef990de3dfbf74969ef4c22276d2fa2614a..967eb9ab814b594247bf999b017af5c38ac3fb4f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +@@ -1,16 +1,12 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.bukkit.craftbukkit.inventory.CraftMetaItem.*; + import com.google.common.collect.ImmutableMap; +-import java.util.Map; +-import net.minecraft.server.EnchantmentManager; + import net.minecraft.server.Item; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.NBTTagList; + import org.apache.commons.lang.Validate; + import org.bukkit.Material; + import org.bukkit.configuration.serialization.DelegateDeserialization; +-import org.bukkit.craftbukkit.enchantments.CraftEnchantment; + import org.bukkit.craftbukkit.util.CraftLegacy; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; +@@ -19,6 +15,11 @@ import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.meta.ItemMeta; + import org.bukkit.material.MaterialData; + ++import java.util.Map; ++ ++import static org.bukkit.craftbukkit.inventory.CraftMetaItem.ENCHANTMENTS_ID; ++import static org.bukkit.craftbukkit.inventory.CraftMetaItem.ENCHANTMENTS_LVL; ++ + @DelegateDeserialization(ItemStack.class) + public final class CraftItemStack extends ItemStack { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java +index 50bc720d4268804f53b204091c9e8f0c17d8dd23..8cfc359da6caff1e0112cf87c2cb4b025f5add0f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java +@@ -2,8 +2,6 @@ package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Function; + import com.google.common.collect.Lists; +-import java.util.Collections; +-import java.util.List; + import net.minecraft.server.EntityHuman; + import net.minecraft.server.IMerchant; + import net.minecraft.server.MerchantRecipeList; +@@ -11,6 +9,9 @@ import org.bukkit.entity.HumanEntity; + import org.bukkit.inventory.Merchant; + import org.bukkit.inventory.MerchantRecipe; + ++import java.util.Collections; ++import java.util.List; ++ + public class CraftMerchant implements Merchant { + + protected final IMerchant merchant; +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java +index 9f6e797d34e5ad21a496c89f5a45ddb0638d3adc..749b5facb60df384b48d492a08dde0df65dec49e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java +@@ -1,15 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + +-import net.minecraft.server.ChatComponentText; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.IChatBaseComponent; +-import net.minecraft.server.IMerchant; +-import net.minecraft.server.ItemStack; +-import net.minecraft.server.MerchantRecipe; +-import net.minecraft.server.MerchantRecipeList; +-import net.minecraft.server.SoundEffect; +-import net.minecraft.server.SoundEffects; +-import net.minecraft.server.World; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + + public class CraftMerchantCustom extends CraftMerchant { +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java +index e198251617bfd6b0fe932d8bfa5dfcafdac919c2..058bc9839f18d14115611442710eeb3a0d41e1b1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java +@@ -1,10 +1,11 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Preconditions; +-import java.util.List; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.MerchantRecipe; + ++import java.util.List; ++ + public class CraftMerchantRecipe extends MerchantRecipe { + + private final net.minecraft.server.MerchantRecipe handle; +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java +index 25b310ad3f1bcefd04406b7efd1ffa82519250e1..9f8364761421e75d6e57dfb8b888066d64cbaf2f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java +@@ -1,12 +1,13 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.Map; + import net.minecraft.server.NBTBase; + import net.minecraft.server.NBTTagCompound; + import org.bukkit.Material; + import org.bukkit.configuration.serialization.DelegateDeserialization; + ++import java.util.Map; ++ + @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) + public class CraftMetaArmorStand extends CraftMetaItem implements com.destroystokyo.paper.inventory.meta.ArmorStandMeta { // Paper + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java +index 87a19622cfcc1e87b3648c3aa11e3d983dd8f624..bd73063c3b9c79c07e4224f5ab741a704c51c6a0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java +@@ -2,9 +2,6 @@ package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; +-import java.util.ArrayList; +-import java.util.List; +-import java.util.Map; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.NBTTagList; + import org.bukkit.DyeColor; +@@ -15,6 +12,10 @@ import org.bukkit.configuration.serialization.DelegateDeserialization; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.meta.BannerMeta; + ++import java.util.ArrayList; ++import java.util.List; ++import java.util.Map; ++ + @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) + public class CraftMetaBanner extends CraftMetaItem implements BannerMeta { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java +index 852e793c0c24bf42f9eb3a5b88e7d0328c7c86fd..83552ce9ba2f7580abc82ef919e918584be150dd 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java +@@ -2,75 +2,17 @@ package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Objects; + import com.google.common.collect.ImmutableMap; +-import java.util.Map; +-import net.minecraft.server.EnumColor; +-import net.minecraft.server.NBTBase; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.TileEntity; +-import net.minecraft.server.TileEntityBanner; +-import net.minecraft.server.TileEntityBarrel; +-import net.minecraft.server.TileEntityBeacon; +-import net.minecraft.server.TileEntityBeehive; +-import net.minecraft.server.TileEntityBell; +-import net.minecraft.server.TileEntityBlastFurnace; +-import net.minecraft.server.TileEntityBrewingStand; +-import net.minecraft.server.TileEntityCampfire; +-import net.minecraft.server.TileEntityChest; +-import net.minecraft.server.TileEntityCommand; +-import net.minecraft.server.TileEntityComparator; +-import net.minecraft.server.TileEntityDispenser; +-import net.minecraft.server.TileEntityDropper; +-import net.minecraft.server.TileEntityEnchantTable; +-import net.minecraft.server.TileEntityEndGateway; +-import net.minecraft.server.TileEntityEnderChest; +-import net.minecraft.server.TileEntityFurnaceFurnace; +-import net.minecraft.server.TileEntityHopper; +-import net.minecraft.server.TileEntityJigsaw; +-import net.minecraft.server.TileEntityJukeBox; +-import net.minecraft.server.TileEntityLectern; +-import net.minecraft.server.TileEntityLightDetector; +-import net.minecraft.server.TileEntityMobSpawner; +-import net.minecraft.server.TileEntityShulkerBox; +-import net.minecraft.server.TileEntitySign; +-import net.minecraft.server.TileEntitySkull; +-import net.minecraft.server.TileEntitySmoker; +-import net.minecraft.server.TileEntityStructure; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.Material; + import org.bukkit.block.BlockState; + import org.bukkit.configuration.serialization.DelegateDeserialization; +-import org.bukkit.craftbukkit.block.CraftBanner; +-import org.bukkit.craftbukkit.block.CraftBarrel; +-import org.bukkit.craftbukkit.block.CraftBeacon; +-import org.bukkit.craftbukkit.block.CraftBeehive; +-import org.bukkit.craftbukkit.block.CraftBell; +-import org.bukkit.craftbukkit.block.CraftBlastFurnace; +-import org.bukkit.craftbukkit.block.CraftBlockEntityState; +-import org.bukkit.craftbukkit.block.CraftBrewingStand; +-import org.bukkit.craftbukkit.block.CraftCampfire; +-import org.bukkit.craftbukkit.block.CraftChest; +-import org.bukkit.craftbukkit.block.CraftCommandBlock; +-import org.bukkit.craftbukkit.block.CraftComparator; +-import org.bukkit.craftbukkit.block.CraftCreatureSpawner; +-import org.bukkit.craftbukkit.block.CraftDaylightDetector; +-import org.bukkit.craftbukkit.block.CraftDispenser; +-import org.bukkit.craftbukkit.block.CraftDropper; +-import org.bukkit.craftbukkit.block.CraftEnchantingTable; +-import org.bukkit.craftbukkit.block.CraftEndGateway; +-import org.bukkit.craftbukkit.block.CraftEnderChest; +-import org.bukkit.craftbukkit.block.CraftFurnaceFurnace; +-import org.bukkit.craftbukkit.block.CraftHopper; +-import org.bukkit.craftbukkit.block.CraftJigsaw; +-import org.bukkit.craftbukkit.block.CraftJukebox; +-import org.bukkit.craftbukkit.block.CraftLectern; +-import org.bukkit.craftbukkit.block.CraftShulkerBox; +-import org.bukkit.craftbukkit.block.CraftSign; +-import org.bukkit.craftbukkit.block.CraftSkull; +-import org.bukkit.craftbukkit.block.CraftSmoker; +-import org.bukkit.craftbukkit.block.CraftStructureBlock; ++import org.bukkit.craftbukkit.block.*; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.meta.BlockStateMeta; + ++import java.util.Map; ++ + @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) + public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +index 95ec299687cd4410146f71bd3429bd12ac291a26..abfa2f837b56b33dacba62e656badcc50da75960 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +@@ -2,9 +2,8 @@ package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.ArrayList; +-import java.util.List; +-import java.util.Map; ++import net.md_5.bungee.api.chat.BaseComponent; ++import net.md_5.bungee.chat.ComponentSerializer; + import net.minecraft.server.IChatBaseComponent; + import net.minecraft.server.IChatBaseComponent.ChatSerializer; + import net.minecraft.server.NBTTagCompound; +@@ -18,11 +17,12 @@ import org.bukkit.craftbukkit.util.CraftChatMessage; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.meta.BookMeta; + +-// Spigot start +-import static org.spigotmc.ValidateUtils.*; + import java.util.AbstractList; +-import net.md_5.bungee.api.chat.BaseComponent; +-import net.md_5.bungee.chat.ComponentSerializer; ++import java.util.ArrayList; ++import java.util.List; ++import java.util.Map; ++ ++import static org.spigotmc.ValidateUtils.limit; + // Spigot end + + @DelegateDeserialization(SerializableMeta.class) +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java +index 0ea7a9606b529ed6b8fa12d4e285e0eaea2fa93d..be4ba6b96b5936dbfeaeb227ab7941749d37d84e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.Map; + import net.minecraft.server.IChatBaseComponent; + import net.minecraft.server.IChatBaseComponent.ChatSerializer; + import net.minecraft.server.NBTTagCompound; +@@ -13,6 +12,8 @@ import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.meta.BookMeta; + ++import java.util.Map; ++ + @DelegateDeserialization(SerializableMeta.class) + class CraftMetaBookSigned extends CraftMetaBook implements BookMeta { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCharge.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCharge.java +index 1ff9ff3f2e97dba2befb4b9f6826cd4aa70c44b9..99e6adf08dda31a72f7d18bfe360b03fd530d108 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCharge.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCharge.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.Map; + import net.minecraft.server.NBTTagCompound; + import org.bukkit.FireworkEffect; + import org.bukkit.Material; +@@ -9,6 +8,8 @@ import org.bukkit.configuration.serialization.DelegateDeserialization; + import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; + import org.bukkit.inventory.meta.FireworkEffectMeta; + ++import java.util.Map; ++ + @DelegateDeserialization(SerializableMeta.class) + class CraftMetaCharge extends CraftMetaItem implements FireworkEffectMeta { + static final ItemMetaKey EXPLOSION = new ItemMetaKey("Explosion", "firework-effect"); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCompass.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCompass.java +index 974246499c097e61c33fff857a371a208dbfaded..bc8d3c4824e7c20663a0d9437c7cbc5ca98a6cbe 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCompass.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCompass.java +@@ -3,13 +3,7 @@ package org.bukkit.craftbukkit.inventory; + import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableMap.Builder; + import com.mojang.serialization.DataResult; +-import java.util.Map; +-import java.util.Optional; +-import net.minecraft.server.DynamicOpsNBT; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.NBTBase; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.ResourceKey; ++import net.minecraft.server.*; + import org.bukkit.Location; + import org.bukkit.Material; + import org.bukkit.World; +@@ -17,6 +11,9 @@ import org.bukkit.configuration.serialization.DelegateDeserialization; + import org.bukkit.craftbukkit.CraftWorld; + import org.bukkit.inventory.meta.CompassMeta; + ++import java.util.Map; ++import java.util.Optional; ++ + @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) + public class CraftMetaCompass extends CraftMetaItem implements CompassMeta { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCrossbow.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCrossbow.java +index 8d3d39943c3ee3bd7dca34b20f46b35c7fa8bffe..75259908f08782b1d9f34ad419b0305694651626 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCrossbow.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCrossbow.java +@@ -3,9 +3,6 @@ package org.bukkit.craftbukkit.inventory; + import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; +-import java.util.ArrayList; +-import java.util.List; +-import java.util.Map; + import net.minecraft.server.ItemArrow; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.NBTTagList; +@@ -15,6 +12,10 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.meta.CrossbowMeta; + ++import java.util.ArrayList; ++import java.util.List; ++import java.util.Map; ++ + @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) + public class CraftMetaCrossbow extends CraftMetaItem implements CrossbowMeta { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java +index f5feea20716cd5e1586a71676fa3272e12d1663f..bcc3b23e39e4e4516655f0b725077567c7fd3ad4 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java +@@ -2,8 +2,6 @@ package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.HashMap; +-import java.util.Map; + import net.minecraft.server.NBTTagCompound; + import org.bukkit.Material; + import org.bukkit.configuration.serialization.DelegateDeserialization; +@@ -11,6 +9,9 @@ import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; + import org.bukkit.enchantments.Enchantment; + import org.bukkit.inventory.meta.EnchantmentStorageMeta; + ++import java.util.HashMap; ++import java.util.Map; ++ + @DelegateDeserialization(SerializableMeta.class) + class CraftMetaEnchantedBook extends CraftMetaItem implements EnchantmentStorageMeta { + static final ItemMetaKey STORED_ENCHANTMENTS = new ItemMetaKey("StoredEnchantments", "stored-enchants"); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java +index 325fec72abeaaeae9cb0a38d144b1a5fb123fb74..53f8d13e99019501e85a9a151e948799160a1d46 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEntityTag.java +@@ -1,12 +1,13 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.Map; + import net.minecraft.server.NBTBase; + import net.minecraft.server.NBTTagCompound; + import org.bukkit.Material; + import org.bukkit.configuration.serialization.DelegateDeserialization; + ++import java.util.Map; ++ + @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) + public class CraftMetaEntityTag extends CraftMetaItem { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +index e57a0ebf327843c1dc7e33cf48899a938b4d2b04..54820c36311d5bd2a7d5f600ec3deaf92e81b85c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +@@ -2,10 +2,6 @@ package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.ArrayList; +-import java.util.Collection; +-import java.util.List; +-import java.util.Map; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.NBTTagList; + import org.apache.commons.lang.Validate; +@@ -20,6 +16,11 @@ import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.meta.FireworkMeta; + ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.List; ++import java.util.Map; ++ + @DelegateDeserialization(SerializableMeta.class) + class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { + /* +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +index fe27e2f51a7d734cb874f9fd87c15ccb6f5c63fa..23df1af99051e565f03f63f0b5a9acc55575b22f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +@@ -1,40 +1,12 @@ + package org.bukkit.craftbukkit.inventory; + ++import com.destroystokyo.paper.Namespaced; ++import com.destroystokyo.paper.NamespacedTag; + import com.google.common.base.Preconditions; + import com.google.common.base.Strings; +-import com.google.common.collect.ImmutableList; +-import com.google.common.collect.ImmutableMap; +-import com.google.common.collect.ImmutableMultimap; +-import com.google.common.collect.LinkedHashMultimap; +-import com.google.common.collect.ImmutableSortedMap; // Paper +-import com.google.common.collect.Lists; +-import com.google.common.collect.Multimap; +-import com.google.common.collect.SetMultimap; +-import com.google.common.collect.Sets; ++import com.google.common.collect.*; + import com.google.gson.JsonParseException; +-import java.io.ByteArrayInputStream; +-import java.io.ByteArrayOutputStream; +-import java.io.IOException; +-import java.lang.annotation.ElementType; +-import java.lang.annotation.Retention; +-import java.lang.annotation.RetentionPolicy; +-import java.lang.annotation.Target; +-import java.lang.reflect.Constructor; +-import java.lang.reflect.InvocationTargetException; +-import java.util.*; +-import java.util.logging.Level; +-import java.util.logging.Logger; +-import javax.annotation.Nonnull; +-import javax.annotation.Nullable; +-import net.minecraft.server.ChatComponentText; +-import net.minecraft.server.EnumItemSlot; +-import net.minecraft.server.IChatBaseComponent; +-import net.minecraft.server.ItemBlock; +-import net.minecraft.server.NBTBase; +-import net.minecraft.server.NBTCompressedStreamTools; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.NBTTagList; +-import net.minecraft.server.NBTTagString; ++import net.minecraft.server.*; + import org.apache.commons.codec.binary.Base64; + import org.apache.commons.lang.Validate; + import org.apache.commons.lang3.EnumUtils; +@@ -69,13 +41,22 @@ import org.bukkit.inventory.meta.Repairable; + import org.bukkit.inventory.meta.tags.CustomItemTagContainer; + import org.bukkit.persistence.PersistentDataContainer; + +-// Spigot start +-import static org.spigotmc.ValidateUtils.*; +-// Spigot end ++import javax.annotation.Nonnull; ++import javax.annotation.Nullable; ++import java.io.ByteArrayInputStream; ++import java.io.ByteArrayOutputStream; ++import java.io.IOException; ++import java.lang.annotation.ElementType; ++import java.lang.annotation.Retention; ++import java.lang.annotation.RetentionPolicy; ++import java.lang.annotation.Target; ++import java.lang.reflect.Constructor; ++import java.lang.reflect.InvocationTargetException; ++import java.util.*; ++import java.util.logging.Level; ++import java.util.logging.Logger; + +-// Paper start +-import com.destroystokyo.paper.Namespaced; +-import com.destroystokyo.paper.NamespacedTag; ++import static org.spigotmc.ValidateUtils.limit; + // Paper end + + /** +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java +index 8c86fe2084d5022a2fdd4d4d8d5dca045fe45f82..40d22683be2b0da5c2d11898bb8df81d3c07a19a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaKnowledgeBook.java +@@ -1,10 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.ArrayList; +-import java.util.Collections; +-import java.util.List; +-import java.util.Map; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.NBTTagList; + import net.minecraft.server.NBTTagString; +@@ -15,6 +11,11 @@ import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; + import org.bukkit.inventory.meta.KnowledgeBookMeta; + ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.List; ++import java.util.Map; ++ + @DelegateDeserialization(SerializableMeta.class) + public class CraftMetaKnowledgeBook extends CraftMetaItem implements KnowledgeBookMeta { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java +index 01f6bef68acc78dadb5d083ef698633049af4dfb..7e6270f78175e382f7823f2e15edada74fe7cb7c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.bukkit.craftbukkit.inventory.CraftItemFactory.*; + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.Map; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.NBTTagInt; + import org.bukkit.Color; +@@ -11,6 +9,10 @@ import org.bukkit.configuration.serialization.DelegateDeserialization; + import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; + import org.bukkit.inventory.meta.LeatherArmorMeta; + ++import java.util.Map; ++ ++import static org.bukkit.craftbukkit.inventory.CraftItemFactory.DEFAULT_LEATHER_COLOR; ++ + @DelegateDeserialization(SerializableMeta.class) + class CraftMetaLeatherArmor extends CraftMetaItem implements LeatherArmorMeta { + static final ItemMetaKey COLOR = new ItemMetaKey("color"); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java +index edfe1f773c3688efb78603f74f2d70eb8e0b6401..985acb4a685e0010c323a7a14e92162f46f78d8e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java +@@ -2,7 +2,6 @@ package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableMap; +-import java.util.Map; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.NBTTagInt; + import net.minecraft.server.NBTTagString; +@@ -15,6 +14,8 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.meta.MapMeta; + import org.bukkit.map.MapView; + ++import java.util.Map; ++ + @DelegateDeserialization(SerializableMeta.class) + class CraftMetaMap extends CraftMetaItem implements MapMeta { + static final ItemMetaKey MAP_SCALING = new ItemMetaKey("map_is_scaling", "scaling"); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java +index f4374ac95bc33715f8f7f59c1677838771366439..ab3aefae8185733b70f9b8dd000ae8b68a049c0b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java +@@ -2,10 +2,6 @@ package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.ArrayList; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.NBTTagList; + import org.apache.commons.lang.Validate; +@@ -21,6 +17,11 @@ import org.bukkit.potion.PotionEffect; + import org.bukkit.potion.PotionEffectType; + import org.bukkit.potion.PotionType; + ++import java.util.ArrayList; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++ + @DelegateDeserialization(SerializableMeta.class) + class CraftMetaPotion extends CraftMetaItem implements PotionMeta { + static final ItemMetaKey AMPLIFIER = new ItemMetaKey("Amplifier", "amplifier"); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +index 21e7a661739da84e6ec7a20c81cefcb0440484a2..003ac1dfe80f7dadb82c178556581ab928e83a15 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +@@ -1,10 +1,9 @@ + package org.bukkit.craftbukkit.inventory; + +-import com.google.common.collect.ImmutableMap.Builder; +-import com.mojang.authlib.GameProfile; +-import java.util.Map; + import com.destroystokyo.paper.profile.CraftPlayerProfile; + import com.destroystokyo.paper.profile.PlayerProfile; ++import com.google.common.collect.ImmutableMap.Builder; ++import com.mojang.authlib.GameProfile; + import net.minecraft.server.GameProfileSerializer; + import net.minecraft.server.NBTBase; + import net.minecraft.server.NBTTagCompound; +@@ -19,6 +18,7 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.meta.SkullMeta; + + import javax.annotation.Nullable; ++import java.util.Map; + @DelegateDeserialization(SerializableMeta.class) + class CraftMetaSkull extends CraftMetaItem implements SkullMeta { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +index 592017c8196b0af8f61a94503e691fca280fd110..c185f76f66ca19a332689f4ad41a72a914ebff6c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.Map; + import net.minecraft.server.MinecraftKey; + import net.minecraft.server.NBTBase; + import net.minecraft.server.NBTTagCompound; +@@ -12,6 +11,8 @@ import org.bukkit.entity.EntityType; + import org.bukkit.inventory.meta.SpawnEggMeta; + import org.bukkit.material.MaterialData; + ++import java.util.Map; ++ + @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) + public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java +index 00bacfe74c83f9af41c732a3e63ecdf6640c8653..8749a022df994829de6542eedd4299e10f0c4cb8 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java +@@ -2,10 +2,6 @@ package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap.Builder; +-import java.util.ArrayList; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; + import net.minecraft.server.NBTTagCompound; + import net.minecraft.server.NBTTagList; + import org.apache.commons.lang.Validate; +@@ -16,6 +12,11 @@ import org.bukkit.inventory.meta.SuspiciousStewMeta; + import org.bukkit.potion.PotionEffect; + import org.bukkit.potion.PotionEffectType; + ++import java.util.ArrayList; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++ + @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) + public class CraftMetaSuspiciousStew extends CraftMetaItem implements SuspiciousStewMeta { + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java +index 134f40f30198f13a4a3381bb00921703c477989e..9616e83bb2cea9e1df03cfb7d93e1c2279e84221 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.collect.ImmutableMap; +-import java.util.Map; + import net.minecraft.server.NBTBase; + import net.minecraft.server.NBTTagCompound; + import org.bukkit.DyeColor; +@@ -13,6 +12,8 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.entity.TropicalFish; + import org.bukkit.inventory.meta.TropicalFishBucketMeta; + ++import java.util.Map; ++ + @DelegateDeserialization(SerializableMeta.class) + class CraftMetaTropicalFishBucket extends CraftMetaItem implements TropicalFishBucketMeta { + static final ItemMetaKey VARIANT = new ItemMetaKey("BucketVariantTag", "fish-variant"); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java +index ef29599a89bc630899c65df9a7004f836787d95e..e0f5ea21b64abcae53a2cf642e4305ca903cc596 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java +@@ -1,13 +1,14 @@ + package org.bukkit.craftbukkit.inventory; + +-import java.util.ArrayList; +-import java.util.List; + import net.minecraft.server.RecipeItemStack; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.Recipe; + import org.bukkit.inventory.RecipeChoice; + ++import java.util.ArrayList; ++import java.util.List; ++ + public interface CraftRecipe extends Recipe { + + void addToCraftingManager(); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java +index 99cfbaf90b5ccd828834b33b3c658206efd6ac21..b45809508ee30d299e41c97c4e40923396065741 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java +@@ -1,9 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import net.minecraft.server.IInventory; +- +-import org.bukkit.inventory.AbstractHorseInventory; +-import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.SaddledHorseInventory; + + public class CraftSaddledInventory extends CraftInventoryAbstractHorse implements SaddledHorseInventory { +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapedRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapedRecipe.java +index 6dbd249f54a0c36b7f2dc8857c462e8e17b6a4b2..1e2c6d2ca690262dedd8e9ea620e68400c1bfe2c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapedRecipe.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapedRecipe.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.inventory; + +-import java.util.Map; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.NonNullList; + import net.minecraft.server.RecipeItemStack; +@@ -11,6 +10,8 @@ import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.RecipeChoice; + import org.bukkit.inventory.ShapedRecipe; + ++import java.util.Map; ++ + public class CraftShapedRecipe extends ShapedRecipe implements CraftRecipe { + // TODO: Could eventually use this to add a matches() method or some such + private ShapedRecipes recipe; +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java +index 4aba511fe8078164bf1467b39645dd9bf6a931e7..344a06f88ae460320bc8134fdd9a938a5fb9d786 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.inventory; + +-import java.util.List; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.NonNullList; + import net.minecraft.server.RecipeItemStack; +@@ -11,6 +10,8 @@ import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.RecipeChoice; + import org.bukkit.inventory.ShapelessRecipe; + ++import java.util.List; ++ + public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe { + // TODO: Could eventually use this to add a matches() method or some such + private ShapelessRecipes recipe; +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/InventoryIterator.java b/src/main/java/org/bukkit/craftbukkit/inventory/InventoryIterator.java +index de558eef3fa03d770ee44d3250e49408db64c81b..f3888f278e9fa514894e97d2fb3ecce32ff1551d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/InventoryIterator.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/InventoryIterator.java +@@ -1,9 +1,10 @@ + package org.bukkit.craftbukkit.inventory; + +-import java.util.ListIterator; + import org.bukkit.inventory.Inventory; + import org.bukkit.inventory.ItemStack; + ++import java.util.ListIterator; ++ + public class InventoryIterator implements ListIterator { + private final Inventory inventory; + private int nextIndex; +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/RecipeIterator.java b/src/main/java/org/bukkit/craftbukkit/inventory/RecipeIterator.java +index 1223bfc7f5de3bafe283f6289c413c9848bf6f08..fd4d4ef6931c9a1262077d85c225a3817d174d11 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/RecipeIterator.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/RecipeIterator.java +@@ -1,14 +1,15 @@ + package org.bukkit.craftbukkit.inventory; + + import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; +-import java.util.Iterator; +-import java.util.Map; + import net.minecraft.server.IRecipe; + import net.minecraft.server.MinecraftKey; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.Recipes; + import org.bukkit.inventory.Recipe; + ++import java.util.Iterator; ++import java.util.Map; ++ + public class RecipeIterator implements Iterator { + private final Iterator, Object2ObjectLinkedOpenHashMap>>> recipes; + private Iterator> current; +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/tags/DeprecatedCustomTagContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/tags/DeprecatedCustomTagContainer.java +index 3ef217b0821fc4b9e759e1667840d07124ba33f8..94e59710d814d8c252c4cfcd3245208da7e3cfcc 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/tags/DeprecatedCustomTagContainer.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/tags/DeprecatedCustomTagContainer.java +@@ -1,12 +1,13 @@ + package org.bukkit.craftbukkit.inventory.tags; + +-import java.util.Objects; + import org.bukkit.NamespacedKey; + import org.bukkit.inventory.meta.tags.CustomItemTagContainer; + import org.bukkit.inventory.meta.tags.ItemTagAdapterContext; + import org.bukkit.inventory.meta.tags.ItemTagType; + import org.bukkit.persistence.PersistentDataContainer; + ++import java.util.Objects; ++ + /** + * The {@link DeprecatedCustomTagContainer} is a simply wrapper implementation + * that wraps the new api to still be usable with the old api parts. +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java +index c1db7104e398df484f1e5400e98714aefd3315f2..3ede4449ecd40c2f15d076b27b284d054f02c1c6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java +@@ -1,11 +1,12 @@ + package org.bukkit.craftbukkit.inventory.util; + +-import java.util.HashMap; +-import java.util.Map; + import org.bukkit.event.inventory.InventoryType; + import org.bukkit.inventory.Inventory; + import org.bukkit.inventory.InventoryHolder; + ++import java.util.HashMap; ++import java.util.Map; ++ + public final class CraftInventoryCreator { + + public static final CraftInventoryCreator INSTANCE = new CraftInventoryCreator(); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java +index ad91eabb47511268d0cf307d941070800ce9bd3f..d89b7e68aa4c91e569e0d9e96d76d0c85dd9a21a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java +@@ -1,19 +1,6 @@ + package org.bukkit.craftbukkit.inventory.util; + +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.IInventory; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.TileEntityBlastFurnace; +-import net.minecraft.server.TileEntityBrewingStand; +-import net.minecraft.server.TileEntityDispenser; +-import net.minecraft.server.TileEntityDropper; +-import net.minecraft.server.TileEntityFurnace; +-import net.minecraft.server.TileEntityFurnaceFurnace; +-import net.minecraft.server.TileEntityHopper; +-import net.minecraft.server.TileEntityLectern; +-import net.minecraft.server.TileEntityLootable; +-import net.minecraft.server.TileEntitySmoker; +-import net.minecraft.server.World; ++import net.minecraft.server.*; + import org.bukkit.craftbukkit.inventory.CraftInventory; + import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer; + import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace; +diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +index b14333ce9e6921024bc93c2847b84f1fb40a5508..4d93b4a6670d1e13e6ec5123d91170a5b47122f1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java ++++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +@@ -2,35 +2,14 @@ package org.bukkit.craftbukkit.legacy; + + import com.google.common.base.Preconditions; + import com.mojang.serialization.Dynamic; +-import java.util.Arrays; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Map; +-import java.util.Optional; +-import java.util.Set; +-import net.minecraft.server.Block; +-import net.minecraft.server.BlockStateList; +-import net.minecraft.server.Blocks; +-import net.minecraft.server.DataConverterFlattenData; +-import net.minecraft.server.DataConverterMaterialId; +-import net.minecraft.server.DataConverterRegistry; +-import net.minecraft.server.DataConverterTypes; +-import net.minecraft.server.DispenserRegistry; +-import net.minecraft.server.DynamicOpsNBT; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IBlockState; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.Item; +-import net.minecraft.server.Items; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.NBTBase; +-import net.minecraft.server.NBTTagCompound; ++import net.minecraft.server.*; + import org.bukkit.Material; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.entity.EntityType; + import org.bukkit.material.MaterialData; + ++import java.util.*; ++ + /** + * This class may seem unnecessarily slow and complicated/repetitive however it + * is able to handle a lot more edge cases and invertible transformations (many +diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapCanvas.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapCanvas.java +index a4bf147e9b43173f5e7b7d68a9b6109437bac4e1..2cca3eb7ca279c4bb6efbbe048ce2227c8c962d6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapCanvas.java ++++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapCanvas.java +@@ -1,13 +1,14 @@ + package org.bukkit.craftbukkit.map; + +-import java.awt.Image; +-import java.util.Arrays; + import org.bukkit.map.MapCanvas; + import org.bukkit.map.MapCursorCollection; + import org.bukkit.map.MapFont; + import org.bukkit.map.MapFont.CharacterSprite; + import org.bukkit.map.MapPalette; + ++import java.awt.*; ++import java.util.Arrays; ++ + public class CraftMapCanvas implements MapCanvas { + + private final byte[] buffer = new byte[128 * 128]; +diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java +index 2c21c5a44d318a548719c8ce379b9c0daf9ef228..6592b115cdfb5e9a182a6232505770da16add13f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java ++++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java +@@ -1,11 +1,5 @@ + package org.bukkit.craftbukkit.map; + +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.logging.Level; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.ResourceKey; + import net.minecraft.server.WorldMap; +@@ -17,6 +11,9 @@ import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.bukkit.map.MapRenderer; + import org.bukkit.map.MapView; + ++import java.util.*; ++import java.util.logging.Level; ++ + public final class CraftMapView implements MapView { + + private final Map renderCache = new HashMap(); +diff --git a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java +index 5768cd512ec166f1e8d1f4a28792015347297c3f..816d2536027cc960028a675211421d01b6816222 100644 +--- a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java ++++ b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java +@@ -1,8 +1,9 @@ + package org.bukkit.craftbukkit.map; + +-import java.util.ArrayList; + import org.bukkit.map.MapCursor; + ++import java.util.ArrayList; ++ + public class RenderData { + + public byte[] buffer; // Paper +diff --git a/src/main/java/org/bukkit/craftbukkit/metadata/BlockMetadataStore.java b/src/main/java/org/bukkit/craftbukkit/metadata/BlockMetadataStore.java +index b3659e4c1332268abda919b3a0f0493f7978aad2..8935a6d81251cc854cb19c6face4d525ac83e6ca 100644 +--- a/src/main/java/org/bukkit/craftbukkit/metadata/BlockMetadataStore.java ++++ b/src/main/java/org/bukkit/craftbukkit/metadata/BlockMetadataStore.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.metadata; + +-import java.util.List; + import org.bukkit.World; + import org.bukkit.block.Block; + import org.bukkit.metadata.MetadataStore; +@@ -8,6 +7,8 @@ import org.bukkit.metadata.MetadataStoreBase; + import org.bukkit.metadata.MetadataValue; + import org.bukkit.plugin.Plugin; + ++import java.util.List; ++ + /** + * A BlockMetadataStore stores metadata values for {@link Block} objects. + */ +diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java +index 5187878792d8f387dbe8c8df7938521f1671adfe..1848846fa801002b0859a70ab67481fc61befb63 100644 +--- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java ++++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java +@@ -1,11 +1,5 @@ + package org.bukkit.craftbukkit.persistence; + +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Map; +-import java.util.Map.Entry; +-import java.util.Objects; +-import java.util.Set; + import net.minecraft.server.NBTBase; + import net.minecraft.server.NBTTagCompound; + import org.apache.commons.lang.Validate; +@@ -15,6 +9,9 @@ import org.bukkit.persistence.PersistentDataAdapterContext; + import org.bukkit.persistence.PersistentDataContainer; + import org.bukkit.persistence.PersistentDataType; + ++import java.util.*; ++import java.util.Map.Entry; ++ + public final class CraftPersistentDataContainer implements PersistentDataContainer { + + private final Map customDataTags = new HashMap<>(); +diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java +index 1b3b8646387255c888175daedf0e4ddcc13b9ff7..a6c796e0ac10a31f9941f5ca7be09403008ee1ff 100644 +--- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java ++++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java +@@ -1,26 +1,15 @@ + package org.bukkit.craftbukkit.persistence; + + import com.google.common.primitives.Primitives; ++import net.minecraft.server.*; ++import org.apache.commons.lang3.Validate; ++import org.bukkit.persistence.PersistentDataContainer; ++ + import java.util.Arrays; + import java.util.HashMap; + import java.util.Map; + import java.util.Objects; + import java.util.function.Function; +-import net.minecraft.server.NBTBase; +-import net.minecraft.server.NBTTagByte; +-import net.minecraft.server.NBTTagByteArray; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.NBTTagDouble; +-import net.minecraft.server.NBTTagFloat; +-import net.minecraft.server.NBTTagInt; +-import net.minecraft.server.NBTTagIntArray; +-import net.minecraft.server.NBTTagList; +-import net.minecraft.server.NBTTagLong; +-import net.minecraft.server.NBTTagLongArray; +-import net.minecraft.server.NBTTagShort; +-import net.minecraft.server.NBTTagString; +-import org.apache.commons.lang3.Validate; +-import org.bukkit.persistence.PersistentDataContainer; + + /** + * This class represents a registry that contains the used adapters for. +diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java +index 87d680a8776d0000cf567ff2acbcd138bcc0a6c7..af6cd24d78a215d9ed5b5c4b86b005538865a0b0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java ++++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java +@@ -2,17 +2,14 @@ package org.bukkit.craftbukkit.potion; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.Maps; ++import net.minecraft.server.MobEffect; ++import net.minecraft.server.PotionRegistry; ++import org.bukkit.potion.*; ++ + import java.util.ArrayList; + import java.util.Collection; + import java.util.List; + import java.util.Map; +-import net.minecraft.server.MobEffect; +-import net.minecraft.server.PotionRegistry; +-import org.bukkit.potion.PotionBrewer; +-import org.bukkit.potion.PotionData; +-import org.bukkit.potion.PotionEffect; +-import org.bukkit.potion.PotionEffectType; +-import org.bukkit.potion.PotionType; + + public class CraftPotionBrewer implements PotionBrewer { + private static final Map> cache = Maps.newHashMap(); +diff --git a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java +index 46e9caf0fbef07e9e6899a57c39736aa462e16b2..5453271e6ac11511fb2ee88b4eb2e5d262df550c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java ++++ b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java +@@ -1,49 +1,20 @@ + package org.bukkit.craftbukkit.projectiles; + +-import java.util.Random; +-import net.minecraft.server.BlockDispenser; +-import net.minecraft.server.EntityArrow; +-import net.minecraft.server.EntityEgg; +-import net.minecraft.server.EntityEnderPearl; +-import net.minecraft.server.EntityFireball; +-import net.minecraft.server.EntityPotion; +-import net.minecraft.server.EntityProjectile; +-import net.minecraft.server.EntitySmallFireball; +-import net.minecraft.server.EntitySnowball; +-import net.minecraft.server.EntitySpectralArrow; +-import net.minecraft.server.EntityThrownExpBottle; +-import net.minecraft.server.EntityTippedArrow; +-import net.minecraft.server.EntityTypes; +-import net.minecraft.server.EnumDirection; +-import net.minecraft.server.IPosition; +-import net.minecraft.server.IProjectile; +-import net.minecraft.server.MathHelper; +-import net.minecraft.server.SourceBlock; +-import net.minecraft.server.TileEntityDispenser; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.Material; + import org.bukkit.block.Block; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.potion.CraftPotionUtil; +-import org.bukkit.entity.AbstractArrow; +-import org.bukkit.entity.Egg; +-import org.bukkit.entity.EnderPearl; +-import org.bukkit.entity.Fireball; +-import org.bukkit.entity.LingeringPotion; +-import org.bukkit.entity.Projectile; +-import org.bukkit.entity.SmallFireball; +-import org.bukkit.entity.Snowball; +-import org.bukkit.entity.SpectralArrow; +-import org.bukkit.entity.ThrownExpBottle; +-import org.bukkit.entity.ThrownPotion; +-import org.bukkit.entity.TippedArrow; +-import org.bukkit.entity.WitherSkull; ++import org.bukkit.entity.*; + import org.bukkit.inventory.ItemStack; + import org.bukkit.potion.PotionData; + import org.bukkit.potion.PotionType; + import org.bukkit.projectiles.BlockProjectileSource; + import org.bukkit.util.Vector; + ++import java.util.Random; ++ + public class CraftBlockProjectileSource implements BlockProjectileSource { + private final TileEntityDispenser dispenserBlock; + +diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java +index 3c1992e212a6d6f1db4d5b807b38d71913619fc0..bc07f29552dbfcb35eb3bdd3e17bc7acd2b8d03a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java ++++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java +@@ -30,11 +30,7 @@ import org.bukkit.plugin.Plugin; + import java.util.ArrayList; + import java.util.Iterator; + import java.util.List; +-import java.util.concurrent.Executor; +-import java.util.concurrent.Executors; +-import java.util.concurrent.SynchronousQueue; +-import java.util.concurrent.ThreadPoolExecutor; +-import java.util.concurrent.TimeUnit; ++import java.util.concurrent.*; + + public class CraftAsyncScheduler extends CraftScheduler { + +diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java +index c38e514b004a4684026d5a89c606399a4fd7efe1..4675805cf281b178b0fcf7dbecda6e70f34973c3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java ++++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java +@@ -1,11 +1,12 @@ + package org.bukkit.craftbukkit.scheduler; + ++import org.bukkit.plugin.Plugin; ++import org.bukkit.scheduler.BukkitWorker; ++ + import java.util.Iterator; + import java.util.LinkedList; + import java.util.Map; + import java.util.logging.Level; +-import org.bukkit.plugin.Plugin; +-import org.bukkit.scheduler.BukkitWorker; + + class CraftAsyncTask extends CraftTask { + +diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftFuture.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftFuture.java +index 1e20385fd60d144ad2d915867156449d5d53c50d..3fa618c2a60651cf8906b9950b9b3ab1da72b573 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftFuture.java ++++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftFuture.java +@@ -1,13 +1,9 @@ + package org.bukkit.craftbukkit.scheduler; + +-import java.util.concurrent.Callable; +-import java.util.concurrent.CancellationException; +-import java.util.concurrent.ExecutionException; +-import java.util.concurrent.Future; +-import java.util.concurrent.TimeUnit; +-import java.util.concurrent.TimeoutException; + import org.bukkit.plugin.Plugin; + ++import java.util.concurrent.*; ++ + class CraftFuture extends CraftTask implements Future { + + private final Callable callable; +diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +index 1bc65ae63673b1de3aa6e0c49bf95dadd7d7b355..56e553e012a2d19b3f2dd17b5c10b77be0847677 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java ++++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +@@ -1,22 +1,6 @@ + package org.bukkit.craftbukkit.scheduler; + +-import co.aikar.timings.MinecraftTimings; // Paper +-import com.google.common.util.concurrent.ThreadFactoryBuilder; +-import java.util.ArrayList; +-import java.util.Comparator; +-import java.util.Iterator; +-import java.util.List; +-import java.util.PriorityQueue; +-import java.util.concurrent.Callable; +-import java.util.concurrent.ConcurrentHashMap; +-import java.util.concurrent.Executor; +-import java.util.concurrent.Executors; +-import java.util.concurrent.Future; +-import java.util.concurrent.atomic.AtomicInteger; +-import java.util.concurrent.atomic.AtomicReference; +-import java.util.function.Consumer; +-import java.util.logging.Level; +-import com.destroystokyo.paper.ServerSchedulerReportingWrapper; ++import co.aikar.timings.MinecraftTimings; + import com.destroystokyo.paper.event.server.ServerExceptionEvent; + import com.destroystokyo.paper.exception.ServerSchedulerException; + import org.apache.commons.lang.Validate; +@@ -27,6 +11,15 @@ import org.bukkit.scheduler.BukkitScheduler; + import org.bukkit.scheduler.BukkitTask; + import org.bukkit.scheduler.BukkitWorker; + ++import java.util.*; ++import java.util.concurrent.Callable; ++import java.util.concurrent.ConcurrentHashMap; ++import java.util.concurrent.Future; ++import java.util.concurrent.atomic.AtomicInteger; ++import java.util.concurrent.atomic.AtomicReference; ++import java.util.function.Consumer; ++import java.util.logging.Level; ++ + /** + * The fundamental concepts for this implementation: + *
  • Main thread owns {@link #head} and {@link #currentTick}, but it may be read from any thread
  • +diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java +index 9d0d1598bfce2f51998395faf39d8bd2f5d3f9f3..ab07107e373d91aad2c37607de741a16a8c684c2 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java ++++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java +@@ -1,14 +1,14 @@ + package org.bukkit.craftbukkit.scheduler; + +-import java.util.function.Consumer; +- ++import co.aikar.timings.MinecraftTimings; + import co.aikar.timings.NullTimingHandler; ++import co.aikar.timings.Timing; + import org.bukkit.Bukkit; +-import co.aikar.timings.MinecraftTimings; // Paper +-import co.aikar.timings.Timing; // Paper + import org.bukkit.plugin.Plugin; + import org.bukkit.scheduler.BukkitTask; + ++import java.util.function.Consumer; ++ + + public class CraftTask implements BukkitTask, Runnable { // Spigot + +diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java +index 73786eda788d18f8dac96de1119e13b6f56b999a..5c6c564aaad467cff76fb2e93a346b628e39972f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java ++++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java +@@ -1,10 +1,11 @@ + package org.bukkit.craftbukkit.scoreboard; + + import com.google.common.collect.ImmutableMap; +-import java.util.Map; + import net.minecraft.server.IScoreboardCriteria; + import net.minecraft.server.ScoreboardObjective; + ++import java.util.Map; ++ + final class CraftCriteria { + static final Map DEFAULTS; + static final CraftCriteria DUMMY; +diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java +index 41d22d223dc66028f7574515c34a75fdfee660ab..5528e29843d23ebe48ce1a22ef81cccd0939371b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java ++++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java +@@ -1,6 +1,5 @@ + package org.bukkit.craftbukkit.scoreboard; + +-import java.util.Map; + import net.minecraft.server.Scoreboard; + import net.minecraft.server.ScoreboardObjective; + import net.minecraft.server.ScoreboardScore; +@@ -9,6 +8,8 @@ import org.bukkit.OfflinePlayer; + import org.bukkit.scoreboard.Objective; + import org.bukkit.scoreboard.Score; + ++import java.util.Map; ++ + /** + * TL;DR: This class is special and lazily grabs a handle... + * ...because a handle is a full fledged (I think permanent) hashMap for the associated name. +diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +index e3036fe23fa2be100044332c432d1ad5b4872823..3b7090b7e0415ebd2df4ce5e4a60be55f0852651 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java ++++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +@@ -3,7 +3,6 @@ package org.bukkit.craftbukkit.scoreboard; + import com.google.common.base.Function; + import com.google.common.collect.ImmutableSet; + import com.google.common.collect.Iterables; +-import java.util.Collection; + import net.minecraft.server.Scoreboard; + import net.minecraft.server.ScoreboardObjective; + import net.minecraft.server.ScoreboardTeam; +@@ -11,11 +10,9 @@ import org.apache.commons.lang.Validate; + import org.bukkit.Bukkit; + import org.bukkit.OfflinePlayer; + import org.bukkit.craftbukkit.util.CraftChatMessage; +-import org.bukkit.scoreboard.DisplaySlot; +-import org.bukkit.scoreboard.Objective; +-import org.bukkit.scoreboard.RenderType; +-import org.bukkit.scoreboard.Score; +-import org.bukkit.scoreboard.Team; ++import org.bukkit.scoreboard.*; ++ ++import java.util.Collection; + + public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { + final Scoreboard board; +diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +index 2c5701376506f07a748e7ac75c6870320585bb4d..0f8d2ffd5a293856b2fb8e6122a39cfd25d28d82 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java ++++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +@@ -1,27 +1,15 @@ + package org.bukkit.craftbukkit.scoreboard; + +-import java.util.Collection; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Iterator; +-import java.util.Map; +-import java.util.function.Consumer; +-import net.minecraft.server.EntityPlayer; +-import net.minecraft.server.IScoreboardCriteria; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.PacketPlayOutScoreboardObjective; +-import net.minecraft.server.PacketPlayOutScoreboardTeam; +-import net.minecraft.server.Scoreboard; +-import net.minecraft.server.ScoreboardObjective; +-import net.minecraft.server.ScoreboardScore; +-import net.minecraft.server.ScoreboardServer; +-import net.minecraft.server.ScoreboardTeam; ++import net.minecraft.server.*; + import org.apache.commons.lang.Validate; + import org.bukkit.craftbukkit.entity.CraftPlayer; + import org.bukkit.craftbukkit.util.WeakCollection; + import org.bukkit.entity.Player; + import org.bukkit.scoreboard.ScoreboardManager; + ++import java.util.*; ++import java.util.function.Consumer; ++ + public final class CraftScoreboardManager implements ScoreboardManager { + private final CraftScoreboard mainScoreboard; + private final MinecraftServer server; +diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +index 0fba3d2a8d3bd7ec615d137e4625a7f357729d8d..f797411443720552b130fb5e04118a51ab2b7c30 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java ++++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +@@ -1,7 +1,6 @@ + package org.bukkit.craftbukkit.scoreboard; + + import com.google.common.collect.ImmutableSet; +-import java.util.Set; + import net.minecraft.server.ScoreboardTeam; + import net.minecraft.server.ScoreboardTeamBase; + import net.minecraft.server.ScoreboardTeamBase.EnumNameTagVisibility; +@@ -13,6 +12,8 @@ import org.bukkit.craftbukkit.util.CraftChatMessage; + import org.bukkit.scoreboard.NameTagVisibility; + import org.bukkit.scoreboard.Team; + ++import java.util.Set; ++ + final class CraftTeam extends CraftScoreboardComponent implements Team { + private final ScoreboardTeam team; + +diff --git a/src/main/java/org/bukkit/craftbukkit/tag/CraftBlockTag.java b/src/main/java/org/bukkit/craftbukkit/tag/CraftBlockTag.java +index 57acfb7c0e1e0a9c104cadf9a0f3ab5b8b3f685b..b3a15dd7efbe1a41f72817ebb0c983af6df751c7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/tag/CraftBlockTag.java ++++ b/src/main/java/org/bukkit/craftbukkit/tag/CraftBlockTag.java +@@ -1,15 +1,15 @@ + package org.bukkit.craftbukkit.tag; + +-import java.util.Collections; +-import java.util.HashSet; +-import java.util.Set; +-import java.util.stream.Collectors; + import net.minecraft.server.Block; + import net.minecraft.server.MinecraftKey; + import net.minecraft.server.TagsServer; + import org.bukkit.Material; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + ++import java.util.Collections; ++import java.util.HashSet; ++import java.util.Set; ++ + public class CraftBlockTag extends CraftTag { + + public CraftBlockTag(TagsServer registry, MinecraftKey tag) { +diff --git a/src/main/java/org/bukkit/craftbukkit/tag/CraftItemTag.java b/src/main/java/org/bukkit/craftbukkit/tag/CraftItemTag.java +index 96ee7881b2dea2b4b764265e670e5a7b57a35f69..f64a3c863dd18e52512f5ac2baa3f53d3bd1d22e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/tag/CraftItemTag.java ++++ b/src/main/java/org/bukkit/craftbukkit/tag/CraftItemTag.java +@@ -1,15 +1,15 @@ + package org.bukkit.craftbukkit.tag; + +-import java.util.Collections; +-import java.util.HashSet; +-import java.util.Set; +-import java.util.stream.Collectors; + import net.minecraft.server.Item; + import net.minecraft.server.MinecraftKey; + import net.minecraft.server.TagsServer; + import org.bukkit.Material; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + ++import java.util.Collections; ++import java.util.HashSet; ++import java.util.Set; ++ + public class CraftItemTag extends CraftTag { + + public CraftItemTag(TagsServer registry, MinecraftKey tag) { +diff --git a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java +index c22dbbfbe8b16d4c2f1df1f9efd3b06e330ac909..e938c819fcf5328ec26a8edd851aaacbb0781704 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java +@@ -1,9 +1,5 @@ + package org.bukkit.craftbukkit.util; + +-import java.util.ArrayList; +-import java.util.LinkedHashMap; +-import java.util.List; +-import java.util.Set; + import net.minecraft.server.BlockPosition; + import net.minecraft.server.Fluid; + import net.minecraft.server.IBlockData; +@@ -11,6 +7,11 @@ import net.minecraft.server.World; + import org.bukkit.block.BlockState; + import org.bukkit.craftbukkit.block.CraftBlockState; + ++import java.util.ArrayList; ++import java.util.LinkedHashMap; ++import java.util.List; ++import java.util.Set; ++ + public class BlockStateListPopulator extends DummyGeneratorAccess { + private final World world; + private final LinkedHashMap list; +diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +index e944a0f941fc74e267437d43717ddee283ffb673..291ddc726622892dba7ae93c4360eaa132e66430 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +@@ -1,35 +1,22 @@ + package org.bukkit.craftbukkit.util; + + import com.google.common.io.ByteStreams; +-import java.io.File; +-import java.io.FileOutputStream; +-import java.io.InputStream; +-import java.util.Arrays; +-import java.util.Enumeration; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.Map; +-import java.util.Set; +-import java.util.jar.JarEntry; +-import java.util.jar.JarFile; +-import java.util.jar.JarOutputStream; +-import java.util.zip.ZipEntry; + import joptsimple.OptionParser; + import joptsimple.OptionSet; + import joptsimple.OptionSpec; + import org.bukkit.Material; + import org.bukkit.plugin.AuthorNagException; +-import org.objectweb.asm.ClassReader; +-import org.objectweb.asm.ClassVisitor; +-import org.objectweb.asm.ClassWriter; +-import org.objectweb.asm.FieldVisitor; +-import org.objectweb.asm.Handle; +-import org.objectweb.asm.Label; +-import org.objectweb.asm.MethodVisitor; +-import org.objectweb.asm.Opcodes; +-import org.objectweb.asm.Type; ++import org.objectweb.asm.*; + + import javax.annotation.Nonnull; ++import java.io.File; ++import java.io.FileOutputStream; ++import java.io.InputStream; ++import java.util.*; ++import java.util.jar.JarEntry; ++import java.util.jar.JarFile; ++import java.util.jar.JarOutputStream; ++import java.util.zip.ZipEntry; + + /** + * This file is imported from Commodore. +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +index 00c24bf2fb1df7246d128c5bf33a2c01c4f398c2..f00d81077e372d6dbe34ab0d703316f397083978 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +@@ -2,22 +2,16 @@ package org.bukkit.craftbukkit.util; + + import com.google.common.collect.ImmutableMap; + import com.google.common.collect.ImmutableMap.Builder; ++import net.minecraft.server.*; ++import net.minecraft.server.ChatClickable.EnumClickAction; ++import org.bukkit.ChatColor; ++ + import java.util.ArrayList; + import java.util.List; + import java.util.Map; + import java.util.Optional; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import net.minecraft.server.ChatClickable; +-import net.minecraft.server.ChatClickable.EnumClickAction; +-import net.minecraft.server.ChatComponentText; +-import net.minecraft.server.ChatHexColor; +-import net.minecraft.server.ChatMessage; +-import net.minecraft.server.ChatModifier; +-import net.minecraft.server.EnumChatFormat; +-import net.minecraft.server.IChatBaseComponent; +-import net.minecraft.server.IChatMutableComponent; +-import org.bukkit.ChatColor; + + public final class CraftChatMessage { + +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java +index c8dde75de231b5fdde88f5bc111c21883d9c3f49..30572e20c13b8d1204c2d4d239d9b28594c4ad62 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java +@@ -1,9 +1,10 @@ + package org.bukkit.craftbukkit.util; + +-import java.util.Arrays; + import org.bukkit.Material; + import org.bukkit.material.MaterialData; + ++import java.util.Arrays; ++ + /** + * @deprecated legacy use only + */ +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index 60604e44911d4eb1b67f4a68f8ddad03bcaff95f..58ac86c205fa8f2b18412d8524731c2322d4077d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -8,34 +8,7 @@ import com.google.gson.JsonElement; + import com.google.gson.JsonObject; + import com.mojang.brigadier.exceptions.CommandSyntaxException; + import com.mojang.serialization.Dynamic; +-import java.io.File; +-import java.io.IOException; +-import java.util.Arrays; +-import java.util.Collections; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Locale; +-import java.util.Map; +-import java.util.logging.Level; +-import java.util.logging.Logger; +-import net.minecraft.server.AdvancementDataWorld; +-import net.minecraft.server.Block; +-import net.minecraft.server.ChatDeserializer; +-import net.minecraft.server.DataConverterRegistry; +-import net.minecraft.server.DataConverterTypes; +-import net.minecraft.server.DynamicOpsNBT; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.Item; +-import net.minecraft.server.LootDeserializationContext; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.MojangsonParser; +-import net.minecraft.server.NBTBase; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.NBTTagString; +-import net.minecraft.server.SavedFile; +-import net.minecraft.server.SharedConstants; ++import net.minecraft.server.*; + import org.bukkit.Bukkit; + import org.bukkit.Material; + import org.bukkit.NamespacedKey; +@@ -50,6 +23,12 @@ import org.bukkit.material.MaterialData; + import org.bukkit.plugin.InvalidPluginException; + import org.bukkit.plugin.PluginDescriptionFile; + ++import java.io.File; ++import java.io.IOException; ++import java.util.*; ++import java.util.logging.Level; ++import java.util.logging.Logger; ++ + @SuppressWarnings("deprecation") + public final class CraftMagicNumbers implements UnsafeValues { + public static final UnsafeValues INSTANCE = new CraftMagicNumbers(); +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftNBTTagConfigSerializer.java b/src/main/java/org/bukkit/craftbukkit/util/CraftNBTTagConfigSerializer.java +index b17faa25e6db28e8538cc21d7a651e4acdf0c580..e5e0a437cf2138682076fcc60c84afc40852de96 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftNBTTagConfigSerializer.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftNBTTagConfigSerializer.java +@@ -2,19 +2,13 @@ package org.bukkit.craftbukkit.util; + + import com.mojang.brigadier.StringReader; + import com.mojang.brigadier.exceptions.CommandSyntaxException; ++import net.minecraft.server.*; ++ + import java.util.ArrayList; + import java.util.HashMap; + import java.util.List; + import java.util.Map; + import java.util.regex.Pattern; +-import net.minecraft.server.MojangsonParser; +-import net.minecraft.server.NBTBase; +-import net.minecraft.server.NBTList; +-import net.minecraft.server.NBTTagCompound; +-import net.minecraft.server.NBTTagDouble; +-import net.minecraft.server.NBTTagInt; +-import net.minecraft.server.NBTTagList; +-import net.minecraft.server.NBTTagString; + + public class CraftNBTTagConfigSerializer { + +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftRayTraceResult.java b/src/main/java/org/bukkit/craftbukkit/util/CraftRayTraceResult.java +index 6995e1beadfb0d802f2f10d11bc1109012eeb2c6..5599161b7757359ef20c9b317804a07c856d1d8d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftRayTraceResult.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftRayTraceResult.java +@@ -1,11 +1,7 @@ + package org.bukkit.craftbukkit.util; + +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.MovingObjectPosition; ++import net.minecraft.server.*; + import net.minecraft.server.MovingObjectPosition.EnumMovingObjectType; +-import net.minecraft.server.MovingObjectPositionBlock; +-import net.minecraft.server.MovingObjectPositionEntity; +-import net.minecraft.server.Vec3D; + import org.bukkit.World; + import org.bukkit.block.Block; + import org.bukkit.block.BlockFace; +diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +index b6c39bf77e716addc9d2a1e915687bc770e937f4..9ec674643ce4667742b8da75612c2cda02889fb5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +@@ -1,35 +1,10 @@ + package org.bukkit.craftbukkit.util; + ++import net.minecraft.server.*; ++ + import java.util.List; + import java.util.Random; + import java.util.function.Predicate; +-import net.minecraft.server.AxisAlignedBB; +-import net.minecraft.server.BiomeBase; +-import net.minecraft.server.BiomeManager; +-import net.minecraft.server.Block; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.ChunkStatus; +-import net.minecraft.server.DifficultyDamageScaler; +-import net.minecraft.server.DimensionManager; +-import net.minecraft.server.Entity; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.Fluid; +-import net.minecraft.server.FluidType; +-import net.minecraft.server.GeneratorAccess; +-import net.minecraft.server.HeightMap; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.IChunkAccess; +-import net.minecraft.server.IChunkProvider; +-import net.minecraft.server.LightEngine; +-import net.minecraft.server.ParticleParam; +-import net.minecraft.server.SoundCategory; +-import net.minecraft.server.SoundEffect; +-import net.minecraft.server.TickList; +-import net.minecraft.server.TickListEmpty; +-import net.minecraft.server.TileEntity; +-import net.minecraft.server.World; +-import net.minecraft.server.WorldBorder; +-import net.minecraft.server.WorldData; + + public class DummyGeneratorAccess implements GeneratorAccess { + +diff --git a/src/main/java/org/bukkit/craftbukkit/util/ForwardLogHandler.java b/src/main/java/org/bukkit/craftbukkit/util/ForwardLogHandler.java +index 100b8566d9f16f20dfe1c5d1875ad7cdacb7b960..74ce4b2ec75b1ca80fe5b2a7f4bfff287f42326d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/ForwardLogHandler.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/ForwardLogHandler.java +@@ -1,12 +1,13 @@ + package org.bukkit.craftbukkit.util; + ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; ++ + import java.util.Map; + import java.util.concurrent.ConcurrentHashMap; + import java.util.logging.ConsoleHandler; + import java.util.logging.Level; + import java.util.logging.LogRecord; +-import org.apache.logging.log4j.LogManager; +-import org.apache.logging.log4j.Logger; + + public class ForwardLogHandler extends ConsoleHandler { + private Map cachedLoggers = new ConcurrentHashMap(); +diff --git a/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java b/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java +index f847a9dd6214ba7e7807365a56c1977bc4930c15..408524476651f24e2d28294d88b8be88b0d719fe 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java +@@ -1,11 +1,12 @@ + package org.bukkit.craftbukkit.util; + +-import java.util.HashSet; +-import java.util.List; + import net.minecraft.server.EntityPlayer; + import net.minecraft.server.MinecraftServer; + import org.bukkit.entity.Player; + ++import java.util.HashSet; ++import java.util.List; ++ + public class LazyPlayerSet extends LazyHashSet { + + private final MinecraftServer server; +diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java +index 9a2da548b8860b496e396564b2c8f6383f020193..7b579654e0eda696ee5419b2a8a02148cbd3f40f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java +@@ -1,12 +1,5 @@ + package org.bukkit.craftbukkit.util; + +-import com.mojang.util.QueueLogAppender; +-import java.io.IOException; +-import java.io.OutputStream; +-import java.util.logging.Level; +-import java.util.logging.Logger; +-//import jline.console.ConsoleReader; +-import org.bukkit.craftbukkit.Main; + //import org.fusesource.jansi.Ansi; + //import org.fusesource.jansi.Ansi.Erase; + +diff --git a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java b/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java +index 50f855b931dba60754fff9c7cdf5e0e744f00fdd..3165126e185ad18a4406712d1a0e27d3634e7b81 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java +@@ -4,13 +4,7 @@ import java.io.IOException; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; + import java.io.Serializable; +-import java.util.AbstractList; +-import java.util.Arrays; +-import java.util.ConcurrentModificationException; +-import java.util.Iterator; +-import java.util.List; +-import java.util.NoSuchElementException; +-import java.util.RandomAccess; ++import java.util.*; + + // implementation of an ArrayList that offers a getter without range checks + @SuppressWarnings("unchecked") +diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +index 2e6cd1780d759a9f94dc4d740fa1b81faad2a1ee..f96d936c82cd223621a12abbf4f0780d7df26259 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +@@ -1,11 +1,12 @@ + package org.bukkit.craftbukkit.util; + ++import org.bukkit.Bukkit; ++ + import java.io.IOException; + import java.io.InputStream; + import java.util.Properties; + import java.util.logging.Level; + import java.util.logging.Logger; +-import org.bukkit.Bukkit; + + public final class Versioning { + public static String getBukkitVersion() { +diff --git a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java +index 3c8946837351bf5a469be494b735d414e1801c20..d2e979c0ece68ccae2045d1bcbc6299eee4bf751 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java +@@ -1,11 +1,12 @@ + package org.bukkit.craftbukkit.util; + ++import org.apache.commons.lang.Validate; ++ + import java.lang.ref.WeakReference; + import java.util.ArrayList; + import java.util.Collection; + import java.util.Iterator; + import java.util.NoSuchElementException; +-import org.apache.commons.lang.Validate; + + public final class WeakCollection implements Collection { + static final Object NO_VALUE = new Object(); +diff --git a/src/main/java/org/bukkit/craftbukkit/util/WorldUUID.java b/src/main/java/org/bukkit/craftbukkit/util/WorldUUID.java +index f101ed6c5a5e16e5804b36f1182edca874981831..af89e91a272a6850fe55221a7b103f6e8b8c59a2 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/WorldUUID.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/WorldUUID.java +@@ -1,15 +1,11 @@ + package org.bukkit.craftbukkit.util; + +-import java.io.DataInputStream; +-import java.io.DataOutputStream; +-import java.io.File; +-import java.io.FileInputStream; +-import java.io.FileOutputStream; +-import java.io.IOException; +-import java.util.UUID; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import java.io.*; ++import java.util.UUID; ++ + public final class WorldUUID { + + private static final Logger LOGGER = LogManager.getLogger(); +diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java +index 37e930e0cb05cdb19c1b0dbd870313a14402181b..91a4afcce0df7652285af12b822662f0d181af1b 100644 +--- a/src/main/java/org/spigotmc/ActivationRange.java ++++ b/src/main/java/org/spigotmc/ActivationRange.java +@@ -1,54 +1,7 @@ + package org.spigotmc; + +-import java.util.Collection; +-import java.util.List; +- +-import net.minecraft.server.Activity; +-import net.minecraft.server.AxisAlignedBB; +-import net.minecraft.server.BehaviorController; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.Chunk; +-import net.minecraft.server.ChunkProviderServer; // Paper +-import net.minecraft.server.Entity; +-import net.minecraft.server.EntityAmbient; +-import net.minecraft.server.EntityAnimal; +-import net.minecraft.server.EntityArrow; +-import net.minecraft.server.EntityBee; +-import net.minecraft.server.EntityComplexPart; +-import net.minecraft.server.EntityCreature; +-import net.minecraft.server.EntityCreeper; +-import net.minecraft.server.EntityEnderCrystal; +-import net.minecraft.server.EntityEnderDragon; +-import net.minecraft.server.EntityEnderSignal; +-import net.minecraft.server.EntityFallingBlock; // Paper +-import net.minecraft.server.EntityFireball; +-import net.minecraft.server.EntityFireworks; +-import net.minecraft.server.EntityFlying; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.EntityLightning; +-import net.minecraft.server.EntityLiving; +-import net.minecraft.server.EntityMonster; +-import net.minecraft.server.EntityPillager; +-import net.minecraft.server.EntityPlayer; +-import net.minecraft.server.EntityProjectile; +-import net.minecraft.server.EntityRaider; +-import net.minecraft.server.EntitySheep; +-import net.minecraft.server.EntitySlice; +-import net.minecraft.server.EntitySlime; +-import net.minecraft.server.EntityTNTPrimed; +-import net.minecraft.server.EntityThrownTrident; +-import net.minecraft.server.EntityVillager; +-import net.minecraft.server.EntityWither; +-import net.minecraft.server.IMonster; +-import net.minecraft.server.MathHelper; +-import net.minecraft.server.MemoryModuleType; +-import net.minecraft.server.MinecraftServer; +-import net.minecraft.server.World; + import co.aikar.timings.MinecraftTimings; +-// Paper start +-import net.minecraft.server.EntityInsentient; +-import net.minecraft.server.EntityLlama; +-import net.minecraft.server.EntityWaterAnimal; ++import net.minecraft.server.*; + // Paper end + + public class ActivationRange +diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java +index c3ac1a46c3e06bfe06ad9ff9f4ec49c055a790b0..1951ace93be5e7a74b80011890e71e7d6b26fc95 100644 +--- a/src/main/java/org/spigotmc/AsyncCatcher.java ++++ b/src/main/java/org/spigotmc/AsyncCatcher.java +@@ -1,7 +1,5 @@ + package org.spigotmc; + +-import net.minecraft.server.MinecraftServer; +- + public class AsyncCatcher + { + +diff --git a/src/main/java/org/spigotmc/LimitStream.java b/src/main/java/org/spigotmc/LimitStream.java +index 8c32e8b62d47ba984a7a1e2e5dad042e2a59284d..4a5463079694b24e7591f124a851b945a16a9aee 100644 +--- a/src/main/java/org/spigotmc/LimitStream.java ++++ b/src/main/java/org/spigotmc/LimitStream.java +@@ -1,9 +1,10 @@ + package org.spigotmc; + ++import net.minecraft.server.NBTReadLimiter; ++ + import java.io.FilterInputStream; + import java.io.IOException; + import java.io.InputStream; +-import net.minecraft.server.NBTReadLimiter; + + public class LimitStream extends FilterInputStream + { +diff --git a/src/main/java/org/spigotmc/Metrics.java b/src/main/java/org/spigotmc/Metrics.java +index 05d2d3d523b5855f0bc0d9b34232ba9045a0368d..32f07f052496ecda189c9d6af9def6a1a8fc032d 100644 +--- a/src/main/java/org/spigotmc/Metrics.java ++++ b/src/main/java/org/spigotmc/Metrics.java +@@ -27,34 +27,19 @@ + */ + package org.spigotmc; + ++import net.minecraft.server.MinecraftServer; + import org.bukkit.Bukkit; +-import org.bukkit.configuration.file.YamlConfiguration; + import org.bukkit.configuration.InvalidConfigurationException; +-import org.bukkit.plugin.Plugin; +-import org.bukkit.plugin.PluginDescriptionFile; +-import org.bukkit.scheduler.BukkitTask; +- +-import java.io.BufferedReader; +-import java.io.File; +-import java.io.IOException; +-import java.io.InputStreamReader; +-import java.io.OutputStreamWriter; +-import java.io.UnsupportedEncodingException; ++import org.bukkit.configuration.file.YamlConfiguration; ++ ++import java.io.*; + import java.net.Proxy; + import java.net.URL; + import java.net.URLConnection; + import java.net.URLEncoder; +-import java.util.Collections; +-import java.util.HashSet; +-import java.util.Iterator; +-import java.util.LinkedHashSet; +-import java.util.Set; +-import java.util.Timer; +-import java.util.TimerTask; +-import java.util.UUID; ++import java.util.*; + import java.util.concurrent.TimeUnit; + import java.util.logging.Level; +-import net.minecraft.server.MinecraftServer; + + /** + *

    The metrics class obtains data about a plugin and submits statistics about it to the metrics backend.

    +diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java +index 123de5ac9026508e21cdc225f0962f5c3c46fed5..44b12b9b367acb51ee02c7b2d91f2e5cbb788cb6 100644 +--- a/src/main/java/org/spigotmc/RestartCommand.java ++++ b/src/main/java/org/spigotmc/RestartCommand.java +@@ -1,12 +1,12 @@ + package org.spigotmc; + +-import java.io.File; +-import java.util.List; + import net.minecraft.server.EntityPlayer; + import net.minecraft.server.MinecraftServer; + import org.bukkit.command.Command; + import org.bukkit.command.CommandSender; + ++import java.io.File; ++ + public class RestartCommand extends Command + { + +diff --git a/src/main/java/org/spigotmc/SpigotCommand.java b/src/main/java/org/spigotmc/SpigotCommand.java +index d0be3c3b593ad5f4bb1d166462fddd32bebb4875..421f64e67a602ae6c6df9372dd6dde47eabb0ff9 100644 +--- a/src/main/java/org/spigotmc/SpigotCommand.java ++++ b/src/main/java/org/spigotmc/SpigotCommand.java +@@ -1,12 +1,13 @@ + package org.spigotmc; + +-import java.io.File; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.WorldServer; + import org.bukkit.ChatColor; + import org.bukkit.command.Command; + import org.bukkit.command.CommandSender; + ++import java.io.File; ++ + public class SpigotCommand extends Command { + + public SpigotCommand(String name) { +diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java +index e66050b87ace6544636e10123ad0963176e5fdf7..d842b72d1fad93b7e499bb7af6fa0cae2cb04e8b 100644 +--- a/src/main/java/org/spigotmc/SpigotConfig.java ++++ b/src/main/java/org/spigotmc/SpigotConfig.java +@@ -1,23 +1,7 @@ + package org.spigotmc; + + import com.google.common.base.Throwables; +-import java.io.File; +-import java.io.IOException; +-import java.lang.reflect.InvocationTargetException; +-import java.lang.reflect.Method; +-import java.lang.reflect.Modifier; +-import java.util.Arrays; +-import java.util.HashMap; +-import java.util.HashSet; +-import java.util.List; +-import java.util.Map; +-import java.util.Set; +-import java.util.logging.Level; +-import net.minecraft.server.AttributeRanged; +-import net.minecraft.server.GenericAttributes; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.MinecraftServer; ++import net.minecraft.server.*; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.core.LoggerContext; + import org.apache.logging.log4j.core.config.Configuration; +@@ -28,6 +12,14 @@ import org.bukkit.configuration.ConfigurationSection; + import org.bukkit.configuration.InvalidConfigurationException; + import org.bukkit.configuration.file.YamlConfiguration; + ++import java.io.File; ++import java.io.IOException; ++import java.lang.reflect.InvocationTargetException; ++import java.lang.reflect.Method; ++import java.lang.reflect.Modifier; ++import java.util.*; ++import java.util.logging.Level; ++ + public class SpigotConfig + { + +diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +index 9859e0c964e4d1e7dc7689cb97f40643a8e5cdd7..e92462eaa355a325a78c5b16c7d44dbcacf586c8 100644 +--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java ++++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +@@ -1,9 +1,10 @@ + package org.spigotmc; + +-import java.util.List; + import org.bukkit.Bukkit; + import org.bukkit.configuration.file.YamlConfiguration; + ++import java.util.List; ++ + public class SpigotWorldConfig + { + +diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java +index 87812ace9e1327f31693bdfb3fa45ac38766799b..0b603f80e2db60590d996cae6ed3e87ead7bd752 100644 +--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java ++++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java +@@ -1,8 +1,5 @@ + package org.spigotmc; + +-import com.google.common.base.Joiner; +-import net.minecraft.server.MinecraftServer; +-import com.google.common.collect.Iterables; + import org.bukkit.ChatColor; + import org.bukkit.command.Command; + import org.bukkit.command.CommandSender; +diff --git a/src/main/java/org/spigotmc/TrackingRange.java b/src/main/java/org/spigotmc/TrackingRange.java +index 627e9a90b3045602bc540a5f3f031aaf3716c942..ad70a45b8ec7f893157215f2767145e842de31fd 100644 +--- a/src/main/java/org/spigotmc/TrackingRange.java ++++ b/src/main/java/org/spigotmc/TrackingRange.java +@@ -1,14 +1,6 @@ + package org.spigotmc; + +-import net.minecraft.server.Entity; +-import net.minecraft.server.EntityEnderDragon; // Paper +-import net.minecraft.server.WorldServer; // Paper +-import net.minecraft.server.EntityExperienceOrb; +-import net.minecraft.server.EntityGhast; +-import net.minecraft.server.EntityItem; +-import net.minecraft.server.EntityItemFrame; +-import net.minecraft.server.EntityPainting; +-import net.minecraft.server.EntityPlayer; ++import net.minecraft.server.*; + + public class TrackingRange + { +diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java +index 4d310908489953d6d061b2358f614142edacb62e..e6a76a4a55de87a2383eb5c831184e50cc11d042 100644 +--- a/src/main/java/org/spigotmc/WatchdogThread.java ++++ b/src/main/java/org/spigotmc/WatchdogThread.java +@@ -1,14 +1,15 @@ + package org.spigotmc; + ++import com.destroystokyo.paper.PaperConfig; ++import com.destroystokyo.paper.io.chunk.ChunkTaskManager; ++import net.minecraft.server.MinecraftServer; ++import org.bukkit.Bukkit; ++ + import java.lang.management.ManagementFactory; + import java.lang.management.MonitorInfo; + import java.lang.management.ThreadInfo; + import java.util.logging.Level; + import java.util.logging.Logger; +-import com.destroystokyo.paper.PaperConfig; +-import com.destroystokyo.paper.io.chunk.ChunkTaskManager; // Paper +-import net.minecraft.server.MinecraftServer; +-import org.bukkit.Bukkit; + + public class WatchdogThread extends Thread + { +diff --git a/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java b/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java +index 232c382b586b0812c9f7161565c0d382177adf7d..8970d2abdac703c1757ad2570079f43f9b82a6f3 100644 +--- a/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java ++++ b/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java +@@ -1,8 +1,10 @@ + package com.destroystokyo.paper.entity.ai; + ++import io.github.classgraph.ClassGraph; ++import io.github.classgraph.ScanResult; + import net.minecraft.server.EntityInsentient; + import net.minecraft.server.PathfinderGoal; +- ++import org.bukkit.entity.Mob; + import org.junit.Assert; + import org.junit.Test; + +@@ -12,11 +14,6 @@ import java.util.ArrayList; + import java.util.List; + import java.util.stream.Collectors; + +-import org.bukkit.entity.Mob; +- +-import io.github.classgraph.ClassGraph; +-import io.github.classgraph.ScanResult; +- + public class VanillaMobGoalTest { + + @Test +diff --git a/src/test/java/org/bukkit/ArtTest.java b/src/test/java/org/bukkit/ArtTest.java +index 39e3d2150aa0da327ab8980d18e1a0d0e77ae3a9..5eb2cc27695da52a702f831057ec0cf5b4a5dab5 100644 +--- a/src/test/java/org/bukkit/ArtTest.java ++++ b/src/test/java/org/bukkit/ArtTest.java +@@ -1,13 +1,6 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.Lists; +-import java.util.Collections; +-import java.util.EnumMap; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; + import net.minecraft.server.IRegistry; + import net.minecraft.server.MinecraftKey; + import net.minecraft.server.Paintings; +@@ -15,6 +8,13 @@ import org.bukkit.craftbukkit.CraftArt; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; + ++import java.util.*; ++ ++import static org.hamcrest.Matchers.is; ++import static org.hamcrest.Matchers.nullValue; ++import static org.junit.Assert.assertNotNull; ++import static org.junit.Assert.assertThat; ++ + public class ArtTest extends AbstractTestingBase { + private static final int UNIT_MULTIPLIER = 16; + +diff --git a/src/test/java/org/bukkit/BlockDataConversionTest.java b/src/test/java/org/bukkit/BlockDataConversionTest.java +index 46cc26b316f0ab17f676bae98ffbd109928c85dd..a1719437849ea14c4ce53f72cd9ad0aeb40d1035 100644 +--- a/src/test/java/org/bukkit/BlockDataConversionTest.java ++++ b/src/test/java/org/bukkit/BlockDataConversionTest.java +@@ -1,7 +1,5 @@ + package org.bukkit; + +-import java.util.ArrayList; +-import java.util.List; + import net.minecraft.server.Block; + import net.minecraft.server.IBlockData; + import net.minecraft.server.IRegistry; +@@ -12,6 +10,9 @@ import org.junit.Test; + import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + ++import java.util.ArrayList; ++import java.util.List; ++ + /** + * This test class ensures that all Blocks (as registered in IRegistry.BLOCK) + * can be converted into their CraftBlockData equivalent. +diff --git a/src/test/java/org/bukkit/BlockDataTest.java b/src/test/java/org/bukkit/BlockDataTest.java +index 00b8ad356f013943396ef971641ea121babb3ffb..7758303ee7622463ef5cabcff9dbb3bc924c2f4a 100644 +--- a/src/test/java/org/bukkit/BlockDataTest.java ++++ b/src/test/java/org/bukkit/BlockDataTest.java +@@ -1,6 +1,5 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; + import net.minecraft.server.BlockCake; + import net.minecraft.server.BlockChest; + import net.minecraft.server.Blocks; +@@ -14,6 +13,9 @@ import org.bukkit.support.AbstractTestingBase; + import org.junit.Assert; + import org.junit.Test; + ++import static org.hamcrest.Matchers.is; ++import static org.hamcrest.Matchers.not; ++ + public class BlockDataTest extends AbstractTestingBase { + + @Test +diff --git a/src/test/java/org/bukkit/ChatTest.java b/src/test/java/org/bukkit/ChatTest.java +index 95bc1d598d01b982847dda1a8531fb21a1cec423..d5251ac1cb8e85756b97a7c47a4b43a7d7695741 100644 +--- a/src/test/java/org/bukkit/ChatTest.java ++++ b/src/test/java/org/bukkit/ChatTest.java +@@ -1,12 +1,13 @@ + package org.bukkit; + +-import static org.junit.Assert.*; + import net.minecraft.server.EnumChatFormat; + import net.minecraft.server.IChatBaseComponent; + import org.bukkit.craftbukkit.util.CraftChatMessage; + import org.junit.Assert; + import org.junit.Test; + ++import static org.junit.Assert.assertEquals; ++ + public class ChatTest { + + @Test +diff --git a/src/test/java/org/bukkit/DyeColorsTest.java b/src/test/java/org/bukkit/DyeColorsTest.java +index 9bd05a702585566b90a778afb1ff0bf32c0c71f5..eedde20db9ded0ddacaba306c9f413f4c8152b14 100644 +--- a/src/test/java/org/bukkit/DyeColorsTest.java ++++ b/src/test/java/org/bukkit/DyeColorsTest.java +@@ -1,9 +1,5 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; +-import java.util.ArrayList; +-import java.util.List; + import net.minecraft.server.EnumColor; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; +@@ -12,6 +8,12 @@ import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.ArrayList; ++import java.util.List; ++ ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + @RunWith(Parameterized.class) + public class DyeColorsTest extends AbstractTestingBase { + +diff --git a/src/test/java/org/bukkit/GameRuleTest.java b/src/test/java/org/bukkit/GameRuleTest.java +index ca598c58b400aacbf1c1801cf29fd7b0b7c12d63..c9a81c742bd679698992451a98a1ccc924afc924 100644 +--- a/src/test/java/org/bukkit/GameRuleTest.java ++++ b/src/test/java/org/bukkit/GameRuleTest.java +@@ -1,11 +1,12 @@ + package org.bukkit; + +-import java.util.Map; + import net.minecraft.server.GameRules; + import org.bukkit.craftbukkit.CraftWorld; + import org.junit.Assert; + import org.junit.Test; + ++import java.util.Map; ++ + public class GameRuleTest { + + @Test +diff --git a/src/test/java/org/bukkit/MaterialTest.java b/src/test/java/org/bukkit/MaterialTest.java +index efac35cb7b5931c21d42306009ff6e92c2260677..bd4b02e16b7bbb91e6b2045866b8f5a76fe492f8 100644 +--- a/src/test/java/org/bukkit/MaterialTest.java ++++ b/src/test/java/org/bukkit/MaterialTest.java +@@ -1,16 +1,6 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.Maps; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Collections; +-import java.util.Comparator; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Map; +-import java.util.stream.StreamSupport; + import net.minecraft.server.IRegistry; + import net.minecraft.server.Item; + import net.minecraft.server.MinecraftKey; +@@ -18,6 +8,12 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; + ++import java.util.*; ++import java.util.stream.StreamSupport; ++ ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.*; ++ + public class MaterialTest extends AbstractTestingBase { + + @Test +diff --git a/src/test/java/org/bukkit/NibbleArrayTest.java b/src/test/java/org/bukkit/NibbleArrayTest.java +index 40ba97fb77dddafe7c792249ca343d5abee3e5d0..460a3e64ecf3efeaecbcbbb86d1ad221fcc35365 100644 +--- a/src/test/java/org/bukkit/NibbleArrayTest.java ++++ b/src/test/java/org/bukkit/NibbleArrayTest.java +@@ -1,10 +1,11 @@ + package org.bukkit; + +-import java.util.Random; + import net.minecraft.server.NibbleArray; + import org.junit.Assert; + import org.junit.Test; + ++import java.util.Random; ++ + public class NibbleArrayTest { + + private static final int NIBBLE_SIZE = 4096; +diff --git a/src/test/java/org/bukkit/PerMaterialTest.java b/src/test/java/org/bukkit/PerMaterialTest.java +index b99ad0faf3b4a8390dcc5af5346b68daed75d4ed..c503a44ef32e1076a1fdc542aab55e3b1b3a42ff 100644 +--- a/src/test/java/org/bukkit/PerMaterialTest.java ++++ b/src/test/java/org/bukkit/PerMaterialTest.java +@@ -1,24 +1,7 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.Lists; +-import java.util.List; +-import java.util.Map; +-import net.minecraft.server.Block; +-import net.minecraft.server.BlockAccessAir; +-import net.minecraft.server.BlockBase; +-import net.minecraft.server.BlockFalling; +-import net.minecraft.server.BlockFire; +-import net.minecraft.server.BlockPosition; +-import net.minecraft.server.Blocks; +-import net.minecraft.server.EntityHuman; +-import net.minecraft.server.EnumHand; +-import net.minecraft.server.IBlockData; +-import net.minecraft.server.Item; +-import net.minecraft.server.ItemRecord; +-import net.minecraft.server.MovingObjectPositionBlock; +-import net.minecraft.server.TileEntityFurnace; ++import net.minecraft.server.*; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.enchantments.EnchantmentTarget; +@@ -32,6 +15,12 @@ import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.List; ++import java.util.Map; ++ ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.*; ++ + @RunWith(Parameterized.class) + public class PerMaterialTest extends AbstractTestingBase { + private static Map fireValues; +diff --git a/src/test/java/org/bukkit/SoundTest.java b/src/test/java/org/bukkit/SoundTest.java +index f8e87443438eadd7d95da05027c2bb78114f9c47..b361c0d119afefa0d049587059422522fda8fc21 100644 +--- a/src/test/java/org/bukkit/SoundTest.java ++++ b/src/test/java/org/bukkit/SoundTest.java +@@ -1,13 +1,15 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import net.minecraft.server.IRegistry; + import net.minecraft.server.MinecraftKey; + import org.bukkit.craftbukkit.CraftSound; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; + ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.assertNotNull; ++import static org.junit.Assert.assertThat; ++ + public class SoundTest extends AbstractTestingBase { + + @Test +diff --git a/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java b/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java +index f45fa3fd632a7bcea7ef51b26d6ae5e3fb67fc6f..5c5b7db9d7e694fd899f64cf40b087e64c8f6b4b 100644 +--- a/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java ++++ b/src/test/java/org/bukkit/StatisticsAndAchievementsTest.java +@@ -1,7 +1,5 @@ + package org.bukkit; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.collect.HashMultiset; + import net.minecraft.server.EntityTypes; + import net.minecraft.server.IRegistry; +@@ -11,6 +9,10 @@ import org.bukkit.entity.EntityType; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; + ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.assertNotNull; ++import static org.junit.Assert.assertThat; ++ + public class StatisticsAndAchievementsTest extends AbstractTestingBase { + + @Test +diff --git a/src/test/java/org/bukkit/StructureTypeTest.java b/src/test/java/org/bukkit/StructureTypeTest.java +index f25e13c08ac20da2e1fcc817cadd3a86c411915c..8fe4d3ecf6075bd95806407628f711bac6f921df 100644 +--- a/src/test/java/org/bukkit/StructureTypeTest.java ++++ b/src/test/java/org/bukkit/StructureTypeTest.java +@@ -1,6 +1,5 @@ + package org.bukkit; + +-import java.util.Map; + import net.minecraft.server.IRegistry; + import net.minecraft.server.MinecraftKey; + import org.bukkit.support.AbstractTestingBase; +@@ -8,6 +7,8 @@ import org.junit.Assert; + import org.junit.BeforeClass; + import org.junit.Test; + ++import java.util.Map; ++ + /** + * This test makes sure that Bukkit always has Minecraft structure types up to + * date. +diff --git a/src/test/java/org/bukkit/craftbukkit/generator/ChunkDataTest.java b/src/test/java/org/bukkit/craftbukkit/generator/ChunkDataTest.java +index b59b28aa9c3824d352b89394eb3a506a11a0dff6..f0773b14258c8555c6f3c2e983609e39767d7670 100644 +--- a/src/test/java/org/bukkit/craftbukkit/generator/ChunkDataTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/generator/ChunkDataTest.java +@@ -1,11 +1,12 @@ + package org.bukkit.craftbukkit.generator; + +-import static org.junit.Assert.*; + import org.bukkit.Material; + import org.bukkit.block.data.BlockData; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; + ++import static org.junit.Assert.assertTrue; ++ + public class ChunkDataTest extends AbstractTestingBase { + + private static final BlockData RED_WOOL = Material.RED_WOOL.createBlockData(); +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/CompositeSerialization.java b/src/test/java/org/bukkit/craftbukkit/inventory/CompositeSerialization.java +index 4a85b083b4185e25a6da38d299d01b0a0eca117f..3a405223002a15210e6b05c62030310f2ad21855 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/CompositeSerialization.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/CompositeSerialization.java +@@ -1,10 +1,5 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.ChatColor; + import org.bukkit.Material; + import org.bukkit.configuration.InvalidConfigurationException; +@@ -15,6 +10,14 @@ import org.bukkit.inventory.meta.ItemMeta; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; + ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.List; ++ ++import static org.hamcrest.Matchers.hasSize; ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + + public class CompositeSerialization extends AbstractTestingBase { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java +index 0ab65ac7310cfc184b1d41b417c0a1db184f199e..8ae0a4a862094bcc0ac2894f10da12c56c69b0c2 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java +@@ -1,11 +1,5 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.junit.Assert.*; +-import java.io.StringReader; +-import java.lang.reflect.Array; +-import java.nio.ByteBuffer; +-import java.util.Map; +-import java.util.UUID; + import net.minecraft.server.NBTTagCompound; + import org.bukkit.Bukkit; + import org.bukkit.Material; +@@ -20,6 +14,14 @@ import org.bukkit.support.AbstractTestingBase; + import org.junit.Before; + import org.junit.Test; + ++import java.io.StringReader; ++import java.lang.reflect.Array; ++import java.nio.ByteBuffer; ++import java.util.Map; ++import java.util.UUID; ++ ++import static org.junit.Assert.*; ++ + public class DeprecatedItemMetaCustomValueTest extends AbstractTestingBase { + + private static NamespacedKey VALID_KEY; +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/FactoryItemMaterialTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/FactoryItemMaterialTest.java +index c279579c2bd54363090c6c99fbd92798a6b97c79..1eeca7324d755ef45b353dfb167b2faa17c7dfc6 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/FactoryItemMaterialTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/FactoryItemMaterialTest.java +@@ -1,9 +1,5 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; +-import java.util.ArrayList; +-import java.util.List; + import org.bukkit.Material; + import org.bukkit.inventory.ItemFactory; + import org.bukkit.inventory.ItemStack; +@@ -15,6 +11,13 @@ import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.ArrayList; ++import java.util.List; ++ ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.assertThat; ++import static org.junit.Assert.assertTrue; ++ + @RunWith(Parameterized.class) + public class FactoryItemMaterialTest extends AbstractTestingBase { + static final ItemFactory factory = CraftItemFactory.instance(); +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaCloneTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaCloneTest.java +index cefedd7d1e568d046b2e6f2ee75ffcf13754c5bb..bd8240c24b6addc45475a7de6f2f90624c5442a9 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaCloneTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaCloneTest.java +@@ -1,11 +1,15 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; +-import java.lang.reflect.Method; + import org.bukkit.Material; + import org.junit.Test; + ++import java.lang.reflect.Method; ++ ++import static org.hamcrest.Matchers.equalTo; ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertNotNull; ++import static org.junit.Assert.assertThat; ++ + public class ItemMetaCloneTest { + + @Test +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java +index 61ac1fb7c5beee7b7adbaafd6ea20e2e6bc778e5..ff1476c0a8a993d572ca8c2276f0bc1459bca4b3 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java +@@ -1,11 +1,5 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; +-import java.lang.reflect.Method; +-import java.util.ArrayList; +-import java.util.List; +-import java.util.concurrent.Callable; + import org.bukkit.Material; + import org.bukkit.configuration.serialization.DelegateDeserialization; + import org.bukkit.craftbukkit.Overridden; +@@ -15,6 +9,14 @@ import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + ++import java.lang.reflect.Method; ++import java.util.ArrayList; ++import java.util.List; ++import java.util.concurrent.Callable; ++ ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.assertThat; ++ + @RunWith(Parameterized.class) + public class ItemMetaImplementationOverrideTest { + static final Class parent = CraftMetaItem.class; +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +index b0edd62eb9066d145cfc52272c71d5f00b7e928d..6adc6850effe0e75ea16d5bd03c7defdf4eaa952 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +@@ -1,25 +1,9 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; +- +-import java.util.*; +- +-import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; // Paper +-import net.minecraft.server.Block; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.ITileEntity; +-import net.minecraft.server.Item; +-import net.minecraft.server.ItemBlock; +-import net.minecraft.server.ItemBlockWallable; +-import net.minecraft.server.NBTTagCompound; +-import org.bukkit.Bukkit; +-import org.bukkit.Color; +-import org.bukkit.DyeColor; +-import org.bukkit.FireworkEffect; +-import org.bukkit.FireworkEffect.Type; ++import net.minecraft.server.*; ++import org.bukkit.*; + import org.bukkit.Material; +-import org.bukkit.NamespacedKey; ++import org.bukkit.FireworkEffect.Type; + import org.bukkit.attribute.Attribute; + import org.bukkit.attribute.AttributeModifier; + import org.bukkit.block.banner.Pattern; +@@ -32,26 +16,18 @@ import org.bukkit.craftbukkit.inventory.ItemStackTest.StackWrapper; + import org.bukkit.enchantments.Enchantment; + import org.bukkit.entity.TropicalFish; + import org.bukkit.inventory.ItemStack; +-import org.bukkit.inventory.meta.BannerMeta; +-import org.bukkit.inventory.meta.BlockDataMeta; +-import org.bukkit.inventory.meta.BlockStateMeta; +-import org.bukkit.inventory.meta.BookMeta; +-import org.bukkit.inventory.meta.CrossbowMeta; +-import org.bukkit.inventory.meta.EnchantmentStorageMeta; +-import org.bukkit.inventory.meta.FireworkEffectMeta; +-import org.bukkit.inventory.meta.FireworkMeta; +-import org.bukkit.inventory.meta.ItemMeta; +-import org.bukkit.inventory.meta.KnowledgeBookMeta; +-import org.bukkit.inventory.meta.LeatherArmorMeta; +-import org.bukkit.inventory.meta.MapMeta; +-import org.bukkit.inventory.meta.PotionMeta; +-import org.bukkit.inventory.meta.TropicalFishBucketMeta; ++import org.bukkit.inventory.meta.*; + import org.bukkit.potion.PotionData; + import org.bukkit.potion.PotionEffectType; + import org.bukkit.potion.PotionType; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; + ++import java.util.*; ++ ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.*; ++ + public class ItemMetaTest extends AbstractTestingBase { + + static final int MAX_FIREWORK_POWER = 127; // Please update ItemStackFireworkTest if/when this gets changed. +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackBookTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackBookTest.java +index c7d10b08925c0b4e7c49876d37f009fff546f7ea..4f55cb6ce350f2b53c25b15858da6e929a4ff663 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackBookTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackBookTest.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Joiner; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.Material; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.meta.BookMeta; +@@ -10,6 +8,9 @@ import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.Arrays; ++import java.util.List; ++ + @RunWith(Parameterized.class) + public class ItemStackBookTest extends ItemStackTest { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackEnchantStorageTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackEnchantStorageTest.java +index 157eef07ee1603ac0002d4fe213b74df24391f4c..e8add3611a2f10fb8e8ebfba5bc5e68b9770972f 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackEnchantStorageTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackEnchantStorageTest.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Joiner; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.Material; + import org.bukkit.enchantments.Enchantment; + import org.bukkit.inventory.ItemStack; +@@ -11,6 +9,9 @@ import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.Arrays; ++import java.util.List; ++ + @RunWith(Parameterized.class) + public class ItemStackEnchantStorageTest extends ItemStackTest { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkChargeTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkChargeTest.java +index 1515ec20020111435403d3f3f7da6158a9c614e1..0605caa8f31683d8d338acc74e0c08d4d8daf17a 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkChargeTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkChargeTest.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Joiner; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.Color; + import org.bukkit.FireworkEffect; + import org.bukkit.FireworkEffect.Type; +@@ -13,6 +11,9 @@ import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.Arrays; ++import java.util.List; ++ + @RunWith(Parameterized.class) + public class ItemStackFireworkChargeTest extends ItemStackTest { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkTest.java +index 31fc6046af46033d9e9ed2c414f78dbc214490bd..98512257f9fc703c8570b17788faafa08d58e9ef 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackFireworkTest.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Joiner; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.Color; + import org.bukkit.FireworkEffect; + import org.bukkit.FireworkEffect.Type; +@@ -13,6 +11,9 @@ import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.Arrays; ++import java.util.List; ++ + @RunWith(Parameterized.class) + public class ItemStackFireworkTest extends ItemStackTest { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLeatherTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLeatherTest.java +index 9dea89e756029cf2c800dd05e9f00473a2cc45e6..4b6124ea821697e186fff945bc26dad787434450 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLeatherTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLeatherTest.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Joiner; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.Color; + import org.bukkit.Material; + import org.bukkit.inventory.ItemStack; +@@ -11,6 +9,9 @@ import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.Arrays; ++import java.util.List; ++ + @RunWith(Parameterized.class) + public class ItemStackLeatherTest extends ItemStackTest { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java +index 339b45191d8edd26e173bff45b4e6400f3739a1a..359e17b91f8e4cd74bb211fcd0dd91e43373fe2a 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Joiner; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.enchantments.Enchantment; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.meta.ItemMeta; +@@ -11,6 +9,9 @@ import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.Arrays; ++import java.util.List; ++ + @RunWith(Parameterized.class) + public class ItemStackLoreEnchantmentTest extends ItemStackTest { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackMapTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackMapTest.java +index fb36575b05596aaa5587093ec49c421a17f4b181..1c0df97be887c312469417be4940ab2b340ffea2 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackMapTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackMapTest.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Joiner; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.Material; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.meta.MapMeta; +@@ -10,6 +8,9 @@ import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.Arrays; ++import java.util.List; ++ + @RunWith(Parameterized.class) + public class ItemStackMapTest extends ItemStackTest { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackPotionsTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackPotionsTest.java +index f7cf39fdd1d180374f2edcf7596f8df8fa204671..f239b34b6578f4def1028446ff6733c1ed90e86c 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackPotionsTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackPotionsTest.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Joiner; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.Material; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.meta.PotionMeta; +@@ -11,6 +9,9 @@ import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.Arrays; ++import java.util.List; ++ + @RunWith(Parameterized.class) + public class ItemStackPotionsTest extends ItemStackTest { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackSkullTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackSkullTest.java +index 0ac5e8cb5717b81760ed57461a05f0c5bd2325d8..dd753e0729bc5ee72f425831aeed55064f47b2da 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackSkullTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackSkullTest.java +@@ -1,8 +1,6 @@ + package org.bukkit.craftbukkit.inventory; + + import com.google.common.base.Joiner; +-import java.util.Arrays; +-import java.util.List; + import org.bukkit.Material; + import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.meta.SkullMeta; +@@ -10,6 +8,9 @@ import org.junit.runner.RunWith; + import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameters; + ++import java.util.Arrays; ++import java.util.List; ++ + @RunWith(Parameterized.class) + public class ItemStackSkullTest extends ItemStackTest { + +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java +index 1add9c7d39c9e02c9dcdfe14e204d9a1e32d68b0..163b2509ec131fb9dcc86649a8c12195b079873b 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java +@@ -1,20 +1,7 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.bukkit.support.Matchers.*; +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import com.google.common.base.Joiner; + import com.google.common.collect.ImmutableList; +-import java.io.ByteArrayInputStream; +-import java.io.ByteArrayOutputStream; +-import java.io.IOException; +-import java.io.ObjectInputStream; +-import java.io.ObjectOutputStream; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; + import org.bukkit.Material; + import org.bukkit.configuration.InvalidConfigurationException; + import org.bukkit.configuration.file.YamlConfiguration; +@@ -31,6 +18,13 @@ import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder; + ++import java.io.*; ++import java.util.*; ++ ++import static org.bukkit.support.Matchers.sameHash; ++import static org.hamcrest.Matchers.*; ++import static org.junit.Assert.assertThat; ++ + @RunWith(Parameterized.class) + public class ItemStackTest extends AbstractTestingBase { + abstract static class StackProvider { +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java +index 5f5781230dab9e151ccf3260f1c42e906b655e7e..5328814ecad8e15fe099cba67455ff7c2d8d6d5b 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java +@@ -1,12 +1,13 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import net.minecraft.server.Enchantments; + import org.bukkit.inventory.ItemStack; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; + ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + public class NMSCraftItemStackTest extends AbstractTestingBase { + + @Test +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/PersistentDataContainerTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/PersistentDataContainerTest.java +index 6feee747e1ee0fc7fb57dc7ee91b7290d6cc348d..f169a98dbcb968cd5d672c4384eb523e65442d65 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/PersistentDataContainerTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/PersistentDataContainerTest.java +@@ -1,11 +1,5 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.junit.Assert.*; +-import java.io.StringReader; +-import java.lang.reflect.Array; +-import java.nio.ByteBuffer; +-import java.util.Map; +-import java.util.UUID; + import net.minecraft.server.NBTTagCompound; + import org.bukkit.Bukkit; + import org.bukkit.Material; +@@ -20,6 +14,14 @@ import org.bukkit.support.AbstractTestingBase; + import org.junit.Before; + import org.junit.Test; + ++import java.io.StringReader; ++import java.lang.reflect.Array; ++import java.nio.ByteBuffer; ++import java.util.Map; ++import java.util.UUID; ++ ++import static org.junit.Assert.*; ++ + public class PersistentDataContainerTest extends AbstractTestingBase { + + private static NamespacedKey VALID_KEY; +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/PlayerInventoryTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/PlayerInventoryTest.java +index 6f56e56afb58cd227231027aa22bbfeb390b3420..7610865e695df2000f4f2efb1f9ab488a0c55b12 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/PlayerInventoryTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/PlayerInventoryTest.java +@@ -1,12 +1,13 @@ + package org.bukkit.craftbukkit.inventory; + +-import static org.junit.Assert.*; + import net.minecraft.server.ItemStack; + import net.minecraft.server.Items; + import net.minecraft.server.PlayerInventory; + import org.bukkit.support.AbstractTestingBase; + import org.junit.Test; + ++import static org.junit.Assert.assertEquals; ++ + public class PlayerInventoryTest extends AbstractTestingBase { + + @Test +diff --git a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java +index e39b87ae6de87d4a9776aa960cf8b1c4305b1db0..02e6cabc2c6904e0bfeb7154f94e90d048d3aeca 100644 +--- a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java +@@ -1,8 +1,5 @@ + package org.bukkit.craftbukkit.legacy; + +-import java.util.Arrays; +-import java.util.HashSet; +-import java.util.Set; + import org.bukkit.Material; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.material.MaterialData; +@@ -10,6 +7,10 @@ import org.bukkit.support.AbstractTestingBase; + import org.junit.Assert; + import org.junit.Test; + ++import java.util.Arrays; ++import java.util.HashSet; ++import java.util.Set; ++ + public class LegacyTest extends AbstractTestingBase { + + private final Set INVALIDATED_MATERIALS = new HashSet<>(Arrays.asList(Material.ACACIA_BUTTON, Material.ACACIA_PRESSURE_PLATE, Material.ACACIA_TRAPDOOR, Material.AIR, Material.ATTACHED_MELON_STEM, Material.ATTACHED_PUMPKIN_STEM, +diff --git a/src/test/java/org/bukkit/craftbukkit/util/CraftChatMessageTest.java b/src/test/java/org/bukkit/craftbukkit/util/CraftChatMessageTest.java +index e4a98f441e6d7213e4c8642cc8a7c0b57fc7d75a..34beafde38a55348eaafa0d822e130a4436ae4f4 100644 +--- a/src/test/java/org/bukkit/craftbukkit/util/CraftChatMessageTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/util/CraftChatMessageTest.java +@@ -1,10 +1,11 @@ + package org.bukkit.craftbukkit.util; + +-import static org.junit.Assert.assertEquals; + import net.minecraft.server.IChatBaseComponent; + import net.minecraft.server.IChatMutableComponent; + import org.junit.Test; + ++import static org.junit.Assert.assertEquals; ++ + public class CraftChatMessageTest { + + @Test +diff --git a/src/test/java/org/bukkit/entity/EntityTypesTest.java b/src/test/java/org/bukkit/entity/EntityTypesTest.java +index af570ccfd671d4b4654df1fcf22ef91218e293e2..dc2cc90e61d4522972265689cbea8870b9c76c7a 100644 +--- a/src/test/java/org/bukkit/entity/EntityTypesTest.java ++++ b/src/test/java/org/bukkit/entity/EntityTypesTest.java +@@ -1,8 +1,5 @@ + package org.bukkit.entity; + +-import java.util.Arrays; +-import java.util.Set; +-import java.util.stream.Collectors; + import net.minecraft.server.EntityTypes; + import net.minecraft.server.IRegistry; + import net.minecraft.server.MinecraftKey; +@@ -10,6 +7,10 @@ import org.bukkit.support.AbstractTestingBase; + import org.junit.Assert; + import org.junit.Test; + ++import java.util.Arrays; ++import java.util.Set; ++import java.util.stream.Collectors; ++ + public class EntityTypesTest extends AbstractTestingBase { + + @Test +diff --git a/src/test/java/org/bukkit/entity/TropicalFishTest.java b/src/test/java/org/bukkit/entity/TropicalFishTest.java +index aa70881a77fd7c2d6b1058d9dba4d70e3ae12ba8..48313ae6e3629972bd44099e2321e184bfdcb995 100644 +--- a/src/test/java/org/bukkit/entity/TropicalFishTest.java ++++ b/src/test/java/org/bukkit/entity/TropicalFishTest.java +@@ -1,12 +1,13 @@ + package org.bukkit.entity; + +-import static org.hamcrest.Matchers.*; +-import static org.junit.Assert.*; + import org.bukkit.DyeColor; + import org.bukkit.craftbukkit.entity.CraftTropicalFish; + import org.bukkit.entity.TropicalFish.Pattern; + import org.junit.Test; + ++import static org.hamcrest.Matchers.is; ++import static org.junit.Assert.assertThat; ++ + public class TropicalFishTest { + + @Test +diff --git a/src/test/java/org/bukkit/map/MapTest.java b/src/test/java/org/bukkit/map/MapTest.java +index 2dde26d3fd4a51828a0aa6e40831ba33aaebeccc..46ab6a50abd5d1231fcdb69bbb74cd7ba684cd24 100644 +--- a/src/test/java/org/bukkit/map/MapTest.java ++++ b/src/test/java/org/bukkit/map/MapTest.java +@@ -1,13 +1,14 @@ + + package org.bukkit.map; + +-import java.awt.Color; +-import java.util.logging.Level; +-import java.util.logging.Logger; + import net.minecraft.server.MaterialMapColor; + import org.junit.Assert; + import org.junit.Test; + ++import java.awt.*; ++import java.util.logging.Level; ++import java.util.logging.Logger; ++ + public class MapTest { + + private static final Logger logger = Logger.getLogger("MapTest"); +diff --git a/src/test/java/org/bukkit/potion/PotionTest.java b/src/test/java/org/bukkit/potion/PotionTest.java +index ebd2efa5ae21b790695775b068207336da60e549..50cbb7da1a96d3bb0ce60c28405152ce89f8ee84 100644 +--- a/src/test/java/org/bukkit/potion/PotionTest.java ++++ b/src/test/java/org/bukkit/potion/PotionTest.java +@@ -1,16 +1,14 @@ + package org.bukkit.potion; + +-import static org.junit.Assert.*; ++import net.minecraft.server.*; ++import org.bukkit.support.AbstractTestingBase; ++import org.junit.Test; ++ + import java.util.EnumMap; + import java.util.List; + import java.util.Map; +-import net.minecraft.server.IRegistry; +-import net.minecraft.server.MinecraftKey; +-import net.minecraft.server.MobEffect; +-import net.minecraft.server.MobEffectList; +-import net.minecraft.server.PotionRegistry; +-import org.bukkit.support.AbstractTestingBase; +-import org.junit.Test; ++ ++import static org.junit.Assert.*; + + public class PotionTest extends AbstractTestingBase { + @Test +diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java +index d3281c81a4e8e0b8c2ad3a8d6628faf546746a2f..bb3400d2ccce6fb73550f80ef1df5a4869e58b9a 100644 +--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java ++++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java +@@ -2,21 +2,15 @@ package org.bukkit.support; + + import com.google.common.collect.ImmutableList; + import com.google.common.util.concurrent.MoreExecutors; +-import java.util.Collections; +-import java.util.List; +-import java.util.concurrent.CompletableFuture; +-import net.minecraft.server.DispenserRegistry; +-import net.minecraft.server.EnumResourcePackType; +-import net.minecraft.server.LootPredicateManager; +-import net.minecraft.server.LootTableRegistry; +-import net.minecraft.server.ResourceManager; +-import net.minecraft.server.ResourcePackVanilla; +-import net.minecraft.server.TagRegistry; +-import net.minecraft.server.Unit; ++import net.minecraft.server.*; + import org.bukkit.Material; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.junit.Assert; + ++import java.util.Collections; ++import java.util.List; ++import java.util.concurrent.CompletableFuture; ++ + /** + * If you are getting: java.lang.ExceptionInInitializerError + * at net.minecraft.server.StatisticList.<clinit>(SourceFile:58) +diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java +index 97eb5fa880d009bef973467403323d022bea5d7a..1036bd4e8fcf5e7ae65388cdc54b770c125e2547 100644 +--- a/src/test/java/org/bukkit/support/DummyServer.java ++++ b/src/test/java/org/bukkit/support/DummyServer.java +@@ -1,10 +1,5 @@ + package org.bukkit.support; + +-import java.lang.reflect.InvocationHandler; +-import java.lang.reflect.Method; +-import java.lang.reflect.Proxy; +-import java.util.HashMap; +-import java.util.logging.Logger; + import org.bukkit.Bukkit; + import org.bukkit.Material; + import org.bukkit.NamespacedKey; +@@ -16,6 +11,12 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; + import org.bukkit.craftbukkit.util.Versioning; + ++import java.lang.reflect.InvocationHandler; ++import java.lang.reflect.Method; ++import java.lang.reflect.Proxy; ++import java.util.HashMap; ++import java.util.logging.Logger; ++ + public final class DummyServer implements InvocationHandler { + private static interface MethodHandler { + Object handle(DummyServer server, Object[] args); diff --git a/patches/server/0031-IntellaJ-Code-Clean-Up.patch b/patches/server/0031-IntellaJ-Code-Clean-Up.patch new file mode 100644 index 00000000..79fa47ca --- /dev/null +++ b/patches/server/0031-IntellaJ-Code-Clean-Up.patch @@ -0,0 +1,32417 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Bud Gidiere +Date: Sat, 8 Aug 2020 18:28:04 -0500 +Subject: [PATCH] IntellaJ Code Clean Up + +Do not try to update this. Just rebuild it. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java +index 27c863ea9d6a91ef7298da5fbd85135b66ff4e73..286dcbdac27cfcbebd2a98184d4842d9f82c650b 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java ++++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java +@@ -83,7 +83,7 @@ public class PaperCommand extends Command { + + // Code from Mojang - copyright them + public static List getListMatchingLast(String[] args, String... matches) { +- return getListMatchingLast(args, (Collection) Arrays.asList(matches)); ++ return getListMatchingLast(args, Arrays.asList(matches)); + } + + public static boolean matches(String s, String s1) { +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index fd1e9518ff6555a347b3d14eb510d7be896c9f94..43420e35165a72534dbd628fcc208691de731814 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -139,7 +139,7 @@ public class PaperConfig { + switch (unit) { + case 'd': num *= (double) 60*60*24; break; + case 'h': num *= (double) 60*60; break; +- case 'm': num *= (double) 60; break; ++ case 'm': num *= 60; break; + default: case 's': break; + } + return (int) num; +@@ -180,7 +180,7 @@ public class PaperConfig { + + private static float getFloat(String path, float def) { + // TODO: Figure out why getFloat() always returns the default value. +- return (float) getDouble(path, (double) def); ++ return (float) getDouble(path, def); + } + + private static int getInt(String path, int def) { +@@ -190,7 +190,7 @@ public class PaperConfig { + + private static List getList(String path, T def) { + config.addDefault(path, def); +- return (List) config.getList(path, config.getList(path)); ++ return config.getList(path, config.getList(path)); + } + + private static String getString(String path, String def) { +@@ -382,7 +382,7 @@ public class PaperConfig { + int threads = getInt("settings.async-chunks.threads", -1); + int cpus = Runtime.getRuntime().availableProcessors(); + if (threads <= 0) { +- threads = (int) Math.min(Integer.getInteger("paper.maxChunkThreads", 8), Math.max(1, cpus - 1)); ++ threads = Math.min(Integer.getInteger("paper.maxChunkThreads", 8), Math.max(1, cpus - 1)); + } + if (cpus == 1 && !Boolean.getBoolean("Paper.allowAsyncChunksSingleCore")) { + asyncChunks = false; +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index b8f3e91d17d2e260401f3a06ef0fb7327d42f059..d121ef6943903a4d3a5c68bbd84da58ae4f4f296 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -55,7 +55,7 @@ public class PaperWorldConfig { + + private float getFloat(String path, float def) { + // TODO: Figure out why getFloat() always returns the default value. +- return (float) getDouble(path, (double) def); ++ return (float) getDouble(path, def); + } + + private List getList(String path, List def) { +diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +index 604c3811ee915f1624e7098cccead7b9f703aa78..c7c48c3926f7a6707f98a3c47e65c09033ff1afd 100644 +--- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java ++++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +@@ -148,7 +148,7 @@ public final class ChunkPacketBlockControllerAntiXray extends ChunkPacketBlockCo + Chunk chunk = chunkPacketInfo.getChunk(); + int x = chunk.getPos().x; + int z = chunk.getPos().z; +- WorldServer world = (WorldServer)chunk.world; ++ WorldServer world = chunk.world; + ((ChunkPacketInfoAntiXray) chunkPacketInfo).setNearbyChunks( + (Chunk) world.getChunkIfLoadedImmediately(x - 1, z), + (Chunk) world.getChunkIfLoadedImmediately(x + 1, z), +diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java +index ef9f55afd6bffa8c02c6820295223e5465eed91e..63431e8f3200e509906a4f2a4d44a82dbfbfec04 100644 +--- a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java ++++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java +@@ -11,7 +11,7 @@ public class PaperAuthenticationService extends YggdrasilAuthenticationService { + private final Environment environment; + public PaperAuthenticationService(Proxy proxy, String clientToken) { + super(proxy, clientToken); +- this.environment = (Environment)EnvironmentParser.getEnvironmentFromProperties().orElse(YggdrasilEnvironment.PROD);; ++ this.environment = EnvironmentParser.getEnvironmentFromProperties().orElse(YggdrasilEnvironment.PROD);; + } + + @Override +diff --git a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java +index 62403feec70ca2aedcd0928bd22b8d05d08b2d7e..439b15c4cf73a0e2999d7558f2db5fb8c557e481 100644 +--- a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java ++++ b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java +@@ -302,7 +302,7 @@ public final class PaperTickList extends TickListServer { // extend to avo + CrashReport crashreport = CrashReport.a(thr, "Exception while ticking"); + CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Block being ticked"); + +- CrashReportSystemDetails.a(crashreportsystemdetails, toTick.getPosition(), (IBlockData) null); ++ CrashReportSystemDetails.a(crashreportsystemdetails, toTick.getPosition(), null); + throw new ReportedException(crashreport); + // end copy from TickListServer + } +diff --git a/src/main/java/com/proximyst/rainforest/RainforestConfig.java b/src/main/java/com/proximyst/rainforest/RainforestConfig.java +index 5855bb241841ea1295cf97dac97413213442550a..ee82c668efd255776342c6584dae05a29679d678 100644 +--- a/src/main/java/com/proximyst/rainforest/RainforestConfig.java ++++ b/src/main/java/com/proximyst/rainforest/RainforestConfig.java +@@ -125,7 +125,7 @@ public final class RainforestConfig { + num *= (double) 60 * 60; + break; + case 'm': +- num *= (double) 60; ++ num *= 60; + break; + default: + case 's': +@@ -169,7 +169,7 @@ public final class RainforestConfig { + + private static float getFloat(String path, float def) { + // TODO: Figure out why getFloat() always returns the default value. +- return (float) getDouble(path, (double) def); ++ return (float) getDouble(path, def); + } + + private static int getInt(String path, int def) { +@@ -179,7 +179,7 @@ public final class RainforestConfig { + + private static List getList(String path, T def) { + config.addDefault(path, def); +- return (List) config.getList(path, config.getList(path)); ++ return config.getList(path, config.getList(path)); + } + + private static String getString(String path, String def) { +diff --git a/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java b/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java +index 9a9fe8f4e440b7bc66fd19a4915fc4360146c225..3d71c28ed9866e6ba0a1db5049e10863d3c55ed6 100644 +--- a/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java ++++ b/src/main/java/com/proximyst/rainforest/RainforestWorldConfig.java +@@ -52,7 +52,7 @@ public final class RainforestWorldConfig { + + private float getFloat(String path, float def) { + // TODO: Figure out why getFloat() always returns the default value. +- return (float) getDouble(path, (double) def); ++ return (float) getDouble(path, def); + } + + private List getList(String path, List def) { +diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java b/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java +index c58ab7f9030bb2a3f6af3a7f327a5e7654972c9f..65857f3404acd1d6e93eb2f15e15c013fd68f128 100644 +--- a/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java ++++ b/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java +@@ -32,7 +32,7 @@ public class YatopiaCommand extends Command { + + // Code from Mojang - copyright them + public static List getListMatchingLast(String[] args, String... matches) { +- return getListMatchingLast(args, (Collection) Arrays.asList(matches)); ++ return getListMatchingLast(args, Arrays.asList(matches)); + } + + public static boolean matches(String s, String s1) { +diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java +index 55282c0eab3d60b7c83c5772ba266b697248c711..7503322478048cdcca7659202596aea4d95fd835 100644 +--- a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java ++++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java +@@ -115,7 +115,7 @@ public class YatopiaConfig { + switch (unit) { + case 'd': num *= (double) 60*60*24; break; + case 'h': num *= (double) 60*60; break; +- case 'm': num *= (double) 60; break; ++ case 'm': num *= 60; break; + default: case 's': break; + } + return (int) num; +@@ -156,7 +156,7 @@ public class YatopiaConfig { + + private static float getFloat(String path, float def) { + // TODO: Figure out why getFloat() always returns the default value. +- return (float) getDouble(path, (double) def); ++ return (float) getDouble(path, def); + } + + private static int getInt(String path, int def) { +@@ -166,7 +166,7 @@ public class YatopiaConfig { + + private static List getList(String path, T def) { + config.addDefault(path, def); +- return (List) config.getList(path, config.getList(path)); ++ return config.getList(path, config.getList(path)); + } + + private static String getString(String path, String def) { +diff --git a/src/main/java/net/minecraft/server/Advancement.java b/src/main/java/net/minecraft/server/Advancement.java +index 9f48cfb84cd3fccc408d908db37d27f1bad6368d..5ef09e05cebf2bd4786d61056e405a5f950264ed 100644 +--- a/src/main/java/net/minecraft/server/Advancement.java ++++ b/src/main/java/net/minecraft/server/Advancement.java +@@ -203,7 +203,7 @@ public class Advancement { + return true; + } else { + if (this.b == null) { +- this.b = (Advancement) function.apply(this.a); ++ this.b = function.apply(this.a); + } + + return this.b != null; +@@ -255,7 +255,7 @@ public class Advancement { + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); + +- jsonobject1.add((String) entry.getKey(), ((Criterion) entry.getValue()).b()); ++ jsonobject1.add(entry.getKey(), entry.getValue().b()); + } + + jsonobject.add("criteria", jsonobject1); +diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +index 2a2b7a1d6a2813740cc9aae6bc911cea659543e6..9aa31f708c606c78885c7ff7912b58285dd8f607 100644 +--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java ++++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +@@ -104,7 +104,7 @@ public class AdvancementDataPlayer { + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); + +- if (((AdvancementProgress) entry.getValue()).isDone()) { ++ if (entry.getValue().isDone()) { + list.add(entry.getKey()); + this.j.add(entry.getKey()); + } +@@ -150,7 +150,7 @@ public class AdvancementDataPlayer { + + dynamic = this.d.update(DataFixTypes.ADVANCEMENTS.a(), dynamic, dynamic.get("DataVersion").asInt(0), SharedConstants.getGameVersion().getWorldVersion()); + dynamic = dynamic.remove("DataVersion"); +- Map map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue()); ++ Map map = AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree(dynamic.getValue()); + + if (map == null) { + throw new JsonParseException("Found null for advancements"); +@@ -161,7 +161,7 @@ public class AdvancementDataPlayer { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- Advancement advancement = advancementdataworld.a((MinecraftKey) entry.getKey()); ++ Advancement advancement = advancementdataworld.a(entry.getKey()); + + if (advancement == null) { + // CraftBukkit start +@@ -170,7 +170,7 @@ public class AdvancementDataPlayer { + } + // CraftBukkit end + } else { +- this.a(advancement, (AdvancementProgress) entry.getValue()); ++ this.a(advancement, entry.getValue()); + } + } + } catch (Throwable throwable1) { +@@ -209,10 +209,10 @@ public class AdvancementDataPlayer { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- AdvancementProgress advancementprogress = (AdvancementProgress) entry.getValue(); ++ AdvancementProgress advancementprogress = entry.getValue(); + + if (advancementprogress.b()) { +- map.put(((Advancement) entry.getKey()).getName(), advancementprogress); ++ map.put(entry.getKey().getName(), advancementprogress); + } + } + +@@ -306,7 +306,7 @@ public class AdvancementDataPlayer { + this.player.world.getServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.bukkit)); // CraftBukkit + advancement.d().a(this.player); + if (advancement.c() != null && advancement.c().i() && this.player.world.getGameRules().getBoolean(GameRules.ANNOUNCE_ADVANCEMENTS)) { +- this.e.sendMessage(new ChatMessage("chat.type.advancement." + advancement.c().e().a(), new Object[]{this.player.getScoreboardDisplayName(), advancement.j()}), ChatMessageType.SYSTEM, SystemUtils.b); ++ this.e.sendMessage(new ChatMessage("chat.type.advancement." + advancement.c().e().a(), this.player.getScoreboardDisplayName(), advancement.j()), ChatMessageType.SYSTEM, SystemUtils.b); + } + } + } +@@ -343,16 +343,16 @@ public class AdvancementDataPlayer { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- CriterionProgress criterionprogress = advancementprogress.getCriterionProgress((String) entry.getKey()); ++ CriterionProgress criterionprogress = advancementprogress.getCriterionProgress(entry.getKey()); + + if (criterionprogress != null && !criterionprogress.a()) { +- CriterionInstance criterioninstance = ((Criterion) entry.getValue()).a(); ++ CriterionInstance criterioninstance = entry.getValue().a(); + + if (criterioninstance != null) { + CriterionTrigger criteriontrigger = CriterionTriggers.a(criterioninstance.a()); + + if (criteriontrigger != null) { +- criteriontrigger.a(this, new CriterionTrigger.a<>(criterioninstance, advancement, (String) entry.getKey())); ++ criteriontrigger.a(this, new CriterionTrigger.a<>(criterioninstance, advancement, entry.getKey())); + } + } + } +@@ -367,16 +367,16 @@ public class AdvancementDataPlayer { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- CriterionProgress criterionprogress = advancementprogress.getCriterionProgress((String) entry.getKey()); ++ CriterionProgress criterionprogress = advancementprogress.getCriterionProgress(entry.getKey()); + + if (criterionprogress != null && (criterionprogress.a() || advancementprogress.isDone())) { +- CriterionInstance criterioninstance = ((Criterion) entry.getValue()).a(); ++ CriterionInstance criterioninstance = entry.getValue().a(); + + if (criterioninstance != null) { + CriterionTrigger criteriontrigger = CriterionTriggers.a(criterioninstance.a()); + + if (criteriontrigger != null) { +- criteriontrigger.b(this, new CriterionTrigger.a<>(criterioninstance, advancement, (String) entry.getKey())); ++ criteriontrigger.b(this, new CriterionTrigger.a<>(criterioninstance, advancement, entry.getKey())); + } + } + } +@@ -437,7 +437,7 @@ public class AdvancementDataPlayer { + } + + public AdvancementProgress getProgress(Advancement advancement) { +- AdvancementProgress advancementprogress = (AdvancementProgress) this.data.get(advancement); ++ AdvancementProgress advancementprogress = this.data.get(advancement); + + if (advancementprogress == null) { + advancementprogress = new AdvancementProgress(); +diff --git a/src/main/java/net/minecraft/server/AdvancementDataWorld.java b/src/main/java/net/minecraft/server/AdvancementDataWorld.java +index e1192141d802509ace1fc2c7d11a3c24a0c36e37..eeeefdf752911f18a2c209505528ceca1fb8e6ee 100644 +--- a/src/main/java/net/minecraft/server/AdvancementDataWorld.java ++++ b/src/main/java/net/minecraft/server/AdvancementDataWorld.java +@@ -47,7 +47,7 @@ public class AdvancementDataWorld extends ResourceDataJson { + } + Advancements advancements = new Advancements(); + +- advancements.a((Map) map1); ++ advancements.a(map1); + Iterator iterator = advancements.b().iterator(); + + while (iterator.hasNext()) { +diff --git a/src/main/java/net/minecraft/server/Advancements.java b/src/main/java/net/minecraft/server/Advancements.java +index b1adbc542936a6d30759123d72e23eabb39fb48c..f46ba1863177c608e9e3fdc3ae92019b52913b32 100644 +--- a/src/main/java/net/minecraft/server/Advancements.java ++++ b/src/main/java/net/minecraft/server/Advancements.java +@@ -39,7 +39,7 @@ public class Advancements { + MinecraftKey minecraftkey = (MinecraftKey) entry.getKey(); + Advancement.SerializedAdvancement advancement_serializedadvancement = (Advancement.SerializedAdvancement) entry.getValue(); + +- if (advancement_serializedadvancement.a((java.util.function.Function) function)) { ++ if (advancement_serializedadvancement.a(function)) { + Advancement advancement = advancement_serializedadvancement.b(minecraftkey); + + this.advancements.put(minecraftkey, advancement); +@@ -86,7 +86,7 @@ public class Advancements { + + @Nullable + public Advancement a(MinecraftKey minecraftkey) { +- return (Advancement) this.advancements.get(minecraftkey); ++ return this.advancements.get(minecraftkey); + } + + public interface a { +diff --git a/src/main/java/net/minecraft/server/ArgumentBlock.java b/src/main/java/net/minecraft/server/ArgumentBlock.java +index 9bd7ded6e5682991ba62e10d54f9f0d2b21e7279..10bcf70a4126f2b7ec5cad5af31cf7a469717005 100644 +--- a/src/main/java/net/minecraft/server/ArgumentBlock.java ++++ b/src/main/java/net/minecraft/server/ArgumentBlock.java +@@ -20,19 +20,19 @@ public class ArgumentBlock { + + public static final SimpleCommandExceptionType a = new SimpleCommandExceptionType(new ChatMessage("argument.block.tag.disallowed")); + public static final DynamicCommandExceptionType b = new DynamicCommandExceptionType((object) -> { +- return new ChatMessage("argument.block.id.invalid", new Object[]{object}); ++ return new ChatMessage("argument.block.id.invalid", object); + }); + public static final Dynamic2CommandExceptionType c = new Dynamic2CommandExceptionType((object, object1) -> { +- return new ChatMessage("argument.block.property.unknown", new Object[]{object, object1}); ++ return new ChatMessage("argument.block.property.unknown", object, object1); + }); + public static final Dynamic2CommandExceptionType d = new Dynamic2CommandExceptionType((object, object1) -> { +- return new ChatMessage("argument.block.property.duplicate", new Object[]{object1, object}); ++ return new ChatMessage("argument.block.property.duplicate", object1, object); + }); + public static final Dynamic3CommandExceptionType e = new Dynamic3CommandExceptionType((object, object1, object2) -> { +- return new ChatMessage("argument.block.property.invalid", new Object[]{object, object2, object1}); ++ return new ChatMessage("argument.block.property.invalid", object, object2, object1); + }); + public static final Dynamic2CommandExceptionType f = new Dynamic2CommandExceptionType((object, object1) -> { +- return new ChatMessage("argument.block.property.novalue", new Object[]{object, object1}); ++ return new ChatMessage("argument.block.property.novalue", object, object1); + }); + public static final SimpleCommandExceptionType g = new SimpleCommandExceptionType(new ChatMessage("argument.block.property.unclosed")); + private static final BiFunction, CompletableFuture> h = (suggestionsbuilder, tags) -> { +@@ -318,15 +318,15 @@ public class ArgumentBlock { + } + + private CompletableFuture k(SuggestionsBuilder suggestionsbuilder, Tags tags) { +- return ICompletionProvider.a((Iterable) tags.a(), suggestionsbuilder.createOffset(this.r).add(suggestionsbuilder)); ++ return ICompletionProvider.a(tags.a(), suggestionsbuilder.createOffset(this.r).add(suggestionsbuilder)); + } + + private CompletableFuture l(SuggestionsBuilder suggestionsbuilder, Tags tags) { + if (this.j) { +- ICompletionProvider.a((Iterable) tags.a(), suggestionsbuilder, String.valueOf('#')); ++ ICompletionProvider.a(tags.a(), suggestionsbuilder, String.valueOf('#')); + } + +- ICompletionProvider.a((Iterable) IRegistry.BLOCK.keySet(), suggestionsbuilder); ++ ICompletionProvider.a(IRegistry.BLOCK.keySet(), suggestionsbuilder); + return suggestionsbuilder.buildFuture(); + } + +@@ -334,7 +334,7 @@ public class ArgumentBlock { + int i = this.i.getCursor(); + + this.m = MinecraftKey.a(this.i); +- Block block = (Block) IRegistry.BLOCK.getOptional(this.m).orElseThrow(() -> { ++ Block block = IRegistry.BLOCK.getOptional(this.m).orElseThrow(() -> { + this.i.setCursor(i); + return ArgumentBlock.b.createWithContext(this.i, this.m.toString()); + }); +@@ -487,7 +487,7 @@ public class ArgumentBlock { + Optional optional = iblockstate.b(s); + + if (optional.isPresent()) { +- this.o = (IBlockData) this.o.set(iblockstate, (T) optional.get()); // CraftBukkit - decompile error ++ this.o = this.o.set(iblockstate, optional.get()); // CraftBukkit - decompile error + this.k.put(iblockstate, optional.get()); + } else { + this.i.setCursor(i); +@@ -509,7 +509,7 @@ public class ArgumentBlock { + stringbuilder.append(','); + } + +- a(stringbuilder, (IBlockState) entry.getKey(), (Comparable) entry.getValue()); ++ a(stringbuilder, (IBlockState) entry.getKey(), entry.getValue()); + } + + stringbuilder.append(']'); +@@ -525,7 +525,7 @@ public class ArgumentBlock { + } + + public CompletableFuture a(SuggestionsBuilder suggestionsbuilder, Tags tags) { +- return (CompletableFuture) this.s.apply(suggestionsbuilder.createOffset(this.i.getCursor()), tags); ++ return this.s.apply(suggestionsbuilder.createOffset(this.i.getCursor()), tags); + } + + public Map j() { +diff --git a/src/main/java/net/minecraft/server/ArgumentEntity.java b/src/main/java/net/minecraft/server/ArgumentEntity.java +index af275a63b2ba583f6a07d606a1b66fca409efd61..63c0755217c621f308343f637bd98da0cdbae2b0 100644 +--- a/src/main/java/net/minecraft/server/ArgumentEntity.java ++++ b/src/main/java/net/minecraft/server/ArgumentEntity.java +@@ -37,7 +37,7 @@ public class ArgumentEntity implements ArgumentType { + } + + public static Entity a(CommandContext commandcontext, String s) throws CommandSyntaxException { +- return ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).a((CommandListenerWrapper) commandcontext.getSource()); ++ return commandcontext.getArgument(s, EntitySelector.class).a(commandcontext.getSource()); + } + + public static ArgumentEntity multipleEntities() { +@@ -55,11 +55,11 @@ public class ArgumentEntity implements ArgumentType { + } + + public static Collection c(CommandContext commandcontext, String s) throws CommandSyntaxException { +- return ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).getEntities((CommandListenerWrapper) commandcontext.getSource()); ++ return commandcontext.getArgument(s, EntitySelector.class).getEntities(commandcontext.getSource()); + } + + public static Collection d(CommandContext commandcontext, String s) throws CommandSyntaxException { +- return ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).d((CommandListenerWrapper) commandcontext.getSource()); ++ return commandcontext.getArgument(s, EntitySelector.class).d(commandcontext.getSource()); + } + + public static ArgumentEntity c() { +@@ -67,7 +67,7 @@ public class ArgumentEntity implements ArgumentType { + } + + public static EntityPlayer e(CommandContext commandcontext, String s) throws CommandSyntaxException { +- return ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).c((CommandListenerWrapper) commandcontext.getSource()); ++ return commandcontext.getArgument(s, EntitySelector.class).c(commandcontext.getSource()); + } + + public static ArgumentEntity d() { +@@ -75,7 +75,7 @@ public class ArgumentEntity implements ArgumentType { + } + + public static Collection f(CommandContext commandcontext, String s) throws CommandSyntaxException { +- List list = ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).d((CommandListenerWrapper) commandcontext.getSource()); ++ List list = commandcontext.getArgument(s, EntitySelector.class).d(commandcontext.getSource()); + + if (list.isEmpty()) { + throw ArgumentEntity.e.create(); +@@ -129,7 +129,7 @@ public class ArgumentEntity implements ArgumentType { + Collection collection = icompletionprovider.l(); + Iterable iterable = this.i ? collection : Iterables.concat(collection, icompletionprovider.r()); + +- ICompletionProvider.b((Iterable) iterable, suggestionsbuilder1); ++ ICompletionProvider.b(iterable, suggestionsbuilder1); + }); + } else { + return Suggestions.empty(); +diff --git a/src/main/java/net/minecraft/server/ArgumentParserSelector.java b/src/main/java/net/minecraft/server/ArgumentParserSelector.java +index f1c630da24dfad324bb439e647948434f0c61e39..a22c7e171b7614a1fd8fd11505fa0e0472129277 100644 +--- a/src/main/java/net/minecraft/server/ArgumentParserSelector.java ++++ b/src/main/java/net/minecraft/server/ArgumentParserSelector.java +@@ -19,13 +19,13 @@ public class ArgumentParserSelector { + + public static final SimpleCommandExceptionType a = new SimpleCommandExceptionType(new ChatMessage("argument.entity.invalid")); + public static final DynamicCommandExceptionType b = new DynamicCommandExceptionType((object) -> { +- return new ChatMessage("argument.entity.selector.unknown", new Object[]{object}); ++ return new ChatMessage("argument.entity.selector.unknown", object); + }); + public static final SimpleCommandExceptionType c = new SimpleCommandExceptionType(new ChatMessage("argument.entity.selector.not_allowed")); + public static final SimpleCommandExceptionType d = new SimpleCommandExceptionType(new ChatMessage("argument.entity.selector.missing")); + public static final SimpleCommandExceptionType e = new SimpleCommandExceptionType(new ChatMessage("argument.entity.options.unterminated")); + public static final DynamicCommandExceptionType f = new DynamicCommandExceptionType((object) -> { +- return new ChatMessage("argument.entity.options.valueless", new Object[]{object}); ++ return new ChatMessage("argument.entity.options.valueless", object); + }); + public static final BiConsumer> g = (vec3d, list) -> { + }; +@@ -113,9 +113,9 @@ public class ArgumentParserSelector { + + if (this.v == null && this.w == null && this.x == null) { + if (this.q.b() != null) { +- float f = (Float) this.q.b(); ++ float f = this.q.b(); + +- axisalignedbb = new AxisAlignedBB((double) (-f), (double) (-f), (double) (-f), (double) (f + 1.0F), (double) (f + 1.0F), (double) (f + 1.0F)); ++ axisalignedbb = new AxisAlignedBB(-f, -f, -f, f + 1.0F, f + 1.0F, f + 1.0F); + } else { + axisalignedbb = null; + } +@@ -155,13 +155,13 @@ public class ArgumentParserSelector { + private void I() { + if (this.y != CriterionConditionRange.a) { + this.A = this.A.and(this.a(this.y, (entity) -> { +- return (double) entity.pitch; ++ return entity.pitch; + })); + } + + if (this.z != CriterionConditionRange.a) { + this.A = this.A.and(this.a(this.z, (entity) -> { +- return (double) entity.yaw; ++ return entity.yaw; + })); + } + +@@ -174,8 +174,8 @@ public class ArgumentParserSelector { + } + + private Predicate a(CriterionConditionRange criterionconditionrange, ToDoubleFunction todoublefunction) { +- double d0 = (double) MathHelper.g(criterionconditionrange.a() == null ? 0.0F : criterionconditionrange.a()); +- double d1 = (double) MathHelper.g(criterionconditionrange.b() == null ? 359.0F : criterionconditionrange.b()); ++ double d0 = MathHelper.g(criterionconditionrange.a() == null ? 0.0F : criterionconditionrange.a()); ++ double d1 = MathHelper.g(criterionconditionrange.b() == null ? 359.0F : criterionconditionrange.b()); + + return (entity) -> { + double d2 = MathHelper.g(todoublefunction.applyAsDouble(entity)); +@@ -527,7 +527,7 @@ public class ArgumentParserSelector { + } + + public CompletableFuture a(SuggestionsBuilder suggestionsbuilder, Consumer consumer) { +- return (CompletableFuture) this.G.apply(suggestionsbuilder.createOffset(this.l.getCursor()), consumer); ++ return this.G.apply(suggestionsbuilder.createOffset(this.l.getCursor()), consumer); + } + + public boolean v() { +diff --git a/src/main/java/net/minecraft/server/ArraySetSorted.java b/src/main/java/net/minecraft/server/ArraySetSorted.java +index 1a099dcdda23f9f64316e9f3a986ba1e93360deb..851e38e11363a1e78c004163fcbf4ff3d884732c 100644 +--- a/src/main/java/net/minecraft/server/ArraySetSorted.java ++++ b/src/main/java/net/minecraft/server/ArraySetSorted.java +@@ -87,7 +87,7 @@ public class ArraySetSorted extends AbstractSet { + private void c(int i) { + if (i > this.b.length) { + if (this.b != ObjectArrays.DEFAULT_EMPTY_ARRAY) { +- i = (int) Math.max(Math.min((long) this.b.length + (long) (this.b.length >> 1), 2147483639L), (long) i); ++ i = (int) Math.max(Math.min((long) this.b.length + (long) (this.b.length >> 1), 2147483639L), i); + } else if (i < 10) { + i = 10; + } +@@ -163,7 +163,7 @@ public class ArraySetSorted extends AbstractSet { + } + + public Object[] toArray() { +- return (Object[]) this.b.clone(); ++ return this.b.clone(); + } + + public U[] toArray(U[] au) { +@@ -180,7 +180,7 @@ public class ArraySetSorted extends AbstractSet { + } + + public void clear() { +- Arrays.fill(this.b, 0, this.c, (Object) null); ++ Arrays.fill(this.b, 0, this.c, null); + this.c = 0; + } + +diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java +index 7b391d5694e6531adabb0a843e4563ad045bb64c..f942ff277742006de0a8b8aec7a3dd47c793f8f2 100644 +--- a/src/main/java/net/minecraft/server/AxisAlignedBB.java ++++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java +@@ -19,8 +19,8 @@ public class AxisAlignedBB { + } + + public static AxisAlignedBB getBoxForChunk(int chunkX, int chunkZ) { +- double x = (double)(chunkX << 4); +- double z = (double)(chunkZ << 4); ++ double x = chunkX << 4; ++ double z = chunkZ << 4; + // use a bounding box bigger than the chunk to prevent entities from entering it on move + return new AxisAlignedBB(x - 1.0E-7, 0.0, z - 1.0E-7, x + (16.0 + 1.0E-7), 255.0, z + (16.0 + 1.0E-7), false); + } +@@ -136,11 +136,11 @@ public class AxisAlignedBB { + } + + public AxisAlignedBB(BlockPosition blockposition) { +- this((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 1), (double) (blockposition.getZ() + 1)); ++ this(blockposition.getX(), blockposition.getY(), blockposition.getZ(), blockposition.getX() + 1, blockposition.getY() + 1, blockposition.getZ() + 1); + } + + public AxisAlignedBB(BlockPosition blockposition, BlockPosition blockposition1) { +- this((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) blockposition1.getX(), (double) blockposition1.getY(), (double) blockposition1.getZ()); ++ this(blockposition.getX(), blockposition.getY(), blockposition.getZ(), blockposition1.getX(), blockposition1.getY(), blockposition1.getZ()); + } + + public AxisAlignedBB(Vec3D vec3d, Vec3D vec3d1) { +@@ -148,7 +148,7 @@ public class AxisAlignedBB { + } + + public static AxisAlignedBB a(StructureBoundingBox structureboundingbox) { +- return new AxisAlignedBB((double) structureboundingbox.a, (double) structureboundingbox.b, (double) structureboundingbox.c, (double) (structureboundingbox.d + 1), (double) (structureboundingbox.e + 1), (double) (structureboundingbox.f + 1)); ++ return new AxisAlignedBB(structureboundingbox.a, structureboundingbox.b, structureboundingbox.c, structureboundingbox.d + 1, structureboundingbox.e + 1, structureboundingbox.f + 1); + } + + public static AxisAlignedBB a(Vec3D vec3d) { +@@ -389,7 +389,7 @@ public class AxisAlignedBB { + double d0 = vec3d1.x - vec3d.x; + double d1 = vec3d1.y - vec3d.y; + double d2 = vec3d1.z - vec3d.z; +- EnumDirection enumdirection = a(this, vec3d, adouble, (EnumDirection) null, d0, d1, d2); ++ EnumDirection enumdirection = a(this, vec3d, adouble, null, d0, d1, d2); + + if (enumdirection == null) { + return Optional.empty(); +diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java +index e4b62eab1262f035395366cc5a5d0893975596d6..18e322912416ccf0fee2fe479d12106fc672866a 100644 +--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java ++++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java +@@ -14,7 +14,7 @@ public class BaseBlockPosition implements Comparable { + return new BaseBlockPosition(aint[0], aint[1], aint[2]); + }); + }, (baseblockposition) -> { +- return IntStream.of(new int[]{baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()}); ++ return IntStream.of(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()); + }); + public static final BaseBlockPosition ZERO = new BaseBlockPosition(0, 0, 0); + protected int a; // Paper - OBFHELPER // Tuinity - private->protected - diff on change, this is the x coordinate - Also revert the decision to expose set on an immutable type +@@ -101,7 +101,7 @@ public class BaseBlockPosition implements Comparable { + } + + public boolean a(BaseBlockPosition baseblockposition, double d0) { +- return this.distanceSquared((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ(), false) < d0 * d0; ++ return this.distanceSquared(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ(), false) < d0 * d0; + } + + public boolean a(IPosition iposition, double d0) { +@@ -110,7 +110,7 @@ public class BaseBlockPosition implements Comparable { + + public final double distanceSquared(BaseBlockPosition baseblockposition) { return j(baseblockposition); } // Paper - OBFHELPER + public double j(BaseBlockPosition baseblockposition) { +- return this.distanceSquared((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ(), true); ++ return this.distanceSquared(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ(), true); + } + + public double a(IPosition iposition, boolean flag) { +diff --git a/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java b/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java +index 0b8fa6dafa6e8cab5cb5bfdb657b3e8d92285450..b4d27409988a52df94f2d7f1a4d5efa4aac99d0d 100644 +--- a/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java ++++ b/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java +@@ -42,19 +42,19 @@ public class BehaviorAttackTargetForget extends Beha + } + + private EntityLiving b(E e0) { +- return (EntityLiving) e0.getBehaviorController().getMemory(MemoryModuleType.ATTACK_TARGET).get(); ++ return e0.getBehaviorController().getMemory(MemoryModuleType.ATTACK_TARGET).get(); + } + + private static boolean a(E e0) { + Optional optional = e0.getBehaviorController().getMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE); + +- return optional.isPresent() && e0.world.getTime() - (Long) optional.get() > 200L; ++ return optional.isPresent() && e0.world.getTime() - optional.get() > 200L; + } + + private boolean c(E e0) { + Optional optional = e0.getBehaviorController().getMemory(MemoryModuleType.ATTACK_TARGET); + +- return optional.isPresent() && !((EntityLiving) optional.get()).isAlive(); ++ return optional.isPresent() && !optional.get().isAlive(); + } + + private void d(E e0, EntityTargetEvent.TargetReason reason) { +diff --git a/src/main/java/net/minecraft/server/BehaviorAttackTargetSet.java b/src/main/java/net/minecraft/server/BehaviorAttackTargetSet.java +index c6fbe5c1f6c627c1fe6da557fd1b21504893035e..fe16a4b4541b9fbc4713022f7d844a5de55f3da6 100644 +--- a/src/main/java/net/minecraft/server/BehaviorAttackTargetSet.java ++++ b/src/main/java/net/minecraft/server/BehaviorAttackTargetSet.java +@@ -31,9 +31,9 @@ public class BehaviorAttackTargetSet extends Behavio + if (!this.b.test(e0)) { + return false; + } else { +- Optional optional = (Optional) this.c.apply(e0); ++ Optional optional = this.c.apply(e0); + +- return optional.isPresent() && ((EntityLiving) optional.get()).isAlive(); ++ return optional.isPresent() && optional.get().isAlive(); + } + } + +diff --git a/src/main/java/net/minecraft/server/BehaviorCareer.java b/src/main/java/net/minecraft/server/BehaviorCareer.java +index cee88035cc54a50da7a586cbdb7dfd62595716ec..2707e00d919e12e91d758fa6247f21f1b495a7c4 100644 +--- a/src/main/java/net/minecraft/server/BehaviorCareer.java ++++ b/src/main/java/net/minecraft/server/BehaviorCareer.java +@@ -15,13 +15,13 @@ public class BehaviorCareer extends Behavior { + } + + protected boolean a(WorldServer worldserver, EntityVillager entityvillager) { +- BlockPosition blockposition = ((GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get()).getBlockPosition(); ++ BlockPosition blockposition = entityvillager.getBehaviorController().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get().getBlockPosition(); + +- return blockposition.a((IPosition) entityvillager.getPositionVector(), 2.0D) || entityvillager.eZ(); ++ return blockposition.a(entityvillager.getPositionVector(), 2.0D) || entityvillager.eZ(); + } + + protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) { +- GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get(); ++ GlobalPos globalpos = entityvillager.getBehaviorController().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get(); + + entityvillager.getBehaviorController().removeMemory(MemoryModuleType.POTENTIAL_JOB_SITE); + entityvillager.getBehaviorController().setMemory(MemoryModuleType.JOB_SITE, globalpos); // CraftBukkit - decompile error +diff --git a/src/main/java/net/minecraft/server/BehaviorFarm.java b/src/main/java/net/minecraft/server/BehaviorFarm.java +index 9f2350c5b20f9e611c1ccadc01b7acb6815880bc..750a18ad57348ceeb758daf3bd067787f6056188 100644 +--- a/src/main/java/net/minecraft/server/BehaviorFarm.java ++++ b/src/main/java/net/minecraft/server/BehaviorFarm.java +@@ -32,7 +32,7 @@ public class BehaviorFarm extends Behavior { + for (int j = -1; j <= 1; ++j) { + for (int k = -1; k <= 1; ++k) { + blockposition_mutableblockposition.c(entityvillager.locX() + (double) i, entityvillager.locY() + (double) j, entityvillager.locZ() + (double) k); +- if (this.a((BlockPosition) blockposition_mutableblockposition, worldserver)) { ++ if (this.a(blockposition_mutableblockposition, worldserver)) { + this.e.add(new BlockPosition(blockposition_mutableblockposition)); + } + } +@@ -46,7 +46,7 @@ public class BehaviorFarm extends Behavior { + + @Nullable + private BlockPosition a(WorldServer worldserver) { +- return this.e.isEmpty() ? null : (BlockPosition) this.e.get(worldserver.getRandom().nextInt(this.e.size())); ++ return this.e.isEmpty() ? null : this.e.get(worldserver.getRandom().nextInt(this.e.size())); + } + + private boolean a(BlockPosition blockposition, WorldServer worldserver) { +@@ -73,7 +73,7 @@ public class BehaviorFarm extends Behavior { + } + + protected void d(WorldServer worldserver, EntityVillager entityvillager, long i) { +- if (this.farmBlock == null || this.farmBlock.a((IPosition) entityvillager.getPositionVector(), 1.0D)) { ++ if (this.farmBlock == null || this.farmBlock.a(entityvillager.getPositionVector(), 1.0D)) { + if (this.farmBlock != null && i > this.c) { + IBlockData iblockdata = worldserver.getType(this.farmBlock); + Block block = iblockdata.getBlock(); +@@ -120,7 +120,7 @@ public class BehaviorFarm extends Behavior { + } + + if (flag) { +- worldserver.playSound((EntityHuman) null, (double) this.farmBlock.getX(), (double) this.farmBlock.getY(), (double) this.farmBlock.getZ(), SoundEffects.ITEM_CROP_PLANT, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ worldserver.playSound(null, this.farmBlock.getX(), this.farmBlock.getY(), this.farmBlock.getZ(), SoundEffects.ITEM_CROP_PLANT, SoundCategory.BLOCKS, 1.0F, 1.0F); + itemstack.subtract(1); + if (itemstack.isEmpty()) { + inventorysubcontainer.setItem(j, ItemStack.b); +diff --git a/src/main/java/net/minecraft/server/BehaviorGate.java b/src/main/java/net/minecraft/server/BehaviorGate.java +index f6e60fc77cfe40dd3824abb9aaa4d8e76d8edd97..1fe0c8739a7997edae458fe4228fa57d5b0b6d84 100644 +--- a/src/main/java/net/minecraft/server/BehaviorGate.java ++++ b/src/main/java/net/minecraft/server/BehaviorGate.java +@@ -21,7 +21,7 @@ public class BehaviorGate extends Behavior { + this.c = behaviorgate_order; + this.d = behaviorgate_execution; + list.forEach((pair) -> { +- this.e.a(pair.getFirst(), (Integer) pair.getSecond()); ++ this.e.a(pair.getFirst(), pair.getSecond()); + }); + } + +@@ -68,8 +68,8 @@ public class BehaviorGate extends Behavior { + + @Override + public String toString() { +- Set> set = (Set) this.e.c().filter((behavior) -> { +- return behavior.a() == Behavior.Status.RUNNING; ++ Set> set = this.e.c().filter((behavior) -> { ++ return behavior.a() == Status.RUNNING; + }).collect(Collectors.toSet()); + + return "(" + this.getClass().getSimpleName() + "): " + set; +diff --git a/src/main/java/net/minecraft/server/BehaviorInteractDoor.java b/src/main/java/net/minecraft/server/BehaviorInteractDoor.java +index 8e5170b6a688529494be75ed5153def27ec9508e..a30331c246ed2f0f786d067a0fa2119bce19e3c6 100644 +--- a/src/main/java/net/minecraft/server/BehaviorInteractDoor.java ++++ b/src/main/java/net/minecraft/server/BehaviorInteractDoor.java +@@ -21,14 +21,14 @@ public class BehaviorInteractDoor extends Behavior { + @Override + protected void a(WorldServer worldserver, EntityLiving entityliving, long i) { + BehaviorController behaviorcontroller = entityliving.getBehaviorController(); +- PathEntity pathentity = (PathEntity) behaviorcontroller.getMemory(MemoryModuleType.PATH).get(); +- List list = (List) behaviorcontroller.getMemory(MemoryModuleType.INTERACTABLE_DOORS).get(); ++ PathEntity pathentity = behaviorcontroller.getMemory(MemoryModuleType.PATH).get(); ++ List list = behaviorcontroller.getMemory(MemoryModuleType.INTERACTABLE_DOORS).get(); + List result = new ArrayList<>(); + for (PathPoint pathpoint : pathentity.d()) { + BlockPosition blockPosition = new BlockPosition(pathpoint.a, pathpoint.b, pathpoint.c); + result.add(blockPosition); + } +- List list1 = (List) result; ++ List list1 = result; + Set set = this.a(worldserver, list, list1); + int j = pathentity.f() - 1; + +@@ -64,7 +64,7 @@ public class BehaviorInteractDoor extends Behavior { + GlobalPos globalpos = GlobalPos.create(worldserver.getDimensionKey(), blockposition); + + if (!behaviorcontroller.getMemory(MemoryModuleType.OPENED_DOORS).isPresent() && flag) { +- behaviorcontroller.setMemory(MemoryModuleType.OPENED_DOORS, Sets.newHashSet(new GlobalPos[]{globalpos})); // CraftBukkit - decompile error ++ behaviorcontroller.setMemory(MemoryModuleType.OPENED_DOORS, Sets.newHashSet(globalpos)); // CraftBukkit - decompile error + } else { + behaviorcontroller.getMemory(MemoryModuleType.OPENED_DOORS).ifPresent((set1) -> { + if (flag) { +@@ -96,7 +96,7 @@ public class BehaviorInteractDoor extends Behavior { + IBlockData iblockdata = worldserver.getType(blockposition); + Block block = iblockdata.getBlock(); + +- if (TagsBlock.WOODEN_DOORS.isTagged(block) && block instanceof BlockDoor && j < i && blockposition.a((IPosition) entityliving.getPositionVector(), 4.0D)) { ++ if (TagsBlock.WOODEN_DOORS.isTagged(block) && block instanceof BlockDoor && j < i && blockposition.a(entityliving.getPositionVector(), 4.0D)) { + ((BlockDoor) block).setDoor(worldserver, blockposition, false); + iterator.remove(); + } +diff --git a/src/main/java/net/minecraft/server/BehaviorMakeLove.java b/src/main/java/net/minecraft/server/BehaviorMakeLove.java +index 498a4fca2b21e04dc329a74d85a6dce9a4e4937f..8ce044df73a4cb1cc4ddf1d987548377f89a91fa 100644 +--- a/src/main/java/net/minecraft/server/BehaviorMakeLove.java ++++ b/src/main/java/net/minecraft/server/BehaviorMakeLove.java +@@ -21,7 +21,7 @@ public class BehaviorMakeLove extends Behavior { + } + + protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) { +- EntityAgeable entityageable = (EntityAgeable) entityvillager.getBehaviorController().getMemory(MemoryModuleType.BREED_TARGET).get(); ++ EntityAgeable entityageable = entityvillager.getBehaviorController().getMemory(MemoryModuleType.BREED_TARGET).get(); + + BehaviorUtil.a(entityvillager, entityageable, 0.5F); + worldserver.broadcastEntityEffect(entityageable, (byte) 18); +@@ -58,10 +58,10 @@ public class BehaviorMakeLove extends Behavior { + Optional optional1 = this.a(entityvillager, entityvillager1); + + if (optional1.isPresent()) { +- this.a(worldserver, (EntityVillager) optional1.get(), (BlockPosition) optional.get()); ++ this.a(worldserver, optional1.get(), optional.get()); + } else { +- worldserver.x().b((BlockPosition) optional.get()); +- PacketDebug.c(worldserver, (BlockPosition) optional.get()); ++ worldserver.x().b(optional.get()); ++ PacketDebug.c(worldserver, optional.get()); + } + } + +@@ -77,7 +77,7 @@ public class BehaviorMakeLove extends Behavior { + return entityageable.getEntityType() == EntityTypes.VILLAGER; + }); + +- return !optional.isPresent() ? false : BehaviorUtil.a(behaviorcontroller, MemoryModuleType.BREED_TARGET, EntityTypes.VILLAGER) && entityvillager.canBreed() && ((EntityAgeable) optional.get()).canBreed(); ++ return !optional.isPresent() ? false : BehaviorUtil.a(behaviorcontroller, MemoryModuleType.BREED_TARGET, EntityTypes.VILLAGER) && entityvillager.canBreed() && optional.get().canBreed(); + } + + private Optional b(WorldServer worldserver, EntityVillager entityvillager) { +diff --git a/src/main/java/net/minecraft/server/BehaviorSleep.java b/src/main/java/net/minecraft/server/BehaviorSleep.java +index d219c4fcdcff31aa1dc2d471262d7fafe4cd5b5e..089ef8ff522cef8cf345ade528e9f18bc5156d72 100644 +--- a/src/main/java/net/minecraft/server/BehaviorSleep.java ++++ b/src/main/java/net/minecraft/server/BehaviorSleep.java +@@ -20,7 +20,7 @@ public class BehaviorSleep extends Behavior { + return false; + } else { + BehaviorController behaviorcontroller = entityliving.getBehaviorController(); +- GlobalPos globalpos = (GlobalPos) behaviorcontroller.getMemory(MemoryModuleType.HOME).get(); ++ GlobalPos globalpos = behaviorcontroller.getMemory(MemoryModuleType.HOME).get(); + + if (worldserver.getDimensionKey() != globalpos.getDimensionManager()) { + return false; +@@ -28,7 +28,7 @@ public class BehaviorSleep extends Behavior { + Optional optional = behaviorcontroller.getMemory(MemoryModuleType.LAST_WOKEN); + + if (optional.isPresent()) { +- long i = worldserver.getTime() - (Long) optional.get(); ++ long i = worldserver.getTime() - optional.get(); + + if (i > 0L && i < 100L) { + return false; +@@ -38,7 +38,7 @@ public class BehaviorSleep extends Behavior { + IBlockData iblockdata = worldserver.getTypeIfLoaded(globalpos.getBlockPosition()); // Paper + if (iblockdata == null) { return false; } // Paper + +- return globalpos.getBlockPosition().a((IPosition) entityliving.getPositionVector(), 2.0D) && iblockdata.getBlock().a((Tag) TagsBlock.BEDS) && !(Boolean) iblockdata.get(BlockBed.OCCUPIED); ++ return globalpos.getBlockPosition().a(entityliving.getPositionVector(), 2.0D) && iblockdata.getBlock().a(TagsBlock.BEDS) && !(Boolean) iblockdata.get(BlockBed.OCCUPIED); + } + } + } +@@ -50,9 +50,9 @@ public class BehaviorSleep extends Behavior { + if (!optional.isPresent()) { + return false; + } else { +- BlockPosition blockposition = ((GlobalPos) optional.get()).getBlockPosition(); ++ BlockPosition blockposition = optional.get().getBlockPosition(); + +- return entityliving.getBehaviorController().c(Activity.REST) && entityliving.locY() > (double) blockposition.getY() + 0.4D && blockposition.a((IPosition) entityliving.getPositionVector(), 1.14D); ++ return entityliving.getBehaviorController().c(Activity.REST) && entityliving.locY() > (double) blockposition.getY() + 0.4D && blockposition.a(entityliving.getPositionVector(), 1.14D); + } + } + +@@ -60,9 +60,9 @@ public class BehaviorSleep extends Behavior { + protected void a(WorldServer worldserver, EntityLiving entityliving, long i) { + if (i > this.b) { + entityliving.getBehaviorController().getMemory(MemoryModuleType.OPENED_DOORS).ifPresent((set) -> { +- BehaviorInteractDoor.a(worldserver, (List) ImmutableList.of(), 0, entityliving, entityliving.getBehaviorController()); ++ BehaviorInteractDoor.a(worldserver, ImmutableList.of(), 0, entityliving, entityliving.getBehaviorController()); + }); +- entityliving.entitySleep(((GlobalPos) entityliving.getBehaviorController().getMemory(MemoryModuleType.HOME).get()).getBlockPosition()); ++ entityliving.entitySleep(entityliving.getBehaviorController().getMemory(MemoryModuleType.HOME).get().getBlockPosition()); + } + + } +diff --git a/src/main/java/net/minecraft/server/BehaviorUtil.java b/src/main/java/net/minecraft/server/BehaviorUtil.java +index 869f3e57457c1038ae20653f7d40f261c1349442..d5b32dd55270f882cba63c590eafa6e94644dba5 100644 +--- a/src/main/java/net/minecraft/server/BehaviorUtil.java ++++ b/src/main/java/net/minecraft/server/BehaviorUtil.java +@@ -44,8 +44,8 @@ public class BehaviorUtil { + private static void b(EntityLiving entityliving, EntityLiving entityliving1, float f) { + boolean flag = true; + +- a(entityliving, (Entity) entityliving1, f, 2); +- a(entityliving1, (Entity) entityliving, f, 2); ++ a(entityliving, entityliving1, f, 2); ++ a(entityliving1, entityliving, f, 2); + } + + public static void a(EntityLiving entityliving, Entity entity, float f, int i) { +@@ -89,7 +89,7 @@ public class BehaviorUtil { + }); + + worldserver.getClass(); +- return (SectionPosition) stream.min(Comparator.comparingInt(worldserver::b)).orElse(sectionposition); ++ return stream.min(Comparator.comparingInt(worldserver::b)).orElse(sectionposition); + } + + public static boolean a(EntityInsentient entityinsentient, EntityLiving entityliving, int i) { +@@ -98,15 +98,15 @@ public class BehaviorUtil { + if (item instanceof ItemProjectileWeapon && entityinsentient.a((ItemProjectileWeapon) item)) { + int j = ((ItemProjectileWeapon) item).d() - i; + +- return entityinsentient.a((Entity) entityliving, (double) j); ++ return entityinsentient.a(entityliving, j); + } else { +- return b((EntityLiving) entityinsentient, entityliving); ++ return b(entityinsentient, entityliving); + } + } + + public static boolean b(EntityLiving entityliving, EntityLiving entityliving1) { + double d0 = entityliving.g(entityliving1.locX(), entityliving1.locY(), entityliving1.locZ()); +- double d1 = (double) (entityliving.getWidth() * 2.0F * entityliving.getWidth() * 2.0F + entityliving1.getWidth()); ++ double d1 = entityliving.getWidth() * 2.0F * entityliving.getWidth() * 2.0F + entityliving1.getWidth(); + + return d0 <= d1; + } +@@ -117,7 +117,7 @@ public class BehaviorUtil { + if (!optional.isPresent()) { + return false; + } else { +- double d1 = entityliving.d(((EntityLiving) optional.get()).getPositionVector()); ++ double d1 = entityliving.d(optional.get().getPositionVector()); + double d2 = entityliving.d(entityliving1.getPositionVector()); + + return d2 > d1 + d0 * d0; +@@ -127,11 +127,11 @@ public class BehaviorUtil { + public static boolean c(EntityLiving entityliving, EntityLiving entityliving1) { + BehaviorController behaviorcontroller = entityliving.getBehaviorController(); + +- return !behaviorcontroller.hasMemory(MemoryModuleType.VISIBLE_MOBS) ? false : ((List) behaviorcontroller.getMemory(MemoryModuleType.VISIBLE_MOBS).get()).contains(entityliving1); ++ return !behaviorcontroller.hasMemory(MemoryModuleType.VISIBLE_MOBS) ? false : behaviorcontroller.getMemory(MemoryModuleType.VISIBLE_MOBS).get().contains(entityliving1); + } + + public static EntityLiving a(EntityLiving entityliving, Optional optional, EntityLiving entityliving1) { +- return !optional.isPresent() ? entityliving1 : a(entityliving, (EntityLiving) optional.get(), entityliving1); ++ return !optional.isPresent() ? entityliving1 : a(entityliving, optional.get(), entityliving1); + } + + public static EntityLiving a(EntityLiving entityliving, EntityLiving entityliving1, EntityLiving entityliving2) { +@@ -150,7 +150,7 @@ public class BehaviorUtil { + } + + public static Stream a(EntityVillager entityvillager, Predicate predicate) { +- return (Stream) entityvillager.getBehaviorController().getMemory(MemoryModuleType.MOBS).map((list) -> { ++ return entityvillager.getBehaviorController().getMemory(MemoryModuleType.MOBS).map((list) -> { + return list.stream().filter((entityliving) -> { + return entityliving instanceof EntityVillager && entityliving != entityvillager; + }).map((entityliving) -> { +diff --git a/src/main/java/net/minecraft/server/BehaviorWork.java b/src/main/java/net/minecraft/server/BehaviorWork.java +index de2a448764e02e3a3434fdf4c1a36921ef411607..7d755d28c38bb802a393c94c8a3bf7e08533bb40 100644 +--- a/src/main/java/net/minecraft/server/BehaviorWork.java ++++ b/src/main/java/net/minecraft/server/BehaviorWork.java +@@ -19,9 +19,9 @@ public class BehaviorWork extends Behavior { + return false; + } else { + this.b = worldserver.getTime(); +- GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.JOB_SITE).get(); ++ GlobalPos globalpos = entityvillager.getBehaviorController().getMemory(MemoryModuleType.JOB_SITE).get(); + +- return globalpos.getDimensionManager() == worldserver.getDimensionKey() && globalpos.getBlockPosition().a((IPosition) entityvillager.getPositionVector(), 1.73D); ++ return globalpos.getDimensionManager() == worldserver.getDimensionKey() && globalpos.getBlockPosition().a(entityvillager.getPositionVector(), 1.73D); + } + } + +@@ -48,9 +48,9 @@ public class BehaviorWork extends Behavior { + if (!optional.isPresent()) { + return false; + } else { +- GlobalPos globalpos = (GlobalPos) optional.get(); ++ GlobalPos globalpos = optional.get(); + +- return globalpos.getDimensionManager() == worldserver.getDimensionKey() && globalpos.getBlockPosition().a((IPosition) entityvillager.getPositionVector(), 1.73D); ++ return globalpos.getDimensionManager() == worldserver.getDimensionKey() && globalpos.getBlockPosition().a(entityvillager.getPositionVector(), 1.73D); + } + } + } +diff --git a/src/main/java/net/minecraft/server/BehaviorWorkComposter.java b/src/main/java/net/minecraft/server/BehaviorWorkComposter.java +index eba9f9a401a40ac4ad964e8f9fffb973a0022a82..259cce666313894b3e4add99a1fd0309cc9a7efb 100644 +--- a/src/main/java/net/minecraft/server/BehaviorWorkComposter.java ++++ b/src/main/java/net/minecraft/server/BehaviorWorkComposter.java +@@ -16,7 +16,7 @@ public class BehaviorWorkComposter extends BehaviorWork { + Optional optional = entityvillager.getBehaviorController().getMemory(MemoryModuleType.JOB_SITE); + + if (optional.isPresent()) { +- GlobalPos globalpos = (GlobalPos) optional.get(); ++ GlobalPos globalpos = optional.get(); + IBlockData iblockdata = worldserver.getType(globalpos.getBlockPosition()); + + if (iblockdata.a(Blocks.COMPOSTER)) { +@@ -28,8 +28,8 @@ public class BehaviorWorkComposter extends BehaviorWork { + } + + private void a(WorldServer worldserver, EntityVillager entityvillager, GlobalPos globalpos, IBlockData iblockdata) { +- if ((Integer) iblockdata.get(BlockComposter.a) == 8) { +- iblockdata = BlockComposter.d(iblockdata, (World) worldserver, globalpos.getBlockPosition(), entityvillager); // CraftBukkit ++ if (iblockdata.get(BlockComposter.a) == 8) { ++ iblockdata = BlockComposter.d(iblockdata, worldserver, globalpos.getBlockPosition(), entityvillager); // CraftBukkit + } + + int i = 20; +@@ -54,7 +54,7 @@ public class BehaviorWorkComposter extends BehaviorWork { + + for (int l1 = 0; l1 < k1; ++l1) { + iblockdata = BlockComposter.a(iblockdata, worldserver, itemstack, globalpos.getBlockPosition(), entityvillager); // CraftBukkit +- if ((Integer) iblockdata.get(BlockComposter.a) == 7) { ++ if (iblockdata.get(BlockComposter.a) == 7) { + return; + } + } +diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java +index d78b5cc7075a37bcf572c2043fa252bb624861a7..b0b7c616d85d0d9e1328ece06e1d1b18bc8e8695 100644 +--- a/src/main/java/net/minecraft/server/BiomeBase.java ++++ b/src/main/java/net/minecraft/server/BiomeBase.java +@@ -72,7 +72,7 @@ public class BiomeBase { + private final Map, BiomeBase.e> w = Maps.newHashMap(); + private final List x; + private final ThreadLocal y = ThreadLocal.withInitial(() -> { +- return (Long2FloatLinkedOpenHashMap) SystemUtils.a(() -> { ++ return SystemUtils.a(() -> { + Long2FloatLinkedOpenHashMap long2floatlinkedopenhashmap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) { + protected void rehash(int i) {} + }; +@@ -84,7 +84,7 @@ public class BiomeBase { + + @Nullable + public static BiomeBase a(BiomeBase biomebase) { +- return (BiomeBase) BiomeBase.reg.fromId(IRegistry.BIOME.a(biomebase)); // Paper - decompile fix / rename ++ return BiomeBase.reg.fromId(IRegistry.BIOME.a(biomebase)); // Paper - decompile fix / rename + } + + public static WorldGenCarverWrapper a(WorldGenCarverAbstract worldgencarverabstract, C c0) { +@@ -164,10 +164,10 @@ public class BiomeBase { + throw new IllegalStateException("Duplicate key"); + } + } +- this.u = (Map) result; ++ this.u = result; + this.v = Maps.newEnumMap(EnumCreatureType.class); this.v.putAll(map2); // Paper + this.x = list1; +- this.l = (String) optional.orElse(null); // Paper - decompile fix ++ this.l = optional.orElse(null); // Paper - decompile fix + Stream stream = map1.values().stream().flatMap(Collection::stream).filter((worldgenfeatureconfigured) -> { + return worldgenfeatureconfigured.d == WorldGenerator.DECORATED_FLOWER; + }); +@@ -190,7 +190,7 @@ public class BiomeBase { + } + + protected void a(EnumCreatureType enumcreaturetype, BiomeBase.BiomeMeta biomebase_biomemeta) { +- ((List) this.v.get(enumcreaturetype)).add(biomebase_biomemeta); ++ this.v.get(enumcreaturetype).add(biomebase_biomemeta); + } + + protected void a(EntityTypes entitytypes, double d0, double d1) { +@@ -198,12 +198,12 @@ public class BiomeBase { + } + + public List getMobs(EnumCreatureType enumcreaturetype) { +- return (List) this.v.get(enumcreaturetype); ++ return this.v.get(enumcreaturetype); + } + + @Nullable + public BiomeBase.e a(EntityTypes entitytypes) { +- return (BiomeBase.e) this.w.get(entitytypes); ++ return this.w.get(entitytypes); + } + + public BiomeBase.Precipitation d() { +@@ -220,7 +220,7 @@ public class BiomeBase { + + protected float a(BlockPosition blockposition) { + if (blockposition.getY() > 64) { +- float f = (float) (BiomeBase.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - decompile error - rename ++ float f = (float) (BiomeBase.NOISE_GENERATOR_3.a((float) blockposition.getX() / 8.0F, (float) blockposition.getZ() / 8.0F, false) * 4.0D); // Paper - decompile error - rename + + return this.getTemperature() - (f + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F; + } else { +@@ -230,7 +230,7 @@ public class BiomeBase { + + public final float getAdjustedTemperature(BlockPosition blockposition) { + long i = blockposition.asLong(); +- Long2FloatLinkedOpenHashMap long2floatlinkedopenhashmap = (Long2FloatLinkedOpenHashMap) this.y.get(); ++ Long2FloatLinkedOpenHashMap long2floatlinkedopenhashmap = this.y.get(); + float f = long2floatlinkedopenhashmap.get(i); + + if (!Float.isNaN(f)) { +@@ -297,17 +297,17 @@ public class BiomeBase { + this.s.add(worldgenfeatureconfigured); + } + +- ((List) this.r.get(worldgenstage_decoration)).add(worldgenfeatureconfigured); ++ this.r.get(worldgenstage_decoration).add(worldgenfeatureconfigured); + } + + public void a(WorldGenStage.Features worldgenstage_features, WorldGenCarverWrapper worldgencarverwrapper) { +- ((List) this.q.computeIfAbsent(worldgenstage_features, (worldgenstage_features1) -> { ++ this.q.computeIfAbsent(worldgenstage_features, (worldgenstage_features1) -> { + return Lists.newArrayList(); +- })).add(worldgencarverwrapper); ++ }).add(worldgencarverwrapper); + } + + public List> a(WorldGenStage.Features worldgenstage_features) { +- return (List) this.q.computeIfAbsent(worldgenstage_features, (worldgenstage_features1) -> { ++ return this.q.computeIfAbsent(worldgenstage_features, (worldgenstage_features1) -> { + return Lists.newArrayList(); + }); + } +@@ -325,7 +325,7 @@ public class BiomeBase { + } + + public StructureFeature b(StructureFeature structurefeature) { +- return (StructureFeature) this.u.getOrDefault(structurefeature.b, structurefeature); ++ return this.u.getOrDefault(structurefeature.b, structurefeature); + } + + public List> h() { +@@ -333,7 +333,7 @@ public class BiomeBase { + } + + public List> a(WorldGenStage.Decoration worldgenstage_decoration) { +- return (List) this.r.get(worldgenstage_decoration); ++ return this.r.get(worldgenstage_decoration); + } + + public void a(WorldGenStage.Decoration worldgenstage_decoration, StructureManager structuremanager, ChunkGenerator chunkgenerator, GeneratorAccessSeed generatoraccessseed, long i, SeededRandom seededrandom, BlockPosition blockposition) { +@@ -362,7 +362,7 @@ public class BiomeBase { + } catch (Exception exception) { + CrashReport crashreport = CrashReport.a(exception, "Feature placement"); + +- crashreport.a("Feature").a("Id", (Object) IRegistry.STRUCTURE_FEATURE.getKey(structuregenerator)).a("Description", () -> { ++ crashreport.a("Feature").a("Id", IRegistry.STRUCTURE_FEATURE.getKey(structuregenerator)).a("Description", () -> { + return structuregenerator.toString(); + }); + throw new ReportedException(crashreport); +@@ -383,7 +383,7 @@ public class BiomeBase { + } catch (Exception exception1) { + CrashReport crashreport1 = CrashReport.a(exception1, "Feature placement"); + +- crashreport1.a("Feature").a("Id", (Object) IRegistry.FEATURE.getKey(worldgenfeatureconfigured.d)).a("Config", (Object) worldgenfeatureconfigured.e).a("Description", () -> { ++ crashreport1.a("Feature").a("Id", IRegistry.FEATURE.getKey(worldgenfeatureconfigured.d)).a("Config", worldgenfeatureconfigured.e).a("Description", () -> { + return worldgenfeatureconfigured.d.toString(); + }); + throw new ReportedException(crashreport1); +@@ -684,7 +684,7 @@ public class BiomeBase { + throw new IllegalStateException("Duplicate key"); + } + } +- e = (Map) map; ++ e = map; + } + + private final String f; +@@ -698,7 +698,7 @@ public class BiomeBase { + } + + public static BiomeBase.Precipitation a(String s) { +- return (BiomeBase.Precipitation) BiomeBase.Precipitation.e.get(s); ++ return Precipitation.e.get(s); + } + + @Override +@@ -721,7 +721,7 @@ public class BiomeBase { + throw new IllegalStateException("Duplicate key"); + } + } +- s = (Map) map; ++ s = map; + } + + private final String t; +@@ -735,7 +735,7 @@ public class BiomeBase { + } + + public static BiomeBase.Geography a(String s) { +- return (BiomeBase.Geography) BiomeBase.Geography.s.get(s); ++ return Geography.s.get(s); + } + + @Override +@@ -757,7 +757,7 @@ public class BiomeBase { + throw new IllegalStateException("Duplicate key"); + } + } +- e = (Map) map; ++ e = map; + } + + private final String f; +diff --git a/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java b/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java +index fdc66fc1e3440b6678a1318e9a109f2b41bc8847..4ddb0b7b5215122d697ada2b6932ac7342a120a7 100644 +--- a/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java ++++ b/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java +@@ -46,11 +46,11 @@ public class BiomeFrozenDeepOcean extends BiomeBase { + protected float a(BlockPosition blockposition) { + float f = this.getTemperature(); + double d0 = BiomeFrozenDeepOcean.t.a((double) blockposition.getX() * 0.05D, (double) blockposition.getZ() * 0.05D, false) * 7.0D; +- double d1 = BiomeFrozenDeepOcean.f.a((double) blockposition.getX() * 0.2D, (double) blockposition.getZ() * 0.2D, false); ++ double d1 = BiomeBase.f.a((double) blockposition.getX() * 0.2D, (double) blockposition.getZ() * 0.2D, false); + double d2 = d0 + d1; + + if (d2 < 0.3D) { +- double d3 = BiomeFrozenDeepOcean.f.a((double) blockposition.getX() * 0.09D, (double) blockposition.getZ() * 0.09D, false); ++ double d3 = BiomeBase.f.a((double) blockposition.getX() * 0.09D, (double) blockposition.getZ() * 0.09D, false); + + if (d3 < 0.8D) { + f = 0.2F; +@@ -58,7 +58,7 @@ public class BiomeFrozenDeepOcean extends BiomeBase { + } + + if (blockposition.getY() > 64) { +- float f1 = (float) (BiomeFrozenDeepOcean.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - rename ++ float f1 = (float) (BiomeBase.NOISE_GENERATOR_3.a((float) blockposition.getX() / 8.0F, (float) blockposition.getZ() / 8.0F, false) * 4.0D); // Paper - rename + + return f - (f1 + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F; + } else { +diff --git a/src/main/java/net/minecraft/server/BiomeFrozenOcean.java b/src/main/java/net/minecraft/server/BiomeFrozenOcean.java +index 4b18e29ccb0cb15568367abb507b844011bd7f80..2d32876a43a2fbacc4660260e85b7a89a6286d70 100644 +--- a/src/main/java/net/minecraft/server/BiomeFrozenOcean.java ++++ b/src/main/java/net/minecraft/server/BiomeFrozenOcean.java +@@ -45,11 +45,11 @@ public final class BiomeFrozenOcean extends BiomeBase { + protected float a(BlockPosition blockposition) { + float f = this.getTemperature(); + double d0 = BiomeFrozenOcean.t.a((double) blockposition.getX() * 0.05D, (double) blockposition.getZ() * 0.05D, false) * 7.0D; +- double d1 = BiomeFrozenOcean.f.a((double) blockposition.getX() * 0.2D, (double) blockposition.getZ() * 0.2D, false); ++ double d1 = BiomeBase.f.a((double) blockposition.getX() * 0.2D, (double) blockposition.getZ() * 0.2D, false); + double d2 = d0 + d1; + + if (d2 < 0.3D) { +- double d3 = BiomeFrozenOcean.f.a((double) blockposition.getX() * 0.09D, (double) blockposition.getZ() * 0.09D, false); ++ double d3 = BiomeBase.f.a((double) blockposition.getX() * 0.09D, (double) blockposition.getZ() * 0.09D, false); + + if (d3 < 0.8D) { + f = 0.2F; +@@ -57,7 +57,7 @@ public final class BiomeFrozenOcean extends BiomeBase { + } + + if (blockposition.getY() > 64) { +- float f1 = (float) (BiomeFrozenOcean.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - rename ++ float f1 = (float) (BiomeBase.NOISE_GENERATOR_3.a((float) blockposition.getX() / 8.0F, (float) blockposition.getZ() / 8.0F, false) * 4.0D); // Paper - rename + + return f - (f1 + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F; + } else { +diff --git a/src/main/java/net/minecraft/server/BiomeStorage.java b/src/main/java/net/minecraft/server/BiomeStorage.java +index 11b47ebc3a49927f4c704b111254b6b1e67dd1d0..a6bbfa11f2123934ccaa7097c035ce1bbe0198a2 100644 +--- a/src/main/java/net/minecraft/server/BiomeStorage.java ++++ b/src/main/java/net/minecraft/server/BiomeStorage.java +@@ -28,7 +28,7 @@ public class BiomeStorage implements BiomeManager.Provider { + + for (int i = 0; i < this.g.length; ++i) { + int j = packetdataserializer.readInt(); +- BiomeBase biomebase = (BiomeBase) IRegistry.BIOME.fromId(j); ++ BiomeBase biomebase = IRegistry.BIOME.fromId(j); + + if (biomebase == null) { + BiomeStorage.LOGGER.warn("Received invalid biome id: " + j); +@@ -66,7 +66,7 @@ public class BiomeStorage implements BiomeManager.Provider { + + if (aint != null) { + for (k = 0; k < aint.length; ++k) { +- this.g[k] = (BiomeBase) IRegistry.BIOME.fromId(aint[k]); ++ this.g[k] = IRegistry.BIOME.fromId(aint[k]); + if (this.g[k] == null) { + l = k & BiomeStorage.b; + i1 = k >> BiomeStorage.e + BiomeStorage.e & BiomeStorage.c; +@@ -108,7 +108,7 @@ public class BiomeStorage implements BiomeManager.Provider { + } + + public BiomeStorage b() { +- return new BiomeStorage((BiomeBase[]) this.g.clone()); ++ return new BiomeStorage(this.g.clone()); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/Biomes.java b/src/main/java/net/minecraft/server/Biomes.java +index eaa527f4fe289a9492b12591154a60e5aa045252..0b23903e679f6d3d4dea6ef5694fc6310c883af9 100644 +--- a/src/main/java/net/minecraft/server/Biomes.java ++++ b/src/main/java/net/minecraft/server/Biomes.java +@@ -95,6 +95,6 @@ public abstract class Biomes { + } + + static { +- Collections.addAll(BiomeBase.c, new BiomeBase[]{Biomes.OCEAN, Biomes.PLAINS, Biomes.DESERT, Biomes.MOUNTAINS, Biomes.FOREST, Biomes.TAIGA, Biomes.SWAMP, Biomes.RIVER, Biomes.FROZEN_RIVER, Biomes.SNOWY_TUNDRA, Biomes.SNOWY_MOUNTAINS, Biomes.MUSHROOM_FIELDS, Biomes.MUSHROOM_FIELD_SHORE, Biomes.BEACH, Biomes.DESERT_HILLS, Biomes.WOODED_HILLS, Biomes.TAIGA_HILLS, Biomes.JUNGLE, Biomes.JUNGLE_HILLS, Biomes.JUNGLE_EDGE, Biomes.DEEP_OCEAN, Biomes.STONE_SHORE, Biomes.SNOWY_BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.DARK_FOREST, Biomes.SNOWY_TAIGA, Biomes.SNOWY_TAIGA_HILLS, Biomes.GIANT_TREE_TAIGA, Biomes.GIANT_TREE_TAIGA_HILLS, Biomes.WOODED_MOUNTAINS, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.BADLANDS, Biomes.WOODED_BADLANDS_PLATEAU, Biomes.BADLANDS_PLATEAU}); ++ Collections.addAll(BiomeBase.c, Biomes.OCEAN, Biomes.PLAINS, Biomes.DESERT, Biomes.MOUNTAINS, Biomes.FOREST, Biomes.TAIGA, Biomes.SWAMP, Biomes.RIVER, Biomes.FROZEN_RIVER, Biomes.SNOWY_TUNDRA, Biomes.SNOWY_MOUNTAINS, Biomes.MUSHROOM_FIELDS, Biomes.MUSHROOM_FIELD_SHORE, Biomes.BEACH, Biomes.DESERT_HILLS, Biomes.WOODED_HILLS, Biomes.TAIGA_HILLS, Biomes.JUNGLE, Biomes.JUNGLE_HILLS, Biomes.JUNGLE_EDGE, Biomes.DEEP_OCEAN, Biomes.STONE_SHORE, Biomes.SNOWY_BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.DARK_FOREST, Biomes.SNOWY_TAIGA, Biomes.SNOWY_TAIGA_HILLS, Biomes.GIANT_TREE_TAIGA, Biomes.GIANT_TREE_TAIGA_HILLS, Biomes.WOODED_MOUNTAINS, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.BADLANDS, Biomes.WOODED_BADLANDS_PLATEAU, Biomes.BADLANDS_PLATEAU); + } + } +diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java +index c16b64b30066bdff4e93c2b728c1825d11457daf..ac42cfe74e0ebb299ac7880161826e5e38766a63 100644 +--- a/src/main/java/net/minecraft/server/Block.java ++++ b/src/main/java/net/minecraft/server/Block.java +@@ -66,7 +66,7 @@ public class Block extends BlockBase implements IMaterial { + } + + public static IBlockData getByCombinedId(int i) { +- IBlockData iblockdata = (IBlockData) Block.REGISTRY_ID.fromId(i); ++ IBlockData iblockdata = Block.REGISTRY_ID.fromId(i); + + return iblockdata == null ? Blocks.AIR.getBlockData() : iblockdata; + } +@@ -76,8 +76,8 @@ public class Block extends BlockBase implements IMaterial { + } + + public static IBlockData a(IBlockData iblockdata, IBlockData iblockdata1, World world, BlockPosition blockposition) { +- VoxelShape voxelshape = VoxelShapes.b(iblockdata.getCollisionShape(world, blockposition), iblockdata1.getCollisionShape(world, blockposition), OperatorBoolean.ONLY_SECOND).a((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); +- List list = world.getEntities((Entity) null, voxelshape.getBoundingBox()); ++ VoxelShape voxelshape = VoxelShapes.b(iblockdata.getCollisionShape(world, blockposition), iblockdata1.getCollisionShape(world, blockposition), OperatorBoolean.ONLY_SECOND).a(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ List list = world.getEntities(null, voxelshape.getBoundingBox()); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { +@@ -106,13 +106,13 @@ public class Block extends BlockBase implements IMaterial { + public static IBlockData b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { + IBlockData iblockdata1 = iblockdata; + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); +- EnumDirection[] aenumdirection = Block.ar; ++ EnumDirection[] aenumdirection = BlockBase.ar; + int i = aenumdirection.length; + + for (int j = 0; j < i; ++j) { + EnumDirection enumdirection = aenumdirection[j]; + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); ++ blockposition_mutableblockposition.a(blockposition, enumdirection); + iblockdata1 = iblockdata1.updateState(enumdirection, generatoraccess.getType(blockposition_mutableblockposition), generatoraccess, blockposition, blockposition_mutableblockposition); + } + +@@ -127,7 +127,7 @@ public class Block extends BlockBase implements IMaterial { + if (iblockdata1 != iblockdata) { + if (iblockdata1.isAir()) { + if (!generatoraccess.s_()) { +- generatoraccess.a(blockposition, (i & 32) == 0, (Entity) null, j); ++ generatoraccess.a(blockposition, (i & 32) == 0, null, j); + } + } else { + generatoraccess.a(blockposition, iblockdata1, i & -33, j); +@@ -142,11 +142,11 @@ public class Block extends BlockBase implements IMaterial { + + this.a(blockstatelist_a); + this.blockStateList = blockstatelist_a.a(Block::getBlockData, IBlockData::new); +- this.j((IBlockData) this.blockStateList.getBlockData()); ++ this.j(this.blockStateList.getBlockData()); + } + + public static boolean b(Block block) { +- return block instanceof BlockLeaves || block == Blocks.BARRIER || block == Blocks.CARVED_PUMPKIN || block == Blocks.JACK_O_LANTERN || block == Blocks.MELON || block == Blocks.PUMPKIN || block.a((Tag) TagsBlock.SHULKER_BOXES); ++ return block instanceof BlockLeaves || block == Blocks.BARRIER || block == Blocks.CARVED_PUMPKIN || block == Blocks.JACK_O_LANTERN || block == Blocks.MELON || block == Blocks.PUMPKIN || block.a(TagsBlock.SHULKER_BOXES); + } + + public boolean isTicking(IBlockData iblockdata) { +@@ -162,7 +162,7 @@ public class Block extends BlockBase implements IMaterial { + public static boolean a(IWorldReader iworldreader, BlockPosition blockposition, EnumDirection enumdirection) { + IBlockData iblockdata = iworldreader.getType(blockposition); + +- return enumdirection == EnumDirection.DOWN && iblockdata.a((Tag) TagsBlock.aB) ? false : !VoxelShapes.c(iblockdata.l(iworldreader, blockposition).a(enumdirection), Block.c, OperatorBoolean.ONLY_SECOND); ++ return enumdirection == EnumDirection.DOWN && iblockdata.a(TagsBlock.aB) ? false : !VoxelShapes.c(iblockdata.l(iworldreader, blockposition).a(enumdirection), Block.c, OperatorBoolean.ONLY_SECOND); + } + + public static boolean d(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +@@ -176,7 +176,7 @@ public class Block extends BlockBase implements IMaterial { + } + + public static boolean a(VoxelShape voxelshape) { +- return (Boolean) Block.a.getUnchecked(voxelshape); ++ return Block.a.getUnchecked(voxelshape); + } + + public boolean b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { +@@ -317,7 +317,7 @@ public class Block extends BlockBase implements IMaterial { + + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) { + world.a(entityhuman, 2001, blockposition, getCombinedId(iblockdata)); +- if (this.a((Tag) TagsBlock.GUARDED_BY_PIGLINS)) { ++ if (this.a(TagsBlock.GUARDED_BY_PIGLINS)) { + PiglinAI.a(entityhuman, false); + } + +diff --git a/src/main/java/net/minecraft/server/BlockBamboo.java b/src/main/java/net/minecraft/server/BlockBamboo.java +index 53eb9241dd7a36506261401aec0b1ed91e97ced3..35872870fb6de362eb393bc196346c35456182ee 100644 +--- a/src/main/java/net/minecraft/server/BlockBamboo.java ++++ b/src/main/java/net/minecraft/server/BlockBamboo.java +@@ -14,7 +14,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { + + public BlockBamboo(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockBamboo.d, 0)).set(BlockBamboo.e, BlockPropertyBambooSize.NONE)).set(BlockBamboo.f, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockBamboo.d, 0).set(BlockBamboo.e, BlockPropertyBambooSize.NONE).set(BlockBamboo.f, 0)); + } + + @Override +@@ -62,13 +62,13 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { + } else { + IBlockData iblockdata = blockactioncontext.getWorld().getType(blockactioncontext.getClickPosition().down()); + +- if (iblockdata.a((Tag) TagsBlock.BAMBOO_PLANTABLE_ON)) { ++ if (iblockdata.a(TagsBlock.BAMBOO_PLANTABLE_ON)) { + if (iblockdata.a(Blocks.BAMBOO_SAPLING)) { +- return (IBlockData) this.getBlockData().set(BlockBamboo.d, 0); ++ return this.getBlockData().set(BlockBamboo.d, 0); + } else if (iblockdata.a(Blocks.BAMBOO)) { +- int i = (Integer) iblockdata.get(BlockBamboo.d) > 0 ? 1 : 0; ++ int i = iblockdata.get(BlockBamboo.d) > 0 ? 1 : 0; + +- return (IBlockData) this.getBlockData().set(BlockBamboo.d, i); ++ return this.getBlockData().set(BlockBamboo.d, i); + } else { + return Blocks.BAMBOO_SAPLING.getBlockData(); + } +@@ -88,17 +88,17 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { + + @Override + public boolean isTicking(IBlockData iblockdata) { +- return (Integer) iblockdata.get(BlockBamboo.f) == 0; ++ return iblockdata.get(BlockBamboo.f) == 0; + } + + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if ((Integer) iblockdata.get(BlockBamboo.f) == 0) { ++ if (iblockdata.get(BlockBamboo.f) == 0) { + if (random.nextInt(Math.max(1, (int) (100.0F / worldserver.spigotConfig.bambooModifier) * 3)) == 0 && worldserver.isEmpty(blockposition.up()) && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { // Spigot + int i = this.b(worldserver, blockposition) + 1; + + if (i < 16) { +- this.a(iblockdata, (World) worldserver, blockposition, random, i); ++ this.a(iblockdata, worldserver, blockposition, random, i); + } + } + +@@ -107,7 +107,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { + + @Override + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { +- return iworldreader.getType(blockposition.down()).a((Tag) TagsBlock.BAMBOO_PLANTABLE_ON); ++ return iworldreader.getType(blockposition.down()).a(TagsBlock.BAMBOO_PLANTABLE_ON); + } + + @Override +@@ -116,8 +116,8 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { + generatoraccess.getBlockTickList().a(blockposition, this, 1); + } + +- if (enumdirection == EnumDirection.UP && iblockdata1.a(Blocks.BAMBOO) && (Integer) iblockdata1.get(BlockBamboo.d) > (Integer) iblockdata.get(BlockBamboo.d)) { +- generatoraccess.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockBamboo.d), 2); ++ if (enumdirection == EnumDirection.UP && iblockdata1.a(Blocks.BAMBOO) && iblockdata1.get(BlockBamboo.d) > iblockdata.get(BlockBamboo.d)) { ++ generatoraccess.setTypeAndData(blockposition, iblockdata.a((IBlockState) BlockBamboo.d), 2); + } + + return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); +@@ -128,7 +128,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { + int i = this.a(iblockaccess, blockposition); + int j = this.b(iblockaccess, blockposition); + +- return i + j + 1 < 16 && (Integer) iblockaccess.getType(blockposition.up(i)).get(BlockBamboo.f) != 1; ++ return i + j + 1 < 16 && iblockaccess.getType(blockposition.up(i)).get(BlockBamboo.f) != 1; + } + + @Override +@@ -138,7 +138,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { + + @Override + public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) { +- int i = this.a((IBlockAccess) worldserver, blockposition); ++ int i = this.a(worldserver, blockposition); + int j = this.b(worldserver, blockposition); + int k = i + j + 1; + int l = 1 + random.nextInt(2); +@@ -147,11 +147,11 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { + BlockPosition blockposition1 = blockposition.up(i); + IBlockData iblockdata1 = worldserver.getType(blockposition1); + +- if (k >= 16 || (Integer) iblockdata1.get(BlockBamboo.f) == 1 || !worldserver.isEmpty(blockposition1.up())) { ++ if (k >= 16 || iblockdata1.get(BlockBamboo.f) == 1 || !worldserver.isEmpty(blockposition1.up())) { + return; + } + +- this.a(iblockdata1, (World) worldserver, blockposition1, random, k); ++ this.a(iblockdata1, worldserver, blockposition1, random, k); + ++i; + ++k; + } +@@ -187,14 +187,14 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { + } + } + +- int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1; ++ int j = iblockdata.get(BlockBamboo.d) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1; + int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1; + + // CraftBukkit start +- if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.d, j)).set(BlockBamboo.e, blockpropertybamboosize)).set(BlockBamboo.f, k), 3)) { ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition.up(), this.getBlockData().set(BlockBamboo.d, j).set(BlockBamboo.e, blockpropertybamboosize).set(BlockBamboo.f, k), 3)) { + if (shouldUpdateOthers) { +- world.setTypeAndData(blockposition.down(), (IBlockData) iblockdata1.set(BlockBamboo.e, BlockPropertyBambooSize.SMALL), 3); +- world.setTypeAndData(blockposition1, (IBlockData) iblockdata2.set(BlockBamboo.e, BlockPropertyBambooSize.NONE), 3); ++ world.setTypeAndData(blockposition.down(), iblockdata1.set(BlockBamboo.e, BlockPropertyBambooSize.SMALL), 3); ++ world.setTypeAndData(blockposition1, iblockdata2.set(BlockBamboo.e, BlockPropertyBambooSize.NONE), 3); + } + } + // CraftBukkit end +diff --git a/src/main/java/net/minecraft/server/BlockBambooSapling.java b/src/main/java/net/minecraft/server/BlockBambooSapling.java +index b5227321a913055b3a538e642bb8b2627993d526..d6d9b7eac5d3b8a34ffb47f587ccdfef839e37e7 100644 +--- a/src/main/java/net/minecraft/server/BlockBambooSapling.java ++++ b/src/main/java/net/minecraft/server/BlockBambooSapling.java +@@ -25,14 +25,14 @@ public class BlockBambooSapling extends Block implements IBlockFragilePlantEleme + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + if (random.nextInt(3) == 0 && worldserver.isEmpty(blockposition.up()) && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { +- this.a((World) worldserver, blockposition); ++ this.a(worldserver, blockposition); + } + + } + + @Override + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { +- return iworldreader.getType(blockposition.down()).a((Tag) TagsBlock.BAMBOO_PLANTABLE_ON); ++ return iworldreader.getType(blockposition.down()).a(TagsBlock.BAMBOO_PLANTABLE_ON); + } + + @Override +@@ -60,7 +60,7 @@ public class BlockBambooSapling extends Block implements IBlockFragilePlantEleme + + @Override + public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) { +- this.a((World) worldserver, blockposition); ++ this.a(worldserver, blockposition); + } + + @Override +@@ -69,6 +69,6 @@ public class BlockBambooSapling extends Block implements IBlockFragilePlantEleme + } + + protected void a(World world, BlockPosition blockposition) { +- org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition.up(), (IBlockData) Blocks.BAMBOO.getBlockData().set(BlockBamboo.e, BlockPropertyBambooSize.SMALL), 3); // CraftBukkit - BlockSpreadEvent ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition.up(), Blocks.BAMBOO.getBlockData().set(BlockBamboo.e, BlockPropertyBambooSize.SMALL), 3); // CraftBukkit - BlockSpreadEvent + } + } +diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java +index 809ec5f8fba12929a62a7a0fab843f5a4ed6b461..e169409bddc7e89891bbdcada805156b67a0a5af 100644 +--- a/src/main/java/net/minecraft/server/BlockBase.java ++++ b/src/main/java/net/minecraft/server/BlockBase.java +@@ -50,7 +50,7 @@ public abstract class BlockBase { + case LAND: + return !iblockdata.r(iblockaccess, blockposition); + case WATER: +- return iblockaccess.getFluid(blockposition).a((Tag) TagsFluid.WATER); ++ return iblockaccess.getFluid(blockposition).a(TagsFluid.WATER); + case AIR: + return !iblockdata.r(iblockaccess, blockposition); + default: +@@ -274,7 +274,7 @@ public abstract class BlockBase { + protected abstract Block p(); + + public MaterialMapColor s() { +- return (MaterialMapColor) this.aB.b.apply(this.p().getBlockData()); ++ return this.aB.b.apply(this.p().getBlockData()); + } + + public interface d { +@@ -313,7 +313,7 @@ public abstract class BlockBase { + this.e = block.c_(this.p()); + this.f = blockbase_info.o; + this.g = blockbase_info.a; +- this.h = (MaterialMapColor) blockbase_info.b.apply(this.p()); ++ this.h = blockbase_info.b.apply(this.p()); + this.strength = blockbase_info.g; + this.j = blockbase_info.h; + this.k = blockbase_info.n; +@@ -355,7 +355,7 @@ public abstract class BlockBase { + } + + public Block getBlock() { +- return (Block) this.c; ++ return this.c; + } + // Paper start + public final boolean isDestroyable() { +@@ -540,7 +540,7 @@ public abstract class BlockBase { + for (int l = 0; l < k; ++l) { + EnumDirection enumdirection = aenumdirection[l]; + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); ++ blockposition_mutableblockposition.a(blockposition, enumdirection); + IBlockData iblockdata = generatoraccess.getTypeIfLoaded(blockposition_mutableblockposition); // EMC + if (iblockdata == null) continue; // EMC + IBlockData iblockdata1 = iblockdata.updateState(enumdirection.opposite(), this.p(), generatoraccess, blockposition_mutableblockposition, blockposition); +@@ -687,7 +687,7 @@ public abstract class BlockBase { + Block block = iblockdata.getBlock(); + + this.a = iblockdata.i(BlockAccessAir.INSTANCE, BlockPosition.ZERO); +- this.g = block.b(iblockdata, (IBlockAccess) BlockAccessAir.INSTANCE, BlockPosition.ZERO); ++ this.g = block.b(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO); + this.h = block.f(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO); + int i; + +@@ -695,7 +695,7 @@ public abstract class BlockBase { + this.i = null; + } else { + this.i = new VoxelShape[f.length]; +- VoxelShape voxelshape = block.d(iblockdata, (IBlockAccess) BlockAccessAir.INSTANCE, BlockPosition.ZERO); ++ VoxelShape voxelshape = block.d(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO); + EnumDirection[] aenumdirection = f; + + i = aenumdirection.length; +diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java +index f0a622585124cb149aa031c64757b34894bf1d44..c2e020917032f87c0ecaef58e9012db6bbb39011 100644 +--- a/src/main/java/net/minecraft/server/BlockBed.java ++++ b/src/main/java/net/minecraft/server/BlockBed.java +@@ -23,7 +23,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + public BlockBed(EnumColor enumcolor, BlockBase.Info blockbase_info) { + super(blockbase_info); + this.color = enumcolor; +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockBed.PART, BlockPropertyBedPart.FOOT)).set(BlockBed.OCCUPIED, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockBed.PART, BlockPropertyBedPart.FOOT).set(BlockBed.OCCUPIED, false)); + } + + @Override +@@ -32,9 +32,9 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + return EnumInteractionResult.CONSUME; + } else { + if (iblockdata.get(BlockBed.PART) != BlockPropertyBedPart.HEAD) { +- blockposition = blockposition.shift((EnumDirection) iblockdata.get(BlockBed.FACING)); ++ blockposition = blockposition.shift(iblockdata.get(BlockFacingHorizontal.FACING)); + iblockdata = world.getType(blockposition); +- if (!iblockdata.a((Block) this)) { ++ if (!iblockdata.a(this)) { + return EnumInteractionResult.CONSUME; + } + } +@@ -42,17 +42,17 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + // CraftBukkit - moved world and biome check into EntityHuman + if (false && !a(world)) { + world.a(blockposition, false); +- BlockPosition blockposition1 = blockposition.shift(((EnumDirection) iblockdata.get(BlockBed.FACING)).opposite()); ++ BlockPosition blockposition1 = blockposition.shift(iblockdata.get(BlockFacingHorizontal.FACING).opposite()); + +- if (world.getType(blockposition1).a((Block) this)) { ++ if (world.getType(blockposition1).a(this)) { + world.a(blockposition1, false); + } + +- world.createExplosion((Entity) null, DamageSource.a(), (ExplosionDamageCalculator) null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY); ++ world.createExplosion(null, DamageSource.a(), null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY); + return EnumInteractionResult.SUCCESS; +- } else if ((Boolean) iblockdata.get(BlockBed.OCCUPIED)) { ++ } else if (iblockdata.get(BlockBed.OCCUPIED)) { + if (!this.a(world, blockposition)) { +- entityhuman.a((IChatBaseComponent) (new ChatMessage("block.minecraft.bed.occupied")), true); ++ entityhuman.a(new ChatMessage("block.minecraft.bed.occupied"), true); + } + + return EnumInteractionResult.SUCCESS; +@@ -82,13 +82,13 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + { + { + world.a(blockposition, false); +- BlockPosition blockposition1 = blockposition.shift(((EnumDirection) iblockdata.get(BlockBed.FACING)).opposite()); ++ BlockPosition blockposition1 = blockposition.shift(iblockdata.get(BlockFacingHorizontal.FACING).opposite()); + + if (world.getType(blockposition1).getBlock() == this) { + world.a(blockposition1, false); + } + +- world.createExplosion((Entity) null, DamageSource.a(), (ExplosionDamageCalculator) null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY); ++ world.createExplosion(null, DamageSource.a(), null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY); + return EnumInteractionResult.SUCCESS; + } + } +@@ -106,7 +106,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + if (list.isEmpty()) { + return false; + } else { +- ((EntityVillager) list.get(0)).entityWakeup(); ++ list.get(0).entityWakeup(); + return true; + } + } +@@ -139,7 +139,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- return enumdirection == a((BlockPropertyBedPart) iblockdata.get(BlockBed.PART), (EnumDirection) iblockdata.get(BlockBed.FACING)) ? (iblockdata1.a((Block) this) && iblockdata1.get(BlockBed.PART) != iblockdata.get(BlockBed.PART) ? (IBlockData) iblockdata.set(BlockBed.OCCUPIED, iblockdata1.get(BlockBed.OCCUPIED)) : Blocks.AIR.getBlockData()) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); ++ return enumdirection == a(iblockdata.get(BlockBed.PART), iblockdata.get(BlockFacingHorizontal.FACING)) ? (iblockdata1.a(this) && iblockdata1.get(BlockBed.PART) != iblockdata.get(BlockBed.PART) ? iblockdata.set(BlockBed.OCCUPIED, iblockdata1.get(BlockBed.OCCUPIED)) : Blocks.AIR.getBlockData()) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); + } + + private static EnumDirection a(BlockPropertyBedPart blockpropertybedpart, EnumDirection enumdirection) { +@@ -149,10 +149,10 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + @Override + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) { + if (!world.isClientSide && entityhuman.isCreative()) { +- BlockPropertyBedPart blockpropertybedpart = (BlockPropertyBedPart) iblockdata.get(BlockBed.PART); ++ BlockPropertyBedPart blockpropertybedpart = iblockdata.get(BlockBed.PART); + + if (blockpropertybedpart == BlockPropertyBedPart.FOOT) { +- BlockPosition blockposition1 = blockposition.shift(a(blockpropertybedpart, (EnumDirection) iblockdata.get(BlockBed.FACING))); ++ BlockPosition blockposition1 = blockposition.shift(a(blockpropertybedpart, iblockdata.get(BlockFacingHorizontal.FACING))); + IBlockData iblockdata1 = world.getType(blockposition1); + + if (iblockdata1.getBlock() == this && iblockdata1.get(BlockBed.PART) == BlockPropertyBedPart.HEAD) { +@@ -172,7 +172,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + BlockPosition blockposition = blockactioncontext.getClickPosition(); + BlockPosition blockposition1 = blockposition.shift(enumdirection); + +- return blockactioncontext.getWorld().getType(blockposition1).a(blockactioncontext) ? (IBlockData) this.getBlockData().set(BlockBed.FACING, enumdirection) : null; ++ return blockactioncontext.getWorld().getType(blockposition1).a(blockactioncontext) ? this.getBlockData().set(BlockFacingHorizontal.FACING, enumdirection) : null; + } + + @Override +@@ -192,13 +192,13 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + } + + public static EnumDirection g(IBlockData iblockdata) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockBed.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockFacingHorizontal.FACING); + + return iblockdata.get(BlockBed.PART) == BlockPropertyBedPart.HEAD ? enumdirection.opposite() : enumdirection; + } + + public static Optional a(EntityTypes entitytypes, IWorldReader iworldreader, BlockPosition blockposition, int i) { +- EnumDirection enumdirection = (EnumDirection) iworldreader.getType(blockposition).get(BlockBed.FACING); ++ EnumDirection enumdirection = iworldreader.getType(blockposition).get(BlockFacingHorizontal.FACING); + // Paper start - configurable bed search radius + if (entitytypes == EntityTypes.PLAYER) return findSafePosition(entitytypes, (World) iworldreader, enumdirection, blockposition); + int j = blockposition.getX(); +@@ -379,7 +379,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + + @Override + protected void a(BlockStateList.a blockstatelist_a) { +- blockstatelist_a.a(BlockBed.FACING, BlockBed.PART, BlockBed.OCCUPIED); ++ blockstatelist_a.a(BlockFacingHorizontal.FACING, BlockBed.PART, BlockBed.OCCUPIED); + } + + @Override +@@ -391,9 +391,9 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { + public void postPlace(World world, BlockPosition blockposition, IBlockData iblockdata, @Nullable EntityLiving entityliving, ItemStack itemstack) { + super.postPlace(world, blockposition, iblockdata, entityliving, itemstack); + if (!world.isClientSide) { +- BlockPosition blockposition1 = blockposition.shift((EnumDirection) iblockdata.get(BlockBed.FACING)); ++ BlockPosition blockposition1 = blockposition.shift(iblockdata.get(BlockFacingHorizontal.FACING)); + +- world.setTypeAndData(blockposition1, (IBlockData) iblockdata.set(BlockBed.PART, BlockPropertyBedPart.HEAD), 3); ++ world.setTypeAndData(blockposition1, iblockdata.set(BlockBed.PART, BlockPropertyBedPart.HEAD), 3); + world.update(blockposition, Blocks.AIR); + iblockdata.a(world, blockposition, 3); + } +diff --git a/src/main/java/net/minecraft/server/BlockBeehive.java b/src/main/java/net/minecraft/server/BlockBeehive.java +index 6a4d63139ebce442b3dc9f89c05cf17430e40e1e..7821e6718490a6668f43a09e7221d4da0d3f4cac 100644 +--- a/src/main/java/net/minecraft/server/BlockBeehive.java ++++ b/src/main/java/net/minecraft/server/BlockBeehive.java +@@ -13,7 +13,7 @@ public class BlockBeehive extends BlockTileEntity { + + public BlockBeehive(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockBeehive.b, 0)).set(BlockBeehive.a, EnumDirection.NORTH)); ++ this.j(this.blockStateList.getBlockData().set(BlockBeehive.b, 0).set(BlockBeehive.a, EnumDirection.NORTH)); + } + + @Override +@@ -23,7 +23,7 @@ public class BlockBeehive extends BlockTileEntity { + + @Override + public int a(IBlockData iblockdata, World world, BlockPosition blockposition) { +- return (Integer) iblockdata.get(BlockBeehive.b); ++ return iblockdata.get(BlockBeehive.b); + } + + @Override +@@ -55,7 +55,7 @@ public class BlockBeehive extends BlockTileEntity { + EntityBee entitybee = (EntityBee) iterator.next(); + + if (entitybee.getGoalTarget() == null) { +- entitybee.setGoalTarget((EntityLiving) list1.get(world.random.nextInt(i)), org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit ++ entitybee.setGoalTarget(list1.get(world.random.nextInt(i)), org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit + } + } + } +@@ -69,7 +69,7 @@ public class BlockBeehive extends BlockTileEntity { + @Override + public EnumInteractionResult interact(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) { + ItemStack itemstack = entityhuman.b(enumhand); +- int i = (Integer) iblockdata.get(BlockBeehive.b); ++ int i = iblockdata.get(BlockBeehive.b); + boolean flag = false; + + if (i >= 5) { +@@ -135,12 +135,12 @@ public class BlockBeehive extends BlockTileEntity { + } + + public void a(World world, IBlockData iblockdata, BlockPosition blockposition) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockBeehive.b, 0), 3); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockBeehive.b, 0), 3); + } + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return (IBlockData) this.getBlockData().set(BlockBeehive.a, blockactioncontext.f().opposite()); ++ return this.getBlockData().set(BlockBeehive.a, blockactioncontext.f().opposite()); + } + + @Override +@@ -167,7 +167,7 @@ public class BlockBeehive extends BlockTileEntity { + if (tileentity instanceof TileEntityBeehive) { + TileEntityBeehive tileentitybeehive = (TileEntityBeehive) tileentity; + ItemStack itemstack = new ItemStack(this); +- int i = (Integer) iblockdata.get(BlockBeehive.b); ++ int i = iblockdata.get(BlockBeehive.b); + boolean flag = !tileentitybeehive.isEmpty(); + + if (!flag && i == 0) { +@@ -179,13 +179,13 @@ public class BlockBeehive extends BlockTileEntity { + if (flag) { + nbttagcompound = new NBTTagCompound(); + nbttagcompound.set("Bees", tileentitybeehive.m()); +- itemstack.a("BlockEntityTag", (NBTBase) nbttagcompound); ++ itemstack.a("BlockEntityTag", nbttagcompound); + } + + nbttagcompound = new NBTTagCompound(); + nbttagcompound.setInt("honey_level", i); +- itemstack.a("BlockStateTag", (NBTBase) nbttagcompound); +- EntityItem entityitem = new EntityItem(world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack); ++ itemstack.a("BlockStateTag", nbttagcompound); ++ EntityItem entityitem = new EntityItem(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), itemstack); + + entityitem.defaultPickupDelay(); + world.addEntity(entityitem); +@@ -197,15 +197,15 @@ public class BlockBeehive extends BlockTileEntity { + + @Override + public List a(IBlockData iblockdata, LootTableInfo.Builder loottableinfo_builder) { +- Entity entity = (Entity) loottableinfo_builder.b(LootContextParameters.THIS_ENTITY); ++ Entity entity = loottableinfo_builder.b(LootContextParameters.THIS_ENTITY); + + if (entity instanceof EntityTNTPrimed || entity instanceof EntityCreeper || entity instanceof EntityWitherSkull || entity instanceof EntityWither || entity instanceof EntityMinecartTNT) { +- TileEntity tileentity = (TileEntity) loottableinfo_builder.b(LootContextParameters.BLOCK_ENTITY); ++ TileEntity tileentity = loottableinfo_builder.b(LootContextParameters.BLOCK_ENTITY); + + if (tileentity instanceof TileEntityBeehive) { + TileEntityBeehive tileentitybeehive = (TileEntityBeehive) tileentity; + +- tileentitybeehive.a((EntityHuman) null, iblockdata, TileEntityBeehive.ReleaseStatus.EMERGENCY); ++ tileentitybeehive.a(null, iblockdata, TileEntityBeehive.ReleaseStatus.EMERGENCY); + } + } + +@@ -220,7 +220,7 @@ public class BlockBeehive extends BlockTileEntity { + if (tileentity instanceof TileEntityBeehive) { + TileEntityBeehive tileentitybeehive = (TileEntityBeehive) tileentity; + +- tileentitybeehive.a((EntityHuman) null, iblockdata, TileEntityBeehive.ReleaseStatus.EMERGENCY); ++ tileentitybeehive.a(null, iblockdata, TileEntityBeehive.ReleaseStatus.EMERGENCY); + } + } + +diff --git a/src/main/java/net/minecraft/server/BlockButtonAbstract.java b/src/main/java/net/minecraft/server/BlockButtonAbstract.java +index 1dba8e8c34005f9e9b28a32b24647cc538da06be..51ab966ea04ff9123390582647b35f1e66c2c0a6 100644 +--- a/src/main/java/net/minecraft/server/BlockButtonAbstract.java ++++ b/src/main/java/net/minecraft/server/BlockButtonAbstract.java +@@ -31,7 +31,7 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + + protected BlockButtonAbstract(boolean flag, BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockButtonAbstract.FACING, EnumDirection.NORTH)).set(BlockButtonAbstract.POWERED, false)).set(BlockButtonAbstract.FACE, BlockPropertyAttachPosition.WALL)); ++ this.j(this.blockStateList.getBlockData().set(BlockFacingHorizontal.FACING, EnumDirection.NORTH).set(BlockButtonAbstract.POWERED, false).set(BlockAttachable.FACE, BlockPropertyAttachPosition.WALL)); + this.v = flag; + } + +@@ -41,10 +41,10 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockButtonAbstract.FACING); +- boolean flag = (Boolean) iblockdata.get(BlockButtonAbstract.POWERED); ++ EnumDirection enumdirection = iblockdata.get(BlockFacingHorizontal.FACING); ++ boolean flag = iblockdata.get(BlockButtonAbstract.POWERED); + +- switch ((BlockPropertyAttachPosition) iblockdata.get(BlockButtonAbstract.FACE)) { ++ switch (iblockdata.get(BlockAttachable.FACE)) { + case FLOOR: + if (enumdirection.n() == EnumDirection.EnumAxis.X) { + return flag ? BlockButtonAbstract.o : BlockButtonAbstract.d; +@@ -71,11 +71,11 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + + @Override + public EnumInteractionResult interact(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) { +- if ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)) { ++ if (iblockdata.get(BlockButtonAbstract.POWERED)) { + return EnumInteractionResult.CONSUME; + } else { + // CraftBukkit start +- boolean powered = ((Boolean) iblockdata.get(POWERED)); ++ boolean powered = iblockdata.get(POWERED); + org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + int old = (powered) ? 15 : 0; + int current = (!powered) ? 15 : 0; +@@ -94,7 +94,7 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + } + + public void d(IBlockData iblockdata, World world, BlockPosition blockposition) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, true), 3); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockButtonAbstract.POWERED, true), 3); + this.f(iblockdata, world, blockposition); + world.getBlockTickList().a(blockposition, this, this.c()); + } +@@ -108,7 +108,7 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + @Override + public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!flag && !iblockdata.a(iblockdata1.getBlock())) { +- if ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)) { ++ if (iblockdata.get(BlockButtonAbstract.POWERED)) { + this.f(iblockdata, world, blockposition); + } + +@@ -118,12 +118,12 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Boolean) iblockdata.get(BlockButtonAbstract.POWERED) ? 15 : 0; ++ return iblockdata.get(BlockButtonAbstract.POWERED) ? 15 : 0; + } + + @Override + public int b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Boolean) iblockdata.get(BlockButtonAbstract.POWERED) && h(iblockdata) == enumdirection ? 15 : 0; ++ return iblockdata.get(BlockButtonAbstract.POWERED) && h(iblockdata) == enumdirection ? 15 : 0; + } + + @Override +@@ -133,9 +133,9 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)) { ++ if (iblockdata.get(BlockButtonAbstract.POWERED)) { + if (this.v) { +- this.e(iblockdata, (World) worldserver, blockposition); ++ this.e(iblockdata, worldserver, blockposition); + } else { + // CraftBukkit start + org.bukkit.block.Block block = worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); +@@ -147,9 +147,9 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, false), 3); +- this.f(iblockdata, (World) worldserver, blockposition); +- this.a((EntityHuman) null, worldserver, blockposition, false); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockButtonAbstract.POWERED, false), 3); ++ this.f(iblockdata, worldserver, blockposition); ++ this.a(null, worldserver, blockposition, false); + } + + } +@@ -165,7 +165,7 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + private void e(IBlockData iblockdata, World world, BlockPosition blockposition) { + List list = world.a(EntityArrow.class, iblockdata.getShape(world, blockposition).getBoundingBox().a(blockposition)); + boolean flag = !list.isEmpty(); +- boolean flag1 = (Boolean) iblockdata.get(BlockButtonAbstract.POWERED); ++ boolean flag1 = iblockdata.get(BlockButtonAbstract.POWERED); + + // CraftBukkit start - Call interact event when arrows turn on wooden buttons + if (flag1 != flag && flag) { +@@ -205,9 +205,9 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + return; + } + // CraftBukkit end +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, flag), 3); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockButtonAbstract.POWERED, flag), 3); + this.f(iblockdata, world, blockposition); +- this.a((EntityHuman) null, world, blockposition, flag); ++ this.a(null, world, blockposition, flag); + } + + if (flag) { +@@ -223,6 +223,6 @@ public abstract class BlockButtonAbstract extends BlockAttachable { + + @Override + protected void a(BlockStateList.a blockstatelist_a) { +- blockstatelist_a.a(BlockButtonAbstract.FACING, BlockButtonAbstract.POWERED, BlockButtonAbstract.FACE); ++ blockstatelist_a.a(BlockFacingHorizontal.FACING, BlockButtonAbstract.POWERED, BlockAttachable.FACE); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java +index ce0797fdc43bbb7b5a2bd67632db04209be40124..f23870e6b039ede4b14db91ca444f566acac404c 100644 +--- a/src/main/java/net/minecraft/server/BlockCactus.java ++++ b/src/main/java/net/minecraft/server/BlockCactus.java +@@ -13,7 +13,7 @@ public class BlockCactus extends Block { + + protected BlockCactus(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockCactus.AGE, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockCactus.AGE, 0)); + } + + @Override +@@ -31,21 +31,21 @@ public class BlockCactus extends Block { + if (worldserver.isEmpty(blockposition1)) { + int i; + +- for (i = 1; worldserver.getType(blockposition.down(i)).a((Block) this); ++i) { ++ for (i = 1; worldserver.getType(blockposition.down(i)).a(this); ++i) { + ; + } + + if (i < worldserver.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height +- int j = (Integer) iblockdata.get(BlockCactus.AGE); ++ int j = iblockdata.get(BlockCactus.AGE); + + if (j >= (byte) range(3, ((100.0F / worldserver.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot + CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition1, this.getBlockData()); // CraftBukkit +- IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockCactus.AGE, 0); ++ IBlockData iblockdata1 = iblockdata.set(BlockCactus.AGE, 0); + + worldserver.setTypeAndData(blockposition, iblockdata1, 4); + iblockdata1.doPhysics(worldserver, blockposition1, this, blockposition, false); + } else { +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCactus.AGE, j + 1), 4); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockCactus.AGE, j + 1), 4); + } + + } +@@ -89,7 +89,7 @@ public class BlockCactus extends Block { + IBlockData iblockdata2 = iworldreader.getType(blockposition.shift(enumdirection)); + + material = iblockdata2.getMaterial(); +- } while (!material.isBuildable() && !iworldreader.getFluid(blockposition.shift(enumdirection)).a((Tag) TagsFluid.LAVA)); ++ } while (!material.isBuildable() && !iworldreader.getFluid(blockposition.shift(enumdirection)).a(TagsFluid.LAVA)); + + return false; + } +diff --git a/src/main/java/net/minecraft/server/BlockCake.java b/src/main/java/net/minecraft/server/BlockCake.java +index 5ef0555417aa6739583688ad957aef2afac17b92..dca018e3b29f9c35e3df35f577f2dcdb05784615 100644 +--- a/src/main/java/net/minecraft/server/BlockCake.java ++++ b/src/main/java/net/minecraft/server/BlockCake.java +@@ -7,12 +7,12 @@ public class BlockCake extends Block { + + protected BlockCake(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockCake.BITES, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockCake.BITES, 0)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return BlockCake.b[(Integer) iblockdata.get(BlockCake.BITES)]; ++ return BlockCake.b[iblockdata.get(BlockCake.BITES)]; + } + + @Override +@@ -49,10 +49,10 @@ public class BlockCake extends Block { + + ((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate(); + // CraftBukkit end +- int i = (Integer) iblockdata.get(BlockCake.BITES); ++ int i = iblockdata.get(BlockCake.BITES); + + if (i < 6) { +- generatoraccess.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCake.BITES, i + 1), 3); ++ generatoraccess.setTypeAndData(blockposition, iblockdata.set(BlockCake.BITES, i + 1), 3); + } else { + generatoraccess.a(blockposition, false); + } +@@ -78,7 +78,7 @@ public class BlockCake extends Block { + + @Override + public int a(IBlockData iblockdata, World world, BlockPosition blockposition) { +- return (7 - (Integer) iblockdata.get(BlockCake.BITES)) * 2; ++ return (7 - iblockdata.get(BlockCake.BITES)) * 2; + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java +index e7581cc1a41fb5dd85a7d56c62bb73792dde931c..102272978439ad2c0daaf648b863ac47b8410484 100644 +--- a/src/main/java/net/minecraft/server/BlockCampfire.java ++++ b/src/main/java/net/minecraft/server/BlockCampfire.java +@@ -19,7 +19,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + super(blockbase_info); + this.g = flag; + this.h = i; +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockCampfire.b, true)).set(BlockCampfire.c, false)).set(BlockCampfire.d, false)).set(BlockCampfire.e, EnumDirection.NORTH)); ++ this.j(this.blockStateList.getBlockData().set(BlockCampfire.b, true).set(BlockCampfire.c, false).set(BlockCampfire.d, false).set(BlockCampfire.e, EnumDirection.NORTH)); + } + + @Override +@@ -32,7 +32,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + Optional optional = tileentitycampfire.a(itemstack); + + if (optional.isPresent()) { +- if (!world.isClientSide && tileentitycampfire.a(entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack, ((RecipeCampfire) optional.get()).getCookingTime())) { ++ if (!world.isClientSide && tileentitycampfire.a(entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack, optional.get().getCookingTime())) { + entityhuman.a(StatisticList.INTERACT_WITH_CAMPFIRE); + return EnumInteractionResult.SUCCESS; + } +@@ -46,7 +46,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + + @Override + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { +- if (!entity.isFireProof() && (Boolean) iblockdata.get(BlockCampfire.b) && entity instanceof EntityLiving && !EnchantmentManager.i((EntityLiving) entity)) { ++ if (!entity.isFireProof() && iblockdata.get(BlockCampfire.b) && entity instanceof EntityLiving && !EnchantmentManager.i((EntityLiving) entity)) { + entity.damageEntity(DamageSource.FIRE, (float) this.h); + } + +@@ -73,16 +73,16 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + BlockPosition blockposition = blockactioncontext.getClickPosition(); + boolean flag = world.getFluid(blockposition).getType() == FluidTypes.WATER; + +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockCampfire.d, flag)).set(BlockCampfire.c, this.l(world.getType(blockposition.down())))).set(BlockCampfire.b, !flag)).set(BlockCampfire.e, blockactioncontext.f()); ++ return this.getBlockData().set(BlockCampfire.d, flag).set(BlockCampfire.c, this.l(world.getType(blockposition.down()))).set(BlockCampfire.b, !flag).set(BlockCampfire.e, blockactioncontext.f()); + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- if ((Boolean) iblockdata.get(BlockCampfire.d)) { +- generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess)); ++ if (iblockdata.get(BlockCampfire.d)) { ++ generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(generatoraccess)); + } + +- return enumdirection == EnumDirection.DOWN ? (IBlockData) iblockdata.set(BlockCampfire.c, this.l(iblockdata1)) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); ++ return enumdirection == EnumDirection.DOWN ? iblockdata.set(BlockCampfire.c, this.l(iblockdata1)) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); + } + + private boolean l(IBlockData iblockdata) { +@@ -102,7 +102,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + public static void c(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata) { + if (generatoraccess.s_()) { + for (int i = 0; i < 20; ++i) { +- a(generatoraccess.getMinecraftWorld(), blockposition, (Boolean) iblockdata.get(BlockCampfire.c), true); ++ a(generatoraccess.getMinecraftWorld(), blockposition, iblockdata.get(BlockCampfire.c), true); + } + } + +@@ -117,18 +117,18 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + @Override + public boolean place(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid) { + if (!(Boolean) iblockdata.get(BlockProperties.C) && fluid.getType() == FluidTypes.WATER) { +- boolean flag = (Boolean) iblockdata.get(BlockCampfire.b); ++ boolean flag = iblockdata.get(BlockCampfire.b); + + if (flag) { + if (!generatoraccess.s_()) { +- generatoraccess.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_GENERIC_EXTINGUISH_FIRE, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ generatoraccess.playSound(null, blockposition, SoundEffects.ENTITY_GENERIC_EXTINGUISH_FIRE, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + + c(generatoraccess, blockposition, iblockdata); + } + +- generatoraccess.setTypeAndData(blockposition, (IBlockData) ((IBlockData) iblockdata.set(BlockCampfire.d, true)).set(BlockCampfire.b, false), 3); +- generatoraccess.getFluidTickList().a(blockposition, fluid.getType(), fluid.getType().a((IWorldReader) generatoraccess)); ++ generatoraccess.setTypeAndData(blockposition, iblockdata.set(BlockCampfire.d, true).set(BlockCampfire.b, false), 3); ++ generatoraccess.getFluidTickList().a(blockposition, fluid.getType(), fluid.getType().a(generatoraccess)); + return true; + } else { + return false; +@@ -149,7 +149,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + return; + } + // CraftBukkit end +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true), 11); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockProperties.r, true), 11); + } + } + +@@ -175,7 +175,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + return true; + } + +- boolean flag = VoxelShapes.c(BlockCampfire.f, iblockdata.b((IBlockAccess) world, blockposition, VoxelShapeCollision.a()), OperatorBoolean.AND); ++ boolean flag = VoxelShapes.c(BlockCampfire.f, iblockdata.b(world, blockposition, VoxelShapeCollision.a()), OperatorBoolean.AND); + + if (flag) { + IBlockData iblockdata1 = world.getType(blockposition1.down()); +@@ -188,22 +188,22 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + } + + public static boolean g(IBlockData iblockdata) { +- return iblockdata.b(BlockCampfire.b) && iblockdata.a((Tag) TagsBlock.CAMPFIRES) && (Boolean) iblockdata.get(BlockCampfire.b); ++ return iblockdata.b(BlockCampfire.b) && iblockdata.a(TagsBlock.CAMPFIRES) && iblockdata.get(BlockCampfire.b); + } + + @Override + public Fluid d(IBlockData iblockdata) { +- return (Boolean) iblockdata.get(BlockCampfire.d) ? FluidTypes.WATER.a(false) : super.d(iblockdata); ++ return iblockdata.get(BlockCampfire.d) ? FluidTypes.WATER.a(false) : super.d(iblockdata); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockCampfire.e, enumblockrotation.a((EnumDirection) iblockdata.get(BlockCampfire.e))); ++ return iblockdata.set(BlockCampfire.e, enumblockrotation.a(iblockdata.get(BlockCampfire.e))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockCampfire.e))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockCampfire.e))); + } + + @Override +@@ -222,7 +222,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + } + + public static boolean h(IBlockData iblockdata) { +- return iblockdata.a((Tag) TagsBlock.CAMPFIRES, (blockbase_blockdata) -> { ++ return iblockdata.a(TagsBlock.CAMPFIRES, (blockbase_blockdata) -> { + return blockbase_blockdata.b(BlockProperties.C) && blockbase_blockdata.b(BlockProperties.r); + }) && !(Boolean) iblockdata.get(BlockProperties.C) && !(Boolean) iblockdata.get(BlockProperties.r); + } +diff --git a/src/main/java/net/minecraft/server/BlockCauldron.java b/src/main/java/net/minecraft/server/BlockCauldron.java +index f7eaeb70aff716665e2da84eab5da6657adeade7..cd1a32352e6265aab21b970e960a757b8ce462f3 100644 +--- a/src/main/java/net/minecraft/server/BlockCauldron.java ++++ b/src/main/java/net/minecraft/server/BlockCauldron.java +@@ -10,7 +10,7 @@ public class BlockCauldron extends Block { + + public BlockCauldron(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockCauldron.LEVEL, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockCauldron.LEVEL, 0)); + } + + @Override +@@ -25,7 +25,7 @@ public class BlockCauldron extends Block { + + @Override + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { +- int i = (Integer) iblockdata.get(BlockCauldron.LEVEL); ++ int i = iblockdata.get(BlockCauldron.LEVEL); + float f = (float) blockposition.getY() + (6.0F + (float) (3 * i)) / 16.0F; + + if (!world.isClientSide && entity.isBurning() && i > 0 && entity.locY() <= (double) f) { +@@ -47,7 +47,7 @@ public class BlockCauldron extends Block { + if (itemstack.isEmpty()) { + return EnumInteractionResult.PASS; + } else { +- int i = (Integer) iblockdata.get(BlockCauldron.LEVEL); ++ int i = iblockdata.get(BlockCauldron.LEVEL); + Item item = itemstack.getItem(); + + if (item == Items.WATER_BUCKET) { +@@ -63,7 +63,7 @@ public class BlockCauldron extends Block { + entityhuman.a(StatisticList.FILL_CAULDRON); + // this.a(world, blockposition, iblockdata, 3); + // CraftBukkit end +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, blockposition, SoundEffects.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + + return EnumInteractionResult.a(world.isClientSide); +@@ -85,7 +85,7 @@ public class BlockCauldron extends Block { + entityhuman.a(StatisticList.USE_CAULDRON); + // this.a(world, blockposition, iblockdata, 0); + // CraftBukkit end +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, blockposition, SoundEffects.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + + return EnumInteractionResult.a(world.isClientSide); +@@ -111,7 +111,7 @@ public class BlockCauldron extends Block { + } + } + +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, blockposition, SoundEffects.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F); + // this.a(world, blockposition, iblockdata, i - 1); + // CraftBukkit end + } +@@ -132,7 +132,7 @@ public class BlockCauldron extends Block { + } + } + +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, blockposition, SoundEffects.ITEM_BOTTLE_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); + // this.a(world, blockposition, iblockdata, i + 1); + // CraftBukkit end + } +@@ -221,7 +221,7 @@ public class BlockCauldron extends Block { + if (event.isCancelled()) { + return false; + } +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCauldron.LEVEL, event.getNewLevel()), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockCauldron.LEVEL, event.getNewLevel()), 2); + world.updateAdjacentComparators(blockposition, this); + return true; + // CraftBukkit end +@@ -235,8 +235,8 @@ public class BlockCauldron extends Block { + if (f >= 0.15F) { + IBlockData iblockdata = world.getType(blockposition); + +- if ((Integer) iblockdata.get(BlockCauldron.LEVEL) < 3) { +- this.a(world, blockposition, (IBlockData) iblockdata.a((IBlockState) BlockCauldron.LEVEL), 2); // CraftBukkit ++ if (iblockdata.get(BlockCauldron.LEVEL) < 3) { ++ this.a(world, blockposition, iblockdata.a((IBlockState) BlockCauldron.LEVEL), 2); // CraftBukkit + } + + } +@@ -250,7 +250,7 @@ public class BlockCauldron extends Block { + + @Override + public int a(IBlockData iblockdata, World world, BlockPosition blockposition) { +- return (Integer) iblockdata.get(BlockCauldron.LEVEL); ++ return iblockdata.get(BlockCauldron.LEVEL); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java +index 80b46fe0841c694f2de6fb912d646f3bcdd86a40..640408e19c41f022a315a237498f86dae84ff235 100644 +--- a/src/main/java/net/minecraft/server/BlockChest.java ++++ b/src/main/java/net/minecraft/server/BlockChest.java +@@ -75,18 +75,18 @@ public class BlockChest extends BlockChestAbstract implements I + + @Override + public IChatBaseComponent getScoreboardDisplayName() { +- return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getScoreboardDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getScoreboardDisplayName() : new ChatMessage("container.chestDouble"))); ++ return tileentitychest.hasCustomName() ? tileentitychest.getScoreboardDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getScoreboardDisplayName() : new ChatMessage("container.chestDouble")); + } + }; + // CraftBukkit end + + protected BlockChest(BlockBase.Info blockbase_info, Supplier> supplier) { + super(blockbase_info, supplier); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockChest.FACING, EnumDirection.NORTH)).set(BlockChest.c, BlockPropertyChestType.SINGLE)).set(BlockChest.d, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockChest.FACING, EnumDirection.NORTH).set(BlockChest.c, BlockPropertyChestType.SINGLE).set(BlockChest.d, false)); + } + + public static DoubleBlockFinder.BlockType g(IBlockData iblockdata) { +- BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) iblockdata.get(BlockChest.c); ++ BlockPropertyChestType blockpropertychesttype = iblockdata.get(BlockChest.c); + + return blockpropertychesttype == BlockPropertyChestType.SINGLE ? DoubleBlockFinder.BlockType.SINGLE : (blockpropertychesttype == BlockPropertyChestType.RIGHT ? DoubleBlockFinder.BlockType.FIRST : DoubleBlockFinder.BlockType.SECOND); + } +@@ -98,18 +98,18 @@ public class BlockChest extends BlockChestAbstract implements I + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- if ((Boolean) iblockdata.get(BlockChest.d)) { +- generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess)); ++ if (iblockdata.get(BlockChest.d)) { ++ generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(generatoraccess)); + } + +- if (iblockdata1.a((Block) this) && enumdirection.n().d()) { +- BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) iblockdata1.get(BlockChest.c); ++ if (iblockdata1.a(this) && enumdirection.n().d()) { ++ BlockPropertyChestType blockpropertychesttype = iblockdata1.get(BlockChest.c); + + if (iblockdata.get(BlockChest.c) == BlockPropertyChestType.SINGLE && blockpropertychesttype != BlockPropertyChestType.SINGLE && iblockdata.get(BlockChest.FACING) == iblockdata1.get(BlockChest.FACING) && h(iblockdata1) == enumdirection.opposite()) { +- return (IBlockData) iblockdata.set(BlockChest.c, blockpropertychesttype.b()); ++ return iblockdata.set(BlockChest.c, blockpropertychesttype.b()); + } + } else if (h(iblockdata) == enumdirection) { +- return (IBlockData) iblockdata.set(BlockChest.c, BlockPropertyChestType.SINGLE); ++ return iblockdata.set(BlockChest.c, BlockPropertyChestType.SINGLE); + } + + return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); +@@ -135,7 +135,7 @@ public class BlockChest extends BlockChestAbstract implements I + } + + public static EnumDirection h(IBlockData iblockdata) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockChest.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockChest.FACING); + + return iblockdata.get(BlockChest.c) == BlockPropertyChestType.LEFT ? enumdirection.g() : enumdirection.h(); + } +@@ -165,19 +165,19 @@ public class BlockChest extends BlockChestAbstract implements I + } + } + +- return (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockChest.FACING, enumdirection)).set(BlockChest.c, blockpropertychesttype)).set(BlockChest.d, fluid.getType() == FluidTypes.WATER); ++ return this.getBlockData().set(BlockChest.FACING, enumdirection).set(BlockChest.c, blockpropertychesttype).set(BlockChest.d, fluid.getType() == FluidTypes.WATER); + } + + @Override + public Fluid d(IBlockData iblockdata) { +- return (Boolean) iblockdata.get(BlockChest.d) ? FluidTypes.WATER.a(false) : super.d(iblockdata); ++ return iblockdata.get(BlockChest.d) ? FluidTypes.WATER.a(false) : super.d(iblockdata); + } + + @Nullable + private EnumDirection a(BlockActionContext blockactioncontext, EnumDirection enumdirection) { + IBlockData iblockdata = blockactioncontext.getWorld().getType(blockactioncontext.getClickPosition().shift(enumdirection)); + +- return iblockdata.a((Block) this) && iblockdata.get(BlockChest.c) == BlockPropertyChestType.SINGLE ? (EnumDirection) iblockdata.get(BlockChest.FACING) : null; ++ return iblockdata.a(this) && iblockdata.get(BlockChest.c) == BlockPropertyChestType.SINGLE ? iblockdata.get(BlockChest.FACING) : null; + } + + @Override +@@ -229,7 +229,7 @@ public class BlockChest extends BlockChestAbstract implements I + + @Nullable + public static IInventory getInventory(BlockChest blockchest, IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) { +- return (IInventory) ((Optional) blockchest.a(iblockdata, world, blockposition, flag).apply(BlockChest.j)).orElse((Object) null); ++ return (IInventory) ((Optional) blockchest.a(iblockdata, world, blockposition, flag).apply(BlockChest.j)).orElse(null); + } + + public DoubleBlockFinder.Result a(IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) { +@@ -249,7 +249,7 @@ public class BlockChest extends BlockChestAbstract implements I + @Nullable + @Override + public ITileInventory getInventory(IBlockData iblockdata, World world, BlockPosition blockposition) { +- return (ITileInventory) ((Optional) this.a(iblockdata, world, blockposition, false).apply(BlockChest.k)).orElse((Object) null); ++ return (ITileInventory) ((Optional) this.a(iblockdata, world, blockposition, false).apply(BlockChest.k)).orElse(null); + } + + @Override +@@ -273,7 +273,7 @@ public class BlockChest extends BlockChestAbstract implements I + return false; + } + // Paper end +- List list = generatoraccess.a(EntityCat.class, new AxisAlignedBB((double) blockposition.getX(), (double) (blockposition.getY() + 1), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 2), (double) (blockposition.getZ() + 1))); ++ List list = generatoraccess.a(EntityCat.class, new AxisAlignedBB(blockposition.getX(), blockposition.getY() + 1, blockposition.getZ(), blockposition.getX() + 1, blockposition.getY() + 2, blockposition.getZ() + 1)); + + if (!list.isEmpty()) { + Iterator iterator = list.iterator(); +@@ -302,12 +302,12 @@ public class BlockChest extends BlockChestAbstract implements I + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockChest.FACING, enumblockrotation.a((EnumDirection) iblockdata.get(BlockChest.FACING))); ++ return iblockdata.set(BlockChest.FACING, enumblockrotation.a(iblockdata.get(BlockChest.FACING))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockChest.FACING))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockChest.FACING))); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockChorusFlower.java b/src/main/java/net/minecraft/server/BlockChorusFlower.java +index 5bc4726f9aaa7eb27d107053ad48880bc2e3c36c..6a5505ac665027535667c2b00909c8a22b8e76d1 100644 +--- a/src/main/java/net/minecraft/server/BlockChorusFlower.java ++++ b/src/main/java/net/minecraft/server/BlockChorusFlower.java +@@ -14,7 +14,7 @@ public class BlockChorusFlower extends Block { + protected BlockChorusFlower(BlockChorusFruit blockchorusfruit, BlockBase.Info blockbase_info) { + super(blockbase_info); + this.b = blockchorusfruit; +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockChorusFlower.AGE, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockChorusFlower.AGE, 0)); + } + + @Override +@@ -27,7 +27,7 @@ public class BlockChorusFlower extends Block { + + @Override + public boolean isTicking(IBlockData iblockdata) { +- return (Integer) iblockdata.get(BlockChorusFlower.AGE) < 5; ++ return iblockdata.get(BlockChorusFlower.AGE) < 5; + } + + @Override +@@ -35,7 +35,7 @@ public class BlockChorusFlower extends Block { + BlockPosition blockposition1 = blockposition.up(); + + if (worldserver.isEmpty(blockposition1) && blockposition1.getY() < 256) { +- int i = (Integer) iblockdata.get(BlockChorusFlower.AGE); ++ int i = iblockdata.get(BlockChorusFlower.AGE); + + if (i < 5) { + boolean flag = false; +@@ -69,10 +69,10 @@ public class BlockChorusFlower extends Block { + flag = true; + } + +- if (flag && b((IWorldReader) worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmpty(blockposition.up(2))) { ++ if (flag && b(worldserver, blockposition1, null) && worldserver.isEmpty(blockposition.up(2))) { + // CraftBukkit start - add event + if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i)), 2)) { +- worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2); ++ worldserver.setTypeAndData(blockposition, this.b.a(worldserver, blockposition), 2); + this.b(worldserver, blockposition1, i); + } + // CraftBukkit end +@@ -88,7 +88,7 @@ public class BlockChorusFlower extends Block { + EnumDirection enumdirection = EnumDirection.EnumDirectionLimit.HORIZONTAL.a(random); + BlockPosition blockposition2 = blockposition.shift(enumdirection); + +- if (worldserver.isEmpty(blockposition2) && worldserver.isEmpty(blockposition2.down()) && b((IWorldReader) worldserver, blockposition2, enumdirection.opposite())) { ++ if (worldserver.isEmpty(blockposition2) && worldserver.isEmpty(blockposition2.down()) && b(worldserver, blockposition2, enumdirection.opposite())) { + // CraftBukkit start - add event + if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i + 1)), 2)) { + this.b(worldserver, blockposition2, i + 1); +@@ -99,18 +99,18 @@ public class BlockChorusFlower extends Block { + } + + if (flag2) { +- worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2); ++ worldserver.setTypeAndData(blockposition, this.b.a(worldserver, blockposition), 2); + } else { + // CraftBukkit - add event + if (CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(5)), 2)) { +- this.a((World) worldserver, blockposition); ++ this.a(worldserver, blockposition); + } + // CraftBukkit end + } + } else { + // CraftBukkit - add event + if (CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(5)), 2)) { +- this.a((World) worldserver, blockposition); ++ this.a(worldserver, blockposition); + } + // CraftBukkit end + } +@@ -120,12 +120,12 @@ public class BlockChorusFlower extends Block { + } + + private void b(World world, BlockPosition blockposition, int i) { +- world.setTypeAndData(blockposition, (IBlockData) this.getBlockData().set(BlockChorusFlower.AGE, i), 2); ++ world.setTypeAndData(blockposition, this.getBlockData().set(BlockChorusFlower.AGE, i), 2); + world.triggerEffect(1033, blockposition, 0); + } + + private void a(World world, BlockPosition blockposition) { +- world.setTypeAndData(blockposition, (IBlockData) this.getBlockData().set(BlockChorusFlower.AGE, 5), 2); ++ world.setTypeAndData(blockposition, this.getBlockData().set(BlockChorusFlower.AGE, 5), 2); + world.triggerEffect(1034, blockposition, 0); + } + +@@ -169,7 +169,7 @@ public class BlockChorusFlower extends Block { + EnumDirection enumdirection = (EnumDirection) iterator.next(); + IBlockData iblockdata2 = iworldreader.getType(blockposition.shift(enumdirection)); + +- if (iblockdata2.a((Block) this.b)) { ++ if (iblockdata2.a(this.b)) { + if (flag) { + return false; + } +@@ -193,7 +193,7 @@ public class BlockChorusFlower extends Block { + } + + public static void a(GeneratorAccess generatoraccess, BlockPosition blockposition, Random random, int i) { +- generatoraccess.setTypeAndData(blockposition, ((BlockChorusFruit) Blocks.CHORUS_PLANT).a((IBlockAccess) generatoraccess, blockposition), 2); ++ generatoraccess.setTypeAndData(blockposition, ((BlockChorusFruit) Blocks.CHORUS_PLANT).a(generatoraccess, blockposition), 2); + a(generatoraccess, blockposition, random, blockposition, i, 0); + } + +@@ -208,12 +208,12 @@ public class BlockChorusFlower extends Block { + for (int l = 0; l < k; ++l) { + BlockPosition blockposition2 = blockposition.up(l + 1); + +- if (!b((IWorldReader) generatoraccess, blockposition2, (EnumDirection) null)) { ++ if (!b(generatoraccess, blockposition2, null)) { + return; + } + +- generatoraccess.setTypeAndData(blockposition2, blockchorusfruit.a((IBlockAccess) generatoraccess, blockposition2), 2); +- generatoraccess.setTypeAndData(blockposition2.down(), blockchorusfruit.a((IBlockAccess) generatoraccess, blockposition2.down()), 2); ++ generatoraccess.setTypeAndData(blockposition2, blockchorusfruit.a(generatoraccess, blockposition2), 2); ++ generatoraccess.setTypeAndData(blockposition2.down(), blockchorusfruit.a(generatoraccess, blockposition2.down()), 2); + } + + boolean flag = false; +@@ -229,24 +229,24 @@ public class BlockChorusFlower extends Block { + EnumDirection enumdirection = EnumDirection.EnumDirectionLimit.HORIZONTAL.a(random); + BlockPosition blockposition3 = blockposition.up(k).shift(enumdirection); + +- if (Math.abs(blockposition3.getX() - blockposition1.getX()) < i && Math.abs(blockposition3.getZ() - blockposition1.getZ()) < i && generatoraccess.isEmpty(blockposition3) && generatoraccess.isEmpty(blockposition3.down()) && b((IWorldReader) generatoraccess, blockposition3, enumdirection.opposite())) { ++ if (Math.abs(blockposition3.getX() - blockposition1.getX()) < i && Math.abs(blockposition3.getZ() - blockposition1.getZ()) < i && generatoraccess.isEmpty(blockposition3) && generatoraccess.isEmpty(blockposition3.down()) && b(generatoraccess, blockposition3, enumdirection.opposite())) { + flag = true; +- generatoraccess.setTypeAndData(blockposition3, blockchorusfruit.a((IBlockAccess) generatoraccess, blockposition3), 2); +- generatoraccess.setTypeAndData(blockposition3.shift(enumdirection.opposite()), blockchorusfruit.a((IBlockAccess) generatoraccess, blockposition3.shift(enumdirection.opposite())), 2); ++ generatoraccess.setTypeAndData(blockposition3, blockchorusfruit.a(generatoraccess, blockposition3), 2); ++ generatoraccess.setTypeAndData(blockposition3.shift(enumdirection.opposite()), blockchorusfruit.a(generatoraccess, blockposition3.shift(enumdirection.opposite())), 2); + a(generatoraccess, blockposition3, random, blockposition1, i, j + 1); + } + } + } + + if (!flag) { +- generatoraccess.setTypeAndData(blockposition.up(k), (IBlockData) Blocks.CHORUS_FLOWER.getBlockData().set(BlockChorusFlower.AGE, 5), 2); ++ generatoraccess.setTypeAndData(blockposition.up(k), Blocks.CHORUS_FLOWER.getBlockData().set(BlockChorusFlower.AGE, 5), 2); + } + + } + + @Override + public void a(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, IProjectile iprojectile) { +- if (iprojectile.getEntityType().a((Tag) TagsEntity.IMPACT_PROJECTILES)) { ++ if (iprojectile.getEntityType().a(TagsEntity.IMPACT_PROJECTILES)) { + BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); + + world.a(blockposition, true, iprojectile); +diff --git a/src/main/java/net/minecraft/server/BlockCocoa.java b/src/main/java/net/minecraft/server/BlockCocoa.java +index 4b3bbbba66b86a63d9fbd913f1c3a3fb765a0429..be9f10a5cfed755116a662606f10b968cab2740c 100644 +--- a/src/main/java/net/minecraft/server/BlockCocoa.java ++++ b/src/main/java/net/minecraft/server/BlockCocoa.java +@@ -15,21 +15,21 @@ public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePl + + public BlockCocoa(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockCocoa.FACING, EnumDirection.NORTH)).set(BlockCocoa.AGE, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockFacingHorizontal.FACING, EnumDirection.NORTH).set(BlockCocoa.AGE, 0)); + } + + @Override + public boolean isTicking(IBlockData iblockdata) { +- return (Integer) iblockdata.get(BlockCocoa.AGE) < 2; ++ return iblockdata.get(BlockCocoa.AGE) < 2; + } + + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + if (worldserver.random.nextInt(Math.max(1, (int) (100.0F / worldserver.spigotConfig.cocoaModifier) * 5)) == 0) { // Spigot +- int i = (Integer) iblockdata.get(BlockCocoa.AGE); ++ int i = iblockdata.get(BlockCocoa.AGE); + + if (i < 2) { +- CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, i + 1), 2); // CraftBukkkit ++ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata.set(BlockCocoa.AGE, i + 1), 2); // CraftBukkkit + } + } + +@@ -37,16 +37,16 @@ public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePl + + @Override + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { +- Block block = iworldreader.getType(blockposition.shift((EnumDirection) iblockdata.get(BlockCocoa.FACING))).getBlock(); ++ Block block = iworldreader.getType(blockposition.shift(iblockdata.get(BlockFacingHorizontal.FACING))).getBlock(); + +- return block.a((Tag) TagsBlock.JUNGLE_LOGS); ++ return block.a(TagsBlock.JUNGLE_LOGS); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- int i = (Integer) iblockdata.get(BlockCocoa.AGE); ++ int i = iblockdata.get(BlockCocoa.AGE); + +- switch ((EnumDirection) iblockdata.get(BlockCocoa.FACING)) { ++ switch (iblockdata.get(BlockFacingHorizontal.FACING)) { + case SOUTH: + return BlockCocoa.e[i]; + case NORTH: +@@ -72,7 +72,7 @@ public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePl + EnumDirection enumdirection = aenumdirection[j]; + + if (enumdirection.n().d()) { +- iblockdata = (IBlockData) iblockdata.set(BlockCocoa.FACING, enumdirection); ++ iblockdata = iblockdata.set(BlockFacingHorizontal.FACING, enumdirection); + if (iblockdata.canPlace(world, blockposition)) { + return iblockdata; + } +@@ -84,12 +84,12 @@ public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePl + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- return enumdirection == iblockdata.get(BlockCocoa.FACING) && !iblockdata.canPlace(generatoraccess, blockposition) ? Blocks.AIR.getBlockData() : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); ++ return enumdirection == iblockdata.get(BlockFacingHorizontal.FACING) && !iblockdata.canPlace(generatoraccess, blockposition) ? Blocks.AIR.getBlockData() : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); + } + + @Override + public boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, boolean flag) { +- return (Integer) iblockdata.get(BlockCocoa.AGE) < 2; ++ return iblockdata.get(BlockCocoa.AGE) < 2; + } + + @Override +@@ -99,12 +99,12 @@ public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePl + + @Override + public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) { +- CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockCocoa.AGE, (Integer) iblockdata.get(BlockCocoa.AGE) + 1), 2); // CraftBukkit ++ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata.set(BlockCocoa.AGE, iblockdata.get(BlockCocoa.AGE) + 1), 2); // CraftBukkit + } + + @Override + protected void a(BlockStateList.a blockstatelist_a) { +- blockstatelist_a.a(BlockCocoa.FACING, BlockCocoa.AGE); ++ blockstatelist_a.a(BlockFacingHorizontal.FACING, BlockCocoa.AGE); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockCommand.java b/src/main/java/net/minecraft/server/BlockCommand.java +index 0d69bdee165b37c88bcdd8e19160e3d4b1c253f1..476ce2fed6778590b64ec6d227a0ba9d5e9be568 100644 +--- a/src/main/java/net/minecraft/server/BlockCommand.java ++++ b/src/main/java/net/minecraft/server/BlockCommand.java +@@ -14,7 +14,7 @@ public class BlockCommand extends BlockTileEntity { + + public BlockCommand(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockCommand.a, EnumDirection.NORTH)).set(BlockCommand.b, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockCommand.a, EnumDirection.NORTH).set(BlockCommand.b, false)); + } + + @Override +@@ -98,7 +98,7 @@ public class BlockCommand extends BlockTileEntity { + commandblocklistenerabstract.a(0); + } + +- a(world, blockposition, (EnumDirection) iblockdata.get(BlockCommand.a)); ++ a(world, blockposition, iblockdata.get(BlockCommand.a)); + } + + @Override +@@ -160,12 +160,12 @@ public class BlockCommand extends BlockTileEntity { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockCommand.a, enumblockrotation.a((EnumDirection) iblockdata.get(BlockCommand.a))); ++ return iblockdata.set(BlockCommand.a, enumblockrotation.a(iblockdata.get(BlockCommand.a))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockCommand.a))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockCommand.a))); + } + + @Override +@@ -175,7 +175,7 @@ public class BlockCommand extends BlockTileEntity { + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return (IBlockData) this.getBlockData().set(BlockCommand.a, blockactioncontext.d().opposite()); ++ return this.getBlockData().set(BlockCommand.a, blockactioncontext.d().opposite()); + } + + private static void a(World world, BlockPosition blockposition, EnumDirection enumdirection) { +@@ -185,7 +185,7 @@ public class BlockCommand extends BlockTileEntity { + IBlockData iblockdata; + int i; + +- for (i = gamerules.getInt(GameRules.MAX_COMMAND_CHAIN_LENGTH); i-- > 0; enumdirection = (EnumDirection) iblockdata.get(BlockCommand.a)) { ++ for (i = gamerules.getInt(GameRules.MAX_COMMAND_CHAIN_LENGTH); i-- > 0; enumdirection = iblockdata.get(BlockCommand.a)) { + blockposition_mutableblockposition.c(enumdirection); + iblockdata = world.getType(blockposition_mutableblockposition); + Block block = iblockdata.getBlock(); +diff --git a/src/main/java/net/minecraft/server/BlockComposter.java b/src/main/java/net/minecraft/server/BlockComposter.java +index 0a7137b096db1807950f0b6754ff2644df97892d..aaa8be82dfa3c3df4db022a36eb8935d46fa38fa 100644 +--- a/src/main/java/net/minecraft/server/BlockComposter.java ++++ b/src/main/java/net/minecraft/server/BlockComposter.java +@@ -14,9 +14,9 @@ public class BlockComposter extends Block implements IInventoryHolder { + public static final BlockStateInteger a = BlockProperties.as; + public static final Object2FloatMap b = new Object2FloatOpenHashMap(); + private static final VoxelShape c = VoxelShapes.b(); +- private static final VoxelShape[] d = (VoxelShape[]) SystemUtils.a((new VoxelShape[9]), (avoxelshape) -> { // CraftBukkit - decompile error ++ private static final VoxelShape[] d = SystemUtils.a((new VoxelShape[9]), (avoxelshape) -> { // CraftBukkit - decompile error + for (int i = 0; i < 8; ++i) { +- avoxelshape[i] = VoxelShapes.a(BlockComposter.c, Block.a(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), OperatorBoolean.ONLY_FIRST); ++ avoxelshape[i] = VoxelShapes.a(BlockComposter.c, Block.a(2.0D, Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), OperatorBoolean.ONLY_FIRST); + } + + avoxelshape[8] = avoxelshape[7]; +@@ -117,12 +117,12 @@ public class BlockComposter extends Block implements IInventoryHolder { + + public BlockComposter(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockComposter.a, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockComposter.a, 0)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return BlockComposter.d[(Integer) iblockdata.get(BlockComposter.a)]; ++ return BlockComposter.d[iblockdata.get(BlockComposter.a)]; + } + + @Override +@@ -137,7 +137,7 @@ public class BlockComposter extends Block implements IInventoryHolder { + + @Override + public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { +- if ((Integer) iblockdata.get(BlockComposter.a) == 7) { ++ if (iblockdata.get(BlockComposter.a) == 7) { + world.getBlockTickList().a(blockposition, iblockdata.getBlock(), 20); + } + +@@ -145,12 +145,12 @@ public class BlockComposter extends Block implements IInventoryHolder { + + @Override + public EnumInteractionResult interact(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) { +- int i = (Integer) iblockdata.get(BlockComposter.a); ++ int i = iblockdata.get(BlockComposter.a); + ItemStack itemstack = entityhuman.b(enumhand); + + if (i < 8 && BlockComposter.b.containsKey(itemstack.getItem())) { + if (i < 7 && !world.isClientSide) { +- IBlockData iblockdata1 = b(iblockdata, (GeneratorAccess) world, blockposition, itemstack); ++ IBlockData iblockdata1 = b(iblockdata, world, blockposition, itemstack); + + world.triggerEffect(1500, blockposition, iblockdata != iblockdata1 ? 1 : 0); + if (!entityhuman.abilities.canInstantlyBuild) { +@@ -168,7 +168,7 @@ public class BlockComposter extends Block implements IInventoryHolder { + } + + public static IBlockData a(IBlockData iblockdata, WorldServer worldserver, ItemStack itemstack, BlockPosition blockposition, Entity entity) { // CraftBukkit +- int i = (Integer) iblockdata.get(BlockComposter.a); ++ int i = iblockdata.get(BlockComposter.a); + + if (i < 7 && BlockComposter.b.containsKey(itemstack.getItem())) { + // CraftBukkit start +@@ -177,7 +177,7 @@ public class BlockComposter extends Block implements IInventoryHolder { + if (iblockdata == iblockdata1 || org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, iblockdata1).isCancelled()) { + return iblockdata; + } +- iblockdata1 = b(iblockdata, (GeneratorAccess) worldserver, blockposition, itemstack, rand); ++ iblockdata1 = b(iblockdata, worldserver, blockposition, itemstack, rand); + // CraftBukkit end + + itemstack.subtract(1); +@@ -208,14 +208,14 @@ public class BlockComposter extends Block implements IInventoryHolder { + world.addEntity(entityitem); + } + +- IBlockData iblockdata1 = d(iblockdata, (GeneratorAccess) world, blockposition); ++ IBlockData iblockdata1 = d(iblockdata, world, blockposition); + +- world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_COMPOSTER_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, blockposition, SoundEffects.BLOCK_COMPOSTER_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); + return iblockdata1; + } + + private static IBlockData d(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { +- IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockComposter.a, 0); ++ IBlockData iblockdata1 = iblockdata.set(BlockComposter.a, 0); + + generatoraccess.setTypeAndData(blockposition, iblockdata1, 3); + return iblockdata1; +@@ -228,14 +228,14 @@ public class BlockComposter extends Block implements IInventoryHolder { + + private static IBlockData b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, ItemStack itemstack, double rand) { + // CraftBukkit end +- int i = (Integer) iblockdata.get(BlockComposter.a); ++ int i = iblockdata.get(BlockComposter.a); + float f = BlockComposter.b.getFloat(itemstack.getItem()); + + if ((i != 0 || f <= 0.0F) && rand >= (double) f) { + return iblockdata; + } else { + int j = i + 1; +- IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockComposter.a, j); ++ IBlockData iblockdata1 = iblockdata.set(BlockComposter.a, j); + + generatoraccess.setTypeAndData(blockposition, iblockdata1, 3); + if (j == 7) { +@@ -248,9 +248,9 @@ public class BlockComposter extends Block implements IInventoryHolder { + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if ((Integer) iblockdata.get(BlockComposter.a) == 7) { +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockComposter.a), 3); +- worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_COMPOSTER_READY, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ if (iblockdata.get(BlockComposter.a) == 7) { ++ worldserver.setTypeAndData(blockposition, iblockdata.a((IBlockState) BlockComposter.a), 3); ++ worldserver.playSound(null, blockposition, SoundEffects.BLOCK_COMPOSTER_READY, SoundCategory.BLOCKS, 1.0F, 1.0F); + TileEntityHopper.enableTicking(worldserver.getTileEntity(new BlockPosition(blockposition.getX(), blockposition.getY() - 1, blockposition.getZ())), 0); // Origami - don't tick empty hoppers + } + +@@ -263,7 +263,7 @@ public class BlockComposter extends Block implements IInventoryHolder { + + @Override + public int a(IBlockData iblockdata, World world, BlockPosition blockposition) { +- return (Integer) iblockdata.get(BlockComposter.a); ++ return iblockdata.get(BlockComposter.a); + } + + @Override +@@ -278,10 +278,10 @@ public class BlockComposter extends Block implements IInventoryHolder { + + @Override + public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { +- int i = (Integer) iblockdata.get(BlockComposter.a); ++ int i = iblockdata.get(BlockComposter.a); + + // CraftBukkit - empty generatoraccess, blockposition +- return (IWorldInventory) (i == 8 ? new BlockComposter.ContainerOutput(iblockdata, generatoraccess, blockposition, new ItemStack(Items.BONE_MEAL)) : (i < 7 ? new BlockComposter.ContainerInput(iblockdata, generatoraccess, blockposition) : new BlockComposter.ContainerEmpty(generatoraccess, blockposition))); ++ return i == 8 ? new ContainerOutput(iblockdata, generatoraccess, blockposition, new ItemStack(Items.BONE_MEAL)) : (i < 7 ? new ContainerInput(iblockdata, generatoraccess, blockposition) : new ContainerEmpty(generatoraccess, blockposition)); + } + + static class ContainerInput extends InventorySubcontainer implements IWorldInventory { +diff --git a/src/main/java/net/minecraft/server/BlockConcretePowder.java b/src/main/java/net/minecraft/server/BlockConcretePowder.java +index c50e4c6cd0a754bf38949843bc4cb47649d7f6e5..d3a3023a33d2a2eb2be1761c1a0a92633b79da78 100644 +--- a/src/main/java/net/minecraft/server/BlockConcretePowder.java ++++ b/src/main/java/net/minecraft/server/BlockConcretePowder.java +@@ -63,7 +63,7 @@ public class BlockConcretePowder extends BlockFalling { + IBlockData iblockdata = iblockaccess.getType(blockposition_mutableblockposition); + + if (enumdirection != EnumDirection.DOWN || l(iblockdata)) { +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); ++ blockposition_mutableblockposition.a(blockposition, enumdirection); + iblockdata = iblockaccess.getType(blockposition_mutableblockposition); + if (l(iblockdata) && !iblockdata.d(iblockaccess, blockposition, enumdirection.opposite())) { + flag = true; +@@ -76,13 +76,13 @@ public class BlockConcretePowder extends BlockFalling { + } + + private static boolean l(IBlockData iblockdata) { +- return iblockdata.getFluid().a((Tag) TagsFluid.WATER); ++ return iblockdata.getFluid().a(TagsFluid.WATER); + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { + // CraftBukkit start +- if (a((IBlockAccess) generatoraccess, blockposition)) { ++ if (a(generatoraccess, blockposition)) { + CraftBlockState blockState = CraftBlockState.getBlockState(generatoraccess, blockposition); + blockState.setData(this.a); + +diff --git a/src/main/java/net/minecraft/server/BlockCoral.java b/src/main/java/net/minecraft/server/BlockCoral.java +index ead4fa9c767e07cac7e031c2f2c5ed18cdbd723f..c2e7671a82f5c7c148cae80ebaecd2bdb816fcde 100644 +--- a/src/main/java/net/minecraft/server/BlockCoral.java ++++ b/src/main/java/net/minecraft/server/BlockCoral.java +@@ -14,7 +14,7 @@ public class BlockCoral extends Block { + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if (!this.a((IBlockAccess) worldserver, blockposition)) { ++ if (!this.a(worldserver, blockposition)) { + // CraftBukkit start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.a.getBlockData()).isCancelled()) { + return; +@@ -27,7 +27,7 @@ public class BlockCoral extends Block { + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- if (!this.a((IBlockAccess) generatoraccess, blockposition)) { ++ if (!this.a(generatoraccess, blockposition)) { + generatoraccess.getBlockTickList().a(blockposition, this, 60 + generatoraccess.getRandom().nextInt(40)); + } + +@@ -42,7 +42,7 @@ public class BlockCoral extends Block { + EnumDirection enumdirection = aenumdirection[j]; + Fluid fluid = iblockaccess.getFluid(blockposition.shift(enumdirection)); + +- if (fluid.a((Tag) TagsFluid.WATER)) { ++ if (fluid.a(TagsFluid.WATER)) { + return true; + } + } +@@ -53,7 +53,7 @@ public class BlockCoral extends Block { + @Nullable + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- if (!this.a((IBlockAccess) blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) { ++ if (!this.a(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) { + blockactioncontext.getWorld().getBlockTickList().a(blockactioncontext.getClickPosition(), this, 60 + blockactioncontext.getWorld().getRandom().nextInt(40)); + } + +diff --git a/src/main/java/net/minecraft/server/BlockCoralFan.java b/src/main/java/net/minecraft/server/BlockCoralFan.java +index 786e94f35776b1496b27cfaac98996998be399c6..917bf13be720471794aec81a27b6c24fcd34ea4c 100644 +--- a/src/main/java/net/minecraft/server/BlockCoralFan.java ++++ b/src/main/java/net/minecraft/server/BlockCoralFan.java +@@ -20,11 +20,11 @@ public class BlockCoralFan extends BlockCoralFanAbstract { + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) { + // CraftBukkit start +- if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.a.getBlockData().set(BlockCoralFan.b, false)).isCancelled()) { ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.a.getBlockData().set(BlockCoralBase.b, false)).isCancelled()) { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) this.a.getBlockData().set(BlockCoralFan.b, false), 2); ++ worldserver.setTypeAndData(blockposition, this.a.getBlockData().set(BlockCoralBase.b, false), 2); + } + + } +@@ -35,8 +35,8 @@ public class BlockCoralFan extends BlockCoralFanAbstract { + return Blocks.AIR.getBlockData(); + } else { + this.a(iblockdata, generatoraccess, blockposition); +- if ((Boolean) iblockdata.get(BlockCoralFan.b)) { +- generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess)); ++ if (iblockdata.get(BlockCoralBase.b)) { ++ generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(generatoraccess)); + } + + return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); +diff --git a/src/main/java/net/minecraft/server/BlockCoralFanWall.java b/src/main/java/net/minecraft/server/BlockCoralFanWall.java +index 514946046748c553cfc49c5d02d99eb86662469a..683bc5bafa943c43bbc24992130a44592826fa2a 100644 +--- a/src/main/java/net/minecraft/server/BlockCoralFanWall.java ++++ b/src/main/java/net/minecraft/server/BlockCoralFanWall.java +@@ -20,22 +20,22 @@ public class BlockCoralFanWall extends BlockCoralFanWallAbstract { + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) { + // CraftBukkit start +- if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.c.getBlockData().set(BlockCoralFanWall.b, false).set(BlockCoralFanWall.a, iblockdata.get(BlockCoralFanWall.a))).isCancelled()) { ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.c.getBlockData().set(BlockCoralBase.b, false).set(BlockCoralFanWallAbstract.a, iblockdata.get(BlockCoralFanWallAbstract.a))).isCancelled()) { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) ((IBlockData) this.c.getBlockData().set(BlockCoralFanWall.b, false)).set(BlockCoralFanWall.a, iblockdata.get(BlockCoralFanWall.a)), 2); ++ worldserver.setTypeAndData(blockposition, this.c.getBlockData().set(BlockCoralBase.b, false).set(BlockCoralFanWallAbstract.a, iblockdata.get(BlockCoralFanWallAbstract.a)), 2); + } + + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- if (enumdirection.opposite() == iblockdata.get(BlockCoralFanWall.a) && !iblockdata.canPlace(generatoraccess, blockposition)) { ++ if (enumdirection.opposite() == iblockdata.get(BlockCoralFanWallAbstract.a) && !iblockdata.canPlace(generatoraccess, blockposition)) { + return Blocks.AIR.getBlockData(); + } else { +- if ((Boolean) iblockdata.get(BlockCoralFanWall.b)) { +- generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess)); ++ if (iblockdata.get(BlockCoralBase.b)) { ++ generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(generatoraccess)); + } + + this.a(iblockdata, generatoraccess, blockposition); +diff --git a/src/main/java/net/minecraft/server/BlockCoralPlant.java b/src/main/java/net/minecraft/server/BlockCoralPlant.java +index fb9910f837b1cd4defe99748869156cbdcb7d798..80354b425c31e94b040ffa8fa1c8fa57a4fb3eea 100644 +--- a/src/main/java/net/minecraft/server/BlockCoralPlant.java ++++ b/src/main/java/net/minecraft/server/BlockCoralPlant.java +@@ -21,11 +21,11 @@ public class BlockCoralPlant extends BlockCoralBase { + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) { + // CraftBukkit start +- if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.c.getBlockData().set(BlockCoralPlant.b, false)).isCancelled()) { ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.c.getBlockData().set(BlockCoralBase.b, false)).isCancelled()) { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) this.c.getBlockData().set(BlockCoralPlant.b, false), 2); ++ worldserver.setTypeAndData(blockposition, this.c.getBlockData().set(BlockCoralBase.b, false), 2); + } + + } +@@ -36,8 +36,8 @@ public class BlockCoralPlant extends BlockCoralBase { + return Blocks.AIR.getBlockData(); + } else { + this.a(iblockdata, generatoraccess, blockposition); +- if ((Boolean) iblockdata.get(BlockCoralPlant.b)) { +- generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess)); ++ if (iblockdata.get(BlockCoralBase.b)) { ++ generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(generatoraccess)); + } + + return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); +diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java +index 45f8f1b9fb05f5598d0ae493d6394b314c01a0d1..b9190fc4ff2b0ebca4ac81f7fb9d243d2b674af0 100644 +--- a/src/main/java/net/minecraft/server/BlockCrops.java ++++ b/src/main/java/net/minecraft/server/BlockCrops.java +@@ -11,12 +11,12 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement + + protected BlockCrops(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(this.c(), 0)); ++ this.j(this.blockStateList.getBlockData().set(this.c(), 0)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return BlockCrops.a[(Integer) iblockdata.get(this.c())]; ++ return BlockCrops.a[iblockdata.get(this.c())]; + } + + @Override +@@ -33,15 +33,15 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement + } + + protected int g(IBlockData iblockdata) { +- return (Integer) iblockdata.get(this.c()); ++ return iblockdata.get(this.c()); + } + + public IBlockData setAge(int i) { +- return (IBlockData) this.getBlockData().set(this.c(), i); ++ return this.getBlockData().set(this.c(), i); + } + + public boolean isRipe(IBlockData iblockdata) { +- return (Integer) iblockdata.get(this.c()) >= this.d(); ++ return iblockdata.get(this.c()) >= this.d(); + } + + @Override +@@ -55,7 +55,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement + int i = this.g(iblockdata); + + if (i < this.d()) { +- float f = a((Block) this, (IBlockAccess) worldserver, blockposition); ++ float f = a(this, worldserver, blockposition); + + // Spigot start + int modifier; +@@ -104,7 +104,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement + + if (iblockdata.a(Blocks.FARMLAND)) { + f1 = 1.0F; +- if ((Integer) iblockdata.get(BlockSoil.MOISTURE) > 0) { ++ if (iblockdata.get(BlockSoil.MOISTURE) > 0) { + f1 = 3.0F; + } + } +@@ -163,7 +163,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement + + @Override + public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) { +- this.a((World) worldserver, blockposition, iblockdata); ++ this.a(worldserver, blockposition, iblockdata); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockDaylightDetector.java b/src/main/java/net/minecraft/server/BlockDaylightDetector.java +index cec8b2be7b1009cf8ca927c9db8e22832b0aca10..2e5d8ad543ddc28cb61490272dfd163cfd58767e 100644 +--- a/src/main/java/net/minecraft/server/BlockDaylightDetector.java ++++ b/src/main/java/net/minecraft/server/BlockDaylightDetector.java +@@ -8,7 +8,7 @@ public class BlockDaylightDetector extends BlockTileEntity { + + public BlockDaylightDetector(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockDaylightDetector.POWER, 0)).set(BlockDaylightDetector.b, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockDaylightDetector.POWER, 0).set(BlockDaylightDetector.b, false)); + } + + @Override +@@ -23,14 +23,14 @@ public class BlockDaylightDetector extends BlockTileEntity { + + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Integer) iblockdata.get(BlockDaylightDetector.POWER); ++ return iblockdata.get(BlockDaylightDetector.POWER); + } + + public static void d(IBlockData iblockdata, World world, BlockPosition blockposition) { + if (world.getDimensionManager().hasSkyLight()) { + int i = world.getBrightness(EnumSkyBlock.SKY, blockposition) - world.c(); + float f = world.a(1.0F); +- boolean flag = (Boolean) iblockdata.get(BlockDaylightDetector.b); ++ boolean flag = iblockdata.get(BlockDaylightDetector.b); + + if (flag) { + i = 15 - i; +@@ -42,9 +42,9 @@ public class BlockDaylightDetector extends BlockTileEntity { + } + + i = MathHelper.clamp(i, 0, 15); +- if ((Integer) iblockdata.get(BlockDaylightDetector.POWER) != i) { +- i = org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, blockposition, ((Integer) iblockdata.get(POWER)), i).getNewCurrent(); // CraftBukkit - Call BlockRedstoneEvent +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDaylightDetector.POWER, i), 3); ++ if (iblockdata.get(BlockDaylightDetector.POWER) != i) { ++ i = org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, blockposition, iblockdata.get(POWER), i).getNewCurrent(); // CraftBukkit - Call BlockRedstoneEvent ++ world.setTypeAndData(blockposition, iblockdata.set(BlockDaylightDetector.POWER, i), 3); + } + + } +@@ -56,7 +56,7 @@ public class BlockDaylightDetector extends BlockTileEntity { + if (world.isClientSide) { + return EnumInteractionResult.SUCCESS; + } else { +- IBlockData iblockdata1 = (IBlockData) iblockdata.a((IBlockState) BlockDaylightDetector.b); ++ IBlockData iblockdata1 = iblockdata.a((IBlockState) BlockDaylightDetector.b); + + world.setTypeAndData(blockposition, iblockdata1, 4); + d(iblockdata1, world, blockposition); +diff --git a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java +index 4dc2546db159ea770b07295962e11315f255fc37..fcd6444e1d998e4f4e4f57655495c48c0f49ba1d 100644 +--- a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java ++++ b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java +@@ -20,14 +20,14 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + + @Override + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { +- return c((IBlockAccess) iworldreader, blockposition.down()); ++ return c(iworldreader, blockposition.down()); + } + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + if (!this.a((IWorldReader) worldserver, blockposition, iblockdata)) { +- boolean flag = (Boolean) iblockdata.get(BlockDiodeAbstract.c); +- boolean flag1 = this.a((World) worldserver, blockposition, iblockdata); ++ boolean flag = iblockdata.get(BlockDiodeAbstract.c); ++ boolean flag1 = this.a(worldserver, blockposition, iblockdata); + + if (flag && !flag1) { + // CraftBukkit start +@@ -35,14 +35,14 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, false), 2); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockDiodeAbstract.c, false), 2); + } else if (!flag) { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 0, 15).getNewCurrent() != 15) { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, true), 2); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockDiodeAbstract.c, true), 2); + if (!flag1) { + worldserver.getBlockTickList().a(blockposition, this, this.g(iblockdata), TickListPriority.VERY_HIGH); + } +@@ -58,7 +58,7 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return !(Boolean) iblockdata.get(BlockDiodeAbstract.c) ? 0 : (iblockdata.get(BlockDiodeAbstract.FACING) == enumdirection ? this.b(iblockaccess, blockposition, iblockdata) : 0); ++ return !(Boolean) iblockdata.get(BlockDiodeAbstract.c) ? 0 : (iblockdata.get(BlockFacingHorizontal.FACING) == enumdirection ? this.b(iblockaccess, blockposition, iblockdata) : 0); + } + + @Override +@@ -84,7 +84,7 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + + protected void c(World world, BlockPosition blockposition, IBlockData iblockdata) { + if (!this.a((IWorldReader) world, blockposition, iblockdata)) { +- boolean flag = (Boolean) iblockdata.get(BlockDiodeAbstract.c); ++ boolean flag = iblockdata.get(BlockDiodeAbstract.c); + boolean flag1 = this.a(world, blockposition, iblockdata); + + if (flag != flag1 && !world.getBlockTickList().b(blockposition, this)) { +@@ -111,7 +111,7 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + } + + protected int b(World world, BlockPosition blockposition, IBlockData iblockdata) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockDiodeAbstract.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockFacingHorizontal.FACING); + BlockPosition blockposition1 = blockposition.shift(enumdirection); + int i = world.getBlockFacePower(blockposition1, enumdirection); + +@@ -120,12 +120,12 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + } else { + IBlockData iblockdata1 = world.getType(blockposition1); + +- return Math.max(i, iblockdata1.a(Blocks.REDSTONE_WIRE) ? (Integer) iblockdata1.get(BlockRedstoneWire.POWER) : 0); ++ return Math.max(i, iblockdata1.a(Blocks.REDSTONE_WIRE) ? iblockdata1.get(BlockRedstoneWire.POWER) : 0); + } + } + + protected int b(IWorldReader iworldreader, BlockPosition blockposition, IBlockData iblockdata) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockDiodeAbstract.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockFacingHorizontal.FACING); + EnumDirection enumdirection1 = enumdirection.g(); + EnumDirection enumdirection2 = enumdirection.h(); + +@@ -135,7 +135,7 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + protected int b(IWorldReader iworldreader, BlockPosition blockposition, EnumDirection enumdirection) { + IBlockData iblockdata = iworldreader.getType(blockposition); + +- return this.h(iblockdata) ? (iblockdata.a(Blocks.REDSTONE_BLOCK) ? 15 : (iblockdata.a(Blocks.REDSTONE_WIRE) ? (Integer) iblockdata.get(BlockRedstoneWire.POWER) : iworldreader.c(blockposition, enumdirection))) : 0; ++ return this.h(iblockdata) ? (iblockdata.a(Blocks.REDSTONE_BLOCK) ? 15 : (iblockdata.a(Blocks.REDSTONE_WIRE) ? iblockdata.get(BlockRedstoneWire.POWER) : iworldreader.c(blockposition, enumdirection))) : 0; + } + + @Override +@@ -145,7 +145,7 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return (IBlockData) this.getBlockData().set(BlockDiodeAbstract.FACING, blockactioncontext.f().opposite()); ++ return this.getBlockData().set(BlockFacingHorizontal.FACING, blockactioncontext.f().opposite()); + } + + @Override +@@ -170,11 +170,11 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + } + + protected void d(World world, BlockPosition blockposition, IBlockData iblockdata) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockDiodeAbstract.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockFacingHorizontal.FACING); + BlockPosition blockposition1 = blockposition.shift(enumdirection.opposite()); + +- world.a(blockposition1, (Block) this, blockposition); +- world.a(blockposition1, (Block) this, enumdirection); ++ world.a(blockposition1, this, blockposition); ++ world.a(blockposition1, this, enumdirection); + } + + protected boolean h(IBlockData iblockdata) { +@@ -190,10 +190,10 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal { + } + + public boolean c(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata) { +- EnumDirection enumdirection = ((EnumDirection) iblockdata.get(BlockDiodeAbstract.FACING)).opposite(); ++ EnumDirection enumdirection = iblockdata.get(BlockFacingHorizontal.FACING).opposite(); + IBlockData iblockdata1 = iblockaccess.getType(blockposition.shift(enumdirection)); + +- return isDiode(iblockdata1) && iblockdata1.get(BlockDiodeAbstract.FACING) != enumdirection; ++ return isDiode(iblockdata1) && iblockdata1.get(BlockFacingHorizontal.FACING) != enumdirection; + } + + protected abstract int g(IBlockData iblockdata); +diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +index 3262b43b5844c332502a3dd1358596998aba0a89..d241c0ecd9984f9ba7de4e58d7b2ad40ba9c4789 100644 +--- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java ++++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +@@ -12,12 +12,12 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow { + BlockPosition blockposition1 = blockposition.up(); + IBlockData iblockdata1 = iworldreader.getType(blockposition1); + +- if (iblockdata1.a(Blocks.SNOW) && (Integer) iblockdata1.get(BlockSnow.LAYERS) == 1) { ++ if (iblockdata1.a(Blocks.SNOW) && iblockdata1.get(BlockSnow.LAYERS) == 1) { + return true; + } else if (iblockdata1.getFluid().e() == 8) { + return false; + } else { +- int i = LightEngineLayer.a(iworldreader, iblockdata, blockposition, iblockdata1, blockposition1, EnumDirection.UP, iblockdata1.b((IBlockAccess) iworldreader, blockposition1)); ++ int i = LightEngineLayer.a(iworldreader, iblockdata, blockposition, iblockdata1, blockposition1, EnumDirection.UP, iblockdata1.b(iworldreader, blockposition1)); + + return i < iworldreader.H(); + } +@@ -26,7 +26,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow { + private static boolean c(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { + BlockPosition blockposition1 = blockposition.up(); + +- return b(iblockdata, iworldreader, blockposition) && !iworldreader.getFluid(blockposition1).a((Tag) TagsFluid.WATER); ++ return b(iblockdata, iworldreader, blockposition) && !iworldreader.getFluid(blockposition1).a(TagsFluid.WATER); + } + + @Override +@@ -47,7 +47,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow { + BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); + + if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) { +- org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).a(Blocks.SNOW))); // CraftBukkit ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, iblockdata1.set(BlockDirtSnow.a, worldserver.getType(blockposition1.up()).a(Blocks.SNOW))); // CraftBukkit + } + } + } +diff --git a/src/main/java/net/minecraft/server/BlockDispenser.java b/src/main/java/net/minecraft/server/BlockDispenser.java +index 65e41ce3363638d7b7062a3de974527e1e7ea692..fe9e90e7b3a01ff0955b3aa2a8482f155468d82c 100644 +--- a/src/main/java/net/minecraft/server/BlockDispenser.java ++++ b/src/main/java/net/minecraft/server/BlockDispenser.java +@@ -20,7 +20,7 @@ public class BlockDispenser extends BlockTileEntity { + + protected BlockDispenser(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockDispenser.FACING, EnumDirection.NORTH)).set(BlockDispenser.TRIGGERED, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockDispenser.FACING, EnumDirection.NORTH).set(BlockDispenser.TRIGGERED, false)); + } + + @Override +@@ -45,7 +45,7 @@ public class BlockDispenser extends BlockTileEntity { + + public void dispense(World world, BlockPosition blockposition) { + SourceBlock sourceblock = new SourceBlock(world, blockposition); +- TileEntityDispenser tileentitydispenser = (TileEntityDispenser) sourceblock.getTileEntity(); ++ TileEntityDispenser tileentitydispenser = sourceblock.getTileEntity(); + int i = tileentitydispenser.h(); + + if (i < 0) { +@@ -63,19 +63,19 @@ public class BlockDispenser extends BlockTileEntity { + } + + protected IDispenseBehavior a(ItemStack itemstack) { +- return (IDispenseBehavior) BlockDispenser.REGISTRY.get(itemstack.getItem()); ++ return BlockDispenser.REGISTRY.get(itemstack.getItem()); + } + + @Override + public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) { + boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || world.isBlockIndirectlyPowered(blockposition.up()); +- boolean flag2 = (Boolean) iblockdata.get(BlockDispenser.TRIGGERED); ++ boolean flag2 = iblockdata.get(BlockDispenser.TRIGGERED); + + if (flag1 && !flag2) { + world.getBlockTickList().a(blockposition, this, 4); +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDispenser.TRIGGERED, true), 4); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockDispenser.TRIGGERED, true), 4); + } else if (!flag1 && flag2) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDispenser.TRIGGERED, false), 4); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockDispenser.TRIGGERED, false), 4); + } + + } +@@ -92,7 +92,7 @@ public class BlockDispenser extends BlockTileEntity { + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return (IBlockData) this.getBlockData().set(BlockDispenser.FACING, blockactioncontext.d().opposite()); ++ return this.getBlockData().set(BlockDispenser.FACING, blockactioncontext.d().opposite()); + } + + @Override +@@ -122,7 +122,7 @@ public class BlockDispenser extends BlockTileEntity { + } + + public static IPosition a(ISourceBlock isourceblock) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + double d0 = isourceblock.getX() + 0.7D * (double) enumdirection.getAdjacentX(); + double d1 = isourceblock.getY() + 0.7D * (double) enumdirection.getAdjacentY(); + double d2 = isourceblock.getZ() + 0.7D * (double) enumdirection.getAdjacentZ(); +@@ -147,12 +147,12 @@ public class BlockDispenser extends BlockTileEntity { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockDispenser.FACING, enumblockrotation.a((EnumDirection) iblockdata.get(BlockDispenser.FACING))); ++ return iblockdata.set(BlockDispenser.FACING, enumblockrotation.a(iblockdata.get(BlockDispenser.FACING))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockDispenser.FACING))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockDispenser.FACING))); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockDoor.java b/src/main/java/net/minecraft/server/BlockDoor.java +index c32cdc4856e1a0062796f7b25402357418d85a44..35c385655c52d4ebe8a34e02ff691de9777dec3b 100644 +--- a/src/main/java/net/minecraft/server/BlockDoor.java ++++ b/src/main/java/net/minecraft/server/BlockDoor.java +@@ -18,12 +18,12 @@ public class BlockDoor extends Block { + + protected BlockDoor(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockDoor.FACING, EnumDirection.NORTH)).set(BlockDoor.OPEN, false)).set(BlockDoor.HINGE, BlockPropertyDoorHinge.LEFT)).set(BlockDoor.POWERED, false)).set(BlockDoor.HALF, BlockPropertyDoubleBlockHalf.LOWER)); ++ this.j(this.blockStateList.getBlockData().set(BlockDoor.FACING, EnumDirection.NORTH).set(BlockDoor.OPEN, false).set(BlockDoor.HINGE, BlockPropertyDoorHinge.LEFT).set(BlockDoor.POWERED, false).set(BlockDoor.HALF, BlockPropertyDoubleBlockHalf.LOWER)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockDoor.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockDoor.FACING); + boolean flag = !(Boolean) iblockdata.get(BlockDoor.OPEN); + boolean flag1 = iblockdata.get(BlockDoor.HINGE) == BlockPropertyDoorHinge.RIGHT; + +@@ -42,9 +42,9 @@ public class BlockDoor extends Block { + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- BlockPropertyDoubleBlockHalf blockpropertydoubleblockhalf = (BlockPropertyDoubleBlockHalf) iblockdata.get(BlockDoor.HALF); ++ BlockPropertyDoubleBlockHalf blockpropertydoubleblockhalf = iblockdata.get(BlockDoor.HALF); + +- return enumdirection.n() == EnumDirection.EnumAxis.Y && blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.LOWER == (enumdirection == EnumDirection.UP) ? (iblockdata1.a((Block) this) && iblockdata1.get(BlockDoor.HALF) != blockpropertydoubleblockhalf ? (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockDoor.FACING, iblockdata1.get(BlockDoor.FACING))).set(BlockDoor.OPEN, iblockdata1.get(BlockDoor.OPEN))).set(BlockDoor.HINGE, iblockdata1.get(BlockDoor.HINGE))).set(BlockDoor.POWERED, iblockdata1.get(BlockDoor.POWERED)) : Blocks.AIR.getBlockData()) : (blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.LOWER && enumdirection == EnumDirection.DOWN && !iblockdata.canPlace(generatoraccess, blockposition) ? Blocks.AIR.getBlockData() : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1)); ++ return enumdirection.n() == EnumDirection.EnumAxis.Y && blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.LOWER == (enumdirection == EnumDirection.UP) ? (iblockdata1.a(this) && iblockdata1.get(BlockDoor.HALF) != blockpropertydoubleblockhalf ? iblockdata.set(BlockDoor.FACING, iblockdata1.get(BlockDoor.FACING)).set(BlockDoor.OPEN, iblockdata1.get(BlockDoor.OPEN)).set(BlockDoor.HINGE, iblockdata1.get(BlockDoor.HINGE)).set(BlockDoor.POWERED, iblockdata1.get(BlockDoor.POWERED)) : Blocks.AIR.getBlockData()) : (blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.LOWER && enumdirection == EnumDirection.DOWN && !iblockdata.canPlace(generatoraccess, blockposition) ? Blocks.AIR.getBlockData() : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1)); + } + + @Override +@@ -60,11 +60,11 @@ public class BlockDoor extends Block { + public boolean a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, PathMode pathmode) { + switch (pathmode) { + case LAND: +- return (Boolean) iblockdata.get(BlockDoor.OPEN); ++ return iblockdata.get(BlockDoor.OPEN); + case WATER: + return false; + case AIR: +- return (Boolean) iblockdata.get(BlockDoor.OPEN); ++ return iblockdata.get(BlockDoor.OPEN); + default: + return false; + } +@@ -87,7 +87,7 @@ public class BlockDoor extends Block { + World world = blockactioncontext.getWorld(); + boolean flag = world.isBlockIndirectlyPowered(blockposition) || world.isBlockIndirectlyPowered(blockposition.up()); + +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockDoor.FACING, blockactioncontext.f())).set(BlockDoor.HINGE, this.b(blockactioncontext))).set(BlockDoor.POWERED, flag)).set(BlockDoor.OPEN, flag)).set(BlockDoor.HALF, BlockPropertyDoubleBlockHalf.LOWER); ++ return this.getBlockData().set(BlockDoor.FACING, blockactioncontext.f()).set(BlockDoor.HINGE, this.b(blockactioncontext)).set(BlockDoor.POWERED, flag).set(BlockDoor.OPEN, flag).set(BlockDoor.HALF, BlockPropertyDoubleBlockHalf.LOWER); + } else { + return null; + } +@@ -95,7 +95,7 @@ public class BlockDoor extends Block { + + @Override + public void postPlace(World world, BlockPosition blockposition, IBlockData iblockdata, EntityLiving entityliving, ItemStack itemstack) { +- world.setTypeAndData(blockposition.up(), (IBlockData) iblockdata.set(BlockDoor.HALF, BlockPropertyDoubleBlockHalf.UPPER), 3); ++ world.setTypeAndData(blockposition.up(), iblockdata.set(BlockDoor.HALF, BlockPropertyDoubleBlockHalf.UPPER), 3); + } + + private BlockPropertyDoorHinge b(BlockActionContext blockactioncontext) { +@@ -114,8 +114,8 @@ public class BlockDoor extends Block { + BlockPosition blockposition5 = blockposition1.shift(enumdirection2); + IBlockData iblockdata3 = world.getType(blockposition5); + int i = (iblockdata.r(world, blockposition2) ? -1 : 0) + (iblockdata1.r(world, blockposition3) ? -1 : 0) + (iblockdata2.r(world, blockposition4) ? 1 : 0) + (iblockdata3.r(world, blockposition5) ? 1 : 0); +- boolean flag = iblockdata.a((Block) this) && iblockdata.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER; +- boolean flag1 = iblockdata2.a((Block) this) && iblockdata2.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER; ++ boolean flag = iblockdata.a(this) && iblockdata.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER; ++ boolean flag1 = iblockdata2.a(this) && iblockdata2.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER; + + if ((!flag || flag1) && i <= 0) { + if ((!flag1 || flag) && i >= 0) { +@@ -139,9 +139,9 @@ public class BlockDoor extends Block { + if (this.material == Material.ORE) { + return EnumInteractionResult.PASS; + } else { +- iblockdata = (IBlockData) iblockdata.a((IBlockState) BlockDoor.OPEN); ++ iblockdata = iblockdata.a((IBlockState) BlockDoor.OPEN); + world.setTypeAndData(blockposition, iblockdata, 10); +- world.a(entityhuman, (Boolean) iblockdata.get(BlockDoor.OPEN) ? this.d() : this.c(), blockposition, 0); ++ world.a(entityhuman, iblockdata.get(BlockDoor.OPEN) ? this.d() : this.c(), blockposition, 0); + return EnumInteractionResult.a(world.isClientSide); + } + } +@@ -149,8 +149,8 @@ public class BlockDoor extends Block { + public void setDoor(World world, BlockPosition blockposition, boolean flag) { + IBlockData iblockdata = world.getType(blockposition); + +- if (iblockdata.a((Block) this) && (Boolean) iblockdata.get(BlockDoor.OPEN) != flag) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDoor.OPEN, flag), 10); ++ if (iblockdata.a(this) && iblockdata.get(BlockDoor.OPEN) != flag) { ++ world.setTypeAndData(blockposition, iblockdata.set(BlockDoor.OPEN, flag), 10); + this.b(world, blockposition, flag); + } + } +@@ -167,7 +167,7 @@ public class BlockDoor extends Block { + int power = bukkitBlock.getBlockPower(); + int powerTop = blockTop.getBlockPower(); + if (powerTop > power) power = powerTop; +- int oldPower = (Boolean) iblockdata.get(BlockDoor.POWERED) ? 15 : 0; ++ int oldPower = iblockdata.get(BlockDoor.POWERED) ? 15 : 0; + + if (oldPower == 0 ^ power == 0) { + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bukkitBlock, oldPower, power); +@@ -175,11 +175,11 @@ public class BlockDoor extends Block { + + boolean flag1 = eventRedstone.getNewCurrent() > 0; + // CraftBukkit end +- if (flag1 != (Boolean) iblockdata.get(BlockDoor.OPEN)) { ++ if (flag1 != iblockdata.get(BlockDoor.OPEN)) { + this.b(world, blockposition, flag1); + } + +- world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) iblockdata.set(BlockDoor.POWERED, flag1)).set(BlockDoor.OPEN, flag1), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockDoor.POWERED, flag1).set(BlockDoor.OPEN, flag1), 2); + } + + } +@@ -189,11 +189,11 @@ public class BlockDoor extends Block { + BlockPosition blockposition1 = blockposition.down(); + IBlockData iblockdata1 = iworldreader.getType(blockposition1); + +- return iblockdata.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER ? iblockdata1.d(iworldreader, blockposition1, EnumDirection.UP) : iblockdata1.a((Block) this); ++ return iblockdata.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER ? iblockdata1.d(iworldreader, blockposition1, EnumDirection.UP) : iblockdata1.a(this); + } + + private void b(World world, BlockPosition blockposition, boolean flag) { +- world.a((EntityHuman) null, flag ? this.d() : this.c(), blockposition, 0); ++ world.a(null, flag ? this.d() : this.c(), blockposition, 0); + } + + @Override +@@ -203,12 +203,12 @@ public class BlockDoor extends Block { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockDoor.FACING, enumblockrotation.a((EnumDirection) iblockdata.get(BlockDoor.FACING))); ++ return iblockdata.set(BlockDoor.FACING, enumblockrotation.a(iblockdata.get(BlockDoor.FACING))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return enumblockmirror == EnumBlockMirror.NONE ? iblockdata : (IBlockData) iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockDoor.FACING))).a((IBlockState) BlockDoor.HINGE); ++ return enumblockmirror == EnumBlockMirror.NONE ? iblockdata : iblockdata.a(enumblockmirror.a(iblockdata.get(BlockDoor.FACING))).a((IBlockState) BlockDoor.HINGE); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockDragonEgg.java b/src/main/java/net/minecraft/server/BlockDragonEgg.java +index 7ea9155c4bf91516fd555c64253daeb8b3e9a42a..4cb5c9cd5dca37f152333bba6851c79bab259a61 100644 +--- a/src/main/java/net/minecraft/server/BlockDragonEgg.java ++++ b/src/main/java/net/minecraft/server/BlockDragonEgg.java +@@ -49,11 +49,11 @@ public class BlockDragonEgg extends BlockFalling { + float f = (world.random.nextFloat() - 0.5F) * 0.2F; + float f1 = (world.random.nextFloat() - 0.5F) * 0.2F; + float f2 = (world.random.nextFloat() - 0.5F) * 0.2F; +- double d1 = MathHelper.d(d0, (double) blockposition1.getX(), (double) blockposition.getX()) + (world.random.nextDouble() - 0.5D) + 0.5D; +- double d2 = MathHelper.d(d0, (double) blockposition1.getY(), (double) blockposition.getY()) + world.random.nextDouble() - 0.5D; +- double d3 = MathHelper.d(d0, (double) blockposition1.getZ(), (double) blockposition.getZ()) + (world.random.nextDouble() - 0.5D) + 0.5D; ++ double d1 = MathHelper.d(d0, blockposition1.getX(), blockposition.getX()) + (world.random.nextDouble() - 0.5D) + 0.5D; ++ double d2 = MathHelper.d(d0, blockposition1.getY(), blockposition.getY()) + world.random.nextDouble() - 0.5D; ++ double d3 = MathHelper.d(d0, blockposition1.getZ(), blockposition.getZ()) + (world.random.nextDouble() - 0.5D) + 0.5D; + +- world.addParticle(Particles.PORTAL, d1, d2, d3, (double) f, (double) f1, (double) f2); ++ world.addParticle(Particles.PORTAL, d1, d2, d3, f, f1, f2); + } + } else { + world.setTypeAndData(blockposition1, iblockdata, 2); +diff --git a/src/main/java/net/minecraft/server/BlockDropper.java b/src/main/java/net/minecraft/server/BlockDropper.java +index 1b360140b6161e9cae96752943d574200b5ced4e..636cce9b82c32c5efd35714709091e9120aee442 100644 +--- a/src/main/java/net/minecraft/server/BlockDropper.java ++++ b/src/main/java/net/minecraft/server/BlockDropper.java +@@ -26,7 +26,7 @@ public class BlockDropper extends BlockDispenser { + @Override + public void dispense(World world, BlockPosition blockposition) { + SourceBlock sourceblock = new SourceBlock(world, blockposition); +- TileEntityDispenser tileentitydispenser = (TileEntityDispenser) sourceblock.getTileEntity(); ++ TileEntityDispenser tileentitydispenser = sourceblock.getTileEntity(); + int i = tileentitydispenser.h(); + + if (i < 0) { +@@ -35,7 +35,7 @@ public class BlockDropper extends BlockDispenser { + ItemStack itemstack = tileentitydispenser.getItem(i); + + if (!itemstack.isEmpty()) { +- EnumDirection enumdirection = (EnumDirection) world.getType(blockposition).get(BlockDropper.FACING); ++ EnumDirection enumdirection = world.getType(blockposition).get(BlockDispenser.FACING); + IInventory iinventory = TileEntityHopper.b(world, blockposition.shift(enumdirection), false); + ItemStack itemstack1; + +diff --git a/src/main/java/net/minecraft/server/BlockEnderPortal.java b/src/main/java/net/minecraft/server/BlockEnderPortal.java +index c08038a930537109e5a0e4bafd742b3a0c36f44c..f000ff6ad7f66b35224064a6017b30830bd8b39b 100644 +--- a/src/main/java/net/minecraft/server/BlockEnderPortal.java ++++ b/src/main/java/net/minecraft/server/BlockEnderPortal.java +@@ -25,7 +25,7 @@ public class BlockEnderPortal extends BlockTileEntity { + + @Override + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { +- if (world instanceof WorldServer && !entity.isPassenger() && !entity.isVehicle() && entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) { ++ if (world instanceof WorldServer && !entity.isPassenger() && !entity.isVehicle() && entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d(-blockposition.getX(), -blockposition.getY(), -blockposition.getZ())), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) { + ResourceKey resourcekey = world.getDimensionKey() == World.THE_END ? World.OVERWORLD : World.THE_END; + WorldServer worldserver = ((WorldServer) world).getMinecraftServer().getWorldServer(resourcekey); + +diff --git a/src/main/java/net/minecraft/server/BlockFenceGate.java b/src/main/java/net/minecraft/server/BlockFenceGate.java +index 327a8a8e5d2e8eddcec885a917f105f22696e104..9434bf782291131a85ce9c8bb0a4e656265fc64a 100644 +--- a/src/main/java/net/minecraft/server/BlockFenceGate.java ++++ b/src/main/java/net/minecraft/server/BlockFenceGate.java +@@ -18,46 +18,46 @@ public class BlockFenceGate extends BlockFacingHorizontal { + + public BlockFenceGate(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockFenceGate.OPEN, false)).set(BlockFenceGate.POWERED, false)).set(BlockFenceGate.IN_WALL, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockFenceGate.OPEN, false).set(BlockFenceGate.POWERED, false).set(BlockFenceGate.IN_WALL, false)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return (Boolean) iblockdata.get(BlockFenceGate.IN_WALL) ? (((EnumDirection) iblockdata.get(BlockFenceGate.FACING)).n() == EnumDirection.EnumAxis.X ? BlockFenceGate.g : BlockFenceGate.f) : (((EnumDirection) iblockdata.get(BlockFenceGate.FACING)).n() == EnumDirection.EnumAxis.X ? BlockFenceGate.e : BlockFenceGate.d); ++ return iblockdata.get(BlockFenceGate.IN_WALL) ? (iblockdata.get(BlockFacingHorizontal.FACING).n() == EnumDirection.EnumAxis.X ? BlockFenceGate.g : BlockFenceGate.f) : (iblockdata.get(BlockFacingHorizontal.FACING).n() == EnumDirection.EnumAxis.X ? BlockFenceGate.e : BlockFenceGate.d); + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { + EnumDirection.EnumAxis enumdirection_enumaxis = enumdirection.n(); + +- if (((EnumDirection) iblockdata.get(BlockFenceGate.FACING)).g().n() != enumdirection_enumaxis) { ++ if (iblockdata.get(BlockFacingHorizontal.FACING).g().n() != enumdirection_enumaxis) { + return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); + } else { + boolean flag = this.h(iblockdata1) || this.h(generatoraccess.getType(blockposition.shift(enumdirection.opposite()))); + +- return (IBlockData) iblockdata.set(BlockFenceGate.IN_WALL, flag); ++ return iblockdata.set(BlockFenceGate.IN_WALL, flag); + } + } + + @Override + public VoxelShape c(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return (Boolean) iblockdata.get(BlockFenceGate.OPEN) ? VoxelShapes.a() : (((EnumDirection) iblockdata.get(BlockFenceGate.FACING)).n() == EnumDirection.EnumAxis.Z ? BlockFenceGate.h : BlockFenceGate.i); ++ return iblockdata.get(BlockFenceGate.OPEN) ? VoxelShapes.a() : (iblockdata.get(BlockFacingHorizontal.FACING).n() == EnumDirection.EnumAxis.Z ? BlockFenceGate.h : BlockFenceGate.i); + } + + @Override + public VoxelShape d(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { +- return (Boolean) iblockdata.get(BlockFenceGate.IN_WALL) ? (((EnumDirection) iblockdata.get(BlockFenceGate.FACING)).n() == EnumDirection.EnumAxis.X ? BlockFenceGate.p : BlockFenceGate.o) : (((EnumDirection) iblockdata.get(BlockFenceGate.FACING)).n() == EnumDirection.EnumAxis.X ? BlockFenceGate.k : BlockFenceGate.j); ++ return iblockdata.get(BlockFenceGate.IN_WALL) ? (iblockdata.get(BlockFacingHorizontal.FACING).n() == EnumDirection.EnumAxis.X ? BlockFenceGate.p : BlockFenceGate.o) : (iblockdata.get(BlockFacingHorizontal.FACING).n() == EnumDirection.EnumAxis.X ? BlockFenceGate.k : BlockFenceGate.j); + } + + @Override + public boolean a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, PathMode pathmode) { + switch (pathmode) { + case LAND: +- return (Boolean) iblockdata.get(BlockFenceGate.OPEN); ++ return iblockdata.get(BlockFenceGate.OPEN); + case WATER: + return false; + case AIR: +- return (Boolean) iblockdata.get(BlockFenceGate.OPEN); ++ return iblockdata.get(BlockFenceGate.OPEN); + default: + return false; + } +@@ -72,30 +72,30 @@ public class BlockFenceGate extends BlockFacingHorizontal { + EnumDirection.EnumAxis enumdirection_enumaxis = enumdirection.n(); + boolean flag1 = enumdirection_enumaxis == EnumDirection.EnumAxis.Z && (this.h(world.getType(blockposition.west())) || this.h(world.getType(blockposition.east()))) || enumdirection_enumaxis == EnumDirection.EnumAxis.X && (this.h(world.getType(blockposition.north())) || this.h(world.getType(blockposition.south()))); + +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockFenceGate.FACING, enumdirection)).set(BlockFenceGate.OPEN, flag)).set(BlockFenceGate.POWERED, flag)).set(BlockFenceGate.IN_WALL, flag1); ++ return this.getBlockData().set(BlockFacingHorizontal.FACING, enumdirection).set(BlockFenceGate.OPEN, flag).set(BlockFenceGate.POWERED, flag).set(BlockFenceGate.IN_WALL, flag1); + } + + private boolean h(IBlockData iblockdata) { +- return iblockdata.getBlock().a((Tag) TagsBlock.WALLS); ++ return iblockdata.getBlock().a(TagsBlock.WALLS); + } + + @Override + public EnumInteractionResult interact(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) { +- if ((Boolean) iblockdata.get(BlockFenceGate.OPEN)) { +- iblockdata = (IBlockData) iblockdata.set(BlockFenceGate.OPEN, false); ++ if (iblockdata.get(BlockFenceGate.OPEN)) { ++ iblockdata = iblockdata.set(BlockFenceGate.OPEN, false); + world.setTypeAndData(blockposition, iblockdata, 10); + } else { + EnumDirection enumdirection = entityhuman.getDirection(); + +- if (iblockdata.get(BlockFenceGate.FACING) == enumdirection.opposite()) { +- iblockdata = (IBlockData) iblockdata.set(BlockFenceGate.FACING, enumdirection); ++ if (iblockdata.get(BlockFacingHorizontal.FACING) == enumdirection.opposite()) { ++ iblockdata = iblockdata.set(BlockFacingHorizontal.FACING, enumdirection); + } + +- iblockdata = (IBlockData) iblockdata.set(BlockFenceGate.OPEN, true); ++ iblockdata = iblockdata.set(BlockFenceGate.OPEN, true); + world.setTypeAndData(blockposition, iblockdata, 10); + } + +- world.a(entityhuman, (Boolean) iblockdata.get(BlockFenceGate.OPEN) ? 1008 : 1014, blockposition, 0); ++ world.a(entityhuman, iblockdata.get(BlockFenceGate.OPEN) ? 1008 : 1014, blockposition, 0); + return EnumInteractionResult.a(world.isClientSide); + } + +@@ -115,10 +115,10 @@ public class BlockFenceGate extends BlockFacingHorizontal { + } + // CraftBukkit end + +- if ((Boolean) iblockdata.get(BlockFenceGate.POWERED) != flag1) { +- world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) iblockdata.set(BlockFenceGate.POWERED, flag1)).set(BlockFenceGate.OPEN, flag1), 2); +- if ((Boolean) iblockdata.get(BlockFenceGate.OPEN) != flag1) { +- world.a((EntityHuman) null, flag1 ? 1008 : 1014, blockposition, 0); ++ if (iblockdata.get(BlockFenceGate.POWERED) != flag1) { ++ world.setTypeAndData(blockposition, iblockdata.set(BlockFenceGate.POWERED, flag1).set(BlockFenceGate.OPEN, flag1), 2); ++ if (iblockdata.get(BlockFenceGate.OPEN) != flag1) { ++ world.a(null, flag1 ? 1008 : 1014, blockposition, 0); + } + } + +@@ -127,10 +127,10 @@ public class BlockFenceGate extends BlockFacingHorizontal { + + @Override + protected void a(BlockStateList.a blockstatelist_a) { +- blockstatelist_a.a(BlockFenceGate.FACING, BlockFenceGate.OPEN, BlockFenceGate.POWERED, BlockFenceGate.IN_WALL); ++ blockstatelist_a.a(BlockFacingHorizontal.FACING, BlockFenceGate.OPEN, BlockFenceGate.POWERED, BlockFenceGate.IN_WALL); + } + + public static boolean a(IBlockData iblockdata, EnumDirection enumdirection) { +- return ((EnumDirection) iblockdata.get(BlockFenceGate.FACING)).n() == enumdirection.g().n(); ++ return iblockdata.get(BlockFacingHorizontal.FACING).n() == enumdirection.g().n(); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java +index 41bbb8d9d2f9da2a71a95e00b0048aa62deb0429..6067e2d842937d524a28f0abdf9d77036b89eb82 100644 +--- a/src/main/java/net/minecraft/server/BlockFire.java ++++ b/src/main/java/net/minecraft/server/BlockFire.java +@@ -20,7 +20,7 @@ public class BlockFire extends BlockFireAbstract { + public static final BlockStateBoolean SOUTH = BlockSprawling.c; + public static final BlockStateBoolean WEST = BlockSprawling.d; + public static final BlockStateBoolean UPPER = BlockSprawling.e; +- private static final Map p = (Map) BlockSprawling.g.entrySet().stream().filter((entry) -> { ++ private static final Map p = BlockSprawling.g.entrySet().stream().filter((entry) -> { + return entry.getKey() != EnumDirection.DOWN; + }).collect(SystemUtils.a()); + private final Object2IntMap flameChances = new Object2IntOpenHashMap(); +@@ -28,13 +28,13 @@ public class BlockFire extends BlockFireAbstract { + + public BlockFire(BlockBase.Info blockbase_info) { + super(blockbase_info, 1.0F); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockFire.AGE, 0)).set(BlockFire.NORTH, false)).set(BlockFire.EAST, false)).set(BlockFire.SOUTH, false)).set(BlockFire.WEST, false)).set(BlockFire.UPPER, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockFire.AGE, 0).set(BlockFire.NORTH, false).set(BlockFire.EAST, false).set(BlockFire.SOUTH, false).set(BlockFire.WEST, false).set(BlockFire.UPPER, false)); + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { + // CraftBukkit start +- if (!(generatoraccess instanceof WorldServer)) return this.canPlace(iblockdata, generatoraccess, blockposition) ? (IBlockData) this.a(generatoraccess, blockposition, (Integer) iblockdata.get(BlockFire.AGE)) : Blocks.AIR.getBlockData(); // Paper - don't fire events in world generation ++ if (!(generatoraccess instanceof WorldServer)) return this.canPlace(iblockdata, generatoraccess, blockposition) ? this.a(generatoraccess, blockposition, iblockdata.get(BlockFire.AGE)) : Blocks.AIR.getBlockData(); // Paper - don't fire events in world generation + if (!this.canPlace(iblockdata, generatoraccess, blockposition)) { + // Suppress during worldgen + if (!(generatoraccess instanceof World)) { +@@ -50,7 +50,7 @@ public class BlockFire extends BlockFireAbstract { + return blockState.getHandle(); + } + } +- return this.a(generatoraccess, blockposition, (Integer) iblockdata.get(BlockFire.AGE)); // Paper - diff on change, see "don't fire events in world generation" ++ return this.a(generatoraccess, blockposition, iblockdata.get(BlockFire.AGE)); // Paper - diff on change, see "don't fire events in world generation" + // CraftBukkit end + } + +@@ -58,27 +58,27 @@ public class BlockFire extends BlockFireAbstract { + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { + VoxelShape voxelshape = VoxelShapes.a(); + +- if ((Boolean) iblockdata.get(BlockFire.UPPER)) { +- voxelshape = BlockFire.a; ++ if (iblockdata.get(BlockFire.UPPER)) { ++ voxelshape = BlockFireAbstract.a; + } + +- if ((Boolean) iblockdata.get(BlockFire.WEST)) { +- voxelshape = VoxelShapes.a(voxelshape, BlockFire.c); ++ if (iblockdata.get(BlockFire.WEST)) { ++ voxelshape = VoxelShapes.a(voxelshape, BlockFireAbstract.c); + } + +- if ((Boolean) iblockdata.get(BlockFire.EAST)) { +- voxelshape = VoxelShapes.a(voxelshape, BlockFire.d); ++ if (iblockdata.get(BlockFire.EAST)) { ++ voxelshape = VoxelShapes.a(voxelshape, BlockFireAbstract.d); + } + +- if ((Boolean) iblockdata.get(BlockFire.NORTH)) { +- voxelshape = VoxelShapes.a(voxelshape, BlockFire.e); ++ if (iblockdata.get(BlockFire.NORTH)) { ++ voxelshape = VoxelShapes.a(voxelshape, BlockFireAbstract.e); + } + +- if ((Boolean) iblockdata.get(BlockFire.SOUTH)) { +- voxelshape = VoxelShapes.a(voxelshape, BlockFire.f); ++ if (iblockdata.get(BlockFire.SOUTH)) { ++ voxelshape = VoxelShapes.a(voxelshape, BlockFireAbstract.f); + } + +- return voxelshape == VoxelShapes.a() ? BlockFire.b : voxelshape; ++ return voxelshape == VoxelShapes.a() ? BlockFireAbstract.b : voxelshape; + } + + @Override +@@ -97,10 +97,10 @@ public class BlockFire extends BlockFireAbstract { + + for (int j = 0; j < i; ++j) { + EnumDirection enumdirection = aenumdirection[j]; +- BlockStateBoolean blockstateboolean = (BlockStateBoolean) BlockFire.p.get(enumdirection); ++ BlockStateBoolean blockstateboolean = BlockFire.p.get(enumdirection); + + if (blockstateboolean != null) { +- iblockdata1 = (IBlockData) iblockdata1.set(blockstateboolean, this.e(iblockaccess.getTypeIfLoaded(blockposition.shift(enumdirection)))); // Paper - prevent chunk loads ++ iblockdata1 = iblockdata1.set(blockstateboolean, this.e(iblockaccess.getTypeIfLoaded(blockposition.shift(enumdirection)))); // Paper - prevent chunk loads + } + } + +@@ -127,15 +127,15 @@ public class BlockFire extends BlockFireAbstract { + + IBlockData iblockdata1 = worldserver.getType(blockposition.down()); + boolean flag = iblockdata1.a(worldserver.getDimensionManager().q()); +- int i = (Integer) iblockdata.get(BlockFire.AGE); ++ int i = iblockdata.get(BlockFire.AGE); + +- if (!flag && worldserver.isRaining() && this.a((World) worldserver, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) { ++ if (!flag && worldserver.isRaining() && this.a(worldserver, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) { + fireExtinguished(worldserver, blockposition); // CraftBukkit - extinguished by rain + } else { + int j = Math.min(15, i + random.nextInt(3) / 2); + + if (i != j) { +- iblockdata = (IBlockData) iblockdata.set(BlockFire.AGE, j); ++ iblockdata = iblockdata.set(BlockFire.AGE, j); + worldserver.setTypeAndData(blockposition, iblockdata, 4); + } + +@@ -181,7 +181,7 @@ public class BlockFire extends BlockFireAbstract { + + blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, l, j1, i1); + if (!worldserver.isLoaded(blockposition_mutableblockposition)) continue; // Paper +- int l1 = this.a((IWorldReader) worldserver, (BlockPosition) blockposition_mutableblockposition); ++ int l1 = this.a((IWorldReader) worldserver, blockposition_mutableblockposition); + + if (l1 > 0) { + int i2 = (l1 + 40 + worldserver.getDifficulty().a() * 7) / (i + 30); +@@ -190,7 +190,7 @@ public class BlockFire extends BlockFireAbstract { + i2 /= 2; + } + +- if (i2 > 0 && random.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.a((World) worldserver, (BlockPosition) blockposition_mutableblockposition))) { ++ if (i2 > 0 && random.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.a(worldserver, blockposition_mutableblockposition))) { + int j2 = Math.min(15, i + random.nextInt(5) / 4); + + // CraftBukkit start - Call to stop spread of fire +@@ -218,11 +218,11 @@ public class BlockFire extends BlockFireAbstract { + } + + private int getBurnChance(IBlockData iblockdata) { +- return iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C) ? 0 : this.burnChances.getInt(iblockdata.getBlock()); ++ return iblockdata.b(BlockProperties.C) && iblockdata.get(BlockProperties.C) ? 0 : this.burnChances.getInt(iblockdata.getBlock()); + } + + private int getFlameChance(IBlockData iblockdata) { +- return iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C) ? 0 : this.flameChances.getInt(iblockdata.getBlock()); ++ return iblockdata.b(BlockProperties.C) && iblockdata.get(BlockProperties.C) ? 0 : this.flameChances.getInt(iblockdata.getBlock()); + } + + private void trySpread(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition +@@ -278,7 +278,7 @@ public class BlockFire extends BlockFireAbstract { + private IBlockData a(GeneratorAccess generatoraccess, BlockPosition blockposition, int i) { + IBlockData iblockdata = a((IBlockAccess) generatoraccess, blockposition); + +- return iblockdata.a(Blocks.FIRE) ? (IBlockData) iblockdata.set(BlockFire.AGE, i) : iblockdata; ++ return iblockdata.a(Blocks.FIRE) ? iblockdata.set(BlockFire.AGE, i) : iblockdata; + } + + private boolean canBurn(IBlockAccess iblockaccess, BlockPosition blockposition) { +diff --git a/src/main/java/net/minecraft/server/BlockFireAbstract.java b/src/main/java/net/minecraft/server/BlockFireAbstract.java +index dbe44fef01f5707959f5b236673574432b98ac91..27818ef38d1d64e573685b91a92af8071c3ed19f 100644 +--- a/src/main/java/net/minecraft/server/BlockFireAbstract.java ++++ b/src/main/java/net/minecraft/server/BlockFireAbstract.java +@@ -61,7 +61,7 @@ public abstract class BlockFireAbstract extends Block { + public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!iblockdata1.a(iblockdata.getBlock())) { + // CraftBukkit - getTypeKey() +- if (world.getTypeKey() != DimensionManager.OVERWORLD && world.getTypeKey() != DimensionManager.THE_NETHER || !BlockPortal.a((GeneratorAccess) world, blockposition)) { ++ if (world.getTypeKey() != DimensionManager.OVERWORLD && world.getTypeKey() != DimensionManager.THE_NETHER || !BlockPortal.a(world, blockposition)) { + if (!iblockdata.canPlace(world, blockposition)) { + fireExtinguished(world, blockposition); // CraftBukkit - fuel block broke + } +@@ -73,7 +73,7 @@ public abstract class BlockFireAbstract extends Block { + @Override + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) { + if (!world.s_()) { +- world.a((EntityHuman) null, 1009, blockposition, 0); ++ world.a(null, 1009, blockposition, 0); + } + + } +diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java +index 335750d4a247c8898ffec3512f3b3453b4e84340..56a2ac036f2d9ec96a6bce58ece5c3c2a2a527c5 100644 +--- a/src/main/java/net/minecraft/server/BlockFluids.java ++++ b/src/main/java/net/minecraft/server/BlockFluids.java +@@ -24,12 +24,12 @@ public class BlockFluids extends Block implements IFluidSource { + } + + this.d.add(fluidtypeflowing.a(8, true)); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockFluids.LEVEL, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockFluids.LEVEL, 0)); + } + + @Override + public VoxelShape c(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return voxelshapecollision.a(BlockFluids.c, blockposition, true) && (Integer) iblockdata.get(BlockFluids.LEVEL) == 0 && voxelshapecollision.a(iblockaccess.getFluid(blockposition.up()), this.b) ? BlockFluids.c : VoxelShapes.a(); ++ return voxelshapecollision.a(BlockFluids.c, blockposition, true) && iblockdata.get(BlockFluids.LEVEL) == 0 && voxelshapecollision.a(iblockaccess.getFluid(blockposition.up()), this.b) ? BlockFluids.c : VoxelShapes.a(); + } + + @Override +@@ -49,14 +49,14 @@ public class BlockFluids extends Block implements IFluidSource { + + @Override + public boolean a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, PathMode pathmode) { +- return !this.b.a((Tag) TagsFluid.LAVA); ++ return !this.b.a(TagsFluid.LAVA); + } + + @Override + public Fluid d(IBlockData iblockdata) { +- int i = (Integer) iblockdata.get(BlockFluids.LEVEL); ++ int i = iblockdata.get(BlockFluids.LEVEL); + +- return (Fluid) this.d.get(Math.min(i, 8)); ++ return this.d.get(Math.min(i, 8)); + } + + @Override +@@ -102,7 +102,7 @@ public class BlockFluids extends Block implements IFluidSource { + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { + if (iblockdata.getFluid().isSource() || iblockdata1.getFluid().isSource()) { +- generatoraccess.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.b.a((IWorldReader) generatoraccess)); ++ generatoraccess.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.b.a(generatoraccess)); + } + + return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); +@@ -117,7 +117,7 @@ public class BlockFluids extends Block implements IFluidSource { + } + + private boolean a(World world, BlockPosition blockposition, IBlockData iblockdata) { +- if (this.b.a((Tag) TagsFluid.LAVA)) { ++ if (this.b.a(TagsFluid.LAVA)) { + boolean flag = world.getType(blockposition.down()).a(Blocks.SOUL_SOIL); + EnumDirection[] aenumdirection = EnumDirection.values(); + int i = aenumdirection.length; +@@ -128,7 +128,7 @@ public class BlockFluids extends Block implements IFluidSource { + if (enumdirection != EnumDirection.DOWN) { + BlockPosition blockposition1 = blockposition.shift(enumdirection); + +- if (world.getFluid(blockposition1).a((Tag) TagsFluid.WATER)) { ++ if (world.getFluid(blockposition1).a(TagsFluid.WATER)) { + Block block = world.getFluid(blockposition).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE; + + // CraftBukkit start +@@ -165,7 +165,7 @@ public class BlockFluids extends Block implements IFluidSource { + + @Override + public FluidType removeFluid(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata) { +- if ((Integer) iblockdata.get(BlockFluids.LEVEL) == 0) { ++ if (iblockdata.get(BlockFluids.LEVEL) == 0) { + generatoraccess.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 11); + return this.b; + } else { +@@ -175,7 +175,7 @@ public class BlockFluids extends Block implements IFluidSource { + + @Override + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { +- if (this.b.a((Tag) TagsFluid.LAVA)) { ++ if (this.b.a(TagsFluid.LAVA)) { + float f = (float) blockposition.getY() + iblockdata.getFluid().getHeight(world, blockposition); + AxisAlignedBB axisalignedbb = entity.getBoundingBox(); + +diff --git a/src/main/java/net/minecraft/server/BlockFungi.java b/src/main/java/net/minecraft/server/BlockFungi.java +index 35abbaf772dced8d462840457f0e19571d8de255..74e47bbe68a0452fdfb3e9c5eb8cde3b53b9a8c0 100644 +--- a/src/main/java/net/minecraft/server/BlockFungi.java ++++ b/src/main/java/net/minecraft/server/BlockFungi.java +@@ -20,12 +20,12 @@ public class BlockFungi extends BlockPlant implements IBlockFragilePlantElement + + @Override + protected boolean c(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { +- return iblockdata.a((Tag) TagsBlock.NYLIUM) || iblockdata.a(Blocks.SOUL_SOIL) || super.c(iblockdata, iblockaccess, blockposition); ++ return iblockdata.a(TagsBlock.NYLIUM) || iblockdata.a(Blocks.SOUL_SOIL) || super.c(iblockdata, iblockaccess, blockposition); + } + + @Override + public boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, boolean flag) { +- Block block = ((WorldGenFeatureHugeFungiConfiguration) ((WorldGenFeatureConfigured) this.b.get()).e).f.getBlock(); ++ Block block = ((WorldGenFeatureHugeFungiConfiguration) this.b.get().e).f.getBlock(); + Block block1 = iblockaccess.getType(blockposition.down()).getBlock(); + + return block1 == block; +@@ -45,6 +45,6 @@ public class BlockFungi extends BlockPlant implements IBlockFragilePlantElement + BlockSapling.treeType = org.bukkit.TreeType.CRIMSON_FUNGUS; + } + // CraftBukkit end +- ((WorldGenFeatureConfigured) this.b.get()).a(worldserver, worldserver.getStructureManager(), worldserver.getChunkProvider().getChunkGenerator(), random, blockposition); ++ this.b.get().a(worldserver, worldserver.getStructureManager(), worldserver.getChunkProvider().getChunkGenerator(), random, blockposition); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java +index 9321677f5600b53f3fb82e5384b3f298b50fff32..472cddabf89d68de6f9e2aa67a5c89dea0effd32 100644 +--- a/src/main/java/net/minecraft/server/BlockGrass.java ++++ b/src/main/java/net/minecraft/server/BlockGrass.java +@@ -32,7 +32,7 @@ public class BlockGrass extends BlockDirtSnowSpreadable implements IBlockFragile + while (true) { + if (j < i / 16) { + blockposition2 = blockposition2.b(random.nextInt(3) - 1, (random.nextInt(3) - 1) * random.nextInt(3) / 2, random.nextInt(3) - 1); +- if (worldserver.getType(blockposition2.down()).a((Block) this) && !worldserver.getType(blockposition2).r(worldserver, blockposition2)) { ++ if (worldserver.getType(blockposition2.down()).a(this) && !worldserver.getType(blockposition2).r(worldserver, blockposition2)) { + ++j; + continue; + } +@@ -55,7 +55,7 @@ public class BlockGrass extends BlockDirtSnowSpreadable implements IBlockFragile + break label38; + } + +- WorldGenFeatureConfigured worldgenfeatureconfigured = ((WorldGenFeatureCompositeConfiguration) ((WorldGenFeatureConfigured) list.get(0)).e).b; ++ WorldGenFeatureConfigured worldgenfeatureconfigured = ((WorldGenFeatureCompositeConfiguration) list.get(0).e).b; + + iblockdata3 = ((WorldGenFlowers) worldgenfeatureconfigured.d).b(random, blockposition2, worldgenfeatureconfigured.e); + } else { +diff --git a/src/main/java/net/minecraft/server/BlockGrowingTop.java b/src/main/java/net/minecraft/server/BlockGrowingTop.java +index c4998f7a73c0784b1fd2240de875777501c1f17d..2c0880d163fd6e92b2cf64c42ae7c805e130a95d 100644 +--- a/src/main/java/net/minecraft/server/BlockGrowingTop.java ++++ b/src/main/java/net/minecraft/server/BlockGrowingTop.java +@@ -10,11 +10,11 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB + protected BlockGrowingTop(BlockBase.Info blockbase_info, EnumDirection enumdirection, VoxelShape voxelshape, boolean flag, double d0) { + super(blockbase_info, enumdirection, voxelshape, flag); + this.e = d0; +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockGrowingTop.d, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockGrowingTop.d, 0)); + } + + public IBlockData a(GeneratorAccess generatoraccess) { +- return (IBlockData) this.getBlockData().set(BlockGrowingTop.d, generatoraccess.getRandom().nextInt(25)); ++ return this.getBlockData().set(BlockGrowingTop.d, generatoraccess.getRandom().nextInt(25)); + } + + @Override +@@ -27,16 +27,16 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB + + @Override + public boolean isTicking(IBlockData iblockdata) { +- return (Integer) iblockdata.get(BlockGrowingTop.d) < 25; ++ return iblockdata.get(BlockGrowingTop.d) < 25; + } + + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if ((Integer) iblockdata.get(BlockGrowingTop.d) < 25 && random.nextDouble() < (100.0D / worldserver.spigotConfig.kelpModifier) * this.e) { // Spigot ++ if (iblockdata.get(BlockGrowingTop.d) < 25 && random.nextDouble() < (100.0D / worldserver.spigotConfig.kelpModifier) * this.e) { // Spigot + BlockPosition blockposition1 = blockposition.shift(this.a); + + if (this.h(worldserver.getType(blockposition1))) { +- org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata.a((IBlockState) BlockGrowingTop.d)); // CraftBukkit ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, iblockdata.a((IBlockState) BlockGrowingTop.d)); // CraftBukkit + } + } + +@@ -48,11 +48,11 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB + generatoraccess.getBlockTickList().a(blockposition, this, 1); + } + +- if (enumdirection == this.a && iblockdata1.a((Block) this)) { ++ if (enumdirection == this.a && iblockdata1.a(this)) { + return this.d().getBlockData(); + } else { + if (this.b) { +- generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess)); ++ generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(generatoraccess)); + } + + return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); +@@ -77,11 +77,11 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB + @Override + public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) { + BlockPosition blockposition1 = blockposition.shift(this.a); +- int i = Math.min((Integer) iblockdata.get(BlockGrowingTop.d) + 1, 25); ++ int i = Math.min(iblockdata.get(BlockGrowingTop.d) + 1, 25); + int j = this.a(random); + + for (int k = 0; k < j && this.h(worldserver.getType(blockposition1)); ++k) { +- worldserver.setTypeUpdate(blockposition1, (IBlockData) iblockdata.set(BlockGrowingTop.d, i)); ++ worldserver.setTypeUpdate(blockposition1, iblockdata.set(BlockGrowingTop.d, i)); + blockposition1 = blockposition1.shift(this.a); + i = Math.min(i + 1, 25); + } +diff --git a/src/main/java/net/minecraft/server/BlockHopper.java b/src/main/java/net/minecraft/server/BlockHopper.java +index 7918382f26807f945dc7966b81c3c1e2f0fc3c41..ae4666223df0665219ea4b8195023b497c62ada3 100644 +--- a/src/main/java/net/minecraft/server/BlockHopper.java ++++ b/src/main/java/net/minecraft/server/BlockHopper.java +@@ -21,12 +21,12 @@ public class BlockHopper extends BlockTileEntity { + + public BlockHopper(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockHopper.FACING, EnumDirection.DOWN)).set(BlockHopper.ENABLED, true)); ++ this.j(this.blockStateList.getBlockData().set(BlockHopper.FACING, EnumDirection.DOWN).set(BlockHopper.ENABLED, true)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- switch ((EnumDirection) iblockdata.get(BlockHopper.FACING)) { ++ switch (iblockdata.get(BlockHopper.FACING)) { + case DOWN: + return BlockHopper.g; + case NORTH: +@@ -44,7 +44,7 @@ public class BlockHopper extends BlockTileEntity { + + @Override + public VoxelShape a_(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { +- switch ((EnumDirection) iblockdata.get(BlockHopper.FACING)) { ++ switch (iblockdata.get(BlockHopper.FACING)) { + case DOWN: + return BlockHopper.o; + case NORTH: +@@ -64,7 +64,7 @@ public class BlockHopper extends BlockTileEntity { + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { + EnumDirection enumdirection = blockactioncontext.getClickedFace().opposite(); + +- return (IBlockData) ((IBlockData) this.getBlockData().set(BlockHopper.FACING, enumdirection.n() == EnumDirection.EnumAxis.Y ? EnumDirection.DOWN : enumdirection)).set(BlockHopper.ENABLED, true); ++ return this.getBlockData().set(BlockHopper.FACING, enumdirection.n() == EnumDirection.EnumAxis.Y ? EnumDirection.DOWN : enumdirection).set(BlockHopper.ENABLED, true); + } + + @Override +@@ -121,8 +121,8 @@ public class BlockHopper extends BlockTileEntity { + private void a(World world, BlockPosition blockposition, IBlockData iblockdata) { + boolean flag = !world.isBlockIndirectlyPowered(blockposition); + +- if (flag != (Boolean) iblockdata.get(BlockHopper.ENABLED)) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockHopper.ENABLED, flag), 4); ++ if (flag != iblockdata.get(BlockHopper.ENABLED)) { ++ world.setTypeAndData(blockposition, iblockdata.set(BlockHopper.ENABLED, flag), 4); + } + + } +@@ -158,12 +158,12 @@ public class BlockHopper extends BlockTileEntity { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockHopper.FACING, enumblockrotation.a((EnumDirection) iblockdata.get(BlockHopper.FACING))); ++ return iblockdata.set(BlockHopper.FACING, enumblockrotation.a(iblockdata.get(BlockHopper.FACING))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockHopper.FACING))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockHopper.FACING))); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java +index 77f5f835c60c181a0a2d6fc782d756338bc2ccb0..930ecbcbf8efb4ea7b0829b708db2ee53c15c3ba 100644 +--- a/src/main/java/net/minecraft/server/BlockIceFrost.java ++++ b/src/main/java/net/minecraft/server/BlockIceFrost.java +@@ -8,7 +8,7 @@ public class BlockIceFrost extends BlockIce { + + public BlockIceFrost(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockIceFrost.a, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockIceFrost.a, 0)); + } + + @Override +@@ -19,7 +19,7 @@ public class BlockIceFrost extends BlockIce { + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + if (!worldserver.paperConfig.frostedIceEnabled) return; // Paper - add ability to disable frosted ice +- if ((random.nextInt(3) == 0 || this.a(worldserver, blockposition, 4)) && worldserver.getLightLevel(blockposition) > 11 - (Integer) iblockdata.get(BlockIceFrost.a) - iblockdata.b((IBlockAccess) worldserver, blockposition) && this.e(iblockdata, (World) worldserver, blockposition)) { ++ if ((random.nextInt(3) == 0 || this.a(worldserver, blockposition, 4)) && worldserver.getLightLevel(blockposition) > 11 - iblockdata.get(BlockIceFrost.a) - iblockdata.b((IBlockAccess) worldserver, blockposition) && this.e(iblockdata, worldserver, blockposition)) { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); + EnumDirection[] aenumdirection = EnumDirection.values(); + int i = aenumdirection.length; +@@ -27,11 +27,11 @@ public class BlockIceFrost extends BlockIce { + for (int j = 0; j < i; ++j) { + EnumDirection enumdirection = aenumdirection[j]; + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); ++ blockposition_mutableblockposition.a(blockposition, enumdirection); + IBlockData iblockdata1 = worldserver.getTypeIfLoaded(blockposition_mutableblockposition); // Paper + if (iblockdata1 == null) { continue; } // Paper + +- if (iblockdata1.a((Block) this) && !this.e(iblockdata1, (World) worldserver, blockposition_mutableblockposition)) { ++ if (iblockdata1.a(this) && !this.e(iblockdata1, worldserver, blockposition_mutableblockposition)) { + worldserver.getBlockTickList().a(blockposition_mutableblockposition, this, MathHelper.nextInt(random, worldserver.paperConfig.frostedIceDelayMin, worldserver.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay + } + } +@@ -42,10 +42,10 @@ public class BlockIceFrost extends BlockIce { + } + + private boolean e(IBlockData iblockdata, World world, BlockPosition blockposition) { +- int i = (Integer) iblockdata.get(BlockIceFrost.a); ++ int i = iblockdata.get(BlockIceFrost.a); + + if (i < 3) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockIceFrost.a, i + 1), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockIceFrost.a, i + 1), 2); + return false; + } else { + this.melt(iblockdata, world, blockposition); +@@ -71,10 +71,10 @@ public class BlockIceFrost extends BlockIce { + for (int l = 0; l < k; ++l) { + EnumDirection enumdirection = aenumdirection[l]; + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); ++ blockposition_mutableblockposition.a(blockposition, enumdirection); + // Paper start + IBlockData type = iblockaccess.getTypeIfLoaded(blockposition_mutableblockposition); +- if (type != null && type.a((Block) this)) { // Paper end ++ if (type != null && type.a(this)) { // Paper end + ++j; + if (j >= i) { + return false; +diff --git a/src/main/java/net/minecraft/server/BlockJukeBox.java b/src/main/java/net/minecraft/server/BlockJukeBox.java +index 9ad57c2f5ae3333478dafe83e5e6abb4c1e7e9cf..ff3e5c476935e7fe62c0477b7bb7c2aad71380ee 100644 +--- a/src/main/java/net/minecraft/server/BlockJukeBox.java ++++ b/src/main/java/net/minecraft/server/BlockJukeBox.java +@@ -8,7 +8,7 @@ public class BlockJukeBox extends BlockTileEntity { + + protected BlockJukeBox(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockJukeBox.HAS_RECORD, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockJukeBox.HAS_RECORD, false)); + } + + @Override +@@ -20,7 +20,7 @@ public class BlockJukeBox extends BlockTileEntity { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("BlockEntityTag"); + + if (nbttagcompound1.hasKey("RecordItem")) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockJukeBox.HAS_RECORD, true), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockJukeBox.HAS_RECORD, true), 2); + } + } + +@@ -28,9 +28,9 @@ public class BlockJukeBox extends BlockTileEntity { + + @Override + public EnumInteractionResult interact(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) { +- if ((Boolean) iblockdata.get(BlockJukeBox.HAS_RECORD)) { ++ if (iblockdata.get(BlockJukeBox.HAS_RECORD)) { + this.dropRecord(world, blockposition); +- iblockdata = (IBlockData) iblockdata.set(BlockJukeBox.HAS_RECORD, false); ++ iblockdata = iblockdata.set(BlockJukeBox.HAS_RECORD, false); + world.setTypeAndData(blockposition, iblockdata, 2); + return EnumInteractionResult.a(world.isClientSide); + } else { +@@ -49,7 +49,7 @@ public class BlockJukeBox extends BlockTileEntity { + } + ((TileEntityJukeBox) tileentity).setRecord(itemstack); + // CraftBukkit end +- generatoraccess.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockJukeBox.HAS_RECORD, true), 2); ++ generatoraccess.setTypeAndData(blockposition, iblockdata.set(BlockJukeBox.HAS_RECORD, true), 2); + } + } + +diff --git a/src/main/java/net/minecraft/server/BlockLeaves.java b/src/main/java/net/minecraft/server/BlockLeaves.java +index 03d0c9ca4facbac2c573e86938cece0942b2369d..e4654686174493b728dbeac94a3c91a43194db63 100644 +--- a/src/main/java/net/minecraft/server/BlockLeaves.java ++++ b/src/main/java/net/minecraft/server/BlockLeaves.java +@@ -11,7 +11,7 @@ public class BlockLeaves extends Block { + + public BlockLeaves(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockLeaves.DISTANCE, 7)).set(BlockLeaves.PERSISTENT, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockLeaves.DISTANCE, 7).set(BlockLeaves.PERSISTENT, false)); + } + + @Override +@@ -21,12 +21,12 @@ public class BlockLeaves extends Block { + + @Override + public boolean isTicking(IBlockData iblockdata) { +- return (Integer) iblockdata.get(BlockLeaves.DISTANCE) == 7 && !(Boolean) iblockdata.get(BlockLeaves.PERSISTENT); ++ return iblockdata.get(BlockLeaves.DISTANCE) == 7 && !(Boolean) iblockdata.get(BlockLeaves.PERSISTENT); + } + + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if (!(Boolean) iblockdata.get(BlockLeaves.PERSISTENT) && (Integer) iblockdata.get(BlockLeaves.DISTANCE) == 7) { ++ if (!(Boolean) iblockdata.get(BlockLeaves.PERSISTENT) && iblockdata.get(BlockLeaves.DISTANCE) == 7) { + // CraftBukkit start + LeavesDecayEvent event = new LeavesDecayEvent(worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ())); + worldserver.getServer().getPluginManager().callEvent(event); +@@ -35,7 +35,7 @@ public class BlockLeaves extends Block { + return; + } + // CraftBukkit end +- c(iblockdata, (World) worldserver, blockposition); ++ c(iblockdata, worldserver, blockposition); + worldserver.a(blockposition, false); + } + +@@ -55,7 +55,7 @@ public class BlockLeaves extends Block { + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { + int i = h(iblockdata1) + 1; + +- if (i != 1 || (Integer) iblockdata.get(BlockLeaves.DISTANCE) != i) { ++ if (i != 1 || iblockdata.get(BlockLeaves.DISTANCE) != i) { + generatoraccess.getBlockTickList().a(blockposition, this, 1); + } + +@@ -71,18 +71,18 @@ public class BlockLeaves extends Block { + for (int k = 0; k < j; ++k) { + EnumDirection enumdirection = aenumdirection[k]; + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); ++ blockposition_mutableblockposition.a(blockposition, enumdirection); + i = Math.min(i, h(generatoraccess.getType(blockposition_mutableblockposition)) + 1); + if (i == 1) { + break; + } + } + +- return (IBlockData) iblockdata.set(BlockLeaves.DISTANCE, i); ++ return iblockdata.set(BlockLeaves.DISTANCE, i); + } + + private static int h(IBlockData iblockdata) { +- return TagsBlock.LOGS.isTagged(iblockdata.getBlock()) ? 0 : (iblockdata.getBlock() instanceof BlockLeaves ? (Integer) iblockdata.get(BlockLeaves.DISTANCE) : 7); ++ return TagsBlock.LOGS.isTagged(iblockdata.getBlock()) ? 0 : (iblockdata.getBlock() instanceof BlockLeaves ? iblockdata.get(BlockLeaves.DISTANCE) : 7); + } + + @Override +@@ -92,6 +92,6 @@ public class BlockLeaves extends Block { + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return a((IBlockData) this.getBlockData().set(BlockLeaves.PERSISTENT, true), (GeneratorAccess) blockactioncontext.getWorld(), blockactioncontext.getClickPosition()); ++ return a(this.getBlockData().set(BlockLeaves.PERSISTENT, true), (GeneratorAccess) blockactioncontext.getWorld(), blockactioncontext.getClickPosition()); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockLectern.java b/src/main/java/net/minecraft/server/BlockLectern.java +index 7e5d3384b7fbb1be218bbb1259e9b5ec55ed69c0..b33d28fb9e8ef695bc199149ce3ee5c15269d57c 100644 +--- a/src/main/java/net/minecraft/server/BlockLectern.java ++++ b/src/main/java/net/minecraft/server/BlockLectern.java +@@ -20,7 +20,7 @@ public class BlockLectern extends BlockTileEntity { + + protected BlockLectern(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockLectern.a, EnumDirection.NORTH)).set(BlockLectern.b, false)).set(BlockLectern.c, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockLectern.a, EnumDirection.NORTH).set(BlockLectern.b, false).set(BlockLectern.c, false)); + } + + @Override +@@ -54,7 +54,7 @@ public class BlockLectern extends BlockTileEntity { + } + } + +- return (IBlockData) ((IBlockData) this.getBlockData().set(BlockLectern.a, blockactioncontext.f().opposite())).set(BlockLectern.c, flag); ++ return this.getBlockData().set(BlockLectern.a, blockactioncontext.f().opposite()).set(BlockLectern.c, flag); + } + + @Override +@@ -64,7 +64,7 @@ public class BlockLectern extends BlockTileEntity { + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- switch ((EnumDirection) iblockdata.get(BlockLectern.a)) { ++ switch (iblockdata.get(BlockLectern.a)) { + case NORTH: + return BlockLectern.j; + case SOUTH: +@@ -80,12 +80,12 @@ public class BlockLectern extends BlockTileEntity { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockLectern.a, enumblockrotation.a((EnumDirection) iblockdata.get(BlockLectern.a))); ++ return iblockdata.set(BlockLectern.a, enumblockrotation.a(iblockdata.get(BlockLectern.a))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockLectern.a))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockLectern.a))); + } + + @Override +@@ -119,13 +119,13 @@ public class BlockLectern extends BlockTileEntity { + + tileentitylectern.setBook(itemstack.cloneAndSubtract(1)); + setHasBook(world, blockposition, iblockdata, true); +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOOK_PUT, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, blockposition, SoundEffects.ITEM_BOOK_PUT, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + + } + + public static void setHasBook(World world, BlockPosition blockposition, IBlockData iblockdata, boolean flag) { +- world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) iblockdata.set(BlockLectern.b, false)).set(BlockLectern.c, flag), 3); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockLectern.b, false).set(BlockLectern.c, flag), 3); + b(world, blockposition, iblockdata); + } + +@@ -136,7 +136,7 @@ public class BlockLectern extends BlockTileEntity { + } + + private static void b(World world, BlockPosition blockposition, IBlockData iblockdata, boolean flag) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockLectern.b, flag), 3); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockLectern.b, flag), 3); + b(world, blockposition, iblockdata); + } + +@@ -152,11 +152,11 @@ public class BlockLectern extends BlockTileEntity { + @Override + public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!iblockdata.a(iblockdata1.getBlock())) { +- if ((Boolean) iblockdata.get(BlockLectern.c)) { ++ if (iblockdata.get(BlockLectern.c)) { + this.d(iblockdata, world, blockposition); + } + +- if ((Boolean) iblockdata.get(BlockLectern.b)) { ++ if (iblockdata.get(BlockLectern.b)) { + world.applyPhysics(blockposition.down(), this); + } + +@@ -169,12 +169,12 @@ public class BlockLectern extends BlockTileEntity { + + if (tileentity instanceof TileEntityLectern) { + TileEntityLectern tileentitylectern = (TileEntityLectern) tileentity; +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockLectern.a); ++ EnumDirection enumdirection = iblockdata.get(BlockLectern.a); + ItemStack itemstack = tileentitylectern.getBook().cloneItemStack(); + if (itemstack.isEmpty()) return; // CraftBukkit - SPIGOT-5500 + float f = 0.25F * (float) enumdirection.getAdjacentX(); + float f1 = 0.25F * (float) enumdirection.getAdjacentZ(); +- EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + 0.5D + (double) f, (double) (blockposition.getY() + 1), (double) blockposition.getZ() + 0.5D + (double) f1, itemstack); ++ EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + 0.5D + (double) f, blockposition.getY() + 1, (double) blockposition.getZ() + 0.5D + (double) f1, itemstack); + + entityitem.defaultPickupDelay(); + world.addEntity(entityitem); +@@ -190,12 +190,12 @@ public class BlockLectern extends BlockTileEntity { + + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Boolean) iblockdata.get(BlockLectern.b) ? 15 : 0; ++ return iblockdata.get(BlockLectern.b) ? 15 : 0; + } + + @Override + public int b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return enumdirection == EnumDirection.UP && (Boolean) iblockdata.get(BlockLectern.b) ? 15 : 0; ++ return enumdirection == EnumDirection.UP && iblockdata.get(BlockLectern.b) ? 15 : 0; + } + + @Override +@@ -205,7 +205,7 @@ public class BlockLectern extends BlockTileEntity { + + @Override + public int a(IBlockData iblockdata, World world, BlockPosition blockposition) { +- if ((Boolean) iblockdata.get(BlockLectern.c)) { ++ if (iblockdata.get(BlockLectern.c)) { + TileEntity tileentity = world.getTileEntity(blockposition); + + if (tileentity instanceof TileEntityLectern) { +@@ -218,7 +218,7 @@ public class BlockLectern extends BlockTileEntity { + + @Override + public EnumInteractionResult interact(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) { +- if ((Boolean) iblockdata.get(BlockLectern.c)) { ++ if (iblockdata.get(BlockLectern.c)) { + if (!world.isClientSide) { + this.a(world, blockposition, entityhuman); + } +@@ -227,7 +227,7 @@ public class BlockLectern extends BlockTileEntity { + } else { + ItemStack itemstack = entityhuman.b(enumhand); + +- return !itemstack.isEmpty() && !itemstack.getItem().a((Tag) TagsItem.LECTERN_BOOKS) ? EnumInteractionResult.CONSUME : EnumInteractionResult.PASS; ++ return !itemstack.isEmpty() && !itemstack.getItem().a(TagsItem.LECTERN_BOOKS) ? EnumInteractionResult.CONSUME : EnumInteractionResult.PASS; + } + } + +diff --git a/src/main/java/net/minecraft/server/BlockLever.java b/src/main/java/net/minecraft/server/BlockLever.java +index f1e38e4f1d95b07f45f4201b6093adf0ed7e0b55..28f1dc18bf062024972503d5da8d56745dd7f01f 100644 +--- a/src/main/java/net/minecraft/server/BlockLever.java ++++ b/src/main/java/net/minecraft/server/BlockLever.java +@@ -16,14 +16,14 @@ public class BlockLever extends BlockAttachable { + + protected BlockLever(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockLever.FACING, EnumDirection.NORTH)).set(BlockLever.POWERED, false)).set(BlockLever.FACE, BlockPropertyAttachPosition.WALL)); ++ this.j(this.blockStateList.getBlockData().set(BlockFacingHorizontal.FACING, EnumDirection.NORTH).set(BlockLever.POWERED, false).set(BlockAttachable.FACE, BlockPropertyAttachPosition.WALL)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- switch ((BlockPropertyAttachPosition) iblockdata.get(BlockLever.FACE)) { ++ switch (iblockdata.get(BlockAttachable.FACE)) { + case FLOOR: +- switch (((EnumDirection) iblockdata.get(BlockLever.FACING)).n()) { ++ switch (iblockdata.get(BlockFacingHorizontal.FACING).n()) { + case X: + return BlockLever.g; + case Z: +@@ -31,7 +31,7 @@ public class BlockLever extends BlockAttachable { + return BlockLever.f; + } + case WALL: +- switch ((EnumDirection) iblockdata.get(BlockLever.FACING)) { ++ switch (iblockdata.get(BlockFacingHorizontal.FACING)) { + case EAST: + return BlockLever.e; + case WEST: +@@ -44,7 +44,7 @@ public class BlockLever extends BlockAttachable { + } + case CEILING: + default: +- switch (((EnumDirection) iblockdata.get(BlockLever.FACING)).n()) { ++ switch (iblockdata.get(BlockFacingHorizontal.FACING).n()) { + case X: + return BlockLever.i; + case Z: +@@ -59,8 +59,8 @@ public class BlockLever extends BlockAttachable { + IBlockData iblockdata1; + + if (world.isClientSide) { +- iblockdata1 = (IBlockData) iblockdata.a((IBlockState) BlockLever.POWERED); +- if ((Boolean) iblockdata1.get(BlockLever.POWERED)) { ++ iblockdata1 = iblockdata.a((IBlockState) BlockLever.POWERED); ++ if (iblockdata1.get(BlockLever.POWERED)) { + a(iblockdata1, world, blockposition, 1.0F); + } + +@@ -81,22 +81,22 @@ public class BlockLever extends BlockAttachable { + // CraftBukkit end + + iblockdata1 = this.d(iblockdata, world, blockposition); +- float f = (Boolean) iblockdata1.get(BlockLever.POWERED) ? 0.6F : 0.5F; ++ float f = iblockdata1.get(BlockLever.POWERED) ? 0.6F : 0.5F; + +- world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_LEVER_CLICK, SoundCategory.BLOCKS, 0.3F, f); ++ world.playSound(null, blockposition, SoundEffects.BLOCK_LEVER_CLICK, SoundCategory.BLOCKS, 0.3F, f); + return EnumInteractionResult.CONSUME; + } + } + + public IBlockData d(IBlockData iblockdata, World world, BlockPosition blockposition) { +- iblockdata = (IBlockData) iblockdata.a((IBlockState) BlockLever.POWERED); ++ iblockdata = iblockdata.a((IBlockState) BlockLever.POWERED); + world.setTypeAndData(blockposition, iblockdata, 3); + this.e(iblockdata, world, blockposition); + return iblockdata; + } + + private static void a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, float f) { +- EnumDirection enumdirection = ((EnumDirection) iblockdata.get(BlockLever.FACING)).opposite(); ++ EnumDirection enumdirection = iblockdata.get(BlockFacingHorizontal.FACING).opposite(); + EnumDirection enumdirection1 = h(iblockdata).opposite(); + double d0 = (double) blockposition.getX() + 0.5D + 0.1D * (double) enumdirection.getAdjacentX() + 0.2D * (double) enumdirection1.getAdjacentX(); + double d1 = (double) blockposition.getY() + 0.5D + 0.1D * (double) enumdirection.getAdjacentY() + 0.2D * (double) enumdirection1.getAdjacentY(); +@@ -108,7 +108,7 @@ public class BlockLever extends BlockAttachable { + @Override + public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!flag && !iblockdata.a(iblockdata1.getBlock())) { +- if ((Boolean) iblockdata.get(BlockLever.POWERED)) { ++ if (iblockdata.get(BlockLever.POWERED)) { + this.e(iblockdata, world, blockposition); + } + +@@ -118,12 +118,12 @@ public class BlockLever extends BlockAttachable { + + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Boolean) iblockdata.get(BlockLever.POWERED) ? 15 : 0; ++ return iblockdata.get(BlockLever.POWERED) ? 15 : 0; + } + + @Override + public int b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Boolean) iblockdata.get(BlockLever.POWERED) && h(iblockdata) == enumdirection ? 15 : 0; ++ return iblockdata.get(BlockLever.POWERED) && h(iblockdata) == enumdirection ? 15 : 0; + } + + @Override +@@ -138,6 +138,6 @@ public class BlockLever extends BlockAttachable { + + @Override + protected void a(BlockStateList.a blockstatelist_a) { +- blockstatelist_a.a(BlockLever.FACE, BlockLever.FACING, BlockLever.POWERED); ++ blockstatelist_a.a(BlockAttachable.FACE, BlockFacingHorizontal.FACING, BlockLever.POWERED); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockMagma.java b/src/main/java/net/minecraft/server/BlockMagma.java +index 63b69c62170c8bb12250adb3a274ad754a78301c..b2958824db3602cae0cb8ab86037a4b4507b0779 100644 +--- a/src/main/java/net/minecraft/server/BlockMagma.java ++++ b/src/main/java/net/minecraft/server/BlockMagma.java +@@ -37,8 +37,8 @@ public class BlockMagma extends Block { + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + BlockPosition blockposition1 = blockposition.up(); + +- if (worldserver.getFluid(blockposition).a((Tag) TagsFluid.WATER)) { +- worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (worldserver.random.nextFloat() - worldserver.random.nextFloat()) * 0.8F); ++ if (worldserver.getFluid(blockposition).a(TagsFluid.WATER)) { ++ worldserver.playSound(null, blockposition, SoundEffects.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (worldserver.random.nextFloat() - worldserver.random.nextFloat()) * 0.8F); + worldserver.a(Particles.LARGE_SMOKE, (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.25D, (double) blockposition1.getZ() + 0.5D, 8, 0.5D, 0.25D, 0.5D, 0.0D); + } + +diff --git a/src/main/java/net/minecraft/server/BlockMinecartDetector.java b/src/main/java/net/minecraft/server/BlockMinecartDetector.java +index f8a91f5e3cb75ac2fbee6f2cb951ade66006a93e..277a5df3de8d49da28994d2535ade538aa9638a0 100644 +--- a/src/main/java/net/minecraft/server/BlockMinecartDetector.java ++++ b/src/main/java/net/minecraft/server/BlockMinecartDetector.java +@@ -15,7 +15,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { + + public BlockMinecartDetector(BlockBase.Info blockbase_info) { + super(true, blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockMinecartDetector.POWERED, false)).set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH)); ++ this.j(this.blockStateList.getBlockData().set(BlockMinecartDetector.POWERED, false).set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH)); + } + + @Override +@@ -34,14 +34,14 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if ((Boolean) iblockdata.get(BlockMinecartDetector.POWERED)) { +- this.a((World) worldserver, blockposition, iblockdata); ++ if (iblockdata.get(BlockMinecartDetector.POWERED)) { ++ this.a(worldserver, blockposition, iblockdata); + } + } + + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Boolean) iblockdata.get(BlockMinecartDetector.POWERED) ? 15 : 0; ++ return iblockdata.get(BlockMinecartDetector.POWERED) ? 15 : 0; + } + + @Override +@@ -51,9 +51,9 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { + + private void a(World world, BlockPosition blockposition, IBlockData iblockdata) { + if (iblockdata.getBlock() != this) { return; } // Paper - not our block, don't do anything +- boolean flag = (Boolean) iblockdata.get(BlockMinecartDetector.POWERED); ++ boolean flag = iblockdata.get(BlockMinecartDetector.POWERED); + boolean flag1 = false; +- List list = this.a(world, blockposition, EntityMinecartAbstract.class, (Predicate) null); ++ List list = this.a(world, blockposition, EntityMinecartAbstract.class, null); + + if (!list.isEmpty()) { + flag1 = true; +@@ -72,7 +72,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { + // CraftBukkit end + + if (flag1 && !flag) { +- iblockdata1 = (IBlockData) iblockdata.set(BlockMinecartDetector.POWERED, true); ++ iblockdata1 = iblockdata.set(BlockMinecartDetector.POWERED, true); + world.setTypeAndData(blockposition, iblockdata1, 3); + this.b(world, blockposition, iblockdata1, true); + world.applyPhysics(blockposition, this); +@@ -81,7 +81,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { + } + + if (!flag1 && flag) { +- iblockdata1 = (IBlockData) iblockdata.set(BlockMinecartDetector.POWERED, false); ++ iblockdata1 = iblockdata.set(BlockMinecartDetector.POWERED, false); + world.setTypeAndData(blockposition, iblockdata1, 3); + this.b(world, blockposition, iblockdata1, false); + world.applyPhysics(blockposition, this); +@@ -129,11 +129,11 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { + + @Override + public int a(IBlockData iblockdata, World world, BlockPosition blockposition) { +- if ((Boolean) iblockdata.get(BlockMinecartDetector.POWERED)) { +- List list = this.a(world, blockposition, EntityMinecartCommandBlock.class, (Predicate) null); ++ if (iblockdata.get(BlockMinecartDetector.POWERED)) { ++ List list = this.a(world, blockposition, EntityMinecartCommandBlock.class, null); + + if (!list.isEmpty()) { +- return ((EntityMinecartCommandBlock) list.get(0)).getCommandBlock().i(); ++ return list.get(0).getCommandBlock().i(); + } + + List list1 = this.a(world, blockposition, EntityMinecartAbstract.class, IEntitySelector.d); +@@ -153,76 +153,76 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { + private AxisAlignedBB a(BlockPosition blockposition) { + double d0 = 0.2D; + +- return new AxisAlignedBB((double) blockposition.getX() + 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.2D, (double) (blockposition.getX() + 1) - 0.2D, (double) (blockposition.getY() + 1) - 0.2D, (double) (blockposition.getZ() + 1) - 0.2D); ++ return new AxisAlignedBB((double) blockposition.getX() + 0.2D, blockposition.getY(), (double) blockposition.getZ() + 0.2D, (double) (blockposition.getX() + 1) - 0.2D, (double) (blockposition.getY() + 1) - 0.2D, (double) (blockposition.getZ() + 1) - 0.2D); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { + switch (enumblockrotation) { + case CLOCKWISE_180: +- switch ((BlockPropertyTrackPosition) iblockdata.get(BlockMinecartDetector.SHAPE)) { ++ switch (iblockdata.get(BlockMinecartDetector.SHAPE)) { + case ASCENDING_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); + case ASCENDING_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); + case ASCENDING_NORTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); + case ASCENDING_SOUTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + } + case COUNTERCLOCKWISE_90: +- switch ((BlockPropertyTrackPosition) iblockdata.get(BlockMinecartDetector.SHAPE)) { ++ switch (iblockdata.get(BlockMinecartDetector.SHAPE)) { + case ASCENDING_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); + case ASCENDING_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); + case ASCENDING_NORTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); + case ASCENDING_SOUTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + case NORTH_SOUTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.EAST_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.EAST_WEST); + case EAST_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH); + } + case CLOCKWISE_90: +- switch ((BlockPropertyTrackPosition) iblockdata.get(BlockMinecartDetector.SHAPE)) { ++ switch (iblockdata.get(BlockMinecartDetector.SHAPE)) { + case ASCENDING_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); + case ASCENDING_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); + case ASCENDING_NORTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); + case ASCENDING_SOUTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + case NORTH_SOUTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.EAST_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.EAST_WEST); + case EAST_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH); + } + default: + return iblockdata; +@@ -231,44 +231,44 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- BlockPropertyTrackPosition blockpropertytrackposition = (BlockPropertyTrackPosition) iblockdata.get(BlockMinecartDetector.SHAPE); ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.get(BlockMinecartDetector.SHAPE); + + switch (enumblockmirror) { + case LEFT_RIGHT: + switch (blockpropertytrackposition) { + case ASCENDING_NORTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); + case ASCENDING_SOUTH: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + default: + return super.a(iblockdata, enumblockmirror); + } + case FRONT_BACK: + switch (blockpropertytrackposition) { + case ASCENDING_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); + case ASCENDING_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); + case ASCENDING_NORTH: + case ASCENDING_SOUTH: + default: + break; + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockMinecartDetector.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + } + } + +diff --git a/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java b/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java +index a540b3e226b985f22daf1a69bf4e8cb578ab1476..d6b933c31a6991fcccfb134806c928836dc33ca6 100644 +--- a/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java ++++ b/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java +@@ -11,7 +11,7 @@ public abstract class BlockMinecartTrackAbstract extends Block { + } + + public static boolean g(IBlockData iblockdata) { +- return iblockdata.a((Tag) TagsBlock.RAILS) && iblockdata.getBlock() instanceof BlockMinecartTrackAbstract; ++ return iblockdata.a(TagsBlock.RAILS) && iblockdata.getBlock() instanceof BlockMinecartTrackAbstract; + } + + protected BlockMinecartTrackAbstract(boolean flag, BlockBase.Info blockbase_info) { +@@ -25,14 +25,14 @@ public abstract class BlockMinecartTrackAbstract extends Block { + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.a((Block) this) ? (BlockPropertyTrackPosition) iblockdata.get(this.d()) : null; ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.a(this) ? iblockdata.get(this.d()) : null; + + return blockpropertytrackposition != null && blockpropertytrackposition.c() ? BlockMinecartTrackAbstract.b : BlockMinecartTrackAbstract.a; + } + + @Override + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { +- return c((IBlockAccess) iworldreader, blockposition.down()); ++ return c(iworldreader, blockposition.down()); + } + + @Override +@@ -55,7 +55,7 @@ public abstract class BlockMinecartTrackAbstract extends Block { + @Override + public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) { + if (!world.isClientSide) { +- BlockPropertyTrackPosition blockpropertytrackposition = (BlockPropertyTrackPosition) iblockdata.get(this.d()); ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.get(this.d()); + + if (a(blockposition, world, blockpropertytrackposition) && !world.isEmpty(blockposition)) { + if (!flag) { +@@ -95,7 +95,7 @@ public abstract class BlockMinecartTrackAbstract extends Block { + if (world.isClientSide) { + return iblockdata; + } else { +- BlockPropertyTrackPosition blockpropertytrackposition = (BlockPropertyTrackPosition) iblockdata.get(this.d()); ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.get(this.d()); + + return (new MinecartTrackLogic(world, blockposition, iblockdata)).a(world.isBlockIndirectlyPowered(blockposition), flag, blockpropertytrackposition).c(); + } +@@ -110,7 +110,7 @@ public abstract class BlockMinecartTrackAbstract extends Block { + public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!flag) { + super.remove(iblockdata, world, blockposition, iblockdata1, flag); +- if (((BlockPropertyTrackPosition) iblockdata.get(this.d())).c()) { ++ if (iblockdata.get(this.d()).c()) { + world.applyPhysics(blockposition.up(), this); + } + +@@ -128,7 +128,7 @@ public abstract class BlockMinecartTrackAbstract extends Block { + EnumDirection enumdirection = blockactioncontext.f(); + boolean flag = enumdirection == EnumDirection.EAST || enumdirection == EnumDirection.WEST; + +- return (IBlockData) iblockdata.set(this.d(), flag ? BlockPropertyTrackPosition.EAST_WEST : BlockPropertyTrackPosition.NORTH_SOUTH); ++ return iblockdata.set(this.d(), flag ? BlockPropertyTrackPosition.EAST_WEST : BlockPropertyTrackPosition.NORTH_SOUTH); + } + + public abstract IBlockState d(); +diff --git a/src/main/java/net/minecraft/server/BlockMonsterEggs.java b/src/main/java/net/minecraft/server/BlockMonsterEggs.java +index a8d48e3e9be1ed0a7bc61d73795a8c8ae5dfacfc..290e7affeefa9ce32bd06f2fe318eb7cc3f6d9d4 100644 +--- a/src/main/java/net/minecraft/server/BlockMonsterEggs.java ++++ b/src/main/java/net/minecraft/server/BlockMonsterEggs.java +@@ -25,9 +25,9 @@ public class BlockMonsterEggs extends Block { + } + + private void a(World world, BlockPosition blockposition) { +- EntitySilverfish entitysilverfish = (EntitySilverfish) EntityTypes.SILVERFISH.a(world); ++ EntitySilverfish entitysilverfish = EntityTypes.SILVERFISH.a(world); + +- entitysilverfish.setPositionRotation((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F); ++ entitysilverfish.setPositionRotation((double) blockposition.getX() + 0.5D, blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F); + world.addEntity(entitysilverfish, SpawnReason.SILVERFISH_BLOCK); // CraftBukkit - add SpawnReason + entitysilverfish.doSpawnEffect(); + } +@@ -50,6 +50,6 @@ public class BlockMonsterEggs extends Block { + } + + public static IBlockData c(Block block) { +- return ((Block) BlockMonsterEggs.b.get(block)).getBlockData(); ++ return BlockMonsterEggs.b.get(block).getBlockData(); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java +index 45c721e59c8d2639b154c948b9f6a540a88da83e..dd669ed57163bcce72c2d27214f6a6c036a9d3e2 100644 +--- a/src/main/java/net/minecraft/server/BlockMushroom.java ++++ b/src/main/java/net/minecraft/server/BlockMushroom.java +@@ -29,7 +29,7 @@ public class BlockMushroom extends BlockPlant implements IBlockFragilePlantEleme + while (iterator.hasNext()) { + BlockPosition blockposition1 = (BlockPosition) iterator.next(); + +- if (worldserver.getType(blockposition1).a((Block) this)) { ++ if (worldserver.getType(blockposition1).a(this)) { + --i; + if (i <= 0) { + return; +@@ -64,7 +64,7 @@ public class BlockMushroom extends BlockPlant implements IBlockFragilePlantEleme + BlockPosition blockposition1 = blockposition.down(); + IBlockData iblockdata1 = iworldreader.getType(blockposition1); + +- return !iblockdata1.a(Blocks.MYCELIUM) && !iblockdata1.a(Blocks.PODZOL) ? iworldreader.getLightLevel(blockposition, 0) < 13 && this.c(iblockdata1, (IBlockAccess) iworldreader, blockposition1) : true; ++ return !iblockdata1.a(Blocks.MYCELIUM) && !iblockdata1.a(Blocks.PODZOL) ? iworldreader.getLightLevel(blockposition, 0) < 13 && this.c(iblockdata1, iworldreader, blockposition1) : true; + } + + public boolean a(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, Random random) { +diff --git a/src/main/java/net/minecraft/server/BlockNetherWart.java b/src/main/java/net/minecraft/server/BlockNetherWart.java +index 51dd46cff2852aee8ae126f636c2cbce36da7a77..64ca70e19787c65583e7be24e3213c614ffdb926 100644 +--- a/src/main/java/net/minecraft/server/BlockNetherWart.java ++++ b/src/main/java/net/minecraft/server/BlockNetherWart.java +@@ -9,12 +9,12 @@ public class BlockNetherWart extends BlockPlant { + + protected BlockNetherWart(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockNetherWart.AGE, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockNetherWart.AGE, 0)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return BlockNetherWart.b[(Integer) iblockdata.get(BlockNetherWart.AGE)]; ++ return BlockNetherWart.b[iblockdata.get(BlockNetherWart.AGE)]; + } + + @Override +@@ -24,15 +24,15 @@ public class BlockNetherWart extends BlockPlant { + + @Override + public boolean isTicking(IBlockData iblockdata) { +- return (Integer) iblockdata.get(BlockNetherWart.AGE) < 3; ++ return iblockdata.get(BlockNetherWart.AGE) < 3; + } + + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- int i = (Integer) iblockdata.get(BlockNetherWart.AGE); ++ int i = iblockdata.get(BlockNetherWart.AGE); + + if (i < 3 && random.nextInt(Math.max(1, (int) (100.0F / worldserver.spigotConfig.wartModifier) * 10)) == 0) { // Spigot +- iblockdata = (IBlockData) iblockdata.set(BlockNetherWart.AGE, i + 1); ++ iblockdata = iblockdata.set(BlockNetherWart.AGE, i + 1); + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata, 2); // CraftBukkit + } + +diff --git a/src/main/java/net/minecraft/server/BlockNote.java b/src/main/java/net/minecraft/server/BlockNote.java +index df69d00d3a38417e53f433cd1eb1f6cf3ec9b55b..ac501d0a2f6ab5ee6b56404ea1aee9482d4c187b 100644 +--- a/src/main/java/net/minecraft/server/BlockNote.java ++++ b/src/main/java/net/minecraft/server/BlockNote.java +@@ -8,30 +8,30 @@ public class BlockNote extends Block { + + public BlockNote(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockNote.INSTRUMENT, BlockPropertyInstrument.HARP)).set(BlockNote.NOTE, 0)).set(BlockNote.POWERED, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockNote.INSTRUMENT, BlockPropertyInstrument.HARP).set(BlockNote.NOTE, 0).set(BlockNote.POWERED, false)); + } + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return (IBlockData) this.getBlockData().set(BlockNote.INSTRUMENT, BlockPropertyInstrument.a(blockactioncontext.getWorld().getType(blockactioncontext.getClickPosition().down()))); ++ return this.getBlockData().set(BlockNote.INSTRUMENT, BlockPropertyInstrument.a(blockactioncontext.getWorld().getType(blockactioncontext.getClickPosition().down()))); + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- return enumdirection == EnumDirection.DOWN ? (IBlockData) iblockdata.set(BlockNote.INSTRUMENT, BlockPropertyInstrument.a(iblockdata1)) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); ++ return enumdirection == EnumDirection.DOWN ? iblockdata.set(BlockNote.INSTRUMENT, BlockPropertyInstrument.a(iblockdata1)) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); + } + + @Override + public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) { + boolean flag1 = world.isBlockIndirectlyPowered(blockposition); + +- if (flag1 != (Boolean) iblockdata.get(BlockNote.POWERED)) { ++ if (flag1 != iblockdata.get(BlockNote.POWERED)) { + if (flag1) { + this.play(world, blockposition, iblockdata); // CraftBukkit + iblockdata = world.getType(blockposition); // CraftBukkit - SPIGOT-5617: update in case changed in event + } + +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockNote.POWERED, flag1), 3); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockNote.POWERED, flag1), 3); + } + + } +@@ -53,7 +53,7 @@ public class BlockNote extends Block { + if (world.isClientSide) { + return EnumInteractionResult.SUCCESS; + } else { +- iblockdata = (IBlockData) iblockdata.a((IBlockState) BlockNote.NOTE); ++ iblockdata = iblockdata.a((IBlockState) BlockNote.NOTE); + world.setTypeAndData(blockposition, iblockdata, 3); + this.play(world, blockposition, iblockdata); // CraftBukkit + entityhuman.a(StatisticList.TUNE_NOTEBLOCK); +@@ -71,10 +71,10 @@ public class BlockNote extends Block { + + @Override + public boolean a(IBlockData iblockdata, World world, BlockPosition blockposition, int i, int j) { +- int k = (Integer) iblockdata.get(BlockNote.NOTE); ++ int k = iblockdata.get(BlockNote.NOTE); + float f = (float) Math.pow(2.0D, (double) (k - 12) / 12.0D); + +- world.playSound((EntityHuman) null, blockposition, ((BlockPropertyInstrument) iblockdata.get(BlockNote.INSTRUMENT)).b(), SoundCategory.RECORDS, 3.0F, f); ++ world.playSound(null, blockposition, iblockdata.get(BlockNote.INSTRUMENT).b(), SoundCategory.RECORDS, 3.0F, f); + world.addParticle(Particles.NOTE, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 1.2D, (double) blockposition.getZ() + 0.5D, (double) k / 24.0D, 0.0D, 0.0D); + return true; + } +diff --git a/src/main/java/net/minecraft/server/BlockObserver.java b/src/main/java/net/minecraft/server/BlockObserver.java +index 595851324fc06ebb5b590b67b53ba7437665a794..1e6849dbb4d490ba437a0e7335c2cdaca40ef147 100644 +--- a/src/main/java/net/minecraft/server/BlockObserver.java ++++ b/src/main/java/net/minecraft/server/BlockObserver.java +@@ -10,49 +10,49 @@ public class BlockObserver extends BlockDirectional { + + public BlockObserver(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockObserver.FACING, EnumDirection.SOUTH)).set(BlockObserver.b, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockDirectional.FACING, EnumDirection.SOUTH).set(BlockObserver.b, false)); + } + + @Override + protected void a(BlockStateList.a blockstatelist_a) { +- blockstatelist_a.a(BlockObserver.FACING, BlockObserver.b); ++ blockstatelist_a.a(BlockDirectional.FACING, BlockObserver.b); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockObserver.FACING, enumblockrotation.a((EnumDirection) iblockdata.get(BlockObserver.FACING))); ++ return iblockdata.set(BlockDirectional.FACING, enumblockrotation.a(iblockdata.get(BlockDirectional.FACING))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockObserver.FACING))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockDirectional.FACING))); + } + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if ((Boolean) iblockdata.get(BlockObserver.b)) { ++ if (iblockdata.get(BlockObserver.b)) { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, false), 2); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockObserver.b, false), 2); + } else { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 0, 15).getNewCurrent() != 15) { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, true), 2); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockObserver.b, true), 2); + worldserver.getBlockTickList().a(blockposition, this, 2); + } + +- this.a((World) worldserver, blockposition, iblockdata); ++ this.a(worldserver, blockposition, iblockdata); + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- if (iblockdata.get(BlockObserver.FACING) == enumdirection && !(Boolean) iblockdata.get(BlockObserver.b)) { ++ if (iblockdata.get(BlockDirectional.FACING) == enumdirection && !(Boolean) iblockdata.get(BlockObserver.b)) { + this.a(generatoraccess, blockposition); + } + +@@ -67,11 +67,11 @@ public class BlockObserver extends BlockDirectional { + } + + protected void a(World world, BlockPosition blockposition, IBlockData iblockdata) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockObserver.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockDirectional.FACING); + BlockPosition blockposition1 = blockposition.shift(enumdirection.opposite()); + +- world.a(blockposition1, (Block) this, blockposition); +- world.a(blockposition1, (Block) this, enumdirection); ++ world.a(blockposition1, this, blockposition); ++ world.a(blockposition1, this, enumdirection); + } + + @Override +@@ -86,14 +86,14 @@ public class BlockObserver extends BlockDirectional { + + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Boolean) iblockdata.get(BlockObserver.b) && iblockdata.get(BlockObserver.FACING) == enumdirection ? 15 : 0; ++ return iblockdata.get(BlockObserver.b) && iblockdata.get(BlockDirectional.FACING) == enumdirection ? 15 : 0; + } + + @Override + public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!iblockdata.a(iblockdata1.getBlock())) { +- if (!world.s_() && (Boolean) iblockdata.get(BlockObserver.b) && !world.getBlockTickList().a(blockposition, this)) { +- IBlockData iblockdata2 = (IBlockData) iblockdata.set(BlockObserver.b, false); ++ if (!world.s_() && iblockdata.get(BlockObserver.b) && !world.getBlockTickList().a(blockposition, this)) { ++ IBlockData iblockdata2 = iblockdata.set(BlockObserver.b, false); + + world.setTypeAndData(blockposition, iblockdata2, 18); + this.a(world, blockposition, iblockdata2); +@@ -105,8 +105,8 @@ public class BlockObserver extends BlockDirectional { + @Override + public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!iblockdata.a(iblockdata1.getBlock())) { +- if (!world.isClientSide && (Boolean) iblockdata.get(BlockObserver.b) && world.getBlockTickList().a(blockposition, this)) { +- this.a(world, blockposition, (IBlockData) iblockdata.set(BlockObserver.b, false)); ++ if (!world.isClientSide && iblockdata.get(BlockObserver.b) && world.getBlockTickList().a(blockposition, this)) { ++ this.a(world, blockposition, iblockdata.set(BlockObserver.b, false)); + } + + } +@@ -114,6 +114,6 @@ public class BlockObserver extends BlockDirectional { + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return (IBlockData) this.getBlockData().set(BlockObserver.FACING, blockactioncontext.d().opposite().opposite()); ++ return this.getBlockData().set(BlockDirectional.FACING, blockactioncontext.d().opposite().opposite()); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java +index c03d519d937bca13e9c4750de3a56603c44e72df..1619c5c12562ddff6ceb4adbf6afb56df132c1f2 100644 +--- a/src/main/java/net/minecraft/server/BlockPiston.java ++++ b/src/main/java/net/minecraft/server/BlockPiston.java +@@ -27,14 +27,14 @@ public class BlockPiston extends BlockDirectional { + + public BlockPiston(boolean flag, BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockPiston.FACING, EnumDirection.NORTH)).set(BlockPiston.EXTENDED, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockDirectional.FACING, EnumDirection.NORTH).set(BlockPiston.EXTENDED, false)); + this.sticky = flag; + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- if ((Boolean) iblockdata.get(BlockPiston.EXTENDED)) { +- switch ((EnumDirection) iblockdata.get(BlockPiston.FACING)) { ++ if (iblockdata.get(BlockPiston.EXTENDED)) { ++ switch (iblockdata.get(BlockDirectional.FACING)) { + case DOWN: + return BlockPiston.h; + case UP: +@@ -82,23 +82,23 @@ public class BlockPiston extends BlockDirectional { + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return (IBlockData) ((IBlockData) this.getBlockData().set(BlockPiston.FACING, blockactioncontext.d().opposite())).set(BlockPiston.EXTENDED, false); ++ return this.getBlockData().set(BlockDirectional.FACING, blockactioncontext.d().opposite()).set(BlockPiston.EXTENDED, false); + } + + private void a(World world, BlockPosition blockposition, IBlockData iblockdata) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockPiston.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockDirectional.FACING); + boolean flag = this.a(world, blockposition, enumdirection); + + if (flag && !(Boolean) iblockdata.get(BlockPiston.EXTENDED)) { + if ((new PistonExtendsChecker(world, blockposition, enumdirection, true)).a()) { + world.playBlockAction(blockposition, this, 0, enumdirection.c()); + } +- } else if (!flag && (Boolean) iblockdata.get(BlockPiston.EXTENDED)) { ++ } else if (!flag && iblockdata.get(BlockPiston.EXTENDED)) { + BlockPosition blockposition1 = blockposition.shift(enumdirection, 2); + IBlockData iblockdata1 = world.getType(blockposition1); + byte b0 = 1; + +- if (iblockdata1.a(Blocks.MOVING_PISTON) && iblockdata1.get(BlockPiston.FACING) == enumdirection) { ++ if (iblockdata1.a(Blocks.MOVING_PISTON) && iblockdata1.get(BlockDirectional.FACING) == enumdirection) { + TileEntity tileentity = world.getTileEntity(blockposition1); + + if (tileentity instanceof TileEntityPiston) { +@@ -113,7 +113,7 @@ public class BlockPiston extends BlockDirectional { + // CraftBukkit start + //if (!this.sticky) { // Paper - Prevents empty sticky pistons from firing retract - history behind is odd + org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); +- BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.of(), CraftBlock.notchToBlockFace(enumdirection)); ++ BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.of(), CraftBlock.notchToBlockFace(enumdirection)); + world.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { +@@ -162,7 +162,7 @@ public class BlockPiston extends BlockDirectional { + + @Override + public boolean a(IBlockData iblockdata, World world, BlockPosition blockposition, int i, int j) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockPiston.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockDirectional.FACING); + // Paper start - prevent retracting when we're facing the wrong way (we were replaced before retraction could occur) + EnumDirection directionQueuedAs = EnumDirection.fromType1(j & 7); // Paper - copied from below + if (!com.destroystokyo.paper.PaperConfig.allowBlockPermanentBreakingExploits && enumdirection != directionQueuedAs) { +@@ -174,7 +174,7 @@ public class BlockPiston extends BlockDirectional { + boolean flag = this.a(world, blockposition, enumdirection); + + if (flag && (i == 1 || i == 2)) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockPiston.EXTENDED, true), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockPiston.EXTENDED, true), 2); + return false; + } + +@@ -188,8 +188,8 @@ public class BlockPiston extends BlockDirectional { + return false; + } + +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockPiston.EXTENDED, true), 67); +- world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_PISTON_EXTEND, SoundCategory.BLOCKS, 0.5F, world.random.nextFloat() * 0.25F + 0.6F); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockPiston.EXTENDED, true), 67); ++ world.playSound(null, blockposition, SoundEffects.BLOCK_PISTON_EXTEND, SoundCategory.BLOCKS, 0.5F, world.random.nextFloat() * 0.25F + 0.6F); + } else if (i == 1 || i == 2) { + TileEntity tileentity = world.getTileEntity(blockposition.shift(enumdirection)); + +@@ -197,10 +197,10 @@ public class BlockPiston extends BlockDirectional { + ((TileEntityPiston) tileentity).l(); + } + +- IBlockData iblockdata1 = (IBlockData) ((IBlockData) Blocks.MOVING_PISTON.getBlockData().set(BlockPistonMoving.a, enumdirection)).set(BlockPistonMoving.b, this.sticky ? BlockPropertyPistonType.STICKY : BlockPropertyPistonType.DEFAULT); ++ IBlockData iblockdata1 = Blocks.MOVING_PISTON.getBlockData().set(BlockPistonMoving.a, enumdirection).set(BlockPistonMoving.b, this.sticky ? BlockPropertyPistonType.STICKY : BlockPropertyPistonType.DEFAULT); + + world.setTypeAndData(blockposition, iblockdata1, 20); +- world.setTileEntity(blockposition, BlockPistonMoving.a((IBlockData) this.getBlockData().set(BlockPiston.FACING, EnumDirection.fromType1(j & 7)), enumdirection, false, true)); // Paper - diff on change, j is facing direction - copy this above ++ world.setTileEntity(blockposition, BlockPistonMoving.a(this.getBlockData().set(BlockDirectional.FACING, EnumDirection.fromType1(j & 7)), enumdirection, false, true)); // Paper - diff on change, j is facing direction - copy this above + world.update(blockposition, iblockdata1.getBlock()); + iblockdata1.a(world, blockposition, 2); + if (this.sticky) { +@@ -239,7 +239,7 @@ public class BlockPiston extends BlockDirectional { + // Paper end - fix headless pistons breaking blocks + } + +- world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_PISTON_CONTRACT, SoundCategory.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F); ++ world.playSound(null, blockposition, SoundEffects.BLOCK_PISTON_CONTRACT, SoundCategory.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F); + } + + return true; +@@ -264,7 +264,7 @@ public class BlockPiston extends BlockDirectional { + case PUSH_ONLY: + return enumdirection == enumdirection1; + } +- } else if ((Boolean) iblockdata.get(BlockPiston.EXTENDED)) { ++ } else if (iblockdata.get(BlockPiston.EXTENDED)) { + return false; + } + +@@ -300,7 +300,7 @@ public class BlockPiston extends BlockDirectional { + List list1 = Lists.newArrayList(); + + for (int i = 0; i < list.size(); ++i) { +- BlockPosition blockposition2 = (BlockPosition) list.get(i); ++ BlockPosition blockposition2 = list.get(i); + IBlockData iblockdata = world.getType(blockposition2); + + list1.add(iblockdata); +@@ -329,7 +329,7 @@ public class BlockPiston extends BlockDirectional { + if (index >= size() || index < 0) { + throw new ArrayIndexOutOfBoundsException(index); + } +- BlockPosition pos = (BlockPosition) (index < moved.size() ? moved.get(index) : broken.get(index - moved.size())); ++ BlockPosition pos = index < moved.size() ? moved.get(index) : broken.get(index - moved.size()); + return bblock.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); + } + }; +@@ -359,7 +359,7 @@ public class BlockPiston extends BlockDirectional { + IBlockData iblockdata1; + + for (k = list2.size() - 1; k >= 0; --k) { +- blockposition3 = (BlockPosition) list2.get(k); ++ blockposition3 = list2.get(k); + iblockdata1 = world.getType(blockposition3); + TileEntity tileentity = iblockdata1.getBlock().isTileEntity() ? world.getTileEntity(blockposition3) : null; + +@@ -371,12 +371,12 @@ public class BlockPiston extends BlockDirectional { + for (k = list.size() - 1; k >= 0; --k) { + // Paper start - fix a variety of piston desync dupes + boolean allowDesync = com.destroystokyo.paper.PaperConfig.allowPistonDuplication && !list1.get(k).getBlock().isTileEntity(); // Tuinity - pushable TE's +- BlockPosition oldPos = blockposition3 = (BlockPosition) list.get(k); ++ BlockPosition oldPos = blockposition3 = list.get(k); + iblockdata1 = allowDesync ? world.getType(oldPos) : null; + // Paper end - fix a variety of piston desync dupes + blockposition3 = blockposition3.shift(enumdirection1); + map.remove(blockposition3); +- world.setTypeAndData(blockposition3, (IBlockData) Blocks.MOVING_PISTON.getBlockData().set(BlockPiston.FACING, enumdirection), 68); ++ world.setTypeAndData(blockposition3, Blocks.MOVING_PISTON.getBlockData().set(BlockDirectional.FACING, enumdirection), 68); + // Paper start - fix a variety of piston desync dupes + if (!allowDesync) { + iblockdata1 = world.getType(oldPos); +@@ -411,9 +411,9 @@ public class BlockPiston extends BlockDirectional { + + if (flag) { + BlockPropertyPistonType blockpropertypistontype = this.sticky ? BlockPropertyPistonType.STICKY : BlockPropertyPistonType.DEFAULT; +- IBlockData iblockdata2 = (IBlockData) ((IBlockData) Blocks.PISTON_HEAD.getBlockData().set(BlockPistonExtension.FACING, enumdirection)).set(BlockPistonExtension.TYPE, blockpropertypistontype); ++ IBlockData iblockdata2 = Blocks.PISTON_HEAD.getBlockData().set(BlockDirectional.FACING, enumdirection).set(BlockPistonExtension.TYPE, blockpropertypistontype); + +- iblockdata1 = (IBlockData) ((IBlockData) Blocks.MOVING_PISTON.getBlockData().set(BlockPistonMoving.a, enumdirection)).set(BlockPistonMoving.b, this.sticky ? BlockPropertyPistonType.STICKY : BlockPropertyPistonType.DEFAULT); ++ iblockdata1 = Blocks.MOVING_PISTON.getBlockData().set(BlockPistonMoving.a, enumdirection).set(BlockPistonMoving.b, this.sticky ? BlockPropertyPistonType.STICKY : BlockPropertyPistonType.DEFAULT); + map.remove(blockposition1); + world.setTypeAndData(blockposition1, iblockdata1, 68); + world.setTileEntity(blockposition1, BlockPistonMoving.a(iblockdata2, enumdirection, true, true)); +@@ -435,8 +435,8 @@ public class BlockPiston extends BlockDirectional { + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); + +- blockposition5 = (BlockPosition) entry.getKey(); +- IBlockData iblockdata4 = (IBlockData) entry.getValue(); ++ blockposition5 = entry.getKey(); ++ IBlockData iblockdata4 = entry.getValue(); + + iblockdata4.b(world, blockposition5, 2); + iblockdata3.a(world, blockposition5, 2); +@@ -449,13 +449,13 @@ public class BlockPiston extends BlockDirectional { + + for (l = list2.size() - 1; l >= 0; --l) { + iblockdata1 = aiblockdata[j++]; +- blockposition5 = (BlockPosition) list2.get(l); ++ blockposition5 = list2.get(l); + iblockdata1.b(world, blockposition5, 2); + world.applyPhysics(blockposition5, iblockdata1.getBlock()); + } + + for (l = list.size() - 1; l >= 0; --l) { +- world.applyPhysics((BlockPosition) list.get(l), aiblockdata[j++].getBlock()); ++ world.applyPhysics(list.get(l), aiblockdata[j++].getBlock()); + } + + if (flag) { +@@ -468,22 +468,22 @@ public class BlockPiston extends BlockDirectional { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockPiston.FACING, enumblockrotation.a((EnumDirection) iblockdata.get(BlockPiston.FACING))); ++ return iblockdata.set(BlockDirectional.FACING, enumblockrotation.a(iblockdata.get(BlockDirectional.FACING))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockPiston.FACING))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockDirectional.FACING))); + } + + @Override + protected void a(BlockStateList.a blockstatelist_a) { +- blockstatelist_a.a(BlockPiston.FACING, BlockPiston.EXTENDED); ++ blockstatelist_a.a(BlockDirectional.FACING, BlockPiston.EXTENDED); + } + + @Override + public boolean c_(IBlockData iblockdata) { +- return (Boolean) iblockdata.get(BlockPiston.EXTENDED); ++ return iblockdata.get(BlockPiston.EXTENDED); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockPistonMoving.java b/src/main/java/net/minecraft/server/BlockPistonMoving.java +index 29ea9b650b3fbed4d2f4bc9332ce26d92ce2e01e..ab76f725a5170877789d13a7d7d32fe67c4d6e75 100644 +--- a/src/main/java/net/minecraft/server/BlockPistonMoving.java ++++ b/src/main/java/net/minecraft/server/BlockPistonMoving.java +@@ -6,12 +6,12 @@ import java.util.List; + + public class BlockPistonMoving extends BlockTileEntity { + +- public static final BlockStateDirection a = BlockPistonExtension.FACING; ++ public static final BlockStateDirection a = BlockDirectional.FACING; + public static final BlockStateEnum b = BlockPistonExtension.TYPE; + + public BlockPistonMoving(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockPistonMoving.a, EnumDirection.NORTH)).set(BlockPistonMoving.b, BlockPropertyPistonType.DEFAULT)); ++ this.j(this.blockStateList.getBlockData().set(BlockPistonMoving.a, EnumDirection.NORTH).set(BlockPistonMoving.b, BlockPropertyPistonType.DEFAULT)); + } + + @Nullable +@@ -43,10 +43,10 @@ public class BlockPistonMoving extends BlockTileEntity { + + @Override + public void postBreak(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata) { +- BlockPosition blockposition1 = blockposition.shift(((EnumDirection) iblockdata.get(BlockPistonMoving.a)).opposite()); ++ BlockPosition blockposition1 = blockposition.shift(iblockdata.get(BlockPistonMoving.a).opposite()); + IBlockData iblockdata1 = generatoraccess.getType(blockposition1); + +- if (iblockdata1.getBlock() instanceof BlockPiston && (Boolean) iblockdata1.get(BlockPiston.EXTENDED)) { ++ if (iblockdata1.getBlock() instanceof BlockPiston && iblockdata1.get(BlockPiston.EXTENDED)) { + generatoraccess.a(blockposition1, false); + } + +@@ -64,7 +64,7 @@ public class BlockPistonMoving extends BlockTileEntity { + + @Override + public List a(IBlockData iblockdata, LootTableInfo.Builder loottableinfo_builder) { +- TileEntityPiston tileentitypiston = this.a((IBlockAccess) loottableinfo_builder.a(), (BlockPosition) loottableinfo_builder.a(LootContextParameters.POSITION)); ++ TileEntityPiston tileentitypiston = this.a(loottableinfo_builder.a(), loottableinfo_builder.a(LootContextParameters.POSITION)); + + return tileentitypiston == null ? Collections.emptyList() : tileentitypiston.k().a(loottableinfo_builder); + } +@@ -90,12 +90,12 @@ public class BlockPistonMoving extends BlockTileEntity { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockPistonMoving.a, enumblockrotation.a((EnumDirection) iblockdata.get(BlockPistonMoving.a))); ++ return iblockdata.set(BlockPistonMoving.a, enumblockrotation.a(iblockdata.get(BlockPistonMoving.a))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockPistonMoving.a))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockPistonMoving.a))); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockPlant.java b/src/main/java/net/minecraft/server/BlockPlant.java +index a830305f0e334ad87e6b9ed94230ff611d997d7e..501054f416aaa6a99935b74f9d4278b15ee9600c 100644 +--- a/src/main/java/net/minecraft/server/BlockPlant.java ++++ b/src/main/java/net/minecraft/server/BlockPlant.java +@@ -26,7 +26,7 @@ public class BlockPlant extends Block { + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { + BlockPosition blockposition1 = blockposition.down(); + +- return this.c(iworldreader.getType(blockposition1), (IBlockAccess) iworldreader, blockposition1); ++ return this.c(iworldreader.getType(blockposition1), iworldreader, blockposition1); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java +index f044de840b24055b24f0a039e18331c13161511d..e2d9cb3d14cbc5a6226ada17402e626a79097637 100644 +--- a/src/main/java/net/minecraft/server/BlockPortal.java ++++ b/src/main/java/net/minecraft/server/BlockPortal.java +@@ -18,12 +18,12 @@ public class BlockPortal extends Block { + + public BlockPortal(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockPortal.AXIS, EnumDirection.EnumAxis.X)); ++ this.j(this.blockStateList.getBlockData().set(BlockPortal.AXIS, EnumDirection.EnumAxis.X)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- switch ((EnumDirection.EnumAxis) iblockdata.get(BlockPortal.AXIS)) { ++ switch (iblockdata.get(BlockPortal.AXIS)) { + case Z: + return BlockPortal.c; + case X: +@@ -35,13 +35,13 @@ public class BlockPortal extends Block { + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + if (worldserver.spigotConfig.enableZombiePigmenPortalSpawns && worldserver.getDimensionManager().isNatural() && worldserver.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && random.nextInt(2000) < worldserver.getDifficulty().a()) { // Spigot +- while (worldserver.getType(blockposition).a((Block) this)) { ++ while (worldserver.getType(blockposition).a(this)) { + blockposition = blockposition.down(); + } + +- if (worldserver.getType(blockposition).a((IBlockAccess) worldserver, blockposition, EntityTypes.ZOMBIFIED_PIGLIN)) { ++ if (worldserver.getType(blockposition).a(worldserver, blockposition, EntityTypes.ZOMBIFIED_PIGLIN)) { + // CraftBukkit - set spawn reason to NETHER_PORTAL +- Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); ++ Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawnCreature(worldserver, null, null, null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); + + if (entity != null) { + entity.portalCooldown = entity.getDefaultPortalCooldown(); +@@ -82,10 +82,10 @@ public class BlockPortal extends Block { + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { + EnumDirection.EnumAxis enumdirection_enumaxis = enumdirection.n(); +- EnumDirection.EnumAxis enumdirection_enumaxis1 = (EnumDirection.EnumAxis) iblockdata.get(BlockPortal.AXIS); ++ EnumDirection.EnumAxis enumdirection_enumaxis1 = iblockdata.get(BlockPortal.AXIS); + boolean flag = enumdirection_enumaxis1 != enumdirection_enumaxis && enumdirection_enumaxis.d(); + +- return !flag && !iblockdata1.a((Block) this) && !(new BlockPortal.Shape(generatoraccess, blockposition, enumdirection_enumaxis1)).f() ? Blocks.AIR.getBlockData() : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); ++ return !flag && !iblockdata1.a(this) && !(new BlockPortal.Shape(generatoraccess, blockposition, enumdirection_enumaxis1)).f() ? Blocks.AIR.getBlockData() : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); + } + + @Override +@@ -105,11 +105,11 @@ public class BlockPortal extends Block { + switch (enumblockrotation) { + case COUNTERCLOCKWISE_90: + case CLOCKWISE_90: +- switch ((EnumDirection.EnumAxis) iblockdata.get(BlockPortal.AXIS)) { ++ switch (iblockdata.get(BlockPortal.AXIS)) { + case Z: +- return (IBlockData) iblockdata.set(BlockPortal.AXIS, EnumDirection.EnumAxis.X); ++ return iblockdata.set(BlockPortal.AXIS, EnumDirection.EnumAxis.X); + case X: +- return (IBlockData) iblockdata.set(BlockPortal.AXIS, EnumDirection.EnumAxis.Z); ++ return iblockdata.set(BlockPortal.AXIS, EnumDirection.EnumAxis.Z); + default: + return iblockdata; + } +@@ -306,7 +306,7 @@ public class BlockPortal extends Block { + } + + protected boolean a(IBlockData iblockdata) { +- return iblockdata.isAir() || iblockdata.a((Tag) TagsBlock.FIRE) || iblockdata.a(Blocks.NETHER_PORTAL); ++ return iblockdata.isAir() || iblockdata.a(TagsBlock.FIRE) || iblockdata.a(Blocks.NETHER_PORTAL); + } + + public boolean d() { +@@ -324,7 +324,7 @@ public class BlockPortal extends Block { + for (int j = 0; j < this.height; ++j) { + BlockPosition pos = blockposition.up(j); + CraftBlockState state = CraftBlockState.getBlockState(this.a.getMinecraftWorld(), pos, 18); +- state.setData((IBlockData) Blocks.NETHER_PORTAL.getBlockData().set(BlockPortal.AXIS, this.b)); ++ state.setData(Blocks.NETHER_PORTAL.getBlockData().set(BlockPortal.AXIS, this.b)); + blocks.add(state); + } + } +@@ -340,7 +340,7 @@ public class BlockPortal extends Block { + BlockPosition blockposition = this.position.shift(this.c, i); + + for (int j = 0; j < this.height; ++j) { +- this.a.setTypeAndData(blockposition.up(j), (IBlockData) Blocks.NETHER_PORTAL.getBlockData().set(BlockPortal.AXIS, this.b), 18); ++ this.a.setTypeAndData(blockposition.up(j), Blocks.NETHER_PORTAL.getBlockData().set(BlockPortal.AXIS, this.b), 18); + } + } + +diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java +index ea42b2a0ebfabe57055785f95b018e2d2c2bfa7a..b1039ba13644244bc6652fe24cc1cafcba853f7e 100644 +--- a/src/main/java/net/minecraft/server/BlockPosition.java ++++ b/src/main/java/net/minecraft/server/BlockPosition.java +@@ -21,7 +21,7 @@ public class BlockPosition extends BaseBlockPosition { + return new BlockPosition(aint[0], aint[1], aint[2]); + }); + }, (blockposition) -> { +- return IntStream.of(new int[]{blockposition.getX(), blockposition.getY(), blockposition.getZ()}); ++ return IntStream.of(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + }).stable(); + private static final Logger LOGGER = LogManager.getLogger(); + public static final BlockPosition ZERO = new BlockPosition(0, 0, 0); +@@ -227,7 +227,7 @@ public class BlockPosition extends BaseBlockPosition { + + protected BlockPosition computeNext() { + if (this.b <= 0) { +- return (BlockPosition) this.endOfData(); ++ return this.endOfData(); + } else { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = this.a.d(j + random.nextInt(l1), k + random.nextInt(i2), l + random.nextInt(j2)); + +@@ -269,7 +269,7 @@ public class BlockPosition extends BaseBlockPosition { + if (this.l > this.j) { + ++this.i; + if (this.i > l_decompiled) { // Paper - use proper l above (first line of this method) +- return (BlockPosition) this.endOfData(); ++ return this.endOfData(); + } + + this.j = Math.min(p_i, this.i); // Paper - decompile issues +@@ -338,7 +338,7 @@ public class BlockPosition extends BaseBlockPosition { + + protected BlockPosition computeNext() { + if (this.h == j2) { +- return (BlockPosition) this.endOfData(); ++ return this.endOfData(); + } else { + int k2 = this.h % k1; + int l2 = this.h / k1; +@@ -390,8 +390,8 @@ public class BlockPosition extends BaseBlockPosition { + public final BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return d(i, j, k);} // Paper - OBFHELPER + public final BlockPosition.MutableBlockPosition d(int i, int j, int k) { // Tuinity + ((BaseBlockPosition)this).a = i; // Tuinity - force inline +- ((BaseBlockPosition)this).b = j; // Tuinity - force inline +- ((BaseBlockPosition)this).e = k; // Tuinity - force inline ++ this.b = j; // Tuinity - force inline ++ this.e = k; // Tuinity - force inline + return this; + } + +@@ -403,15 +403,15 @@ public class BlockPosition extends BaseBlockPosition { + public final BlockPosition.MutableBlockPosition setValues(final BaseBlockPosition baseblockposition) { return this.g(baseblockposition); } // Paper - OBFHELPER + public final BlockPosition.MutableBlockPosition g(BaseBlockPosition baseblockposition) { // Tuinity + ((BaseBlockPosition)this).a = baseblockposition.a; // Tuinity - force inline +- ((BaseBlockPosition)this).b = baseblockposition.b; // Tuinity - force inline +- ((BaseBlockPosition)this).e = baseblockposition.e; // Tuinity - force inline ++ this.b = baseblockposition.b; // Tuinity - force inline ++ this.e = baseblockposition.e; // Tuinity - force inline + return this; + } + + public final BlockPosition.MutableBlockPosition g(long i) { // Tuinity + ((BaseBlockPosition)this).a = (int)(i >> 38); // Tuinity - force inline +- ((BaseBlockPosition)this).b = (int)((i << 52) >> 52); // Tuinity - force inline +- ((BaseBlockPosition)this).e = (int)((i << 26) >> 38); // Tuinity - force inline ++ this.b = (int)((i << 52) >> 52); // Tuinity - force inline ++ this.e = (int)((i << 26) >> 38); // Tuinity - force inline + return this; + } + +@@ -429,8 +429,8 @@ public class BlockPosition extends BaseBlockPosition { + + public final BlockPosition.MutableBlockPosition c(EnumDirection enumdirection) { // Tuinity + ((BaseBlockPosition)this).a += enumdirection.getAdjacentX(); // Tuinity - force inline +- ((BaseBlockPosition)this).b += enumdirection.getAdjacentY(); // Tuinity - force inline +- ((BaseBlockPosition)this).e += enumdirection.getAdjacentZ(); // Tuinity - force inline ++ this.b += enumdirection.getAdjacentY(); // Tuinity - force inline ++ this.e += enumdirection.getAdjacentZ(); // Tuinity - force inline + return this; + } + +@@ -461,10 +461,10 @@ public class BlockPosition extends BaseBlockPosition { + ((BaseBlockPosition)this).a = value; + } + public final void setY(int value) { +- ((BaseBlockPosition)this).b = value; ++ this.b = value; + } + public final void setZ(int value) { +- ((BaseBlockPosition)this).e = value; ++ this.e = value; + } + + public final void o(int i) { +@@ -472,11 +472,11 @@ public class BlockPosition extends BaseBlockPosition { + } + + public final void p(int i) { +- ((BaseBlockPosition)this).b = i; ++ this.b = i; + } + + public final void q(int i) { +- ((BaseBlockPosition)this).e = i; ++ this.e = i; + } + // Tuinity end + +diff --git a/src/main/java/net/minecraft/server/BlockPoweredRail.java b/src/main/java/net/minecraft/server/BlockPoweredRail.java +index 3b5c097defd83e3f82b695312fae3ded536f1f55..ef6145899b4380e744f6fb9a3c5aacc5ee103aed 100644 +--- a/src/main/java/net/minecraft/server/BlockPoweredRail.java ++++ b/src/main/java/net/minecraft/server/BlockPoweredRail.java +@@ -9,7 +9,7 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract { + + protected BlockPoweredRail(BlockBase.Info blockbase_info) { + super(true, blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH)).set(BlockPoweredRail.POWERED, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH).set(BlockPoweredRail.POWERED, false)); + } + + protected boolean a(World world, BlockPosition blockposition, IBlockData iblockdata, boolean flag, int i) { +@@ -20,7 +20,7 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract { + int k = blockposition.getY(); + int l = blockposition.getZ(); + boolean flag1 = true; +- BlockPropertyTrackPosition blockpropertytrackposition = (BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE); ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.get(BlockPoweredRail.SHAPE); + + switch (blockpropertytrackposition) { + case NORTH_SOUTH: +@@ -89,18 +89,18 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract { + protected boolean a(World world, BlockPosition blockposition, boolean flag, int i, BlockPropertyTrackPosition blockpropertytrackposition) { + IBlockData iblockdata = world.getType(blockposition); + +- if (!iblockdata.a((Block) this)) { ++ if (!iblockdata.a(this)) { + return false; + } else { +- BlockPropertyTrackPosition blockpropertytrackposition1 = (BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE); ++ BlockPropertyTrackPosition blockpropertytrackposition1 = iblockdata.get(BlockPoweredRail.SHAPE); + +- return blockpropertytrackposition == BlockPropertyTrackPosition.EAST_WEST && (blockpropertytrackposition1 == BlockPropertyTrackPosition.NORTH_SOUTH || blockpropertytrackposition1 == BlockPropertyTrackPosition.ASCENDING_NORTH || blockpropertytrackposition1 == BlockPropertyTrackPosition.ASCENDING_SOUTH) ? false : (blockpropertytrackposition == BlockPropertyTrackPosition.NORTH_SOUTH && (blockpropertytrackposition1 == BlockPropertyTrackPosition.EAST_WEST || blockpropertytrackposition1 == BlockPropertyTrackPosition.ASCENDING_EAST || blockpropertytrackposition1 == BlockPropertyTrackPosition.ASCENDING_WEST) ? false : ((Boolean) iblockdata.get(BlockPoweredRail.POWERED) ? (world.isBlockIndirectlyPowered(blockposition) ? true : this.a(world, blockposition, iblockdata, flag, i + 1)) : false)); ++ return blockpropertytrackposition == BlockPropertyTrackPosition.EAST_WEST && (blockpropertytrackposition1 == BlockPropertyTrackPosition.NORTH_SOUTH || blockpropertytrackposition1 == BlockPropertyTrackPosition.ASCENDING_NORTH || blockpropertytrackposition1 == BlockPropertyTrackPosition.ASCENDING_SOUTH) ? false : (blockpropertytrackposition == BlockPropertyTrackPosition.NORTH_SOUTH && (blockpropertytrackposition1 == BlockPropertyTrackPosition.EAST_WEST || blockpropertytrackposition1 == BlockPropertyTrackPosition.ASCENDING_EAST || blockpropertytrackposition1 == BlockPropertyTrackPosition.ASCENDING_WEST) ? false : (iblockdata.get(BlockPoweredRail.POWERED) ? (world.isBlockIndirectlyPowered(blockposition) ? true : this.a(world, blockposition, iblockdata, flag, i + 1)) : false)); + } + } + + @Override + protected void a(IBlockData iblockdata, World world, BlockPosition blockposition, Block block) { +- boolean flag = (Boolean) iblockdata.get(BlockPoweredRail.POWERED); ++ boolean flag = iblockdata.get(BlockPoweredRail.POWERED); + boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || this.a(world, blockposition, iblockdata, true, 0) || this.a(world, blockposition, iblockdata, false, 0); + + if (flag1 != flag) { +@@ -111,9 +111,9 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract { + return; + } + // CraftBukkit end +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockPoweredRail.POWERED, flag1), 3); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockPoweredRail.POWERED, flag1), 3); + world.applyPhysics(blockposition.down(), this); +- if (((BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE)).c()) { ++ if (iblockdata.get(BlockPoweredRail.SHAPE).c()) { + world.applyPhysics(blockposition.up(), this); + } + } +@@ -129,69 +129,69 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract { + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { + switch (enumblockrotation) { + case CLOCKWISE_180: +- switch ((BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE)) { ++ switch (iblockdata.get(BlockPoweredRail.SHAPE)) { + case ASCENDING_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); + case ASCENDING_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); + case ASCENDING_NORTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); + case ASCENDING_SOUTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + } + case COUNTERCLOCKWISE_90: +- switch ((BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE)) { ++ switch (iblockdata.get(BlockPoweredRail.SHAPE)) { + case NORTH_SOUTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.EAST_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.EAST_WEST); + case EAST_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH); + case ASCENDING_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); + case ASCENDING_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); + case ASCENDING_NORTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); + case ASCENDING_SOUTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + } + case CLOCKWISE_90: +- switch ((BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE)) { ++ switch (iblockdata.get(BlockPoweredRail.SHAPE)) { + case NORTH_SOUTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.EAST_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.EAST_WEST); + case EAST_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_SOUTH); + case ASCENDING_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); + case ASCENDING_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); + case ASCENDING_NORTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); + case ASCENDING_SOUTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + } + default: + return iblockdata; +@@ -200,44 +200,44 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- BlockPropertyTrackPosition blockpropertytrackposition = (BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE); ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.get(BlockPoweredRail.SHAPE); + + switch (enumblockmirror) { + case LEFT_RIGHT: + switch (blockpropertytrackposition) { + case ASCENDING_NORTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_SOUTH); + case ASCENDING_SOUTH: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_NORTH); + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + default: + return super.a(iblockdata, enumblockmirror); + } + case FRONT_BACK: + switch (blockpropertytrackposition) { + case ASCENDING_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_WEST); + case ASCENDING_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.ASCENDING_EAST); + case ASCENDING_NORTH: + case ASCENDING_SOUTH: + default: + break; + case SOUTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_WEST); + case SOUTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.SOUTH_EAST); + case NORTH_WEST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_EAST); + case NORTH_EAST: +- return (IBlockData) iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); ++ return iblockdata.set(BlockPoweredRail.SHAPE, BlockPropertyTrackPosition.NORTH_WEST); + } + } + +diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java b/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java +index d163ec51b5477be2fa94767835962ab341b61b6f..10e13666f801677cead80a1f5224c98857e38884 100644 +--- a/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java ++++ b/src/main/java/net/minecraft/server/BlockPressurePlateAbstract.java +@@ -37,7 +37,7 @@ public abstract class BlockPressurePlateAbstract extends Block { + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { + BlockPosition blockposition1 = blockposition.down(); + +- return c((IBlockAccess) iworldreader, blockposition1) || a(iworldreader, blockposition1, EnumDirection.UP); ++ return c(iworldreader, blockposition1) || a(iworldreader, blockposition1, EnumDirection.UP); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java b/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java +index af29ceacd6d57d955dcca7b0a11559d97ffc9d96..fdddf6c974de8da248b3ea02a1dd196806a5e382 100644 +--- a/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java ++++ b/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java +@@ -12,26 +12,26 @@ public class BlockPressurePlateBinary extends BlockPressurePlateAbstract { + + protected BlockPressurePlateBinary(BlockPressurePlateBinary.EnumMobType blockpressureplatebinary_enummobtype, BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockPressurePlateBinary.POWERED, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockPressurePlateBinary.POWERED, false)); + this.e = blockpressureplatebinary_enummobtype; + } + + @Override + protected int getPower(IBlockData iblockdata) { +- return (Boolean) iblockdata.get(BlockPressurePlateBinary.POWERED) ? 15 : 0; ++ return iblockdata.get(BlockPressurePlateBinary.POWERED) ? 15 : 0; + } + + @Override + protected IBlockData a(IBlockData iblockdata, int i) { +- return (IBlockData) iblockdata.set(BlockPressurePlateBinary.POWERED, i > 0); ++ return iblockdata.set(BlockPressurePlateBinary.POWERED, i > 0); + } + + @Override + protected void a(GeneratorAccess generatoraccess, BlockPosition blockposition) { + if (this.material != Material.WOOD && this.material != Material.NETHER_WOOD) { +- generatoraccess.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_STONE_PRESSURE_PLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.6F); ++ generatoraccess.playSound(null, blockposition, SoundEffects.BLOCK_STONE_PRESSURE_PLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.6F); + } else { +- generatoraccess.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_WOODEN_PRESSURE_PLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.8F); ++ generatoraccess.playSound(null, blockposition, SoundEffects.BLOCK_WOODEN_PRESSURE_PLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.8F); + } + + } +@@ -39,21 +39,21 @@ public class BlockPressurePlateBinary extends BlockPressurePlateAbstract { + @Override + protected void b(GeneratorAccess generatoraccess, BlockPosition blockposition) { + if (this.material != Material.WOOD && this.material != Material.NETHER_WOOD) { +- generatoraccess.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_STONE_PRESSURE_PLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.5F); ++ generatoraccess.playSound(null, blockposition, SoundEffects.BLOCK_STONE_PRESSURE_PLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.5F); + } else { +- generatoraccess.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_WOODEN_PRESSURE_PLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.7F); ++ generatoraccess.playSound(null, blockposition, SoundEffects.BLOCK_WOODEN_PRESSURE_PLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.7F); + } + + } + + @Override + protected int b(World world, BlockPosition blockposition) { +- AxisAlignedBB axisalignedbb = BlockPressurePlateBinary.c.a(blockposition); ++ AxisAlignedBB axisalignedbb = BlockPressurePlateAbstract.c.a(blockposition); + List list; + + switch (this.e) { + case EVERYTHING: +- list = world.getEntities((Entity) null, axisalignedbb); ++ list = world.getEntities(null, axisalignedbb); + break; + case MOBS: + list = world.a(EntityLiving.class, axisalignedbb); +diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java b/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java +index f76dd0f7f2d6a68aad2f19b2e926138c9c0c0ad0..ee0fa035a5cfdaf937ad2e3b4517e4500b894afe 100644 +--- a/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java ++++ b/src/main/java/net/minecraft/server/BlockPressurePlateWeighted.java +@@ -9,7 +9,7 @@ public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract { + + protected BlockPressurePlateWeighted(int i, BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockPressurePlateWeighted.POWER, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockPressurePlateWeighted.POWER, 0)); + this.weight = i; + } + +@@ -18,7 +18,7 @@ public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract { + // CraftBukkit start + // int i = Math.min(world.a(Entity.class, BlockPressurePlateWeighted.c.a(blockposition)).size(), this.weight); + int i = 0; +- java.util.Iterator iterator = world.a(Entity.class, BlockPressurePlateWeighted.c.a(blockposition)).iterator(); ++ java.util.Iterator iterator = world.a(Entity.class, BlockPressurePlateAbstract.c.a(blockposition)).iterator(); + + while (iterator.hasNext()) { + Entity entity = (Entity) iterator.next(); +@@ -52,22 +52,22 @@ public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract { + + @Override + protected void a(GeneratorAccess generatoraccess, BlockPosition blockposition) { +- generatoraccess.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_METAL_PRESSURE_PLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.90000004F); ++ generatoraccess.playSound(null, blockposition, SoundEffects.BLOCK_METAL_PRESSURE_PLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.90000004F); + } + + @Override + protected void b(GeneratorAccess generatoraccess, BlockPosition blockposition) { +- generatoraccess.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_METAL_PRESSURE_PLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.75F); ++ generatoraccess.playSound(null, blockposition, SoundEffects.BLOCK_METAL_PRESSURE_PLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.75F); + } + + @Override + protected int getPower(IBlockData iblockdata) { +- return (Integer) iblockdata.get(BlockPressurePlateWeighted.POWER); ++ return iblockdata.get(BlockPressurePlateWeighted.POWER); + } + + @Override + protected IBlockData a(IBlockData iblockdata, int i) { +- return (IBlockData) iblockdata.set(BlockPressurePlateWeighted.POWER, i); ++ return iblockdata.set(BlockPressurePlateWeighted.POWER, i); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockPumpkinCarved.java b/src/main/java/net/minecraft/server/BlockPumpkinCarved.java +index f07d09348145f795c3788ffb4577c30a7b2e5bb6..46b449f3aee21ec766bca812408656be2bd47c2e 100644 +--- a/src/main/java/net/minecraft/server/BlockPumpkinCarved.java ++++ b/src/main/java/net/minecraft/server/BlockPumpkinCarved.java +@@ -25,7 +25,7 @@ public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWea + + protected BlockPumpkinCarved(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockPumpkinCarved.a, EnumDirection.NORTH)); ++ this.j(this.blockStateList.getBlockData().set(BlockPumpkinCarved.a, EnumDirection.NORTH)); + } + + @Override +@@ -55,7 +55,7 @@ public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWea + // world.triggerEffect(2001, shapedetectorblock.getPosition(), Block.getCombinedId(shapedetectorblock.a())); // CraftBukkit + } + +- EntitySnowman entitysnowman = (EntitySnowman) EntityTypes.SNOW_GOLEM.a(world); ++ EntitySnowman entitysnowman = EntityTypes.SNOW_GOLEM.a(world); + BlockPosition blockposition1 = shapedetector_shapedetectorcollection.a(0, 2, 0).getPosition(); + + entitysnowman.setPositionRotation((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.05D, (double) blockposition1.getZ() + 0.5D, 0.0F, 0.0F); +@@ -72,7 +72,7 @@ public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWea + + while (iterator.hasNext()) { + entityplayer = (EntityPlayer) iterator.next(); +- CriterionTriggers.n.a(entityplayer, (Entity) entitysnowman); ++ CriterionTriggers.n.a(entityplayer, entitysnowman); + } + + for (j = 0; j < this.getSnowmanShape().b(); ++j) { +@@ -93,7 +93,7 @@ public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWea + } + + BlockPosition blockposition2 = shapedetector_shapedetectorcollection.a(1, 2, 0).getPosition(); +- EntityIronGolem entityirongolem = (EntityIronGolem) EntityTypes.IRON_GOLEM.a(world); ++ EntityIronGolem entityirongolem = EntityTypes.IRON_GOLEM.a(world); + + entityirongolem.setPlayerCreated(true); + entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F); +@@ -110,7 +110,7 @@ public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWea + + while (iterator.hasNext()) { + entityplayer = (EntityPlayer) iterator.next(); +- CriterionTriggers.n.a(entityplayer, (Entity) entityirongolem); ++ CriterionTriggers.n.a(entityplayer, entityirongolem); + } + + for (j = 0; j < this.getIronGolemShape().c(); ++j) { +@@ -127,7 +127,7 @@ public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWea + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return (IBlockData) this.getBlockData().set(BlockPumpkinCarved.a, blockactioncontext.f().opposite()); ++ return this.getBlockData().set(BlockPumpkinCarved.a, blockactioncontext.f().opposite()); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneComparator.java b/src/main/java/net/minecraft/server/BlockRedstoneComparator.java +index 70595d2a00fef8664224060865adb7cc6fc89c0e..4537e5f4acad21f8eca65fb880b753ef68244003 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneComparator.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneComparator.java +@@ -12,7 +12,7 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile + + public BlockRedstoneComparator(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockRedstoneComparator.FACING, EnumDirection.NORTH)).set(BlockRedstoneComparator.c, false)).set(BlockRedstoneComparator.MODE, BlockPropertyComparatorMode.COMPARE)); ++ this.j(this.blockStateList.getBlockData().set(BlockFacingHorizontal.FACING, EnumDirection.NORTH).set(BlockDiodeAbstract.c, false).set(BlockRedstoneComparator.MODE, BlockPropertyComparatorMode.COMPARE)); + } + + @Override +@@ -47,7 +47,7 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile + @Override + protected int b(World world, BlockPosition blockposition, IBlockData iblockdata) { + int i = super.b(world, blockposition, iblockdata); +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockRedstoneComparator.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockFacingHorizontal.FACING); + BlockPosition blockposition1 = blockposition.shift(enumdirection); + IBlockData iblockdata1 = world.getType(blockposition1); + +@@ -70,11 +70,11 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile + @Nullable + private EntityItemFrame a(World world, EnumDirection enumdirection, BlockPosition blockposition) { + // CraftBukkit - decompile error +- List list = world.a(EntityItemFrame.class, new AxisAlignedBB((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 1), (double) (blockposition.getZ() + 1)), (java.util.function.Predicate) (entityitemframe) -> { ++ List list = world.a(EntityItemFrame.class, new AxisAlignedBB(blockposition.getX(), blockposition.getY(), blockposition.getZ(), blockposition.getX() + 1, blockposition.getY() + 1, blockposition.getZ() + 1), (entityitemframe) -> { + return entityitemframe != null && entityitemframe.getDirection() == enumdirection; + }); + +- return list.size() == 1 ? (EntityItemFrame) list.get(0) : null; ++ return list.size() == 1 ? list.get(0) : null; + } + + @Override +@@ -82,7 +82,7 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile + if (!entityhuman.abilities.mayBuild) { + return EnumInteractionResult.PASS; + } else { +- iblockdata = (IBlockData) iblockdata.a((IBlockState) BlockRedstoneComparator.MODE); ++ iblockdata = iblockdata.a((IBlockState) BlockRedstoneComparator.MODE); + float f = iblockdata.get(BlockRedstoneComparator.MODE) == BlockPropertyComparatorMode.SUBTRACT ? 0.55F : 0.5F; + + world.playSound(entityhuman, blockposition, SoundEffects.BLOCK_COMPARATOR_CLICK, SoundCategory.BLOCKS, 0.3F, f); +@@ -99,7 +99,7 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile + TileEntity tileentity = world.getTileEntity(blockposition); + int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator) tileentity).d() : 0; + +- if (i != j || (Boolean) iblockdata.get(BlockRedstoneComparator.c) != this.a(world, blockposition, iblockdata)) { ++ if (i != j || iblockdata.get(BlockDiodeAbstract.c) != this.a(world, blockposition, iblockdata)) { + TickListPriority ticklistpriority = this.c((IBlockAccess) world, blockposition, iblockdata) ? TickListPriority.HIGH : TickListPriority.NORMAL; + + world.getBlockTickList().a(blockposition, this, 2, ticklistpriority); +@@ -122,7 +122,7 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile + + if (j != i || iblockdata.get(BlockRedstoneComparator.MODE) == BlockPropertyComparatorMode.COMPARE) { + boolean flag = this.a(world, blockposition, iblockdata); +- boolean flag1 = (Boolean) iblockdata.get(BlockRedstoneComparator.c); ++ boolean flag1 = iblockdata.get(BlockDiodeAbstract.c); + + if (flag1 && !flag) { + // CraftBukkit start +@@ -130,14 +130,14 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile + return; + } + // CraftBukkit end +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneComparator.c, false), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockDiodeAbstract.c, false), 2); + } else if (!flag1 && flag) { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(world, blockposition, 0, 15).getNewCurrent() != 15) { + return; + } + // CraftBukkit end +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneComparator.c, true), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockDiodeAbstract.c, true), 2); + } + + this.d(world, blockposition, iblockdata); +@@ -147,7 +147,7 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- this.f((World) worldserver, blockposition, iblockdata); ++ this.f(worldserver, blockposition, iblockdata); + } + + @Override +@@ -165,6 +165,6 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile + + @Override + protected void a(BlockStateList.a blockstatelist_a) { +- blockstatelist_a.a(BlockRedstoneComparator.FACING, BlockRedstoneComparator.MODE, BlockRedstoneComparator.c); ++ blockstatelist_a.a(BlockFacingHorizontal.FACING, BlockRedstoneComparator.MODE, BlockDiodeAbstract.c); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java +index 154d217a27c490542e36f41b547e4905e728fb8f..72c58bf803d62b58c14f31551e4ffe0e020c9e3d 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java +@@ -11,19 +11,19 @@ public class BlockRedstoneLamp extends Block { + + public BlockRedstoneLamp(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) this.getBlockData().set(BlockRedstoneLamp.a, false)); ++ this.j(this.getBlockData().set(BlockRedstoneLamp.a, false)); + } + + @Nullable + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return (IBlockData) this.getBlockData().set(BlockRedstoneLamp.a, blockactioncontext.getWorld().isBlockIndirectlyPowered(blockactioncontext.getClickPosition())); ++ return this.getBlockData().set(BlockRedstoneLamp.a, blockactioncontext.getWorld().isBlockIndirectlyPowered(blockactioncontext.getClickPosition())); + } + + @Override + public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) { + if (!world.isClientSide) { +- boolean flag1 = (Boolean) iblockdata.get(BlockRedstoneLamp.a); ++ boolean flag1 = iblockdata.get(BlockRedstoneLamp.a); + + if (flag1 != world.isBlockIndirectlyPowered(blockposition)) { + if (flag1) { +@@ -34,7 +34,7 @@ public class BlockRedstoneLamp extends Block { + return; + } + // CraftBukkit end +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2); ++ world.setTypeAndData(blockposition, iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2); + } + } + +@@ -43,13 +43,13 @@ public class BlockRedstoneLamp extends Block { + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if ((Boolean) iblockdata.get(BlockRedstoneLamp.a) && !worldserver.isBlockIndirectlyPowered(blockposition)) { ++ if (iblockdata.get(BlockRedstoneLamp.a) && !worldserver.isBlockIndirectlyPowered(blockposition)) { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2); ++ worldserver.setTypeAndData(blockposition, iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2); + } + + } +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneOre.java b/src/main/java/net/minecraft/server/BlockRedstoneOre.java +index 7a4a481135e1457716bbe606571d143da27e654b..b405a05c19615438d4e66e9a7d5cda0a0801c426 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneOre.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneOre.java +@@ -12,7 +12,7 @@ public class BlockRedstoneOre extends Block { + + public BlockRedstoneOre(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) this.getBlockData().set(BlockRedstoneOre.a, false)); ++ this.j(this.getBlockData().set(BlockRedstoneOre.a, false)); + } + + @Override +@@ -64,25 +64,25 @@ public class BlockRedstoneOre extends Block { + return; + } + // CraftBukkit end +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, true), 3); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockRedstoneOre.a, true), 3); + } + + } + + @Override + public boolean isTicking(IBlockData iblockdata) { +- return (Boolean) iblockdata.get(BlockRedstoneOre.a); ++ return iblockdata.get(BlockRedstoneOre.a); + } + + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if ((Boolean) iblockdata.get(BlockRedstoneOre.a)) { ++ if (iblockdata.get(BlockRedstoneOre.a)) { + // CraftBukkit start + if (CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, iblockdata.set(BlockRedstoneOre.a, false)).isCancelled()) { + return; + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, false), 3); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockRedstoneOre.a, false), 3); + } + + } +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +index 520a34550f58f35eeaf6cb62a3f0edc64abb1451..7735e0d8ae78fb09e102b4fbde61577edc351394 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +@@ -11,7 +11,7 @@ public class BlockRedstoneTorch extends BlockTorch { + + protected BlockRedstoneTorch(BlockBase.Info blockbase_info) { + super(blockbase_info, ParticleParamRedstone.a); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockRedstoneTorch.LIT, true)); ++ this.j(this.blockStateList.getBlockData().set(BlockRedstoneTorch.LIT, true)); + } + + @Override +@@ -44,7 +44,7 @@ public class BlockRedstoneTorch extends BlockTorch { + + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Boolean) iblockdata.get(BlockRedstoneTorch.LIT) && EnumDirection.UP != enumdirection ? 15 : 0; ++ return iblockdata.get(BlockRedstoneTorch.LIT) && EnumDirection.UP != enumdirection ? 15 : 0; + } + + protected boolean a(World world, BlockPosition blockposition, IBlockData iblockdata) { +@@ -53,7 +53,7 @@ public class BlockRedstoneTorch extends BlockTorch { + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- boolean flag = this.a((World) worldserver, blockposition, iblockdata); ++ boolean flag = this.a(worldserver, blockposition, iblockdata); + // Paper start + java.util.ArrayDeque redstoneUpdateInfos = worldserver.redstoneUpdateInfos; + if (redstoneUpdateInfos != null) { +@@ -67,11 +67,11 @@ public class BlockRedstoneTorch extends BlockTorch { + // CraftBukkit start + org.bukkit.plugin.PluginManager manager = worldserver.getServer().getPluginManager(); + org.bukkit.block.Block block = worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); +- int oldCurrent = ((Boolean) iblockdata.get(BlockRedstoneTorch.LIT)).booleanValue() ? 15 : 0; ++ int oldCurrent = iblockdata.get(BlockRedstoneTorch.LIT).booleanValue() ? 15 : 0; + + BlockRedstoneEvent event = new BlockRedstoneEvent(block, oldCurrent, oldCurrent); + // CraftBukkit end +- if ((Boolean) iblockdata.get(BlockRedstoneTorch.LIT)) { ++ if (iblockdata.get(BlockRedstoneTorch.LIT)) { + if (flag) { + // CraftBukkit start + if (oldCurrent != 0) { +@@ -82,7 +82,7 @@ public class BlockRedstoneTorch extends BlockTorch { + } + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, false), 3); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockRedstoneTorch.LIT, false), 3); + if (a(worldserver, blockposition, true)) { + worldserver.triggerEffect(1502, blockposition, 0); + worldserver.getBlockTickList().a(blockposition, worldserver.getType(blockposition).getBlock(), 160); +@@ -98,14 +98,14 @@ public class BlockRedstoneTorch extends BlockTorch { + } + } + // CraftBukkit end +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, true), 3); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockRedstoneTorch.LIT, true), 3); + } + + } + + @Override + public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) { +- if ((Boolean) iblockdata.get(BlockRedstoneTorch.LIT) == this.a(world, blockposition, iblockdata) && !world.getBlockTickList().b(blockposition, this)) { ++ if (iblockdata.get(BlockRedstoneTorch.LIT) == this.a(world, blockposition, iblockdata) && !world.getBlockTickList().b(blockposition, this)) { + world.getBlockTickList().a(blockposition, this, 2); + } + +diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java +index f9cb85492078aec72eae938af8db2c371e9e489c..cb435c8f425697407ff80844e0b3efbb0a587005 100644 +--- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java ++++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java +@@ -22,7 +22,7 @@ public class BlockRedstoneWire extends Block { + public static final Map> f = Maps.newEnumMap(ImmutableMap.of(EnumDirection.NORTH, BlockRedstoneWire.NORTH, EnumDirection.EAST, BlockRedstoneWire.EAST, EnumDirection.SOUTH, BlockRedstoneWire.SOUTH, EnumDirection.WEST, BlockRedstoneWire.WEST)); + private static final VoxelShape g = Block.a(3.0D, 0.0D, 3.0D, 13.0D, 1.0D, 13.0D); + private static final Map h = Maps.newEnumMap(ImmutableMap.of(EnumDirection.NORTH, Block.a(3.0D, 0.0D, 0.0D, 13.0D, 1.0D, 13.0D), EnumDirection.SOUTH, Block.a(3.0D, 0.0D, 3.0D, 13.0D, 1.0D, 16.0D), EnumDirection.EAST, Block.a(3.0D, 0.0D, 3.0D, 16.0D, 1.0D, 13.0D), EnumDirection.WEST, Block.a(0.0D, 0.0D, 3.0D, 13.0D, 1.0D, 13.0D))); +- private static final Map i = Maps.newEnumMap(ImmutableMap.of(EnumDirection.NORTH, VoxelShapes.a((VoxelShape) BlockRedstoneWire.h.get(EnumDirection.NORTH), Block.a(3.0D, 0.0D, 0.0D, 13.0D, 16.0D, 1.0D)), EnumDirection.SOUTH, VoxelShapes.a((VoxelShape) BlockRedstoneWire.h.get(EnumDirection.SOUTH), Block.a(3.0D, 0.0D, 15.0D, 13.0D, 16.0D, 16.0D)), EnumDirection.EAST, VoxelShapes.a((VoxelShape) BlockRedstoneWire.h.get(EnumDirection.EAST), Block.a(15.0D, 0.0D, 3.0D, 16.0D, 16.0D, 13.0D)), EnumDirection.WEST, VoxelShapes.a((VoxelShape) BlockRedstoneWire.h.get(EnumDirection.WEST), Block.a(0.0D, 0.0D, 3.0D, 1.0D, 16.0D, 13.0D)))); ++ private static final Map i = Maps.newEnumMap(ImmutableMap.of(EnumDirection.NORTH, VoxelShapes.a(BlockRedstoneWire.h.get(EnumDirection.NORTH), Block.a(3.0D, 0.0D, 0.0D, 13.0D, 16.0D, 1.0D)), EnumDirection.SOUTH, VoxelShapes.a(BlockRedstoneWire.h.get(EnumDirection.SOUTH), Block.a(3.0D, 0.0D, 15.0D, 13.0D, 16.0D, 16.0D)), EnumDirection.EAST, VoxelShapes.a(BlockRedstoneWire.h.get(EnumDirection.EAST), Block.a(15.0D, 0.0D, 3.0D, 16.0D, 16.0D, 13.0D)), EnumDirection.WEST, VoxelShapes.a(BlockRedstoneWire.h.get(EnumDirection.WEST), Block.a(0.0D, 0.0D, 3.0D, 1.0D, 16.0D, 13.0D)))); + private final Map j = Maps.newHashMap(); + private static final Vector3fa[] k = new Vector3fa[16]; + private final IBlockData o; +@@ -30,14 +30,14 @@ public class BlockRedstoneWire extends Block { + + public BlockRedstoneWire(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockRedstoneWire.NORTH, BlockPropertyRedstoneSide.NONE)).set(BlockRedstoneWire.EAST, BlockPropertyRedstoneSide.NONE)).set(BlockRedstoneWire.SOUTH, BlockPropertyRedstoneSide.NONE)).set(BlockRedstoneWire.WEST, BlockPropertyRedstoneSide.NONE)).set(BlockRedstoneWire.POWER, 0)); +- this.o = (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockRedstoneWire.NORTH, BlockPropertyRedstoneSide.SIDE)).set(BlockRedstoneWire.EAST, BlockPropertyRedstoneSide.SIDE)).set(BlockRedstoneWire.SOUTH, BlockPropertyRedstoneSide.SIDE)).set(BlockRedstoneWire.WEST, BlockPropertyRedstoneSide.SIDE); ++ this.j(this.blockStateList.getBlockData().set(BlockRedstoneWire.NORTH, BlockPropertyRedstoneSide.NONE).set(BlockRedstoneWire.EAST, BlockPropertyRedstoneSide.NONE).set(BlockRedstoneWire.SOUTH, BlockPropertyRedstoneSide.NONE).set(BlockRedstoneWire.WEST, BlockPropertyRedstoneSide.NONE).set(BlockRedstoneWire.POWER, 0)); ++ this.o = this.getBlockData().set(BlockRedstoneWire.NORTH, BlockPropertyRedstoneSide.SIDE).set(BlockRedstoneWire.EAST, BlockPropertyRedstoneSide.SIDE).set(BlockRedstoneWire.SOUTH, BlockPropertyRedstoneSide.SIDE).set(BlockRedstoneWire.WEST, BlockPropertyRedstoneSide.SIDE); + UnmodifiableIterator unmodifiableiterator = this.getStates().a().iterator(); + + while (unmodifiableiterator.hasNext()) { + IBlockData iblockdata = (IBlockData) unmodifiableiterator.next(); + +- if ((Integer) iblockdata.get(BlockRedstoneWire.POWER) == 0) { ++ if (iblockdata.get(BlockRedstoneWire.POWER) == 0) { + this.j.put(iblockdata, this.l(iblockdata)); + } + } +@@ -53,9 +53,9 @@ public class BlockRedstoneWire extends Block { + BlockPropertyRedstoneSide blockpropertyredstoneside = (BlockPropertyRedstoneSide) iblockdata.get((IBlockState) BlockRedstoneWire.f.get(enumdirection)); + + if (blockpropertyredstoneside == BlockPropertyRedstoneSide.SIDE) { +- voxelshape = VoxelShapes.a(voxelshape, (VoxelShape) BlockRedstoneWire.h.get(enumdirection)); ++ voxelshape = VoxelShapes.a(voxelshape, BlockRedstoneWire.h.get(enumdirection)); + } else if (blockpropertyredstoneside == BlockPropertyRedstoneSide.UP) { +- voxelshape = VoxelShapes.a(voxelshape, (VoxelShape) BlockRedstoneWire.i.get(enumdirection)); ++ voxelshape = VoxelShapes.a(voxelshape, BlockRedstoneWire.i.get(enumdirection)); + } + } + +@@ -64,42 +64,42 @@ public class BlockRedstoneWire extends Block { + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return (VoxelShape) this.j.get(iblockdata.set(BlockRedstoneWire.POWER, 0)); ++ return this.j.get(iblockdata.set(BlockRedstoneWire.POWER, 0)); + } + + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- return this.a((IBlockAccess) blockactioncontext.getWorld(), this.o, blockactioncontext.getClickPosition()); ++ return this.a(blockactioncontext.getWorld(), this.o, blockactioncontext.getClickPosition()); + } + + private IBlockData a(IBlockAccess iblockaccess, IBlockData iblockdata, BlockPosition blockposition) { + boolean flag = n(iblockdata); + +- iblockdata = this.b(iblockaccess, (IBlockData) this.getBlockData().set(BlockRedstoneWire.POWER, iblockdata.get(BlockRedstoneWire.POWER)), blockposition); ++ iblockdata = this.b(iblockaccess, this.getBlockData().set(BlockRedstoneWire.POWER, iblockdata.get(BlockRedstoneWire.POWER)), blockposition); + if (flag && n(iblockdata)) { + return iblockdata; + } else { +- boolean flag1 = ((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.NORTH)).b(); +- boolean flag2 = ((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.SOUTH)).b(); +- boolean flag3 = ((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.EAST)).b(); +- boolean flag4 = ((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.WEST)).b(); ++ boolean flag1 = iblockdata.get(BlockRedstoneWire.NORTH).b(); ++ boolean flag2 = iblockdata.get(BlockRedstoneWire.SOUTH).b(); ++ boolean flag3 = iblockdata.get(BlockRedstoneWire.EAST).b(); ++ boolean flag4 = iblockdata.get(BlockRedstoneWire.WEST).b(); + boolean flag5 = !flag1 && !flag2; + boolean flag6 = !flag3 && !flag4; + + if (!flag4 && flag5) { +- iblockdata = (IBlockData) iblockdata.set(BlockRedstoneWire.WEST, BlockPropertyRedstoneSide.SIDE); ++ iblockdata = iblockdata.set(BlockRedstoneWire.WEST, BlockPropertyRedstoneSide.SIDE); + } + + if (!flag3 && flag5) { +- iblockdata = (IBlockData) iblockdata.set(BlockRedstoneWire.EAST, BlockPropertyRedstoneSide.SIDE); ++ iblockdata = iblockdata.set(BlockRedstoneWire.EAST, BlockPropertyRedstoneSide.SIDE); + } + + if (!flag1 && flag6) { +- iblockdata = (IBlockData) iblockdata.set(BlockRedstoneWire.NORTH, BlockPropertyRedstoneSide.SIDE); ++ iblockdata = iblockdata.set(BlockRedstoneWire.NORTH, BlockPropertyRedstoneSide.SIDE); + } + + if (!flag2 && flag6) { +- iblockdata = (IBlockData) iblockdata.set(BlockRedstoneWire.SOUTH, BlockPropertyRedstoneSide.SIDE); ++ iblockdata = iblockdata.set(BlockRedstoneWire.SOUTH, BlockPropertyRedstoneSide.SIDE); + } + + return iblockdata; +@@ -116,7 +116,7 @@ public class BlockRedstoneWire extends Block { + if (!((BlockPropertyRedstoneSide) iblockdata.get((IBlockState) BlockRedstoneWire.f.get(enumdirection))).b()) { + BlockPropertyRedstoneSide blockpropertyredstoneside = this.a(iblockaccess, blockposition, enumdirection, flag); + +- iblockdata = (IBlockData) iblockdata.set((IBlockState) BlockRedstoneWire.f.get(enumdirection), blockpropertyredstoneside); ++ iblockdata = iblockdata.set(BlockRedstoneWire.f.get(enumdirection), blockpropertyredstoneside); + } + } + +@@ -128,20 +128,20 @@ public class BlockRedstoneWire extends Block { + if (enumdirection == EnumDirection.DOWN) { + return iblockdata; + } else if (enumdirection == EnumDirection.UP) { +- return this.a((IBlockAccess) generatoraccess, iblockdata, blockposition); ++ return this.a(generatoraccess, iblockdata, blockposition); + } else { + BlockPropertyRedstoneSide blockpropertyredstoneside = this.a((IBlockAccess) generatoraccess, blockposition, enumdirection); + +- return blockpropertyredstoneside.b() == ((BlockPropertyRedstoneSide) iblockdata.get((IBlockState) BlockRedstoneWire.f.get(enumdirection))).b() && !m(iblockdata) ? (IBlockData) iblockdata.set((IBlockState) BlockRedstoneWire.f.get(enumdirection), blockpropertyredstoneside) : this.a((IBlockAccess) generatoraccess, (IBlockData) ((IBlockData) this.o.set(BlockRedstoneWire.POWER, iblockdata.get(BlockRedstoneWire.POWER))).set((IBlockState) BlockRedstoneWire.f.get(enumdirection), blockpropertyredstoneside), blockposition); ++ return blockpropertyredstoneside.b() == ((BlockPropertyRedstoneSide) iblockdata.get((IBlockState) BlockRedstoneWire.f.get(enumdirection))).b() && !m(iblockdata) ? iblockdata.set(BlockRedstoneWire.f.get(enumdirection), blockpropertyredstoneside) : this.a(generatoraccess, this.o.set(BlockRedstoneWire.POWER, iblockdata.get(BlockRedstoneWire.POWER)).set(BlockRedstoneWire.f.get(enumdirection), blockpropertyredstoneside), blockposition); + } + } + + private static boolean m(IBlockData iblockdata) { +- return ((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.NORTH)).b() && ((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.SOUTH)).b() && ((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.EAST)).b() && ((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.WEST)).b(); ++ return iblockdata.get(BlockRedstoneWire.NORTH).b() && iblockdata.get(BlockRedstoneWire.SOUTH).b() && iblockdata.get(BlockRedstoneWire.EAST).b() && iblockdata.get(BlockRedstoneWire.WEST).b(); + } + + private static boolean n(IBlockData iblockdata) { +- return !((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.NORTH)).b() && !((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.SOUTH)).b() && !((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.EAST)).b() && !((BlockPropertyRedstoneSide) iblockdata.get(BlockRedstoneWire.WEST)).b(); ++ return !iblockdata.get(BlockRedstoneWire.NORTH).b() && !iblockdata.get(BlockRedstoneWire.SOUTH).b() && !iblockdata.get(BlockRedstoneWire.EAST).b() && !iblockdata.get(BlockRedstoneWire.WEST).b(); + } + + @Override +@@ -153,7 +153,7 @@ public class BlockRedstoneWire extends Block { + EnumDirection enumdirection = (EnumDirection) iterator.next(); + BlockPropertyRedstoneSide blockpropertyredstoneside = (BlockPropertyRedstoneSide) iblockdata.get((IBlockState) BlockRedstoneWire.f.get(enumdirection)); + +- if (blockpropertyredstoneside != BlockPropertyRedstoneSide.NONE && !generatoraccess.getType(blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection)).a((Block) this)) { ++ if (blockpropertyredstoneside != BlockPropertyRedstoneSide.NONE && !generatoraccess.getType(blockposition_mutableblockposition.a(blockposition, enumdirection)).a(this)) { + blockposition_mutableblockposition.c(EnumDirection.DOWN); + IBlockData iblockdata1 = generatoraccess.getType(blockposition_mutableblockposition); + +@@ -164,7 +164,7 @@ public class BlockRedstoneWire extends Block { + a(iblockdata1, iblockdata2, generatoraccess, blockposition_mutableblockposition, i, j); + } + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection).c(EnumDirection.UP); ++ blockposition_mutableblockposition.a(blockposition, enumdirection).c(EnumDirection.UP); + IBlockData iblockdata3 = generatoraccess.getType(blockposition_mutableblockposition); + + if (!iblockdata3.a(Blocks.OBSERVER)) { +@@ -206,7 +206,7 @@ public class BlockRedstoneWire extends Block { + BlockPosition blockposition1 = blockposition.down(); + IBlockData iblockdata1 = iworldreader.getType(blockposition1); + +- return this.b((IBlockAccess) iworldreader, blockposition1, iblockdata1); ++ return this.b(iworldreader, blockposition1, iblockdata1); + } + + private boolean b(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata) { +@@ -331,7 +331,7 @@ public class BlockRedstoneWire extends Block { + int i = this.a(world, blockposition); + + // CraftBukkit start +- int oldPower = (Integer) iblockdata.get(BlockRedstoneWire.POWER); ++ int oldPower = iblockdata.get(BlockRedstoneWire.POWER); + if (oldPower != i) { + BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), oldPower, i); + world.getServer().getPluginManager().callEvent(event); +@@ -341,7 +341,7 @@ public class BlockRedstoneWire extends Block { + if (oldPower != i) { + // CraftBukkit end + if (world.getType(blockposition) == iblockdata) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneWire.POWER, i), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockRedstoneWire.POWER, i), 2); + } + + Set set = Sets.newHashSet(); +@@ -399,11 +399,11 @@ public class BlockRedstoneWire extends Block { + private int getPower(int min, IBlockData iblockdata) { return Math.max(min, getPower(iblockdata)); } // Paper - Optimize redstone + private int getPower(IBlockData iblockdata) { return this.o(iblockdata); } // Paper - OBFHELPER + private int o(IBlockData iblockdata) { +- return iblockdata.a((Block) this) ? (Integer) iblockdata.get(BlockRedstoneWire.POWER) : 0; ++ return iblockdata.a(this) ? iblockdata.get(BlockRedstoneWire.POWER) : 0; + } + + private void b(World world, BlockPosition blockposition) { +- if (world.getType(blockposition).a((Block) this)) { ++ if (world.getType(blockposition).a(this)) { + world.applyPhysics(blockposition, this); + EnumDirection[] aenumdirection = EnumDirection.values(); + int i = aenumdirection.length; +@@ -499,7 +499,7 @@ public class BlockRedstoneWire extends Block { + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { + if (this.p && enumdirection != EnumDirection.DOWN) { +- int i = (Integer) iblockdata.get(BlockRedstoneWire.POWER); ++ int i = iblockdata.get(BlockRedstoneWire.POWER); + + return i == 0 ? 0 : (enumdirection != EnumDirection.UP && !((BlockPropertyRedstoneSide) this.a(iblockaccess, iblockdata, blockposition).get((IBlockState) BlockRedstoneWire.f.get(enumdirection.opposite()))).b() ? 0 : i); + } else { +@@ -515,11 +515,11 @@ public class BlockRedstoneWire extends Block { + if (iblockdata.a(Blocks.REDSTONE_WIRE)) { + return true; + } else if (iblockdata.a(Blocks.REPEATER)) { +- EnumDirection enumdirection1 = (EnumDirection) iblockdata.get(BlockRepeater.FACING); ++ EnumDirection enumdirection1 = iblockdata.get(BlockFacingHorizontal.FACING); + + return enumdirection1 == enumdirection || enumdirection1.opposite() == enumdirection; + } else { +- return iblockdata.a(Blocks.OBSERVER) ? enumdirection == iblockdata.get(BlockObserver.FACING) : iblockdata.isPowerSource() && enumdirection != null; ++ return iblockdata.a(Blocks.OBSERVER) ? enumdirection == iblockdata.get(BlockDirectional.FACING) : iblockdata.isPowerSource() && enumdirection != null; + } + } + +@@ -532,11 +532,11 @@ public class BlockRedstoneWire extends Block { + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { + switch (enumblockrotation) { + case CLOCKWISE_180: +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockRedstoneWire.NORTH, iblockdata.get(BlockRedstoneWire.SOUTH))).set(BlockRedstoneWire.EAST, iblockdata.get(BlockRedstoneWire.WEST))).set(BlockRedstoneWire.SOUTH, iblockdata.get(BlockRedstoneWire.NORTH))).set(BlockRedstoneWire.WEST, iblockdata.get(BlockRedstoneWire.EAST)); ++ return iblockdata.set(BlockRedstoneWire.NORTH, iblockdata.get(BlockRedstoneWire.SOUTH)).set(BlockRedstoneWire.EAST, iblockdata.get(BlockRedstoneWire.WEST)).set(BlockRedstoneWire.SOUTH, iblockdata.get(BlockRedstoneWire.NORTH)).set(BlockRedstoneWire.WEST, iblockdata.get(BlockRedstoneWire.EAST)); + case COUNTERCLOCKWISE_90: +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockRedstoneWire.NORTH, iblockdata.get(BlockRedstoneWire.EAST))).set(BlockRedstoneWire.EAST, iblockdata.get(BlockRedstoneWire.SOUTH))).set(BlockRedstoneWire.SOUTH, iblockdata.get(BlockRedstoneWire.WEST))).set(BlockRedstoneWire.WEST, iblockdata.get(BlockRedstoneWire.NORTH)); ++ return iblockdata.set(BlockRedstoneWire.NORTH, iblockdata.get(BlockRedstoneWire.EAST)).set(BlockRedstoneWire.EAST, iblockdata.get(BlockRedstoneWire.SOUTH)).set(BlockRedstoneWire.SOUTH, iblockdata.get(BlockRedstoneWire.WEST)).set(BlockRedstoneWire.WEST, iblockdata.get(BlockRedstoneWire.NORTH)); + case CLOCKWISE_90: +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockRedstoneWire.NORTH, iblockdata.get(BlockRedstoneWire.WEST))).set(BlockRedstoneWire.EAST, iblockdata.get(BlockRedstoneWire.NORTH))).set(BlockRedstoneWire.SOUTH, iblockdata.get(BlockRedstoneWire.EAST))).set(BlockRedstoneWire.WEST, iblockdata.get(BlockRedstoneWire.SOUTH)); ++ return iblockdata.set(BlockRedstoneWire.NORTH, iblockdata.get(BlockRedstoneWire.WEST)).set(BlockRedstoneWire.EAST, iblockdata.get(BlockRedstoneWire.NORTH)).set(BlockRedstoneWire.SOUTH, iblockdata.get(BlockRedstoneWire.EAST)).set(BlockRedstoneWire.WEST, iblockdata.get(BlockRedstoneWire.SOUTH)); + default: + return iblockdata; + } +@@ -546,9 +546,9 @@ public class BlockRedstoneWire extends Block { + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { + switch (enumblockmirror) { + case LEFT_RIGHT: +- return (IBlockData) ((IBlockData) iblockdata.set(BlockRedstoneWire.NORTH, iblockdata.get(BlockRedstoneWire.SOUTH))).set(BlockRedstoneWire.SOUTH, iblockdata.get(BlockRedstoneWire.NORTH)); ++ return iblockdata.set(BlockRedstoneWire.NORTH, iblockdata.get(BlockRedstoneWire.SOUTH)).set(BlockRedstoneWire.SOUTH, iblockdata.get(BlockRedstoneWire.NORTH)); + case FRONT_BACK: +- return (IBlockData) ((IBlockData) iblockdata.set(BlockRedstoneWire.EAST, iblockdata.get(BlockRedstoneWire.WEST))).set(BlockRedstoneWire.WEST, iblockdata.get(BlockRedstoneWire.EAST)); ++ return iblockdata.set(BlockRedstoneWire.EAST, iblockdata.get(BlockRedstoneWire.WEST)).set(BlockRedstoneWire.WEST, iblockdata.get(BlockRedstoneWire.EAST)); + default: + return super.a(iblockdata, enumblockmirror); + } +@@ -567,8 +567,8 @@ public class BlockRedstoneWire extends Block { + if (m(iblockdata) || n(iblockdata)) { + IBlockData iblockdata1 = m(iblockdata) ? this.getBlockData() : this.o; + +- iblockdata1 = (IBlockData) iblockdata1.set(BlockRedstoneWire.POWER, iblockdata.get(BlockRedstoneWire.POWER)); +- iblockdata1 = this.a((IBlockAccess) world, iblockdata1, blockposition); ++ iblockdata1 = iblockdata1.set(BlockRedstoneWire.POWER, iblockdata.get(BlockRedstoneWire.POWER)); ++ iblockdata1 = this.a(world, iblockdata1, blockposition); + if (iblockdata1 != iblockdata) { + world.setTypeAndData(blockposition, iblockdata1, 3); + this.a(world, blockposition, iblockdata, iblockdata1); +diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java +index c051decd19ff763a061822bc2a4b03289dfe3ac7..9256626c3e3d5770ed23e0c994a94ed3d3d96e65 100644 +--- a/src/main/java/net/minecraft/server/BlockReed.java ++++ b/src/main/java/net/minecraft/server/BlockReed.java +@@ -10,7 +10,7 @@ public class BlockReed extends Block { + + protected BlockReed(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockReed.AGE, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockReed.AGE, 0)); + } + + @Override +@@ -31,18 +31,18 @@ public class BlockReed extends Block { + if (worldserver.isEmpty(blockposition.up())) { + int i; + +- for (i = 1; worldserver.getType(blockposition.down(i)).a((Block) this); ++i) { ++ for (i = 1; worldserver.getType(blockposition.down(i)).a(this); ++i) { + ; + } + + if (i < worldserver.paperConfig.reedMaxHeight) { // Paper - Configurable growth height +- int j = (Integer) iblockdata.get(BlockReed.AGE); ++ int j = iblockdata.get(BlockReed.AGE); + + if (j >= (byte) range(3, ((100.0F / worldserver.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition.up(), this.getBlockData()); // CraftBukkit +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockReed.AGE, 0), 4); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockReed.AGE, 0), 4); + } else { +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockReed.AGE, j + 1), 4); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockReed.AGE, j + 1), 4); + } + } + } +@@ -74,7 +74,7 @@ public class BlockReed extends Block { + IBlockData iblockdata2 = iworldreader.getType(blockposition1.shift(enumdirection)); + Fluid fluid = iworldreader.getFluid(blockposition1.shift(enumdirection)); + +- if (fluid.a((Tag) TagsFluid.WATER) || iblockdata2.a(Blocks.FROSTED_ICE)) { ++ if (fluid.a(TagsFluid.WATER) || iblockdata2.a(Blocks.FROSTED_ICE)) { + return true; + } + } +diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java +index de5ee6c9af67b7ce82c5b3699120f649fdd69652..4646f4d6186cb505caa05221f409f42c286f379b 100644 +--- a/src/main/java/net/minecraft/server/BlockSapling.java ++++ b/src/main/java/net/minecraft/server/BlockSapling.java +@@ -18,7 +18,7 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen + protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, BlockBase.Info blockbase_info) { + super(blockbase_info); + this.c = worldgentreeprovider; +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockSapling.STAGE, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockSapling.STAGE, 0)); + } + + @Override +@@ -58,8 +58,8 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen + } + + public void grow(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, Random random) { +- if ((Integer) iblockdata.get(BlockSapling.STAGE) == 0) { +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockSapling.STAGE), 4); ++ if (iblockdata.get(BlockSapling.STAGE) == 0) { ++ worldserver.setTypeAndData(blockposition, iblockdata.a((IBlockState) BlockSapling.STAGE), 4); + } else { + this.c.a(worldserver, worldserver.getChunkProvider().getChunkGenerator(), blockposition, iblockdata, random); + } +diff --git a/src/main/java/net/minecraft/server/BlockScaffolding.java b/src/main/java/net/minecraft/server/BlockScaffolding.java +index 903862a298c9aaded01488c81bd1cd7ebbfbef8d..6f3cfb5e006a035a109024fe3c6cc57bf973baa8 100644 +--- a/src/main/java/net/minecraft/server/BlockScaffolding.java ++++ b/src/main/java/net/minecraft/server/BlockScaffolding.java +@@ -15,7 +15,7 @@ public class BlockScaffolding extends Block implements IBlockWaterlogged { + + protected BlockScaffolding(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockScaffolding.a, 7)).set(BlockScaffolding.b, false)).set(BlockScaffolding.c, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockScaffolding.a, 7).set(BlockScaffolding.b, false).set(BlockScaffolding.c, false)); + } + + @Override +@@ -25,7 +25,7 @@ public class BlockScaffolding extends Block implements IBlockWaterlogged { + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return !voxelshapecollision.a(iblockdata.getBlock().getItem()) ? ((Boolean) iblockdata.get(BlockScaffolding.c) ? BlockScaffolding.e : BlockScaffolding.d) : VoxelShapes.b(); ++ return !voxelshapecollision.a(iblockdata.getBlock().getItem()) ? (iblockdata.get(BlockScaffolding.c) ? BlockScaffolding.e : BlockScaffolding.d) : VoxelShapes.b(); + } + + @Override +@@ -42,9 +42,9 @@ public class BlockScaffolding extends Block implements IBlockWaterlogged { + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { + BlockPosition blockposition = blockactioncontext.getClickPosition(); + World world = blockactioncontext.getWorld(); +- int i = a((IBlockAccess) world, blockposition); ++ int i = a(world, blockposition); + +- return (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockScaffolding.b, world.getFluid(blockposition).getType() == FluidTypes.WATER)).set(BlockScaffolding.a, i)).set(BlockScaffolding.c, this.a(world, blockposition, i)); ++ return this.getBlockData().set(BlockScaffolding.b, world.getFluid(blockposition).getType() == FluidTypes.WATER).set(BlockScaffolding.a, i).set(BlockScaffolding.c, this.a(world, blockposition, i)); + } + + @Override +@@ -57,8 +57,8 @@ public class BlockScaffolding extends Block implements IBlockWaterlogged { + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- if ((Boolean) iblockdata.get(BlockScaffolding.b)) { +- generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess)); ++ if (iblockdata.get(BlockScaffolding.b)) { ++ generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(generatoraccess)); + } + + if (!generatoraccess.s_()) { +@@ -70,12 +70,12 @@ public class BlockScaffolding extends Block implements IBlockWaterlogged { + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- int i = a((IBlockAccess) worldserver, blockposition); +- IBlockData iblockdata1 = (IBlockData) ((IBlockData) iblockdata.set(BlockScaffolding.a, i)).set(BlockScaffolding.c, this.a(worldserver, blockposition, i)); ++ int i = a(worldserver, blockposition); ++ IBlockData iblockdata1 = iblockdata.set(BlockScaffolding.a, i).set(BlockScaffolding.c, this.a(worldserver, blockposition, i)); + +- if ((Integer) iblockdata1.get(BlockScaffolding.a) == 7 && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit - BlockFadeEvent +- if ((Integer) iblockdata.get(BlockScaffolding.a) == 7) { +- worldserver.addEntity(new EntityFallingBlock(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (IBlockData) iblockdata1.set(BlockScaffolding.b, false))); ++ if (iblockdata1.get(BlockScaffolding.a) == 7 && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit - BlockFadeEvent ++ if (iblockdata.get(BlockScaffolding.a) == 7) { ++ worldserver.addEntity(new EntityFallingBlock(worldserver, (double) blockposition.getX() + 0.5D, blockposition.getY(), (double) blockposition.getZ() + 0.5D, iblockdata1.set(BlockScaffolding.b, false))); + } else { + worldserver.b(blockposition, true); + } +@@ -87,21 +87,21 @@ public class BlockScaffolding extends Block implements IBlockWaterlogged { + + @Override + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { +- return a((IBlockAccess) iworldreader, blockposition) < 7; ++ return a(iworldreader, blockposition) < 7; + } + + @Override + public VoxelShape c(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return voxelshapecollision.a(VoxelShapes.b(), blockposition, true) && !voxelshapecollision.b() ? BlockScaffolding.d : ((Integer) iblockdata.get(BlockScaffolding.a) != 0 && (Boolean) iblockdata.get(BlockScaffolding.c) && voxelshapecollision.a(BlockScaffolding.g, blockposition, true) ? BlockScaffolding.f : VoxelShapes.a()); ++ return voxelshapecollision.a(VoxelShapes.b(), blockposition, true) && !voxelshapecollision.b() ? BlockScaffolding.d : (iblockdata.get(BlockScaffolding.a) != 0 && iblockdata.get(BlockScaffolding.c) && voxelshapecollision.a(BlockScaffolding.g, blockposition, true) ? BlockScaffolding.f : VoxelShapes.a()); + } + + @Override + public Fluid d(IBlockData iblockdata) { +- return (Boolean) iblockdata.get(BlockScaffolding.b) ? FluidTypes.WATER.a(false) : super.d(iblockdata); ++ return iblockdata.get(BlockScaffolding.b) ? FluidTypes.WATER.a(false) : super.d(iblockdata); + } + + private boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, int i) { +- return i > 0 && !iblockaccess.getType(blockposition.down()).a((Block) this); ++ return i > 0 && !iblockaccess.getType(blockposition.down()).a(this); + } + + public static int a(IBlockAccess iblockaccess, BlockPosition blockposition) { +@@ -110,7 +110,7 @@ public class BlockScaffolding extends Block implements IBlockWaterlogged { + int i = 7; + + if (iblockdata.a(Blocks.SCAFFOLDING)) { +- i = (Integer) iblockdata.get(BlockScaffolding.a); ++ i = iblockdata.get(BlockScaffolding.a); + } else if (iblockdata.d(iblockaccess, blockposition_mutableblockposition, EnumDirection.UP)) { + return 0; + } +@@ -119,10 +119,10 @@ public class BlockScaffolding extends Block implements IBlockWaterlogged { + + while (iterator.hasNext()) { + EnumDirection enumdirection = (EnumDirection) iterator.next(); +- IBlockData iblockdata1 = iblockaccess.getType(blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection)); ++ IBlockData iblockdata1 = iblockaccess.getType(blockposition_mutableblockposition.a(blockposition, enumdirection)); + + if (iblockdata1.a(Blocks.SCAFFOLDING)) { +- i = Math.min(i, (Integer) iblockdata1.get(BlockScaffolding.a) + 1); ++ i = Math.min(i, iblockdata1.get(BlockScaffolding.a) + 1); + if (i == 1) { + break; + } +diff --git a/src/main/java/net/minecraft/server/BlockSnow.java b/src/main/java/net/minecraft/server/BlockSnow.java +index fd254e83a2a18a45a1f3fef65d08d3a1e3e2116a..796b04b13c860fa47d15f4ebdbc7cd4f439fc787 100644 +--- a/src/main/java/net/minecraft/server/BlockSnow.java ++++ b/src/main/java/net/minecraft/server/BlockSnow.java +@@ -10,14 +10,14 @@ public class BlockSnow extends Block { + + protected BlockSnow(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockSnow.LAYERS, 1)); ++ this.j(this.blockStateList.getBlockData().set(BlockSnow.LAYERS, 1)); + } + + @Override + public boolean a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, PathMode pathmode) { + switch (pathmode) { + case LAND: +- return (Integer) iblockdata.get(BlockSnow.LAYERS) < 5; ++ return iblockdata.get(BlockSnow.LAYERS) < 5; + case WATER: + return false; + case AIR: +@@ -29,22 +29,22 @@ public class BlockSnow extends Block { + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return BlockSnow.b[(Integer) iblockdata.get(BlockSnow.LAYERS)]; ++ return BlockSnow.b[iblockdata.get(BlockSnow.LAYERS)]; + } + + @Override + public VoxelShape c(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return BlockSnow.b[(Integer) iblockdata.get(BlockSnow.LAYERS) - 1]; ++ return BlockSnow.b[iblockdata.get(BlockSnow.LAYERS) - 1]; + } + + @Override + public VoxelShape e(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { +- return BlockSnow.b[(Integer) iblockdata.get(BlockSnow.LAYERS)]; ++ return BlockSnow.b[iblockdata.get(BlockSnow.LAYERS)]; + } + + @Override + public VoxelShape a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return BlockSnow.b[(Integer) iblockdata.get(BlockSnow.LAYERS)]; ++ return BlockSnow.b[iblockdata.get(BlockSnow.LAYERS)]; + } + + @Override +@@ -56,7 +56,7 @@ public class BlockSnow extends Block { + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { + IBlockData iblockdata1 = iworldreader.getType(blockposition.down()); + +- return !iblockdata1.a(Blocks.ICE) && !iblockdata1.a(Blocks.PACKED_ICE) && !iblockdata1.a(Blocks.BARRIER) ? (!iblockdata1.a(Blocks.HONEY_BLOCK) && !iblockdata1.a(Blocks.SOUL_SAND) ? Block.a(iblockdata1.getCollisionShape(iworldreader, blockposition.down()), EnumDirection.UP) || iblockdata1.getBlock() == this && (Integer) iblockdata1.get(BlockSnow.LAYERS) == 8 : true) : false; ++ return !iblockdata1.a(Blocks.ICE) && !iblockdata1.a(Blocks.PACKED_ICE) && !iblockdata1.a(Blocks.BARRIER) ? (!iblockdata1.a(Blocks.HONEY_BLOCK) && !iblockdata1.a(Blocks.SOUL_SAND) ? Block.a(iblockdata1.getCollisionShape(iworldreader, blockposition.down()), EnumDirection.UP) || iblockdata1.getBlock() == this && iblockdata1.get(BlockSnow.LAYERS) == 8 : true) : false; + } + + @Override +@@ -72,7 +72,7 @@ public class BlockSnow extends Block { + return; + } + // CraftBukkit end +- c(iblockdata, (World) worldserver, blockposition); ++ c(iblockdata, worldserver, blockposition); + worldserver.a(blockposition, false); + } + +@@ -80,7 +80,7 @@ public class BlockSnow extends Block { + + @Override + public boolean a(IBlockData iblockdata, BlockActionContext blockactioncontext) { +- int i = (Integer) iblockdata.get(BlockSnow.LAYERS); ++ int i = iblockdata.get(BlockSnow.LAYERS); + + return blockactioncontext.getItemStack().getItem() == this.getItem() && i < 8 ? (blockactioncontext.c() ? blockactioncontext.getClickedFace() == EnumDirection.UP : true) : i == 1; + } +@@ -90,10 +90,10 @@ public class BlockSnow extends Block { + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { + IBlockData iblockdata = blockactioncontext.getWorld().getType(blockactioncontext.getClickPosition()); + +- if (iblockdata.a((Block) this)) { +- int i = (Integer) iblockdata.get(BlockSnow.LAYERS); ++ if (iblockdata.a(this)) { ++ int i = iblockdata.get(BlockSnow.LAYERS); + +- return (IBlockData) iblockdata.set(BlockSnow.LAYERS, Math.min(8, i + 1)); ++ return iblockdata.set(BlockSnow.LAYERS, Math.min(8, i + 1)); + } else { + return super.getPlacedState(blockactioncontext); + } +diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java +index f80e60c924228f84a785840bc9da75a016787d65..86ffb78c0f59ef050ef65169861205c69f5b94d6 100644 +--- a/src/main/java/net/minecraft/server/BlockSoil.java ++++ b/src/main/java/net/minecraft/server/BlockSoil.java +@@ -14,7 +14,7 @@ public class BlockSoil extends Block { + + protected BlockSoil(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockSoil.MOISTURE, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockSoil.MOISTURE, 0)); + } + + @Override +@@ -58,16 +58,16 @@ public class BlockSoil extends Block { + + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- int i = (Integer) iblockdata.get(BlockSoil.MOISTURE); ++ int i = iblockdata.get(BlockSoil.MOISTURE); + +- if (!a((IWorldReader) worldserver, blockposition) && !worldserver.isRainingAt(blockposition.up())) { ++ if (!a(worldserver, blockposition) && !worldserver.isRainingAt(blockposition.up())) { + if (i > 0) { +- org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, i - 1), 2); // CraftBukkit ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(worldserver, blockposition, iblockdata.set(BlockSoil.MOISTURE, i - 1), 2); // CraftBukkit + } else if (!a((IBlockAccess) worldserver, blockposition)) { + fade(iblockdata, worldserver, blockposition); + } + } else if (i < 7) { +- org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockSoil.MOISTURE, 7), 2); // CraftBukkit ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleMoistureChangeEvent(worldserver, blockposition, iblockdata.set(BlockSoil.MOISTURE, 7), 2); // CraftBukkit + } + + } +@@ -125,7 +125,7 @@ public class BlockSoil extends Block { + } + + blockposition1 = (BlockPosition) iterator.next(); +- } while (!iworldreader.getFluid(blockposition1).a((Tag) TagsFluid.WATER)); ++ } while (!iworldreader.getFluid(blockposition1).a(TagsFluid.WATER)); + + return true; + } +diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java +index 9407c67c2b21473d5a7456f074a9860829d88393..2e1b85d5c4c771e2c03135dcd4b3cc34574ccc17 100644 +--- a/src/main/java/net/minecraft/server/BlockSponge.java ++++ b/src/main/java/net/minecraft/server/BlockSponge.java +@@ -44,9 +44,9 @@ public class BlockSponge extends Block { + BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator + + while (!queue.isEmpty()) { +- Tuple tuple = (Tuple) queue.poll(); +- BlockPosition blockposition1 = (BlockPosition) tuple.a(); +- int j = (Integer) tuple.b(); ++ Tuple tuple = queue.poll(); ++ BlockPosition blockposition1 = tuple.a(); ++ int j = tuple.b(); + EnumDirection[] aenumdirection = EnumDirection.values(); + int k = aenumdirection.length; + +@@ -59,7 +59,7 @@ public class BlockSponge extends Block { + // CraftBukkit end + Material material = iblockdata.getMaterial(); + +- if (fluid.a((Tag) TagsFluid.WATER)) { ++ if (fluid.a(TagsFluid.WATER)) { + if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).removeFluid(blockList, blockposition2, iblockdata) != FluidTypes.EMPTY) { // CraftBukkit + ++i; + if (j < 6) { +diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java +index 71b594ccc2a68e5f0a3066b6daa9ec6e879aec01..707407a4de9e441cf5613b4513aa25c2a3ad6b0b 100644 +--- a/src/main/java/net/minecraft/server/BlockStateEnum.java ++++ b/src/main/java/net/minecraft/server/BlockStateEnum.java +@@ -20,7 +20,7 @@ public class BlockStateEnum & INamable> extends IBlockState + + while (iterator.hasNext()) { + T t0 = iterator.next(); // Paper - Decompile fix +- String s1 = ((INamable) t0).getName(); ++ String s1 = t0.getName(); + + if (this.b.containsKey(s1)) { + throw new IllegalArgumentException("Multiple values have the same name '" + s1 + "'"); +@@ -42,7 +42,7 @@ public class BlockStateEnum & INamable> extends IBlockState + } + + public String a(T t0) { +- return ((INamable) t0).getName(); ++ return t0.getName(); + } + + public boolean equals_unused(Object object) { // Paper +@@ -67,7 +67,7 @@ public class BlockStateEnum & INamable> extends IBlockState + } + + public static & INamable> BlockStateEnum of(String s, Class oclass) { +- return a(s, oclass, (Predicate) Predicates.alwaysTrue()); ++ return a(s, oclass, Predicates.alwaysTrue()); + } + + public static & INamable> BlockStateEnum a(String s, Class oclass, Predicate predicate) { +@@ -77,11 +77,11 @@ public class BlockStateEnum & INamable> extends IBlockState + list.add(t); + } + } +- return a(s, oclass, (Collection) list); ++ return a(s, oclass, list); + } + + public static & INamable> BlockStateEnum of(String s, Class oclass, T... at) { +- return a(s, oclass, (Collection) Lists.newArrayList(at)); ++ return a(s, oclass, Lists.newArrayList(at)); + } + + public static & INamable> BlockStateEnum a(String s, Class oclass, Collection collection) { +diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java +index ce99f308689c8073bf4b6dd65604016aa0102f60..b69bd9be183d6e64e79adb330b5eb516d954fc22 100644 +--- a/src/main/java/net/minecraft/server/BlockStem.java ++++ b/src/main/java/net/minecraft/server/BlockStem.java +@@ -13,12 +13,12 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { + protected BlockStem(BlockStemmed blockstemmed, BlockBase.Info blockbase_info) { + super(blockbase_info); + this.blockFruit = blockstemmed; +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockStem.AGE, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockStem.AGE, 0)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return BlockStem.b[(Integer) iblockdata.get(BlockStem.AGE)]; ++ return BlockStem.b[iblockdata.get(BlockStem.AGE)]; + } + + @Override +@@ -29,13 +29,13 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { + if (worldserver.getLightLevel(blockposition, 0) >= 9) { +- float f = BlockCrops.a((Block) this, (IBlockAccess) worldserver, blockposition); ++ float f = BlockCrops.a(this, worldserver, blockposition); + + if (random.nextInt((int) ((100.0F / (this == Blocks.PUMPKIN_STEM ? worldserver.spigotConfig.pumpkinModifier : worldserver.spigotConfig.melonModifier)) * (25.0F / f)) + 1) == 0) { // Spigot +- int i = (Integer) iblockdata.get(BlockStem.AGE); ++ int i = iblockdata.get(BlockStem.AGE); + + if (i < 7) { +- iblockdata = (IBlockData) iblockdata.set(BlockStem.AGE, i + 1); ++ iblockdata = iblockdata.set(BlockStem.AGE, i + 1); + CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata, 2); // CraftBukkit + } else { + EnumDirection enumdirection = EnumDirection.EnumDirectionLimit.HORIZONTAL.a(random); +@@ -48,7 +48,7 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { + return; + } + // CraftBukkit end +- worldserver.setTypeUpdate(blockposition, (IBlockData) this.blockFruit.d().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection)); ++ worldserver.setTypeUpdate(blockposition, this.blockFruit.d().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection)); + } + } + } +@@ -58,7 +58,7 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { + + @Override + public boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, boolean flag) { +- return (Integer) iblockdata.get(BlockStem.AGE) != 7; ++ return iblockdata.get(BlockStem.AGE) != 7; + } + + @Override +@@ -68,8 +68,8 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { + + @Override + public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) { +- int i = Math.min(7, (Integer) iblockdata.get(BlockStem.AGE) + MathHelper.nextInt(worldserver.random, 2, 5)); +- IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockStem.AGE, i); ++ int i = Math.min(7, iblockdata.get(BlockStem.AGE) + MathHelper.nextInt(worldserver.random, 2, 5)); ++ IBlockData iblockdata1 = iblockdata.set(BlockStem.AGE, i); + + CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata1, 2); // CraftBukkit + if (i == 7) { +diff --git a/src/main/java/net/minecraft/server/BlockSweetBerryBush.java b/src/main/java/net/minecraft/server/BlockSweetBerryBush.java +index 679d4dd446efad0a8927f66cf3cd84802a3b08af..d24592eebcdb6d1a869583e255fff730cd5e02cc 100644 +--- a/src/main/java/net/minecraft/server/BlockSweetBerryBush.java ++++ b/src/main/java/net/minecraft/server/BlockSweetBerryBush.java +@@ -17,25 +17,25 @@ public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlan + + public BlockSweetBerryBush(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockSweetBerryBush.a, 0)); ++ this.j(this.blockStateList.getBlockData().set(BlockSweetBerryBush.a, 0)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return (Integer) iblockdata.get(BlockSweetBerryBush.a) == 0 ? BlockSweetBerryBush.b : ((Integer) iblockdata.get(BlockSweetBerryBush.a) < 3 ? BlockSweetBerryBush.c : super.b(iblockdata, iblockaccess, blockposition, voxelshapecollision)); ++ return iblockdata.get(BlockSweetBerryBush.a) == 0 ? BlockSweetBerryBush.b : (iblockdata.get(BlockSweetBerryBush.a) < 3 ? BlockSweetBerryBush.c : super.b(iblockdata, iblockaccess, blockposition, voxelshapecollision)); + } + + @Override + public boolean isTicking(IBlockData iblockdata) { +- return (Integer) iblockdata.get(BlockSweetBerryBush.a) < 3; ++ return iblockdata.get(BlockSweetBerryBush.a) < 3; + } + + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- int i = (Integer) iblockdata.get(BlockSweetBerryBush.a); ++ int i = iblockdata.get(BlockSweetBerryBush.a); + + if (i < 3 && random.nextInt(Math.max(1, (int) (100.0F / worldserver.spigotConfig.sweetBerryModifier) * 5)) == 0 && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { // Spigot +- CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, (IBlockData) iblockdata.set(BlockSweetBerryBush.a, i + 1), 2); // CraftBukkit ++ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata.set(BlockSweetBerryBush.a, i + 1), 2); // CraftBukkit + } + + } +@@ -44,7 +44,7 @@ public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlan + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { + if (entity instanceof EntityLiving && entity.getEntityType() != EntityTypes.FOX && entity.getEntityType() != EntityTypes.BEE) { + entity.a(iblockdata, new Vec3D(0.800000011920929D, 0.75D, 0.800000011920929D)); +- if (!world.isClientSide && (Integer) iblockdata.get(BlockSweetBerryBush.a) > 0 && (entity.D != entity.locX() || entity.F != entity.locZ())) { ++ if (!world.isClientSide && iblockdata.get(BlockSweetBerryBush.a) > 0 && (entity.D != entity.locX() || entity.F != entity.locZ())) { + double d0 = Math.abs(entity.locX() - entity.D); + double d1 = Math.abs(entity.locZ() - entity.F); + +@@ -60,7 +60,7 @@ public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlan + + @Override + public EnumInteractionResult interact(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) { +- int i = (Integer) iblockdata.get(BlockSweetBerryBush.a); ++ int i = iblockdata.get(BlockSweetBerryBush.a); + boolean flag = i == 3; + + if (!flag && entityhuman.b(enumhand).getItem() == Items.BONE_MEAL) { +@@ -77,8 +77,8 @@ public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlan + a(world, blockposition, CraftItemStack.asNMSCopy(itemStack)); + } + // CraftBukkit end +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_SWEET_BERRIES_PICK_FROM_BUSH, SoundCategory.BLOCKS, 1.0F, 0.8F + world.random.nextFloat() * 0.4F); +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSweetBerryBush.a, 1), 2); ++ world.playSound(null, blockposition, SoundEffects.ITEM_SWEET_BERRIES_PICK_FROM_BUSH, SoundCategory.BLOCKS, 1.0F, 0.8F + world.random.nextFloat() * 0.4F); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockSweetBerryBush.a, 1), 2); + return EnumInteractionResult.a(world.isClientSide); + } else { + return super.interact(iblockdata, world, blockposition, entityhuman, enumhand, movingobjectpositionblock); +@@ -92,7 +92,7 @@ public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlan + + @Override + public boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, boolean flag) { +- return (Integer) iblockdata.get(BlockSweetBerryBush.a) < 3; ++ return iblockdata.get(BlockSweetBerryBush.a) < 3; + } + + @Override +@@ -102,8 +102,8 @@ public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlan + + @Override + public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) { +- int i = Math.min(3, (Integer) iblockdata.get(BlockSweetBerryBush.a) + 1); ++ int i = Math.min(3, iblockdata.get(BlockSweetBerryBush.a) + 1); + +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockSweetBerryBush.a, i), 2); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockSweetBerryBush.a, i), 2); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java +index 1f54c5e97adc0de5db11d7ec0708f5796fedd453..0c448d9e60b12efd3db5c9b06f87e3ee5f955d8e 100644 +--- a/src/main/java/net/minecraft/server/BlockTNT.java ++++ b/src/main/java/net/minecraft/server/BlockTNT.java +@@ -10,7 +10,7 @@ public class BlockTNT extends Block { + + public BlockTNT(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) this.getBlockData().set(BlockTNT.a, false)); ++ this.j(this.getBlockData().set(BlockTNT.a, false)); + } + + @Override +@@ -45,7 +45,7 @@ public class BlockTNT extends Block { + + @Override + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) { +- if (!world.s_() && !entityhuman.isCreative() && (Boolean) iblockdata.get(BlockTNT.a)) { ++ if (!world.s_() && !entityhuman.isCreative() && iblockdata.get(BlockTNT.a)) { + a(world, blockposition); + } + +@@ -61,7 +61,7 @@ public class BlockTNT extends Block { + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.EXPLOSION, source).callEvent()) + return; + // Paper end +- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, explosion.getSource()); ++ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, blockposition.getY(), (double) blockposition.getZ() + 0.5D, explosion.getSource()); + + entitytntprimed.setFuseTicks((short) (world.random.nextInt(entitytntprimed.getFuseTicks() / 4) + entitytntprimed.getFuseTicks() / 8)); + world.addEntity(entitytntprimed); +@@ -74,10 +74,10 @@ public class BlockTNT extends Block { + + private static void a(World world, BlockPosition blockposition, @Nullable EntityLiving entityliving) { + if (!world.isClientSide) { +- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, entityliving); ++ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, blockposition.getY(), (double) blockposition.getZ() + 0.5D, entityliving); + + world.addEntity(entitytntprimed); +- world.playSound((EntityHuman) null, entitytntprimed.locX(), entitytntprimed.locY(), entitytntprimed.locZ(), SoundEffects.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, entitytntprimed.locX(), entitytntprimed.locY(), entitytntprimed.locZ(), SoundEffects.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + } + +@@ -94,7 +94,7 @@ public class BlockTNT extends Block { + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.ITEM, entityhuman.getBukkitEntity()).callEvent()) + return EnumInteractionResult.FAIL; + // Paper end +- a(world, blockposition, (EntityLiving) entityhuman); ++ a(world, blockposition, entityhuman); + world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 11); + if (!entityhuman.isCreative()) { + if (item == Items.FLINT_AND_STEEL) { +diff --git a/src/main/java/net/minecraft/server/BlockTallPlant.java b/src/main/java/net/minecraft/server/BlockTallPlant.java +index 446a2ffcd95fd631750b74fd31b4c41013b8a5a8..2ac7bf0f02a72ac730a35ae2d83191aa631300aa 100644 +--- a/src/main/java/net/minecraft/server/BlockTallPlant.java ++++ b/src/main/java/net/minecraft/server/BlockTallPlant.java +@@ -8,14 +8,14 @@ public class BlockTallPlant extends BlockPlant { + + public BlockTallPlant(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockTallPlant.HALF, BlockPropertyDoubleBlockHalf.LOWER)); ++ this.j(this.blockStateList.getBlockData().set(BlockTallPlant.HALF, BlockPropertyDoubleBlockHalf.LOWER)); + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- BlockPropertyDoubleBlockHalf blockpropertydoubleblockhalf = (BlockPropertyDoubleBlockHalf) iblockdata.get(BlockTallPlant.HALF); ++ BlockPropertyDoubleBlockHalf blockpropertydoubleblockhalf = iblockdata.get(BlockTallPlant.HALF); + +- return enumdirection.n() == EnumDirection.EnumAxis.Y && blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.LOWER == (enumdirection == EnumDirection.UP) && (!iblockdata1.a((Block) this) || iblockdata1.get(BlockTallPlant.HALF) == blockpropertydoubleblockhalf) ? Blocks.AIR.getBlockData() : (blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.LOWER && enumdirection == EnumDirection.DOWN && !iblockdata.canPlace(generatoraccess, blockposition) ? Blocks.AIR.getBlockData() : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1)); ++ return enumdirection.n() == EnumDirection.EnumAxis.Y && blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.LOWER == (enumdirection == EnumDirection.UP) && (!iblockdata1.a(this) || iblockdata1.get(BlockTallPlant.HALF) == blockpropertydoubleblockhalf) ? Blocks.AIR.getBlockData() : (blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.LOWER && enumdirection == EnumDirection.DOWN && !iblockdata.canPlace(generatoraccess, blockposition) ? Blocks.AIR.getBlockData() : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1)); + } + + @Nullable +@@ -28,7 +28,7 @@ public class BlockTallPlant extends BlockPlant { + + @Override + public void postPlace(World world, BlockPosition blockposition, IBlockData iblockdata, EntityLiving entityliving, ItemStack itemstack) { +- world.setTypeAndData(blockposition.up(), (IBlockData) this.getBlockData().set(BlockTallPlant.HALF, BlockPropertyDoubleBlockHalf.UPPER), 3); ++ world.setTypeAndData(blockposition.up(), this.getBlockData().set(BlockTallPlant.HALF, BlockPropertyDoubleBlockHalf.UPPER), 3); + } + + @Override +@@ -38,13 +38,13 @@ public class BlockTallPlant extends BlockPlant { + } else { + IBlockData iblockdata1 = iworldreader.getType(blockposition.down()); + +- return iblockdata1.a((Block) this) && iblockdata1.get(BlockTallPlant.HALF) == BlockPropertyDoubleBlockHalf.LOWER; ++ return iblockdata1.a(this) && iblockdata1.get(BlockTallPlant.HALF) == BlockPropertyDoubleBlockHalf.LOWER; + } + } + + public void a(GeneratorAccess generatoraccess, BlockPosition blockposition, int i) { +- generatoraccess.setTypeAndData(blockposition, (IBlockData) this.getBlockData().set(BlockTallPlant.HALF, BlockPropertyDoubleBlockHalf.LOWER), i); +- generatoraccess.setTypeAndData(blockposition.up(), (IBlockData) this.getBlockData().set(BlockTallPlant.HALF, BlockPropertyDoubleBlockHalf.UPPER), i); ++ generatoraccess.setTypeAndData(blockposition, this.getBlockData().set(BlockTallPlant.HALF, BlockPropertyDoubleBlockHalf.LOWER), i); ++ generatoraccess.setTypeAndData(blockposition.up(), this.getBlockData().set(BlockTallPlant.HALF, BlockPropertyDoubleBlockHalf.UPPER), i); + } + + @Override +@@ -53,7 +53,7 @@ public class BlockTallPlant extends BlockPlant { + if (entityhuman.isCreative()) { + b(world, blockposition, iblockdata, entityhuman); + } else { +- dropItems(iblockdata, world, blockposition, (TileEntity) null, entityhuman, entityhuman.getItemInMainHand()); ++ dropItems(iblockdata, world, blockposition, null, entityhuman, entityhuman.getItemInMainHand()); + } + } + +@@ -71,7 +71,7 @@ public class BlockTallPlant extends BlockPlant { + return; + } + // CraftBukkit end +- BlockPropertyDoubleBlockHalf blockpropertydoubleblockhalf = (BlockPropertyDoubleBlockHalf) iblockdata.get(BlockTallPlant.HALF); ++ BlockPropertyDoubleBlockHalf blockpropertydoubleblockhalf = iblockdata.get(BlockTallPlant.HALF); + + if (blockpropertydoubleblockhalf == BlockPropertyDoubleBlockHalf.UPPER) { + BlockPosition blockposition1 = blockposition.down(); +diff --git a/src/main/java/net/minecraft/server/BlockTrapdoor.java b/src/main/java/net/minecraft/server/BlockTrapdoor.java +index 49b3f24162067a28f7886c3ab3bde8c031371350..6bf31517378fa5169bb9be1c1ab09999e78befd7 100644 +--- a/src/main/java/net/minecraft/server/BlockTrapdoor.java ++++ b/src/main/java/net/minecraft/server/BlockTrapdoor.java +@@ -19,7 +19,7 @@ public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterl + + protected BlockTrapdoor(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockTrapdoor.FACING, EnumDirection.NORTH)).set(BlockTrapdoor.OPEN, false)).set(BlockTrapdoor.HALF, BlockPropertyHalf.BOTTOM)).set(BlockTrapdoor.c, false)).set(BlockTrapdoor.d, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockFacingHorizontal.FACING, EnumDirection.NORTH).set(BlockTrapdoor.OPEN, false).set(BlockTrapdoor.HALF, BlockPropertyHalf.BOTTOM).set(BlockTrapdoor.c, false).set(BlockTrapdoor.d, false)); + } + + @Override +@@ -27,7 +27,7 @@ public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterl + if (!(Boolean) iblockdata.get(BlockTrapdoor.OPEN)) { + return iblockdata.get(BlockTrapdoor.HALF) == BlockPropertyHalf.TOP ? BlockTrapdoor.j : BlockTrapdoor.i; + } else { +- switch ((EnumDirection) iblockdata.get(BlockTrapdoor.FACING)) { ++ switch (iblockdata.get(BlockFacingHorizontal.FACING)) { + case NORTH: + default: + return BlockTrapdoor.h; +@@ -45,11 +45,11 @@ public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterl + public boolean a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, PathMode pathmode) { + switch (pathmode) { + case LAND: +- return (Boolean) iblockdata.get(BlockTrapdoor.OPEN); ++ return iblockdata.get(BlockTrapdoor.OPEN); + case WATER: +- return (Boolean) iblockdata.get(BlockTrapdoor.d); ++ return iblockdata.get(BlockTrapdoor.d); + case AIR: +- return (Boolean) iblockdata.get(BlockTrapdoor.OPEN); ++ return iblockdata.get(BlockTrapdoor.OPEN); + default: + return false; + } +@@ -60,13 +60,13 @@ public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterl + if (this.material == Material.ORE) { + return EnumInteractionResult.PASS; + } else { +- iblockdata = (IBlockData) iblockdata.a((IBlockState) BlockTrapdoor.OPEN); ++ iblockdata = iblockdata.a((IBlockState) BlockTrapdoor.OPEN); + world.setTypeAndData(blockposition, iblockdata, 2); +- if ((Boolean) iblockdata.get(BlockTrapdoor.d)) { +- world.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) world)); ++ if (iblockdata.get(BlockTrapdoor.d)) { ++ world.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(world)); + } + +- this.a(entityhuman, world, blockposition, (Boolean) iblockdata.get(BlockTrapdoor.OPEN)); ++ this.a(entityhuman, world, blockposition, iblockdata.get(BlockTrapdoor.OPEN)); + return EnumInteractionResult.a(world.isClientSide); + } + } +@@ -89,13 +89,13 @@ public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterl + if (!world.isClientSide) { + boolean flag1 = world.isBlockIndirectlyPowered(blockposition); + +- if (flag1 != (Boolean) iblockdata.get(BlockTrapdoor.c)) { ++ if (flag1 != iblockdata.get(BlockTrapdoor.c)) { + // CraftBukkit start + org.bukkit.World bworld = world.getWorld(); + org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + + int power = bblock.getBlockPower(); +- int oldPower = (Boolean) iblockdata.get(OPEN) ? 15 : 0; ++ int oldPower = iblockdata.get(OPEN) ? 15 : 0; + + if (oldPower == 0 ^ power == 0 || block.getBlockData().isPowerSource()) { + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bblock, oldPower, power); +@@ -103,14 +103,14 @@ public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterl + flag1 = eventRedstone.getNewCurrent() > 0; + } + // CraftBukkit end +- if ((Boolean) iblockdata.get(BlockTrapdoor.OPEN) != flag1) { +- iblockdata = (IBlockData) iblockdata.set(BlockTrapdoor.OPEN, flag1); +- this.a((EntityHuman) null, world, blockposition, flag1); ++ if (iblockdata.get(BlockTrapdoor.OPEN) != flag1) { ++ iblockdata = iblockdata.set(BlockTrapdoor.OPEN, flag1); ++ this.a(null, world, blockposition, flag1); + } + +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTrapdoor.c, flag1), 2); +- if ((Boolean) iblockdata.get(BlockTrapdoor.d)) { +- world.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) world)); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockTrapdoor.c, flag1), 2); ++ if (iblockdata.get(BlockTrapdoor.d)) { ++ world.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(world)); + } + } + +@@ -124,32 +124,32 @@ public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterl + EnumDirection enumdirection = blockactioncontext.getClickedFace(); + + if (!blockactioncontext.c() && enumdirection.n().d()) { +- iblockdata = (IBlockData) ((IBlockData) iblockdata.set(BlockTrapdoor.FACING, enumdirection)).set(BlockTrapdoor.HALF, blockactioncontext.getPos().y - (double) blockactioncontext.getClickPosition().getY() > 0.5D ? BlockPropertyHalf.TOP : BlockPropertyHalf.BOTTOM); ++ iblockdata = iblockdata.set(BlockFacingHorizontal.FACING, enumdirection).set(BlockTrapdoor.HALF, blockactioncontext.getPos().y - (double) blockactioncontext.getClickPosition().getY() > 0.5D ? BlockPropertyHalf.TOP : BlockPropertyHalf.BOTTOM); + } else { +- iblockdata = (IBlockData) ((IBlockData) iblockdata.set(BlockTrapdoor.FACING, blockactioncontext.f().opposite())).set(BlockTrapdoor.HALF, enumdirection == EnumDirection.UP ? BlockPropertyHalf.BOTTOM : BlockPropertyHalf.TOP); ++ iblockdata = iblockdata.set(BlockFacingHorizontal.FACING, blockactioncontext.f().opposite()).set(BlockTrapdoor.HALF, enumdirection == EnumDirection.UP ? BlockPropertyHalf.BOTTOM : BlockPropertyHalf.TOP); + } + + if (blockactioncontext.getWorld().isBlockIndirectlyPowered(blockactioncontext.getClickPosition())) { +- iblockdata = (IBlockData) ((IBlockData) iblockdata.set(BlockTrapdoor.OPEN, true)).set(BlockTrapdoor.c, true); ++ iblockdata = iblockdata.set(BlockTrapdoor.OPEN, true).set(BlockTrapdoor.c, true); + } + +- return (IBlockData) iblockdata.set(BlockTrapdoor.d, fluid.getType() == FluidTypes.WATER); ++ return iblockdata.set(BlockTrapdoor.d, fluid.getType() == FluidTypes.WATER); + } + + @Override + protected void a(BlockStateList.a blockstatelist_a) { +- blockstatelist_a.a(BlockTrapdoor.FACING, BlockTrapdoor.OPEN, BlockTrapdoor.HALF, BlockTrapdoor.c, BlockTrapdoor.d); ++ blockstatelist_a.a(BlockFacingHorizontal.FACING, BlockTrapdoor.OPEN, BlockTrapdoor.HALF, BlockTrapdoor.c, BlockTrapdoor.d); + } + + @Override + public Fluid d(IBlockData iblockdata) { +- return (Boolean) iblockdata.get(BlockTrapdoor.d) ? FluidTypes.WATER.a(false) : super.d(iblockdata); ++ return iblockdata.get(BlockTrapdoor.d) ? FluidTypes.WATER.a(false) : super.d(iblockdata); + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- if ((Boolean) iblockdata.get(BlockTrapdoor.d)) { +- generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess)); ++ if (iblockdata.get(BlockTrapdoor.d)) { ++ generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a(generatoraccess)); + } + + return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); +diff --git a/src/main/java/net/minecraft/server/BlockTripwire.java b/src/main/java/net/minecraft/server/BlockTripwire.java +index e04bf62581a5d0fca29bf2d49bab7c3d37fe7cfa..624aaadecb96b1af7f21fd6c564f757d0306e646 100644 +--- a/src/main/java/net/minecraft/server/BlockTripwire.java ++++ b/src/main/java/net/minecraft/server/BlockTripwire.java +@@ -23,13 +23,13 @@ public class BlockTripwire extends Block { + + public BlockTripwire(BlockTripwireHook blocktripwirehook, BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockTripwire.POWERED, false)).set(BlockTripwire.ATTACHED, false)).set(BlockTripwire.DISARMED, false)).set(BlockTripwire.NORTH, false)).set(BlockTripwire.EAST, false)).set(BlockTripwire.SOUTH, false)).set(BlockTripwire.WEST, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockTripwire.POWERED, false).set(BlockTripwire.ATTACHED, false).set(BlockTripwire.DISARMED, false).set(BlockTripwire.NORTH, false).set(BlockTripwire.EAST, false).set(BlockTripwire.SOUTH, false).set(BlockTripwire.WEST, false)); + this.k = blocktripwirehook; + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return (Boolean) iblockdata.get(BlockTripwire.ATTACHED) ? BlockTripwire.h : BlockTripwire.i; ++ return iblockdata.get(BlockTripwire.ATTACHED) ? BlockTripwire.h : BlockTripwire.i; + } + + @Override +@@ -37,12 +37,12 @@ public class BlockTripwire extends Block { + World world = blockactioncontext.getWorld(); + BlockPosition blockposition = blockactioncontext.getClickPosition(); + +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockTripwire.NORTH, this.a(world.getType(blockposition.north()), EnumDirection.NORTH))).set(BlockTripwire.EAST, this.a(world.getType(blockposition.east()), EnumDirection.EAST))).set(BlockTripwire.SOUTH, this.a(world.getType(blockposition.south()), EnumDirection.SOUTH))).set(BlockTripwire.WEST, this.a(world.getType(blockposition.west()), EnumDirection.WEST)); ++ return this.getBlockData().set(BlockTripwire.NORTH, this.a(world.getType(blockposition.north()), EnumDirection.NORTH)).set(BlockTripwire.EAST, this.a(world.getType(blockposition.east()), EnumDirection.EAST)).set(BlockTripwire.SOUTH, this.a(world.getType(blockposition.south()), EnumDirection.SOUTH)).set(BlockTripwire.WEST, this.a(world.getType(blockposition.west()), EnumDirection.WEST)); + } + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- return enumdirection.n().d() ? (IBlockData) iblockdata.set((IBlockState) BlockTripwire.j.get(enumdirection), this.a(iblockdata1, enumdirection)) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); ++ return enumdirection.n().d() ? iblockdata.set(BlockTripwire.j.get(enumdirection), this.a(iblockdata1, enumdirection)) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1); + } + + @Override +@@ -55,14 +55,14 @@ public class BlockTripwire extends Block { + @Override + public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!flag && !iblockdata.a(iblockdata1.getBlock())) { +- this.a(world, blockposition, (IBlockData) iblockdata.set(BlockTripwire.POWERED, true)); ++ this.a(world, blockposition, iblockdata.set(BlockTripwire.POWERED, true)); + } + } + + @Override + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) { + if (!world.isClientSide && !entityhuman.getItemInMainHand().isEmpty() && entityhuman.getItemInMainHand().getItem() == Items.SHEARS) { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTripwire.DISARMED, true), 4); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockTripwire.DISARMED, true), 4); + } + + super.a(world, blockposition, iblockdata, entityhuman); +@@ -82,11 +82,11 @@ public class BlockTripwire extends Block { + BlockPosition blockposition1 = blockposition.shift(enumdirection, k); + IBlockData iblockdata1 = world.getType(blockposition1); + +- if (iblockdata1.a((Block) this.k)) { ++ if (iblockdata1.a(this.k)) { + if (iblockdata1.get(BlockTripwireHook.FACING) == enumdirection.opposite()) { + this.k.a(world, blockposition1, iblockdata1, false, true, k, iblockdata); + } +- } else if (iblockdata1.a((Block) this)) { ++ } else if (iblockdata1.a(this)) { + ++k; + continue; + } +@@ -110,16 +110,16 @@ public class BlockTripwire extends Block { + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if ((Boolean) worldserver.getType(blockposition).get(BlockTripwire.POWERED)) { +- this.a((World) worldserver, blockposition); ++ if (worldserver.getType(blockposition).get(BlockTripwire.POWERED)) { ++ this.a(worldserver, blockposition); + } + } + + private void a(World world, BlockPosition blockposition) { + IBlockData iblockdata = world.getType(blockposition); +- boolean flag = (Boolean) iblockdata.get(BlockTripwire.POWERED); ++ boolean flag = iblockdata.get(BlockTripwire.POWERED); + boolean flag1 = false; +- List list = world.getEntities((Entity) null, iblockdata.getShape(world, blockposition).getBoundingBox().a(blockposition)); ++ List list = world.getEntities(null, iblockdata.getShape(world, blockposition).getBoundingBox().a(blockposition)); + + if (!list.isEmpty()) { + Iterator iterator = list.iterator(); +@@ -135,7 +135,7 @@ public class BlockTripwire extends Block { + } + + // CraftBukkit start - Call interact even when triggering connected tripwire +- if (flag != flag1 && flag1 && (Boolean)iblockdata.get(ATTACHED)) { ++ if (flag != flag1 && flag1 && iblockdata.get(ATTACHED)) { + org.bukkit.World bworld = world.getWorld(); + org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager(); + org.bukkit.block.Block block = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); +@@ -169,7 +169,7 @@ public class BlockTripwire extends Block { + // CraftBukkit end + + if (flag1 != flag) { +- iblockdata = (IBlockData) iblockdata.set(BlockTripwire.POWERED, flag1); ++ iblockdata = iblockdata.set(BlockTripwire.POWERED, flag1); + world.setTypeAndData(blockposition, iblockdata, 3); + this.a(world, blockposition, iblockdata); + } +@@ -190,11 +190,11 @@ public class BlockTripwire extends Block { + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { + switch (enumblockrotation) { + case CLOCKWISE_180: +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockTripwire.NORTH, iblockdata.get(BlockTripwire.SOUTH))).set(BlockTripwire.EAST, iblockdata.get(BlockTripwire.WEST))).set(BlockTripwire.SOUTH, iblockdata.get(BlockTripwire.NORTH))).set(BlockTripwire.WEST, iblockdata.get(BlockTripwire.EAST)); ++ return iblockdata.set(BlockTripwire.NORTH, iblockdata.get(BlockTripwire.SOUTH)).set(BlockTripwire.EAST, iblockdata.get(BlockTripwire.WEST)).set(BlockTripwire.SOUTH, iblockdata.get(BlockTripwire.NORTH)).set(BlockTripwire.WEST, iblockdata.get(BlockTripwire.EAST)); + case COUNTERCLOCKWISE_90: +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockTripwire.NORTH, iblockdata.get(BlockTripwire.EAST))).set(BlockTripwire.EAST, iblockdata.get(BlockTripwire.SOUTH))).set(BlockTripwire.SOUTH, iblockdata.get(BlockTripwire.WEST))).set(BlockTripwire.WEST, iblockdata.get(BlockTripwire.NORTH)); ++ return iblockdata.set(BlockTripwire.NORTH, iblockdata.get(BlockTripwire.EAST)).set(BlockTripwire.EAST, iblockdata.get(BlockTripwire.SOUTH)).set(BlockTripwire.SOUTH, iblockdata.get(BlockTripwire.WEST)).set(BlockTripwire.WEST, iblockdata.get(BlockTripwire.NORTH)); + case CLOCKWISE_90: +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockTripwire.NORTH, iblockdata.get(BlockTripwire.WEST))).set(BlockTripwire.EAST, iblockdata.get(BlockTripwire.NORTH))).set(BlockTripwire.SOUTH, iblockdata.get(BlockTripwire.EAST))).set(BlockTripwire.WEST, iblockdata.get(BlockTripwire.SOUTH)); ++ return iblockdata.set(BlockTripwire.NORTH, iblockdata.get(BlockTripwire.WEST)).set(BlockTripwire.EAST, iblockdata.get(BlockTripwire.NORTH)).set(BlockTripwire.SOUTH, iblockdata.get(BlockTripwire.EAST)).set(BlockTripwire.WEST, iblockdata.get(BlockTripwire.SOUTH)); + default: + return iblockdata; + } +@@ -204,9 +204,9 @@ public class BlockTripwire extends Block { + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { + switch (enumblockmirror) { + case LEFT_RIGHT: +- return (IBlockData) ((IBlockData) iblockdata.set(BlockTripwire.NORTH, iblockdata.get(BlockTripwire.SOUTH))).set(BlockTripwire.SOUTH, iblockdata.get(BlockTripwire.NORTH)); ++ return iblockdata.set(BlockTripwire.NORTH, iblockdata.get(BlockTripwire.SOUTH)).set(BlockTripwire.SOUTH, iblockdata.get(BlockTripwire.NORTH)); + case FRONT_BACK: +- return (IBlockData) ((IBlockData) iblockdata.set(BlockTripwire.EAST, iblockdata.get(BlockTripwire.WEST))).set(BlockTripwire.WEST, iblockdata.get(BlockTripwire.EAST)); ++ return iblockdata.set(BlockTripwire.EAST, iblockdata.get(BlockTripwire.WEST)).set(BlockTripwire.WEST, iblockdata.get(BlockTripwire.EAST)); + default: + return super.a(iblockdata, enumblockmirror); + } +diff --git a/src/main/java/net/minecraft/server/BlockTripwireHook.java b/src/main/java/net/minecraft/server/BlockTripwireHook.java +index fabc713798e7292d376db4ba74d2820ed18bd4e8..79504efb77dcc03769cec6732dff07024b0be505 100644 +--- a/src/main/java/net/minecraft/server/BlockTripwireHook.java ++++ b/src/main/java/net/minecraft/server/BlockTripwireHook.java +@@ -18,12 +18,12 @@ public class BlockTripwireHook extends Block { + + public BlockTripwireHook(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockTripwireHook.FACING, EnumDirection.NORTH)).set(BlockTripwireHook.POWERED, false)).set(BlockTripwireHook.ATTACHED, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockTripwireHook.FACING, EnumDirection.NORTH).set(BlockTripwireHook.POWERED, false).set(BlockTripwireHook.ATTACHED, false)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- switch ((EnumDirection) iblockdata.get(BlockTripwireHook.FACING)) { ++ switch (iblockdata.get(BlockTripwireHook.FACING)) { + case EAST: + default: + return BlockTripwireHook.g; +@@ -38,7 +38,7 @@ public class BlockTripwireHook extends Block { + + @Override + public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockTripwireHook.FACING); ++ EnumDirection enumdirection = iblockdata.get(BlockTripwireHook.FACING); + BlockPosition blockposition1 = blockposition.shift(enumdirection.opposite()); + IBlockData iblockdata1 = iworldreader.getType(blockposition1); + +@@ -53,7 +53,7 @@ public class BlockTripwireHook extends Block { + @Nullable + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { +- IBlockData iblockdata = (IBlockData) ((IBlockData) this.getBlockData().set(BlockTripwireHook.POWERED, false)).set(BlockTripwireHook.ATTACHED, false); ++ IBlockData iblockdata = this.getBlockData().set(BlockTripwireHook.POWERED, false).set(BlockTripwireHook.ATTACHED, false); + World world = blockactioncontext.getWorld(); + BlockPosition blockposition = blockactioncontext.getClickPosition(); + EnumDirection[] aenumdirection = blockactioncontext.e(); +@@ -66,7 +66,7 @@ public class BlockTripwireHook extends Block { + if (enumdirection.n().d()) { + EnumDirection enumdirection1 = enumdirection.opposite(); + +- iblockdata = (IBlockData) iblockdata.set(BlockTripwireHook.FACING, enumdirection1); ++ iblockdata = iblockdata.set(BlockTripwireHook.FACING, enumdirection1); + if (iblockdata.canPlace(world, blockposition)) { + return iblockdata; + } +@@ -78,13 +78,13 @@ public class BlockTripwireHook extends Block { + + @Override + public void postPlace(World world, BlockPosition blockposition, IBlockData iblockdata, EntityLiving entityliving, ItemStack itemstack) { +- this.a(world, blockposition, iblockdata, false, false, -1, (IBlockData) null); ++ this.a(world, blockposition, iblockdata, false, false, -1, null); + } + + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, boolean flag, boolean flag1, int i, @Nullable IBlockData iblockdata1) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockTripwireHook.FACING); +- boolean flag2 = (Boolean) iblockdata.get(BlockTripwireHook.ATTACHED); +- boolean flag3 = (Boolean) iblockdata.get(BlockTripwireHook.POWERED); ++ EnumDirection enumdirection = iblockdata.get(BlockTripwireHook.FACING); ++ boolean flag2 = iblockdata.get(BlockTripwireHook.ATTACHED); ++ boolean flag3 = iblockdata.get(BlockTripwireHook.POWERED); + boolean flag4 = !flag; + boolean flag5 = false; + int j = 0; +@@ -108,11 +108,11 @@ public class BlockTripwireHook extends Block { + flag4 = false; + } else { + if (k == i) { +- iblockdata2 = (IBlockData) MoreObjects.firstNonNull(iblockdata1, iblockdata2); ++ iblockdata2 = MoreObjects.firstNonNull(iblockdata1, iblockdata2); + } + + boolean flag6 = !(Boolean) iblockdata2.get(BlockTripwire.DISARMED); +- boolean flag7 = (Boolean) iblockdata2.get(BlockTripwire.POWERED); ++ boolean flag7 = iblockdata2.get(BlockTripwire.POWERED); + + flag5 |= flag6 && flag7; + aiblockdata[k] = iblockdata2; +@@ -125,13 +125,13 @@ public class BlockTripwireHook extends Block { + + flag4 &= j > 1; + flag5 &= flag4; +- IBlockData iblockdata3 = (IBlockData) ((IBlockData) this.getBlockData().set(BlockTripwireHook.ATTACHED, flag4)).set(BlockTripwireHook.POWERED, flag5); ++ IBlockData iblockdata3 = this.getBlockData().set(BlockTripwireHook.ATTACHED, flag4).set(BlockTripwireHook.POWERED, flag5); + + if (j > 0) { + blockposition1 = blockposition.shift(enumdirection, j); + EnumDirection enumdirection1 = enumdirection.opposite(); + +- world.setTypeAndData(blockposition1, (IBlockData) iblockdata3.set(BlockTripwireHook.FACING, enumdirection1), 3); ++ world.setTypeAndData(blockposition1, iblockdata3.set(BlockTripwireHook.FACING, enumdirection1), 3); + this.a(world, blockposition1, enumdirection1); + this.a(world, blockposition1, flag4, flag5, flag2, flag3); + } +@@ -150,7 +150,7 @@ public class BlockTripwireHook extends Block { + this.a(world, blockposition, flag4, flag5, flag2, flag3); + if (!flag) { + if (world.getType(blockposition).getBlock() == Blocks.TRIPWIRE_HOOK) // Paper - validate +- world.setTypeAndData(blockposition, (IBlockData) iblockdata3.set(BlockTripwireHook.FACING, enumdirection), 3); ++ world.setTypeAndData(blockposition, iblockdata3.set(BlockTripwireHook.FACING, enumdirection), 3); + if (flag1) { + this.a(world, blockposition, enumdirection); + } +@@ -162,7 +162,7 @@ public class BlockTripwireHook extends Block { + IBlockData iblockdata4 = aiblockdata[l]; + + if (iblockdata4 != null) { +- world.setTypeAndData(blockposition2, (IBlockData) iblockdata4.set(BlockTripwireHook.ATTACHED, flag4), 3); ++ world.setTypeAndData(blockposition2, iblockdata4.set(BlockTripwireHook.ATTACHED, flag4), 3); + if (!world.getType(blockposition2).isAir()) { + ; + } +@@ -174,18 +174,18 @@ public class BlockTripwireHook extends Block { + + @Override + public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- this.a(worldserver, blockposition, iblockdata, false, true, -1, (IBlockData) null); ++ this.a(worldserver, blockposition, iblockdata, false, true, -1, null); + } + + private void a(World world, BlockPosition blockposition, boolean flag, boolean flag1, boolean flag2, boolean flag3) { + if (flag1 && !flag3) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_TRIPWIRE_CLICK_ON, SoundCategory.BLOCKS, 0.4F, 0.6F); ++ world.playSound(null, blockposition, SoundEffects.BLOCK_TRIPWIRE_CLICK_ON, SoundCategory.BLOCKS, 0.4F, 0.6F); + } else if (!flag1 && flag3) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_TRIPWIRE_CLICK_OFF, SoundCategory.BLOCKS, 0.4F, 0.5F); ++ world.playSound(null, blockposition, SoundEffects.BLOCK_TRIPWIRE_CLICK_OFF, SoundCategory.BLOCKS, 0.4F, 0.5F); + } else if (flag && !flag2) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_TRIPWIRE_ATTACH, SoundCategory.BLOCKS, 0.4F, 0.7F); ++ world.playSound(null, blockposition, SoundEffects.BLOCK_TRIPWIRE_ATTACH, SoundCategory.BLOCKS, 0.4F, 0.7F); + } else if (!flag && flag2) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_TRIPWIRE_DETACH, SoundCategory.BLOCKS, 0.4F, 1.2F / (world.random.nextFloat() * 0.2F + 0.9F)); ++ world.playSound(null, blockposition, SoundEffects.BLOCK_TRIPWIRE_DETACH, SoundCategory.BLOCKS, 0.4F, 1.2F / (world.random.nextFloat() * 0.2F + 0.9F)); + } + + } +@@ -198,16 +198,16 @@ public class BlockTripwireHook extends Block { + @Override + public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { + if (!flag && !iblockdata.a(iblockdata1.getBlock())) { +- boolean flag1 = (Boolean) iblockdata.get(BlockTripwireHook.ATTACHED); +- boolean flag2 = (Boolean) iblockdata.get(BlockTripwireHook.POWERED); ++ boolean flag1 = iblockdata.get(BlockTripwireHook.ATTACHED); ++ boolean flag2 = iblockdata.get(BlockTripwireHook.POWERED); + + if (flag1 || flag2) { +- this.a(world, blockposition, iblockdata, true, false, -1, (IBlockData) null); ++ this.a(world, blockposition, iblockdata, true, false, -1, null); + } + + if (flag2) { + world.applyPhysics(blockposition, this); +- world.applyPhysics(blockposition.shift(((EnumDirection) iblockdata.get(BlockTripwireHook.FACING)).opposite()), this); ++ world.applyPhysics(blockposition.shift(iblockdata.get(BlockTripwireHook.FACING).opposite()), this); + } + + super.remove(iblockdata, world, blockposition, iblockdata1, flag); +@@ -216,7 +216,7 @@ public class BlockTripwireHook extends Block { + + @Override + public int a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { +- return (Boolean) iblockdata.get(BlockTripwireHook.POWERED) ? 15 : 0; ++ return iblockdata.get(BlockTripwireHook.POWERED) ? 15 : 0; + } + + @Override +@@ -231,12 +231,12 @@ public class BlockTripwireHook extends Block { + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { +- return (IBlockData) iblockdata.set(BlockTripwireHook.FACING, enumblockrotation.a((EnumDirection) iblockdata.get(BlockTripwireHook.FACING))); ++ return iblockdata.set(BlockTripwireHook.FACING, enumblockrotation.a(iblockdata.get(BlockTripwireHook.FACING))); + } + + @Override + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { +- return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockTripwireHook.FACING))); ++ return iblockdata.a(enumblockmirror.a(iblockdata.get(BlockTripwireHook.FACING))); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java +index 77478d89afd0dcaef3b726b1e320a72bbd30e04e..8c150ab8fa654e13796c081aa731f3475c0d3ff8 100644 +--- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java ++++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java +@@ -17,7 +17,7 @@ public class BlockTurtleEgg extends Block { + + public BlockTurtleEgg(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockTurtleEgg.a, 0)).set(BlockTurtleEgg.b, 1)); ++ this.j(this.blockStateList.getBlockData().set(BlockTurtleEgg.a, 0).set(BlockTurtleEgg.b, 1)); + } + + @Override +@@ -62,13 +62,13 @@ public class BlockTurtleEgg extends Block { + } + + private void a(World world, BlockPosition blockposition, IBlockData iblockdata) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_BREAK, SoundCategory.BLOCKS, 0.7F, 0.9F + world.random.nextFloat() * 0.2F); +- int i = (Integer) iblockdata.get(BlockTurtleEgg.b); ++ world.playSound(null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_BREAK, SoundCategory.BLOCKS, 0.7F, 0.9F + world.random.nextFloat() * 0.2F); ++ int i = iblockdata.get(BlockTurtleEgg.b); + + if (i <= 1) { + world.b(blockposition, false); + } else { +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTurtleEgg.b, i - 1), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockTurtleEgg.b, i - 1), 2); + world.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata)); + } + +@@ -76,8 +76,8 @@ public class BlockTurtleEgg extends Block { + + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) { +- if (this.a((World) worldserver) && a((IBlockAccess) worldserver, blockposition)) { +- int i = (Integer) iblockdata.get(BlockTurtleEgg.a); ++ if (this.a(worldserver) && a(worldserver, blockposition)) { ++ int i = iblockdata.get(BlockTurtleEgg.a); + + if (i < 2) { + // CraftBukkit start - Call BlockGrowEvent +@@ -85,7 +85,7 @@ public class BlockTurtleEgg extends Block { + return; + } + // CraftBukkit end +- worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_CRACK, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F); ++ worldserver.playSound(null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_CRACK, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F); + // worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockTurtleEgg.a, i + 1), 2); // CraftBukkit - handled above + } else { + // CraftBukkit start - Call BlockFadeEvent +@@ -93,16 +93,16 @@ public class BlockTurtleEgg extends Block { + return; + } + // CraftBukkit end +- worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F); ++ worldserver.playSound(null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F); + worldserver.a(blockposition, false); + +- for (int j = 0; j < (Integer) iblockdata.get(BlockTurtleEgg.b); ++j) { ++ for (int j = 0; j < iblockdata.get(BlockTurtleEgg.b); ++j) { + worldserver.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata)); +- EntityTurtle entityturtle = (EntityTurtle) EntityTypes.TURTLE.a((World) worldserver); ++ EntityTurtle entityturtle = EntityTypes.TURTLE.a(worldserver); + + entityturtle.setAgeRaw(-24000); + entityturtle.setHomePos(blockposition); +- entityturtle.setPositionRotation((double) blockposition.getX() + 0.3D + (double) j * 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F); ++ entityturtle.setPositionRotation((double) blockposition.getX() + 0.3D + (double) j * 0.2D, blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F); + worldserver.addEntity(entityturtle, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG); // CraftBukkit + } + } +@@ -115,12 +115,12 @@ public class BlockTurtleEgg extends Block { + } + + public static boolean b(IBlockAccess iblockaccess, BlockPosition blockposition) { +- return iblockaccess.getType(blockposition).a((Tag) TagsBlock.SAND); ++ return iblockaccess.getType(blockposition).a(TagsBlock.SAND); + } + + @Override + public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { +- if (a((IBlockAccess) world, blockposition) && !world.isClientSide) { ++ if (a(world, blockposition) && !world.isClientSide) { + world.triggerEffect(2005, blockposition, 0); + } + +@@ -140,7 +140,7 @@ public class BlockTurtleEgg extends Block { + + @Override + public boolean a(IBlockData iblockdata, BlockActionContext blockactioncontext) { +- return blockactioncontext.getItemStack().getItem() == this.getItem() && (Integer) iblockdata.get(BlockTurtleEgg.b) < 4 ? true : super.a(iblockdata, blockactioncontext); ++ return blockactioncontext.getItemStack().getItem() == this.getItem() && iblockdata.get(BlockTurtleEgg.b) < 4 ? true : super.a(iblockdata, blockactioncontext); + } + + @Nullable +@@ -148,12 +148,12 @@ public class BlockTurtleEgg extends Block { + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { + IBlockData iblockdata = blockactioncontext.getWorld().getType(blockactioncontext.getClickPosition()); + +- return iblockdata.a((Block) this) ? (IBlockData) iblockdata.set(BlockTurtleEgg.b, Math.min(4, (Integer) iblockdata.get(BlockTurtleEgg.b) + 1)) : super.getPlacedState(blockactioncontext); ++ return iblockdata.a(this) ? iblockdata.set(BlockTurtleEgg.b, Math.min(4, iblockdata.get(BlockTurtleEgg.b) + 1)) : super.getPlacedState(blockactioncontext); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { +- return (Integer) iblockdata.get(BlockTurtleEgg.b) > 1 ? BlockTurtleEgg.d : BlockTurtleEgg.c; ++ return iblockdata.get(BlockTurtleEgg.b) > 1 ? BlockTurtleEgg.d : BlockTurtleEgg.c; + } + + @Override +diff --git a/src/main/java/net/minecraft/server/BlockVine.java b/src/main/java/net/minecraft/server/BlockVine.java +index 48bbf6d3b5dcbe6c188066dd2ef9219dc903f19c..49025393b4dca01bc63da799e282f2af39516d16 100644 +--- a/src/main/java/net/minecraft/server/BlockVine.java ++++ b/src/main/java/net/minecraft/server/BlockVine.java +@@ -14,7 +14,7 @@ public class BlockVine extends Block { + public static final BlockStateBoolean EAST = BlockSprawling.b; + public static final BlockStateBoolean SOUTH = BlockSprawling.c; + public static final BlockStateBoolean WEST = BlockSprawling.d; +- public static final Map f = (Map) BlockSprawling.g.entrySet().stream().filter((entry) -> { ++ public static final Map f = BlockSprawling.g.entrySet().stream().filter((entry) -> { + return entry.getKey() != EnumDirection.DOWN; + }).collect(SystemUtils.a()); + protected static final VoxelShape g = Block.a(0.0D, 15.0D, 0.0D, 16.0D, 16.0D, 16.0D); +@@ -25,30 +25,30 @@ public class BlockVine extends Block { + + public BlockVine(BlockBase.Info blockbase_info) { + super(blockbase_info); +- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockVine.UP, false)).set(BlockVine.NORTH, false)).set(BlockVine.EAST, false)).set(BlockVine.SOUTH, false)).set(BlockVine.WEST, false)); ++ this.j(this.blockStateList.getBlockData().set(BlockVine.UP, false).set(BlockVine.NORTH, false).set(BlockVine.EAST, false).set(BlockVine.SOUTH, false).set(BlockVine.WEST, false)); + } + + @Override + public VoxelShape b(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) { + VoxelShape voxelshape = VoxelShapes.a(); + +- if ((Boolean) iblockdata.get(BlockVine.UP)) { ++ if (iblockdata.get(BlockVine.UP)) { + voxelshape = VoxelShapes.a(voxelshape, BlockVine.g); + } + +- if ((Boolean) iblockdata.get(BlockVine.NORTH)) { ++ if (iblockdata.get(BlockVine.NORTH)) { + voxelshape = VoxelShapes.a(voxelshape, BlockVine.j); + } + +- if ((Boolean) iblockdata.get(BlockVine.EAST)) { ++ if (iblockdata.get(BlockVine.EAST)) { + voxelshape = VoxelShapes.a(voxelshape, BlockVine.i); + } + +- if ((Boolean) iblockdata.get(BlockVine.SOUTH)) { ++ if (iblockdata.get(BlockVine.SOUTH)) { + voxelshape = VoxelShapes.a(voxelshape, BlockVine.k); + } + +- if ((Boolean) iblockdata.get(BlockVine.WEST)) { ++ if (iblockdata.get(BlockVine.WEST)) { + voxelshape = VoxelShapes.a(voxelshape, BlockVine.h); + } + +@@ -71,7 +71,7 @@ public class BlockVine extends Block { + while (iterator.hasNext()) { + BlockStateBoolean blockstateboolean = (BlockStateBoolean) iterator.next(); + +- if ((Boolean) iblockdata.get(blockstateboolean)) { ++ if (iblockdata.get(blockstateboolean)) { + ++i; + } + } +@@ -90,10 +90,10 @@ public class BlockVine extends Block { + } else if (enumdirection.n() == EnumDirection.EnumAxis.Y) { + return false; + } else { +- BlockStateBoolean blockstateboolean = (BlockStateBoolean) BlockVine.f.get(enumdirection); ++ BlockStateBoolean blockstateboolean = BlockVine.f.get(enumdirection); + IBlockData iblockdata = iblockaccess.getType(blockposition.up()); + +- return iblockdata.a((Block) this) && (Boolean) iblockdata.get(blockstateboolean); ++ return iblockdata.a(this) && iblockdata.get(blockstateboolean); + } + } + } +@@ -107,8 +107,8 @@ public class BlockVine extends Block { + private IBlockData g(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { + BlockPosition blockposition1 = blockposition.up(); + +- if ((Boolean) iblockdata.get(BlockVine.UP)) { +- iblockdata = (IBlockData) iblockdata.set(BlockVine.UP, a(iblockaccess, blockposition1, EnumDirection.DOWN)); ++ if (iblockdata.get(BlockVine.UP)) { ++ iblockdata = iblockdata.set(BlockVine.UP, a(iblockaccess, blockposition1, EnumDirection.DOWN)); + } + + IBlockData iblockdata1 = null; +@@ -118,7 +118,7 @@ public class BlockVine extends Block { + EnumDirection enumdirection = (EnumDirection) iterator.next(); + BlockStateBoolean blockstateboolean = getDirection(enumdirection); + +- if ((Boolean) iblockdata.get(blockstateboolean)) { ++ if (iblockdata.get(blockstateboolean)) { + boolean flag = this.b(iblockaccess, blockposition, enumdirection); + + if (!flag) { +@@ -126,10 +126,10 @@ public class BlockVine extends Block { + iblockdata1 = iblockaccess.getType(blockposition1); + } + +- flag = iblockdata1.a((Block) this) && (Boolean) iblockdata1.get(blockstateboolean); ++ flag = iblockdata1.a(this) && iblockdata1.get(blockstateboolean); + } + +- iblockdata = (IBlockData) iblockdata.set(blockstateboolean, flag); ++ iblockdata = iblockdata.set(blockstateboolean, flag); + } + } + +@@ -157,14 +157,14 @@ public class BlockVine extends Block { + EnumDirection enumdirection1; + + if (enumdirection.n().d() && !(Boolean) iblockdata.get(getDirection(enumdirection))) { +- if (this.a((IBlockAccess) worldserver, blockposition)) { ++ if (this.a(worldserver, blockposition)) { + blockposition2 = blockposition.shift(enumdirection); + iblockdata1 = worldserver.getType(blockposition2); + if (iblockdata1.isAir()) { + enumdirection1 = enumdirection.g(); + EnumDirection enumdirection2 = enumdirection.h(); +- boolean flag = (Boolean) iblockdata.get(getDirection(enumdirection1)); +- boolean flag1 = (Boolean) iblockdata.get(getDirection(enumdirection2)); ++ boolean flag = iblockdata.get(getDirection(enumdirection1)); ++ boolean flag1 = iblockdata.get(getDirection(enumdirection2)); + BlockPosition blockposition3 = blockposition2.shift(enumdirection1); + BlockPosition blockposition4 = blockposition2.shift(enumdirection2); + +@@ -172,35 +172,35 @@ public class BlockVine extends Block { + BlockPosition source = blockposition; + + if (flag && a((IBlockAccess) worldserver, blockposition3, enumdirection1)) { +- CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection1), true), 2); ++ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, this.getBlockData().set(getDirection(enumdirection1), true), 2); + } else if (flag1 && a((IBlockAccess) worldserver, blockposition4, enumdirection2)) { +- CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection2), true), 2); ++ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, this.getBlockData().set(getDirection(enumdirection2), true), 2); + } else { + EnumDirection enumdirection3 = enumdirection.opposite(); + + if (flag && worldserver.isEmpty(blockposition3) && a((IBlockAccess) worldserver, blockposition.shift(enumdirection1), enumdirection3)) { +- CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition3, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), true), 2); ++ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition3, this.getBlockData().set(getDirection(enumdirection3), true), 2); + } else if (flag1 && worldserver.isEmpty(blockposition4) && a((IBlockAccess) worldserver, blockposition.shift(enumdirection2), enumdirection3)) { +- CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition4, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), true), 2); ++ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition4, this.getBlockData().set(getDirection(enumdirection3), true), 2); + } else if ((double) worldserver.random.nextFloat() < 0.05D && a((IBlockAccess) worldserver, blockposition2.up(), EnumDirection.UP)) { +- CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, (IBlockData) this.getBlockData().set(BlockVine.UP, true), 2); ++ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, this.getBlockData().set(BlockVine.UP, true), 2); + } + // CraftBukkit end + } + } else if (a((IBlockAccess) worldserver, blockposition2, enumdirection)) { +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), true), 2); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(getDirection(enumdirection), true), 2); + } + + } + } else { + if (enumdirection == EnumDirection.UP && blockposition.getY() < 255) { +- if (this.b((IBlockAccess) worldserver, blockposition, enumdirection)) { +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockVine.UP, true), 2); ++ if (this.b(worldserver, blockposition, enumdirection)) { ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockVine.UP, true), 2); + return; + } + + if (worldserver.isEmpty(blockposition1)) { +- if (!this.a((IBlockAccess) worldserver, blockposition)) { ++ if (!this.a(worldserver, blockposition)) { + return; + } + +@@ -210,7 +210,7 @@ public class BlockVine extends Block { + while (iterator.hasNext()) { + enumdirection1 = (EnumDirection) iterator.next(); + if (random.nextBoolean() || !a((IBlockAccess) worldserver, blockposition1.shift(enumdirection1), EnumDirection.UP)) { +- iblockdata2 = (IBlockData) iblockdata2.set(getDirection(enumdirection1), false); ++ iblockdata2 = iblockdata2.set(getDirection(enumdirection1), false); + } + } + +@@ -225,7 +225,7 @@ public class BlockVine extends Block { + if (blockposition.getY() > 0) { + blockposition2 = blockposition.down(); + iblockdata1 = worldserver.getType(blockposition2); +- if (iblockdata1.isAir() || iblockdata1.a((Block) this)) { ++ if (iblockdata1.isAir() || iblockdata1.a(this)) { + IBlockData iblockdata3 = iblockdata1.isAir() ? this.getBlockData() : iblockdata1; + IBlockData iblockdata4 = this.a(iblockdata, iblockdata3, random); + +@@ -248,8 +248,8 @@ public class BlockVine extends Block { + if (random.nextBoolean()) { + BlockStateBoolean blockstateboolean = getDirection(enumdirection); + +- if ((Boolean) iblockdata.get(blockstateboolean)) { +- iblockdata1 = (IBlockData) iblockdata1.set(blockstateboolean, true); ++ if (iblockdata.get(blockstateboolean)) { ++ iblockdata1 = iblockdata1.set(blockstateboolean, true); + } + } + } +@@ -258,7 +258,7 @@ public class BlockVine extends Block { + } + + private boolean canSpread(IBlockData iblockdata) { +- return (Boolean) iblockdata.get(BlockVine.NORTH) || (Boolean) iblockdata.get(BlockVine.EAST) || (Boolean) iblockdata.get(BlockVine.SOUTH) || (Boolean) iblockdata.get(BlockVine.WEST); ++ return iblockdata.get(BlockVine.NORTH) || iblockdata.get(BlockVine.EAST) || iblockdata.get(BlockVine.SOUTH) || iblockdata.get(BlockVine.WEST); + } + + private boolean a(IBlockAccess iblockaccess, BlockPosition blockposition) { +@@ -270,7 +270,7 @@ public class BlockVine extends Block { + while (iterator.hasNext()) { + BlockPosition blockposition1 = (BlockPosition) iterator.next(); + +- if (iblockaccess.getType(blockposition1).a((Block) this)) { ++ if (iblockaccess.getType(blockposition1).a(this)) { + --i; + if (i <= 0) { + return false; +@@ -285,14 +285,14 @@ public class BlockVine extends Block { + public boolean a(IBlockData iblockdata, BlockActionContext blockactioncontext) { + IBlockData iblockdata1 = blockactioncontext.getWorld().getType(blockactioncontext.getClickPosition()); + +- return iblockdata1.a((Block) this) ? this.l(iblockdata1) < BlockVine.f.size() : super.a(iblockdata, blockactioncontext); ++ return iblockdata1.a(this) ? this.l(iblockdata1) < BlockVine.f.size() : super.a(iblockdata, blockactioncontext); + } + + @Nullable + @Override + public IBlockData getPlacedState(BlockActionContext blockactioncontext) { + IBlockData iblockdata = blockactioncontext.getWorld().getType(blockactioncontext.getClickPosition()); +- boolean flag = iblockdata.a((Block) this); ++ boolean flag = iblockdata.a(this); + IBlockData iblockdata1 = flag ? iblockdata : this.getBlockData(); + EnumDirection[] aenumdirection = blockactioncontext.e(); + int i = aenumdirection.length; +@@ -302,10 +302,10 @@ public class BlockVine extends Block { + + if (enumdirection != EnumDirection.DOWN) { + BlockStateBoolean blockstateboolean = getDirection(enumdirection); +- boolean flag1 = flag && (Boolean) iblockdata.get(blockstateboolean); ++ boolean flag1 = flag && iblockdata.get(blockstateboolean); + +- if (!flag1 && this.b((IBlockAccess) blockactioncontext.getWorld(), blockactioncontext.getClickPosition(), enumdirection)) { +- return (IBlockData) iblockdata1.set(blockstateboolean, true); ++ if (!flag1 && this.b(blockactioncontext.getWorld(), blockactioncontext.getClickPosition(), enumdirection)) { ++ return iblockdata1.set(blockstateboolean, true); + } + } + } +@@ -322,11 +322,11 @@ public class BlockVine extends Block { + public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { + switch (enumblockrotation) { + case CLOCKWISE_180: +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockVine.NORTH, iblockdata.get(BlockVine.SOUTH))).set(BlockVine.EAST, iblockdata.get(BlockVine.WEST))).set(BlockVine.SOUTH, iblockdata.get(BlockVine.NORTH))).set(BlockVine.WEST, iblockdata.get(BlockVine.EAST)); ++ return iblockdata.set(BlockVine.NORTH, iblockdata.get(BlockVine.SOUTH)).set(BlockVine.EAST, iblockdata.get(BlockVine.WEST)).set(BlockVine.SOUTH, iblockdata.get(BlockVine.NORTH)).set(BlockVine.WEST, iblockdata.get(BlockVine.EAST)); + case COUNTERCLOCKWISE_90: +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockVine.NORTH, iblockdata.get(BlockVine.EAST))).set(BlockVine.EAST, iblockdata.get(BlockVine.SOUTH))).set(BlockVine.SOUTH, iblockdata.get(BlockVine.WEST))).set(BlockVine.WEST, iblockdata.get(BlockVine.NORTH)); ++ return iblockdata.set(BlockVine.NORTH, iblockdata.get(BlockVine.EAST)).set(BlockVine.EAST, iblockdata.get(BlockVine.SOUTH)).set(BlockVine.SOUTH, iblockdata.get(BlockVine.WEST)).set(BlockVine.WEST, iblockdata.get(BlockVine.NORTH)); + case CLOCKWISE_90: +- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set(BlockVine.NORTH, iblockdata.get(BlockVine.WEST))).set(BlockVine.EAST, iblockdata.get(BlockVine.NORTH))).set(BlockVine.SOUTH, iblockdata.get(BlockVine.EAST))).set(BlockVine.WEST, iblockdata.get(BlockVine.SOUTH)); ++ return iblockdata.set(BlockVine.NORTH, iblockdata.get(BlockVine.WEST)).set(BlockVine.EAST, iblockdata.get(BlockVine.NORTH)).set(BlockVine.SOUTH, iblockdata.get(BlockVine.EAST)).set(BlockVine.WEST, iblockdata.get(BlockVine.SOUTH)); + default: + return iblockdata; + } +@@ -336,15 +336,15 @@ public class BlockVine extends Block { + public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { + switch (enumblockmirror) { + case LEFT_RIGHT: +- return (IBlockData) ((IBlockData) iblockdata.set(BlockVine.NORTH, iblockdata.get(BlockVine.SOUTH))).set(BlockVine.SOUTH, iblockdata.get(BlockVine.NORTH)); ++ return iblockdata.set(BlockVine.NORTH, iblockdata.get(BlockVine.SOUTH)).set(BlockVine.SOUTH, iblockdata.get(BlockVine.NORTH)); + case FRONT_BACK: +- return (IBlockData) ((IBlockData) iblockdata.set(BlockVine.EAST, iblockdata.get(BlockVine.WEST))).set(BlockVine.WEST, iblockdata.get(BlockVine.EAST)); ++ return iblockdata.set(BlockVine.EAST, iblockdata.get(BlockVine.WEST)).set(BlockVine.WEST, iblockdata.get(BlockVine.EAST)); + default: + return super.a(iblockdata, enumblockmirror); + } + } + + public static BlockStateBoolean getDirection(EnumDirection enumdirection) { +- return (BlockStateBoolean) BlockVine.f.get(enumdirection); ++ return BlockVine.f.get(enumdirection); + } + } +diff --git a/src/main/java/net/minecraft/server/BlockWitherSkull.java b/src/main/java/net/minecraft/server/BlockWitherSkull.java +index c17ec61f589b7177af7ae44aa1f018d6e9f9aa1a..ff21ff4ff44cf0124036e06a17edcea45aeae886 100644 +--- a/src/main/java/net/minecraft/server/BlockWitherSkull.java ++++ b/src/main/java/net/minecraft/server/BlockWitherSkull.java +@@ -51,7 +51,7 @@ public class BlockWitherSkull extends BlockSkull { + } + } + +- EntityWither entitywither = (EntityWither) EntityTypes.WITHER.a(world); ++ EntityWither entitywither = EntityTypes.WITHER.a(world); + BlockPosition blockposition1 = shapedetector_shapedetectorcollection.a(1, 2, 0).getPosition(); + + entitywither.setPositionRotation((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.55D, (double) blockposition1.getZ() + 0.5D, shapedetector_shapedetectorcollection.getFacing().n() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F); +@@ -71,7 +71,7 @@ public class BlockWitherSkull extends BlockSkull { + while (iterator.hasNext()) { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); + +- CriterionTriggers.n.a(entityplayer, (Entity) entitywither); ++ CriterionTriggers.n.a(entityplayer, entitywither); + } + + // world.addEntity(entitywither); // CraftBukkit - moved up +@@ -94,7 +94,7 @@ public class BlockWitherSkull extends BlockSkull { + private static ShapeDetector c() { + if (BlockWitherSkull.c == null) { + BlockWitherSkull.c = ShapeDetectorBuilder.a().a("^^^", "###", "~#~").a('#', (shapedetectorblock) -> { +- return shapedetectorblock.a().a((Tag) TagsBlock.WITHER_SUMMON_BASE_BLOCKS); ++ return shapedetectorblock.a().a(TagsBlock.WITHER_SUMMON_BASE_BLOCKS); + }).a('^', ShapeDetectorBlock.a(BlockStatePredicate.a(Blocks.WITHER_SKELETON_SKULL).or(BlockStatePredicate.a(Blocks.WITHER_SKELETON_WALL_SKULL)))).a('~', ShapeDetectorBlock.a(MaterialPredicate.a(Material.AIR))).b(); + } + +@@ -104,7 +104,7 @@ public class BlockWitherSkull extends BlockSkull { + private static ShapeDetector d() { + if (BlockWitherSkull.d == null) { + BlockWitherSkull.d = ShapeDetectorBuilder.a().a(" ", "###", "~#~").a('#', (shapedetectorblock) -> { +- return shapedetectorblock.a().a((Tag) TagsBlock.WITHER_SUMMON_BASE_BLOCKS); ++ return shapedetectorblock.a().a(TagsBlock.WITHER_SUMMON_BASE_BLOCKS); + }).a('~', ShapeDetectorBlock.a(MaterialPredicate.a(Material.AIR))).b(); + } + +diff --git a/src/main/java/net/minecraft/server/ChatHexColor.java b/src/main/java/net/minecraft/server/ChatHexColor.java +index 5e7f063f5e7a4f41554d13042726fb8b981365e3..73b82a92090b4f9c3375f263a387193cd2eb0dc4 100644 +--- a/src/main/java/net/minecraft/server/ChatHexColor.java ++++ b/src/main/java/net/minecraft/server/ChatHexColor.java +@@ -10,10 +10,10 @@ import java.util.stream.Stream; + + public final class ChatHexColor { + +- private static final Map a = (Map) Stream.of(EnumChatFormat.values()).filter(EnumChatFormat::d).collect(ImmutableMap.toImmutableMap(Function.identity(), (enumchatformat) -> { ++ private static final Map a = Stream.of(EnumChatFormat.values()).filter(EnumChatFormat::d).collect(ImmutableMap.toImmutableMap(Function.identity(), (enumchatformat) -> { + return new ChatHexColor(enumchatformat.e(), enumchatformat.f(), enumchatformat); // CraftBukkit + })); +- private static final Map b = (Map) ChatHexColor.a.values().stream().collect(ImmutableMap.toImmutableMap((chathexcolor) -> { ++ private static final Map b = ChatHexColor.a.values().stream().collect(ImmutableMap.toImmutableMap((chathexcolor) -> { + return chathexcolor.name; + }, Function.identity())); + private final int rgb; +@@ -57,7 +57,7 @@ public final class ChatHexColor { + } + + public int hashCode() { +- return Objects.hash(new Object[]{this.rgb, this.name}); ++ return Objects.hash(this.rgb, this.name); + } + + public String toString() { +@@ -66,7 +66,7 @@ public final class ChatHexColor { + + @Nullable + public static ChatHexColor a(EnumChatFormat enumchatformat) { +- return (ChatHexColor) ChatHexColor.a.get(enumchatformat); ++ return ChatHexColor.a.get(enumchatformat); + } + + public static ChatHexColor a(int i) { +@@ -84,7 +84,7 @@ public final class ChatHexColor { + return null; + } + } else { +- return (ChatHexColor) ChatHexColor.b.get(s); ++ return ChatHexColor.b.get(s); + } + } + } +diff --git a/src/main/java/net/minecraft/server/ChatModifier.java b/src/main/java/net/minecraft/server/ChatModifier.java +index 84d773375bedda460ba5da09e66cfb176f8a73e6..f8496f6df80824a24ca5d884637e84c20500bc9e 100644 +--- a/src/main/java/net/minecraft/server/ChatModifier.java ++++ b/src/main/java/net/minecraft/server/ChatModifier.java +@@ -9,7 +9,7 @@ import java.util.Objects; + public class ChatModifier { + + public static final MinecraftKey a = new MinecraftKey("minecraft", "default"); +- public static final ChatModifier b = new ChatModifier((ChatHexColor) null, (Boolean) null, (Boolean) null, (Boolean) null, (Boolean) null, (Boolean) null, (ChatClickable) null, (ChatHoverable) null, (String) null, (MinecraftKey) null); ++ public static final ChatModifier b = new ChatModifier(null, null, null, null, null, null, null, null, null, null); + @Nullable + private final ChatHexColor color; + @Nullable +@@ -227,7 +227,7 @@ public class ChatModifier { + } + + public int hashCode() { +- return Objects.hash(new Object[]{this.color, this.bold, this.italic, this.underlined, this.strikethrough, this.obfuscated, this.clickEvent, this.hoverEvent, this.insertion}); ++ return Objects.hash(this.color, this.bold, this.italic, this.underlined, this.strikethrough, this.obfuscated, this.clickEvent, this.hoverEvent, this.insertion); + } + + public static class ChatModifierSerializer implements JsonDeserializer, JsonSerializer { +diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java +index d1d3ed44bf3ad0dc44d268b66df77051aa195fb8..8a61c48cd641baeab618e0cadc914edc977fcbfd 100644 +--- a/src/main/java/net/minecraft/server/Chunk.java ++++ b/src/main/java/net/minecraft/server/Chunk.java +@@ -50,7 +50,7 @@ public class Chunk implements IChunkAccess { + private volatile boolean x; + + public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage) { +- this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, (ChunkSection[]) null, (Consumer) null); ++ this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, null, null); + } + + // Paper start +@@ -243,7 +243,7 @@ public class Chunk implements IChunkAccess { + + protected void onNeighbourChange(final long bitsetBefore, final long bitsetAfter) { + // Paper start - no-tick view distance +- ChunkProviderServer chunkProviderServer = ((WorldServer)this.world).getChunkProvider(); ++ ChunkProviderServer chunkProviderServer = this.world.getChunkProvider(); + PlayerChunkMap chunkMap = chunkProviderServer.playerChunkMap; + // this code handles the addition of ticking tickets - the distance map handles the removal + if (!areNeighboursLoaded(bitsetBefore, 2) && areNeighboursLoaded(bitsetAfter, 2)) { +@@ -337,7 +337,7 @@ public class Chunk implements IChunkAccess { + // Paper end + + public Chunk(World world, ProtoChunk protochunk) { +- this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null); ++ this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), null); + Iterator iterator = protochunk.y().iterator(); + + while (iterator.hasNext()) { +@@ -371,7 +371,7 @@ public class Chunk implements IChunkAccess { + Entry entry = (Entry) iterator.next(); + + if (ChunkStatus.FULL.h().contains(entry.getKey())) { +- this.a((HeightMap.Type) entry.getKey()).copyFrom(((HeightMap) entry.getValue())); // Tuinity ++ this.a(entry.getKey()).copyFrom(entry.getValue()); // Tuinity + } + } + +@@ -382,7 +382,7 @@ public class Chunk implements IChunkAccess { + + @Override + public HeightMap a(HeightMap.Type heightmap_type) { +- return (HeightMap) this.heightMap.computeIfAbsent(heightmap_type, (heightmap_type1) -> { ++ return this.heightMap.computeIfAbsent(heightmap_type, (heightmap_type1) -> { + return new HeightMap(this, heightmap_type1); + }); + } +@@ -559,10 +559,10 @@ public class Chunk implements IChunkAccess { + Block block = iblockdata.getBlock(); + Block block1 = iblockdata1.getBlock(); + +- ((HeightMap) this.heightMap.get(HeightMap.Type.MOTION_BLOCKING)).a(i, j, k, iblockdata); +- ((HeightMap) this.heightMap.get(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES)).a(i, j, k, iblockdata); +- ((HeightMap) this.heightMap.get(HeightMap.Type.OCEAN_FLOOR)).a(i, j, k, iblockdata); +- ((HeightMap) this.heightMap.get(HeightMap.Type.WORLD_SURFACE)).a(i, j, k, iblockdata); ++ this.heightMap.get(HeightMap.Type.MOTION_BLOCKING).a(i, j, k, iblockdata); ++ this.heightMap.get(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES).a(i, j, k, iblockdata); ++ this.heightMap.get(HeightMap.Type.OCEAN_FLOOR).a(i, j, k, iblockdata); ++ this.heightMap.get(HeightMap.Type.WORLD_SURFACE).a(i, j, k, iblockdata); + boolean flag2 = chunksection.c(); + + if (flag1 != flag2) { +@@ -681,7 +681,7 @@ public class Chunk implements IChunkAccess { + + @Override + public void a(HeightMap.Type heightmap_type, long[] along) { +- ((HeightMap) this.heightMap.get(heightmap_type)).a(along); ++ this.heightMap.get(heightmap_type).a(along); + } + + public final void removeEntity(Entity entity) { this.b(entity); } // Paper - OBFHELPER +@@ -721,7 +721,7 @@ public class Chunk implements IChunkAccess { + + public final int getHighestBlockY(HeightMap.Type heightmap_type, int i, int j) { return this.getHighestBlock(heightmap_type, i, j) + 1; } // Paper - sort of an obfhelper, but without -1 + @Override public int getHighestBlock(HeightMap.Type heightmap_type, int i, int j) { // Paper +- return ((HeightMap) this.heightMap.get(heightmap_type)).a(i & 15, j & 15) - 1; ++ return this.heightMap.get(heightmap_type).a(i & 15, j & 15) - 1; + } + + @Nullable +@@ -744,12 +744,12 @@ public class Chunk implements IChunkAccess { + // CraftBukkit start + TileEntity tileentity = world.capturedTileEntities.get(blockposition); + if (tileentity == null) { +- tileentity = (TileEntity) this.tileEntities.get(blockposition); ++ tileentity = this.tileEntities.get(blockposition); + } + // CraftBukkit end + + if (tileentity == null) { +- NBTTagCompound nbttagcompound = (NBTTagCompound) this.e.remove(blockposition); ++ NBTTagCompound nbttagcompound = this.e.remove(blockposition); + + if (nbttagcompound != null) { + TileEntity tileentity1 = this.a(blockposition, nbttagcompound); +@@ -786,7 +786,7 @@ public class Chunk implements IChunkAccess { + if (this.getType(blockposition).getBlock() instanceof ITileEntity) { + tileentity.setLocation(this.world, blockposition); + tileentity.r(); +- TileEntity tileentity1 = (TileEntity) this.tileEntities.put(blockposition.immutableCopy(), tileentity); ++ TileEntity tileentity1 = this.tileEntities.put(blockposition.immutableCopy(), tileentity); + + if (tileentity1 != null && tileentity1 != tileentity) { + tileentity1.an_(); +@@ -833,7 +833,7 @@ public class Chunk implements IChunkAccess { + nbttagcompound.setBoolean("keepPacked", false); + return nbttagcompound; + } else { +- nbttagcompound = (NBTTagCompound) this.e.get(blockposition); ++ nbttagcompound = this.e.get(blockposition); + if (nbttagcompound != null) { + nbttagcompound = nbttagcompound.clone(); + nbttagcompound.setBoolean("keepPacked", true); +@@ -846,7 +846,7 @@ public class Chunk implements IChunkAccess { + @Override + public void removeTileEntity(BlockPosition blockposition) { + if (this.loaded || this.world.s_()) { +- TileEntity tileentity = (TileEntity) this.tileEntities.remove(blockposition); ++ TileEntity tileentity = this.tileEntities.remove(blockposition); + + if (tileentity != null) { + tileentity.an_(); +@@ -868,7 +868,7 @@ public class Chunk implements IChunkAccess { + // Paper start - neighbour cache + int chunkX = this.loc.x; + int chunkZ = this.loc.z; +- ChunkProviderServer chunkProvider = ((WorldServer)this.world).getChunkProvider(); ++ ChunkProviderServer chunkProvider = this.world.getChunkProvider(); + for (int dx = -NEIGHBOUR_CACHE_RADIUS; dx <= NEIGHBOUR_CACHE_RADIUS; ++dx) { + for (int dz = -NEIGHBOUR_CACHE_RADIUS; dz <= NEIGHBOUR_CACHE_RADIUS; ++dz) { + Chunk neighbour = chunkProvider.getChunkAtIfLoadedMainThreadNoCache(chunkX + dx, chunkZ + dz); +@@ -883,7 +883,7 @@ public class Chunk implements IChunkAccess { + this.loadedTicketLevel = true; + // Paper end - neighbour cache + org.bukkit.Server server = this.world.getServer(); +- ((WorldServer)this.world).getChunkProvider().addLoadedChunk(this); // Paper ++ this.world.getChunkProvider().addLoadedChunk(this); // Paper + if (server != null) { + /* + * If it's a new world, the first few chunks are generated inside +@@ -924,11 +924,11 @@ public class Chunk implements IChunkAccess { + server.getPluginManager().callEvent(unloadEvent); + // note: saving can be prevented, but not forced if no saving is actually required + this.mustNotSave = !unloadEvent.isSaveChunk(); +- ((WorldServer)this.world).getChunkProvider().removeLoadedChunk(this); // Paper ++ this.world.getChunkProvider().removeLoadedChunk(this); // Paper + // Paper start - neighbour cache + int chunkX = this.loc.x; + int chunkZ = this.loc.z; +- ChunkProviderServer chunkProvider = ((WorldServer)this.world).getChunkProvider(); ++ ChunkProviderServer chunkProvider = this.world.getChunkProvider(); + for (int dx = -NEIGHBOUR_CACHE_RADIUS; dx <= NEIGHBOUR_CACHE_RADIUS; ++dx) { + for (int dz = -NEIGHBOUR_CACHE_RADIUS; dz <= NEIGHBOUR_CACHE_RADIUS; ++dz) { + Chunk neighbour = chunkProvider.getChunkAtIfLoadedMainThreadNoCache(chunkX + dx, chunkZ + dz); +@@ -961,7 +961,7 @@ public class Chunk implements IChunkAccess { + int l = list1.size(); + + for (int i1 = 0; i1 < l; ++i1) { +- Entity entity1 = (Entity) list1.get(i1); ++ Entity entity1 = list1.get(i1); + if (entity1.shouldBeRemoved) continue; // Paper + + if (entity1.getBoundingBox().c(axisalignedbb) && entity1 != entity) { +@@ -1098,7 +1098,7 @@ public class Chunk implements IChunkAccess { + + @Override + public NBTTagCompound f(BlockPosition blockposition) { +- return (NBTTagCompound) this.e.get(blockposition); ++ return this.e.get(blockposition); + } + + @Override +@@ -1140,7 +1140,7 @@ public class Chunk implements IChunkAccess { + @Nullable + @Override + public StructureStart a(StructureGenerator structuregenerator) { +- return (StructureStart) this.l.get(structuregenerator); ++ return this.l.get(structuregenerator); + } + + @Override +@@ -1161,16 +1161,16 @@ public class Chunk implements IChunkAccess { + + @Override + public LongSet b(StructureGenerator structuregenerator) { +- return (LongSet) this.m.computeIfAbsent(structuregenerator, (structuregenerator1) -> { ++ return this.m.computeIfAbsent(structuregenerator, (structuregenerator1) -> { + return new LongOpenHashSet(); + }); + } + + @Override + public void a(StructureGenerator structuregenerator, long i) { +- ((LongSet) this.m.computeIfAbsent(structuregenerator, (structuregenerator1) -> { ++ this.m.computeIfAbsent(structuregenerator, (structuregenerator1) -> { + return new LongOpenHashSet(); +- })).add(i); ++ }).add(i); + } + + @Override +@@ -1202,10 +1202,10 @@ public class Chunk implements IChunkAccess { + ShortListIterator shortlistiterator = this.n[i].iterator(); + + while (shortlistiterator.hasNext()) { +- Short oshort = (Short) shortlistiterator.next(); ++ Short oshort = shortlistiterator.next(); + BlockPosition blockposition = ProtoChunk.a(oshort, i, chunkcoordintpair); + IBlockData iblockdata = this.getType(blockposition); +- IBlockData iblockdata1 = Block.b(iblockdata, (GeneratorAccess) this.world, blockposition); ++ IBlockData iblockdata1 = Block.b(iblockdata, this.world, blockposition); + + this.world.setTypeAndData(blockposition, iblockdata1, 20); + } +@@ -1307,7 +1307,7 @@ public class Chunk implements IChunkAccess { + } + + public PlayerChunk.State getState() { +- return this.u == null ? PlayerChunk.State.BORDER : (PlayerChunk.State) this.u.get(); ++ return this.u == null ? PlayerChunk.State.BORDER : this.u.get(); + } + + public void a(Supplier supplier) { +diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java +index e49bdf51a50ef368d11f4436acad81b0360b2129..7e19b0bd1b0b55cb15f93cfb8cd663e634780d67 100644 +--- a/src/main/java/net/minecraft/server/ChunkCache.java ++++ b/src/main/java/net/minecraft/server/ChunkCache.java +@@ -57,7 +57,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess { + if (k >= 0 && k < this.c.length && l >= 0 && l < this.c[k].length) { // Paper - if this changes, update getChunkIfLoaded below + IChunkAccess ichunkaccess = this.c[k][l]; + +- return (IChunkAccess) (ichunkaccess != null ? ichunkaccess : new ChunkEmpty(this.e, new ChunkCoordIntPair(i, j))); ++ return ichunkaccess != null ? ichunkaccess : new ChunkEmpty(this.e, new ChunkCoordIntPair(i, j)); + } else { + return new ChunkEmpty(this.e, new ChunkCoordIntPair(i, j)); + } +diff --git a/src/main/java/net/minecraft/server/ChunkConverter.java b/src/main/java/net/minecraft/server/ChunkConverter.java +index c52ff505f31036c00a67d4bf85302d73b3fd923e..79f8d079b66257b688077791fc1fcba320594354 100644 +--- a/src/main/java/net/minecraft/server/ChunkConverter.java ++++ b/src/main/java/net/minecraft/server/ChunkConverter.java +@@ -102,7 +102,7 @@ public class ChunkConverter { + for (int j1 = 0; j1 < i1; ++j1) { + EnumDirection enumdirection = aenumdirection1[j1]; + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); ++ blockposition_mutableblockposition.a(blockposition, enumdirection); + iblockdata1 = a(iblockdata1, enumdirection, world, blockposition, blockposition_mutableblockposition); + } + +@@ -113,7 +113,7 @@ public class ChunkConverter { + } + + private static IBlockData a(IBlockData iblockdata, EnumDirection enumdirection, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- return ((ChunkConverter.a) ChunkConverter.f.getOrDefault(iblockdata.getBlock(), ChunkConverter.Type.DEFAULT)).a(iblockdata, enumdirection, generatoraccess.getType(blockposition1), generatoraccess, blockposition, blockposition1); ++ return ChunkConverter.f.getOrDefault(iblockdata.getBlock(), Type.DEFAULT).a(iblockdata, enumdirection, generatoraccess.getType(blockposition1), generatoraccess, blockposition, blockposition1); + } + + private void b(Chunk chunk) { +@@ -142,7 +142,7 @@ public class ChunkConverter { + int k1 = l >> 4 & 15; + + blockposition_mutableblockposition.d(chunkcoordintpair.d() + i1, (i << 4) + j1, chunkcoordintpair.e() + k1); +- IBlockData iblockdata = (IBlockData) datapaletteblock.a(l); ++ IBlockData iblockdata = datapaletteblock.a(l); + IBlockData iblockdata1 = iblockdata; + EnumDirection[] aenumdirection1 = aenumdirection; + int l1 = aenumdirection.length; +@@ -150,7 +150,7 @@ public class ChunkConverter { + for (int i2 = 0; i2 < l1; ++i2) { + EnumDirection enumdirection = aenumdirection1[i2]; + +- blockposition_mutableblockposition1.a((BaseBlockPosition) blockposition_mutableblockposition, enumdirection); ++ blockposition_mutableblockposition1.a(blockposition_mutableblockposition, enumdirection); + if (blockposition_mutableblockposition.getX() >> 4 == chunkcoordintpair.x && blockposition_mutableblockposition.getZ() >> 4 == chunkcoordintpair.z) { + iblockdata1 = a(iblockdata1, enumdirection, world, blockposition_mutableblockposition, blockposition_mutableblockposition1); + } +@@ -218,28 +218,28 @@ public class ChunkConverter { + + static enum Type implements ChunkConverter.a { + +- BLACKLIST(new Block[]{Blocks.OBSERVER, Blocks.NETHER_PORTAL, Blocks.WHITE_CONCRETE_POWDER, Blocks.ORANGE_CONCRETE_POWDER, Blocks.MAGENTA_CONCRETE_POWDER, Blocks.LIGHT_BLUE_CONCRETE_POWDER, Blocks.YELLOW_CONCRETE_POWDER, Blocks.LIME_CONCRETE_POWDER, Blocks.PINK_CONCRETE_POWDER, Blocks.GRAY_CONCRETE_POWDER, Blocks.LIGHT_GRAY_CONCRETE_POWDER, Blocks.CYAN_CONCRETE_POWDER, Blocks.PURPLE_CONCRETE_POWDER, Blocks.BLUE_CONCRETE_POWDER, Blocks.BROWN_CONCRETE_POWDER, Blocks.GREEN_CONCRETE_POWDER, Blocks.RED_CONCRETE_POWDER, Blocks.BLACK_CONCRETE_POWDER, Blocks.ANVIL, Blocks.CHIPPED_ANVIL, Blocks.DAMAGED_ANVIL, Blocks.DRAGON_EGG, Blocks.GRAVEL, Blocks.SAND, Blocks.RED_SAND, Blocks.OAK_SIGN, Blocks.SPRUCE_SIGN, Blocks.BIRCH_SIGN, Blocks.ACACIA_SIGN, Blocks.JUNGLE_SIGN, Blocks.DARK_OAK_SIGN, Blocks.OAK_WALL_SIGN, Blocks.SPRUCE_WALL_SIGN, Blocks.BIRCH_WALL_SIGN, Blocks.ACACIA_WALL_SIGN, Blocks.JUNGLE_WALL_SIGN, Blocks.DARK_OAK_WALL_SIGN}) { ++ BLACKLIST(Blocks.OBSERVER, Blocks.NETHER_PORTAL, Blocks.WHITE_CONCRETE_POWDER, Blocks.ORANGE_CONCRETE_POWDER, Blocks.MAGENTA_CONCRETE_POWDER, Blocks.LIGHT_BLUE_CONCRETE_POWDER, Blocks.YELLOW_CONCRETE_POWDER, Blocks.LIME_CONCRETE_POWDER, Blocks.PINK_CONCRETE_POWDER, Blocks.GRAY_CONCRETE_POWDER, Blocks.LIGHT_GRAY_CONCRETE_POWDER, Blocks.CYAN_CONCRETE_POWDER, Blocks.PURPLE_CONCRETE_POWDER, Blocks.BLUE_CONCRETE_POWDER, Blocks.BROWN_CONCRETE_POWDER, Blocks.GREEN_CONCRETE_POWDER, Blocks.RED_CONCRETE_POWDER, Blocks.BLACK_CONCRETE_POWDER, Blocks.ANVIL, Blocks.CHIPPED_ANVIL, Blocks.DAMAGED_ANVIL, Blocks.DRAGON_EGG, Blocks.GRAVEL, Blocks.SAND, Blocks.RED_SAND, Blocks.OAK_SIGN, Blocks.SPRUCE_SIGN, Blocks.BIRCH_SIGN, Blocks.ACACIA_SIGN, Blocks.JUNGLE_SIGN, Blocks.DARK_OAK_SIGN, Blocks.OAK_WALL_SIGN, Blocks.SPRUCE_WALL_SIGN, Blocks.BIRCH_WALL_SIGN, Blocks.ACACIA_WALL_SIGN, Blocks.JUNGLE_WALL_SIGN, Blocks.DARK_OAK_WALL_SIGN) { + @Override + public IBlockData a(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { + return iblockdata; + } + }, +- DEFAULT(new Block[0]) { ++ DEFAULT() { + @Override + public IBlockData a(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { + return iblockdata.updateState(enumdirection, generatoraccess.getType(blockposition1), generatoraccess, blockposition, blockposition1); + } + }, +- CHEST(new Block[]{Blocks.CHEST, Blocks.TRAPPED_CHEST}) { ++ CHEST(Blocks.CHEST, Blocks.TRAPPED_CHEST) { + @Override + public IBlockData a(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { + if (iblockdata1.a(iblockdata.getBlock()) && enumdirection.n().d() && iblockdata.get(BlockChest.c) == BlockPropertyChestType.SINGLE && iblockdata1.get(BlockChest.c) == BlockPropertyChestType.SINGLE) { +- EnumDirection enumdirection1 = (EnumDirection) iblockdata.get(BlockChest.FACING); ++ EnumDirection enumdirection1 = iblockdata.get(BlockChest.FACING); + + if (enumdirection.n() != enumdirection1.n() && enumdirection1 == iblockdata1.get(BlockChest.FACING)) { + BlockPropertyChestType blockpropertychesttype = enumdirection == enumdirection1.g() ? BlockPropertyChestType.LEFT : BlockPropertyChestType.RIGHT; + +- generatoraccess.setTypeAndData(blockposition1, (IBlockData) iblockdata1.set(BlockChest.c, blockpropertychesttype.b()), 18); ++ generatoraccess.setTypeAndData(blockposition1, iblockdata1.set(BlockChest.c, blockpropertychesttype.b()), 18); + if (enumdirection1 == EnumDirection.NORTH || enumdirection1 == EnumDirection.EAST) { + TileEntity tileentity = generatoraccess.getTileEntity(blockposition); + TileEntity tileentity1 = generatoraccess.getTileEntity(blockposition1); +@@ -249,14 +249,14 @@ public class ChunkConverter { + } + } + +- return (IBlockData) iblockdata.set(BlockChest.c, blockpropertychesttype); ++ return iblockdata.set(BlockChest.c, blockpropertychesttype); + } + } + + return iblockdata; + } + }, +- LEAVES(true, new Block[]{Blocks.ACACIA_LEAVES, Blocks.BIRCH_LEAVES, Blocks.DARK_OAK_LEAVES, Blocks.JUNGLE_LEAVES, Blocks.OAK_LEAVES, Blocks.SPRUCE_LEAVES}) { ++ LEAVES(true, Blocks.ACACIA_LEAVES, Blocks.BIRCH_LEAVES, Blocks.DARK_OAK_LEAVES, Blocks.JUNGLE_LEAVES, Blocks.OAK_LEAVES, Blocks.SPRUCE_LEAVES) { + private final ThreadLocal>> g = ThreadLocal.withInitial(() -> { + return Lists.newArrayListWithCapacity(7); + }); +@@ -266,8 +266,8 @@ public class ChunkConverter { + IBlockData iblockdata2 = iblockdata.updateState(enumdirection, generatoraccess.getType(blockposition1), generatoraccess, blockposition, blockposition1); + + if (iblockdata != iblockdata2) { +- int i = (Integer) iblockdata2.get(BlockProperties.an); +- List> list = (List) this.g.get(); ++ int i = iblockdata2.get(BlockProperties.an); ++ List> list = this.g.get(); + + if (list.isEmpty()) { + for (int j = 0; j < 7; ++j) { +@@ -275,7 +275,7 @@ public class ChunkConverter { + } + } + +- ((ObjectSet) list.get(i)).add(blockposition.immutableCopy()); ++ list.get(i).add(blockposition.immutableCopy()); + } + + return iblockdata; +@@ -284,20 +284,20 @@ public class ChunkConverter { + @Override + public void a(GeneratorAccess generatoraccess) { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); +- List> list = (List) this.g.get(); ++ List> list = this.g.get(); + + for (int i = 2; i < list.size(); ++i) { + int j = i - 1; +- ObjectSet objectset = (ObjectSet) list.get(j); +- ObjectSet objectset1 = (ObjectSet) list.get(i); ++ ObjectSet objectset = list.get(j); ++ ObjectSet objectset1 = list.get(i); + ObjectIterator objectiterator = objectset.iterator(); + + while (objectiterator.hasNext()) { + BlockPosition blockposition = (BlockPosition) objectiterator.next(); + IBlockData iblockdata = generatoraccess.getType(blockposition); + +- if ((Integer) iblockdata.get(BlockProperties.an) >= j) { +- generatoraccess.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.an, j), 18); ++ if (iblockdata.get(BlockProperties.an) >= j) { ++ generatoraccess.setTypeAndData(blockposition, iblockdata.set(BlockProperties.an, j), 18); + if (i != 7) { + EnumDirection[] aenumdirection = f; // Paper - decomp fix + int k = aenumdirection.length; +@@ -305,10 +305,10 @@ public class ChunkConverter { + for (int l = 0; l < k; ++l) { + EnumDirection enumdirection = aenumdirection[l]; + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); ++ blockposition_mutableblockposition.a(blockposition, enumdirection); + IBlockData iblockdata1 = generatoraccess.getType(blockposition_mutableblockposition); + +- if (iblockdata1.b(BlockProperties.an) && (Integer) iblockdata.get(BlockProperties.an) > i) { ++ if (iblockdata1.b(BlockProperties.an) && iblockdata.get(BlockProperties.an) > i) { + objectset1.add(blockposition_mutableblockposition.immutableCopy()); + } + } +@@ -320,14 +320,14 @@ public class ChunkConverter { + list.clear(); + } + }, +- STEM_BLOCK(new Block[]{Blocks.MELON_STEM, Blocks.PUMPKIN_STEM}) { ++ STEM_BLOCK(Blocks.MELON_STEM, Blocks.PUMPKIN_STEM) { + @Override + public IBlockData a(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- if ((Integer) iblockdata.get(BlockStem.AGE) == 7) { ++ if (iblockdata.get(BlockStem.AGE) == 7) { + BlockStemmed blockstemmed = ((BlockStem) iblockdata.getBlock()).d(); + +- if (iblockdata1.a((Block) blockstemmed)) { +- return (IBlockData) blockstemmed.d().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection); ++ if (iblockdata1.a(blockstemmed)) { ++ return blockstemmed.d().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection); + } + } + +diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +index 939551c5a8dd3272723f164fc3bf6336fee78171..6832884fe0723c63abc5b296358720c3e84b4e40 100644 +--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java ++++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +@@ -126,7 +126,7 @@ public class ChunkCoordIntPair { + final int k = chunkcoordintpair.x < chunkcoordintpair1.x ? 1 : -1; + final int l = chunkcoordintpair.z < chunkcoordintpair1.z ? 1 : -1; + +- return StreamSupport.stream(new AbstractSpliterator((long) (i * j), 64) { ++ return StreamSupport.stream(new AbstractSpliterator(i * j, 64) { + @Nullable + private ChunkCoordIntPair e; + +diff --git a/src/main/java/net/minecraft/server/ChunkEmpty.java b/src/main/java/net/minecraft/server/ChunkEmpty.java +index 46f7f64edb26345118da9112bd6f85cf4f7e76b2..c77e12f52099cf6dd73fe3257a99bc5686441431 100644 +--- a/src/main/java/net/minecraft/server/ChunkEmpty.java ++++ b/src/main/java/net/minecraft/server/ChunkEmpty.java +@@ -7,7 +7,7 @@ import java.util.function.Predicate; + + public class ChunkEmpty extends Chunk { + +- private static final BiomeBase[] b = (BiomeBase[]) SystemUtils.a((new BiomeBase[BiomeStorage.a]), (abiomebase) -> { // Paper - decompile error ++ private static final BiomeBase[] b = SystemUtils.a((new BiomeBase[BiomeStorage.a]), (abiomebase) -> { // Paper - decompile error + Arrays.fill(abiomebase, Biomes.PLAINS); + }); + +diff --git a/src/main/java/net/minecraft/server/ChunkGenerator.java b/src/main/java/net/minecraft/server/ChunkGenerator.java +index 43b80b6667839a2769c14508fcdef71d829dc949..536b1b2fd8791e423e76f70a354d0d4071962cba 100644 +--- a/src/main/java/net/minecraft/server/ChunkGenerator.java ++++ b/src/main/java/net/minecraft/server/ChunkGenerator.java +@@ -171,7 +171,7 @@ public abstract class ChunkGenerator { + } catch (Exception exception) { + CrashReport crashreport = CrashReport.a(exception, "Biome decoration"); + +- crashreport.a("Generation").a("CenterX", (Object) i).a("CenterZ", (Object) j).a("Step", (Object) worldgenstage_decoration).a("Seed", (Object) i1).a("Biome", (Object) IRegistry.BIOME.getKey(biomebase)); ++ crashreport.a("Generation").a("CenterX", i).a("CenterZ", j).a("Step", worldgenstage_decoration).a("Seed", i1).a("Biome", IRegistry.BIOME.getKey(biomebase)); + throw new ReportedException(crashreport); + } + } +diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +index e6eb96017bfda10971708f59b0fd009b8905837e..19a4bf7e4026e26e0e9e97ead88d8dc3aa5d35b5 100644 +--- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java ++++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +@@ -25,7 +25,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + return chunkgeneratorabstract.h; + })).apply(instance, instance.stable(ChunkGeneratorAbstract::new)); + }); +- private static final float[] i = (float[]) SystemUtils.a((new float[13824]), (afloat) -> { // CraftBukkit - decompile error ++ private static final float[] i = SystemUtils.a((new float[13824]), (afloat) -> { // CraftBukkit - decompile error + for (int i = 0; i < 24; ++i) { + for (int j = 0; j < 24; ++j) { + for (int k = 0; k < 24; ++k) { +@@ -35,7 +35,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + } + + }); +- private static final float[] j = (float[]) SystemUtils.a((new float[25]), (afloat) -> { // CraftBukkit - decompile error ++ private static final float[] j = SystemUtils.a((new float[25]), (afloat) -> { // CraftBukkit - decompile error + for (int i = -2; i <= 2; ++i) { + for (int j = -2; j <= 2; ++j) { + float f = 10.0F / MathHelper.c((float) (i * i + j * j) + 0.2F); +@@ -88,7 +88,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + this.q = new NoiseGeneratorOctaves(this.e, IntStream.rangeClosed(-15, 0)); + this.r = new NoiseGeneratorOctaves(this.e, IntStream.rangeClosed(-15, 0)); + this.s = new NoiseGeneratorOctaves(this.e, IntStream.rangeClosed(-7, 0)); +- this.t = (NoiseGenerator) (noisesettings.i() ? new NoiseGenerator3(this.e, IntStream.rangeClosed(-3, 0)) : new NoiseGeneratorOctaves(this.e, IntStream.rangeClosed(-3, 0))); ++ this.t = noisesettings.i() ? new NoiseGenerator3(this.e, IntStream.rangeClosed(-3, 0)) : new NoiseGeneratorOctaves(this.e, IntStream.rangeClosed(-3, 0)); + this.e.a(2620); + this.u = new NoiseGeneratorOctaves(this.e, IntStream.rangeClosed(-15, 0)); + if (noisesettings.k()) { +@@ -164,7 +164,8 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + double d3; + + if (this.v != null) { +- d0 = (double) (/*WorldChunkManagerTheEnd.a(this.v, i, j) Yatopia lithium*/tlCache.get().getNoiseAt(i, j) - 8.0F); ++ /*WorldChunkManagerTheEnd.a(this.v, i, j) Yatopia lithium*/ ++ d0 = tlCache.get().getNoiseAt(i, j) - 8.0F; + if (d0 > 0.0D) { + d1 = 0.25D; + } else { +@@ -211,8 +212,8 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + float f10 = f1 / f2; + float f11 = f / f2; + +- d2 = (double) (f10 * 0.5F - 0.125F); +- d3 = (double) (f11 * 0.9F + 0.1F); ++ d2 = f10 * 0.5F - 0.125F; ++ d3 = f11 * 0.9F + 0.1F; + d0 = d2 * 0.265625D; + d1 = 96.0D / d3; + } +@@ -222,12 +223,12 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + double d6 = d4 / noisesettings.b().c(); + double d7 = d5 / noisesettings.b().d(); + +- d2 = (double) noisesettings.c().a(); +- d3 = (double) noisesettings.c().b(); +- double d8 = (double) noisesettings.c().c(); +- double d9 = (double) noisesettings.d().a(); +- double d10 = (double) noisesettings.d().b(); +- double d11 = (double) noisesettings.d().c(); ++ d2 = noisesettings.c().a(); ++ d3 = noisesettings.c().b(); ++ double d8 = noisesettings.c().c(); ++ double d9 = noisesettings.d().a(); ++ double d10 = noisesettings.d().b(); ++ double d11 = noisesettings.d().c(); + double d12 = noisesettings.j() ? this.c(i, j) : 0.0D; + double d13 = noisesettings.g(); + double d14 = noisesettings.h(); +@@ -262,7 +263,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + } + + private double c(int i, int j) { +- double d0 = this.u.a((double) (i * 200), 10.0D, (double) (j * 200), 1.0D, 0.0D, true); ++ double d0 = this.u.a(i * 200, 10.0D, j * 200, 1.0D, 0.0D, true); + double d1; + + if (d0 < 0.0D) { +@@ -278,14 +279,14 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + + @Override + public int getBaseHeight(int i, int j, HeightMap.Type heightmap_type) { +- return this.a(i, j, (IBlockData[]) null, heightmap_type.e()); ++ return this.a(i, j, null, heightmap_type.e()); + } + + @Override + public IBlockAccess a(int i, int j) { + IBlockData[] aiblockdata = new IBlockData[this.o * this.l]; + +- this.a(i, j, aiblockdata, (Predicate) null); ++ this.a(i, j, aiblockdata, null); + return new BlockColumn(aiblockdata); + } + +@@ -528,7 +529,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + int i5; + + for (d18 = d18 / 2.0D - d18 * d18 * d18 / 24.0D; objectlistiterator.hasNext(); d18 += a(k4, l4, i5) * 0.8D) { +- StructurePiece structurepiece = (StructurePiece) objectlistiterator.next(); ++ StructurePiece structurepiece = objectlistiterator.next(); + StructureBoundingBox structureboundingbox = structurepiece.g(); + + k4 = Math.max(0, Math.max(structureboundingbox.a - j3, j3 - structureboundingbox.d)); +@@ -539,7 +540,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + objectlistiterator.back(objectlist.size()); + + while (objectlistiterator1.hasNext()) { +- WorldGenFeatureDefinedStructureJigsawJunction worldgenfeaturedefinedstructurejigsawjunction = (WorldGenFeatureDefinedStructureJigsawJunction) objectlistiterator1.next(); ++ WorldGenFeatureDefinedStructureJigsawJunction worldgenfeaturedefinedstructurejigsawjunction = objectlistiterator1.next(); + int j5 = j3 - worldgenfeaturedefinedstructurejigsawjunction.a(); + + k4 = j2 - worldgenfeaturedefinedstructurejigsawjunction.b(); +@@ -585,7 +586,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { + } + + private static double b(int i, int j, int k) { +- double d0 = (double) (i * i + k * k); ++ double d0 = i * i + k * k; + double d1 = (double) j + 0.5D; + double d2 = d1 * d1; + double d3 = Math.pow(2.718281828459045D, -(d2 / 16.0D + d0 / 16.0D)); +diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java +index eabc303195f6cc560a4c3ad33e07bcd3abb3bce7..db8ccdc9742a7cf2a74cb5fa6f0aa463b281c2fd 100644 +--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java ++++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java +@@ -124,10 +124,10 @@ public abstract class ChunkMapDistance { + this.computeDelayedTicketFor(entry.getLongKey(), tempLevel[0], entry.getValue()); + } + // Tuinity end - delay chunk unloads +- this.ticketLevelTracker.update(entry.getLongKey(), getLowestTicketLevel((ArraySetSorted) entry.getValue()), false); ++ this.ticketLevelTracker.update(entry.getLongKey(), getLowestTicketLevel(entry.getValue()), false); + } + +- if (((ArraySetSorted) entry.getValue()).isEmpty()) { ++ if (entry.getValue().isEmpty()) { + objectiterator.remove(); + } + } +@@ -136,7 +136,7 @@ public abstract class ChunkMapDistance { + + private static int getLowestTicketLevel(ArraySetSorted> arraysetsorted) { + AsyncCatcher.catchOp("ChunkMapDistance::getLowestTicketLevel"); // Paper +- return !arraysetsorted.isEmpty() ? ((Ticket) arraysetsorted.b()).b() : PlayerChunkMap.GOLDEN_TICKET + 1; ++ return !arraysetsorted.isEmpty() ? arraysetsorted.b().b() : PlayerChunkMap.GOLDEN_TICKET + 1; + } + + protected abstract boolean a(long i); +@@ -231,7 +231,7 @@ public abstract class ChunkMapDistance { + AsyncCatcher.catchOp("ChunkMapDistance::addTicket"); // Paper + ArraySetSorted> arraysetsorted = this.e(i); + int j = getLowestTicketLevel(arraysetsorted); +- Ticket ticket1 = (Ticket) arraysetsorted.a(ticket); // CraftBukkit - decompile error ++ Ticket ticket1 = arraysetsorted.a(ticket); // CraftBukkit - decompile error + + ticket1.a(this.currentTick); + if (ticket.b() < j) { +@@ -428,7 +428,7 @@ public abstract class ChunkMapDistance { + + private ArraySetSorted> e(long i) { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Async tickets compute"); // Tuinity +- return (ArraySetSorted) this.tickets.computeIfAbsent(i, (j) -> { ++ return this.tickets.computeIfAbsent(i, (j) -> { + return ArraySetSorted.a(4); + }); + } +@@ -448,9 +448,9 @@ public abstract class ChunkMapDistance { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Async player add"); // Tuinity + long i = sectionposition.r().pair(); + +- ((ObjectSet) this.c.computeIfAbsent(i, (j) -> { ++ this.c.computeIfAbsent(i, (j) -> { + return new ObjectOpenHashSet(); +- })).add(entityplayer); ++ }).add(entityplayer); + //this.f.update(i, 0, true); // Paper - no longer used + this.g.update(i, 0, true); + } +@@ -458,7 +458,7 @@ public abstract class ChunkMapDistance { + public void b(SectionPosition sectionposition, EntityPlayer entityplayer) { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Async player remove"); // Tuinity + long i = sectionposition.r().pair(); +- ObjectSet objectset = (ObjectSet) this.c.get(i); ++ ObjectSet objectset = this.c.get(i); + + if (objectset != null) objectset.remove(entityplayer); // Paper - some state corruption happens here, don't crash, clean up gracefully. + if (objectset == null || objectset.isEmpty()) { // Paper +@@ -470,11 +470,11 @@ public abstract class ChunkMapDistance { + } + + protected String c(long i) { +- ArraySetSorted> arraysetsorted = (ArraySetSorted) this.tickets.get(i); ++ ArraySetSorted> arraysetsorted = this.tickets.get(i); + String s; + + if (arraysetsorted != null && !arraysetsorted.isEmpty()) { +- s = ((Ticket) arraysetsorted.b()).toString(); ++ s = arraysetsorted.b().toString(); + } else { + s = "no_ticket"; + } +@@ -533,9 +533,9 @@ public abstract class ChunkMapDistance { + + @Override + protected int b(long i) { +- ArraySetSorted> arraysetsorted = (ArraySetSorted) ChunkMapDistance.this.tickets.get(i); ++ ArraySetSorted> arraysetsorted = ChunkMapDistance.this.tickets.get(i); + +- return arraysetsorted == null ? Integer.MAX_VALUE : (arraysetsorted.isEmpty() ? Integer.MAX_VALUE : ((Ticket) arraysetsorted.b()).b()); ++ return arraysetsorted == null ? Integer.MAX_VALUE : (arraysetsorted.isEmpty() ? Integer.MAX_VALUE : arraysetsorted.b().b()); + } + + @Override +@@ -823,7 +823,7 @@ public abstract class ChunkMapDistance { + } + + private boolean d(long i) { +- ObjectSet objectset = (ObjectSet) ChunkMapDistance.this.c.get(i); ++ ObjectSet objectset = ChunkMapDistance.this.c.get(i); + + return objectset != null && !objectset.isEmpty(); + } +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index 22f96def107223b07dd4b3b89b65cb103a061741..b2d9a1327155586589e37b220da4fffdc82d9dc9 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -624,7 +624,7 @@ public class ChunkProviderServer extends IChunkProvider { + public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) { + final int x = i; final int z = j; // Paper - conflict on variable change + if (Thread.currentThread() != this.serverThread) { +- return (IChunkAccess) CompletableFuture.supplyAsync(() -> { ++ return CompletableFuture.supplyAsync(() -> { + return this.getChunkAt(i, j, chunkstatus, flag); + }, this.serverThreadQueue).join(); + } else { +@@ -672,7 +672,7 @@ public class ChunkProviderServer extends IChunkProvider { + return ichunkaccess1; + }, (playerchunk_failure) -> { + if (flag) { +- throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Chunk not there when requested: " + playerchunk_failure)); ++ throw SystemUtils.c(new IllegalStateException("Chunk not there when requested: " + playerchunk_failure)); + } else { + return null; + } +@@ -694,8 +694,8 @@ public class ChunkProviderServer extends IChunkProvider { + + private void clearCache() { + Arrays.fill(this.cachePos, ChunkCoordIntPair.a); +- Arrays.fill(this.cacheStatus, (Object) null); +- Arrays.fill(this.cacheChunk, (Object) null); ++ Arrays.fill(this.cacheStatus, null); ++ Arrays.fill(this.cacheChunk, null); + } + + private long syncLoadCounter; // Tuinity - prevent plugin unloads from removing our ticket +@@ -735,7 +735,7 @@ public class ChunkProviderServer extends IChunkProvider { + //gameprofilerfiller.exit(); // Akarin - remove caller + if (this.a(playerchunk, l)) { + this.chunkMapDistance.removeTicketAtLevel(TicketType.REQUIRED_LOAD, chunkcoordintpair, l, identifier); // Tuinity +- throw (IllegalStateException) SystemUtils.c(new IllegalStateException("No chunk holder after ticket has been added")); ++ throw SystemUtils.c(new IllegalStateException("No chunk holder after ticket has been added")); + } + } + } else { identifier = null; } // Tuinity - prevent plugin unloads from removing our ticket +@@ -777,11 +777,11 @@ public class ChunkProviderServer extends IChunkProvider { + int l = ChunkProviderServer.b.size() - 1; + + while (true) { +- ChunkStatus chunkstatus = (ChunkStatus) ChunkProviderServer.b.get(l); ++ ChunkStatus chunkstatus = ChunkProviderServer.b.get(l); + Optional optional = ((Either) playerchunk.getStatusFutureUnchecked(chunkstatus).getNow(PlayerChunk.UNLOADED_CHUNK_ACCESS)).left(); + + if (optional.isPresent()) { +- return (IBlockAccess) optional.get(); ++ return optional.get(); + } + + if (chunkstatus == ChunkStatus.LIGHT.e()) { +@@ -966,7 +966,7 @@ public class ChunkProviderServer extends IChunkProvider { + int chunkZ = net.minecraft.server.MCUtil.getChunkCoordinate(player.locZ()); + + playerChunkMap.playerMobSpawnMap.addOrUpdate(player, chunkX, chunkZ, range); +- player.lastEntitySpawnRadiusSquared = (double)((range << 4) * (range << 4)); // used in isOutsideRange ++ player.lastEntitySpawnRadiusSquared = (range << 4) * (range << 4); // used in isOutsideRange + player.playerNaturallySpawnedEvent = event; + } + // Paper end - optimize isOutisdeRange +diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +index 6c117070ba321a1a59c97fd638c54b9126a48333..43d5d6f5bcc3cc476ab3e8e0f52c86717a43de83 100644 +--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +@@ -405,7 +405,7 @@ public class ChunkRegionLoader { + break; + } + } +- ChunkSection chunksection = (ChunkSection) found; ++ ChunkSection chunksection = found; + // Paper start - async chunk save for unload + NibbleArray nibblearray; // block light + NibbleArray nibblearray1; // sky light +@@ -557,7 +557,7 @@ public class ChunkRegionLoader { + Entry entry = (Entry) iterator2.next(); + + if (ichunkaccess.getChunkStatus().h().contains(entry.getKey())) { +- nbttagcompound2.set(((HeightMap.Type) entry.getKey()).b(), new NBTTagLongArray(((HeightMap) entry.getValue()).a())); ++ nbttagcompound2.set(entry.getKey().b(), new NBTTagLongArray(entry.getValue().a())); + } + } + +@@ -643,7 +643,7 @@ public class ChunkRegionLoader { + while (iterator.hasNext()) { + Entry, StructureStart> entry = (Entry) iterator.next(); + +- nbttagcompound1.set(((StructureGenerator) entry.getKey()).i(), ((StructureStart) entry.getValue()).a(chunkcoordintpair.x, chunkcoordintpair.z)); ++ nbttagcompound1.set(entry.getKey().i(), entry.getValue().a(chunkcoordintpair.x, chunkcoordintpair.z)); + } + + nbttagcompound.set("Starts", nbttagcompound1); +@@ -653,7 +653,7 @@ public class ChunkRegionLoader { + while (iterator1.hasNext()) { + Entry, LongSet> entry1 = (Entry) iterator1.next(); + +- nbttagcompound2.set(((StructureGenerator) entry1.getKey()).i(), new NBTTagLongArray((LongSet) entry1.getValue())); ++ nbttagcompound2.set(entry1.getKey().i(), new NBTTagLongArray(entry1.getValue())); + } + + nbttagcompound.set("References", nbttagcompound2); +@@ -668,7 +668,7 @@ public class ChunkRegionLoader { + while (iterator.hasNext()) { + String s = (String) iterator.next(); + String s1 = s.toLowerCase(Locale.ROOT); +- StructureGenerator structuregenerator = (StructureGenerator) StructureGenerator.a.get(s1); ++ StructureGenerator structuregenerator = StructureGenerator.a.get(s1); + + if (structuregenerator == null) { + ChunkRegionLoader.LOGGER.error("Unknown structure start: {}", s1); +@@ -720,7 +720,7 @@ public class ChunkRegionLoader { + ShortListIterator shortlistiterator = shortlist.iterator(); + + while (shortlistiterator.hasNext()) { +- Short oshort = (Short) shortlistiterator.next(); ++ Short oshort = shortlistiterator.next(); + + nbttaglist1.add(NBTTagShort.a(oshort)); + } +diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java +index bdfbd1c51aa25b06ecb4abfc0012712cbbcafaa7..66a5457bf7fa9f8d136c52f5ade211b6a59651e1 100644 +--- a/src/main/java/net/minecraft/server/ChunkSection.java ++++ b/src/main/java/net/minecraft/server/ChunkSection.java +@@ -39,7 +39,7 @@ public class ChunkSection { + } + + public Fluid b(int i, int j, int k) { +- return ((IBlockData) this.blockIds.a(i, j, k)).getFluid(); // Paper - diff on change - we expect this to be effectively just getType(x, y, z).getFluid(). If this changes we need to check other patches that use IBlockData#getFluid. ++ return this.blockIds.a(i, j, k).getFluid(); // Paper - diff on change - we expect this to be effectively just getType(x, y, z).getFluid(). If this changes we need to check other patches that use IBlockData#getFluid. + } + + public void a() { +@@ -58,9 +58,9 @@ public class ChunkSection { + IBlockData iblockdata1; + + if (flag) { +- iblockdata1 = (IBlockData) this.blockIds.setBlock(i, j, k, iblockdata); ++ iblockdata1 = this.blockIds.setBlock(i, j, k, iblockdata); + } else { +- iblockdata1 = (IBlockData) this.blockIds.b(i, j, k, iblockdata); ++ iblockdata1 = this.blockIds.b(i, j, k, iblockdata); + } + + Fluid fluid = iblockdata1.getFluid(); +diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java +index aa4c400e214775fb1e6bfefd11713c1ff9418ddf..535ad1fec8b2d6d899089778b5c3177558c585ec 100644 +--- a/src/main/java/net/minecraft/server/ChunkStatus.java ++++ b/src/main/java/net/minecraft/server/ChunkStatus.java +@@ -24,7 +24,7 @@ public class ChunkStatus { + + return CompletableFuture.completedFuture(Either.left(ichunkaccess)); + }; +- public static final ChunkStatus EMPTY = a("empty", (ChunkStatus) null, -1, ChunkStatus.n, ChunkStatus.Type.PROTOCHUNK, (worldserver, chunkgenerator, list, ichunkaccess) -> { ++ public static final ChunkStatus EMPTY = a("empty", null, -1, ChunkStatus.n, ChunkStatus.Type.PROTOCHUNK, (worldserver, chunkgenerator, list, ichunkaccess) -> { + }); + public static final ChunkStatus STRUCTURE_STARTS = a("structure_starts", ChunkStatus.EMPTY, 0, ChunkStatus.n, ChunkStatus.Type.PROTOCHUNK, (chunkstatus, worldserver, chunkgenerator, definedstructuremanager, lightenginethreaded, function, list, ichunkaccess) -> { + if (!ichunkaccess.getChunkStatus().b(chunkstatus)) { +@@ -64,7 +64,7 @@ public class ChunkStatus { + public static final ChunkStatus FEATURES = a("features", ChunkStatus.LIQUID_CARVERS, 8, ChunkStatus.o, ChunkStatus.Type.PROTOCHUNK, (chunkstatus, worldserver, chunkgenerator, definedstructuremanager, lightenginethreaded, function, list, ichunkaccess) -> { + ProtoChunk protochunk = (ProtoChunk) ichunkaccess; + +- protochunk.a((LightEngine) lightenginethreaded); ++ protochunk.a(lightenginethreaded); + if (!ichunkaccess.getChunkStatus().b(chunkstatus)) { + HeightMap.a(ichunkaccess, EnumSet.of(HeightMap.Type.MOTION_BLOCKING, HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, HeightMap.Type.OCEAN_FLOOR, HeightMap.Type.WORLD_SURFACE)); + RegionLimitedWorldAccess regionlimitedworldaccess = new RegionLimitedWorldAccess(worldserver, list); +@@ -86,16 +86,16 @@ public class ChunkStatus { + public static final ChunkStatus HEIGHTMAPS = a("heightmaps", ChunkStatus.SPAWN, 0, ChunkStatus.o, ChunkStatus.Type.PROTOCHUNK, (worldserver, chunkgenerator, list, ichunkaccess) -> { + }); + public static final ChunkStatus FULL = a("full", ChunkStatus.HEIGHTMAPS, 0, ChunkStatus.o, ChunkStatus.Type.LEVELCHUNK, (chunkstatus, worldserver, chunkgenerator, definedstructuremanager, lightenginethreaded, function, list, ichunkaccess) -> { +- return (CompletableFuture) function.apply(ichunkaccess); ++ return function.apply(ichunkaccess); + }, (chunkstatus, worldserver, definedstructuremanager, lightenginethreaded, function, ichunkaccess) -> { +- return (CompletableFuture) function.apply(ichunkaccess); ++ return function.apply(ichunkaccess); + }); + private static final List q = ImmutableList.of(ChunkStatus.FULL, ChunkStatus.FEATURES, ChunkStatus.LIQUID_CARVERS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS); +- private static final IntList r = (IntList) SystemUtils.a((new IntArrayList(a().size())), (java.util.function.Consumer) (intarraylist) -> { // CraftBukkit - decompile error ++ private static final IntList r = SystemUtils.a((new IntArrayList(a().size())), (java.util.function.Consumer) (intarraylist) -> { // CraftBukkit - decompile error + int i = 0; + + for (int j = a().size() - 1; j >= 0; --j) { +- while (i + 1 < ChunkStatus.q.size() && j <= ((ChunkStatus) ChunkStatus.q.get(i + 1)).c()) { ++ while (i + 1 < ChunkStatus.q.size() && j <= ChunkStatus.q.get(i + 1).c()) { + ++i; + } + +@@ -153,7 +153,7 @@ public class ChunkStatus { + } + + public static ChunkStatus a(int i) { +- return i >= ChunkStatus.q.size() ? ChunkStatus.EMPTY : (i < 0 ? ChunkStatus.FULL : (ChunkStatus) ChunkStatus.q.get(i)); ++ return i >= ChunkStatus.q.size() ? ChunkStatus.EMPTY : (i < 0 ? ChunkStatus.FULL : ChunkStatus.q.get(i)); + } + + public static int b() { +@@ -191,7 +191,7 @@ public class ChunkStatus { + } + + public CompletableFuture> a(WorldServer worldserver, ChunkGenerator chunkgenerator, DefinedStructureManager definedstructuremanager, LightEngineThreaded lightenginethreaded, Function>> function, List list) { +- return this.v.doWork(this, worldserver, chunkgenerator, definedstructuremanager, lightenginethreaded, function, list, (IChunkAccess) list.get(list.size() / 2)); ++ return this.v.doWork(this, worldserver, chunkgenerator, definedstructuremanager, lightenginethreaded, function, list, list.get(list.size() / 2)); + } + + public CompletableFuture> a(WorldServer worldserver, DefinedStructureManager definedstructuremanager, LightEngineThreaded lightenginethreaded, Function>> function, IChunkAccess ichunkaccess) { +@@ -219,7 +219,7 @@ public class ChunkStatus { + } + // Paper end + public static ChunkStatus a(String s) { +- return (ChunkStatus) IRegistry.CHUNK_STATUS.get(MinecraftKey.a(s)); ++ return IRegistry.CHUNK_STATUS.get(MinecraftKey.a(s)); + } + + public EnumSet h() { +diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java +index 75818cd3f54dcd362f78842a640ce17f4c5913ef..55a0b14000cdc19a622cf974e0581659befee398 100644 +--- a/src/main/java/net/minecraft/server/CombatTracker.java ++++ b/src/main/java/net/minecraft/server/CombatTracker.java +@@ -27,9 +27,9 @@ public class CombatTracker { + Optional optional = this.b.dq(); + + if (optional.isPresent()) { +- IBlockData iblockdata = this.b.world.getType((BlockPosition) optional.get()); ++ IBlockData iblockdata = this.b.world.getType(optional.get()); + +- if (!iblockdata.a(Blocks.LADDER) && !iblockdata.a((Tag) TagsBlock.TRAPDOORS)) { ++ if (!iblockdata.a(Blocks.LADDER) && !iblockdata.a(TagsBlock.TRAPDOORS)) { + if (iblockdata.a(Blocks.VINE)) { + this.h = "vines"; + } else if (!iblockdata.a(Blocks.WEEPING_VINES) && !iblockdata.a(Blocks.WEEPING_VINES_PLANT)) { +@@ -73,10 +73,10 @@ public class CombatTracker { + + public IChatBaseComponent getDeathMessage() { + if (this.a.isEmpty()) { +- return new ChatMessage("death.attack.generic", new Object[]{this.b.getScoreboardDisplayName()}); ++ return new ChatMessage("death.attack.generic", this.b.getScoreboardDisplayName()); + } else { + CombatEntry combatentry = this.j(); +- CombatEntry combatentry1 = (CombatEntry) this.a.get(this.a.size() - 1); ++ CombatEntry combatentry1 = this.a.get(this.a.size() - 1); + IChatBaseComponent ichatbasecomponent = combatentry1.h(); + Entity entity = combatentry1.a().getEntity(); + Object object; +@@ -90,23 +90,23 @@ public class CombatTracker { + ItemStack itemstack = entity1 instanceof EntityLiving ? ((EntityLiving) entity1).getItemInMainHand() : ItemStack.b; + + if (!itemstack.isEmpty() && itemstack.hasName()) { +- object = new ChatMessage("death.fell.assist.item", new Object[]{this.b.getScoreboardDisplayName(), ichatbasecomponent1, itemstack.C()}); ++ object = new ChatMessage("death.fell.assist.item", this.b.getScoreboardDisplayName(), ichatbasecomponent1, itemstack.C()); + } else { +- object = new ChatMessage("death.fell.assist", new Object[]{this.b.getScoreboardDisplayName(), ichatbasecomponent1}); ++ object = new ChatMessage("death.fell.assist", this.b.getScoreboardDisplayName(), ichatbasecomponent1); + } + } else if (ichatbasecomponent != null) { + ItemStack itemstack1 = entity instanceof EntityLiving ? ((EntityLiving) entity).getItemInMainHand() : ItemStack.b; + + if (!itemstack1.isEmpty() && itemstack1.hasName()) { +- object = new ChatMessage("death.fell.finish.item", new Object[]{this.b.getScoreboardDisplayName(), ichatbasecomponent, itemstack1.C()}); ++ object = new ChatMessage("death.fell.finish.item", this.b.getScoreboardDisplayName(), ichatbasecomponent, itemstack1.C()); + } else { +- object = new ChatMessage("death.fell.finish", new Object[]{this.b.getScoreboardDisplayName(), ichatbasecomponent}); ++ object = new ChatMessage("death.fell.finish", this.b.getScoreboardDisplayName(), ichatbasecomponent); + } + } else { +- object = new ChatMessage("death.fell.killer", new Object[]{this.b.getScoreboardDisplayName()}); ++ object = new ChatMessage("death.fell.killer", this.b.getScoreboardDisplayName()); + } + } else { +- object = new ChatMessage("death.fell.accident." + this.a(combatentry), new Object[]{this.b.getScoreboardDisplayName()}); ++ object = new ChatMessage("death.fell.accident." + this.a(combatentry), this.b.getScoreboardDisplayName()); + } + } else { + object = combatentry1.a().getLocalizedDeathMessage(this.b); +@@ -153,8 +153,8 @@ public class CombatTracker { + float f1 = 0.0F; + + for (int i = 0; i < this.a.size(); ++i) { +- CombatEntry combatentry2 = (CombatEntry) this.a.get(i); +- CombatEntry combatentry3 = i > 0 ? (CombatEntry) this.a.get(i - 1) : null; ++ CombatEntry combatentry2 = this.a.get(i); ++ CombatEntry combatentry3 = i > 0 ? this.a.get(i - 1) : null; + + if ((combatentry2.a() == DamageSource.FALL || combatentry2.a() == DamageSource.OUT_OF_WORLD) && combatentry2.j() > 0.0F && (combatentry == null || combatentry2.j() > f1)) { + if (i > 0) { +diff --git a/src/main/java/net/minecraft/server/CommandDifficulty.java b/src/main/java/net/minecraft/server/CommandDifficulty.java +index 9efc743e028650ccc9cda5a2c9deb1836253b91d..65ab534c0ba2309e3ec98b28f26901e34e5bc475 100644 +--- a/src/main/java/net/minecraft/server/CommandDifficulty.java ++++ b/src/main/java/net/minecraft/server/CommandDifficulty.java +@@ -7,7 +7,7 @@ import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; + public class CommandDifficulty { + + private static final DynamicCommandExceptionType a = new DynamicCommandExceptionType((object) -> { +- return new ChatMessage("commands.difficulty.failure", new Object[]{object}); ++ return new ChatMessage("commands.difficulty.failure", object); + }); + + public static void a(com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher) { +@@ -19,7 +19,7 @@ public class CommandDifficulty { + EnumDifficulty enumdifficulty = aenumdifficulty[j]; + + literalargumentbuilder.then(CommandDispatcher.a(enumdifficulty.c()).executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), enumdifficulty); ++ return a(commandcontext.getSource(), enumdifficulty); + })); + } + +@@ -28,7 +28,7 @@ public class CommandDifficulty { + })).executes((commandcontext) -> { + EnumDifficulty enumdifficulty1 = ((CommandListenerWrapper) commandcontext.getSource()).getWorld().getDifficulty(); + +- ((CommandListenerWrapper) commandcontext.getSource()).sendMessage(new ChatMessage("commands.difficulty.query", new Object[]{enumdifficulty1.b()}), false); ++ ((CommandListenerWrapper) commandcontext.getSource()).sendMessage(new ChatMessage("commands.difficulty.query", enumdifficulty1.b()), false); + return enumdifficulty1.a(); + })); + } +@@ -41,7 +41,7 @@ public class CommandDifficulty { + throw CommandDifficulty.a.create(enumdifficulty.c()); + } else { + minecraftserver.a(world, enumdifficulty, true); // Paper +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.difficulty.success", new Object[]{enumdifficulty.b()}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.difficulty.success", enumdifficulty.b()), true); + return 0; + } + } +diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java +index c11ba2f1c4cfea9d32a432e473a2a82f06a1356a..00ca89a93efdc60dc60dfa0f9ad0c0933bad9476 100644 +--- a/src/main/java/net/minecraft/server/CommandDispatcher.java ++++ b/src/main/java/net/minecraft/server/CommandDispatcher.java +@@ -118,7 +118,7 @@ public class CommandDispatcher { + // CraftBukkit start + public CommandDispatcher() { + this.b.setConsumer((commandcontext, flag1, i) -> { +- ((CommandListenerWrapper) commandcontext.getSource()).a(commandcontext, flag1, i); ++ commandcontext.getSource().a(commandcontext, flag1, i); + }); + } + +@@ -197,12 +197,12 @@ public class CommandDispatcher { + + ichatmutablecomponent.c(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j)); + if (j < commandsyntaxexception.getInput().length()) { +- IChatMutableComponent ichatmutablecomponent1 = (new ChatComponentText(commandsyntaxexception.getInput().substring(j))).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.UNDERLINE}); ++ IChatMutableComponent ichatmutablecomponent1 = (new ChatComponentText(commandsyntaxexception.getInput().substring(j))).a(EnumChatFormat.RED, EnumChatFormat.UNDERLINE); + + ichatmutablecomponent.addSibling(ichatmutablecomponent1); + } + +- ichatmutablecomponent.addSibling((new ChatMessage("command.context.here")).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.ITALIC})); ++ ichatmutablecomponent.addSibling((new ChatMessage("command.context.here")).a(EnumChatFormat.RED, EnumChatFormat.ITALIC)); + commandlistenerwrapper.sendFailureMessage(ichatmutablecomponent); + } + +@@ -254,13 +254,13 @@ public class CommandDispatcher { + + RootCommandNode vanilla = entityplayer.server.vanillaCommandDispatcher.a().getRoot(); + map.put(vanilla, vanillaRoot); +- this.a(vanilla, vanillaRoot, entityplayer.getCommandListener(), (Map) map); ++ this.a(vanilla, vanillaRoot, entityplayer.getCommandListener(), map); + + // Now build the global commands in a second pass + RootCommandNode rootcommandnode = new RootCommandNode(); + + map.put(this.b.getRoot(), rootcommandnode); +- this.a(this.b.getRoot(), rootcommandnode, entityplayer.getCommandListener(), (Map) map); ++ this.a(this.b.getRoot(), rootcommandnode, entityplayer.getCommandListener(), map); + + Collection bukkit = new LinkedHashSet<>(); + for (CommandNode node : rootcommandnode.getChildren()) { +@@ -319,7 +319,7 @@ public class CommandDispatcher { + } + + if (argumentbuilder.getRedirect() != null) { +- argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect())); ++ argumentbuilder.redirect(map.get(argumentbuilder.getRedirect())); + } + + CommandNode commandnode3 = argumentbuilder.build(); // CraftBukkit - decompile error +@@ -359,7 +359,7 @@ public class CommandDispatcher { + + @Nullable + public static CommandSyntaxException a(ParseResults parseresults) { +- return !parseresults.getReader().canRead() ? null : (parseresults.getExceptions().size() == 1 ? (CommandSyntaxException) parseresults.getExceptions().values().iterator().next() : (parseresults.getContext().getRange().isEmpty() ? CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownCommand().createWithContext(parseresults.getReader()) : CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownArgument().createWithContext(parseresults.getReader()))); ++ return !parseresults.getReader().canRead() ? null : (parseresults.getExceptions().size() == 1 ? parseresults.getExceptions().values().iterator().next() : (parseresults.getContext().getRange().isEmpty() ? CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownCommand().createWithContext(parseresults.getReader()) : CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownArgument().createWithContext(parseresults.getReader()))); + } + + public static enum ServerType { +diff --git a/src/main/java/net/minecraft/server/CommandEffect.java b/src/main/java/net/minecraft/server/CommandEffect.java +index ddb9948d3f729dff5daa039f6fba099d46333012..bf2c1e3c10530d1c6a22780efa716a8154eaa8ed 100644 +--- a/src/main/java/net/minecraft/server/CommandEffect.java ++++ b/src/main/java/net/minecraft/server/CommandEffect.java +@@ -20,21 +20,21 @@ public class CommandEffect { + private static final SimpleCommandExceptionType c = new SimpleCommandExceptionType(new ChatMessage("commands.effect.clear.specific.failed")); + + public static void a(com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher) { +- com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("effect").requires((commandlistenerwrapper) -> { ++ com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("effect").requires((commandlistenerwrapper) -> { + return commandlistenerwrapper.hasPermission(2); + })).then(((LiteralArgumentBuilder) CommandDispatcher.a("clear").executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), ImmutableList.of(((CommandListenerWrapper) commandcontext.getSource()).g())); +- })).then(((RequiredArgumentBuilder) CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).executes((commandcontext) -> { ++ return a(commandcontext.getSource(), ImmutableList.of(commandcontext.getSource().g())); ++ })).then(CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets")); +- })).then(CommandDispatcher.a("effect", (ArgumentType) ArgumentMobEffect.a()).executes((commandcontext) -> { ++ }).then(CommandDispatcher.a("effect", (ArgumentType) ArgumentMobEffect.a()).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ArgumentMobEffect.a(commandcontext, "effect")); +- }))))).then(CommandDispatcher.a("give").then(CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).then(((RequiredArgumentBuilder) CommandDispatcher.a("effect", (ArgumentType) ArgumentMobEffect.a()).executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ArgumentMobEffect.a(commandcontext, "effect"), (Integer) null, 0, true); +- })).then(((RequiredArgumentBuilder) CommandDispatcher.a("seconds", (ArgumentType) IntegerArgumentType.integer(1, 1000000)).executes((commandcontext) -> { ++ })))).then(CommandDispatcher.a("give").then(CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).then(CommandDispatcher.a("effect", (ArgumentType) ArgumentMobEffect.a()).executes((commandcontext) -> { ++ return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ArgumentMobEffect.a(commandcontext, "effect"), null, 0, true); ++ }).then(CommandDispatcher.a("seconds", (ArgumentType) IntegerArgumentType.integer(1, 1000000)).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ArgumentMobEffect.a(commandcontext, "effect"), IntegerArgumentType.getInteger(commandcontext, "seconds"), 0, true); +- })).then(((RequiredArgumentBuilder) CommandDispatcher.a("amplifier", (ArgumentType) IntegerArgumentType.integer(0, 255)).executes((commandcontext) -> { ++ }).then(CommandDispatcher.a("amplifier", (ArgumentType) IntegerArgumentType.integer(0, 255)).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ArgumentMobEffect.a(commandcontext, "effect"), IntegerArgumentType.getInteger(commandcontext, "seconds"), IntegerArgumentType.getInteger(commandcontext, "amplifier"), true); +- })).then(CommandDispatcher.a("hideParticles", (ArgumentType) BoolArgumentType.bool()).executes((commandcontext) -> { ++ }).then(CommandDispatcher.a("hideParticles", (ArgumentType) BoolArgumentType.bool()).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ArgumentMobEffect.a(commandcontext, "effect"), IntegerArgumentType.getInteger(commandcontext, "seconds"), IntegerArgumentType.getInteger(commandcontext, "amplifier"), !BoolArgumentType.getBool(commandcontext, "hideParticles")); + })))))))); + } +@@ -73,9 +73,9 @@ public class CommandEffect { + throw CommandEffect.a.create(); + } else { + if (collection.size() == 1) { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.give.success.single", new Object[]{mobeffectlist.d(), ((Entity) collection.iterator().next()).getScoreboardDisplayName(), k / 20}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.give.success.single", mobeffectlist.d(), collection.iterator().next().getScoreboardDisplayName(), k / 20), true); + } else { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.give.success.multiple", new Object[]{mobeffectlist.d(), collection.size(), k / 20}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.give.success.multiple", mobeffectlist.d(), collection.size(), k / 20), true); + } + + return j; +@@ -98,9 +98,9 @@ public class CommandEffect { + throw CommandEffect.b.create(); + } else { + if (collection.size() == 1) { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.clear.everything.success.single", new Object[]{((Entity) collection.iterator().next()).getScoreboardDisplayName()}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.clear.everything.success.single", collection.iterator().next().getScoreboardDisplayName()), true); + } else { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.clear.everything.success.multiple", new Object[]{collection.size()}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.clear.everything.success.multiple", collection.size()), true); + } + + return i; +@@ -123,9 +123,9 @@ public class CommandEffect { + throw CommandEffect.c.create(); + } else { + if (collection.size() == 1) { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.clear.specific.success.single", new Object[]{mobeffectlist.d(), ((Entity) collection.iterator().next()).getScoreboardDisplayName()}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.clear.specific.success.single", mobeffectlist.d(), collection.iterator().next().getScoreboardDisplayName()), true); + } else { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.clear.specific.success.multiple", new Object[]{mobeffectlist.d(), collection.size()}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.effect.clear.specific.success.multiple", mobeffectlist.d(), collection.size()), true); + } + + return i; +diff --git a/src/main/java/net/minecraft/server/CommandGamemode.java b/src/main/java/net/minecraft/server/CommandGamemode.java +index 9ae005dbce25bc1abf5ee6c60aff7707c77691c7..29af97f2036c91d6976244dad28f2e322c119207 100644 +--- a/src/main/java/net/minecraft/server/CommandGamemode.java ++++ b/src/main/java/net/minecraft/server/CommandGamemode.java +@@ -11,7 +11,7 @@ import java.util.Iterator; + public class CommandGamemode { + + public static void a(com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher) { +- LiteralArgumentBuilder literalargumentbuilder = (LiteralArgumentBuilder) CommandDispatcher.a("gamemode").requires((commandlistenerwrapper) -> { ++ LiteralArgumentBuilder literalargumentbuilder = CommandDispatcher.a("gamemode").requires((commandlistenerwrapper) -> { + return commandlistenerwrapper.hasPermission(2); + }); + EnumGamemode[] aenumgamemode = EnumGamemode.values(); +@@ -22,7 +22,7 @@ public class CommandGamemode { + + if (enumgamemode != EnumGamemode.NOT_SET) { + literalargumentbuilder.then(((LiteralArgumentBuilder) CommandDispatcher.a(enumgamemode.b()).executes((commandcontext) -> { +- return a(commandcontext, (Collection) Collections.singleton(((CommandListenerWrapper) commandcontext.getSource()).h()), enumgamemode); ++ return a(commandcontext, Collections.singleton(commandcontext.getSource().h()), enumgamemode); + })).then(CommandDispatcher.a("target", (ArgumentType) ArgumentEntity.d()).executes((commandcontext) -> { + return a(commandcontext, ArgumentEntity.f(commandcontext, "target"), enumgamemode); + }))); +@@ -36,13 +36,13 @@ public class CommandGamemode { + ChatMessage chatmessage = new ChatMessage("gameMode." + enumgamemode.b()); + + if (commandlistenerwrapper.getEntity() == entityplayer) { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamemode.success.self", new Object[]{chatmessage}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamemode.success.self", chatmessage), true); + } else { + if (commandlistenerwrapper.getWorld().getGameRules().getBoolean(GameRules.SEND_COMMAND_FEEDBACK)) { +- entityplayer.sendMessage(new ChatMessage("gameMode.changed", new Object[]{chatmessage}), SystemUtils.b); ++ entityplayer.sendMessage(new ChatMessage("gameMode.changed", chatmessage), SystemUtils.b); + } + +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamemode.success.other", new Object[]{entityplayer.getScoreboardDisplayName(), chatmessage}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamemode.success.other", entityplayer.getScoreboardDisplayName(), chatmessage), true); + } + + } +@@ -62,7 +62,7 @@ public class CommandGamemode { + continue; + } + // CraftBukkit end +- a((CommandListenerWrapper) commandcontext.getSource(), entityplayer, enumgamemode); ++ a(commandcontext.getSource(), entityplayer, enumgamemode); + ++i; + } + } +diff --git a/src/main/java/net/minecraft/server/CommandGamerule.java b/src/main/java/net/minecraft/server/CommandGamerule.java +index 1ae60aae1d2017226c1f3ea39148d24aaf40cdde..0f2be052bb2a9060ab104697b5dc3c4a51f862ea 100644 +--- a/src/main/java/net/minecraft/server/CommandGamerule.java ++++ b/src/main/java/net/minecraft/server/CommandGamerule.java +@@ -6,7 +6,7 @@ import com.mojang.brigadier.context.CommandContext; + public class CommandGamerule { + + public static void a(com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher) { +- final LiteralArgumentBuilder literalargumentbuilder = (LiteralArgumentBuilder) CommandDispatcher.a("gamerule").requires((commandlistenerwrapper) -> { ++ final LiteralArgumentBuilder literalargumentbuilder = CommandDispatcher.a("gamerule").requires((commandlistenerwrapper) -> { + return commandlistenerwrapper.hasPermission(2); + }); + +@@ -14,7 +14,7 @@ public class CommandGamerule { + @Override + public > void a(GameRules.GameRuleKey gamerules_gamerulekey, GameRules.GameRuleDefinition gamerules_gameruledefinition) { + literalargumentbuilder.then(((LiteralArgumentBuilder) CommandDispatcher.a(gamerules_gamerulekey.a()).executes((commandcontext) -> { +- return CommandGamerule.b((CommandListenerWrapper) commandcontext.getSource(), gamerules_gamerulekey); ++ return CommandGamerule.b(commandcontext.getSource(), gamerules_gamerulekey); + })).then(gamerules_gameruledefinition.a("value").executes((commandcontext) -> { + return CommandGamerule.b(commandcontext, gamerules_gamerulekey); + }))); +@@ -24,18 +24,18 @@ public class CommandGamerule { + } + + private static > int b(CommandContext commandcontext, GameRules.GameRuleKey gamerules_gamerulekey) { +- CommandListenerWrapper commandlistenerwrapper = (CommandListenerWrapper) commandcontext.getSource(); ++ CommandListenerWrapper commandlistenerwrapper = commandcontext.getSource(); + T t0 = commandlistenerwrapper.getWorld().getGameRules().get(gamerules_gamerulekey); // CraftBukkit + + t0.b(commandcontext, "value"); +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.set", new Object[]{gamerules_gamerulekey.a(), t0.toString()}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.set", gamerules_gamerulekey.a(), t0.toString()), true); + return t0.getIntValue(); + } + + private static > int b(CommandListenerWrapper commandlistenerwrapper, GameRules.GameRuleKey gamerules_gamerulekey) { + T t0 = commandlistenerwrapper.getWorld().getGameRules().get(gamerules_gamerulekey); // CraftBukkit + +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.query", new Object[]{gamerules_gamerulekey.a(), t0.toString()}), false); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.query", gamerules_gamerulekey.a(), t0.toString()), false); + return t0.getIntValue(); + } + } +diff --git a/src/main/java/net/minecraft/server/CommandListenerWrapper.java b/src/main/java/net/minecraft/server/CommandListenerWrapper.java +index 2829ea1b689286314c1d0c5579abd0c553aca405..22a25f54652a966cca580d5a92036306299bd3fe 100644 +--- a/src/main/java/net/minecraft/server/CommandListenerWrapper.java ++++ b/src/main/java/net/minecraft/server/CommandListenerWrapper.java +@@ -73,7 +73,7 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys + } + + public CommandListenerWrapper a(ResultConsumer resultconsumer, BinaryOperator> binaryoperator) { +- ResultConsumer resultconsumer1 = (ResultConsumer) binaryoperator.apply(this.l, resultconsumer); ++ ResultConsumer resultconsumer1 = binaryoperator.apply(this.l, resultconsumer); + + return this.a(resultconsumer1); + } +@@ -107,7 +107,7 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys + double d0 = vec3d.x - vec3d1.x; + double d1 = vec3d.y - vec3d1.y; + double d2 = vec3d.z - vec3d1.z; +- double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); ++ double d3 = MathHelper.sqrt(d0 * d0 + d2 * d2); + float f = MathHelper.g((float) (-(MathHelper.d(d1, d3) * 57.2957763671875D))); + float f1 = MathHelper.g((float) (MathHelper.d(d2, d0) * 57.2957763671875D) - 90.0F); + +@@ -215,7 +215,7 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys + } + + private void sendAdminMessage(IChatBaseComponent ichatbasecomponent) { +- IChatMutableComponent ichatmutablecomponent = (new ChatMessage("chat.type.admin", new Object[]{this.getScoreboardDisplayName(), ichatbasecomponent})).a(new EnumChatFormat[]{EnumChatFormat.GRAY, EnumChatFormat.ITALIC}); ++ IChatMutableComponent ichatmutablecomponent = (new ChatMessage("chat.type.admin", new Object[]{this.getScoreboardDisplayName(), ichatbasecomponent})).a(EnumChatFormat.GRAY, EnumChatFormat.ITALIC); + + if (this.i.getGameRules().getBoolean(GameRules.SEND_COMMAND_FEEDBACK)) { + Iterator iterator = this.i.getPlayerList().getPlayers().iterator(); +diff --git a/src/main/java/net/minecraft/server/CommandSpreadPlayers.java b/src/main/java/net/minecraft/server/CommandSpreadPlayers.java +index 2a1baa58de9a1061e45dea46486ea8696d95d7d2..937a1b04b701e4b037d952e8f1c683bc8809030b 100644 +--- a/src/main/java/net/minecraft/server/CommandSpreadPlayers.java ++++ b/src/main/java/net/minecraft/server/CommandSpreadPlayers.java +@@ -16,34 +16,34 @@ import java.util.*; + public class CommandSpreadPlayers { + + private static final Dynamic4CommandExceptionType a = new Dynamic4CommandExceptionType((object, object1, object2, object3) -> { +- return new ChatMessage("commands.spreadplayers.failed.teams", new Object[]{object, object1, object2, object3}); ++ return new ChatMessage("commands.spreadplayers.failed.teams", object, object1, object2, object3); + }); + private static final Dynamic4CommandExceptionType b = new Dynamic4CommandExceptionType((object, object1, object2, object3) -> { +- return new ChatMessage("commands.spreadplayers.failed.entities", new Object[]{object, object1, object2, object3}); ++ return new ChatMessage("commands.spreadplayers.failed.entities", object, object1, object2, object3); + }); + + public static void a(com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher) { + com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("spreadplayers").requires((commandlistenerwrapper) -> { + return commandlistenerwrapper.hasPermission(2); +- })).then(CommandDispatcher.a("center", (ArgumentType) ArgumentVec2.a()).then(CommandDispatcher.a("spreadDistance", (ArgumentType) FloatArgumentType.floatArg(0.0F)).then(((RequiredArgumentBuilder) CommandDispatcher.a("maxRange", (ArgumentType) FloatArgumentType.floatArg(1.0F)).then(CommandDispatcher.a("respectTeams", (ArgumentType) BoolArgumentType.bool()).then(CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).executes((commandcontext) -> { ++ })).then(CommandDispatcher.a("center", (ArgumentType) ArgumentVec2.a()).then(CommandDispatcher.a("spreadDistance", (ArgumentType) FloatArgumentType.floatArg(0.0F)).then(CommandDispatcher.a("maxRange", (ArgumentType) FloatArgumentType.floatArg(1.0F)).then(CommandDispatcher.a("respectTeams", (ArgumentType) BoolArgumentType.bool()).then(CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentVec2.a(commandcontext, "center"), FloatArgumentType.getFloat(commandcontext, "spreadDistance"), FloatArgumentType.getFloat(commandcontext, "maxRange"), 256, BoolArgumentType.getBool(commandcontext, "respectTeams"), ArgumentEntity.b(commandcontext, "targets")); +- })))).then(CommandDispatcher.a("under").then(CommandDispatcher.a("maxHeight", (ArgumentType) IntegerArgumentType.integer(0)).then(CommandDispatcher.a("respectTeams", (ArgumentType) BoolArgumentType.bool()).then(CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).executes((commandcontext) -> { ++ }))).then(CommandDispatcher.a("under").then(CommandDispatcher.a("maxHeight", (ArgumentType) IntegerArgumentType.integer(0)).then(CommandDispatcher.a("respectTeams", (ArgumentType) BoolArgumentType.bool()).then(CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentVec2.a(commandcontext, "center"), FloatArgumentType.getFloat(commandcontext, "spreadDistance"), FloatArgumentType.getFloat(commandcontext, "maxRange"), IntegerArgumentType.getInteger(commandcontext, "maxHeight"), BoolArgumentType.getBool(commandcontext, "respectTeams"), ArgumentEntity.b(commandcontext, "targets")); + }))))))))); + } + + private static int a(CommandListenerWrapper commandlistenerwrapper, Vec2F vec2f, float f, float f1, int i, boolean flag, Collection collection) throws CommandSyntaxException { + Random random = new Random(); +- double d0 = (double) (vec2f.i - f1); +- double d1 = (double) (vec2f.j - f1); +- double d2 = (double) (vec2f.i + f1); +- double d3 = (double) (vec2f.j + f1); ++ double d0 = vec2f.i - f1; ++ double d1 = vec2f.j - f1; ++ double d2 = vec2f.i + f1; ++ double d3 = vec2f.j + f1; + CommandSpreadPlayers.a[] acommandspreadplayers_a = a(random, flag ? a(collection) : collection.size(), d0, d1, d2, d3); + +- a(vec2f, (double) f, commandlistenerwrapper.getWorld(), random, d0, d1, d2, d3, i, acommandspreadplayers_a, flag); ++ a(vec2f, f, commandlistenerwrapper.getWorld(), random, d0, d1, d2, d3, i, acommandspreadplayers_a, flag); + double d4 = a(collection, commandlistenerwrapper.getWorld(), acommandspreadplayers_a, i, flag); + +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.spreadplayers.success." + (flag ? "teams" : "entities"), new Object[]{acommandspreadplayers_a.length, vec2f.i, vec2f.j, String.format(Locale.ROOT, "%.2f", d4)}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.spreadplayers.success." + (flag ? "teams" : "entities"), acommandspreadplayers_a.length, vec2f.i, vec2f.j, String.format(Locale.ROOT, "%.2f", d4)), true); + return acommandspreadplayers_a.length; + } + +@@ -57,7 +57,7 @@ public class CommandSpreadPlayers { + if (entity instanceof EntityHuman) { + set.add(entity.getScoreboardTeam()); + } else { +- set.add((ScoreboardTeamBase) null); // CraftBukkit - decompile error ++ set.add(null); // CraftBukkit - decompile error + } + } + +@@ -100,7 +100,7 @@ public class CommandSpreadPlayers { + if (k > 0) { + commandspreadplayers_a.a = commandspreadplayers_a.a / (double) k; + commandspreadplayers_a.b = commandspreadplayers_a.b / (double) k; +- double d7 = (double) commandspreadplayers_a.b(); ++ double d7 = commandspreadplayers_a.b(); + + if (d7 > 0.0D) { + commandspreadplayers_a.a(); +@@ -162,12 +162,12 @@ public class CommandSpreadPlayers { + map.put(scoreboardteambase, acommandspreadplayers_a[j++]); + } + +- commandspreadplayers_a = (CommandSpreadPlayers.a) map.get(scoreboardteambase); ++ commandspreadplayers_a = map.get(scoreboardteambase); + } else { + commandspreadplayers_a = acommandspreadplayers_a[j++]; + } + +- entity.enderTeleportAndLoad((double) MathHelper.floor(commandspreadplayers_a.a) + 0.5D, (double) commandspreadplayers_a.a(worldserver, i), (double) MathHelper.floor(commandspreadplayers_a.b) + 0.5D); ++ entity.enderTeleportAndLoad((double) MathHelper.floor(commandspreadplayers_a.a) + 0.5D, commandspreadplayers_a.a(worldserver, i), (double) MathHelper.floor(commandspreadplayers_a.b) + 0.5D); + d1 = Double.MAX_VALUE; + CommandSpreadPlayers.a[] acommandspreadplayers_a1 = acommandspreadplayers_a; + int k = acommandspreadplayers_a.length; +@@ -186,7 +186,7 @@ public class CommandSpreadPlayers { + if (collection.size() < 2) { + return 0.0D; + } else { +- d0 /= (double) collection.size(); ++ d0 /= collection.size(); + return d0; + } + } +@@ -219,7 +219,7 @@ public class CommandSpreadPlayers { + } + + void a() { +- double d0 = (double) this.b(); ++ double d0 = this.b(); + + this.a /= d0; + this.b /= d0; +@@ -257,7 +257,7 @@ public class CommandSpreadPlayers { + } + + public int a(IBlockAccess iblockaccess, int i) { +- BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(this.a, (double) (i + 1), this.b); ++ BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(this.a, i + 1, this.b); + boolean flag = iblockaccess.getType(blockposition_mutableblockposition).isAir(); + + blockposition_mutableblockposition.c(EnumDirection.DOWN); +@@ -278,7 +278,7 @@ public class CommandSpreadPlayers { + } + + public boolean b(IBlockAccess iblockaccess, int i) { +- BlockPosition blockposition = new BlockPosition(this.a, (double) (this.a(iblockaccess, i) - 1), this.b); ++ BlockPosition blockposition = new BlockPosition(this.a, this.a(iblockaccess, i) - 1, this.b); + IBlockData iblockdata = getType(iblockaccess, blockposition); // CraftBukkit + Material material = iblockdata.getMaterial(); + +diff --git a/src/main/java/net/minecraft/server/CommandTeleport.java b/src/main/java/net/minecraft/server/CommandTeleport.java +index c0934df435089d020c2e637ec6329d9bf9276c0f..5d02230bd53603a1e0ba3b741e14696cf0fdd1a3 100644 +--- a/src/main/java/net/minecraft/server/CommandTeleport.java ++++ b/src/main/java/net/minecraft/server/CommandTeleport.java +@@ -19,23 +19,23 @@ public class CommandTeleport { + private static final SimpleCommandExceptionType a = new SimpleCommandExceptionType(new ChatMessage("commands.teleport.invalidPosition")); + + public static void a(com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher) { +- LiteralCommandNode literalcommandnode = com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("teleport").requires((commandlistenerwrapper) -> { ++ LiteralCommandNode literalcommandnode = com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("teleport").requires((commandlistenerwrapper) -> { + return commandlistenerwrapper.hasPermission(2); +- })).then(((RequiredArgumentBuilder) CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).then(((RequiredArgumentBuilder) ((RequiredArgumentBuilder) CommandDispatcher.a("location", (ArgumentType) ArgumentVec3.a()).executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), (IVectorPosition) null, (CommandTeleport.a) null); +- })).then(CommandDispatcher.a("rotation", (ArgumentType) ArgumentRotation.a()).executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), ArgumentRotation.a(commandcontext, "rotation"), (CommandTeleport.a) null); +- }))).then(((LiteralArgumentBuilder) CommandDispatcher.a("facing").then(CommandDispatcher.a("entity").then(((RequiredArgumentBuilder) CommandDispatcher.a("facingEntity", (ArgumentType) ArgumentEntity.a()).executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), (IVectorPosition) null, new CommandTeleport.a(ArgumentEntity.a(commandcontext, "facingEntity"), ArgumentAnchor.Anchor.FEET)); +- })).then(CommandDispatcher.a("facingAnchor", (ArgumentType) ArgumentAnchor.a()).executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), (IVectorPosition) null, new CommandTeleport.a(ArgumentEntity.a(commandcontext, "facingEntity"), ArgumentAnchor.a(commandcontext, "facingAnchor"))); +- }))))).then(CommandDispatcher.a("facingLocation", (ArgumentType) ArgumentVec3.a()).executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), (IVectorPosition) null, new CommandTeleport.a(ArgumentVec3.a(commandcontext, "facingLocation"))); +- }))))).then(CommandDispatcher.a("destination", (ArgumentType) ArgumentEntity.a()).executes((commandcontext) -> { ++ })).then(CommandDispatcher.a("targets", (ArgumentType) ArgumentEntity.multipleEntities()).then(CommandDispatcher.a("location", (ArgumentType) ArgumentVec3.a()).executes((commandcontext) -> { ++ return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), null, null); ++ }).then(CommandDispatcher.a("rotation", (ArgumentType) ArgumentRotation.a()).executes((commandcontext) -> { ++ return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), ArgumentRotation.a(commandcontext, "rotation"), null); ++ })).then(CommandDispatcher.a("facing").then(CommandDispatcher.a("entity").then(CommandDispatcher.a("facingEntity", (ArgumentType) ArgumentEntity.a()).executes((commandcontext) -> { ++ return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), null, new a(ArgumentEntity.a(commandcontext, "facingEntity"), ArgumentAnchor.Anchor.FEET)); ++ }).then(CommandDispatcher.a("facingAnchor", (ArgumentType) ArgumentAnchor.a()).executes((commandcontext) -> { ++ return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), null, new a(ArgumentEntity.a(commandcontext, "facingEntity"), ArgumentAnchor.a(commandcontext, "facingAnchor"))); ++ })))).then(CommandDispatcher.a("facingLocation", (ArgumentType) ArgumentVec3.a()).executes((commandcontext) -> { ++ return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), null, new a(ArgumentVec3.a(commandcontext, "facingLocation"))); ++ })))).then(CommandDispatcher.a("destination", (ArgumentType) ArgumentEntity.a()).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentEntity.b(commandcontext, "targets"), ArgumentEntity.a(commandcontext, "destination")); +- })))).then(CommandDispatcher.a("location", (ArgumentType) ArgumentVec3.a()).executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), Collections.singleton(((CommandListenerWrapper) commandcontext.getSource()).g()), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), VectorPosition.d(), (CommandTeleport.a) null); +- }))).then(CommandDispatcher.a("destination", (ArgumentType) ArgumentEntity.a()).executes((commandcontext) -> { ++ }))).then(CommandDispatcher.a("location", (ArgumentType) ArgumentVec3.a()).executes((commandcontext) -> { ++ return a((CommandListenerWrapper) commandcontext.getSource(), Collections.singleton(((CommandListenerWrapper) commandcontext.getSource()).g()), ((CommandListenerWrapper) commandcontext.getSource()).getWorld(), ArgumentVec3.b(commandcontext, "location"), VectorPosition.d(), null); ++ })).then(CommandDispatcher.a("destination", (ArgumentType) ArgumentEntity.a()).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), Collections.singleton(((CommandListenerWrapper) commandcontext.getSource()).g()), ArgumentEntity.a(commandcontext, "destination")); + }))); + +@@ -50,13 +50,13 @@ public class CommandTeleport { + while (iterator.hasNext()) { + Entity entity1 = (Entity) iterator.next(); + +- a(commandlistenerwrapper, entity1, (WorldServer) entity.world, entity.locX(), entity.locY(), entity.locZ(), EnumSet.noneOf(PacketPlayOutPosition.EnumPlayerTeleportFlags.class), entity.yaw, entity.pitch, (CommandTeleport.a) null); ++ a(commandlistenerwrapper, entity1, (WorldServer) entity.world, entity.locX(), entity.locY(), entity.locZ(), EnumSet.noneOf(PacketPlayOutPosition.EnumPlayerTeleportFlags.class), entity.yaw, entity.pitch, null); + } + + if (collection.size() == 1) { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.teleport.success.entity.single", new Object[]{((Entity) collection.iterator().next()).getScoreboardDisplayName(), entity.getScoreboardDisplayName()}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.teleport.success.entity.single", collection.iterator().next().getScoreboardDisplayName(), entity.getScoreboardDisplayName()), true); + } else { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.teleport.success.entity.multiple", new Object[]{collection.size(), entity.getScoreboardDisplayName()}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.teleport.success.entity.multiple", collection.size(), entity.getScoreboardDisplayName()), true); + } + + return collection.size(); +@@ -105,9 +105,9 @@ public class CommandTeleport { + } + + if (collection.size() == 1) { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.teleport.success.location.single", new Object[]{((Entity) collection.iterator().next()).getScoreboardDisplayName(), vec3d.x, vec3d.y, vec3d.z}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.teleport.success.location.single", collection.iterator().next().getScoreboardDisplayName(), vec3d.x, vec3d.y, vec3d.z), true); + } else { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.teleport.success.location.multiple", new Object[]{collection.size(), vec3d.x, vec3d.y, vec3d.z}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.teleport.success.location.multiple", collection.size(), vec3d.x, vec3d.y, vec3d.z), true); + } + + return collection.size(); +@@ -168,7 +168,7 @@ public class CommandTeleport { + entity.decouple(); + Entity entity1 = entity; + +- entity = entity.getEntityType().a((World) worldserver); ++ entity = entity.getEntityType().a(worldserver); + if (entity == null) { + return; + } +diff --git a/src/main/java/net/minecraft/server/CommandTime.java b/src/main/java/net/minecraft/server/CommandTime.java +index 97ea1e66ed7d5d85cf52b8eecc93abfc5c807166..ee8a7f4637b88974958cf9ddd33eb2ac05d656d5 100644 +--- a/src/main/java/net/minecraft/server/CommandTime.java ++++ b/src/main/java/net/minecraft/server/CommandTime.java +@@ -12,26 +12,26 @@ import java.util.Iterator; + public class CommandTime { + + public static void a(com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher) { +- com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("time").requires((commandlistenerwrapper) -> { ++ com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("time").requires((commandlistenerwrapper) -> { + return commandlistenerwrapper.hasPermission(2); +- })).then(((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("set").then(CommandDispatcher.a("day").executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), 1000); ++ })).then(((LiteralArgumentBuilder) CommandDispatcher.a("set").then(CommandDispatcher.a("day").executes((commandcontext) -> { ++ return a(commandcontext.getSource(), 1000); + }))).then(CommandDispatcher.a("noon").executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), 6000); +- }))).then(CommandDispatcher.a("night").executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), 13000); +- }))).then(CommandDispatcher.a("midnight").executes((commandcontext) -> { +- return a((CommandListenerWrapper) commandcontext.getSource(), 18000); +- }))).then(CommandDispatcher.a("time", (ArgumentType) ArgumentTime.a()).executes((commandcontext) -> { ++ return a(commandcontext.getSource(), 6000); ++ })).then(CommandDispatcher.a("night").executes((commandcontext) -> { ++ return a(commandcontext.getSource(), 13000); ++ })).then(CommandDispatcher.a("midnight").executes((commandcontext) -> { ++ return a(commandcontext.getSource(), 18000); ++ })).then(CommandDispatcher.a("time", (ArgumentType) ArgumentTime.a()).executes((commandcontext) -> { + return a((CommandListenerWrapper) commandcontext.getSource(), IntegerArgumentType.getInteger(commandcontext, "time")); +- })))).then(CommandDispatcher.a("add").then(CommandDispatcher.a("time", (ArgumentType) ArgumentTime.a()).executes((commandcontext) -> { ++ }))).then(CommandDispatcher.a("add").then(CommandDispatcher.a("time", (ArgumentType) ArgumentTime.a()).executes((commandcontext) -> { + return b((CommandListenerWrapper) commandcontext.getSource(), IntegerArgumentType.getInteger(commandcontext, "time")); +- })))).then(((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("query").then(CommandDispatcher.a("daytime").executes((commandcontext) -> { +- return c((CommandListenerWrapper) commandcontext.getSource(), a(((CommandListenerWrapper) commandcontext.getSource()).getWorld())); ++ }))).then(((LiteralArgumentBuilder) CommandDispatcher.a("query").then(CommandDispatcher.a("daytime").executes((commandcontext) -> { ++ return c(commandcontext.getSource(), a(commandcontext.getSource().getWorld())); + }))).then(CommandDispatcher.a("gametime").executes((commandcontext) -> { +- return c((CommandListenerWrapper) commandcontext.getSource(), (int) (((CommandListenerWrapper) commandcontext.getSource()).getWorld().getTime() % 2147483647L)); +- }))).then(CommandDispatcher.a("day").executes((commandcontext) -> { +- return c((CommandListenerWrapper) commandcontext.getSource(), (int) (((CommandListenerWrapper) commandcontext.getSource()).getWorld().getDayTime() / 24000L % 2147483647L)); ++ return c(commandcontext.getSource(), (int) (commandcontext.getSource().getWorld().getTime() % 2147483647L)); ++ })).then(CommandDispatcher.a("day").executes((commandcontext) -> { ++ return c(commandcontext.getSource(), (int) (commandcontext.getSource().getWorld().getDayTime() / 24000L % 2147483647L)); + })))); + } + +@@ -40,7 +40,7 @@ public class CommandTime { + } + + private static int c(CommandListenerWrapper commandlistenerwrapper, int i) { +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.query", new Object[]{i}), false); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.query", i), false); + return i; + } + +@@ -54,12 +54,12 @@ public class CommandTime { + TimeSkipEvent event = new TimeSkipEvent(worldserver.getWorld(), TimeSkipEvent.SkipReason.COMMAND, i - worldserver.getDayTime()); + Bukkit.getPluginManager().callEvent(event); + if (!event.isCancelled()) { +- worldserver.setDayTime((long) worldserver.getDayTime() + event.getSkipAmount()); ++ worldserver.setDayTime(worldserver.getDayTime() + event.getSkipAmount()); + } + // CraftBukkit end + } + +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", new Object[]{i}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", i), true); + return a(commandlistenerwrapper.getWorld()); + } + +@@ -80,7 +80,7 @@ public class CommandTime { + + int j = a(commandlistenerwrapper.getWorld()); + +- commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", new Object[]{j}), true); ++ commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", j), true); + return j; + } + } +diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java +index bd6e5f85f7cab597f1e7e076fe4305efbdf598b8..7b11814b9d9b0f70068d006b82429402a17aeb4f 100644 +--- a/src/main/java/net/minecraft/server/Container.java ++++ b/src/main/java/net/minecraft/server/Container.java +@@ -55,7 +55,7 @@ public abstract class Container { + } + + protected static boolean a(ContainerAccess containeraccess, EntityHuman entityhuman, Block block) { +- return (Boolean) containeraccess.a((world, blockposition) -> { ++ return containeraccess.a((world, blockposition) -> { + return !world.getType(blockposition).a(block) ? false : entityhuman.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) <= 64.0D; + }, true); + } +@@ -115,7 +115,7 @@ public abstract class Container { + NonNullList nonnulllist = NonNullList.a(); + + for (int i = 0; i < this.slots.size(); ++i) { +- nonnulllist.add(((Slot) this.slots.get(i)).getItem()); ++ nonnulllist.add(this.slots.get(i).getItem()); + } + + return nonnulllist; +@@ -126,8 +126,8 @@ public abstract class Container { + int i; + + for (i = 0; i < this.slots.size(); ++i) { +- ItemStack itemstack = ((Slot) this.slots.get(i)).getItem(); +- ItemStack itemstack1 = (ItemStack) this.items.get(i); ++ ItemStack itemstack = this.slots.get(i).getItem(); ++ ItemStack itemstack1 = this.items.get(i); + + if (!ItemStack.matches(itemstack1, itemstack)) { + ItemStack itemstack2 = itemstack.cloneItemStack(); +@@ -144,7 +144,7 @@ public abstract class Container { + } + + for (i = 0; i < this.d.size(); ++i) { +- ContainerProperty containerproperty = (ContainerProperty) this.d.get(i); ++ ContainerProperty containerproperty = this.d.get(i); + + if (containerproperty.c()) { + Iterator iterator1 = this.listeners.iterator(); +@@ -164,11 +164,11 @@ public abstract class Container { + } + + public Slot getSlot(int i) { +- return (Slot) this.slots.get(i); ++ return this.slots.get(i); + } + + public ItemStack shiftClick(EntityHuman entityhuman, int i) { +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + return slot != null ? slot.getItem() : ItemStack.b; + } +@@ -186,10 +186,10 @@ public abstract class Container { + crashreportsystemdetails.a("Menu Class", () -> { + return this.getClass().getCanonicalName(); + }); +- crashreportsystemdetails.a("Slot Count", (Object) this.slots.size()); +- crashreportsystemdetails.a("Slot", (Object) i); +- crashreportsystemdetails.a("Button", (Object) j); +- crashreportsystemdetails.a("Type", (Object) inventoryclicktype); ++ crashreportsystemdetails.a("Slot Count", this.slots.size()); ++ crashreportsystemdetails.a("Slot", i); ++ crashreportsystemdetails.a("Button", j); ++ crashreportsystemdetails.a("Type", inventoryclicktype); + throw new ReportedException(crashreport); + } + } +@@ -321,7 +321,7 @@ public abstract class Container { + return ItemStack.b; + } + +- slot2 = (Slot) this.slots.get(i); ++ slot2 = this.slots.get(i); + if (slot2 == null || !slot2.isAllowed(entityhuman)) { + return ItemStack.b; + } +@@ -334,7 +334,7 @@ public abstract class Container { + return ItemStack.b; + } + +- slot2 = (Slot) this.slots.get(i); ++ slot2 = this.slots.get(i); + if (slot2 != null) { + itemstack2 = slot2.getItem(); + itemstack1 = playerinventory.getCarried(); +@@ -409,7 +409,7 @@ public abstract class Container { + } + } + } else if (inventoryclicktype == InventoryClickType.SWAP) { +- slot2 = (Slot) this.slots.get(i); ++ slot2 = this.slots.get(i); + itemstack2 = playerinventory.getItem(j); + itemstack1 = slot2.getItem(); + if (!itemstack2.isEmpty() || !itemstack1.isEmpty()) { +@@ -446,21 +446,21 @@ public abstract class Container { + } + } + } else if (inventoryclicktype == InventoryClickType.CLONE && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried().isEmpty() && i >= 0) { +- slot2 = (Slot) this.slots.get(i); ++ slot2 = this.slots.get(i); + if (slot2 != null && slot2.hasItem()) { + itemstack2 = slot2.getItem().cloneItemStack(); + itemstack2.setCount(itemstack2.getMaxStackSize()); + playerinventory.setCarried(itemstack2); + } + } else if (inventoryclicktype == InventoryClickType.THROW && playerinventory.getCarried().isEmpty() && i >= 0) { +- slot2 = (Slot) this.slots.get(i); ++ slot2 = this.slots.get(i); + if (slot2 != null && slot2.hasItem() && slot2.isAllowed(entityhuman)) { + itemstack2 = slot2.a(j == 0 ? 1 : slot2.getItem().getCount()); + slot2.a(entityhuman, itemstack2); + entityhuman.drop(itemstack2, true); + } + } else if (inventoryclicktype == InventoryClickType.PICKUP_ALL && i >= 0) { +- slot2 = (Slot) this.slots.get(i); ++ slot2 = this.slots.get(i); + itemstack2 = playerinventory.getCarried(); + if (!itemstack2.isEmpty() && (slot2 == null || !slot2.hasItem() || !slot2.isAllowed(entityhuman))) { + k = j == 0 ? 0 : this.slots.size() - 1; +@@ -468,7 +468,7 @@ public abstract class Container { + + for (int l1 = 0; l1 < 2; ++l1) { + for (int i2 = k; i2 >= 0 && i2 < this.slots.size() && itemstack2.getCount() < itemstack2.getMaxStackSize(); i2 += k1) { +- Slot slot3 = (Slot) this.slots.get(i2); ++ Slot slot3 = this.slots.get(i2); + + if (slot3.hasItem() && a(slot3, itemstack2, true) && slot3.isAllowed(entityhuman) && this.a(itemstack2, slot3)) { + ItemStack itemstack5 = slot3.getItem(); +@@ -542,7 +542,7 @@ public abstract class Container { + } + + public void a(int i, int j) { +- ((ContainerProperty) this.d.get(i)).set(j); ++ this.d.get(i).set(j); + } + + public boolean c(EntityHuman entityhuman) { +@@ -581,7 +581,7 @@ public abstract class Container { + break; + } + +- slot = (Slot) this.slots.get(k); ++ slot = this.slots.get(k); + itemstack1 = slot.getItem(); + if (!itemstack1.isEmpty() && a(itemstack, itemstack1)) { + int l = itemstack1.getCount() + itemstack.getCount(); +@@ -623,7 +623,7 @@ public abstract class Container { + break; + } + +- slot = (Slot) this.slots.get(k); ++ slot = this.slots.get(k); + itemstack1 = slot.getItem(); + if (itemstack1.isEmpty() && slot.isAllowed(itemstack)) { + if (itemstack.getCount() > slot.getMaxStackSize()) { +diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java +index 2b55aa0f3444c3c5c3233083cb3693e4ccac3b6d..ec1860323425109ecbfd5274562ec1fcc565908d 100644 +--- a/src/main/java/net/minecraft/server/ContainerAnvil.java ++++ b/src/main/java/net/minecraft/server/ContainerAnvil.java +@@ -32,7 +32,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract { + + @Override + protected boolean a(IBlockData iblockdata) { +- return iblockdata.a((Tag) TagsBlock.ANVIL); ++ return iblockdata.a(TagsBlock.ANVIL); + } + + @Override +@@ -64,7 +64,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract { + this.containerAccess.a((world, blockposition) -> { + IBlockData iblockdata = world.getType(blockposition); + +- if (!entityhuman.abilities.canInstantlyBuild && iblockdata.a((Tag) TagsBlock.ANVIL) && entityhuman.getRandom().nextFloat() < 0.12F) { ++ if (!entityhuman.abilities.canInstantlyBuild && iblockdata.a(TagsBlock.ANVIL) && entityhuman.getRandom().nextFloat() < 0.12F) { + IBlockData iblockdata1 = BlockAnvil.c(iblockdata); + // Paper start + com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), iblockdata1 != null ? org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1) : null); +@@ -165,8 +165,8 @@ public class ContainerAnvil extends ContainerAnvilAbstract { + Enchantment enchantment = (Enchantment) iterator.next(); + + if (enchantment != null) { +- int l1 = (Integer) map.getOrDefault(enchantment, 0); +- int i2 = (Integer) map1.get(enchantment); ++ int l1 = map.getOrDefault(enchantment, 0); ++ int i2 = map1.get(enchantment); + + i2 = l1 == i2 ? i2 + 1 : Math.max(i2, l1); + boolean flag3 = enchantment.canEnchant(itemstack); +@@ -240,7 +240,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract { + } else if (!this.renameText.equals(itemstack.getName().getString())) { + b1 = 1; + i += b1; +- itemstack1.a((IChatBaseComponent) (new ChatComponentText(this.renameText))); ++ itemstack1.a(new ChatComponentText(this.renameText)); + } + + this.levelCost.set(j + i); +@@ -288,7 +288,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract { + if (StringUtils.isBlank(s)) { + itemstack.s(); + } else { +- itemstack.a((IChatBaseComponent) (new ChatComponentText(this.renameText))); ++ itemstack.a(new ChatComponentText(this.renameText)); + } + } + +diff --git a/src/main/java/net/minecraft/server/ContainerAnvilAbstract.java b/src/main/java/net/minecraft/server/ContainerAnvilAbstract.java +index ad9f234c4862d78b5a8e547aa8bb6528497de236..3610e99fccc382f6f8b9a1162327fefc755bca34 100644 +--- a/src/main/java/net/minecraft/server/ContainerAnvilAbstract.java ++++ b/src/main/java/net/minecraft/server/ContainerAnvilAbstract.java +@@ -9,7 +9,7 @@ public abstract class ContainerAnvilAbstract extends Container { + @Override + public void update() { + super.update(); +- ContainerAnvilAbstract.this.a((IInventory) this); ++ ContainerAnvilAbstract.this.a(this); + } + }; + protected final ContainerAccess containerAccess; +@@ -81,7 +81,7 @@ public abstract class ContainerAnvilAbstract extends Container { + @Override + public boolean canUse(EntityHuman entityhuman) { + if (!this.checkReachable) return true; // CraftBukkit +- return (Boolean) this.containerAccess.a((world, blockposition) -> { ++ return this.containerAccess.a((world, blockposition) -> { + return !this.a(world.getType(blockposition)) ? false : entityhuman.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) <= 64.0D; + }, true); + } +@@ -93,7 +93,7 @@ public abstract class ContainerAnvilAbstract extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/ContainerBeacon.java b/src/main/java/net/minecraft/server/ContainerBeacon.java +index 15e2f03d11ec35477401daa5e104ea76fd5de82b..0deee47f86086103d3337b8fcb3ac09669002a0f 100644 +--- a/src/main/java/net/minecraft/server/ContainerBeacon.java ++++ b/src/main/java/net/minecraft/server/ContainerBeacon.java +@@ -23,7 +23,7 @@ public class ContainerBeacon extends Container { + this.beacon = new InventorySubcontainer(1) { + @Override + public boolean b(int j, ItemStack itemstack) { +- return itemstack.getItem().a((Tag) TagsItem.BEACON_PAYMENT_ITEMS); ++ return itemstack.getItem().a(TagsItem.BEACON_PAYMENT_ITEMS); + } + + @Override +@@ -35,7 +35,7 @@ public class ContainerBeacon extends Container { + this.containerProperties = icontainerproperties; + this.containerAccess = containeraccess; + this.d = new ContainerBeacon.SlotBeacon(this.beacon, 0, 136, 110); +- this.a((Slot) this.d); ++ this.a(this.d); + this.a(icontainerproperties); + boolean flag = true; + boolean flag1 = true; +@@ -82,7 +82,7 @@ public class ContainerBeacon extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +@@ -143,7 +143,7 @@ public class ContainerBeacon extends Container { + + @Override + public boolean isAllowed(ItemStack itemstack) { +- return itemstack.getItem().a((Tag) TagsItem.BEACON_PAYMENT_ITEMS); ++ return itemstack.getItem().a(TagsItem.BEACON_PAYMENT_ITEMS); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/ContainerBrewingStand.java b/src/main/java/net/minecraft/server/ContainerBrewingStand.java +index f1bad658540b619ac6c77f5a08812e2bce5791e1..29e234f5e7b704dffb43ff05f3826cd1d588db19 100644 +--- a/src/main/java/net/minecraft/server/ContainerBrewingStand.java ++++ b/src/main/java/net/minecraft/server/ContainerBrewingStand.java +@@ -27,11 +27,11 @@ public class ContainerBrewingStand extends Container { + a(icontainerproperties, 2); + this.brewingStand = iinventory; + this.d = icontainerproperties; +- this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(iinventory, 0, 56, 51))); +- this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(iinventory, 1, 79, 58))); +- this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(iinventory, 2, 102, 51))); +- this.e = this.a((Slot) (new ContainerBrewingStand.SlotBrewing(iinventory, 3, 79, 17))); +- this.a((Slot) (new ContainerBrewingStand.a(iinventory, 4, 17, 17))); ++ this.a(new SlotPotionBottle(iinventory, 0, 56, 51)); ++ this.a(new SlotPotionBottle(iinventory, 1, 79, 58)); ++ this.a(new SlotPotionBottle(iinventory, 2, 102, 51)); ++ this.e = this.a(new SlotBrewing(iinventory, 3, 79, 17)); ++ this.a(new a(iinventory, 4, 17, 17)); + this.a(icontainerproperties); + + int j; +@@ -57,7 +57,7 @@ public class ContainerBrewingStand extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/ContainerCartography.java b/src/main/java/net/minecraft/server/ContainerCartography.java +index 79d328786f2e9ba386cb297bb8e7ec0ec3228a65..d1d1214a57dd4e230382641f39b805639c025131 100644 +--- a/src/main/java/net/minecraft/server/ContainerCartography.java ++++ b/src/main/java/net/minecraft/server/ContainerCartography.java +@@ -39,14 +39,14 @@ public class ContainerCartography extends Container { + this.inventory = new InventorySubcontainer(2) { + @Override + public void update() { +- ContainerCartography.this.a((IInventory) this); ++ ContainerCartography.this.a(this); + super.update(); + } + }; + this.resultInventory = new InventoryCraftResult() { + @Override + public void update() { +- ContainerCartography.this.a((IInventory) this); ++ ContainerCartography.this.a(this); + super.update(); + } + +@@ -81,7 +81,7 @@ public class ContainerCartography extends Container { + @Override + public ItemStack a(int j) { + ItemStack itemstack = super.a(j); +- ItemStack itemstack1 = (ItemStack) containeraccess.a((world, blockposition) -> { ++ ItemStack itemstack1 = containeraccess.a((world, blockposition) -> { + if (!ContainerCartography.this.e && ContainerCartography.this.inventory.getItem(1).getItem() == Items.dP) { + ItemStack itemstack2 = ItemWorldMap.a(world, ContainerCartography.this.inventory.getItem(0)); + +@@ -112,7 +112,7 @@ public class ContainerCartography extends Container { + long j = world.getTime(); + + if (ContainerCartography.this.f != j) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.UI_CARTOGRAPHY_TABLE_TAKE_RESULT, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, blockposition, SoundEffects.UI_CARTOGRAPHY_TABLE_TAKE_RESULT, SoundCategory.BLOCKS, 1.0F, 1.0F); + ContainerCartography.this.f = j; + } + +@@ -203,7 +203,7 @@ public class ContainerCartography extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +@@ -213,7 +213,7 @@ public class ContainerCartography extends Container { + itemstack = itemstack1.cloneItemStack(); + if (i == 2) { + if (this.inventory.getItem(1).getItem() == Items.dP) { +- itemstack2 = (ItemStack) this.containerAccess.a((world, blockposition) -> { ++ itemstack2 = this.containerAccess.a((world, blockposition) -> { + ItemStack itemstack3 = ItemWorldMap.a(world, this.inventory.getItem(0)); + + if (itemstack3 != null) { +diff --git a/src/main/java/net/minecraft/server/ContainerChest.java b/src/main/java/net/minecraft/server/ContainerChest.java +index 772b3b703fd1daf95b5d359d5f86b44fe6909ef5..3e9532ba04b122b0ccff25715bf3490a7231abe1 100644 +--- a/src/main/java/net/minecraft/server/ContainerChest.java ++++ b/src/main/java/net/minecraft/server/ContainerChest.java +@@ -111,7 +111,7 @@ public class ContainerChest extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/ContainerDispenser.java b/src/main/java/net/minecraft/server/ContainerDispenser.java +index f1cdcfffab0498ecb46eb2ca4d3a15ad42541911..70e6fa08e71b66f6b6dab40efa7e48e76ee0f6ef 100644 +--- a/src/main/java/net/minecraft/server/ContainerDispenser.java ++++ b/src/main/java/net/minecraft/server/ContainerDispenser.java +@@ -57,7 +57,7 @@ public class ContainerDispenser extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTable.java b/src/main/java/net/minecraft/server/ContainerEnchantTable.java +index 3722c14e2491cd929cad00f9bd971a1fc2f56694..3c264fc394dc2ee5ad2f9fa5c1df345622f807f4 100644 +--- a/src/main/java/net/minecraft/server/ContainerEnchantTable.java ++++ b/src/main/java/net/minecraft/server/ContainerEnchantTable.java +@@ -40,7 +40,7 @@ public class ContainerEnchantTable extends Container { + @Override + public void update() { + super.update(); +- ContainerEnchantTable.this.a((IInventory) this); ++ ContainerEnchantTable.this.a(this); + } + + // CraftBukkit start +@@ -144,7 +144,7 @@ public class ContainerEnchantTable extends Container { + } + } + +- this.h.setSeed((long) this.i.get()); ++ this.h.setSeed(this.i.get()); + + for (j = 0; j < 3; ++j) { + this.costs[j] = EnchantmentManager.a(this.h, j, i, itemstack); +@@ -160,7 +160,7 @@ public class ContainerEnchantTable extends Container { + List list = this.a(itemstack, j, this.costs[j]); + + if (list != null && !list.isEmpty()) { +- WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) list.get(this.h.nextInt(list.size())); ++ WeightedRandomEnchant weightedrandomenchant = list.get(this.h.nextInt(list.size())); + + this.enchantments[j] = IRegistry.ENCHANTMENT.a(weightedrandomenchant.enchantment); // CraftBukkit - decompile error + this.levels[j] = weightedrandomenchant.level; +@@ -297,7 +297,7 @@ public class ContainerEnchantTable extends Container { + this.enchantSlots.update(); + this.i.set(entityhuman.eF()); + this.a(this.enchantSlots); +- world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_ENCHANTMENT_TABLE_USE, SoundCategory.BLOCKS, 1.0F, world.random.nextFloat() * 0.1F + 0.9F); ++ world.playSound(null, blockposition, SoundEffects.BLOCK_ENCHANTMENT_TABLE_USE, SoundCategory.BLOCKS, 1.0F, world.random.nextFloat() * 0.1F + 0.9F); + } + + }); +@@ -308,7 +308,7 @@ public class ContainerEnchantTable extends Container { + } + + private List a(ItemStack itemstack, int i, int j) { +- this.h.setSeed((long) (this.i.get() + i)); ++ this.h.setSeed(this.i.get() + i); + List list = EnchantmentManager.b(this.h, itemstack, j, false); + + if (itemstack.getItem() == Items.BOOK && list.size() > 1) { +@@ -335,7 +335,7 @@ public class ContainerEnchantTable extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +@@ -354,7 +354,7 @@ public class ContainerEnchantTable extends Container { + return ItemStack.b; + } + } else { +- if (((Slot) this.slots.get(0)).hasItem() || !((Slot) this.slots.get(0)).isAllowed(itemstack1)) { ++ if (this.slots.get(0).hasItem() || !this.slots.get(0).isAllowed(itemstack1)) { + return ItemStack.b; + } + +@@ -362,7 +362,7 @@ public class ContainerEnchantTable extends Container { + + itemstack2.setCount(1); + itemstack1.subtract(1); +- ((Slot) this.slots.get(0)).set(itemstack2); ++ this.slots.get(0).set(itemstack2); + } + + if (itemstack1.isEmpty()) { +diff --git a/src/main/java/net/minecraft/server/ContainerFurnace.java b/src/main/java/net/minecraft/server/ContainerFurnace.java +index 7b4c85c4ace44268901849df2f89f0378f42205c..436a44c82762cc10708097aa2bc50b824d09d54b 100644 +--- a/src/main/java/net/minecraft/server/ContainerFurnace.java ++++ b/src/main/java/net/minecraft/server/ContainerFurnace.java +@@ -41,8 +41,8 @@ public abstract class ContainerFurnace extends ContainerRecipeBook { + this.e = icontainerproperties; + this.c = playerinventory.player.world; + this.a(new Slot(iinventory, 0, 56, 17)); +- this.a((Slot) (new SlotFurnaceFuel(this, iinventory, 1, 56, 53))); +- this.a((Slot) (new SlotFurnaceResult(playerinventory.player, iinventory, 2, 116, 35))); ++ this.a(new SlotFurnaceFuel(this, iinventory, 1, 56, 53)); ++ this.a(new SlotFurnaceResult(playerinventory.player, iinventory, 2, 116, 35)); + this.player = playerinventory; // CraftBukkit - save player + + int j; +@@ -107,7 +107,7 @@ public abstract class ContainerFurnace extends ContainerRecipeBook { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +@@ -156,7 +156,7 @@ public abstract class ContainerFurnace extends ContainerRecipeBook { + } + + protected boolean a(ItemStack itemstack) { +- return this.c.getCraftingManager().craft((Recipes) this.f, new InventorySubcontainer(new ItemStack[]{itemstack}), this.c).isPresent(); // Eclipse fail ++ return this.c.getCraftingManager().craft((Recipes) this.f, new InventorySubcontainer(itemstack), this.c).isPresent(); // Eclipse fail + } + + protected boolean b(ItemStack itemstack) { +diff --git a/src/main/java/net/minecraft/server/ContainerGrindstone.java b/src/main/java/net/minecraft/server/ContainerGrindstone.java +index 667099bb130038b88bc2e1c4be076e8d725a5601..ee5b3498df3d30ac576e98a94f3f0579fc99f1b4 100644 +--- a/src/main/java/net/minecraft/server/ContainerGrindstone.java ++++ b/src/main/java/net/minecraft/server/ContainerGrindstone.java +@@ -43,7 +43,7 @@ public class ContainerGrindstone extends Container { + @Override + public void update() { + super.update(); +- ContainerGrindstone.this.a((IInventory) this); ++ ContainerGrindstone.this.a(this); + } + + // CraftBukkit start +@@ -81,7 +81,7 @@ public class ContainerGrindstone extends Container { + int k = EntityExperienceOrb.getOrbValue(j); + + j -= k; +- world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX(), (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, k, org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, entityhuman)); // Paper ++ world.addEntity(new EntityExperienceOrb(world, blockposition.getX(), (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, k, org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, entityhuman)); // Paper + } + + world.triggerEffect(1042, blockposition, 0); +@@ -112,8 +112,8 @@ public class ContainerGrindstone extends Container { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- Enchantment enchantment = (Enchantment) entry.getKey(); +- Integer integer = (Integer) entry.getValue(); ++ Enchantment enchantment = entry.getKey(); ++ Integer integer = entry.getValue(); + + if (!enchantment.c()) { + j += enchantment.a(integer); +@@ -213,10 +213,10 @@ public class ContainerGrindstone extends Container { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- Enchantment enchantment = (Enchantment) entry.getKey(); ++ Enchantment enchantment = entry.getKey(); + + if (!enchantment.c() || EnchantmentManager.getEnchantmentLevel(enchantment, itemstack2) == 0) { +- itemstack2.addEnchantment(enchantment, (Integer) entry.getValue()); ++ itemstack2.addEnchantment(enchantment, entry.getValue()); + } + } + +@@ -243,7 +243,7 @@ public class ContainerGrindstone extends Container { + } + } + } +- Map map = (Map) result; ++ Map map = result; + + EnchantmentManager.a(map, itemstack1); + itemstack1.setRepairCost(0); +@@ -278,7 +278,7 @@ public class ContainerGrindstone extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/ContainerHopper.java b/src/main/java/net/minecraft/server/ContainerHopper.java +index f450f6fb6d87166feb20c09afabf3850a655cb7a..7a12473bbf58a31439692af06afdc3e25132fecb 100644 +--- a/src/main/java/net/minecraft/server/ContainerHopper.java ++++ b/src/main/java/net/minecraft/server/ContainerHopper.java +@@ -64,7 +64,7 @@ public class ContainerHopper extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/ContainerHorse.java b/src/main/java/net/minecraft/server/ContainerHorse.java +index ebaf45be997d121e1974dc1f920dccbf11744cb3..1a39f7d3b857557b4daffe48bcf0a7e583416e59 100644 +--- a/src/main/java/net/minecraft/server/ContainerHorse.java ++++ b/src/main/java/net/minecraft/server/ContainerHorse.java +@@ -24,7 +24,7 @@ public class ContainerHorse extends Container { + } + + public ContainerHorse(int i, PlayerInventory playerinventory, IInventory iinventory, final EntityHorseAbstract entityhorseabstract) { +- super((Containers) null, i); ++ super(null, i); + player = playerinventory; + // CraftBukkit end + this.c = iinventory; +@@ -82,7 +82,7 @@ public class ContainerHorse extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/ContainerLoom.java b/src/main/java/net/minecraft/server/ContainerLoom.java +index 1fe21ca13a1eecb64cb2d3f4f18993e181d26ae2..6f6ff5898b9e433128ea91502eea4e07e17216e8 100644 +--- a/src/main/java/net/minecraft/server/ContainerLoom.java ++++ b/src/main/java/net/minecraft/server/ContainerLoom.java +@@ -48,7 +48,7 @@ public class ContainerLoom extends Container { + @Override + public void update() { + super.update(); +- ContainerLoom.this.a((IInventory) this); ++ ContainerLoom.this.a(this); + ContainerLoom.this.e.run(); + } + +@@ -110,7 +110,7 @@ public class ContainerLoom extends Container { + long j = world.getTime(); + + if (ContainerLoom.this.j != j) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.UI_LOOM_TAKE_RESULT, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, blockposition, SoundEffects.UI_LOOM_TAKE_RESULT, SoundCategory.BLOCKS, 1.0F, 1.0F); + ContainerLoom.this.j = j; + } + +@@ -181,7 +181,7 @@ public class ContainerLoom extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/ContainerMerchant.java b/src/main/java/net/minecraft/server/ContainerMerchant.java +index d7f3f1dabf5cef892ff51566bbacd286bc18fd1e..d88d7362384d9eb0f44fe8c0029462679b168650 100644 +--- a/src/main/java/net/minecraft/server/ContainerMerchant.java ++++ b/src/main/java/net/minecraft/server/ContainerMerchant.java +@@ -30,7 +30,7 @@ public class ContainerMerchant extends Container { + this.inventoryMerchant = new InventoryMerchant(imerchant); + this.a(new Slot(this.inventoryMerchant, 0, 136, 37)); + this.a(new Slot(this.inventoryMerchant, 1, 162, 37)); +- this.a((Slot) (new SlotMerchantResult(playerinventory.player, imerchant, this.inventoryMerchant, 2, 220, 37))); ++ this.a(new SlotMerchantResult(playerinventory.player, imerchant, this.inventoryMerchant, 2, 220, 37)); + this.player = playerinventory; // CraftBukkit - save player + + int j; +@@ -70,7 +70,7 @@ public class ContainerMerchant extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +@@ -123,7 +123,7 @@ public class ContainerMerchant extends Container { + @Override + public void b(EntityHuman entityhuman) { + super.b(entityhuman); +- this.merchant.setTradingPlayer((EntityHuman) null); ++ this.merchant.setTradingPlayer(null); + if (!this.merchant.getWorld().isClientSide) { + if (entityhuman.isAlive() && (!(entityhuman instanceof EntityPlayer) || !((EntityPlayer) entityhuman).q())) { + entityhuman.inventory.a(entityhuman.world, this.inventoryMerchant.splitWithoutUpdate(0)); +@@ -167,10 +167,10 @@ public class ContainerMerchant extends Container { + } + + if (this.inventoryMerchant.getItem(0).isEmpty() && this.inventoryMerchant.getItem(1).isEmpty()) { +- ItemStack itemstack2 = ((MerchantRecipe) this.i().get(i)).getBuyItem1(); ++ ItemStack itemstack2 = this.i().get(i).getBuyItem1(); + + this.c(0, itemstack2); +- ItemStack itemstack3 = ((MerchantRecipe) this.i().get(i)).getBuyItem2(); ++ ItemStack itemstack3 = this.i().get(i).getBuyItem2(); + + this.c(1, itemstack3); + } +@@ -181,7 +181,7 @@ public class ContainerMerchant extends Container { + private void c(int i, ItemStack itemstack) { + if (!itemstack.isEmpty()) { + for (int j = 3; j < 39; ++j) { +- ItemStack itemstack1 = ((Slot) this.slots.get(j)).getItem(); ++ ItemStack itemstack1 = this.slots.get(j).getItem(); + + if (!itemstack1.isEmpty() && this.b(itemstack, itemstack1)) { + ItemStack itemstack2 = this.inventoryMerchant.getItem(i); +diff --git a/src/main/java/net/minecraft/server/ContainerPlayer.java b/src/main/java/net/minecraft/server/ContainerPlayer.java +index d957d2d2e40b803a49f0b32a7be44097fe74cba2..4a7e85114634ba29e9fed4be6e2fa5a8cf0adb1a 100644 +--- a/src/main/java/net/minecraft/server/ContainerPlayer.java ++++ b/src/main/java/net/minecraft/server/ContainerPlayer.java +@@ -27,7 +27,7 @@ public class ContainerPlayer extends ContainerRecipeBook { + // CraftBukkit end + + public ContainerPlayer(PlayerInventory playerinventory, boolean flag, EntityHuman entityhuman) { +- super((Containers) null, 0); ++ super(null, 0); + this.i = flag; + this.owner = entityhuman; + // CraftBukkit start +@@ -37,7 +37,7 @@ public class ContainerPlayer extends ContainerRecipeBook { + this.player = playerinventory; // CraftBukkit - save player + setTitle(new ChatMessage("container.crafting")); // SPIGOT-4722: Allocate title for player inventory + // CraftBukkit end +- this.a((Slot) (new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 154, 28))); ++ this.a(new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 154, 28)); + + int i; + int j; +@@ -111,7 +111,7 @@ public class ContainerPlayer extends ContainerRecipeBook { + super.b(entityhuman); + this.resultInventory.clear(); + if (!entityhuman.world.isClientSide) { +- this.a(entityhuman, entityhuman.world, (IInventory) this.craftInventory); ++ this.a(entityhuman, entityhuman.world, this.craftInventory); + } + } + +@@ -123,7 +123,7 @@ public class ContainerPlayer extends ContainerRecipeBook { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +@@ -145,13 +145,13 @@ public class ContainerPlayer extends ContainerRecipeBook { + if (!this.a(itemstack1, 9, 45, false)) { + return ItemStack.b; + } +- } else if (enumitemslot.a() == EnumItemSlot.Function.ARMOR && !((Slot) this.slots.get(8 - enumitemslot.b())).hasItem()) { ++ } else if (enumitemslot.a() == EnumItemSlot.Function.ARMOR && !this.slots.get(8 - enumitemslot.b()).hasItem()) { + int j = 8 - enumitemslot.b(); + + if (!this.a(itemstack1, j, j + 1, false)) { + return ItemStack.b; + } +- } else if (enumitemslot == EnumItemSlot.OFFHAND && !((Slot) this.slots.get(45)).hasItem()) { ++ } else if (enumitemslot == EnumItemSlot.OFFHAND && !this.slots.get(45).hasItem()) { + if (!this.a(itemstack1, 45, 46, false)) { + return ItemStack.b; + } +diff --git a/src/main/java/net/minecraft/server/ContainerShulkerBox.java b/src/main/java/net/minecraft/server/ContainerShulkerBox.java +index 4158d140c1e6092fcefbff51d739057e0a83c52b..ed37843aecc92fe9da2bd7cfa1dde69648971e99 100644 +--- a/src/main/java/net/minecraft/server/ContainerShulkerBox.java ++++ b/src/main/java/net/minecraft/server/ContainerShulkerBox.java +@@ -41,7 +41,7 @@ public class ContainerShulkerBox extends Container { + + for (j = 0; j < 3; ++j) { + for (k = 0; k < 9; ++k) { +- this.a((Slot) (new SlotShulkerBox(iinventory, k + j * 9, 8 + k * 18, 18 + j * 18))); ++ this.a(new SlotShulkerBox(iinventory, k + j * 9, 8 + k * 18, 18 + j * 18)); + } + } + +@@ -65,7 +65,7 @@ public class ContainerShulkerBox extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/ContainerSmithing.java b/src/main/java/net/minecraft/server/ContainerSmithing.java +index b541ee24b5bf4b5fb5cd1a6e197fa76b3e3596c3..c4da4ed2a899dcb10a2ac847c7a180e9c40a336a 100644 +--- a/src/main/java/net/minecraft/server/ContainerSmithing.java ++++ b/src/main/java/net/minecraft/server/ContainerSmithing.java +@@ -59,7 +59,7 @@ public class ContainerSmithing extends ContainerAnvilAbstract { + if (list.isEmpty()) { + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareSmithingEvent(getBukkitView(), ItemStack.b); // CraftBukkit + } else { +- this.h = (RecipeSmithing) list.get(0); ++ this.h = list.get(0); + ItemStack itemstack = this.h.a(this.repairInventory); + + org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareSmithingEvent(getBukkitView(), itemstack); // CraftBukkit +diff --git a/src/main/java/net/minecraft/server/ContainerStonecutter.java b/src/main/java/net/minecraft/server/ContainerStonecutter.java +index 0e1630424aa112df9e602f782cc430c8ffb95d4a..2498c75f9d5b17154dd7cca73101f5bf3be0ee26 100644 +--- a/src/main/java/net/minecraft/server/ContainerStonecutter.java ++++ b/src/main/java/net/minecraft/server/ContainerStonecutter.java +@@ -52,7 +52,7 @@ public class ContainerStonecutter extends Container { + @Override + public void update() { + super.update(); +- ContainerStonecutter.this.a((IInventory) this); ++ ContainerStonecutter.this.a(this); + ContainerStonecutter.this.l.run(); + } + }; +@@ -79,7 +79,7 @@ public class ContainerStonecutter extends Container { + long j = world.getTime(); + + if (ContainerStonecutter.this.k != j) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.UI_STONECUTTER_TAKE_RESULT, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, blockposition, SoundEffects.UI_STONECUTTER_TAKE_RESULT, SoundCategory.BLOCKS, 1.0F, 1.0F); + ContainerStonecutter.this.k = j; + } + +@@ -148,7 +148,7 @@ public class ContainerStonecutter extends Container { + + private void i() { + if (!this.i.isEmpty() && this.d(this.containerProperty.get())) { +- RecipeStonecutting recipestonecutting = (RecipeStonecutting) this.i.get(this.containerProperty.get()); ++ RecipeStonecutting recipestonecutting = this.i.get(this.containerProperty.get()); + + this.d.set(recipestonecutting.a(this.inventory)); + } else { +@@ -171,7 +171,7 @@ public class ContainerStonecutter extends Container { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +@@ -189,7 +189,7 @@ public class ContainerStonecutter extends Container { + if (!this.a(itemstack1, 2, 38, false)) { + return ItemStack.b; + } +- } else if (this.world.getCraftingManager().craft(Recipes.STONECUTTING, new InventorySubcontainer(new ItemStack[]{itemstack1}), this.world).isPresent()) { ++ } else if (this.world.getCraftingManager().craft(Recipes.STONECUTTING, new InventorySubcontainer(itemstack1), this.world).isPresent()) { + if (!this.a(itemstack1, 0, 1, false)) { + return ItemStack.b; + } +diff --git a/src/main/java/net/minecraft/server/ContainerWorkbench.java b/src/main/java/net/minecraft/server/ContainerWorkbench.java +index 7d6a2cc31e9082c33ac8fab99721639c280c54be..9e5ace6cc3aacbf73cdf19fcec913929128782fe 100644 +--- a/src/main/java/net/minecraft/server/ContainerWorkbench.java ++++ b/src/main/java/net/minecraft/server/ContainerWorkbench.java +@@ -31,7 +31,7 @@ public class ContainerWorkbench extends ContainerRecipeBook { + // CraftBukkit end + this.containerAccess = containeraccess; + this.f = playerinventory.player; +- this.a((Slot) (new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 124, 35))); ++ this.a(new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 124, 35)); + + int j; + int k; +@@ -61,7 +61,7 @@ public class ContainerWorkbench extends ContainerRecipeBook { + Optional optional = world.getMinecraftServer().getCraftingManager().craft(Recipes.CRAFTING, inventorycrafting, world); + + if (optional.isPresent()) { +- RecipeCrafting recipecrafting = (RecipeCrafting) optional.get(); ++ RecipeCrafting recipecrafting = optional.get(); + + if (inventorycraftresult.a(world, entityplayer, recipecrafting)) { + itemstack = recipecrafting.a(inventorycrafting); +@@ -101,7 +101,7 @@ public class ContainerWorkbench extends ContainerRecipeBook { + public void b(EntityHuman entityhuman) { + super.b(entityhuman); + this.containerAccess.a((world, blockposition) -> { +- this.a(entityhuman, world, (IInventory) this.craftInventory); ++ this.a(entityhuman, world, this.craftInventory); + }); + } + +@@ -114,7 +114,7 @@ public class ContainerWorkbench extends ContainerRecipeBook { + @Override + public ItemStack shiftClick(EntityHuman entityhuman, int i) { + ItemStack itemstack = ItemStack.b; +- Slot slot = (Slot) this.slots.get(i); ++ Slot slot = this.slots.get(i); + + if (slot != null && slot.hasItem()) { + ItemStack itemstack1 = slot.getItem(); +diff --git a/src/main/java/net/minecraft/server/Containers.java b/src/main/java/net/minecraft/server/Containers.java +index 754e583514b40b45a7b98dc3a7a752480c0384af..d491cd112c04eaa73aac98a0509746ad9cf138e1 100644 +--- a/src/main/java/net/minecraft/server/Containers.java ++++ b/src/main/java/net/minecraft/server/Containers.java +@@ -31,7 +31,7 @@ public class Containers { + private final Containers.Supplier y; + + private static Containers a(String s, Containers.Supplier containers_supplier) { +- return (Containers) IRegistry.a(IRegistry.MENU, s, (new Containers<>(containers_supplier))); // CraftBukkit - decompile error ++ return IRegistry.a(IRegistry.MENU, s, (new Containers<>(containers_supplier))); // CraftBukkit - decompile error + } + + private Containers(Containers.Supplier containers_supplier) { +diff --git a/src/main/java/net/minecraft/server/ControllerMove.java b/src/main/java/net/minecraft/server/ControllerMove.java +index 6393ff765f12db2911e2eaba800104b7539c290a..83be1306d094afa155ba32b79a54ca15c4391ab1 100644 +--- a/src/main/java/net/minecraft/server/ControllerMove.java ++++ b/src/main/java/net/minecraft/server/ControllerMove.java +@@ -93,7 +93,7 @@ public class ControllerMove { + Block block = iblockdata.getBlock(); + VoxelShape voxelshape = iblockdata.getCollisionShape(this.a.world, blockposition); + +- if (d2 > (double) this.a.G && d0 * d0 + d1 * d1 < (double) Math.max(1.0F, this.a.getWidth()) || !voxelshape.isEmpty() && this.a.locY() < voxelshape.c(EnumDirection.EnumAxis.Y) + (double) blockposition.getY() && !block.a((Tag) TagsBlock.DOORS) && !block.a((Tag) TagsBlock.FENCES)) { ++ if (d2 > (double) this.a.G && d0 * d0 + d1 * d1 < (double) Math.max(1.0F, this.a.getWidth()) || !voxelshape.isEmpty() && this.a.locY() < voxelshape.c(EnumDirection.EnumAxis.Y) + (double) blockposition.getY() && !block.a(TagsBlock.DOORS) && !block.a(TagsBlock.FENCES)) { + this.a.getControllerJump().jump(); + this.h = ControllerMove.Operation.JUMPING; + } +diff --git a/src/main/java/net/minecraft/server/ControllerMoveFlying.java b/src/main/java/net/minecraft/server/ControllerMoveFlying.java +index bafcb780f520db562e4a834400b789f60b563597..d427d6e2592bf7af9b3906f340d2c8744f179174 100644 +--- a/src/main/java/net/minecraft/server/ControllerMoveFlying.java ++++ b/src/main/java/net/minecraft/server/ControllerMoveFlying.java +@@ -39,7 +39,7 @@ public class ControllerMoveFlying extends ControllerMove { + } + + this.a.n(f1); +- double d4 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); ++ double d4 = MathHelper.sqrt(d0 * d0 + d2 * d2); + float f2 = (float) (-(MathHelper.d(d1, d4) * 57.2957763671875D)); + + this.a.pitch = this.a(this.a.pitch, f2, (float) this.i); +diff --git a/src/main/java/net/minecraft/server/Convertable.java b/src/main/java/net/minecraft/server/Convertable.java +index c0f2e44c6c54e22f32d5df6cbc9e926387749383..b502049713ba9c6b854a1f8a3dcd76154eb28da2 100644 +--- a/src/main/java/net/minecraft/server/Convertable.java ++++ b/src/main/java/net/minecraft/server/Convertable.java +@@ -37,7 +37,7 @@ public class Convertable { + this.f = datafixer; + + try { +- Files.createDirectories(Files.exists(java_nio_file_path, new LinkOption[0]) ? java_nio_file_path.toRealPath() : java_nio_file_path); ++ Files.createDirectories(Files.exists(java_nio_file_path) ? java_nio_file_path.toRealPath() : java_nio_file_path); + } catch (IOException ioexception) { + throw new RuntimeException(ioexception); + } +@@ -59,7 +59,7 @@ public class Convertable { + Optional> optional = dynamic.get(s).result(); + + if (optional.isPresent()) { +- dynamic1 = dynamic1.set(s, (Dynamic) optional.get()); ++ dynamic1 = dynamic1.set(s, optional.get()); + } + } + +@@ -106,14 +106,14 @@ public class Convertable { + @Nullable + private static DataPackConfiguration b(File file, DataFixer datafixer) { + try { +- NBTTagCompound nbttagcompound = NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file))); ++ NBTTagCompound nbttagcompound = NBTCompressedStreamTools.a(new FileInputStream(file)); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Data"); + + nbttagcompound1.remove("Player"); + int i = nbttagcompound1.hasKeyOfType("DataVersion", 99) ? nbttagcompound1.getInt("DataVersion") : -1; + Dynamic dynamic = datafixer.update(DataFixTypes.LEVEL.a(), new Dynamic(DynamicOpsNBT.a, nbttagcompound1), i, SharedConstants.getGameVersion().getWorldVersion()); + +- return (DataPackConfiguration) dynamic.get("DataPacks").result().map(Convertable::a).orElse(DataPackConfiguration.a); ++ return dynamic.get("DataPacks").result().map(Convertable::a).orElse(DataPackConfiguration.a); + } catch (Exception exception) { + Convertable.LOGGER.error("Exception reading {}", file, exception); + return null; +@@ -123,7 +123,7 @@ public class Convertable { + private static BiFunction b(DynamicOps dynamicops, DataPackConfiguration datapackconfiguration) { + return (file, datafixer) -> { + try { +- NBTTagCompound nbttagcompound = NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file))); ++ NBTTagCompound nbttagcompound = NBTCompressedStreamTools.a(new FileInputStream(file)); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Data"); + NBTTagCompound nbttagcompound2 = nbttagcompound1.hasKeyOfType("Player", 10) ? nbttagcompound1.getCompound("Player") : null; + +@@ -134,7 +134,7 @@ public class Convertable { + LevelVersion levelversion = LevelVersion.a(dynamic); + WorldSettings worldsettings = WorldSettings.a(dynamic, datapackconfiguration); + +- return WorldDataServer.a(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, (GeneratorSettings) pair.getFirst(), (Lifecycle) pair.getSecond()); ++ return WorldDataServer.a(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, pair.getFirst(), pair.getSecond()); + } catch (Exception exception) { + Convertable.LOGGER.error("Exception reading {}", file, exception); + return null; +@@ -145,7 +145,7 @@ public class Convertable { + private BiFunction a(File file, boolean flag) { + return (file1, datafixer) -> { + try { +- NBTTagCompound nbttagcompound = NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file1))); ++ NBTTagCompound nbttagcompound = NBTCompressedStreamTools.a(new FileInputStream(file1)); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Data"); + + nbttagcompound1.remove("Player"); +@@ -159,7 +159,7 @@ public class Convertable { + } else { + boolean flag1 = j != this.g(); + File file2 = new File(file, "icon.png"); +- DataPackConfiguration datapackconfiguration = (DataPackConfiguration) dynamic.get("DataPacks").result().map(Convertable::a).orElse(DataPackConfiguration.a); ++ DataPackConfiguration datapackconfiguration = dynamic.get("DataPacks").result().map(Convertable::a).orElse(DataPackConfiguration.a); + WorldSettings worldsettings = WorldSettings.a(dynamic, datapackconfiguration); + + return new WorldInfo(worldsettings, levelversion, file.getName(), flag1, flag, file2); +@@ -199,7 +199,7 @@ public class Convertable { + } + + public java.nio.file.Path getWorldFolder(SavedFile savedfile) { +- return (java.nio.file.Path) this.e.computeIfAbsent(savedfile, (savedfile1) -> { ++ return this.e.computeIfAbsent(savedfile, (savedfile1) -> { + return this.folder.resolve(savedfile1.a()); + }); + } +@@ -247,25 +247,25 @@ public class Convertable { + @Nullable + public WorldInfo d() { + this.checkSession(); +- return (WorldInfo) Convertable.this.a(this.folder.toFile(), Convertable.this.a(this.folder.toFile(), false)); ++ return Convertable.this.a(this.folder.toFile(), Convertable.this.a(this.folder.toFile(), false)); + } + + @Nullable + public SaveData a(DynamicOps dynamicops, DataPackConfiguration datapackconfiguration) { + this.checkSession(); +- return (SaveData) Convertable.this.a(this.folder.toFile(), Convertable.b(dynamicops, datapackconfiguration)); ++ return Convertable.this.a(this.folder.toFile(), Convertable.b(dynamicops, datapackconfiguration)); + } + + @Nullable + public DataPackConfiguration e() { + this.checkSession(); +- return (DataPackConfiguration) Convertable.this.a(this.folder.toFile(), (file, datafixer) -> { ++ return Convertable.this.a(this.folder.toFile(), (file, datafixer) -> { + return Convertable.b(file, datafixer); + }); + } + + public void a(IRegistryCustom iregistrycustom, SaveData savedata) { +- this.a(iregistrycustom, savedata, (NBTTagCompound) null); ++ this.a(iregistrycustom, savedata, null); + } + + public void a(IRegistryCustom iregistrycustom, SaveData savedata, @Nullable NBTTagCompound nbttagcompound) { +@@ -278,7 +278,7 @@ public class Convertable { + try { + File file1 = File.createTempFile("level", ".dat", file); + +- NBTCompressedStreamTools.a(nbttagcompound2, (OutputStream) (new FileOutputStream(file1))); ++ NBTCompressedStreamTools.a(nbttagcompound2, new FileOutputStream(file1)); + File file2 = new File(file, "level.dat_old"); + File file3 = new File(file, "level.dat"); + +diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java +index 83b8f9a7419db0dd7b9ffb36652290fbdafb3d8d..a9d8446f85ee7b4e25f4bb9b1dce910dbcb1fe71 100644 +--- a/src/main/java/net/minecraft/server/CraftingManager.java ++++ b/src/main/java/net/minecraft/server/CraftingManager.java +@@ -35,10 +35,10 @@ public class CraftingManager extends ResourceDataJson { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- MinecraftKey minecraftkey = (MinecraftKey) entry.getKey(); ++ MinecraftKey minecraftkey = entry.getKey(); + + try { +- IRecipe irecipe = a(minecraftkey, ChatDeserializer.m((JsonElement) entry.getValue(), "top element")); ++ IRecipe irecipe = a(minecraftkey, ChatDeserializer.m(entry.getValue(), "top element")); + + // CraftBukkit start - SPIGOT-4638: last recipe gets priority + (map1.computeIfAbsent(irecipe.g(), (recipes) -> { +@@ -50,7 +50,7 @@ public class CraftingManager extends ResourceDataJson { + } + } + +- this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> { ++ this.recipes = map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> { + return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* + })); + CraftingManager.LOGGER.info("Loaded {} recipes", map1.size()); +@@ -106,7 +106,7 @@ public class CraftingManager extends ResourceDataJson { + } + + public > List b(Recipes recipes, C c0, World world) { +- return (List) this.b(recipes).values().stream().flatMap((irecipe) -> { ++ return this.b(recipes).values().stream().flatMap((irecipe) -> { + return SystemUtils.a(recipes.a(irecipe, world, c0)); + }).sorted(Comparator.comparing((irecipe) -> { + return irecipe.getResult().j(); +@@ -151,7 +151,7 @@ public class CraftingManager extends ResourceDataJson { + set.add(iRecipe); + } + } +- return (Collection) set; ++ return set; + } + + public Stream d() { +diff --git a/src/main/java/net/minecraft/server/CrashReport.java b/src/main/java/net/minecraft/server/CrashReport.java +index 8e48cbf130d1033f8ea65bbbe90384782b04f283..6ddce2e41f0434aa95afdfbce7f1c12e6c353977 100644 +--- a/src/main/java/net/minecraft/server/CrashReport.java ++++ b/src/main/java/net/minecraft/server/CrashReport.java +@@ -60,9 +60,9 @@ public class CrashReport { + + return k + " bytes (" + j1 + " MB) / " + j + " bytes (" + i1 + " MB) up to " + i + " bytes (" + l + " MB)"; + }); +- this.d.a("CPUs", (Object) Runtime.getRuntime().availableProcessors()); ++ this.d.a("CPUs", Runtime.getRuntime().availableProcessors()); + this.d.a("JVM Flags", () -> { +- List list = (List) SystemUtils.j().collect(Collectors.toList()); ++ List list = SystemUtils.j().collect(Collectors.toList()); + + StringJoiner joiner = new StringJoiner(" "); + for (String s : list) { +@@ -83,7 +83,7 @@ public class CrashReport { + + public void a(StringBuilder stringbuilder) { + if ((this.h == null || this.h.length <= 0) && !this.e.isEmpty()) { +- this.h = (StackTraceElement[]) ArrayUtils.subarray(((CrashReportSystemDetails) this.e.get(0)).a(), 0, 1); ++ this.h = ArrayUtils.subarray(this.e.get(0).a(), 0, 1); + } + + if (this.h != null && this.h.length > 0) { +@@ -233,7 +233,7 @@ public class CrashReport { + + this.g = crashreportsystemdetails.a(stacktraceelement, stacktraceelement1); + if (j > 0 && !this.e.isEmpty()) { +- CrashReportSystemDetails crashreportsystemdetails1 = (CrashReportSystemDetails) this.e.get(this.e.size() - 1); ++ CrashReportSystemDetails crashreportsystemdetails1 = this.e.get(this.e.size() - 1); + + crashreportsystemdetails1.b(j); + } else if (astacktraceelement != null && astacktraceelement.length >= j && 0 <= k && k < astacktraceelement.length) { +diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java +index 759dbd50d584ed2e1ff836c90526d50d59d15691..3cbc7f1fc4742901c3e5a2f931ae62069fa9f5f1 100644 +--- a/src/main/java/net/minecraft/server/CustomFunction.java ++++ b/src/main/java/net/minecraft/server/CustomFunction.java +@@ -43,7 +43,7 @@ public class CustomFunction { + + for (int i = 0; i < list.size(); ++i) { + int j = i + 1; +- String s = ((String) list.get(i)).trim(); ++ String s = list.get(i).trim(); + StringReader stringreader = new StringReader(s); + + if (stringreader.canRead() && stringreader.peek() != '#') { +@@ -72,7 +72,7 @@ public class CustomFunction { + } + } + +- return new CustomFunction(minecraftkey, (CustomFunction.c[]) list1.toArray(new CustomFunction.c[0])); ++ return new CustomFunction(minecraftkey, list1.toArray(new c[0])); + } + + public static class a { +@@ -107,7 +107,7 @@ public class CustomFunction { + + @Nullable + public MinecraftKey a() { +- return (MinecraftKey) this.d.map((customfunction) -> { ++ return this.d.map((customfunction) -> { + return customfunction.b; + }).orElse(this.b); + } +diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java +index 52150f3b71552ecbd721e464be1533a759309d25..f6f586cdda3e543cb2ed4c142d4367c2588fdad1 100644 +--- a/src/main/java/net/minecraft/server/CustomFunctionData.java ++++ b/src/main/java/net/minecraft/server/CustomFunctionData.java +@@ -31,12 +31,12 @@ public class CustomFunctionData { + } + + public void tick() { +- this.a((Collection) this.g, CustomFunctionData.a); ++ this.a(this.g, CustomFunctionData.a); + if (this.h) { + this.h = false; + Collection collection = this.i.b().b(CustomFunctionData.b).getTagged(); + +- this.a((Collection) collection, CustomFunctionData.b); ++ this.a(collection, CustomFunctionData.b); + } + + } +@@ -82,7 +82,7 @@ public class CustomFunctionData { + } + + try { +- CustomFunctionData.a customfunctiondata_a = (CustomFunctionData.a) this.e.removeFirst(); ++ CustomFunctionData.a customfunctiondata_a = this.e.removeFirst(); + + //this.server.getMethodProfiler().a(customfunctiondata_a::toString); // Akarin - remove caller + customfunctiondata_a.a(this.e, i); +diff --git a/src/main/java/net/minecraft/server/DamageSource.java b/src/main/java/net/minecraft/server/DamageSource.java +index 6fe5678cffc2487fe00c953d772f764bb37a4b11..bd258c92ba153c82dc0111ac361d31792c28f1a5 100644 +--- a/src/main/java/net/minecraft/server/DamageSource.java ++++ b/src/main/java/net/minecraft/server/DamageSource.java +@@ -187,7 +187,7 @@ public class DamageSource { + String s = "death.attack." + this.translationIndex; + String s1 = s + ".player"; + +- return entityliving1 != null ? new ChatMessage(s1, new Object[]{entityliving.getScoreboardDisplayName(), entityliving1.getScoreboardDisplayName()}) : new ChatMessage(s, new Object[]{entityliving.getScoreboardDisplayName()}); ++ return entityliving1 != null ? new ChatMessage(s1, entityliving.getScoreboardDisplayName(), entityliving1.getScoreboardDisplayName()) : new ChatMessage(s, entityliving.getScoreboardDisplayName()); + } + + public boolean isFire() { +diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java +index d109499e811123d623bed4315201bcfd71ea77fe..2b2355a035420bbf54cdc96203f488c8a229a2cc 100644 +--- a/src/main/java/net/minecraft/server/DataBits.java ++++ b/src/main/java/net/minecraft/server/DataBits.java +@@ -18,11 +18,11 @@ public class DataBits { + private final int i; + + public DataBits(int i, int j) { +- this(i, j, (long[]) null); ++ this(i, j, null); + } + + public DataBits(int i, int j, @Nullable long[] along) { +- Validate.inclusiveBetween(1L, 32L, (long) i); ++ Validate.inclusiveBetween(1L, 32L, i); + this.e = j; + this.c = i; + this.d = (1L << i) - 1L; +@@ -36,7 +36,7 @@ public class DataBits { + + if (along != null) { + if (along.length != l) { +- throw (RuntimeException) SystemUtils.c(new RuntimeException("Invalid length given for storage, got: " + along.length + " but expected: " + l)); ++ throw SystemUtils.c(new RuntimeException("Invalid length given for storage, got: " + along.length + " but expected: " + l)); + } + + this.b = along; +diff --git a/src/main/java/net/minecraft/server/DataConverterFlatten.java b/src/main/java/net/minecraft/server/DataConverterFlatten.java +index 8d1f58aa2601fa79f68731b68e9a8e09629efeb7..36035093bbca70736ecf9dadf6931bd804587904 100644 +--- a/src/main/java/net/minecraft/server/DataConverterFlatten.java ++++ b/src/main/java/net/minecraft/server/DataConverterFlatten.java +@@ -16,7 +16,7 @@ import java.util.Set; + + public class DataConverterFlatten extends DataFix { + +- private static final Map a = (Map) DataFixUtils.make(Maps.newHashMap(), (hashmap) -> { ++ private static final Map a = DataFixUtils.make(Maps.newHashMap(), (hashmap) -> { + hashmap.put("minecraft:stone.0", "minecraft:stone"); + hashmap.put("minecraft:stone.1", "minecraft:granite"); + hashmap.put("minecraft:stone.2", "minecraft:polished_granite"); +@@ -346,10 +346,10 @@ public class DataConverterFlatten extends DataFix { + String substring = s.substring(0, s.indexOf(46)); + set.add(substring); + } +- b = (Set) set; ++ b = set; + } + +- private static final Set c = Sets.newHashSet(new String[]{"minecraft:bow", "minecraft:carrot_on_a_stick", "minecraft:chainmail_boots", "minecraft:chainmail_chestplate", "minecraft:chainmail_helmet", "minecraft:chainmail_leggings", "minecraft:diamond_axe", "minecraft:diamond_boots", "minecraft:diamond_chestplate", "minecraft:diamond_helmet", "minecraft:diamond_hoe", "minecraft:diamond_leggings", "minecraft:diamond_pickaxe", "minecraft:diamond_shovel", "minecraft:diamond_sword", "minecraft:elytra", "minecraft:fishing_rod", "minecraft:flint_and_steel", "minecraft:golden_axe", "minecraft:golden_boots", "minecraft:golden_chestplate", "minecraft:golden_helmet", "minecraft:golden_hoe", "minecraft:golden_leggings", "minecraft:golden_pickaxe", "minecraft:golden_shovel", "minecraft:golden_sword", "minecraft:iron_axe", "minecraft:iron_boots", "minecraft:iron_chestplate", "minecraft:iron_helmet", "minecraft:iron_hoe", "minecraft:iron_leggings", "minecraft:iron_pickaxe", "minecraft:iron_shovel", "minecraft:iron_sword", "minecraft:leather_boots", "minecraft:leather_chestplate", "minecraft:leather_helmet", "minecraft:leather_leggings", "minecraft:shears", "minecraft:shield", "minecraft:stone_axe", "minecraft:stone_hoe", "minecraft:stone_pickaxe", "minecraft:stone_shovel", "minecraft:stone_sword", "minecraft:wooden_axe", "minecraft:wooden_hoe", "minecraft:wooden_pickaxe", "minecraft:wooden_shovel", "minecraft:wooden_sword"}); ++ private static final Set c = Sets.newHashSet("minecraft:bow", "minecraft:carrot_on_a_stick", "minecraft:chainmail_boots", "minecraft:chainmail_chestplate", "minecraft:chainmail_helmet", "minecraft:chainmail_leggings", "minecraft:diamond_axe", "minecraft:diamond_boots", "minecraft:diamond_chestplate", "minecraft:diamond_helmet", "minecraft:diamond_hoe", "minecraft:diamond_leggings", "minecraft:diamond_pickaxe", "minecraft:diamond_shovel", "minecraft:diamond_sword", "minecraft:elytra", "minecraft:fishing_rod", "minecraft:flint_and_steel", "minecraft:golden_axe", "minecraft:golden_boots", "minecraft:golden_chestplate", "minecraft:golden_helmet", "minecraft:golden_hoe", "minecraft:golden_leggings", "minecraft:golden_pickaxe", "minecraft:golden_shovel", "minecraft:golden_sword", "minecraft:iron_axe", "minecraft:iron_boots", "minecraft:iron_chestplate", "minecraft:iron_helmet", "minecraft:iron_hoe", "minecraft:iron_leggings", "minecraft:iron_pickaxe", "minecraft:iron_shovel", "minecraft:iron_sword", "minecraft:leather_boots", "minecraft:leather_chestplate", "minecraft:leather_helmet", "minecraft:leather_leggings", "minecraft:shears", "minecraft:shield", "minecraft:stone_axe", "minecraft:stone_hoe", "minecraft:stone_pickaxe", "minecraft:stone_shovel", "minecraft:stone_sword", "minecraft:wooden_axe", "minecraft:wooden_hoe", "minecraft:wooden_pickaxe", "minecraft:wooden_shovel", "minecraft:wooden_sword"); + + public DataConverterFlatten(Schema schema, boolean flag) { + super(schema, flag); +@@ -367,7 +367,7 @@ public class DataConverterFlatten extends DataFix { + return typed; + } else { + Typed typed1 = typed; +- Dynamic dynamic = (Dynamic) typed.get(DSL.remainderFinder()); ++ Dynamic dynamic = typed.get(DSL.remainderFinder()); + int i = dynamic.get("Damage").asInt(0); + String s = a((String) ((Pair) optional.get()).getSecond(), i); + +@@ -377,7 +377,7 @@ public class DataConverterFlatten extends DataFix { + + if (DataConverterFlatten.c.contains(((Pair) optional.get()).getSecond())) { + Typed typed2 = typed.getOrCreateTyped(opticfinder1); +- Dynamic dynamic1 = (Dynamic) typed2.get(DSL.remainderFinder()); ++ Dynamic dynamic1 = typed2.get(DSL.remainderFinder()); + + if (i != 0) dynamic1 = dynamic1.set("Damage", dynamic1.createInt(i)); // CraftBukkit + typed1 = typed1.set(opticfinder1, typed2.set(DSL.remainderFinder(), dynamic1)); +@@ -392,9 +392,9 @@ public class DataConverterFlatten extends DataFix { + @Nullable + public static String a(@Nullable String s, int i) { + if (DataConverterFlatten.b.contains(s)) { +- String s1 = (String) DataConverterFlatten.a.get(s + '.' + i); ++ String s1 = DataConverterFlatten.a.get(s + '.' + i); + +- return s1 == null ? (String) DataConverterFlatten.a.get(s + ".0") : s1; ++ return s1 == null ? DataConverterFlatten.a.get(s + ".0") : s1; + } else { + return null; + } +diff --git a/src/main/java/net/minecraft/server/DataConverterMap.java b/src/main/java/net/minecraft/server/DataConverterMap.java +index 85bb4850b79f15f07fdf723e79a236d755b8b330..24776c3b02ef82f5b9031d9cbc1ec782b9f2f275 100644 +--- a/src/main/java/net/minecraft/server/DataConverterMap.java ++++ b/src/main/java/net/minecraft/server/DataConverterMap.java +@@ -24,9 +24,9 @@ public class DataConverterMap extends DataFix { + Optional> optional = typed.getOptional(opticfinder); + + if (optional.isPresent() && Objects.equals(((Pair) optional.get()).getSecond(), "minecraft:filled_map")) { +- Dynamic dynamic = (Dynamic) typed.get(DSL.remainderFinder()); ++ Dynamic dynamic = typed.get(DSL.remainderFinder()); + Typed typed1 = typed.getOrCreateTyped(opticfinder1); +- Dynamic dynamic1 = (Dynamic) typed1.get(DSL.remainderFinder()); ++ Dynamic dynamic1 = typed1.get(DSL.remainderFinder()); + + if (!dynamic1.getElement("map").result().isPresent()) dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.get("Damage").asInt(0))); // CraftBukkit + return typed.set(opticfinder1, typed1.set(DSL.remainderFinder(), dynamic1)); +diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java +index 6953ca641f8a7a8481254cadda2ad83cd809767a..ec7559d72d8d0501faf7c45fe635cb89d39bd3d5 100644 +--- a/src/main/java/net/minecraft/server/DataConverterRegistry.java ++++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java +@@ -220,7 +220,7 @@ public class DataConverterRegistry { + })); + Schema schema52 = datafixerbuilder.addSchema(1475, DataConverterRegistry.b); + +- datafixerbuilder.addFixer(DataConverterBlockRename.a(schema52, "Flowing fixer", a((Map) ImmutableMap.of("minecraft:flowing_water", "minecraft:water", "minecraft:flowing_lava", "minecraft:lava")))); ++ datafixerbuilder.addFixer(DataConverterBlockRename.a(schema52, "Flowing fixer", a(ImmutableMap.of("minecraft:flowing_water", "minecraft:water", "minecraft:flowing_lava", "minecraft:lava")))); + Schema schema53 = datafixerbuilder.addSchema(1480, DataConverterRegistry.b); + + datafixerbuilder.addFixer(DataConverterBlockRename.a(schema53, "Rename coral blocks", a(DataConverterCoral.a))); +@@ -234,8 +234,8 @@ public class DataConverterRegistry { + datafixerbuilder.addFixer(DataConverterItemName.a(schema55, "Rename pufferfish egg item", a(DataConverterEntityPufferfish.a))); + Schema schema56 = datafixerbuilder.addSchema(1484, DataConverterRegistry.b); + +- datafixerbuilder.addFixer(DataConverterItemName.a(schema56, "Rename seagrass items", a((Map) ImmutableMap.of("minecraft:sea_grass", "minecraft:seagrass", "minecraft:tall_sea_grass", "minecraft:tall_seagrass")))); +- datafixerbuilder.addFixer(DataConverterBlockRename.a(schema56, "Rename seagrass blocks", a((Map) ImmutableMap.of("minecraft:sea_grass", "minecraft:seagrass", "minecraft:tall_sea_grass", "minecraft:tall_seagrass")))); ++ datafixerbuilder.addFixer(DataConverterItemName.a(schema56, "Rename seagrass items", a(ImmutableMap.of("minecraft:sea_grass", "minecraft:seagrass", "minecraft:tall_sea_grass", "minecraft:tall_seagrass")))); ++ datafixerbuilder.addFixer(DataConverterBlockRename.a(schema56, "Rename seagrass blocks", a(ImmutableMap.of("minecraft:sea_grass", "minecraft:seagrass", "minecraft:tall_sea_grass", "minecraft:tall_seagrass")))); + datafixerbuilder.addFixer(new DataConverterHeightmapRenaming(schema56, false)); + Schema schema57 = datafixerbuilder.addSchema(1486, DataConverterSchemaV1486::new); + +@@ -243,11 +243,11 @@ public class DataConverterRegistry { + datafixerbuilder.addFixer(DataConverterItemName.a(schema57, "Rename cod/salmon egg items", a(DataConverterEntityCodSalmon.b))); + Schema schema58 = datafixerbuilder.addSchema(1487, DataConverterRegistry.b); + +- datafixerbuilder.addFixer(DataConverterItemName.a(schema58, "Rename prismarine_brick(s)_* blocks", a((Map) ImmutableMap.of("minecraft:prismarine_bricks_slab", "minecraft:prismarine_brick_slab", "minecraft:prismarine_bricks_stairs", "minecraft:prismarine_brick_stairs")))); +- datafixerbuilder.addFixer(DataConverterBlockRename.a(schema58, "Rename prismarine_brick(s)_* items", a((Map) ImmutableMap.of("minecraft:prismarine_bricks_slab", "minecraft:prismarine_brick_slab", "minecraft:prismarine_bricks_stairs", "minecraft:prismarine_brick_stairs")))); ++ datafixerbuilder.addFixer(DataConverterItemName.a(schema58, "Rename prismarine_brick(s)_* blocks", a(ImmutableMap.of("minecraft:prismarine_bricks_slab", "minecraft:prismarine_brick_slab", "minecraft:prismarine_bricks_stairs", "minecraft:prismarine_brick_stairs")))); ++ datafixerbuilder.addFixer(DataConverterBlockRename.a(schema58, "Rename prismarine_brick(s)_* items", a(ImmutableMap.of("minecraft:prismarine_bricks_slab", "minecraft:prismarine_brick_slab", "minecraft:prismarine_bricks_stairs", "minecraft:prismarine_brick_stairs")))); + Schema schema59 = datafixerbuilder.addSchema(1488, DataConverterRegistry.b); + +- datafixerbuilder.addFixer(DataConverterBlockRename.a(schema59, "Rename kelp/kelptop", a((Map) ImmutableMap.of("minecraft:kelp_top", "minecraft:kelp", "minecraft:kelp", "minecraft:kelp_plant")))); ++ datafixerbuilder.addFixer(DataConverterBlockRename.a(schema59, "Rename kelp/kelptop", a(ImmutableMap.of("minecraft:kelp_top", "minecraft:kelp", "minecraft:kelp", "minecraft:kelp_plant")))); + datafixerbuilder.addFixer(DataConverterItemName.a(schema59, "Rename kelptop", a("minecraft:kelp_top", "minecraft:kelp"))); + datafixerbuilder.addFixer(new DataConverterNamedEntity(schema59, false, "Command block block entity custom name fix", DataConverterTypes.BLOCK_ENTITY, "minecraft:command_block") { + @Override +@@ -265,7 +265,7 @@ public class DataConverterRegistry { + Schema schema60 = datafixerbuilder.addSchema(1490, DataConverterRegistry.b); + + datafixerbuilder.addFixer(DataConverterBlockRename.a(schema60, "Rename melon_block", a("minecraft:melon_block", "minecraft:melon"))); +- datafixerbuilder.addFixer(DataConverterItemName.a(schema60, "Rename melon_block/melon/speckled_melon", a((Map) ImmutableMap.of("minecraft:melon_block", "minecraft:melon", "minecraft:melon", "minecraft:melon_slice", "minecraft:speckled_melon", "minecraft:glistering_melon_slice")))); ++ datafixerbuilder.addFixer(DataConverterItemName.a(schema60, "Rename melon_block/melon/speckled_melon", a(ImmutableMap.of("minecraft:melon_block", "minecraft:melon", "minecraft:melon", "minecraft:melon_slice", "minecraft:speckled_melon", "minecraft:glistering_melon_slice")))); + Schema schema61 = datafixerbuilder.addSchema(1492, DataConverterRegistry.b); + + datafixerbuilder.addFixer(new DataConverterChunkStructuresTemplateRename(schema61, false)); +@@ -314,8 +314,8 @@ public class DataConverterRegistry { + datafixerbuilder.addFixer(new DataConverterAddChoices(schema73, "Added Illager Beast", DataConverterTypes.ENTITY)); + Schema schema74 = datafixerbuilder.addSchema(1802, DataConverterRegistry.b); + +- datafixerbuilder.addFixer(DataConverterBlockRename.a(schema74, "Rename sign blocks & stone slabs", a((Map) ImmutableMap.of("minecraft:stone_slab", "minecraft:smooth_stone_slab", "minecraft:sign", "minecraft:oak_sign", "minecraft:wall_sign", "minecraft:oak_wall_sign")))); +- datafixerbuilder.addFixer(DataConverterItemName.a(schema74, "Rename sign item & stone slabs", a((Map) ImmutableMap.of("minecraft:stone_slab", "minecraft:smooth_stone_slab", "minecraft:sign", "minecraft:oak_sign")))); ++ datafixerbuilder.addFixer(DataConverterBlockRename.a(schema74, "Rename sign blocks & stone slabs", a(ImmutableMap.of("minecraft:stone_slab", "minecraft:smooth_stone_slab", "minecraft:sign", "minecraft:oak_sign", "minecraft:wall_sign", "minecraft:oak_wall_sign")))); ++ datafixerbuilder.addFixer(DataConverterItemName.a(schema74, "Rename sign item & stone slabs", a(ImmutableMap.of("minecraft:stone_slab", "minecraft:smooth_stone_slab", "minecraft:sign", "minecraft:oak_sign")))); + Schema schema75 = datafixerbuilder.addSchema(1803, DataConverterRegistry.b); + + datafixerbuilder.addFixer(new DataConverterItemLoreComponentize(schema75, false)); +@@ -414,8 +414,8 @@ public class DataConverterRegistry { + datafixerbuilder.addFixer(new DataConverterMemoryExpiry(schema102, "minecraft:villager")); + Schema schema103 = datafixerbuilder.addSchema(2508, DataConverterRegistry.b); + +- datafixerbuilder.addFixer(DataConverterItemName.a(schema103, "Renamed fungi items to fungus", a((Map) ImmutableMap.of("minecraft:warped_fungi", "minecraft:warped_fungus", "minecraft:crimson_fungi", "minecraft:crimson_fungus")))); +- datafixerbuilder.addFixer(DataConverterBlockRename.a(schema103, "Renamed fungi blocks to fungus", a((Map) ImmutableMap.of("minecraft:warped_fungi", "minecraft:warped_fungus", "minecraft:crimson_fungi", "minecraft:crimson_fungus")))); ++ datafixerbuilder.addFixer(DataConverterItemName.a(schema103, "Renamed fungi items to fungus", a(ImmutableMap.of("minecraft:warped_fungi", "minecraft:warped_fungus", "minecraft:crimson_fungi", "minecraft:crimson_fungus")))); ++ datafixerbuilder.addFixer(DataConverterBlockRename.a(schema103, "Renamed fungi blocks to fungus", a(ImmutableMap.of("minecraft:warped_fungi", "minecraft:warped_fungus", "minecraft:crimson_fungi", "minecraft:crimson_fungus")))); + Schema schema104 = datafixerbuilder.addSchema(2509, DataConverterSchemaV2509::new); + + datafixerbuilder.addFixer(new DataConverterEntityZombifiedPiglinRename(schema104)); +@@ -453,8 +453,8 @@ public class DataConverterRegistry { + datafixerbuilder.addFixer(new DataConverterBitStorageAlign(schema112)); + Schema schema113 = datafixerbuilder.addSchema(2528, DataConverterRegistry.b); + +- datafixerbuilder.addFixer(DataConverterItemName.a(schema113, "Rename soul fire torch and soul fire lantern", a((Map) ImmutableMap.of("minecraft:soul_fire_torch", "minecraft:soul_torch", "minecraft:soul_fire_lantern", "minecraft:soul_lantern")))); +- datafixerbuilder.addFixer(DataConverterBlockRename.a(schema113, "Rename soul fire torch and soul fire lantern", a((Map) ImmutableMap.of("minecraft:soul_fire_torch", "minecraft:soul_torch", "minecraft:soul_fire_wall_torch", "minecraft:soul_wall_torch", "minecraft:soul_fire_lantern", "minecraft:soul_lantern")))); ++ datafixerbuilder.addFixer(DataConverterItemName.a(schema113, "Rename soul fire torch and soul fire lantern", a(ImmutableMap.of("minecraft:soul_fire_torch", "minecraft:soul_torch", "minecraft:soul_fire_lantern", "minecraft:soul_lantern")))); ++ datafixerbuilder.addFixer(DataConverterBlockRename.a(schema113, "Rename soul fire torch and soul fire lantern", a(ImmutableMap.of("minecraft:soul_fire_torch", "minecraft:soul_torch", "minecraft:soul_fire_wall_torch", "minecraft:soul_wall_torch", "minecraft:soul_fire_lantern", "minecraft:soul_lantern")))); + Schema schema114 = datafixerbuilder.addSchema(2529, DataConverterRegistry.b); + + datafixerbuilder.addFixer(new DataConverterStriderGravity(schema114, false)); +diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java +index d3105bf3dd35ad26d3df64c03174cedcdfaca178..7b11493b98106baeaaa64a12b77a0fc14cfb9068 100644 +--- a/src/main/java/net/minecraft/server/DataWatcher.java ++++ b/src/main/java/net/minecraft/server/DataWatcher.java +@@ -34,7 +34,7 @@ public class DataWatcher { + */ + private Object onAddTrackedDataInsertMap(it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap> map, int keyRaw, DataWatcher.Item valueRaw) { + int k = keyRaw; +- DataWatcher.Item v = (DataWatcher.Item) valueRaw; ++ DataWatcher.Item v = valueRaw; + + DataWatcher.Item[] storage = this.entriesArray; + +@@ -113,7 +113,7 @@ public class DataWatcher { + int i; + + if (DataWatcher.b.containsKey(oclass)) { +- i = (Integer) DataWatcher.b.get(oclass) + 1; ++ i = DataWatcher.b.get(oclass) + 1; + } else { + int j = 0; + Class oclass2 = oclass; +@@ -121,7 +121,7 @@ public class DataWatcher { + while (oclass2 != Entity.class) { + oclass2 = oclass2.getSuperclass(); + if (DataWatcher.b.containsKey(oclass2)) { +- j = (Integer) DataWatcher.b.get(oclass2) + 1; ++ j = DataWatcher.b.get(oclass2) + 1; + break; + } + } +diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java +index 7ae538a6a7a9766f8443c0dd7cf908a028d3f9bb..6ba634db74d23d5e1a03595c105e23e04ada6a6d 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/DedicatedServer.java +@@ -147,7 +147,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + this.a_(dedicatedserverproperties.serverIp); + } + // Spigot start +- this.a((PlayerList) (new DedicatedPlayerList(this, this.f, this.worldNBTStorage))); ++ this.a(new DedicatedPlayerList(this, this.f, this.worldNBTStorage)); + org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings")); + org.spigotmc.SpigotConfig.registerCommands(); + // Spigot end +@@ -189,7 +189,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + this.setResourcePack(dedicatedserverproperties.resourcePack, this.aY()); + this.setMotd(dedicatedserverproperties.motd); + this.setForceGamemode(dedicatedserverproperties.forceGamemode); +- super.setIdleTimeout((Integer) dedicatedserverproperties.playerIdleTimeout.get()); ++ super.setIdleTimeout(dedicatedserverproperties.playerIdleTimeout.get()); + this.i(dedicatedserverproperties.enforceWhitelist); + // this.saveData.setGameType(dedicatedserverproperties.gamemode); // CraftBukkit - moved to world loading + DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode); +@@ -257,7 +257,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + + //DedicatedServer.LOGGER.info("Done ({})! For help, type \"help\"", s); // Paper moved to after init + if (dedicatedserverproperties.announcePlayerAchievements != null) { +- ((GameRules.GameRuleBoolean) this.getGameRules().get(GameRules.ANNOUNCE_ADVANCEMENTS)).a(dedicatedserverproperties.announcePlayerAchievements, (MinecraftServer) this); ++ this.getGameRules().get(GameRules.ANNOUNCE_ADVANCEMENTS).a(dedicatedserverproperties.announcePlayerAchievements, this); + } + + if (dedicatedserverproperties.enableQuery) { +@@ -284,7 +284,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + + Items.AIR.a(CreativeModeTab.g, NonNullList.a()); + if (dedicatedserverproperties.enableJmxMonitoring) { +- MinecraftServerBeans.a((MinecraftServer) this); ++ MinecraftServerBeans.a(this); + } + + return true; +@@ -352,7 +352,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + public CrashReport b(CrashReport crashreport) { + crashreport = super.b(crashreport); + crashreport.g().a("Is Modded", () -> { +- return (String) this.getModded().orElse("Unknown (can't tell)"); ++ return this.getModded().orElse("Unknown (can't tell)"); + }); + crashreport.g().a("Type", () -> { + return "Dedicated Server (map_server.txt)"; +@@ -529,7 +529,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + public void setIdleTimeout(int i) { + super.setIdleTimeout(i); + this.propertyManager.setProperty((dedicatedserverproperties) -> { +- return (DedicatedServerProperties) dedicatedserverproperties.playerIdleTimeout.set(i); ++ return dedicatedserverproperties.playerIdleTimeout.set(i); + }); + } + +@@ -575,7 +575,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + this.bm(); + } + +- flag1 = NameReferencingFileConverter.b((MinecraftServer) this); ++ flag1 = NameReferencingFileConverter.b(this); + } + + boolean flag2 = false; +@@ -586,7 +586,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + this.bm(); + } + +- flag2 = NameReferencingFileConverter.c((MinecraftServer) this); ++ flag2 = NameReferencingFileConverter.c(this); + } + + boolean flag3 = false; +@@ -703,7 +703,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + + public void setHasWhitelist(boolean flag) { + this.propertyManager.setProperty((dedicatedserverproperties) -> { +- return (DedicatedServerProperties) dedicatedserverproperties.whiteList.set(flag); ++ return dedicatedserverproperties.whiteList.set(flag); + }); + } + +diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java +index addfec76b34a0af11e70d74ca8540155ba7254a3..1705971ce9686db37db27bcea4f0c50ec09465f2 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java ++++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java +@@ -62,8 +62,8 @@ public class DedicatedServerProperties extends PropertyManager { +diff --git a/src/main/java/net/minecraft/server/DedicatedServerSettings.java b/src/main/java/net/minecraft/server/DedicatedServerSettings.java +index 659b302de68d8c5ec598aa499955aa05275d76a9..e2d66609ed18785dc76c743782c3757978c88fcf 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServerSettings.java ++++ b/src/main/java/net/minecraft/server/DedicatedServerSettings.java +@@ -27,7 +27,7 @@ public class DedicatedServerSettings { + } + + public DedicatedServerSettings setProperty(UnaryOperator unaryoperator) { +- (this.properties = (DedicatedServerProperties) unaryoperator.apply(this.properties)).savePropertiesFile(this.path); ++ (this.properties = unaryoperator.apply(this.properties)).savePropertiesFile(this.path); + return this; + } + } +diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java +index 4bc8c48576ca91bd4efe02c94eaa4b8f1f740b2c..fb03afd51331bc8984171a8a910b27d4d407bfc5 100644 +--- a/src/main/java/net/minecraft/server/DefinedStructure.java ++++ b/src/main/java/net/minecraft/server/DefinedStructure.java +@@ -33,7 +33,7 @@ public class DefinedStructure { + + public void a(World world, BlockPosition blockposition, BlockPosition blockposition1, boolean flag, @Nullable Block block) { + if (blockposition1.getX() >= 1 && blockposition1.getY() >= 1 && blockposition1.getZ() >= 1) { +- BlockPosition blockposition2 = blockposition.a((BaseBlockPosition) blockposition1).b(-1, -1, -1); ++ BlockPosition blockposition2 = blockposition.a(blockposition1).b(-1, -1, -1); + List list = Lists.newArrayList(); + List list1 = Lists.newArrayList(); + List list2 = Lists.newArrayList(); +@@ -60,14 +60,14 @@ public class DefinedStructure { + nbttagcompound.remove("z"); + definedstructure_blockinfo = new DefinedStructure.BlockInfo(blockposition6, iblockdata, nbttagcompound.clone()); + } else { +- definedstructure_blockinfo = new DefinedStructure.BlockInfo(blockposition6, iblockdata, (NBTTagCompound) null); ++ definedstructure_blockinfo = new DefinedStructure.BlockInfo(blockposition6, iblockdata, null); + } + +- a(definedstructure_blockinfo, (List) list, (List) list1, (List) list2); ++ a(definedstructure_blockinfo, list, list1, list2); + } + } + +- List list3 = a((List) list, (List) list1, (List) list2); ++ List list3 = a(list, list1, list2); + + this.a.clear(); + this.a.add(new DefinedStructure.a(list3)); +@@ -152,9 +152,9 @@ public class DefinedStructure { + + while (iterator.hasNext()) { + DefinedStructure.BlockInfo definedstructure_blockinfo = (DefinedStructure.BlockInfo) iterator.next(); +- BlockPosition blockposition1 = flag ? a(definedstructureinfo, definedstructure_blockinfo.a).a((BaseBlockPosition) blockposition) : definedstructure_blockinfo.a; ++ BlockPosition blockposition1 = flag ? a(definedstructureinfo, definedstructure_blockinfo.a).a(blockposition) : definedstructure_blockinfo.a; + +- if (structureboundingbox == null || structureboundingbox.b((BaseBlockPosition) blockposition1)) { ++ if (structureboundingbox == null || structureboundingbox.b(blockposition1)) { + list.add(new DefinedStructure.BlockInfo(blockposition1, definedstructure_blockinfo.b.a(definedstructureinfo.d()), definedstructure_blockinfo.c)); + } + } +@@ -208,7 +208,7 @@ public class DefinedStructure { + DefinedStructure.BlockInfo definedstructure_blockinfo = (DefinedStructure.BlockInfo) iterator.next(); + BlockPosition blockposition2 = definedstructure_blockinfo.a; + +- if (structureboundingbox == null || structureboundingbox.b((BaseBlockPosition) blockposition2)) { ++ if (structureboundingbox == null || structureboundingbox.b(blockposition2)) { + Fluid fluid = definedstructureinfo.l() ? generatoraccess.getFluid(blockposition2) : null; + IBlockData iblockdata = definedstructure_blockinfo.b.a(definedstructureinfo.c()).a(definedstructureinfo.d()); + +@@ -304,7 +304,7 @@ public class DefinedStructure { + + while (iterator2.hasNext()) { + Pair pair = (Pair) iterator2.next(); +- BlockPosition blockposition6 = (BlockPosition) pair.getFirst(); ++ BlockPosition blockposition6 = pair.getFirst(); + + voxelshapebitset.a(blockposition6.getX() - i2, blockposition6.getY() - j2, blockposition6.getZ() - k2, true, true); + } +@@ -317,7 +317,7 @@ public class DefinedStructure { + while (iterator1.hasNext()) { + Pair pair1 = (Pair) iterator1.next(); + +- blockposition3 = (BlockPosition) pair1.getFirst(); ++ blockposition3 = pair1.getFirst(); + if (!definedstructureinfo.i()) { + IBlockData iblockdata2 = generatoraccess.getType(blockposition3); + +@@ -376,7 +376,7 @@ public class DefinedStructure { + + while (iterator.hasNext()) { + DefinedStructure.BlockInfo definedstructure_blockinfo = (DefinedStructure.BlockInfo) iterator.next(); +- BlockPosition blockposition2 = a(definedstructureinfo, definedstructure_blockinfo.a).a((BaseBlockPosition) blockposition); ++ BlockPosition blockposition2 = a(definedstructureinfo, definedstructure_blockinfo.a).a(blockposition); + DefinedStructure.BlockInfo definedstructure_blockinfo1 = new DefinedStructure.BlockInfo(blockposition2, definedstructure_blockinfo.b, definedstructure_blockinfo.c != null ? definedstructure_blockinfo.c.clone() : null); + + for (Iterator iterator1 = definedstructureinfo.j().iterator(); definedstructure_blockinfo1 != null && iterator1.hasNext(); definedstructure_blockinfo1 = ((DefinedStructureProcessor) iterator1.next()).a(generatoraccess, blockposition, blockposition1, definedstructure_blockinfo, definedstructure_blockinfo1, definedstructureinfo)) { +@@ -396,12 +396,12 @@ public class DefinedStructure { + + while (iterator.hasNext()) { + DefinedStructure.EntityInfo definedstructure_entityinfo = (DefinedStructure.EntityInfo) iterator.next(); +- BlockPosition blockposition2 = a(definedstructure_entityinfo.b, enumblockmirror, enumblockrotation, blockposition1).a((BaseBlockPosition) blockposition); ++ BlockPosition blockposition2 = a(definedstructure_entityinfo.b, enumblockmirror, enumblockrotation, blockposition1).a(blockposition); + +- if (structureboundingbox == null || structureboundingbox.b((BaseBlockPosition) blockposition2)) { ++ if (structureboundingbox == null || structureboundingbox.b(blockposition2)) { + NBTTagCompound nbttagcompound = definedstructure_entityinfo.c.clone(); + Vec3D vec3d = a(definedstructure_entityinfo.a, enumblockmirror, enumblockrotation, blockposition1); +- Vec3D vec3d1 = vec3d.add((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); ++ Vec3D vec3d1 = vec3d.add(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + NBTTagList nbttaglist = new NBTTagList(); + + nbttaglist.add(NBTTagDouble.a(vec3d1.x)); +@@ -415,7 +415,7 @@ public class DefinedStructure { + f += entity.yaw - entity.a(enumblockrotation); + entity.setPositionRotation(vec3d1.x, vec3d1.y, vec3d1.z, f, entity.pitch); + if (flag && entity instanceof EntityInsentient) { +- ((EntityInsentient) entity).prepare(generatoraccess, generatoraccess.getDamageScaler(new BlockPosition(vec3d1)), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, nbttagcompound); ++ ((EntityInsentient) entity).prepare(generatoraccess, generatoraccess.getDamageScaler(new BlockPosition(vec3d1)), EnumMobSpawn.STRUCTURE, null, nbttagcompound); + } + + generatoraccess.addEntity(entity); +@@ -608,10 +608,10 @@ public class DefinedStructure { + } + + NBTTagList nbttaglist = new NBTTagList(); +- List list1 = ((DefinedStructure.a) this.a.get(0)).a(); ++ List list1 = this.a.get(0).a(); + + for (int j = 0; j < list1.size(); ++j) { +- DefinedStructure.BlockInfo definedstructure_blockinfo = (DefinedStructure.BlockInfo) list1.get(j); ++ DefinedStructure.BlockInfo definedstructure_blockinfo = list1.get(j); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + + nbttagcompound1.set("pos", this.a(definedstructure_blockinfo.a.getX(), definedstructure_blockinfo.a.getY(), definedstructure_blockinfo.a.getZ())); +@@ -625,9 +625,9 @@ public class DefinedStructure { + nbttaglist.add(nbttagcompound1); + + for (int l = 1; l < this.a.size(); ++l) { +- DefinedStructure.b definedstructure_b1 = (DefinedStructure.b) list.get(l); ++ DefinedStructure.b definedstructure_b1 = list.get(l); + +- definedstructure_b1.a(((DefinedStructure.BlockInfo) ((DefinedStructure.a) this.a.get(l)).a().get(j)).b, k); ++ definedstructure_b1.a(this.a.get(l).a().get(j).b, k); + } + } + +@@ -753,10 +753,10 @@ public class DefinedStructure { + + DefinedStructure.BlockInfo definedstructure_blockinfo = new DefinedStructure.BlockInfo(blockposition, iblockdata, nbttagcompound1); + +- a(definedstructure_blockinfo, (List) list, (List) list1, (List) list2); ++ a(definedstructure_blockinfo, list, list1, list2); + } + +- List list3 = a((List) list, (List) list1, (List) list2); ++ List list3 = a(list, list1, list2); + + this.a.add(new DefinedStructure.a(list3)); + } +@@ -804,14 +804,14 @@ public class DefinedStructure { + } + + public List a(Block block) { +- return (List) this.b.computeIfAbsent(block, (block1) -> { ++ return this.b.computeIfAbsent(block, (block1) -> { + List list = new ArrayList<>(); + for (BlockInfo definedstructure_blockinfo : this.a) { + if (definedstructure_blockinfo.b.a(block1)) { + list.add(definedstructure_blockinfo); + } + } +- return (List) list; ++ return list; + }); + } + } +@@ -869,7 +869,7 @@ public class DefinedStructure { + + @Nullable + public IBlockData a(int i) { +- IBlockData iblockdata = (IBlockData) this.b.fromId(i); ++ IBlockData iblockdata = this.b.fromId(i); + + return iblockdata == null ? a : iblockdata; // CraftBukkit - decompile error + } +diff --git a/src/main/java/net/minecraft/server/DefinedStructureManager.java b/src/main/java/net/minecraft/server/DefinedStructureManager.java +index 162b6989ff3b2ab0513910ad86b84dc6d29bad81..1bbef33aa23a976c674609ea336e7389e2c98233 100644 +--- a/src/main/java/net/minecraft/server/DefinedStructureManager.java ++++ b/src/main/java/net/minecraft/server/DefinedStructureManager.java +@@ -39,7 +39,7 @@ public class DefinedStructureManager { + + @Nullable + public DefinedStructure b(MinecraftKey minecraftkey) { +- return (DefinedStructure) this.b.computeIfAbsent(minecraftkey, (minecraftkey1) -> { ++ return this.b.computeIfAbsent(minecraftkey, (minecraftkey1) -> { + DefinedStructure definedstructure = this.f(minecraftkey1); + + return definedstructure != null ? definedstructure : this.e(minecraftkey1); +@@ -104,7 +104,7 @@ public class DefinedStructureManager { + DefinedStructure definedstructure; + + try { +- definedstructure = this.a((InputStream) fileinputstream); ++ definedstructure = this.a(fileinputstream); + } catch (Throwable throwable1) { + throwable = throwable1; + throw throwable1; +@@ -151,7 +151,7 @@ public class DefinedStructureManager { + } + + public boolean c(MinecraftKey minecraftkey) { +- DefinedStructure definedstructure = (DefinedStructure) this.b.get(minecraftkey); ++ DefinedStructure definedstructure = this.b.get(minecraftkey); + + if (definedstructure == null) { + return false; +@@ -163,7 +163,7 @@ public class DefinedStructureManager { + return false; + } else { + try { +- Files.createDirectories(Files.exists(java_nio_file_path1, new LinkOption[0]) ? java_nio_file_path1.toRealPath() : java_nio_file_path1); ++ Files.createDirectories(Files.exists(java_nio_file_path1) ? java_nio_file_path1.toRealPath() : java_nio_file_path1); + } catch (IOException ioexception) { + DefinedStructureManager.LOGGER.error("Failed to create parent directory: {}", java_nio_file_path1); + return false; +@@ -176,7 +176,7 @@ public class DefinedStructureManager { + Throwable throwable = null; + + try { +- NBTCompressedStreamTools.a(nbttagcompound, (OutputStream) fileoutputstream); ++ NBTCompressedStreamTools.a(nbttagcompound, fileoutputstream); + } catch (Throwable throwable1) { + throwable = throwable1; + throw throwable1; +diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java b/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java +index cd32e069768a9510e612a7ed9ed77fef447a9084..cfd1867fad37bbd6d7e9904362e1255a39b045ed 100644 +--- a/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java ++++ b/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java +@@ -16,7 +16,7 @@ public class DispenseBehaviorBoat extends DispenseBehaviorItem { + + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + World world = isourceblock.getWorld(); + double d0 = isourceblock.getX() + (double) ((float) enumdirection.getAdjacentX() * 1.125F); + double d1 = isourceblock.getY() + (double) ((float) enumdirection.getAdjacentY() * 1.125F); +@@ -24,10 +24,10 @@ public class DispenseBehaviorBoat extends DispenseBehaviorItem { + BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); + double d3; + +- if (world.getFluid(blockposition).a((Tag) TagsFluid.WATER)) { ++ if (world.getFluid(blockposition).a(TagsFluid.WATER)) { + d3 = 1.0D; + } else { +- if (!world.getType(blockposition).isAir() || !world.getFluid(blockposition.down()).a((Tag) TagsFluid.WATER)) { ++ if (!world.getType(blockposition).isAir() || !world.getFluid(blockposition.down()).a(TagsFluid.WATER)) { + return this.b.dispense(isourceblock, itemstack); + } + +@@ -54,7 +54,7 @@ public class DispenseBehaviorBoat extends DispenseBehaviorItem { + itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java +index ca5eae350b971e93df708a29c426609423645430..8b420890ecdcbcfd68445625c92413f3237e034b 100644 +--- a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java ++++ b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java +@@ -15,12 +15,12 @@ public class DispenseBehaviorItem implements IDispenseBehavior { + ItemStack itemstack1 = this.a(isourceblock, itemstack); + + this.a(isourceblock); +- this.a(isourceblock, (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ this.a(isourceblock, isourceblock.getBlockData().get(BlockDispenser.FACING)); + return itemstack1; + } + + protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + IPosition iposition = BlockDispenser.a(isourceblock); + ItemStack itemstack1 = itemstack.cloneAndSubtract(1); + +@@ -71,7 +71,7 @@ public class DispenseBehaviorItem implements IDispenseBehavior { + if (!event.getItem().getType().equals(craftItem.getType())) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior.getClass() != DispenseBehaviorItem.class) { + idispensebehavior.dispense(isourceblock, eventStack); + } else { +diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java b/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java +index e0b4dd5b547643538db66ad0a097a4b32b343086..684d0e77c335993543fd2632f8418ae05de98a23 100644 +--- a/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java ++++ b/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java +@@ -13,7 +13,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem { + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { + World world = isourceblock.getWorld(); + IPosition iposition = BlockDispenser.a(isourceblock); +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + IProjectile iprojectile = this.a(world, iposition, itemstack); + + // iprojectile.shoot((double) enumdirection.getAdjacentX(), (double) ((float) enumdirection.getAdjacentY() + 0.1F), (double) enumdirection.getAdjacentZ(), this.getPower(), this.a()); +@@ -22,7 +22,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem { + org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); + CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); + +- BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) enumdirection.getAdjacentX(), (double) ((float) enumdirection.getAdjacentY() + 0.1F), (double) enumdirection.getAdjacentZ())); ++ BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(enumdirection.getAdjacentX(), (float) enumdirection.getAdjacentY() + 0.1F, (double) enumdirection.getAdjacentZ())); + if (!BlockDispenser.eventFired) { + world.getServer().getPluginManager().callEvent(event); + } +@@ -36,7 +36,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem { + itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -44,7 +44,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem { + } + + iprojectile.shoot(event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), this.getPower(), this.a()); +- ((Entity) iprojectile).projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource((TileEntityDispenser) isourceblock.getTileEntity()); ++ iprojectile.projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(isourceblock.getTileEntity()); + // CraftBukkit end + world.addEntity(iprojectile); + // itemstack.subtract(1); // CraftBukkit - Handled during event processing +diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorShears.java b/src/main/java/net/minecraft/server/DispenseBehaviorShears.java +index db743d81ea4cda5cafcccd01f3f120da9449dca4..cc5ff6cfe5b29e483f9d0adf0bddbce3bb4d684b 100644 +--- a/src/main/java/net/minecraft/server/DispenseBehaviorShears.java ++++ b/src/main/java/net/minecraft/server/DispenseBehaviorShears.java +@@ -31,7 +31,7 @@ public class DispenseBehaviorShears extends DispenseBehaviorMaybe { + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -40,10 +40,10 @@ public class DispenseBehaviorShears extends DispenseBehaviorMaybe { + // CraftBukkit end + + if (!world.s_()) { +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + + this.a(a((WorldServer) world, blockposition) || b((WorldServer) world, blockposition, bukkitBlock, craftItem)); // CraftBukkit +- if (this.a() && itemstack.isDamaged(1, world.getRandom(), (EntityPlayer) null)) { ++ if (this.a() && itemstack.isDamaged(1, world.getRandom(), null)) { + itemstack.setCount(0); + } + } +@@ -54,13 +54,13 @@ public class DispenseBehaviorShears extends DispenseBehaviorMaybe { + private static boolean a(WorldServer worldserver, BlockPosition blockposition) { + IBlockData iblockdata = worldserver.getType(blockposition); + +- if (iblockdata.a((Tag) TagsBlock.BEEHIVES)) { +- int i = (Integer) iblockdata.get(BlockBeehive.b); ++ if (iblockdata.a(TagsBlock.BEEHIVES)) { ++ int i = iblockdata.get(BlockBeehive.b); + + if (i >= 5) { +- worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_BEEHIVE_SHEAR, SoundCategory.BLOCKS, 1.0F, 1.0F); +- BlockBeehive.a((World) worldserver, blockposition); +- ((BlockBeehive) iblockdata.getBlock()).a(worldserver, iblockdata, blockposition, (EntityHuman) null, TileEntityBeehive.ReleaseStatus.BEE_RELEASED); ++ worldserver.playSound(null, blockposition, SoundEffects.BLOCK_BEEHIVE_SHEAR, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ BlockBeehive.a(worldserver, blockposition); ++ ((BlockBeehive) iblockdata.getBlock()).a(worldserver, iblockdata, blockposition, null, TileEntityBeehive.ReleaseStatus.BEE_RELEASED); + return true; + } + } +diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorShulkerBox.java b/src/main/java/net/minecraft/server/DispenseBehaviorShulkerBox.java +index 36f2a9c375efc543d51c43b9224766b0a4879bb3..af49b448a15560a3ed27006fb11db56aaa845402 100644 +--- a/src/main/java/net/minecraft/server/DispenseBehaviorShulkerBox.java ++++ b/src/main/java/net/minecraft/server/DispenseBehaviorShulkerBox.java +@@ -15,7 +15,7 @@ public class DispenseBehaviorShulkerBox extends DispenseBehaviorMaybe { + Item item = itemstack.getItem(); + + if (item instanceof ItemBlock) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); + EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP; + +@@ -35,7 +35,7 @@ public class DispenseBehaviorShulkerBox extends DispenseBehaviorMaybe { + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -43,7 +43,7 @@ public class DispenseBehaviorShulkerBox extends DispenseBehaviorMaybe { + } + // CraftBukkit end + +- this.a(((ItemBlock) item).a((BlockActionContext) (new BlockActionContextDirectional(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1))).a()); ++ this.a(((ItemBlock) item).a(new BlockActionContextDirectional(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1)).a()); + } + + return itemstack; +diff --git a/src/main/java/net/minecraft/server/DispenserRegistry.java b/src/main/java/net/minecraft/server/DispenserRegistry.java +index 8aabda32c5bd474e6ff6e2c08d97063ac44c5ce9..216dce5c452c7ae1cf1cebe4156fef559817523c 100644 +--- a/src/main/java/net/minecraft/server/DispenserRegistry.java ++++ b/src/main/java/net/minecraft/server/DispenserRegistry.java +@@ -51,7 +51,7 @@ public class DispenserRegistry { + DataConverterFlattenData.map(1023, "{Name:'minecraft:oak_sign',Properties:{rotation:'15'}}", "{Name:'minecraft:standing_sign',Properties:{rotation:'15'}}"); + DataConverterMaterialId.ID_MAPPING.put(323, "minecraft:oak_sign"); + +- DataConverterFlattenData.map(1440, "{Name:\'minecraft:portal\',Properties:{axis:\'x\'}}", new String[]{"{Name:\'minecraft:portal\',Properties:{axis:\'x\'}}"}); ++ DataConverterFlattenData.map(1440, "{Name:'minecraft:portal',Properties:{axis:'x'}}", "{Name:'minecraft:portal',Properties:{axis:'x'}}"); + + DataConverterMaterialId.ID_MAPPING.put(409, "minecraft:prismarine_shard"); + DataConverterMaterialId.ID_MAPPING.put(410, "minecraft:prismarine_crystals"); +@@ -139,7 +139,7 @@ public class DispenserRegistry { + a(IRegistry.CUSTOM_STAT, (minecraftkey) -> { + return "stat." + minecraftkey.toString().replace(':', '.'); + }, set); +- a((Set) set); ++ a(set); + return set; + } + +diff --git a/src/main/java/net/minecraft/server/DoubleBlockFinder.java b/src/main/java/net/minecraft/server/DoubleBlockFinder.java +index 89b2b11bf00b656bb23be855b25697e6ac93a0a2..c641abf533c968fef4dbf1d29ddbd58e28a5d61a 100644 +--- a/src/main/java/net/minecraft/server/DoubleBlockFinder.java ++++ b/src/main/java/net/minecraft/server/DoubleBlockFinder.java +@@ -6,21 +6,21 @@ import java.util.function.Function; + public class DoubleBlockFinder { + + public static DoubleBlockFinder.Result a(TileEntityTypes tileentitytypes, Function function, Function function1, BlockStateDirection blockstatedirection, IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, BiPredicate bipredicate) { +- S s0 = tileentitytypes.a((IBlockAccess) generatoraccess, blockposition); ++ S s0 = tileentitytypes.a(generatoraccess, blockposition); + + if (s0 == null) { + return DoubleBlockFinder.Combiner::b; + } else if (bipredicate.test(generatoraccess, blockposition)) { + return DoubleBlockFinder.Combiner::b; + } else { +- DoubleBlockFinder.BlockType doubleblockfinder_blocktype = (DoubleBlockFinder.BlockType) function.apply(iblockdata); ++ DoubleBlockFinder.BlockType doubleblockfinder_blocktype = function.apply(iblockdata); + boolean flag = doubleblockfinder_blocktype == DoubleBlockFinder.BlockType.SINGLE; + boolean flag1 = doubleblockfinder_blocktype == DoubleBlockFinder.BlockType.FIRST; + + if (flag) { + return new DoubleBlockFinder.Result.Single<>(s0); + } else { +- BlockPosition blockposition1 = blockposition.shift((EnumDirection) function1.apply(iblockdata)); ++ BlockPosition blockposition1 = blockposition.shift(function1.apply(iblockdata)); + // Paper start + IBlockData iblockdata1 = generatoraccess.getTypeIfLoaded(blockposition1); + if (iblockdata1 == null) { +@@ -29,14 +29,14 @@ public class DoubleBlockFinder { + // Paper end + + if (iblockdata1.a(iblockdata.getBlock())) { +- DoubleBlockFinder.BlockType doubleblockfinder_blocktype1 = (DoubleBlockFinder.BlockType) function.apply(iblockdata1); ++ DoubleBlockFinder.BlockType doubleblockfinder_blocktype1 = function.apply(iblockdata1); + + if (doubleblockfinder_blocktype1 != DoubleBlockFinder.BlockType.SINGLE && doubleblockfinder_blocktype != doubleblockfinder_blocktype1 && iblockdata1.get(blockstatedirection) == iblockdata.get(blockstatedirection)) { + if (bipredicate.test(generatoraccess, blockposition1)) { + return DoubleBlockFinder.Combiner::b; + } + +- S s1 = tileentitytypes.a((IBlockAccess) generatoraccess, blockposition1); ++ S s1 = tileentitytypes.a(generatoraccess, blockposition1); + + if (s1 != null) { + S s2 = flag1 ? s0 : s1; +diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java +index 0d860d5dbef667b40a137127fcb73fd6611dcba8..34de6b318058bc1a513a876820ad5c46b90bb332 100644 +--- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java ++++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java +@@ -64,7 +64,7 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded + blockposition_mutableblockposition.c(d0, d3, d1); + } + +- d3 = (double) (MathHelper.floor(d3) + 1); ++ d3 = MathHelper.floor(d3) + 1; + this.d = new EntityAreaEffectCloud(this.a.world, d0, d3, d1); + this.d.setSource(this.a); + this.d.setRadius(5.0F); +diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java +index 892be05e196ffed7c8bd59fff0cba89a614f5d66..9a7e3f2e8ee13cd405f6b66fe2de70358ce607d2 100644 +--- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java ++++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java +@@ -34,7 +34,7 @@ public class DragonControllerStrafe extends AbstractDragonController { + double d3 = d0 - this.a.locX(); + double d4 = d1 - this.a.locZ(); + +- d2 = (double) MathHelper.sqrt(d3 * d3 + d4 * d4); ++ d2 = MathHelper.sqrt(d3 * d3 + d4 * d4); + double d5 = Math.min(0.4000000059604645D + d2 / 80.0D - 1.0D, 10.0D); + + this.e = new Vec3D(d0, this.f.locY() + d5, d1); +@@ -50,9 +50,9 @@ public class DragonControllerStrafe extends AbstractDragonController { + if (this.a.hasLineOfSight(this.f)) { + ++this.c; + Vec3D vec3d = (new Vec3D(this.f.locX() - this.a.locX(), 0.0D, this.f.locZ() - this.a.locZ())).d(); +- Vec3D vec3d1 = (new Vec3D((double) MathHelper.sin(this.a.yaw * 0.017453292F), 0.0D, (double) (-MathHelper.cos(this.a.yaw * 0.017453292F)))).d(); ++ Vec3D vec3d1 = (new Vec3D(MathHelper.sin(this.a.yaw * 0.017453292F), 0.0D, -MathHelper.cos(this.a.yaw * 0.017453292F))).d(); + float f = (float) vec3d1.b(vec3d); +- float f1 = (float) (Math.acos((double) f) * 57.2957763671875D); ++ float f1 = (float) (Math.acos(f) * 57.2957763671875D); + + f1 += 0.5F; + if (this.c >= 5 && f1 >= 0.0F && f1 < 10.0F) { +@@ -66,7 +66,7 @@ public class DragonControllerStrafe extends AbstractDragonController { + double d11 = this.f.locZ() - d8; + + if (!this.a.isSilent()) { +- this.a.world.a((EntityHuman) null, 1017, this.a.getChunkCoordinates(), 0); ++ this.a.world.a(null, 1017, this.a.getChunkCoordinates(), 0); + } + + EntityDragonFireball entitydragonfireball = new EntityDragonFireball(this.a.world, this.a, d9, d10, d11); +@@ -121,7 +121,7 @@ public class DragonControllerStrafe extends AbstractDragonController { + j += 12; + } + +- this.d = this.a.a(i, j, (PathPoint) null); ++ this.d = this.a.a(i, j, null); + if (this.d != null) { + this.d.a(); + } +@@ -135,13 +135,13 @@ public class DragonControllerStrafe extends AbstractDragonController { + BaseBlockPosition baseblockposition = this.d.g(); + + this.d.a(); +- double d0 = (double) baseblockposition.getX(); +- double d1 = (double) baseblockposition.getZ(); ++ double d0 = baseblockposition.getX(); ++ double d1 = baseblockposition.getZ(); + + double d2; + + do { +- d2 = (double) ((float) baseblockposition.getY() + this.a.getRandom().nextFloat() * 20.0F); ++ d2 = (float) baseblockposition.getY() + this.a.getRandom().nextFloat() * 20.0F; + } while (d2 < (double) baseblockposition.getY()); + + this.e = new Vec3D(d0, d2, d1); +@@ -165,7 +165,7 @@ public class DragonControllerStrafe extends AbstractDragonController { + int l = MathHelper.floor(this.f.locZ()); + double d0 = (double) k - this.a.locX(); + double d1 = (double) l - this.a.locZ(); +- double d2 = (double) MathHelper.sqrt(d0 * d0 + d1 * d1); ++ double d2 = MathHelper.sqrt(d0 * d0 + d1 * d1); + double d3 = Math.min(0.4000000059604645D + d2 / 80.0D - 1.0D, 10.0D); + int i1 = MathHelper.floor(this.f.locY() + d3); + PathPoint pathpoint = new PathPoint(k, i1, l); +diff --git a/src/main/java/net/minecraft/server/EnchantmentFrostWalker.java b/src/main/java/net/minecraft/server/EnchantmentFrostWalker.java +index 4d769a513216c56ae93944cd99d091fa3ad97e51..4ed08dfd9c3647d96cdae83dcea3630a0eec3f10 100644 +--- a/src/main/java/net/minecraft/server/EnchantmentFrostWalker.java ++++ b/src/main/java/net/minecraft/server/EnchantmentFrostWalker.java +@@ -34,19 +34,19 @@ public class EnchantmentFrostWalker extends Enchantment { + IBlockData iblockdata = Blocks.FROSTED_ICE.getBlockData(); + float f = (float) Math.min(16, 2 + i); + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); +- Iterator iterator = BlockPosition.a(blockposition.a((double) (-f), -1.0D, (double) (-f)), blockposition.a((double) f, -1.0D, (double) f)).iterator(); ++ Iterator iterator = BlockPosition.a(blockposition.a(-f, -1.0D, -f), blockposition.a(f, -1.0D, f)).iterator(); + + while (iterator.hasNext()) { + BlockPosition blockposition1 = (BlockPosition) iterator.next(); + +- if (blockposition1.a((IPosition) entityliving.getPositionVector(), (double) f)) { ++ if (blockposition1.a(entityliving.getPositionVector(), f)) { + blockposition_mutableblockposition.d(blockposition1.getX(), blockposition1.getY() + 1, blockposition1.getZ()); + IBlockData iblockdata1 = world.getType(blockposition_mutableblockposition); + + if (iblockdata1.isAir()) { + IBlockData iblockdata2 = world.getType(blockposition1); + +- if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition1) && world.a(iblockdata, blockposition1, VoxelShapeCollision.a())) { ++ if (iblockdata2.getMaterial() == Material.WATER && iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition1) && world.a(iblockdata, blockposition1, VoxelShapeCollision.a())) { + // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker + if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition1, iblockdata, entityliving)) { + world.getBlockTickList().a(blockposition1, Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120)); +diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java +index ed7692c65b54e7b0f37794f6bd07141e32122d67..f2a4d65804c65765666ceaccebb590a331804597 100644 +--- a/src/main/java/net/minecraft/server/EnchantmentManager.java ++++ b/src/main/java/net/minecraft/server/EnchantmentManager.java +@@ -45,7 +45,7 @@ public class EnchantmentManager { + NBTTagCompound nbttagcompound = nbttaglist.getCompound(i); + + IRegistry.ENCHANTMENT.getOptional(MinecraftKey.a(nbttagcompound.getString("id"))).ifPresent((enchantment) -> { +- Integer integer = (Integer) map.put(enchantment, nbttagcompound.getInt("lvl")); ++ Integer integer = map.put(enchantment, nbttagcompound.getInt("lvl")); + }); + } + +@@ -58,10 +58,10 @@ public class EnchantmentManager { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- Enchantment enchantment = (Enchantment) entry.getKey(); ++ Enchantment enchantment = entry.getKey(); + + if (enchantment != null) { +- int i = (Integer) entry.getValue(); ++ int i = entry.getValue(); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + nbttagcompound.setString("id", String.valueOf(IRegistry.ENCHANTMENT.getKey(enchantment))); +@@ -76,7 +76,7 @@ public class EnchantmentManager { + if (nbttaglist.isEmpty()) { + itemstack.removeTag("Enchantments"); + } else if (itemstack.getItem() != Items.ENCHANTED_BOOK) { +- itemstack.a("Enchantments", (NBTBase) nbttaglist); ++ itemstack.a("Enchantments", nbttaglist); + } + + } +@@ -267,14 +267,14 @@ public class EnchantmentManager { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- ItemStack itemstack = (ItemStack) entry.getValue(); ++ ItemStack itemstack = entry.getValue(); + + if (!itemstack.isEmpty() && getEnchantmentLevel(enchantment, itemstack) > 0 && predicate.test(itemstack)) { + list.add(entry); + } + } + +- return list.isEmpty() ? null : (Entry) list.get(entityliving.getRandom().nextInt(list.size())); ++ return list.isEmpty() ? null : list.get(entityliving.getRandom().nextInt(list.size())); + } + } + +diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java +index 18f4e2840ef517993b340efed560697ea50212a7..0946a7fcad7873caeba9492d77cee38a74e8ec70 100644 +--- a/src/main/java/net/minecraft/server/Enchantments.java ++++ b/src/main/java/net/minecraft/server/Enchantments.java +@@ -12,33 +12,33 @@ public class Enchantments { + public static final Enchantment WATER_WORKER = a("aqua_affinity", new EnchantmentWaterWorker(Enchantment.Rarity.RARE, Enchantments.M)); + public static final Enchantment THORNS = a("thorns", new EnchantmentThorns(Enchantment.Rarity.VERY_RARE, Enchantments.M)); + public static final Enchantment DEPTH_STRIDER = a("depth_strider", new EnchantmentDepthStrider(Enchantment.Rarity.RARE, Enchantments.M)); +- public static final Enchantment FROST_WALKER = a("frost_walker", new EnchantmentFrostWalker(Enchantment.Rarity.RARE, new EnumItemSlot[]{EnumItemSlot.FEET})); ++ public static final Enchantment FROST_WALKER = a("frost_walker", new EnchantmentFrostWalker(Enchantment.Rarity.RARE, EnumItemSlot.FEET)); + public static final Enchantment BINDING_CURSE = a("binding_curse", new EnchantmentBinding(Enchantment.Rarity.VERY_RARE, Enchantments.M)); +- public static final Enchantment SOUL_SPEED = a("soul_speed", new EnchantmentSoulSpeed(Enchantment.Rarity.VERY_RARE, new EnumItemSlot[]{EnumItemSlot.FEET})); +- public static final Enchantment DAMAGE_ALL = a("sharpness", new EnchantmentWeaponDamage(Enchantment.Rarity.COMMON, 0, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment DAMAGE_UNDEAD = a("smite", new EnchantmentWeaponDamage(Enchantment.Rarity.UNCOMMON, 1, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment DAMAGE_ARTHROPODS = a("bane_of_arthropods", new EnchantmentWeaponDamage(Enchantment.Rarity.UNCOMMON, 2, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment KNOCKBACK = a("knockback", new EnchantmentKnockback(Enchantment.Rarity.UNCOMMON, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment FIRE_ASPECT = a("fire_aspect", new EnchantmentFire(Enchantment.Rarity.RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment LOOT_BONUS_MOBS = a("looting", new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnchantmentSlotType.WEAPON, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment SWEEPING = a("sweeping", new EnchantmentSweeping(Enchantment.Rarity.RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment DIG_SPEED = a("efficiency", new EnchantmentDigging(Enchantment.Rarity.COMMON, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment SILK_TOUCH = a("silk_touch", new EnchantmentSilkTouch(Enchantment.Rarity.VERY_RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment DURABILITY = a("unbreaking", new EnchantmentDurability(Enchantment.Rarity.UNCOMMON, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment LOOT_BONUS_BLOCKS = a("fortune", new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnchantmentSlotType.DIGGER, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment ARROW_DAMAGE = a("power", new EnchantmentArrowDamage(Enchantment.Rarity.COMMON, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment ARROW_KNOCKBACK = a("punch", new EnchantmentArrowKnockback(Enchantment.Rarity.RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment ARROW_FIRE = a("flame", new EnchantmentFlameArrows(Enchantment.Rarity.RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment ARROW_INFINITE = a("infinity", new EnchantmentInfiniteArrows(Enchantment.Rarity.VERY_RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment LUCK = a("luck_of_the_sea", new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment LURE = a("lure", new EnchantmentLure(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment LOYALTY = a("loyalty", new EnchantmentTridentLoyalty(Enchantment.Rarity.UNCOMMON, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment IMPALING = a("impaling", new EnchantmentTridentImpaling(Enchantment.Rarity.RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment RIPTIDE = a("riptide", new EnchantmentTridentRiptide(Enchantment.Rarity.RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment CHANNELING = a("channeling", new EnchantmentTridentChanneling(Enchantment.Rarity.VERY_RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment MULTISHOT = a("multishot", new EnchantmentMultishot(Enchantment.Rarity.RARE, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment QUICK_CHARGE = a("quick_charge", new EnchantmentQuickCharge(Enchantment.Rarity.UNCOMMON, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); +- public static final Enchantment PIERCING = a("piercing", new EnchantmentPiercing(Enchantment.Rarity.COMMON, new EnumItemSlot[]{EnumItemSlot.MAINHAND})); ++ public static final Enchantment SOUL_SPEED = a("soul_speed", new EnchantmentSoulSpeed(Enchantment.Rarity.VERY_RARE, EnumItemSlot.FEET)); ++ public static final Enchantment DAMAGE_ALL = a("sharpness", new EnchantmentWeaponDamage(Enchantment.Rarity.COMMON, 0, EnumItemSlot.MAINHAND)); ++ public static final Enchantment DAMAGE_UNDEAD = a("smite", new EnchantmentWeaponDamage(Enchantment.Rarity.UNCOMMON, 1, EnumItemSlot.MAINHAND)); ++ public static final Enchantment DAMAGE_ARTHROPODS = a("bane_of_arthropods", new EnchantmentWeaponDamage(Enchantment.Rarity.UNCOMMON, 2, EnumItemSlot.MAINHAND)); ++ public static final Enchantment KNOCKBACK = a("knockback", new EnchantmentKnockback(Enchantment.Rarity.UNCOMMON, EnumItemSlot.MAINHAND)); ++ public static final Enchantment FIRE_ASPECT = a("fire_aspect", new EnchantmentFire(Enchantment.Rarity.RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment LOOT_BONUS_MOBS = a("looting", new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnchantmentSlotType.WEAPON, EnumItemSlot.MAINHAND)); ++ public static final Enchantment SWEEPING = a("sweeping", new EnchantmentSweeping(Enchantment.Rarity.RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment DIG_SPEED = a("efficiency", new EnchantmentDigging(Enchantment.Rarity.COMMON, EnumItemSlot.MAINHAND)); ++ public static final Enchantment SILK_TOUCH = a("silk_touch", new EnchantmentSilkTouch(Enchantment.Rarity.VERY_RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment DURABILITY = a("unbreaking", new EnchantmentDurability(Enchantment.Rarity.UNCOMMON, EnumItemSlot.MAINHAND)); ++ public static final Enchantment LOOT_BONUS_BLOCKS = a("fortune", new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnchantmentSlotType.DIGGER, EnumItemSlot.MAINHAND)); ++ public static final Enchantment ARROW_DAMAGE = a("power", new EnchantmentArrowDamage(Enchantment.Rarity.COMMON, EnumItemSlot.MAINHAND)); ++ public static final Enchantment ARROW_KNOCKBACK = a("punch", new EnchantmentArrowKnockback(Enchantment.Rarity.RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment ARROW_FIRE = a("flame", new EnchantmentFlameArrows(Enchantment.Rarity.RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment ARROW_INFINITE = a("infinity", new EnchantmentInfiniteArrows(Enchantment.Rarity.VERY_RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment LUCK = a("luck_of_the_sea", new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, EnumItemSlot.MAINHAND)); ++ public static final Enchantment LURE = a("lure", new EnchantmentLure(Enchantment.Rarity.RARE, EnchantmentSlotType.FISHING_ROD, EnumItemSlot.MAINHAND)); ++ public static final Enchantment LOYALTY = a("loyalty", new EnchantmentTridentLoyalty(Enchantment.Rarity.UNCOMMON, EnumItemSlot.MAINHAND)); ++ public static final Enchantment IMPALING = a("impaling", new EnchantmentTridentImpaling(Enchantment.Rarity.RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment RIPTIDE = a("riptide", new EnchantmentTridentRiptide(Enchantment.Rarity.RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment CHANNELING = a("channeling", new EnchantmentTridentChanneling(Enchantment.Rarity.VERY_RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment MULTISHOT = a("multishot", new EnchantmentMultishot(Enchantment.Rarity.RARE, EnumItemSlot.MAINHAND)); ++ public static final Enchantment QUICK_CHARGE = a("quick_charge", new EnchantmentQuickCharge(Enchantment.Rarity.UNCOMMON, EnumItemSlot.MAINHAND)); ++ public static final Enchantment PIERCING = a("piercing", new EnchantmentPiercing(Enchantment.Rarity.COMMON, EnumItemSlot.MAINHAND)); + public static final Enchantment MENDING = a("mending", new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values())); + public static final Enchantment VANISHING_CURSE = a("vanishing_curse", new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values())); + +@@ -51,6 +51,6 @@ public class Enchantments { + // CraftBukkit end + + private static Enchantment a(String s, Enchantment enchantment) { +- return (Enchantment) IRegistry.a(IRegistry.ENCHANTMENT, s, enchantment); // CraftBukkit - decompile error ++ return IRegistry.a(IRegistry.ENCHANTMENT, s, enchantment); // CraftBukkit - decompile error + } + } +diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java +index 589f00d27255aa1b227fea7c19a27862321c83ef..8d704794e644d269e72492213ac427f0445b3e82 100644 +--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java ++++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java +@@ -159,7 +159,7 @@ public class EnderDragonBattle { + if (list.isEmpty()) { + this.dragonKilled = true; + } else { +- EntityEnderDragon entityenderdragon = (EntityEnderDragon) list.get(0); ++ EntityEnderDragon entityenderdragon = list.get(0); + + this.dragonUUID = entityenderdragon.getUniqueID(); + EnderDragonBattle.LOGGER.info("Found that there's a dragon still alive ({})", entityenderdragon); +@@ -185,7 +185,7 @@ public class EnderDragonBattle { + this.o(); + } else { + EnderDragonBattle.LOGGER.debug("Haven't seen our dragon, but found another one to use."); +- this.dragonUUID = ((EntityEnderDragon) list.get(0)).getUniqueID(); ++ this.dragonUUID = list.get(0).getUniqueID(); + } + + } +@@ -204,7 +204,7 @@ public class EnderDragonBattle { + while (iterator.hasNext()) { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); + +- CriterionTriggers.n.a(entityplayer, (Entity) entityenderdragon); ++ CriterionTriggers.n.a(entityplayer, entityenderdragon); + } + } else { + this.respawnPhase = enumdragonrespawn; +@@ -337,7 +337,7 @@ public class EnderDragonBattle { + + WorldGenEnder.Spike worldgenender_spike; + +- for (Iterator iterator = WorldGenEnder.a((GeneratorAccessSeed) this.world).iterator(); iterator.hasNext(); this.h += this.world.a(EntityEnderCrystal.class, worldgenender_spike.f()).size()) { ++ for (Iterator iterator = WorldGenEnder.a(this.world).iterator(); iterator.hasNext(); this.h += this.world.a(EntityEnderCrystal.class, worldgenender_spike.f()).size()) { + worldgenender_spike = (WorldGenEnder.Spike) iterator.next(); + } + +@@ -362,7 +362,7 @@ public class EnderDragonBattle { + + private void n() { + if (!this.gateways.isEmpty()) { +- int i = (Integer) this.gateways.remove(this.gateways.size() - 1); ++ int i = this.gateways.remove(this.gateways.size() - 1); + int j = MathHelper.floor(96.0D * Math.cos(2.0D * (-3.141592653589793D + 0.15707963267948966D * (double) i))); + int k = MathHelper.floor(96.0D * Math.sin(2.0D * (-3.141592653589793D + 0.15707963267948966D * (double) i))); + +@@ -389,7 +389,7 @@ public class EnderDragonBattle { + + private EntityEnderDragon o() { + this.world.getChunkAtWorldCoords(new BlockPosition(0, 128, 0)); +- EntityEnderDragon entityenderdragon = (EntityEnderDragon) EntityTypes.ENDER_DRAGON.a((World) this.world); ++ EntityEnderDragon entityenderdragon = EntityTypes.ENDER_DRAGON.a(this.world); + + entityenderdragon.getDragonControllerManager().setControllerPhase(DragonControllerPhase.HOLDING_PATTERN); + entityenderdragon.setPositionRotation(0.0D, 128.0D, 0.0D, this.world.random.nextFloat() * 360.0F, 0.0F); +@@ -469,7 +469,7 @@ public class EnderDragonBattle { + } + + EnderDragonBattle.LOGGER.debug("Found all crystals, respawning dragon."); +- this.a((List) list); ++ this.a(list); + } + + } +@@ -499,7 +499,7 @@ public class EnderDragonBattle { + } + + public void resetCrystals() { +- Iterator iterator = WorldGenEnder.a((GeneratorAccessSeed) this.world).iterator(); ++ Iterator iterator = WorldGenEnder.a(this.world).iterator(); + + while (iterator.hasNext()) { + WorldGenEnder.Spike worldgenender_spike = (WorldGenEnder.Spike) iterator.next(); +@@ -510,7 +510,7 @@ public class EnderDragonBattle { + EntityEnderCrystal entityendercrystal = (EntityEnderCrystal) iterator1.next(); + + entityendercrystal.setInvulnerable(false); +- entityendercrystal.setBeamTarget((BlockPosition) null); ++ entityendercrystal.setBeamTarget(null); + } + } + +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index 1779f7756a7093b558bcfc7ce96559558b911a92..f08eda377f29215df18e8a030c6e6e9a69130c62 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -202,7 +202,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + // Tuinity start + public final AxisAlignedBB getBoundingBoxAt(double x, double y, double z) { + double widthHalf = (double)this.size.width / 2.0; +- double height = (double)this.size.height; ++ double height = this.size.height; + return new AxisAlignedBB(x - widthHalf, y, z - widthHalf, x + widthHalf, y + height, z + widthHalf); + } + // Tuinity end +@@ -382,7 +382,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public EntityPose getPose() { +- return (EntityPose) this.datawatcher.get(Entity.POSE); ++ return this.datawatcher.get(Entity.POSE); + } + + public boolean a(Entity entity, double d0) { +@@ -716,7 +716,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + Block block = iblockdata.getBlock(); + + if (vec3d.y != vec3d1.y) { +- block.a((IBlockAccess) this.world, this); ++ block.a(this.world, this); + } + + // CraftBukkit start +@@ -750,7 +750,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + double d1 = vec3d1.y; + double d2 = vec3d1.z; + +- if (!block.a((Tag) TagsBlock.CLIMBABLE)) { ++ if (!block.a(TagsBlock.CLIMBABLE)) { + d1 = 0.0D; + } + +@@ -790,9 +790,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + + float f2 = this.getBlockSpeedFactor(); + +- this.setMot(this.getMot().d((double) f2, 1.0D, (double) f2)); ++ this.setMot(this.getMot().d(f2, 1.0D, f2)); + if (this.world.c(this.getBoundingBox().shrink(0.001D)).noneMatch((iblockdata1) -> { +- return iblockdata1.a((Tag) TagsBlock.FIRE) || iblockdata1.a(Blocks.LAVA); ++ return iblockdata1.a(TagsBlock.FIRE) || iblockdata1.a(Blocks.LAVA); + }) && this.fireTicks <= 0) { + this.setFireTicks(-this.getMaxFireTicks()); + } +@@ -824,7 +824,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + IBlockData iblockdata = this.world.getType(blockposition1); + Block block = iblockdata.getBlock(); + +- if (block.a((Tag) TagsBlock.FENCES) || block.a((Tag) TagsBlock.WALLS) || block instanceof BlockFenceGate) { ++ if (block.a(TagsBlock.FENCES) || block.a(TagsBlock.WALLS) || block instanceof BlockFenceGate) { + return blockposition1; + } + } +@@ -974,7 +974,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + List potentialCollisions = com.tuinity.tuinity.util.CachedLists.getTempCollisionList(); + try { + AxisAlignedBB collisionBox; +- double stepHeight = (double)this.getStepHeight(); ++ double stepHeight = this.getStepHeight(); + if (stepHeight > 0.0 && (this.onGround || (moveVector.y < 0.0)) && (moveVector.x != 0.0 || moveVector.z != 0.0)) { + // don't bother getting the collisions if we don't need them. + if (moveVector.y <= 0.0) { +@@ -1033,8 +1033,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + boolean flag3 = this.onGround || flag1 && vec3d.y < 0.0D; + + if (this.G > 0.0F && flag3 && (flag || flag2)) { +- Vec3D vec3d2 = a(this, new Vec3D(vec3d.x, (double) this.G, vec3d.z), axisalignedbb, this.world, voxelshapecollision, streamaccumulator); +- Vec3D vec3d3 = a(this, new Vec3D(0.0D, (double) this.G, 0.0D), axisalignedbb.b(vec3d.x, 0.0D, vec3d.z), this.world, voxelshapecollision, streamaccumulator); ++ Vec3D vec3d2 = a(this, new Vec3D(vec3d.x, this.G, vec3d.z), axisalignedbb, this.world, voxelshapecollision, streamaccumulator); ++ Vec3D vec3d3 = a(this, new Vec3D(0.0D, this.G, 0.0D), axisalignedbb.b(vec3d.x, 0.0D, vec3d.z), this.world, voxelshapecollision, streamaccumulator); + + if (vec3d3.y < (double) this.G) { + Vec3D vec3d4 = a(this, new Vec3D(vec3d.x, 0.0D, vec3d.z), axisalignedbb.c(vec3d3), this.world, voxelshapecollision, streamaccumulator).e(vec3d3); +@@ -1219,13 +1219,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + + public void playSound(SoundEffect soundeffect, float f, float f1) { + if (!this.isSilent()) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), soundeffect, this.getSoundCategory(), f, f1); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), soundeffect, this.getSoundCategory(), f, f1); + } + + } + + public boolean isSilent() { +- return (Boolean) this.datawatcher.get(Entity.az); ++ return this.datawatcher.get(Entity.az); + } + + public void setSilent(boolean flag) { +@@ -1233,7 +1233,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public boolean isNoGravity() { +- return (Boolean) this.datawatcher.get(Entity.aA); ++ return this.datawatcher.get(Entity.aA); + } + + public void setNoGravity(boolean flag) { +@@ -1291,7 +1291,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + public boolean isInRain() { // Paper - private -> public + BlockPosition blockposition = this.getChunkCoordinates(); + +- return this.world.isRainingAt(blockposition) || this.world.isRainingAt(blockposition.a(0.0D, (double) this.size.height, 0.0D)); ++ return this.world.isRainingAt(blockposition) || this.world.isRainingAt(blockposition.a(0.0D, this.size.height, 0.0D)); + } + + public final boolean isInBubbleColumn() { return k(); } // Paper - OBFHELPER +@@ -1334,14 +1334,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } else { + double d0 = this.world.getDimensionManager().isNether() ? 0.007D : 0.0023333333333333335D; + +- return this.a((Tag) TagsFluid.LAVA, d0); ++ return this.a(TagsFluid.LAVA, d0); + } + } + + void aH() { + if (this.getVehicle() instanceof EntityBoat) { + this.inWater = false; +- } else if (this.a((Tag) TagsFluid.WATER, 0.014D)) { ++ } else if (this.a(TagsFluid.WATER, 0.014D)) { + if (!this.inWater && !this.justCreated) { + this.aI(); + } +@@ -1356,7 +1356,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + private void n() { +- this.N = this.a((Tag) TagsFluid.WATER); ++ this.N = this.a(TagsFluid.WATER); + this.O = null; + double d0 = this.getHeadY() - 0.1111111119389534D; + Vec3D vec3d = new Vec3D(this.locX(), d0, this.locZ()); +@@ -1384,7 +1384,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + tag = (Tag) iterator.next(); + } while (!fluid.a(tag)); + +- double d1 = (double) ((float) blockposition.getY() + fluid.getHeight(this.world, blockposition)); ++ double d1 = (float) blockposition.getY() + fluid.getHeight(this.world, blockposition); + + if (d1 > d0) { + this.O = tag; +@@ -1417,13 +1417,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + for (i = 0; (float) i < 1.0F + this.size.width * 20.0F; ++i) { + d0 = (this.random.nextDouble() * 2.0D - 1.0D) * (double) this.size.width; + d1 = (this.random.nextDouble() * 2.0D - 1.0D) * (double) this.size.width; +- this.world.addParticle(Particles.BUBBLE, this.locX() + d0, (double) (f2 + 1.0F), this.locZ() + d1, vec3d.x, vec3d.y - this.random.nextDouble() * 0.20000000298023224D, vec3d.z); ++ this.world.addParticle(Particles.BUBBLE, this.locX() + d0, f2 + 1.0F, this.locZ() + d1, vec3d.x, vec3d.y - this.random.nextDouble() * 0.20000000298023224D, vec3d.z); + } + + for (i = 0; (float) i < 1.0F + this.size.width * 20.0F; ++i) { + d0 = (this.random.nextDouble() * 2.0D - 1.0D) * (double) this.size.width; + d1 = (this.random.nextDouble() * 2.0D - 1.0D) * (double) this.size.width; +- this.world.addParticle(Particles.SPLASH, this.locX() + d0, (double) (f2 + 1.0F), this.locZ() + d1, vec3d.x, vec3d.y, vec3d.z); ++ this.world.addParticle(Particles.SPLASH, this.locX() + d0, f2 + 1.0F, this.locZ() + d1, vec3d.x, vec3d.y, vec3d.z); + } + + } +@@ -1530,7 +1530,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public void setPositionRotation(BlockPosition blockposition, float f, float f1) { +- this.setPositionRotation((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, f, f1); ++ this.setPositionRotation((double) blockposition.getX() + 0.5D, blockposition.getY(), (double) blockposition.getZ() + 0.5D, f, f1); + } + + public void setPositionRotation(double d0, double d1, double d2, float f, float f1) { +@@ -1589,7 +1589,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + double d2 = MathHelper.a(d0, d1); + + if (d2 >= 0.009999999776482582D) { +- d2 = (double) MathHelper.sqrt(d2); ++ d2 = MathHelper.sqrt(d2); + d0 /= d2; + d1 /= d2; + double d3 = 1.0D / d2; +@@ -1602,8 +1602,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + d1 *= d3; + d0 *= 0.05000000074505806D; + d1 *= 0.05000000074505806D; +- d0 *= (double) (1.0F - this.I); +- d1 *= (double) (1.0F - this.I); ++ d0 *= 1.0F - this.I; ++ d1 *= 1.0F - this.I; + if (!this.isVehicle()) { + this.h(-d0, 0.0D, -d1); + } +@@ -1655,7 +1655,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + float f6 = MathHelper.cos(f2); + float f7 = MathHelper.sin(f2); + +- return new Vec3D((double) (f5 * f6), (double) (-f7), (double) (f4 * f6)); ++ return new Vec3D(f5 * f6, -f7, f4 * f6); + } + + public final Vec3D i(float f) { +@@ -1671,9 +1671,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + if (f == 1.0F) { + return new Vec3D(this.locX(), this.getHeadY(), this.locZ()); + } else { +- double d0 = MathHelper.d((double) f, this.lastX, this.locX()); +- double d1 = MathHelper.d((double) f, this.lastY, this.locY()) + (double) this.getHeadHeight(); +- double d2 = MathHelper.d((double) f, this.lastZ, this.locZ()); ++ double d0 = MathHelper.d(f, this.lastX, this.locX()); ++ double d1 = MathHelper.d(f, this.lastY, this.locY()) + (double) this.getHeadHeight(); ++ double d2 = MathHelper.d(f, this.lastZ, this.locZ()); + + return new Vec3D(d0, d1, d2); + } +@@ -1758,8 +1758,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + nbttagcompound.a("UUID", this.getUniqueID()); + // CraftBukkit start + // PAIL: Check above UUID reads 1.8 properly, ie: UUIDMost / UUIDLeast +- nbttagcompound.setLong("WorldUUIDLeast", ((WorldServer) this.world).getWorld().getUID().getLeastSignificantBits()); +- nbttagcompound.setLong("WorldUUIDMost", ((WorldServer) this.world).getWorld().getUID().getMostSignificantBits()); ++ nbttagcompound.setLong("WorldUUIDLeast", this.world.getWorld().getUID().getLeastSignificantBits()); ++ nbttagcompound.setLong("WorldUUIDMost", this.world.getWorld().getUID().getMostSignificantBits()); + nbttagcompound.setInt("Bukkit.updateLevel", CURRENT_LEVEL); + nbttagcompound.setInt("Spigot.ticksLived", this.ticksLived); + // CraftBukkit end +@@ -1879,7 +1879,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + if (Double.isFinite(this.locX()) && Double.isFinite(this.locY()) && Double.isFinite(this.locZ())) { +- if (Double.isFinite((double) this.yaw) && Double.isFinite((double) this.pitch)) { ++ if (Double.isFinite(this.yaw) && Double.isFinite(this.pitch)) { + this.ac(); + this.setYawPitch(this.yaw, this.pitch); + if (nbttagcompound.hasKeyOfType("CustomName", 8)) { +@@ -2133,7 +2133,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } else { + float f = 0.1F; + float f1 = this.size.width * 0.8F; +- AxisAlignedBB axisalignedbb = AxisAlignedBB.g((double) f1, 0.10000000149011612D, (double) f1).d(this.locX(), this.getHeadY(), this.locZ()); ++ AxisAlignedBB axisalignedbb = AxisAlignedBB.g(f1, 0.10000000149011612D, f1).d(this.locX(), this.getHeadY(), this.locZ()); + + return this.world.a(this, axisalignedbb, (iblockdata, blockposition) -> { + return iblockdata.o(this.world, blockposition); +@@ -2214,7 +2214,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + + public void ejectPassengers() { + for (int i = this.passengers.size() - 1; i >= 0; --i) { +- ((Entity) this.passengers.get(i)).stopRiding(); ++ this.passengers.get(i).stopRiding(); + } + + } +@@ -2351,7 +2351,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = BlockPortal.c((GeneratorAccess) this.world, this.ah); + double d0 = shapedetector_shapedetectorcollection.getFacing().n() == EnumDirection.EnumAxis.X ? (double) shapedetector_shapedetectorcollection.a().getZ() : (double) shapedetector_shapedetectorcollection.a().getX(); + double d1 = MathHelper.a(Math.abs(MathHelper.c((shapedetector_shapedetectorcollection.getFacing().n() == EnumDirection.EnumAxis.X ? this.locZ() : this.locX()) - (double) (shapedetector_shapedetectorcollection.getFacing().g().e() == EnumDirection.EnumAxisDirection.NEGATIVE ? 1 : 0), d0, d0 - (double) shapedetector_shapedetectorcollection.d())), 0.0D, 1.0D); +- double d2 = MathHelper.a(MathHelper.c(this.locY() - 1.0D, (double) shapedetector_shapedetectorcollection.a().getY(), (double) (shapedetector_shapedetectorcollection.a().getY() - shapedetector_shapedetectorcollection.e())), 0.0D, 1.0D); ++ double d2 = MathHelper.a(MathHelper.c(this.locY() - 1.0D, shapedetector_shapedetectorcollection.a().getY(), shapedetector_shapedetectorcollection.a().getY() - shapedetector_shapedetectorcollection.e()), 0.0D, 1.0D); + + this.ai = new Vec3D(d1, d2, 0.0D); + this.aj = shapedetector_shapedetectorcollection.getFacing(); +@@ -2526,11 +2526,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public boolean getFlag(int i) { +- return ((Byte) this.datawatcher.get(Entity.T) & 1 << i) != 0; ++ return (this.datawatcher.get(Entity.T) & 1 << i) != 0; + } + + public void setFlag(int i, boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(Entity.T); ++ byte b0 = this.datawatcher.get(Entity.T); + + if (flag) { + this.datawatcher.set(Entity.T, (byte) (b0 | 1 << i)); +@@ -2546,7 +2546,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public int getAirTicks() { +- return (Integer) this.datawatcher.get(Entity.AIR_TICKS); ++ return this.datawatcher.get(Entity.AIR_TICKS); + } + + public void setAirTicks(int i) { +@@ -2644,7 +2644,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + for (int j = 0; j < i; ++j) { + EnumDirection enumdirection1 = aenumdirection[j]; + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection1); ++ blockposition_mutableblockposition.a(blockposition, enumdirection1); + if (!this.world.getType(blockposition_mutableblockposition).r(this.world, blockposition_mutableblockposition)) { + double d4 = vec3d.a(enumdirection1.n()); + double d5 = enumdirection1.e() == EnumDirection.EnumAxisDirection.POSITIVE ? 1.0D - d4 : d4; +@@ -2661,11 +2661,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + Vec3D vec3d1 = this.getMot().a(0.75D); + + if (enumdirection.n() == EnumDirection.EnumAxis.X) { +- this.setMot((double) (f1 * f), vec3d1.y, vec3d1.z); ++ this.setMot(f1 * f, vec3d1.y, vec3d1.z); + } else if (enumdirection.n() == EnumDirection.EnumAxis.Y) { +- this.setMot(vec3d1.x, (double) (f1 * f), vec3d1.z); ++ this.setMot(vec3d1.x, f1 * f, vec3d1.z); + } else if (enumdirection.n() == EnumDirection.EnumAxis.Z) { +- this.setMot(vec3d1.x, vec3d1.y, (double) (f1 * f)); ++ this.setMot(vec3d1.x, vec3d1.y, f1 * f); + } + + } +@@ -2676,7 +2676,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + private static IChatBaseComponent b(IChatBaseComponent ichatbasecomponent) { +- IChatMutableComponent ichatmutablecomponent = ichatbasecomponent.f().setChatModifier(ichatbasecomponent.getChatModifier().setChatClickable((ChatClickable) null)); ++ IChatMutableComponent ichatmutablecomponent = ichatbasecomponent.f().setChatModifier(ichatbasecomponent.getChatModifier().setChatClickable(null)); + Iterator iterator = ichatbasecomponent.getSiblings().iterator(); + + while (iterator.hasNext()) { +@@ -2720,7 +2720,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public String toString() { +- return String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cx=%d, cz=%d, tl=%d, v=%b, d=%b]", new Object[] { this.getClass().getSimpleName(), this.getDisplayName().getString(), Integer.valueOf(this.id), this.uniqueID.toString(), this.world == null ? "~NULL~" : this.world.toString(), Double.valueOf(this.locX()), Double.valueOf(this.locY()), Double.valueOf(this.locZ()), chunkX, chunkZ, this.ticksLived, this.valid, this.dead}); // Paper - add more information ++ return String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cx=%d, cz=%d, tl=%d, v=%b, d=%b]", this.getClass().getSimpleName(), this.getDisplayName().getString(), Integer.valueOf(this.id), this.uniqueID.toString(), this.world == null ? "~NULL~" : this.world.toString(), Double.valueOf(this.locX()), Double.valueOf(this.locY()), Double.valueOf(this.locZ()), chunkX, chunkZ, this.ticksLived, this.valid, this.dead); // Paper - add more information + } + + public boolean isInvulnerable(DamageSource damagesource) { +@@ -2853,7 +2853,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + // CraftBukkit end + + //this.world.getMethodProfiler().exitEnter("reloading"); // Akarin - remove caller +- Entity entity = this.getEntityType().a((World) worldserver); ++ Entity entity = this.getEntityType().a(worldserver); + + if (entity != null) { + entity.v(this); +@@ -2920,15 +2920,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + crashreportsystemdetails.a("Entity Type", () -> { + return EntityTypes.getName(this.getEntityType()) + " (" + this.getClass().getCanonicalName() + ")"; + }); +- crashreportsystemdetails.a("Entity ID", (Object) this.id); ++ crashreportsystemdetails.a("Entity ID", this.id); + crashreportsystemdetails.a("Entity Name", () -> { + return this.getDisplayName().getString(); + }); +- crashreportsystemdetails.a("Entity's Exact location", (Object) String.format(Locale.ROOT, "%.2f, %.2f, %.2f", this.locX(), this.locY(), this.locZ())); +- crashreportsystemdetails.a("Entity's Block location", (Object) CrashReportSystemDetails.a(MathHelper.floor(this.locX()), MathHelper.floor(this.locY()), MathHelper.floor(this.locZ()))); ++ crashreportsystemdetails.a("Entity's Exact location", String.format(Locale.ROOT, "%.2f, %.2f, %.2f", this.locX(), this.locY(), this.locZ())); ++ crashreportsystemdetails.a("Entity's Block location", CrashReportSystemDetails.a(MathHelper.floor(this.locX()), MathHelper.floor(this.locY()), MathHelper.floor(this.locZ()))); + Vec3D vec3d = this.getMot(); + +- crashreportsystemdetails.a("Entity's Momentum", (Object) String.format(Locale.ROOT, "%.2f, %.2f, %.2f", vec3d.x, vec3d.y, vec3d.z)); ++ crashreportsystemdetails.a("Entity's Momentum", String.format(Locale.ROOT, "%.2f, %.2f, %.2f", vec3d.x, vec3d.y, vec3d.z)); + crashreportsystemdetails.a("Entity's Passengers", () -> { + return this.getPassengers().toString(); + }); +@@ -2979,12 +2979,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + @Nullable + @Override + public IChatBaseComponent getCustomName() { +- return (IChatBaseComponent) ((Optional) this.datawatcher.get(Entity.ax)).orElse((Object) null); ++ return (IChatBaseComponent) ((Optional) this.datawatcher.get(Entity.ax)).orElse(null); + } + + @Override + public boolean hasCustomName() { +- return ((Optional) this.datawatcher.get(Entity.ax)).isPresent(); ++ return this.datawatcher.get(Entity.ax).isPresent(); + } + + public void setCustomNameVisible(boolean flag) { +@@ -2992,7 +2992,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public boolean getCustomNameVisible() { +- return (Boolean) this.datawatcher.get(Entity.ay); ++ return this.datawatcher.get(Entity.ay); + } + + public final void enderTeleportAndLoad(double d0, double d1, double d2) { +@@ -3050,14 +3050,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + if (entitysize1.width > entitysize.width && !this.justCreated && !this.world.isClientSide) { + float f = entitysize.width - entitysize1.width; + +- this.move(EnumMoveType.SELF, new Vec3D((double) f, 0.0D, (double) f)); ++ this.move(EnumMoveType.SELF, new Vec3D(f, 0.0D, f)); + } + + } + } + + public EnumDirection getDirection() { +- return EnumDirection.fromAngle((double) this.yaw); ++ return EnumDirection.fromAngle(this.yaw); + } + + public EnumDirection getAdjustedDirection() { +@@ -3143,7 +3143,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + + public void a(EntityLiving entityliving, Entity entity) { + if (entity instanceof EntityLiving) { +- EnchantmentManager.a((EntityLiving) entity, (Entity) entityliving); ++ EnchantmentManager.a((EntityLiving) entity, entityliving); + } + + EnchantmentManager.b(entityliving, entity); +@@ -3367,7 +3367,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + double d0 = vec3d.x - vec3d1.x; + double d1 = vec3d.y - vec3d1.y; + double d2 = vec3d.z - vec3d1.z; +- double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); ++ double d3 = MathHelper.sqrt(d0 * d0 + d2 * d2); + + this.pitch = MathHelper.g((float) (-(MathHelper.d(d1, d3) * 57.2957763671875D))); + this.yaw = MathHelper.g((float) (MathHelper.d(d2, d0) * 57.2957763671875D) - 90.0F); +@@ -3402,7 +3402,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + Fluid fluid = this.world.getFluid(blockposition_mutableblockposition); + + if (fluid.a(tag)) { +- double d2 = (double) ((float) i2 + fluid.getHeight(this.world, blockposition_mutableblockposition)); ++ double d2 = (float) i2 + fluid.getHeight(this.world, blockposition_mutableblockposition); + + if (d2 >= axisalignedbb.minY) { + flag1 = true; +diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java +index d861a96b4cb5a5480deb93708207002da782bb51..c74a1ff9ad27b3aeb2dfe73fb20b336e5da523be 100644 +--- a/src/main/java/net/minecraft/server/EntityAgeable.java ++++ b/src/main/java/net/minecraft/server/EntityAgeable.java +@@ -52,7 +52,7 @@ public abstract class EntityAgeable extends EntityCreature { + } + + entityageable_a.b(); +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + @Nullable +@@ -69,7 +69,7 @@ public abstract class EntityAgeable extends EntityCreature { + } + + public int getAge() { +- return this.world.isClientSide ? ((Boolean) this.datawatcher.get(EntityAgeable.bv) ? -1 : 1) : this.b; ++ return this.world.isClientSide ? (this.datawatcher.get(EntityAgeable.bv) ? -1 : 1) : this.b; + } + + public void setAge(int i, boolean flag) { +diff --git a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java +index 5a9157697e9b3b9dbd78aa20561c030957fd1243..3d152828b6a9ca8d8e3c503f4051ae6653a56ec5 100644 +--- a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java ++++ b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java +@@ -77,7 +77,7 @@ public class EntityAreaEffectCloud extends Entity { + } + + public float getRadius() { +- return (Float) this.getDataWatcher().get(EntityAreaEffectCloud.c); ++ return this.getDataWatcher().get(EntityAreaEffectCloud.c); + } + + public void a(PotionRegistry potionregistry) { +@@ -92,7 +92,7 @@ public class EntityAreaEffectCloud extends Entity { + if (this.potionRegistry == Potions.EMPTY && this.effects.isEmpty()) { + this.getDataWatcher().set(EntityAreaEffectCloud.COLOR, 0); + } else { +- this.getDataWatcher().set(EntityAreaEffectCloud.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))); ++ this.getDataWatcher().set(EntityAreaEffectCloud.COLOR, PotionUtil.a(PotionUtil.a(this.potionRegistry, this.effects))); + } + + } +@@ -108,12 +108,12 @@ public class EntityAreaEffectCloud extends Entity { + // CraftBukkit start accessor methods + public void refreshEffects() { + if (!this.hasColor) { +- this.getDataWatcher().set(EntityAreaEffectCloud.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))); // PAIL: rename ++ this.getDataWatcher().set(EntityAreaEffectCloud.COLOR, PotionUtil.a(PotionUtil.a(this.potionRegistry, this.effects))); // PAIL: rename + } + } + + public String getType() { +- return ((MinecraftKey) IRegistry.POTION.getKey(this.potionRegistry)).toString(); ++ return IRegistry.POTION.getKey(this.potionRegistry).toString(); + } + + public void setType(String string) { +@@ -122,7 +122,7 @@ public class EntityAreaEffectCloud extends Entity { + // CraftBukkit end + + public int getColor() { +- return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.COLOR); ++ return this.getDataWatcher().get(EntityAreaEffectCloud.COLOR); + } + + public void setColor(int i) { +@@ -131,7 +131,7 @@ public class EntityAreaEffectCloud extends Entity { + } + + public ParticleParam getParticle() { +- return (ParticleParam) this.getDataWatcher().get(EntityAreaEffectCloud.f); ++ return this.getDataWatcher().get(EntityAreaEffectCloud.f); + } + + public void setParticle(ParticleParam particleparam) { +@@ -143,7 +143,7 @@ public class EntityAreaEffectCloud extends Entity { + } + + public boolean k() { +- return (Boolean) this.getDataWatcher().get(EntityAreaEffectCloud.e); ++ return this.getDataWatcher().get(EntityAreaEffectCloud.e); + } + + public int getDuration() { +@@ -201,7 +201,7 @@ public class EntityAreaEffectCloud extends Entity { + i = i1 >> 16 & 255; + j = i1 >> 8 & 255; + k = i1 & 255; +- this.world.b(particleparam, this.locX() + (double) f2, this.locY(), this.locZ() + (double) f3, (double) ((float) i / 255.0F), (double) ((float) j / 255.0F), (double) ((float) k / 255.0F)); ++ this.world.b(particleparam, this.locX() + (double) f2, this.locY(), this.locZ() + (double) f3, (float) i / 255.0F, (float) j / 255.0F, (float) k / 255.0F); + } else { + this.world.b(particleparam, this.locX() + (double) f2, this.locY(), this.locZ() + (double) f3, 0.0D, 0.0D, 0.0D); + } +@@ -222,7 +222,7 @@ public class EntityAreaEffectCloud extends Entity { + k = i >> 8 & 255; + int k1 = i & 255; + +- this.world.b(particleparam, this.locX() + (double) f3, this.locY(), this.locZ() + (double) f6, (double) ((float) j / 255.0F), (double) ((float) k / 255.0F), (double) ((float) k1 / 255.0F)); ++ this.world.b(particleparam, this.locX() + (double) f3, this.locY(), this.locZ() + (double) f6, (float) j / 255.0F, (float) k / 255.0F, (float) k1 / 255.0F); + } else { + this.world.b(particleparam, this.locX() + (double) f3, this.locY(), this.locZ() + (double) f6, (0.5D - this.random.nextDouble()) * 0.15D, 0.009999999776482582D, (0.5D - this.random.nextDouble()) * 0.15D); + } +@@ -260,7 +260,7 @@ public class EntityAreaEffectCloud extends Entity { + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); + +- if (this.ticksLived >= (Integer) entry.getValue()) { ++ if (this.ticksLived >= entry.getValue()) { + iterator.remove(); + } + } +diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java +index c4257b33f28a8cb6c99ad34d9226422e5ef4bfc0..dd2cf406d3b734340305abc1283db1a1f716ea15 100644 +--- a/src/main/java/net/minecraft/server/EntityArmorStand.java ++++ b/src/main/java/net/minecraft/server/EntityArmorStand.java +@@ -121,9 +121,9 @@ public class EntityArmorStand extends EntityLiving { + public ItemStack getEquipment(EnumItemSlot enumitemslot) { + switch (enumitemslot.a()) { + case HAND: +- return (ItemStack) this.handItems.get(enumitemslot.b()); ++ return this.handItems.get(enumitemslot.b()); + case ARMOR: +- return (ItemStack) this.armorItems.get(enumitemslot.b()); ++ return this.armorItems.get(enumitemslot.b()); + default: + return ItemStack.b; + } +@@ -329,7 +329,7 @@ public class EntityArmorStand extends EntityLiving { + List list = this.world.getEntities(this, this.getBoundingBox(), EntityArmorStand.bw); + + for (int i = 0; i < list.size(); ++i) { +- Entity entity = (Entity) list.get(i); ++ Entity entity = list.get(i); + + if (this.h(entity) <= 0.2D) { + entity.collide(this); +@@ -523,7 +523,7 @@ public class EntityArmorStand extends EntityLiving { + + private void D() { + if (this.world instanceof WorldServer) { +- ((WorldServer) this.world).a(new ParticleParamBlock(Particles.BLOCK, Blocks.OAK_PLANKS.getBlockData()), this.locX(), this.e(0.6666666666666666D), this.locZ(), 10, (double) (this.getWidth() / 4.0F), (double) (this.getHeight() / 4.0F), (double) (this.getWidth() / 4.0F), 0.05D); ++ ((WorldServer) this.world).a(new ParticleParamBlock(Particles.BLOCK, Blocks.OAK_PLANKS.getBlockData()), this.locX(), this.e(0.6666666666666666D), this.locZ(), 10, this.getWidth() / 4.0F, this.getHeight() / 4.0F, this.getWidth() / 4.0F, 0.05D); + } + + } +@@ -554,7 +554,7 @@ public class EntityArmorStand extends EntityLiving { + int i; + + for (i = 0; i < this.handItems.size(); ++i) { +- itemstack = (ItemStack) this.handItems.get(i); ++ itemstack = this.handItems.get(i); + if (!itemstack.isEmpty()) { + drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)); // CraftBukkit - add to drops // Paper - mirror so we can destroy it later - though this call site was safe + this.handItems.set(i, ItemStack.b); +@@ -562,7 +562,7 @@ public class EntityArmorStand extends EntityLiving { + } + + for (i = 0; i < this.armorItems.size(); ++i) { +- itemstack = (ItemStack) this.armorItems.get(i); ++ itemstack = this.armorItems.get(i); + if (!itemstack.isEmpty()) { + drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)); // CraftBukkit - add to drops // Paper - mirror so we can destroy it later - though this call site was safe + this.armorItems.set(i, ItemStack.b); +@@ -573,7 +573,7 @@ public class EntityArmorStand extends EntityLiving { + } + + private void F() { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_ARMOR_STAND_BREAK, this.getSoundCategory(), 1.0F, 1.0F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_ARMOR_STAND_BREAK, this.getSoundCategory(), 1.0F, 1.0F); + } + + @Override +@@ -637,37 +637,37 @@ public class EntityArmorStand extends EntityLiving { + + public void updatePose() { + // Paper end +- Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.c); ++ Vector3f vector3f = this.datawatcher.get(EntityArmorStand.c); + + if (!this.headPose.equals(vector3f)) { + this.setHeadPose(vector3f); + } + +- Vector3f vector3f1 = (Vector3f) this.datawatcher.get(EntityArmorStand.d); ++ Vector3f vector3f1 = this.datawatcher.get(EntityArmorStand.d); + + if (!this.bodyPose.equals(vector3f1)) { + this.setBodyPose(vector3f1); + } + +- Vector3f vector3f2 = (Vector3f) this.datawatcher.get(EntityArmorStand.e); ++ Vector3f vector3f2 = this.datawatcher.get(EntityArmorStand.e); + + if (!this.leftArmPose.equals(vector3f2)) { + this.setLeftArmPose(vector3f2); + } + +- Vector3f vector3f3 = (Vector3f) this.datawatcher.get(EntityArmorStand.f); ++ Vector3f vector3f3 = this.datawatcher.get(EntityArmorStand.f); + + if (!this.rightArmPose.equals(vector3f3)) { + this.setRightArmPose(vector3f3); + } + +- Vector3f vector3f4 = (Vector3f) this.datawatcher.get(EntityArmorStand.g); ++ Vector3f vector3f4 = this.datawatcher.get(EntityArmorStand.g); + + if (!this.leftLegPose.equals(vector3f4)) { + this.setLeftLegPose(vector3f4); + } + +- Vector3f vector3f5 = (Vector3f) this.datawatcher.get(EntityArmorStand.bo); ++ Vector3f vector3f5 = this.datawatcher.get(EntityArmorStand.bo); + + if (!this.rightLegPose.equals(vector3f5)) { + this.setRightLegPose(vector3f5); +@@ -716,35 +716,35 @@ public class EntityArmorStand extends EntityLiving { + } + + public void setSmall(boolean flag) { +- this.datawatcher.set(EntityArmorStand.b, this.a((Byte) this.datawatcher.get(EntityArmorStand.b), 1, flag)); ++ this.datawatcher.set(EntityArmorStand.b, this.a(this.datawatcher.get(EntityArmorStand.b), 1, flag)); + } + + public boolean isSmall() { +- return ((Byte) this.datawatcher.get(EntityArmorStand.b) & 1) != 0; ++ return (this.datawatcher.get(EntityArmorStand.b) & 1) != 0; + } + + public void setArms(boolean flag) { +- this.datawatcher.set(EntityArmorStand.b, this.a((Byte) this.datawatcher.get(EntityArmorStand.b), 4, flag)); ++ this.datawatcher.set(EntityArmorStand.b, this.a(this.datawatcher.get(EntityArmorStand.b), 4, flag)); + } + + public boolean hasArms() { +- return ((Byte) this.datawatcher.get(EntityArmorStand.b) & 4) != 0; ++ return (this.datawatcher.get(EntityArmorStand.b) & 4) != 0; + } + + public void setBasePlate(boolean flag) { +- this.datawatcher.set(EntityArmorStand.b, this.a((Byte) this.datawatcher.get(EntityArmorStand.b), 8, flag)); ++ this.datawatcher.set(EntityArmorStand.b, this.a(this.datawatcher.get(EntityArmorStand.b), 8, flag)); + } + + public boolean hasBasePlate() { +- return ((Byte) this.datawatcher.get(EntityArmorStand.b) & 8) != 0; ++ return (this.datawatcher.get(EntityArmorStand.b) & 8) != 0; + } + + public void setMarker(boolean flag) { +- this.datawatcher.set(EntityArmorStand.b, this.a((Byte) this.datawatcher.get(EntityArmorStand.b), 16, flag)); ++ this.datawatcher.set(EntityArmorStand.b, this.a(this.datawatcher.get(EntityArmorStand.b), 16, flag)); + } + + public boolean isMarker() { +- return ((Byte) this.datawatcher.get(EntityArmorStand.b) & 16) != 0; ++ return (this.datawatcher.get(EntityArmorStand.b) & 16) != 0; + } + + private byte a(byte b0, int i, boolean flag) { +diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java +index 2a659eb7bc7766663828a6547da9c1b3944a90a2..a2a3dc96ef3fbec987c3ecea5095e94643d91745 100644 +--- a/src/main/java/net/minecraft/server/EntityArrow.java ++++ b/src/main/java/net/minecraft/server/EntityArrow.java +@@ -88,7 +88,7 @@ public abstract class EntityArrow extends IProjectile { + float f = MathHelper.sqrt(b(vec3d)); + + this.yaw = (float) (MathHelper.d(vec3d.x, vec3d.z) * 57.2957763671875D); +- this.pitch = (float) (MathHelper.d(vec3d.y, (double) f) * 57.2957763671875D); ++ this.pitch = (float) (MathHelper.d(vec3d.y, f) * 57.2957763671875D); + this.lastYaw = this.yaw; + this.lastPitch = this.pitch; + } +@@ -205,7 +205,7 @@ public abstract class EntityArrow extends IProjectile { + this.yaw = (float) (MathHelper.d(d0, d2) * 57.2957763671875D); + } + +- this.pitch = (float) (MathHelper.d(d1, (double) f1) * 57.2957763671875D); ++ this.pitch = (float) (MathHelper.d(d1, f1) * 57.2957763671875D); + this.pitch = e(this.lastPitch, this.pitch); + this.yaw = e(this.lastYaw, this.yaw); + float f2 = 0.99F; +@@ -241,7 +241,7 @@ public abstract class EntityArrow extends IProjectile { + this.inGround = false; + Vec3D vec3d = this.getMot(); + +- this.setMot(vec3d.d((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F))); ++ this.setMot(vec3d.d(this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F)); + this.despawnCounter = 0; + } + +@@ -299,7 +299,7 @@ public abstract class EntityArrow extends IProjectile { + } + + if (this.isCritical()) { +- long j = (long) this.random.nextInt(i / 2 + 2); ++ long j = this.random.nextInt(i / 2 + 2); + + i = (int) Math.min(j + (long) i, 2147483647L); + } +@@ -351,7 +351,7 @@ public abstract class EntityArrow extends IProjectile { + + if (!this.world.isClientSide && entity1 instanceof EntityLiving) { + EnchantmentManager.a(entityliving, entity1); +- EnchantmentManager.b((EntityLiving) entity1, (Entity) entityliving); ++ EnchantmentManager.b((EntityLiving) entity1, entityliving); + } + + this.a(entityliving); +@@ -367,9 +367,9 @@ public abstract class EntityArrow extends IProjectile { + EntityPlayer entityplayer = (EntityPlayer) entity1; + + if (this.at != null && this.isShotFromCrossbow()) { +- CriterionTriggers.G.a(entityplayer, (Collection) this.at); ++ CriterionTriggers.G.a(entityplayer, this.at); + } else if (!entity.isAlive() && this.isShotFromCrossbow()) { +- CriterionTriggers.G.a(entityplayer, (Collection) Arrays.asList(entity)); ++ CriterionTriggers.G.a(entityplayer, Arrays.asList(entity)); + } + } + } +@@ -475,7 +475,7 @@ public abstract class EntityArrow extends IProjectile { + this.setCritical(nbttagcompound.getBoolean("crit")); + this.setPierceLevel(nbttagcompound.getByte("PierceLevel")); + if (nbttagcompound.hasKeyOfType("SoundEvent", 8)) { +- this.ar = (SoundEffect) IRegistry.SOUND_EVENT.getOptional(new MinecraftKey(nbttagcompound.getString("SoundEvent"))).orElse(this.i()); ++ this.ar = IRegistry.SOUND_EVENT.getOptional(new MinecraftKey(nbttagcompound.getString("SoundEvent"))).orElse(this.i()); + } + + this.setShotFromCrossbow(nbttagcompound.getBoolean("ShotFromCrossbow")); +@@ -560,7 +560,7 @@ public abstract class EntityArrow extends IProjectile { + } + + private void a(int i, boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityArrow.f); ++ byte b0 = this.datawatcher.get(EntityArrow.f); + + if (flag) { + this.datawatcher.set(EntityArrow.f, (byte) (b0 | i)); +@@ -571,19 +571,19 @@ public abstract class EntityArrow extends IProjectile { + } + + public boolean isCritical() { +- byte b0 = (Byte) this.datawatcher.get(EntityArrow.f); ++ byte b0 = this.datawatcher.get(EntityArrow.f); + + return (b0 & 1) != 0; + } + + public boolean isShotFromCrossbow() { +- byte b0 = (Byte) this.datawatcher.get(EntityArrow.f); ++ byte b0 = this.datawatcher.get(EntityArrow.f); + + return (b0 & 4) != 0; + } + + public byte getPierceLevel() { +- return (Byte) this.datawatcher.get(EntityArrow.g); ++ return this.datawatcher.get(EntityArrow.g); + } + + public void a(EntityLiving entityliving, float f) { +@@ -615,7 +615,7 @@ public abstract class EntityArrow extends IProjectile { + } + + public boolean t() { +- return !this.world.isClientSide ? this.noclip : ((Byte) this.datawatcher.get(EntityArrow.f) & 2) != 0; ++ return !this.world.isClientSide ? this.noclip : (this.datawatcher.get(EntityArrow.f) & 2) != 0; + } + + public void setShotFromCrossbow(boolean flag) { +diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java +index 781cadf1471cf8aa405af406bc9ae8db01d6eb8f..2ec87833c33aa9126b802faef480a8fe2c2b8d3e 100644 +--- a/src/main/java/net/minecraft/server/EntityBat.java ++++ b/src/main/java/net/minecraft/server/EntityBat.java +@@ -66,11 +66,11 @@ public class EntityBat extends EntityAmbient { + } + + public boolean isAsleep() { +- return ((Byte) this.datawatcher.get(EntityBat.b) & 1) != 0; ++ return (this.datawatcher.get(EntityBat.b) & 1) != 0; + } + + public void setAsleep(boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityBat.b); ++ byte b0 = this.datawatcher.get(EntityBat.b); + + if (flag) { + this.datawatcher.set(EntityBat.b, (byte) (b0 | 1)); +@@ -106,12 +106,12 @@ public class EntityBat extends EntityAmbient { + this.aJ = (float) this.random.nextInt(360); + } + +- if (this.world.a(EntityBat.c, (EntityLiving) this) != null) { ++ if (this.world.a(EntityBat.c, this) != null) { + // CraftBukkit Start - Call BatToggleSleepEvent + if (CraftEventFactory.handleBatToggleSleepEvent(this, true)) { + this.setAsleep(false); + if (!flag) { +- this.world.a((EntityHuman) null, 1025, blockposition, 0); ++ this.world.a(null, 1025, blockposition, 0); + } + } + // CraftBukkit End +@@ -121,7 +121,7 @@ public class EntityBat extends EntityAmbient { + if (CraftEventFactory.handleBatToggleSleepEvent(this, true)) { + this.setAsleep(false); + if (!flag) { +- this.world.a((EntityHuman) null, 1025, blockposition, 0); ++ this.world.a(null, 1025, blockposition, 0); + } + } + // CraftBukkit End - Call BatToggleSleepEvent +@@ -131,7 +131,7 @@ public class EntityBat extends EntityAmbient { + this.d = null; + } + +- if (this.d == null || this.random.nextInt(30) == 0 || this.d.a((IPosition) this.getPositionVector(), 2.0D)) { ++ if (this.d == null || this.random.nextInt(30) == 0 || this.d.a(this.getPositionVector(), 2.0D)) { + this.d = new BlockPosition(this.locX() + (double) this.random.nextInt(7) - (double) this.random.nextInt(7), this.locY() + (double) this.random.nextInt(6) - 2.0D, this.locZ() + (double) this.random.nextInt(7) - (double) this.random.nextInt(7)); + } + +@@ -202,7 +202,7 @@ public class EntityBat extends EntityAmbient { + @Override + public void saveData(NBTTagCompound nbttagcompound) { + super.saveData(nbttagcompound); +- nbttagcompound.setByte("BatFlags", (Byte) this.datawatcher.get(EntityBat.b)); ++ nbttagcompound.setByte("BatFlags", this.datawatcher.get(EntityBat.b)); + } + + public static boolean b(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { +diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java +index 776f4df79ac8ffad2e876e400df131f5c5691faf..92b8f3adf865f10055a48d3b94477f129a0d319d 100644 +--- a/src/main/java/net/minecraft/server/EntityBee.java ++++ b/src/main/java/net/minecraft/server/EntityBee.java +@@ -69,7 +69,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + this.goalSelector.a(0, new EntityBee.b(this, 1.399999976158142D, true)); + this.goalSelector.a(1, new EntityBee.d()); + this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D)); +- this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a((Tag) TagsItem.FLOWERS), false)); ++ this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(TagsItem.FLOWERS), false)); + this.bJ = new EntityBee.k(); + this.goalSelector.a(4, this.bJ); + this.goalSelector.a(5, new PathfinderGoalFollowParent(this, 1.25D)); +@@ -131,7 +131,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + boolean flag = entity.damageEntity(DamageSource.b(this), (float) ((int) this.b(GenericAttributes.ATTACK_DAMAGE))); + + if (flag) { +- this.a((EntityLiving) this, entity); ++ this.a(this, entity); + if (entity instanceof EntityLiving) { + ((EntityLiving) entity).q(((EntityLiving) entity).dy() + 1); + byte b0 = 0; +@@ -172,7 +172,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + } + + private void h(BlockPosition blockposition) { +- Vec3D vec3d = Vec3D.c((BaseBlockPosition) blockposition); ++ Vec3D vec3d = Vec3D.c(blockposition); + byte b0 = 0; + BlockPosition blockposition1 = this.getChunkCoordinates(); + int i = (int) vec3d.y - blockposition1.getY(); +@@ -289,7 +289,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + + @Override + public int getAnger() { +- return (Integer) this.datawatcher.get(EntityBee.bw); ++ return this.datawatcher.get(EntityBee.bw); + } + + @Override +@@ -417,15 +417,15 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + + private void d(int i, boolean flag) { + if (flag) { +- this.datawatcher.set(EntityBee.bv, (byte) ((Byte) this.datawatcher.get(EntityBee.bv) | i)); ++ this.datawatcher.set(EntityBee.bv, (byte) (this.datawatcher.get(EntityBee.bv) | i)); + } else { +- this.datawatcher.set(EntityBee.bv, (byte) ((Byte) this.datawatcher.get(EntityBee.bv) & ~i)); ++ this.datawatcher.set(EntityBee.bv, (byte) (this.datawatcher.get(EntityBee.bv) & ~i)); + } + + } + + private boolean u(int i) { +- return ((Byte) this.datawatcher.get(EntityBee.bv) & i) != 0; ++ return (this.datawatcher.get(EntityBee.bv) & i) != 0; + } + + public static AttributeProvider.Builder fa() { +@@ -456,11 +456,11 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + + @Override + public boolean k(ItemStack itemstack) { +- return itemstack.getItem().a((Tag) TagsItem.FLOWERS); ++ return itemstack.getItem().a(TagsItem.FLOWERS); + } + + private boolean k(BlockPosition blockposition) { +- return this.world.p(blockposition) && this.world.getType(blockposition).getBlock().a((Tag) TagsBlock.FLOWERS); ++ return this.world.p(blockposition) && this.world.getType(blockposition).getBlock().a(TagsBlock.FLOWERS); + } + + @Override +@@ -488,7 +488,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + + @Override + public EntityBee createChild(EntityAgeable entityageable) { +- return (EntityBee) EntityTypes.BEE.a(this.world); ++ return EntityTypes.BEE.a(this.world); + } + + @Override +@@ -544,7 +544,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + } + + private boolean b(BlockPosition blockposition, int i) { +- return blockposition.a((BaseBlockPosition) this.getChunkCoordinates(), (double) i); ++ return blockposition.a(this.getChunkCoordinates(), i); + } + + class d extends EntityBee.a { +@@ -555,7 +555,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + + @Override + public boolean g() { +- if (EntityBee.this.hasHivePos() && EntityBee.this.fe() && EntityBee.this.hivePos.a((IPosition) EntityBee.this.getPositionVector(), 2.0D)) { ++ if (EntityBee.this.hasHivePos() && EntityBee.this.fe() && EntityBee.this.hivePos.a(EntityBee.this.getPositionVector(), 2.0D)) { + if (!EntityBee.this.world.isLoadedAndInBounds(EntityBee.this.hivePos)) return false; // Paper + TileEntity tileentity = EntityBee.this.world.getTileEntity(EntityBee.this.hivePos); + +@@ -635,7 +635,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + boolean flag = false; + BlockStateInteger blockstateinteger = null; + +- if (block.a((Tag) TagsBlock.BEE_GROWABLES)) { ++ if (block.a(TagsBlock.BEE_GROWABLES)) { + if (block instanceof BlockCrops) { + BlockCrops blockcrops = (BlockCrops) block; + +@@ -647,13 +647,13 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + int j; + + if (block instanceof BlockStem) { +- j = (Integer) iblockdata.get(BlockStem.AGE); ++ j = iblockdata.get(BlockStem.AGE); + if (j < 7) { + flag = true; + blockstateinteger = BlockStem.AGE; + } + } else if (block == Blocks.SWEET_BERRY_BUSH) { +- j = (Integer) iblockdata.get(BlockSweetBerryBush.a); ++ j = iblockdata.get(BlockSweetBerryBush.a); + if (j < 3) { + flag = true; + blockstateinteger = BlockSweetBerryBush.a; +@@ -661,9 +661,9 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + } + } + +- if (flag && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(EntityBee.this, blockposition, iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1)).isCancelled()) { // Spigot ++ if (flag && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(EntityBee.this, blockposition, iblockdata.set(blockstateinteger, iblockdata.get(blockstateinteger) + 1)).isCancelled()) { // Spigot + EntityBee.this.world.triggerEffect(2005, blockposition, 0); +- EntityBee.this.world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1)); ++ EntityBee.this.world.setTypeUpdate(blockposition, iblockdata.set(blockstateinteger, iblockdata.get(blockstateinteger) + 1)); + EntityBee.this.fj(); + } + } +@@ -702,7 +702,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + do { + if (!iterator.hasNext()) { + EntityBee.this.bK.j(); +- EntityBee.this.hivePos = (BlockPosition) list.get(0); ++ EntityBee.this.hivePos = list.get(0); + return; + } + +@@ -720,7 +720,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + return villageplacetype == VillagePlaceType.t || villageplacetype == VillagePlaceType.u; + }, blockposition, 20, VillagePlace.Occupancy.ANY); + +- return (List) stream.map(VillagePlaceRecord::f).filter((blockposition1) -> { ++ return stream.map(VillagePlaceRecord::f).filter((blockposition1) -> { + return EntityBee.this.i(blockposition1); + }).sorted(Comparator.comparingDouble((blockposition1) -> { + return blockposition1.j(blockposition); +@@ -731,7 +731,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + class k extends EntityBee.a { + + private final Predicate c = (iblockdata) -> { +- return iblockdata.a((Tag) TagsBlock.TALL_FLOWERS) ? (iblockdata.a(Blocks.SUNFLOWER) ? iblockdata.get(BlockTallPlant.HALF) == BlockPropertyDoubleBlockHalf.UPPER : true) : iblockdata.a((Tag) TagsBlock.SMALL_FLOWERS); ++ return iblockdata.a(TagsBlock.TALL_FLOWERS) ? (iblockdata.a(Blocks.SUNFLOWER) ? iblockdata.get(BlockTallPlant.HALF) == BlockPropertyDoubleBlockHalf.UPPER : true) : iblockdata.a(TagsBlock.SMALL_FLOWERS); + }; + private int d = 0; + private int e = 0; +@@ -758,7 +758,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + Optional optional = this.o(); + + if (optional.isPresent()) { +- EntityBee.this.flowerPos = (BlockPosition) optional.get(); ++ EntityBee.this.flowerPos = optional.get(); + EntityBee.this.navigation.a((double) EntityBee.this.flowerPos.getX() + 0.5D, (double) EntityBee.this.flowerPos.getY() + 0.5D, (double) EntityBee.this.flowerPos.getZ() + 0.5D, 1.2000000476837158D); + return true; + } else { +@@ -823,7 +823,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + if (this.h > 600) { + EntityBee.this.flowerPos = null; + } else { +- Vec3D vec3d = Vec3D.c((BaseBlockPosition) EntityBee.this.flowerPos).add(0.0D, 0.6000000238418579D, 0.0D); ++ Vec3D vec3d = Vec3D.c(EntityBee.this.flowerPos).add(0.0D, 0.6000000238418579D, 0.0D); + + if (vec3d.f(EntityBee.this.getPositionVector()) > 1.0D) { + this.g = vec3d; +@@ -888,7 +888,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + for (int k = 0; k <= j; k = k > 0 ? -k : 1 - k) { + for (int l = k < j && k > -j ? j : 0; l <= j; l = l > 0 ? -l : 1 - l) { + blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, k, i - 1, l); +- if (blockposition.a((BaseBlockPosition) blockposition_mutableblockposition, d0) && predicate.test(EntityBee.this.world.getType(blockposition_mutableblockposition))) { ++ if (blockposition.a(blockposition_mutableblockposition, d0) && predicate.test(EntityBee.this.world.getType(blockposition_mutableblockposition))) { + return Optional.of(blockposition_mutableblockposition); + } + } +@@ -991,7 +991,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + + @Override + public boolean g() { +- return EntityBee.this.hivePos != null && !EntityBee.this.eA() && EntityBee.this.fe() && !this.d(EntityBee.this.hivePos) && EntityBee.this.world.getType(EntityBee.this.hivePos).a((Tag) TagsBlock.BEEHIVES); ++ return EntityBee.this.hivePos != null && !EntityBee.this.eA() && EntityBee.this.fe() && !this.d(EntityBee.this.hivePos) && EntityBee.this.world.getType(EntityBee.this.hivePos).a(TagsBlock.BEEHIVES); + } + + @Override +@@ -1049,7 +1049,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + + private boolean a(BlockPosition blockposition) { + EntityBee.this.navigation.a(10.0F); +- EntityBee.this.navigation.a((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), 1.0D); ++ EntityBee.this.navigation.a(blockposition.getX(), blockposition.getY(), blockposition.getZ(), 1.0D); + return EntityBee.this.navigation.k() != null && EntityBee.this.navigation.k().i(); + } + +@@ -1125,7 +1125,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + Vec3D vec3d; + + if (EntityBee.this.fk() && !EntityBee.this.b(EntityBee.this.hivePos, 22)) { +- Vec3D vec3d1 = Vec3D.a((BaseBlockPosition) EntityBee.this.hivePos); ++ Vec3D vec3d1 = Vec3D.a(EntityBee.this.hivePos); + + vec3d = vec3d1.d(EntityBee.this.getPositionVector()).d(); + } else { +@@ -1135,7 +1135,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + boolean flag = true; + Vec3D vec3d2 = RandomPositionGenerator.a(EntityBee.this, 8, 7, vec3d, 1.5707964F, 2, 1); + +- return vec3d2 != null ? vec3d2 : RandomPositionGenerator.a((EntityCreature) EntityBee.this, 8, 4, -2, vec3d, 1.5707963705062866D); ++ return vec3d2 != null ? vec3d2 : RandomPositionGenerator.a(EntityBee.this, 8, 4, -2, vec3d, 1.5707963705062866D); + } + } + +diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java +index e762b4db13286bd7d973d240ca3da95b9bbab57f..e947f2903e17591c76ca223726ece8d3d360398a 100644 +--- a/src/main/java/net/minecraft/server/EntityBoat.java ++++ b/src/main/java/net/minecraft/server/EntityBoat.java +@@ -121,7 +121,7 @@ public class EntityBoat extends Entity { + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + org.bukkit.entity.Entity attacker = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity(); + +- VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, (double) f); ++ VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, f); + this.world.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { +@@ -147,7 +147,7 @@ public class EntityBoat extends Entity { + } + // CraftBukkit end + if (!flag && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { +- this.a((IMaterial) this.g()); ++ this.a(this.g()); + } + + this.die(); +@@ -269,7 +269,7 @@ public class EntityBoat extends Entity { + this.v(); + if (this.world.isClientSide) { + this.x(); +- this.world.a((Packet) (new PacketPlayInBoatMove(this.a(0), this.a(1)))); ++ this.world.a(new PacketPlayInBoatMove(this.a(0), this.a(1))); + } + + this.move(EnumMoveType.SELF, this.getMot()); +@@ -305,7 +305,7 @@ public class EntityBoat extends Entity { + double d0 = i == 1 ? -vec3d.z : vec3d.z; + double d1 = i == 1 ? vec3d.x : -vec3d.x; + +- this.world.playSound((EntityHuman) null, this.locX() + d0, this.locY(), this.locZ() + d1, soundeffect, this.getSoundCategory(), 1.0F, 0.8F + 0.4F * this.random.nextFloat()); ++ this.world.playSound(null, this.locX() + d0, this.locY(), this.locZ() + d1, soundeffect, this.getSoundCategory(), 1.0F, 0.8F + 0.4F * this.random.nextFloat()); + } + } + +@@ -322,7 +322,7 @@ public class EntityBoat extends Entity { + boolean flag = !this.world.isClientSide && !(this.getRidingPassenger() instanceof EntityHuman); + + for (int j = 0; j < list.size(); ++j) { +- Entity entity = (Entity) list.get(j); ++ Entity entity = list.get(j); + + if (!entity.w(this)) { + if (flag && this.getPassengers().size() < 2 && !entity.isPassenger() && entity.getWidth() < this.getWidth() && entity instanceof EntityLiving && !(entity instanceof EntityWaterAnimal) && !(entity instanceof EntityHuman)) { +@@ -349,7 +349,7 @@ public class EntityBoat extends Entity { + + this.aJ = MathHelper.a(this.aJ, 0.0F, 1.0F); + this.aL = this.aK; +- this.aK = 10.0F * (float) Math.sin((double) (0.5F * (float) this.world.getTime())) * this.aJ; ++ this.aK = 10.0F * (float) Math.sin(0.5F * (float) this.world.getTime()) * this.aJ; + } else { + if (!this.aH) { + this.d(0); +@@ -468,7 +468,7 @@ public class EntityBoat extends Entity { + blockposition_mutableblockposition.d(l1, k1, i2); + Fluid fluid = this.world.getFluid(blockposition_mutableblockposition); + +- if (fluid.a((Tag) TagsFluid.WATER)) { ++ if (fluid.a(TagsFluid.WATER)) { + f = Math.max(f, fluid.getHeight(this.world, blockposition_mutableblockposition)); + } + +@@ -514,7 +514,7 @@ public class EntityBoat extends Entity { + blockposition_mutableblockposition.d(l1, k2, i2); + IBlockData iblockdata = this.world.getType(blockposition_mutableblockposition); + +- if (!(iblockdata.getBlock() instanceof BlockWaterLily) && VoxelShapes.c(iblockdata.getCollisionShape(this.world, blockposition_mutableblockposition).a((double) l1, (double) k2, (double) i2), voxelshape, OperatorBoolean.AND)) { ++ if (!(iblockdata.getBlock() instanceof BlockWaterLily) && VoxelShapes.c(iblockdata.getCollisionShape(this.world, blockposition_mutableblockposition).a(l1, k2, i2), voxelshape, OperatorBoolean.AND)) { + f += iblockdata.getBlock().getFrictionFactor(); + ++k1; + } +@@ -546,10 +546,10 @@ public class EntityBoat extends Entity { + blockposition_mutableblockposition.d(k1, l1, i2); + Fluid fluid = this.world.getFluid(blockposition_mutableblockposition); + +- if (fluid.a((Tag) TagsFluid.WATER)) { ++ if (fluid.a(TagsFluid.WATER)) { + float f = (float) l1 + fluid.getHeight(this.world, blockposition_mutableblockposition); + +- this.aC = Math.max((double) f, this.aC); ++ this.aC = Math.max(f, this.aC); + flag |= axisalignedbb.minY < (double) f; + } + } +@@ -578,7 +578,7 @@ public class EntityBoat extends Entity { + blockposition_mutableblockposition.d(k1, l1, i2); + Fluid fluid = this.world.getFluid(blockposition_mutableblockposition); + +- if (fluid.a((Tag) TagsFluid.WATER) && d0 < (double) ((float) blockposition_mutableblockposition.getY() + fluid.getHeight(this.world, blockposition_mutableblockposition))) { ++ if (fluid.a(TagsFluid.WATER) && d0 < (double) ((float) blockposition_mutableblockposition.getY() + fluid.getHeight(this.world, blockposition_mutableblockposition))) { + if (!fluid.isSource()) { + return EntityBoat.EnumStatus.UNDER_FLOWING_WATER; + } +@@ -661,7 +661,7 @@ public class EntityBoat extends Entity { + f -= 0.005F; + } + +- this.setMot(this.getMot().add((double) (MathHelper.sin(-this.yaw * 0.017453292F) * f), 0.0D, (double) (MathHelper.cos(this.yaw * 0.017453292F) * f))); ++ this.setMot(this.getMot().add(MathHelper.sin(-this.yaw * 0.017453292F) * f, 0.0D, MathHelper.cos(this.yaw * 0.017453292F) * f)); + this.a(this.az && !this.ay || this.aA, this.ay && !this.az || this.aA); + } + } +@@ -686,7 +686,7 @@ public class EntityBoat extends Entity { + } + } + +- Vec3D vec3d = (new Vec3D((double) f, 0.0D, 0.0D)).b(-this.yaw * 0.017453292F - 1.5707964F); ++ Vec3D vec3d = (new Vec3D(f, 0.0D, 0.0D)).b(-this.yaw * 0.017453292F - 1.5707964F); + + entity.setPosition(this.locX() + vec3d.x, this.locY() + (double) f1, this.locZ() + vec3d.z); + entity.yaw += this.ar; +@@ -704,7 +704,7 @@ public class EntityBoat extends Entity { + + @Override + public Vec3D c(EntityLiving entityliving) { +- Vec3D vec3d = a((double) (this.getWidth() * MathHelper.a), (double) entityliving.getWidth(), this.yaw); ++ Vec3D vec3d = a(this.getWidth() * MathHelper.a, entityliving.getWidth(), this.yaw); + double d0 = this.locX() + vec3d.x; + double d1 = this.locZ() + vec3d.z; + BlockPosition blockposition = new BlockPosition(d0, this.getBoundingBox().maxY, d1); +@@ -794,11 +794,11 @@ public class EntityBoat extends Entity { + int i; + + for (i = 0; i < 3; ++i) { +- this.a((IMaterial) this.getType().b()); ++ this.a(this.getType().b()); + } + + for (i = 0; i < 2; ++i) { +- this.a((IMaterial) Items.STICK); ++ this.a(Items.STICK); + } + } + } +@@ -806,7 +806,7 @@ public class EntityBoat extends Entity { + } + + this.fallDistance = 0.0F; +- } else if (!this.world.getFluid(this.getChunkCoordinates().down()).a((Tag) TagsFluid.WATER) && d0 < 0.0D) { ++ } else if (!this.world.getFluid(this.getChunkCoordinates().down()).a(TagsFluid.WATER) && d0 < 0.0D) { + this.fallDistance = (float) ((double) this.fallDistance - d0); + } + +@@ -814,7 +814,7 @@ public class EntityBoat extends Entity { + } + + public boolean a(int i) { +- return (Boolean) this.datawatcher.get(i == 0 ? EntityBoat.f : EntityBoat.g) && this.getRidingPassenger() != null; ++ return this.datawatcher.get(i == 0 ? EntityBoat.f : EntityBoat.g) && this.getRidingPassenger() != null; + } + + public void setDamage(float f) { +@@ -822,7 +822,7 @@ public class EntityBoat extends Entity { + } + + public float getDamage() { +- return (Float) this.datawatcher.get(EntityBoat.d); ++ return this.datawatcher.get(EntityBoat.d); + } + + public void b(int i) { +@@ -830,7 +830,7 @@ public class EntityBoat extends Entity { + } + + public int n() { +- return (Integer) this.datawatcher.get(EntityBoat.b); ++ return this.datawatcher.get(EntityBoat.b); + } + + private void d(int i) { +@@ -838,7 +838,7 @@ public class EntityBoat extends Entity { + } + + private int z() { +- return (Integer) this.datawatcher.get(EntityBoat.an); ++ return this.datawatcher.get(EntityBoat.an); + } + + public void c(int i) { +@@ -846,7 +846,7 @@ public class EntityBoat extends Entity { + } + + public int o() { +- return (Integer) this.datawatcher.get(EntityBoat.c); ++ return this.datawatcher.get(EntityBoat.c); + } + + public void setType(EntityBoat.EnumBoatType entityboat_enumboattype) { +@@ -854,12 +854,12 @@ public class EntityBoat extends Entity { + } + + public EntityBoat.EnumBoatType getType() { +- return EntityBoat.EnumBoatType.a((Integer) this.datawatcher.get(EntityBoat.e)); ++ return EntityBoat.EnumBoatType.a(this.datawatcher.get(EntityBoat.e)); + } + + @Override + protected boolean q(Entity entity) { +- return this.getPassengers().size() < 2 && !this.a((Tag) TagsFluid.WATER); ++ return this.getPassengers().size() < 2 && !this.a(TagsFluid.WATER); + } + + @Nullable +@@ -867,7 +867,7 @@ public class EntityBoat extends Entity { + public Entity getRidingPassenger() { + List list = this.getPassengers(); + +- return list.isEmpty() ? null : (Entity) list.get(0); ++ return list.isEmpty() ? null : list.get(0); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java +index 2fad3a1ae884726f431d8e5f5106134dec322309..64897431b77c432a716d52be680343aa1d5d7dc7 100644 +--- a/src/main/java/net/minecraft/server/EntityCat.java ++++ b/src/main/java/net/minecraft/server/EntityCat.java +@@ -16,7 +16,7 @@ public class EntityCat extends EntityTameableAnimal { + private static final DataWatcherObject bA = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i); + private static final DataWatcherObject bB = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i); + private static final DataWatcherObject bC = DataWatcher.a(EntityCat.class, DataWatcherRegistry.b); +- public static final Map bx = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error ++ public static final Map bx = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error + hashmap.put(0, new MinecraftKey("textures/entity/cat/tabby.png")); + hashmap.put(1, new MinecraftKey("textures/entity/cat/black.png")); + hashmap.put(2, new MinecraftKey("textures/entity/cat/red.png")); +@@ -43,7 +43,7 @@ public class EntityCat extends EntityTameableAnimal { + } + + public MinecraftKey eV() { +- return (MinecraftKey) EntityCat.bx.getOrDefault(this.getCatType(), EntityCat.bx.get(0)); ++ return EntityCat.bx.getOrDefault(this.getCatType(), EntityCat.bx.get(0)); + } + + @Override +@@ -66,7 +66,7 @@ public class EntityCat extends EntityTameableAnimal { + } + + public int getCatType() { +- return (Integer) this.datawatcher.get(EntityCat.bz); ++ return this.datawatcher.get(EntityCat.bz); + } + + public void setCatType(int i) { +@@ -82,7 +82,7 @@ public class EntityCat extends EntityTameableAnimal { + } + + public boolean eX() { +- return (Boolean) this.datawatcher.get(EntityCat.bA); ++ return this.datawatcher.get(EntityCat.bA); + } + + public void y(boolean flag) { +@@ -90,11 +90,11 @@ public class EntityCat extends EntityTameableAnimal { + } + + public boolean eY() { +- return (Boolean) this.datawatcher.get(EntityCat.bB); ++ return this.datawatcher.get(EntityCat.bB); + } + + public EnumColor getCollarColor() { +- return EnumColor.fromColorIndex((Integer) this.datawatcher.get(EntityCat.bC)); ++ return EnumColor.fromColorIndex(this.datawatcher.get(EntityCat.bC)); + } + + public void setCollarColor(EnumColor enumcolor) { +@@ -245,7 +245,7 @@ public class EntityCat extends EntityTameableAnimal { + + @Override + public EntityCat createChild(EntityAgeable entityageable) { +- EntityCat entitycat = (EntityCat) EntityTypes.CAT.a(this.world); ++ EntityCat entitycat = EntityTypes.CAT.a(this.world); + + if (entityageable instanceof EntityCat) { + if (this.random.nextBoolean()) { +@@ -307,12 +307,12 @@ public class EntityCat extends EntityTameableAnimal { + Item item = itemstack.getItem(); + + if (this.world.isClientSide) { +- return this.isTamed() && this.j((EntityLiving) entityhuman) ? EnumInteractionResult.SUCCESS : (this.k(itemstack) && (this.getHealth() < this.getMaxHealth() || !this.isTamed()) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS); ++ return this.isTamed() && this.j(entityhuman) ? EnumInteractionResult.SUCCESS : (this.k(itemstack) && (this.getHealth() < this.getMaxHealth() || !this.isTamed()) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS); + } else { + EnumInteractionResult enuminteractionresult; + + if (this.isTamed()) { +- if (this.j((EntityLiving) entityhuman)) { ++ if (this.j(entityhuman)) { + if (!(item instanceof ItemDye)) { + if (item.isFood() && this.k(itemstack) && this.getHealth() < this.getMaxHealth()) { + this.a(entityhuman, itemstack); +@@ -384,7 +384,7 @@ public class EntityCat extends EntityTameableAnimal { + this.bD = new EntityCat.a<>(this, EntityHuman.class, 16.0F, 0.8D, 1.33D); + } + +- this.goalSelector.a((PathfinderGoal) this.bD); ++ this.goalSelector.a(this.bD); + if (!this.isTamed()) { + this.goalSelector.a(4, this.bD); + } +@@ -424,8 +424,8 @@ public class EntityCat extends EntityTameableAnimal { + BlockPosition blockposition = this.b.getChunkCoordinates(); + IBlockData iblockdata = this.a.world.getType(blockposition); + +- if (iblockdata.getBlock().a((Tag) TagsBlock.BEDS)) { +- this.c = (BlockPosition) iblockdata.d(BlockBed.FACING).map((enumdirection) -> { ++ if (iblockdata.getBlock().a(TagsBlock.BEDS)) { ++ this.c = iblockdata.d(BlockFacingHorizontal.FACING).map((enumdirection) -> { + return blockposition.shift(enumdirection.opposite()); + }).orElseGet(() -> { + return new BlockPosition(blockposition); +@@ -466,7 +466,7 @@ public class EntityCat extends EntityTameableAnimal { + public void c() { + if (this.c != null) { + this.a.setSitting(false); +- this.a.getNavigation().a((double) this.c.getX(), (double) this.c.getY(), (double) this.c.getZ(), 1.100000023841858D); ++ this.a.getNavigation().a(this.c.getX(), this.c.getY(), this.c.getZ(), 1.100000023841858D); + } + + } +@@ -490,7 +490,7 @@ public class EntityCat extends EntityTameableAnimal { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); + + blockposition_mutableblockposition.g(this.a.getChunkCoordinates()); +- this.a.a((double) (blockposition_mutableblockposition.getX() + random.nextInt(11) - 5), (double) (blockposition_mutableblockposition.getY() + random.nextInt(5) - 2), (double) (blockposition_mutableblockposition.getZ() + random.nextInt(11) - 5), false); ++ this.a.a(blockposition_mutableblockposition.getX() + random.nextInt(11) - 5, blockposition_mutableblockposition.getY() + random.nextInt(5) - 2, blockposition_mutableblockposition.getZ() + random.nextInt(11) - 5, false); + blockposition_mutableblockposition.g(this.a.getChunkCoordinates()); + LootTable loottable = this.a.world.getMinecraftServer().getLootTableRegistry().getLootTable(LootTables.ak); + LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.a.world)).set(LootContextParameters.POSITION, blockposition_mutableblockposition).set(LootContextParameters.THIS_ENTITY, this.a).a(random); +@@ -500,7 +500,7 @@ public class EntityCat extends EntityTameableAnimal { + while (iterator.hasNext()) { + ItemStack itemstack = (ItemStack) iterator.next(); + +- this.a.world.addEntity(new EntityItem(this.a.world, (double) blockposition_mutableblockposition.getX() - (double) MathHelper.sin(this.a.aH * 0.017453292F), (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + (double) MathHelper.cos(this.a.aH * 0.017453292F), itemstack)); ++ this.a.world.addEntity(new EntityItem(this.a.world, (double) blockposition_mutableblockposition.getX() - (double) MathHelper.sin(this.a.aH * 0.017453292F), blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + (double) MathHelper.cos(this.a.aH * 0.017453292F), itemstack)); + } + + } +@@ -509,14 +509,14 @@ public class EntityCat extends EntityTameableAnimal { + public void e() { + if (this.b != null && this.c != null) { + this.a.setSitting(false); +- this.a.getNavigation().a((double) this.c.getX(), (double) this.c.getY(), (double) this.c.getZ(), 1.100000023841858D); ++ this.a.getNavigation().a(this.c.getX(), this.c.getY(), this.c.getZ(), 1.100000023841858D); + if (this.a.h((Entity) this.b) < 2.5D) { + ++this.d; + if (this.d > 16) { + this.a.x(true); + this.a.y(false); + } else { +- this.a.a((Entity) this.b, 45.0F, 45.0F); ++ this.a.a(this.b, 45.0F, 45.0F); + this.a.y(true); + } + } else { +diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java +index c6ee92343a16a9bf90b2660da440f2092ca378e4..0880f21c28fa76f56660a4dc4d7722c419cc0c8e 100644 +--- a/src/main/java/net/minecraft/server/EntityChicken.java ++++ b/src/main/java/net/minecraft/server/EntityChicken.java +@@ -99,7 +99,7 @@ public class EntityChicken extends EntityAnimal { + + @Override + public EntityChicken createChild(EntityAgeable entityageable) { +- return (EntityChicken) EntityTypes.CHICKEN.a(this.world); ++ return EntityTypes.CHICKEN.a(this.world); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java +index 30ee6df6b47c7cfa555a757a01270b986e4fdf9e..f7bd4b7a7e4b98c14b25f56f42c56d8cd6051575 100644 +--- a/src/main/java/net/minecraft/server/EntityCow.java ++++ b/src/main/java/net/minecraft/server/EntityCow.java +@@ -58,7 +58,7 @@ public class EntityCow extends EntityAnimal { + + if (itemstack.getItem() == Items.BUCKET && !this.isBaby()) { + // CraftBukkit start - Got milk? +- org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) entityhuman.world, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET, enumhand); // Paper - add enumHand ++ org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman.world, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET, enumhand); // Paper - add enumHand + + if (event.isCancelled()) { + return EnumInteractionResult.PASS; +@@ -77,7 +77,7 @@ public class EntityCow extends EntityAnimal { + + @Override + public EntityCow createChild(EntityAgeable entityageable) { +- return (EntityCow) EntityTypes.COW.a(this.world); ++ return EntityTypes.COW.a(this.world); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java +index 11d384729326af693a9a679195acbd594227466a..63cb53941ae187a0d8871a02c984a0e140535930 100644 +--- a/src/main/java/net/minecraft/server/EntityCreature.java ++++ b/src/main/java/net/minecraft/server/EntityCreature.java +@@ -14,7 +14,7 @@ public abstract class EntityCreature extends EntityInsentient { + } + + public float f(BlockPosition blockposition) { +- return this.a(blockposition, (IWorldReader) this.world); ++ return this.a(blockposition, this.world); + } + + public float a(BlockPosition blockposition, IWorldReader iworldreader) { +@@ -23,7 +23,7 @@ public abstract class EntityCreature extends EntityInsentient { + + @Override + public boolean a(GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn) { +- return this.a(this.getChunkCoordinates(), (IWorldReader) generatoraccess) >= 0.0F; ++ return this.a(this.getChunkCoordinates(), generatoraccess) >= 0.0F; + } + + public boolean eJ() { +diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java +index 46c64aa6b0676635a48452818a99322a396f0441..724ff72d4a2807c1d6beb83abd57fa73e212949f 100644 +--- a/src/main/java/net/minecraft/server/EntityCreeper.java ++++ b/src/main/java/net/minecraft/server/EntityCreeper.java +@@ -34,7 +34,7 @@ public class EntityCreeper extends EntityMonster { + this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this)); + this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); +- this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, new Class[0])); ++ this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this)); + } + + public static AttributeProvider.Builder m() { +@@ -69,7 +69,7 @@ public class EntityCreeper extends EntityMonster { + @Override + public void saveData(NBTTagCompound nbttagcompound) { + super.saveData(nbttagcompound); +- if ((Boolean) this.datawatcher.get(EntityCreeper.POWERED)) { ++ if (this.datawatcher.get(EntityCreeper.POWERED)) { + nbttagcompound.setBoolean("powered", true); + } + +@@ -156,11 +156,11 @@ public class EntityCreeper extends EntityMonster { + } + + public boolean isPowered() { +- return (Boolean) this.datawatcher.get(EntityCreeper.POWERED); ++ return this.datawatcher.get(EntityCreeper.POWERED); + } + + public int eL() { +- return (Integer) this.datawatcher.get(EntityCreeper.b); ++ return this.datawatcher.get(EntityCreeper.b); + } + + public void a(int i) { +@@ -250,7 +250,7 @@ public class EntityCreeper extends EntityMonster { + } + + public boolean isIgnited() { +- return (Boolean) this.datawatcher.get(EntityCreeper.d); ++ return this.datawatcher.get(EntityCreeper.d); + } + + public void ignite() { +diff --git a/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java b/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java +index 43bbc3a36973fb101a72e6c47a0c69e49d17b988..b5970d0cbe5f5a72fce3814458c20e9f13e04460 100644 +--- a/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java ++++ b/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java +@@ -30,7 +30,7 @@ public class EntityDamageSourceIndirect extends EntityDamageSource { + String s = "death.attack." + this.translationIndex; + String s1 = s + ".item"; + +- return !itemstack.isEmpty() && itemstack.hasName() ? new ChatMessage(s1, new Object[]{entityliving.getScoreboardDisplayName(), ichatbasecomponent, itemstack.C()}) : new ChatMessage(s, new Object[]{entityliving.getScoreboardDisplayName(), ichatbasecomponent}); ++ return !itemstack.isEmpty() && itemstack.hasName() ? new ChatMessage(s1, entityliving.getScoreboardDisplayName(), ichatbasecomponent, itemstack.C()) : new ChatMessage(s, entityliving.getScoreboardDisplayName(), ichatbasecomponent); + } + + // CraftBukkit start +diff --git a/src/main/java/net/minecraft/server/EntityDolphin.java b/src/main/java/net/minecraft/server/EntityDolphin.java +index f0adab12020fa8adb2483cad7f945c4b66763cba..18a2e36046656cde8a558e1e1408df891d80c0fb 100644 +--- a/src/main/java/net/minecraft/server/EntityDolphin.java ++++ b/src/main/java/net/minecraft/server/EntityDolphin.java +@@ -44,11 +44,11 @@ public class EntityDolphin extends EntityWaterAnimal { + } + + public BlockPosition getTreasurePos() { +- return (BlockPosition) this.datawatcher.get(EntityDolphin.c); ++ return this.datawatcher.get(EntityDolphin.c); + } + + public boolean gotFish() { +- return (Boolean) this.datawatcher.get(EntityDolphin.d); ++ return this.datawatcher.get(EntityDolphin.d); + } + + public void setGotFish(boolean flag) { +@@ -56,7 +56,7 @@ public class EntityDolphin extends EntityWaterAnimal { + } + + public int getMoistness() { +- return (Integer) this.datawatcher.get(EntityDolphin.bv); ++ return this.datawatcher.get(EntityDolphin.bv); + } + + public void setMoistness(int i) { +@@ -124,7 +124,7 @@ public class EntityDolphin extends EntityWaterAnimal { + boolean flag = entity.damageEntity(DamageSource.mobAttack(this), (float) ((int) this.b(GenericAttributes.ATTACK_DAMAGE))); + + if (flag) { +- this.a((EntityLiving) this, entity); ++ this.a(this, entity); + this.playSound(SoundEffects.ENTITY_DOLPHIN_ATTACK, 1.0F, 1.0F); + } + +@@ -204,7 +204,7 @@ public class EntityDolphin extends EntityWaterAnimal { + } + + if (this.onGround) { +- this.setMot(this.getMot().add((double) ((this.random.nextFloat() * 2.0F - 1.0F) * 0.2F), 0.5D, (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 0.2F))); ++ this.setMot(this.getMot().add((this.random.nextFloat() * 2.0F - 1.0F) * 0.2F, 0.5D, (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F)); + this.yaw = this.random.nextFloat() * 360.0F; + this.onGround = false; + this.impulse = true; +@@ -230,7 +230,7 @@ public class EntityDolphin extends EntityWaterAnimal { + protected EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) { + ItemStack itemstack = entityhuman.b(enumhand); + +- if (!itemstack.isEmpty() && itemstack.getItem().a((Tag) TagsItem.FISHES)) { ++ if (!itemstack.isEmpty() && itemstack.getItem().a(TagsItem.FISHES)) { + if (!this.world.isClientSide) { + this.playSound(SoundEffects.ENTITY_DOLPHIN_EAT, 1.0F, 1.0F); + } +@@ -247,7 +247,7 @@ public class EntityDolphin extends EntityWaterAnimal { + } + + public static boolean b(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { +- return blockposition.getY() > 45 && blockposition.getY() < generatoraccess.getSeaLevel() && (generatoraccess.getBiome(blockposition) != Biomes.OCEAN || generatoraccess.getBiome(blockposition) != Biomes.DEEP_OCEAN) && generatoraccess.getFluid(blockposition).a((Tag) TagsFluid.WATER); ++ return blockposition.getY() > 45 && blockposition.getY() < generatoraccess.getSeaLevel() && (generatoraccess.getBiome(blockposition) != Biomes.OCEAN || generatoraccess.getBiome(blockposition) != Biomes.DEEP_OCEAN) && generatoraccess.getFluid(blockposition).a(TagsFluid.WATER); + } + + @Override +@@ -280,7 +280,7 @@ public class EntityDolphin extends EntityWaterAnimal { + protected boolean eO() { + BlockPosition blockposition = this.getNavigation().h(); + +- return blockposition != null ? blockposition.a((IPosition) this.getPositionVector(), 12.0D) : false; ++ return blockposition != null ? blockposition.a(this.getPositionVector(), 12.0D) : false; + } + + @Override +@@ -327,7 +327,7 @@ public class EntityDolphin extends EntityWaterAnimal { + public boolean b() { + BlockPosition blockposition = this.a.getTreasurePos(); + +- return !(new BlockPosition((double) blockposition.getX(), this.a.locY(), (double) blockposition.getZ())).a((IPosition) this.a.getPositionVector(), 4.0D) && !this.b && this.a.getAirTicks() >= 100; ++ return !(new BlockPosition(blockposition.getX(), this.a.locY(), blockposition.getZ())).a(this.a.getPositionVector(), 4.0D) && !this.b && this.a.getAirTicks() >= 100; + } + + @Override +@@ -363,7 +363,7 @@ public class EntityDolphin extends EntityWaterAnimal { + public void d() { + BlockPosition blockposition = this.a.getTreasurePos(); + +- if ((new BlockPosition((double) blockposition.getX(), this.a.locY(), (double) blockposition.getZ())).a((IPosition) this.a.getPositionVector(), 4.0D) || this.b) { ++ if ((new BlockPosition(blockposition.getX(), this.a.locY(), blockposition.getZ())).a(this.a.getPositionVector(), 4.0D) || this.b) { + this.a.setGotFish(false); + } + +@@ -374,7 +374,7 @@ public class EntityDolphin extends EntityWaterAnimal { + World world = this.a.world; + + if (this.a.eO() || this.a.getNavigation().m()) { +- Vec3D vec3d = Vec3D.a((BaseBlockPosition) this.a.getTreasurePos()); ++ Vec3D vec3d = Vec3D.a(this.a.getTreasurePos()); + Vec3D vec3d1 = RandomPositionGenerator.a(this.a, 16, 1, vec3d, 0.39269909262657166D); + + if (vec3d1 == null) { +@@ -384,7 +384,7 @@ public class EntityDolphin extends EntityWaterAnimal { + if (vec3d1 != null) { + BlockPosition blockposition = new BlockPosition(vec3d1); + +- if (!world.getFluid(blockposition).a((Tag) TagsFluid.WATER) || !world.getType(blockposition).a((IBlockAccess) world, blockposition, PathMode.WATER)) { ++ if (!world.getFluid(blockposition).a(TagsFluid.WATER) || !world.getType(blockposition).a(world, blockposition, PathMode.WATER)) { + vec3d1 = RandomPositionGenerator.b(this.a, 8, 5, vec3d); + } + } +@@ -418,7 +418,7 @@ public class EntityDolphin extends EntityWaterAnimal { + + @Override + public boolean a() { +- this.c = this.a.world.a(EntityDolphin.bw, (EntityLiving) this.a); ++ this.c = this.a.world.a(EntityDolphin.bw, this.a); + return this.c == null ? false : this.c.isSwimming() && this.a.getGoalTarget() != this.c; + } + +@@ -444,7 +444,7 @@ public class EntityDolphin extends EntityWaterAnimal { + if (this.a.h((Entity) this.c) < 6.25D) { + this.a.getNavigation().o(); + } else { +- this.a.getNavigation().a((Entity) this.c, this.b); ++ this.a.getNavigation().a(this.c, this.b); + } + + if (this.c.isSwimming() && this.c.world.random.nextInt(6) == 0) { +@@ -476,7 +476,7 @@ public class EntityDolphin extends EntityWaterAnimal { + List list = EntityDolphin.this.world.a(EntityItem.class, EntityDolphin.this.getBoundingBox().grow(8.0D, 8.0D, 8.0D), EntityDolphin.b); + + if (!list.isEmpty()) { +- EntityDolphin.this.getNavigation().a((Entity) list.get(0), 1.2000000476837158D); ++ EntityDolphin.this.getNavigation().a(list.get(0), 1.2000000476837158D); + EntityDolphin.this.playSound(SoundEffects.ENTITY_DOLPHIN_PLAY, 1.0F, 1.0F); + } + +@@ -504,7 +504,7 @@ public class EntityDolphin extends EntityWaterAnimal { + this.a(itemstack); + EntityDolphin.this.setSlot(EnumItemSlot.MAINHAND, ItemStack.b); + } else if (!list.isEmpty()) { +- EntityDolphin.this.getNavigation().a((Entity) list.get(0), 1.2000000476837158D); ++ EntityDolphin.this.getNavigation().a(list.get(0), 1.2000000476837158D); + } + + } +@@ -520,7 +520,7 @@ public class EntityDolphin extends EntityWaterAnimal { + float f1 = EntityDolphin.this.random.nextFloat() * 6.2831855F; + float f2 = 0.02F * EntityDolphin.this.random.nextFloat(); + +- entityitem.setMot((double) (0.3F * -MathHelper.sin(EntityDolphin.this.yaw * 0.017453292F) * MathHelper.cos(EntityDolphin.this.pitch * 0.017453292F) + MathHelper.cos(f1) * f2), (double) (0.3F * MathHelper.sin(EntityDolphin.this.pitch * 0.017453292F) * 1.5F), (double) (0.3F * MathHelper.cos(EntityDolphin.this.yaw * 0.017453292F) * MathHelper.cos(EntityDolphin.this.pitch * 0.017453292F) + MathHelper.sin(f1) * f2)); ++ entityitem.setMot(0.3F * -MathHelper.sin(EntityDolphin.this.yaw * 0.017453292F) * MathHelper.cos(EntityDolphin.this.pitch * 0.017453292F) + MathHelper.cos(f1) * f2, 0.3F * MathHelper.sin(EntityDolphin.this.pitch * 0.017453292F) * 1.5F, 0.3F * MathHelper.cos(EntityDolphin.this.yaw * 0.017453292F) * MathHelper.cos(EntityDolphin.this.pitch * 0.017453292F) + MathHelper.sin(f1) * f2); + EntityDolphin.this.world.addEntity(entityitem); + } + } +@@ -559,7 +559,7 @@ public class EntityDolphin extends EntityWaterAnimal { + + if (this.i.isInWater()) { + this.i.n(f1 * 0.02F); +- float f2 = -((float) (MathHelper.d(d1, (double) MathHelper.sqrt(d0 * d0 + d2 * d2)) * 57.2957763671875D)); ++ float f2 = -((float) (MathHelper.d(d1, MathHelper.sqrt(d0 * d0 + d2 * d2)) * 57.2957763671875D)); + + f2 = MathHelper.a(MathHelper.g(f2), -85.0F, 85.0F); + this.i.pitch = this.a(this.i.pitch, f2, 5.0F); +diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java +index d8a8c62daa9bceb98ec70f745c351e6d162d35d8..e07d3a565d730d86efe4346ec4ace8b340ba1d37 100644 +--- a/src/main/java/net/minecraft/server/EntityDrowned.java ++++ b/src/main/java/net/minecraft/server/EntityDrowned.java +@@ -47,7 +47,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + + public static boolean b(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { + BiomeBase biomebase = generatoraccess.getBiome(blockposition); +- boolean flag = generatoraccess.getDifficulty() != EnumDifficulty.PEACEFUL && a(generatoraccess, blockposition, random) && (enummobspawn == EnumMobSpawn.SPAWNER || generatoraccess.getFluid(blockposition).a((Tag) TagsFluid.WATER)); ++ boolean flag = generatoraccess.getDifficulty() != EnumDifficulty.PEACEFUL && a(generatoraccess, blockposition, random) && (enummobspawn == EnumMobSpawn.SPAWNER || generatoraccess.getFluid(blockposition).a(TagsFluid.WATER)); + + return biomebase != Biomes.RIVER && biomebase != Biomes.FROZEN_RIVER ? random.nextInt(40) == 0 && a(generatoraccess, blockposition) && flag : random.nextInt(15) == 0 && flag; + } +@@ -172,7 +172,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + BlockPosition blockposition = pathentity.m(); + + if (blockposition != null) { +- double d0 = this.g((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); ++ double d0 = this.g(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + + if (d0 < 4.0D) { + return true; +@@ -189,7 +189,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + double d0 = entityliving.locX() - this.locX(); + double d1 = entityliving.e(0.3333333333333333D) - entitythrowntrident.locY(); + double d2 = entityliving.locZ() - this.locZ(); +- double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); ++ double d3 = MathHelper.sqrt(d0 * d0 + d2 * d2); + + entitythrowntrident.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4)); + this.playSound(SoundEffects.ENTITY_DROWNED_SHOOT, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F)); +@@ -226,7 +226,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + double d0 = this.b - this.i.locX(); + double d1 = this.c - this.i.locY(); + double d2 = this.d - this.i.locZ(); +- double d3 = (double) MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); ++ double d3 = MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + + d1 /= d3; + float f = (float) (MathHelper.d(d2, d0) * 57.2957763671875D) - 90.0F; +@@ -254,7 +254,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + private final EntityDrowned b; + + public a(EntityDrowned entitydrowned, double d0, boolean flag) { +- super((EntityZombie) entitydrowned, d0, flag); ++ super(entitydrowned, d0, flag); + this.b = entitydrowned; + } + +@@ -324,7 +324,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + BlockPosition blockposition1 = blockposition.b(random.nextInt(20) - 10, 2 - random.nextInt(8), random.nextInt(20) - 10); + + if (this.f.getType(blockposition1).a(Blocks.WATER)) { +- return Vec3D.c((BaseBlockPosition) blockposition1); ++ return Vec3D.c(blockposition1); + } + } + +@@ -355,7 +355,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + protected boolean a(IWorldReader iworldreader, BlockPosition blockposition) { + BlockPosition blockposition1 = blockposition.up(); + +- return iworldreader.isEmpty(blockposition1) && iworldreader.isEmpty(blockposition1.up()) ? iworldreader.getType(blockposition).a((IBlockAccess) iworldreader, blockposition, (Entity) this.g) : false; ++ return iworldreader.isEmpty(blockposition1) && iworldreader.isEmpty(blockposition1.up()) ? iworldreader.getType(blockposition).a(iworldreader, blockposition, this.g) : false; + } + + @Override +@@ -397,7 +397,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + @Override + public void e() { + if (this.a.locY() < (double) (this.c - 1) && (this.a.getNavigation().m() || this.a.eP())) { +- Vec3D vec3d = RandomPositionGenerator.b(this.a, 4, 8, new Vec3D(this.a.locX(), (double) (this.c - 1), this.a.locZ())); ++ Vec3D vec3d = RandomPositionGenerator.b(this.a, 4, 8, new Vec3D(this.a.locX(), this.c - 1, this.a.locZ())); + + if (vec3d == null) { + this.d = true; +diff --git a/src/main/java/net/minecraft/server/EntityEnderCrystal.java b/src/main/java/net/minecraft/server/EntityEnderCrystal.java +index be5c79102e6dcb60061267c3d9a5a97386d09ccc..599488e5662876020ee648be026ec120278ec537 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderCrystal.java ++++ b/src/main/java/net/minecraft/server/EntityEnderCrystal.java +@@ -134,7 +134,7 @@ public class EntityEnderCrystal extends Entity { + + @Nullable + public BlockPosition getBeamTarget() { +- return (BlockPosition) ((Optional) this.getDataWatcher().get(EntityEnderCrystal.c)).orElse((Object) null); ++ return (BlockPosition) ((Optional) this.getDataWatcher().get(EntityEnderCrystal.c)).orElse(null); + } + + public void setShowingBottom(boolean flag) { +@@ -142,7 +142,7 @@ public class EntityEnderCrystal extends Entity { + } + + public boolean isShowingBottom() { +- return (Boolean) this.getDataWatcher().get(EntityEnderCrystal.d); ++ return this.getDataWatcher().get(EntityEnderCrystal.d); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java +index c1d52acec510ea20273fc7dc83ae6453ea42990e..e1518c0fea950143d09d4fd3547faefc6397d46b 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java ++++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java +@@ -87,7 +87,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + d0 = this.c[j][1]; + d1 = this.c[k][1] - d0; + adouble[1] = d0 + d1 * (double) f; +- adouble[2] = MathHelper.d((double) f, this.c[j][2], this.c[k][2]); ++ adouble[2] = MathHelper.d(f, this.c[j][2], this.c[k][2]); + return adouble; + } + +@@ -139,7 +139,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + } else { + if (this.d < 0) { + for (int i = 0; i < this.c.length; ++i) { +- this.c[i][0] = (double) this.yaw; ++ this.c[i][0] = this.yaw; + this.c[i][1] = this.locY(); + } + } +@@ -148,7 +148,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + this.d = 0; + } + +- this.c[this.d][0] = (double) this.yaw; ++ this.c[this.d][0] = this.yaw; + this.c[this.d][1] = this.locY(); + double d0; + double d1; +@@ -188,17 +188,17 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + d2 = vec3d1.z - this.locZ(); + double d4 = d0 * d0 + d1 * d1 + d2 * d2; + float f5 = idragoncontroller.f(); +- double d5 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); ++ double d5 = MathHelper.sqrt(d0 * d0 + d2 * d2); + + if (d5 > 0.0D) { +- d1 = MathHelper.a(d1 / d5, (double) (-f5), (double) f5); ++ d1 = MathHelper.a(d1 / d5, -f5, f5); + } + + this.setMot(this.getMot().add(0.0D, d1 * 0.01D, 0.0D)); + this.yaw = MathHelper.g(this.yaw); + double d6 = MathHelper.a(MathHelper.g(180.0D - MathHelper.d(d0, d2) * 57.2957763671875D - (double) this.yaw), -50.0D, 50.0D); + Vec3D vec3d2 = vec3d1.a(this.locX(), this.locY(), this.locZ()).d(); +- Vec3D vec3d3 = (new Vec3D((double) MathHelper.sin(this.yaw * 0.017453292F), this.getMot().y, (double) (-MathHelper.cos(this.yaw * 0.017453292F)))).d(); ++ Vec3D vec3d3 = (new Vec3D(MathHelper.sin(this.yaw * 0.017453292F), this.getMot().y, -MathHelper.cos(this.yaw * 0.017453292F))).d(); + + f3 = Math.max(((float) vec3d3.b(vec3d2) + 0.5F) / 1.5F, 0.0F); + this.bA *= 0.8F; +@@ -235,9 +235,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + float f11 = MathHelper.sin(f10); + float f12 = MathHelper.cos(f10); + +- this.a(this.bG, (double) (f11 * 0.5F), 0.0D, (double) (-f12 * 0.5F)); +- this.a(this.bK, (double) (f12 * 4.5F), 2.0D, (double) (f11 * 4.5F)); +- this.a(this.bL, (double) (f12 * -4.5F), 2.0D, (double) (f11 * -4.5F)); ++ this.a(this.bG, f11 * 0.5F, 0.0D, -f12 * 0.5F); ++ this.a(this.bK, f12 * 4.5F, 2.0D, f11 * 4.5F); ++ this.a(this.bL, f12 * -4.5F, 2.0D, f11 * -4.5F); + if (!this.world.isClientSide && this.hurtTicks == 0) { + this.a(this.world.getEntities(this, this.bK.getBoundingBox().grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D), IEntitySelector.e)); + this.a(this.world.getEntities(this, this.bL.getBoundingBox().grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D), IEntitySelector.e)); +@@ -249,8 +249,8 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + float f14 = MathHelper.cos(this.yaw * 0.017453292F - this.bA * 0.01F); + float f15 = this.eN(); + +- this.a(this.bv, (double) (f13 * 6.5F * f8), (double) (f15 + f9 * 6.5F), (double) (-f14 * 6.5F * f8)); +- this.a(this.bF, (double) (f13 * 5.5F * f8), (double) (f15 + f9 * 5.5F), (double) (-f14 * 5.5F * f8)); ++ this.a(this.bv, f13 * 6.5F * f8, f15 + f9 * 6.5F, -f14 * 6.5F * f8); ++ this.a(this.bF, f13 * 5.5F * f8, f15 + f9 * 5.5F, -f14 * 5.5F * f8); + double[] adouble = this.a(5, 1.0F); + + int k; +@@ -277,7 +277,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + + f3 = 1.5F; + f4 = (float) (k + 1) * 2.0F; +- this.a(entitycomplexpart, (double) (-(f11 * 1.5F + f17 * f4) * f8), adouble1[1] - adouble[1] - (double) ((f4 + 1.5F) * f9) + 1.5D, (double) ((f12 * 1.5F + f18 * f4) * f8)); ++ this.a(entitycomplexpart, -(f11 * 1.5F + f17 * f4) * f8, adouble1[1] - adouble[1] - (double) ((f4 + 1.5F) * f9) + 1.5D, (f12 * 1.5F + f18 * f4) * f8); + } + + if (!this.world.isClientSide) { +@@ -368,7 +368,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + entity.h(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D); + if (!this.bN.a().a() && ((EntityLiving) entity).cZ() < entity.ticksLived - 2) { + entity.damageEntity(DamageSource.mobAttack(this), 5.0F); +- this.a((EntityLiving) this, entity); ++ this.a(this, entity); + } + } + } +@@ -383,7 +383,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + + if (entity instanceof EntityLiving) { + entity.damageEntity(DamageSource.mobAttack(this), 10.0F); +- this.a((EntityLiving) this, entity); ++ this.a(this, entity); + } + } + +@@ -575,8 +575,8 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + if (this.deathAnimationTicks == 1 && !this.isSilent()) { + // CraftBukkit start - Use relative location for far away sounds + // this.world.b(1028, this.getChunkCoordinates(), 0); +- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API +- for (EntityPlayer player : (List) ((WorldServer)world).getPlayers()) { ++ int viewDistance = this.world.getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API ++ for (EntityPlayer player : ((WorldServer)world).getPlayers()) { + // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch + // Paper end + double deltaX = this.locX() - player.locX(); +@@ -914,7 +914,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + if (damagesource.getEntity() instanceof EntityHuman) { + entityhuman = (EntityHuman) damagesource.getEntity(); + } else { +- entityhuman = this.world.a(EntityEnderDragon.bD, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); ++ entityhuman = this.world.a(EntityEnderDragon.bD, blockposition.getX(), blockposition.getY(), blockposition.getZ()); + } + + if (entityendercrystal == this.currentEnderCrystal) { +@@ -927,7 +927,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + @Override + public void a(DataWatcherObject datawatcherobject) { + if (EntityEnderDragon.PHASE.equals(datawatcherobject) && this.world.isClientSide) { +- this.bN.setControllerPhase(DragonControllerPhase.getById((Integer) this.getDataWatcher().get(EntityEnderDragon.PHASE))); ++ this.bN.setControllerPhase(DragonControllerPhase.getById(this.getDataWatcher().get(EntityEnderDragon.PHASE))); + } + + super.a(datawatcherobject); +diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java +index 290e1e198ec76c3fc08e273371e9d7ab3375df9f..fd10d25dceee235420860c7f54b7ee7d1b8d8fb4 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderPearl.java ++++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java +@@ -54,7 +54,7 @@ public class EntityEnderPearl extends EntityProjectileThrowable { + + if (!teleEvent.isCancelled() && !entityplayer.playerConnection.isDisconnected()) { + if (this.random.nextFloat() < 0.05F && this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING)) { +- EntityEndermite entityendermite = (EntityEndermite) EntityTypes.ENDERMITE.a(this.world); ++ EntityEndermite entityendermite = EntityTypes.ENDERMITE.a(this.world); + + entityendermite.setPlayerSpawned(true); + entityendermite.setPositionRotation(entity.locX(), entity.locY(), entity.locZ(), entity.yaw, entity.pitch); +@@ -101,7 +101,7 @@ public class EntityEnderPearl extends EntityProjectileThrowable { + Entity entity = this.getShooter(); + + if (entity != null && entity.world.getDimensionKey() != worldserver.getDimensionKey()) { +- this.setShooter((Entity) null); ++ this.setShooter(null); + } + + return super.a(worldserver); +diff --git a/src/main/java/net/minecraft/server/EntityEnderSignal.java b/src/main/java/net/minecraft/server/EntityEnderSignal.java +index 82a5aaf5bbffba1e60d15912d173a85425588326..63a61bb97c80f60e7bb6c6742954db72b92a9d0c 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderSignal.java ++++ b/src/main/java/net/minecraft/server/EntityEnderSignal.java +@@ -36,7 +36,7 @@ public class EntityEnderSignal extends Entity { + } + + private ItemStack h() { +- return (ItemStack) this.getDataWatcher().get(EntityEnderSignal.b); ++ return this.getDataWatcher().get(EntityEnderSignal.b); + } + + public ItemStack g() { +@@ -51,9 +51,9 @@ public class EntityEnderSignal extends Entity { + } + + public void a(BlockPosition blockposition) { +- double d0 = (double) blockposition.getX(); ++ double d0 = blockposition.getX(); + int i = blockposition.getY(); +- double d1 = (double) blockposition.getZ(); ++ double d1 = blockposition.getZ(); + double d2 = d0 - this.locX(); + double d3 = d1 - this.locZ(); + float f = MathHelper.sqrt(d2 * d2 + d3 * d3); +@@ -64,7 +64,7 @@ public class EntityEnderSignal extends Entity { + this.targetY = this.locY() + 8.0D; + } else { + this.targetX = d0; +- this.targetY = (double) i; ++ this.targetY = i; + this.targetZ = d1; + } + +@@ -81,14 +81,14 @@ public class EntityEnderSignal extends Entity { + double d2 = this.locZ() + vec3d.z; + float f = MathHelper.sqrt(b(vec3d)); + +- this.pitch = IProjectile.e(this.lastPitch, (float) (MathHelper.d(vec3d.y, (double) f) * 57.2957763671875D)); ++ this.pitch = IProjectile.e(this.lastPitch, (float) (MathHelper.d(vec3d.y, f) * 57.2957763671875D)); + this.yaw = IProjectile.e(this.lastYaw, (float) (MathHelper.d(vec3d.x, vec3d.z) * 57.2957763671875D)); + if (!this.world.isClientSide) { + double d3 = this.targetX - d0; + double d4 = this.targetZ - d2; + float f1 = (float) Math.sqrt(d3 * d3 + d4 * d4); + float f2 = (float) MathHelper.d(d4, d3); +- double d5 = MathHelper.d(0.0025D, (double) f, (double) f1); ++ double d5 = MathHelper.d(0.0025D, f, f1); + double d6 = vec3d.y; + + if (f1 < 1.0F) { +@@ -98,7 +98,7 @@ public class EntityEnderSignal extends Entity { + + int i = this.locY() < this.targetY ? 1 : -1; + +- vec3d = new Vec3D(Math.cos((double) f2) * d5, d6 + ((double) i - d6) * 0.014999999664723873D, Math.sin((double) f2) * d5); ++ vec3d = new Vec3D(Math.cos(f2) * d5, d6 + ((double) i - d6) * 0.014999999664723873D, Math.sin(f2) * d5); + this.setMot(vec3d); + } + +diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java +index e3f0067ca9981257279d0288c878ccb7786dcb82..7e256e4ae1a878928d2cb4824a5b9d8920821703 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderman.java ++++ b/src/main/java/net/minecraft/server/EntityEnderman.java +@@ -43,7 +43,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + this.goalSelector.a(11, new EntityEnderman.PathfinderGoalEndermanPickupBlock(this)); + this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::b)); + this.targetSelector.a(2, new EntityEnderman.PathfinderGoalPlayerWhoLookedAtTarget(this)); +- this.targetSelector.a(3, new PathfinderGoalHurtByTarget(this, new Class[0])); ++ this.targetSelector.a(3, new PathfinderGoalHurtByTarget(this)); + this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityEndermite.class, 10, true, false, EntityEnderman.bx)); + this.targetSelector.a(5, new PathfinderGoalUniversalAngerReset<>(this, false)); + } +@@ -178,7 +178,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + } + private boolean g_real(EntityHuman entityhuman) { + // Paper end +- ItemStack itemstack = (ItemStack) entityhuman.inventory.armor.get(3); ++ ItemStack itemstack = entityhuman.inventory.armor.get(3); + + if (itemstack.getItem() == Blocks.CARVED_PUMPKIN.getItem()) { + return false; +@@ -226,7 +226,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + float f = this.aO(); + + if (f > 0.5F && this.world.f(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper +- this.setGoalTarget((EntityLiving) null); ++ this.setGoalTarget(null); + this.eM(); + } + } +@@ -268,13 +268,13 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + + IBlockData iblockdata = this.world.getType(blockposition_mutableblockposition); + boolean flag = iblockdata.getMaterial().isSolid(); +- boolean flag1 = iblockdata.getFluid().a((Tag) TagsFluid.WATER); ++ boolean flag1 = iblockdata.getFluid().a(TagsFluid.WATER); + + if (flag && !flag1) { + boolean flag2 = this.a(d0, d1, d2, true); + + if (flag2 && !this.isSilent()) { +- this.world.playSound((EntityHuman) null, this.lastX, this.lastY, this.lastZ, SoundEffects.ENTITY_ENDERMAN_TELEPORT, this.getSoundCategory(), 1.0F, 1.0F); ++ this.world.playSound(null, this.lastX, this.lastY, this.lastZ, SoundEffects.ENTITY_ENDERMAN_TELEPORT, this.getSoundCategory(), 1.0F, 1.0F); + this.playSound(SoundEffects.ENTITY_ENDERMAN_TELEPORT, 1.0F, 1.0F); + } + +@@ -305,7 +305,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + IBlockData iblockdata = this.getCarried(); + + if (iblockdata != null) { +- this.a((IMaterial) iblockdata.getBlock()); ++ this.a(iblockdata.getBlock()); + } + + } +@@ -316,7 +316,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + + @Nullable + public IBlockData getCarried() { +- return (IBlockData) ((Optional) this.datawatcher.get(EntityEnderman.d)).orElse((Object) null); ++ return (IBlockData) ((Optional) this.datawatcher.get(EntityEnderman.d)).orElse(null); + } + + @Override +@@ -345,11 +345,11 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + } + + public boolean eO() { +- return (Boolean) this.datawatcher.get(EntityEnderman.bv); ++ return this.datawatcher.get(EntityEnderman.bv); + } + + public boolean eP() { +- return (Boolean) this.datawatcher.get(EntityEnderman.bw); ++ return this.datawatcher.get(EntityEnderman.bw); + } + + public void eQ() { +@@ -390,7 +390,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + MovingObjectPositionBlock movingobjectpositionblock = world.rayTrace(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.OUTLINE, RayTrace.FluidCollisionOption.NONE, this.enderman)); + boolean flag = movingobjectpositionblock.getBlockPosition().equals(blockposition); + +- if (block.a((Tag) TagsBlock.ENDERMAN_HOLDABLE) && flag) { ++ if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) { + // CraftBukkit start - Pickup event + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { + //this.enderman.setCarried(iblockdata); // Paper - moved down +@@ -435,7 +435,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + // CraftBukkit start - Place event + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, iblockdata2).isCancelled()) { + world.setTypeAndData(blockposition, iblockdata2, 3); +- this.a.setCarried((IBlockData) null); ++ this.a.setCarried(null); + } + // CraftBukkit end + } +@@ -499,7 +499,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + + @Override + public boolean a() { +- this.j = this.i.world.a(this.m, (EntityLiving) this.i); ++ this.j = this.i.world.a(this.m, this.i); + return this.j != null; + } + +@@ -522,7 +522,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + if (!this.i.g(this.j)) { + return false; + } else { +- this.i.a((Entity) this.j, 10.0F, 10.0F); ++ this.i.a(this.j, 10.0F, 10.0F); + return true; + } + } else { +@@ -550,7 +550,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + } + + this.l = 0; +- } else if (this.c.h((Entity) this.i) > 256.0D && this.l++ >= 30 && this.i.a((Entity) this.c)) { ++ } else if (this.c.h((Entity) this.i) > 256.0D && this.l++ >= 30 && this.i.a(this.c)) { + this.l = 0; + } + } +diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java +index 1e69d270c9a13a9d34e6a9abd4f1c9715d96a447..61995b856645cce3ecb0bfd98565fd2bf32e56c0 100644 +--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java ++++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java +@@ -99,14 +99,14 @@ public class EntityExperienceOrb extends Entity { + this.lastX = this.locX(); + this.lastY = this.locY(); + this.lastZ = this.locZ(); +- if (this.a((Tag) TagsFluid.WATER)) { ++ if (this.a(TagsFluid.WATER)) { + this.i(); + } else if (!this.isNoGravity()) { + this.setMot(this.getMot().add(0.0D, -0.03D, 0.0D)); + } + +- if (this.world.getFluid(this.getChunkCoordinates()).a((Tag) TagsFluid.LAVA)) { +- this.setMot((double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F), 0.20000000298023224D, (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F)); ++ if (this.world.getFluid(this.getChunkCoordinates()).a(TagsFluid.LAVA)) { ++ this.setMot((this.random.nextFloat() - this.random.nextFloat()) * 0.2F, 0.20000000298023224D, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); + this.playSound(SoundEffects.ENTITY_GENERIC_BURN, 0.4F, 2.0F + this.random.nextFloat() * 0.4F); + } + +@@ -117,7 +117,7 @@ public class EntityExperienceOrb extends Entity { + double d0 = 8.0D; + + if (this.targetTime < this.b - 20 + this.getId() % 100) { +- if (this.targetPlayer == null || this.targetPlayer.h((Entity) this) > 64.0D) { ++ if (this.targetPlayer == null || this.targetPlayer.h(this) > 64.0D) { + this.targetPlayer = this.world.findNearbyPlayer(this, 8.0D); + } + +@@ -161,7 +161,7 @@ public class EntityExperienceOrb extends Entity { + f = this.world.getType(new BlockPosition(this.locX(), this.locY() - 1.0D, this.locZ())).getBlock().getFrictionFactor() * 0.98F; + } + +- this.setMot(this.getMot().d((double) f, 0.98D, (double) f)); ++ this.setMot(this.getMot().d(f, 0.98D, f)); + if (this.onGround) { + this.setMot(this.getMot().d(1.0D, -0.9D, 1.0D)); + } +@@ -220,10 +220,10 @@ public class EntityExperienceOrb extends Entity { + if (this.d == 0 && entityhuman.bB == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper + entityhuman.bB = 2; + entityhuman.receive(this, 1); +- Entry entry = EnchantmentManager.a(Enchantments.MENDING, (EntityLiving) entityhuman, ItemStack::f); ++ Entry entry = EnchantmentManager.a(Enchantments.MENDING, entityhuman, ItemStack::f); + + if (entry != null) { +- ItemStack itemstack = (ItemStack) entry.getValue(); ++ ItemStack itemstack = entry.getValue(); + + if (!itemstack.isEmpty() && itemstack.f()) { + int i = Math.min(this.c(this.value), itemstack.getDamage()); +diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java +index 9c6ee54e4efd7c6f49cb179c4fa57b10895eb96a..0da167b61497077361e71107142ca60c45ed9ad7 100644 +--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java ++++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java +@@ -110,13 +110,13 @@ public class EntityFallingBlock extends Entity { + if (!this.world.isClientSide) { + blockposition = this.getChunkCoordinates(); + boolean flag = this.block.getBlock() instanceof BlockConcretePowder; +- boolean flag1 = flag && this.world.getFluid(blockposition).a((Tag) TagsFluid.WATER); ++ boolean flag1 = flag && this.world.getFluid(blockposition).a(TagsFluid.WATER); + double d0 = this.getMot().g(); + + if (flag && d0 > 1.0D) { + MovingObjectPositionBlock movingobjectpositionblock = this.world.rayTrace(new RayTrace(new Vec3D(this.lastX, this.lastY, this.lastZ), this.getPositionVector(), RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.SOURCE_ONLY, this)); + +- if (movingobjectpositionblock.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && this.world.getFluid(movingobjectpositionblock.getBlockPosition()).a((Tag) TagsFluid.WATER)) { ++ if (movingobjectpositionblock.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && this.world.getFluid(movingobjectpositionblock.getBlockPosition()).a(TagsFluid.WATER)) { + blockposition = movingobjectpositionblock.getBlockPosition(); + flag1 = true; + } +@@ -125,7 +125,7 @@ public class EntityFallingBlock extends Entity { + if (!this.onGround && !flag1) { + if (!this.world.isClientSide && (this.ticksLived > 100 && (blockposition.getY() < 1 || blockposition.getY() > 256) || this.ticksLived > 600)) { + if (this.dropItem && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { +- this.a((IMaterial) block); ++ this.a(block); + } + + this.die(); +@@ -137,13 +137,13 @@ public class EntityFallingBlock extends Entity { + if (!iblockdata.a(Blocks.MOVING_PISTON)) { + this.die(); + if (!this.g) { +- boolean flag2 = iblockdata.a((BlockActionContext) (new BlockActionContextDirectional(this.world, blockposition, EnumDirection.DOWN, ItemStack.b, EnumDirection.UP))); ++ boolean flag2 = iblockdata.a(new BlockActionContextDirectional(this.world, blockposition, EnumDirection.DOWN, ItemStack.b, EnumDirection.UP)); + boolean flag3 = BlockFalling.canFallThrough(this.world.getType(blockposition.down())) && (!flag || !flag1); + boolean flag4 = this.block.canPlace(this.world, blockposition) && !flag3; + + if (flag2 && flag4) { + if (this.block.b(BlockProperties.C) && this.world.getFluid(blockposition).getType() == FluidTypes.WATER) { +- this.block = (IBlockData) this.block.set(BlockProperties.C, true); ++ this.block = this.block.set(BlockProperties.C, true); + } + + // CraftBukkit start +@@ -177,10 +177,10 @@ public class EntityFallingBlock extends Entity { + } + } + } else if (this.dropItem && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { +- this.a((IMaterial) block); ++ this.a(block); + } + } else if (this.dropItem && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { +- this.a((IMaterial) block); ++ this.a(block); + } + } else if (block instanceof BlockFalling) { + ((BlockFalling) block).a(this.world, blockposition, this); +@@ -200,7 +200,7 @@ public class EntityFallingBlock extends Entity { + + if (i > 0) { + List list = Lists.newArrayList(this.world.getEntities(this, this.getBoundingBox())); +- boolean flag = this.block.a((Tag) TagsBlock.ANVIL); ++ boolean flag = this.block.a(TagsBlock.ANVIL); + DamageSource damagesource = flag ? DamageSource.ANVIL : DamageSource.FALLING_BLOCK; + Iterator iterator = list.iterator(); + +@@ -256,7 +256,7 @@ public class EntityFallingBlock extends Entity { + this.hurtEntities = nbttagcompound.getBoolean("HurtEntities"); + this.fallHurtAmount = nbttagcompound.getFloat("FallHurtAmount"); + this.fallHurtMax = nbttagcompound.getInt("FallHurtMax"); +- } else if (this.block.a((Tag) TagsBlock.ANVIL)) { ++ } else if (this.block.a(TagsBlock.ANVIL)) { + this.hurtEntities = true; + } + +@@ -289,7 +289,7 @@ public class EntityFallingBlock extends Entity { + @Override + public void appendEntityCrashDetails(CrashReportSystemDetails crashreportsystemdetails) { + super.appendEntityCrashDetails(crashreportsystemdetails); +- crashreportsystemdetails.a("Immitating BlockState", (Object) this.block.toString()); ++ crashreportsystemdetails.a("Immitating BlockState", this.block.toString()); + } + + public IBlockData getBlock() { +diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java +index e54df71af1420e275e13960de621e79c073c2708..6f24a0ccefd7400ff61dd53eb49b95cc0d54d334 100644 +--- a/src/main/java/net/minecraft/server/EntityFireball.java ++++ b/src/main/java/net/minecraft/server/EntityFireball.java +@@ -24,7 +24,7 @@ public abstract class EntityFireball extends IProjectile { + + public void setDirection(double d3, double d4, double d5) { + // CraftBukkit end +- double d6 = (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5); ++ double d6 = MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5); + + if (d6 != 0.0D) { + this.dirX = d3 / d6 * 0.1D; +@@ -120,7 +120,7 @@ public abstract class EntityFireball extends IProjectile { + @Override + public void saveData(NBTTagCompound nbttagcompound) { + super.saveData(nbttagcompound); +- nbttagcompound.set("power", this.a(new double[]{this.dirX, this.dirY, this.dirZ})); ++ nbttagcompound.set("power", this.a(this.dirX, this.dirY, this.dirZ)); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityFireballFireball.java b/src/main/java/net/minecraft/server/EntityFireballFireball.java +index 73985655ea0fb3ce618accf2f38308062f8821f9..c3cd52c7c3e2f3a6370fc1c71976333183bd9fe4 100644 +--- a/src/main/java/net/minecraft/server/EntityFireballFireball.java ++++ b/src/main/java/net/minecraft/server/EntityFireballFireball.java +@@ -26,7 +26,7 @@ public abstract class EntityFireballFireball extends EntityFireball { + } + + public ItemStack getItem() { +- return (ItemStack) this.getDataWatcher().get(EntityFireballFireball.e); ++ return this.getDataWatcher().get(EntityFireballFireball.e); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java +index a6e55a9754cd1970a928732f85f6b88315ce6620..5360aa348497ed253327684f1ca75761924457a6 100644 +--- a/src/main/java/net/minecraft/server/EntityFireworks.java ++++ b/src/main/java/net/minecraft/server/EntityFireworks.java +@@ -87,7 +87,7 @@ public class EntityFireworks extends IProjectile { + + if (this.n()) { + if (this.ridingEntity == null) { +- ((OptionalInt) this.datawatcher.get(EntityFireworks.c)).ifPresent((i) -> { ++ this.datawatcher.get(EntityFireworks.c).ifPresent((i) -> { + Entity entity = this.world.getEntity(i); + + if (entity instanceof EntityLiving) { +@@ -128,7 +128,7 @@ public class EntityFireworks extends IProjectile { + + this.x(); + if (this.ticksFlown == 0 && !this.isSilent()) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_FIREWORK_ROCKET_LAUNCH, SoundCategory.AMBIENT, 3.0F, 1.0F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_FIREWORK_ROCKET_LAUNCH, SoundCategory.AMBIENT, 3.0F, 1.0F); + } + + ++this.ticksFlown; +@@ -168,7 +168,7 @@ public class EntityFireworks extends IProjectile { + protected void a(MovingObjectPositionBlock movingobjectpositionblock) { + BlockPosition blockposition = new BlockPosition(movingobjectpositionblock.getBlockPosition()); + +- this.world.getType(blockposition).a(this.world, blockposition, (Entity) this); ++ this.world.getType(blockposition).a(this.world, blockposition, this); + if (!this.world.s_() && this.hasExplosions()) { + // CraftBukkit start + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callFireworkExplodeEvent(this).isCancelled()) { +@@ -181,7 +181,7 @@ public class EntityFireworks extends IProjectile { + } + + private boolean hasExplosions() { +- ItemStack itemstack = (ItemStack) this.datawatcher.get(EntityFireworks.FIREWORK_ITEM); ++ ItemStack itemstack = this.datawatcher.get(EntityFireworks.FIREWORK_ITEM); + NBTTagCompound nbttagcompound = itemstack.isEmpty() ? null : itemstack.b("Fireworks"); + NBTTagList nbttaglist = nbttagcompound != null ? nbttagcompound.getList("Explosions", 10) : null; + +@@ -190,7 +190,7 @@ public class EntityFireworks extends IProjectile { + + private void m() { + float f = 0.0F; +- ItemStack itemstack = (ItemStack) this.datawatcher.get(EntityFireworks.FIREWORK_ITEM); ++ ItemStack itemstack = this.datawatcher.get(EntityFireworks.FIREWORK_ITEM); + NBTTagCompound nbttagcompound = itemstack.isEmpty() ? null : itemstack.b("Fireworks"); + NBTTagList nbttaglist = nbttagcompound != null ? nbttagcompound.getList("Explosions", 10) : null; + +@@ -240,11 +240,11 @@ public class EntityFireworks extends IProjectile { + } + + private boolean n() { +- return ((OptionalInt) this.datawatcher.get(EntityFireworks.c)).isPresent(); ++ return this.datawatcher.get(EntityFireworks.c).isPresent(); + } + + public boolean isShotAtAngle() { +- return (Boolean) this.datawatcher.get(EntityFireworks.SHOT_AT_ANGLE); ++ return this.datawatcher.get(EntityFireworks.SHOT_AT_ANGLE); + } + + @Override +@@ -252,13 +252,13 @@ public class EntityFireworks extends IProjectile { + super.saveData(nbttagcompound); + nbttagcompound.setInt("Life", this.ticksFlown); + nbttagcompound.setInt("LifeTime", this.expectedLifespan); +- ItemStack itemstack = (ItemStack) this.datawatcher.get(EntityFireworks.FIREWORK_ITEM); ++ ItemStack itemstack = this.datawatcher.get(EntityFireworks.FIREWORK_ITEM); + + if (!itemstack.isEmpty()) { + nbttagcompound.set("FireworksItem", itemstack.save(new NBTTagCompound())); + } + +- nbttagcompound.setBoolean("ShotAtAngle", (Boolean) this.datawatcher.get(EntityFireworks.SHOT_AT_ANGLE)); ++ nbttagcompound.setBoolean("ShotAtAngle", this.datawatcher.get(EntityFireworks.SHOT_AT_ANGLE)); + // Paper start + if (this.spawningEntity != null) { + nbttagcompound.setUUID("SpawningEntity", this.spawningEntity); +diff --git a/src/main/java/net/minecraft/server/EntityFish.java b/src/main/java/net/minecraft/server/EntityFish.java +index db1ede61c5b06fbb20c53230faddbe704b7edd50..853298aba8cd4af144952f83753f93554b6ed868 100644 +--- a/src/main/java/net/minecraft/server/EntityFish.java ++++ b/src/main/java/net/minecraft/server/EntityFish.java +@@ -47,7 +47,7 @@ public abstract class EntityFish extends EntityWaterAnimal { + } + + public boolean isFromBucket() { +- return (Boolean) this.datawatcher.get(EntityFish.FROM_BUCKET); ++ return this.datawatcher.get(EntityFish.FROM_BUCKET); + } + + public void setFromBucket(boolean flag) { +@@ -102,7 +102,7 @@ public abstract class EntityFish extends EntityWaterAnimal { + @Override + public void movementTick() { + if (!this.isInWater() && this.onGround && this.v) { +- this.setMot(this.getMot().add((double) ((this.random.nextFloat() * 2.0F - 1.0F) * 0.05F), 0.4000000059604645D, (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 0.05F))); ++ this.setMot(this.getMot().add((this.random.nextFloat() * 2.0F - 1.0F) * 0.05F, 0.4000000059604645D, (this.random.nextFloat() * 2.0F - 1.0F) * 0.05F)); + this.onGround = false; + this.impulse = true; + this.playSound(this.getSoundFlop(), this.getSoundVolume(), this.dG()); +@@ -172,7 +172,7 @@ public abstract class EntityFish extends EntityWaterAnimal { + + @Override + public void a() { +- if (this.i.a((Tag) TagsFluid.WATER)) { ++ if (this.i.a(TagsFluid.WATER)) { + this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D)); + } + +@@ -185,7 +185,7 @@ public abstract class EntityFish extends EntityWaterAnimal { + double d2 = this.d - this.i.locZ(); + + if (d1 != 0.0D) { +- double d3 = (double) MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); ++ double d3 = MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + + this.i.setMot(this.i.getMot().add(0.0D, (double) this.i.dM() * (d1 / d3) * 0.1D, 0.0D)); + } +diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java +index a9602613fa80a4ba65ce749c6780b202392457ab..bb6317ed3736cce8c2a2e5d6946dbca265db0649 100644 +--- a/src/main/java/net/minecraft/server/EntityFishingHook.java ++++ b/src/main/java/net/minecraft/server/EntityFishingHook.java +@@ -51,13 +51,13 @@ public class EntityFishingHook extends IProjectile { + double d2 = entityhuman.locZ() - (double) f2 * 0.3D; + + this.setPositionRotation(d0, d1, d2, f1, f); +- Vec3D vec3d = new Vec3D((double) (-f3), (double) MathHelper.a(-(f5 / f4), -5.0F, 5.0F), (double) (-f2)); ++ Vec3D vec3d = new Vec3D(-f3, MathHelper.a(-(f5 / f4), -5.0F, 5.0F), -f2); + double d3 = vec3d.f(); + + vec3d = vec3d.d(0.6D / d3 + 0.5D + this.random.nextGaussian() * 0.0045D, 0.6D / d3 + 0.5D + this.random.nextGaussian() * 0.0045D, 0.6D / d3 + 0.5D + this.random.nextGaussian() * 0.0045D); + this.setMot(vec3d); + this.yaw = (float) (MathHelper.d(vec3d.x, vec3d.z) * 57.2957763671875D); +- this.pitch = (float) (MathHelper.d(vec3d.y, (double) MathHelper.sqrt(b(vec3d))) * 57.2957763671875D); ++ this.pitch = (float) (MathHelper.d(vec3d.y, MathHelper.sqrt(b(vec3d))) * 57.2957763671875D); + this.lastYaw = this.yaw; + this.lastPitch = this.pitch; + } +@@ -71,15 +71,15 @@ public class EntityFishingHook extends IProjectile { + @Override + public void a(DataWatcherObject datawatcherobject) { + if (EntityFishingHook.e.equals(datawatcherobject)) { +- int i = (Integer) this.getDataWatcher().get(EntityFishingHook.e); ++ int i = this.getDataWatcher().get(EntityFishingHook.e); + + this.hooked = i > 0 ? this.world.getEntity(i - 1) : null; + } + + if (EntityFishingHook.f.equals(datawatcherobject)) { +- this.c = (Boolean) this.getDataWatcher().get(EntityFishingHook.f); ++ this.c = this.getDataWatcher().get(EntityFishingHook.f); + if (this.c) { +- this.setMot(this.getMot().x, (double) (-0.4F * MathHelper.a(this.b, 0.6F, 1.0F)), this.getMot().z); ++ this.setMot(this.getMot().x, -0.4F * MathHelper.a(this.b, 0.6F, 1.0F), this.getMot().z); + } + } + +@@ -109,7 +109,7 @@ public class EntityFishingHook extends IProjectile { + BlockPosition blockposition = this.getChunkCoordinates(); + Fluid fluid = this.world.getFluid(blockposition); + +- if (fluid.a((Tag) TagsFluid.WATER)) { ++ if (fluid.a(TagsFluid.WATER)) { + f = fluid.getHeight(this.world, blockposition); + } + +@@ -173,7 +173,7 @@ public class EntityFishingHook extends IProjectile { + } + } + +- if (!fluid.a((Tag) TagsFluid.WATER)) { ++ if (!fluid.a(TagsFluid.WATER)) { + this.setMot(this.getMot().add(0.0D, -0.03D, 0.0D)); + } + +@@ -234,7 +234,7 @@ public class EntityFishingHook extends IProjectile { + @Override + protected void a(MovingObjectPositionBlock movingobjectpositionblock) { + super.a(movingobjectpositionblock); +- this.setMot(this.getMot().d().a(movingobjectpositionblock.a((Entity) this))); ++ this.setMot(this.getMot().d().a(movingobjectpositionblock.a(this))); + } + + private void n() { +@@ -282,19 +282,19 @@ public class EntityFishingHook extends IProjectile { + f1 = MathHelper.sin(f); + f2 = MathHelper.cos(f); + d0 = this.locX() + (double) (f1 * (float) this.ap * 0.1F); +- d1 = (double) ((float) MathHelper.floor(this.locY()) + 1.0F); ++ d1 = (float) MathHelper.floor(this.locY()) + 1.0F; + d2 = this.locZ() + (double) (f2 * (float) this.ap * 0.1F); + iblockdata = worldserver.getType(new BlockPosition(d0, d1 - 1.0D, d2)); + if (iblockdata.a(Blocks.WATER)) { + if (this.random.nextFloat() < 0.15F) { +- worldserver.a(Particles.BUBBLE, d0, d1 - 0.10000000149011612D, d2, 1, (double) f1, 0.1D, (double) f2, 0.0D); ++ worldserver.a(Particles.BUBBLE, d0, d1 - 0.10000000149011612D, d2, 1, f1, 0.1D, f2, 0.0D); + } + + float f3 = f1 * 0.04F; + float f4 = f2 * 0.04F; + +- worldserver.a(Particles.FISHING, d0, d1, d2, 0, (double) f4, 0.01D, (double) (-f3), 1.0D); +- worldserver.a(Particles.FISHING, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D); ++ worldserver.a(Particles.FISHING, d0, d1, d2, 0, f4, 0.01D, -f3, 1.0D); ++ worldserver.a(Particles.FISHING, d0, d1, d2, 0, -f4, 0.01D, f3, 1.0D); + } + } else { + // CraftBukkit start +@@ -307,8 +307,8 @@ public class EntityFishingHook extends IProjectile { + this.playSound(SoundEffects.ENTITY_FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); + double d3 = this.locY() + 0.5D; + +- worldserver.a(Particles.BUBBLE, this.locX(), d3, this.locZ(), (int) (1.0F + this.getWidth() * 20.0F), (double) this.getWidth(), 0.0D, (double) this.getWidth(), 0.20000000298023224D); +- worldserver.a(Particles.FISHING, this.locX(), d3, this.locZ(), (int) (1.0F + this.getWidth() * 20.0F), (double) this.getWidth(), 0.0D, (double) this.getWidth(), 0.20000000298023224D); ++ worldserver.a(Particles.BUBBLE, this.locX(), d3, this.locZ(), (int) (1.0F + this.getWidth() * 20.0F), this.getWidth(), 0.0D, this.getWidth(), 0.20000000298023224D); ++ worldserver.a(Particles.FISHING, this.locX(), d3, this.locZ(), (int) (1.0F + this.getWidth() * 20.0F), this.getWidth(), 0.0D, this.getWidth(), 0.20000000298023224D); + this.an = MathHelper.nextInt(this.random, 20, 40); + this.getDataWatcher().set(EntityFishingHook.f, true); + } +@@ -327,7 +327,7 @@ public class EntityFishingHook extends IProjectile { + f1 = MathHelper.a(this.random, 0.0F, 360.0F) * 0.017453292F; + f2 = MathHelper.a(this.random, 25.0F, 60.0F); + d0 = this.locX() + (double) (MathHelper.sin(f1) * f2 * 0.1F); +- d1 = (double) ((float) MathHelper.floor(this.locY()) + 1.0F); ++ d1 = (float) MathHelper.floor(this.locY()) + 1.0F; + d2 = this.locZ() + (double) (MathHelper.cos(f1) * f2 * 0.1F); + iblockdata = worldserver.getType(new BlockPosition(d0, d1 - 1.0D, d2)); + if (iblockdata.a(Blocks.WATER)) { +@@ -375,9 +375,9 @@ public class EntityFishingHook extends IProjectile { + } + + private EntityFishingHook.WaterPosition a(BlockPosition blockposition, BlockPosition blockposition1) { +- return (EntityFishingHook.WaterPosition) BlockPosition.b(blockposition, blockposition1).map(this::c).reduce((entityfishinghook_waterposition, entityfishinghook_waterposition1) -> { +- return entityfishinghook_waterposition == entityfishinghook_waterposition1 ? entityfishinghook_waterposition : EntityFishingHook.WaterPosition.INVALID; +- }).orElse(EntityFishingHook.WaterPosition.INVALID); ++ return BlockPosition.b(blockposition, blockposition1).map(this::c).reduce((entityfishinghook_waterposition, entityfishinghook_waterposition1) -> { ++ return entityfishinghook_waterposition == entityfishinghook_waterposition1 ? entityfishinghook_waterposition : WaterPosition.INVALID; ++ }).orElse(WaterPosition.INVALID); + } + + private EntityFishingHook.WaterPosition c(BlockPosition blockposition) { +@@ -386,7 +386,7 @@ public class EntityFishingHook extends IProjectile { + if (!iblockdata.isAir() && !iblockdata.a(Blocks.LILY_PAD)) { + Fluid fluid = iblockdata.getFluid(); + +- return fluid.a((Tag) TagsFluid.WATER) && fluid.isSource() && iblockdata.getCollisionShape(this.world, blockposition).isEmpty() ? EntityFishingHook.WaterPosition.INSIDE_WATER : EntityFishingHook.WaterPosition.INVALID; ++ return fluid.a(TagsFluid.WATER) && fluid.isSource() && iblockdata.getCollisionShape(this.world, blockposition).isEmpty() ? EntityFishingHook.WaterPosition.INSIDE_WATER : EntityFishingHook.WaterPosition.INVALID; + } else { + return EntityFishingHook.WaterPosition.ABOVE_WATER; + } +@@ -418,7 +418,7 @@ public class EntityFishingHook extends IProjectile { + } + // CraftBukkit end + this.reel(); +- CriterionTriggers.D.a((EntityPlayer) entityhuman, itemstack, this, (Collection) Collections.emptyList()); ++ CriterionTriggers.D.a((EntityPlayer) entityhuman, itemstack, this, Collections.emptyList()); + this.world.broadcastEntityEffect(this, (byte) 31); + i = this.hooked instanceof EntityItem ? 3 : 5; + } else if (this.an > 0) { +@@ -426,7 +426,7 @@ public class EntityFishingHook extends IProjectile { + LootTable loottable = this.world.getMinecraftServer().getLootTableRegistry().getLootTable(LootTables.ag); + List list = loottable.populateLoot(loottableinfo_builder.build(LootContextParameterSets.FISHING)); + +- CriterionTriggers.D.a((EntityPlayer) entityhuman, itemstack, this, (Collection) list); ++ CriterionTriggers.D.a((EntityPlayer) entityhuman, itemstack, this, list); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { +@@ -453,7 +453,7 @@ public class EntityFishingHook extends IProjectile { + entityhuman.world.addEntity(new EntityExperienceOrb(entityhuman.world, entityhuman.locX(), entityhuman.locY() + 0.5D, entityhuman.locZ() + 0.5D, playerFishEvent.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.FISHING, this.getOwner(), this)); // Paper + } + // CraftBukkit end +- if (itemstack1.getItem().a((Tag) TagsItem.FISHES)) { ++ if (itemstack1.getItem().a(TagsItem.FISHES)) { + entityhuman.a(StatisticList.FISH_CAUGHT, 1); + } + } +diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java +index 1ee54cc1d2ef08d05e89e1289c7f232f460d1ac3..e99a731e61ec569e14b8e14d36b7b857b678c707 100644 +--- a/src/main/java/net/minecraft/server/EntityFox.java ++++ b/src/main/java/net/minecraft/server/EntityFox.java +@@ -110,7 +110,7 @@ public class EntityFox extends EntityAnimal { + + if (this.l(itemstack)) { + if (this.bK > 600) { +- ItemStack itemstack1 = itemstack.a(this.world, (EntityLiving) this); ++ ItemStack itemstack1 = itemstack.a(this.world, this); + + if (!itemstack1.isEmpty()) { + this.setSlot(EnumItemSlot.MAINHAND, itemstack1); +@@ -184,7 +184,7 @@ public class EntityFox extends EntityAnimal { + + @Override + public EntityFox createChild(EntityAgeable entityageable) { +- EntityFox entityfox = (EntityFox) EntityTypes.FOX.a(this.world); ++ EntityFox entityfox = EntityTypes.FOX.a(this.world); + + entityfox.setFoxType(this.random.nextBoolean() ? this.getFoxType() : ((EntityFox) entityageable).getFoxType()); + return entityfox; +@@ -216,7 +216,7 @@ public class EntityFox extends EntityAnimal { + } + + this.a(difficultydamagescaler); +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + private void initializePathFinderGoals() { +@@ -247,7 +247,7 @@ public class EntityFox extends EntityAnimal { + } + + public EntityFox.Type getFoxType() { +- return EntityFox.Type.a((Integer) this.datawatcher.get(EntityFox.bv)); ++ return EntityFox.Type.a(this.datawatcher.get(EntityFox.bv)); + } + + public void setFoxType(EntityFox.Type entityfox_type) { +@@ -263,7 +263,7 @@ public class EntityFox extends EntityAnimal { + } + + private void b(@Nullable UUID uuid) { +- if (((Optional) this.datawatcher.get(EntityFox.FIRST_TRUSTED_PLAYER)).isPresent()) { ++ if (this.datawatcher.get(EntityFox.FIRST_TRUSTED_PLAYER).isPresent()) { + this.datawatcher.set(EntityFox.SECOND_TRUSTED_PLAYER, Optional.ofNullable(uuid)); + } else { + this.datawatcher.set(EntityFox.FIRST_TRUSTED_PLAYER, Optional.ofNullable(uuid)); +@@ -347,15 +347,15 @@ public class EntityFox extends EntityAnimal { + + private void d(int i, boolean flag) { + if (flag) { +- this.datawatcher.set(EntityFox.bw, (byte) ((Byte) this.datawatcher.get(EntityFox.bw) | i)); ++ this.datawatcher.set(EntityFox.bw, (byte) (this.datawatcher.get(EntityFox.bw) | i)); + } else { +- this.datawatcher.set(EntityFox.bw, (byte) ((Byte) this.datawatcher.get(EntityFox.bw) & ~i)); ++ this.datawatcher.set(EntityFox.bw, (byte) (this.datawatcher.get(EntityFox.bw) & ~i)); + } + + } + + private boolean t(int i) { +- return ((Byte) this.datawatcher.get(EntityFox.bw) & i) != 0; ++ return (this.datawatcher.get(EntityFox.bw) & i) != 0; + } + + @Override +@@ -688,10 +688,10 @@ public class EntityFox extends EntityAnimal { + if (entityliving.getAdjustedDirection() != entityliving.getDirection()) { + return false; + } else { +- boolean flag = EntityFox.a((EntityFox) EntityFox.this, entityliving); ++ boolean flag = EntityFox.a(EntityFox.this, entityliving); + + if (!flag) { +- EntityFox.this.getNavigation().a((Entity) entityliving, 0); ++ EntityFox.this.getNavigation().a(entityliving, 0); + EntityFox.this.setCrouching(false); + EntityFox.this.w(false); + } +@@ -770,7 +770,7 @@ public class EntityFox extends EntityAnimal { + EntityFox.this.attackEntity(entityliving); + } else if (EntityFox.this.pitch > 0.0F && EntityFox.this.onGround && (float) EntityFox.this.getMot().y != 0.0F && EntityFox.this.world.getType(EntityFox.this.getChunkCoordinates()).a(Blocks.SNOW)) { + EntityFox.this.pitch = 60.0F; +- EntityFox.this.setGoalTarget((EntityLiving) null); ++ EntityFox.this.setGoalTarget(null); + EntityFox.this.x(true); + } + +@@ -791,7 +791,7 @@ public class EntityFox extends EntityAnimal { + + @Override + public boolean a() { +- return EntityFox.this.isInWater() && EntityFox.this.b((Tag) TagsFluid.WATER) > 0.25D || EntityFox.this.aN(); ++ return EntityFox.this.isInWater() && EntityFox.this.b(TagsFluid.WATER) > 0.25D || EntityFox.this.aN(); + } + } + +@@ -900,7 +900,7 @@ public class EntityFox extends EntityAnimal { + protected boolean a(IWorldReader iworldreader, BlockPosition blockposition) { + IBlockData iblockdata = iworldreader.getType(blockposition); + +- return iblockdata.a(Blocks.SWEET_BERRY_BUSH) && (Integer) iblockdata.get(BlockSweetBerryBush.a) >= 2; ++ return iblockdata.a(Blocks.SWEET_BERRY_BUSH) && iblockdata.get(BlockSweetBerryBush.a) >= 2; + } + + @Override +@@ -923,7 +923,7 @@ public class EntityFox extends EntityAnimal { + IBlockData iblockdata = EntityFox.this.world.getType(this.e); + + if (iblockdata.a(Blocks.SWEET_BERRY_BUSH)) { +- int i = (Integer) iblockdata.get(BlockSweetBerryBush.a); ++ int i = iblockdata.get(BlockSweetBerryBush.a); + + iblockdata.set(BlockSweetBerryBush.a, 1); + // CraftBukkit start - call EntityChangeBlockEvent +@@ -944,7 +944,7 @@ public class EntityFox extends EntityAnimal { + } + + EntityFox.this.playSound(SoundEffects.ITEM_SWEET_BERRIES_PICK_FROM_BUSH, 1.0F, 1.0F); +- EntityFox.this.world.setTypeAndData(this.e, (IBlockData) iblockdata.set(BlockSweetBerryBush.a, 1), 2); ++ EntityFox.this.world.setTypeAndData(this.e, iblockdata.set(BlockSweetBerryBush.a, 1), 2); + } + } + } +@@ -1223,7 +1223,7 @@ public class EntityFox extends EntityAnimal { + + if (entityplayer2 != null) { + entityplayer2.a(StatisticList.ANIMALS_BRED); +- CriterionTriggers.o.a(entityplayer2, this.animal, this.partner, (EntityAgeable) entityfox); ++ CriterionTriggers.o.a(entityplayer2, this.animal, this.partner, entityfox); + } + + this.animal.setAgeRaw(6000); +@@ -1303,7 +1303,7 @@ public class EntityFox extends EntityAnimal { + public void d() { + EntityLiving entityliving = EntityFox.this.getGoalTarget(); + +- if (entityliving != null && EntityFox.a((EntityFox) EntityFox.this, entityliving)) { ++ if (entityliving != null && EntityFox.a(EntityFox.this, entityliving)) { + EntityFox.this.w(true); + EntityFox.this.setCrouching(true); + EntityFox.this.getNavigation().o(); +@@ -1325,7 +1325,7 @@ public class EntityFox extends EntityAnimal { + EntityFox.this.setCrouching(true); + EntityFox.this.getNavigation().o(); + } else { +- EntityFox.this.getNavigation().a((Entity) entityliving, 1.5D); ++ EntityFox.this.getNavigation().a(entityliving, 1.5D); + } + + } +@@ -1377,7 +1377,7 @@ public class EntityFox extends EntityAnimal { + ItemStack itemstack = EntityFox.this.getEquipment(EnumItemSlot.MAINHAND); + + if (itemstack.isEmpty() && !list.isEmpty()) { +- EntityFox.this.getNavigation().a((Entity) list.get(0), 1.2000000476837158D); ++ EntityFox.this.getNavigation().a(list.get(0), 1.2000000476837158D); + } + + } +@@ -1387,7 +1387,7 @@ public class EntityFox extends EntityAnimal { + List list = EntityFox.this.world.a(EntityItem.class, EntityFox.this.getBoundingBox().grow(8.0D, 8.0D, 8.0D), EntityFox.bz); + + if (!list.isEmpty()) { +- EntityFox.this.getNavigation().a((Entity) list.get(0), 1.2000000476837158D); ++ EntityFox.this.getNavigation().a(list.get(0), 1.2000000476837158D); + } + + } +@@ -1395,7 +1395,7 @@ public class EntityFox extends EntityAnimal { + + public static enum Type { + +- RED(0, "red", new BiomeBase[]{Biomes.TAIGA, Biomes.TAIGA_HILLS, Biomes.TAIGA_MOUNTAINS, Biomes.GIANT_TREE_TAIGA, Biomes.GIANT_SPRUCE_TAIGA, Biomes.GIANT_TREE_TAIGA_HILLS, Biomes.GIANT_SPRUCE_TAIGA_HILLS}), SNOW(1, "snow", new BiomeBase[]{Biomes.SNOWY_TAIGA, Biomes.SNOWY_TAIGA_HILLS, Biomes.SNOWY_TAIGA_MOUNTAINS}); ++ RED(0, "red", Biomes.TAIGA, Biomes.TAIGA_HILLS, Biomes.TAIGA_MOUNTAINS, Biomes.GIANT_TREE_TAIGA, Biomes.GIANT_SPRUCE_TAIGA, Biomes.GIANT_TREE_TAIGA_HILLS, Biomes.GIANT_SPRUCE_TAIGA_HILLS), SNOW(1, "snow", Biomes.SNOWY_TAIGA, Biomes.SNOWY_TAIGA_HILLS, Biomes.SNOWY_TAIGA_MOUNTAINS); + + private static final EntityFox.Type[] c; + +@@ -1405,7 +1405,7 @@ public class EntityFox extends EntityAnimal { + list.add(type); + } + list.sort(Comparator.comparingInt(Type::c)); +- c = (Type[]) list.toArray(new Type[0]); ++ c = list.toArray(new Type[0]); + } + + private static final Map d; +@@ -1417,7 +1417,7 @@ public class EntityFox extends EntityAnimal { + throw new IllegalStateException("Duplicate key"); + } + } +- d = (Map) map; ++ d = map; + } + + private final int e; +@@ -1443,7 +1443,7 @@ public class EntityFox extends EntityAnimal { + } + + public static EntityFox.Type a(String s) { +- return (EntityFox.Type) EntityFox.Type.d.getOrDefault(s, EntityFox.Type.RED); ++ return Type.d.getOrDefault(s, Type.RED); + } + + public static EntityFox.Type a(int i) { +diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java +index d16118b39e6094cd9b821156365df5fff438b9e5..3ea734a9b59cd023a3bb80d995a8b6db6f1530c9 100644 +--- a/src/main/java/net/minecraft/server/EntityGhast.java ++++ b/src/main/java/net/minecraft/server/EntityGhast.java +@@ -147,7 +147,7 @@ public class EntityGhast extends EntityFlying implements IMonster { + + ++this.a; + if (this.a == 10 && !this.ghast.isSilent()) { +- world.a((EntityHuman) null, 1015, this.ghast.getChunkCoordinates(), 0); ++ world.a(null, 1015, this.ghast.getChunkCoordinates(), 0); + } + + if (this.a == 20) { +@@ -158,7 +158,7 @@ public class EntityGhast extends EntityFlying implements IMonster { + double d4 = entityliving.locZ() - (this.ghast.locZ() + vec3d.z * 4.0D); + + if (!this.ghast.isSilent()) { +- world.a((EntityHuman) null, 1016, this.ghast.getChunkCoordinates(), 0); ++ world.a(null, 1016, this.ghast.getChunkCoordinates(), 0); + } + + EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.ghast, d2, d3, d4); +diff --git a/src/main/java/net/minecraft/server/EntityHanging.java b/src/main/java/net/minecraft/server/EntityHanging.java +index ace78adfb5baf462d4b511d84f17beb11607ce62..c467f53724a4319cebb7fedb55507d87e47b8fc4 100644 +--- a/src/main/java/net/minecraft/server/EntityHanging.java ++++ b/src/main/java/net/minecraft/server/EntityHanging.java +@@ -68,9 +68,9 @@ public abstract class EntityHanging extends Entity { + if (entity != null) { + entity.setPositionRaw(d0, d1, d2); + } +- double d6 = (double) width; +- double d7 = (double) height; +- double d8 = (double) width; ++ double d6 = width; ++ double d7 = height; ++ double d8 = width; + + if (direction.n() == EnumDirection.EnumAxis.Z) { + d8 = 1.0D; +diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java +index 9f47392e115e20e307e2e79fc3ec5bf03c2d90cd..a41c3a630d3acbb561be819d0970f68e8a31cffb 100644 +--- a/src/main/java/net/minecraft/server/EntityHoglin.java ++++ b/src/main/java/net/minecraft/server/EntityHoglin.java +@@ -15,7 +15,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + public boolean bA = false; // PAIL + protected static final ImmutableList>> bv = ImmutableList.of(SensorType.c, SensorType.d, SensorType.n, SensorType.m); + // CraftBukkit - decompile error +- protected static final ImmutableList> bw = ImmutableList.>of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED}); ++ protected static final ImmutableList> bw = ImmutableList.>of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED); + + public EntityHoglin(EntityTypes entitytypes, World world) { + super(entitytypes, world); +@@ -69,7 +69,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + + @Override + protected BehaviorController.b cJ() { +- return BehaviorController.a((Collection) EntityHoglin.bw, (Collection) EntityHoglin.bv); ++ return BehaviorController.a(EntityHoglin.bw, (Collection) EntityHoglin.bv); + } + + @Override +@@ -172,7 +172,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + } + + private void b(WorldServer worldserver) { +- EntityZoglin entityzoglin = (EntityZoglin) this.b(EntityTypes.ZOGLIN); ++ EntityZoglin entityzoglin = this.b(EntityTypes.ZOGLIN); + + entityzoglin.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0)); + } +@@ -219,7 +219,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + } + + public boolean eW() { // PAIL +- return (Boolean) this.getDataWatcher().get(EntityHoglin.bx); ++ return this.getDataWatcher().get(EntityHoglin.bx); + } + + public boolean eO() { +@@ -237,7 +237,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + @Nullable + @Override + public EntityAgeable createChild(EntityAgeable entityageable) { +- EntityHoglin entityhoglin = (EntityHoglin) EntityTypes.HOGLIN.a(this.world); ++ EntityHoglin entityhoglin = EntityTypes.HOGLIN.a(this.world); + + if (entityhoglin != null) { + entityhoglin.setPersistent(); +@@ -258,7 +258,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + + @Override + protected SoundEffect getSoundAmbient() { +- return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse(null); // CraftBukkit - decompile error ++ return this.world.isClientSide ? null : HoglinAI.b(this).orElse(null); // CraftBukkit - decompile error + } + + @Override +@@ -293,6 +293,6 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + @Override + protected void M() { + super.M(); +- PacketDebug.a((EntityLiving) this); ++ PacketDebug.a(this); + } + } +diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java +index 8de9b17292bc69e603d5e3ef1f5e82d594f08804..787d09d6b9acd0cc4030d2410c0356140558c1cc 100644 +--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java ++++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java +@@ -68,11 +68,11 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + } + + protected boolean t(int i) { +- return ((Byte) this.datawatcher.get(EntityHorseAbstract.bG) & i) != 0; ++ return (this.datawatcher.get(EntityHorseAbstract.bG) & i) != 0; + } + + protected void d(int i, boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityHorseAbstract.bG); ++ byte b0 = this.datawatcher.get(EntityHorseAbstract.bG); + + if (flag) { + this.datawatcher.set(EntityHorseAbstract.bG, (byte) (b0 | i)); +@@ -88,7 +88,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + + @Nullable + public UUID getOwnerUUID() { +- return (UUID) ((Optional) this.datawatcher.get(EntityHorseAbstract.bH)).orElse((Object) null); ++ return (UUID) ((Optional) this.datawatcher.get(EntityHorseAbstract.bH)).orElse(null); + } + + public void setOwnerUUID(@Nullable UUID uuid) { +@@ -140,7 +140,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + public void saddle(@Nullable SoundCategory soundcategory) { + this.inventoryChest.setItem(0, new ItemStack(Items.SADDLE)); + if (soundcategory != null) { +- this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_HORSE_SADDLE, soundcategory, 0.5F, 1.0F); ++ this.world.playSound(null, this, SoundEffects.ENTITY_HORSE_SADDLE, soundcategory, 0.5F, 1.0F); + } + + } +@@ -176,7 +176,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + SoundEffect soundeffect = this.fh(); + + if (soundeffect != null) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), soundeffect, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), soundeffect, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); + } + } + +@@ -223,7 +223,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + + this.inventoryChest = new InventorySubcontainer(this.getChestSlots(), (org.bukkit.entity.AbstractHorse) this.getBukkitEntity()); // CraftBukkit + if (inventorysubcontainer != null) { +- inventorysubcontainer.b((IInventoryListener) this); ++ inventorysubcontainer.b(this); + int i = Math.min(inventorysubcontainer.getSize(), this.inventoryChest.getSize()); + + for (int j = 0; j < i; ++j) { +@@ -235,7 +235,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + } + } + +- this.inventoryChest.a((IInventoryListener) this); ++ this.inventoryChest.a(this); + this.ff(); + } + +@@ -507,7 +507,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + EntityLiving entityliving = this.world.a(EntityHorseAbstract.class, EntityHorseAbstract.bE, this, this.locX(), this.locY(), this.locZ(), this.getBoundingBox().g(16.0D)); + + if (entityliving != null && this.h((Entity) entityliving) > 4.0D) { +- this.navigation.a((Entity) entityliving, 0); ++ this.navigation.a(entityliving, 0); + } + } + +@@ -629,7 +629,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + this.setOwnerUUID(entityhuman.getUniqueID()); + this.setTamed(true); + if (entityhuman instanceof EntityPlayer) { +- CriterionTriggers.x.a((EntityPlayer) entityhuman, (EntityAnimal) this); ++ CriterionTriggers.x.a((EntityPlayer) entityhuman, this); + } + + this.world.broadcastEntityEffect(this, (byte) 7); +@@ -680,7 +680,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + float f2 = MathHelper.sin(this.yaw * 0.017453292F); + float f3 = MathHelper.cos(this.yaw * 0.017453292F); + +- this.setMot(this.getMot().add((double) (-0.4F * f2 * this.jumpPower), 0.0D, (double) (0.4F * f3 * this.jumpPower))); ++ this.setMot(this.getMot().add(-0.4F * f2 * this.jumpPower, 0.0D, 0.4F * f3 * this.jumpPower)); + } + + this.jumpPower = 0.0F; +@@ -689,7 +689,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + this.aL = this.dM() * 0.1F; + if (this.cr()) { + this.n((float) this.b(GenericAttributes.MOVEMENT_SPEED)); +- super.f(new Vec3D((double) f, vec3d.y, (double) f1)); ++ super.f(new Vec3D(f, vec3d.y, f1)); + } else if (entityliving instanceof EntityHuman) { + this.setMot(Vec3D.a); + } +@@ -699,7 +699,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + this.v(false); + } + +- this.a((EntityLiving) this, false); ++ this.a(this, false); + } else { + this.aL = 0.02F; + super.f(vec3d); +@@ -911,7 +911,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + @Nullable + @Override + public Entity getRidingPassenger() { +- return this.getPassengers().isEmpty() ? null : (Entity) this.getPassengers().get(0); ++ return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0); + } + + @Nullable +@@ -957,13 +957,13 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + + @Override + public Vec3D c(EntityLiving entityliving) { +- Vec3D vec3d = a((double) this.getWidth(), (double) entityliving.getWidth(), this.yaw + (entityliving.getMainHand() == EnumMainHand.RIGHT ? 90.0F : -90.0F)); ++ Vec3D vec3d = a((double) this.getWidth(), entityliving.getWidth(), this.yaw + (entityliving.getMainHand() == EnumMainHand.RIGHT ? 90.0F : -90.0F)); + Vec3D vec3d1 = this.a(vec3d, entityliving); + + if (vec3d1 != null) { + return vec3d1; + } else { +- Vec3D vec3d2 = a((double) this.getWidth(), (double) entityliving.getWidth(), this.yaw + (entityliving.getMainHand() == EnumMainHand.LEFT ? 90.0F : -90.0F)); ++ Vec3D vec3d2 = a((double) this.getWidth(), entityliving.getWidth(), this.yaw + (entityliving.getMainHand() == EnumMainHand.LEFT ? 90.0F : -90.0F)); + Vec3D vec3d3 = this.a(vec3d2, entityliving); + + return vec3d3 != null ? vec3d3 : this.getPositionVector(); +@@ -981,6 +981,6 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + } + + this.eL(); +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + } +diff --git a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java +index 4934e71225fe1242615660a379e797e212040ed3..3445a7904fd46958364ef8ec71ab0680967a1e0d 100644 +--- a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java ++++ b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java +@@ -11,7 +11,7 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { + + @Override + protected void eL() { +- this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue((double) this.fq()); ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.fq()); + } + + @Override +@@ -25,7 +25,7 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { + } + + public boolean isCarryingChest() { +- return (Boolean) this.datawatcher.get(EntityHorseChestedAbstract.bD); ++ return this.datawatcher.get(EntityHorseChestedAbstract.bD); + } + + public void setCarryingChest(boolean flag) { +@@ -47,7 +47,7 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { + super.dropInventory(); + if (this.isCarryingChest()) { + if (!this.world.isClientSide) { +- this.a((IMaterial) Blocks.CHEST); ++ this.a(Blocks.CHEST); + } + + //this.setCarryingChest(false); // Paper - moved to post death logic +diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +index 43e605f682709708f5b79c70398691dc195ef925..d7cb73896253cb604ad5e47e6fbdd3db6b14c6a3 100644 +--- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java ++++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +@@ -27,7 +27,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + @Override + protected SoundEffect getSoundAmbient() { + super.getSoundAmbient(); +- return this.a((Tag) TagsFluid.WATER) ? SoundEffects.ENTITY_SKELETON_HORSE_AMBIENT_WATER : SoundEffects.ENTITY_SKELETON_HORSE_AMBIENT; ++ return this.a(TagsFluid.WATER) ? SoundEffects.ENTITY_SKELETON_HORSE_AMBIENT_WATER : SoundEffects.ENTITY_SKELETON_HORSE_AMBIENT; + } + + @Override +@@ -137,7 +137,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + if (flag) { + this.goalSelector.a(1, this.bD); + } else { +- this.goalSelector.a((PathfinderGoal) this.bD); ++ this.goalSelector.a(this.bD); + } + + } +@@ -146,7 +146,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + @Nullable + @Override + public EntityAgeable createChild(EntityAgeable entityageable) { +- return (EntityAgeable) EntityTypes.SKELETON_HORSE.a(this.world); ++ return EntityTypes.SKELETON_HORSE.a(this.world); + } + + @Override +@@ -169,7 +169,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + return EnumInteractionResult.a(this.world.isClientSide); + } + +- EnumInteractionResult enuminteractionresult = itemstack.a(entityhuman, (EntityLiving) this, enumhand); ++ EnumInteractionResult enuminteractionresult = itemstack.a(entityhuman, this, enumhand); + + if (enuminteractionresult.a()) { + return enuminteractionresult; +diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java +index c6bc8dda20d4789499184b651092199de0c0c333..9e4d1c29bc0482bf340e081232c5445a23310fc1 100644 +--- a/src/main/java/net/minecraft/server/EntityHuman.java ++++ b/src/main/java/net/minecraft/server/EntityHuman.java +@@ -25,7 +25,7 @@ public abstract class EntityHuman extends EntityLiving { + + public static final EntitySize bo = EntitySize.b(0.6F, 1.8F); + // CraftBukkit - decompile error +- private static final Map b = ImmutableMap.builder().put(EntityPose.STANDING, EntityHuman.bo).put(EntityPose.SLEEPING, EntityHuman.ao).put(EntityPose.FALL_FLYING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SWIMMING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SPIN_ATTACK, EntitySize.b(0.6F, 0.6F)).put(EntityPose.CROUCHING, EntitySize.b(0.6F, 1.5F)).put(EntityPose.DYING, EntitySize.c(0.2F, 0.2F)).build(); ++ private static final Map b = ImmutableMap.builder().put(EntityPose.STANDING, EntityHuman.bo).put(EntityPose.SLEEPING, EntityLiving.ao).put(EntityPose.FALL_FLYING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SWIMMING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SPIN_ATTACK, EntitySize.b(0.6F, 0.6F)).put(EntityPose.CROUCHING, EntitySize.b(0.6F, 1.5F)).put(EntityPose.DYING, EntitySize.c(0.2F, 0.2F)).build(); + private static final DataWatcherObject c = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c); + private static final DataWatcherObject d = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.b); + protected static final DataWatcherObject bp = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); public static DataWatcherObject getSkinPartsWatcher() { return bp; } // Paper - OBFHELPER +@@ -84,7 +84,7 @@ public abstract class EntityHuman extends EntityLiving { + this.bQ = gameprofile; + this.defaultContainer = new ContainerPlayer(this.inventory, !world.isClientSide, this); + this.activeContainer = this.defaultContainer; +- this.setPositionRotation((double) blockposition.getX() + 0.5D, (double) (blockposition.getY() + 1), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F); ++ this.setPositionRotation((double) blockposition.getX() + 0.5D, blockposition.getY() + 1, (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F); + this.aU = 180.0F; + } + +@@ -205,14 +205,14 @@ public abstract class EntityHuman extends EntityLiving { + } + + protected boolean es() { +- this.bI = this.a((Tag) TagsFluid.WATER); ++ this.bI = this.a(TagsFluid.WATER); + return this.bI; + } + + private void o() { + ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD); + +- if (itemstack.getItem() == Items.TURTLE_HELMET && !this.a((Tag) TagsFluid.WATER)) { ++ if (itemstack.getItem() == Items.TURTLE_HELMET && !this.a(TagsFluid.WATER)) { + this.addEffect(new MobEffect(MobEffects.WATER_BREATHING, 200, 0, false, false, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.TURTLE_HELMET); // CraftBukkit + } + +@@ -424,7 +424,7 @@ public abstract class EntityHuman extends EntityLiving { + List list = this.world.getEntities(this, axisalignedbb); + + for (int i = 0; i < list.size(); ++i) { +- Entity entity = (Entity) list.get(i); ++ Entity entity = list.get(i); + + if (!entity.dead) { + this.c(entity); +@@ -447,8 +447,8 @@ public abstract class EntityHuman extends EntityLiving { + EntityTypes.a(s).filter((entitytypes) -> { + return entitytypes == EntityTypes.PARROT; + }).ifPresent((entitytypes) -> { +- if (!EntityParrot.a(this.world, (Entity) this)) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), EntityParrot.a(this.world, this.world.random), this.getSoundCategory(), 1.0F, EntityParrot.a(this.world.random)); ++ if (!EntityParrot.a(this.world, this)) { ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), EntityParrot.a(this.world, this.world.random), this.getSoundCategory(), 1.0F, EntityParrot.a(this.world.random)); + } + + }); +@@ -461,7 +461,7 @@ public abstract class EntityHuman extends EntityLiving { + } + + public int getScore() { +- return (Integer) this.datawatcher.get(EntityHuman.d); ++ return this.datawatcher.get(EntityHuman.d); + } + + public void setScore(int i) { +@@ -483,7 +483,7 @@ public abstract class EntityHuman extends EntityLiving { + } + + if (damagesource != null) { +- this.setMot((double) (-MathHelper.cos((this.aw + this.yaw) * 0.017453292F) * 0.1F), 0.10000000149011612D, (double) (-MathHelper.sin((this.aw + this.yaw) * 0.017453292F) * 0.1F)); ++ this.setMot(-MathHelper.cos((this.aw + this.yaw) * 0.017453292F) * 0.1F, 0.10000000149011612D, -MathHelper.sin((this.aw + this.yaw) * 0.017453292F) * 0.1F); + } else { + this.setMot(0.0D, 0.1D, 0.0D); + } +@@ -558,7 +558,7 @@ public abstract class EntityHuman extends EntityLiving { + if (flag) { + f = this.random.nextFloat() * 0.5F; + f1 = this.random.nextFloat() * 6.2831855F; +- entityitem.setMot((double) (-MathHelper.sin(f1) * f), 0.20000000298023224D, (double) (MathHelper.cos(f1) * f)); ++ entityitem.setMot(-MathHelper.sin(f1) * f, 0.20000000298023224D, MathHelper.cos(f1) * f); + } else { + f = 0.3F; + f1 = MathHelper.sin(this.pitch * 0.017453292F); +@@ -568,7 +568,7 @@ public abstract class EntityHuman extends EntityLiving { + float f5 = this.random.nextFloat() * 6.2831855F; + float f6 = 0.02F * this.random.nextFloat(); + +- entityitem.setMot((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6); ++ entityitem.setMot((double) (-f3 * f2 * 0.3F) + Math.cos(f5) * (double) f6, -f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F, (double) (f4 * f2 * 0.3F) + Math.sin(f5) * (double) f6); + } + + // CraftBukkit start - fire PlayerDropItemEvent +@@ -642,7 +642,7 @@ public abstract class EntityHuman extends EntityLiving { + f *= f1; + } + +- if (this.a((Tag) TagsFluid.WATER) && !EnchantmentManager.h((EntityLiving) this)) { ++ if (this.a(TagsFluid.WATER) && !EnchantmentManager.h(this)) { + f /= 5.0F; + } + +@@ -677,7 +677,7 @@ public abstract class EntityHuman extends EntityLiving { + this.setScore(nbttagcompound.getInt("Score")); + this.foodData.a(nbttagcompound); + this.abilities.b(nbttagcompound); +- this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue((double) this.abilities.b()); ++ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(this.abilities.b()); + if (nbttagcompound.hasKeyOfType("EnderItems", 9)) { + this.enderChest.a(nbttagcompound.getList("EnderItems", 10)); + } +@@ -971,7 +971,7 @@ public abstract class EntityHuman extends EntityLiving { + double d1 = vec3d.z; + double d2 = 0.05D; + +- while (d0 != 0.0D && this.world.getCubes(this, this.getBoundingBox().d(d0, (double) (-this.G), 0.0D))) { ++ while (d0 != 0.0D && this.world.getCubes(this, this.getBoundingBox().d(d0, -this.G, 0.0D))) { + if (d0 < 0.05D && d0 >= -0.05D) { + d0 = 0.0D; + } else if (d0 > 0.0D) { +@@ -981,7 +981,7 @@ public abstract class EntityHuman extends EntityLiving { + } + } + +- while (d1 != 0.0D && this.world.getCubes(this, this.getBoundingBox().d(0.0D, (double) (-this.G), d1))) { ++ while (d1 != 0.0D && this.world.getCubes(this, this.getBoundingBox().d(0.0D, -this.G, d1))) { + if (d1 < 0.05D && d1 >= -0.05D) { + d1 = 0.0D; + } else if (d1 > 0.0D) { +@@ -991,7 +991,7 @@ public abstract class EntityHuman extends EntityLiving { + } + } + +- while (d0 != 0.0D && d1 != 0.0D && this.world.getCubes(this, this.getBoundingBox().d(d0, (double) (-this.G), d1))) { ++ while (d0 != 0.0D && d1 != 0.0D && this.world.getCubes(this, this.getBoundingBox().d(d0, -this.G, d1))) { + if (d0 < 0.05D && d0 >= -0.05D) { + d0 = 0.0D; + } else if (d0 > 0.0D) { +@@ -1045,7 +1045,7 @@ public abstract class EntityHuman extends EntityLiving { + boolean flag = f2 > 0.9F; + boolean flag1 = false; + byte b0 = 0; +- int i = b0 + EnchantmentManager.b((EntityLiving) this); ++ int i = b0 + EnchantmentManager.b(this); + + if (this.isSprinting() && flag) { + sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_ATTACK_KNOCKBACK, this.getSoundCategory(), 1.0F, 1.0F); // Paper - send while respecting visibility +@@ -1063,7 +1063,7 @@ public abstract class EntityHuman extends EntityLiving { + + f += f1; + boolean flag3 = false; +- double d0 = (double) (this.A - this.z); ++ double d0 = this.A - this.z; + + if (flag && !flag2 && !flag1 && this.onGround && d0 < (double) this.dM()) { + ItemStack itemstack = this.b(EnumHand.MAIN_HAND); +@@ -1098,9 +1098,9 @@ public abstract class EntityHuman extends EntityLiving { + if (flag5) { + if (i > 0) { + if (entity instanceof EntityLiving) { +- ((EntityLiving) entity).doKnockback((float) i * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); // Paper ++ ((EntityLiving) entity).doKnockback((float) i * 0.5F, MathHelper.sin(this.yaw * 0.017453292F), -MathHelper.cos(this.yaw * 0.017453292F), this); // Paper + } else { +- entity.h((double) (-MathHelper.sin(this.yaw * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 0.017453292F) * (float) i * 0.5F)); ++ entity.h(-MathHelper.sin(this.yaw * 0.017453292F) * (float) i * 0.5F, 0.1D, MathHelper.cos(this.yaw * 0.017453292F) * (float) i * 0.5F); + } + + this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D)); +@@ -1112,7 +1112,7 @@ public abstract class EntityHuman extends EntityLiving { + } + + if (flag3) { +- float f4 = 1.0F + EnchantmentManager.a((EntityLiving) this) * f; ++ float f4 = 1.0F + EnchantmentManager.a(this) * f; + List list = this.world.a(EntityLiving.class, entity.getBoundingBox().grow(1.0D, 0.25D, 1.0D)); + Iterator iterator = list.iterator(); + +@@ -1122,7 +1122,7 @@ public abstract class EntityHuman extends EntityLiving { + if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h((Entity) entityliving) < 9.0D) { + // CraftBukkit start - Only apply knockback if the damage hits + if (entityliving.damageEntity(DamageSource.playerAttack(this).sweep(), f4)) { +- entityliving.doKnockback(0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); ++ entityliving.doKnockback(0.4F, MathHelper.sin(this.yaw * 0.017453292F), -MathHelper.cos(this.yaw * 0.017453292F), this); + } + // CraftBukkit end + } +@@ -1174,10 +1174,10 @@ public abstract class EntityHuman extends EntityLiving { + + this.z(entity); + if (entity instanceof EntityLiving) { +- EnchantmentManager.a((EntityLiving) entity, (Entity) this); ++ EnchantmentManager.a((EntityLiving) entity, this); + } + +- EnchantmentManager.b((EntityLiving) this, entity); ++ EnchantmentManager.b(this, entity); + ItemStack itemstack1 = this.getItemInMainHand(); + Object object = entity; + +@@ -1257,8 +1257,8 @@ public abstract class EntityHuman extends EntityLiving { + public void b(Entity entity) {} + + public void ew() { +- double d0 = (double) (-MathHelper.sin(this.yaw * 0.017453292F)); +- double d1 = (double) MathHelper.cos(this.yaw * 0.017453292F); ++ double d0 = -MathHelper.sin(this.yaw * 0.017453292F); ++ double d1 = MathHelper.cos(this.yaw * 0.017453292F); + + if (this.world instanceof WorldServer) { + ((WorldServer) this.world).a(Particles.SWEEP_ATTACK, this.locX() + d0, this.e(0.5D), this.locZ() + d1, 0, d0, 0.0D, d1, 0.0D); +@@ -1331,15 +1331,15 @@ public abstract class EntityHuman extends EntityLiving { + IBlockData iblockdata = worldserver.getType(blockposition); + Block block = iblockdata.getBlock(); + +- if (block instanceof BlockRespawnAnchor && (Integer) iblockdata.get(BlockRespawnAnchor.a) > 0 && BlockRespawnAnchor.a((World) worldserver)) { +- Optional optional = BlockRespawnAnchor.a(EntityTypes.PLAYER, (IWorldReader) worldserver, blockposition); ++ if (block instanceof BlockRespawnAnchor && iblockdata.get(BlockRespawnAnchor.a) > 0 && BlockRespawnAnchor.a(worldserver)) { ++ Optional optional = BlockRespawnAnchor.a(EntityTypes.PLAYER, worldserver, blockposition); + + if (!flag1 && optional.isPresent()) { +- worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRespawnAnchor.a, (Integer) iblockdata.get(BlockRespawnAnchor.a) - 1), 3); ++ worldserver.setTypeAndData(blockposition, iblockdata.set(BlockRespawnAnchor.a, iblockdata.get(BlockRespawnAnchor.a) - 1), 3); + } + + return optional; +- } else if (block instanceof BlockBed && BlockBed.a((World) worldserver)) { ++ } else if (block instanceof BlockBed && BlockBed.a(worldserver)) { + return BlockBed.a(EntityTypes.PLAYER, worldserver, blockposition, 0); + } else if (!flag) { + return Optional.empty(); +@@ -1469,7 +1469,7 @@ public abstract class EntityHuman extends EntityLiving { + this.a(StatisticList.SWIM_ONE_CM, i); + this.applyExhaustion(0.01F * (float) i * 0.01F); + } +- } else if (this.a((Tag) TagsFluid.WATER)) { ++ } else if (this.a(TagsFluid.WATER)) { + i = Math.round(MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F); + if (i > 0) { + this.a(StatisticList.WALK_UNDER_WATER_ONE_CM, i); +@@ -1659,7 +1659,7 @@ public abstract class EntityHuman extends EntityLiving { + if (i > 0 && this.expLevel % 5 == 0 && (float) this.g < (float) this.ticksLived - 100.0F) { + float f = this.expLevel > 30 ? 1.0F : (float) this.expLevel / 30.0F; + +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_LEVELUP, this.getSoundCategory(), f * 0.75F, 1.0F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_LEVELUP, this.getSoundCategory(), f * 0.75F, 1.0F); + this.g = this.ticksLived; + } + +@@ -1741,7 +1741,7 @@ public abstract class EntityHuman extends EntityLiving { + + @Override + public ItemStack getEquipment(EnumItemSlot enumitemslot) { +- return enumitemslot == EnumItemSlot.MAINHAND ? this.inventory.getItemInHand() : (enumitemslot == EnumItemSlot.OFFHAND ? (ItemStack) this.inventory.extraSlots.get(0) : (enumitemslot.a() == EnumItemSlot.Function.ARMOR ? (ItemStack) this.inventory.armor.get(enumitemslot.b()) : ItemStack.b)); ++ return enumitemslot == EnumItemSlot.MAINHAND ? this.inventory.getItemInHand() : (enumitemslot == EnumItemSlot.OFFHAND ? this.inventory.extraSlots.get(0) : (enumitemslot.a() == EnumItemSlot.Function.ARMOR ? this.inventory.armor.get(enumitemslot.b()) : ItemStack.b)); + } + + @Override +@@ -1766,7 +1766,7 @@ public abstract class EntityHuman extends EntityLiving { + + @Override + public Iterable bj() { +- return Lists.newArrayList(new ItemStack[]{this.getItemInMainHand(), this.getItemInOffHand()}); ++ return Lists.newArrayList(this.getItemInMainHand(), this.getItemInOffHand()); + } + + @Override +@@ -1913,7 +1913,7 @@ public abstract class EntityHuman extends EntityLiving { + + @Override + public float getAbsorptionHearts() { +- return (Float) this.getDataWatcher().get(EntityHuman.c); ++ return this.getDataWatcher().get(EntityHuman.c); + } + + public static UUID a(GameProfile gameprofile) { +@@ -1989,7 +1989,7 @@ public abstract class EntityHuman extends EntityLiving { + + @Override + public EnumMainHand getMainHand() { +- return (Byte) this.datawatcher.get(EntityHuman.bq) == 0 ? EnumMainHand.LEFT : EnumMainHand.RIGHT; ++ return this.datawatcher.get(EntityHuman.bq) == 0 ? EnumMainHand.LEFT : EnumMainHand.RIGHT; + } + + public void a(EnumMainHand enummainhand) { +@@ -1997,7 +1997,7 @@ public abstract class EntityHuman extends EntityLiving { + } + + public NBTTagCompound getShoulderEntityLeft() { +- return (NBTTagCompound) this.datawatcher.get(EntityHuman.br); ++ return this.datawatcher.get(EntityHuman.br); + } + + public void setShoulderEntityLeft(NBTTagCompound nbttagcompound) { +@@ -2005,7 +2005,7 @@ public abstract class EntityHuman extends EntityLiving { + } + + public NBTTagCompound getShoulderEntityRight() { +- return (NBTTagCompound) this.datawatcher.get(EntityHuman.bs); ++ return this.datawatcher.get(EntityHuman.bs); + } + + public void setShoulderEntityRight(NBTTagCompound nbttagcompound) { +@@ -2051,7 +2051,7 @@ public abstract class EntityHuman extends EntityLiving { + + @Override + public EntitySize a(EntityPose entitypose) { +- return (EntitySize) EntityHuman.b.getOrDefault(entitypose, EntityHuman.bo); ++ return EntityHuman.b.getOrDefault(entitypose, EntityHuman.bo); + } + + @Override +@@ -2076,7 +2076,7 @@ public abstract class EntityHuman extends EntityLiving { + return ItemStack.b; + } else { + Predicate predicate = ((ItemProjectileWeapon) itemstack.getItem()).e(); +- ItemStack itemstack1 = ItemProjectileWeapon.a((EntityLiving) this, predicate); ++ ItemStack itemstack1 = ItemProjectileWeapon.a(this, predicate); + + if (!itemstack1.isEmpty()) { + return itemstack1; +@@ -2100,7 +2100,7 @@ public abstract class EntityHuman extends EntityLiving { + public ItemStack a(World world, ItemStack itemstack) { + this.getFoodData().a(itemstack.getItem(), itemstack); + this.b(StatisticList.ITEM_USED.b(itemstack.getItem())); +- world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); ++ world.playSound(null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); + if (this instanceof EntityPlayer) { + CriterionTriggers.z.a((EntityPlayer) this, itemstack); + } +diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java +index 76fd0513f3c89678809a28b9f1b22940fb5e5f23..3e14ddc7ee50d0975a61fea92b9f3dc2a6b87a9b 100644 +--- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java ++++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java +@@ -78,7 +78,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan + + for (j = 0; j < 4; ++j) { + this.bw[0][j] = this.bw[1][j]; +- this.bw[1][j] = new Vec3D((double) (-6.0F + (float) this.random.nextInt(13)) * 0.5D, (double) Math.max(0, this.random.nextInt(6) - 4), (double) (-6.0F + (float) this.random.nextInt(13)) * 0.5D); ++ this.bw[1][j] = new Vec3D((double) (-6.0F + (float) this.random.nextInt(13)) * 0.5D, Math.max(0, this.random.nextInt(6) - 4), (double) (-6.0F + (float) this.random.nextInt(13)) * 0.5D); + } + + for (j = 0; j < 16; ++j) { +@@ -131,7 +131,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan + double d0 = entityliving.locX() - this.locX(); + double d1 = entityliving.e(0.3333333333333333D) - entityarrow.locY(); + double d2 = entityliving.locZ() - this.locZ(); +- double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); ++ double d3 = MathHelper.sqrt(d0 * d0 + d2 * d2); + + entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4)); + // Paper start +diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java +index e65447a0867abbd60dd2ebf6b9961cb9a5216bb7..cb66ccd750542f4db8e99557bfbb2c5e8d6c0a9e 100644 +--- a/src/main/java/net/minecraft/server/EntityInsentient.java ++++ b/src/main/java/net/minecraft/server/EntityInsentient.java +@@ -95,7 +95,7 @@ public abstract class EntityInsentient extends EntityLiving { + entityinsentient = this; + } + +- Float ofloat = (Float) entityinsentient.bA.get(pathtype); ++ Float ofloat = entityinsentient.bA.get(pathtype); + + return ofloat == null ? pathtype.a() : ofloat; + } +@@ -256,13 +256,13 @@ public abstract class EntityInsentient extends EntityLiving { + int j; + + for (j = 0; j < this.bx.size(); ++j) { +- if (!((ItemStack) this.bx.get(j)).isEmpty() && this.dropChanceArmor[j] <= 1.0F) { ++ if (!this.bx.get(j).isEmpty() && this.dropChanceArmor[j] <= 1.0F) { + i += 1 + this.random.nextInt(3); + } + } + + for (j = 0; j < this.bw.size(); ++j) { +- if (!((ItemStack) this.bw.get(j)).isEmpty() && this.dropChanceHand[j] <= 1.0F) { ++ if (!this.bw.get(j).isEmpty() && this.dropChanceHand[j] <= 1.0F) { + i += 1 + this.random.nextInt(3); + } + } +@@ -580,7 +580,7 @@ public abstract class EntityInsentient extends EntityLiving { + } + if (canPickup) { + // CraftBukkit end +- double d0 = (double) this.e(enumitemslot); ++ double d0 = this.e(enumitemslot); + + if (!itemstack1.isEmpty() && (double) Math.max(this.random.nextFloat() - 0.1F, 0.0F) < d0) { + this.forceDrops = true; // CraftBukkit +@@ -793,7 +793,7 @@ public abstract class EntityInsentient extends EntityLiving { + d2 = (entity.getBoundingBox().minY + entity.getBoundingBox().maxY) / 2.0D - this.getHeadY(); + } + +- double d3 = (double) MathHelper.sqrt(d0 * d0 + d1 * d1); ++ double d3 = MathHelper.sqrt(d0 * d0 + d1 * d1); + float f2 = (float) (MathHelper.d(d1, d0) * 57.2957763671875D) - 90.0F; + float f3 = (float) (-(MathHelper.d(d2, d3) * 57.2957763671875D)); + +@@ -818,7 +818,7 @@ public abstract class EntityInsentient extends EntityLiving { + public static boolean a(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { + BlockPosition blockposition1 = blockposition.down(); + +- return enummobspawn == EnumMobSpawn.SPAWNER || generatoraccess.getType(blockposition1).a((IBlockAccess) generatoraccess, blockposition1, entitytypes); ++ return enummobspawn == EnumMobSpawn.SPAWNER || generatoraccess.getType(blockposition1).a(generatoraccess, blockposition1, entitytypes); + } + + public boolean a(GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn) { +@@ -867,9 +867,9 @@ public abstract class EntityInsentient extends EntityLiving { + public ItemStack getEquipment(EnumItemSlot enumitemslot) { + switch (enumitemslot.a()) { + case HAND: +- return (ItemStack) this.bw.get(enumitemslot.b()); ++ return this.bw.get(enumitemslot.b()); + case ARMOR: +- return (ItemStack) this.bx.get(enumitemslot.b()); ++ return this.bx.get(enumitemslot.b()); + default: + return ItemStack.b; + } +@@ -1148,7 +1148,7 @@ public abstract class EntityInsentient extends EntityLiving { + return EnumInteractionResult.a(this.world.isClientSide); + } else { + if (itemstack.getItem() == Items.NAME_TAG) { +- EnumInteractionResult enuminteractionresult = itemstack.a(entityhuman, (EntityLiving) this, enumhand); ++ EnumInteractionResult enuminteractionresult = itemstack.a(entityhuman, this, enumhand); + + if (enuminteractionresult.a()) { + return enuminteractionresult; +@@ -1281,7 +1281,7 @@ public abstract class EntityInsentient extends EntityLiving { + } + + if (!this.world.isClientSide && flag && this.world instanceof WorldServer) { +- ((WorldServer) this.world).getChunkProvider().broadcast(this, new PacketPlayOutAttachEntity(this, (Entity) null)); ++ ((WorldServer) this.world).getChunkProvider().broadcast(this, new PacketPlayOutAttachEntity(this, null)); + } + } + +@@ -1406,33 +1406,33 @@ public abstract class EntityInsentient extends EntityLiving { + } + + public void setNoAI(boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityInsentient.b); ++ byte b0 = this.datawatcher.get(EntityInsentient.b); + + this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 1) : (byte) (b0 & -2)); + } + + public void setLeftHanded(boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityInsentient.b); ++ byte b0 = this.datawatcher.get(EntityInsentient.b); + + this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 2) : (byte) (b0 & -3)); + } + + public void setAggressive(boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityInsentient.b); ++ byte b0 = this.datawatcher.get(EntityInsentient.b); + + this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 4) : (byte) (b0 & -5)); + } + + public boolean isNoAI() { +- return ((Byte) this.datawatcher.get(EntityInsentient.b) & 1) != 0; ++ return (this.datawatcher.get(EntityInsentient.b) & 1) != 0; + } + + public boolean isLeftHanded() { +- return ((Byte) this.datawatcher.get(EntityInsentient.b) & 2) != 0; ++ return (this.datawatcher.get(EntityInsentient.b) & 2) != 0; + } + + public boolean isAggressive() { +- return ((Byte) this.datawatcher.get(EntityInsentient.b) & 4) != 0; ++ return (this.datawatcher.get(EntityInsentient.b) & 4) != 0; + } + + public void a(boolean flag) {} +@@ -1454,7 +1454,7 @@ public abstract class EntityInsentient extends EntityLiving { + + if (entity instanceof EntityLiving) { + f += EnchantmentManager.a(this.getItemInMainHand(), ((EntityLiving) entity).getMonsterType()); +- f1 += (float) EnchantmentManager.b((EntityLiving) this); ++ f1 += (float) EnchantmentManager.b(this); + } + + int i = EnchantmentManager.getFireAspectEnchantmentLevel(this); +@@ -1474,7 +1474,7 @@ public abstract class EntityInsentient extends EntityLiving { + + if (flag) { + if (f1 > 0.0F && entity instanceof EntityLiving) { +- ((EntityLiving) entity).doKnockback(f1 * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); ++ ((EntityLiving) entity).doKnockback(f1 * 0.5F, MathHelper.sin(this.yaw * 0.017453292F), -MathHelper.cos(this.yaw * 0.017453292F), this); + this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D)); + } + +@@ -1484,7 +1484,7 @@ public abstract class EntityInsentient extends EntityLiving { + this.a(entityhuman, this.getItemInMainHand(), entityhuman.isHandRaised() ? entityhuman.getActiveItem() : ItemStack.b); + } + +- this.a((EntityLiving) this, entity); ++ this.a(this, entity); + this.z(entity); + } + +diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java +index a7373a63cb11822ca83728d6740f39180833856e..c2d79003e1212e831e280ebe28a0665ecd152a71 100644 +--- a/src/main/java/net/minecraft/server/EntityIronGolem.java ++++ b/src/main/java/net/minecraft/server/EntityIronGolem.java +@@ -33,7 +33,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { + this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); + this.targetSelector.a(1, new PathfinderGoalDefendVillage(this)); +- this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, new Class[0])); ++ this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::b)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityInsentient.class, 5, false, false, (entityliving) -> { + return entityliving instanceof IMonster && !(entityliving instanceof EntityCreeper); +@@ -151,7 +151,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { + + if (flag) { + entity.setMot(entity.getMot().add(0.0D, 0.4000000059604645D, 0.0D)); +- this.a((EntityLiving) this, entity); ++ this.a(this, entity); + } + + this.playSound(SoundEffects.ENTITY_IRON_GOLEM_ATTACK, 1.0F, 1.0F); +@@ -227,11 +227,11 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { + } + + public boolean isPlayerCreated() { +- return ((Byte) this.datawatcher.get(EntityIronGolem.b) & 1) != 0; ++ return (this.datawatcher.get(EntityIronGolem.b) & 1) != 0; + } + + public void setPlayerCreated(boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityIronGolem.b); ++ byte b0 = this.datawatcher.get(EntityIronGolem.b); + + if (flag) { + this.datawatcher.set(EntityIronGolem.b, (byte) (b0 | 1)); +@@ -252,19 +252,19 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { + BlockPosition blockposition1 = blockposition.down(); + IBlockData iblockdata = iworldreader.getType(blockposition1); + +- if (!iblockdata.a((IBlockAccess) iworldreader, blockposition1, (Entity) this) && !world.paperConfig.ironGolemsCanSpawnInAir) { // Paper ++ if (!iblockdata.a(iworldreader, blockposition1, this) && !world.paperConfig.ironGolemsCanSpawnInAir) { // Paper + return false; + } else { + for (int i = 1; i < 3; ++i) { + BlockPosition blockposition2 = blockposition.up(i); + IBlockData iblockdata1 = iworldreader.getType(blockposition2); + +- if (!SpawnerCreature.a((IBlockAccess) iworldreader, blockposition2, iblockdata1, iblockdata1.getFluid(), EntityTypes.IRON_GOLEM)) { ++ if (!SpawnerCreature.a(iworldreader, blockposition2, iblockdata1, iblockdata1.getFluid(), EntityTypes.IRON_GOLEM)) { + return false; + } + } + +- return SpawnerCreature.a((IBlockAccess) iworldreader, blockposition, iworldreader.getType(blockposition), FluidTypes.EMPTY.h(), EntityTypes.IRON_GOLEM) && iworldreader.i(this); ++ return SpawnerCreature.a(iworldreader, blockposition, iworldreader.getType(blockposition), FluidTypes.EMPTY.h(), EntityTypes.IRON_GOLEM) && iworldreader.i(this); + } + } + +@@ -272,8 +272,8 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { + + NONE(1.0F), LOW(0.75F), MEDIUM(0.5F), HIGH(0.25F); + +- private static final List e = (List) Stream.of(values()).sorted(Comparator.comparingDouble((entityirongolem_cracklevel) -> { +- return (double) entityirongolem_cracklevel.f; ++ private static final List e = Stream.of(values()).sorted(Comparator.comparingDouble((entityirongolem_cracklevel) -> { ++ return entityirongolem_cracklevel.f; + })).collect(ImmutableList.toImmutableList()); + private final float f; + +diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java +index ebedb11ad7f281601abb26da6b035f1103e1fc98..1e6e3e21829c66c411314bdab8677b3118197e63 100644 +--- a/src/main/java/net/minecraft/server/EntityItem.java ++++ b/src/main/java/net/minecraft/server/EntityItem.java +@@ -70,9 +70,9 @@ public class EntityItem extends Entity { + this.lastZ = this.locZ(); + Vec3D vec3d = this.getMot(); + +- if (this.a((Tag) TagsFluid.WATER)) { ++ if (this.a(TagsFluid.WATER)) { + this.u(); +- } else if (this.a((Tag) TagsFluid.LAVA)) { ++ } else if (this.a(TagsFluid.LAVA)) { + this.v(); + } else if (!this.isNoGravity()) { + this.setMot(this.getMot().add(0.0D, -0.04D, 0.0D)); +@@ -95,7 +95,7 @@ public class EntityItem extends Entity { + f = this.world.getType(new BlockPosition(this.locX(), this.locY() - 1.0D, this.locZ())).getBlock().getFrictionFactor() * 0.98F; + } + +- this.setMot(this.getMot().d((double) f, 0.98D, (double) f)); ++ this.setMot(this.getMot().d(f, 0.98D, f)); + if (this.onGround) { + this.setMot(this.getMot().d(1.0D, -0.5D, 1.0D)); + } +@@ -105,7 +105,7 @@ public class EntityItem extends Entity { + int i = flag ? 2 : 40; + + if (this.ticksLived % i == 0) { +- if (this.world.getFluid(this.getChunkCoordinates()).a((Tag) TagsFluid.LAVA) && !this.isFireProof()) { ++ if (this.world.getFluid(this.getChunkCoordinates()).a(TagsFluid.LAVA) && !this.isFireProof()) { + this.playSound(SoundEffects.ENTITY_GENERIC_BURN, 0.4F, 2.0F + this.random.nextFloat() * 0.4F); + } + +@@ -396,7 +396,7 @@ public class EntityItem extends Entity { + } + + // Call newer event afterwards +- EntityPickupItemEvent entityEvent = new EntityPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining); ++ EntityPickupItemEvent entityEvent = new EntityPickupItemEvent(entityhuman.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining); + entityEvent.setCancelled(!entityhuman.canPickUpLoot); + this.world.getServer().getPluginManager().callEvent(entityEvent); + if (entityEvent.isCancelled()) { +@@ -436,7 +436,7 @@ public class EntityItem extends Entity { + public IChatBaseComponent getDisplayName() { + IChatBaseComponent ichatbasecomponent = this.getCustomName(); + +- return (IChatBaseComponent) (ichatbasecomponent != null ? ichatbasecomponent : new ChatMessage(this.getItemStack().j())); ++ return ichatbasecomponent != null ? ichatbasecomponent : new ChatMessage(this.getItemStack().j()); + } + + @Override +@@ -457,7 +457,7 @@ public class EntityItem extends Entity { + } + + public ItemStack getItemStack() { +- return (ItemStack) this.getDataWatcher().get(EntityItem.ITEM); ++ return this.getDataWatcher().get(EntityItem.ITEM); + } + + public void setItemStack(ItemStack itemstack) { +@@ -470,7 +470,7 @@ public class EntityItem extends Entity { + public void a(DataWatcherObject datawatcherobject) { + super.a(datawatcherobject); + if (EntityItem.ITEM.equals(datawatcherobject)) { +- this.getItemStack().a((Entity) this); ++ this.getItemStack().a(this); + } + + } +diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java +index e38f5d1ab2764e85aefc3398d29170c806250148..ee4bde44c3febd88ea4d498183a4e9cf06a405fe 100644 +--- a/src/main/java/net/minecraft/server/EntityItemFrame.java ++++ b/src/main/java/net/minecraft/server/EntityItemFrame.java +@@ -71,9 +71,9 @@ public class EntityItemFrame extends EntityHanging { + if (entity != null) { + entity.setPositionRaw(d1, d2, d3); + } +- double d4 = (double) width; +- double d5 = (double) height; +- double d6 = (double) width; ++ double d4 = width; ++ double d5 = height; ++ double d6 = width; + EnumDirection.EnumAxis enumdirection_enumaxis = direction.n(); + + switch (enumdirection_enumaxis) { +@@ -104,7 +104,7 @@ public class EntityItemFrame extends EntityHanging { + } else { + IBlockData iblockdata = this.world.getType(this.blockPosition.shift(this.direction.opposite())); + +- return !iblockdata.getMaterial().isBuildable() && (!this.direction.n().d() || !BlockDiodeAbstract.isDiode(iblockdata)) ? false : this.world.getEntities(this, this.getBoundingBox(), EntityItemFrame.b).isEmpty(); ++ return !iblockdata.getMaterial().isBuildable() && (!this.direction.n().d() || !BlockDiodeAbstract.isDiode(iblockdata)) ? false : this.world.getEntities(this, this.getBoundingBox(), EntityHanging.b).isEmpty(); + } + } + +@@ -200,7 +200,7 @@ public class EntityItemFrame extends EntityHanging { + } + + if (flag) { +- this.a((IMaterial) Items.ITEM_FRAME); ++ this.a(Items.ITEM_FRAME); + } + + if (!itemstack.isEmpty()) { +@@ -227,7 +227,7 @@ public class EntityItemFrame extends EntityHanging { + } + + public ItemStack getItem() { +- return (ItemStack) this.getDataWatcher().get(EntityItemFrame.ITEM); ++ return this.getDataWatcher().get(EntityItemFrame.ITEM); + } + + public void setItem(ItemStack itemstack) { +@@ -244,7 +244,7 @@ public class EntityItemFrame extends EntityHanging { + if (!itemstack.isEmpty()) { + itemstack = itemstack.cloneItemStack(); + itemstack.setCount(1); +- itemstack.a((Entity) this); ++ itemstack.a(this); + } + + this.getDataWatcher().set(EntityItemFrame.ITEM, itemstack); +@@ -274,14 +274,14 @@ public class EntityItemFrame extends EntityHanging { + ItemStack itemstack = this.getItem(); + + if (!itemstack.isEmpty() && itemstack.z() != this) { +- itemstack.a((Entity) this); ++ itemstack.a(this); + } + } + + } + + public int getRotation() { +- return (Integer) this.getDataWatcher().get(EntityItemFrame.g); ++ return this.getDataWatcher().get(EntityItemFrame.g); + } + + public void setRotation(int i) { +diff --git a/src/main/java/net/minecraft/server/EntityLeash.java b/src/main/java/net/minecraft/server/EntityLeash.java +index 99052f026f2d24300ab0a1b7c6b8b134d6800995..2926f18885bd08def7ee463e1e37f417ee516c15 100644 +--- a/src/main/java/net/minecraft/server/EntityLeash.java ++++ b/src/main/java/net/minecraft/server/EntityLeash.java +@@ -123,7 +123,7 @@ public class EntityLeash extends EntityHanging { + + @Override + public boolean survives() { +- return this.world.getType(this.blockPosition).getBlock().a((Tag) TagsBlock.FENCES); ++ return this.world.getType(this.blockPosition).getBlock().a(TagsBlock.FENCES); + } + + public static EntityLeash a(World world, BlockPosition blockposition) { +diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java +index 71cc6953091119dda28003a8199e981440483c72..d9322ea7fa5e7610c64e0109b08fdf8b148d6e26 100644 +--- a/src/main/java/net/minecraft/server/EntityLightning.java ++++ b/src/main/java/net/minecraft/server/EntityLightning.java +@@ -51,8 +51,8 @@ public class EntityLightning extends Entity { + // CraftBukkit start - Use relative location for far away sounds + // this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); + float pitch = 0.8F + this.random.nextFloat() * 0.2F; +- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; +- for (EntityPlayer player : (List) (List) this.world.getPlayers()) { ++ int viewDistance = this.world.getServer().getViewDistance() * 16; ++ for (EntityPlayer player : (List) this.world.getPlayers()) { + double deltaX = this.locX() - player.locX(); + double deltaZ = this.locZ() - player.locZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +@@ -107,7 +107,7 @@ public class EntityLightning extends Entity { + } + + if (this.f != null) { +- CriterionTriggers.E.a(this.f, (Collection) list); ++ CriterionTriggers.E.a(this.f, list); + } + } + } +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index a37badcd92afd03a4b622048921618dbca2db8b4..1fd21bd75eedb6bc53994eee1a6426f3b04a4acf 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -158,7 +158,7 @@ public abstract class EntityLiving extends Entity { + this.G = 0.6F; + DynamicOpsNBT dynamicopsnbt = DynamicOpsNBT.a; + +- this.bn = this.a(new Dynamic(dynamicopsnbt, dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), dynamicopsnbt.emptyMap())))); ++ this.bn = this.a(new Dynamic(dynamicopsnbt, dynamicopsnbt.createMap(ImmutableMap.of(dynamicopsnbt.createString("memories"), dynamicopsnbt.emptyMap())))); + } + + public BehaviorController getBehaviorController() { +@@ -166,7 +166,7 @@ public abstract class EntityLiving extends Entity { + } + + protected BehaviorController.b cJ() { +- return BehaviorController.a((Collection) ImmutableList.of(), (Collection) ImmutableList.of()); ++ return BehaviorController.a(ImmutableList.of(), ImmutableList.of()); + } + + protected BehaviorController a(Dynamic dynamic) { +@@ -212,7 +212,7 @@ public abstract class EntityLiving extends Entity { + float f = (float) MathHelper.f(this.fallDistance - 3.0F); + + if (!iblockdata.isAir()) { +- double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D); ++ double d1 = Math.min(0.2F + f / 15.0F, 2.5D); + int i = (int) (150.0D * d1); + + // CraftBukkit start - visiblity api +@@ -253,7 +253,7 @@ public abstract class EntityLiving extends Entity { + if (this.inBlock()) { + this.damageEntity(DamageSource.STUCK, 1.0F); + } else if (flag && !this.world.getWorldBorder().a(this.getBoundingBox())) { +- double d0 = this.world.getWorldBorder().a((Entity) this) + this.world.getWorldBorder().getDamageBuffer(); ++ double d0 = this.world.getWorldBorder().a(this) + this.world.getWorldBorder().getDamageBuffer(); + + if (d0 < 0.0D) { + double d1 = this.world.getWorldBorder().getDamageAmount(); +@@ -273,7 +273,7 @@ public abstract class EntityLiving extends Entity { + boolean flag1 = flag && ((EntityHuman) this).abilities.isInvulnerable; + + if (this.isAlive()) { +- if (this.a((Tag) TagsFluid.WATER) && !this.world.getType(new BlockPosition(this.locX(), this.getHeadY(), this.locZ())).a(Blocks.BUBBLE_COLUMN)) { ++ if (this.a(TagsFluid.WATER) && !this.world.getType(new BlockPosition(this.locX(), this.getHeadY(), this.locZ())).a(Blocks.BUBBLE_COLUMN)) { + if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden + this.setAirTicks(this.l(this.getAirTicks())); + if (this.getAirTicks() == -20) { +@@ -337,9 +337,9 @@ public abstract class EntityLiving extends Entity { + + if (this.lastDamager != null) { + if (!this.lastDamager.isAlive()) { +- this.setLastDamager((EntityLiving) null); ++ this.setLastDamager(null); + } else if (this.ticksLived - this.hurtTimestamp > 100) { +- this.setLastDamager((EntityLiving) null); ++ this.setLastDamager(null); + } + } + +@@ -366,7 +366,7 @@ public abstract class EntityLiving extends Entity { + } + + protected boolean cO() { +- return this.aJ().a((Tag) TagsBlock.SOUL_SPEED_BLOCKS); ++ return this.aJ().a(TagsBlock.SOUL_SPEED_BLOCKS); + } + + @Override +@@ -400,7 +400,7 @@ public abstract class EntityLiving extends Entity { + return; + } + +- attributemodifiable.b(new AttributeModifier(EntityLiving.c, "Soul speed boost", (double) (0.03F * (1.0F + (float) i * 0.35F)), AttributeModifier.Operation.ADDITION)); ++ attributemodifiable.b(new AttributeModifier(EntityLiving.c, "Soul speed boost", 0.03F * (1.0F + (float) i * 0.35F), AttributeModifier.Operation.ADDITION)); + if (this.getRandom().nextFloat() < 0.04F) { + ItemStack itemstack = this.getEquipment(EnumItemSlot.FEET); + +@@ -579,7 +579,7 @@ public abstract class EntityLiving extends Entity { + nbttagcompound.setInt("SleepingZ", blockposition.getZ()); + }); + DataResult dataresult = this.bn.a((DynamicOps) DynamicOpsNBT.a); +- Logger logger = EntityLiving.LOGGER; ++ Logger logger = Entity.LOGGER; + + logger.getClass(); + dataresult.resultOrPartial(logger::error).ifPresent((nbtbase) -> { +@@ -638,7 +638,7 @@ public abstract class EntityLiving extends Entity { + boolean flag = scoreboardteam != null && this.world.getScoreboard().addPlayerToTeam(this.getUniqueIDString(), scoreboardteam); + + if (!flag) { +- EntityLiving.LOGGER.warn("Unable to add mob to team \"{}\" (that team probably doesn't exist)", s); ++ Entity.LOGGER.warn("Unable to add mob to team \"{}\" (that team probably doesn't exist)", s); + } + } + +@@ -650,7 +650,7 @@ public abstract class EntityLiving extends Entity { + BlockPosition blockposition = new BlockPosition(nbttagcompound.getInt("SleepingX"), nbttagcompound.getInt("SleepingY"), nbttagcompound.getInt("SleepingZ")); + + this.e(blockposition); +- this.datawatcher.set(EntityLiving.POSE, EntityPose.SLEEPING); ++ this.datawatcher.set(Entity.POSE, EntityPose.SLEEPING); + if (!this.justCreated) { + this.a(blockposition); + } +@@ -691,7 +691,7 @@ public abstract class EntityLiving extends Entity { + try { + while (iterator.hasNext()) { + MobEffectList mobeffectlist = (MobEffectList) iterator.next(); +- MobEffect mobeffect = (MobEffect) this.effects.get(mobeffectlist); ++ MobEffect mobeffect = this.effects.get(mobeffectlist); + + if (!mobeffect.tick(this, () -> { + this.a(mobeffect, true); +@@ -733,8 +733,8 @@ public abstract class EntityLiving extends Entity { + this.updateEffects = false; + } + +- int i = (Integer) this.datawatcher.get(EntityLiving.f); +- boolean flag = (Boolean) this.datawatcher.get(EntityLiving.g); ++ int i = this.datawatcher.get(EntityLiving.f); ++ boolean flag = this.datawatcher.get(EntityLiving.g); + + if (i > 0) { + boolean flag1; +@@ -849,7 +849,7 @@ public abstract class EntityLiving extends Entity { + + for (flag = false; iterator.hasNext(); flag = true) { + // CraftBukkit start +- MobEffect effect = (MobEffect) iterator.next(); ++ MobEffect effect = iterator.next(); + EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED); + if (event.isCancelled()) { + continue; +@@ -877,7 +877,7 @@ public abstract class EntityLiving extends Entity { + + @Nullable + public MobEffect getEffect(MobEffectList mobeffectlist) { +- return (MobEffect) this.effects.get(mobeffectlist); ++ return this.effects.get(mobeffectlist); + } + + // CraftBukkit start +@@ -896,7 +896,7 @@ public abstract class EntityLiving extends Entity { + if (!this.d(mobeffect)) { + return false; + } else { +- MobEffect mobeffect1 = (MobEffect) this.effects.get(mobeffect.getMobEffect()); ++ MobEffect mobeffect1 = this.effects.get(mobeffect.getMobEffect()); + + // CraftBukkit start + boolean override = false; +@@ -965,7 +965,7 @@ public abstract class EntityLiving extends Entity { + return null; + } + +- return (MobEffect) this.effects.remove(mobeffectlist); ++ return this.effects.remove(mobeffectlist); + } + + public boolean removeEffect(MobEffectList mobeffectlist) { +@@ -1046,7 +1046,7 @@ public abstract class EntityLiving extends Entity { + return (float) ((EntityPlayer) this).getBukkitEntity().getHealth(); + } + // CraftBukkit end +- return (Float) this.datawatcher.get(EntityLiving.HEALTH); ++ return this.datawatcher.get(EntityLiving.HEALTH); + } + + public void setHealth(float f) { +@@ -1608,7 +1608,7 @@ public abstract class EntityLiving extends Entity { + IBlockData iblockdata = this.dr(); + Block block = iblockdata.getBlock(); + +- if (block.a((Tag) TagsBlock.CLIMBABLE)) { ++ if (block.a(TagsBlock.CLIMBABLE)) { + this.bF = Optional.of(blockposition); + return true; + } else if (block instanceof BlockTrapdoor && this.b(blockposition, iblockdata)) { +@@ -1625,10 +1625,10 @@ public abstract class EntityLiving extends Entity { + } + + private boolean b(BlockPosition blockposition, IBlockData iblockdata) { +- if ((Boolean) iblockdata.get(BlockTrapdoor.OPEN)) { ++ if (iblockdata.get(BlockTrapdoor.OPEN)) { + IBlockData iblockdata1 = this.world.getType(blockposition.down()); + +- if (iblockdata1.a(Blocks.LADDER) && iblockdata1.get(BlockLadder.FACING) == iblockdata.get(BlockTrapdoor.FACING)) { ++ if (iblockdata1.a(Blocks.LADDER) && iblockdata1.get(BlockLadder.FACING) == iblockdata.get(BlockFacingHorizontal.FACING)) { + return true; + } + } +@@ -1928,7 +1928,7 @@ public abstract class EntityLiving extends Entity { + + @Nullable + public EntityLiving getKillingEntity() { +- return (EntityLiving) (this.combatTracker.c() != null ? this.combatTracker.c() : (this.killer != null ? this.killer : (this.lastDamager != null ? this.lastDamager : null))); ++ return this.combatTracker.c() != null ? this.combatTracker.c() : (this.killer != null ? this.killer : (this.lastDamager != null ? this.lastDamager : null)); + } + + public final float getMaxHealth() { +@@ -1936,7 +1936,7 @@ public abstract class EntityLiving extends Entity { + } + + public final int getArrowCount() { +- return (Integer) this.datawatcher.get(EntityLiving.bo); ++ return this.datawatcher.get(EntityLiving.bo); + } + + public final void setArrowCount(int i) { +@@ -1944,7 +1944,7 @@ public abstract class EntityLiving extends Entity { + } + + public final int dy() { +- return (Integer) this.datawatcher.get(EntityLiving.bp); ++ return this.datawatcher.get(EntityLiving.bp); + } + + public final void q(int i) { +@@ -2129,7 +2129,7 @@ public abstract class EntityLiving extends Entity { + private void a(Entity entity) { + Vec3D vec3d; + +- if (!entity.dead && !this.world.getType(entity.getChunkCoordinates()).getBlock().a((Tag) TagsBlock.PORTALS)) { ++ if (!entity.dead && !this.world.getType(entity.getChunkCoordinates()).getBlock().a(TagsBlock.PORTALS)) { + vec3d = entity.c(this); + } else { + vec3d = new Vec3D(entity.locX(), entity.locY() + (double) entity.getHeight(), entity.locZ()); +@@ -2151,11 +2151,11 @@ public abstract class EntityLiving extends Entity { + + Vec3D vec3d = this.getMot(); + +- this.setMot(vec3d.x, (double) f, vec3d.z); ++ this.setMot(vec3d.x, f, vec3d.z); + if (this.isSprinting()) { + float f1 = this.yaw * 0.017453292F; + +- this.setMot(this.getMot().add((double) (-MathHelper.sin(f1) * 0.2F), 0.0D, (double) (MathHelper.cos(f1) * 0.2F))); ++ this.setMot(this.getMot().add(-MathHelper.sin(f1) * 0.2F, 0.0D, MathHelper.cos(f1) * 0.2F)); + } + + this.impulse = true; +@@ -2218,7 +2218,7 @@ public abstract class EntityLiving extends Entity { + vec3d1 = new Vec3D(vec3d1.x, 0.2D, vec3d1.z); + } + +- this.setMot(vec3d1.d((double) f, 0.800000011920929D, (double) f)); ++ this.setMot(vec3d1.d(f, 0.800000011920929D, f)); + Vec3D vec3d2 = this.a(d0, flag, this.getMot()); + + this.setMot(vec3d2); +@@ -2231,7 +2231,7 @@ public abstract class EntityLiving extends Entity { + this.move(EnumMoveType.SELF, this.getMot()); + Vec3D vec3d3; + +- if (this.b((Tag) TagsFluid.LAVA) <= this.cw()) { ++ if (this.b(TagsFluid.LAVA) <= this.cw()) { + this.setMot(this.getMot().d(0.5D, 0.800000011920929D, 0.5D)); + vec3d3 = this.a(d0, flag, this.getMot()); + this.setMot(vec3d3); +@@ -2466,7 +2466,7 @@ public abstract class EntityLiving extends Entity { + + if (f > 0.0025000002F) { + f3 = 1.0F; +- f2 = (float) Math.sqrt((double) f) * 3.0F; ++ f2 = (float) Math.sqrt(f) * 3.0F; + float f4 = (float) MathHelper.d(d1, d0) * 57.295776F - 90.0F; + float f5 = MathHelper.e(MathHelper.g(this.yaw) - f4); + +@@ -2602,8 +2602,8 @@ public abstract class EntityLiving extends Entity { + } + + private void a(Map map) { +- ItemStack itemstack = (ItemStack) map.get(EnumItemSlot.MAINHAND); +- ItemStack itemstack1 = (ItemStack) map.get(EnumItemSlot.OFFHAND); ++ ItemStack itemstack = map.get(EnumItemSlot.MAINHAND); ++ ItemStack itemstack1 = map.get(EnumItemSlot.OFFHAND); + + if (itemstack != null && itemstack1 != null && ItemStack.matches(itemstack, this.e(EnumItemSlot.OFFHAND)) && ItemStack.matches(itemstack1, this.e(EnumItemSlot.MAINHAND))) { + ((WorldServer) this.world).getChunkProvider().broadcast(this, new PacketPlayOutEntityStatus(this, (byte) 55)); +@@ -2637,7 +2637,7 @@ public abstract class EntityLiving extends Entity { + } + + private ItemStack d(EnumItemSlot enumitemslot) { +- return (ItemStack) this.bv.get(enumitemslot.b()); ++ return this.bv.get(enumitemslot.b()); + } + + private void b(EnumItemSlot enumitemslot, ItemStack itemstack) { +@@ -2645,7 +2645,7 @@ public abstract class EntityLiving extends Entity { + } + + private ItemStack e(EnumItemSlot enumitemslot) { +- return (ItemStack) this.bu.get(enumitemslot.b()); ++ return this.bu.get(enumitemslot.b()); + } + + private void c(EnumItemSlot enumitemslot, ItemStack itemstack) { +@@ -2744,18 +2744,18 @@ public abstract class EntityLiving extends Entity { + double d7; + + if (this.aN()) { +- d7 = this.b((Tag) TagsFluid.LAVA); ++ d7 = this.b(TagsFluid.LAVA); + } else { +- d7 = this.b((Tag) TagsFluid.WATER); ++ d7 = this.b(TagsFluid.WATER); + } + + boolean flag = this.isInWater() && d7 > 0.0D; + double d8 = this.cw(); + + if (flag && (!this.onGround || d7 > d8)) { +- this.c((Tag) TagsFluid.WATER); ++ this.c(TagsFluid.WATER); + } else if (this.aN() && (!this.onGround || d7 > d8)) { +- this.c((Tag) TagsFluid.LAVA); ++ this.c(TagsFluid.LAVA); + } else if ((this.onGround || flag && d7 <= d8) && this.jumpTicks == 0) { + if (new com.destroystokyo.paper.event.entity.EntityJumpEvent(getBukkitLivingEntity()).callEvent()) { // Paper + this.jump(); +@@ -2773,7 +2773,7 @@ public abstract class EntityLiving extends Entity { + this.t(); + AxisAlignedBB axisalignedbb = this.getBoundingBox(); + +- this.f(new Vec3D((double) this.aY, (double) this.aZ, (double) this.ba)); ++ this.f(new Vec3D(this.aY, this.aZ, this.ba)); + //this.world.getMethodProfiler().exit(); // Akarin - remove caller + //this.world.getMethodProfiler().enter("push"); // Akarin - remove caller + if (this.bm > 0) { +@@ -2849,7 +2849,7 @@ public abstract class EntityLiving extends Entity { + j = 0; + + for (int k = 0; k < list.size(); ++k) { +- if (!((Entity) list.get(k)).isPassenger()) { ++ if (!list.get(k).isPassenger()) { + ++j; + } + } +@@ -2861,7 +2861,7 @@ public abstract class EntityLiving extends Entity { + + numCollisions = Math.max(0, numCollisions - world.paperConfig.maxCollisionsPerEntity); // Paper + for (j = 0; j < list.size() && numCollisions < world.paperConfig.maxCollisionsPerEntity; ++j) { // Paper +- Entity entity = (Entity) list.get(j); ++ Entity entity = list.get(j); + entity.numCollisions++; // Paper + numCollisions++; // Paper + +@@ -2880,7 +2880,7 @@ public abstract class EntityLiving extends Entity { + + if (!list.isEmpty()) { + for (int i = 0; i < list.size(); ++i) { +- Entity entity = (Entity) list.get(i); ++ Entity entity = list.get(i); + + if (entity instanceof EntityLiving) { + this.h((EntityLiving) entity); +@@ -2914,7 +2914,7 @@ public abstract class EntityLiving extends Entity { + } + + public boolean isRiptiding() { +- return ((Byte) this.datawatcher.get(EntityLiving.an) & 4) != 0; ++ return (this.datawatcher.get(EntityLiving.an) & 4) != 0; + } + + // Paper start +@@ -3035,11 +3035,11 @@ public abstract class EntityLiving extends Entity { + public abstract EnumMainHand getMainHand(); + + public boolean isHandRaised() { +- return ((Byte) this.datawatcher.get(EntityLiving.an) & 1) > 0; ++ return (this.datawatcher.get(EntityLiving.an) & 1) > 0; + } + + public EnumHand getRaisedHand() { +- return ((Byte) this.datawatcher.get(EntityLiving.an) & 2) > 0 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND; ++ return (this.datawatcher.get(EntityLiving.an) & 2) > 0 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND; + } + + // Paper start - lag compensate eating +@@ -3092,7 +3092,7 @@ public abstract class EntityLiving extends Entity { + } + + protected void c(int i, boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityLiving.an); ++ byte b0 = this.datawatcher.get(EntityLiving.an); + int j; + + if (flag) { +@@ -3378,11 +3378,11 @@ public abstract class EntityLiving extends Entity { + public AxisAlignedBB f(EntityPose entitypose) { + EntitySize entitysize = this.a(entitypose); + +- return new AxisAlignedBB((double) (-entitysize.width / 2.0F), 0.0D, (double) (-entitysize.width / 2.0F), (double) (entitysize.width / 2.0F), (double) entitysize.height, (double) (entitysize.width / 2.0F)); ++ return new AxisAlignedBB(-entitysize.width / 2.0F, 0.0D, -entitysize.width / 2.0F, entitysize.width / 2.0F, entitysize.height, entitysize.width / 2.0F); + } + + public Optional getBedPosition() { +- return (Optional) this.datawatcher.get(EntityLiving.bq); ++ return this.datawatcher.get(EntityLiving.bq); + } + + public void e(BlockPosition blockposition) { +@@ -3405,7 +3405,7 @@ public abstract class EntityLiving extends Entity { + IBlockData iblockdata = this.world.getType(blockposition); + + if (iblockdata.getBlock() instanceof BlockBed) { +- this.world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockBed.OCCUPIED, true), 3); ++ this.world.setTypeAndData(blockposition, iblockdata.set(BlockBed.OCCUPIED, true), 3); + } + + this.setPose(EntityPose.SLEEPING); +@@ -3420,7 +3420,7 @@ public abstract class EntityLiving extends Entity { + } + + private boolean z() { +- return (Boolean) this.getBedPosition().map((blockposition) -> { ++ return this.getBedPosition().map((blockposition) -> { + return this.world.getType(blockposition).getBlock() instanceof BlockBed; + }).orElse(false); + } +@@ -3434,8 +3434,8 @@ public abstract class EntityLiving extends Entity { + IBlockData iblockdata = this.world.getType(blockposition); + + if (iblockdata.getBlock() instanceof BlockBed) { +- this.world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockBed.OCCUPIED, false), 3); +- Vec3D vec3d = (Vec3D) BlockBed.a(this.getEntityType(), this.world, blockposition, 0).orElseGet(() -> { ++ this.world.setTypeAndData(blockposition, iblockdata.set(BlockBed.OCCUPIED, false), 3); ++ Vec3D vec3d = BlockBed.a(this.getEntityType(), this.world, blockposition, 0).orElseGet(() -> { + BlockPosition blockposition1 = blockposition.up(); + + return new Vec3D((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.1D, (double) blockposition1.getZ() + 0.5D); +@@ -3472,7 +3472,7 @@ public abstract class EntityLiving extends Entity { + + public ItemStack a(World world, ItemStack itemstack) { + if (itemstack.F()) { +- world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), this.d(itemstack), SoundCategory.NEUTRAL, 1.0F, 1.0F + (world.random.nextFloat() - world.random.nextFloat()) * 0.4F); ++ world.playSound(null, this.locX(), this.locY(), this.locZ(), this.d(itemstack), SoundCategory.NEUTRAL, 1.0F, 1.0F + (world.random.nextFloat() - world.random.nextFloat()) * 0.4F); + this.a(itemstack, world, this); + if (!(this instanceof EntityHuman) || !((EntityHuman) this).abilities.canInstantlyBuild) { + itemstack.subtract(1); +@@ -3492,8 +3492,8 @@ public abstract class EntityLiving extends Entity { + while (iterator.hasNext()) { + Pair pair = (Pair) iterator.next(); + +- if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) { +- entityliving.addEffect(new MobEffect((MobEffect) pair.getFirst()), EntityPotionEffectEvent.Cause.FOOD); // CraftBukkit ++ if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < pair.getSecond()) { ++ entityliving.addEffect(new MobEffect(pair.getFirst()), EntityPotionEffectEvent.Cause.FOOD); // CraftBukkit + } + } + } +@@ -3559,7 +3559,7 @@ public abstract class EntityLiving extends Entity { + MovingObjectPositionEntity result = null; + + for (Entity entity : entityList) { +- AxisAlignedBB aabb = entity.getBoundingBox().grow((double) entity.getCollisionBorderSize()); ++ AxisAlignedBB aabb = entity.getBoundingBox().grow(entity.getCollisionBorderSize()); + Optional rayTraceResult = aabb.calculateIntercept(start, end); + + if (rayTraceResult.isPresent()) { +diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java +index 039a74ee15bc1bf562f782b46f797dddccf9e04e..f580f2d1363dda7430fdaab70c21428f6b0cfe42 100644 +--- a/src/main/java/net/minecraft/server/EntityLlama.java ++++ b/src/main/java/net/minecraft/server/EntityLlama.java +@@ -30,7 +30,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + } + + public int getStrength() { +- return (Integer) this.datawatcher.get(EntityLlama.bE); ++ return this.datawatcher.get(EntityLlama.bE); + } + + @Override +@@ -85,7 +85,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + } + + public int getVariant() { +- return MathHelper.clamp((Integer) this.datawatcher.get(EntityLlama.bG), 0, 3); ++ return MathHelper.clamp(this.datawatcher.get(EntityLlama.bG), 0, 3); + } + + public void setVariant(int i) { +@@ -170,7 +170,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + SoundEffect soundeffect = this.fh(); + + if (soundeffect != null) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), this.fh(), this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), this.fh(), this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); + } + } + +@@ -196,7 +196,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + } + + this.setVariant(i); +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + @Override +@@ -306,7 +306,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + + @Nullable + public EnumColor fz() { +- int i = (Integer) this.datawatcher.get(EntityLlama.bF); ++ int i = this.datawatcher.get(EntityLlama.bF); + + return i == -1 ? null : EnumColor.fromColorIndex(i); + } +@@ -325,7 +325,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + public EntityLlama createChild(EntityAgeable entityageable) { + EntityLlama entityllama = this.fA(); + +- this.a(entityageable, (EntityHorseAbstract) entityllama); ++ this.a(entityageable, entityllama); + EntityLlama entityllama1 = (EntityLlama) entityageable; + int i = this.random.nextInt(Math.max(this.getStrength(), entityllama1.getStrength())) + 1; + +@@ -339,7 +339,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + } + + protected EntityLlama fA() { +- return (EntityLlama) EntityTypes.LLAMA.a(this.world); ++ return EntityTypes.LLAMA.a(this.world); + } + + private void j(EntityLiving entityliving) { +@@ -351,7 +351,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + + entityllamaspit.shoot(d0, d1 + (double) f, d2, 1.5F, 10.0F); + if (!this.isSilent()) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_LLAMA_SPIT, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_LLAMA_SPIT, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); + } + + this.world.addEntity(entityllamaspit); +diff --git a/src/main/java/net/minecraft/server/EntityLlamaTrader.java b/src/main/java/net/minecraft/server/EntityLlamaTrader.java +index 45661626586674b35d81bc92b268549aa9b50f1f..d1c20fae15ca16d40680e7e42029f6678bd774be 100644 +--- a/src/main/java/net/minecraft/server/EntityLlamaTrader.java ++++ b/src/main/java/net/minecraft/server/EntityLlamaTrader.java +@@ -13,7 +13,7 @@ public class EntityLlamaTrader extends EntityLlama { + + @Override + protected EntityLlama fA() { +- return (EntityLlama) EntityTypes.TRADER_LLAMA.a(this.world); ++ return EntityTypes.TRADER_LLAMA.a(this.world); + } + + @Override +@@ -91,7 +91,7 @@ public class EntityLlamaTrader extends EntityLlama { + ((EntityAgeable.a) groupdataentity).a(false); + } + +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + public class a extends PathfinderGoalTarget { +diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +index 0f57985d9b4fc8d31e87b50284200aead6b4dd7e..57f83da23ca3ef1d44217bd1e323acb2abe71b9a 100644 +--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java ++++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +@@ -28,7 +28,7 @@ public abstract class EntityMinecartAbstract extends Entity { + private static final DataWatcherObject g = DataWatcher.a(EntityMinecartAbstract.class, DataWatcherRegistry.i); + private static final ImmutableMap> an = ImmutableMap.of(EntityPose.STANDING, ImmutableList.of(0, 1, -1), EntityPose.CROUCHING, ImmutableList.of(0, 1, -1), EntityPose.SWIMMING, ImmutableList.of(0, 1)); + private boolean ao; +- private static final Map> ap = (Map) SystemUtils.a(Maps.newEnumMap(BlockPropertyTrackPosition.class), (enummap) -> { // CraftBukkit - decompile error ++ private static final Map> ap = SystemUtils.a(Maps.newEnumMap(BlockPropertyTrackPosition.class), (enummap) -> { // CraftBukkit - decompile error + BaseBlockPosition baseblockposition = EnumDirection.WEST.p(); + BaseBlockPosition baseblockposition1 = EnumDirection.EAST.p(); + BaseBlockPosition baseblockposition2 = EnumDirection.NORTH.p(); +@@ -82,7 +82,7 @@ public abstract class EntityMinecartAbstract extends Entity { + } + + public static EntityMinecartAbstract a(World world, double d0, double d1, double d2, EntityMinecartAbstract.EnumMinecartType entityminecartabstract_enumminecarttype) { +- return (EntityMinecartAbstract) (entityminecartabstract_enumminecarttype == EntityMinecartAbstract.EnumMinecartType.CHEST ? new EntityMinecartChest(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EntityMinecartAbstract.EnumMinecartType.FURNACE ? new EntityMinecartFurnace(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EntityMinecartAbstract.EnumMinecartType.TNT ? new EntityMinecartTNT(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EntityMinecartAbstract.EnumMinecartType.SPAWNER ? new EntityMinecartMobSpawner(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EntityMinecartAbstract.EnumMinecartType.HOPPER ? new EntityMinecartHopper(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EntityMinecartAbstract.EnumMinecartType.COMMAND_BLOCK ? new EntityMinecartCommandBlock(world, d0, d1, d2) : new EntityMinecartRideable(world, d0, d1, d2))))))); ++ return entityminecartabstract_enumminecarttype == EnumMinecartType.CHEST ? new EntityMinecartChest(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EnumMinecartType.FURNACE ? new EntityMinecartFurnace(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EnumMinecartType.TNT ? new EntityMinecartTNT(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EnumMinecartType.SPAWNER ? new EntityMinecartMobSpawner(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EnumMinecartType.HOPPER ? new EntityMinecartHopper(world, d0, d1, d2) : (entityminecartabstract_enumminecarttype == EnumMinecartType.COMMAND_BLOCK ? new EntityMinecartCommandBlock(world, d0, d1, d2) : new EntityMinecartRideable(world, d0, d1, d2)))))); + } + + @Override +@@ -145,12 +145,12 @@ public abstract class EntityMinecartAbstract extends Entity { + + blockposition_mutableblockposition.d(blockposition.getX() + aint2[0], blockposition.getY() + i, blockposition.getZ() + aint2[1]); + double d0 = this.world.c(blockposition_mutableblockposition, (iblockdata) -> { +- return iblockdata.a((Tag) TagsBlock.CLIMBABLE) ? true : iblockdata.getBlock() instanceof BlockTrapdoor && (Boolean) iblockdata.get(BlockTrapdoor.OPEN); ++ return iblockdata.a(TagsBlock.CLIMBABLE) ? true : iblockdata.getBlock() instanceof BlockTrapdoor && iblockdata.get(BlockTrapdoor.OPEN); + }); + + if (DismountUtil.a(d0)) { +- AxisAlignedBB axisalignedbb = new AxisAlignedBB((double) (-f), d0, (double) (-f), (double) f, d0 + (double) entitysize.height, (double) f); +- Vec3D vec3d = Vec3D.a((BaseBlockPosition) blockposition_mutableblockposition, d0); ++ AxisAlignedBB axisalignedbb = new AxisAlignedBB(-f, d0, -f, f, d0 + (double) entitysize.height, f); ++ Vec3D vec3d = Vec3D.a(blockposition_mutableblockposition, d0); + + if (DismountUtil.a(this.world, entityliving, axisalignedbb.c(vec3d))) { + entityliving.setPose(entitypose); +@@ -163,12 +163,12 @@ public abstract class EntityMinecartAbstract extends Entity { + + double d1 = this.getBoundingBox().maxY; + +- blockposition_mutableblockposition.c((double) blockposition.getX(), d1, (double) blockposition.getZ()); ++ blockposition_mutableblockposition.c(blockposition.getX(), d1, blockposition.getZ()); + UnmodifiableIterator unmodifiableiterator2 = immutablelist.iterator(); + + while (unmodifiableiterator2.hasNext()) { + EntityPose entitypose1 = (EntityPose) unmodifiableiterator2.next(); +- double d2 = (double) entityliving.a(entitypose1).height; ++ double d2 = entityliving.a(entitypose1).height; + double d3 = (double) blockposition_mutableblockposition.getY() + this.world.a(blockposition_mutableblockposition, d1 - (double) blockposition_mutableblockposition.getY() + d2); + + if (d1 + d2 <= d3) { +@@ -235,7 +235,7 @@ public abstract class EntityMinecartAbstract extends Entity { + protected float getBlockSpeedFactor() { + IBlockData iblockdata = this.world.getType(this.getChunkCoordinates()); + +- return iblockdata.a((Tag) TagsBlock.RAILS) ? 1.0F : super.getBlockSpeedFactor(); ++ return iblockdata.a(TagsBlock.RAILS) ? 1.0F : super.getBlockSpeedFactor(); + } + + public void a(DamageSource damagesource) { +@@ -258,7 +258,7 @@ public abstract class EntityMinecartAbstract extends Entity { + } + + private static Pair a(BlockPropertyTrackPosition blockpropertytrackposition) { +- return (Pair) EntityMinecartAbstract.ap.get(blockpropertytrackposition); ++ return EntityMinecartAbstract.ap.get(blockpropertytrackposition); + } + + @Override +@@ -321,7 +321,7 @@ public abstract class EntityMinecartAbstract extends Entity { + int j = MathHelper.floor(this.locY()); + int k = MathHelper.floor(this.locZ()); + +- if (this.world.getType(new BlockPosition(i, j - 1, k)).a((Tag) TagsBlock.RAILS)) { ++ if (this.world.getType(new BlockPosition(i, j - 1, k)).a(TagsBlock.RAILS)) { + --j; + } + +@@ -331,7 +331,7 @@ public abstract class EntityMinecartAbstract extends Entity { + if (BlockMinecartTrackAbstract.g(iblockdata)) { + this.b(blockposition, iblockdata); + if (iblockdata.a(Blocks.ACTIVATOR_RAIL)) { +- this.a(i, j, k, (Boolean) iblockdata.get(BlockPoweredRail.POWERED)); ++ this.a(i, j, k, iblockdata.get(BlockPoweredRail.POWERED)); + } + } else { + this.h(); +@@ -349,7 +349,7 @@ public abstract class EntityMinecartAbstract extends Entity { + } + } + +- double d6 = (double) MathHelper.g(this.yaw - this.lastYaw); ++ double d6 = MathHelper.g(this.yaw - this.lastYaw); + + if (d6 < -170.0D || d6 >= 170.0D) { + this.yaw += 180.0F; +@@ -374,7 +374,7 @@ public abstract class EntityMinecartAbstract extends Entity { + + if (!list.isEmpty()) { + for (int l = 0; l < list.size(); ++l) { +- Entity entity = (Entity) list.get(l); ++ Entity entity = list.get(l); + + if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) { + // CraftBukkit start +@@ -458,19 +458,19 @@ public abstract class EntityMinecartAbstract extends Entity { + double d2 = this.locZ(); + Vec3D vec3d = this.o(d0, d1, d2); + +- d1 = (double) blockposition.getY(); ++ d1 = blockposition.getY(); + boolean flag = false; + boolean flag1 = false; + BlockMinecartTrackAbstract blockminecarttrackabstract = (BlockMinecartTrackAbstract) iblockdata.getBlock(); + + if (blockminecarttrackabstract == Blocks.POWERED_RAIL) { +- flag = (Boolean) iblockdata.get(BlockPoweredRail.POWERED); ++ flag = iblockdata.get(BlockPoweredRail.POWERED); + flag1 = !flag; + } + + double d3 = 0.0078125D; + Vec3D vec3d1 = this.getMot(); +- BlockPropertyTrackPosition blockpropertytrackposition = (BlockPropertyTrackPosition) iblockdata.get(blockminecarttrackabstract.d()); ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.get(blockminecarttrackabstract.d()); + + switch (blockpropertytrackposition) { + case ASCENDING_EAST: +@@ -492,10 +492,10 @@ public abstract class EntityMinecartAbstract extends Entity { + + vec3d1 = this.getMot(); + Pair pair = a(blockpropertytrackposition); +- BaseBlockPosition baseblockposition = (BaseBlockPosition) pair.getFirst(); +- BaseBlockPosition baseblockposition1 = (BaseBlockPosition) pair.getSecond(); +- double d4 = (double) (baseblockposition1.getX() - baseblockposition.getX()); +- double d5 = (double) (baseblockposition1.getZ() - baseblockposition.getZ()); ++ BaseBlockPosition baseblockposition = pair.getFirst(); ++ BaseBlockPosition baseblockposition1 = pair.getSecond(); ++ double d4 = baseblockposition1.getX() - baseblockposition.getX(); ++ double d5 = baseblockposition1.getZ() - baseblockposition.getZ(); + double d6 = Math.sqrt(d4 * d4 + d5 * d5); + double d7 = vec3d1.x * d4 + vec3d1.z * d5; + +@@ -508,7 +508,7 @@ public abstract class EntityMinecartAbstract extends Entity { + + vec3d1 = new Vec3D(d8 * d4 / d6, vec3d1.y, d8 * d5 / d6); + this.setMot(vec3d1); +- Entity entity = this.getPassengers().isEmpty() ? null : (Entity) this.getPassengers().get(0); ++ Entity entity = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0); + + if (entity instanceof EntityHuman) { + Vec3D vec3d2 = entity.getMot(); +@@ -644,17 +644,17 @@ public abstract class EntityMinecartAbstract extends Entity { + int j = MathHelper.floor(d1); + int k = MathHelper.floor(d2); + +- if (this.world.getType(new BlockPosition(i, j - 1, k)).a((Tag) TagsBlock.RAILS)) { ++ if (this.world.getType(new BlockPosition(i, j - 1, k)).a(TagsBlock.RAILS)) { + --j; + } + + IBlockData iblockdata = this.world.getType(new BlockPosition(i, j, k)); + + if (BlockMinecartTrackAbstract.g(iblockdata)) { +- BlockPropertyTrackPosition blockpropertytrackposition = (BlockPropertyTrackPosition) iblockdata.get(((BlockMinecartTrackAbstract) iblockdata.getBlock()).d()); ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.get(((BlockMinecartTrackAbstract) iblockdata.getBlock()).d()); + Pair pair = a(blockpropertytrackposition); +- BaseBlockPosition baseblockposition = (BaseBlockPosition) pair.getFirst(); +- BaseBlockPosition baseblockposition1 = (BaseBlockPosition) pair.getSecond(); ++ BaseBlockPosition baseblockposition = pair.getFirst(); ++ BaseBlockPosition baseblockposition1 = pair.getSecond(); + double d3 = (double) i + 0.5D + (double) baseblockposition.getX() * 0.5D; + double d4 = (double) j + 0.0625D + (double) baseblockposition.getY() * 0.5D; + double d5 = (double) k + 0.5D + (double) baseblockposition.getZ() * 0.5D; +@@ -729,7 +729,7 @@ public abstract class EntityMinecartAbstract extends Entity { + double d2 = d0 * d0 + d1 * d1; + + if (d2 >= 9.999999747378752E-5D) { +- d2 = (double) MathHelper.sqrt(d2); ++ d2 = MathHelper.sqrt(d2); + d0 /= d2; + d1 /= d2; + double d3 = 1.0D / d2; +@@ -742,15 +742,15 @@ public abstract class EntityMinecartAbstract extends Entity { + d1 *= d3; + d0 *= 0.10000000149011612D; + d1 *= 0.10000000149011612D; +- d0 *= (double) (1.0F - this.I); +- d1 *= (double) (1.0F - this.I); ++ d0 *= 1.0F - this.I; ++ d1 *= 1.0F - this.I; + d0 *= 0.5D; + d1 *= 0.5D; + if (entity instanceof EntityMinecartAbstract) { + double d4 = entity.locX() - this.locX(); + double d5 = entity.locZ() - this.locZ(); + Vec3D vec3d = (new Vec3D(d4, 0.0D, d5)).d(); +- Vec3D vec3d1 = (new Vec3D((double) MathHelper.cos(this.yaw * 0.017453292F), 0.0D, (double) MathHelper.sin(this.yaw * 0.017453292F))).d(); ++ Vec3D vec3d1 = (new Vec3D(MathHelper.cos(this.yaw * 0.017453292F), 0.0D, MathHelper.sin(this.yaw * 0.017453292F))).d(); + double d6 = Math.abs(vec3d.b(vec3d1)); + + if (d6 < 0.800000011920929D) { +@@ -793,7 +793,7 @@ public abstract class EntityMinecartAbstract extends Entity { + } + + public float getDamage() { +- return (Float) this.datawatcher.get(EntityMinecartAbstract.d); ++ return this.datawatcher.get(EntityMinecartAbstract.d); + } + + public void c(int i) { +@@ -801,7 +801,7 @@ public abstract class EntityMinecartAbstract extends Entity { + } + + public int getType() { +- return (Integer) this.datawatcher.get(EntityMinecartAbstract.b); ++ return this.datawatcher.get(EntityMinecartAbstract.b); + } + + public void d(int i) { +@@ -809,13 +809,13 @@ public abstract class EntityMinecartAbstract extends Entity { + } + + public int n() { +- return (Integer) this.datawatcher.get(EntityMinecartAbstract.c); ++ return this.datawatcher.get(EntityMinecartAbstract.c); + } + + public abstract EntityMinecartAbstract.EnumMinecartType getMinecartType(); + + public IBlockData getDisplayBlock() { +- return !this.t() ? this.q() : Block.getByCombinedId((Integer) this.getDataWatcher().get(EntityMinecartAbstract.e)); ++ return !this.t() ? this.q() : Block.getByCombinedId(this.getDataWatcher().get(EntityMinecartAbstract.e)); + } + + public IBlockData q() { +@@ -823,7 +823,7 @@ public abstract class EntityMinecartAbstract extends Entity { + } + + public int getDisplayBlockOffset() { +- return !this.t() ? this.s() : (Integer) this.getDataWatcher().get(EntityMinecartAbstract.f); ++ return !this.t() ? this.s() : this.getDataWatcher().get(EntityMinecartAbstract.f); + } + + public int s() { +@@ -841,7 +841,7 @@ public abstract class EntityMinecartAbstract extends Entity { + } + + public boolean t() { +- return (Boolean) this.getDataWatcher().get(EntityMinecartAbstract.g); ++ return this.getDataWatcher().get(EntityMinecartAbstract.g); + } + + public void a(boolean flag) { +diff --git a/src/main/java/net/minecraft/server/EntityMinecartCommandBlock.java b/src/main/java/net/minecraft/server/EntityMinecartCommandBlock.java +index feaa108f97463a6e1315cabbc80f427de4b7d0a1..e076d9af22227d02ca02904fedcdaca3c0500ed1 100644 +--- a/src/main/java/net/minecraft/server/EntityMinecartCommandBlock.java ++++ b/src/main/java/net/minecraft/server/EntityMinecartCommandBlock.java +@@ -69,12 +69,12 @@ public class EntityMinecartCommandBlock extends EntityMinecartAbstract { + super.a(datawatcherobject); + if (EntityMinecartCommandBlock.c.equals(datawatcherobject)) { + try { +- this.d.b((IChatBaseComponent) this.getDataWatcher().get(EntityMinecartCommandBlock.c)); ++ this.d.b(this.getDataWatcher().get(EntityMinecartCommandBlock.c)); + } catch (Throwable throwable) { + ; + } + } else if (EntityMinecartCommandBlock.COMMAND.equals(datawatcherobject)) { +- this.d.setCommand((String) this.getDataWatcher().get(EntityMinecartCommandBlock.COMMAND)); ++ this.d.setCommand(this.getDataWatcher().get(EntityMinecartCommandBlock.COMMAND)); + } + + } +@@ -107,7 +107,7 @@ public class EntityMinecartCommandBlock extends EntityMinecartAbstract { + // CraftBukkit start + @Override + public org.bukkit.command.CommandSender getBukkitSender(CommandListenerWrapper wrapper) { +- return (org.bukkit.craftbukkit.entity.CraftMinecartCommand) EntityMinecartCommandBlock.this.getBukkitEntity(); ++ return EntityMinecartCommandBlock.this.getBukkitEntity(); + } + // CraftBukkit end + } +diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java +index ff7763a62a57a1f73d385ca161efd5a26c6d8711..81b2c00af3c0c62f13f15ef250a087d045997e62 100644 +--- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java ++++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java +@@ -101,7 +101,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp + @Override + public ItemStack getItem(int i) { + this.d((EntityHuman) null); +- return (ItemStack) this.items.get(i); ++ return this.items.get(i); + } + + @Override +@@ -113,7 +113,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp + @Override + public ItemStack splitWithoutUpdate(int i) { + this.d((EntityHuman) null); +- ItemStack itemstack = (ItemStack) this.items.get(i); ++ ItemStack itemstack = this.items.get(i); + + if (itemstack.isEmpty()) { + return ItemStack.b; +@@ -165,7 +165,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp + + @Override + public boolean a(EntityHuman entityhuman) { +- return this.dead ? false : entityhuman.h((Entity) this) <= 64.0D; ++ return this.dead ? false : entityhuman.h(this) <= 64.0D; + } + + @Nullable +@@ -224,12 +224,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp + float f = 0.98F; + + if (this.lootTable == null) { +- int i = 15 - Container.b((IInventory) this); ++ int i = 15 - Container.b(this); + + f += (float) i * 0.001F; + } + +- this.setMot(this.getMot().d((double) f, 0.0D, (double) f)); ++ this.setMot(this.getMot().d(f, 0.0D, f)); + } + + public void d(@Nullable EntityHuman entityhuman) { +diff --git a/src/main/java/net/minecraft/server/EntityMinecartHopper.java b/src/main/java/net/minecraft/server/EntityMinecartHopper.java +index be10c4c8fd89de73e50af5cca51948d99f133e29..721b562372f33e09139e43db1730b4c3d3a0d825 100644 +--- a/src/main/java/net/minecraft/server/EntityMinecartHopper.java ++++ b/src/main/java/net/minecraft/server/EntityMinecartHopper.java +@@ -107,7 +107,7 @@ public class EntityMinecartHopper extends EntityMinecartContainer implements IHo + List list = this.world.a(EntityItem.class, this.getBoundingBox().grow(0.25D, 0.0D, 0.25D), IEntitySelector.a); + + if (!list.isEmpty()) { +- TileEntityHopper.a((IInventory) this, (EntityItem) list.get(0)); ++ TileEntityHopper.a(this, list.get(0)); + } + + return false; +@@ -118,7 +118,7 @@ public class EntityMinecartHopper extends EntityMinecartContainer implements IHo + public void a(DamageSource damagesource) { + super.a(damagesource); + if (this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { +- this.a((IMaterial) Blocks.HOPPER); ++ this.a(Blocks.HOPPER); + } + + } +diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java +index ebdd990829edb8e423f482fa4352fe2d468efcba..505d9cb2014424c8c03881c460d1aeb211816a3a 100644 +--- a/src/main/java/net/minecraft/server/EntityMonster.java ++++ b/src/main/java/net/minecraft/server/EntityMonster.java +@@ -112,7 +112,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { + public ItemStack f(ItemStack itemstack) { + if (itemstack.getItem() instanceof ItemProjectileWeapon) { + Predicate predicate = ((ItemProjectileWeapon) itemstack.getItem()).e(); +- ItemStack itemstack1 = ItemProjectileWeapon.a((EntityLiving) this, predicate); ++ ItemStack itemstack1 = ItemProjectileWeapon.a(this, predicate); + + return itemstack1.isEmpty() ? new ItemStack(Items.ARROW) : itemstack1; + } else { +diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java +index 6b66c54d6f45fb9034e13576e383bf3a0009e99a..0e72a5b403ccc3ea957491807c37a7991a31856c 100644 +--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java ++++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java +@@ -92,7 +92,7 @@ public class EntityMushroomCow extends EntityCow implements IShearable { + } + + return EnumInteractionResult.a(this.world.isClientSide); +- } else if (this.getVariant() == EntityMushroomCow.Type.BROWN && itemstack.getItem().a((Tag) TagsItem.SMALL_FLOWERS)) { ++ } else if (this.getVariant() == EntityMushroomCow.Type.BROWN && itemstack.getItem().a(TagsItem.SMALL_FLOWERS)) { + if (this.bw != null) { + for (int i = 0; i < 2; ++i) { + this.world.addParticle(Particles.SMOKE, this.locX() + this.random.nextDouble() / 2.0D, this.e(0.5D), this.locZ() + this.random.nextDouble() / 2.0D, 0.0D, this.random.nextDouble() / 5.0D, 0.0D); +@@ -104,7 +104,7 @@ public class EntityMushroomCow extends EntityCow implements IShearable { + return EnumInteractionResult.PASS; + } + +- Pair pair = (Pair) optional.get(); ++ Pair pair = optional.get(); + + if (!entityhuman.abilities.canInstantlyBuild) { + itemstack.subtract(1); +@@ -114,8 +114,8 @@ public class EntityMushroomCow extends EntityCow implements IShearable { + this.world.addParticle(Particles.EFFECT, this.locX() + this.random.nextDouble() / 2.0D, this.e(0.5D), this.locZ() + this.random.nextDouble() / 2.0D, 0.0D, this.random.nextDouble() / 5.0D, 0.0D); + } + +- this.bw = (MobEffectList) pair.getLeft(); +- this.bx = (Integer) pair.getRight(); ++ this.bw = pair.getLeft(); ++ this.bx = pair.getRight(); + this.playSound(SoundEffects.ENTITY_MOOSHROOM_EAT, 2.0F, 1.0F); + } + +@@ -127,11 +127,11 @@ public class EntityMushroomCow extends EntityCow implements IShearable { + + @Override + public void shear(SoundCategory soundcategory) { +- this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_MOOSHROOM_SHEAR, soundcategory, 1.0F, 1.0F); ++ this.world.playSound(null, this, SoundEffects.ENTITY_MOOSHROOM_SHEAR, soundcategory, 1.0F, 1.0F); + if (!this.world.s_()) { + ((WorldServer) this.world).a(Particles.EXPLOSION, this.locX(), this.e(0.5D), this.locZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D); + // this.die(); // CraftBukkit - moved down +- EntityCow entitycow = (EntityCow) EntityTypes.COW.a(this.world); ++ EntityCow entitycow = EntityTypes.COW.a(this.world); + + entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch); + entitycow.setHealth(this.getHealth()); +@@ -214,12 +214,12 @@ public class EntityMushroomCow extends EntityCow implements IShearable { + } + + public EntityMushroomCow.Type getVariant() { +- return EntityMushroomCow.Type.b((String) this.datawatcher.get(EntityMushroomCow.bv)); ++ return EntityMushroomCow.Type.b(this.datawatcher.get(EntityMushroomCow.bv)); + } + + @Override + public EntityMushroomCow createChild(EntityAgeable entityageable) { +- EntityMushroomCow entitymushroomcow = (EntityMushroomCow) EntityTypes.MOOSHROOM.a(this.world); ++ EntityMushroomCow entitymushroomcow = EntityTypes.MOOSHROOM.a(this.world); + + entitymushroomcow.setVariant(this.a((EntityMushroomCow) entityageable)); + return entitymushroomcow; +diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java +index ea4da16de36a1680bcc8eae06c59899d607976a1..f140e679ae33b77e9f46adb78a0f08375f0bdd2e 100644 +--- a/src/main/java/net/minecraft/server/EntityOcelot.java ++++ b/src/main/java/net/minecraft/server/EntityOcelot.java +@@ -16,7 +16,7 @@ public class EntityOcelot extends EntityAnimal { + } + + private boolean isTrusting() { +- return (Boolean) this.datawatcher.get(EntityOcelot.bw); ++ return this.datawatcher.get(EntityOcelot.bw); + } + + private void setTrusting(boolean flag) { +@@ -173,7 +173,7 @@ public class EntityOcelot extends EntityAnimal { + this.bx = new EntityOcelot.a<>(this, EntityHuman.class, 16.0F, 0.8D, 1.33D); + } + +- this.goalSelector.a((PathfinderGoal) this.bx); ++ this.goalSelector.a(this.bx); + if (!this.isTrusting()) { + this.goalSelector.a(4, this.bx); + } +@@ -182,7 +182,7 @@ public class EntityOcelot extends EntityAnimal { + + @Override + public EntityOcelot createChild(EntityAgeable entityageable) { +- return (EntityOcelot) EntityTypes.OCELOT.a(this.world); ++ return EntityTypes.OCELOT.a(this.world); + } + + @Override +@@ -205,7 +205,7 @@ public class EntityOcelot extends EntityAnimal { + + IBlockData iblockdata = iworldreader.getType(blockposition.down()); + +- if (iblockdata.a(Blocks.GRASS_BLOCK) || iblockdata.a((Tag) TagsBlock.LEAVES)) { ++ if (iblockdata.a(Blocks.GRASS_BLOCK) || iblockdata.a(TagsBlock.LEAVES)) { + return true; + } + } +@@ -221,7 +221,7 @@ public class EntityOcelot extends EntityAnimal { + ((EntityAgeable.a) groupdataentity).a(1.0F); + } + +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + static class b extends PathfinderGoalTempt { +diff --git a/src/main/java/net/minecraft/server/EntityPainting.java b/src/main/java/net/minecraft/server/EntityPainting.java +index 53dd219b0ee41090ac7ab417301d7098783e5fee..6c6cca662d4ee37055147f6aa933a048223d94ca 100644 +--- a/src/main/java/net/minecraft/server/EntityPainting.java ++++ b/src/main/java/net/minecraft/server/EntityPainting.java +@@ -14,7 +14,7 @@ public class EntityPainting extends EntityHanging { + super(entitytypes, world); + // CraftBukkit start - generate a non-null painting + List list = Lists.newArrayList(Paintings.a); +- this.art = (Paintings) list.get(this.random.nextInt(list.size())); ++ this.art = list.get(this.random.nextInt(list.size())); + // CraftBukkit end + } + +@@ -50,7 +50,7 @@ public class EntityPainting extends EntityHanging { + } + } + +- this.art = (Paintings) list.get(this.random.nextInt(list.size())); ++ this.art = list.get(this.random.nextInt(list.size())); + } + + this.setDirection(enumdirection); +@@ -64,7 +64,7 @@ public class EntityPainting extends EntityHanging { + + @Override + public void loadData(NBTTagCompound nbttagcompound) { +- this.art = (Paintings) IRegistry.MOTIVE.get(MinecraftKey.a(nbttagcompound.getString("Motive"))); ++ this.art = IRegistry.MOTIVE.get(MinecraftKey.a(nbttagcompound.getString("Motive"))); + super.loadData(nbttagcompound); + } + +@@ -90,7 +90,7 @@ public class EntityPainting extends EntityHanging { + } + } + +- this.a((IMaterial) Items.PAINTING); ++ this.a(Items.PAINTING); + } + } + +diff --git a/src/main/java/net/minecraft/server/EntityPanda.java b/src/main/java/net/minecraft/server/EntityPanda.java +index 12f7020ec7abbefaa876dc8b0a424603c0605687..ed3c9716307cc28cc106176d452fed73e8c7b925 100644 +--- a/src/main/java/net/minecraft/server/EntityPanda.java ++++ b/src/main/java/net/minecraft/server/EntityPanda.java +@@ -49,7 +49,7 @@ public class EntityPanda extends EntityAnimal { + } + + public int eL() { +- return (Integer) this.datawatcher.get(EntityPanda.bw); ++ return this.datawatcher.get(EntityPanda.bw); + } + + public void t(int i) { +@@ -77,7 +77,7 @@ public class EntityPanda extends EntityAnimal { + } + + public boolean eP() { +- return (Integer) this.datawatcher.get(EntityPanda.by) > 0; ++ return this.datawatcher.get(EntityPanda.by) > 0; + } + + public void v(boolean flag) { +@@ -85,7 +85,7 @@ public class EntityPanda extends EntityAnimal { + } + + private int fl() { +- return (Integer) this.datawatcher.get(EntityPanda.by); ++ return this.datawatcher.get(EntityPanda.by); + } + + private void v(int i) { +@@ -101,7 +101,7 @@ public class EntityPanda extends EntityAnimal { + } + + public int eV() { +- return (Integer) this.datawatcher.get(EntityPanda.bx); ++ return this.datawatcher.get(EntityPanda.bx); + } + + public void u(int i) { +@@ -109,7 +109,7 @@ public class EntityPanda extends EntityAnimal { + } + + public EntityPanda.Gene getMainGene() { +- return EntityPanda.Gene.a((Byte) this.datawatcher.get(EntityPanda.bz)); ++ return EntityPanda.Gene.a(this.datawatcher.get(EntityPanda.bz)); + } + + public void setMainGene(EntityPanda.Gene entitypanda_gene) { +@@ -121,7 +121,7 @@ public class EntityPanda extends EntityAnimal { + } + + public EntityPanda.Gene getHiddenGene() { +- return EntityPanda.Gene.a((Byte) this.datawatcher.get(EntityPanda.bA)); ++ return EntityPanda.Gene.a(this.datawatcher.get(EntityPanda.bA)); + } + + public void setHiddenGene(EntityPanda.Gene entitypanda_gene) { +@@ -152,11 +152,11 @@ public class EntityPanda extends EntityAnimal { + } + + private boolean w(int i) { +- return ((Byte) this.datawatcher.get(EntityPanda.bB) & i) != 0; ++ return (this.datawatcher.get(EntityPanda.bB) & i) != 0; + } + + private void d(int i, boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityPanda.bB); ++ byte b0 = this.datawatcher.get(EntityPanda.bB); + + if (flag) { + this.datawatcher.set(EntityPanda.bB, (byte) (b0 | i)); +@@ -183,7 +183,7 @@ public class EntityPanda extends EntityAnimal { + @Nullable + @Override + public EntityAgeable createChild(EntityAgeable entityageable) { +- EntityPanda entitypanda = (EntityPanda) EntityTypes.PANDA.a(this.world); ++ EntityPanda entitypanda = EntityTypes.PANDA.a(this.world); + + if (entityageable instanceof EntityPanda) { + entitypanda.a(this, (EntityPanda) entityageable); +@@ -277,7 +277,7 @@ public class EntityPanda extends EntityAnimal { + + if (this.eL() > 0) { + if (this.getGoalTarget() != null) { +- this.a((Entity) this.getGoalTarget(), 90.0F, 90.0F); ++ this.a(this.getGoalTarget(), 90.0F, 90.0F); + } + + if (this.eL() == 29 || this.eL() == 14) { +@@ -473,7 +473,7 @@ public class EntityPanda extends EntityAnimal { + ((EntityAgeable.a) groupdataentity).a(0.2F); + } + +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + public void a(EntityPanda entitypanda, @Nullable EntityPanda entitypanda1) { +@@ -623,9 +623,9 @@ public class EntityPanda extends EntityAnimal { + BlockPosition blockposition = this.a(this.a.world, this.a, 5, 4); + + if (blockposition != null) { +- this.c = (double) blockposition.getX(); +- this.d = (double) blockposition.getY(); +- this.e = (double) blockposition.getZ(); ++ this.c = blockposition.getX(); ++ this.d = blockposition.getY(); ++ this.e = blockposition.getZ(); + return true; + } else { + return this.g(); +@@ -658,14 +658,14 @@ public class EntityPanda extends EntityAnimal { + if (!this.a.bD && !this.a.bE) { + return super.b(); + } else { +- this.a.setGoalTarget((EntityLiving) null); ++ this.a.setGoalTarget(null); + return false; + } + } + + @Override + protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) { +- if (entityinsentient instanceof EntityPanda && ((EntityPanda) entityinsentient).isAggressive()) { ++ if (entityinsentient instanceof EntityPanda && entityinsentient.isAggressive()) { + entityinsentient.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit + } + +@@ -741,7 +741,7 @@ public class EntityPanda extends EntityAnimal { + List list = EntityPanda.this.world.a(EntityItem.class, EntityPanda.this.getBoundingBox().grow(8.0D, 8.0D, 8.0D), EntityPanda.PICKUP_PREDICATE); + + if (!list.isEmpty() && EntityPanda.this.getEquipment(EnumItemSlot.MAINHAND).isEmpty()) { +- EntityPanda.this.getNavigation().a((Entity) list.get(0), 1.2000000476837158D); ++ EntityPanda.this.getNavigation().a(list.get(0), 1.2000000476837158D); + } else if (!EntityPanda.this.getEquipment(EnumItemSlot.MAINHAND).isEmpty()) { + EntityPanda.this.fu(); + } +@@ -800,9 +800,9 @@ public class EntityPanda extends EntityAnimal { + this.e.t(32); + this.f = this.e.ticksLived + 600; + if (this.e.doAITick()) { +- EntityHuman entityhuman = this.b.a(EntityPanda.bC, (EntityLiving) this.e); ++ EntityHuman entityhuman = this.b.a(EntityPanda.bC, this.e); + +- this.e.bM.a((EntityLiving) entityhuman); ++ this.e.bM.a(entityhuman); + } + } + +@@ -939,7 +939,7 @@ public class EntityPanda extends EntityAnimal { + if (this.e == EntityHuman.class) { + this.b = this.a.world.a(this.f, this.a, this.a.locX(), this.a.getHeadY(), this.a.locZ()); + } else { +- this.b = this.a.world.b(this.e, this.f, this.a, this.a.locX(), this.a.getHeadY(), this.a.locZ(), this.a.getBoundingBox().grow((double) this.c, 3.0D, (double) this.c)); ++ this.b = this.a.world.b(this.e, this.f, this.a, this.a.locX(), this.a.getHeadY(), this.a.locZ(), this.a.getBoundingBox().grow(this.c, 3.0D, this.c)); + } + } + +@@ -1000,7 +1000,7 @@ public class EntityPanda extends EntityAnimal { + list.add(gene); + } + list.sort(Comparator.comparingInt(Gene::a)); +- h = (Gene[]) list.toArray(new Gene[0]); ++ h = list.toArray(new Gene[0]); + } + + private final int i; +diff --git a/src/main/java/net/minecraft/server/EntityParrot.java b/src/main/java/net/minecraft/server/EntityParrot.java +index 6d313783838103c848b3375ac29ccd8b33a27430..b30944791047791b0a4c75691609a363b9b0c1c8 100644 +--- a/src/main/java/net/minecraft/server/EntityParrot.java ++++ b/src/main/java/net/minecraft/server/EntityParrot.java +@@ -20,8 +20,8 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + } + }; + private static final Item bD = Items.COOKIE; +- private static final Set bE = Sets.newHashSet(new Item[]{Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS}); +- private static final Map, SoundEffect> bF = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error ++ private static final Set bE = Sets.newHashSet(Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS); ++ private static final Map, SoundEffect> bF = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error + hashmap.put(EntityTypes.BLAZE, SoundEffects.ENTITY_PARROT_IMITATE_BLAZE); + hashmap.put(EntityTypes.CAVE_SPIDER, SoundEffects.ENTITY_PARROT_IMITATE_SPIDER); + hashmap.put(EntityTypes.CREEPER, SoundEffects.ENTITY_PARROT_IMITATE_CREEPER); +@@ -80,7 +80,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + ((EntityAgeable.a) groupdataentity).a(false); + } + +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + @Override +@@ -121,7 +121,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + + @Override + public void movementTick() { +- if (this.bI == null || !this.bI.a((IPosition) this.getPositionVector(), 3.46D) || !this.world.getType(this.bI).a(Blocks.JUKEBOX)) { ++ if (this.bI == null || !this.bI.a(this.getPositionVector(), 3.46D) || !this.world.getType(this.bI).a(Blocks.JUKEBOX)) { + this.bH = false; + this.bI = null; + } +@@ -158,12 +158,12 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + List list = world.a(EntityInsentient.class, entity.getBoundingBox().g(20.0D), EntityParrot.bC); + + if (!list.isEmpty()) { +- EntityInsentient entityinsentient = (EntityInsentient) list.get(world.random.nextInt(list.size())); ++ EntityInsentient entityinsentient = list.get(world.random.nextInt(list.size())); + + if (!entityinsentient.isSilent()) { + SoundEffect soundeffect = c(entityinsentient.getEntityType()); + +- world.playSound((EntityHuman) null, entity.locX(), entity.locY(), entity.locZ(), soundeffect, entity.getSoundCategory(), 0.7F, a(world.random)); ++ world.playSound(null, entity.locX(), entity.locY(), entity.locZ(), soundeffect, entity.getSoundCategory(), 0.7F, a(world.random)); + return true; + } + } +@@ -184,7 +184,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + } + + if (!this.isSilent()) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PARROT_EAT, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PARROT_EAT, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); + } + + if (!this.world.isClientSide) { +@@ -208,7 +208,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + } + + return EnumInteractionResult.a(this.world.isClientSide); +- } else if (!this.fb() && this.isTamed() && this.j((EntityLiving) entityhuman)) { ++ } else if (!this.fb() && this.isTamed() && this.j(entityhuman)) { + if (!this.world.isClientSide) { + this.setWillSit(!this.isWillSit()); + } +@@ -227,7 +227,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + public static boolean c(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { + IBlockData iblockdata = generatoraccess.getType(blockposition.down()); + +- return (iblockdata.a((Tag) TagsBlock.LEAVES) || iblockdata.a(Blocks.GRASS_BLOCK) || iblockdata.a((Tag) TagsBlock.LOGS) || iblockdata.a(Blocks.AIR)) && generatoraccess.getLightLevel(blockposition, 0) > 8; ++ return (iblockdata.a(TagsBlock.LEAVES) || iblockdata.a(Blocks.GRASS_BLOCK) || iblockdata.a(TagsBlock.LOGS) || iblockdata.a(Blocks.AIR)) && generatoraccess.getLightLevel(blockposition, 0) > 8; + } + + @Override +@@ -264,14 +264,14 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + if (world.getDifficulty() != EnumDifficulty.PEACEFUL && random.nextInt(1000) == 0) { + List> list = Lists.newArrayList(EntityParrot.bF.keySet()); + +- return c((EntityTypes) list.get(random.nextInt(list.size()))); ++ return c(list.get(random.nextInt(list.size()))); + } else { + return SoundEffects.ENTITY_PARROT_AMBIENT; + } + } + + private static SoundEffect c(EntityTypes entitytypes) { +- return (SoundEffect) EntityParrot.bF.getOrDefault(entitytypes, SoundEffects.ENTITY_PARROT_AMBIENT); ++ return EntityParrot.bF.getOrDefault(entitytypes, SoundEffects.ENTITY_PARROT_AMBIENT); + } + + @Override +@@ -337,7 +337,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + } + + public int getVariant() { +- return MathHelper.clamp((Integer) this.datawatcher.get(EntityParrot.bB), 0, 4); ++ return MathHelper.clamp(this.datawatcher.get(EntityParrot.bB), 0, 4); + } + + public void setVariant(int i) { +diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java +index 1d6fd36a0ea06db7dd74f6d14ac2effe93b9ac74..301f3e826ea5daf097547e29df1d5efb299b4056 100644 +--- a/src/main/java/net/minecraft/server/EntityPhantom.java ++++ b/src/main/java/net/minecraft/server/EntityPhantom.java +@@ -48,11 +48,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { + + private void eK() { + this.updateSize(); +- this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue((double) (6 + this.getSize())); ++ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(6 + this.getSize()); + } + + public int getSize() { +- return (Integer) this.datawatcher.get(EntityPhantom.b); ++ return this.datawatcher.get(EntityPhantom.b); + } + + @Override +@@ -215,7 +215,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + return false; + } else { + this.c = 60; +- List list = EntityPhantom.this.world.a(this.b, (EntityLiving) EntityPhantom.this, EntityPhantom.this.getBoundingBox().grow(16.0D, 64.0D, 16.0D)); ++ List list = EntityPhantom.this.world.a(this.b, EntityPhantom.this, EntityPhantom.this.getBoundingBox().grow(16.0D, 64.0D, 16.0D)); + + if (!list.isEmpty()) { + list.sort(Comparator.comparing(Entity::locY).reversed()); +@@ -224,7 +224,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + while (iterator.hasNext()) { + EntityHuman entityhuman = (EntityHuman) iterator.next(); + +- if (EntityPhantom.this.a((EntityLiving) entityhuman, PathfinderTargetCondition.a)) { ++ if (EntityPhantom.this.a(entityhuman, PathfinderTargetCondition.a)) { + if (!world.paperConfig.phantomOnlyAttackInsomniacs || IEntitySelector.isInsomniac.test(entityhuman)) // Paper + EntityPhantom.this.setGoalTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit - reason + return true; +@@ -311,7 +311,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + return false; + } else if (!entityliving.isAlive()) { + return false; +- } else if (entityliving instanceof EntityHuman && (((EntityHuman) entityliving).isSpectator() || ((EntityHuman) entityliving).isCreative())) { ++ } else if (entityliving instanceof EntityHuman && (entityliving.isSpectator() || ((EntityHuman) entityliving).isCreative())) { + return false; + } else if (!this.a()) { + return false; +@@ -341,7 +341,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + + @Override + public void d() { +- EntityPhantom.this.setGoalTarget((EntityLiving) null); ++ EntityPhantom.this.setGoalTarget(null); + EntityPhantom.this.bv = EntityPhantom.AttackPhase.CIRCLE; + } + +@@ -428,7 +428,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + } + + this.c += this.f * 15.0F * 0.017453292F; +- EntityPhantom.this.c = Vec3D.b((BaseBlockPosition) EntityPhantom.this.d).add((double) (this.d * MathHelper.cos(this.c)), (double) (-4.0F + this.e), (double) (this.d * MathHelper.sin(this.c))); ++ EntityPhantom.this.c = Vec3D.b(EntityPhantom.this.d).add(this.d * MathHelper.cos(this.c), -4.0F + this.e, this.d * MathHelper.sin(this.c)); + } + } + +@@ -484,15 +484,15 @@ public class EntityPhantom extends EntityFlying implements IMonster { + float f = (float) (EntityPhantom.this.c.x - EntityPhantom.this.locX()); + float f1 = (float) (EntityPhantom.this.c.y - EntityPhantom.this.locY()); + float f2 = (float) (EntityPhantom.this.c.z - EntityPhantom.this.locZ()); +- double d0 = (double) MathHelper.c(f * f + f2 * f2); ++ double d0 = MathHelper.c(f * f + f2 * f2); + double d1 = 1.0D - (double) MathHelper.e(f1 * 0.7F) / d0; + + f = (float) ((double) f * d1); + f2 = (float) ((double) f2 * d1); +- d0 = (double) MathHelper.c(f * f + f2 * f2); +- double d2 = (double) MathHelper.c(f * f + f2 * f2 + f1 * f1); ++ d0 = MathHelper.c(f * f + f2 * f2); ++ double d2 = MathHelper.c(f * f + f2 * f2 + f1 * f1); + float f3 = EntityPhantom.this.yaw; +- float f4 = (float) MathHelper.d((double) f2, (double) f); ++ float f4 = (float) MathHelper.d(f2, (double) f); + float f5 = MathHelper.g(EntityPhantom.this.yaw + 90.0F); + float f6 = MathHelper.g(f4 * 57.295776F); + +@@ -504,7 +504,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + this.j = MathHelper.c(this.j, 0.2F, 0.025F); + } + +- float f7 = (float) (-(MathHelper.d((double) (-f1), d0) * 57.2957763671875D)); ++ float f7 = (float) (-(MathHelper.d(-f1, d0) * 57.2957763671875D)); + + EntityPhantom.this.pitch = f7; + float f8 = EntityPhantom.this.yaw + 90.0F; +diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java +index 13b95af73c1f7f09b8d41cb4350792e9300fda1a..d5828e6519b4ca304ff66d6baaebf67ad0c959b2 100644 +--- a/src/main/java/net/minecraft/server/EntityPig.java ++++ b/src/main/java/net/minecraft/server/EntityPig.java +@@ -38,7 +38,7 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { + @Nullable + @Override + public Entity getRidingPassenger() { +- return this.getPassengers().isEmpty() ? null : (Entity) this.getPassengers().get(0); ++ return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0); + } + + @Override +@@ -118,7 +118,7 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { + if (!enuminteractionresult.a()) { + ItemStack itemstack = entityhuman.b(enumhand); + +- return itemstack.getItem() == Items.SADDLE ? itemstack.a(entityhuman, (EntityLiving) this, enumhand) : EnumInteractionResult.PASS; ++ return itemstack.getItem() == Items.SADDLE ? itemstack.a(entityhuman, this, enumhand) : EnumInteractionResult.PASS; + } else { + return enuminteractionresult; + } +@@ -148,7 +148,7 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { + public void saddle(@Nullable SoundCategory soundcategory) { + this.saddleStorage.setSaddle(true); + if (soundcategory != null) { +- this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_PIG_SADDLE, soundcategory, 0.5F, 1.0F); ++ this.world.playSound(null, this, SoundEffects.ENTITY_PIG_SADDLE, soundcategory, 0.5F, 1.0F); + } + + } +@@ -178,7 +178,7 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { + double d0 = this.world.m(blockposition_mutableblockposition); + + if (DismountUtil.a(d0)) { +- Vec3D vec3d = Vec3D.a((BaseBlockPosition) blockposition_mutableblockposition, d0); ++ Vec3D vec3d = Vec3D.a(blockposition_mutableblockposition, d0); + + if (DismountUtil.a(this.world, entityliving, axisalignedbb.c(vec3d))) { + entityliving.setPose(entitypose); +@@ -195,7 +195,7 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { + @Override + public void onLightningStrike(EntityLightning entitylightning) { + if (this.world.getDifficulty() != EnumDifficulty.PEACEFUL) { +- EntityPigZombie entitypigzombie = (EntityPigZombie) EntityTypes.ZOMBIFIED_PIGLIN.a(this.world); ++ EntityPigZombie entitypigzombie = EntityTypes.ZOMBIFIED_PIGLIN.a(this.world); + + entitypigzombie.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD)); + entitypigzombie.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch); +@@ -228,7 +228,7 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { + + @Override + public void f(Vec3D vec3d) { +- this.a((EntityInsentient) this, this.saddleStorage, vec3d); ++ this.a(this, this.saddleStorage, vec3d); + } + + @Override +@@ -248,7 +248,7 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { + + @Override + public EntityPig createChild(EntityAgeable entityageable) { +- return (EntityPig) EntityTypes.PIG.a(this.world); ++ return EntityTypes.PIG.a(this.world); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityPiglin.java b/src/main/java/net/minecraft/server/EntityPiglin.java +index f6e58838b5008fe091cff4eb3bf08f5026dd7880..148c55021f5d323559a7ba9d515ced3c9788a2d0 100644 +--- a/src/main/java/net/minecraft/server/EntityPiglin.java ++++ b/src/main/java/net/minecraft/server/EntityPiglin.java +@@ -21,7 +21,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + private final InventorySubcontainer bB = new InventorySubcontainer(8); + public boolean bC = false; // PAIL private -> public, rename cannotHunt + protected static final ImmutableList>> b = ImmutableList.of(SensorType.c, SensorType.d, SensorType.b, SensorType.g, SensorType.e, SensorType.l); +- protected static final ImmutableList> c = ImmutableList.of(MemoryModuleType.LOOK_TARGET, MemoryModuleType.INTERACTABLE_DOORS, MemoryModuleType.OPENED_DOORS, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLINS, MemoryModuleType.NEAREST_ADULT_PIGLINS, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, new MemoryModuleType[]{MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.PATH, MemoryModuleType.ANGRY_AT, MemoryModuleType.UNIVERSAL_ANGER, MemoryModuleType.AVOID_TARGET, MemoryModuleType.ADMIRING_ITEM, MemoryModuleType.ADMIRING_DISABLED, MemoryModuleType.CELEBRATE_LOCATION, MemoryModuleType.DANCING, MemoryModuleType.HUNTED_RECENTLY, MemoryModuleType.NEAREST_VISIBLE_BABY_HOGLIN, MemoryModuleType.NEAREST_VISIBLE_BABY_PIGLIN, MemoryModuleType.NEAREST_VISIBLE_NEMSIS, MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED, MemoryModuleType.RIDE_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_HUNTABLE_HOGLIN, MemoryModuleType.NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD, MemoryModuleType.NEAREST_PLAYER_HOLDING_WANTED_ITEM, MemoryModuleType.ATE_RECENTLY, MemoryModuleType.NEAREST_REPELLENT}); ++ protected static final ImmutableList> c = ImmutableList.of(MemoryModuleType.LOOK_TARGET, MemoryModuleType.INTERACTABLE_DOORS, MemoryModuleType.OPENED_DOORS, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLINS, MemoryModuleType.NEAREST_ADULT_PIGLINS, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.PATH, MemoryModuleType.ANGRY_AT, MemoryModuleType.UNIVERSAL_ANGER, MemoryModuleType.AVOID_TARGET, MemoryModuleType.ADMIRING_ITEM, MemoryModuleType.ADMIRING_DISABLED, MemoryModuleType.CELEBRATE_LOCATION, MemoryModuleType.DANCING, MemoryModuleType.HUNTED_RECENTLY, MemoryModuleType.NEAREST_VISIBLE_BABY_HOGLIN, MemoryModuleType.NEAREST_VISIBLE_BABY_PIGLIN, MemoryModuleType.NEAREST_VISIBLE_NEMSIS, MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED, MemoryModuleType.RIDE_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_HUNTABLE_HOGLIN, MemoryModuleType.NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD, MemoryModuleType.NEAREST_PLAYER_HOLDING_WANTED_ITEM, MemoryModuleType.ATE_RECENTLY, MemoryModuleType.NEAREST_REPELLENT); + + public EntityPiglin(EntityTypes entitytypes, World world) { + super(entitytypes, world); +@@ -150,7 +150,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + + @Override + protected BehaviorController.b cJ() { +- return BehaviorController.a((Collection) EntityPiglin.c, (Collection) EntityPiglin.b); ++ return BehaviorController.a(EntityPiglin.c, (Collection) EntityPiglin.b); + } + + @Override +@@ -209,7 +209,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + + @Override + public boolean isBaby() { +- return (Boolean) this.getDataWatcher().get(EntityPiglin.d); ++ return this.getDataWatcher().get(EntityPiglin.d); + } + + public boolean eM() { +@@ -221,7 +221,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + } + + public boolean eT() { // PAIL private -> public, rename isImmuneToZombification +- return (Boolean) this.getDataWatcher().get(EntityPiglin.bv); ++ return this.getDataWatcher().get(EntityPiglin.bv); + } + + private void v(boolean flag) { +@@ -265,7 +265,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + for (ItemStack itemStack : this.bB.f()) { + a(itemStack); + } +- EntityPigZombie entitypigzombie = (EntityPigZombie) this.b(EntityTypes.ZOMBIFIED_PIGLIN); ++ EntityPigZombie entitypigzombie = this.b(EntityTypes.ZOMBIFIED_PIGLIN); + + entitypigzombie.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0)); + } +@@ -273,7 +273,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + @Nullable + @Override + public EntityLiving getGoalTarget() { +- return (EntityLiving) this.bn.getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error ++ return this.bn.getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error + } + + private ItemStack eU() { +@@ -281,7 +281,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + } + + private boolean eV() { +- return (Boolean) this.datawatcher.get(EntityPiglin.bw); ++ return this.datawatcher.get(EntityPiglin.bw); + } + + @Override +@@ -299,7 +299,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + } + + public boolean eQ() { +- return (Boolean) this.datawatcher.get(EntityPiglin.bx); ++ return this.datawatcher.get(EntityPiglin.bx); + } + + public void u(boolean flag) { +@@ -396,12 +396,12 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + private Entity b(Entity entity, int i) { + List list = entity.getPassengers(); + +- return i != 1 && !list.isEmpty() ? this.b((Entity) list.get(0), i - 1) : entity; ++ return i != 1 && !list.isEmpty() ? this.b(list.get(0), i - 1) : entity; + } + + @Override + protected SoundEffect getSoundAmbient() { +- return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse(null); // CraftBukkit - decompile error ++ return this.world.isClientSide ? null : PiglinAI.d(this).orElse(null); // CraftBukkit - decompile error + } + + @Override +@@ -426,7 +426,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow { + @Override + protected void M() { + super.M(); +- PacketDebug.a((EntityLiving) this); ++ PacketDebug.a(this); + } + + public static enum ArmPose { +diff --git a/src/main/java/net/minecraft/server/EntityPillager.java b/src/main/java/net/minecraft/server/EntityPillager.java +index f0cc1d75d91064c5bf8c0655067bd34ccf6d4dba..77891aee3c58a50438e739ef496a265376b6a070 100644 +--- a/src/main/java/net/minecraft/server/EntityPillager.java ++++ b/src/main/java/net/minecraft/server/EntityPillager.java +@@ -114,7 +114,7 @@ public class EntityPillager extends EntityIllagerAbstract implements ICrossbow { + Map map = Maps.newHashMap(); + + map.put(Enchantments.PIERCING, 1); +- EnchantmentManager.a((Map) map, itemstack); ++ EnchantmentManager.a(map, itemstack); + } + + this.setSlot(EnumItemSlot.MAINHAND, itemstack); +@@ -209,7 +209,7 @@ public class EntityPillager extends EntityIllagerAbstract implements ICrossbow { + } + + map.put(Enchantments.MULTISHOT, 1); +- EnchantmentManager.a((Map) map, itemstack); ++ EnchantmentManager.a(map, itemstack); + this.setSlot(EnumItemSlot.MAINHAND, itemstack); + } + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index 69db19af3246ec61b710ab273c5a9fe5b172ed93..f143624c072ddd300591bdadd3173c97e16973fe 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -153,7 +153,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + + if (worldserver.getDimensionManager().hasSkyLight() && worldserver.worldDataServer.getGameType() != EnumGamemode.ADVENTURE) { + int i = Math.max(0, this.server.a(worldserver)); +- int j = MathHelper.floor(worldserver.getWorldBorder().b((double) blockposition.getX(), (double) blockposition.getZ())); ++ int j = MathHelper.floor(worldserver.getWorldBorder().b(blockposition.getX(), blockposition.getZ())); + + if (j < i) { + i = j; +@@ -163,7 +163,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + i = 1; + } + +- long k = (long) (i * 2 + 1); ++ long k = i * 2 + 1; + long l = k * k; + int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l; + int j1 = this.u(i1); +@@ -191,7 +191,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + + if (worldserver.getDimensionManager().hasSkyLight() && worldserver.worldDataServer.getGameType() != EnumGamemode.ADVENTURE) { // CraftBukkit + int i = Math.max(0, this.server.a(worldserver)); +- int j = MathHelper.floor(worldserver.getWorldBorder().b((double) blockposition.getX(), (double) blockposition.getZ())); ++ int j = MathHelper.floor(worldserver.getWorldBorder().b(blockposition.getX(), blockposition.getZ())); + + if (j < i) { + i = j; +@@ -201,7 +201,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + i = 1; + } + +- long k = (long) (i * 2 + 1); ++ long k = i * 2 + 1; + long l = k * k; + int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l; + int j1 = this.u(i1); +@@ -358,7 +358,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + if (world == null || position == null) { + world = ((CraftWorld) Bukkit.getServer().getWorlds().get(0)).getHandle(); +- position = Vec3D.a(((WorldServer) world).getSpawn()); ++ position = Vec3D.a(world.getSpawn()); + } + this.world = world; + this.setPositionRaw(position.getX(), position.getY(), position.getZ()); // Paper - don't register to chunks yet +@@ -497,7 +497,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + ItemStack itemstack = this.inventory.getItem(i); + + if (itemstack.getItem().ae_()) { +- Packet packet = ((ItemWorldMapBase) itemstack.getItem()).a(itemstack, this.world, (EntityHuman) this); ++ Packet packet = ((ItemWorldMapBase) itemstack.getItem()).a(itemstack, this.world, this); + + if (packet != null) { + this.playerConnection.sendPacket(packet); +@@ -563,7 +563,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + + if (this.oldLevel != this.expLevel) { +- CraftEventFactory.callPlayerLevelChangeEvent(this.world.getServer().getPlayer((EntityPlayer) this), this.oldLevel, this.expLevel); ++ CraftEventFactory.callPlayerLevelChangeEvent(this.world.getServer().getPlayer(this), this.oldLevel, this.expLevel); + this.oldLevel = this.expLevel; + } + // CraftBukkit end +@@ -676,12 +676,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + ichatbasecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromStringOrNull(deathMessage); + } + +- this.playerConnection.a((Packet) (new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, ichatbasecomponent)), (future) -> { ++ this.playerConnection.a(new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, ichatbasecomponent), (future) -> { + if (!future.isSuccess()) { + boolean flag1 = true; + String s = ichatbasecomponent.a(256); +- ChatMessage chatmessage = new ChatMessage("death.attack.message_too_long", new Object[]{(new ChatComponentText(s)).a(EnumChatFormat.YELLOW)}); +- IChatMutableComponent ichatmutablecomponent = (new ChatMessage("death.attack.even_more_magic", new Object[]{this.getScoreboardDisplayName()})).format((chatmodifier) -> { ++ ChatMessage chatmessage = new ChatMessage("death.attack.message_too_long", (new ChatComponentText(s)).a(EnumChatFormat.YELLOW)); ++ IChatMutableComponent ichatmutablecomponent = (new ChatMessage("death.attack.even_more_magic", this.getScoreboardDisplayName())).format((chatmodifier) -> { + return chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatmessage)); + }); + +@@ -693,7 +693,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + + if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) { + if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) { +- this.server.getPlayerList().a((EntityHuman) this, ichatbasecomponent); ++ this.server.getPlayerList().a(this, ichatbasecomponent); + } else if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OWN_TEAM) { + this.server.getPlayerList().b(this, ichatbasecomponent); + } +@@ -896,9 +896,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + if (worldserver.getTypeKey() == DimensionManager.THE_END) { // CraftBukkit + BlockPosition blockposition = WorldServer.a; + +- d0 = (double) blockposition.getX(); +- d1 = (double) blockposition.getY(); +- d2 = (double) blockposition.getZ(); ++ d0 = blockposition.getX(); ++ d1 = blockposition.getY(); ++ d2 = blockposition.getZ(); + f1 = 90.0F; + f = 0.0F; + } else { +@@ -1101,9 +1101,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + if (!this.isCreative()) { + double d0 = 8.0D; + double d1 = 5.0D; +- Vec3D vec3d = Vec3D.c((BaseBlockPosition) blockposition); ++ Vec3D vec3d = Vec3D.c(blockposition); + List list = this.world.a(EntityMonster.class, new AxisAlignedBB(vec3d.getX() - 8.0D, vec3d.getY() - 5.0D, vec3d.getZ() - 8.0D, vec3d.getX() + 8.0D, vec3d.getY() + 5.0D, vec3d.getZ() + 8.0D), (entitymonster) -> { +- return entitymonster.f((EntityHuman) this); ++ return entitymonster.f(this); + }); + + if (!list.isEmpty()) { +@@ -1121,7 +1121,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + + @Override + public Either sleep(BlockPosition blockposition, boolean force) { +- EnumDirection enumdirection = (EnumDirection) this.world.getType(blockposition).get(BlockFacingHorizontal.FACING); ++ EnumDirection enumdirection = this.world.getType(blockposition).get(BlockFacingHorizontal.FACING); + Either bedResult = this.getBedResult(blockposition, enumdirection); + + if (bedResult.left().orElse(null) == EntityHuman.EnumBedResult.OTHER_PROBLEM) { +@@ -1164,7 +1164,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + + private boolean g(BlockPosition blockposition) { +- Vec3D vec3d = Vec3D.c((BaseBlockPosition) blockposition); ++ Vec3D vec3d = Vec3D.c(blockposition); + + return Math.abs(this.locX() - vec3d.getX()) <= 3.0D && Math.abs(this.locY() - vec3d.getY()) <= 2.0D && Math.abs(this.locZ() - vec3d.getZ()) <= 3.0D; + } +@@ -1288,7 +1288,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + // CraftBukkit end + if (container == null) { + if (this.isSpectator()) { +- this.a((IChatBaseComponent) (new ChatMessage("container.spectatorCantOpen")).a(EnumChatFormat.RED), true); ++ this.a((new ChatMessage("container.spectatorCantOpen")).a(EnumChatFormat.RED), true); + } + + return OptionalInt.empty(); +@@ -1336,7 +1336,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + Item item = itemstack.getItem(); + + if (item == Items.WRITTEN_BOOK) { +- if (ItemWrittenBook.a(itemstack, this.getCommandListener(), (EntityHuman) this)) { ++ if (ItemWrittenBook.a(itemstack, this.getCommandListener(), this)) { + this.activeContainer.c(); + } + +@@ -1403,7 +1403,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + + public void o() { +- this.activeContainer.b((EntityHuman) this); ++ this.activeContainer.b(this); + this.activeContainer = this.defaultContainer; + } + +@@ -1550,7 +1550,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + + this.bN = entityplayer.bN; + this.enderChest = entityplayer.enderChest; +- this.getDataWatcher().set(EntityPlayer.bp, entityplayer.getDataWatcher().get(EntityPlayer.bp)); ++ this.getDataWatcher().set(EntityHuman.bp, entityplayer.getDataWatcher().get(EntityHuman.bp)); + this.lastSentExp = -1; + this.lastHealthSent = -1.0F; + this.lastFoodSent = -1; +@@ -1677,7 +1677,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + + public void a(IChatBaseComponent ichatbasecomponent, ChatMessageType chatmessagetype, UUID uuid) { +- this.playerConnection.a((Packet) (new PacketPlayOutChat(ichatbasecomponent, chatmessagetype, uuid)), (future) -> { ++ this.playerConnection.a(new PacketPlayOutChat(ichatbasecomponent, chatmessagetype, uuid), (future) -> { + if (!future.isSuccess() && (chatmessagetype == ChatMessageType.GAME_INFO || chatmessagetype == ChatMessageType.SYSTEM)) { + boolean flag = true; + String s = ichatbasecomponent.a(256); +@@ -1722,8 +1722,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + // Paper end + this.cf = packetplayinsettings.d(); + this.cg = packetplayinsettings.e(); +- this.getDataWatcher().set(EntityPlayer.bp, (byte) packetplayinsettings.f()); +- this.getDataWatcher().set(EntityPlayer.bq, (byte) (packetplayinsettings.getMainHand() == EnumMainHand.LEFT ? 0 : 1)); ++ this.getDataWatcher().set(EntityHuman.bp, (byte) packetplayinsettings.f()); ++ this.getDataWatcher().set(EntityHuman.bq, (byte) (packetplayinsettings.getMainHand() == EnumMainHand.LEFT ? 0 : 1)); + } + + public EnumChatVisibility getChatFlags() { +@@ -1753,15 +1753,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + + public void c(Entity entity) { + if (entity instanceof EntityHuman) { +- this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[]{entity.getId()})); ++ this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(entity.getId())); + } else { +- this.removeQueue.add((Integer) entity.getId()); // CraftBukkit - decompile error ++ this.removeQueue.add(entity.getId()); // CraftBukkit - decompile error + } + + } + + public void d(Entity entity) { +- this.removeQueue.remove((Integer) entity.getId()); // CraftBukkit - decompile error ++ this.removeQueue.remove(entity.getId()); // CraftBukkit - decompile error + } + + @Override +@@ -1776,7 +1776,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + + public Entity getSpecatorTarget() { +- return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity); ++ return this.spectatedEntity == null ? this : this.spectatedEntity; + } + + public void setSpectatorTarget(Entity newSpectatorTarget) { +diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java +index cc5a362346427070980b4cbf8ab18313d82aa669..0467874225eb256b31c3db491ca81aa0a6075358 100644 +--- a/src/main/java/net/minecraft/server/EntityPotion.java ++++ b/src/main/java/net/minecraft/server/EntityPotion.java +@@ -223,7 +223,7 @@ public class EntityPotion extends EntityProjectileThrowable { + private void a(BlockPosition blockposition, EnumDirection enumdirection) { + IBlockData iblockdata = this.world.getType(blockposition); + +- if (iblockdata.a((Tag) TagsBlock.FIRE)) { ++ if (iblockdata.a(TagsBlock.FIRE)) { + // CraftBukkit start + if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { + this.world.a(blockposition, false); +@@ -232,9 +232,9 @@ public class EntityPotion extends EntityProjectileThrowable { + } else if (BlockCampfire.g(iblockdata)) { + // CraftBukkit start + if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.set(BlockCampfire.b, false)).isCancelled()) { // PAIL rename LIT +- this.world.a((EntityHuman) null, 1009, blockposition, 0); +- BlockCampfire.c((GeneratorAccess) this.world, blockposition, iblockdata); +- this.world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.b, false)); ++ this.world.a(null, 1009, blockposition, 0); ++ BlockCampfire.c(this.world, blockposition, iblockdata); ++ this.world.setTypeUpdate(blockposition, iblockdata.set(BlockCampfire.b, false)); + } + // CraftBukkit end + } +diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java +index 795685f1eed489b8323c7a8528b2bbd4737b9cb7..c18a9fe7fec790ed1f908e008117e04ddf6ac245 100644 +--- a/src/main/java/net/minecraft/server/EntityProjectile.java ++++ b/src/main/java/net/minecraft/server/EntityProjectile.java +@@ -33,7 +33,7 @@ public abstract class EntityProjectile extends IProjectile { + TileEntity tileentity = this.world.getTileEntity(blockposition); + + if (tileentity instanceof TileEntityEndGateway) { +- ((TileEntityEndGateway) tileentity).a((Entity) this); ++ ((TileEntityEndGateway) tileentity).a(this); + } + + flag = true; +diff --git a/src/main/java/net/minecraft/server/EntityProjectileThrowable.java b/src/main/java/net/minecraft/server/EntityProjectileThrowable.java +index 68b7a42b595575fef60402d8c659dcd8d5deeeca..43688ec2ad8a843e7ef1814ace0efc064bdf9f64 100644 +--- a/src/main/java/net/minecraft/server/EntityProjectileThrowable.java ++++ b/src/main/java/net/minecraft/server/EntityProjectileThrowable.java +@@ -34,7 +34,7 @@ public abstract class EntityProjectileThrowable extends EntityProjectile { + // CraftBukkit end + + public ItemStack getItem() { +- return (ItemStack) this.getDataWatcher().get(EntityProjectileThrowable.b); ++ return this.getDataWatcher().get(EntityProjectileThrowable.b); + } + + public ItemStack g() { +diff --git a/src/main/java/net/minecraft/server/EntityPufferFish.java b/src/main/java/net/minecraft/server/EntityPufferFish.java +index 2f895df713fa1a6e45c23041e2b3b97c4b170f31..753aa5dda0ffb54a42ea00d99e38760e48eebfa0 100644 +--- a/src/main/java/net/minecraft/server/EntityPufferFish.java ++++ b/src/main/java/net/minecraft/server/EntityPufferFish.java +@@ -24,7 +24,7 @@ public class EntityPufferFish extends EntityFish { + } + + public int getPuffState() { +- return (Integer) this.datawatcher.get(EntityPufferFish.b); ++ return this.datawatcher.get(EntityPufferFish.b); + } + + public void setPuffState(int i) { +diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java +index 911182863c171c8e2faeb9375d1515d4be353b42..6c152afdeeda7f2835a4070974f223252fe0fc53 100644 +--- a/src/main/java/net/minecraft/server/EntityRabbit.java ++++ b/src/main/java/net/minecraft/server/EntityRabbit.java +@@ -46,7 +46,7 @@ public class EntityRabbit extends EntityAnimal { + PathEntity pathentity = this.navigation.k(); + + if (pathentity != null && pathentity.f() < pathentity.e()) { +- Vec3D vec3d = pathentity.a((Entity) this); ++ Vec3D vec3d = pathentity.a(this); + + if (vec3d.y > this.locY() + 0.5D) { + return 0.5F; +@@ -142,7 +142,7 @@ public class EntityRabbit extends EntityAnimal { + Vec3D vec3d = new Vec3D(this.moveController.d(), this.moveController.e(), this.moveController.f()); + + if (pathentity != null && pathentity.f() < pathentity.e()) { +- vec3d = pathentity.a((Entity) this); ++ vec3d = pathentity.a(this); + } + + this.b(vec3d.x, vec3d.z); +@@ -263,8 +263,8 @@ public class EntityRabbit extends EntityAnimal { + + @Override + public EntityRabbit createChild(EntityAgeable entityageable) { +- EntityRabbit entityrabbit = (EntityRabbit) EntityTypes.RABBIT.a(this.world); +- int i = this.a((GeneratorAccess) this.world); ++ EntityRabbit entityrabbit = EntityTypes.RABBIT.a(this.world); ++ int i = this.a(this.world); + + if (this.random.nextInt(20) != 0) { + if (entityageable instanceof EntityRabbit && this.random.nextBoolean()) { +@@ -284,7 +284,7 @@ public class EntityRabbit extends EntityAnimal { + } + + public int getRabbitType() { +- return (Integer) this.datawatcher.get(EntityRabbit.bv); ++ return this.datawatcher.get(EntityRabbit.bv); + } + + public void setRabbitType(int i) { +@@ -314,7 +314,7 @@ public class EntityRabbit extends EntityAnimal { + } + + this.setRabbitType(i); +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + private int a(GeneratorAccess generatoraccess) { +@@ -342,7 +342,7 @@ public class EntityRabbit extends EntityAnimal { + + @Override + protected double a(EntityLiving entityliving) { +- return (double) (4.0F + entityliving.getWidth()); ++ return 4.0F + entityliving.getWidth(); + } + } + +@@ -396,7 +396,7 @@ public class EntityRabbit extends EntityAnimal { + @Override + public void e() { + super.e(); +- this.entity.getControllerLook().a((double) this.e.getX() + 0.5D, (double) (this.e.getY() + 1), (double) this.e.getZ() + 0.5D, 10.0F, (float) this.entity.eo()); ++ this.entity.getControllerLook().a((double) this.e.getX() + 0.5D, this.e.getY() + 1, (double) this.e.getZ() + 0.5D, 10.0F, (float) this.entity.eo()); + if (this.k()) { + World world = this.entity.world; + BlockPosition blockposition = this.e.up(); +@@ -404,7 +404,7 @@ public class EntityRabbit extends EntityAnimal { + Block block = iblockdata.getBlock(); + + if (this.i && block instanceof BlockCarrots) { +- Integer integer = (Integer) iblockdata.get(BlockCarrots.AGE); ++ Integer integer = iblockdata.get(BlockCrops.AGE); + + if (integer == 0) { + // CraftBukkit start +@@ -419,12 +419,12 @@ public class EntityRabbit extends EntityAnimal { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent( + this.entity, + blockposition, +- iblockdata.set(BlockCarrots.AGE, integer - 1) ++ iblockdata.set(BlockCrops.AGE, integer - 1) + ).isCancelled()) { + return; + } + // CraftBukkit end +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCarrots.AGE, integer - 1), 2); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockCrops.AGE, integer - 1), 2); + world.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata)); + } + +diff --git a/src/main/java/net/minecraft/server/EntityRaider.java b/src/main/java/net/minecraft/server/EntityRaider.java +index 42f8d85c460a74f7f7c3277c44ed4648cd56a013..c27a7c45749dc083068aae21ab32252094b62e67 100644 +--- a/src/main/java/net/minecraft/server/EntityRaider.java ++++ b/src/main/java/net/minecraft/server/EntityRaider.java +@@ -58,7 +58,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling { + Raid raid1 = ((WorldServer) this.world).c_(this.getChunkCoordinates()); + + if (raid1 != null && PersistentRaid.a(this, raid1)) { +- raid1.a(raid1.getGroupsSpawned(), this, (BlockPosition) null, true); ++ raid1.a(raid1.getGroupsSpawned(), this, null, true); + } + } + } else { +@@ -206,7 +206,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling { + if (this.fc() && !flag && ItemStack.matches(itemstack, Raid.s())) { + EnumItemSlot enumitemslot = EnumItemSlot.HEAD; + ItemStack itemstack1 = this.getEquipment(enumitemslot); +- double d0 = (double) this.e(enumitemslot); ++ double d0 = this.e(enumitemslot); + + if (!itemstack1.isEmpty() && (double) Math.max(this.random.nextFloat() - 0.1F, 0.0F) < d0) { + this.a(itemstack1); +@@ -296,19 +296,19 @@ public abstract class EntityRaider extends EntityMonsterPatrolling { + if (!optional.isPresent()) { + return false; + } else { +- this.c = ((BlockPosition) optional.get()).immutableCopy(); ++ this.c = optional.get().immutableCopy(); + return true; + } + } + + @Override + public boolean b() { +- return this.a.getNavigation().m() ? false : this.a.getGoalTarget() == null && !this.c.a((IPosition) this.a.getPositionVector(), (double) (this.a.getWidth() + (float) this.e)) && !this.f; ++ return this.a.getNavigation().m() ? false : this.a.getGoalTarget() == null && !this.c.a(this.a.getPositionVector(), this.a.getWidth() + (float) this.e) && !this.f; + } + + @Override + public void d() { +- if (this.c.a((IPosition) this.a.getPositionVector(), (double) this.e)) { ++ if (this.c.a(this.a.getPositionVector(), this.e)) { + this.d.add(this.c); + } + +@@ -318,14 +318,14 @@ public abstract class EntityRaider extends EntityMonsterPatrolling { + public void c() { + super.c(); + this.a.n(0); +- this.a.getNavigation().a((double) this.c.getX(), (double) this.c.getY(), (double) this.c.getZ(), this.b); ++ this.a.getNavigation().a(this.c.getX(), this.c.getY(), this.c.getZ(), this.b); + this.f = false; + } + + @Override + public void e() { + if (this.a.getNavigation().m()) { +- Vec3D vec3d = Vec3D.c((BaseBlockPosition) this.c); ++ Vec3D vec3d = Vec3D.c(this.c); + Vec3D vec3d1 = RandomPositionGenerator.a(this.a, 16, 7, vec3d, 0.3141592741012573D); + + if (vec3d1 == null) { +@@ -503,7 +503,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling { + List list = this.b.world.a(EntityItem.class, this.b.getBoundingBox().grow(16.0D, 8.0D, 16.0D), EntityRaider.b); + + if (!list.isEmpty()) { +- return this.b.getNavigation().a((Entity) list.get(0), 1.149999976158142D); ++ return this.b.getNavigation().a(list.get(0), 1.149999976158142D); + } + } + +@@ -515,11 +515,11 @@ public abstract class EntityRaider extends EntityMonsterPatrolling { + + @Override + public void e() { +- if (this.b.getNavigation().h().a((IPosition) this.b.getPositionVector(), 1.414D)) { ++ if (this.b.getNavigation().h().a(this.b.getPositionVector(), 1.414D)) { + List list = this.b.world.a(EntityItem.class, this.b.getBoundingBox().grow(4.0D, 4.0D, 4.0D), EntityRaider.b); + + if (!list.isEmpty()) { +- this.b.b((EntityItem) list.get(0)); ++ this.b.b(list.get(0)); + } + } + +diff --git a/src/main/java/net/minecraft/server/EntityRavager.java b/src/main/java/net/minecraft/server/EntityRavager.java +index 6bdf90f43a1b683bbbb188cbb4a03f522b138c8e..6e5f9e0d19f83c0391e5a9d5e8d578ee815cda26 100644 +--- a/src/main/java/net/minecraft/server/EntityRavager.java ++++ b/src/main/java/net/minecraft/server/EntityRavager.java +@@ -36,7 +36,7 @@ public class EntityRavager extends EntityRaider { + + @Override + protected void H() { +- boolean flag = !(this.getRidingPassenger() instanceof EntityInsentient) || this.getRidingPassenger().getEntityType().a((Tag) TagsEntity.RADIERS); ++ boolean flag = !(this.getRidingPassenger() instanceof EntityInsentient) || this.getRidingPassenger().getEntityType().a(TagsEntity.RADIERS); + boolean flag1 = !(this.getVehicle() instanceof EntityBoat); + + this.goalSelector.a(PathfinderGoal.Type.MOVE, flag); +@@ -93,7 +93,7 @@ public class EntityRavager extends EntityRaider { + @Nullable + @Override + public Entity getRidingPassenger() { +- return this.getPassengers().isEmpty() ? null : (Entity) this.getPassengers().get(0); ++ return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0); + } + + @Override +@@ -154,9 +154,9 @@ public class EntityRavager extends EntityRaider { + + private void eY() { + if (this.random.nextInt(6) == 0) { +- double d0 = this.locX() - (double) this.getWidth() * Math.sin((double) (this.aH * 0.017453292F)) + (this.random.nextDouble() * 0.6D - 0.3D); ++ double d0 = this.locX() - (double) this.getWidth() * Math.sin(this.aH * 0.017453292F) + (this.random.nextDouble() * 0.6D - 0.3D); + double d1 = this.locY() + (double) this.getHeight() - 0.3D; +- double d2 = this.locZ() + (double) this.getWidth() * Math.cos((double) (this.aH * 0.017453292F)) + (this.random.nextDouble() * 0.6D - 0.3D); ++ double d2 = this.locZ() + (double) this.getWidth() * Math.cos(this.aH * 0.017453292F) + (this.random.nextDouble() * 0.6D - 0.3D); + + this.world.addParticle(Particles.ENTITY_EFFECT, d0, d1, d2, 0.4980392156862745D, 0.5137254901960784D, 0.5725490196078431D); + } +@@ -182,7 +182,7 @@ public class EntityRavager extends EntityRaider { + this.world.broadcastEntityEffect(this, (byte) 39); + entityliving.collide(this); + } else { +- this.a((Entity) entityliving); ++ this.a(entityliving); + } + + entityliving.velocityChanged = true; +@@ -299,7 +299,7 @@ public class EntityRavager extends EntityRaider { + protected double a(EntityLiving entityliving) { + float f = EntityRavager.this.getWidth() - 0.1F; + +- return (double) (f * 2.0F * f * 2.0F + entityliving.getWidth()); ++ return f * 2.0F * f * 2.0F + entityliving.getWidth(); + } + } + } +diff --git a/src/main/java/net/minecraft/server/EntitySelector.java b/src/main/java/net/minecraft/server/EntitySelector.java +index 0d0dd4f580ec6a5f3c49e619ed6a53f5dc94b735..15c3fb4ce4ab6f8387e7fb62be886a089c719cf1 100644 +--- a/src/main/java/net/minecraft/server/EntitySelector.java ++++ b/src/main/java/net/minecraft/server/EntitySelector.java +@@ -79,7 +79,7 @@ public class EntitySelector { + } else if (list.size() > 1) { + throw ArgumentEntity.a.create(); + } else { +- return (Entity) list.get(0); ++ return list.get(0); + } + } + +@@ -106,9 +106,9 @@ public class EntitySelector { + entity = worldserver.getEntity(this.k); + } while (entity == null); + +- return Lists.newArrayList(new Entity[]{entity}); ++ return Lists.newArrayList(entity); + } else { +- Vec3D vec3d = (Vec3D) this.f.apply(commandlistenerwrapper.getPosition()); ++ Vec3D vec3d = this.f.apply(commandlistenerwrapper.getPosition()); + Predicate predicate = this.a(vec3d); + + if (this.i) { +@@ -128,7 +128,7 @@ public class EntitySelector { + } + } + +- return this.a(vec3d, (List) list); ++ return this.a(vec3d, list); + } + } + } +@@ -149,7 +149,7 @@ public class EntitySelector { + if (list.size() != 1) { + throw ArgumentEntity.e.create(); + } else { +- return (EntityPlayer) list.get(0); ++ return list.get(0); + } + } + +@@ -164,7 +164,7 @@ public class EntitySelector { + entityplayer = commandlistenerwrapper.getServer().getPlayerList().getPlayer(this.k); + return (List) (entityplayer == null ? Collections.emptyList() : Lists.newArrayList(new EntityPlayer[]{entityplayer})); + } else { +- Vec3D vec3d = (Vec3D) this.f.apply(commandlistenerwrapper.getPosition()); ++ Vec3D vec3d = this.f.apply(commandlistenerwrapper.getPosition()); + Predicate predicate = this.a(vec3d); + + if (this.i) { +@@ -172,7 +172,7 @@ public class EntitySelector { + EntityPlayer entityplayer1 = (EntityPlayer) commandlistenerwrapper.getEntity(); + + if (predicate.test(entityplayer1)) { +- return Lists.newArrayList(new EntityPlayer[]{entityplayer1}); ++ return Lists.newArrayList(entityplayer1); + } + } + +diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java +index a41d55ba3f3ae8a3f62f152ac178e114e72cb6a4..252b717e723dfe7d063515faba9bf91d23e4d6a1 100644 +--- a/src/main/java/net/minecraft/server/EntitySheep.java ++++ b/src/main/java/net/minecraft/server/EntitySheep.java +@@ -15,7 +15,7 @@ import java.util.Random; + public class EntitySheep extends EntityAnimal implements IShearable { + + private static final DataWatcherObject bv = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a); +- private static final Map bw = (Map) SystemUtils.a(Maps.newEnumMap(EnumColor.class), (enummap) -> { // CraftBukkit - decompile error ++ private static final Map bw = SystemUtils.a(Maps.newEnumMap(EnumColor.class), (enummap) -> { // CraftBukkit - decompile error + enummap.put(EnumColor.WHITE, Blocks.WHITE_WOOL); + enummap.put(EnumColor.ORANGE, Blocks.ORANGE_WOOL); + enummap.put(EnumColor.MAGENTA, Blocks.MAGENTA_WOOL); +@@ -171,17 +171,17 @@ public class EntitySheep extends EntityAnimal implements IShearable { + + @Override + public void shear(SoundCategory soundcategory) { +- this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_SHEEP_SHEAR, soundcategory, 1.0F, 1.0F); ++ this.world.playSound(null, this, SoundEffects.ENTITY_SHEEP_SHEAR, soundcategory, 1.0F, 1.0F); + this.setSheared(true); + int i = 1 + this.random.nextInt(3); + + for (int j = 0; j < i; ++j) { + this.forceDrops = true; // CraftBukkit +- EntityItem entityitem = this.a((IMaterial) EntitySheep.bw.get(this.getColor()), 1); ++ EntityItem entityitem = this.a(EntitySheep.bw.get(this.getColor()), 1); + this.forceDrops = false; // CraftBukkit + + if (entityitem != null) { +- entityitem.setMot(entityitem.getMot().add((double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (this.random.nextFloat() * 0.05F), (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F))); ++ entityitem.setMot(entityitem.getMot().add((this.random.nextFloat() - this.random.nextFloat()) * 0.1F, this.random.nextFloat() * 0.05F, (this.random.nextFloat() - this.random.nextFloat()) * 0.1F)); + } + } + +@@ -227,21 +227,21 @@ public class EntitySheep extends EntityAnimal implements IShearable { + } + + public EnumColor getColor() { +- return EnumColor.fromColorIndex((Byte) this.datawatcher.get(EntitySheep.bv) & 15); ++ return EnumColor.fromColorIndex(this.datawatcher.get(EntitySheep.bv) & 15); + } + + public void setColor(EnumColor enumcolor) { +- byte b0 = (Byte) this.datawatcher.get(EntitySheep.bv); ++ byte b0 = this.datawatcher.get(EntitySheep.bv); + + this.datawatcher.set(EntitySheep.bv, (byte) (b0 & 240 | enumcolor.getColorIndex() & 15)); + } + + public boolean isSheared() { +- return ((Byte) this.datawatcher.get(EntitySheep.bv) & 16) != 0; ++ return (this.datawatcher.get(EntitySheep.bv) & 16) != 0; + } + + public void setSheared(boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntitySheep.bv); ++ byte b0 = this.datawatcher.get(EntitySheep.bv); + + if (flag) { + this.datawatcher.set(EntitySheep.bv, (byte) (b0 | 16)); +@@ -260,9 +260,9 @@ public class EntitySheep extends EntityAnimal implements IShearable { + @Override + public EntitySheep createChild(EntityAgeable entityageable) { + EntitySheep entitysheep = (EntitySheep) entityageable; +- EntitySheep entitysheep1 = (EntitySheep) EntityTypes.SHEEP.a(this.world); ++ EntitySheep entitysheep1 = EntityTypes.SHEEP.a(this.world); + +- entitysheep1.setColor(this.a((EntityAnimal) this, (EntityAnimal) entitysheep)); ++ entitysheep1.setColor(this.a(this, entitysheep)); + return entitysheep1; + } + +@@ -299,13 +299,13 @@ public class EntitySheep extends EntityAnimal implements IShearable { + ItemDye.class.getClass(); + optional = optional.filter(ItemDye.class::isInstance); + ItemDye.class.getClass(); +- return (EnumColor) optional.map(ItemDye.class::cast).map(ItemDye::d).orElseGet(() -> { ++ return optional.map(ItemDye.class::cast).map(ItemDye::d).orElseGet(() -> { + return this.world.random.nextBoolean() ? enumcolor : enumcolor1; + }); + } + + private static InventoryCrafting a(EnumColor enumcolor, EnumColor enumcolor1) { +- InventoryCrafting inventorycrafting = new InventoryCrafting(new Container((Containers) null, -1) { ++ InventoryCrafting inventorycrafting = new InventoryCrafting(new Container(null, -1) { + @Override + public boolean canUse(EntityHuman entityhuman) { + return false; +diff --git a/src/main/java/net/minecraft/server/EntityShulker.java b/src/main/java/net/minecraft/server/EntityShulker.java +index 75541b1c1515f4d008038d41c886b02c3c89bd49..ecd02d09e74a3280d9de82384e867cd1c05a3312 100644 +--- a/src/main/java/net/minecraft/server/EntityShulker.java ++++ b/src/main/java/net/minecraft/server/EntityShulker.java +@@ -108,9 +108,9 @@ public class EntityShulker extends EntityGolem implements IMonster { + @Override + public void saveData(NBTTagCompound nbttagcompound) { + super.saveData(nbttagcompound); +- nbttagcompound.setByte("AttachFace", (byte) ((EnumDirection) this.datawatcher.get(EntityShulker.b)).c()); +- nbttagcompound.setByte("Peek", (Byte) this.datawatcher.get(EntityShulker.d)); +- nbttagcompound.setByte("Color", (Byte) this.datawatcher.get(EntityShulker.COLOR)); ++ nbttagcompound.setByte("AttachFace", (byte) this.datawatcher.get(EntityShulker.b).c()); ++ nbttagcompound.setByte("Peek", this.datawatcher.get(EntityShulker.d)); ++ nbttagcompound.setByte("Color", this.datawatcher.get(EntityShulker.COLOR)); + BlockPosition blockposition = this.eN(); + + if (blockposition != null) { +@@ -124,7 +124,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + @Override + public void tick() { + super.tick(); +- BlockPosition blockposition = (BlockPosition) ((Optional) this.datawatcher.get(EntityShulker.c)).orElse((Object) null); ++ BlockPosition blockposition = (BlockPosition) ((Optional) this.datawatcher.get(EntityShulker.c)).orElse(null); + + if (blockposition == null && !this.world.isClientSide) { + blockposition = this.getChunkCoordinates(); +@@ -146,7 +146,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + + if (!iblockdata.isAir()) { + if (iblockdata.a(Blocks.MOVING_PISTON)) { +- enumdirection = (EnumDirection) iblockdata.get(BlockPiston.FACING); ++ enumdirection = iblockdata.get(BlockDirectional.FACING); + if (this.world.isEmpty(blockposition.shift(enumdirection))) { + blockposition = blockposition.shift(enumdirection); + this.datawatcher.set(EntityShulker.c, Optional.of(blockposition)); +@@ -154,7 +154,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + this.eL(); + } + } else if (iblockdata.a(Blocks.PISTON_HEAD)) { +- enumdirection = (EnumDirection) iblockdata.get(BlockPistonExtension.FACING); ++ enumdirection = iblockdata.get(BlockDirectional.FACING); + if (this.world.isEmpty(blockposition.shift(enumdirection))) { + blockposition = blockposition.shift(enumdirection); + this.datawatcher.set(EntityShulker.c, Optional.of(blockposition)); +@@ -195,7 +195,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + } + } + +- this.f((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D); ++ this.f((double) blockposition.getX() + 0.5D, blockposition.getY(), (double) blockposition.getZ() + 0.5D); + double d0 = 0.5D - (double) MathHelper.sin((0.5F + this.bz) * 3.1415927F) * 0.5D; + double d1 = 0.5D - (double) MathHelper.sin((0.5F + this.by) * 3.1415927F) * 0.5D; + EnumDirection enumdirection2 = this.eM().opposite(); +@@ -236,7 +236,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + public void setPosition(double d0, double d1, double d2) { + super.setPosition(d0, d1, d2); + if (this.datawatcher != null && this.ticksLived != 0) { +- Optional optional = (Optional) this.datawatcher.get(EntityShulker.c); ++ Optional optional = this.datawatcher.get(EntityShulker.c); + Optional optional1 = Optional.of(new BlockPosition(d0, d1, d2)); + + if (!optional1.equals(optional)) { +@@ -265,7 +265,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + } + + private boolean a(BlockPosition blockposition, EnumDirection enumdirection) { +- return this.world.a(blockposition.shift(enumdirection), (Entity) this, enumdirection.opposite()) && this.world.getCubes(this, ShulkerUtil.a(blockposition, enumdirection.opposite())); ++ return this.world.a(blockposition.shift(enumdirection), this, enumdirection.opposite()) && this.world.getCubes(this, ShulkerUtil.a(blockposition, enumdirection.opposite())); + } + + protected boolean eL() { +@@ -293,7 +293,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + this.playSound(SoundEffects.ENTITY_SHULKER_TELEPORT, 1.0F, 1.0F); + this.datawatcher.set(EntityShulker.c, Optional.of(blockposition1)); + this.datawatcher.set(EntityShulker.d, (byte) 0); +- this.setGoalTarget((EntityLiving) null); ++ this.setGoalTarget(null); + return true; + } + } +@@ -328,7 +328,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + this.bB = 6; + } + +- this.f((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D); ++ this.f((double) blockposition.getX() + 0.5D, blockposition.getY(), (double) blockposition.getZ() + 0.5D); + if (valid) ((WorldServer) world).chunkCheck(this); // CraftBukkit + } + } +@@ -368,12 +368,12 @@ public class EntityShulker extends EntityGolem implements IMonster { + } + + public EnumDirection eM() { +- return (EnumDirection) this.datawatcher.get(EntityShulker.b); ++ return this.datawatcher.get(EntityShulker.b); + } + + @Nullable + public BlockPosition eN() { +- return (BlockPosition) ((Optional) this.datawatcher.get(EntityShulker.c)).orElse((Object) null); ++ return (BlockPosition) ((Optional) this.datawatcher.get(EntityShulker.c)).orElse(null); + } + + public void h(@Nullable BlockPosition blockposition) { +@@ -381,7 +381,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + } + + public int eO() { +- return (Byte) this.datawatcher.get(EntityShulker.d); ++ return this.datawatcher.get(EntityShulker.d); + } + + public void a(int i) { +@@ -503,7 +503,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + EntityShulker.this.playSound(SoundEffects.ENTITY_SHULKER_SHOOT, 2.0F, (EntityShulker.this.random.nextFloat() - EntityShulker.this.random.nextFloat()) * 0.2F + 1.0F); + } + } else { +- EntityShulker.this.setGoalTarget((EntityLiving) null); ++ EntityShulker.this.setGoalTarget(null); + } + + super.e(); +diff --git a/src/main/java/net/minecraft/server/EntityShulkerBullet.java b/src/main/java/net/minecraft/server/EntityShulkerBullet.java +index 64a127f3d51ba34996e40eec72c0911f64394e98..26dcd72eda6c94e71cb67239dcca2c21ce65f070 100644 +--- a/src/main/java/net/minecraft/server/EntityShulkerBullet.java ++++ b/src/main/java/net/minecraft/server/EntityShulkerBullet.java +@@ -112,7 +112,7 @@ public class EntityShulkerBullet extends IProjectile { + double d3 = (double) blockposition.getZ() + 0.5D; + EnumDirection enumdirection = null; + +- if (!blockposition.a((IPosition) this.getPositionVector(), 2.0D)) { ++ if (!blockposition.a(this.getPositionVector(), 2.0D)) { + BlockPosition blockposition1 = this.getChunkCoordinates(); + List list = Lists.newArrayList(); + +@@ -146,7 +146,7 @@ public class EntityShulkerBullet extends IProjectile { + enumdirection = EnumDirection.a(this.random); + } + } else { +- enumdirection = (EnumDirection) list.get(this.random.nextInt(list.size())); ++ enumdirection = list.get(this.random.nextInt(list.size())); + } + + d1 = this.locX() + (double) enumdirection.getAdjacentX(); +@@ -158,7 +158,7 @@ public class EntityShulkerBullet extends IProjectile { + double d4 = d1 - this.locX(); + double d5 = d2 - this.locY(); + double d6 = d3 - this.locZ(); +- double d7 = (double) MathHelper.sqrt(d4 * d4 + d5 * d5 + d6 * d6); ++ double d7 = MathHelper.sqrt(d4 * d4 + d5 * d5 + d6 * d6); + + if (d7 == 0.0D) { + this.e = 0.0D; +@@ -195,7 +195,7 @@ public class EntityShulkerBullet extends IProjectile { + } + } + +- if (this.target != null && this.target.isAlive() && (!(this.target instanceof EntityHuman) || !((EntityHuman) this.target).isSpectator())) { ++ if (this.target != null && this.target.isAlive() && (!(this.target instanceof EntityHuman) || !this.target.isSpectator())) { + this.e = MathHelper.a(this.e * 1.025D, -1.0D, 1.0D); + this.f = MathHelper.a(this.f * 1.025D, -1.0D, 1.0D); + this.g = MathHelper.a(this.g * 1.025D, -1.0D, 1.0D); +@@ -229,7 +229,7 @@ public class EntityShulkerBullet extends IProjectile { + BlockPosition blockposition = this.getChunkCoordinates(); + EnumDirection.EnumAxis enumdirection_enumaxis = this.dir.n(); + +- if (this.world.a(blockposition.shift(this.dir), (Entity) this)) { ++ if (this.world.a(blockposition.shift(this.dir), this)) { + this.a(enumdirection_enumaxis); + } else { + BlockPosition blockposition1 = this.target.getChunkCoordinates(); +@@ -264,7 +264,7 @@ public class EntityShulkerBullet extends IProjectile { + Entity entity = movingobjectpositionentity.getEntity(); + Entity entity1 = this.getShooter(); + EntityLiving entityliving = entity1 instanceof EntityLiving ? (EntityLiving) entity1 : null; +- boolean flag = entity.damageEntity(DamageSource.a((Entity) this, entityliving).c(), 4.0F); ++ boolean flag = entity.damageEntity(DamageSource.a(this, entityliving).c(), 4.0F); + + if (flag) { + this.a(entityliving, entity); +diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +index 531ff5246e1f2a0862617752bdf0707d33970227..5a42a7594b89cd2b3c84d855b06e336a2feb7635 100644 +--- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java ++++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +@@ -34,7 +34,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR + this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D)); + this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this)); +- this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0])); ++ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this)); + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bv)); +@@ -124,8 +124,8 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR + + public void eM() { + if (this.world != null && !this.world.isClientSide) { +- this.goalSelector.a((PathfinderGoal) this.c); +- this.goalSelector.a((PathfinderGoal) this.b); ++ this.goalSelector.a(this.c); ++ this.goalSelector.a(this.b); + ItemStack itemstack = this.b(ProjectileHelper.a(this, Items.BOW)); + + if (itemstack.getItem() == Items.BOW) { +@@ -151,7 +151,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR + double d0 = entityliving.locX() - this.locX(); + double d1 = entityliving.e(0.3333333333333333D) - entityarrow.locY(); + double d2 = entityliving.locZ() - this.locZ(); +- double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); ++ double d3 = MathHelper.sqrt(d0 * d0 + d2 * d2); + + entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4)); + // CraftBukkit start +diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java +index 58d811d75fa12d4f37fb0309787b9c136c79ad09..799cbfa8e577c8fe2b1b8ff47174d799303c7a0e 100644 +--- a/src/main/java/net/minecraft/server/EntitySlime.java ++++ b/src/main/java/net/minecraft/server/EntitySlime.java +@@ -52,9 +52,9 @@ public class EntitySlime extends EntityInsentient implements IMonster { + this.datawatcher.set(EntitySlime.bv, i); + this.ac(); + this.updateSize(); +- this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue((double) (i * i)); +- this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue((double) (0.2F + 0.1F * (float) i)); +- this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue((double) i); ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(i * i); ++ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.2F + 0.1F * (float) i); ++ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(i); + if (flag) { + this.setHealth(this.getMaxHealth()); + } +@@ -63,7 +63,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + } + + public int getSize() { +- return (Integer) this.datawatcher.get(EntitySlime.bv); ++ return this.datawatcher.get(EntitySlime.bv); + } + + @Override +@@ -196,7 +196,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + for (int l = 0; l < k; ++l) { + float f1 = ((float) (l % 2) - 0.5F) * f; + float f2 = ((float) (l / 2) - 0.5F) * f; +- EntitySlime entityslime = (EntitySlime) this.getEntityType().a(this.world); ++ EntitySlime entityslime = this.getEntityType().a(this.world); + + if (this.isPersistent()) { + entityslime.setPersistent(); +@@ -235,7 +235,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + @Override + public void pickup(EntityHuman entityhuman) { + if (this.eM()) { +- this.j((EntityLiving) entityhuman); ++ this.j(entityhuman); + } + + } +@@ -246,7 +246,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + + if (this.h((Entity) entityliving) < 0.6D * (double) i * 0.6D * (double) i && this.hasLineOfSight(entityliving) && entityliving.damageEntity(DamageSource.mobAttack(this), this.eN())) { + this.playSound(SoundEffects.ENTITY_SLIME_ATTACK, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); +- this.a((EntityLiving) this, (Entity) entityliving); ++ this.a(this, entityliving); + } + } + +@@ -325,7 +325,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + protected void jump() { + Vec3D vec3d = this.getMot(); + +- this.setMot(vec3d.x, (double) this.dI(), vec3d.z); ++ this.setMot(vec3d.x, this.dI(), vec3d.z); + this.impulse = true; + } + +@@ -483,7 +483,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + + @Override + public void e() { +- this.a.a((Entity) this.a.getGoalTarget(), 10.0F, 10.0F); ++ this.a.a(this.a.getGoalTarget(), 10.0F, 10.0F); + ((EntitySlime.ControllerMoveSlime) this.a.getControllerMove()).a(this.a.yaw, this.a.eM()); + } + +diff --git a/src/main/java/net/minecraft/server/EntitySmallFireball.java b/src/main/java/net/minecraft/server/EntitySmallFireball.java +index 8c006ba920e4ae89c9534b16f3b11042036ce936..919c12f9898c9df4c15127dc48f2ab26c0003b48 100644 +--- a/src/main/java/net/minecraft/server/EntitySmallFireball.java ++++ b/src/main/java/net/minecraft/server/EntitySmallFireball.java +@@ -33,7 +33,7 @@ public class EntitySmallFireball extends EntityFireballFireball { + + // CraftBukkit start - Entity damage by entity event + combust event + if (isIncendiary) { +- EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), entity.getBukkitEntity(), 5); ++ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5); + entity.world.getServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { +diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java +index f391889deddc248b06b7e4e20b9208f98aab91bc..73116bdc481b3a82ca30b5d644e139138349f08c 100644 +--- a/src/main/java/net/minecraft/server/EntitySnowman.java ++++ b/src/main/java/net/minecraft/server/EntitySnowman.java +@@ -130,7 +130,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt + + @Override + public void shear(SoundCategory soundcategory) { +- this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_SNOW_GOLEM_SHEAR, soundcategory, 1.0F, 1.0F); ++ this.world.playSound(null, this, SoundEffects.ENTITY_SNOW_GOLEM_SHEAR, soundcategory, 1.0F, 1.0F); + if (!this.world.s_()) { + this.setHasPumpkin(false); + this.a(new ItemStack(Items.dj), 1.7F); +@@ -144,11 +144,11 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt + } + + public boolean hasPumpkin() { +- return ((Byte) this.datawatcher.get(EntitySnowman.b) & 16) != 0; ++ return (this.datawatcher.get(EntitySnowman.b) & 16) != 0; + } + + public void setHasPumpkin(boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntitySnowman.b); ++ byte b0 = this.datawatcher.get(EntitySnowman.b); + + if (flag) { + this.datawatcher.set(EntitySnowman.b, (byte) (b0 | 16)); +diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java +index 53405c4479ad8787a4222008011aaf4d8dccdca7..b4face73ea5705ffceb8922dc06170998905bca3 100644 +--- a/src/main/java/net/minecraft/server/EntitySpider.java ++++ b/src/main/java/net/minecraft/server/EntitySpider.java +@@ -19,14 +19,14 @@ public class EntitySpider extends EntityMonster { + this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.8D)); + this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this)); +- this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0])); ++ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this)); + this.targetSelector.a(2, new EntitySpider.PathfinderGoalSpiderNearestAttackableTarget<>(this, EntityHuman.class)); + this.targetSelector.a(3, new EntitySpider.PathfinderGoalSpiderNearestAttackableTarget<>(this, EntityIronGolem.class)); + } + + @Override + public double aY() { +- return (double) (this.getHeight() * 0.5F); ++ return this.getHeight() * 0.5F; + } + + @Override +@@ -97,11 +97,11 @@ public class EntitySpider extends EntityMonster { + } + + public boolean eM() { +- return ((Byte) this.datawatcher.get(EntitySpider.b) & 1) != 0; ++ return (this.datawatcher.get(EntitySpider.b) & 1) != 0; + } + + public void t(boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntitySpider.b); ++ byte b0 = this.datawatcher.get(EntitySpider.b); + + if (flag) { + b0 = (byte) (b0 | 1); +@@ -118,10 +118,10 @@ public class EntitySpider extends EntityMonster { + Object object = super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + + if (generatoraccess.getRandom().nextInt(100) == 0) { +- EntitySkeleton entityskeleton = (EntitySkeleton) EntityTypes.SKELETON.a(this.world); ++ EntitySkeleton entityskeleton = EntityTypes.SKELETON.a(this.world); + + entityskeleton.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, 0.0F); +- entityskeleton.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) null, (NBTTagCompound) null); ++ entityskeleton.prepare(generatoraccess, difficultydamagescaler, enummobspawn, null, null); + entityskeleton.startRiding(this); + generatoraccess.addEntity(entityskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.JOCKEY); // CraftBukkit - add SpawnReason + } +@@ -179,7 +179,7 @@ public class EntitySpider extends EntityMonster { + float f = this.a.aO(); + + if (f >= 0.5F && this.a.getRandom().nextInt(100) == 0) { +- this.a.setGoalTarget((EntityLiving) null); ++ this.a.setGoalTarget(null); + return false; + } else { + return super.b(); +@@ -188,7 +188,7 @@ public class EntitySpider extends EntityMonster { + + @Override + protected double a(EntityLiving entityliving) { +- return (double) (4.0F + entityliving.getWidth()); ++ return 4.0F + entityliving.getWidth(); + } + } + +diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java +index c9c0b2ab265666986cdedf920955ee55ebbedaf3..29791225e425d2fc45abb586526a22ba52464228 100644 +--- a/src/main/java/net/minecraft/server/EntitySquid.java ++++ b/src/main/java/net/minecraft/server/EntitySquid.java +@@ -104,7 +104,7 @@ public class EntitySquid extends EntityWaterAnimal { + } + + if (!this.world.isClientSide) { +- this.setMot((double) (this.bD * this.bA), (double) (this.bE * this.bA), (double) (this.bF * this.bA)); ++ this.setMot(this.bD * this.bA, this.bE * this.bA, this.bF * this.bA); + } + + Vec3D vec3d = this.getMot(); +@@ -113,7 +113,7 @@ public class EntitySquid extends EntityWaterAnimal { + this.aH += (-((float) MathHelper.d(vec3d.x, vec3d.z)) * 57.295776F - this.aH) * 0.1F; + this.yaw = this.aH; + this.d = (float) ((double) this.d + 3.141592653589793D * (double) this.bC * 1.5D); +- this.b += (-((float) MathHelper.d((double) f1, vec3d.y)) * 57.295776F - this.b) * 0.1F; ++ this.b += (-((float) MathHelper.d(f1, vec3d.y)) * 57.295776F - this.b) * 0.1F; + } else { + this.by = MathHelper.e(MathHelper.sin(this.bw)) * 3.1415927F * 0.25F; + if (!this.world.isClientSide) { +@@ -211,7 +211,7 @@ public class EntitySquid extends EntityWaterAnimal { + IBlockData iblockdata = EntitySquid.this.world.getType(new BlockPosition(EntitySquid.this.locX() + vec3d.x, EntitySquid.this.locY() + vec3d.y, EntitySquid.this.locZ() + vec3d.z)); + Fluid fluid = EntitySquid.this.world.getFluid(new BlockPosition(EntitySquid.this.locX() + vec3d.x, EntitySquid.this.locY() + vec3d.y, EntitySquid.this.locZ() + vec3d.z)); + +- if (fluid.a((Tag) TagsFluid.WATER) || iblockdata.isAir()) { ++ if (fluid.a(TagsFluid.WATER) || iblockdata.isAir()) { + double d0 = vec3d.f(); + + if (d0 > 0.0D) { +diff --git a/src/main/java/net/minecraft/server/EntityStrider.java b/src/main/java/net/minecraft/server/EntityStrider.java +index f6bf51c17ae158e2d65ea65e885ecebe11037ba8..f7b676b1b492cc7f26e754231fc037318fadfa9d 100644 +--- a/src/main/java/net/minecraft/server/EntityStrider.java ++++ b/src/main/java/net/minecraft/server/EntityStrider.java +@@ -34,7 +34,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + + do { + blockposition_mutableblockposition.c(EnumDirection.UP); +- } while (generatoraccess.getFluid(blockposition_mutableblockposition).a((Tag) TagsFluid.LAVA)); ++ } while (generatoraccess.getFluid(blockposition_mutableblockposition).a(TagsFluid.LAVA)); + + return generatoraccess.getType(blockposition_mutableblockposition).isAir(); + } +@@ -82,7 +82,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + public void saddle(@Nullable SoundCategory soundcategory) { + this.bA.setSaddle(true); + if (soundcategory != null) { +- this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_STRIDER_SADDLE, soundcategory, 0.5F, 1.0F); ++ this.world.playSound(null, this, SoundEffects.ENTITY_STRIDER_SADDLE, soundcategory, 0.5F, 1.0F); + } + + } +@@ -106,12 +106,12 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + } + + public boolean eL() { +- return this.getVehicle() instanceof EntityStrider ? ((EntityStrider) this.getVehicle()).eL() : (Boolean) this.datawatcher.get(EntityStrider.by); ++ return this.getVehicle() instanceof EntityStrider ? ((EntityStrider) this.getVehicle()).eL() : this.datawatcher.get(EntityStrider.by); + } + + @Override + public boolean a(FluidType fluidtype) { +- return fluidtype.a((Tag) TagsFluid.LAVA); ++ return fluidtype.a(TagsFluid.LAVA); + } + + @Nullable +@@ -154,12 +154,12 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + @Nullable + @Override + public Entity getRidingPassenger() { +- return this.getPassengers().isEmpty() ? null : (Entity) this.getPassengers().get(0); ++ return this.getPassengers().isEmpty() ? null : this.getPassengers().get(0); + } + + @Override + public Vec3D c(EntityLiving entityliving) { +- Vec3D[] avec3d = new Vec3D[]{a((double) this.getWidth(), (double) entityliving.getWidth(), entityliving.yaw), a((double) this.getWidth(), (double) entityliving.getWidth(), entityliving.yaw - 22.5F), a((double) this.getWidth(), (double) entityliving.getWidth(), entityliving.yaw + 22.5F), a((double) this.getWidth(), (double) entityliving.getWidth(), entityliving.yaw - 45.0F), a((double) this.getWidth(), (double) entityliving.getWidth(), entityliving.yaw + 45.0F)}; ++ Vec3D[] avec3d = new Vec3D[]{a((double) this.getWidth(), entityliving.getWidth(), entityliving.yaw), a((double) this.getWidth(), entityliving.getWidth(), entityliving.yaw - 22.5F), a((double) this.getWidth(), entityliving.getWidth(), entityliving.yaw + 22.5F), a((double) this.getWidth(), entityliving.getWidth(), entityliving.yaw - 45.0F), a((double) this.getWidth(), entityliving.getWidth(), entityliving.yaw + 45.0F)}; + Set set = Sets.newLinkedHashSet(); + double d0 = this.getBoundingBox().maxY; + double d1 = this.getBoundingBox().minY - 0.5D; +@@ -185,7 +185,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + while (iterator.hasNext()) { + BlockPosition blockposition = (BlockPosition) iterator.next(); + +- if (!this.world.getFluid(blockposition).a((Tag) TagsFluid.LAVA)) { ++ if (!this.world.getFluid(blockposition).a(TagsFluid.LAVA)) { + UnmodifiableIterator unmodifiableiterator = entityliving.ei().iterator(); + + while (unmodifiableiterator.hasNext()) { +@@ -194,7 +194,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + d2 = this.world.m(blockposition); + if (DismountUtil.a(d2)) { + AxisAlignedBB axisalignedbb = entityliving.f(entitypose); +- Vec3D vec3d1 = Vec3D.a((BaseBlockPosition) blockposition, d2); ++ Vec3D vec3d1 = Vec3D.a(blockposition, d2); + + if (DismountUtil.a(this.world, entityliving, axisalignedbb.c(vec3d1))) { + entityliving.setPose(entitypose); +@@ -211,7 +211,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + @Override + public void f(Vec3D vec3d) { + this.n(this.eM()); +- this.a((EntityInsentient) this, this.bA, vec3d); ++ this.a(this, this.bA, vec3d); + } + + public float eM() { +@@ -263,7 +263,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + + IBlockData iblockdata = this.world.getType(this.getChunkCoordinates()); + IBlockData iblockdata1 = this.aJ(); +- boolean flag = iblockdata.a((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || iblockdata1.a((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || this.b((Tag) TagsFluid.LAVA) > 0.0D; ++ boolean flag = iblockdata.a(TagsBlock.STRIDER_WARM_BLOCKS) || iblockdata1.a(TagsBlock.STRIDER_WARM_BLOCKS) || this.b(TagsFluid.LAVA) > 0.0D; + + // CraftBukkit start + if (!flag ^ this.eL()) { +@@ -291,9 +291,9 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + + private void eV() { + if (this.aN()) { +- VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a((Entity) this); ++ VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this); + +- if (voxelshapecollision.a(BlockFluids.c, this.getChunkCoordinates(), true) && !this.world.getFluid(this.getChunkCoordinates().up()).a((Tag) TagsFluid.LAVA)) { ++ if (voxelshapecollision.a(BlockFluids.c, this.getChunkCoordinates(), true) && !this.world.getFluid(this.getChunkCoordinates().up()).a(TagsFluid.LAVA)) { + this.onGround = true; + } else { + this.setMot(this.getMot().a(0.5D).add(0.0D, 0.05D, 0.0D)); +@@ -323,7 +323,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + + @Override + protected boolean q(Entity entity) { +- return this.getPassengers().isEmpty() && !this.a((Tag) TagsFluid.LAVA); ++ return this.getPassengers().isEmpty() && !this.a(TagsFluid.LAVA); + } + + @Override +@@ -343,12 +343,12 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + + @Override + public float a(BlockPosition blockposition, IWorldReader iworldreader) { +- return iworldreader.getType(blockposition).getFluid().a((Tag) TagsFluid.LAVA) ? 10.0F : 0.0F; ++ return iworldreader.getType(blockposition).getFluid().a(TagsFluid.LAVA) ? 10.0F : 0.0F; + } + + @Override + public EntityStrider createChild(EntityAgeable entityageable) { +- return (EntityStrider) EntityTypes.STRIDER.a(this.world); ++ return EntityTypes.STRIDER.a(this.world); + } + + @Override +@@ -381,10 +381,10 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + if (!enuminteractionresult.a()) { + ItemStack itemstack = entityhuman.b(enumhand); + +- return itemstack.getItem() == Items.SADDLE ? itemstack.a(entityhuman, (EntityLiving) this, enumhand) : EnumInteractionResult.PASS; ++ return itemstack.getItem() == Items.SADDLE ? itemstack.a(entityhuman, this, enumhand) : EnumInteractionResult.PASS; + } else { + if (flag && !this.isSilent()) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_STRIDER_EAT, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_STRIDER_EAT, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); + } + + return enuminteractionresult; +@@ -419,29 +419,29 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + Object object = null; + + if (entitystrider_groupdata_rider == EntityStrider.GroupData.Rider.BABY_RIDER) { +- EntityStrider entitystrider = (EntityStrider) EntityTypes.STRIDER.a(generatoraccess.getMinecraftWorld()); ++ EntityStrider entitystrider = EntityTypes.STRIDER.a(generatoraccess.getMinecraftWorld()); + + if (entitystrider != null) { + object = entitystrider; + entitystrider.setAgeRaw(-24000); + } + } else if (entitystrider_groupdata_rider == EntityStrider.GroupData.Rider.PIGLIN_RIDER) { +- EntityPigZombie entitypigzombie = (EntityPigZombie) EntityTypes.ZOMBIFIED_PIGLIN.a(generatoraccess.getMinecraftWorld()); ++ EntityPigZombie entitypigzombie = EntityTypes.ZOMBIFIED_PIGLIN.a(generatoraccess.getMinecraftWorld()); + + if (entitypigzombie != null) { + object = entitypigzombie; +- this.saddle((SoundCategory) null); ++ this.saddle(null); + } + } + + if (object != null) { + ((EntityInsentient) object).setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, 0.0F); +- ((EntityInsentient) object).prepare(generatoraccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, entityzombie_groupdatazombie, (NBTTagCompound) null); ++ ((EntityInsentient) object).prepare(generatoraccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, entityzombie_groupdatazombie, null); + ((EntityInsentient) object).a((Entity) this, true); + generatoraccess.addEntity((Entity) object); + } + +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + static class b extends Navigation { +diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +index d85139e4acd58eb0c521f9942cbe13541b2db490..8762090f7f7f849036b1e3ee58bbdbdc584075d3 100644 +--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java ++++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +@@ -170,7 +170,7 @@ public class EntityTNTPrimed extends Entity { + } + + public int h() { +- return (Integer) this.datawatcher.get(EntityTNTPrimed.FUSE_TICKS); ++ return this.datawatcher.get(EntityTNTPrimed.FUSE_TICKS); + } + + public int getFuseTicks() { +diff --git a/src/main/java/net/minecraft/server/EntityThrownTrident.java b/src/main/java/net/minecraft/server/EntityThrownTrident.java +index c68002ffe68bec96079d3404c481a07d17990913..f4e8c7397817d3d34b2c29f59ebab24214247d2a 100644 +--- a/src/main/java/net/minecraft/server/EntityThrownTrident.java ++++ b/src/main/java/net/minecraft/server/EntityThrownTrident.java +@@ -39,7 +39,7 @@ public class EntityThrownTrident extends EntityArrow { + Entity entity = this.getShooter(); + + if ((this.ap || this.t()) && entity != null) { +- byte b0 = (Byte) this.datawatcher.get(EntityThrownTrident.g); ++ byte b0 = this.datawatcher.get(EntityThrownTrident.g); + + if (b0 > 0 && !this.z()) { + if (!this.world.isClientSide && this.fromPlayer == EntityArrow.PickupStatus.ALLOWED) { +@@ -99,7 +99,7 @@ public class EntityThrownTrident extends EntityArrow { + } + + Entity entity1 = this.getShooter(); +- DamageSource damagesource = DamageSource.a((Entity) this, (Entity) (entity1 == null ? this : entity1)); ++ DamageSource damagesource = DamageSource.a(this, entity1 == null ? this : entity1); + + this.ap = true; + SoundEffect soundeffect = SoundEffects.ITEM_TRIDENT_HIT; +@@ -114,7 +114,7 @@ public class EntityThrownTrident extends EntityArrow { + + if (entity1 instanceof EntityLiving) { + EnchantmentManager.a(entityliving1, entity1); +- EnchantmentManager.b((EntityLiving) entity1, (Entity) entityliving1); ++ EnchantmentManager.b((EntityLiving) entity1, entityliving1); + } + + this.a(entityliving1); +@@ -128,9 +128,9 @@ public class EntityThrownTrident extends EntityArrow { + BlockPosition blockposition = entity.getChunkCoordinates(); + + if (this.world.f(blockposition)) { +- EntityLightning entitylightning = (EntityLightning) EntityTypes.LIGHTNING_BOLT.a(this.world); ++ EntityLightning entitylightning = EntityTypes.LIGHTNING_BOLT.a(this.world); + +- entitylightning.c(Vec3D.c((BaseBlockPosition) blockposition)); ++ entitylightning.c(Vec3D.c(blockposition)); + entitylightning.d(entity1 instanceof EntityPlayer ? (EntityPlayer) entity1 : null); + ((WorldServer) this.world).strikeLightning(entitylightning, org.bukkit.event.weather.LightningStrikeEvent.Cause.TRIDENT); // CraftBukkit + soundeffect = SoundEffects.ITEM_TRIDENT_THUNDER; +@@ -175,7 +175,7 @@ public class EntityThrownTrident extends EntityArrow { + + @Override + public void h() { +- byte b0 = (Byte) this.datawatcher.get(EntityThrownTrident.g); ++ byte b0 = this.datawatcher.get(EntityThrownTrident.g); + + if (this.fromPlayer != EntityArrow.PickupStatus.ALLOWED || b0 <= 0) { + super.h(); +diff --git a/src/main/java/net/minecraft/server/EntityTippedArrow.java b/src/main/java/net/minecraft/server/EntityTippedArrow.java +index 2828cf35df63cf4d8478aab74ef7e7a1e7d57d9d..db521a013906430ee886ba3d8d0a5fe90b51b8ff 100644 +--- a/src/main/java/net/minecraft/server/EntityTippedArrow.java ++++ b/src/main/java/net/minecraft/server/EntityTippedArrow.java +@@ -72,14 +72,14 @@ public class EntityTippedArrow extends EntityArrow { + if (this.potionRegistry == Potions.EMPTY && this.effects.isEmpty()) { + this.datawatcher.set(EntityTippedArrow.COLOR, -1); + } else { +- this.datawatcher.set(EntityTippedArrow.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))); ++ this.datawatcher.set(EntityTippedArrow.COLOR, PotionUtil.a(PotionUtil.a(this.potionRegistry, this.effects))); + } + + } + + public void addEffect(MobEffect mobeffect) { + this.effects.add(mobeffect); +- this.getDataWatcher().set(EntityTippedArrow.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))); ++ this.getDataWatcher().set(EntityTippedArrow.COLOR, PotionUtil.a(PotionUtil.a(this.potionRegistry, this.effects))); + } + + @Override +@@ -125,7 +125,7 @@ public class EntityTippedArrow extends EntityArrow { + + // CraftBukkit start accessor methods + public void refreshEffects() { +- this.getDataWatcher().set(EntityTippedArrow.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))); ++ this.getDataWatcher().set(EntityTippedArrow.COLOR, PotionUtil.a(PotionUtil.a(this.potionRegistry, this.effects))); + } + + public String getType() { +@@ -134,7 +134,7 @@ public class EntityTippedArrow extends EntityArrow { + + public void setType(String string) { + this.potionRegistry = IRegistry.POTION.get(new MinecraftKey(string)); +- this.getDataWatcher().set(EntityTippedArrow.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))); ++ this.getDataWatcher().set(EntityTippedArrow.COLOR, PotionUtil.a(PotionUtil.a(this.potionRegistry, this.effects))); + } + + public boolean isTipped() { +@@ -143,7 +143,7 @@ public class EntityTippedArrow extends EntityArrow { + // CraftBukkit end + + public int getColor() { +- return (Integer) this.datawatcher.get(EntityTippedArrow.COLOR); ++ return this.datawatcher.get(EntityTippedArrow.COLOR); + } + + public void setColor(int i) { +@@ -231,7 +231,7 @@ public class EntityTippedArrow extends EntityArrow { + ItemStack itemstack = new ItemStack(Items.TIPPED_ARROW); + + PotionUtil.a(itemstack, this.potionRegistry); +- PotionUtil.a(itemstack, (Collection) this.effects); ++ PotionUtil.a(itemstack, this.effects); + if (this.hasColor) { + itemstack.getOrCreateTag().setInt("CustomPotionColor", this.getColor()); + } +diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +index ea0890a8c8f2c575fca384f909ce15dfe4ddf9f7..e1e8aca1ca210981fe7e2d08f07f9e970e1df13d 100644 +--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +@@ -88,8 +88,8 @@ public class EntityTrackerEntry { + while (iterator.hasNext()) { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); + +- worldmap.a((EntityHuman) entityplayer, itemstack); +- Packet packet = ((ItemWorldMap) itemstack.getItem()).a(itemstack, (World) this.b, (EntityHuman) entityplayer); ++ worldmap.a(entityplayer, itemstack); ++ Packet packet = ((ItemWorldMap) itemstack.getItem()).a(itemstack, this.b, entityplayer); + + if (packet != null) { + entityplayer.playerConnection.sendPacket(packet); +diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java +index 1959155080fe2a2fb19227c884d598719528b140..84bbeab214beff40703086600d1fd9009f7e17a3 100644 +--- a/src/main/java/net/minecraft/server/EntityTurtle.java ++++ b/src/main/java/net/minecraft/server/EntityTurtle.java +@@ -32,7 +32,7 @@ public class EntityTurtle extends EntityAnimal { + this.datawatcher.set(EntityTurtle.bw, blockposition.immutableCopy()); // Paper - called with mutablepos... + } + public BlockPosition getHomePos() { // Paper - public +- return (BlockPosition) this.datawatcher.get(EntityTurtle.bw); ++ return this.datawatcher.get(EntityTurtle.bw); + } + + private void setTravelPos(BlockPosition blockposition) { +@@ -40,11 +40,11 @@ public class EntityTurtle extends EntityAnimal { + } + + private BlockPosition getTravelPos() { +- return (BlockPosition) this.datawatcher.get(EntityTurtle.bz); ++ return this.datawatcher.get(EntityTurtle.bz); + } + + public boolean hasEgg() { +- return (Boolean) this.datawatcher.get(EntityTurtle.bx); ++ return this.datawatcher.get(EntityTurtle.bx); + } + + public void setHasEgg(boolean flag) { // Paper +@@ -53,7 +53,7 @@ public class EntityTurtle extends EntityAnimal { + + public final boolean isDigging() { return this.eM(); } // Paper - OBFHELPER + public boolean eM() { +- return (Boolean) this.datawatcher.get(EntityTurtle.by); ++ return this.datawatcher.get(EntityTurtle.by); + } + + public final void setDigging(boolean digging) { this.u(digging); } // Paper - OBFHELPER +@@ -64,7 +64,7 @@ public class EntityTurtle extends EntityAnimal { + + public final boolean isGoingHome() { return this.eV(); } // Paper - OBFHELPER + private boolean eV() { +- return (Boolean) this.datawatcher.get(EntityTurtle.bA); ++ return this.datawatcher.get(EntityTurtle.bA); + } + + public final void setGoingHome(boolean goingHome) { this.v(goingHome); } // Paper - OBFHELPER +@@ -74,7 +74,7 @@ public class EntityTurtle extends EntityAnimal { + + public final boolean isTravelling() { return this.eW(); } // Paper - OBFHELPER + private boolean eW() { +- return (Boolean) this.datawatcher.get(EntityTurtle.bB); ++ return this.datawatcher.get(EntityTurtle.bB); + } + + public final void setTravelling(boolean travelling) { this.w(travelling); } // Paper - OBFHELPER +@@ -130,7 +130,7 @@ public class EntityTurtle extends EntityAnimal { + } + + public static boolean c(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { +- return blockposition.getY() < generatoraccess.getSeaLevel() + 4 && BlockTurtleEgg.a((IBlockAccess) generatoraccess, blockposition) && generatoraccess.getLightLevel(blockposition, 0) > 8; ++ return blockposition.getY() < generatoraccess.getSeaLevel() + 4 && BlockTurtleEgg.a(generatoraccess, blockposition) && generatoraccess.getLightLevel(blockposition, 0) > 8; + } + + @Override +@@ -228,7 +228,7 @@ public class EntityTurtle extends EntityAnimal { + @Nullable + @Override + public EntityAgeable createChild(EntityAgeable entityageable) { +- return (EntityAgeable) EntityTypes.TURTLE.a(this.world); ++ return EntityTypes.TURTLE.a(this.world); + } + + @Override +@@ -238,7 +238,7 @@ public class EntityTurtle extends EntityAnimal { + + @Override + public float a(BlockPosition blockposition, IWorldReader iworldreader) { +- return !this.eV() && iworldreader.getFluid(blockposition).a((Tag) TagsFluid.WATER) ? 10.0F : (BlockTurtleEgg.a((IBlockAccess) iworldreader, blockposition) ? 10.0F : iworldreader.y(blockposition) - 0.5F); ++ return !this.eV() && iworldreader.getFluid(blockposition).a(TagsFluid.WATER) ? 10.0F : (BlockTurtleEgg.a(iworldreader, blockposition) ? 10.0F : iworldreader.y(blockposition) - 0.5F); + } + + @Override +@@ -247,7 +247,7 @@ public class EntityTurtle extends EntityAnimal { + if (this.isAlive() && this.eM() && this.bC >= 1 && this.bC % 5 == 0) { + BlockPosition blockposition = this.getChunkCoordinates(); + +- if (BlockTurtleEgg.a((IBlockAccess) this.world, blockposition)) { ++ if (BlockTurtleEgg.a(this.world, blockposition)) { + this.world.triggerEffect(2001, blockposition, Block.getCombinedId(Blocks.SAND.getBlockData())); + } + } +@@ -259,7 +259,7 @@ public class EntityTurtle extends EntityAnimal { + super.m(); + if (!this.isBaby() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) { + this.forceDrops = true; // CraftBukkit +- this.a((IMaterial) Items.SCUTE, 1); ++ this.a(Items.SCUTE, 1); + this.forceDrops = false; // CraftBukkit + } + +@@ -271,7 +271,7 @@ public class EntityTurtle extends EntityAnimal { + this.a(0.1F, vec3d); + this.move(EnumMoveType.SELF, this.getMot()); + this.setMot(this.getMot().a(0.9D)); +- if (this.getGoalTarget() == null && (!this.eV() || !this.getHomePos().a((IPosition) this.getPositionVector(), 20.0D))) { ++ if (this.getGoalTarget() == null && (!this.eV() || !this.getHomePos().a(this.getPositionVector(), 20.0D))) { + this.setMot(this.getMot().add(0.0D, -0.005D, 0.0D)); + } + } else { +@@ -335,7 +335,7 @@ public class EntityTurtle extends EntityAnimal { + private void g() { + if (this.i.isInWater()) { + this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D)); +- if (!this.i.getHomePos().a((IPosition) this.i.getPositionVector(), 16.0D)) { ++ if (!this.i.getHomePos().a(this.i.getPositionVector(), 16.0D)) { + this.i.n(Math.max(this.i.dM() / 2.0F, 0.08F)); + } + +@@ -355,7 +355,7 @@ public class EntityTurtle extends EntityAnimal { + double d0 = this.b - this.i.locX(); + double d1 = this.c - this.i.locY(); + double d2 = this.d - this.i.locZ(); +- double d3 = (double) MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); ++ double d3 = MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + + d1 /= d3; + float f = (float) (MathHelper.d(d2, d0) * 57.2957763671875D) - 90.0F; +@@ -429,12 +429,12 @@ public class EntityTurtle extends EntityAnimal { + + @Override + public boolean a() { +- return this.g.hasEgg() && this.g.getHomePos().a((IPosition) this.g.getPositionVector(), 9.0D) ? super.a() : false; ++ return this.g.hasEgg() && this.g.getHomePos().a(this.g.getPositionVector(), 9.0D) ? super.a() : false; + } + + @Override + public boolean b() { +- return super.b() && this.g.hasEgg() && this.g.getHomePos().a((IPosition) this.g.getPositionVector(), 9.0D); ++ return super.b() && this.g.hasEgg() && this.g.getHomePos().a(this.g.getPositionVector(), 9.0D); + } + + @Override +@@ -453,8 +453,8 @@ public class EntityTurtle extends EntityAnimal { + int eggCount = this.g.random.nextInt(4) + 1; + com.destroystokyo.paper.event.entity.TurtleLayEggEvent layEggEvent = new com.destroystokyo.paper.event.entity.TurtleLayEggEvent((org.bukkit.entity.Turtle) this.g.getBukkitEntity(), MCUtil.toLocation(this.g.world, this.e.up()), eggCount); + if (layEggEvent.callEvent() && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.g, this.e.up(), Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, layEggEvent.getEggCount())).isCancelled()) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_LAY_EGG, SoundCategory.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F); +- world.setTypeAndData(this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, layEggEvent.getEggCount()), 3); ++ world.playSound(null, blockposition, SoundEffects.ENTITY_TURTLE_LAY_EGG, SoundCategory.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F); ++ world.setTypeAndData(this.e.up(), Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, layEggEvent.getEggCount()), 3); + } + // CraftBukkit end + this.g.setHasEgg(false); +@@ -499,7 +499,7 @@ public class EntityTurtle extends EntityAnimal { + + if (entityplayer != null) { + entityplayer.a(StatisticList.ANIMALS_BRED); +- CriterionTriggers.o.a(entityplayer, this.animal, this.partner, (EntityAgeable) null); ++ CriterionTriggers.o.a(entityplayer, this.animal, this.partner, null); + } + + this.d.setHasEgg(true); +@@ -526,7 +526,7 @@ public class EntityTurtle extends EntityAnimal { + i(EntityTurtle entityturtle, double d0, Item item) { + this.b = entityturtle; + this.c = d0; +- this.f = Sets.newHashSet(new Item[]{item}); ++ this.f = Sets.newHashSet(item); + this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK)); + } + +@@ -536,7 +536,7 @@ public class EntityTurtle extends EntityAnimal { + --this.e; + return false; + } else { +- this.d = this.b.world.a(this.a, (EntityLiving) this.b); // CraftBukkit - decompile error ++ this.d = this.b.world.a(this.a, this.b); // CraftBukkit - decompile error + return this.d == null ? false : this.a(this.d.getItemInMainHand()) || this.a(this.d.getItemInOffHand()); + } + } +@@ -563,7 +563,7 @@ public class EntityTurtle extends EntityAnimal { + if (this.b.h((Entity) this.d) < 6.25D) { + this.b.getNavigation().o(); + } else { +- this.b.getNavigation().a((Entity) this.d, this.c); ++ this.b.getNavigation().a(this.d, this.c); + } + + } +@@ -583,7 +583,7 @@ public class EntityTurtle extends EntityAnimal { + + @Override + public boolean a() { +- return this.a.isBaby() ? false : (this.a.hasEgg() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.getHomePos().a((IPosition) this.a.getPositionVector(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.a.getBukkitEntity()).callEvent(); // Paper ++ return this.a.isBaby() ? false : (this.a.hasEgg() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.getHomePos().a(this.a.getPositionVector(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.a.getBukkitEntity()).callEvent(); // Paper + } + + @Override +@@ -600,20 +600,20 @@ public class EntityTurtle extends EntityAnimal { + + @Override + public boolean b() { +- return !this.a.getHomePos().a((IPosition) this.a.getPositionVector(), 7.0D) && !this.c && this.d <= 600; ++ return !this.a.getHomePos().a(this.a.getPositionVector(), 7.0D) && !this.c && this.d <= 600; + } + + @Override + public void e() { + BlockPosition blockposition = this.a.getHomePos(); +- boolean flag = blockposition.a((IPosition) this.a.getPositionVector(), 16.0D); ++ boolean flag = blockposition.a(this.a.getPositionVector(), 16.0D); + + if (flag) { + ++this.d; + } + + if (this.a.getNavigation().m()) { +- Vec3D vec3d = Vec3D.c((BaseBlockPosition) blockposition); ++ Vec3D vec3d = Vec3D.c(blockposition); + Vec3D vec3d1 = RandomPositionGenerator.a(this.a, 16, 3, vec3d, 0.3141592741012573D); + + if (vec3d1 == null) { +@@ -674,7 +674,7 @@ public class EntityTurtle extends EntityAnimal { + @Override + public void e() { + if (this.a.getNavigation().m()) { +- Vec3D vec3d = Vec3D.c((BaseBlockPosition) this.a.getTravelPos()); ++ Vec3D vec3d = Vec3D.c(this.a.getTravelPos()); + Vec3D vec3d1 = RandomPositionGenerator.a(this.a, 16, 3, vec3d, 0.3141592741012573D); + + if (vec3d1 == null) { +@@ -727,9 +727,9 @@ public class EntityTurtle extends EntityAnimal { + BlockPosition blockposition = this.a(this.a.world, this.a, 7, 4); + + if (blockposition != null) { +- this.c = (double) blockposition.getX(); +- this.d = (double) blockposition.getY(); +- this.e = (double) blockposition.getZ(); ++ this.c = blockposition.getX(); ++ this.d = blockposition.getY(); ++ this.e = blockposition.getZ(); + return true; + } else { + return this.g(); +diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java +index 85c784ceea900d65de136da8c7ac718f26127456..b5080e45a85b5f87421da5f825b5f4a8ba7093dd 100644 +--- a/src/main/java/net/minecraft/server/EntityTypes.java ++++ b/src/main/java/net/minecraft/server/EntityTypes.java +@@ -192,7 +192,7 @@ public class EntityTypes { + double d0; + + if (flag) { +- t0.setPosition((double) blockposition.getX() + 0.5D, (double) (blockposition.getY() + 1), (double) blockposition.getZ() + 0.5D); ++ t0.setPosition((double) blockposition.getX() + 0.5D, blockposition.getY() + 1, (double) blockposition.getZ() + 0.5D); + d0 = a(world, blockposition, flag1, t0.getBoundingBox()); + } else { + d0 = 0.0D; +@@ -204,7 +204,7 @@ public class EntityTypes { + + entityinsentient.aJ = entityinsentient.yaw; + entityinsentient.aH = entityinsentient.yaw; +- entityinsentient.prepare(world, world.getDamageScaler(entityinsentient.getChunkCoordinates()), enummobspawn, (GroupDataEntity) null, nbttagcompound); ++ entityinsentient.prepare(world, world.getDamageScaler(entityinsentient.getChunkCoordinates()), enummobspawn, null, nbttagcompound); + entityinsentient.F(); + } + +@@ -224,7 +224,7 @@ public class EntityTypes { + axisalignedbb1 = axisalignedbb1.b(0.0D, -1.0D, 0.0D); + } + +- Stream stream = iworldreader.d((Entity) null, axisalignedbb1, (entity) -> { ++ Stream stream = iworldreader.d(null, axisalignedbb1, (entity) -> { + return true; + }); + +@@ -330,7 +330,7 @@ public class EntityTypes { + } + + public boolean a(IBlockData iblockdata) { +- return this.bg.contains(iblockdata.getBlock()) ? false : (!this.bj && (iblockdata.a((Tag) TagsBlock.FIRE) || iblockdata.a(Blocks.MAGMA_BLOCK) || BlockCampfire.g(iblockdata) || iblockdata.a(Blocks.LAVA)) ? true : iblockdata.a(Blocks.WITHER_ROSE) || iblockdata.a(Blocks.SWEET_BERRY_BUSH) || iblockdata.a(Blocks.CACTUS)); ++ return this.bg.contains(iblockdata.getBlock()) ? false : (!this.bj && (iblockdata.a(TagsBlock.FIRE) || iblockdata.a(Blocks.MAGMA_BLOCK) || BlockCampfire.g(iblockdata) || iblockdata.a(Blocks.LAVA)) ? true : iblockdata.a(Blocks.WITHER_ROSE) || iblockdata.a(Blocks.SWEET_BERRY_BUSH) || iblockdata.a(Blocks.CACTUS)); + } + + public EntitySize l() { +@@ -343,7 +343,7 @@ public class EntityTypes { + + @Nullable + public static Entity a(NBTTagCompound nbttagcompound, World world, Function function) { +- return (Entity) b(nbttagcompound, world).map(function).map((entity) -> { ++ return b(nbttagcompound, world).map(function).map((entity) -> { + if (nbttagcompound.hasKeyOfType("Passengers", 9)) { + NBTTagList nbttaglist = nbttagcompound.getList("Passengers", 10); + +diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java +index 3af1ad56464ee6d0c43f8a2fcba993e398036829..f8aeba39f403ec21984ea3561b3ca069d5e057ca 100644 +--- a/src/main/java/net/minecraft/server/EntityVex.java ++++ b/src/main/java/net/minecraft/server/EntityVex.java +@@ -105,13 +105,13 @@ public class EntityVex extends EntityMonster { + } + + private boolean b(int i) { +- byte b0 = (Byte) this.datawatcher.get(EntityVex.b); ++ byte b0 = this.datawatcher.get(EntityVex.b); + + return (b0 & i) != 0; + } + + private void a(int i, boolean flag) { +- byte b0 = (Byte) this.datawatcher.get(EntityVex.b); ++ byte b0 = this.datawatcher.get(EntityVex.b); + int j; + + if (flag) { +diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java +index 52bab44807674a5f7aee105d015f639b8aef9829..796c58552c99ab457264d92c81af96f87a257784 100644 +--- a/src/main/java/net/minecraft/server/EntityVillager.java ++++ b/src/main/java/net/minecraft/server/EntityVillager.java +@@ -27,7 +27,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + private boolean simplerVillagerBehavior = YatopiaConfig.simplerVillagerBehavior; //get this during villager creation so a reloaded config doesn't get them into an invalid state + private static final DataWatcherObject by = DataWatcher.a(EntityVillager.class, DataWatcherRegistry.q); + public static final Map bw = ImmutableMap.of(Items.BREAD, 4, Items.POTATO, 1, Items.CARROT, 1, Items.BEETROOT, 1); +- private static final Set bz = ImmutableSet.of(Items.BREAD, Items.POTATO, Items.CARROT, Items.WHEAT, Items.WHEAT_SEEDS, Items.BEETROOT, new Item[]{Items.BEETROOT_SEEDS}); ++ private static final Set bz = ImmutableSet.of(Items.BREAD, Items.POTATO, Items.CARROT, Items.WHEAT, Items.WHEAT_SEEDS, Items.BEETROOT, Items.BEETROOT_SEEDS); + private int bA; + private boolean bB; + @Nullable +@@ -41,7 +41,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + private int bK; public int getRestocksToday(){ return this.bK; } public void setRestocksToday(int restocksToday){ this.bK = restocksToday; } // Paper OBFHELPER + private long bL; + private boolean bM; +- private static final ImmutableList> bN = ImmutableList.of(MemoryModuleType.HOME, MemoryModuleType.JOB_SITE, MemoryModuleType.POTENTIAL_JOB_SITE, MemoryModuleType.MEETING_POINT, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.VISIBLE_VILLAGER_BABIES, MemoryModuleType.NEAREST_PLAYERS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.WALK_TARGET, new MemoryModuleType[]{MemoryModuleType.LOOK_TARGET, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.BREED_TARGET, MemoryModuleType.PATH, MemoryModuleType.INTERACTABLE_DOORS, MemoryModuleType.OPENED_DOORS, MemoryModuleType.NEAREST_BED, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.NEAREST_HOSTILE, MemoryModuleType.SECONDARY_JOB_SITE, MemoryModuleType.HIDING_PLACE, MemoryModuleType.HEARD_BELL_TIME, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.LAST_SLEPT, MemoryModuleType.LAST_WOKEN, MemoryModuleType.LAST_WORKED_AT_POI, MemoryModuleType.GOLEM_LAST_SEEN_TIME}); ++ private static final ImmutableList> bN = ImmutableList.of(MemoryModuleType.HOME, MemoryModuleType.JOB_SITE, MemoryModuleType.POTENTIAL_JOB_SITE, MemoryModuleType.MEETING_POINT, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.VISIBLE_VILLAGER_BABIES, MemoryModuleType.NEAREST_PLAYERS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.WALK_TARGET, MemoryModuleType.LOOK_TARGET, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.BREED_TARGET, MemoryModuleType.PATH, MemoryModuleType.INTERACTABLE_DOORS, MemoryModuleType.OPENED_DOORS, MemoryModuleType.NEAREST_BED, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.NEAREST_HOSTILE, MemoryModuleType.SECONDARY_JOB_SITE, MemoryModuleType.HIDING_PLACE, MemoryModuleType.HEARD_BELL_TIME, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.LAST_SLEPT, MemoryModuleType.LAST_WOKEN, MemoryModuleType.LAST_WORKED_AT_POI, MemoryModuleType.GOLEM_LAST_SEEN_TIME); + private static final ImmutableList>> bO = ImmutableList.of(SensorType.c, SensorType.d, SensorType.b, SensorType.e, SensorType.f, SensorType.g, SensorType.h, SensorType.i, SensorType.j, SensorType.k); + public static final Map, BiPredicate> bx = ImmutableMap.of(MemoryModuleType.HOME, (entityvillager, villageplacetype) -> { + return villageplacetype == VillagePlaceType.r; +@@ -112,7 +112,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + + @Override + protected BehaviorController.b cJ() { +- return BehaviorController.a((Collection) EntityVillager.bN, (Collection) EntityVillager.bO); ++ return BehaviorController.a(EntityVillager.bN, (Collection) EntityVillager.bO); + } + + @Override +@@ -140,18 +140,18 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + behaviorcontroller.a(Activity.PLAY, Behaviors.a(0.5F)); + } else { + behaviorcontroller.setSchedule(Schedule.VILLAGER_DEFAULT); +- behaviorcontroller.a(Activity.WORK, Behaviors.b(villagerprofession, 0.5F), (Set) ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))); ++ behaviorcontroller.a(Activity.WORK, Behaviors.b(villagerprofession, 0.5F), ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))); + } + + behaviorcontroller.a(Activity.CORE, Behaviors.a(villagerprofession, 0.5F)); +- behaviorcontroller.a(Activity.MEET, Behaviors.d(villagerprofession, 0.5F), (Set) ImmutableSet.of(Pair.of(MemoryModuleType.MEETING_POINT, MemoryStatus.VALUE_PRESENT))); ++ behaviorcontroller.a(Activity.MEET, Behaviors.d(villagerprofession, 0.5F), ImmutableSet.of(Pair.of(MemoryModuleType.MEETING_POINT, MemoryStatus.VALUE_PRESENT))); + behaviorcontroller.a(Activity.REST, Behaviors.c(villagerprofession, 0.5F)); + behaviorcontroller.a(Activity.IDLE, Behaviors.e(villagerprofession, 0.5F)); + behaviorcontroller.a(Activity.PANIC, Behaviors.f(villagerprofession, 0.5F)); + behaviorcontroller.a(Activity.PRE_RAID, Behaviors.g(villagerprofession, 0.5F)); + behaviorcontroller.a(Activity.RAID, Behaviors.h(villagerprofession, 0.5F)); + behaviorcontroller.a(Activity.HIDE, Behaviors.i(villagerprofession, 0.5F)); +- behaviorcontroller.a((Set) ImmutableSet.of(Activity.CORE)); ++ behaviorcontroller.a(ImmutableSet.of(Activity.CORE)); + behaviorcontroller.b(Activity.IDLE); + behaviorcontroller.a(Activity.IDLE); + behaviorcontroller.a(this.world.getDayTime(), this.world.getTime()); +@@ -254,7 +254,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + } + + if (this.bC != null && this.world instanceof WorldServer) { +- ((WorldServer) this.world).a(ReputationEvent.e, (Entity) this.bC, (ReputationHandler) this); ++ ((WorldServer) this.world).a(ReputationEvent.e, this.bC, this); + this.world.broadcastEntityEffect(this, (byte) 14); + this.bC = null; + } +@@ -502,7 +502,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + public void saveData(NBTTagCompound nbttagcompound) { + super.saveData(nbttagcompound); + DataResult dataresult = VillagerData.a.encodeStart(DynamicOpsNBT.a, this.getVillagerData()); // CraftBukkit - decompile error +- Logger logger = EntityVillager.LOGGER; ++ Logger logger = Entity.LOGGER; + + logger.getClass(); + dataresult.resultOrPartial(logger::error).ifPresent((nbtbase) -> { +@@ -525,7 +525,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + super.loadData(nbttagcompound); + if (nbttagcompound.hasKeyOfType("VillagerData", 10)) { + DataResult dataresult = VillagerData.a.parse(new Dynamic(DynamicOpsNBT.a, nbttagcompound.get("VillagerData"))); +- Logger logger = EntityVillager.LOGGER; ++ Logger logger = Entity.LOGGER; + + logger.getClass(); + dataresult.resultOrPartial(logger::error).ifPresent(this::setVillagerData); +@@ -602,7 +602,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + + @Override + public VillagerData getVillagerData() { +- return (VillagerData) this.datawatcher.get(EntityVillager.by); ++ return this.datawatcher.get(EntityVillager.by); + } + + @Override +@@ -626,7 +626,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + @Override + public void setLastDamager(@Nullable EntityLiving entityliving) { + if (entityliving != null && this.world instanceof WorldServer) { +- ((WorldServer) this.world).a(ReputationEvent.c, (Entity) entityliving, (ReputationHandler) this); ++ ((WorldServer) this.world).a(ReputationEvent.c, entityliving, this); + if (this.isAlive() && entityliving instanceof EntityHuman) { + this.world.broadcastEntityEffect(this, (byte) 13); + } +@@ -637,7 +637,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + + @Override + public void die(DamageSource damagesource) { +- if (org.spigotmc.SpigotConfig.logVillagerDeaths) EntityVillager.LOGGER.info("Villager {} died, message: '{}'", this, damagesource.getLocalizedDeathMessage(this).getString()); // Spigot ++ if (org.spigotmc.SpigotConfig.logVillagerDeaths) Entity.LOGGER.info("Villager {} died, message: '{}'", this, damagesource.getLocalizedDeathMessage(this).getString()); // Spigot + Entity entity = damagesource.getEntity(); + + if (entity != null) { +@@ -687,7 +687,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + if (worldserver != null) { + VillagePlace villageplace = worldserver.x(); + Optional optional = villageplace.c(globalpos.getBlockPosition()); +- BiPredicate bipredicate = (BiPredicate) EntityVillager.bx.get(memorymoduletype); ++ BiPredicate bipredicate = EntityVillager.bx.get(memorymoduletype); + + if (optional.isPresent() && bipredicate.test(this, optional.get())) { + villageplace.b(globalpos.getBlockPosition()); +@@ -714,7 +714,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + ItemStack itemstack = this.getInventory().getItem(i); + + if (!itemstack.isEmpty()) { +- Integer integer = (Integer) EntityVillager.bw.get(itemstack.getItem()); ++ Integer integer = EntityVillager.bw.get(itemstack.getItem()); + + if (integer != null) { + int j = itemstack.getCount(); +@@ -801,15 +801,15 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + + EntityVillager entityvillager = new EntityVillager(EntityTypes.VILLAGER, this.world, villagertype); + +- entityvillager.prepare(this.world, this.world.getDamageScaler(entityvillager.getChunkCoordinates()), EnumMobSpawn.BREEDING, (GroupDataEntity) null, (NBTTagCompound) null); ++ entityvillager.prepare(this.world, this.world.getDamageScaler(entityvillager.getChunkCoordinates()), EnumMobSpawn.BREEDING, null, null); + return entityvillager; + } + + @Override + public void onLightningStrike(EntityLightning entitylightning) { + if (this.world.getDifficulty() != EnumDifficulty.PEACEFUL) { +- EntityVillager.LOGGER.info("Villager {} was struck by lightning {}.", this, entitylightning); +- EntityWitch entitywitch = (EntityWitch) EntityTypes.WITCH.a(this.world); ++ Entity.LOGGER.info("Villager {} was struck by lightning {}.", this, entitylightning); ++ EntityWitch entitywitch = EntityTypes.WITCH.a(this.world); + + // Paper start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) { +@@ -818,7 +818,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + // Paper end + + entitywitch.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch); +- entitywitch.prepare(this.world, this.world.getDamageScaler(entitywitch.getChunkCoordinates()), EnumMobSpawn.CONVERSION, (GroupDataEntity) null, (NBTTagCompound) null); ++ entitywitch.prepare(this.world, this.world.getDamageScaler(entitywitch.getChunkCoordinates()), EnumMobSpawn.CONVERSION, null, null); + entitywitch.setNoAI(this.isNoAI()); + if (this.hasCustomName()) { + entitywitch.setCustomName(this.getCustomName()); +@@ -892,16 +892,16 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + } + + public boolean canPlant() { +- return this.getInventory().a((Set) ImmutableSet.of(Items.WHEAT_SEEDS, Items.POTATO, Items.CARROT, Items.BEETROOT_SEEDS)); ++ return this.getInventory().a(ImmutableSet.of(Items.WHEAT_SEEDS, Items.POTATO, Items.CARROT, Items.BEETROOT_SEEDS)); + } + + @Override + protected void eW() { + VillagerData villagerdata = this.getVillagerData(); +- Int2ObjectMap int2objectmap = (Int2ObjectMap) VillagerTrades.a.get(villagerdata.getProfession()); ++ Int2ObjectMap int2objectmap = VillagerTrades.a.get(villagerdata.getProfession()); + + if (int2objectmap != null && !int2objectmap.isEmpty()) { +- VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption = (VillagerTrades.IMerchantRecipeOption[]) int2objectmap.get(villagerdata.getLevel()); ++ VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption = int2objectmap.get(villagerdata.getLevel()); + + if (avillagertrades_imerchantrecipeoption != null) { + MerchantRecipeList merchantrecipelist = this.getOffers(); +@@ -944,7 +944,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + result.add(entityVillager); + } + } +- List list1 = (List) result; ++ List list1 = result; + + if (list1.size() >= j) { + EntityIronGolem entityirongolem = this.fw(); +@@ -968,7 +968,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + if (!optional.isPresent()) { + return false; + } else { +- Long olong = (Long) optional.get(); ++ Long olong = optional.get(); + + return i - olong <= 600L; + } +@@ -983,15 +983,15 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + BlockPosition blockposition = this.getChunkCoordinates(); + + for (int i = 0; i < 10; ++i) { +- double d0 = (double) (this.world.random.nextInt(16) - 8); +- double d1 = (double) (this.world.random.nextInt(16) - 8); ++ double d0 = this.world.random.nextInt(16) - 8; ++ double d1 = this.world.random.nextInt(16) - 8; + BlockPosition blockposition1 = this.a(blockposition, d0, d1); + + if (blockposition1 != null) { +- EntityIronGolem entityirongolem = (EntityIronGolem) EntityTypes.IRON_GOLEM.createCreature(this.world, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition1, EnumMobSpawn.MOB_SUMMONED, false, false); ++ EntityIronGolem entityirongolem = EntityTypes.IRON_GOLEM.createCreature(this.world, null, null, null, blockposition1, EnumMobSpawn.MOB_SUMMONED, false, false); + + if (entityirongolem != null) { +- if (entityirongolem.a((GeneratorAccess) this.world, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) this.world)) { ++ if (entityirongolem.a(this.world, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) this.world)) { + this.world.addEntity(entityirongolem, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.VILLAGE_DEFENSE); // CraftBukkit + return entityirongolem; + } +@@ -1065,7 +1065,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + @Override + protected void M() { + super.M(); +- PacketDebug.a((EntityLiving) this); ++ PacketDebug.a(this); + } + + @Override +@@ -1085,6 +1085,6 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + private boolean d(long i) { + Optional optional = this.bn.getMemory(MemoryModuleType.LAST_SLEPT); + +- return optional.isPresent() ? i - (Long) optional.get() < 24000L : false; ++ return optional.isPresent() ? i - optional.get() < 24000L : false; + } + } +diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java +index c15feba3c54c5b8610f16cceada91cf9077a8701..2fa2503d530cab6b0dad4fc3a7f66205373786c3 100644 +--- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java ++++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java +@@ -42,12 +42,12 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP + ((EntityAgeable.a) groupdataentity).a(false); + } + +- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); ++ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } + + public final int getUnhappy() { return eL(); } // Paper - OBFHELPER + public int eL() { +- return (Integer) this.datawatcher.get(EntityVillagerAbstract.bw); ++ return this.datawatcher.get(EntityVillagerAbstract.bw); + } + + public final void setUnhappy(int i) { s(i); } // Paper - OBFHELPER +@@ -169,7 +169,7 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP + } + + protected void eT() { +- this.setTradingPlayer((EntityHuman) null); ++ this.setTradingPlayer(null); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java +index 3116488509862fc82b0b9172957af812d96bcf80..5348684debe76188c668b5699c503bedd88549c1 100644 +--- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java ++++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java +@@ -83,8 +83,8 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { + + @Override + protected void eW() { +- VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption = (VillagerTrades.IMerchantRecipeOption[]) VillagerTrades.b.get(1); +- VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption1 = (VillagerTrades.IMerchantRecipeOption[]) VillagerTrades.b.get(2); ++ VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption = VillagerTrades.b.get(1); ++ VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption1 = VillagerTrades.b.get(2); + + if (avillagertrades_imerchantrecipeoption != null && avillagertrades_imerchantrecipeoption1 != null) { + MerchantRecipeList merchantrecipelist = this.getOffers(); +@@ -251,14 +251,14 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { + + EntityVillagerTrader.this.navigation.a(vec3d1.x, vec3d1.y, vec3d1.z, this.c); + } else { +- EntityVillagerTrader.this.navigation.a((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), this.c); ++ EntityVillagerTrader.this.navigation.a(blockposition.getX(), blockposition.getY(), blockposition.getZ(), this.c); + } + } + + } + + private boolean a(BlockPosition blockposition, double d0) { +- return !blockposition.a((IPosition) this.a.getPositionVector(), d0); ++ return !blockposition.a(this.a.getPositionVector(), d0); + } + } + } +diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java +index 66851778820759547f17288dc82ec58114592257..e810420951f0ee00699a2a1f46d68ed27e71ede0 100644 +--- a/src/main/java/net/minecraft/server/EntityVindicator.java ++++ b/src/main/java/net/minecraft/server/EntityVindicator.java +@@ -142,7 +142,7 @@ public class EntityVindicator extends EntityIllagerAbstract { + Map map = Maps.newHashMap(); + + map.put(Enchantments.DAMAGE_ALL, Integer.valueOf(b0)); +- EnchantmentManager.a((Map) map, itemstack); ++ EnchantmentManager.a(map, itemstack); + } + + this.setSlot(EnumItemSlot.MAINHAND, itemstack); +@@ -205,7 +205,7 @@ public class EntityVindicator extends EntityIllagerAbstract { + if (this.a.getVehicle() instanceof EntityRavager) { + float f = this.a.getVehicle().getWidth() - 0.1F; + +- return (double) (f * 2.0F * f * 2.0F + entityliving.getWidth()); ++ return f * 2.0F * f * 2.0F + entityliving.getWidth(); + } else { + return super.a(entityliving); + } +diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java +index 32ff8f7dbe910ae9457e73fa75aaa749103cb6cb..b15a1a590accfaaa2f62a25f08643da566a5f618 100644 +--- a/src/main/java/net/minecraft/server/EntityWitch.java ++++ b/src/main/java/net/minecraft/server/EntityWitch.java +@@ -36,7 +36,7 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { + this.goalSelector.a(2, new PathfinderGoalRandomStrollLand(this, 1.0D)); + this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(3, new PathfinderGoalRandomLookaround(this)); +- this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})); ++ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, EntityRaider.class)); + this.targetSelector.a(2, this.by); + this.targetSelector.a(3, this.bz); + } +@@ -69,7 +69,7 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { + + public boolean isDrinkingPotion() { return m(); } // Paper - OBFHELPER + public boolean m() { +- return (Boolean) this.getDataWatcher().get(EntityWitch.bw); ++ return this.getDataWatcher().get(EntityWitch.bw); + } + + public static AttributeProvider.Builder eL() { +@@ -115,7 +115,7 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { + } else { + PotionRegistry potionregistry = null; + +- if (this.random.nextFloat() < 0.15F && this.a((Tag) TagsFluid.WATER) && !this.hasEffect(MobEffects.WATER_BREATHING)) { ++ if (this.random.nextFloat() < 0.15F && this.a(TagsFluid.WATER) && !this.hasEffect(MobEffects.WATER_BREATHING)) { + potionregistry = Potions.WATER_BREATHING; + } else if (this.random.nextFloat() < 0.15F && (this.isBurning() || this.dl() != null && this.dl().isFire()) && !this.hasEffect(MobEffects.FIRE_RESISTANCE)) { + potionregistry = Potions.FIRE_RESISTANCE; +@@ -159,7 +159,7 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { + setPotionUseTimeLeft(getItemInMainHand().getItemUseMaxDuration()); + setDrinkingPotion(true); + if (!this.isSilent()) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); + } + AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); + attributemodifiable.removeModifier(EntityWitch.bv); +@@ -203,7 +203,7 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { + potionregistry = Potions.REGENERATION; + } + +- this.setGoalTarget((EntityLiving) null); ++ this.setGoalTarget(null); + } else if (f1 >= 8.0F && !entityliving.hasEffect(MobEffects.SLOWER_MOVEMENT)) { + potionregistry = Potions.SLOWNESS; + } else if (entityliving.getHealth() >= 8.0F && !entityliving.hasEffect(MobEffects.POISON)) { +@@ -225,7 +225,7 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { + entitypotion.pitch -= -20.0F; + entitypotion.shoot(d0, d1 + (double) (f1 * 0.2F), d2, 0.75F, 8.0F); + if (!this.isSilent()) { +- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_THROW, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); ++ this.world.playSound(null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_THROW, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); + } + + this.world.addEntity(entitypotion); +diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java +index 8c7bfe19f95cc757397bc496087df8dcd88351c4..bb7768f984d4ad7e818e1d5f1c1b78d1c084da15 100644 +--- a/src/main/java/net/minecraft/server/EntityWither.java ++++ b/src/main/java/net/minecraft/server/EntityWither.java +@@ -47,7 +47,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D)); + this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this)); +- this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0])); ++ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this)); + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityInsentient.class, 0, false, false, EntityWither.bF)); + } + +@@ -154,7 +154,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + double d4 = entity1.locX() - d1; + double d5 = entity1.getHeadY() - d2; + double d6 = entity1.locZ() - d3; +- double d7 = (double) MathHelper.sqrt(d4 * d4 + d6 * d6); ++ double d7 = MathHelper.sqrt(d4 * d4 + d6 * d6); + float f = (float) (MathHelper.d(d6, d4) * 57.2957763671875D) - 90.0F; + float f1 = (float) (-(MathHelper.d(d5, d7) * 57.2957763671875D)); + +@@ -207,7 +207,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + if (!this.isSilent()) { + // CraftBukkit start - Use relative location for far away sounds + // this.world.b(1023, new BlockPosition(this), 0); +- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API ++ int viewDistance = this.world.getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API + for (EntityPlayer player : (List)this.world.getPlayers()) { + // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch + double deltaX = this.locX() - player.locX(); +@@ -276,7 +276,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + List list = this.world.a(EntityLiving.class, EntityWither.bG, this, this.getBoundingBox().grow(20.0D, 8.0D, 20.0D)); + + for (int i1 = 0; i1 < 10 && !list.isEmpty(); ++i1) { +- EntityLiving entityliving = (EntityLiving) list.get(this.random.nextInt(list.size())); ++ EntityLiving entityliving = list.get(this.random.nextInt(list.size())); + + if (entityliving != this && entityliving.isAlive() && this.hasLineOfSight(entityliving)) { + if (entityliving instanceof EntityHuman) { +@@ -333,7 +333,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + } + + if (flag) { +- this.world.a((EntityHuman) null, 1022, this.getChunkCoordinates(), 0); ++ this.world.a(null, 1022, this.getChunkCoordinates(), 0); + } + } + } +@@ -416,7 +416,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + + private void a(int i, double d0, double d1, double d2, boolean flag) { + if (!this.isSilent()) { +- this.world.a((EntityHuman) null, 1024, this.getChunkCoordinates(), 0); ++ this.world.a(null, 1024, this.getChunkCoordinates(), 0); + } + + double d3 = this.u(i); +@@ -513,7 +513,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + } + + public int getInvul() { +- return (Integer) this.datawatcher.get(EntityWither.bw); ++ return this.datawatcher.get(EntityWither.bw); + } + + public void setInvul(int i) { +@@ -525,7 +525,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + } + + public void setHeadTarget(int i, int j) { +- this.datawatcher.set((DataWatcherObject) EntityWither.bv.get(i), j); ++ this.datawatcher.set(EntityWither.bv.get(i), j); + } + + public boolean T_() { +diff --git a/src/main/java/net/minecraft/server/EntityWitherSkull.java b/src/main/java/net/minecraft/server/EntityWitherSkull.java +index 3839e63b7981f7d6225e9ade7f0be21427ffa8e9..4e2a58572f715176975684cc12274a9d49699ffa 100644 +--- a/src/main/java/net/minecraft/server/EntityWitherSkull.java ++++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java +@@ -105,7 +105,7 @@ public class EntityWitherSkull extends EntityFireball { + } + + public boolean isCharged() { +- return (Boolean) this.datawatcher.get(EntityWitherSkull.e); ++ return this.datawatcher.get(EntityWitherSkull.e); + } + + public void setCharged(boolean flag) { +diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java +index 5f8a74a433fe69eb5eb528663e290279cf3239f4..23455d071f06b56abd824b56d3abc8ba3b7b8228 100644 +--- a/src/main/java/net/minecraft/server/EntityWolf.java ++++ b/src/main/java/net/minecraft/server/EntityWolf.java +@@ -182,7 +182,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + float f1 = (this.random.nextFloat() * 2.0F - 1.0F) * this.getWidth() * 0.5F; + float f2 = (this.random.nextFloat() * 2.0F - 1.0F) * this.getWidth() * 0.5F; + +- this.world.addParticle(Particles.SPLASH, this.locX() + (double) f1, (double) (f + 0.8F), this.locZ() + (double) f2, vec3d.x, vec3d.y, vec3d.z); ++ this.world.addParticle(Particles.SPLASH, this.locX() + (double) f1, f + 0.8F, this.locZ() + (double) f2, vec3d.x, vec3d.y, vec3d.z); + } + } + } +@@ -230,7 +230,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + boolean flag = entity.damageEntity(DamageSource.mobAttack(this), (float) ((int) this.b(GenericAttributes.ATTACK_DAMAGE))); + + if (flag) { +- this.a((EntityLiving) this, entity); ++ this.a(this, entity); + } + + return flag; +@@ -255,7 +255,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + Item item = itemstack.getItem(); + + if (this.world.isClientSide) { +- boolean flag = this.j((EntityLiving) entityhuman) || this.isTamed() || item == Items.BONE && !this.isTamed() && !this.isAngry(); ++ boolean flag = this.j(entityhuman) || this.isTamed() || item == Items.BONE && !this.isTamed() && !this.isAngry(); + + return flag ? EnumInteractionResult.CONSUME : EnumInteractionResult.PASS; + } else { +@@ -272,11 +272,11 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + if (!(item instanceof ItemDye)) { + EnumInteractionResult enuminteractionresult = super.b(entityhuman, enumhand); + +- if ((!enuminteractionresult.a() || this.isBaby()) && this.j((EntityLiving) entityhuman)) { ++ if ((!enuminteractionresult.a() || this.isBaby()) && this.j(entityhuman)) { + this.setWillSit(!this.isWillSit()); + this.jumping = false; + this.navigation.o(); +- this.setGoalTarget((EntityLiving) null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason ++ this.setGoalTarget(null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason + return EnumInteractionResult.SUCCESS; + } + +@@ -302,7 +302,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { + this.tame(entityhuman); + this.navigation.o(); +- this.setGoalTarget((EntityLiving) null); ++ this.setGoalTarget(null); + this.setWillSit(true); + this.world.broadcastEntityEffect(this, (byte) 7); + } else { +@@ -330,7 +330,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + + @Override + public int getAnger() { +- return (Integer) this.datawatcher.get(EntityWolf.bA); ++ return this.datawatcher.get(EntityWolf.bA); + } + + @Override +@@ -355,7 +355,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + } + + public EnumColor getCollarColor() { +- return EnumColor.fromColorIndex((Integer) this.datawatcher.get(EntityWolf.bz)); ++ return EnumColor.fromColorIndex(this.datawatcher.get(EntityWolf.bz)); + } + + public void setCollarColor(EnumColor enumcolor) { +@@ -364,7 +364,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + + @Override + public EntityWolf createChild(EntityAgeable entityageable) { +- EntityWolf entitywolf = (EntityWolf) EntityTypes.WOLF.a(this.world); ++ EntityWolf entitywolf = EntityTypes.WOLF.a(this.world); + UUID uuid = this.getOwnerUUID(); + + if (uuid != null) { +@@ -395,7 +395,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + } + + public boolean eZ() { +- return (Boolean) this.datawatcher.get(EntityWolf.by); ++ return this.datawatcher.get(EntityWolf.by); + } + + @Override +@@ -438,13 +438,13 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + + @Override + public void c() { +- EntityWolf.this.setGoalTarget((EntityLiving) null); ++ EntityWolf.this.setGoalTarget(null); + super.c(); + } + + @Override + public void e() { +- EntityWolf.this.setGoalTarget((EntityLiving) null); ++ EntityWolf.this.setGoalTarget(null); + super.e(); + } + } +diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java +index e18a2b7b25bd6b30e73ce675849520c1250833dd..28270f7a71553bee98bc51a7d1ff9b13071669a3 100644 +--- a/src/main/java/net/minecraft/server/EntityZombie.java ++++ b/src/main/java/net/minecraft/server/EntityZombie.java +@@ -75,7 +75,7 @@ public class EntityZombie extends EntityMonster { + } + + public boolean isDrownConverting() { +- return (Boolean) this.getDataWatcher().get(EntityZombie.DROWN_CONVERTING); ++ return this.getDataWatcher().get(EntityZombie.DROWN_CONVERTING); + } + + public boolean eV() { +@@ -90,11 +90,11 @@ public class EntityZombie extends EntityMonster { + if (flag) { + this.goalSelector.a(1, this.by); + } else { +- this.goalSelector.a((PathfinderGoal) this.by); ++ this.goalSelector.a(this.by); + } + } + } else if (this.bz) { +- this.goalSelector.a((PathfinderGoal) this.by); ++ this.goalSelector.a(this.by); + this.bz = false; + } + +@@ -106,7 +106,7 @@ public class EntityZombie extends EntityMonster { + + @Override + public boolean isBaby() { +- return (Boolean) this.getDataWatcher().get(EntityZombie.d); ++ return this.getDataWatcher().get(EntityZombie.d); + } + + @Override +@@ -156,7 +156,7 @@ public class EntityZombie extends EntityMonster { + this.eQ(); + } + } else if (this.eO()) { +- if (this.a((Tag) TagsFluid.WATER)) { ++ if (this.a(TagsFluid.WATER)) { + ++this.bA; + if (this.bA >= 600) { + this.startDrownedConversion(300); +@@ -217,13 +217,13 @@ public class EntityZombie extends EntityMonster { + protected void eQ() { + this.c(EntityTypes.DROWNED); + if (!this.isSilent()) { +- this.world.a((EntityHuman) null, 1040, this.getChunkCoordinates(), 0); ++ this.world.a(null, 1040, this.getChunkCoordinates(), 0); + } + + } + + protected void c(EntityTypes entitytypes) { +- EntityZombie entityzombie = (EntityZombie) this.b(entitytypes); ++ EntityZombie entityzombie = this.b(entitytypes); + + if (entityzombie != null) { + entityzombie.u(entityzombie.world.getDamageScaler(entityzombie.getChunkCoordinates()).d()); +@@ -267,12 +267,12 @@ public class EntityZombie extends EntityMonster { + EntityTypes entitytypes = entityzombie.getEntityType(); + EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(entitytypes); + +- if (SpawnerCreature.a(entitypositiontypes_surface, (IWorldReader) this.world, blockposition, entitytypes) && EntityPositionTypes.a(entitytypes, this.world, EnumMobSpawn.REINFORCEMENT, blockposition, this.world.random)) { +- entityzombie.setPosition((double) i1, (double) j1, (double) k1); +- if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.i(entityzombie) && this.world.getCubes(entityzombie) && !this.world.containsLiquid(entityzombie.getBoundingBox())) { ++ if (SpawnerCreature.a(entitypositiontypes_surface, this.world, blockposition, entitytypes) && EntityPositionTypes.a(entitytypes, this.world, EnumMobSpawn.REINFORCEMENT, blockposition, this.world.random)) { ++ entityzombie.setPosition(i1, j1, k1); ++ if (!this.world.isPlayerNearby(i1, j1, k1, 7.0D) && this.world.i(entityzombie) && this.world.getCubes(entityzombie) && !this.world.containsLiquid(entityzombie.getBoundingBox())) { + this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit + entityzombie.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.REINFORCEMENT_TARGET, true); // CraftBukkit +- entityzombie.prepare(this.world, this.world.getDamageScaler(entityzombie.getChunkCoordinates()), EnumMobSpawn.REINFORCEMENT, (GroupDataEntity) null, (NBTTagCompound) null); ++ entityzombie.prepare(this.world, this.world.getDamageScaler(entityzombie.getChunkCoordinates()), EnumMobSpawn.REINFORCEMENT, null, null); + this.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).addModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION)); + entityzombie.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).addModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION)); + break; +@@ -398,11 +398,11 @@ public class EntityZombie extends EntityMonster { + } // Paper end + + EntityVillager entityvillager = (EntityVillager) entityliving; +- EntityZombieVillager entityzombievillager = (EntityZombieVillager) EntityTypes.ZOMBIE_VILLAGER.a(this.world); ++ EntityZombieVillager entityzombievillager = EntityTypes.ZOMBIE_VILLAGER.a(this.world); + + entityzombievillager.u(entityvillager); + // entityvillager.die(); // CraftBukkit - moved down +- entityzombievillager.prepare(this.world, this.world.getDamageScaler(entityzombievillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false, true), (NBTTagCompound) null); ++ entityzombievillager.prepare(this.world, this.world.getDamageScaler(entityzombievillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false, true), null); + entityzombievillager.setVillagerData(entityvillager.getVillagerData()); + entityzombievillager.a((NBTBase) entityvillager.fj().a((DynamicOps) DynamicOpsNBT.a).getValue()); + entityzombievillager.setOffers(entityvillager.getOffers().a()); +@@ -428,7 +428,7 @@ public class EntityZombie extends EntityMonster { + this.world.addEntity(entityzombievillager, CreatureSpawnEvent.SpawnReason.INFECTION); // CraftBukkit - add SpawnReason + // CraftBukkit end + if (!this.isSilent()) { +- this.world.a((EntityHuman) null, 1026, this.getChunkCoordinates(), 0); ++ this.world.a(null, 1026, this.getChunkCoordinates(), 0); + } + } + +@@ -465,16 +465,16 @@ public class EntityZombie extends EntityMonster { + List list = generatoraccess.a(EntityChicken.class, this.getBoundingBox().grow(5.0D, 3.0D, 5.0D), IEntitySelector.c); + + if (!list.isEmpty()) { +- EntityChicken entitychicken = (EntityChicken) list.get(0); ++ EntityChicken entitychicken = list.get(0); + + entitychicken.setChickenJockey(true); + this.startRiding(entitychicken); + } + } else if ((double) generatoraccess.getRandom().nextFloat() < 0.05D) { +- EntityChicken entitychicken1 = (EntityChicken) EntityTypes.CHICKEN.a(this.world); ++ EntityChicken entitychicken1 = EntityTypes.CHICKEN.a(this.world); + + entitychicken1.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, 0.0F); +- entitychicken1.prepare(generatoraccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null); ++ entitychicken1.prepare(generatoraccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, null, null); + entitychicken1.setChickenJockey(true); + this.startRiding(entitychicken1); + generatoraccess.addEntity(entitychicken1, CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit +@@ -564,12 +564,12 @@ public class EntityZombie extends EntityMonster { + + @Override + public void a(GeneratorAccess generatoraccess, BlockPosition blockposition) { +- generatoraccess.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_ZOMBIE_DESTROY_EGG, SoundCategory.HOSTILE, 0.5F, 0.9F + EntityZombie.this.random.nextFloat() * 0.2F); ++ generatoraccess.playSound(null, blockposition, SoundEffects.ENTITY_ZOMBIE_DESTROY_EGG, SoundCategory.HOSTILE, 0.5F, 0.9F + EntityZombie.this.random.nextFloat() * 0.2F); + } + + @Override + public void a(World world, BlockPosition blockposition) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_BREAK, SoundCategory.BLOCKS, 0.7F, 0.9F + world.random.nextFloat() * 0.2F); ++ world.playSound(null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_BREAK, SoundCategory.BLOCKS, 0.7F, 0.9F + world.random.nextFloat() * 0.2F); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java +index 143b9123e0ebe4779e17286f366c9a4cc44cd568..c587352036b16be9ecd17f7b5600492cd1c142ea 100644 +--- a/src/main/java/net/minecraft/server/EntityZombieHusk.java ++++ b/src/main/java/net/minecraft/server/EntityZombieHusk.java +@@ -59,7 +59,7 @@ public class EntityZombieHusk extends EntityZombie { + protected void eQ() { + this.c(EntityTypes.ZOMBIE); + if (!this.isSilent()) { +- this.world.a((EntityHuman) null, 1041, this.getChunkCoordinates(), 0); ++ this.world.a(null, 1041, this.getChunkCoordinates(), 0); + } + + } +diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java +index c3acf82e8396a554c4e56df33731c8f891117879..8bb01bcaf57f9c53ae914fe76dc3d3ce905872f1 100644 +--- a/src/main/java/net/minecraft/server/EntityZombieVillager.java ++++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java +@@ -24,7 +24,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo + + public EntityZombieVillager(EntityTypes entitytypes, World world) { + super(entitytypes, world); +- this.setVillagerData(this.getVillagerData().withProfession((VillagerProfession) IRegistry.VILLAGER_PROFESSION.a(this.random))); ++ this.setVillagerData(this.getVillagerData().withProfession(IRegistry.VILLAGER_PROFESSION.a(this.random))); + } + + @Override +@@ -38,7 +38,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo + public void saveData(NBTTagCompound nbttagcompound) { + super.saveData(nbttagcompound); + DataResult dataresult = VillagerData.a.encodeStart(DynamicOpsNBT.a, this.getVillagerData()); // CraftBukkit - decompile error +- Logger logger = EntityZombieVillager.LOGGER; ++ Logger logger = Entity.LOGGER; + + logger.getClass(); + dataresult.resultOrPartial(logger::error).ifPresent((nbtbase) -> { +@@ -65,7 +65,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo + super.loadData(nbttagcompound); + if (nbttagcompound.hasKeyOfType("VillagerData", 10)) { + DataResult dataresult = VillagerData.a.parse(new Dynamic(DynamicOpsNBT.a, nbttagcompound.get("VillagerData"))); +- Logger logger = EntityZombieVillager.LOGGER; ++ Logger logger = Entity.LOGGER; + + logger.getClass(); + dataresult.resultOrPartial(logger::error).ifPresent(this::setVillagerData); +@@ -142,7 +142,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo + } + + public boolean isConverting() { +- return (Boolean) this.getDataWatcher().get(EntityZombieVillager.CONVERTING); ++ return this.getDataWatcher().get(EntityZombieVillager.CONVERTING); + } + + public void startConversion(@Nullable UUID uuid, int i) { +@@ -158,7 +158,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo + } + + private void b(WorldServer worldserver) { +- EntityVillager entityvillager = (EntityVillager) EntityTypes.VILLAGER.a((World) worldserver); ++ EntityVillager entityvillager = EntityTypes.VILLAGER.a(worldserver); + EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); + int i = aenumitemslot.length; + +@@ -170,7 +170,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo + if (EnchantmentManager.d(itemstack)) { + entityvillager.a_(enumitemslot.b() + 300, itemstack); + } else { +- double d0 = (double) this.e(enumitemslot); ++ double d0 = this.e(enumitemslot); + + if (d0 > 1.0D) { + this.a(itemstack); +@@ -190,7 +190,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo + } + + entityvillager.setExperience(this.by); +- entityvillager.prepare(worldserver, worldserver.getDamageScaler(entityvillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, (GroupDataEntity) null, (NBTTagCompound) null); ++ entityvillager.prepare(worldserver, worldserver.getDamageScaler(entityvillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, null, null); + if (this.isBaby()) { + entityvillager.setAgeRaw(-24000); + } +@@ -220,14 +220,14 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo + EntityHuman entityhuman = worldserver.b(this.conversionPlayer); + + if (entityhuman instanceof EntityPlayer) { +- CriterionTriggers.r.a((EntityPlayer) entityhuman, (EntityZombie) this, entityvillager); +- worldserver.a(ReputationEvent.a, (Entity) entityhuman, (ReputationHandler) entityvillager); ++ CriterionTriggers.r.a((EntityPlayer) entityhuman, this, entityvillager); ++ worldserver.a(ReputationEvent.a, entityhuman, entityvillager); + } + } + + entityvillager.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); // CraftBukkit + if (!this.isSilent()) { +- worldserver.a((EntityHuman) null, 1027, this.getChunkCoordinates(), 0); ++ worldserver.a(null, 1027, this.getChunkCoordinates(), 0); + } + + } +@@ -316,7 +316,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo + + @Override + public VillagerData getVillagerData() { +- return (VillagerData) this.datawatcher.get(EntityZombieVillager.c); ++ return this.datawatcher.get(EntityZombieVillager.c); + } + + public void a(int i) { +diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java +index a02f87750d8a0dc617bebd8c7f4db33f1d050b3d..368fc30dc1ec4795ece3d1388fdbd18b3630b020 100644 +--- a/src/main/java/net/minecraft/server/EnumDirection.java ++++ b/src/main/java/net/minecraft/server/EnumDirection.java +@@ -23,22 +23,22 @@ public enum EnumDirection implements INamable { + private final EnumDirection.EnumAxisDirection l; + private final BaseBlockPosition m; + private static final EnumDirection[] n = values(); private static final EnumDirection[] ALL = n;// Yatopia OBF HELPER +- private static final Map o = (Map) Arrays.stream(EnumDirection.n).collect(Collectors.toMap(EnumDirection::m, (enumdirection) -> { ++ private static final Map o = Arrays.stream(EnumDirection.n).collect(Collectors.toMap(EnumDirection::m, (enumdirection) -> { + return enumdirection; + })); +- private static final EnumDirection[] p = (EnumDirection[]) Arrays.stream(EnumDirection.n).sorted(Comparator.comparingInt((enumdirection) -> { ++ private static final EnumDirection[] p = Arrays.stream(EnumDirection.n).sorted(Comparator.comparingInt((enumdirection) -> { + return enumdirection.g; + })).toArray((i) -> { + return new EnumDirection[i]; + }); +- private static final EnumDirection[] q = (EnumDirection[]) Arrays.stream(EnumDirection.n).filter((enumdirection) -> { ++ private static final EnumDirection[] q = Arrays.stream(EnumDirection.n).filter((enumdirection) -> { + return enumdirection.n().d(); + }).sorted(Comparator.comparingInt((enumdirection) -> { + return enumdirection.i; + })).toArray((i) -> { + return new EnumDirection[i]; + }); +- private static final Long2ObjectMap r = (Long2ObjectMap) Arrays.stream(EnumDirection.n).collect(Collectors.toMap((enumdirection) -> { ++ private static final Long2ObjectMap r = Arrays.stream(EnumDirection.n).collect(Collectors.toMap((enumdirection) -> { + return (new BlockPosition(enumdirection.p())).asLong(); + }, (enumdirection) -> { + return enumdirection; +@@ -162,7 +162,7 @@ public enum EnumDirection implements INamable { + + @Nullable + public static EnumDirection a(int i, int j, int k) { +- return (EnumDirection) EnumDirection.r.get(BlockPosition.a(i, j, k)); ++ return EnumDirection.r.get(BlockPosition.a(i, j, k)); + } + + public static EnumDirection fromAngle(double d0) { +@@ -336,7 +336,7 @@ public enum EnumDirection implements INamable { + + private static final EnumDirection.EnumAxis[] e = values(); + public static final Codec d = INamable.a(EnumDirection.EnumAxis::values, EnumDirection.EnumAxis::a); +- private static final Map f = (Map) Arrays.stream(EnumDirection.EnumAxis.e).collect(Collectors.toMap(EnumDirection.EnumAxis::b, (enumdirection_enumaxis) -> { ++ private static final Map f = Arrays.stream(EnumAxis.e).collect(Collectors.toMap(EnumAxis::b, (enumdirection_enumaxis) -> { + return enumdirection_enumaxis; + })); + private final String g; +@@ -347,7 +347,7 @@ public enum EnumDirection implements INamable { + + @Nullable + public static EnumDirection.EnumAxis a(String s) { +- return (EnumDirection.EnumAxis) EnumDirection.EnumAxis.f.get(s.toLowerCase(Locale.ROOT)); ++ return EnumAxis.f.get(s.toLowerCase(Locale.ROOT)); + } + + public String b() { +diff --git a/src/main/java/net/minecraft/server/EnumProtocol.java b/src/main/java/net/minecraft/server/EnumProtocol.java +index 4e856e3bccf667bdfb426331e3c3b3b68119a9ad..a33b17eb936990cceef8c4cb243ed6fffb3a9114 100644 +--- a/src/main/java/net/minecraft/server/EnumProtocol.java ++++ b/src/main/java/net/minecraft/server/EnumProtocol.java +@@ -32,7 +32,7 @@ public enum EnumProtocol { + + @Nullable + public Integer a(EnumProtocolDirection enumprotocoldirection, Packet packet) { +- return ((EnumProtocol.a) this.h.get(enumprotocoldirection)).a(packet.getClass()); ++ return this.h.get(enumprotocoldirection).a(packet.getClass()); + } + + @Nullable +@@ -50,7 +50,7 @@ public enum EnumProtocol { + } + + public static EnumProtocol a(Packet packet) { +- return (EnumProtocol) EnumProtocol.f.get(packet.getClass()); ++ return EnumProtocol.f.get(packet.getClass()); + } + + static { +@@ -130,9 +130,9 @@ public enum EnumProtocol { + @Nullable + public Packet a(int i) { + if (i < 0 || i >= this.b.size()) return null; // Paper +- Supplier> supplier = (Supplier) this.b.get(i); ++ Supplier> supplier = this.b.get(i); + +- return supplier != null ? (Packet) supplier.get() : null; ++ return supplier != null ? supplier.get() : null; + } + + public Iterable>> a() { +diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java +index 15224fc323b66c4f33f487a994590df043db4f52..f7eb6d713cb05082de0921e0ca6e0bb73760e4dd 100644 +--- a/src/main/java/net/minecraft/server/Explosion.java ++++ b/src/main/java/net/minecraft/server/Explosion.java +@@ -47,7 +47,7 @@ public class Explosion { + } + + private ExplosionDamageCalculator a(@Nullable Entity entity) { +- return (ExplosionDamageCalculator) (entity == null ? ExplosionDamageCalculatorBlock.INSTANCE : new ExplosionDamageCalculatorEntity(entity)); ++ return entity == null ? ExplosionDamageCalculatorBlock.INSTANCE : new ExplosionDamageCalculatorEntity(entity); + } + + public static float a(Vec3D vec3d, Entity entity) { +@@ -65,9 +65,9 @@ public class Explosion { + for (float f = 0.0F; f <= 1.0F; f = (float) ((double) f + d0)) { + for (float f1 = 0.0F; f1 <= 1.0F; f1 = (float) ((double) f1 + d1)) { + for (float f2 = 0.0F; f2 <= 1.0F; f2 = (float) ((double) f2 + d2)) { +- double d5 = MathHelper.d((double) f, axisalignedbb.minX, axisalignedbb.maxX); +- double d6 = MathHelper.d((double) f1, axisalignedbb.minY, axisalignedbb.maxY); +- double d7 = MathHelper.d((double) f2, axisalignedbb.minZ, axisalignedbb.maxZ); ++ double d5 = MathHelper.d(f, axisalignedbb.minX, axisalignedbb.maxX); ++ double d6 = MathHelper.d(f1, axisalignedbb.minY, axisalignedbb.maxY); ++ double d7 = MathHelper.d(f2, axisalignedbb.minZ, axisalignedbb.maxZ); + Vec3D vec3d1 = new Vec3D(d5 + d3, d6, d7 + d4); + + if (entity.world.rayTrace(new RayTrace(vec3d1, vec3d, RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.NONE, entity)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS) { +@@ -102,9 +102,9 @@ public class Explosion { + for (i = 0; i < 16; ++i) { + for (j = 0; j < 16; ++j) { + if (k == 0 || k == 15 || i == 0 || i == 15 || j == 0 || j == 15) { +- double d0 = (double) ((float) k / 15.0F * 2.0F - 1.0F); +- double d1 = (double) ((float) i / 15.0F * 2.0F - 1.0F); +- double d2 = (double) ((float) j / 15.0F * 2.0F - 1.0F); ++ double d0 = (float) k / 15.0F * 2.0F - 1.0F; ++ double d1 = (float) i / 15.0F * 2.0F - 1.0F; ++ double d2 = (float) j / 15.0F * 2.0F - 1.0F; + double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + + d0 /= d3; +@@ -123,7 +123,7 @@ public class Explosion { + Optional optional = this.k.a(this, this.world, blockposition, iblockdata, fluid); + + if (optional.isPresent()) { +- f -= ((Float) optional.get() + 0.3F) * 0.3F; ++ f -= (optional.get() + 0.3F) * 0.3F; + } + + if (f > 0.0F && this.k.a(this, this.world, blockposition, iblockdata, f) && blockposition.getY() < 256 && blockposition.getY() >= 0) { // CraftBukkit - don't wrap explosions +@@ -149,20 +149,20 @@ public class Explosion { + int i1 = MathHelper.floor(this.posY + (double) f2 + 1.0D); + int j1 = MathHelper.floor(this.posZ - (double) f2 - 1.0D); + int k1 = MathHelper.floor(this.posZ + (double) f2 + 1.0D); +- List list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), (com.google.common.base.Predicate) entity -> IEntitySelector.canAITarget().test(entity) && !entity.dead && !(entity instanceof EntityItem)); // Paper - Fix lag from explosions processing dead entities ++ List list = this.world.getEntities(this.source, new AxisAlignedBB(i, l, j1, j, i1, k1), (com.google.common.base.Predicate) entity -> IEntitySelector.canAITarget().test(entity) && !entity.dead && !(entity instanceof EntityItem)); // Paper - Fix lag from explosions processing dead entities + Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ); + + for (int l1 = 0; l1 < list.size(); ++l1) { +- Entity entity = (Entity) list.get(l1); ++ Entity entity = list.get(l1); + + if (!entity.ch()) { +- double d7 = (double) (MathHelper.sqrt(entity.d(vec3d)) / f2); ++ double d7 = MathHelper.sqrt(entity.d(vec3d)) / f2; + + if (d7 <= 1.0D) { + double d8 = entity.locX() - this.posX; + double d9 = (entity instanceof EntityTNTPrimed ? entity.locY() : entity.getHeadY()) - this.posY; + double d10 = entity.locZ() - this.posZ; +- double d11 = (double) MathHelper.sqrt(d8 * d8 + d9 * d9 + d10 * d10); ++ double d11 = MathHelper.sqrt(d8 * d8 + d9 * d9 + d10 * d10); + + if (d11 != 0.0D) { + d8 /= d11; +@@ -229,7 +229,7 @@ public class Explosion { + + List blockList = Lists.newArrayList(); + for (int i1 = this.blocks.size() - 1; i1 >= 0; i1--) { +- BlockPosition cpos = (BlockPosition) this.blocks.get(i1); ++ BlockPosition cpos = this.blocks.get(i1); + org.bukkit.block.Block bblock = bworld.getBlockAt(cpos.getX(), cpos.getY(), cpos.getZ()); + if (!bblock.getType().isAir()) { + blockList.add(bblock); +@@ -301,7 +301,7 @@ public class Explosion { + while (objectlistiterator.hasNext()) { + Pair pair = (Pair) objectlistiterator.next(); + +- Block.a(this.world, (BlockPosition) pair.getSecond(), (ItemStack) pair.getFirst()); ++ Block.a(this.world, pair.getSecond(), pair.getFirst()); + } + } + +@@ -328,8 +328,8 @@ public class Explosion { + int i = objectarraylist.size(); + + for (int j = 0; j < i; ++j) { +- Pair pair = (Pair) objectarraylist.get(j); +- ItemStack itemstack1 = (ItemStack) pair.getFirst(); ++ Pair pair = objectarraylist.get(j); ++ ItemStack itemstack1 = pair.getFirst(); + + if (EntityItem.a(itemstack1, itemstack)) { + ItemStack itemstack2 = EntityItem.a(itemstack1, itemstack, 16); +diff --git a/src/main/java/net/minecraft/server/Fluid.java b/src/main/java/net/minecraft/server/Fluid.java +index 2189477e59e4695278c891ce14ec3f6797249caa..39522157b5615f7c4f59ffdc125c5b6b632002dc 100644 +--- a/src/main/java/net/minecraft/server/Fluid.java ++++ b/src/main/java/net/minecraft/server/Fluid.java +@@ -8,7 +8,7 @@ import java.util.Random; + + public final class Fluid extends IBlockDataHolder { + +- public static final Codec a = a((Codec) IRegistry.FLUID, FluidType::h).stable(); ++ public static final Codec a = a(IRegistry.FLUID, FluidType::h).stable(); + + // Tuinity start + protected final boolean isEmpty; +@@ -19,7 +19,7 @@ public final class Fluid extends IBlockDataHolder { + } + + public FluidType getType() { +- return (FluidType) this.c; ++ return this.c; + } + + public boolean isSource() { +diff --git a/src/main/java/net/minecraft/server/FluidTypeFlowing.java b/src/main/java/net/minecraft/server/FluidTypeFlowing.java +index 7e97b5dffc1228b30f4e75789398b7b616d68447..19cf8b3ec91db5560da39b075908b5ab89c1b4e4 100644 +--- a/src/main/java/net/minecraft/server/FluidTypeFlowing.java ++++ b/src/main/java/net/minecraft/server/FluidTypeFlowing.java +@@ -50,7 +50,7 @@ public abstract class FluidTypeFlowing extends FluidType { + while (iterator.hasNext()) { + EnumDirection enumdirection = (EnumDirection) iterator.next(); + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); ++ blockposition_mutableblockposition.a(blockposition, enumdirection); + Fluid fluid1 = iblockaccess.getFluid(blockposition_mutableblockposition); + + if (this.g(fluid1)) { +@@ -74,22 +74,22 @@ public abstract class FluidTypeFlowing extends FluidType { + } + + if (f1 != 0.0F) { +- d0 += (double) ((float) enumdirection.getAdjacentX() * f1); +- d1 += (double) ((float) enumdirection.getAdjacentZ() * f1); ++ d0 += (float) enumdirection.getAdjacentX() * f1; ++ d1 += (float) enumdirection.getAdjacentZ() * f1; + } + } + } + + Vec3D vec3d = new Vec3D(d0, 0.0D, d1); + +- if ((Boolean) fluid.get(FluidTypeFlowing.FALLING)) { ++ if (fluid.get(FluidTypeFlowing.FALLING)) { + Iterator iterator1 = EnumDirection.EnumDirectionLimit.HORIZONTAL.iterator(); + + while (iterator1.hasNext()) { + EnumDirection enumdirection1 = (EnumDirection) iterator1.next(); + +- blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection1); +- if (this.a(iblockaccess, (BlockPosition) blockposition_mutableblockposition, enumdirection1) || this.a(iblockaccess, blockposition_mutableblockposition.up(), enumdirection1)) { ++ blockposition_mutableblockposition.a(blockposition, enumdirection1); ++ if (this.a(iblockaccess, blockposition_mutableblockposition, enumdirection1) || this.a(iblockaccess, blockposition_mutableblockposition.up(), enumdirection1)) { + vec3d = vec3d.d().add(0.0D, -6.0D, 0.0D); + break; + } +@@ -100,14 +100,14 @@ public abstract class FluidTypeFlowing extends FluidType { + } + + private boolean g(Fluid fluid) { +- return fluid.isEmpty() || fluid.getType().a((FluidType) this); ++ return fluid.isEmpty() || fluid.getType().a(this); + } + + protected boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { + IBlockData iblockdata = iblockaccess.getType(blockposition); + Fluid fluid = iblockaccess.getFluid(blockposition); + +- return fluid.getType().a((FluidType) this) ? false : (enumdirection == EnumDirection.UP ? true : (iblockdata.getMaterial() == Material.ICE ? false : iblockdata.d(iblockaccess, blockposition, enumdirection))); ++ return fluid.getType().a(this) ? false : (enumdirection == EnumDirection.UP ? true : (iblockdata.getMaterial() == Material.ICE ? false : iblockdata.d(iblockaccess, blockposition, enumdirection))); + } + + protected void a(GeneratorAccess generatoraccess, BlockPosition blockposition, Fluid fluid) { +@@ -128,10 +128,10 @@ public abstract class FluidTypeFlowing extends FluidType { + } + // CraftBukkit end + this.a(generatoraccess, blockposition1, iblockdata1, EnumDirection.DOWN, fluid1); +- if (this.a((IWorldReader) generatoraccess, blockposition) >= 3) { ++ if (this.a(generatoraccess, blockposition) >= 3) { + this.a(generatoraccess, blockposition, fluid, iblockdata); + } +- } else if (fluid.isSource() || !this.a((IBlockAccess) generatoraccess, fluid1.getType(), blockposition, iblockdata, blockposition1, iblockdata1)) { ++ } else if (fluid.isSource() || !this.a(generatoraccess, fluid1.getType(), blockposition, iblockdata, blockposition1, iblockdata1)) { + this.a(generatoraccess, blockposition, fluid, iblockdata); + } + +@@ -139,20 +139,20 @@ public abstract class FluidTypeFlowing extends FluidType { + } + + private void a(GeneratorAccess generatoraccess, BlockPosition blockposition, Fluid fluid, IBlockData iblockdata) { +- int i = fluid.e() - this.c((IWorldReader) generatoraccess); ++ int i = fluid.e() - this.c(generatoraccess); + +- if ((Boolean) fluid.get(FluidTypeFlowing.FALLING)) { ++ if (fluid.get(FluidTypeFlowing.FALLING)) { + i = 7; + } + + if (i > 0) { +- Map map = this.b((IWorldReader) generatoraccess, blockposition, iblockdata); ++ Map map = this.b(generatoraccess, blockposition, iblockdata); + Iterator iterator = map.entrySet().iterator(); + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- EnumDirection enumdirection = (EnumDirection) entry.getKey(); +- Fluid fluid1 = (Fluid) entry.getValue(); ++ EnumDirection enumdirection = entry.getKey(); ++ Fluid fluid1 = entry.getValue(); + BlockPosition blockposition1 = blockposition.shift(enumdirection); + IBlockData iblockdata1 = generatoraccess.getTypeIfLoaded(blockposition1); // Paper + if (iblockdata1 == null) continue; // Paper +@@ -186,7 +186,7 @@ public abstract class FluidTypeFlowing extends FluidType { + if (iblockdata1 == null) continue; // Paper + Fluid fluid = iblockdata1.getFluid(); + +- if (fluid.getType().a((FluidType) this) && this.a(enumdirection, (IBlockAccess) iworldreader, blockposition, iblockdata, blockposition1, iblockdata1)) { ++ if (fluid.getType().a(this) && this.a(enumdirection, iworldreader, blockposition, iblockdata, blockposition1, iblockdata1)) { + if (fluid.isSource()) { + ++j; + } +@@ -208,7 +208,7 @@ public abstract class FluidTypeFlowing extends FluidType { + IBlockData iblockdata3 = iworldreader.getType(blockposition2); + Fluid fluid2 = iblockdata3.getFluid(); + +- if (!fluid2.isEmpty() && fluid2.getType().a((FluidType) this) && this.a(EnumDirection.UP, (IBlockAccess) iworldreader, blockposition, iblockdata, blockposition2, iblockdata3)) { ++ if (!fluid2.isEmpty() && fluid2.getType().a(this) && this.a(EnumDirection.UP, iworldreader, blockposition, iblockdata, blockposition2, iblockdata3)) { + return this.a(8, true); + } else { + int k = i - this.c(iworldreader); +@@ -221,7 +221,7 @@ public abstract class FluidTypeFlowing extends FluidType { + Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap; + + if (!iblockdata.getBlock().o() && !iblockdata1.getBlock().o()) { +- object2bytelinkedopenhashmap = (Object2ByteLinkedOpenHashMap) FluidTypeFlowing.e.get(); ++ object2bytelinkedopenhashmap = FluidTypeFlowing.e.get(); + } else { + object2bytelinkedopenhashmap = null; + } +@@ -257,13 +257,13 @@ public abstract class FluidTypeFlowing extends FluidType { + public abstract FluidType d(); + + public Fluid a(int i, boolean flag) { +- return (Fluid) ((Fluid) this.d().h().set(FluidTypeFlowing.LEVEL, i)).set(FluidTypeFlowing.FALLING, flag); ++ return this.d().h().set(FluidTypeFlowing.LEVEL, i).set(FluidTypeFlowing.FALLING, flag); + } + + public abstract FluidType e(); + + public Fluid a(boolean flag) { +- return (Fluid) this.e().h().set(FluidTypeFlowing.FALLING, flag); ++ return this.e().h().set(FluidTypeFlowing.FALLING, flag); + } + + protected abstract boolean f(); +@@ -312,15 +312,15 @@ public abstract class FluidTypeFlowing extends FluidType { + short2objectmap.put(short0, pair); + } + // Paper end +- IBlockData iblockdata1 = (IBlockData) pair.getFirst(); +- Fluid fluid = (Fluid) pair.getSecond(); ++ IBlockData iblockdata1 = pair.getFirst(); ++ Fluid fluid = pair.getSecond(); + + if (this.a(iworldreader, this.d(), blockposition, iblockdata, enumdirection1, blockposition2, iblockdata1, fluid)) { + boolean flag = short2booleanmap.computeIfAbsent(short0, (k) -> { + BlockPosition blockposition3 = blockposition2.down(); + IBlockData iblockdata2 = iworldreader.getType(blockposition3); + +- return this.a((IBlockAccess) iworldreader, this.d(), blockposition2, iblockdata1, blockposition3, iblockdata2); ++ return this.a(iworldreader, this.d(), blockposition2, iblockdata1, blockposition3, iblockdata2); + }); + + if (flag) { +@@ -342,7 +342,7 @@ public abstract class FluidTypeFlowing extends FluidType { + } + + private boolean a(IBlockAccess iblockaccess, FluidType fluidtype, BlockPosition blockposition, IBlockData iblockdata, BlockPosition blockposition1, IBlockData iblockdata1) { +- return !this.a(EnumDirection.DOWN, iblockaccess, blockposition, iblockdata, blockposition1, iblockdata1) ? false : (iblockdata1.getFluid().getType().a((FluidType) this) ? true : this.a(iblockaccess, blockposition1, iblockdata1, fluidtype)); ++ return !this.a(EnumDirection.DOWN, iblockaccess, blockposition, iblockdata, blockposition1, iblockdata1) ? false : (iblockdata1.getFluid().getType().a(this) ? true : this.a(iblockaccess, blockposition1, iblockdata1, fluidtype)); + } + + private boolean a(IBlockAccess iblockaccess, FluidType fluidtype, BlockPosition blockposition, IBlockData iblockdata, EnumDirection enumdirection, BlockPosition blockposition1, IBlockData iblockdata1, Fluid fluid) { +@@ -350,7 +350,7 @@ public abstract class FluidTypeFlowing extends FluidType { + } + + private boolean h(Fluid fluid) { +- return fluid.getType().a((FluidType) this) && fluid.isSource(); ++ return fluid.getType().a(this) && fluid.isSource(); + } + + protected abstract int b(IWorldReader iworldreader); +@@ -384,7 +384,7 @@ public abstract class FluidTypeFlowing extends FluidType { + BlockPosition blockposition1 = blockposition.shift(enumdirection); + short short0 = a(blockposition, blockposition1); + // Paper start +- Pair pair = (Pair) short2objectmap.get(short0); ++ Pair pair = short2objectmap.get(short0); + if (pair == null) { + IBlockData iblockdatax = iworldreader.getTypeIfLoaded(blockposition1); + if (iblockdatax == null) continue; +@@ -402,7 +402,7 @@ public abstract class FluidTypeFlowing extends FluidType { + boolean flag = short2booleanopenhashmap.computeIfAbsent(short0, (j) -> { + IBlockData iblockdata2 = iworldreader.getType(blockposition2); + +- return this.a((IBlockAccess) iworldreader, this.d(), blockposition1, iblockdata1, blockposition2, iblockdata2); ++ return this.a(iworldreader, this.d(), blockposition1, iblockdata1, blockposition2, iblockdata2); + }); + int j; + +@@ -431,7 +431,7 @@ public abstract class FluidTypeFlowing extends FluidType { + + if (block instanceof IFluidContainer) { + return ((IFluidContainer) block).canPlace(iblockaccess, blockposition, iblockdata, fluidtype); +- } else if (!(block instanceof BlockDoor) && !block.a((Tag) TagsBlock.SIGNS) && block != Blocks.LADDER && block != Blocks.SUGAR_CANE && block != Blocks.BUBBLE_COLUMN) { ++ } else if (!(block instanceof BlockDoor) && !block.a(TagsBlock.SIGNS) && block != Blocks.LADDER && block != Blocks.SUGAR_CANE && block != Blocks.BUBBLE_COLUMN) { + Material material = iblockdata.getMaterial(); + + return material != Material.PORTAL && material != Material.STRUCTURE_VOID && material != Material.WATER_PLANT && material != Material.REPLACEABLE_WATER_PLANT ? !material.isSolid() : false; +@@ -447,7 +447,7 @@ public abstract class FluidTypeFlowing extends FluidType { + protected abstract int c(IWorldReader iworldreader); + + protected int a(World world, BlockPosition blockposition, Fluid fluid, Fluid fluid1) { +- return this.a((IWorldReader) world); ++ return this.a(world); + } + + @Override +@@ -484,7 +484,7 @@ public abstract class FluidTypeFlowing extends FluidType { + } + + protected static int e(Fluid fluid) { +- return fluid.isSource() ? 0 : 8 - Math.min(fluid.e(), 8) + ((Boolean) fluid.get(FluidTypeFlowing.FALLING) ? 8 : 0); ++ return fluid.isSource() ? 0 : 8 - Math.min(fluid.e(), 8) + (fluid.get(FluidTypeFlowing.FALLING) ? 8 : 0); + } + + private static boolean c(Fluid fluid, IBlockAccess iblockaccess, BlockPosition blockposition) { +@@ -503,8 +503,8 @@ public abstract class FluidTypeFlowing extends FluidType { + + @Override + public VoxelShape b(Fluid fluid, IBlockAccess iblockaccess, BlockPosition blockposition) { +- return fluid.e() == 9 && c(fluid, iblockaccess, blockposition) ? VoxelShapes.b() : (VoxelShape) this.f.computeIfAbsent(fluid, (fluid1) -> { +- return VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, (double) fluid1.getHeight(iblockaccess, blockposition), 1.0D); ++ return fluid.e() == 9 && c(fluid, iblockaccess, blockposition) ? VoxelShapes.b() : this.f.computeIfAbsent(fluid, (fluid1) -> { ++ return VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, fluid1.getHeight(iblockaccess, blockposition), 1.0D); + }); + } + } +diff --git a/src/main/java/net/minecraft/server/FluidTypeLava.java b/src/main/java/net/minecraft/server/FluidTypeLava.java +index 29930e801cdcb97bec2fb113ec478fe9c4a63b63..a331bf90e5eec8951c372610d8455821a82ebe5f 100644 +--- a/src/main/java/net/minecraft/server/FluidTypeLava.java ++++ b/src/main/java/net/minecraft/server/FluidTypeLava.java +@@ -109,7 +109,7 @@ public abstract class FluidTypeLava extends FluidTypeFlowing { + + @Override + public IBlockData b(Fluid fluid) { +- return (IBlockData) Blocks.LAVA.getBlockData().set(BlockFluids.LEVEL, e(fluid)); ++ return Blocks.LAVA.getBlockData().set(BlockFluids.LEVEL, e(fluid)); + } + + @Override +@@ -124,7 +124,7 @@ public abstract class FluidTypeLava extends FluidTypeFlowing { + + @Override + public boolean a(Fluid fluid, IBlockAccess iblockaccess, BlockPosition blockposition, FluidType fluidtype, EnumDirection enumdirection) { +- return fluid.getHeight(iblockaccess, blockposition) >= 0.44444445F && fluidtype.a((Tag) TagsFluid.WATER); ++ return fluid.getHeight(iblockaccess, blockposition) >= 0.44444445F && fluidtype.a(TagsFluid.WATER); + } + + @Override +@@ -134,9 +134,9 @@ public abstract class FluidTypeLava extends FluidTypeFlowing { + + @Override + public int a(World world, BlockPosition blockposition, Fluid fluid, Fluid fluid1) { +- int i = this.a((IWorldReader) world); ++ int i = this.a(world); + +- if (!fluid.isEmpty() && !fluid1.isEmpty() && !(Boolean) fluid.get(FluidTypeLava.FALLING) && !(Boolean) fluid1.get(FluidTypeLava.FALLING) && fluid1.getHeight(world, blockposition) > fluid.getHeight(world, blockposition) && world.getRandom().nextInt(4) != 0) { ++ if (!fluid.isEmpty() && !fluid1.isEmpty() && !(Boolean) fluid.get(FluidTypeFlowing.FALLING) && !(Boolean) fluid1.get(FluidTypeFlowing.FALLING) && fluid1.getHeight(world, blockposition) > fluid.getHeight(world, blockposition) && world.getRandom().nextInt(4) != 0) { + i *= 4; + } + +@@ -157,7 +157,7 @@ public abstract class FluidTypeLava extends FluidTypeFlowing { + if (enumdirection == EnumDirection.DOWN) { + Fluid fluid1 = generatoraccess.getFluid(blockposition); + +- if (this.a((Tag) TagsFluid.LAVA) && fluid1.a((Tag) TagsFluid.WATER)) { ++ if (this.a(TagsFluid.LAVA) && fluid1.a(TagsFluid.WATER)) { + if (iblockdata.getBlock() instanceof BlockFluids) { + // CraftBukkit start + if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(generatoraccess.getMinecraftWorld(), blockposition, Blocks.STONE.getBlockData(), 3)) { +@@ -191,12 +191,12 @@ public abstract class FluidTypeLava extends FluidTypeFlowing { + @Override + protected void a(BlockStateList.a blockstatelist_a) { + super.a(blockstatelist_a); +- blockstatelist_a.a(FluidTypeLava.a.LEVEL); ++ blockstatelist_a.a(FluidTypeFlowing.LEVEL); + } + + @Override + public int d(Fluid fluid) { +- return (Integer) fluid.get(FluidTypeLava.a.LEVEL); ++ return fluid.get(FluidTypeFlowing.LEVEL); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/GameProfileBanEntry.java b/src/main/java/net/minecraft/server/GameProfileBanEntry.java +index c07122cf7df7d3f86c00574bec508dadb2f49151..19c4d9e5813e15cd52c6d63289ed290fe444a5fe 100644 +--- a/src/main/java/net/minecraft/server/GameProfileBanEntry.java ++++ b/src/main/java/net/minecraft/server/GameProfileBanEntry.java +@@ -11,7 +11,7 @@ import java.util.UUID; + public class GameProfileBanEntry extends ExpirableListEntry { + + public GameProfileBanEntry(GameProfile gameprofile) { +- this(gameprofile, (Date) null, (String) null, (Date) null, (String) null); ++ this(gameprofile, null, null, null, null); + } + + public GameProfileBanEntry(GameProfile gameprofile, @Nullable Date date, @Nullable String s, @Nullable Date date1, @Nullable String s1) { +@@ -25,15 +25,15 @@ public class GameProfileBanEntry extends ExpirableListEntry { + @Override + protected void a(JsonObject jsonobject) { + if (this.getKey() != null) { +- jsonobject.addProperty("uuid", ((GameProfile) this.getKey()).getId() == null ? "" : ((GameProfile) this.getKey()).getId().toString()); +- jsonobject.addProperty("name", ((GameProfile) this.getKey()).getName()); ++ jsonobject.addProperty("uuid", this.getKey().getId() == null ? "" : this.getKey().getId().toString()); ++ jsonobject.addProperty("name", this.getKey().getName()); + super.a(jsonobject); + } + } + + @Override + public IChatBaseComponent e() { +- GameProfile gameprofile = (GameProfile) this.getKey(); ++ GameProfile gameprofile = this.getKey(); + + return new ChatComponentText(gameprofile.getName() != null ? gameprofile.getName() : Objects.toString(gameprofile.getId(), "(Unknown)")); + } +diff --git a/src/main/java/net/minecraft/server/GameProfileSerializer.java b/src/main/java/net/minecraft/server/GameProfileSerializer.java +index 66a10de0bd9d2901c4e5cc5398f19c20b70e6c56..8c042726e1e3a323d18f0728286610f2e3a5d7df 100644 +--- a/src/main/java/net/minecraft/server/GameProfileSerializer.java ++++ b/src/main/java/net/minecraft/server/GameProfileSerializer.java +@@ -209,7 +209,7 @@ public final class GameProfileSerializer { + if (!nbttagcompound.hasKeyOfType("Name", 8)) { + return Blocks.AIR.getBlockData(); + } else { +- Block block = (Block) IRegistry.BLOCK.get(new MinecraftKey(nbttagcompound.getString("Name"))); ++ Block block = IRegistry.BLOCK.get(new MinecraftKey(nbttagcompound.getString("Name"))); + IBlockData iblockdata = block.getBlockData(); + + if (nbttagcompound.hasKeyOfType("Properties", 10)) { +@@ -222,7 +222,7 @@ public final class GameProfileSerializer { + IBlockState iblockstate = blockstatelist.a(s); + + if (iblockstate != null) { +- iblockdata = (IBlockData) a(iblockdata, iblockstate, s, nbttagcompound1, nbttagcompound); ++ iblockdata = a(iblockdata, iblockstate, s, nbttagcompound1, nbttagcompound); + } + } + } +@@ -254,7 +254,7 @@ public final class GameProfileSerializer { + + while (unmodifiableiterator.hasNext()) { + Entry, Comparable> entry = (Entry) unmodifiableiterator.next(); +- IBlockState iblockstate = (IBlockState) entry.getKey(); ++ IBlockState iblockstate = entry.getKey(); + + nbttagcompound1.setString(iblockstate.getName(), a(iblockstate, (Comparable) entry.getValue())); + } +diff --git a/src/main/java/net/minecraft/server/GameRules.java b/src/main/java/net/minecraft/server/GameRules.java +index 2510cfbd7bc96824fc660d02a80fe55f376853a6..f31778b93fea88f87cedfc27acf9d468971c9fd5 100644 +--- a/src/main/java/net/minecraft/server/GameRules.java ++++ b/src/main/java/net/minecraft/server/GameRules.java +@@ -82,7 +82,7 @@ public class GameRules { + + private static > GameRules.GameRuleKey a(String s, GameRules.GameRuleCategory gamerules_gamerulecategory, GameRules.GameRuleDefinition gamerules_gameruledefinition) { + GameRules.GameRuleKey gamerules_gamerulekey = new GameRules.GameRuleKey<>(s, gamerules_gamerulecategory); +- GameRules.GameRuleDefinition gamerules_gameruledefinition1 = (GameRules.GameRuleDefinition) GameRules.I.put(gamerules_gamerulekey, gamerules_gameruledefinition); ++ GameRules.GameRuleDefinition gamerules_gameruledefinition1 = GameRules.I.put(gamerules_gamerulekey, gamerules_gameruledefinition); + + if (gamerules_gameruledefinition1 != null) { + throw new IllegalStateException("Duplicate game rule registration for " + s); +@@ -130,8 +130,8 @@ public class GameRules { + } + + public GameRules b() { +- return new GameRules((Map) this.J.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry) -> { +- return ((GameRules.GameRuleValue) entry.getValue()).f(); ++ return new GameRules(this.J.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry) -> { ++ return ((GameRuleValue) entry.getValue()).f(); + }))); + } + +@@ -149,11 +149,11 @@ public class GameRules { + } + + public boolean getBoolean(GameRules.GameRuleKey gamerules_gamerulekey) { +- return ((GameRules.GameRuleBoolean) this.get(gamerules_gamerulekey)).a(); ++ return this.get(gamerules_gamerulekey).a(); + } + + public int getInt(GameRules.GameRuleKey gamerules_gamerulekey) { +- return ((GameRules.GameRuleInt) this.get(gamerules_gamerulekey)).a(); ++ return this.get(gamerules_gamerulekey).a(); + } + + public static class GameRuleBoolean extends GameRules.GameRuleValue { +@@ -295,7 +295,7 @@ public class GameRules { + + public void b(CommandContext commandcontext, String s) { + this.a(commandcontext, s); +- this.onChange(((CommandListenerWrapper) commandcontext.getSource()).getServer()); ++ this.onChange(commandcontext.getSource().getServer()); + } + + public void onChange(@Nullable MinecraftServer minecraftserver) { +diff --git a/src/main/java/net/minecraft/server/GenericAttributes.java b/src/main/java/net/minecraft/server/GenericAttributes.java +index 9913fb4facd5f647d04205d413d75f7f4e850cd8..9231219fb80bb1dde769e77ef10d37c3aafa340f 100644 +--- a/src/main/java/net/minecraft/server/GenericAttributes.java ++++ b/src/main/java/net/minecraft/server/GenericAttributes.java +@@ -17,6 +17,6 @@ public class GenericAttributes { + public static final AttributeBase JUMP_STRENGTH = a("horse.jump_strength", (new AttributeRanged("attribute.name.horse.jump_strength", 0.7D, 0.0D, 2.0D)).a(true)); + + private static AttributeBase a(String s, AttributeBase attributebase) { +- return (AttributeBase) IRegistry.a(IRegistry.ATTRIBUTE, s, attributebase); ++ return IRegistry.a(IRegistry.ATTRIBUTE, s, attributebase); + } + } +diff --git a/src/main/java/net/minecraft/server/GuiStatsComponent.java b/src/main/java/net/minecraft/server/GuiStatsComponent.java +index decb89a87a85f26fa30574dc077e0f61910a1fe6..7965cccc3d188394b230b97b1967d062961da0e5 100644 +--- a/src/main/java/net/minecraft/server/GuiStatsComponent.java ++++ b/src/main/java/net/minecraft/server/GuiStatsComponent.java +@@ -8,7 +8,7 @@ import java.util.Locale; + + public class GuiStatsComponent extends JComponent { + +- private static final DecimalFormat a = (DecimalFormat) SystemUtils.a(new DecimalFormat("########0.000"), (decimalformat) -> { // Paper - decompile error ++ private static final DecimalFormat a = SystemUtils.a(new DecimalFormat("########0.000"), (decimalformat) -> { // Paper - decompile error + decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT)); + }); + private final int[] b = new int[256]; +diff --git a/src/main/java/net/minecraft/server/HeightMap.java b/src/main/java/net/minecraft/server/HeightMap.java +index 1fdc709f5dcb873a20cebc3fe788e2a6bd5a641e..df6fd529bcfd87e2f88235283933297589f8478e 100644 +--- a/src/main/java/net/minecraft/server/HeightMap.java ++++ b/src/main/java/net/minecraft/server/HeightMap.java +@@ -70,7 +70,7 @@ public class HeightMap { + + if (!iblockdata.a(Blocks.AIR)) { + while (objectlistiterator.hasNext()) { +- HeightMap heightmap = (HeightMap) objectlistiterator.next(); ++ HeightMap heightmap = objectlistiterator.next(); + + if (heightmap.d.test(iblockdata)) { + heightmap.a(k, l, i1 + 1); +@@ -162,12 +162,12 @@ public class HeightMap { + private final String h; + private final HeightMap.Use i; + private final Predicate j; +- private static final Map k = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // Tuinity - decompile fix +- HeightMap.Type[] aheightmap_type = values(); ++ private static final Map k = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // Tuinity - decompile fix ++ Type[] aheightmap_type = values(); + int i = aheightmap_type.length; + + for (int j = 0; j < i; ++j) { +- HeightMap.Type heightmap_type = aheightmap_type[j]; ++ Type heightmap_type = aheightmap_type[j]; + + hashmap.put(heightmap_type.h, heightmap_type); + } +@@ -190,7 +190,7 @@ public class HeightMap { + + @Nullable + public static HeightMap.Type a(String s) { +- return (HeightMap.Type) HeightMap.Type.k.get(s); ++ return Type.k.get(s); + } + + public Predicate e() { +diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java +index 54f48ebc0a1add4183ad1a02e21d8025550f1cdb..0f3a5051a6c6394d24291034b01941982c57de5b 100644 +--- a/src/main/java/net/minecraft/server/IBlockAccess.java ++++ b/src/main/java/net/minecraft/server/IBlockAccess.java +@@ -70,7 +70,7 @@ public interface IBlockAccess { + // CraftBukkit end + + default MovingObjectPositionBlock rayTrace(RayTrace raytrace) { +- return (MovingObjectPositionBlock) a(raytrace, (raytrace1, blockposition) -> { ++ return a(raytrace, (raytrace1, blockposition) -> { + return this.rayTraceBlock(raytrace1, blockposition); // CraftBukkit - moved into separate method + }, (raytrace1) -> { + Vec3D vec3d = raytrace1.b().d(raytrace1.a()); +diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java +index 9117504767834d0a798a3dfd4867a0c0bea95ed8..eb659d563c6cb40cf0c396ba1bebc795a4da921d 100644 +--- a/src/main/java/net/minecraft/server/IBlockData.java ++++ b/src/main/java/net/minecraft/server/IBlockData.java +@@ -6,7 +6,7 @@ import com.mojang.serialization.MapCodec; + + public class IBlockData extends BlockBase.BlockData { + +- public static final Codec b = a((Codec) IRegistry.BLOCK, Block::getBlockData).stable(); ++ public static final Codec b = a(IRegistry.BLOCK, Block::getBlockData).stable(); + + + // Tuinity start - optimise getType calls +diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java +index 9fa95225ff3a31db29236a55bb7ad4a6b700e62e..8aca939086c90efff7eace06a15c356a2f47d844 100644 +--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java ++++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java +@@ -19,7 +19,7 @@ import java.util.stream.Stream; + public interface IChatBaseComponent extends Message, IChatFormatted, Iterable { + + default Stream stream() { +- return Streams.concat(new Stream[]{Stream.of(this), this.getSiblings().stream().flatMap(IChatBaseComponent::stream)}); ++ return Streams.concat(Stream.of(this), this.getSiblings().stream().flatMap(IChatBaseComponent::stream)); + } + + @Override +@@ -44,7 +44,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable, JsonSerializer { + +- private static final Gson a = (Gson) SystemUtils.a(() -> { ++ private static final Gson a = SystemUtils.a(() -> { + GsonBuilder gsonbuilder = new GsonBuilder(); + + gsonbuilder.disableHtmlEscaping(); +- gsonbuilder.registerTypeHierarchyAdapter(IChatBaseComponent.class, new IChatBaseComponent.ChatSerializer()); ++ gsonbuilder.registerTypeHierarchyAdapter(IChatBaseComponent.class, new ChatSerializer()); + gsonbuilder.registerTypeHierarchyAdapter(ChatModifier.class, new ChatModifier.ChatModifierSerializer()); + gsonbuilder.registerTypeAdapterFactory(new ChatTypeAdapterFactory()); + return gsonbuilder.create(); + }); +- private static final Field b = (Field) SystemUtils.a(() -> { ++ private static final Field b = SystemUtils.a(() -> { + try { + new JsonReader(new StringReader("")); + Field field = JsonReader.class.getDeclaredField("pos"); +@@ -110,7 +110,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable { ++ private static final Field c = SystemUtils.a(() -> { + try { + new JsonReader(new StringReader("")); + Field field = JsonReader.class.getDeclaredField("lineStart"); +@@ -224,7 +224,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable entry = (Entry) iterator.next(); + +- jsonobject.add((String) entry.getKey(), (JsonElement) entry.getValue()); ++ jsonobject.add(entry.getKey(), entry.getValue()); + } + } + +@@ -346,17 +346,17 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable { ++ return this.b(null, axisalignedbb, (entity) -> { + return true; + }); + } +diff --git a/src/main/java/net/minecraft/server/IDispenseBehavior.java b/src/main/java/net/minecraft/server/IDispenseBehavior.java +index 1ec06c6f02f40fb3bf29e0f11ddcbb4338d83cb1..aea6e8e048103f9398c3083c9f5f8f4e522f23af 100644 +--- a/src/main/java/net/minecraft/server/IDispenseBehavior.java ++++ b/src/main/java/net/minecraft/server/IDispenseBehavior.java +@@ -21,7 +21,7 @@ public interface IDispenseBehavior { + ItemStack dispense(ISourceBlock isourceblock, ItemStack itemstack); + + static void c() { +- BlockDispenser.a((IMaterial) Items.ARROW, (IDispenseBehavior) (new DispenseBehaviorProjectile() { ++ BlockDispenser.a(Items.ARROW, new DispenseBehaviorProjectile() { + @Override + protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) { + EntityTippedArrow entitytippedarrow = new EntityTippedArrow(world, iposition.getX(), iposition.getY(), iposition.getZ()); +@@ -29,8 +29,8 @@ public interface IDispenseBehavior { + entitytippedarrow.fromPlayer = EntityArrow.PickupStatus.ALLOWED; + return entitytippedarrow; + } +- })); +- BlockDispenser.a((IMaterial) Items.TIPPED_ARROW, (IDispenseBehavior) (new DispenseBehaviorProjectile() { ++ }); ++ BlockDispenser.a(Items.TIPPED_ARROW, new DispenseBehaviorProjectile() { + @Override + protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) { + EntityTippedArrow entitytippedarrow = new EntityTippedArrow(world, iposition.getX(), iposition.getY(), iposition.getZ()); +@@ -39,8 +39,8 @@ public interface IDispenseBehavior { + entitytippedarrow.fromPlayer = EntityArrow.PickupStatus.ALLOWED; + return entitytippedarrow; + } +- })); +- BlockDispenser.a((IMaterial) Items.SPECTRAL_ARROW, (IDispenseBehavior) (new DispenseBehaviorProjectile() { ++ }); ++ BlockDispenser.a(Items.SPECTRAL_ARROW, new DispenseBehaviorProjectile() { + @Override + protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) { + EntitySpectralArrow entityspectralarrow = new EntitySpectralArrow(world, iposition.getX(), iposition.getY(), iposition.getZ()); +@@ -48,27 +48,27 @@ public interface IDispenseBehavior { + entityspectralarrow.fromPlayer = EntityArrow.PickupStatus.ALLOWED; + return entityspectralarrow; + } +- })); +- BlockDispenser.a((IMaterial) Items.EGG, (IDispenseBehavior) (new DispenseBehaviorProjectile() { ++ }); ++ BlockDispenser.a(Items.EGG, new DispenseBehaviorProjectile() { + @Override + protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) { +- return (IProjectile) SystemUtils.a((new EntityEgg(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entityegg) -> { // CraftBukkit - decompile error ++ return SystemUtils.a((new EntityEgg(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entityegg) -> { // CraftBukkit - decompile error + entityegg.setItem(itemstack); + }); + } +- })); +- BlockDispenser.a((IMaterial) Items.SNOWBALL, (IDispenseBehavior) (new DispenseBehaviorProjectile() { ++ }); ++ BlockDispenser.a(Items.SNOWBALL, new DispenseBehaviorProjectile() { + @Override + protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) { +- return (IProjectile) SystemUtils.a((new EntitySnowball(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entitysnowball) -> { // CraftBukkit - decompile error ++ return SystemUtils.a((new EntitySnowball(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entitysnowball) -> { // CraftBukkit - decompile error + entitysnowball.setItem(itemstack); + }); + } +- })); +- BlockDispenser.a((IMaterial) Items.EXPERIENCE_BOTTLE, (IDispenseBehavior) (new DispenseBehaviorProjectile() { ++ }); ++ BlockDispenser.a(Items.EXPERIENCE_BOTTLE, new DispenseBehaviorProjectile() { + @Override + protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) { +- return (IProjectile) SystemUtils.a((new EntityThrownExpBottle(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entitythrownexpbottle) -> { // CraftBukkit - decompile error ++ return SystemUtils.a((new EntityThrownExpBottle(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entitythrownexpbottle) -> { // CraftBukkit - decompile error + entitythrownexpbottle.setItem(itemstack); + }); + } +@@ -82,14 +82,14 @@ public interface IDispenseBehavior { + protected float getPower() { + return super.getPower() * 1.25F; + } +- })); +- BlockDispenser.a((IMaterial) Items.SPLASH_POTION, new IDispenseBehavior() { ++ }); ++ BlockDispenser.a(Items.SPLASH_POTION, new IDispenseBehavior() { + @Override + public ItemStack dispense(ISourceBlock isourceblock, ItemStack itemstack) { + return (new DispenseBehaviorProjectile() { + @Override + protected IProjectile a(World world, IPosition iposition, ItemStack itemstack1) { +- return (IProjectile) SystemUtils.a((new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entitypotion) -> { // CraftBukkit - decompile error ++ return SystemUtils.a((new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entitypotion) -> { // CraftBukkit - decompile error + entitypotion.setItem(itemstack1); + }); + } +@@ -106,13 +106,13 @@ public interface IDispenseBehavior { + }).dispense(isourceblock, itemstack); + } + }); +- BlockDispenser.a((IMaterial) Items.LINGERING_POTION, new IDispenseBehavior() { ++ BlockDispenser.a(Items.LINGERING_POTION, new IDispenseBehavior() { + @Override + public ItemStack dispense(ISourceBlock isourceblock, ItemStack itemstack) { + return (new DispenseBehaviorProjectile() { + @Override + protected IProjectile a(World world, IPosition iposition, ItemStack itemstack1) { +- return (IProjectile) SystemUtils.a((new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entitypotion) -> { // CraftBukkit - decompile error ++ return SystemUtils.a((new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ())), (entitypotion) -> { // CraftBukkit - decompile error + entitypotion.setItem(itemstack1); + }); + } +@@ -132,7 +132,7 @@ public interface IDispenseBehavior { + DispenseBehaviorItem dispensebehavioritem = new DispenseBehaviorItem() { + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + EntityTypes entitytypes = ((ItemMonsterEgg) itemstack.getItem()).a(itemstack.getTag()); + + // CraftBukkit start +@@ -155,7 +155,7 @@ public interface IDispenseBehavior { + itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -163,7 +163,7 @@ public interface IDispenseBehavior { + } + + try { // Paper +- entitytypes.spawnCreature(isourceblock.getWorld(), itemstack, (EntityHuman) null, isourceblock.getBlockPosition().shift(enumdirection), EnumMobSpawn.DISPENSER, enumdirection != EnumDirection.UP, false); ++ entitytypes.spawnCreature(isourceblock.getWorld(), itemstack, null, isourceblock.getBlockPosition().shift(enumdirection), EnumMobSpawn.DISPENSER, enumdirection != EnumDirection.UP, false); + // Paper start + } catch (Exception ex){ + MinecraftServer.LOGGER.warn("An exception occurred dispensing entity at {}[{}]", world.getWorld().getName(), isourceblock.getBlockPosition(), ex); +@@ -180,13 +180,13 @@ public interface IDispenseBehavior { + while (iterator.hasNext()) { + ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) iterator.next(); + +- BlockDispenser.a((IMaterial) itemmonsteregg, (IDispenseBehavior) dispensebehavioritem); ++ BlockDispenser.a(itemmonsteregg, dispensebehavioritem); + } + +- BlockDispenser.a((IMaterial) Items.ARMOR_STAND, (IDispenseBehavior) (new DispenseBehaviorItem() { ++ BlockDispenser.a(Items.ARMOR_STAND, new DispenseBehaviorItem() { + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); + World world = isourceblock.getWorld(); + +@@ -209,7 +209,7 @@ public interface IDispenseBehavior { + itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -217,19 +217,19 @@ public interface IDispenseBehavior { + } + // CraftBukkit end + +- EntityArmorStand entityarmorstand = new EntityArmorStand(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D); ++ EntityArmorStand entityarmorstand = new EntityArmorStand(world, (double) blockposition.getX() + 0.5D, blockposition.getY(), (double) blockposition.getZ() + 0.5D); + +- EntityTypes.a(world, (EntityHuman) null, (Entity) entityarmorstand, itemstack.getTag()); ++ EntityTypes.a(world, null, entityarmorstand, itemstack.getTag()); + entityarmorstand.yaw = enumdirection.o(); + world.addEntity(entityarmorstand); + // itemstack.subtract(1); // CraftBukkit - Handled during event processing + return itemstack; + } +- })); +- BlockDispenser.a((IMaterial) Items.SADDLE, (IDispenseBehavior) (new DispenseBehaviorMaybe() { ++ }); ++ BlockDispenser.a(Items.SADDLE, new DispenseBehaviorMaybe() { + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + List list = isourceblock.getWorld().a(EntityLiving.class, new AxisAlignedBB(blockposition), (entityliving) -> { + if (!(entityliving instanceof ISaddleable)) { + return false; +@@ -249,11 +249,11 @@ public interface IDispenseBehavior { + return super.a(isourceblock, itemstack); + } + } +- })); ++ }); + DispenseBehaviorMaybe dispensebehaviormaybe = new DispenseBehaviorMaybe() { + @Override + protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + List list = isourceblock.getWorld().a(EntityHorseAbstract.class, new AxisAlignedBB(blockposition), (entityhorseabstract) -> { + return entityhorseabstract.isAlive() && entityhorseabstract.ft(); + }); +@@ -275,30 +275,30 @@ public interface IDispenseBehavior { + } + }; + +- BlockDispenser.a((IMaterial) Items.LEATHER_HORSE_ARMOR, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.IRON_HORSE_ARMOR, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.GOLDEN_HORSE_ARMOR, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.DIAMOND_HORSE_ARMOR, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fM, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fN, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fV, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fX, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fY, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.gb, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fT, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fZ, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fP, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fU, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fR, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fO, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fS, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fW, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.ga, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.fQ, (IDispenseBehavior) dispensebehaviormaybe); +- BlockDispenser.a((IMaterial) Items.cy, (IDispenseBehavior) (new DispenseBehaviorMaybe() { ++ BlockDispenser.a(Items.LEATHER_HORSE_ARMOR, dispensebehaviormaybe); ++ BlockDispenser.a(Items.IRON_HORSE_ARMOR, dispensebehaviormaybe); ++ BlockDispenser.a(Items.GOLDEN_HORSE_ARMOR, dispensebehaviormaybe); ++ BlockDispenser.a(Items.DIAMOND_HORSE_ARMOR, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fM, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fN, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fV, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fX, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fY, dispensebehaviormaybe); ++ BlockDispenser.a(Items.gb, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fT, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fZ, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fP, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fU, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fR, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fO, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fS, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fW, dispensebehaviormaybe); ++ BlockDispenser.a(Items.ga, dispensebehaviormaybe); ++ BlockDispenser.a(Items.fQ, dispensebehaviormaybe); ++ BlockDispenser.a(Items.cy, new DispenseBehaviorMaybe() { + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + List list = isourceblock.getWorld().a(EntityHorseChestedAbstract.class, new AxisAlignedBB(blockposition), (entityhorsechestedabstract) -> { + return entityhorsechestedabstract.isAlive() && !entityhorsechestedabstract.isCarryingChest(); + }); +@@ -318,11 +318,11 @@ public interface IDispenseBehavior { + this.a(true); + return itemstack; + } +- })); +- BlockDispenser.a((IMaterial) Items.FIREWORK_ROCKET, (IDispenseBehavior) (new DispenseBehaviorItem() { ++ }); ++ BlockDispenser.a(Items.FIREWORK_ROCKET, new DispenseBehaviorItem() { + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + // CraftBukkit start + World world = isourceblock.getWorld(); + ItemStack itemstack1 = itemstack.cloneAndSubtract(1); +@@ -343,7 +343,7 @@ public interface IDispenseBehavior { + itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -354,7 +354,7 @@ public interface IDispenseBehavior { + EntityFireworks entityfireworks = new EntityFireworks(isourceblock.getWorld(), itemstack1, isourceblock.getX(), isourceblock.getY(), isourceblock.getX(), true); // Paper - GH-2871 - fix last firework in stack having no effects when dispensed + + IDispenseBehavior.a(isourceblock, entityfireworks, enumdirection); +- entityfireworks.shoot((double) enumdirection.getAdjacentX(), (double) enumdirection.getAdjacentY(), (double) enumdirection.getAdjacentZ(), 0.5F, 1.0F); ++ entityfireworks.shoot(enumdirection.getAdjacentX(), enumdirection.getAdjacentY(), enumdirection.getAdjacentZ(), 0.5F, 1.0F); + isourceblock.getWorld().addEntity(entityfireworks); + // itemstack.subtract(1); // Handled during event processing + // CraftBukkit end +@@ -365,11 +365,11 @@ public interface IDispenseBehavior { + protected void a(ISourceBlock isourceblock) { + isourceblock.getWorld().triggerEffect(1004, isourceblock.getBlockPosition(), 0); + } +- })); +- BlockDispenser.a((IMaterial) Items.FIRE_CHARGE, (IDispenseBehavior) (new DispenseBehaviorItem() { ++ }); ++ BlockDispenser.a(Items.FIRE_CHARGE, new DispenseBehaviorItem() { + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + IPosition iposition = BlockDispenser.a(isourceblock); + double d0 = iposition.getX() + (double) ((float) enumdirection.getAdjacentX() * 0.3F); + double d1 = iposition.getY() + (double) ((float) enumdirection.getAdjacentY() * 0.3F); +@@ -399,7 +399,7 @@ public interface IDispenseBehavior { + itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -408,7 +408,7 @@ public interface IDispenseBehavior { + + EntitySmallFireball entitysmallfireball = new EntitySmallFireball(world, d0, d1, d2, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ()); + entitysmallfireball.setItem(itemstack1); +- entitysmallfireball.projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource((TileEntityDispenser) isourceblock.getTileEntity()); ++ entitysmallfireball.projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(isourceblock.getTileEntity()); + + world.addEntity(entitysmallfireball); + // itemstack.subtract(1); // Handled during event processing +@@ -420,20 +420,20 @@ public interface IDispenseBehavior { + protected void a(ISourceBlock isourceblock) { + isourceblock.getWorld().triggerEffect(1018, isourceblock.getBlockPosition(), 0); + } +- })); +- BlockDispenser.a((IMaterial) Items.OAK_BOAT, (IDispenseBehavior) (new DispenseBehaviorBoat(EntityBoat.EnumBoatType.OAK))); +- BlockDispenser.a((IMaterial) Items.SPRUCE_BOAT, (IDispenseBehavior) (new DispenseBehaviorBoat(EntityBoat.EnumBoatType.SPRUCE))); +- BlockDispenser.a((IMaterial) Items.BIRCH_BOAT, (IDispenseBehavior) (new DispenseBehaviorBoat(EntityBoat.EnumBoatType.BIRCH))); +- BlockDispenser.a((IMaterial) Items.JUNGLE_BOAT, (IDispenseBehavior) (new DispenseBehaviorBoat(EntityBoat.EnumBoatType.JUNGLE))); +- BlockDispenser.a((IMaterial) Items.DARK_OAK_BOAT, (IDispenseBehavior) (new DispenseBehaviorBoat(EntityBoat.EnumBoatType.DARK_OAK))); +- BlockDispenser.a((IMaterial) Items.ACACIA_BOAT, (IDispenseBehavior) (new DispenseBehaviorBoat(EntityBoat.EnumBoatType.ACACIA))); ++ }); ++ BlockDispenser.a(Items.OAK_BOAT, new DispenseBehaviorBoat(EntityBoat.EnumBoatType.OAK)); ++ BlockDispenser.a(Items.SPRUCE_BOAT, new DispenseBehaviorBoat(EntityBoat.EnumBoatType.SPRUCE)); ++ BlockDispenser.a(Items.BIRCH_BOAT, new DispenseBehaviorBoat(EntityBoat.EnumBoatType.BIRCH)); ++ BlockDispenser.a(Items.JUNGLE_BOAT, new DispenseBehaviorBoat(EntityBoat.EnumBoatType.JUNGLE)); ++ BlockDispenser.a(Items.DARK_OAK_BOAT, new DispenseBehaviorBoat(EntityBoat.EnumBoatType.DARK_OAK)); ++ BlockDispenser.a(Items.ACACIA_BOAT, new DispenseBehaviorBoat(EntityBoat.EnumBoatType.ACACIA)); + DispenseBehaviorItem dispensebehavioritem1 = new DispenseBehaviorItem() { + private final DispenseBehaviorItem b = new DispenseBehaviorItem(); + + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { + ItemBucket itembucket = (ItemBucket) itemstack.getItem(); +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + World world = isourceblock.getWorld(); + + // CraftBukkit start +@@ -458,7 +458,7 @@ public interface IDispenseBehavior { + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -469,7 +469,7 @@ public interface IDispenseBehavior { + } + // CraftBukkit end + +- if (itembucket.a((EntityHuman) null, world, blockposition, (MovingObjectPositionBlock) null)) { ++ if (itembucket.a(null, world, blockposition, (MovingObjectPositionBlock) null)) { + itembucket.a(world, itemstack, blockposition); + // CraftBukkit start - Handle stacked buckets + Item item = Items.BUCKET; +@@ -488,19 +488,19 @@ public interface IDispenseBehavior { + } + }; + +- BlockDispenser.a((IMaterial) Items.LAVA_BUCKET, (IDispenseBehavior) dispensebehavioritem1); +- BlockDispenser.a((IMaterial) Items.WATER_BUCKET, (IDispenseBehavior) dispensebehavioritem1); +- BlockDispenser.a((IMaterial) Items.SALMON_BUCKET, (IDispenseBehavior) dispensebehavioritem1); +- BlockDispenser.a((IMaterial) Items.COD_BUCKET, (IDispenseBehavior) dispensebehavioritem1); +- BlockDispenser.a((IMaterial) Items.PUFFERFISH_BUCKET, (IDispenseBehavior) dispensebehavioritem1); +- BlockDispenser.a((IMaterial) Items.TROPICAL_FISH_BUCKET, (IDispenseBehavior) dispensebehavioritem1); +- BlockDispenser.a((IMaterial) Items.BUCKET, (IDispenseBehavior) (new DispenseBehaviorItem() { ++ BlockDispenser.a(Items.LAVA_BUCKET, dispensebehavioritem1); ++ BlockDispenser.a(Items.WATER_BUCKET, dispensebehavioritem1); ++ BlockDispenser.a(Items.SALMON_BUCKET, dispensebehavioritem1); ++ BlockDispenser.a(Items.COD_BUCKET, dispensebehavioritem1); ++ BlockDispenser.a(Items.PUFFERFISH_BUCKET, dispensebehavioritem1); ++ BlockDispenser.a(Items.TROPICAL_FISH_BUCKET, dispensebehavioritem1); ++ BlockDispenser.a(Items.BUCKET, new DispenseBehaviorItem() { + private final DispenseBehaviorItem b = new DispenseBehaviorItem(); + + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { + World world = isourceblock.getWorld(); +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + IBlockData iblockdata = world.getType(blockposition); + Block block = iblockdata.getBlock(); + +@@ -528,7 +528,7 @@ public interface IDispenseBehavior { + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -553,8 +553,8 @@ public interface IDispenseBehavior { + return super.a(isourceblock, itemstack); + } + } +- })); +- BlockDispenser.a((IMaterial) Items.FLINT_AND_STEEL, (IDispenseBehavior) (new DispenseBehaviorMaybe() { ++ }); ++ BlockDispenser.a(Items.FLINT_AND_STEEL, new DispenseBehaviorMaybe() { + @Override + protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { + World world = isourceblock.getWorld(); +@@ -575,7 +575,7 @@ public interface IDispenseBehavior { + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -584,17 +584,17 @@ public interface IDispenseBehavior { + // CraftBukkit end + + this.a(true); +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + IBlockData iblockdata = world.getType(blockposition); + +- if (BlockFireAbstract.a((GeneratorAccess) world, blockposition)) { ++ if (BlockFireAbstract.a(world, blockposition)) { + // CraftBukkit start - Ignition by dispensing flint and steel + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, isourceblock.getBlockPosition()).isCancelled()) { + world.setTypeUpdate(blockposition, BlockFireAbstract.a((IBlockAccess) world, blockposition)); + } + // CraftBukkit end + } else if (BlockCampfire.h(iblockdata)) { +- world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true)); ++ world.setTypeUpdate(blockposition, iblockdata.set(BlockProperties.r, true)); + } else if (iblockdata.getBlock() instanceof BlockTNT) { + BlockTNT.a(world, blockposition); + world.a(blockposition, false); +@@ -602,19 +602,19 @@ public interface IDispenseBehavior { + this.a(false); + } + +- if (this.a() && itemstack.isDamaged(1, world.random, (EntityPlayer) null)) { ++ if (this.a() && itemstack.isDamaged(1, world.random, null)) { + itemstack.setCount(0); + } + + return itemstack; + } +- })); +- BlockDispenser.a((IMaterial) Items.BONE_MEAL, (IDispenseBehavior) (new DispenseBehaviorMaybe() { ++ }); ++ BlockDispenser.a(Items.BONE_MEAL, new DispenseBehaviorMaybe() { + @Override + protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { + this.a(true); + World world = isourceblock.getWorld(); +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + // CraftBukkit start + org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); + CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack); +@@ -631,7 +631,7 @@ public interface IDispenseBehavior { + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -641,7 +641,7 @@ public interface IDispenseBehavior { + world.captureTreeGeneration = true; + // CraftBukkit end + +- if (!ItemBoneMeal.a(itemstack, world, blockposition) && !ItemBoneMeal.a(itemstack, world, blockposition, (EnumDirection) null)) { ++ if (!ItemBoneMeal.a(itemstack, world, blockposition) && !ItemBoneMeal.a(itemstack, world, blockposition, null)) { + this.a(false); + } else if (!world.isClientSide) { + world.triggerEffect(2005, blockposition, 0); +@@ -669,12 +669,12 @@ public interface IDispenseBehavior { + + return itemstack; + } +- })); +- BlockDispenser.a((IMaterial) Blocks.TNT, (IDispenseBehavior) (new DispenseBehaviorItem() { ++ }); ++ BlockDispenser.a(Blocks.TNT, new DispenseBehaviorItem() { + @Override + protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { + World world = isourceblock.getWorld(); +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + // EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null); + + // CraftBukkit start +@@ -682,7 +682,7 @@ public interface IDispenseBehavior { + org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); + CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); + +- BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D)); ++ BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) blockposition.getX() + 0.5D, blockposition.getY(), (double) blockposition.getZ() + 0.5D)); + if (!BlockDispenser.eventFired) { + world.getServer().getPluginManager().callEvent(event); + } +@@ -696,22 +696,22 @@ public interface IDispenseBehavior { + itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; + } + } + +- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), (EntityLiving) null); ++ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), null); + // CraftBukkit end + + world.addEntity(entitytntprimed); +- world.playSound((EntityHuman) null, entitytntprimed.locX(), entitytntprimed.locY(), entitytntprimed.locZ(), SoundEffects.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ world.playSound(null, entitytntprimed.locX(), entitytntprimed.locY(), entitytntprimed.locZ(), SoundEffects.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F); + // itemstack.subtract(1); // CraftBukkit - handled above + return itemstack; + } +- })); ++ }); + DispenseBehaviorMaybe dispensebehaviormaybe1 = new DispenseBehaviorMaybe() { + @Override + protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +@@ -720,16 +720,16 @@ public interface IDispenseBehavior { + } + }; + +- BlockDispenser.a((IMaterial) Items.CREEPER_HEAD, (IDispenseBehavior) dispensebehaviormaybe1); +- BlockDispenser.a((IMaterial) Items.ZOMBIE_HEAD, (IDispenseBehavior) dispensebehaviormaybe1); +- BlockDispenser.a((IMaterial) Items.DRAGON_HEAD, (IDispenseBehavior) dispensebehaviormaybe1); +- BlockDispenser.a((IMaterial) Items.SKELETON_SKULL, (IDispenseBehavior) dispensebehaviormaybe1); +- BlockDispenser.a((IMaterial) Items.PLAYER_HEAD, (IDispenseBehavior) dispensebehaviormaybe1); +- BlockDispenser.a((IMaterial) Items.WITHER_SKELETON_SKULL, (IDispenseBehavior) (new DispenseBehaviorMaybe() { ++ BlockDispenser.a(Items.CREEPER_HEAD, dispensebehaviormaybe1); ++ BlockDispenser.a(Items.ZOMBIE_HEAD, dispensebehaviormaybe1); ++ BlockDispenser.a(Items.DRAGON_HEAD, dispensebehaviormaybe1); ++ BlockDispenser.a(Items.SKELETON_SKULL, dispensebehaviormaybe1); ++ BlockDispenser.a(Items.PLAYER_HEAD, dispensebehaviormaybe1); ++ BlockDispenser.a(Items.WITHER_SKELETON_SKULL, new DispenseBehaviorMaybe() { + @Override + protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { + World world = isourceblock.getWorld(); +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); + + // CraftBukkit start +@@ -748,7 +748,7 @@ public interface IDispenseBehavior { + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -757,7 +757,7 @@ public interface IDispenseBehavior { + // CraftBukkit end + + if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) { +- world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, enumdirection.n() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.opposite().get2DRotationValue() * 4), 3); ++ world.setTypeAndData(blockposition, Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, enumdirection.n() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.opposite().get2DRotationValue() * 4), 3); + TileEntity tileentity = world.getTileEntity(blockposition); + + if (tileentity instanceof TileEntitySkull) { +@@ -772,12 +772,12 @@ public interface IDispenseBehavior { + + return itemstack; + } +- })); +- BlockDispenser.a((IMaterial) Blocks.CARVED_PUMPKIN, (IDispenseBehavior) (new DispenseBehaviorMaybe() { ++ }); ++ BlockDispenser.a(Blocks.CARVED_PUMPKIN, new DispenseBehaviorMaybe() { + @Override + protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { + World world = isourceblock.getWorld(); +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN; + + // CraftBukkit start +@@ -796,7 +796,7 @@ public interface IDispenseBehavior { + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -804,7 +804,7 @@ public interface IDispenseBehavior { + } + // CraftBukkit end + +- if (world.isEmpty(blockposition) && blockpumpkincarved.a((IWorldReader) world, blockposition)) { ++ if (world.isEmpty(blockposition) && blockpumpkincarved.a(world, blockposition)) { + if (!world.isClientSide) { + world.setTypeAndData(blockposition, blockpumpkincarved.getBlockData(), 3); + } +@@ -817,18 +817,18 @@ public interface IDispenseBehavior { + + return itemstack; + } +- })); +- BlockDispenser.a((IMaterial) Blocks.SHULKER_BOX.getItem(), (IDispenseBehavior) (new DispenseBehaviorShulkerBox())); ++ }); ++ BlockDispenser.a(Blocks.SHULKER_BOX.getItem(), new DispenseBehaviorShulkerBox()); + EnumColor[] aenumcolor = EnumColor.values(); + int i = aenumcolor.length; + + for (int j = 0; j < i; ++j) { + EnumColor enumcolor = aenumcolor[j]; + +- BlockDispenser.a((IMaterial) BlockShulkerBox.a(enumcolor).getItem(), (IDispenseBehavior) (new DispenseBehaviorShulkerBox())); ++ BlockDispenser.a(BlockShulkerBox.a(enumcolor).getItem(), new DispenseBehaviorShulkerBox()); + } + +- BlockDispenser.a((IMaterial) Items.GLASS_BOTTLE.getItem(), (IDispenseBehavior) (new DispenseBehaviorMaybe() { ++ BlockDispenser.a(Items.GLASS_BOTTLE.getItem(), new DispenseBehaviorMaybe() { + private final DispenseBehaviorItem b = new DispenseBehaviorItem(); + + private ItemStack a(ISourceBlock isourceblock, ItemStack itemstack, ItemStack itemstack1) { +@@ -848,7 +848,7 @@ public interface IDispenseBehavior { + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { + this.a(false); + World world = isourceblock.getWorld(); +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + IBlockData iblockdata = world.getType(blockposition); + + // CraftBukkit start +@@ -867,7 +867,7 @@ public interface IDispenseBehavior { + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -875,31 +875,31 @@ public interface IDispenseBehavior { + } + // CraftBukkit end + +- if (iblockdata.a((Tag) TagsBlock.BEEHIVES, (blockbase_blockdata) -> { ++ if (iblockdata.a(TagsBlock.BEEHIVES, (blockbase_blockdata) -> { + return blockbase_blockdata.b(BlockBeehive.b); +- }) && (Integer) iblockdata.get(BlockBeehive.b) >= 5) { +- ((BlockBeehive) iblockdata.getBlock()).a(world.getMinecraftWorld(), iblockdata, blockposition, (EntityHuman) null, TileEntityBeehive.ReleaseStatus.BEE_RELEASED); ++ }) && iblockdata.get(BlockBeehive.b) >= 5) { ++ ((BlockBeehive) iblockdata.getBlock()).a(world.getMinecraftWorld(), iblockdata, blockposition, null, TileEntityBeehive.ReleaseStatus.BEE_RELEASED); + this.a(true); + return this.a(isourceblock, itemstack, new ItemStack(Items.HONEY_BOTTLE)); +- } else if (world.getFluid(blockposition).a((Tag) TagsFluid.WATER)) { ++ } else if (world.getFluid(blockposition).a(TagsFluid.WATER)) { + this.a(true); + return this.a(isourceblock, itemstack, PotionUtil.a(new ItemStack(Items.POTION), Potions.WATER)); + } else { + return super.a(isourceblock, itemstack); + } + } +- })); +- BlockDispenser.a((IMaterial) Items.dq, (IDispenseBehavior) (new DispenseBehaviorMaybe() { ++ }); ++ BlockDispenser.a(Items.dq, new DispenseBehaviorMaybe() { + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); + World world = isourceblock.getWorld(); + IBlockData iblockdata = world.getType(blockposition); + + this.a(true); + if (iblockdata.a(Blocks.RESPAWN_ANCHOR)) { +- if ((Integer) iblockdata.get(BlockRespawnAnchor.a) != 4) { ++ if (iblockdata.get(BlockRespawnAnchor.a) != 4) { + BlockRespawnAnchor.a(world, blockposition, iblockdata); + itemstack.subtract(1); + } else { +@@ -911,8 +911,8 @@ public interface IDispenseBehavior { + return super.a(isourceblock, itemstack); + } + } +- })); +- BlockDispenser.a((IMaterial) Items.SHEARS.getItem(), (IDispenseBehavior) (new DispenseBehaviorShears())); ++ }); ++ BlockDispenser.a(Items.SHEARS.getItem(), new DispenseBehaviorShears()); + } + + static void a(ISourceBlock isourceblock, Entity entity, EnumDirection enumdirection) { +diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java +index 09e2ecb035fc724f35304460b67f303637b2860a..b668b27cffa943006ab052415d2c7ec8a1a87f0c 100644 +--- a/src/main/java/net/minecraft/server/IEntityAccess.java ++++ b/src/main/java/net/minecraft/server/IEntityAccess.java +@@ -171,17 +171,17 @@ public interface IEntityAccess { + + @Nullable + default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving) { +- return (EntityHuman) this.a(this.getPlayers(), pathfindertargetcondition, entityliving, entityliving.locX(), entityliving.locY(), entityliving.locZ()); ++ return this.a(this.getPlayers(), pathfindertargetcondition, entityliving, entityliving.locX(), entityliving.locY(), entityliving.locZ()); + } + + @Nullable + default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, double d0, double d1, double d2) { +- return (EntityHuman) this.a(this.getPlayers(), pathfindertargetcondition, entityliving, d0, d1, d2); ++ return this.a(this.getPlayers(), pathfindertargetcondition, entityliving, d0, d1, d2); + } + + @Nullable + default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, double d0, double d1, double d2) { +- return (EntityHuman) this.a(this.getPlayers(), pathfindertargetcondition, (EntityLiving) null, d0, d1, d2); ++ return this.a(this.getPlayers(), pathfindertargetcondition, null, d0, d1, d2); + } + + @Nullable +@@ -256,7 +256,7 @@ public interface IEntityAccess { + default EntityHuman getPlayerByUUID(UUID uuid) { + // Paper end + for (int i = 0; i < this.getPlayers().size(); ++i) { +- EntityHuman entityhuman = (EntityHuman) this.getPlayers().get(i); ++ EntityHuman entityhuman = this.getPlayers().get(i); + + if (uuid.equals(entityhuman.getUniqueID())) { + return entityhuman; +diff --git a/src/main/java/net/minecraft/server/IEntityAngerable.java b/src/main/java/net/minecraft/server/IEntityAngerable.java +index d8b8670c83816b2233a61b451cec4b08d21101c3..9d58c3854e1ed1c007b9529aaa6d27c5a8eaa1e9 100644 +--- a/src/main/java/net/minecraft/server/IEntityAngerable.java ++++ b/src/main/java/net/minecraft/server/IEntityAngerable.java +@@ -28,7 +28,7 @@ public interface IEntityAngerable { + default void a(WorldServer worldserver, NBTTagCompound nbttagcompound) { + this.setAnger(nbttagcompound.getInt("AngerTime")); + if (!nbttagcompound.b("AngryAt")) { +- this.setAngerTarget((UUID) null); ++ this.setAngerTarget(null); + } else { + UUID uuid = nbttagcompound.a("AngryAt"); + +@@ -96,9 +96,9 @@ public interface IEntityAngerable { + } + + default void pacify() { +- this.setLastDamager((EntityLiving) null); +- this.setAngerTarget((UUID) null); +- this.setGoalTarget((EntityLiving) null, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit ++ this.setLastDamager(null); ++ this.setAngerTarget(null); ++ this.setGoalTarget(null, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit + this.setAnger(0); + } + +diff --git a/src/main/java/net/minecraft/server/IOWorker.java b/src/main/java/net/minecraft/server/IOWorker.java +index 907916f8ce8021b0f0007bb6e1cda9287163d0cc..b1ce83c0db7bc9263b128d68e207fb2e56741aee 100644 +--- a/src/main/java/net/minecraft/server/IOWorker.java ++++ b/src/main/java/net/minecraft/server/IOWorker.java +@@ -34,8 +34,8 @@ public class IOWorker implements AutoCloseable { + + public CompletableFuture a(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) { + return this.a(() -> { +- IOWorker.a ioworker_a = (IOWorker.a) this.e.computeIfAbsent(chunkcoordintpair, (chunkcoordintpair1) -> { +- return new IOWorker.a(nbttagcompound); ++ IOWorker.a ioworker_a = this.e.computeIfAbsent(chunkcoordintpair, (chunkcoordintpair1) -> { ++ return new a(nbttagcompound); + }); + + ioworker_a.a = nbttagcompound; +@@ -46,7 +46,7 @@ public class IOWorker implements AutoCloseable { + @Nullable + public NBTTagCompound a(ChunkCoordIntPair chunkcoordintpair) throws IOException { + CompletableFuture completablefuture = this.a(() -> { +- IOWorker.a ioworker_a = (IOWorker.a) this.e.get(chunkcoordintpair); ++ IOWorker.a ioworker_a = this.e.get(chunkcoordintpair); + + if (ioworker_a != null) { + return Either.left(ioworker_a.a); +@@ -80,7 +80,7 @@ public class IOWorker implements AutoCloseable { + CompletableFuture voidCompletableFuture = ioworker_a.b; + list.add(voidCompletableFuture); + } +- return Either.left(CompletableFuture.allOf((CompletableFuture[]) list.toArray(new CompletableFuture[0]))); ++ return Either.left(CompletableFuture.allOf(list.toArray(new CompletableFuture[0]))); + }).thenCompose(Function.identity()); + + return completablefuture.thenCompose((ovoid) -> { +@@ -112,10 +112,10 @@ public class IOWorker implements AutoCloseable { + Iterator> iterator = this.e.entrySet().iterator(); + + if (iterator.hasNext()) { +- Entry entry = (Entry) iterator.next(); ++ Entry entry = iterator.next(); + + iterator.remove(); +- this.a((ChunkCoordIntPair) entry.getKey(), (IOWorker.a) entry.getValue()); ++ this.a(entry.getKey(), entry.getValue()); + this.c(); + } + } +diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java +index 28f53508f91b6a3412b8b3cfb8f7e70f0727053f..5dbb8c973b3599c18ebd07050e90424a10a7f195 100644 +--- a/src/main/java/net/minecraft/server/IProjectile.java ++++ b/src/main/java/net/minecraft/server/IProjectile.java +@@ -107,7 +107,7 @@ public abstract class IProjectile extends Entity { + float f2 = MathHelper.sqrt(b(vec3d)); + + this.yaw = (float) (MathHelper.d(vec3d.x, vec3d.z) * 57.2957763671875D); +- this.pitch = (float) (MathHelper.d(vec3d.y, (double) f2) * 57.2957763671875D); ++ this.pitch = (float) (MathHelper.d(vec3d.y, f2) * 57.2957763671875D); + this.lastYaw = this.yaw; + this.lastPitch = this.pitch; + } +@@ -117,7 +117,7 @@ public abstract class IProjectile extends Entity { + float f6 = -MathHelper.sin((f + f2) * 0.017453292F); + float f7 = MathHelper.cos(f1 * 0.017453292F) * MathHelper.cos(f * 0.017453292F); + +- this.shoot((double) f5, (double) f6, (double) f7, f3, f4); ++ this.shoot(f5, f6, f7, f3, f4); + Vec3D vec3d = entity.getMot(); + + if (!entity.world.paperConfig.disableRelativeProjectileVelocity) this.setMot(this.getMot().add(vec3d.x, entity.isOnGround() ? 0.0D : vec3d.y, vec3d.z)); // Paper - allow disabling relative velocity +@@ -163,7 +163,7 @@ public abstract class IProjectile extends Entity { + Vec3D vec3d = this.getMot(); + float f = MathHelper.sqrt(b(vec3d)); + +- this.pitch = e(this.lastPitch, (float) (MathHelper.d(vec3d.y, (double) f) * 57.2957763671875D)); ++ this.pitch = e(this.lastPitch, (float) (MathHelper.d(vec3d.y, f) * 57.2957763671875D)); + this.yaw = e(this.lastYaw, (float) (MathHelper.d(vec3d.x, vec3d.z) * 57.2957763671875D)); + } + +diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java +index a2475bd55975445fc1e412d45720d5d1ff0e4553..b7ed906bfeaaa47b9f3d51671f1e447b2884ec66 100644 +--- a/src/main/java/net/minecraft/server/IWorldReader.java ++++ b/src/main/java/net/minecraft/server/IWorldReader.java +@@ -69,7 +69,7 @@ public interface IWorldReader extends IBlockLightAccess, ICollisionAccess, Biome + for (blockposition1 = blockposition1.down(); blockposition1.getY() > blockposition.getY(); blockposition1 = blockposition1.down()) { + IBlockData iblockdata = this.getType(blockposition1); + +- if (iblockdata.b((IBlockAccess) this, blockposition1) > 0 && !iblockdata.getMaterial().isLiquid()) { ++ if (iblockdata.b(this, blockposition1) > 0 && !iblockdata.getMaterial().isLiquid()) { + return false; + } + } +@@ -107,7 +107,7 @@ public interface IWorldReader extends IBlockLightAccess, ICollisionAccess, Biome + } + + default boolean A(BlockPosition blockposition) { +- return this.getFluid(blockposition).a((Tag) TagsFluid.WATER); ++ return this.getFluid(blockposition).a(TagsFluid.WATER); + } + + default boolean containsLiquid(AxisAlignedBB axisalignedbb) { +diff --git a/src/main/java/net/minecraft/server/IWorldWriter.java b/src/main/java/net/minecraft/server/IWorldWriter.java +index 25b55b6efc2d5b4e6dbe05b6eba16ac4ad436998..f869a22f8cea4219bfb6078dc819326a3eb98641 100644 +--- a/src/main/java/net/minecraft/server/IWorldWriter.java ++++ b/src/main/java/net/minecraft/server/IWorldWriter.java +@@ -13,7 +13,7 @@ public interface IWorldWriter { + boolean a(BlockPosition blockposition, boolean flag); + + default boolean b(BlockPosition blockposition, boolean flag) { +- return this.a(blockposition, flag, (Entity) null); ++ return this.a(blockposition, flag, null); + } + + default boolean a(BlockPosition blockposition, boolean flag, @Nullable Entity entity) { +diff --git a/src/main/java/net/minecraft/server/InventoryCraftResult.java b/src/main/java/net/minecraft/server/InventoryCraftResult.java +index 0948a829e72d26f47f4578fb3defc7dedf92c917..b36bf589d76dda347586a9240d791bcf7d1030a7 100644 +--- a/src/main/java/net/minecraft/server/InventoryCraftResult.java ++++ b/src/main/java/net/minecraft/server/InventoryCraftResult.java +@@ -74,7 +74,7 @@ public class InventoryCraftResult implements IInventory, RecipeHolder { + + @Override + public ItemStack getItem(int i) { +- return (ItemStack) this.items.get(0); ++ return this.items.get(0); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/InventoryCrafting.java b/src/main/java/net/minecraft/server/InventoryCrafting.java +index 1e29bf073058291b80d0a41b91b6e1690a861535..054035f9aea9a7388267d22b19ec2332589e48c4 100644 +--- a/src/main/java/net/minecraft/server/InventoryCrafting.java ++++ b/src/main/java/net/minecraft/server/InventoryCrafting.java +@@ -109,7 +109,7 @@ public class InventoryCrafting implements IInventory, AutoRecipeOutput { + + @Override + public ItemStack getItem(int i) { +- return i >= this.getSize() ? ItemStack.b : (ItemStack) this.items.get(i); ++ return i >= this.getSize() ? ItemStack.b : this.items.get(i); + } + + @Override +@@ -122,7 +122,7 @@ public class InventoryCrafting implements IInventory, AutoRecipeOutput { + ItemStack itemstack = ContainerUtil.a(this.items, i, j); + + if (!itemstack.isEmpty()) { +- this.container.a((IInventory) this); ++ this.container.a(this); + } + + return itemstack; +@@ -131,7 +131,7 @@ public class InventoryCrafting implements IInventory, AutoRecipeOutput { + @Override + public void setItem(int i, ItemStack itemstack) { + this.items.set(i, itemstack); +- this.container.a((IInventory) this); ++ this.container.a(this); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/InventoryMerchant.java b/src/main/java/net/minecraft/server/InventoryMerchant.java +index 9da614417d915d410335cf9bbcfca9343c36dd55..057159b615384af6c8b87a425523938e1d8e825e 100644 +--- a/src/main/java/net/minecraft/server/InventoryMerchant.java ++++ b/src/main/java/net/minecraft/server/InventoryMerchant.java +@@ -33,7 +33,7 @@ public class InventoryMerchant implements IInventory { + + public void onClose(CraftHumanEntity who) { + transaction.remove(who); +- merchant.setTradingPlayer((EntityHuman) null); // SPIGOT-4860 ++ merchant.setTradingPlayer(null); // SPIGOT-4860 + } + + public List getViewers() { +@@ -88,12 +88,12 @@ public class InventoryMerchant implements IInventory { + + @Override + public ItemStack getItem(int i) { +- return (ItemStack) this.itemsInSlots.get(i); ++ return this.itemsInSlots.get(i); + } + + @Override + public ItemStack splitStack(int i, int j) { +- ItemStack itemstack = (ItemStack) this.itemsInSlots.get(i); ++ ItemStack itemstack = this.itemsInSlots.get(i); + + if (i == 2 && !itemstack.isEmpty()) { + return ContainerUtil.a(this.itemsInSlots, i, itemstack.getCount()); +@@ -145,12 +145,12 @@ public class InventoryMerchant implements IInventory { + ItemStack itemstack; + ItemStack itemstack1; + +- if (((ItemStack) this.itemsInSlots.get(0)).isEmpty()) { +- itemstack = (ItemStack) this.itemsInSlots.get(1); ++ if (this.itemsInSlots.get(0).isEmpty()) { ++ itemstack = this.itemsInSlots.get(1); + itemstack1 = ItemStack.b; + } else { +- itemstack = (ItemStack) this.itemsInSlots.get(0); +- itemstack1 = (ItemStack) this.itemsInSlots.get(1); ++ itemstack = this.itemsInSlots.get(0); ++ itemstack1 = this.itemsInSlots.get(1); + } + + if (itemstack.isEmpty()) { +diff --git a/src/main/java/net/minecraft/server/InventorySubcontainer.java b/src/main/java/net/minecraft/server/InventorySubcontainer.java +index b9d1c0d48c2fd0e2b423b99447a4b8d551077f08..1e0b009cebe6f069706cfba6c242d31fbab49a4d 100644 +--- a/src/main/java/net/minecraft/server/InventorySubcontainer.java ++++ b/src/main/java/net/minecraft/server/InventorySubcontainer.java +@@ -85,7 +85,7 @@ public class InventorySubcontainer implements IInventory, AutoRecipeOutput { + + @Override + public ItemStack getItem(int i) { +- return i >= 0 && i < this.items.size() ? (ItemStack) this.items.get(i) : ItemStack.b; ++ return i >= 0 && i < this.items.size() ? this.items.get(i) : ItemStack.b; + } + + public List f() { +@@ -95,7 +95,7 @@ public class InventorySubcontainer implements IInventory, AutoRecipeOutput { + result.add(itemstack); + } + } +- List list = (List) result; ++ List list = result; + + this.clear(); + return list; +@@ -166,7 +166,7 @@ public class InventorySubcontainer implements IInventory, AutoRecipeOutput { + + @Override + public ItemStack splitWithoutUpdate(int i) { +- ItemStack itemstack = (ItemStack) this.items.get(i); ++ ItemStack itemstack = this.items.get(i); + + if (itemstack.isEmpty()) { + return ItemStack.b; +@@ -252,7 +252,7 @@ public class InventorySubcontainer implements IInventory, AutoRecipeOutput { + list.add(itemstack); + } + } +- return ((List) list).toString(); ++ return list.toString(); + } + + private void c(ItemStack itemstack) { +diff --git a/src/main/java/net/minecraft/server/ItemArmor.java b/src/main/java/net/minecraft/server/ItemArmor.java +index 9aeecdafeed5b4bd7b13b91cfa71456e0719bcf0..c54ce15e3ec2357b7b474d1f5a3a98a5b4f9f59b 100644 +--- a/src/main/java/net/minecraft/server/ItemArmor.java ++++ b/src/main/java/net/minecraft/server/ItemArmor.java +@@ -27,13 +27,13 @@ public class ItemArmor extends Item implements ItemWearable { + private final Multimap m; + + public static boolean a(ISourceBlock isourceblock, ItemStack itemstack) { +- BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ BlockPosition blockposition = isourceblock.getBlockPosition().shift(isourceblock.getBlockData().get(BlockDispenser.FACING)); + List list = isourceblock.getWorld().a(EntityLiving.class, new AxisAlignedBB(blockposition), IEntitySelector.g.and(new IEntitySelector.EntitySelectorEquipable(itemstack))); + + if (list.isEmpty()) { + return false; + } else { +- EntityLiving entityliving = (EntityLiving) list.get(0); ++ EntityLiving entityliving = list.get(0); + EnumItemSlot enumitemslot = EntityInsentient.j(itemstack); + ItemStack itemstack1 = itemstack.cloneAndSubtract(1); + // CraftBukkit start +@@ -55,7 +55,7 @@ public class ItemArmor extends Item implements ItemWearable { + itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != ItemArmor.a) { + idispensebehavior.dispense(isourceblock, eventStack); + return true; +@@ -80,14 +80,14 @@ public class ItemArmor extends Item implements ItemWearable { + this.k = armormaterial.b(enumitemslot); + this.l = armormaterial.e(); + this.c = armormaterial.f(); +- BlockDispenser.a((IMaterial) this, ItemArmor.a); ++ BlockDispenser.a(this, ItemArmor.a); + Builder builder = ImmutableMultimap.builder(); + UUID uuid = ItemArmor.j[enumitemslot.b()]; + +- builder.put(GenericAttributes.ARMOR, new AttributeModifier(uuid, "Armor modifier", (double) this.k, AttributeModifier.Operation.ADDITION)); +- builder.put(GenericAttributes.ARMOR_TOUGHNESS, new AttributeModifier(uuid, "Armor toughness", (double) this.l, AttributeModifier.Operation.ADDITION)); ++ builder.put(GenericAttributes.ARMOR, new AttributeModifier(uuid, "Armor modifier", this.k, AttributeModifier.Operation.ADDITION)); ++ builder.put(GenericAttributes.ARMOR_TOUGHNESS, new AttributeModifier(uuid, "Armor toughness", this.l, AttributeModifier.Operation.ADDITION)); + if (armormaterial == EnumArmorMaterial.NETHERITE) { +- builder.put(GenericAttributes.KNOCKBACK_RESISTANCE, new AttributeModifier(uuid, "Armor knockback resistance", (double) this.c, AttributeModifier.Operation.ADDITION)); ++ builder.put(GenericAttributes.KNOCKBACK_RESISTANCE, new AttributeModifier(uuid, "Armor knockback resistance", this.c, AttributeModifier.Operation.ADDITION)); + } + + this.m = builder.build(); +diff --git a/src/main/java/net/minecraft/server/ItemArmorStand.java b/src/main/java/net/minecraft/server/ItemArmorStand.java +index f3df5d48bf1dc4f960d0bc60d4ea8f5b048dbe42..94f29e4461104ce7314b28d4591e01e66c278467 100644 +--- a/src/main/java/net/minecraft/server/ItemArmorStand.java ++++ b/src/main/java/net/minecraft/server/ItemArmorStand.java +@@ -19,7 +19,7 @@ public class ItemArmorStand extends Item { + BlockActionContext blockactioncontext = new BlockActionContext(itemactioncontext); + BlockPosition blockposition = blockactioncontext.getClickPosition(); + ItemStack itemstack = itemactioncontext.getItemStack(); +- EntityArmorStand entityarmorstand = (EntityArmorStand) EntityTypes.ARMOR_STAND.createCreature(world, itemstack.getTag(), (IChatBaseComponent) null, itemactioncontext.getEntity(), blockposition, EnumMobSpawn.SPAWN_EGG, true, true); ++ EntityArmorStand entityarmorstand = EntityTypes.ARMOR_STAND.createCreature(world, itemstack.getTag(), null, itemactioncontext.getEntity(), blockposition, EnumMobSpawn.SPAWN_EGG, true, true); + + if (world.getCubes(entityarmorstand) && world.getEntities(entityarmorstand, entityarmorstand.getBoundingBox()).isEmpty()) { + if (!world.isClientSide) { +@@ -33,7 +33,7 @@ public class ItemArmorStand extends Item { + } + // CraftBukkit end + world.addEntity(entityarmorstand); +- world.playSound((EntityHuman) null, entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F); ++ world.playSound(null, entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F); + } + + itemstack.subtract(1); +diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java +index 8425d58ccae4d1462e225ef7f0e4d25ce26ac43c..4a7ed4ffbe9746cf2f41a6dc04b6fc0505673fe3 100644 +--- a/src/main/java/net/minecraft/server/ItemBlock.java ++++ b/src/main/java/net/minecraft/server/ItemBlock.java +@@ -145,14 +145,14 @@ public class ItemBlock extends Item { + } + + private static > IBlockData a(IBlockData iblockdata, IBlockState iblockstate, String s) { +- return (IBlockData) iblockstate.b(s).map((comparable) -> { +- return (IBlockData) iblockdata.set(iblockstate, comparable); ++ return iblockstate.b(s).map((comparable) -> { ++ return iblockdata.set(iblockstate, comparable); + }).orElse(iblockdata); + } + + protected boolean b(BlockActionContext blockactioncontext, IBlockData iblockdata) { + EntityHuman entityhuman = blockactioncontext.getEntity(); +- VoxelShapeCollision voxelshapecollision = entityhuman == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a((Entity) entityhuman); ++ VoxelShapeCollision voxelshapecollision = entityhuman == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a(entityhuman); + // CraftBukkit start - store default return + World world = blockactioncontext.getWorld(); // Paper + boolean defaultReturn = (!this.isCheckCollisions() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && world.checkEntityCollision(iblockdata, entityhuman, voxelshapecollision, blockactioncontext.getClickPosition(), true); // Paper +diff --git a/src/main/java/net/minecraft/server/ItemBoat.java b/src/main/java/net/minecraft/server/ItemBoat.java +index d53f86d7dd4d8eb26482129b5a6900c48ba92f97..4997fef980a4b996ce2470ec2da06488a010a5c5 100644 +--- a/src/main/java/net/minecraft/server/ItemBoat.java ++++ b/src/main/java/net/minecraft/server/ItemBoat.java +@@ -32,7 +32,7 @@ public class ItemBoat extends Item { + + while (iterator.hasNext()) { + Entity entity = (Entity) iterator.next(); +- AxisAlignedBB axisalignedbb = entity.getBoundingBox().g((double) entity.bc()); ++ AxisAlignedBB axisalignedbb = entity.getBoundingBox().g(entity.bc()); + + if (axisalignedbb.d(vec3d1)) { + return InteractionResultWrapper.pass(itemstack); +diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java +index b3cb832be6db70922c5495476e89124d75c9ed6d..912b1633fe0d29b687a30604a1b34b77fdc0b297 100644 +--- a/src/main/java/net/minecraft/server/ItemBow.java ++++ b/src/main/java/net/minecraft/server/ItemBow.java +@@ -28,8 +28,8 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { + + boolean consumeArrow = true; // Paper + if (!world.isClientSide) { +- ItemArrow itemarrow = (ItemArrow) ((ItemArrow) (itemstack1.getItem() instanceof ItemArrow ? itemstack1.getItem() : Items.ARROW)); +- EntityArrow entityarrow = itemarrow.a(world, itemstack1, (EntityLiving) entityhuman); ++ ItemArrow itemarrow = (ItemArrow) (itemstack1.getItem() instanceof ItemArrow ? itemstack1.getItem() : Items.ARROW); ++ EntityArrow entityarrow = itemarrow.a(world, itemstack1, entityhuman); + + entityarrow.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, f * 3.0F, 1.0F); + if (f == 1.0F) { +@@ -79,7 +79,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { + // CraftBukkit end + } + +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.RANDOM.nextFloat() * 0.4F + 1.2F) + f * 0.5F); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (Item.RANDOM.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + if (!flag1 && !entityhuman.abilities.canInstantlyBuild && consumeArrow) { // Paper + itemstack1.subtract(1); + if (itemstack1.isEmpty()) { +@@ -129,7 +129,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { + + @Override + public Predicate b() { +- return ItemBow.a; ++ return ItemProjectileWeapon.a; + } + + @Override +diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java +index 6697cfb7cf32cc2a86993a9d59aec056ac493c30..7509b08123b96505ffea65bfcbc28045145ef92f 100644 +--- a/src/main/java/net/minecraft/server/ItemBucket.java ++++ b/src/main/java/net/minecraft/server/ItemBucket.java +@@ -28,7 +28,7 @@ public class ItemBucket extends Item { + } else if (movingobjectpositionblock.getType() != MovingObjectPosition.EnumMovingObjectType.BLOCK) { + return InteractionResultWrapper.pass(itemstack); + } else { +- MovingObjectPositionBlock movingobjectpositionblock1 = (MovingObjectPositionBlock) movingobjectpositionblock; ++ MovingObjectPositionBlock movingobjectpositionblock1 = movingobjectpositionblock; + BlockPosition blockposition = movingobjectpositionblock1.getBlockPosition(); + EnumDirection enumdirection = movingobjectpositionblock1.getDirection(); + BlockPosition blockposition1 = blockposition.shift(enumdirection); +@@ -41,7 +41,7 @@ public class ItemBucket extends Item { + if (iblockdata.getBlock() instanceof IFluidSource) { + // CraftBukkit start + FluidType dummyFluid = ((IFluidSource) iblockdata.getBlock()).removeFluid(DummyGeneratorAccess.INSTANCE, blockposition, iblockdata); +- PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) world, entityhuman, blockposition, blockposition, movingobjectpositionblock.getDirection(), itemstack, dummyFluid.a(), enumhand); // Paper - add enumhand ++ PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(world, entityhuman, blockposition, blockposition, movingobjectpositionblock.getDirection(), itemstack, dummyFluid.a(), enumhand); // Paper - add enumhand + + if (event.isCancelled()) { + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-5163 (see PlayerInteractManager) +@@ -53,7 +53,7 @@ public class ItemBucket extends Item { + + if (fluidtype != FluidTypes.EMPTY) { + entityhuman.b(StatisticList.ITEM_USED.b(this)); +- entityhuman.playSound(fluidtype.a((Tag) TagsFluid.LAVA) ? SoundEffects.ITEM_BUCKET_FILL_LAVA : SoundEffects.ITEM_BUCKET_FILL, 1.0F, 1.0F); ++ entityhuman.playSound(fluidtype.a(TagsFluid.LAVA) ? SoundEffects.ITEM_BUCKET_FILL_LAVA : SoundEffects.ITEM_BUCKET_FILL, 1.0F, 1.0F); + ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit + + if (!world.isClientSide) { +@@ -112,7 +112,7 @@ public class ItemBucket extends Item { + + // CraftBukkit start + if (flag1 && entityhuman != null) { +- PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent((WorldServer) world, entityhuman, blockposition, clicked, enumdirection, itemstack, enumhand); // Paper - add enumhand ++ PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(world, entityhuman, blockposition, clicked, enumdirection, itemstack, enumhand); // Paper - add enumhand + if (event.isCancelled()) { + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541 +@@ -121,8 +121,8 @@ public class ItemBucket extends Item { + } + // CraftBukkit end + if (!flag1) { +- return movingobjectpositionblock != null && this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), (MovingObjectPositionBlock) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumhand +- } else if (world.getDimensionManager().isNether() && this.fluidType.a((Tag) TagsFluid.WATER)) { ++ return movingobjectpositionblock != null && this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumhand ++ } else if (world.getDimensionManager().isNether() && this.fluidType.a(TagsFluid.WATER)) { + int i = blockposition.getX(); + int j = blockposition.getY(); + int k = blockposition.getZ(); +@@ -136,7 +136,7 @@ public class ItemBucket extends Item { + return true; + } else if (block instanceof IFluidContainer && this.fluidType == FluidTypes.WATER) { + ((IFluidContainer) block).place(world, blockposition, iblockdata, ((FluidTypeFlowing) this.fluidType).a(false)); +- this.a(entityhuman, (GeneratorAccess) world, blockposition); ++ this.a(entityhuman, world, blockposition); + return true; + } else { + if (!world.isClientSide && flag && !material.isLiquid()) { +@@ -146,7 +146,7 @@ public class ItemBucket extends Item { + if (!world.setTypeAndData(blockposition, this.fluidType.h().getBlockData(), 11) && !iblockdata.getFluid().isSource()) { + return false; + } else { +- this.a(entityhuman, (GeneratorAccess) world, blockposition); ++ this.a(entityhuman, world, blockposition); + return true; + } + } +@@ -154,7 +154,7 @@ public class ItemBucket extends Item { + } + + protected void a(@Nullable EntityHuman entityhuman, GeneratorAccess generatoraccess, BlockPosition blockposition) { +- SoundEffect soundeffect = this.fluidType.a((Tag) TagsFluid.LAVA) ? SoundEffects.ITEM_BUCKET_EMPTY_LAVA : SoundEffects.ITEM_BUCKET_EMPTY; ++ SoundEffect soundeffect = this.fluidType.a(TagsFluid.LAVA) ? SoundEffects.ITEM_BUCKET_EMPTY_LAVA : SoundEffects.ITEM_BUCKET_EMPTY; + + generatoraccess.playSound(entityhuman, blockposition, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F); + } +diff --git a/src/main/java/net/minecraft/server/ItemChorusFruit.java b/src/main/java/net/minecraft/server/ItemChorusFruit.java +index 6faaeca386e7ea62acc79be01c12fa6df0b343d7..6b21280c0d2e196ae1c62c0c331e64aa69dcbb81 100644 +--- a/src/main/java/net/minecraft/server/ItemChorusFruit.java ++++ b/src/main/java/net/minecraft/server/ItemChorusFruit.java +@@ -23,7 +23,7 @@ public class ItemChorusFruit extends Item { + + for (int i = 0; i < 16; ++i) { + double d3 = entityliving.locX() + (entityliving.getRandom().nextDouble() - 0.5D) * 16.0D; +- double d4 = MathHelper.a(entityliving.locY() + (double) (entityliving.getRandom().nextInt(16) - 8), 0.0D, (double) (world.getHeight() - 1)); ++ double d4 = MathHelper.a(entityliving.locY() + (double) (entityliving.getRandom().nextInt(16) - 8), 0.0D, world.getHeight() - 1); + double d5 = entityliving.locZ() + (entityliving.getRandom().nextDouble() - 0.5D) * 16.0D; + + // CraftBukkit start +@@ -47,7 +47,7 @@ public class ItemChorusFruit extends Item { + if (entityliving.a(d3, d4, d5, true)) { + SoundEffect soundeffect = entityliving instanceof EntityFox ? SoundEffects.ENTITY_FOX_TELEPORT : SoundEffects.ITEM_CHORUS_FRUIT_TELEPORT; + +- world.playSound((EntityHuman) null, d0, d1, d2, soundeffect, SoundCategory.PLAYERS, 1.0F, 1.0F); ++ world.playSound(null, d0, d1, d2, soundeffect, SoundCategory.PLAYERS, 1.0F, 1.0F); + entityliving.playSound(soundeffect, 1.0F, 1.0F); + break; + } +diff --git a/src/main/java/net/minecraft/server/ItemCrossbow.java b/src/main/java/net/minecraft/server/ItemCrossbow.java +index 4e5d09d2d43aca5cfd7f284120043293e82009a3..d9bfad120c167353e9090b8f1305100ec45a3d55 100644 +--- a/src/main/java/net/minecraft/server/ItemCrossbow.java ++++ b/src/main/java/net/minecraft/server/ItemCrossbow.java +@@ -17,12 +17,12 @@ public class ItemCrossbow extends ItemProjectileWeapon implements ItemVanishable + + @Override + public Predicate e() { +- return ItemCrossbow.b; ++ return ItemProjectileWeapon.b; + } + + @Override + public Predicate b() { +- return ItemCrossbow.a; ++ return ItemProjectileWeapon.a; + } + + @Override +@@ -55,7 +55,7 @@ public class ItemCrossbow extends ItemProjectileWeapon implements ItemVanishable + a(itemstack, true); + SoundCategory soundcategory = entityliving instanceof EntityHuman ? SoundCategory.PLAYERS : SoundCategory.HOSTILE; + +- world.playSound((EntityHuman) null, entityliving.locX(), entityliving.locY(), entityliving.locZ(), SoundEffects.ITEM_CROSSBOW_LOADING_END, soundcategory, 1.0F, 1.0F / (ItemCrossbow.RANDOM.nextFloat() * 0.5F + 1.0F) + 0.2F); ++ world.playSound(null, entityliving.locX(), entityliving.locY(), entityliving.locZ(), SoundEffects.ITEM_CROSSBOW_LOADING_END, soundcategory, 1.0F, 1.0F / (Item.RANDOM.nextFloat() * 0.5F + 1.0F) + 0.2F); + } + + } +@@ -206,7 +206,7 @@ public class ItemCrossbow extends ItemProjectileWeapon implements ItemVanishable + Vector3fa vector3fa = new Vector3fa(vec3d1); + + vector3fa.a(quaternion); +- ((IProjectile) object).shoot((double) vector3fa.a(), (double) vector3fa.b(), (double) vector3fa.c(), f1, f2); ++ ((IProjectile) object).shoot(vector3fa.a(), vector3fa.b(), vector3fa.c(), f1, f2); + } + // CraftBukkit start + org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(entityliving, itemstack, itemstack1, (IProjectile) object, f); // Paper // TODO: consume?? +@@ -229,12 +229,12 @@ public class ItemCrossbow extends ItemProjectileWeapon implements ItemVanishable + } + } + // CraftBukkit end +- world.playSound((EntityHuman) null, entityliving.locX(), entityliving.locY(), entityliving.locZ(), SoundEffects.ITEM_CROSSBOW_SHOOT, SoundCategory.PLAYERS, 1.0F, f); ++ world.playSound(null, entityliving.locX(), entityliving.locY(), entityliving.locZ(), SoundEffects.ITEM_CROSSBOW_SHOOT, SoundCategory.PLAYERS, 1.0F, f); + } + } + + private static EntityArrow a(World world, EntityLiving entityliving, ItemStack itemstack, ItemStack itemstack1) { +- ItemArrow itemarrow = (ItemArrow) ((ItemArrow) (itemstack1.getItem() instanceof ItemArrow ? itemstack1.getItem() : Items.ARROW)); ++ ItemArrow itemarrow = (ItemArrow) (itemstack1.getItem() instanceof ItemArrow ? itemstack1.getItem() : Items.ARROW); + EntityArrow entityarrow = itemarrow.a(world, itemstack1, entityliving); + + if (entityliving instanceof EntityHuman) { +@@ -257,7 +257,7 @@ public class ItemCrossbow extends ItemProjectileWeapon implements ItemVanishable + float[] afloat = a(entityliving.getRandom()); + + for (int i = 0; i < list.size(); ++i) { +- ItemStack itemstack1 = (ItemStack) list.get(i); ++ ItemStack itemstack1 = list.get(i); + boolean flag = entityliving instanceof EntityHuman && ((EntityHuman) entityliving).abilities.canInstantlyBuild; + + if (!itemstack1.isEmpty()) { +@@ -283,7 +283,7 @@ public class ItemCrossbow extends ItemProjectileWeapon implements ItemVanishable + private static float a(boolean flag) { + float f = flag ? 0.63F : 0.43F; + +- return 1.0F / (ItemCrossbow.RANDOM.nextFloat() * 0.5F + 1.8F) + f; ++ return 1.0F / (Item.RANDOM.nextFloat() * 0.5F + 1.8F) + f; + } + + private static void a(World world, EntityLiving entityliving, ItemStack itemstack) { +@@ -315,12 +315,12 @@ public class ItemCrossbow extends ItemProjectileWeapon implements ItemVanishable + + if (f >= 0.2F && !this.c) { + this.c = true; +- world.playSound((EntityHuman) null, entityliving.locX(), entityliving.locY(), entityliving.locZ(), soundeffect, SoundCategory.PLAYERS, 0.5F, 1.0F); ++ world.playSound(null, entityliving.locX(), entityliving.locY(), entityliving.locZ(), soundeffect, SoundCategory.PLAYERS, 0.5F, 1.0F); + } + + if (f >= 0.5F && soundeffect1 != null && !this.d) { + this.d = true; +- world.playSound((EntityHuman) null, entityliving.locX(), entityliving.locY(), entityliving.locZ(), soundeffect1, SoundCategory.PLAYERS, 0.5F, 1.0F); ++ world.playSound(null, entityliving.locX(), entityliving.locY(), entityliving.locZ(), soundeffect1, SoundCategory.PLAYERS, 0.5F, 1.0F); + } + } + +diff --git a/src/main/java/net/minecraft/server/ItemDebugStick.java b/src/main/java/net/minecraft/server/ItemDebugStick.java +index 480dbd68605a0d2ff6423ddb99a75b5a516ab600..4bddd5d64ef4ceddfa69f26a5858708bf70fc535 100644 +--- a/src/main/java/net/minecraft/server/ItemDebugStick.java ++++ b/src/main/java/net/minecraft/server/ItemDebugStick.java +@@ -45,7 +45,7 @@ public class ItemDebugStick extends Item { + String s = IRegistry.BLOCK.getKey(block).toString(); + + if (collection.isEmpty()) { +- a(entityhuman, (IChatBaseComponent) (new ChatMessage(this.getName() + ".empty", new Object[]{s}))); ++ a(entityhuman, new ChatMessage(this.getName() + ".empty", new Object[]{s})); + } else { + NBTTagCompound nbttagcompound = itemstack.a("DebugProperty"); + String s1 = nbttagcompound.getString(s); +@@ -53,19 +53,19 @@ public class ItemDebugStick extends Item { + + if (flag) { + if (iblockstate == null) { +- iblockstate = (IBlockState) collection.iterator().next(); ++ iblockstate = collection.iterator().next(); + } + + IBlockData iblockdata1 = a(iblockdata, iblockstate, entityhuman.ep()); + + generatoraccess.setTypeAndData(blockposition, iblockdata1, 18); +- a(entityhuman, (IChatBaseComponent) (new ChatMessage(this.getName() + ".update", new Object[]{iblockstate.getName(), a(iblockdata1, iblockstate)}))); ++ a(entityhuman, new ChatMessage(this.getName() + ".update", new Object[]{iblockstate.getName(), a(iblockdata1, iblockstate)})); + } else { + iblockstate = (IBlockState) a((Iterable) collection, (Object) iblockstate, entityhuman.ep()); + String s2 = iblockstate.getName(); + + nbttagcompound.setString(s, s2); +- a(entityhuman, (IChatBaseComponent) (new ChatMessage(this.getName() + ".select", new Object[]{s2, a(iblockdata, iblockstate)}))); ++ a(entityhuman, new ChatMessage(this.getName() + ".select", new Object[]{s2, a(iblockdata, iblockstate)})); + } + + } +@@ -73,7 +73,7 @@ public class ItemDebugStick extends Item { + } + + private static > IBlockData a(IBlockData iblockdata, IBlockState iblockstate, boolean flag) { +- return (IBlockData) iblockdata.set(iblockstate, a(iblockstate.getValues(), iblockdata.get(iblockstate), flag)); ++ return iblockdata.set(iblockstate, a(iblockstate.getValues(), iblockdata.get(iblockstate), flag)); + } + + private static T a(Iterable iterable, @Nullable T t0, boolean flag) { +diff --git a/src/main/java/net/minecraft/server/ItemDye.java b/src/main/java/net/minecraft/server/ItemDye.java +index 64e63663e65bc4ab1e975f9b61c547fb270eb092..f5ca944c0b507856c89007211fcc9c6194c1297d 100644 +--- a/src/main/java/net/minecraft/server/ItemDye.java ++++ b/src/main/java/net/minecraft/server/ItemDye.java +@@ -32,7 +32,7 @@ public class ItemDye extends Item { + return EnumInteractionResult.PASS; + } + +- entitysheep.setColor(EnumColor.fromColorIndex((byte) event.getColor().getWoolData())); ++ entitysheep.setColor(EnumColor.fromColorIndex(event.getColor().getWoolData())); + // CraftBukkit end + itemstack.subtract(1); + } +@@ -49,6 +49,6 @@ public class ItemDye extends Item { + } + + public static ItemDye a(EnumColor enumcolor) { +- return (ItemDye) ItemDye.a.get(enumcolor); ++ return ItemDye.a.get(enumcolor); + } + } +diff --git a/src/main/java/net/minecraft/server/ItemEgg.java b/src/main/java/net/minecraft/server/ItemEgg.java +index 6ddb0237c013e5c40d6c28a300f33443f6f703a5..533b463100e82350f78da97b918d94a87f873b96 100644 +--- a/src/main/java/net/minecraft/server/ItemEgg.java ++++ b/src/main/java/net/minecraft/server/ItemEgg.java +@@ -25,7 +25,7 @@ public class ItemEgg extends Item { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + entityhuman.b(StatisticList.ITEM_USED.b(this)); + } else { + if (entityhuman instanceof EntityPlayer) { +@@ -37,7 +37,7 @@ public class ItemEgg extends Item { + + + } +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.RANDOM.nextFloat() * 0.4F + 0.8F)); // CraftBukkit - from above ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Item.RANDOM.nextFloat() * 0.4F + 0.8F)); // CraftBukkit - from above + + /* // Paper start - moved up + entityhuman.b(StatisticList.ITEM_USED.b(this)); +diff --git a/src/main/java/net/minecraft/server/ItemEndCrystal.java b/src/main/java/net/minecraft/server/ItemEndCrystal.java +index f948cf01f804f0c310f5d261a5d8badc4d948fe9..addf602f14f41d59182814e2cea2f5ecb41fae10 100644 +--- a/src/main/java/net/minecraft/server/ItemEndCrystal.java ++++ b/src/main/java/net/minecraft/server/ItemEndCrystal.java +@@ -22,10 +22,10 @@ public class ItemEndCrystal extends Item { + if (!world.isEmpty(blockposition1)) { + return EnumInteractionResult.FAIL; + } else { +- double d0 = (double) blockposition1.getX(); +- double d1 = (double) blockposition1.getY(); +- double d2 = (double) blockposition1.getZ(); +- List list = world.getEntities((Entity) null, new AxisAlignedBB(d0, d1, d2, d0 + 1.0D, d1 + 2.0D, d2 + 1.0D)); ++ double d0 = blockposition1.getX(); ++ double d1 = blockposition1.getY(); ++ double d2 = blockposition1.getZ(); ++ List list = world.getEntities(null, new AxisAlignedBB(d0, d1, d2, d0 + 1.0D, d1 + 2.0D, d2 + 1.0D)); + + if (!list.isEmpty()) { + return EnumInteractionResult.FAIL; +diff --git a/src/main/java/net/minecraft/server/ItemEnderEye.java b/src/main/java/net/minecraft/server/ItemEnderEye.java +index 0685030128645a3c01a2b99b97368c951c2753fa..d61f4c6ab7285f2ee2b8d0d07fc89aef789553b1 100644 +--- a/src/main/java/net/minecraft/server/ItemEnderEye.java ++++ b/src/main/java/net/minecraft/server/ItemEnderEye.java +@@ -16,7 +16,7 @@ public class ItemEnderEye extends Item { + if (world.isClientSide) { + return EnumInteractionResult.SUCCESS; + } else { +- IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockEnderPortalFrame.EYE, true); ++ IBlockData iblockdata1 = iblockdata.set(BlockEnderPortalFrame.EYE, true); + + Block.a(iblockdata, iblockdata1, world, blockposition); + world.setTypeAndData(blockposition, iblockdata1, 2); +@@ -47,7 +47,7 @@ public class ItemEnderEye extends Item { + double deltaLength = Math.sqrt(distanceSquared); + double relativeX = player.locX() + (deltaX / deltaLength) * viewDistance; + double relativeZ = player.locZ() + (deltaZ / deltaLength) * viewDistance; +- player.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1038, new BlockPosition((int) relativeX, (int) soundPos.getY(), (int) relativeZ), 0, true)); ++ player.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1038, new BlockPosition((int) relativeX, soundPos.getY(), (int) relativeZ), 0, true)); + } else { + player.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1038, soundPos, 0, true)); + } +@@ -67,7 +67,7 @@ public class ItemEnderEye extends Item { + ItemStack itemstack = entityhuman.b(enumhand); + MovingObjectPositionBlock movingobjectpositionblock = a(world, entityhuman, RayTrace.FluidCollisionOption.NONE); + +- if (movingobjectpositionblock.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK && world.getType(((MovingObjectPositionBlock) movingobjectpositionblock).getBlockPosition()).a(Blocks.END_PORTAL_FRAME)) { ++ if (movingobjectpositionblock.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK && world.getType(movingobjectpositionblock.getBlockPosition()).a(Blocks.END_PORTAL_FRAME)) { + return InteractionResultWrapper.pass(itemstack); + } else { + entityhuman.c(enumhand); +@@ -88,8 +88,8 @@ public class ItemEnderEye extends Item { + CriterionTriggers.m.a((EntityPlayer) entityhuman, blockposition); + } + +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ENDER_EYE_LAUNCH, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderEye.RANDOM.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, 1003, entityhuman.getChunkCoordinates(), 0); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ENDER_EYE_LAUNCH, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Item.RANDOM.nextFloat() * 0.4F + 0.8F)); ++ world.a(null, 1003, entityhuman.getChunkCoordinates(), 0); + if (!entityhuman.abilities.canInstantlyBuild) { + itemstack.subtract(1); + } +diff --git a/src/main/java/net/minecraft/server/ItemEnderPearl.java b/src/main/java/net/minecraft/server/ItemEnderPearl.java +index 0e154ee2976694dacf8d41fcd831f21fbbda13af..3d0fd483268c07a9bb6918afdb8ca31c7ba27731 100644 +--- a/src/main/java/net/minecraft/server/ItemEnderPearl.java ++++ b/src/main/java/net/minecraft/server/ItemEnderPearl.java +@@ -25,7 +25,7 @@ public class ItemEnderPearl extends Item { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + entityhuman.b(StatisticList.ITEM_USED.b(this)); + entityhuman.getCooldownTracker().setCooldown(this, 20); + } else { +diff --git a/src/main/java/net/minecraft/server/ItemExpBottle.java b/src/main/java/net/minecraft/server/ItemExpBottle.java +index 10abf20e907f1ea25797ff33d181de7eaed9a9da..bd00abc69cb186a49b059702f229e6a2d644daef 100644 +--- a/src/main/java/net/minecraft/server/ItemExpBottle.java ++++ b/src/main/java/net/minecraft/server/ItemExpBottle.java +@@ -30,7 +30,7 @@ public class ItemExpBottle extends Item { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + entityhuman.b(StatisticList.ITEM_USED.b(this)); + } else { + if (entityhuman instanceof EntityPlayer) { +diff --git a/src/main/java/net/minecraft/server/ItemFireball.java b/src/main/java/net/minecraft/server/ItemFireball.java +index e598f13883571ebe037292fee4e70d9371fc8aa7..f0a06056b91917a149463be0ddfdcd33d2c70321 100644 +--- a/src/main/java/net/minecraft/server/ItemFireball.java ++++ b/src/main/java/net/minecraft/server/ItemFireball.java +@@ -23,11 +23,11 @@ public class ItemFireball extends Item { + } + // CraftBukkit end + this.a(world, blockposition); +- world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.b, true)); ++ world.setTypeUpdate(blockposition, iblockdata.set(BlockCampfire.b, true)); + flag = true; + } else { + blockposition = blockposition.shift(itemactioncontext.getClickedFace()); +- if (BlockFireAbstract.a((GeneratorAccess) world, blockposition)) { ++ if (BlockFireAbstract.a(world, blockposition)) { + // CraftBukkit start - fire BlockIgniteEvent + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getEntity()).isCancelled()) { + if (!itemactioncontext.getEntity().abilities.canInstantlyBuild) { +@@ -51,6 +51,6 @@ public class ItemFireball extends Item { + } + + private void a(World world, BlockPosition blockposition) { +- world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_FIRECHARGE_USE, SoundCategory.BLOCKS, 1.0F, (ItemFireball.RANDOM.nextFloat() - ItemFireball.RANDOM.nextFloat()) * 0.2F + 1.0F); ++ world.playSound(null, blockposition, SoundEffects.ITEM_FIRECHARGE_USE, SoundCategory.BLOCKS, 1.0F, (Item.RANDOM.nextFloat() - Item.RANDOM.nextFloat()) * 0.2F + 1.0F); + } + } +diff --git a/src/main/java/net/minecraft/server/ItemFireworks.java b/src/main/java/net/minecraft/server/ItemFireworks.java +index cf232cb18bf320011f588602e42c0e20b52fe70c..d0ed10cb387509468ffed858fb990612d2c6cd09 100644 +--- a/src/main/java/net/minecraft/server/ItemFireworks.java ++++ b/src/main/java/net/minecraft/server/ItemFireworks.java +@@ -69,7 +69,7 @@ public class ItemFireworks extends Item { + list.sort(Comparator.comparingInt((itemfireworks_effecttype) -> { + return itemfireworks_effecttype.g; + })); +- f = (EffectType[]) list.toArray(new EffectType[0]); ++ f = list.toArray(new EffectType[0]); + } + + private final int g; +diff --git a/src/main/java/net/minecraft/server/ItemFishingRod.java b/src/main/java/net/minecraft/server/ItemFishingRod.java +index 1b0146413e80c5a0df594da3def26e7118d874ee..9087f99eb60b4d3704f393f3bab2e4f687fe83cc 100644 +--- a/src/main/java/net/minecraft/server/ItemFishingRod.java ++++ b/src/main/java/net/minecraft/server/ItemFishingRod.java +@@ -21,7 +21,7 @@ public class ItemFishingRod extends Item implements ItemVanishable { + }); + } + +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_RETRIEVE, SoundCategory.NEUTRAL, 1.0F, 0.4F / (ItemFishingRod.RANDOM.nextFloat() * 0.4F + 0.8F)); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_RETRIEVE, SoundCategory.NEUTRAL, 1.0F, 0.4F / (Item.RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + // world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.RANDOM.nextFloat() * 0.4F + 0.8F)); + if (!world.isClientSide) { +@@ -37,7 +37,7 @@ public class ItemFishingRod extends Item implements ItemVanishable { + entityhuman.hookedFish = null; + return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); + } +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.RANDOM.nextFloat() * 0.4F + 0.8F)); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Item.RANDOM.nextFloat() * 0.4F + 0.8F)); + world.addEntity(entityfishinghook); + // CraftBukkit end + } +diff --git a/src/main/java/net/minecraft/server/ItemFlintAndSteel.java b/src/main/java/net/minecraft/server/ItemFlintAndSteel.java +index edfe7e681ccbc335cb4738e11dc9f4e0432da48a..1372653a20049bc6ce372a1c8ffb6f75b2c45bca 100644 +--- a/src/main/java/net/minecraft/server/ItemFlintAndSteel.java ++++ b/src/main/java/net/minecraft/server/ItemFlintAndSteel.java +@@ -14,8 +14,8 @@ public class ItemFlintAndSteel extends Item { + IBlockData iblockdata = world.getType(blockposition); + + if (BlockCampfire.h(iblockdata) && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, entityhuman).isCancelled()) { // CraftBukkit +- world.playSound(entityhuman, blockposition, SoundEffects.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, ItemFlintAndSteel.RANDOM.nextFloat() * 0.4F + 0.8F); +- world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true), 11); ++ world.playSound(entityhuman, blockposition, SoundEffects.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, Item.RANDOM.nextFloat() * 0.4F + 0.8F); ++ world.setTypeAndData(blockposition, iblockdata.set(BlockProperties.r, true), 11); + if (entityhuman != null) { + itemactioncontext.getItemStack().damage(1, entityhuman, (entityhuman1) -> { + entityhuman1.broadcastItemBreak(itemactioncontext.getHand()); +@@ -26,7 +26,7 @@ public class ItemFlintAndSteel extends Item { + } else { + BlockPosition blockposition1 = blockposition.shift(itemactioncontext.getClickedFace()); + +- if (BlockFireAbstract.a((GeneratorAccess) world, blockposition1)) { ++ if (BlockFireAbstract.a(world, blockposition1)) { + // CraftBukkit start - Store the clicked block + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition1, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, entityhuman).isCancelled()) { + itemactioncontext.getItemStack().damage(1, entityhuman, (entityhuman1) -> { +@@ -35,7 +35,7 @@ public class ItemFlintAndSteel extends Item { + return EnumInteractionResult.PASS; + } + // CraftBukkit end +- world.playSound(entityhuman, blockposition1, SoundEffects.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, ItemFlintAndSteel.RANDOM.nextFloat() * 0.4F + 0.8F); ++ world.playSound(entityhuman, blockposition1, SoundEffects.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, Item.RANDOM.nextFloat() * 0.4F + 0.8F); + IBlockData iblockdata1 = BlockFireAbstract.a((IBlockAccess) world, blockposition1); + + world.setTypeAndData(blockposition1, iblockdata1, 11); +diff --git a/src/main/java/net/minecraft/server/ItemLeash.java b/src/main/java/net/minecraft/server/ItemLeash.java +index 7d58e32a257174053e73a5de0a31d055b90316cf..aff1ad4b74d8e60866c44cc1f2230641548df9df 100644 +--- a/src/main/java/net/minecraft/server/ItemLeash.java ++++ b/src/main/java/net/minecraft/server/ItemLeash.java +@@ -17,7 +17,7 @@ public class ItemLeash extends Item { + BlockPosition blockposition = itemactioncontext.getClickPosition(); + Block block = world.getType(blockposition).getBlock(); + +- if (block.a((Tag) TagsBlock.FENCES)) { ++ if (block.a(TagsBlock.FENCES)) { + EntityHuman entityhuman = itemactioncontext.getEntity(); + + if (!world.isClientSide && entityhuman != null) { +diff --git a/src/main/java/net/minecraft/server/ItemLingeringPotion.java b/src/main/java/net/minecraft/server/ItemLingeringPotion.java +index 58f7191a6980265e8fab17cf39769bbbca0ee105..f2b72d7467412800797bfa17e91d515da31e0e7f 100644 +--- a/src/main/java/net/minecraft/server/ItemLingeringPotion.java ++++ b/src/main/java/net/minecraft/server/ItemLingeringPotion.java +@@ -11,7 +11,7 @@ public class ItemLingeringPotion extends ItemPotionThrowable { + // Paper start + InteractionResultWrapper wrapper = super.a(world, entityhuman, enumhand); + if (wrapper.getResult() != EnumInteractionResult.FAIL) { +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.RANDOM.nextFloat() * 0.4F + 0.8F)); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Item.RANDOM.nextFloat() * 0.4F + 0.8F)); + } + return wrapper; + // Paper end +diff --git a/src/main/java/net/minecraft/server/ItemMinecart.java b/src/main/java/net/minecraft/server/ItemMinecart.java +index dc7decb060ae56dbb6056e6e96f3ae00012507c1..44c5b1751500e1b101f0800b87386b9b21b9f45d 100644 +--- a/src/main/java/net/minecraft/server/ItemMinecart.java ++++ b/src/main/java/net/minecraft/server/ItemMinecart.java +@@ -12,29 +12,29 @@ public class ItemMinecart extends Item { + + @Override + public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + World world = isourceblock.getWorld(); + double d0 = isourceblock.getX() + (double) enumdirection.getAdjacentX() * 1.125D; + double d1 = Math.floor(isourceblock.getY()) + (double) enumdirection.getAdjacentY(); + double d2 = isourceblock.getZ() + (double) enumdirection.getAdjacentZ() * 1.125D; + BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); + IBlockData iblockdata = world.getType(blockposition); +- BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.getBlock() instanceof BlockMinecartTrackAbstract ? (BlockPropertyTrackPosition) iblockdata.get(((BlockMinecartTrackAbstract) iblockdata.getBlock()).d()) : BlockPropertyTrackPosition.NORTH_SOUTH; ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.getBlock() instanceof BlockMinecartTrackAbstract ? iblockdata.get(((BlockMinecartTrackAbstract) iblockdata.getBlock()).d()) : BlockPropertyTrackPosition.NORTH_SOUTH; + double d3; + +- if (iblockdata.a((Tag) TagsBlock.RAILS)) { ++ if (iblockdata.a(TagsBlock.RAILS)) { + if (blockpropertytrackposition.c()) { + d3 = 0.6D; + } else { + d3 = 0.1D; + } + } else { +- if (!iblockdata.isAir() || !world.getType(blockposition.down()).a((Tag) TagsBlock.RAILS)) { ++ if (!iblockdata.isAir() || !world.getType(blockposition.down()).a(TagsBlock.RAILS)) { + return this.b.dispense(isourceblock, itemstack); + } + + IBlockData iblockdata1 = world.getType(blockposition.down()); +- BlockPropertyTrackPosition blockpropertytrackposition1 = iblockdata1.getBlock() instanceof BlockMinecartTrackAbstract ? (BlockPropertyTrackPosition) iblockdata1.get(((BlockMinecartTrackAbstract) iblockdata1.getBlock()).d()) : BlockPropertyTrackPosition.NORTH_SOUTH; ++ BlockPropertyTrackPosition blockpropertytrackposition1 = iblockdata1.getBlock() instanceof BlockMinecartTrackAbstract ? iblockdata1.get(((BlockMinecartTrackAbstract) iblockdata1.getBlock()).d()) : BlockPropertyTrackPosition.NORTH_SOUTH; + + if (enumdirection != EnumDirection.DOWN && blockpropertytrackposition1.c()) { + d3 = -0.4D; +@@ -63,7 +63,7 @@ public class ItemMinecart extends Item { + itemstack.add(1); + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +- IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.REGISTRY.get(eventStack.getItem()); ++ IDispenseBehavior idispensebehavior = BlockDispenser.REGISTRY.get(eventStack.getItem()); + if (idispensebehavior != IDispenseBehavior.NONE && idispensebehavior != this) { + idispensebehavior.dispense(isourceblock, eventStack); + return itemstack; +@@ -93,7 +93,7 @@ public class ItemMinecart extends Item { + public ItemMinecart(EntityMinecartAbstract.EnumMinecartType entityminecartabstract_enumminecarttype, Item.Info item_info) { + super(item_info); + this.b = entityminecartabstract_enumminecarttype; +- BlockDispenser.a((IMaterial) this, ItemMinecart.a); ++ BlockDispenser.a(this, ItemMinecart.a); + } + + @Override +@@ -102,13 +102,13 @@ public class ItemMinecart extends Item { + BlockPosition blockposition = itemactioncontext.getClickPosition(); + IBlockData iblockdata = world.getType(blockposition); + +- if (!iblockdata.a((Tag) TagsBlock.RAILS)) { ++ if (!iblockdata.a(TagsBlock.RAILS)) { + return EnumInteractionResult.FAIL; + } else { + ItemStack itemstack = itemactioncontext.getItemStack(); + + if (!world.isClientSide) { +- BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.getBlock() instanceof BlockMinecartTrackAbstract ? (BlockPropertyTrackPosition) iblockdata.get(((BlockMinecartTrackAbstract) iblockdata.getBlock()).d()) : BlockPropertyTrackPosition.NORTH_SOUTH; ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.getBlock() instanceof BlockMinecartTrackAbstract ? iblockdata.get(((BlockMinecartTrackAbstract) iblockdata.getBlock()).d()) : BlockPropertyTrackPosition.NORTH_SOUTH; + double d0 = 0.0D; + + if (blockpropertytrackposition.c()) { +diff --git a/src/main/java/net/minecraft/server/ItemMonsterEgg.java b/src/main/java/net/minecraft/server/ItemMonsterEgg.java +index cb88147e34f66a65d5da4db2637a28746c2eff87..66c5da36506decd65f2aef4dba6e23eb3a91d3db 100644 +--- a/src/main/java/net/minecraft/server/ItemMonsterEgg.java ++++ b/src/main/java/net/minecraft/server/ItemMonsterEgg.java +@@ -78,7 +78,7 @@ public class ItemMonsterEgg extends Item { + } else if (world.isClientSide) { + return InteractionResultWrapper.success(itemstack); + } else { +- MovingObjectPositionBlock movingobjectpositionblock1 = (MovingObjectPositionBlock) movingobjectpositionblock; ++ MovingObjectPositionBlock movingobjectpositionblock1 = movingobjectpositionblock; + BlockPosition blockposition = movingobjectpositionblock1.getBlockPosition(); + + if (!(world.getType(blockposition).getBlock() instanceof BlockFluids)) { +@@ -115,7 +115,7 @@ public class ItemMonsterEgg extends Item { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("EntityTag"); + + if (nbttagcompound1.hasKeyOfType("id", 8)) { +- return (EntityTypes) EntityTypes.a(nbttagcompound1.getString("id")).orElse(this.d); ++ return EntityTypes.a(nbttagcompound1.getString("id")).orElse(this.d); + } + } + +@@ -131,7 +131,7 @@ public class ItemMonsterEgg extends Item { + if (entityinsentient instanceof EntityAgeable) { + object = ((EntityAgeable) entityinsentient).createChild((EntityAgeable) entityinsentient); + } else { +- object = (EntityInsentient) entitytypes.a(world); ++ object = entitytypes.a(world); + } + + if (object == null) { +diff --git a/src/main/java/net/minecraft/server/ItemRecord.java b/src/main/java/net/minecraft/server/ItemRecord.java +index 13b9bd8ece4aaa804d8d79b902d3ec63a737de87..e0cba43de3b3d00cce2dc3f569bed6b6abb273f2 100644 +--- a/src/main/java/net/minecraft/server/ItemRecord.java ++++ b/src/main/java/net/minecraft/server/ItemRecord.java +@@ -28,8 +28,8 @@ public class ItemRecord extends Item { + + if (!world.isClientSide) { + if (true) return EnumInteractionResult.SUCCESS; // CraftBukkit - handled in ItemStack +- ((BlockJukeBox) Blocks.JUKEBOX).a((GeneratorAccess) world, blockposition, iblockdata, itemstack); +- world.a((EntityHuman) null, 1010, blockposition, Item.getId(this)); ++ ((BlockJukeBox) Blocks.JUKEBOX).a(world, blockposition, iblockdata, itemstack); ++ world.a(null, 1010, blockposition, Item.getId(this)); + itemstack.subtract(1); + EntityHuman entityhuman = itemactioncontext.getEntity(); + +diff --git a/src/main/java/net/minecraft/server/ItemSkullPlayer.java b/src/main/java/net/minecraft/server/ItemSkullPlayer.java +index d08946bb977a3e949fc2178ed12e84152551a635..6dba52514d82d2cd4851cf7df37f70f326088671 100644 +--- a/src/main/java/net/minecraft/server/ItemSkullPlayer.java ++++ b/src/main/java/net/minecraft/server/ItemSkullPlayer.java +@@ -28,7 +28,7 @@ public class ItemSkullPlayer extends ItemBlockWallable { + } + + if (s != null) { +- return new ChatMessage(this.getName() + ".named", new Object[]{s}); ++ return new ChatMessage(this.getName() + ".named", s); + } + } + +@@ -39,7 +39,7 @@ public class ItemSkullPlayer extends ItemBlockWallable { + public boolean b(NBTTagCompound nbttagcompound) { + super.b(nbttagcompound); + if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && !StringUtils.isBlank(nbttagcompound.getString("SkullOwner"))) { +- GameProfile gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner")); ++ GameProfile gameprofile = new GameProfile(null, nbttagcompound.getString("SkullOwner")); + + // Spigot start + TileEntitySkull.b(gameprofile, new com.google.common.base.Predicate() { +diff --git a/src/main/java/net/minecraft/server/ItemSnowball.java b/src/main/java/net/minecraft/server/ItemSnowball.java +index 4242b5c4ed1e7d546fee7e2b3892b7b25e1259ff..01eb07d4d08ff38258c0278718eb9166b24ea0d6 100644 +--- a/src/main/java/net/minecraft/server/ItemSnowball.java ++++ b/src/main/java/net/minecraft/server/ItemSnowball.java +@@ -27,7 +27,7 @@ public class ItemSnowball extends Item { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // Paper + } + +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.RANDOM.nextFloat() * 0.4F + 0.8F)); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Item.RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { // Paper + if (entityhuman instanceof EntityPlayer) ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // Paper + return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack); // Paper +diff --git a/src/main/java/net/minecraft/server/ItemSplashPotion.java b/src/main/java/net/minecraft/server/ItemSplashPotion.java +index c919a402e80a5c6b17fdbd99e110be1abefda747..49f0950f0fc85ba347ccca69752092a24034de78 100644 +--- a/src/main/java/net/minecraft/server/ItemSplashPotion.java ++++ b/src/main/java/net/minecraft/server/ItemSplashPotion.java +@@ -11,7 +11,7 @@ public class ItemSplashPotion extends ItemPotionThrowable { + // Paper start + InteractionResultWrapper wrapper = super.a(world, entityhuman, enumhand); + if (wrapper.getResult() != EnumInteractionResult.FAIL) { +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemSplashPotion.RANDOM.nextFloat() * 0.4F + 0.8F)); ++ world.playSound(null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Item.RANDOM.nextFloat() * 0.4F + 0.8F)); + } + return wrapper; + // Paper end +diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java +index 9529eb584b1d5f4549d4f376a2d4894a65f05c6d..92745f5e47d904442477a1e6a9038b88141b860d 100644 +--- a/src/main/java/net/minecraft/server/ItemStack.java ++++ b/src/main/java/net/minecraft/server/ItemStack.java +@@ -43,7 +43,7 @@ public final class ItemStack { + }); + private static final Logger LOGGER = LogManager.getLogger(); + public static final ItemStack b = new ItemStack((Item) null);public static final ItemStack NULL_ITEM = b; // Paper - OBFHELPER +- public static final DecimalFormat c = (DecimalFormat) SystemUtils.a((new DecimalFormat("#.##")), (decimalformat) -> { // CraftBukkit - decompile error ++ public static final DecimalFormat c = SystemUtils.a((new DecimalFormat("#.##")), (decimalformat) -> { // CraftBukkit - decompile error + decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT)); + }); + private static final ChatModifier e = ChatModifier.b.setColor(EnumChatFormat.DARK_PURPLE).setItalic(true); +@@ -151,11 +151,11 @@ public final class ItemStack { + + // CraftBukkit - break into own method + private void load(NBTTagCompound nbttagcompound) { +- this.item = (Item) IRegistry.ITEM.get(new MinecraftKey(nbttagcompound.getString("id"))); ++ this.item = IRegistry.ITEM.get(new MinecraftKey(nbttagcompound.getString("id"))); + this.count = nbttagcompound.getByte("Count"); + if (nbttagcompound.hasKeyOfType("tag", 10)) { + // CraftBukkit start - make defensive copy as this data may be coming from the save thread +- this.tag = (NBTTagCompound) nbttagcompound.getCompound("tag").clone(); ++ this.tag = nbttagcompound.getCompound("tag").clone(); + processEnchantOrder(this.tag); // Paper + processText(); // Paper + this.getItem().b(this.tag); +@@ -314,7 +314,7 @@ public final class ItemStack { + // PAIL: checkme on updates. + if (this.item instanceof ItemRecord) { + ((BlockJukeBox) Blocks.JUKEBOX).a(world, blockposition, world.getType(blockposition), this); +- world.a((EntityHuman) null, 1010, blockposition, Item.getId(this.item)); ++ world.a(null, 1010, blockposition, Item.getId(this.item)); + this.subtract(1); + entityhuman.a(StatisticList.PLAY_RECORD); + } +@@ -494,7 +494,7 @@ public final class ItemStack { + public void a(EntityLiving entityliving, EntityHuman entityhuman) { + Item item = this.getItem(); + +- if (item.a(this, entityliving, (EntityLiving) entityhuman)) { ++ if (item.a(this, entityliving, entityhuman)) { + entityhuman.b(StatisticList.ITEM_USED.b(item)); + } + +@@ -636,7 +636,7 @@ public final class ItemStack { + } else { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + +- this.a(s, (NBTBase) nbttagcompound); ++ this.a(s, nbttagcompound); + return nbttagcompound; + } + } +@@ -764,7 +764,7 @@ public final class ItemStack { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + nbttagcompound.setString("id", String.valueOf(IRegistry.ENCHANTMENT.getKey(enchantment))); +- nbttagcompound.setShort("lvl", (short) ((byte) i)); ++ nbttagcompound.setShort("lvl", (byte) i); + nbttaglist.add(nbttagcompound); + processEnchantOrder(nbttagcompound); // Paper + } +@@ -871,7 +871,7 @@ public final class ItemStack { + ichatmutablecomponent.a(EnumChatFormat.ITALIC); + } + +- IChatMutableComponent ichatmutablecomponent1 = ChatComponentUtils.a((IChatBaseComponent) ichatmutablecomponent); ++ IChatMutableComponent ichatmutablecomponent1 = ChatComponentUtils.a(ichatmutablecomponent); + + if (!this.j) { + ichatmutablecomponent1.a(this.v().e).format((chatmodifier) -> { +diff --git a/src/main/java/net/minecraft/server/ItemTrident.java b/src/main/java/net/minecraft/server/ItemTrident.java +index 32982bb477fd6cbf97f1310694f0557fe120569d..9e0ef11dc3dcf5cd9506f7fa2a6b3dc67f3163a9 100644 +--- a/src/main/java/net/minecraft/server/ItemTrident.java ++++ b/src/main/java/net/minecraft/server/ItemTrident.java +@@ -12,8 +12,8 @@ public class ItemTrident extends Item implements ItemVanishable { + super(item_info); + Builder builder = ImmutableMultimap.builder(); + +- builder.put(GenericAttributes.ATTACK_DAMAGE, new AttributeModifier(ItemTrident.f, "Tool modifier", 8.0D, AttributeModifier.Operation.ADDITION)); +- builder.put(GenericAttributes.ATTACK_SPEED, new AttributeModifier(ItemTrident.g, "Tool modifier", -2.9000000953674316D, AttributeModifier.Operation.ADDITION)); ++ builder.put(GenericAttributes.ATTACK_DAMAGE, new AttributeModifier(Item.f, "Tool modifier", 8.0D, AttributeModifier.Operation.ADDITION)); ++ builder.put(GenericAttributes.ATTACK_SPEED, new AttributeModifier(Item.g, "Tool modifier", -2.9000000953674316D, AttributeModifier.Operation.ADDITION)); + this.a = builder.build(); + } + +@@ -71,7 +71,7 @@ public class ItemTrident extends Item implements ItemVanishable { + entitythrowntrident.trident = itemstack.cloneItemStack(); // SPIGOT-4511 update since damage call moved + // CraftBukkit end + +- world.playSound((EntityHuman) null, (Entity) entitythrowntrident, SoundEffects.ITEM_TRIDENT_THROW, SoundCategory.PLAYERS, 1.0F, 1.0F); ++ world.playSound(null, entitythrowntrident, SoundEffects.ITEM_TRIDENT_THROW, SoundCategory.PLAYERS, 1.0F, 1.0F); + if (!entityhuman.abilities.canInstantlyBuild) { + entityhuman.inventory.f(itemstack); + } +@@ -102,7 +102,7 @@ public class ItemTrident extends Item implements ItemVanishable { + f2 *= f6 / f5; + f3 *= f6 / f5; + f4 *= f6 / f5; +- entityhuman.h((double) f2, (double) f3, (double) f4); ++ entityhuman.h(f2, f3, f4); + entityhuman.r(20); + if (entityhuman.isOnGround()) { + float f7 = 1.1999999F; +@@ -120,7 +120,7 @@ public class ItemTrident extends Item implements ItemVanishable { + soundeffect = SoundEffects.ITEM_TRIDENT_RIPTIDE_1; + } + +- world.playSound((EntityHuman) null, (Entity) entityhuman, soundeffect, SoundCategory.PLAYERS, 1.0F, 1.0F); ++ world.playSound(null, entityhuman, soundeffect, SoundCategory.PLAYERS, 1.0F, 1.0F); + } + + } +diff --git a/src/main/java/net/minecraft/server/ItemWorldMap.java b/src/main/java/net/minecraft/server/ItemWorldMap.java +index 0f342d972f94852d057e39f0c24baf46b21c0d52..f70add91d9a4291a276fcba82ae62b1b07d880e5 100644 +--- a/src/main/java/net/minecraft/server/ItemWorldMap.java ++++ b/src/main/java/net/minecraft/server/ItemWorldMap.java +@@ -144,7 +144,7 @@ public class ItemWorldMap extends ItemWorldMapBase { + ++k3; + } while (l4 > 0 && !iblockdata1.getFluid().isEmpty()); + +- iblockdata = this.a(world, iblockdata, (BlockPosition) blockposition_mutableblockposition); ++ iblockdata = this.a(world, iblockdata, blockposition_mutableblockposition); + } + } else { + iblockdata = Blocks.BEDROCK.getBlockData(); +@@ -169,7 +169,7 @@ public class ItemWorldMap extends ItemWorldMapBase { + b0 = 0; + } + +- MaterialMapColor materialmapcolor = (MaterialMapColor) Iterables.getFirst(Multisets.copyHighestCountFirst(multiset), MaterialMapColor.b); ++ MaterialMapColor materialmapcolor = Iterables.getFirst(Multisets.copyHighestCountFirst(multiset), MaterialMapColor.b); + + if (materialmapcolor == MaterialMapColor.n) { + d2 = (double) k3 * 0.1D + (double) (k1 + l1 & 1) * 0.2D; +@@ -377,11 +377,11 @@ public class ItemWorldMap extends ItemWorldMapBase { + public EnumInteractionResult a(ItemActionContext itemactioncontext) { + IBlockData iblockdata = itemactioncontext.getWorld().getType(itemactioncontext.getClickPosition()); + +- if (iblockdata.a((Tag) TagsBlock.BANNERS)) { ++ if (iblockdata.a(TagsBlock.BANNERS)) { + if (!itemactioncontext.e.isClientSide) { + WorldMap worldmap = getSavedMap(itemactioncontext.getItemStack(), itemactioncontext.getWorld()); + +- worldmap.a((GeneratorAccess) itemactioncontext.getWorld(), itemactioncontext.getClickPosition()); ++ worldmap.a(itemactioncontext.getWorld(), itemactioncontext.getClickPosition()); + } + + return EnumInteractionResult.a(itemactioncontext.e.isClientSide); +diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java +index da52912a4ae8d23d1fa14a2a1b4fdcba26c2500e..6302f94946297d98d225fa880134abc0f0d3835d 100644 +--- a/src/main/java/net/minecraft/server/JsonList.java ++++ b/src/main/java/net/minecraft/server/JsonList.java +@@ -66,7 +66,7 @@ public abstract class JsonList> { + // Paper start + // this.g(); + // return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error +- return (V) this.getBackingMap().computeIfPresent(this.getMappingKey(k0), (k, v) -> { ++ return this.getBackingMap().computeIfPresent(this.getMappingKey(k0), (k, v) -> { + return v.hasExpired() ? null : v; + }); + // Paper end +@@ -88,7 +88,7 @@ public abstract class JsonList> { + } + + public String[] getEntries() { +- return (String[]) this.d.keySet().toArray(new String[this.d.size()]); ++ return this.d.keySet().toArray(new String[this.d.size()]); + } + + // CraftBukkit start +@@ -151,7 +151,7 @@ public abstract class JsonList> { + JsonObject jsonobject = new JsonObject(); + + jsonlistentry.getClass(); +- return (JsonObject) SystemUtils.a(jsonobject, jsonlistentry::a); // CraftBukkit - decompile error ++ return SystemUtils.a(jsonobject, jsonlistentry::a); // CraftBukkit - decompile error + }).forEach(jsonarray::add); + BufferedWriter bufferedwriter = null; + Throwable throwable = null; +@@ -175,7 +175,7 @@ public abstract class JsonList> { + Throwable throwable = null; + + try { +- JsonArray jsonarray = (JsonArray) JsonList.b.fromJson(bufferedreader, JsonArray.class); ++ JsonArray jsonarray = JsonList.b.fromJson(bufferedreader, JsonArray.class); + + this.d.clear(); + Iterator iterator = jsonarray.iterator(); +diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java +index c9f277c06d29741fbab92c77dadf0b53cc84911a..f38a7fa8d4fad3f03c8936434bbfac79bcf2179d 100644 +--- a/src/main/java/net/minecraft/server/LegacyPingHandler.java ++++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java +@@ -74,7 +74,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + channelhandlercontext.close(); + break; + } +- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { event.getProtocolVersion(), minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit ++ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()); // CraftBukkit + // Paper end + this.a(channelhandlercontext, this.a(s)); + break; +diff --git a/src/main/java/net/minecraft/server/LightEngineBlock.java b/src/main/java/net/minecraft/server/LightEngineBlock.java +index a61d0a27e9525505eedaec8cde44216e807eb9a8..98c591c1f0e7189f25ce97e88c3a2030d153542b 100644 +--- a/src/main/java/net/minecraft/server/LightEngineBlock.java ++++ b/src/main/java/net/minecraft/server/LightEngineBlock.java +@@ -80,7 +80,7 @@ public final class LightEngineBlock extends LightEngineLayer, S e + + private void d() { + Arrays.fill(this.g, ChunkCoordIntPair.a); +- Arrays.fill(this.h, (Object) null); ++ Arrays.fill(this.h, null); + } + + // Paper start - comment out, see getBlockOptimized +diff --git a/src/main/java/net/minecraft/server/LightEngineSky.java b/src/main/java/net/minecraft/server/LightEngineSky.java +index 32b52ca2462fa206b1184025cb3837d6c326db2d..d73262707e61efc4aa5c35783709c3320d4ab770 100644 +--- a/src/main/java/net/minecraft/server/LightEngineSky.java ++++ b/src/main/java/net/minecraft/server/LightEngineSky.java +@@ -18,7 +18,7 @@ public final class LightEngineSky extends LightEngineLayer l2) { +@@ -252,17 +252,17 @@ public final class LightEngineSky extends LightEngineLayer> e + + @Nullable + public NibbleArray h(long i) { +- NibbleArray nibblearray = (NibbleArray) this.i.get(i); ++ NibbleArray nibblearray = this.i.get(i); + + return nibblearray != null ? nibblearray : this.a(i, false); + } +@@ -180,7 +180,7 @@ public abstract class LightEngineStorage> e + } + + protected NibbleArray j(long i) { +- NibbleArray nibblearray = (NibbleArray) this.i.get(i); ++ NibbleArray nibblearray = this.i.get(i); + + return nibblearray != null ? nibblearray : new NibbleArray().markPoolSafe(); // Paper + } +@@ -222,7 +222,7 @@ public abstract class LightEngineStorage> e + while (longiterator.hasNext()) { + i = longiterator.nextLong(); // Paper + this.a(lightenginelayer, i); +- NibbleArray nibblearray1 = (NibbleArray) this.i.remove(i); ++ NibbleArray nibblearray1 = this.i.remove(i); + + nibblearray = this.f.d(i); + if (this.o.contains(SectionPosition.f(i))) { +diff --git a/src/main/java/net/minecraft/server/LightEngineStorageArray.java b/src/main/java/net/minecraft/server/LightEngineStorageArray.java +index cee30e695c378acba0aab9ae66094914364ea3c9..7b8ab70c55c4686ce4eda4d816e4e962884e29ee 100644 +--- a/src/main/java/net/minecraft/server/LightEngineStorageArray.java ++++ b/src/main/java/net/minecraft/server/LightEngineStorageArray.java +@@ -83,7 +83,7 @@ public abstract class LightEngineStorageArray> 52) & 15, (int) baseZ & 15); // Paper - y changed above ++ return nibblearray.a(baseX & 15, (int) ((i << 52) >> 52) & 15, baseZ & 15); // Paper - y changed above + } else { + return 15; + } +@@ -58,19 +58,19 @@ public class LightEngineStorageSky extends LightEngineStorage j) { +- ((LightEngineStorageSky.a) this.f).b = j; +- ((LightEngineStorageSky.a) this.f).otherData.queueDefaultReturnValue(((LightEngineStorageSky.a) this.f).b); // Paper - avoid copying light data ++ if (this.f.b > j) { ++ this.f.b = j; ++ this.f.otherData.queueDefaultReturnValue(this.f.b); // Paper - avoid copying light data + } + + long k = SectionPosition.f(i); +- int l = ((LightEngineStorageSky.a) this.f).otherData.getUpdating(k); // Paper - avoid copying light data ++ int l = this.f.otherData.getUpdating(k); // Paper - avoid copying light data + + if (l < j + 1) { +- ((LightEngineStorageSky.a) this.f).otherData.queueUpdate(k, j + 1); // Paper - avoid copying light data ++ this.f.otherData.queueUpdate(k, j + 1); // Paper - avoid copying light data + if (this.o.contains(k)) { + this.q(i); +- if (l > ((LightEngineStorageSky.a) this.f).b) { ++ if (l > this.f.b) { + long i1 = SectionPosition.b(SectionPosition.b(i), l - 1, SectionPosition.d(i)); + + this.p(i1); +@@ -107,7 +107,7 @@ public class LightEngineStorageSky extends LightEngineStorage= ((LightEngineStorageSky.a) this.f).b; ++ return i >= this.f.b; + } + + protected boolean m(long i) { +@@ -310,7 +310,7 @@ public class LightEngineStorageSky extends LightEngineStorage= k; ++ return k == this.f.b || SectionPosition.c(i) >= k; + } + + protected boolean o(long i) { +diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java +index adc7e6b6c0a8bec4dc0d2c9bf39a459578bdd41d..2d81ed2ce08d1c56703dfe5ce8e30e6cf0b39fa8 100644 +--- a/src/main/java/net/minecraft/server/LightEngineThreaded.java ++++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java +@@ -172,12 +172,12 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { + + @Override + public int a(int i, boolean flag, boolean flag1) { +- throw (UnsupportedOperationException) SystemUtils.c(new UnsupportedOperationException("Ran authomatically on a different thread!")); ++ throw SystemUtils.c(new UnsupportedOperationException("Ran authomatically on a different thread!")); + } + + @Override + public void a(BlockPosition blockposition, int i) { +- throw (UnsupportedOperationException) SystemUtils.c(new UnsupportedOperationException("Ran authomatically on a different thread!")); ++ throw SystemUtils.c(new UnsupportedOperationException("Ran authomatically on a different thread!")); + } + + @Override +@@ -201,8 +201,8 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { + int i; + + for (i = -1; i < 17; ++i) { +- super.a(EnumSkyBlock.BLOCK, SectionPosition.a(chunkcoordintpair, i), (NibbleArray) null, true); +- super.a(EnumSkyBlock.SKY, SectionPosition.a(chunkcoordintpair, i), (NibbleArray) null, true); ++ super.a(EnumSkyBlock.BLOCK, SectionPosition.a(chunkcoordintpair, i), null, true); ++ super.a(EnumSkyBlock.SKY, SectionPosition.a(chunkcoordintpair, i), null, true); + } + + for (i = 0; i < 16; ++i) { +diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java +index b87b989a4dfd1abe160842071b435d19bdd8942e..c3c82ebde8a878a606e629aff9e35ccfd5f97935 100644 +--- a/src/main/java/net/minecraft/server/LocaleLanguage.java ++++ b/src/main/java/net/minecraft/server/LocaleLanguage.java +@@ -64,7 +64,7 @@ public abstract class LocaleLanguage { + return new LocaleLanguage() { + @Override + public String a(String s) { +- return (String) map.getOrDefault(s, s); ++ return map.getOrDefault(s, s); + } + + @Override +@@ -80,12 +80,12 @@ public abstract class LocaleLanguage { + } + + public static void a(InputStream inputstream, BiConsumer biconsumer) { +- JsonObject jsonobject = (JsonObject) LocaleLanguage.b.fromJson(new InputStreamReader(inputstream, StandardCharsets.UTF_8), JsonObject.class); ++ JsonObject jsonobject = LocaleLanguage.b.fromJson(new InputStreamReader(inputstream, StandardCharsets.UTF_8), JsonObject.class); + Iterator iterator = jsonobject.entrySet().iterator(); + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- String s = LocaleLanguage.c.matcher(ChatDeserializer.a((JsonElement) entry.getValue(), (String) entry.getKey())).replaceAll("%$1s"); ++ String s = LocaleLanguage.c.matcher(ChatDeserializer.a(entry.getValue(), entry.getKey())).replaceAll("%$1s"); + + biconsumer.accept(entry.getKey(), s); + } +diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java +index 656ba5b0621aa3f5a3208a4e08692a381522f437..9ed31240f0865e6fde7fc15d8c1453fd314cda1a 100644 +--- a/src/main/java/net/minecraft/server/LoginListener.java ++++ b/src/main/java/net/minecraft/server/LoginListener.java +@@ -185,7 +185,7 @@ public class LoginListener implements PacketLoginInListener { + + @Override + public void a(PacketLoginInStart packetlogininstart) { +- Validate.validState(this.g == LoginListener.EnumProtocolState.HELLO, "Unexpected hello packet", new Object[0]); ++ Validate.validState(this.g == LoginListener.EnumProtocolState.HELLO, "Unexpected hello packet"); + this.i = packetlogininstart.b(); + if (this.server.getOnlineMode() && !this.networkManager.isLocal()) { + this.g = LoginListener.EnumProtocolState.KEY; +@@ -221,7 +221,7 @@ public class LoginListener implements PacketLoginInListener { + + @Override + public void a(PacketLoginInEncryptionBegin packetlogininencryptionbegin) { +- Validate.validState(this.g == LoginListener.EnumProtocolState.KEY, "Unexpected key packet", new Object[0]); ++ Validate.validState(this.g == LoginListener.EnumProtocolState.KEY, "Unexpected key packet"); + PrivateKey privatekey = this.server.getKeyPair().getPrivate(); + + if (!Arrays.equals(this.e, packetlogininencryptionbegin.b(privatekey))) { +@@ -238,7 +238,7 @@ public class LoginListener implements PacketLoginInListener { + try { + String s = (new BigInteger(MinecraftEncryption.a("", LoginListener.this.server.getKeyPair().getPublic(), LoginListener.this.loginKey))).toString(16); + +- LoginListener.this.i = LoginListener.this.server.getMinecraftSessionService().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.a()); ++ LoginListener.this.i = LoginListener.this.server.getMinecraftSessionService().hasJoinedServer(new GameProfile(null, gameprofile.getName()), s, this.a()); + if (LoginListener.this.i != null) { + // CraftBukkit start - fire PlayerPreLoginEvent + if (!networkManager.isConnected()) { +diff --git a/src/main/java/net/minecraft/server/LootEnchantFunction.java b/src/main/java/net/minecraft/server/LootEnchantFunction.java +index 5da2f615e1a67cfca13609910576098daa741a82..700801b0418cc9e74aef68cd2ea7218bc607065c 100644 +--- a/src/main/java/net/minecraft/server/LootEnchantFunction.java ++++ b/src/main/java/net/minecraft/server/LootEnchantFunction.java +@@ -34,7 +34,7 @@ public class LootEnchantFunction extends LootItemFunctionConditional { + + @Override + public ItemStack a(ItemStack itemstack, LootTableInfo loottableinfo) { +- Entity entity = (Entity) loottableinfo.getContextParameter(LootContextParameters.KILLER_ENTITY); ++ Entity entity = loottableinfo.getContextParameter(LootContextParameters.KILLER_ENTITY); + + if (entity instanceof EntityLiving) { + int i = EnchantmentManager.g((EntityLiving) entity); +@@ -78,9 +78,9 @@ public class LootEnchantFunction extends LootItemFunctionConditional { + + @Override + public LootEnchantFunction b(JsonObject jsonobject, JsonDeserializationContext jsondeserializationcontext, LootItemCondition[] alootitemcondition) { +- int i = ChatDeserializer.a(jsonobject, "limit", (int) 0); ++ int i = ChatDeserializer.a(jsonobject, "limit", 0); + +- return new LootEnchantFunction(alootitemcondition, (LootValueBounds) ChatDeserializer.a(jsonobject, "count", jsondeserializationcontext, LootValueBounds.class), i); ++ return new LootEnchantFunction(alootitemcondition, ChatDeserializer.a(jsonobject, "count", jsondeserializationcontext, LootValueBounds.class), i); + } + } + +diff --git a/src/main/java/net/minecraft/server/LootEntryAbstract.java b/src/main/java/net/minecraft/server/LootEntryAbstract.java +index 39227fd450c32ea58439f6ad1d310f2c518ad109..f7193d6bf649210c4447596381112653d9accdd4 100644 +--- a/src/main/java/net/minecraft/server/LootEntryAbstract.java ++++ b/src/main/java/net/minecraft/server/LootEntryAbstract.java +@@ -48,7 +48,7 @@ public abstract class LootEntryAbstract implements LootEntryChildren { + + @Override + public final T a(JsonObject jsonobject, JsonDeserializationContext jsondeserializationcontext) { +- LootItemCondition[] alootitemcondition = (LootItemCondition[]) ChatDeserializer.a(jsonobject, "conditions", new LootItemCondition[0], jsondeserializationcontext, LootItemCondition[].class); ++ LootItemCondition[] alootitemcondition = ChatDeserializer.a(jsonobject, "conditions", new LootItemCondition[0], jsondeserializationcontext, LootItemCondition[].class); + + return this.deserializeType(jsonobject, jsondeserializationcontext, alootitemcondition); + } +@@ -78,11 +78,11 @@ public abstract class LootEntryAbstract implements LootEntryChildren { + } + + protected LootItemCondition[] f() { +- return (LootItemCondition[]) this.a.toArray(new LootItemCondition[0]); ++ return this.a.toArray(new LootItemCondition[0]); + } + + public LootEntryAlternatives.a a(LootEntryAbstract.a lootentryabstract_a) { +- return new LootEntryAlternatives.a(new LootEntryAbstract.a[]{this, lootentryabstract_a}); ++ return new LootEntryAlternatives.a(this, lootentryabstract_a); + } + + public abstract LootEntryAbstract b(); +diff --git a/src/main/java/net/minecraft/server/LootItemConditionRandomChanceWithLooting.java b/src/main/java/net/minecraft/server/LootItemConditionRandomChanceWithLooting.java +index fb285b3fb92af4eb4c867e44253fa7cd3d3c87fc..275ea5a358bd7c101feef5f9fe5332a1b7e5738c 100644 +--- a/src/main/java/net/minecraft/server/LootItemConditionRandomChanceWithLooting.java ++++ b/src/main/java/net/minecraft/server/LootItemConditionRandomChanceWithLooting.java +@@ -28,7 +28,7 @@ public class LootItemConditionRandomChanceWithLooting implements LootItemConditi + } + + public boolean test(LootTableInfo loottableinfo) { +- Entity entity = (Entity) loottableinfo.getContextParameter(LootContextParameters.KILLER_ENTITY); ++ Entity entity = loottableinfo.getContextParameter(LootContextParameters.KILLER_ENTITY); + int i = 0; + + if (entity instanceof EntityLiving) { +diff --git a/src/main/java/net/minecraft/server/LootItemConditionSurvivesExplosion.java b/src/main/java/net/minecraft/server/LootItemConditionSurvivesExplosion.java +index bb75895189ddcef1a5376b328bf2fed0ec148079..1ee1d5411e496884d813b09dcce45b274632e97e 100644 +--- a/src/main/java/net/minecraft/server/LootItemConditionSurvivesExplosion.java ++++ b/src/main/java/net/minecraft/server/LootItemConditionSurvivesExplosion.java +@@ -25,7 +25,7 @@ public class LootItemConditionSurvivesExplosion implements LootItemCondition { + } + + public boolean test(LootTableInfo loottableinfo) { +- Float ofloat = (Float) loottableinfo.getContextParameter(LootContextParameters.EXPLOSION_RADIUS); ++ Float ofloat = loottableinfo.getContextParameter(LootContextParameters.EXPLOSION_RADIUS); + + if (ofloat != null) { + Random random = loottableinfo.a(); +diff --git a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java +index cccd0b1a4cc7505b3a63b117e25ad8e8e0b949e4..0e425ed26d2c8756f954230c8c1a8bb954046b1e 100644 +--- a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java ++++ b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java +@@ -45,7 +45,7 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional + if (itemstack.getItem() != Items.MAP) { + return itemstack; + } else { +- BlockPosition blockposition = (BlockPosition) loottableinfo.getContextParameter(LootContextParameters.POSITION); ++ BlockPosition blockposition = loottableinfo.getContextParameter(LootContextParameters.POSITION); + + if (blockposition != null) { + WorldServer worldserver = loottableinfo.getWorld(); +@@ -65,7 +65,7 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional + + ItemWorldMap.applySepiaFilter(worldserver, itemstack1); + WorldMap.decorateMap(itemstack1, blockposition1, "+", this.f); +- itemstack1.a((IChatBaseComponent) (new ChatMessage("filled_map." + this.e.i().toLowerCase(Locale.ROOT)))); ++ itemstack1.a(new ChatMessage("filled_map." + this.e.i().toLowerCase(Locale.ROOT))); + return itemstack1; + } + } +@@ -119,7 +119,7 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional + } + + byte b0 = ChatDeserializer.a(jsonobject, "zoom", (byte) 2); +- int i = ChatDeserializer.a(jsonobject, "search_radius", (int) 50); ++ int i = ChatDeserializer.a(jsonobject, "search_radius", 50); + boolean flag = ChatDeserializer.a(jsonobject, "skip_existing_chunks", true); + + return new LootItemFunctionExplorationMap(alootitemcondition, structuregenerator, mapicon_type, b0, i, flag); +@@ -128,7 +128,7 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional + private static StructureGenerator a(JsonObject jsonobject) { + if (jsonobject.has("destination")) { + String s = ChatDeserializer.h(jsonobject, "destination"); +- StructureGenerator structuregenerator = (StructureGenerator) StructureGenerator.a.get(s.toLowerCase(Locale.ROOT)); ++ StructureGenerator structuregenerator = StructureGenerator.a.get(s.toLowerCase(Locale.ROOT)); + + if (structuregenerator != null) { + return structuregenerator; +diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java +index 3aced0cb32f3a4f11efda79e40b6f8cd5045b295..fc64505737e43d4bc0e2ecc7ad6766b023869951 100644 +--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java ++++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java +@@ -78,9 +78,9 @@ public abstract class LootSelectorEntry extends LootEntryAbstract { + + @Override + public final T deserializeType(JsonObject jsonobject, JsonDeserializationContext jsondeserializationcontext, LootItemCondition[] alootitemcondition) { +- int i = ChatDeserializer.a(jsonobject, "weight", (int) 1); +- int j = ChatDeserializer.a(jsonobject, "quality", (int) 0); +- LootItemFunction[] alootitemfunction = (LootItemFunction[]) ChatDeserializer.a(jsonobject, "functions", new LootItemFunction[0], jsondeserializationcontext, LootItemFunction[].class); ++ int i = ChatDeserializer.a(jsonobject, "weight", 1); ++ int j = ChatDeserializer.a(jsonobject, "quality", 0); ++ LootItemFunction[] alootitemfunction = ChatDeserializer.a(jsonobject, "functions", new LootItemFunction[0], jsondeserializationcontext, LootItemFunction[].class); + + return this.b(jsonobject, jsondeserializationcontext, i, j, alootitemcondition, alootitemfunction); + } +@@ -128,7 +128,7 @@ public abstract class LootSelectorEntry extends LootEntryAbstract { + } + + protected LootItemFunction[] a() { +- return (LootItemFunction[]) this.c.toArray(new LootItemFunction[0]); ++ return this.c.toArray(new LootItemFunction[0]); + } + + public T a(int i) { +diff --git a/src/main/java/net/minecraft/server/LootTable.java b/src/main/java/net/minecraft/server/LootTable.java +index 451cec0df56e1153c1c8c9ae554530fbc77ad312..e2b559030ec72a1a224afd8f11b9cba9853665d7 100644 +--- a/src/main/java/net/minecraft/server/LootTable.java ++++ b/src/main/java/net/minecraft/server/LootTable.java +@@ -133,9 +133,9 @@ public class LootTable { + } + + if (itemstack.isEmpty()) { +- iinventory.setItem((Integer) list1.remove(list1.size() - 1), ItemStack.b); ++ iinventory.setItem(list1.remove(list1.size() - 1), ItemStack.b); + } else { +- iinventory.setItem((Integer) list1.remove(list1.size() - 1), itemstack); ++ iinventory.setItem(list1.remove(list1.size() - 1), itemstack); + } + } + +@@ -157,7 +157,7 @@ public class LootTable { + } + + while (i - list.size() - list1.size() > 0 && !list1.isEmpty()) { +- ItemStack itemstack1 = (ItemStack) list1.remove(MathHelper.nextInt(random, 0, list1.size() - 1)); ++ ItemStack itemstack1 = list1.remove(MathHelper.nextInt(random, 0, list1.size() - 1)); + int j = MathHelper.nextInt(random, 1, itemstack1.getCount() / 2); + ItemStack itemstack2 = itemstack1.cloneAndSubtract(j); + +@@ -201,7 +201,7 @@ public class LootTable { + + public LootTable deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { + JsonObject jsonobject = ChatDeserializer.m(jsonelement, "loot table"); +- LootSelector[] alootselector = (LootSelector[]) ChatDeserializer.a(jsonobject, "pools", new LootSelector[0], jsondeserializationcontext, LootSelector[].class); ++ LootSelector[] alootselector = ChatDeserializer.a(jsonobject, "pools", new LootSelector[0], jsondeserializationcontext, LootSelector[].class); + LootContextParameterSet lootcontextparameterset = null; + + if (jsonobject.has("type")) { +@@ -210,7 +210,7 @@ public class LootTable { + lootcontextparameterset = LootContextParameterSets.a(new MinecraftKey(s)); + } + +- LootItemFunction[] alootitemfunction = (LootItemFunction[]) ChatDeserializer.a(jsonobject, "functions", new LootItemFunction[0], jsondeserializationcontext, LootItemFunction[].class); ++ LootItemFunction[] alootitemfunction = ChatDeserializer.a(jsonobject, "functions", new LootItemFunction[0], jsondeserializationcontext, LootItemFunction[].class); + + return new LootTable(lootcontextparameterset != null ? lootcontextparameterset : LootContextParameterSets.GENERIC, alootselector, alootitemfunction); + } +@@ -272,7 +272,7 @@ public class LootTable { + } + + public LootTable b() { +- return new LootTable(this.c, (LootSelector[]) this.a.toArray(new LootSelector[0]), (LootItemFunction[]) this.b.toArray(new LootItemFunction[0])); ++ return new LootTable(this.c, this.a.toArray(new LootSelector[0]), this.b.toArray(new LootItemFunction[0])); + } + } + } +diff --git a/src/main/java/net/minecraft/server/LootTableRegistry.java b/src/main/java/net/minecraft/server/LootTableRegistry.java +index 2c456bc34ca9eb56534f68f4844057a852f5ca8a..9674ded498ef37a2b0c2fbcbb663c88b47c5f3f4 100644 +--- a/src/main/java/net/minecraft/server/LootTableRegistry.java ++++ b/src/main/java/net/minecraft/server/LootTableRegistry.java +@@ -25,12 +25,12 @@ public class LootTableRegistry extends ResourceDataJson { + } + + public LootTable getLootTable(MinecraftKey minecraftkey) { +- return (LootTable) this.c.getOrDefault(minecraftkey, LootTable.EMPTY); ++ return this.c.getOrDefault(minecraftkey, LootTable.EMPTY); + } + + protected void a(Map map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) { + Builder builder = ImmutableMap.builder(); +- JsonElement jsonelement = (JsonElement) map.remove(LootTables.a); ++ JsonElement jsonelement = map.remove(LootTables.a); + + if (jsonelement != null) { + LootTableRegistry.LOGGER.warn("Datapack tried to redefine {} loot table, ignoring", LootTables.a); +diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java +index 2ddd36aa4b7c6835261012c5b70570898c2877e7..200cc8c26711092476478cb63995094d9877944c 100644 +--- a/src/main/java/net/minecraft/server/Main.java ++++ b/src/main/java/net/minecraft/server/Main.java +@@ -116,7 +116,7 @@ public class Main { + Main.LOGGER.warn("Safe mode active, only vanilla datapack will be loaded"); + } + +- ResourcePackRepository resourcepackrepository = new ResourcePackRepository<>(ResourcePackLoader::new, new ResourcePackSource[]{new ResourcePackSourceVanilla(), new ResourcePackSourceFolder(convertable_conversionsession.getWorldFolder(SavedFile.DATAPACKS).toFile(), PackSource.c)}); ++ ResourcePackRepository resourcepackrepository = new ResourcePackRepository<>(ResourcePackLoader::new, new ResourcePackSourceVanilla(), new ResourcePackSourceFolder(convertable_conversionsession.getWorldFolder(SavedFile.DATAPACKS).toFile(), PackSource.c)); + // CraftBukkit start + File bukkitDataPackFolder = new File(convertable_conversionsession.getWorldFolder(SavedFile.DATAPACKS).toFile(), "bukkit"); + if (!bukkitDataPackFolder.exists()) { +@@ -179,7 +179,7 @@ public class Main { + convertable_conversionsession.a((IRegistryCustom) iregistrycustom_dimension, (SaveData) object); + */ + Class.forName("net.minecraft.server.VillagerTrades");// Paper - load this sync so it won't fail later async +- final DedicatedServer dedicatedserver = (DedicatedServer) MinecraftServer.a((thread) -> { ++ final DedicatedServer dedicatedserver = MinecraftServer.a((thread) -> { + DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataConverterRegistry.a(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new); + + /* +diff --git a/src/main/java/net/minecraft/server/MinecartTrackLogic.java b/src/main/java/net/minecraft/server/MinecartTrackLogic.java +index 6faccf602f22a2b58064ba2342bf2c6adc1b79f2..42ce447b168aef33a03b0e2d3e1ddb15040b9414 100644 +--- a/src/main/java/net/minecraft/server/MinecartTrackLogic.java ++++ b/src/main/java/net/minecraft/server/MinecartTrackLogic.java +@@ -26,7 +26,7 @@ public class MinecartTrackLogic { + this.b = blockposition; + this.d = iblockdata; + this.c = (BlockMinecartTrackAbstract) iblockdata.getBlock(); +- BlockPropertyTrackPosition blockpropertytrackposition = (BlockPropertyTrackPosition) iblockdata.get(this.c.d()); ++ BlockPropertyTrackPosition blockpropertytrackposition = iblockdata.get(this.c.d()); + + this.e = this.c.c(); + this.a(blockpropertytrackposition); +@@ -84,7 +84,7 @@ public class MinecartTrackLogic { + + private void d() { + for (int i = 0; i < this.f.size(); ++i) { +- MinecartTrackLogic minecarttracklogic = this.b((BlockPosition) this.f.get(i)); ++ MinecartTrackLogic minecarttracklogic = this.b(this.f.get(i)); + + if (minecarttracklogic != null && minecarttracklogic.a(this)) { + this.f.set(i, minecarttracklogic.b); +@@ -125,7 +125,7 @@ public class MinecartTrackLogic { + + private boolean c(BlockPosition blockposition) { + for (int i = 0; i < this.f.size(); ++i) { +- BlockPosition blockposition1 = (BlockPosition) this.f.get(i); ++ BlockPosition blockposition1 = this.f.get(i); + + if (blockposition1.getX() == blockposition.getX() && blockposition1.getZ() == blockposition.getZ()) { + return true; +@@ -221,7 +221,7 @@ public class MinecartTrackLogic { + blockpropertytrackposition = BlockPropertyTrackPosition.NORTH_SOUTH; + } + +- this.d = (IBlockData) this.d.set(this.c.d(), blockpropertytrackposition); ++ this.d = this.d.set(this.c.d(), blockpropertytrackposition); + this.a.setTypeAndData(this.b, this.d, 3); + } + +@@ -351,7 +351,7 @@ public class MinecartTrackLogic { + } + + this.a(blockpropertytrackposition1); +- this.d = (IBlockData) this.d.set(this.c.d(), blockpropertytrackposition1); ++ this.d = this.d.set(this.c.d(), blockpropertytrackposition1); + if (flag1 || this.a.getType(this.b) != this.d) { + this.a.setTypeAndData(this.b, this.d, 3); + // Paper start - prevent desync +@@ -361,7 +361,7 @@ public class MinecartTrackLogic { + // Paper end - prevent desync + + for (int i = 0; i < this.f.size(); ++i) { +- MinecartTrackLogic minecarttracklogic = this.b((BlockPosition) this.f.get(i)); ++ MinecartTrackLogic minecarttracklogic = this.b(this.f.get(i)); + + if (minecarttracklogic != null && minecarttracklogic.isValid()) { // Paper - prevent desync + minecarttracklogic.d(); +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 067956fdd37e058dbf94c04d1d19de7084f32e23..440c7f15e2e081ec13d6ab32177c70ef4959e8bb 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -150,7 +150,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant S a(Function function) { + AtomicReference atomicreference = new AtomicReference(); + Thread thread = new Thread(() -> { +- ((MinecraftServer) atomicreference.get()).v(); ++ atomicreference.get().v(); + }, "Server thread"); + + thread.setUncaughtExceptionHandler((thread1, throwable) -> { +@@ -232,10 +232,10 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, this.dataPackResources.h(), (IRegistryCustom) iregistrycustom_dimension); +- worlddata = (WorldDataServer) worldSession.a((DynamicOps) registryreadops, datapackconfiguration); ++ RegistryReadOps registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, this.dataPackResources.h(), iregistrycustom_dimension); ++ worlddata = (WorldDataServer) worldSession.a(registryreadops, datapackconfiguration); + if (worlddata == null) { + WorldSettings worldsettings; + GeneratorSettings generatorsettings; +@@ -369,7 +369,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { + return true; + }, worlddata.getGeneratorSettings().e().c().stream().map((entry) -> { +- return ResourceKey.a(IRegistry.ad, ((ResourceKey) entry.getKey()).a()); ++ return ResourceKey.a(IRegistry.ad, entry.getKey().a()); + }).collect(ImmutableSet.toImmutableSet())); + } + +@@ -380,7 +380,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant list = ImmutableList.of(new MobSpawnerPhantom(), new MobSpawnerPatrol(), new MobSpawnerCat(), new VillageSiege(), new MobSpawnerTrader(iworlddataserver)); + RegistryMaterials registrymaterials = generatorsettings.e(); +- WorldDimension worlddimension = (WorldDimension) registrymaterials.a(dimensionKey); ++ WorldDimension worlddimension = registrymaterials.a(dimensionKey); + DimensionManager dimensionmanager; + ChunkGenerator chunkgenerator; + +@@ -392,7 +392,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant typeKey = (ResourceKey) this.f.a().c(dimensionmanager).orElseThrow(() -> { ++ ResourceKey typeKey = this.f.a().c(dimensionmanager).orElseThrow(() -> { + return new IllegalStateException("Unregistered dimension type: " + dimensionmanager); + }); + ResourceKey worldKey = ResourceKey.a(IRegistry.ae, dimensionKey.a()); +@@ -631,7 +631,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant resourcekey) { +- return (WorldServer) this.worldServer.get(resourcekey); ++ return this.worldServer.get(resourcekey); + } + + public Set> E() { +@@ -1866,9 +1866,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrantmap(resourcepackrepository::a).filter(Objects::nonNull).map(ResourcePackLoader::d).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error ++ return stream.map(resourcepackrepository::a).filter(Objects::nonNull).map(ResourcePackLoader::d).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error + }, this).thenCompose((immutablelist) -> { +- return DataPackResources.a((List) immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); // Paper - decompile error ++ return DataPackResources.a(immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); // Paper - decompile error + }).thenAcceptAsync((datapackresources) -> { + this.dataPackResources.close(); + this.dataPackResources = datapackresources; +@@ -1893,7 +1893,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant resourcepackrepository, DataPackConfiguration datapackconfiguration, boolean flag) { + resourcepackrepository.a(); + if (flag) { +- resourcepackrepository.a((Collection) Collections.singleton("vanilla")); ++ resourcepackrepository.a(Collections.singleton("vanilla")); + return new DataPackConfiguration(ImmutableList.of("vanilla"), ImmutableList.of()); + } else { + Set set = Sets.newLinkedHashSet(); +@@ -1926,7 +1926,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant resourcepackrepository) { + Collection collection = resourcepackrepository.d(); + List list = ImmutableList.copyOf(collection); +- List list1 = (List) resourcepackrepository.b().stream().filter((s) -> { ++ List list1 = resourcepackrepository.b().stream().filter((s) -> { + return !collection.contains(s); + }).collect(ImmutableList.toImmutableList()); + +@@ -1970,7 +1970,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant, WorldServer> entry = (Entry) iterator.next(); +- MinecraftKey minecraftkey = ((ResourceKey) entry.getKey()).a(); ++ MinecraftKey minecraftkey = entry.getKey().a(); + java.nio.file.Path java_nio_file_path2 = java_nio_file_path1.resolve(minecraftkey.getNamespace()).resolve(minecraftkey.getKey()); + + Files.createDirectories(java_nio_file_path2); +- ((WorldServer) entry.getValue()).a(java_nio_file_path2); ++ entry.getValue().a(java_nio_file_path2); + } + + this.d(java_nio_file_path.resolve("gamerules.txt")); +diff --git a/src/main/java/net/minecraft/server/MobEffectList.java b/src/main/java/net/minecraft/server/MobEffectList.java +index a6c18f175e0dbc1c03e5c9750a0e184b7d5c6ede..d7457cd0e687ea7d9a2e5f105b2833df0bf7d4d7 100644 +--- a/src/main/java/net/minecraft/server/MobEffectList.java ++++ b/src/main/java/net/minecraft/server/MobEffectList.java +@@ -21,7 +21,7 @@ public class MobEffectList { + + @Nullable + public static MobEffectList fromId(int i) { +- return (MobEffectList) IRegistry.MOB_EFFECT.fromId(i); ++ return IRegistry.MOB_EFFECT.fromId(i); + } + + public static int getId(MobEffectList mobeffectlist) { +@@ -145,10 +145,10 @@ public class MobEffectList { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- AttributeModifiable attributemodifiable = attributemapbase.a((AttributeBase) entry.getKey()); ++ AttributeModifiable attributemodifiable = attributemapbase.a(entry.getKey()); + + if (attributemodifiable != null) { +- attributemodifiable.removeModifier((AttributeModifier) entry.getValue()); ++ attributemodifiable.removeModifier(entry.getValue()); + } + } + +@@ -159,10 +159,10 @@ public class MobEffectList { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- AttributeModifiable attributemodifiable = attributemapbase.a((AttributeBase) entry.getKey()); ++ AttributeModifiable attributemodifiable = attributemapbase.a(entry.getKey()); + + if (attributemodifiable != null) { +- AttributeModifier attributemodifier = (AttributeModifier) entry.getValue(); ++ AttributeModifier attributemodifier = entry.getValue(); + + attributemodifiable.removeModifier(attributemodifier); + attributemodifiable.addModifier(new AttributeModifier(attributemodifier.getUniqueId(), this.c() + " " + i, this.a(i, attributemodifier), attributemodifier.getOperation())); +diff --git a/src/main/java/net/minecraft/server/MobEffects.java b/src/main/java/net/minecraft/server/MobEffects.java +index 73dbcd9beb63f3bbc2eaa331e8f183819ac39ddf..420ec9c46cbe52de203e97f27a9f863032b72b8c 100644 +--- a/src/main/java/net/minecraft/server/MobEffects.java ++++ b/src/main/java/net/minecraft/server/MobEffects.java +@@ -66,6 +66,6 @@ public class MobEffects { + // CraftBukkit end + + private static MobEffectList a(int i, String s, MobEffectList mobeffectlist) { +- return (MobEffectList) IRegistry.a(IRegistry.MOB_EFFECT, i, s, mobeffectlist); ++ return IRegistry.a(IRegistry.MOB_EFFECT, i, s, mobeffectlist); + } + } +diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +index 2a7846b0ea96638e5b519f92e6d20a96c12d25b0..a9ccf879cf75a24e22925455ce232da5f2f3af8c 100644 +--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java ++++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +@@ -52,7 +52,7 @@ public abstract class MobSpawnerAbstract { + private boolean h() { + BlockPosition blockposition = this.b(); + +- return this.a().isAffectsSpawningPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange); // Paper ++ return this.a().isAffectsSpawningPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, this.requiredPlayerRange); // Paper + } + + public void c() { +@@ -106,7 +106,7 @@ public abstract class MobSpawnerAbstract { + double d4 = j >= 2 ? nbttaglist.h(1) : (double) (blockposition.getY() + world.random.nextInt(3) - 1); + double d5 = j >= 3 ? nbttaglist.h(2) : (double) blockposition.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; + +- if (world.b(((EntityTypes) optional.get()).a(d3, d4, d5)) && EntityPositionTypes.a((EntityTypes) optional.get(), world.getMinecraftWorld(), EnumMobSpawn.SPAWNER, new BlockPosition(d3, d4, d5), world.getRandom())) { ++ if (world.b(optional.get().a(d3, d4, d5)) && EntityPositionTypes.a((EntityTypes) optional.get(), world.getMinecraftWorld(), EnumMobSpawn.SPAWNER, new BlockPosition(d3, d4, d5), world.getRandom())) { + // Paper start + EntityTypes entityType = optional.get(); + String key = EntityTypes.getName(entityType).getKey(); +@@ -138,7 +138,7 @@ public abstract class MobSpawnerAbstract { + return; + } + +- int k = world.a(entity.getClass(), (new AxisAlignedBB((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 1), (double) (blockposition.getZ() + 1))).g((double) this.spawnRange)).size(); ++ int k = world.a(entity.getClass(), (new AxisAlignedBB(blockposition.getX(), blockposition.getY(), blockposition.getZ(), blockposition.getX() + 1, blockposition.getY() + 1, blockposition.getZ() + 1)).g(this.spawnRange)).size(); + + if (k >= this.maxNearbyEntities) { + this.i(); +@@ -149,12 +149,12 @@ public abstract class MobSpawnerAbstract { + if (entity instanceof EntityInsentient) { + EntityInsentient entityinsentient = (EntityInsentient) entity; + +- if (!entityinsentient.a((GeneratorAccess) world, EnumMobSpawn.SPAWNER) || !entityinsentient.a((IWorldReader) world)) { ++ if (!entityinsentient.a(world, EnumMobSpawn.SPAWNER) || !entityinsentient.a(world)) { + continue; + } + + if (this.spawnData.getEntity().e() == 1 && this.spawnData.getEntity().hasKeyOfType("id", 8)) { +- ((EntityInsentient) entity).prepare(world, world.getDamageScaler(entity.getChunkCoordinates()), EnumMobSpawn.SPAWNER, (GroupDataEntity) null, (NBTTagCompound) null); ++ ((EntityInsentient) entity).prepare(world, world.getDamageScaler(entity.getChunkCoordinates()), EnumMobSpawn.SPAWNER, null, null); + } + // Spigot Start + if ( entityinsentient.world.spigotConfig.nerfSpawnerMobs ) +@@ -221,7 +221,7 @@ public abstract class MobSpawnerAbstract { + } + + if (!this.mobs.isEmpty()) { +- this.setSpawnData((MobSpawnerData) WeightedRandom.a(this.a().random, this.mobs)); ++ this.setSpawnData(WeightedRandom.a(this.a().random, this.mobs)); + } + + this.a(1); +@@ -247,7 +247,7 @@ public abstract class MobSpawnerAbstract { + if (nbttagcompound.hasKeyOfType("SpawnData", 10)) { + this.setSpawnData(new MobSpawnerData(1, nbttagcompound.getCompound("SpawnData"))); + } else if (!this.mobs.isEmpty()) { +- this.setSpawnData((MobSpawnerData) WeightedRandom.a(this.a().random, this.mobs)); ++ this.setSpawnData(WeightedRandom.a(this.a().random, this.mobs)); + } + // Paper start - use ints if set + if (nbttagcompound.hasKeyOfType("Paper.MinSpawnDelay", 99)) { +diff --git a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java +index 776e54ff472a67f535dfb409e753325a1105bcce..9bcad6583bae704e8cf4365af41933972792af66 100644 +--- a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java ++++ b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java +@@ -83,7 +83,7 @@ public class MobSpawnerPatrol implements MobSpawner { + return 0; + } else { + int i1 = 0; +- int j1 = (int) Math.ceil((double) worldserver.getDamageScaler(blockposition_mutableblockposition).b()) + 1; ++ int j1 = (int) Math.ceil(worldserver.getDamageScaler(blockposition_mutableblockposition).b()) + 1; + + for (int k1 = 0; k1 < j1; ++k1) { + ++i1; +@@ -116,12 +116,12 @@ public class MobSpawnerPatrol implements MobSpawner { + private boolean a(World world, BlockPosition blockposition, Random random, boolean flag) { + IBlockData iblockdata = world.getType(blockposition); + +- if (!SpawnerCreature.a((IBlockAccess) world, blockposition, iblockdata, iblockdata.getFluid(), EntityTypes.PILLAGER)) { ++ if (!SpawnerCreature.a(world, blockposition, iblockdata, iblockdata.getFluid(), EntityTypes.PILLAGER)) { + return false; + } else if (!EntityMonsterPatrolling.b(EntityTypes.PILLAGER, world, EnumMobSpawn.PATROL, blockposition, random)) { + return false; + } else { +- EntityMonsterPatrolling entitymonsterpatrolling = (EntityMonsterPatrolling) EntityTypes.PILLAGER.a(world); ++ EntityMonsterPatrolling entitymonsterpatrolling = EntityTypes.PILLAGER.a(world); + + if (entitymonsterpatrolling != null) { + if (flag) { +@@ -129,8 +129,8 @@ public class MobSpawnerPatrol implements MobSpawner { + entitymonsterpatrolling.eV(); + } + +- entitymonsterpatrolling.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); +- entitymonsterpatrolling.prepare(world, world.getDamageScaler(blockposition), EnumMobSpawn.PATROL, (GroupDataEntity) null, (NBTTagCompound) null); ++ entitymonsterpatrolling.setPosition(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ entitymonsterpatrolling.prepare(world, world.getDamageScaler(blockposition), EnumMobSpawn.PATROL, null, null); + world.addEntity(entitymonsterpatrolling, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.PATROL); // CraftBukkit + return true; + } else { +diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java +index bf4fa17101cb8710d8b8ba8ad43f98b6fe154ae1..f2e82ad702f73691c113c68ac4f5597a0fa1ab87 100644 +--- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java ++++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java +@@ -48,7 +48,7 @@ public class MobSpawnerPhantom implements MobSpawner { + IBlockData iblockdata = worldserver.getType(blockposition1); + Fluid fluid = worldserver.getFluid(blockposition1); + +- if (SpawnerCreature.a((IBlockAccess) worldserver, blockposition1, iblockdata, fluid, EntityTypes.PHANTOM)) { ++ if (SpawnerCreature.a(worldserver, blockposition1, iblockdata, fluid, EntityTypes.PHANTOM)) { + GroupDataEntity groupdataentity = null; + int k = 1 + random.nextInt(difficultydamagescaler.a().a() + 1); + +@@ -62,10 +62,10 @@ public class MobSpawnerPhantom implements MobSpawner { + continue; + } + // Paper end +- EntityPhantom entityphantom = (EntityPhantom) EntityTypes.PHANTOM.a((World) worldserver); ++ EntityPhantom entityphantom = EntityTypes.PHANTOM.a(worldserver); + entityphantom.spawningEntity = entityhuman.uniqueID; // Paper + entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F); +- groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null); ++ groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, null); + worldserver.addEntity(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit + } + +diff --git a/src/main/java/net/minecraft/server/MobSpawnerTrader.java b/src/main/java/net/minecraft/server/MobSpawnerTrader.java +index 55758e608cd439bd55b71d80408e9f1dec57d967..5950ca3f5908c85887960ca002553d20ea688ca4 100644 +--- a/src/main/java/net/minecraft/server/MobSpawnerTrader.java ++++ b/src/main/java/net/minecraft/server/MobSpawnerTrader.java +@@ -75,7 +75,7 @@ public class MobSpawnerTrader implements MobSpawner { + Optional optional = villageplace.b(VillagePlaceType.s.c(), (blockposition1) -> { + return true; + }, blockposition, 48, VillagePlace.Occupancy.ANY); +- BlockPosition blockposition1 = (BlockPosition) optional.orElse(blockposition); ++ BlockPosition blockposition1 = optional.orElse(blockposition); + BlockPosition blockposition2 = this.a(worldserver, blockposition1, 48); + + if (blockposition2 != null && this.a(worldserver, blockposition2)) { +@@ -83,7 +83,7 @@ public class MobSpawnerTrader implements MobSpawner { + return false; + } + +- EntityVillagerTrader entityvillagertrader = (EntityVillagerTrader) EntityTypes.WANDERING_TRADER.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition2, EnumMobSpawn.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit ++ EntityVillagerTrader entityvillagertrader = EntityTypes.WANDERING_TRADER.spawnCreature(worldserver, null, null, null, blockposition2, EnumMobSpawn.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit + + if (entityvillagertrader != null) { + for (int i = 0; i < 2; ++i) { +@@ -106,7 +106,7 @@ public class MobSpawnerTrader implements MobSpawner { + BlockPosition blockposition = this.a(entityvillagertrader.world, entityvillagertrader.getChunkCoordinates(), i); + + if (blockposition != null) { +- EntityLlamaTrader entityllamatrader = (EntityLlamaTrader) EntityTypes.TRADER_LLAMA.spawnCreature(entityvillagertrader.world, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition, EnumMobSpawn.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit ++ EntityLlamaTrader entityllamatrader = EntityTypes.TRADER_LLAMA.spawnCreature(entityvillagertrader.world, null, null, null, blockposition, EnumMobSpawn.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit + + if (entityllamatrader != null) { + entityllamatrader.setLeashHolder(entityvillagertrader, true); +diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +index 1dd0276f409c4d82d9932582847cd128c3a668a2..25b6ec82a51ef4baa4cb05a4ade4d357387d3cce 100644 +--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java ++++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +@@ -16,7 +16,7 @@ public class NBTCompressedStreamTools { + NBTTagCompound nbttagcompound; + + try { +- nbttagcompound = a((DataInput) datainputstream, NBTReadLimiter.a); ++ nbttagcompound = a(datainputstream, NBTReadLimiter.a); + } catch (Throwable throwable1) { + throwable = throwable1; + throw throwable1; +@@ -67,7 +67,7 @@ public class NBTCompressedStreamTools { + + public static NBTTagCompound readNBT(DataInputStream datainputstream) throws IOException { return a(datainputstream); } // Paper - OBFHELPER + public static NBTTagCompound a(DataInputStream datainputstream) throws IOException { +- return a((DataInput) datainputstream, NBTReadLimiter.a); ++ return a(datainputstream, NBTReadLimiter.a); + } + + public static NBTTagCompound a(DataInput datainput, NBTReadLimiter nbtreadlimiter) throws IOException { +@@ -113,7 +113,7 @@ public class NBTCompressedStreamTools { + CrashReport crashreport = CrashReport.a(ioexception, "Loading NBT data"); + CrashReportSystemDetails crashreportsystemdetails = crashreport.a("NBT Tag"); + +- crashreportsystemdetails.a("Tag type", (Object) b0); ++ crashreportsystemdetails.a("Tag type", b0); + throw new ReportedException(crashreport); + } + } +diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java +index b62311247d1b8b02d2239de972a5a1450a973ef2..8a8a29e1b5d84008f219c3eb3a76fec6b9f32ac0 100644 +--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java ++++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java +@@ -48,7 +48,7 @@ public class NBTTagByteArray extends NBTList { + byte[] abyte = new byte[list.size()]; + + for (int i = 0; i < list.size(); ++i) { +- Byte obyte = (Byte) list.get(i); ++ Byte obyte = list.get(i); + + abyte[i] = obyte == null ? 0 : obyte; + } +@@ -105,11 +105,11 @@ public class NBTTagByteArray extends NBTList { + + @Override + public IChatBaseComponent a(String s, int i) { +- IChatMutableComponent ichatmutablecomponent = (new ChatComponentText("B")).a(NBTTagByteArray.g); ++ IChatMutableComponent ichatmutablecomponent = (new ChatComponentText("B")).a(NBTBase.g); + IChatMutableComponent ichatmutablecomponent1 = (new ChatComponentText("[")).addSibling(ichatmutablecomponent).c(";"); + + for (int j = 0; j < this.data.length; ++j) { +- IChatMutableComponent ichatmutablecomponent2 = (new ChatComponentText(String.valueOf(this.data[j]))).a(NBTTagByteArray.f); ++ IChatMutableComponent ichatmutablecomponent2 = (new ChatComponentText(String.valueOf(this.data[j]))).a(NBTBase.f); + + ichatmutablecomponent1.c(" ").addSibling(ichatmutablecomponent2).addSibling(ichatmutablecomponent); + if (j != this.data.length - 1) { +diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java +index 2b044b9807826034b3b94c45b26b7c0882b53d2c..399508d7e65ccb3bf3a78f8dbe1875cdf6e972fa 100644 +--- a/src/main/java/net/minecraft/server/NBTTagCompound.java ++++ b/src/main/java/net/minecraft/server/NBTTagCompound.java +@@ -18,7 +18,7 @@ import java.util.regex.Pattern; + public class NBTTagCompound implements NBTBase { + + public static final Codec a = Codec.PASSTHROUGH.comapFlatMap((dynamic) -> { +- NBTBase nbtbase = (NBTBase) dynamic.convert(DynamicOpsNBT.a).getValue(); ++ NBTBase nbtbase = dynamic.convert(DynamicOpsNBT.a).getValue(); + + return nbtbase instanceof NBTTagCompound ? DataResult.success((NBTTagCompound) nbtbase) : DataResult.error("Not a compound tag: " + nbtbase); + }, (nbttagcompound) -> { +@@ -40,7 +40,7 @@ public class NBTTagCompound implements NBTBase { + while ((b0 = NBTTagCompound.c(datainput, nbtreadlimiter)) != 0) { + String s = NBTTagCompound.d(datainput, nbtreadlimiter); + +- nbtreadlimiter.a((long) (224 + 16 * s.length())); ++ nbtreadlimiter.a(224 + 16 * s.length()); + NBTBase nbtbase = NBTTagCompound.b(NBTTagTypes.a(b0), s, datainput, i + 1, nbtreadlimiter); + + if (hashmap.put(s, nbtbase) != null) { +@@ -78,7 +78,7 @@ public class NBTTagCompound implements NBTBase { + + while (iterator.hasNext()) { + String s = (String) iterator.next(); +- NBTBase nbtbase = (NBTBase) this.map.get(s); ++ NBTBase nbtbase = this.map.get(s); + + a(s, nbtbase, dataoutput); + } +@@ -106,7 +106,7 @@ public class NBTTagCompound implements NBTBase { + + @Nullable + public NBTBase set(String s, NBTBase nbtbase) { +- return (NBTBase) this.map.put(s, nbtbase); ++ return this.map.put(s, nbtbase); + } + + public void setByte(String s, byte b0) { +@@ -198,11 +198,11 @@ public class NBTTagCompound implements NBTBase { + + @Nullable + public NBTBase get(String s) { +- return (NBTBase) this.map.get(s); ++ return this.map.get(s); + } + + public byte d(String s) { +- NBTBase nbtbase = (NBTBase) this.map.get(s); ++ NBTBase nbtbase = this.map.get(s); + + return nbtbase == null ? 0 : nbtbase.getTypeId(); + } +@@ -292,7 +292,7 @@ public class NBTTagCompound implements NBTBase { + public String getString(String s) { + try { + if (this.hasKeyOfType(s, 8)) { +- return ((NBTBase) this.map.get(s)).asString(); ++ return this.map.get(s).asString(); + } + } catch (ClassCastException classcastexception) { + ; +@@ -408,10 +408,10 @@ public class NBTTagCompound implements NBTBase { + CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Corrupt NBT tag", 1); + + crashreportsystemdetails.a("Tag type found", () -> { +- return ((NBTBase) this.map.get(s)).b().a(); ++ return this.map.get(s).b().a(); + }); + crashreportsystemdetails.a("Tag type expected", nbttagtype::a); +- crashreportsystemdetails.a("Tag name", (Object) s); ++ crashreportsystemdetails.a("Tag name", s); + return crashreport; + } + +@@ -461,8 +461,8 @@ public class NBTTagCompound implements NBTBase { + CrashReport crashreport = CrashReport.a(ioexception, "Loading NBT data"); + CrashReportSystemDetails crashreportsystemdetails = crashreport.a("NBT Tag"); + +- crashreportsystemdetails.a("Tag name", (Object) s); +- crashreportsystemdetails.a("Tag type", (Object) nbttagtype.a()); ++ crashreportsystemdetails.a("Tag name", s); ++ crashreportsystemdetails.a("Tag type", nbttagtype.a()); + throw new ReportedException(crashreport); + } + } +@@ -472,7 +472,7 @@ public class NBTTagCompound implements NBTBase { + + while (iterator.hasNext()) { + String s = (String) iterator.next(); +- NBTBase nbtbase = (NBTBase) nbttagcompound.map.get(s); ++ NBTBase nbtbase = nbttagcompound.map.get(s); + + if (nbtbase.getTypeId() == 10) { + if (this.hasKeyOfType(s, 10)) { +@@ -496,11 +496,11 @@ public class NBTTagCompound implements NBTBase { + + protected static IChatBaseComponent t(String s) { + if (NBTTagCompound.h.matcher(s).matches()) { +- return (new ChatComponentText(s)).a(NBTTagCompound.d); ++ return (new ChatComponentText(s)).a(NBTBase.d); + } else { + String s1 = NBTTagString.b(s); + String s2 = s1.substring(0, 1); +- IChatMutableComponent ichatmutablecomponent = (new ChatComponentText(s1.substring(1, s1.length() - 1))).a(NBTTagCompound.d); ++ IChatMutableComponent ichatmutablecomponent = (new ChatComponentText(s1.substring(1, s1.length() - 1))).a(NBTBase.d); + + return (new ChatComponentText(s2)).addSibling(ichatmutablecomponent).c(s2); + } +@@ -530,7 +530,7 @@ public class NBTTagCompound implements NBTBase { + for (Iterator iterator = ((Collection) collection).iterator(); iterator.hasNext(); chatcomponenttext.addSibling(ichatmutablecomponent)) { + String s1 = (String) iterator.next(); + +- ichatmutablecomponent = (new ChatComponentText(Strings.repeat(s, i + 1))).addSibling(t(s1)).c(String.valueOf(':')).c(" ").addSibling(((NBTBase) this.map.get(s1)).a(s, i + 1)); ++ ichatmutablecomponent = (new ChatComponentText(Strings.repeat(s, i + 1))).addSibling(t(s1)).c(String.valueOf(':')).c(" ").addSibling(this.map.get(s1).a(s, i + 1)); + if (iterator.hasNext()) { + ichatmutablecomponent.c(String.valueOf(',')).c(s.isEmpty() ? " " : "\n"); + } +diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java +index 48ef35fb282395b1fa609ef4e2e9511abb7cf641..73fcaa4581ec7b8e1e633ed13b2bd1a6236db76e 100644 +--- a/src/main/java/net/minecraft/server/NBTTagIntArray.java ++++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java +@@ -51,7 +51,7 @@ public class NBTTagIntArray extends NBTList { + int[] aint = new int[list.size()]; + + for (int i = 0; i < list.size(); ++i) { +- Integer integer = (Integer) list.get(i); ++ Integer integer = list.get(i); + + aint[i] = integer == null ? 0 : integer; + } +@@ -120,11 +120,11 @@ public class NBTTagIntArray extends NBTList { + + @Override + public IChatBaseComponent a(String s, int i) { +- IChatMutableComponent ichatmutablecomponent = (new ChatComponentText("I")).a(NBTTagIntArray.g); ++ IChatMutableComponent ichatmutablecomponent = (new ChatComponentText("I")).a(NBTBase.g); + IChatMutableComponent ichatmutablecomponent1 = (new ChatComponentText("[")).addSibling(ichatmutablecomponent).c(";"); + + for (int j = 0; j < this.data.length; ++j) { +- ichatmutablecomponent1.c(" ").addSibling((new ChatComponentText(String.valueOf(this.data[j]))).a(NBTTagIntArray.f)); ++ ichatmutablecomponent1.c(" ").addSibling((new ChatComponentText(String.valueOf(this.data[j]))).a(NBTBase.f)); + if (j != this.data.length - 1) { + ichatmutablecomponent1.c(","); + } +diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java +index 3a04a1eda9c12d5b5ffdea7dafdf93a410a404b0..c06e72486a8032080f336eb295b7801f7258426b 100644 +--- a/src/main/java/net/minecraft/server/NBTTagList.java ++++ b/src/main/java/net/minecraft/server/NBTTagList.java +@@ -70,7 +70,7 @@ public class NBTTagList extends NBTList { + if (this.list.isEmpty()) { + this.type = 0; + } else { +- this.type = ((NBTBase) this.list.get(0)).getTypeId(); ++ this.type = this.list.get(0).getTypeId(); + } + + dataoutput.writeByte(this.type); +@@ -119,7 +119,7 @@ public class NBTTagList extends NBTList { + + @Override + public NBTBase remove(int i) { +- NBTBase nbtbase = (NBTBase) this.list.remove(i); ++ NBTBase nbtbase = this.list.remove(i); + + this.g(); + return nbtbase; +@@ -131,7 +131,7 @@ public class NBTTagList extends NBTList { + + public NBTTagCompound getCompound(int i) { + if (i >= 0 && i < this.list.size()) { +- NBTBase nbtbase = (NBTBase) this.list.get(i); ++ NBTBase nbtbase = this.list.get(i); + + if (nbtbase.getTypeId() == 10) { + return (NBTTagCompound) nbtbase; +@@ -143,7 +143,7 @@ public class NBTTagList extends NBTList { + + public NBTTagList b(int i) { + if (i >= 0 && i < this.list.size()) { +- NBTBase nbtbase = (NBTBase) this.list.get(i); ++ NBTBase nbtbase = this.list.get(i); + + if (nbtbase.getTypeId() == 9) { + return (NBTTagList) nbtbase; +@@ -155,7 +155,7 @@ public class NBTTagList extends NBTList { + + public short d(int i) { + if (i >= 0 && i < this.list.size()) { +- NBTBase nbtbase = (NBTBase) this.list.get(i); ++ NBTBase nbtbase = this.list.get(i); + + if (nbtbase.getTypeId() == 2) { + return ((NBTTagShort) nbtbase).asShort(); +@@ -167,7 +167,7 @@ public class NBTTagList extends NBTList { + + public int e(int i) { + if (i >= 0 && i < this.list.size()) { +- NBTBase nbtbase = (NBTBase) this.list.get(i); ++ NBTBase nbtbase = this.list.get(i); + + if (nbtbase.getTypeId() == 3) { + return ((NBTTagInt) nbtbase).asInt(); +@@ -179,7 +179,7 @@ public class NBTTagList extends NBTList { + + public int[] f(int i) { + if (i >= 0 && i < this.list.size()) { +- NBTBase nbtbase = (NBTBase) this.list.get(i); ++ NBTBase nbtbase = this.list.get(i); + + if (nbtbase.getTypeId() == 11) { + return ((NBTTagIntArray) nbtbase).getInts(); +@@ -192,7 +192,7 @@ public class NBTTagList extends NBTList { + public final double getDoubleAt(int i) { return this.h(i); } // Paper - OBFHELPER + public double h(int i) { + if (i >= 0 && i < this.list.size()) { +- NBTBase nbtbase = (NBTBase) this.list.get(i); ++ NBTBase nbtbase = this.list.get(i); + + if (nbtbase.getTypeId() == 6) { + return ((NBTTagDouble) nbtbase).asDouble(); +@@ -204,7 +204,7 @@ public class NBTTagList extends NBTList { + + public float i(int i) { + if (i >= 0 && i < this.list.size()) { +- NBTBase nbtbase = (NBTBase) this.list.get(i); ++ NBTBase nbtbase = this.list.get(i); + + if (nbtbase.getTypeId() == 5) { + return ((NBTTagFloat) nbtbase).asFloat(); +@@ -216,7 +216,7 @@ public class NBTTagList extends NBTList { + + public String getString(int i) { + if (i >= 0 && i < this.list.size()) { +- NBTBase nbtbase = (NBTBase) this.list.get(i); ++ NBTBase nbtbase = this.list.get(i); + + return nbtbase.getTypeId() == 8 ? nbtbase.asString() : nbtbase.toString(); + } else { +@@ -229,7 +229,7 @@ public class NBTTagList extends NBTList { + } + + public NBTBase get(int i) { +- return (NBTBase) this.list.get(i); ++ return this.list.get(i); + } + + @Override +@@ -313,7 +313,7 @@ public class NBTTagList extends NBTList { + chatcomponenttext.c(", "); + } + +- chatcomponenttext.addSibling(((NBTBase) this.list.get(j)).l()); ++ chatcomponenttext.addSibling(this.list.get(j).l()); + } + + chatcomponenttext.c("]"); +@@ -330,7 +330,7 @@ public class NBTTagList extends NBTList { + for (j = 0; j < this.list.size(); ++j) { + ChatComponentText chatcomponenttext2 = new ChatComponentText(Strings.repeat(s, i + 1)); + +- chatcomponenttext2.addSibling(((NBTBase) this.list.get(j)).a(s, i + 1)); ++ chatcomponenttext2.addSibling(this.list.get(j).a(s, i + 1)); + if (j != this.list.size() - 1) { + chatcomponenttext2.c(s2).c(s.isEmpty() ? " " : "\n"); + } +diff --git a/src/main/java/net/minecraft/server/NBTTagString.java b/src/main/java/net/minecraft/server/NBTTagString.java +index a4747d5dc04ff1e1ec5fd35f927db7d452ea5ae4..889583bea0d0810fd7be4ee6673045b236e192ae 100644 +--- a/src/main/java/net/minecraft/server/NBTTagString.java ++++ b/src/main/java/net/minecraft/server/NBTTagString.java +@@ -13,7 +13,7 @@ public class NBTTagString implements NBTBase { + nbtreadlimiter.a(288L); + String s = datainput.readUTF(); + +- nbtreadlimiter.a((long) (16 * s.length())); ++ nbtreadlimiter.a(16 * s.length()); + return NBTTagString.a(s); + } + +@@ -87,7 +87,7 @@ public class NBTTagString implements NBTBase { + public IChatBaseComponent a(String s, int i) { + String s1 = b(this.data); + String s2 = s1.substring(0, 1); +- IChatMutableComponent ichatmutablecomponent = (new ChatComponentText(s1.substring(1, s1.length() - 1))).a(NBTTagString.e); ++ IChatMutableComponent ichatmutablecomponent = (new ChatComponentText(s1.substring(1, s1.length() - 1))).a(NBTBase.e); + + return (new ChatComponentText(s2)).addSibling(ichatmutablecomponent).c(s2); + } +diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +index 04552de8d42d9bd75fd37f7ef13ee275a2ead931..80a21113df5e3fe31282bde17fb203fa011602f0 100644 +--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java ++++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +@@ -51,7 +51,7 @@ public class NameReferencingFileConverter { + list.add(s1); + } + } +- String[] astring = (String[]) list.toArray(new String[0]); ++ String[] astring = list.toArray(new String[0]); + + if (minecraftserver.getOnlineMode() + || (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting +@@ -62,7 +62,7 @@ public class NameReferencingFileConverter { + + for (int j = 0; j < i; ++j) { + String s = astring1[j]; +- UUID uuid = EntityHuman.a(new GameProfile((UUID) null, s)); ++ UUID uuid = EntityHuman.a(new GameProfile(null, s)); + GameProfile gameprofile = new GameProfile(uuid, s); + + profilelookupcallback.onProfileLookupSucceeded(gameprofile); +@@ -86,19 +86,19 @@ public class NameReferencingFileConverter { + try { + final Map map = Maps.newHashMap(); + +- a(NameReferencingFileConverter.b, (Map) map); ++ a(NameReferencingFileConverter.b, map); + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() { + public void onProfileLookupSucceeded(GameProfile gameprofile) { + minecraftserver.getUserCache().a(gameprofile); +- String[] astring = (String[]) map.get(gameprofile.getName().toLowerCase(Locale.ROOT)); ++ String[] astring = map.get(gameprofile.getName().toLowerCase(Locale.ROOT)); + + if (astring == null) { + NameReferencingFileConverter.LOGGER.warn("Could not convert user banlist entry for {}", gameprofile.getName()); + throw new NameReferencingFileConverter.FileConversionException("Profile not in the conversionlist"); + } else { +- Date date = astring.length > 1 ? NameReferencingFileConverter.b(astring[1], (Date) null) : null; ++ Date date = astring.length > 1 ? NameReferencingFileConverter.b(astring[1], null) : null; + String s = astring.length > 2 ? astring[2] : null; +- Date date1 = astring.length > 3 ? NameReferencingFileConverter.b(astring[3], (Date) null) : null; ++ Date date1 = astring.length > 3 ? NameReferencingFileConverter.b(astring[3], null) : null; + String s1 = astring.length > 4 ? astring[4] : null; + + gameprofilebanlist.add(new GameProfileBanEntry(gameprofile, date, s, date1, s1)); +@@ -144,15 +144,15 @@ public class NameReferencingFileConverter { + try { + Map map = Maps.newHashMap(); + +- a(NameReferencingFileConverter.a, (Map) map); ++ a(NameReferencingFileConverter.a, map); + Iterator iterator = map.keySet().iterator(); + + while (iterator.hasNext()) { + String s = (String) iterator.next(); +- String[] astring = (String[]) map.get(s); +- Date date = astring.length > 1 ? b(astring[1], (Date) null) : null; ++ String[] astring = map.get(s); ++ Date date = astring.length > 1 ? b(astring[1], null) : null; + String s1 = astring.length > 2 ? astring[2] : null; +- Date date1 = astring.length > 3 ? b(astring[3], (Date) null) : null; ++ Date date1 = astring.length > 3 ? b(astring[3], null) : null; + String s2 = astring.length > 4 ? astring[4] : null; + + ipbanlist.add(new IpBanEntry(s, date, s1, date1, s2)); +@@ -278,10 +278,10 @@ public class NameReferencingFileConverter { + } + }; + +- a(minecraftserver, Lists.newArrayList(new String[]{s}), profilelookupcallback); +- return !list.isEmpty() && ((GameProfile) list.get(0)).getId() != null ? ((GameProfile) list.get(0)).getId() : null; ++ a(minecraftserver, Lists.newArrayList(s), profilelookupcallback); ++ return !list.isEmpty() && list.get(0).getId() != null ? list.get(0).getId() : null; + } else { +- return EntityHuman.a(new GameProfile((UUID) null, s)); ++ return EntityHuman.a(new GameProfile(null, s)); + } + } else { + try { +@@ -317,7 +317,7 @@ public class NameReferencingFileConverter { + } + + try { +- final String[] astring = (String[]) list.toArray(new String[list.size()]); ++ final String[] astring = list.toArray(new String[list.size()]); + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() { + public void onProfileLookupSucceeded(GameProfile gameprofile) { + dedicatedserver.getUserCache().a(gameprofile); +diff --git a/src/main/java/net/minecraft/server/Navigation.java b/src/main/java/net/minecraft/server/Navigation.java +index f04411a2a295d2a982dca5851ae76a80a6a83585..a215f6538f8f4be235025b0090708da26860bfb1 100644 +--- a/src/main/java/net/minecraft/server/Navigation.java ++++ b/src/main/java/net/minecraft/server/Navigation.java +@@ -24,7 +24,7 @@ public class Navigation extends NavigationAbstract { + + @Override + protected Vec3D b() { +- return new Vec3D(this.a.locX(), (double) this.t(), this.a.locZ()); ++ return new Vec3D(this.a.locX(), this.t(), this.a.locZ()); + } + + @Override +@@ -66,7 +66,7 @@ public class Navigation extends NavigationAbstract { + private int t() { + if (this.a.isInWater() && this.r()) { + int i = MathHelper.floor(this.a.locY()); +- Block block = this.b.getType(new BlockPosition(this.a.locX(), (double) i, this.a.locZ())).getBlock(); ++ Block block = this.b.getType(new BlockPosition(this.a.locX(), i, this.a.locZ())).getBlock(); + int j = 0; + + do { +@@ -75,7 +75,7 @@ public class Navigation extends NavigationAbstract { + } + + ++i; +- block = this.b.getType(new BlockPosition(this.a.locX(), (double) i, this.a.locZ())).getBlock(); ++ block = this.b.getType(new BlockPosition(this.a.locX(), i, this.a.locZ())).getBlock(); + ++j; + } while (j <= 16); + +@@ -226,7 +226,7 @@ public class Navigation extends NavigationAbstract { + blockposition = (BlockPosition) iterator.next(); + d2 = (double) blockposition.getX() + 0.5D - vec3d.x; + d3 = (double) blockposition.getZ() + 0.5D - vec3d.z; +- } while (d2 * d0 + d3 * d1 < 0.0D || this.b.getType(blockposition).a((IBlockAccess) this.b, blockposition, PathMode.LAND)); ++ } while (d2 * d0 + d3 * d1 < 0.0D || this.b.getType(blockposition).a(this.b, blockposition, PathMode.LAND)); + + return false; + } +diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java +index b0eeeb9827d523c878d1e84fde8f5036476fdf2e..adfb721fdc469da85accaa051ac04ab8b39740b7 100644 +--- a/src/main/java/net/minecraft/server/NavigationAbstract.java ++++ b/src/main/java/net/minecraft/server/NavigationAbstract.java +@@ -134,7 +134,7 @@ public abstract class NavigationAbstract { + + @Nullable + public PathEntity a(Stream stream, int i) { +- return this.a((Set) stream.collect(Collectors.toSet()), 8, false, i); ++ return this.a(stream.collect(Collectors.toSet()), 8, false, i); + } + + @Nullable +@@ -341,10 +341,10 @@ public abstract class NavigationAbstract { + if (shouldContinuePathfind(pathEntity)) + return; + //PacketDebug.a(this.b, this.a, pathEntity, this.l); +- vec3d = pathEntity.a((Entity) this.a); ++ vec3d = pathEntity.a(this.a); + BlockPosition blockposition = new BlockPosition(vec3d); + +- this.a.getControllerMove().a(vec3d.x, this.b.getType(blockposition.down()).isAir() ? vec3d.y : PathfinderNormal.a((IBlockAccess) this.b, blockposition), vec3d.z, this.d); ++ this.a.getControllerMove().a(vec3d.x, this.b.getType(blockposition.down()).isAir() ? vec3d.y : PathfinderNormal.a(this.b, blockposition), vec3d.z, this.d); + } + /* protected void l() { + Vec3D vec3d = this.b(); +@@ -385,12 +385,12 @@ public abstract class NavigationAbstract { + if (this.c.e() <= this.c.f() + 1) { + return false; + } else { +- Vec3D vec3d1 = Vec3D.c((BaseBlockPosition) this.c.a(this.c.f()).a()); ++ Vec3D vec3d1 = Vec3D.c(this.c.a(this.c.f()).a()); + +- if (!vec3d.a((IPosition) vec3d1, 2.0D)) { ++ if (!vec3d.a(vec3d1, 2.0D)) { + return false; + } else { +- Vec3D vec3d2 = Vec3D.c((BaseBlockPosition) this.c.a(this.c.f() + 1).a()); ++ Vec3D vec3d2 = Vec3D.c(this.c.a(this.c.f() + 1).a()); + Vec3D vec3d3 = vec3d2.d(vec3d1); + Vec3D vec3d4 = vec3d.d(vec3d1); + +@@ -537,7 +537,7 @@ public abstract class NavigationAbstract { + PathPoint pathpoint = this.c.c(); + Vec3D vec3d = new Vec3D(((double) pathpoint.a + this.a.locX()) / 2.0D, ((double) pathpoint.b + this.a.locY()) / 2.0D, ((double) pathpoint.c + this.a.locZ()) / 2.0D); + +- if (blockposition.a((IPosition) vec3d, (double) (this.c.e() - this.c.f()))) { ++ if (blockposition.a(vec3d, this.c.e() - this.c.f())) { + this.j(); + } + +diff --git a/src/main/java/net/minecraft/server/NavigationFlying.java b/src/main/java/net/minecraft/server/NavigationFlying.java +index cf3f4c1a2a89cce0345566a62faa34ef7e93c603..6063860d3217021e38c341e5e7fe2aa6bedbdfb7 100644 +--- a/src/main/java/net/minecraft/server/NavigationFlying.java ++++ b/src/main/java/net/minecraft/server/NavigationFlying.java +@@ -74,7 +74,7 @@ public class NavigationFlying extends NavigationAbstract { + if (shouldContinuePathfind(pathEntity)) + return; + //PacketDebug.a(this.b, this.a, pathEntity, this.l); +- vec3d = pathEntity.a((Entity) this.a); ++ vec3d = pathEntity.a(this.a); + BlockPosition blockposition = new BlockPosition(vec3d); + + this.a.getControllerMove().a(vec3d.x, vec3d.y, vec3d.z, this.d); +@@ -160,6 +160,6 @@ public class NavigationFlying extends NavigationAbstract { + + @Override + public boolean a(BlockPosition blockposition) { +- return this.b.getType(blockposition).a((IBlockAccess) this.b, blockposition, (Entity) this.a); ++ return this.b.getType(blockposition).a((IBlockAccess) this.b, blockposition, this.a); + } + } +diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java +index 773d51f0bbef5f4473bba99ea176b37739de862a..8faab305cd42e014a122a8bffd36586467f6dbcc 100644 +--- a/src/main/java/net/minecraft/server/NetworkManager.java ++++ b/src/main/java/net/minecraft/server/NetworkManager.java +@@ -152,7 +152,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + NetworkManager.LOGGER.debug("Timeout", throwable); + this.close(new ChatMessage("disconnect.timeout")); + } else { +- ChatMessage chatmessage = new ChatMessage("disconnect.genericReason", new Object[]{"Internal Exception: " + throwable}); ++ ChatMessage chatmessage = new ChatMessage("disconnect.genericReason", "Internal Exception: " + throwable); + + if (flag) { + NetworkManager.LOGGER.debug("Failed to sent packet", throwable); +@@ -189,7 +189,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + } + + public void setPacketListener(PacketListener packetlistener) { +- Validate.notNull(packetlistener, "packetListener", new Object[0]); ++ Validate.notNull(packetlistener, "packetListener"); + this.packetListener = packetlistener; + } + // Paper start +@@ -232,7 +232,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + // Paper end + + public void sendPacket(Packet packet) { +- this.sendPacket(packet, (GenericFutureListener) null); ++ this.sendPacket(packet, null); + } + + public void sendPacket(Packet packet, @Nullable GenericFutureListener> genericfuturelistener) { +@@ -281,7 +281,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + final boolean flush = effectiveFlush || packet instanceof PacketPlayOutKeepAlive || packet instanceof PacketPlayOutKickDisconnect; // no delay for certain packets + // Tuinity end - add flush parameter + EnumProtocol enumprotocol = EnumProtocol.a(packet); +- EnumProtocol enumprotocol1 = (EnumProtocol) this.channel.attr(NetworkManager.c).get(); ++ EnumProtocol enumprotocol1 = this.channel.attr(NetworkManager.c).get(); + + ++this.q; + if (enumprotocol1 != enumprotocol) { +diff --git a/src/main/java/net/minecraft/server/NextTickListEntry.java b/src/main/java/net/minecraft/server/NextTickListEntry.java +index 2287e47d1b891135a5f2579ec324c70589141192..7e477455b403aad87e845be396fdb7388e7a34a3 100644 +--- a/src/main/java/net/minecraft/server/NextTickListEntry.java ++++ b/src/main/java/net/minecraft/server/NextTickListEntry.java +@@ -18,7 +18,7 @@ public class NextTickListEntry { + } + + public NextTickListEntry(BlockPosition blockposition, T t0, long i, TickListPriority ticklistpriority) { +- this.f = (long) (NextTickListEntry.COUNTER.getAndIncrement()); // Paper - async chunk loading ++ this.f = NextTickListEntry.COUNTER.getAndIncrement(); // Paper - async chunk loading + this.a = blockposition.immutableCopy(); + this.e = t0; + this.b = i; +diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java +index 09398d1740b1ad0752183578294ee8f5453b84fd..1e06b748ac93b138f6033cfb73ce35dbb11644d9 100644 +--- a/src/main/java/net/minecraft/server/NibbleArray.java ++++ b/src/main/java/net/minecraft/server/NibbleArray.java +@@ -78,7 +78,7 @@ public class NibbleArray { + registerCleaner(); + // Paper end + if (abyte.length != 2048) { +- throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException("ChunkNibbleArrays should be 2048 bytes not: " + abyte.length)); ++ throw SystemUtils.c(new IllegalArgumentException("ChunkNibbleArrays should be 2048 bytes not: " + abyte.length)); + } + } + +diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java +index d410843fe0c0d20cc374eac676c8f34a0a8aef2f..b1842d589d48547e58c8569821613f3b390c9781 100644 +--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java ++++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java +@@ -47,7 +47,7 @@ public class PacketDataSerializer extends ByteBuf { + DataResult dataresult = codec.parse(DynamicOpsNBT.a, nbttagcompound); + + if (dataresult.error().isPresent()) { +- throw new IOException("Failed to decode: " + ((PartialResult) dataresult.error().get()).message() + " " + nbttagcompound); ++ throw new IOException("Failed to decode: " + dataresult.error().get().message() + " " + nbttagcompound); + } else { + return dataresult.result().get(); + } +@@ -57,7 +57,7 @@ public class PacketDataSerializer extends ByteBuf { + DataResult dataresult = codec.encodeStart(DynamicOpsNBT.a, t0); + + if (dataresult.error().isPresent()) { +- throw new IOException("Failed to encode: " + ((PartialResult) dataresult.error().get()).message() + " " + t0); ++ throw new IOException("Failed to encode: " + dataresult.error().get().message() + " " + t0); + } else { + this.a((NBTTagCompound) dataresult.result().get()); + } +@@ -250,7 +250,7 @@ public class PacketDataSerializer extends ByteBuf { + this.readerIndex(i); + + try { +- return NBTCompressedStreamTools.a((DataInput) (new ByteBufInputStream(this)), new NBTReadLimiter(2097152L)); ++ return NBTCompressedStreamTools.a(new ByteBufInputStream(this), new NBTReadLimiter(2097152L)); + } catch (IOException ioexception) { + throw new EncoderException(ioexception); + } +@@ -374,7 +374,7 @@ public class PacketDataSerializer extends ByteBuf { + + public MovingObjectPositionBlock q() { + BlockPosition blockposition = this.e(); +- EnumDirection enumdirection = (EnumDirection) this.a(EnumDirection.class); ++ EnumDirection enumdirection = this.a(EnumDirection.class); + float f = this.readFloat(); + float f1 = this.readFloat(); + float f2 = this.readFloat(); +@@ -387,7 +387,7 @@ public class PacketDataSerializer extends ByteBuf { + BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); + + this.a(blockposition); +- this.a((Enum) movingobjectpositionblock.getDirection()); ++ this.a(movingobjectpositionblock.getDirection()); + Vec3D vec3d = movingobjectpositionblock.getPos(); + + this.writeFloat((float) (vec3d.x - (double) blockposition.getX())); +diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java +index 7deab4d4e40156590eada8f49b7e078efe924b44..e6c41352917b5e1ec78746043aff05db86fc33aa 100644 +--- a/src/main/java/net/minecraft/server/PacketEncoder.java ++++ b/src/main/java/net/minecraft/server/PacketEncoder.java +@@ -21,7 +21,7 @@ public class PacketEncoder extends MessageToByteEncoder> { + } + + protected void encode(ChannelHandlerContext channelhandlercontext, Packet packet, ByteBuf bytebuf) throws Exception { +- EnumProtocol enumprotocol = (EnumProtocol) channelhandlercontext.channel().attr(NetworkManager.c).get(); ++ EnumProtocol enumprotocol = channelhandlercontext.channel().attr(NetworkManager.c).get(); + + if (enumprotocol == null) { + throw new RuntimeException("ConnectionProtocol unknown: " + packet); +diff --git a/src/main/java/net/minecraft/server/PacketPlayInBlockPlace.java b/src/main/java/net/minecraft/server/PacketPlayInBlockPlace.java +index 194576502b4142ecd19bb4ec879d8855d0722365..00b985d61fc1463327117245ce7bc0b85deb95d0 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayInBlockPlace.java ++++ b/src/main/java/net/minecraft/server/PacketPlayInBlockPlace.java +@@ -16,12 +16,12 @@ public class PacketPlayInBlockPlace implements Packet { + @Override + public void a(PacketDataSerializer packetdataserializer) throws IOException { + this.timestamp = System.currentTimeMillis(); // Spigot +- this.a = (EnumHand) packetdataserializer.a(EnumHand.class); ++ this.a = packetdataserializer.a(EnumHand.class); + } + + @Override + public void b(PacketDataSerializer packetdataserializer) throws IOException { +- packetdataserializer.a((Enum) this.a); ++ packetdataserializer.a(this.a); + } + + public void a(PacketListenerPlayIn packetlistenerplayin) { +diff --git a/src/main/java/net/minecraft/server/PacketPlayInSettings.java b/src/main/java/net/minecraft/server/PacketPlayInSettings.java +index 87ec3987d4b6de836016e91ef90383e3e5bb2d16..a31851803948939f8bc69eee3b43af3c0e9bb328 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayInSettings.java ++++ b/src/main/java/net/minecraft/server/PacketPlayInSettings.java +@@ -17,20 +17,20 @@ public class PacketPlayInSettings implements Packet { + public void a(PacketDataSerializer packetdataserializer) throws IOException { + this.locale = packetdataserializer.e(16); + this.viewDistance = packetdataserializer.readByte(); +- this.c = (EnumChatVisibility) packetdataserializer.a(EnumChatVisibility.class); ++ this.c = packetdataserializer.a(EnumChatVisibility.class); + this.d = packetdataserializer.readBoolean(); + this.e = packetdataserializer.readUnsignedByte(); +- this.f = (EnumMainHand) packetdataserializer.a(EnumMainHand.class); ++ this.f = packetdataserializer.a(EnumMainHand.class); + } + + @Override + public void b(PacketDataSerializer packetdataserializer) throws IOException { + packetdataserializer.a(this.locale); + packetdataserializer.writeByte(this.viewDistance); +- packetdataserializer.a((Enum) this.c); ++ packetdataserializer.a(this.c); + packetdataserializer.writeBoolean(this.d); + packetdataserializer.writeByte(this.e); +- packetdataserializer.a((Enum) this.f); ++ packetdataserializer.a(this.f); + } + + public void a(PacketListenerPlayIn packetlistenerplayin) { +diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +index 79363155ce48746db8cb749358efad07e91b2f3d..3cec040487e0f32f0d39dc586b4452af5337cfdf 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java ++++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +@@ -16,13 +16,13 @@ public class PacketPlayInUseEntity implements Packet { + @Override + public void a(PacketDataSerializer packetdataserializer) throws IOException { + this.a = packetdataserializer.i(); +- this.action = (PacketPlayInUseEntity.EnumEntityUseAction) packetdataserializer.a(PacketPlayInUseEntity.EnumEntityUseAction.class); ++ this.action = packetdataserializer.a(EnumEntityUseAction.class); + if (this.action == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT_AT) { +- this.c = new Vec3D((double) packetdataserializer.readFloat(), (double) packetdataserializer.readFloat(), (double) packetdataserializer.readFloat()); ++ this.c = new Vec3D(packetdataserializer.readFloat(), packetdataserializer.readFloat(), packetdataserializer.readFloat()); + } + + if (this.action == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT || this.action == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT_AT) { +- this.d = (EnumHand) packetdataserializer.a(EnumHand.class); ++ this.d = packetdataserializer.a(EnumHand.class); + } + + this.e = packetdataserializer.readBoolean(); +@@ -31,7 +31,7 @@ public class PacketPlayInUseEntity implements Packet { + @Override + public void b(PacketDataSerializer packetdataserializer) throws IOException { + packetdataserializer.d(this.a); +- packetdataserializer.a((Enum) this.action); ++ packetdataserializer.a(this.action); + if (this.action == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT_AT) { + packetdataserializer.writeFloat((float) this.c.x); + packetdataserializer.writeFloat((float) this.c.y); +@@ -39,7 +39,7 @@ public class PacketPlayInUseEntity implements Packet { + } + + if (this.action == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT || this.action == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT_AT) { +- packetdataserializer.a((Enum) this.d); ++ packetdataserializer.a(this.d); + } + + packetdataserializer.writeBoolean(this.e); +diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseItem.java b/src/main/java/net/minecraft/server/PacketPlayInUseItem.java +index 5941c3a5e7242e891ff79d0203762550b821fefa..8250beca69643685c3890a2682d95d2898aea7a9 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayInUseItem.java ++++ b/src/main/java/net/minecraft/server/PacketPlayInUseItem.java +@@ -13,13 +13,13 @@ public class PacketPlayInUseItem implements Packet { + @Override + public void a(PacketDataSerializer packetdataserializer) throws IOException { + this.timestamp = System.currentTimeMillis(); // Spigot +- this.b = (EnumHand) packetdataserializer.a(EnumHand.class); ++ this.b = packetdataserializer.a(EnumHand.class); + this.a = packetdataserializer.q(); + } + + @Override + public void b(PacketDataSerializer packetdataserializer) throws IOException { +- packetdataserializer.a((Enum) this.b); ++ packetdataserializer.a(this.b); + packetdataserializer.a(this.a); + } + +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +index 27cf029e0704d59481621543fb1283767f166e2d..82d5276c1844d379df025e142d036dc46908692d 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +@@ -83,7 +83,7 @@ public class PacketPlayOutScoreboardTeam implements Packet { + + @Override + public void a(PacketDataSerializer packetdataserializer) throws IOException { +- this.a = (PacketPlayOutTitle.EnumTitleAction) packetdataserializer.a(PacketPlayOutTitle.EnumTitleAction.class); ++ this.a = packetdataserializer.a(EnumTitleAction.class); + if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE || this.a == PacketPlayOutTitle.EnumTitleAction.ACTIONBAR) { + this.b = packetdataserializer.h(); + } +@@ -57,7 +57,7 @@ public class PacketPlayOutTitle implements Packet { + + @Override + public void b(PacketDataSerializer packetdataserializer) throws IOException { +- packetdataserializer.a((Enum) this.a); ++ packetdataserializer.a(this.a); + if (this.a == PacketPlayOutTitle.EnumTitleAction.TITLE || this.a == PacketPlayOutTitle.EnumTitleAction.SUBTITLE || this.a == PacketPlayOutTitle.EnumTitleAction.ACTIONBAR) { + // Paper start + if (this.components != null) { +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java +index 901a5df3f7d3f9ee60485ec1044a05e8aff89ccb..31865fc4f8573bfbb9d6fb15f4824ed3c633df42 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java +@@ -25,7 +25,7 @@ public class PacketPlayOutWindowItems implements Packet { + this.b = NonNullList.a(nonnulllist.size(), ItemStack.b); + + for (int j = 0; j < this.b.size(); ++j) { +- this.b.set(j, ((ItemStack) nonnulllist.get(j)).cloneItemStack()); ++ this.b.set(j, nonnulllist.get(j).cloneItemStack()); + } + + } +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutWorldBorder.java b/src/main/java/net/minecraft/server/PacketPlayOutWorldBorder.java +index 5c2e452632939cf7e1c3f1a4b3c65555fb212ee5..9870cc9f816c9e9d4f5e485f44820f278a7c9adc 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutWorldBorder.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutWorldBorder.java +@@ -32,7 +32,7 @@ public class PacketPlayOutWorldBorder implements Packet { + + @Override + public void a(PacketDataSerializer packetdataserializer) throws IOException { +- this.a = (PacketPlayOutWorldBorder.EnumWorldBorderAction) packetdataserializer.a(PacketPlayOutWorldBorder.EnumWorldBorderAction.class); ++ this.a = packetdataserializer.a(EnumWorldBorderAction.class); + switch (this.a) { + case SET_SIZE: + this.e = packetdataserializer.readDouble(); +@@ -67,7 +67,7 @@ public class PacketPlayOutWorldBorder implements Packet { + + @Override + public void b(PacketDataSerializer packetdataserializer) throws IOException { +- packetdataserializer.a((Enum) this.a); ++ packetdataserializer.a(this.a); + switch (this.a) { + case SET_SIZE: + packetdataserializer.writeDouble(this.e); +diff --git a/src/main/java/net/minecraft/server/PairedQueue.java b/src/main/java/net/minecraft/server/PairedQueue.java +index d18359567b46e4bbd807ad8eeadb8bfeff533bf8..951c3f0368024d79d5856040e563b2b20eebbd9e 100644 +--- a/src/main/java/net/minecraft/server/PairedQueue.java ++++ b/src/main/java/net/minecraft/server/PairedQueue.java +@@ -46,7 +46,7 @@ public interface PairedQueue { + public boolean a(PairedQueue.b pairedqueue_b) { + int i = pairedqueue_b.a(); + +- ((Queue) this.a.get(i)).add(pairedqueue_b); ++ this.a.get(i).add(pairedqueue_b); + return true; + } + +diff --git a/src/main/java/net/minecraft/server/PathEntity.java b/src/main/java/net/minecraft/server/PathEntity.java +index d786c3d2eb4e06e20b5125b7ef8fa7d929eb4d01..63b02823bf0dcc79a0cd565b5bccdcd053ff1016 100644 +--- a/src/main/java/net/minecraft/server/PathEntity.java ++++ b/src/main/java/net/minecraft/server/PathEntity.java +@@ -17,7 +17,7 @@ public class PathEntity { + public PathEntity(List list, BlockPosition blockposition, boolean flag) { + this.a = list; + this.f = blockposition; +- this.g = list.isEmpty() ? Float.MAX_VALUE : ((PathPoint) this.a.get(this.a.size() - 1)).c(this.f); ++ this.g = list.isEmpty() ? Float.MAX_VALUE : this.a.get(this.a.size() - 1).c(this.f); + this.h = flag; + } + +@@ -30,11 +30,11 @@ public class PathEntity { + } + + public PathPoint getFinalPoint() { return c(); } @Nullable public PathPoint c() { // Paper - OBFHELPER +- return !this.a.isEmpty() ? (PathPoint) this.a.get(this.a.size() - 1) : null; ++ return !this.a.isEmpty() ? this.a.get(this.a.size() - 1) : null; + } + + public PathPoint a(int i) { +- return (PathPoint) this.a.get(i); ++ return this.a.get(i); + } + + public List d() { +@@ -65,9 +65,9 @@ public class PathEntity { + } + + public Vec3D a(Entity entity, int i) { +- PathPoint pathpoint = (PathPoint) this.a.get(i); ++ PathPoint pathpoint = this.a.get(i); + double d0 = (double) pathpoint.a + (double) ((int) (entity.getWidth() + 1.0F)) * 0.5D; +- double d1 = (double) pathpoint.b; ++ double d1 = pathpoint.b; + double d2 = (double) pathpoint.c + (double) ((int) (entity.getWidth() + 1.0F)) * 0.5D; + + return new Vec3D(d0, d1, d2); +@@ -84,7 +84,7 @@ public class PathEntity { + } + + public PathPoint h() { +- return (PathPoint) this.a.get(this.e); ++ return this.a.get(this.e); + } + + public boolean a(@Nullable PathEntity pathentity) { +@@ -94,8 +94,8 @@ public class PathEntity { + return false; + } else { + for (int i = 0; i < this.a.size(); ++i) { +- PathPoint pathpoint = (PathPoint) this.a.get(i); +- PathPoint pathpoint1 = (PathPoint) pathentity.a.get(i); ++ PathPoint pathpoint = this.a.get(i); ++ PathPoint pathpoint1 = pathentity.a.get(i); + + if (pathpoint.a != pathpoint1.a || pathpoint.b != pathpoint1.b || pathpoint.c != pathpoint1.c) { + return false; +diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java +index 4dca3cd3447ed58f597db33f40da5a2df3c3cd82..018c0e0587d03c5b921e43718eb2e6f017c33e10 100644 +--- a/src/main/java/net/minecraft/server/Pathfinder.java ++++ b/src/main/java/net/minecraft/server/Pathfinder.java +@@ -66,7 +66,7 @@ public class Pathfinder { + Map.Entry entry = list.get(i1); + PathDestination pathdestination = entry.getKey(); + +- if (pathpoint1.c((PathPoint) pathdestination) <= (float) i) { ++ if (pathpoint1.c(pathdestination) <= (float) i) { + pathdestination.e(); + set2.add(entry); + // Paper end +diff --git a/src/main/java/net/minecraft/server/PathfinderAbstract.java b/src/main/java/net/minecraft/server/PathfinderAbstract.java +index 5cfcac3bc29e3f3d139b10209f5082cba292a434..ba1248e59a728d292233f56982b2156bec2a03fa 100644 +--- a/src/main/java/net/minecraft/server/PathfinderAbstract.java ++++ b/src/main/java/net/minecraft/server/PathfinderAbstract.java +@@ -36,7 +36,7 @@ public abstract class PathfinderAbstract { + } + + protected PathPoint a(int i, int j, int k) { +- return (PathPoint) this.c.computeIfAbsent(PathPoint.b(i, j, k), (l) -> { ++ return this.c.computeIfAbsent(PathPoint.b(i, j, k), (l) -> { + return new PathPoint(i, j, k); + }); + } +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java +index 4025b1fcfcc2d1640a288609f456afab99e1d43e..a8e725b74e9a55bc4477c5f16c3bcda6f96689ad 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java +@@ -38,7 +38,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract { + + @Override + public boolean b() { +- return this.a <= this.f() && !this.g() && this.door.a((IPosition) this.entity.getPositionVector(), 2.0D) && this.a(this.entity.world.getDifficulty()); ++ return this.a <= this.f() && !this.g() && this.door.a(this.entity.getPositionVector(), 2.0D) && this.a(this.entity.world.getDifficulty()); + } + + @Override +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalDefendVillage.java b/src/main/java/net/minecraft/server/PathfinderGoalDefendVillage.java +index 38a73e167f1a0dd0f5855be018848704ebb2affb..d7b2ba03c57cfc6ab7c6bdac6a9979e7f5e557c6 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalDefendVillage.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalDefendVillage.java +@@ -20,7 +20,7 @@ public class PathfinderGoalDefendVillage extends PathfinderGoalTarget { + public boolean a() { + AxisAlignedBB axisalignedbb = this.a.getBoundingBox().grow(10.0D, 8.0D, 10.0D); + List list = this.a.world.a(EntityVillager.class, this.c, this.a, axisalignedbb); +- List list1 = this.a.world.a(this.c, (EntityLiving) this.a, axisalignedbb); ++ List list1 = this.a.world.a(this.c, this.a, axisalignedbb); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java +index e2b23978e347fe63e8bc900b72da6cbaf27bf652..2ff2be6175eb83db49e84e9689880f989420a3a1 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java +@@ -16,7 +16,7 @@ public class PathfinderGoalFloat extends PathfinderGoal { + public final boolean validConditions() { return this.a(); } // Paper - OBFHELPER + @Override + public boolean a() { +- return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cw() || this.a.aN(); ++ return this.a.isInWater() && this.a.b(TagsFluid.WATER) > this.a.cw() || this.a.aN(); + } + + public void update() { this.e(); } // Paper - OBFHELPER +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java b/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java +index 2eb4eab78cf7f8205092982ab1278188085ecd80..f730980df805e80afd69aa7140908b8a22b606ed 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java +@@ -80,7 +80,7 @@ public class PathfinderGoalFollowOwner extends PathfinderGoal { + if (this.a.h((Entity) this.b) >= 144.0D) { + this.g(); + } else { +- this.e.a((Entity) this.b, this.d); ++ this.e.a(this.b, this.d); + } + + } +@@ -111,7 +111,7 @@ public class PathfinderGoalFollowOwner extends PathfinderGoal { + } else { + // CraftBukkit start + CraftEntity entity = this.a.getBukkitEntity(); +- Location to = new Location(entity.getWorld(), (double) i + 0.5D, (double) j, (double) k + 0.5D, this.a.yaw, this.a.pitch); ++ Location to = new Location(entity.getWorld(), (double) i + 0.5D, j, (double) k + 0.5D, this.a.yaw, this.a.pitch); + EntityTeleportEvent event = new EntityTeleportEvent(entity, entity.getLocation(), to); + this.a.world.getServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { +@@ -127,7 +127,7 @@ public class PathfinderGoalFollowOwner extends PathfinderGoal { + } + + private boolean a(BlockPosition blockposition) { +- PathType pathtype = PathfinderNormal.a((IBlockAccess) this.c, blockposition.i()); ++ PathType pathtype = PathfinderNormal.a(this.c, blockposition.i()); + + if (pathtype != PathType.WALKABLE) { + return false; +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java +index 3e26c32d0c886c6bd70aa4823d8738cdde7a6b24..5cf2fa8c2d59984524b9d7e4720c1528ef413aaa 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java +@@ -64,7 +64,7 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal { + } + + protected void g() { +- this.a.getNavigation().a((double) ((float) this.e.getX()) + 0.5D, (double) (this.e.getY() + 1), (double) ((float) this.e.getZ()) + 0.5D, this.b); ++ this.a.getNavigation().a((double) ((float) this.e.getX()) + 0.5D, this.e.getY() + 1, (double) ((float) this.e.getZ()) + 0.5D, this.b); + } + + public double h() { +@@ -73,11 +73,11 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal { + + @Override + public void e() { +- if (!this.e.up().a((IPosition) this.a.getPositionVector(), this.h())) { ++ if (!this.e.up().a(this.a.getPositionVector(), this.h())) { + this.h = false; + ++this.d; + if (this.j()) { +- this.a.getNavigation().a((double) ((float) this.e.getX()) + 0.5D, (double) (this.e.getY() + 1), (double) ((float) this.e.getZ()) + 0.5D, this.b); ++ this.a.getNavigation().a((double) ((float) this.e.getX()) + 0.5D, this.e.getY() + 1, (double) ((float) this.e.getZ()) + 0.5D, this.b); + } + } else { + this.h = true; +@@ -105,7 +105,7 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal { + for (int i1 = 0; i1 <= l; i1 = i1 > 0 ? -i1 : 1 - i1) { + for (int j1 = i1 < l && i1 > -l ? l : 0; j1 <= l; j1 = j1 > 0 ? -j1 : 1 - j1) { + blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, i1, k - 1, j1); +- if (this.a.a((BlockPosition) blockposition_mutableblockposition) && this.a(this.a.world, blockposition_mutableblockposition)) { ++ if (this.a.a(blockposition_mutableblockposition) && this.a(this.a.world, blockposition_mutableblockposition)) { + this.e = blockposition_mutableblockposition; + setTarget(blockposition_mutableblockposition.immutableCopy()); // Paper + return true; +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java +index b37e4aa37b35863d74cb6ef95562fba65486bdf9..5652737dc98c9b0b076d67f76dd60770804017ad 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java +@@ -21,7 +21,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { + this.a.t(false); + this.a.setTamed(true); + this.a.setAgeRaw(0); +- EntityLightning entitylightning = (EntityLightning) EntityTypes.LIGHTNING_BOLT.a(this.a.world); ++ EntityLightning entitylightning = EntityTypes.LIGHTNING_BOLT.a(this.a.world); + + entitylightning.teleportAndSync(this.a.locX(), this.a.locY(), this.a.locZ()); + entitylightning.setEffect(true); +@@ -42,9 +42,9 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { + } + + private EntityHorseAbstract a(DifficultyDamageScaler difficultydamagescaler) { +- EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a(this.a.world); ++ EntityHorseSkeleton entityhorseskeleton = EntityTypes.SKELETON_HORSE.a(this.a.world); + +- entityhorseskeleton.prepare(this.a.world, difficultydamagescaler, EnumMobSpawn.TRIGGERED, (GroupDataEntity) null, (NBTTagCompound) null); ++ entityhorseskeleton.prepare(this.a.world, difficultydamagescaler, EnumMobSpawn.TRIGGERED, null, null); + entityhorseskeleton.setPosition(this.a.locX(), this.a.locY(), this.a.locZ()); + entityhorseskeleton.noDamageTicks = 60; + entityhorseskeleton.setPersistent(); +@@ -55,9 +55,9 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { + } + + private EntitySkeleton a(DifficultyDamageScaler difficultydamagescaler, EntityHorseAbstract entityhorseabstract) { +- EntitySkeleton entityskeleton = (EntitySkeleton) EntityTypes.SKELETON.a(entityhorseabstract.world); ++ EntitySkeleton entityskeleton = EntityTypes.SKELETON.a(entityhorseabstract.world); + +- entityskeleton.prepare(entityhorseabstract.world, difficultydamagescaler, EnumMobSpawn.TRIGGERED, (GroupDataEntity) null, (NBTTagCompound) null); ++ entityskeleton.prepare(entityhorseabstract.world, difficultydamagescaler, EnumMobSpawn.TRIGGERED, null, null); + entityskeleton.setPosition(entityhorseabstract.locX(), entityhorseabstract.locY(), entityhorseabstract.locZ()); + entityskeleton.noDamageTicks = 60; + entityskeleton.setPersistent(); +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java +index dee689e4c792d94d5f313aa44e0568648a8fe949..1eb9b30fcdcf6cadb2671dfbeea0cc95f43bee4e 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java +@@ -16,7 +16,7 @@ public class PathfinderGoalNearestAttackableTarget exten + } + + public PathfinderGoalNearestAttackableTarget(EntityInsentient entityinsentient, Class oclass, boolean flag, boolean flag1) { +- this(entityinsentient, oclass, 10, flag, flag1, (Predicate) null); ++ this(entityinsentient, oclass, 10, flag, flag1, null); + } + + public PathfinderGoalNearestAttackableTarget(EntityInsentient entityinsentient, Class oclass, int i, boolean flag, boolean flag1, @Nullable Predicate predicate) { +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java +index 30eab63fc900b4c92458d033cd26c9bf01575411..c4d5793e40088104853ea62648b6abad303dc226 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java +@@ -27,9 +27,9 @@ public class PathfinderGoalPanic extends PathfinderGoal { + BlockPosition blockposition = this.a(this.a.world, this.a, 5, 4); + + if (blockposition != null) { +- this.c = (double) blockposition.getX(); +- this.d = (double) blockposition.getY(); +- this.e = (double) blockposition.getZ(); ++ this.c = blockposition.getX(); ++ this.d = blockposition.getY(); ++ this.e = blockposition.getZ(); + return true; + } + } +@@ -70,7 +70,7 @@ public class PathfinderGoalPanic extends PathfinderGoal { + public boolean b() { + // CraftBukkit start - introduce a temporary timeout hack until this is fixed properly + if ((this.a.ticksLived - this.a.hurtTimestamp) > 100) { +- this.a.setLastDamager((EntityLiving) null); ++ this.a.setLastDamager(null); + return false; + } + // CraftBukkit end +@@ -91,7 +91,7 @@ public class PathfinderGoalPanic extends PathfinderGoal { + for (int k1 = l - j; k1 <= l + j; ++k1) { + for (int l1 = i1 - i; l1 <= i1 + i; ++l1) { + blockposition_mutableblockposition.d(j1, k1, l1); +- if (iblockaccess.getFluid(blockposition_mutableblockposition).a((Tag) TagsFluid.WATER)) { ++ if (iblockaccess.getFluid(blockposition_mutableblockposition).a(TagsFluid.WATER)) { + float f1 = (float) ((j1 - k) * (j1 - k) + (k1 - l) * (k1 - l) + (l1 - i1) * (l1 - i1)); + + if (f1 < f) { +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java +index b27679e5993177d550a7a2727fc3bcda5afe15b5..d22f1cece57161cdcc892459a4ce2437cae0b473 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java +@@ -62,7 +62,7 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { + super.e(); + World world = this.entity.world; + BlockPosition blockposition = this.entity.getChunkCoordinates(); +- BlockPosition blockposition1 = this.a(blockposition, (IBlockAccess) world); ++ BlockPosition blockposition1 = this.a(blockposition, world); + Random random = this.entity.getRandom(); + + if (this.k() && blockposition1 != null) { +@@ -89,7 +89,7 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { + if (this.i > 60) { + // CraftBukkit start - Step on eggs + EntityInteractEvent event = new EntityInteractEvent(this.entity.getBukkitEntity(), CraftBlock.at(world, blockposition1)); +- world.getServer().getPluginManager().callEvent((EntityInteractEvent) event); ++ world.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; +@@ -102,7 +102,7 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { + double d1 = random.nextGaussian() * 0.02D; + double d2 = random.nextGaussian() * 0.02D; + +- ((WorldServer) world).a(Particles.POOF, (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY(), (double) blockposition1.getZ() + 0.5D, 1, d0, d1, d2, 0.15000000596046448D); ++ ((WorldServer) world).a(Particles.POOF, (double) blockposition1.getX() + 0.5D, blockposition1.getY(), (double) blockposition1.getZ() + 0.5D, 1, d0, d1, d2, 0.15000000596046448D); + } + + this.a(world, blockposition1); +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +index 3d791a74c37193dbf76d6b0a3d428d94a988d39f..35576de0a92f407ccd6786edfc720de2ca5768ea 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +@@ -76,7 +76,7 @@ public class PathfinderGoalSelector { + private static final PathfinderGoal.Type[] PATHFINDER_GOAL_TYPES = PathfinderGoal.Type.values(); // Paper - remove streams from pathfindergoalselector + + public void doTick() { +- GameProfilerFiller gameprofilerfiller = (GameProfilerFiller) this.e.get(); ++ GameProfilerFiller gameprofilerfiller = this.e.get(); + + //gameprofilerfiller.enter("goalCleanup"); // Akarin - remove caller + // Paper start - remove streams from pathfindergoalselector +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTame.java b/src/main/java/net/minecraft/server/PathfinderGoalTame.java +index 3f86ec4cfda0193be8faf4b15c0264d46d818470..36dd199a6dd0a764f4856d702dc0234a744aa3e2 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalTame.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalTame.java +@@ -47,7 +47,7 @@ public class PathfinderGoalTame extends PathfinderGoal { + @Override + public void e() { + if (!this.entity.isTamed() && this.entity.getRandom().nextInt(50) == 0) { +- Entity entity = (Entity) this.entity.getPassengers().get(0); ++ Entity entity = this.entity.getPassengers().get(0); + + if (entity == null) { + return; +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalTarget.java +index 6d1b9348e95ce154a1cae31e7f67a6213a1d3803..06ed42d9ddcd4cf21ed48101fbc11c4b41a4d4fa 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalTarget.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalTarget.java +@@ -82,7 +82,7 @@ public abstract class PathfinderGoalTarget extends PathfinderGoal { + + @Override + public void d() { +- this.e.setGoalTarget((EntityLiving) null, EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit ++ this.e.setGoalTarget(null, EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit + this.g = null; + } + +@@ -114,7 +114,7 @@ public abstract class PathfinderGoalTarget extends PathfinderGoal { + + private boolean a(EntityLiving entityliving) { + this.c = 10 + this.e.getRandom().nextInt(5); +- PathEntity pathentity = this.e.getNavigation().a((Entity) entityliving, 0); ++ PathEntity pathentity = this.e.getNavigation().a(entityliving, 0); + + if (pathentity == null) { + return false; +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java +index c6feca04953a946aff4936bfd85b0e45c612a01c..ca18a211011342173fb3af1ca6d857b3d342cc16 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java +@@ -45,7 +45,7 @@ public class PathfinderGoalTempt extends PathfinderGoal { + --this.j; + return false; + } else { +- this.target = this.a.world.a(PathfinderGoalTempt.c, (EntityLiving) this.a); ++ this.target = this.a.world.a(PathfinderGoalTempt.c, this.a); + // CraftBukkit start + boolean tempt = this.target == null ? false : this.a(this.target.getItemInMainHand()) || this.a(this.target.getItemInOffHand()); + if (tempt) { +@@ -81,8 +81,8 @@ public class PathfinderGoalTempt extends PathfinderGoal { + this.g = this.target.locZ(); + } + +- this.h = (double) this.target.pitch; +- this.i = (double) this.target.yaw; ++ this.h = this.target.pitch; ++ this.i = this.target.yaw; + } + + return this.a(); +@@ -114,7 +114,7 @@ public class PathfinderGoalTempt extends PathfinderGoal { + if (this.a.h((Entity) this.target) < 6.25D) { + this.a.getNavigation().o(); + } else { +- this.a.getNavigation().a((Entity) this.target, this.d); ++ this.a.getNavigation().a(this.target, this.d); + } + + } +diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java +index af25ec2b833fa10a7d27c4cf91c505aee85bffe6..27bd263c43fb8db2737b30d4b94b2e1e3cba739b 100644 +--- a/src/main/java/net/minecraft/server/PathfinderNormal.java ++++ b/src/main/java/net/minecraft/server/PathfinderNormal.java +@@ -43,27 +43,27 @@ public class PathfinderNormal extends PathfinderAbstract { + public PathPoint b() { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); + int i = MathHelper.floor(this.b.locY()); +- IBlockData iblockdata = this.a.getType(blockposition_mutableblockposition.c(this.b.locX(), (double) i, this.b.locZ())); ++ IBlockData iblockdata = this.a.getType(blockposition_mutableblockposition.c(this.b.locX(), i, this.b.locZ())); + BlockPosition blockposition; + + if (this.b.a(iblockdata.getFluid().getType())) { + while (this.b.a(iblockdata.getFluid().getType())) { + ++i; +- iblockdata = this.a.getType(blockposition_mutableblockposition.c(this.b.locX(), (double) i, this.b.locZ())); ++ iblockdata = this.a.getType(blockposition_mutableblockposition.c(this.b.locX(), i, this.b.locZ())); + } + + --i; + } else if (this.e() && this.b.isInWater()) { + while (iblockdata.getBlock() == Blocks.WATER || iblockdata.getFluid() == FluidTypes.WATER.a(false)) { + ++i; +- iblockdata = this.a.getType(blockposition_mutableblockposition.c(this.b.locX(), (double) i, this.b.locZ())); ++ iblockdata = this.a.getType(blockposition_mutableblockposition.c(this.b.locX(), i, this.b.locZ())); + } + + --i; + } else if (this.b.isOnGround()) { + i = MathHelper.floor(this.b.locY() + 0.5D); + } else { +- for (blockposition = this.b.getChunkCoordinates(); (this.a.getType(blockposition).isAir() || this.a.getType(blockposition).a((IBlockAccess) this.a, blockposition, PathMode.LAND)) && blockposition.getY() > 0; blockposition = blockposition.down()) { ++ for (blockposition = this.b.getChunkCoordinates(); (this.a.getType(blockposition).isAir() || this.a.getType(blockposition).a(this.a, blockposition, PathMode.LAND)) && blockposition.getY() > 0; blockposition = blockposition.down()) { + ; + } + +@@ -76,8 +76,8 @@ public class PathfinderNormal extends PathfinderAbstract { + if (this.b.a(pathtype) < 0.0F) { + AxisAlignedBB axisalignedbb = this.b.getBoundingBox(); + +- if (this.b(blockposition_mutableblockposition.c(axisalignedbb.minX, (double) i, axisalignedbb.minZ)) || this.b(blockposition_mutableblockposition.c(axisalignedbb.minX, (double) i, axisalignedbb.maxZ)) || this.b(blockposition_mutableblockposition.c(axisalignedbb.maxX, (double) i, axisalignedbb.minZ)) || this.b(blockposition_mutableblockposition.c(axisalignedbb.maxX, (double) i, axisalignedbb.maxZ))) { +- PathPoint pathpoint = this.a((BlockPosition) blockposition_mutableblockposition); ++ if (this.b(blockposition_mutableblockposition.c(axisalignedbb.minX, i, axisalignedbb.minZ)) || this.b(blockposition_mutableblockposition.c(axisalignedbb.minX, i, axisalignedbb.maxZ)) || this.b(blockposition_mutableblockposition.c(axisalignedbb.maxX, i, axisalignedbb.minZ)) || this.b(blockposition_mutableblockposition.c(axisalignedbb.maxX, i, axisalignedbb.maxZ))) { ++ PathPoint pathpoint = this.a(blockposition_mutableblockposition); + + pathpoint.l = this.a(this.b, pathpoint.a()); + pathpoint.k = this.b.a(pathpoint.l); +@@ -114,7 +114,7 @@ public class PathfinderNormal extends PathfinderAbstract { + j = MathHelper.d(Math.max(1.0F, this.b.G)); + } + +- double d0 = a((IBlockAccess) this.a, new BlockPosition(pathpoint.a, pathpoint.b, pathpoint.c)); ++ double d0 = a(this.a, new BlockPosition(pathpoint.a, pathpoint.b, pathpoint.c)); + PathPoint pathpoint1 = this.a(pathpoint.a, pathpoint.b, pathpoint.c + 1, j, d0, EnumDirection.SOUTH, pathtype1); + + if (this.a(pathpoint1, pathpoint)) { +@@ -214,7 +214,7 @@ public class PathfinderNormal extends PathfinderAbstract { + private PathPoint a(int i, int j, int k, int l, double d0, EnumDirection enumdirection, PathType pathtype) { + PathPoint pathpoint = null; + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); +- double d1 = a((IBlockAccess) this.a, (BlockPosition) blockposition_mutableblockposition.d(i, j, k)); ++ double d1 = a(this.a, (BlockPosition) blockposition_mutableblockposition.d(i, j, k)); + + if (d1 - d0 > 1.125D) { + return null; +@@ -241,7 +241,7 @@ public class PathfinderNormal extends PathfinderAbstract { + if (pathpoint != null && (pathpoint.l == PathType.OPEN || pathpoint.l == PathType.WALKABLE) && this.b.getWidth() < 1.0F) { + double d3 = (double) (i - enumdirection.getAdjacentX()) + 0.5D; + double d4 = (double) (k - enumdirection.getAdjacentZ()) + 0.5D; +- AxisAlignedBB axisalignedbb = new AxisAlignedBB(d3 - d2, a((IBlockAccess) this.a, (BlockPosition) blockposition_mutableblockposition.c(d3, (double) (j + 1), d4)) + 0.001D, d4 - d2, d3 + d2, (double) this.b.getHeight() + a((IBlockAccess) this.a, (BlockPosition) blockposition_mutableblockposition.c((double) pathpoint.a, (double) pathpoint.b, (double) pathpoint.c)) - 0.002D, d4 + d2); ++ AxisAlignedBB axisalignedbb = new AxisAlignedBB(d3 - d2, a(this.a, (BlockPosition) blockposition_mutableblockposition.c(d3, j + 1, d4)) + 0.001D, d4 - d2, d3 + d2, (double) this.b.getHeight() + a(this.a, (BlockPosition) blockposition_mutableblockposition.c(pathpoint.a, pathpoint.b, pathpoint.c)) - 0.002D, d4 + d2); + + if (this.a(axisalignedbb)) { + pathpoint = null; +@@ -268,7 +268,7 @@ public class PathfinderNormal extends PathfinderAbstract { + } + + if (pathtype1 == PathType.OPEN) { +- AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double) i - d2 + 0.5D, (double) j + 0.001D, (double) k - d2 + 0.5D, (double) i + d2 + 0.5D, (double) ((float) j + this.b.getHeight()), (double) k + d2 + 0.5D); ++ AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double) i - d2 + 0.5D, (double) j + 0.001D, (double) k - d2 + 0.5D, (double) i + d2 + 0.5D, (float) j + this.b.getHeight(), (double) k + d2 + 0.5D); + + if (this.a(axisalignedbb1)) { + return null; +@@ -336,7 +336,7 @@ public class PathfinderNormal extends PathfinderAbstract { + } + + private boolean a(AxisAlignedBB axisalignedbb) { +- return (Boolean) this.l.computeIfAbsent(axisalignedbb, (axisalignedbb1) -> { ++ return this.l.computeIfAbsent(axisalignedbb, (axisalignedbb1) -> { + return !this.a.getCubes(this.b, axisalignedbb); + }); + } +@@ -423,7 +423,7 @@ public class PathfinderNormal extends PathfinderAbstract { + } + + private PathType a(EntityInsentient entityinsentient, int i, int j, int k) { +- return (PathType) this.k.computeIfAbsent(BlockPosition.a(i, j, k), (l) -> { ++ return this.k.computeIfAbsent(BlockPosition.a(i, j, k), (l) -> { + return this.a(this.a, i, j, k, entityinsentient, this.d, this.e, this.f, this.d(), this.c()); + }); + } +@@ -498,11 +498,11 @@ public class PathfinderNormal extends PathfinderAbstract { + + Fluid fluid = iblockaccess.getFluid(blockposition_mutableblockposition); + +- if (fluid.a((Tag) TagsFluid.WATER)) { ++ if (fluid.a(TagsFluid.WATER)) { + return PathType.WATER_BORDER; + } + +- if (fluid.a((Tag) TagsFluid.LAVA)) { ++ if (fluid.a(TagsFluid.LAVA)) { + return PathType.LAVA; + } + } // Paper +@@ -568,13 +568,13 @@ public class PathfinderNormal extends PathfinderAbstract { + return PathType.DOOR_WOOD_CLOSED; + } else if (block instanceof BlockDoor && material == Material.ORE && !(Boolean) iblockdata.get(BlockDoor.OPEN)) { + return PathType.DOOR_IRON_CLOSED; +- } else if (block instanceof BlockDoor && (Boolean) iblockdata.get(BlockDoor.OPEN)) { ++ } else if (block instanceof BlockDoor && iblockdata.get(BlockDoor.OPEN)) { + return PathType.DOOR_OPEN; + } else if (block instanceof BlockMinecartTrackAbstract) { + return PathType.RAIL; + } else if (block instanceof BlockLeaves) { + return PathType.LEAVES; +- } else if (!block.a((Tag) TagsBlock.FENCES) && !block.a((Tag) TagsBlock.WALLS) && (!(block instanceof BlockFenceGate) || (Boolean) iblockdata.get(BlockFenceGate.OPEN))) { ++ } else if (!block.a(TagsBlock.FENCES) && !block.a(TagsBlock.WALLS) && (!(block instanceof BlockFenceGate) || iblockdata.get(BlockFenceGate.OPEN))) { + if (!iblockdata.a(iblockaccess, blockposition, PathMode.LAND)) { + return PathType.BLOCKED; + } else { +@@ -594,6 +594,6 @@ public class PathfinderNormal extends PathfinderAbstract { + } + + private static boolean a(IBlockData iblockdata) { +- return iblockdata.a((Tag) TagsBlock.FIRE) || iblockdata.a(Blocks.MAGMA_BLOCK) || BlockCampfire.g(iblockdata); ++ return iblockdata.a(TagsBlock.FIRE) || iblockdata.a(Blocks.MAGMA_BLOCK) || BlockCampfire.g(iblockdata); + } + } +diff --git a/src/main/java/net/minecraft/server/PathfinderTurtle.java b/src/main/java/net/minecraft/server/PathfinderTurtle.java +index 9598563b4f97500fd3fba0165813d564d9c96c4f..a6427544d5410104a539456951df96abeedb29c1 100644 +--- a/src/main/java/net/minecraft/server/PathfinderTurtle.java ++++ b/src/main/java/net/minecraft/server/PathfinderTurtle.java +@@ -146,7 +146,7 @@ public class PathfinderTurtle extends PathfinderNormal { + } + + if (pathtype == PathType.OPEN) { +- AxisAlignedBB axisalignedbb = new AxisAlignedBB((double) i - d2 + 0.5D, (double) j + 0.001D, (double) k - d2 + 0.5D, (double) i + d2 + 0.5D, (double) ((float) j + this.b.getHeight()), (double) k + d2 + 0.5D); ++ AxisAlignedBB axisalignedbb = new AxisAlignedBB((double) i - d2 + 0.5D, (double) j + 0.001D, (double) k - d2 + 0.5D, (double) i + d2 + 0.5D, (float) j + this.b.getHeight(), (double) k + d2 + 0.5D); + + if (!this.a.getCubes(this.b, axisalignedbb)) { // Akarin - use chunk cache + return null; +@@ -249,7 +249,7 @@ public class PathfinderTurtle extends PathfinderNormal { + pathtype = PathType.OPEN; + } + +- if (pathtype2 == PathType.DAMAGE_FIRE || iblockdata.a(Blocks.MAGMA_BLOCK) || iblockdata.a((Tag) TagsBlock.CAMPFIRES)) { ++ if (pathtype2 == PathType.DAMAGE_FIRE || iblockdata.a(Blocks.MAGMA_BLOCK) || iblockdata.a(TagsBlock.CAMPFIRES)) { + pathtype = PathType.DAMAGE_FIRE; + } + +diff --git a/src/main/java/net/minecraft/server/PathfinderWater.java b/src/main/java/net/minecraft/server/PathfinderWater.java +index d576edc8c30288e98aeda8f1cb561b22c6b37536..ad2b57bf424af66e73109d8fefcf77463f520b33 100644 +--- a/src/main/java/net/minecraft/server/PathfinderWater.java ++++ b/src/main/java/net/minecraft/server/PathfinderWater.java +@@ -49,7 +49,7 @@ public class PathfinderWater extends PathfinderAbstract { + Fluid fluid = iblockaccess.getFluid(blockposition); + IBlockData iblockdata = iblockaccess.getType(blockposition); + +- return fluid.isEmpty() && iblockdata.a(iblockaccess, blockposition.down(), PathMode.WATER) && iblockdata.isAir() ? PathType.BREACH : (fluid.a((Tag) TagsFluid.WATER) && iblockdata.a(iblockaccess, blockposition, PathMode.WATER) ? PathType.WATER : PathType.BLOCKED); ++ return fluid.isEmpty() && iblockdata.a(iblockaccess, blockposition.down(), PathMode.WATER) && iblockdata.isAir() ? PathType.BREACH : (fluid.a(TagsFluid.WATER) && iblockdata.a(iblockaccess, blockposition, PathMode.WATER) ? PathType.WATER : PathType.BLOCKED); + } + + @Nullable +@@ -87,11 +87,11 @@ public class PathfinderWater extends PathfinderAbstract { + Fluid fluid = this.a.getFluid(blockposition_mutableblockposition.d(l, i1, j1)); + IBlockData iblockdata = this.a.getType(blockposition_mutableblockposition.d(l, i1, j1)); + +- if (fluid.isEmpty() && iblockdata.a((IBlockAccess) this.a, blockposition_mutableblockposition.down(), PathMode.WATER) && iblockdata.isAir()) { ++ if (fluid.isEmpty() && iblockdata.a(this.a, blockposition_mutableblockposition.down(), PathMode.WATER) && iblockdata.isAir()) { + return PathType.BREACH; + } + +- if (!fluid.a((Tag) TagsFluid.WATER)) { ++ if (!fluid.a(TagsFluid.WATER)) { + return PathType.BLOCKED; + } + } +@@ -100,7 +100,7 @@ public class PathfinderWater extends PathfinderAbstract { + + IBlockData iblockdata1 = this.a.getType(blockposition_mutableblockposition); + +- if (iblockdata1.a((IBlockAccess) this.a, blockposition_mutableblockposition, PathMode.WATER)) { ++ if (iblockdata1.a(this.a, blockposition_mutableblockposition, PathMode.WATER)) { + return PathType.WATER; + } else { + return PathType.BLOCKED; +diff --git a/src/main/java/net/minecraft/server/PersistentRaid.java b/src/main/java/net/minecraft/server/PersistentRaid.java +index 56f766ebddb0727b1edab918bc34151155bfa7a0..1251a581bfe558458788248c4cf029b0d682896f 100644 +--- a/src/main/java/net/minecraft/server/PersistentRaid.java ++++ b/src/main/java/net/minecraft/server/PersistentRaid.java +@@ -23,7 +23,7 @@ public class PersistentRaid extends PersistentBase { + } + + public Raid a(int i) { +- return (Raid) this.raids.get(i); ++ return this.raids.get(i); + } + + public void a() { +@@ -69,7 +69,7 @@ public class PersistentRaid extends PersistentBase { + return null; + } else { + BlockPosition blockposition = entityplayer.getChunkCoordinates(); +- List list = (List) this.b.x().c(VillagePlaceType.b, blockposition, 64, VillagePlace.Occupancy.IS_OCCUPIED).collect(Collectors.toList()); ++ List list = this.b.x().c(VillagePlaceType.b, blockposition, 64, VillagePlace.Occupancy.IS_OCCUPIED).collect(Collectors.toList()); + int i = 0; + Vec3D vec3d = Vec3D.a; + +@@ -77,7 +77,7 @@ public class PersistentRaid extends PersistentBase { + VillagePlaceRecord villageplacerecord = (VillagePlaceRecord) iterator.next(); + BlockPosition blockposition1 = villageplacerecord.f(); + +- vec3d = vec3d.add((double) blockposition1.getX(), (double) blockposition1.getY(), (double) blockposition1.getZ()); ++ vec3d = vec3d.add(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ()); + } + + BlockPosition blockposition2; +@@ -120,7 +120,7 @@ public class PersistentRaid extends PersistentBase { + this.raids.put(raid.getId(), raid); + } + // CraftBukkit end +- raid.a((EntityHuman) entityplayer); ++ raid.a(entityplayer); + entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) 43)); + if (!raid.c()) { + entityplayer.a(StatisticList.RAID_TRIGGER); +@@ -185,7 +185,7 @@ public class PersistentRaid extends PersistentBase { + @Nullable + public Raid getNearbyRaid(BlockPosition blockposition, int i) { + Raid raid = null; +- double d0 = (double) i; ++ double d0 = i; + Iterator iterator = this.raids.values().iterator(); + + while (iterator.hasNext()) { +diff --git a/src/main/java/net/minecraft/server/PersistentStructureLegacy.java b/src/main/java/net/minecraft/server/PersistentStructureLegacy.java +index a263559c2136743a4549ae630fc8a50b445abe45..e70ee0c75877760317598d511200684ed4198ece 100644 +--- a/src/main/java/net/minecraft/server/PersistentStructureLegacy.java ++++ b/src/main/java/net/minecraft/server/PersistentStructureLegacy.java +@@ -15,7 +15,7 @@ import java.util.Map; + + public class PersistentStructureLegacy { + +- private static final Map a = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error ++ private static final Map a = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error + hashmap.put("Village", "Village"); + hashmap.put("Mineshaft", "Mineshaft"); + hashmap.put("Mansion", "Mansion"); +@@ -28,7 +28,7 @@ public class PersistentStructureLegacy { + hashmap.put("Fortress", "Fortress"); + hashmap.put("EndCity", "EndCity"); + }); +- private static final Map b = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error ++ private static final Map b = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error + hashmap.put("Iglu", "Igloo"); + hashmap.put("TeDP", "Desert_Pyramid"); + hashmap.put("TeJP", "Jungle_Pyramid"); +@@ -60,7 +60,7 @@ public class PersistentStructureLegacy { + + while (iterator.hasNext()) { + String s = (String) iterator.next(); +- PersistentIndexed persistentindexed = (PersistentIndexed) this.e.get(s); ++ PersistentIndexed persistentindexed = this.e.get(s); + + if (persistentindexed != null && persistentindexed.c(i)) { + persistentindexed.d(i); +@@ -84,7 +84,7 @@ public class PersistentStructureLegacy { + + while (iterator.hasNext()) { + String s = (String) iterator.next(); +- StructureGenerator structuregenerator = (StructureGenerator) StructureGenerator.a.get(s.toLowerCase(Locale.ROOT)); ++ StructureGenerator structuregenerator = StructureGenerator.a.get(s.toLowerCase(Locale.ROOT)); + + if (!nbttagcompound3.hasKeyOfType(s, 12) && structuregenerator != null) { + boolean flag = true; +@@ -98,7 +98,7 @@ public class PersistentStructureLegacy { + } + } + +- nbttagcompound3.c(s, (List) longarraylist); ++ nbttagcompound3.c(s, longarraylist); + } + } + +@@ -109,7 +109,7 @@ public class PersistentStructureLegacy { + } + + private boolean a(int i, int j, String s) { +- return !this.c ? false : this.d.get(s) != null && ((PersistentIndexed) this.e.get(PersistentStructureLegacy.a.get(s))).b(ChunkCoordIntPair.pair(i, j)); ++ return !this.c ? false : this.d.get(s) != null && this.e.get(PersistentStructureLegacy.a.get(s)).b(ChunkCoordIntPair.pair(i, j)); + } + + private boolean a(int i, int j) { +@@ -126,7 +126,7 @@ public class PersistentStructureLegacy { + } + + s = (String) iterator.next(); +- } while (this.d.get(s) == null || !((PersistentIndexed) this.e.get(PersistentStructureLegacy.a.get(s))).c(ChunkCoordIntPair.pair(i, j))); ++ } while (this.d.get(s) == null || !this.e.get(PersistentStructureLegacy.a.get(s)).c(ChunkCoordIntPair.pair(i, j))); + + return true; + } +@@ -140,13 +140,13 @@ public class PersistentStructureLegacy { + + while (iterator.hasNext()) { + String s = (String) iterator.next(); +- Long2ObjectMap long2objectmap = (Long2ObjectMap) this.d.get(s); ++ Long2ObjectMap long2objectmap = this.d.get(s); + + if (long2objectmap != null) { + long i = chunkcoordintpair.pair(); + +- if (((PersistentIndexed) this.e.get(PersistentStructureLegacy.a.get(s))).c(i)) { +- NBTTagCompound nbttagcompound4 = (NBTTagCompound) long2objectmap.get(i); ++ if (this.e.get(PersistentStructureLegacy.a.get(s)).c(i)) { ++ NBTTagCompound nbttagcompound4 = long2objectmap.get(i); + + if (nbttagcompound4 != null) { + nbttagcompound3.set(s, nbttagcompound4); +@@ -189,7 +189,7 @@ public class PersistentStructureLegacy { + + if (!nbttaglist.isEmpty()) { + s2 = nbttaglist.getCompound(0).getString("id"); +- String s3 = (String) PersistentStructureLegacy.b.get(s2); ++ String s3 = PersistentStructureLegacy.b.get(s2); + + if (s3 != null) { + nbttagcompound1.setString("id", s3); +@@ -203,7 +203,7 @@ public class PersistentStructureLegacy { + } + + String s4 = s + "_index"; +- PersistentIndexed persistentindexed = (PersistentIndexed) worldpersistentdata.a(() -> { ++ PersistentIndexed persistentindexed = worldpersistentdata.a(() -> { + return new PersistentIndexed(s4); + }, s4); + +diff --git a/src/main/java/net/minecraft/server/PiglinAI.java b/src/main/java/net/minecraft/server/PiglinAI.java +index e219d23643fb01227fca8b83011525b23cbf4600..33813ba80ee8e14875234c099fccc61a582a46f0 100644 +--- a/src/main/java/net/minecraft/server/PiglinAI.java ++++ b/src/main/java/net/minecraft/server/PiglinAI.java +@@ -25,7 +25,7 @@ public class PiglinAI { + c(behaviorcontroller); + e(behaviorcontroller); + f(behaviorcontroller); +- behaviorcontroller.a((Set) ImmutableSet.of(Activity.CORE)); ++ behaviorcontroller.a(ImmutableSet.of(Activity.CORE)); + behaviorcontroller.b(Activity.IDLE); + behaviorcontroller.e(); + return behaviorcontroller; +@@ -34,7 +34,7 @@ public class PiglinAI { + protected static void a(EntityPiglin entitypiglin) { + int i = PiglinAI.b.a(entitypiglin.world.random); + +- entitypiglin.getBehaviorController().a(MemoryModuleType.HUNTED_RECENTLY, true, (long) i); ++ entitypiglin.getBehaviorController().a(MemoryModuleType.HUNTED_RECENTLY, true, i); + } + + private static void a(BehaviorController behaviorcontroller) { +@@ -77,7 +77,7 @@ public class PiglinAI { + + private static BehaviorGateSingle b() { + // CraftBukkit - decompile error +- return new BehaviorGateSingle<>(ImmutableList.of(Pair.of(new BehaviorStrollRandomUnconstrained(0.6F), 2), Pair.of(BehaviorInteract.a(EntityTypes.PIGLIN, 8, MemoryModuleType.INTERACTION_TARGET, 0.6F, 2), 2), Pair.of(new BehaviorRunIf<>((java.util.function.Predicate) PiglinAI::g, new BehaviorLookWalk(0.6F, 3)), 2), Pair.of(new BehaviorNop(30, 60), 1))); ++ return new BehaviorGateSingle(ImmutableList.of(Pair.of(new BehaviorStrollRandomUnconstrained(0.6F), 2), Pair.of(BehaviorInteract.a(EntityTypes.PIGLIN, 8, MemoryModuleType.INTERACTION_TARGET, 0.6F, 2), 2), Pair.of(new BehaviorRunIf<>(PiglinAI::g, new BehaviorLookWalk(0.6F, 3)), 2), Pair.of(new BehaviorNop(30, 60), 1))); + } + + private static BehaviorWalkAway c() { +@@ -94,10 +94,10 @@ public class PiglinAI { + + protected static void b(EntityPiglin entitypiglin) { + BehaviorController behaviorcontroller = entitypiglin.getBehaviorController(); +- Activity activity = (Activity) behaviorcontroller.f().orElse(null); // CraftBukkit - decompile error ++ Activity activity = behaviorcontroller.f().orElse(null); // CraftBukkit - decompile error + +- behaviorcontroller.a((List) ImmutableList.of(Activity.ADMIRE_ITEM, Activity.FLIGHT, Activity.AVOID, Activity.CELEBRATE, Activity.RIDE, Activity.IDLE)); +- Activity activity1 = (Activity) behaviorcontroller.f().orElse(null); // CraftBukkit - decompile error ++ behaviorcontroller.a(ImmutableList.of(Activity.ADMIRE_ITEM, Activity.FLIGHT, Activity.AVOID, Activity.CELEBRATE, Activity.RIDE, Activity.IDLE)); ++ Activity activity1 = behaviorcontroller.f().orElse(null); // CraftBukkit - decompile error + + if (activity != activity1) { + d(entitypiglin).ifPresent(entitypiglin::a); +@@ -231,7 +231,7 @@ public class PiglinAI { + Optional optional = entitypiglin.getBehaviorController().getMemory(MemoryModuleType.NEAREST_VISIBLE_PLAYER); + + if (optional.isPresent()) { +- a(entitypiglin, (EntityHuman) optional.get(), list); ++ a(entitypiglin, optional.get(), list); + } else { + b(entitypiglin, list); + } +@@ -254,7 +254,7 @@ public class PiglinAI { + while (iterator.hasNext()) { + ItemStack itemstack = (ItemStack) iterator.next(); + +- BehaviorUtil.a((EntityLiving) entitypiglin, itemstack, vec3d.add(0.0D, 1.0D, 0.0D)); ++ BehaviorUtil.a(entitypiglin, itemstack, vec3d.add(0.0D, 1.0D, 0.0D)); + } + } + +@@ -274,7 +274,7 @@ public class PiglinAI { + protected static boolean a(EntityPiglin entitypiglin, ItemStack itemstack) { + Item item = itemstack.getItem(); + +- if (item.a((Tag) TagsItem.PIGLIN_REPELLENTS)) { ++ if (item.a(TagsItem.PIGLIN_REPELLENTS)) { + return false; + } else if (D(entitypiglin) && entitypiglin.getBehaviorController().hasMemory(MemoryModuleType.ATTACK_TARGET)) { + return false; +@@ -288,7 +288,7 @@ public class PiglinAI { + } + + protected static boolean a(Item item) { +- return item.a((Tag) TagsItem.PIGLIN_LOVED); ++ return item.a(TagsItem.PIGLIN_LOVED); + } + + private static boolean a(EntityPiglin entitypiglin, Entity entity) { +@@ -297,7 +297,7 @@ public class PiglinAI { + } else { + EntityInsentient entityinsentient = (EntityInsentient) entity; + +- return !entityinsentient.isBaby() || !entityinsentient.isAlive() || h((EntityLiving) entitypiglin) || h((EntityLiving) entityinsentient) || entityinsentient instanceof EntityPiglin && entityinsentient.getVehicle() == null; ++ return !entityinsentient.isBaby() || !entityinsentient.isAlive() || h((EntityLiving) entitypiglin) || h(entityinsentient) || entityinsentient instanceof EntityPiglin && entityinsentient.getVehicle() == null; + } + } + +@@ -311,9 +311,9 @@ public class PiglinAI { + BehaviorController behaviorcontroller = entitypiglin.getBehaviorController(); + + if (behaviorcontroller.hasMemory(MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED)) { +- EntityLiving entityliving = (EntityLiving) behaviorcontroller.getMemory(MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED).get(); ++ EntityLiving entityliving = behaviorcontroller.getMemory(MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED).get(); + +- return entitypiglin.a((Entity) entityliving, 6.0D); ++ return entitypiglin.a(entityliving, 6.0D); + } else { + return false; + } +@@ -325,9 +325,9 @@ public class PiglinAI { + if (n(entitypiglin)) { + return Optional.empty(); + } else { +- Optional optional = BehaviorUtil.a((EntityLiving) entitypiglin, MemoryModuleType.ANGRY_AT); ++ Optional optional = BehaviorUtil.a(entitypiglin, MemoryModuleType.ANGRY_AT); + +- if (optional.isPresent() && e((EntityLiving) optional.get())) { ++ if (optional.isPresent() && e(optional.get())) { + return optional; + } else { + Optional optional1; +@@ -345,7 +345,7 @@ public class PiglinAI { + } else { + Optional optional2 = behaviorcontroller.getMemory(MemoryModuleType.NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD); + +- return optional2.isPresent() && e((EntityLiving) optional2.get()) ? optional2 : Optional.empty(); ++ return optional2.isPresent() && e(optional2.get()) ? optional2 : Optional.empty(); + } + } + } +@@ -453,7 +453,7 @@ public class PiglinAI { + private static boolean p(EntityPiglin entitypiglin) { + BehaviorController behaviorcontroller = entitypiglin.getBehaviorController(); + +- return !behaviorcontroller.hasMemory(MemoryModuleType.AVOID_TARGET) ? false : ((EntityLiving) behaviorcontroller.getMemory(MemoryModuleType.AVOID_TARGET).get()).a((Entity) entitypiglin, 12.0D); ++ return !behaviorcontroller.hasMemory(MemoryModuleType.AVOID_TARGET) ? false : behaviorcontroller.getMemory(MemoryModuleType.AVOID_TARGET).get().a(entitypiglin, 12.0D); + } + + protected static boolean e(EntityPiglin entitypiglin) { +@@ -467,11 +467,11 @@ public class PiglinAI { + } + + private static List q(EntityPiglin entitypiglin) { +- return (List) entitypiglin.getBehaviorController().getMemory(MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLINS).orElse(ImmutableList.of()); ++ return entitypiglin.getBehaviorController().getMemory(MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLINS).orElse(ImmutableList.of()); + } + + private static List r(EntityPiglin entitypiglin) { +- return (List) entitypiglin.getBehaviorController().getMemory(MemoryModuleType.NEAREST_ADULT_PIGLINS).orElse(ImmutableList.of()); ++ return entitypiglin.getBehaviorController().getMemory(MemoryModuleType.NEAREST_ADULT_PIGLINS).orElse(ImmutableList.of()); + } + + public static boolean a(EntityLiving entityliving) { +@@ -543,7 +543,7 @@ public class PiglinAI { + Optional optional = i(entitypiglin); + + if (optional.isPresent()) { +- c(entitypiglin, (EntityLiving) optional.get()); ++ c(entitypiglin, optional.get()); + } else { + c(entitypiglin, entityliving); + } +@@ -552,7 +552,7 @@ public class PiglinAI { + + private static void g(EntityPiglin entitypiglin, EntityLiving entityliving) { + Optional optional = t(entitypiglin); +- EntityLiving entityliving1 = BehaviorUtil.a((EntityLiving) entitypiglin, optional, entityliving); ++ EntityLiving entityliving1 = BehaviorUtil.a(entitypiglin, optional, entityliving); + + if (!optional.isPresent() || optional.get() != entityliving1) { + c(entitypiglin, entityliving1); +@@ -560,7 +560,7 @@ public class PiglinAI { + } + + private static Optional t(EntityPiglin entitypiglin) { +- return BehaviorUtil.a((EntityLiving) entitypiglin, MemoryModuleType.ANGRY_AT); ++ return BehaviorUtil.a(entitypiglin, MemoryModuleType.ANGRY_AT); + } + + public static Optional h(EntityPiglin entitypiglin) { +@@ -579,9 +579,9 @@ public class PiglinAI { + + private static void i(EntityPiglin entitypiglin, EntityLiving entityliving) { + BehaviorController behaviorcontroller = entitypiglin.getBehaviorController(); +- EntityLiving entityliving1 = BehaviorUtil.a((EntityLiving) entitypiglin, behaviorcontroller.getMemory(MemoryModuleType.AVOID_TARGET), entityliving); ++ EntityLiving entityliving1 = BehaviorUtil.a(entitypiglin, behaviorcontroller.getMemory(MemoryModuleType.AVOID_TARGET), entityliving); + +- entityliving1 = BehaviorUtil.a((EntityLiving) entitypiglin, behaviorcontroller.getMemory(MemoryModuleType.ATTACK_TARGET), entityliving1); ++ entityliving1 = BehaviorUtil.a(entitypiglin, behaviorcontroller.getMemory(MemoryModuleType.ATTACK_TARGET), entityliving1); + j(entitypiglin, entityliving1); + } + +@@ -591,7 +591,7 @@ public class PiglinAI { + if (!behaviorcontroller.hasMemory(MemoryModuleType.AVOID_TARGET)) { + return true; + } else { +- EntityLiving entityliving = (EntityLiving) behaviorcontroller.getMemory(MemoryModuleType.AVOID_TARGET).get(); ++ EntityLiving entityliving = behaviorcontroller.getMemory(MemoryModuleType.AVOID_TARGET).get(); + EntityTypes entitytypes = entityliving.getEntityType(); + + return entitytypes == EntityTypes.HOGLIN ? v(entitypiglin) : (a(entitytypes) ? !behaviorcontroller.b(MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED, entityliving) : false); // CraftBukkit - decompile error +@@ -603,8 +603,8 @@ public class PiglinAI { + } + + private static boolean w(EntityPiglin entitypiglin) { +- int i = (Integer) entitypiglin.getBehaviorController().getMemory(MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT).orElse(0) + 1; +- int j = (Integer) entitypiglin.getBehaviorController().getMemory(MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT).orElse(0); ++ int i = entitypiglin.getBehaviorController().getMemory(MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT).orElse(0) + 1; ++ int j = entitypiglin.getBehaviorController().getMemory(MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT).orElse(0); + + return j > i; + } +@@ -613,12 +613,12 @@ public class PiglinAI { + entitypiglin.getBehaviorController().removeMemory(MemoryModuleType.ANGRY_AT); + entitypiglin.getBehaviorController().removeMemory(MemoryModuleType.ATTACK_TARGET); + entitypiglin.getBehaviorController().removeMemory(MemoryModuleType.WALK_TARGET); +- entitypiglin.getBehaviorController().a(MemoryModuleType.AVOID_TARGET, entityliving, (long) PiglinAI.e.a(entitypiglin.world.random)); ++ entitypiglin.getBehaviorController().a(MemoryModuleType.AVOID_TARGET, entityliving, PiglinAI.e.a(entitypiglin.world.random)); + j(entitypiglin); + } + + protected static void j(EntityPiglin entitypiglin) { +- entitypiglin.getBehaviorController().a(MemoryModuleType.HUNTED_RECENTLY, true, (long) PiglinAI.b.a(entitypiglin.world.random)); ++ entitypiglin.getBehaviorController().a(MemoryModuleType.HUNTED_RECENTLY, true, PiglinAI.b.a(entitypiglin.world.random)); + } + + private static void y(EntityPiglin entitypiglin) { +diff --git a/src/main/java/net/minecraft/server/PistonExtendsChecker.java b/src/main/java/net/minecraft/server/PistonExtendsChecker.java +index 194a0a7bf3d48909ffe9322f0ad6b4e84cddd956..7360a3f5403646cd194b28467798fd98e8d6f269 100644 +--- a/src/main/java/net/minecraft/server/PistonExtendsChecker.java ++++ b/src/main/java/net/minecraft/server/PistonExtendsChecker.java +@@ -46,7 +46,7 @@ public class PistonExtendsChecker { + return false; + } else { + for (int i = 0; i < this.f.size(); ++i) { +- BlockPosition blockposition = (BlockPosition) this.f.get(i); ++ BlockPosition blockposition = this.f.get(i); + + if (a(this.a.getType(blockposition).getBlock()) && !this.a(blockposition)) { + return false; +@@ -118,7 +118,7 @@ public class PistonExtendsChecker { + this.a(j, l); + + for (int i1 = 0; i1 <= l + j; ++i1) { +- BlockPosition blockposition3 = (BlockPosition) this.f.get(i1); ++ BlockPosition blockposition3 = this.f.get(i1); + + if (a(this.a.getType(blockposition3).getBlock()) && !this.a(blockposition3)) { + return false; +diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java +index b0997aa1b6d03f98042a8293eb7be702ba559f4a..42fa96dc1a9d10c21dcad26dc9b03bf12812cfd8 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/PlayerChunk.java +@@ -252,7 +252,7 @@ public class PlayerChunk { + public Chunk getFullChunk() { + if (!getChunkState(this.oldTicketLevel).isAtLeast(PlayerChunk.State.BORDER)) return null; // note: using oldTicketLevel for isLoaded checks + CompletableFuture> statusFuture = this.getStatusFutureUnchecked(ChunkStatus.FULL); +- Either either = (Either) statusFuture.getNow(null); ++ Either either = statusFuture.getNow(null); + return either == null ? null : (Chunk) either.left().orElse(null); + } + // CraftBukkit end +@@ -260,7 +260,7 @@ public class PlayerChunk { + public Chunk getFullChunkIfCached() { + // Note: Copied from above without ticket level check + CompletableFuture> statusFuture = this.getStatusFutureUnchecked(ChunkStatus.FULL); +- Either either = (Either) statusFuture.getNow(null); ++ Either either = statusFuture.getNow(null); + return either == null ? null : (Chunk) either.left().orElse(null); + } + +@@ -303,7 +303,7 @@ public class PlayerChunk { + // Paper end + + public CompletableFuture> getStatusFutureUnchecked(ChunkStatus chunkstatus) { +- CompletableFuture> completablefuture = (CompletableFuture) this.statusFutures.get(chunkstatus.c()); ++ CompletableFuture> completablefuture = this.statusFutures.get(chunkstatus.c()); + + return completablefuture == null ? PlayerChunk.UNLOADED_CHUNK_ACCESS_FUTURE : completablefuture; + } +@@ -330,22 +330,22 @@ public class PlayerChunk { + @Nullable + public Chunk getChunk() { + CompletableFuture> completablefuture = this.a(); +- Either either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error ++ Either either = completablefuture.getNow(null); // CraftBukkit - decompile error + +- return either == null ? null : (Chunk) either.left().orElse(null); // CraftBukkit - decompile error ++ return either == null ? null : either.left().orElse(null); // CraftBukkit - decompile error + } + + @Nullable + public IChunkAccess f() { + for (int i = PlayerChunk.CHUNK_STATUSES.size() - 1; i >= 0; --i) { +- ChunkStatus chunkstatus = (ChunkStatus) PlayerChunk.CHUNK_STATUSES.get(i); ++ ChunkStatus chunkstatus = PlayerChunk.CHUNK_STATUSES.get(i); + CompletableFuture> completablefuture = this.getStatusFutureUnchecked(chunkstatus); + + if (!completablefuture.isCompletedExceptionally()) { + Optional optional = ((Either) completablefuture.getNow(PlayerChunk.UNLOADED_CHUNK_ACCESS)).left(); + + if (optional.isPresent()) { +- return (IChunkAccess) optional.get(); ++ return optional.get(); + } + } + } +@@ -499,10 +499,10 @@ public class PlayerChunk { + public final CompletableFuture> getOrCreateFuture(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) { return this.a(chunkstatus, playerchunkmap); } // Tuinity - OBFHELPER + public CompletableFuture> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) { + int i = chunkstatus.c(); +- CompletableFuture> completablefuture = (CompletableFuture) this.statusFutures.get(i); ++ CompletableFuture> completablefuture = this.statusFutures.get(i); + + if (completablefuture != null) { +- Either either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error ++ Either either = completablefuture.getNow(null); // CraftBukkit - decompile error + + if (either == null || either.left().isPresent()) { + return completablefuture; +@@ -600,7 +600,7 @@ public class PlayerChunk { + // Paper end + + for (int i = flag1 ? chunkstatus1.c() + 1 : 0; i <= chunkstatus.c(); ++i) { +- completablefuture = (CompletableFuture) this.statusFutures.get(i); ++ completablefuture = this.statusFutures.get(i); + if (completablefuture != null) { + completablefuture.complete(either); + } else { +@@ -688,7 +688,7 @@ public class PlayerChunk { + + if (!flag6 && flag7) { + if (this.entityTickingFuture != PlayerChunk.UNLOADED_CHUNK_FUTURE) { +- throw (IllegalStateException) SystemUtils.c(new IllegalStateException()); ++ throw SystemUtils.c(new IllegalStateException()); + } + + // Paper start - cache ticking ready status +@@ -820,7 +820,7 @@ public class PlayerChunk { + + public void a(ProtoChunkExtension protochunkextension) { + for (int i = 0; i < this.statusFutures.length(); ++i) { +- CompletableFuture> completablefuture = (CompletableFuture) this.statusFutures.get(i); ++ CompletableFuture> completablefuture = this.statusFutures.get(i); + + if (completablefuture != null) { + Optional optional = ((Either) completablefuture.getNow(PlayerChunk.UNLOADED_CHUNK_ACCESS)).left(); +diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java +index af489b49985c90178d5231ea46869152e89614e2..cb9f344b45cada2e327fd0feec66e7d527f35403 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +@@ -577,8 +577,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + + private static double getDistanceSquaredFromChunk(ChunkCoordIntPair chunkPos, Entity entity) { return a(chunkPos, entity); } // Paper - OBFHELPER + private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) { +- double d0 = (double) (chunkcoordintpair.x * 16 + 8); +- double d1 = (double) (chunkcoordintpair.z * 16 + 8); ++ double d0 = chunkcoordintpair.x * 16 + 8; ++ double d1 = chunkcoordintpair.z * 16 + 8; + double d2 = d0 - entity.locX(); + double d3 = d1 - entity.locZ(); + +@@ -615,7 +615,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + + @Nullable + public PlayerChunk getUpdatingChunk(long i) { // Paper +- return (PlayerChunk) this.updatingChunks.get(i); ++ return this.updatingChunks.get(i); + } + + // Paper start - remove cloning of visible chunks unless accessed as a collection async +@@ -659,10 +659,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + // Paper start - mt safe get + if (Thread.currentThread() != this.world.serverThread) { + synchronized (this.visibleChunks) { +- return (PlayerChunk) (this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap)this.visibleChunks).safeGet(i)); ++ return this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap)this.visibleChunks).safeGet(i); + } + } +- return (PlayerChunk) (this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap)this.visibleChunks).safeGet(i)); ++ return this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap)this.visibleChunks).safeGet(i); + // Paper end + } + +@@ -704,7 +704,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + })); + } + +- ChunkStatus chunkstatus = (ChunkStatus) intfunction.apply(j1); ++ ChunkStatus chunkstatus = intfunction.apply(j1); + CompletableFuture> completablefuture = playerchunk.a(chunkstatus, this); + // Paper start + if (requestingNeighbor != null && requestingNeighbor != playerchunk && !completablefuture.isDone()) { +@@ -735,7 +735,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + if (!optional.isPresent()) { + return Either.right(new PlayerChunk.Failure() { + public String toString() { +- return "Unloaded " + new ChunkCoordIntPair(j + l1 % (i * 2 + 1), k + l1 / (i * 2 + 1)) + " " + ((PlayerChunk.Failure) either.right().get()).toString(); ++ return "Unloaded " + new ChunkCoordIntPair(j + l1 % (i * 2 + 1), k + l1 / (i * 2 + 1)) + " " + either.right().get().toString(); + } + }); + } +@@ -777,7 +777,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } + + if (j <= PlayerChunkMap.GOLDEN_TICKET && playerchunk == null) { +- playerchunk = (PlayerChunk) this.pendingUnload.remove(i); ++ playerchunk = this.pendingUnload.remove(i); + if (playerchunk != null) { + playerchunk.a(j); + } else { +@@ -874,7 +874,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + result.add(playerChunk); + } + } +- List list = (List) result; // Paper - remove cloning of visible chunks ++ List list = result; // Paper - remove cloning of visible chunks + MutableBoolean mutableboolean = new MutableBoolean(); + + do { +@@ -947,7 +947,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + while (longiterator.hasNext()) { // Spigot + long j = longiterator.nextLong(); + longiterator.remove(); // Spigot +- PlayerChunk playerchunk = (PlayerChunk) this.updatingChunks.remove(j); ++ PlayerChunk playerchunk = this.updatingChunks.remove(j); + + if (playerchunk != null) { + this.pendingUnload.put(j, playerchunk); +@@ -966,7 +966,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + Runnable runnable; + + int queueTarget = Math.min(this.getUnloadQueueTasks().size() - 100, (int) (this.getUnloadQueueTasks().size() * UNLOAD_QUEUE_RESIZE_FACTOR)); // Paper - Target this queue as well +- while ((booleansupplier.getAsBoolean() || this.getUnloadQueueTasks().size() > queueTarget) && (runnable = (Runnable)this.getUnloadQueueTasks().poll()) != null) { // Paper - Target this queue as well ++ while ((booleansupplier.getAsBoolean() || this.getUnloadQueueTasks().size() > queueTarget) && (runnable = this.getUnloadQueueTasks().poll()) != null) { // Paper - Target this queue as well + runnable.run(); + } + +@@ -1065,7 +1065,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + + this.lightEngine.a(ichunkaccess.getPos()); + this.lightEngine.queueUpdate(); +- this.worldLoadListener.a(ichunkaccess.getPos(), (ChunkStatus) null); ++ this.worldLoadListener.a(ichunkaccess.getPos(), null); + this.dataRegionManager.removeChunk(playerchunk.location.x, playerchunk.location.z); // Tuinity + } + +@@ -1124,7 +1124,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + this.chunkDistanceManager.a(TicketType.LIGHT, chunkcoordintpair, 33 + ChunkStatus.a(ChunkStatus.FEATURES), chunkcoordintpair); + } + +- IChunkAccess ichunkaccess = (IChunkAccess) optional.get(); ++ IChunkAccess ichunkaccess = optional.get(); + + if (ichunkaccess.getChunkStatus().b(chunkstatus)) { + CompletableFuture> completablefuture1; // Paper +@@ -1256,9 +1256,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + CrashReport crashreport = CrashReport.a(exception, "Exception generating new chunk"); + CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Chunk to be generated"); + +- crashreportsystemdetails.a("Location", (Object) String.format("%d,%d", chunkcoordintpair.x, chunkcoordintpair.z)); +- crashreportsystemdetails.a("Position hash", (Object) ChunkCoordIntPair.pair(chunkcoordintpair.x, chunkcoordintpair.z)); +- crashreportsystemdetails.a("Generator", (Object) this.chunkGenerator); ++ crashreportsystemdetails.a("Location", String.format("%d,%d", chunkcoordintpair.x, chunkcoordintpair.z)); ++ crashreportsystemdetails.a("Position hash", ChunkCoordIntPair.pair(chunkcoordintpair.x, chunkcoordintpair.z)); ++ crashreportsystemdetails.a("Generator", this.chunkGenerator); + throw new ReportedException(crashreport); + } + }, (playerchunk_failure) -> { +@@ -1346,7 +1346,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + checkDupeUUID(entity); // Paper + if (!(entity instanceof EntityHuman) && (entity.dead || !this.world.addEntityChunk(entity))) { // Paper + if (list == null) { +- list = Lists.newArrayList(new Entity[]{entity}); ++ list = Lists.newArrayList(entity); + } else { + list.add(entity); + } +@@ -1615,7 +1615,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + while (objectbidirectionaliterator.hasNext()) { + Entry entry = (Entry) objectbidirectionaliterator.next(); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(entry.getLongKey()); +- PlayerChunk playerchunk = (PlayerChunk) entry.getValue(); ++ PlayerChunk playerchunk = entry.getValue(); + Optional optional = Optional.ofNullable(playerchunk.f()); + Optional optional1 = optional.flatMap((ichunkaccess) -> { + return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty(); +@@ -1638,9 +1638,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + + private static String a(CompletableFuture> completablefuture) { + try { +- Either either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error ++ Either either = completablefuture.getNow(null); // CraftBukkit - decompile error + +- return either != null ? (String) either.map((chunk) -> { ++ return either != null ? either.map((chunk) -> { + return "done"; + }, (playerchunk_failure) -> { + return "unloaded"; +@@ -1860,7 +1860,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + this.playerMap.a(ChunkCoordIntPair.pair(i, j), entityplayer, flag1); + this.c(entityplayer); + if (!flag1) { +- this.chunkDistanceManager.a(SectionPosition.a((Entity) entityplayer), entityplayer); ++ this.chunkDistanceManager.a(SectionPosition.a(entityplayer), entityplayer); + } + this.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps + } else { +@@ -1878,7 +1878,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } + + private SectionPosition c(EntityPlayer entityplayer) { +- SectionPosition sectionposition = SectionPosition.a((Entity) entityplayer); ++ SectionPosition sectionposition = SectionPosition.a(entityplayer); + + entityplayer.a(sectionposition); + // Paper - distance map handles this now +@@ -1891,7 +1891,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + int i = MathHelper.floor(entityplayer.locX()) >> 4; + int j = MathHelper.floor(entityplayer.locZ()) >> 4; + SectionPosition sectionposition = entityplayer.N(); +- SectionPosition sectionposition1 = SectionPosition.a((Entity) entityplayer); ++ SectionPosition sectionposition1 = SectionPosition.a(entityplayer); + long k = sectionposition.r().pair(); + long l = sectionposition1.r().pair(); + boolean flag = this.playerMap.d(entityplayer); +@@ -2032,7 +2032,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + int j = entitytypes.getUpdateInterval(); + + if (this.trackedEntities.containsKey(entity.getId())) { +- throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Entity is already tracked!")); ++ throw SystemUtils.c(new IllegalStateException("Entity is already tracked!")); + } else { + PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = new PlayerChunkMap.EntityTracker(entity, i, j, entitytypes.isDeltaTracking()); + +@@ -2073,7 +2073,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } + } + +- PlayerChunkMap.EntityTracker playerchunkmap_entitytracker1 = (PlayerChunkMap.EntityTracker) this.trackedEntities.remove(entity.getId()); ++ PlayerChunkMap.EntityTracker playerchunkmap_entitytracker1 = this.trackedEntities.remove(entity.getId()); + + if (playerchunkmap_entitytracker1 != null) { + playerchunkmap_entitytracker1.a(); +@@ -2149,7 +2149,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } + + protected void broadcast(Entity entity, Packet packet) { +- PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = (PlayerChunkMap.EntityTracker) this.trackedEntities.get(entity.getId()); ++ PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = this.trackedEntities.get(entity.getId()); + + if (playerchunkmap_entitytracker != null) { + playerchunkmap_entitytracker.broadcast(packet); +@@ -2158,7 +2158,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } + + protected void broadcastIncludingSelf(Entity entity, Packet packet) { +- PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = (PlayerChunkMap.EntityTracker) this.trackedEntities.get(entity.getId()); ++ PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = this.trackedEntities.get(entity.getId()); + + if (playerchunkmap_entitytracker != null) { + playerchunkmap_entitytracker.broadcastIncludingSelf(packet); +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index ad56cb830d81c5d02bd338c004a788891becb095..ef84290df36a9d8dc6e31232d523ff03338a6ed0 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -118,7 +118,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + private boolean hasMoved; // Spigot + + public CraftPlayer getPlayer() { +- return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity(); ++ return (this.player == null) ? null : this.player.getBukkitEntity(); + } + // CraftBukkit end + +@@ -371,7 +371,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + // Paper end + +- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isExemptPlayer()) { ++ if (d10 - d9 > Math.max(100.0D, Math.pow(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed, 2)) && !this.isExemptPlayer()) { + // CraftBukkit end + PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8); + this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity)); +@@ -590,7 +590,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getPlayer(), suggestions, buffer); + suggestEvent.setCancelled(suggestions.isEmpty()); + if (!suggestEvent.callEvent()) return; +- this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), (com.mojang.brigadier.suggestion.Suggestions) suggestEvent.getSuggestions())); // CraftBukkit - decompile error // Paper ++ this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestEvent.getSuggestions())); // CraftBukkit - decompile error // Paper + // Paper end + }); + }); +@@ -634,22 +634,22 @@ public class PlayerConnection implements PacketListenerPlayIn { + + if (commandblocklistenerabstract != null) { + TileEntityCommand.Type tileentitycommand_type = tileentitycommand.m(); +- EnumDirection enumdirection = (EnumDirection) this.player.world.getType(blockposition).get(BlockCommand.a); ++ EnumDirection enumdirection = this.player.world.getType(blockposition).get(BlockCommand.a); + IBlockData iblockdata; + + switch (packetplayinsetcommandblock.g()) { + case SEQUENCE: + iblockdata = Blocks.CHAIN_COMMAND_BLOCK.getBlockData(); +- this.player.world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) iblockdata.set(BlockCommand.a, enumdirection)).set(BlockCommand.b, packetplayinsetcommandblock.e()), 2); ++ this.player.world.setTypeAndData(blockposition, iblockdata.set(BlockCommand.a, enumdirection).set(BlockCommand.b, packetplayinsetcommandblock.e()), 2); + break; + case AUTO: + iblockdata = Blocks.REPEATING_COMMAND_BLOCK.getBlockData(); +- this.player.world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) iblockdata.set(BlockCommand.a, enumdirection)).set(BlockCommand.b, packetplayinsetcommandblock.e()), 2); ++ this.player.world.setTypeAndData(blockposition, iblockdata.set(BlockCommand.a, enumdirection).set(BlockCommand.b, packetplayinsetcommandblock.e()), 2); + break; + case REDSTONE: + default: + iblockdata = Blocks.COMMAND_BLOCK.getBlockData(); +- this.player.world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) iblockdata.set(BlockCommand.a, enumdirection)).set(BlockCommand.b, packetplayinsetcommandblock.e()), 2); ++ this.player.world.setTypeAndData(blockposition, iblockdata.set(BlockCommand.a, enumdirection).set(BlockCommand.b, packetplayinsetcommandblock.e()), 2); + } + + tileentity.r(); +@@ -667,7 +667,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + + commandblocklistenerabstract.e(); + if (!UtilColor.b(s)) { +- this.player.sendMessage(new ChatMessage("advMode.setCommand.success", new Object[]{s}), SystemUtils.b); ++ this.player.sendMessage(new ChatMessage("advMode.setCommand.success", s), SystemUtils.b); + } + } + +@@ -692,7 +692,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + + commandblocklistenerabstract.e(); +- this.player.sendMessage(new ChatMessage("advMode.setCommand.success", new Object[]{packetplayinsetcommandminecart.b()}), SystemUtils.b); ++ this.player.sendMessage(new ChatMessage("advMode.setCommand.success", packetplayinsetcommandminecart.b()), SystemUtils.b); + } + + } +@@ -765,27 +765,27 @@ public class PlayerConnection implements PacketListenerPlayIn { + + if (packetplayinstruct.c() == TileEntityStructure.UpdateType.SAVE_AREA) { + if (tileentitystructure.D()) { +- this.player.a((IChatBaseComponent) (new ChatMessage("structure_block.save_success", new Object[]{s})), false); ++ this.player.a(new ChatMessage("structure_block.save_success", new Object[]{s}), false); + } else { +- this.player.a((IChatBaseComponent) (new ChatMessage("structure_block.save_failure", new Object[]{s})), false); ++ this.player.a(new ChatMessage("structure_block.save_failure", new Object[]{s}), false); + } + } else if (packetplayinstruct.c() == TileEntityStructure.UpdateType.LOAD_AREA) { + if (!tileentitystructure.G()) { +- this.player.a((IChatBaseComponent) (new ChatMessage("structure_block.load_not_found", new Object[]{s})), false); ++ this.player.a(new ChatMessage("structure_block.load_not_found", new Object[]{s}), false); + } else if (tileentitystructure.E()) { +- this.player.a((IChatBaseComponent) (new ChatMessage("structure_block.load_success", new Object[]{s})), false); ++ this.player.a(new ChatMessage("structure_block.load_success", new Object[]{s}), false); + } else { +- this.player.a((IChatBaseComponent) (new ChatMessage("structure_block.load_prepare", new Object[]{s})), false); ++ this.player.a(new ChatMessage("structure_block.load_prepare", new Object[]{s}), false); + } + } else if (packetplayinstruct.c() == TileEntityStructure.UpdateType.SCAN_AREA) { + if (tileentitystructure.C()) { +- this.player.a((IChatBaseComponent) (new ChatMessage("structure_block.size_success", new Object[]{s})), false); ++ this.player.a(new ChatMessage("structure_block.size_success", new Object[]{s}), false); + } else { +- this.player.a((IChatBaseComponent) (new ChatMessage("structure_block.size_failure")), false); ++ this.player.a(new ChatMessage("structure_block.size_failure"), false); + } + } + } else { +- this.player.a((IChatBaseComponent) (new ChatMessage("structure_block.invalid_structure_name", new Object[]{packetplayinstruct.e()})), false); ++ this.player.a(new ChatMessage("structure_block.invalid_structure_name", new Object[]{packetplayinstruct.e()}), false); + } + + tileentitystructure.update(); +@@ -912,24 +912,24 @@ public class PlayerConnection implements PacketListenerPlayIn { + itemstack2.setTag(nbttagcompound.clone()); + } + +- itemstack2.a("author", (NBTBase) NBTTagString.a(this.player.getDisplayName().getString())); +- itemstack2.a("title", (NBTBase) NBTTagString.a(itemstack.getTag().getString("title"))); ++ itemstack2.a("author", NBTTagString.a(this.player.getDisplayName().getString())); ++ itemstack2.a("title", NBTTagString.a(itemstack.getTag().getString("title"))); + NBTTagList nbttaglist = itemstack.getTag().getList("pages", 8); + + for (int i = 0; i < nbttaglist.size(); ++i) { + String s = nbttaglist.getString(i); + ChatComponentText chatcomponenttext = new ChatComponentText(s); + +- s = IChatBaseComponent.ChatSerializer.a((IChatBaseComponent) chatcomponenttext); +- nbttaglist.set(i, (NBTBase) NBTTagString.a(s)); ++ s = IChatBaseComponent.ChatSerializer.a(chatcomponenttext); ++ nbttaglist.set(i, NBTTagString.a(s)); + } + +- itemstack2.a("pages", (NBTBase) nbttaglist); ++ itemstack2.a("pages", nbttaglist); + this.player.a(packetplayinbedit.d(), CraftEventFactory.handleEditBookEvent(player, enumitemslot, itemstack1, itemstack2)); // CraftBukkit + } else { + // Paper start - dont mutate players current item, set it from the event + ItemStack newBook = itemstack1.cloneItemStack(); +- newBook.getOrCreateTagAndSet("pages", (NBTBase)itemstack.getTag().getList("pages", 8)); ++ newBook.getOrCreateTagAndSet("pages", itemstack.getTag().getList("pages", 8)); + this.player.setSlot(enumitemslot, CraftEventFactory.handleEditBookEvent(player, enumitemslot, itemstack1, newBook)); + // Paper end + } +@@ -1058,7 +1058,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + if (!this.player.H() && (!this.player.getWorldServer().getGameRules().getBoolean(GameRules.DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isGliding())) { + float f2 = this.player.isGliding() ? 300.0F : 100.0F; + +- if (d11 - d10 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isExemptPlayer()) { ++ if (d11 - d10 > Math.max(f2, Math.pow(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed, 2)) && !this.isExemptPlayer()) { + // CraftBukkit end + PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9); + this.a(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch); +@@ -1130,7 +1130,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + + this.player.setLocation(d4, d5, d6, f, f1); +- if (!this.player.noclip && !this.player.isSleeping() && (flag1 && worldserver.getCubes(this.player, axisalignedbb) || (didCollide && this.a((IWorldReader) worldserver, axisalignedbb)))) { // Tuinity - optimise out the extra getCubes-like call most of the time ++ if (!this.player.noclip && !this.player.isSleeping() && (flag1 && worldserver.getCubes(this.player, axisalignedbb) || (didCollide && this.a(worldserver, axisalignedbb)))) { // Tuinity - optimise out the extra getCubes-like call most of the time + this.a(d0, d1, d2, f, f1); + } else { + // CraftBukkit start - fire PlayerMoveEvent +@@ -1196,7 +1196,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + this.player.setLocation(d4, d5, d6, f, f1); // Copied from above + + // MC-135989, SPIGOT-5564: isRiptiding +- this.B = d12 >= -0.03125D && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR && !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isGliding() && this.a((Entity) this.player) && !this.player.isRiptiding(); ++ this.B = d12 >= -0.03125D && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR && !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isGliding() && this.a(this.player) && !this.player.isRiptiding(); + // CraftBukkit end + this.player.getWorldServer().getChunkProvider().movePlayer(this.player); + this.player.a(this.player.locY() - d3, packetplayinflying.b()); +@@ -1229,13 +1229,13 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + + public void a(double d0, double d1, double d2, float f, float f1) { +- this.a(d0, d1, d2, f, f1, Collections.emptySet()); ++ this.a(d0, d1, d2, f, f1, Collections.emptySet()); + } + + // CraftBukkit start - Delegate to teleport(Location) + public final void teleport(double d0, double d1, double d2, float f, float f1, PlayerTeleportEvent.TeleportCause cause) { this.a(d0, d1, d2, f, f1, cause); } // Paper - OBFHELPER + public void a(double d0, double d1, double d2, float f, float f1, PlayerTeleportEvent.TeleportCause cause) { +- this.a(d0, d1, d2, f, f1, Collections.emptySet(), cause); ++ this.a(d0, d1, d2, f, f1, Collections.emptySet(), cause); + } + + public void a(double d0, double d1, double d2, float f, float f1, Set set) { +@@ -1276,7 +1276,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + + public void teleport(Location dest) { +- internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.emptySet()); ++ internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.emptySet()); + } + + private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set) { +@@ -1453,7 +1453,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + + this.player.resetIdleTimer(); + if (blockposition.getY() < this.minecraftServer.getMaxBuildHeight()) { +- if (this.teleportPos == null && this.player.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) { ++ if (this.teleportPos == null && this.player.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a(this.player, blockposition)) { + // CraftBukkit start - Check if we can actually do something over this large a distance + // Paper - move check up + this.player.clearActiveItem(); // SPIGOT-4706 +@@ -1612,7 +1612,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + + public void sendPacket(Packet packet) { +- this.a(packet, (GenericFutureListener) null); ++ this.a(packet, null); + } + + public void a(Packet packet, @Nullable GenericFutureListener> genericfuturelistener) { +@@ -1748,7 +1748,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + this.chat(s, true); + // CraftBukkit end - the below is for reference. :) + } else { +- ChatMessage chatmessage = new ChatMessage("chat.type.text", new Object[]{this.player.getScoreboardDisplayName(), s}); ++ ChatMessage chatmessage = new ChatMessage("chat.type.text", this.player.getScoreboardDisplayName(), s); + + this.minecraftServer.getPlayerList().sendMessage(chatmessage, ChatMessageType.CHAT, this.player.getUniqueID()); + } +@@ -2040,7 +2040,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + break; + case OPEN_INVENTORY: + if (this.player.getVehicle() instanceof EntityHorseAbstract) { +- ((EntityHorseAbstract) this.player.getVehicle()).f((EntityHuman) this.player); ++ ((EntityHorseAbstract) this.player.getVehicle()).f(this.player); + } + break; + case START_FALL_FLYING: +@@ -2059,7 +2059,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer()); + if (this.player.isFrozen()) return; // CraftBukkit + WorldServer worldserver = this.player.getWorldServer(); +- Entity entity = packetplayinuseentity.a((World) worldserver); ++ Entity entity = packetplayinuseentity.a(worldserver); + // Spigot Start + if ( entity == player && !player.isSpectator() ) + { +@@ -2086,10 +2086,10 @@ public class PlayerConnection implements PacketListenerPlayIn { + Item origItem = this.player.inventory.getItemInHand() == null ? null : this.player.inventory.getItemInHand().getItem(); + PlayerInteractEntityEvent event; + if (packetplayinuseentity.b() == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT) { +- event = new PlayerInteractEntityEvent((Player) this.getPlayer(), entity.getBukkitEntity(), (packetplayinuseentity.c() == EnumHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND); ++ event = new PlayerInteractEntityEvent(this.getPlayer(), entity.getBukkitEntity(), (packetplayinuseentity.c() == EnumHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND); + } else { + Vec3D target = packetplayinuseentity.d(); +- event = new PlayerInteractAtEntityEvent((Player) this.getPlayer(), entity.getBukkitEntity(), new org.bukkit.util.Vector(target.x, target.y, target.z), (packetplayinuseentity.c() == EnumHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND); ++ event = new PlayerInteractAtEntityEvent(this.getPlayer(), entity.getBukkitEntity(), new org.bukkit.util.Vector(target.x, target.y, target.z), (packetplayinuseentity.c() == EnumHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND); + } + this.server.getPluginManager().callEvent(event); + +@@ -2131,7 +2131,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + // CraftBukkit end + } else if (packetplayinuseentity.b() == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT_AT) { +- optional = Optional.of(entity.a((EntityHuman) this.player, packetplayinuseentity.d(), enumhand)); ++ optional = Optional.of(entity.a(this.player, packetplayinuseentity.d(), enumhand)); + // CraftBukkit start + if (!itemInHand.isEmpty() && itemInHand.getCount() <= -1) { + this.player.updateInventory(this.player.activeContainer); +@@ -2153,9 +2153,9 @@ public class PlayerConnection implements PacketListenerPlayIn { + // CraftBukkit end + } + +- if (optional.isPresent() && ((EnumInteractionResult) optional.get()).a()) { ++ if (optional.isPresent() && optional.get().a()) { + CriterionTriggers.P.a(this.player, this.player.b(enumhand), entity); +- if (((EnumInteractionResult) optional.get()).b()) { ++ if (optional.get().b()) { + this.player.swingHand(enumhand, true); + } + } +@@ -2194,7 +2194,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, false); + if (this.minecraftServer.isHardcore()) { + this.player.a(EnumGamemode.SPECTATOR); +- ((GameRules.GameRuleBoolean) this.player.getWorldServer().getGameRules().get(GameRules.SPECTATORS_GENERATE_CHUNKS)).a(false, this.minecraftServer); ++ this.player.getWorldServer().getGameRules().get(GameRules.SPECTATORS_GENERATE_CHUNKS).a(false, this.minecraftServer); + } + } + break; +@@ -2225,7 +2225,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + NonNullList nonnulllist = NonNullList.a(); + + for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) { +- nonnulllist.add(((Slot) this.player.activeContainer.slots.get(i)).getItem()); ++ nonnulllist.add(this.player.activeContainer.slots.get(i).getItem()); + } + + this.player.a(this.player.activeContainer, nonnulllist); +@@ -2511,7 +2511,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + NonNullList nonnulllist1 = NonNullList.a(); + + for (int j = 0; j < this.player.activeContainer.slots.size(); ++j) { +- ItemStack itemstack1 = ((Slot) this.player.activeContainer.slots.get(j)).getItem(); ++ ItemStack itemstack1 = this.player.activeContainer.slots.get(j).getItem(); + + nonnulllist1.add(itemstack1.isEmpty() ? ItemStack.b : itemstack1); + } +@@ -2546,7 +2546,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + if (this.player.isFrozen()) return; // CraftBukkit + this.player.resetIdleTimer(); + if (this.player.activeContainer.windowId == packetplayinenchantitem.b() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { +- this.player.activeContainer.a((EntityHuman) this.player, packetplayinenchantitem.c()); ++ this.player.activeContainer.a(this.player, packetplayinenchantitem.c()); + this.player.activeContainer.c(); + } + +@@ -2570,7 +2570,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + nbttagcompound1.remove("x"); + nbttagcompound1.remove("y"); + nbttagcompound1.remove("z"); +- itemstack.a("BlockEntityTag", (NBTBase) nbttagcompound1); ++ itemstack.a("BlockEntityTag", nbttagcompound1); + } + } + +@@ -2688,7 +2688,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + // Paper end + lines[i] = SharedConstants.a(astring[i]); //Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created. + } +- SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines); ++ SignChangeEvent event = new SignChangeEvent(player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines); + this.server.getPluginManager().callEvent(event); + + if (!event.isCancelled()) { +@@ -2767,7 +2767,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + getPlayer().addChannel(channel); + } + } catch (Exception ex) { +- PlayerConnection.LOGGER.error("Couldn\'t register custom payload", ex); ++ PlayerConnection.LOGGER.error("Couldn't register custom payload", ex); + this.disconnect("Invalid payload REGISTER!"); + } + } else if (packetplayincustompayload.tag.equals(CUSTOM_UNREGISTER)) { +@@ -2777,7 +2777,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + getPlayer().removeChannel(channel); + } + } catch (Exception ex) { +- PlayerConnection.LOGGER.error("Couldn\'t unregister custom payload", ex); ++ PlayerConnection.LOGGER.error("Couldn't unregister custom payload", ex); + this.disconnect("Invalid payload UNREGISTER!"); + } + } else { +@@ -2786,7 +2786,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + packetplayincustompayload.data.readBytes(data); + server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packetplayincustompayload.tag.toString(), data); + } catch (Exception ex) { +- PlayerConnection.LOGGER.error("Couldn\'t dispatch custom payload", ex); ++ PlayerConnection.LOGGER.error("Couldn't dispatch custom payload", ex); + this.disconnect("Invalid custom payload!"); + } + } +diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java +index a0658cda96d3a2796fb940cd947aa708aaae24b7..9c059b656365041a70d7ed4a96c7061bc67329b5 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java ++++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java +@@ -10,7 +10,7 @@ public class PlayerConnectionUtils { + private static final Logger LOGGER = LogManager.getLogger(); + + public static void ensureMainThread(Packet packet, T t0, WorldServer worldserver) throws CancelledPacketHandleException { +- ensureMainThread(packet, t0, (IAsyncTaskHandler) worldserver.getMinecraftServer()); ++ ensureMainThread(packet, t0, worldserver.getMinecraftServer()); + } + + // Tuinity start - detailed watchdog information +diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java +index 52b465ae49c602d8b52878c12d1aab37c003259a..55151b03048f0f2a2f78a204b2be48a8959eafc1 100644 +--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java ++++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java +@@ -62,7 +62,7 @@ public class PlayerInteractManager { + this.gamemode = enumgamemode; + enumgamemode.a(this.player.abilities); + this.player.updateAbilities(); +- this.player.server.getPlayerList().sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_GAME_MODE, new EntityPlayer[]{this.player}), this.player); // CraftBukkit ++ this.player.server.getPlayerList().sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit + this.world.everyoneSleeping(); + } + +@@ -158,7 +158,7 @@ public class PlayerInteractManager { + IBlockData iblockdata; + + if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) { +- if (!this.world.a((EntityHuman) this.player, blockposition)) { ++ if (!this.world.a(this.player, blockposition)) { + // CraftBukkit start - fire PlayerInteractEvent + CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, blockposition, enumdirection, this.player.inventory.getItemInHand(), EnumHand.MAIN_HAND); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, false, "may not interact")); +@@ -195,7 +195,7 @@ public class PlayerInteractManager { + return; + } + +- if (this.player.a((World) this.world, blockposition, this.gamemode)) { ++ if (this.player.a(this.world, blockposition, this.gamemode)) { + this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, false, "block action restricted")); + return; + } +@@ -329,7 +329,7 @@ public class PlayerInteractManager { + + if (this.player instanceof EntityPlayer) { + // Sword + Creative mode pre-cancel +- boolean isSwordNoBreak = !this.player.getItemInMainHand().getItem().a(iblockdata, this.world, blockposition, (EntityHuman) this.player); ++ boolean isSwordNoBreak = !this.player.getItemInMainHand().getItem().a(iblockdata, this.world, blockposition, this.player); + + // Tell client the block is gone immediately then process events + // Don't tell the client if its a creative sword break because its not broken! +@@ -378,7 +378,7 @@ public class PlayerInteractManager { + } + // CraftBukkit end + +- if (false && !this.player.getItemInMainHand().getItem().a(iblockdata, (World) this.world, blockposition, (EntityHuman) this.player)) { // CraftBukkit - false ++ if (false && !this.player.getItemInMainHand().getItem().a(iblockdata, this.world, blockposition, this.player)) { // CraftBukkit - false + return false; + } else { + iblockdata = this.world.getType(blockposition); // CraftBukkit - update state from plugins +@@ -389,14 +389,14 @@ public class PlayerInteractManager { + if ((block instanceof BlockCommand || block instanceof BlockStructure || block instanceof BlockJigsaw) && !this.player.isCreativeAndOp() && !(block instanceof BlockCommand && (this.player.isCreative() && this.player.getBukkitEntity().hasPermission("minecraft.commandblock")))) { // Paper - command block permission + this.world.notify(blockposition, iblockdata, iblockdata, 3); + return false; +- } else if (this.player.a((World) this.world, blockposition, this.gamemode)) { ++ } else if (this.player.a(this.world, blockposition, this.gamemode)) { + return false; + } else { + // CraftBukkit start + org.bukkit.block.BlockState state = bblock.getState(); + world.captureDrops = new ArrayList<>(); + // CraftBukkit end +- block.a((World) this.world, blockposition, iblockdata, (EntityHuman) this.player); ++ block.a(this.world, blockposition, iblockdata, this.player); + boolean flag = this.world.a(blockposition, false); + + if (flag) { +@@ -442,8 +442,8 @@ public class PlayerInteractManager { + } else { + int i = itemstack.getCount(); + int j = itemstack.getDamage(); +- InteractionResultWrapper interactionresultwrapper = itemstack.a(world, (EntityHuman) entityplayer, enumhand); +- ItemStack itemstack1 = (ItemStack) interactionresultwrapper.b(); ++ InteractionResultWrapper interactionresultwrapper = itemstack.a(world, entityplayer, enumhand); ++ ItemStack itemstack1 = interactionresultwrapper.b(); + + if (itemstack1 == itemstack && itemstack1.getCount() == i && itemstack1.k() <= 0 && itemstack1.getDamage() == j) { + return interactionresultwrapper.a(); +diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java +index b7fe6425a6c830b2b63710b3c4c3c6e70df5268f..e1c0061088866044d19ae14a3b01c01e033eed00 100644 +--- a/src/main/java/net/minecraft/server/PlayerInventory.java ++++ b/src/main/java/net/minecraft/server/PlayerInventory.java +@@ -80,7 +80,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + } + + public ItemStack getItemInHand() { +- return d(this.itemInHandIndex) ? (ItemStack) this.items.get(this.itemInHandIndex) : ItemStack.b; ++ return d(this.itemInHandIndex) ? this.items.get(this.itemInHandIndex) : ItemStack.b; + } + + public static int getHotbarSize() { +@@ -119,7 +119,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + + public int getFirstEmptySlotIndex() { + for (int i = 0; i < this.items.size(); ++i) { +- if (((ItemStack) this.items.get(i)).isEmpty()) { ++ if (this.items.get(i).isEmpty()) { + return i; + } + } +@@ -129,7 +129,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + + public void c(int i) { + this.itemInHandIndex = this.i(); +- ItemStack itemstack = (ItemStack) this.items.get(this.itemInHandIndex); ++ ItemStack itemstack = this.items.get(this.itemInHandIndex); + + this.items.set(this.itemInHandIndex, this.items.get(i)); + this.items.set(i, itemstack); +@@ -141,9 +141,9 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + + public int c(ItemStack itemstack) { + for (int i = 0; i < this.items.size(); ++i) { +- ItemStack itemstack1 = (ItemStack) this.items.get(i); ++ ItemStack itemstack1 = this.items.get(i); + +- if (!((ItemStack) this.items.get(i)).isEmpty() && this.b(itemstack, (ItemStack) this.items.get(i)) && !((ItemStack) this.items.get(i)).f() && !itemstack1.hasEnchantments() && !itemstack1.hasName()) { ++ if (!this.items.get(i).isEmpty() && this.b(itemstack, this.items.get(i)) && !this.items.get(i).f() && !itemstack1.hasEnchantments() && !itemstack1.hasName()) { + return i; + } + } +@@ -157,14 +157,14 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + + for (j = 0; j < 9; ++j) { + i = (this.itemInHandIndex + j) % 9; +- if (((ItemStack) this.items.get(i)).isEmpty()) { ++ if (this.items.get(i).isEmpty()) { + return i; + } + } + + for (j = 0; j < 9; ++j) { + i = (this.itemInHandIndex + j) % 9; +- if (!((ItemStack) this.items.get(i)).hasEnchantments()) { ++ if (!this.items.get(i).hasEnchantments()) { + return i; + } + } +@@ -175,7 +175,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + public int a(Predicate predicate, int i, IInventory iinventory) { + byte b0 = 0; + boolean flag = i == 0; +- int j = b0 + ContainerUtil.a((IInventory) this, predicate, i - b0, flag); ++ int j = b0 + ContainerUtil.a(this, predicate, i - b0, flag); + + j += ContainerUtil.a(iinventory, predicate, i - j, flag); + j += ContainerUtil.a(this.carried, predicate, i - j, flag); +@@ -237,7 +237,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + return 40; + } else { + for (int i = 0; i < this.items.size(); ++i) { +- if (this.isSimilarAndNotFull((ItemStack) this.items.get(i), itemstack)) { ++ if (this.isSimilarAndNotFull(this.items.get(i), itemstack)) { + return i; + } + } +@@ -253,8 +253,8 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + NonNullList nonnulllist = (NonNullList) iterator.next(); + + for (int i = 0; i < nonnulllist.size(); ++i) { +- if (!((ItemStack) nonnulllist.get(i)).isEmpty()) { +- ((ItemStack) nonnulllist.get(i)).a(this.player.world, this.player, i, this.itemInHandIndex == i); ++ if (!nonnulllist.get(i).isEmpty()) { ++ nonnulllist.get(i).a(this.player.world, this.player, i, this.itemInHandIndex == i); + } + } + } +@@ -277,7 +277,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + + if (i >= 0) { + this.items.set(i, itemstack.cloneItemStack()); +- ((ItemStack) this.items.get(i)).d(5); ++ this.items.get(i).d(5); + itemstack.setCount(0); + return true; + } else if (this.player.abilities.canInstantlyBuild) { +@@ -309,8 +309,8 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + CrashReport crashreport = CrashReport.a(throwable, "Adding item to inventory"); + CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Item being added"); + +- crashreportsystemdetails.a("Item ID", (Object) Item.getId(itemstack.getItem())); +- crashreportsystemdetails.a("Item data", (Object) itemstack.getDamage()); ++ crashreportsystemdetails.a("Item ID", Item.getId(itemstack.getItem())); ++ crashreportsystemdetails.a("Item data", itemstack.getDamage()); + crashreportsystemdetails.a("Item name", () -> { + return itemstack.getName().getString(); + }); +@@ -357,7 +357,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + } + } + +- return list != null && !((ItemStack) list.get(i)).isEmpty() ? ContainerUtil.a(list, i, j) : ItemStack.b; ++ return list != null && !list.get(i).isEmpty() ? ContainerUtil.a(list, i, j) : ItemStack.b; + } + + public void f(ItemStack itemstack) { +@@ -390,8 +390,8 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + } + } + +- if (nonnulllist != null && !((ItemStack) nonnulllist.get(i)).isEmpty()) { +- ItemStack itemstack = (ItemStack) nonnulllist.get(i); ++ if (nonnulllist != null && !nonnulllist.get(i).isEmpty()) { ++ ItemStack itemstack = nonnulllist.get(i); + + nonnulllist.set(i, ItemStack.b); + return itemstack; +@@ -421,7 +421,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + } + + public float a(IBlockData iblockdata) { +- return ((ItemStack) this.items.get(this.itemInHandIndex)).a(iblockdata); ++ return this.items.get(this.itemInHandIndex).a(iblockdata); + } + + public NBTTagList a(NBTTagList nbttaglist) { +@@ -429,28 +429,28 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + int i; + + for (i = 0; i < this.items.size(); ++i) { +- if (!((ItemStack) this.items.get(i)).isEmpty()) { ++ if (!this.items.get(i).isEmpty()) { + nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte) i); +- ((ItemStack) this.items.get(i)).save(nbttagcompound); ++ this.items.get(i).save(nbttagcompound); + nbttaglist.add(nbttagcompound); + } + } + + for (i = 0; i < this.armor.size(); ++i) { +- if (!((ItemStack) this.armor.get(i)).isEmpty()) { ++ if (!this.armor.get(i).isEmpty()) { + nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte) (i + 100)); +- ((ItemStack) this.armor.get(i)).save(nbttagcompound); ++ this.armor.get(i).save(nbttagcompound); + nbttaglist.add(nbttagcompound); + } + } + + for (i = 0; i < this.extraSlots.size(); ++i) { +- if (!((ItemStack) this.extraSlots.get(i)).isEmpty()) { ++ if (!this.extraSlots.get(i).isEmpty()) { + nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte) (i + 150)); +- ((ItemStack) this.extraSlots.get(i)).save(nbttagcompound); ++ this.extraSlots.get(i).save(nbttagcompound); + nbttaglist.add(nbttagcompound); + } + } +@@ -537,7 +537,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + } + } + +- return list == null ? ItemStack.b : (ItemStack) list.get(i); ++ return list == null ? ItemStack.b : list.get(i); + } + + @Override +@@ -553,7 +553,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + } + + for (int i = 0; i < this.armor.size(); ++i) { +- ItemStack itemstack = (ItemStack) this.armor.get(i); ++ ItemStack itemstack = this.armor.get(i); + + if ((!damagesource.isFire() || !itemstack.getItem().u()) && itemstack.getItem() instanceof ItemArmor) { + int finalI = i; // CraftBukkit - decompile error +@@ -573,7 +573,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { + List list = (List) iterator.next(); + + for (int i = 0; i < list.size(); ++i) { +- ItemStack itemstack = (ItemStack) list.get(i); ++ ItemStack itemstack = list.get(i); + + if (!itemstack.isEmpty()) { + this.player.a(itemstack, true, false); +diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java +index 35a0725e7124918765d3188d0774516d3fe7c152..8498324704ea2e3178a46149b2cc2fd37682dbff 100644 +--- a/src/main/java/net/minecraft/server/PlayerList.java ++++ b/src/main/java/net/minecraft/server/PlayerList.java +@@ -165,7 +165,7 @@ public abstract class PlayerList { + // PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", entityplayer.getDisplayName().getString(), s1, entityplayer.getId(), entityplayer.locX(), entityplayer.locY(), entityplayer.locZ()); + WorldData worlddata = worldserver1.getWorldData(); + +- this.a(entityplayer, (EntityPlayer) null, worldserver1); ++ this.a(entityplayer, null, worldserver1); + PlayerConnection playerconnection = new PlayerConnection(this.server, networkmanager, entityplayer); + GameRules gamerules = worldserver1.getGameRules(); + boolean flag = gamerules.getBoolean(GameRules.DO_IMMEDIATE_RESPAWN); +@@ -234,9 +234,9 @@ public abstract class PlayerList { + ChatMessage chatmessage; + + if (entityplayer.getProfile().getName().equalsIgnoreCase(s)) { +- chatmessage = new ChatMessage("multiplayer.player.joined", new Object[]{entityplayer.getScoreboardDisplayName()}); ++ chatmessage = new ChatMessage("multiplayer.player.joined", entityplayer.getScoreboardDisplayName()); + } else { +- chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[]{entityplayer.getScoreboardDisplayName(), s}); ++ chatmessage = new ChatMessage("multiplayer.player.joined.renamed", entityplayer.getScoreboardDisplayName(), s); + } + // CraftBukkit start + chatmessage.a(EnumChatFormat.YELLOW); +@@ -275,7 +275,7 @@ public abstract class PlayerList { + PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entityplayer); + + for (int i = 0; i < this.players.size(); ++i) { +- EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i); ++ EntityPlayer entityplayer1 = this.players.get(i); + + if (entityplayer1.getBukkitEntity().canSee(entityplayer.getBukkitEntity())) { + entityplayer1.playerConnection.sendPacket(packet); +@@ -285,7 +285,7 @@ public abstract class PlayerList { + continue; + } + +- entityplayer.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[] { entityplayer1})); ++ entityplayer.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entityplayer1)); + } + entityplayer.sentListPacket = true; + entityplayer.supressTrackerForLogin = false; // Paper +@@ -469,13 +469,13 @@ public abstract class PlayerList { + if (!entityplayer.getBukkitEntity().isPersistent()) return; // CraftBukkit + if (!entityplayer.didPlayerJoinEvent) return; // Paper - If we never fired PJE, we disconnected during login. Data has not changed, and additionally, our saved vehicle is not loaded! If we save now, we will lose our vehicle (CraftBukkit bug) + this.playerFileData.save(entityplayer); +- ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) entityplayer.getStatisticManager(); // CraftBukkit ++ ServerStatisticManager serverstatisticmanager = entityplayer.getStatisticManager(); // CraftBukkit + + if (serverstatisticmanager != null) { + serverstatisticmanager.save(); + } + +- AdvancementDataPlayer advancementdataplayer = (AdvancementDataPlayer) entityplayer.getAdvancementDataIfLoadedImmediately(); // CraftBukkit // Paper ++ AdvancementDataPlayer advancementdataplayer = entityplayer.getAdvancementDataIfLoadedImmediately(); // CraftBukkit // Paper + + if (advancementdataplayer != null) { + advancementdataplayer.b(); +@@ -536,7 +536,7 @@ public abstract class PlayerList { + this.playersByName.remove(entityplayer.getName().toLowerCase(java.util.Locale.ROOT)); // Spigot + this.server.getBossBattleCustomData().b(entityplayer); + UUID uuid = entityplayer.getUniqueID(); +- EntityPlayer entityplayer1 = (EntityPlayer) this.j.get(uuid); ++ EntityPlayer entityplayer1 = this.j.get(uuid); + + if (entityplayer1 == entityplayer) { + this.j.remove(uuid); +@@ -557,7 +557,7 @@ public abstract class PlayerList { + // this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[]{entityplayer})); + PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, entityplayer); + for (int i = 0; i < players.size(); i++) { +- EntityPlayer entityplayer2 = (EntityPlayer) this.players.get(i); ++ EntityPlayer entityplayer2 = this.players.get(i); + + if (entityplayer2.getBukkitEntity().canSee(entityplayer.getBukkitEntity())) { + entityplayer2.playerConnection.sendPacket(packet); +@@ -583,7 +583,7 @@ public abstract class PlayerList { + EntityPlayer entityplayer; + + for (int i = 0; i < this.players.size(); ++i) { +- entityplayer = (EntityPlayer) this.players.get(i); ++ entityplayer = this.players.get(i); + if (entityplayer.getUniqueID().equals(uuid)) { + list.add(entityplayer); + } +@@ -619,9 +619,9 @@ public abstract class PlayerList { + if (getProfileBans().isBanned(gameprofile) && (gameprofilebanentry = getProfileBans().get(gameprofile)) != null) { + // Paper end + +- chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()}); ++ chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", gameprofilebanentry.getReason()); + if (gameprofilebanentry.getExpires() != null) { +- chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[]{PlayerList.g.format(gameprofilebanentry.getExpires())})); ++ chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", PlayerList.g.format(gameprofilebanentry.getExpires()))); + } + + // return chatmessage; +@@ -632,9 +632,9 @@ public abstract class PlayerList { + } else if (getIPBans().isBanned(socketaddress) && getIPBans().get(socketaddress) != null && !getIPBans().get(socketaddress).hasExpired()) { // Paper - fix NPE with temp ip bans + IpBanEntry ipbanentry = this.l.get(socketaddress); + +- chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()}); ++ chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", ipbanentry.getReason()); + if (ipbanentry.getExpires() != null) { +- chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", new Object[]{PlayerList.g.format(ipbanentry.getExpires())})); ++ chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", PlayerList.g.format(ipbanentry.getExpires()))); + } + + // return chatmessage; +@@ -784,7 +784,7 @@ public abstract class PlayerList { + if (location == null) { + worldserver1 = this.server.getWorldServer(World.OVERWORLD); + blockposition = entityplayer1.getSpawnPoint(worldserver1); +- location = new Location(worldserver1.getWorld(), (double) ((float) blockposition.getX() + 0.5F), (double) ((float) blockposition.getY() + 0.1F), (double) ((float) blockposition.getZ() + 0.5F)); ++ location = new Location(worldserver1.getWorld(), (float) blockposition.getX() + 0.5F, (float) blockposition.getY() + 0.1F, (float) blockposition.getZ() + 0.5F); + } + + Player respawnPlayer = cserver.getPlayer(entityplayer1); +@@ -843,7 +843,7 @@ public abstract class PlayerList { + if (flag2 && !isLocAltered) { + IBlockData data = worldserver1.getType(blockposition); + worldserver1.setTypeAndData(blockposition, data.set(BlockRespawnAnchor.a, data.get(BlockRespawnAnchor.a) - 1), 3); +- entityplayer1.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.BLOCK_RESPAWN_ANCHOR_DEPLETE, SoundCategory.BLOCKS, (double) location.getX(), (double) location.getY(), (double) location.getZ(), 1.0F, 1.0F)); ++ entityplayer1.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.BLOCK_RESPAWN_ANCHOR_DEPLETE, SoundCategory.BLOCKS, location.getX(), location.getY(), location.getZ(), 1.0F, 1.0F)); + // Paper end + } + // Added from changeDimension +@@ -891,7 +891,7 @@ public abstract class PlayerList { + if (++this.w > 600) { + // CraftBukkit start + for (int i = 0; i < this.players.size(); ++i) { +- final EntityPlayer target = (EntityPlayer) this.players.get(i); ++ final EntityPlayer target = this.players.get(i); + + target.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_LATENCY, Iterables.filter(this.players, new Predicate() { + @Override +@@ -908,7 +908,7 @@ public abstract class PlayerList { + + public void sendAll(Packet packet) { + for (int i = 0; i < this.players.size(); ++i) { +- ((EntityPlayer) this.players.get(i)).playerConnection.sendPacket(packet); ++ this.players.get(i).playerConnection.sendPacket(packet); + } + + } +@@ -920,7 +920,7 @@ public abstract class PlayerList { + if (entityhuman != null && entityhuman instanceof EntityPlayer && !entityplayer.getBukkitEntity().canSee(((EntityPlayer) entityhuman).getBukkitEntity())) { + continue; + } +- ((EntityPlayer) this.players.get(i)).playerConnection.sendPacket(packet); ++ this.players.get(i).playerConnection.sendPacket(packet); + } + } + +@@ -934,7 +934,7 @@ public abstract class PlayerList { + + public void a(Packet packet, ResourceKey resourcekey) { + for (int i = 0; i < this.players.size(); ++i) { +- EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); ++ EntityPlayer entityplayer = this.players.get(i); + + if (entityplayer.world.getDimensionKey() == resourcekey) { + entityplayer.playerConnection.sendPacket(packet); +@@ -969,7 +969,7 @@ public abstract class PlayerList { + this.sendMessage(ichatbasecomponent, ChatMessageType.SYSTEM, entityhuman.getUniqueID()); + } else { + for (int i = 0; i < this.players.size(); ++i) { +- EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); ++ EntityPlayer entityplayer = this.players.get(i); + + if (entityplayer.getScoreboardTeam() != scoreboardteambase) { + entityplayer.sendMessage(ichatbasecomponent, entityhuman.getUniqueID()); +@@ -983,7 +983,7 @@ public abstract class PlayerList { + String[] astring = new String[this.players.size()]; + + for (int i = 0; i < this.players.size(); ++i) { +- astring[i] = ((EntityPlayer) this.players.get(i)).getProfile().getName(); ++ astring[i] = this.players.get(i).getProfile().getName(); + } + + return astring; +@@ -1117,7 +1117,7 @@ public abstract class PlayerList { + MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main + MinecraftTimings.savePlayers.startTiming(); // Paper + for (int i = 0; i < this.players.size(); ++i) { +- this.savePlayerFile((EntityPlayer) this.players.get(i)); ++ this.savePlayerFile(this.players.get(i)); + } + MinecraftTimings.savePlayers.stopTiming(); // Paper + return null; }); // Paper - ensure main +@@ -1248,8 +1248,8 @@ public abstract class PlayerList { + + // Yatopia start - make sure all saves are done + try { +- ((WorldNBTStorage)playerFileData).saveThread.shutdown(); +- boolean done = ((WorldNBTStorage)playerFileData).saveThread.awaitTermination(60, TimeUnit.SECONDS); ++ playerFileData.saveThread.shutdown(); ++ boolean done = playerFileData.saveThread.awaitTermination(60, TimeUnit.SECONDS); + if(!done) { + LOGGER.error("Players did not save completly!"); + } +@@ -1297,7 +1297,7 @@ public abstract class PlayerList { + + public ServerStatisticManager getStatisticManager(UUID uuid, String displayName) { + EntityPlayer entityhuman = this.getPlayer(uuid); +- ServerStatisticManager serverstatisticmanager = entityhuman == null ? null : (ServerStatisticManager) entityhuman.getStatisticManager(); ++ ServerStatisticManager serverstatisticmanager = entityhuman == null ? null : entityhuman.getStatisticManager(); + // CraftBukkit end + + if (serverstatisticmanager == null) { +@@ -1342,7 +1342,7 @@ public abstract class PlayerList { + public AdvancementDataPlayer loadAdvancementDataPlayerBlocking(EntityPlayer entityplayer) { return this.f(entityplayer); } // Paper - OBFHELPER + public AdvancementDataPlayer f(EntityPlayer entityplayer) { + UUID uuid = entityplayer.getUniqueID(); +- AdvancementDataPlayer advancementdataplayer = (AdvancementDataPlayer) entityplayer.getAdvancementDataIfLoadedImmediately(); // CraftBukkit ++ AdvancementDataPlayer advancementdataplayer = entityplayer.getAdvancementDataIfLoadedImmediately(); // CraftBukkit + + if (advancementdataplayer == null) { + File file = this.server.a(SavedFile.ADVANCEMENTS).toFile(); +@@ -1377,7 +1377,7 @@ public abstract class PlayerList { + + @Nullable + public EntityPlayer getPlayer(UUID uuid) { +- return (EntityPlayer) this.j.get(uuid); ++ return this.j.get(uuid); + } + + public boolean f(GameProfile gameprofile) { +diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java +index 0b4a0052a25470033326f7533880a14eaccd6321..0199e1e0c081e0d76cd2c927fa719f3d2bde4b2f 100644 +--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java ++++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java +@@ -54,7 +54,7 @@ public class PortalTravelAgent { + VillagePlace villageplace = this.world.x(); + + villageplace.a(this.world, blockposition, searchRadius); // Paper - This impacts the # of chunks searched for entries +- List list = (List) villageplace.b((villageplacetype) -> { ++ List list = villageplace.b((villageplacetype) -> { + return villageplacetype == VillagePlaceType.v; + }, blockposition, searchRadius, VillagePlace.Occupancy.ANY).collect(Collectors.toList()); // CraftBukkit - searchRadius + boolean seen = false; +@@ -72,7 +72,7 @@ public class PortalTravelAgent { + } + Optional optional = seen ? Optional.of(best) : Optional.empty(); + +- return (ShapeDetector.Shape) optional.map((villageplacerecord) -> { ++ return optional.map((villageplacerecord) -> { + BlockPosition blockposition1 = villageplacerecord.f(); + + this.world.getChunkProvider().addTicket(TicketType.PORTAL, new ChunkCoordIntPair(blockposition1), 3, blockposition1); +@@ -257,7 +257,7 @@ public class PortalTravelAgent { + } + } + +- IBlockData iblockdata = (IBlockData) Blocks.NETHER_PORTAL.getBlockData().set(BlockPortal.AXIS, k5 == 0 ? EnumDirection.EnumAxis.Z : EnumDirection.EnumAxis.X); ++ IBlockData iblockdata = Blocks.NETHER_PORTAL.getBlockData().set(BlockPortal.AXIS, k5 == 0 ? EnumDirection.EnumAxis.Z : EnumDirection.EnumAxis.X); + + for (i3 = 0; i3 < 2; ++i3) { + for (l2 = 0; l2 < 3; ++l2) { +diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java +index a448fa6418e6e56df70dc53fec2e5582def5593e..e2ffbecfbf7773a93c88e58ea45dda44455fdbd0 100644 +--- a/src/main/java/net/minecraft/server/PotionUtil.java ++++ b/src/main/java/net/minecraft/server/PotionUtil.java +@@ -25,7 +25,7 @@ public class PotionUtil { + List list = Lists.newArrayList(); + + list.addAll(c(nbttagcompound).a()); +- a(nbttagcompound, (List) list); ++ a(nbttagcompound, list); + return list; + } + +@@ -36,7 +36,7 @@ public class PotionUtil { + public static List b(@Nullable NBTTagCompound nbttagcompound) { + List list = Lists.newArrayList(); + +- a(nbttagcompound, (List) list); ++ a(nbttagcompound, list); + return list; + } + +@@ -59,11 +59,11 @@ public class PotionUtil { + public static int c(ItemStack itemstack) { + NBTTagCompound nbttagcompound = itemstack.getTag(); + +- return nbttagcompound != null && nbttagcompound.hasKeyOfType("CustomPotionColor", 99) ? nbttagcompound.getInt("CustomPotionColor") : (d(itemstack) == Potions.EMPTY ? 16253176 : a((Collection) getEffects(itemstack))); ++ return nbttagcompound != null && nbttagcompound.hasKeyOfType("CustomPotionColor", 99) ? nbttagcompound.getInt("CustomPotionColor") : (d(itemstack) == Potions.EMPTY ? 16253176 : a(getEffects(itemstack))); + } + + public static int a(PotionRegistry potionregistry) { +- return potionregistry == Potions.EMPTY ? 16253176 : a((Collection) potionregistry.a()); ++ return potionregistry == Potions.EMPTY ? 16253176 : a(potionregistry.a()); + } + + public static int a(Collection collection) { +diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java +index cea260df46d9300d95182d72cec2a1ea15ff8625..84662db06714dfe2fdfdd741bd8aa4ea5d3494cd 100644 +--- a/src/main/java/net/minecraft/server/PropertyManager.java ++++ b/src/main/java/net/minecraft/server/PropertyManager.java +@@ -129,7 +129,7 @@ public abstract class PropertyManager> { + + @Nullable String getSettingIfExists(final String path) { return this.c(path); } // Paper - OBFHELPER + @Nullable private String c(String s) { // Paper - OBFHELPER +- return (String) getOverride(s, this.properties.getProperty(s)); // CraftBukkit ++ return getOverride(s, this.properties.getProperty(s)); // CraftBukkit + } + + @Nullable +@@ -177,16 +177,16 @@ public abstract class PropertyManager> { + } + + protected String getString(String s, String s1) { +- return (String) this.a(s, Function.identity(), Function.identity(), s1); ++ return this.a(s, Function.identity(), Function.identity(), s1); + } + + @Nullable + protected String a(String s) { +- return (String) this.a(s, Function.identity()); ++ return this.a(s, Function.identity()); + } + + protected int getInt(String s, int i) { +- return (Integer) this.a(s, a(Integer::parseInt), i); // CraftBukkit - decompile error ++ return this.a(s, a(Integer::parseInt), i); // CraftBukkit - decompile error + } + + protected PropertyManager.EditableProperty b(String s, int i) { +@@ -194,11 +194,11 @@ public abstract class PropertyManager> { + } + + protected int a(String s, UnaryOperator unaryoperator, int i) { +- return (Integer) this.a(s, a(Integer::parseInt), unaryoperator, Objects::toString, i); ++ return this.a(s, a(Integer::parseInt), unaryoperator, Objects::toString, i); + } + + protected long getLong(String s, long i) { +- return (Long) this.a(s, a(Long::parseLong), i); // CraftBukkit - decompile error ++ return this.a(s, a(Long::parseLong), i); // CraftBukkit - decompile error + } + + protected boolean getBoolean(String s, boolean flag) { +@@ -211,7 +211,7 @@ public abstract class PropertyManager> { + + @Nullable + protected Boolean b(String s) { +- return (Boolean) this.a(s, Boolean::valueOf); ++ return this.a(s, Boolean::valueOf); + } + + protected Properties a() { +diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java +index 5e34bb8a0619ca3ac170db5e94fb9597ee271e46..80bfebc4aa9934389cdacab29fae7575745e5d8e 100644 +--- a/src/main/java/net/minecraft/server/ProtoChunk.java ++++ b/src/main/java/net/minecraft/server/ProtoChunk.java +@@ -46,7 +46,7 @@ public class ProtoChunk implements IChunkAccess { + @Deprecated public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter) { this(chunkcoordintpair, chunkconverter, null); } // Notice for updates: Please make sure this constructor isn't used anywhere + public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, World world) { + // Paper end +- this(chunkcoordintpair, chunkconverter, (ChunkSection[]) null, new ProtoChunkTickList<>((block) -> { ++ this(chunkcoordintpair, chunkconverter, null, new ProtoChunkTickList<>((block) -> { + return block == null || block.getBlockData().isAir(); + }, chunkcoordintpair), new ProtoChunkTickList<>((fluidtype) -> { + return fluidtype == null || fluidtype == FluidTypes.EMPTY; +@@ -167,7 +167,7 @@ public class ProtoChunk implements IChunkAccess { + ChunkSection chunksection = this.a(j >> 4); + IBlockData iblockdata1 = chunksection.setType(i & 15, j & 15, k & 15, iblockdata); + +- if (this.g.b(ChunkStatus.FEATURES) && iblockdata != iblockdata1 && (iblockdata.b((IBlockAccess) this, blockposition) != iblockdata1.b((IBlockAccess) this, blockposition) || iblockdata.f() != iblockdata1.f() || iblockdata.e() || iblockdata1.e())) { ++ if (this.g.b(ChunkStatus.FEATURES) && iblockdata != iblockdata1 && (iblockdata.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata.f() != iblockdata1.f() || iblockdata.e() || iblockdata1.e())) { + LightEngine lightengine = this.e(); + + lightengine.a(blockposition); +@@ -178,7 +178,7 @@ public class ProtoChunk implements IChunkAccess { + // Tuinity - reduce iterator creation + + for (HeightMap.Type heightmap_type : enumset) { // Tuinity - reduce iterator creation +- HeightMap heightmap = (HeightMap) this.f.get(heightmap_type); ++ HeightMap heightmap = this.f.get(heightmap_type); + + if (heightmap == null) { + if (enumset1 == null) { +@@ -196,7 +196,7 @@ public class ProtoChunk implements IChunkAccess { + // Tuinity start - reduce iterator creation + for (HeightMap.Type heightmap_type : enumset) { + // Tuinity end - reduce iterator creation +- ((HeightMap) this.f.get(heightmap_type)).a(i & 15, j, k & 15, iblockdata); ++ this.f.get(heightmap_type).a(i & 15, j, k & 15, iblockdata); + } + + return iblockdata1; +@@ -231,7 +231,7 @@ public class ProtoChunk implements IChunkAccess { + @Nullable + @Override + public TileEntity getTileEntity(BlockPosition blockposition) { +- return (TileEntity) this.h.get(blockposition); ++ return this.h.get(blockposition); + } + + public Map x() { +@@ -308,18 +308,18 @@ public class ProtoChunk implements IChunkAccess { + + @Override + public HeightMap a(HeightMap.Type heightmap_type) { +- return (HeightMap) this.f.computeIfAbsent(heightmap_type, (heightmap_type1) -> { ++ return this.f.computeIfAbsent(heightmap_type, (heightmap_type1) -> { + return new HeightMap(this, heightmap_type1); + }); + } + + @Override + public int getHighestBlock(HeightMap.Type heightmap_type, int i, int j) { +- HeightMap heightmap = (HeightMap) this.f.get(heightmap_type); ++ HeightMap heightmap = this.f.get(heightmap_type); + + if (heightmap == null) { + HeightMap.a(this, EnumSet.of(heightmap_type)); +- heightmap = (HeightMap) this.f.get(heightmap_type); ++ heightmap = this.f.get(heightmap_type); + } + + return heightmap.a(i & 15, j & 15) - 1; +@@ -336,7 +336,7 @@ public class ProtoChunk implements IChunkAccess { + @Nullable + @Override + public StructureStart a(StructureGenerator structuregenerator) { +- return (StructureStart) this.n.get(structuregenerator); ++ return this.n.get(structuregenerator); + } + + @Override +@@ -359,16 +359,16 @@ public class ProtoChunk implements IChunkAccess { + + @Override + public LongSet b(StructureGenerator structuregenerator) { +- return (LongSet) this.o.computeIfAbsent(structuregenerator, (structuregenerator1) -> { ++ return this.o.computeIfAbsent(structuregenerator, (structuregenerator1) -> { + return new LongOpenHashSet(); + }); + } + + @Override + public void a(StructureGenerator structuregenerator, long i) { +- ((LongSet) this.o.computeIfAbsent(structuregenerator, (structuregenerator1) -> { ++ this.o.computeIfAbsent(structuregenerator, (structuregenerator1) -> { + return new LongOpenHashSet(); +- })).add(i); ++ }).add(i); + this.c = true; + } + +@@ -457,7 +457,7 @@ public class ProtoChunk implements IChunkAccess { + + @Override + public NBTTagCompound f(BlockPosition blockposition) { +- return (NBTTagCompound) this.i.get(blockposition); ++ return this.i.get(blockposition); + } + + @Nullable +@@ -465,7 +465,7 @@ public class ProtoChunk implements IChunkAccess { + public NBTTagCompound i(BlockPosition blockposition) { + TileEntity tileentity = this.getTileEntity(blockposition); + +- return tileentity != null ? tileentity.save(new NBTTagCompound()) : (NBTTagCompound) this.i.get(blockposition); ++ return tileentity != null ? tileentity.save(new NBTTagCompound()) : this.i.get(blockposition); + } + + @Override +@@ -476,11 +476,11 @@ public class ProtoChunk implements IChunkAccess { + + @Nullable + public BitSet a(WorldGenStage.Features worldgenstage_features) { +- return (BitSet) this.t.get(worldgenstage_features); ++ return this.t.get(worldgenstage_features); + } + + public BitSet b(WorldGenStage.Features worldgenstage_features) { +- return (BitSet) this.t.computeIfAbsent(worldgenstage_features, (worldgenstage_features1) -> { ++ return this.t.computeIfAbsent(worldgenstage_features, (worldgenstage_features1) -> { + return new BitSet(65536); + }); + } +diff --git a/src/main/java/net/minecraft/server/ProtoChunkExtension.java b/src/main/java/net/minecraft/server/ProtoChunkExtension.java +index c154b40f6ee4fda14debea94ae41ae24c5423633..57617777632cd9a1e34a4827a0e1ffb0ede8d062 100644 +--- a/src/main/java/net/minecraft/server/ProtoChunkExtension.java ++++ b/src/main/java/net/minecraft/server/ProtoChunkExtension.java +@@ -185,12 +185,12 @@ public class ProtoChunkExtension extends ProtoChunk { + + @Override + public BitSet a(WorldGenStage.Features worldgenstage_features) { +- throw (UnsupportedOperationException) SystemUtils.c(new UnsupportedOperationException("Meaningless in this context")); ++ throw SystemUtils.c(new UnsupportedOperationException("Meaningless in this context")); + } + + @Override + public BitSet b(WorldGenStage.Features worldgenstage_features) { +- throw (UnsupportedOperationException) SystemUtils.c(new UnsupportedOperationException("Meaningless in this context")); ++ throw SystemUtils.c(new UnsupportedOperationException("Meaningless in this context")); + } + + public Chunk u() { +diff --git a/src/main/java/net/minecraft/server/Raid.java b/src/main/java/net/minecraft/server/Raid.java +index 8fb4513944de5bbdf08443d6c1e20ae2d0548686..5c5dc13ef62c02457308197285f066b8030af673 100644 +--- a/src/main/java/net/minecraft/server/Raid.java ++++ b/src/main/java/net/minecraft/server/Raid.java +@@ -225,7 +225,7 @@ public class Raid { + flag1 = this.y.isPresent(); + boolean flag2 = !flag1 && this.preRaidTicks % 5 == 0; + +- if (flag1 && !this.world.getChunkProvider().a(new ChunkCoordIntPair((BlockPosition) this.y.get()))) { ++ if (flag1 && !this.world.getChunkProvider().a(new ChunkCoordIntPair(this.y.get()))) { + flag2 = true; + } + +@@ -249,7 +249,7 @@ public class Raid { + this.bossBattle.setProgress(MathHelper.a((float) (300 - this.preRaidTicks) / 300.0F, 0.0F, 1.0F)); + } else if (this.preRaidTicks == 0 && this.groupsSpawned > 0) { + this.preRaidTicks = 300; +- this.bossBattle.a((IChatBaseComponent) Raid.a); ++ this.bossBattle.a(Raid.a); + return; + } + } +@@ -259,12 +259,12 @@ public class Raid { + this.F(); + if (i > 0) { + if (i <= 2) { +- this.bossBattle.a((IChatBaseComponent) Raid.a.mutableCopy().c(" - ").addSibling(new ChatMessage("event.minecraft.raid.raiders_remaining", new Object[]{i}))); ++ this.bossBattle.a(Raid.a.mutableCopy().c(" - ").addSibling(new ChatMessage("event.minecraft.raid.raiders_remaining", i))); + } else { +- this.bossBattle.a((IChatBaseComponent) Raid.a); ++ this.bossBattle.a(Raid.a); + } + } else { +- this.bossBattle.a((IChatBaseComponent) Raid.a); ++ this.bossBattle.a(Raid.a); + } + } + +@@ -272,7 +272,7 @@ public class Raid { + int j = 0; + + while (this.G()) { +- BlockPosition blockposition = this.y.isPresent() ? (BlockPosition) this.y.get() : this.a(j, 20); ++ BlockPosition blockposition = this.y.isPresent() ? this.y.get() : this.a(j, 20); + + if (blockposition != null) { + this.started = true; +@@ -392,7 +392,7 @@ public class Raid { + HashSet hashset = Sets.newHashSet(); + + while (iterator.hasNext()) { +- Set set = (Set) iterator.next(); ++ Set set = iterator.next(); + Iterator iterator1 = set.iterator(); + + while (iterator1.hasNext()) { +@@ -438,7 +438,7 @@ public class Raid { + while (iterator.hasNext()) { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); + Vec3D vec3d = entityplayer.getPositionVector(); +- Vec3D vec3d1 = Vec3D.a((BaseBlockPosition) blockposition); ++ Vec3D vec3d1 = Vec3D.a(blockposition); + float f1 = MathHelper.sqrt((vec3d1.x - vec3d.x) * (vec3d1.x - vec3d.x) + (vec3d1.z - vec3d.z) * (vec3d1.z - vec3d.z)); + double d0 = vec3d.x + (double) (13.0F / f1) * (vec3d1.x - vec3d.x); + double d1 = vec3d.z + (double) (13.0F / f1) * (vec3d1.z - vec3d.z); +@@ -470,7 +470,7 @@ public class Raid { + int i1 = 0; + + for (int j1 = 0; j1 < l; ++j1) { +- EntityRaider entityraider = (EntityRaider) raid_wave.g.a((World) this.world); ++ EntityRaider entityraider = raid_wave.g.a(this.world); + + if (!flag && entityraider.eO()) { + entityraider.setPatrolLeader(true); +@@ -485,12 +485,12 @@ public class Raid { + EntityRaider entityraider1 = null; + + if (i == this.a(EnumDifficulty.NORMAL)) { +- entityraider1 = (EntityRaider) EntityTypes.PILLAGER.a((World) this.world); ++ entityraider1 = EntityTypes.PILLAGER.a(this.world); + } else if (i >= this.a(EnumDifficulty.HARD)) { + if (i1 == 0) { +- entityraider1 = (EntityRaider) EntityTypes.EVOKER.a((World) this.world); ++ entityraider1 = EntityTypes.EVOKER.a(this.world); + } else { +- entityraider1 = (EntityRaider) EntityTypes.VINDICATOR.a((World) this.world); ++ entityraider1 = EntityTypes.VINDICATOR.a(this.world); + } + } + +@@ -522,7 +522,7 @@ public class Raid { + entityraider.b(0); + if (!flag && blockposition != null) { + entityraider.setPosition((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 1.0D, (double) blockposition.getZ() + 0.5D); +- entityraider.prepare(this.world, this.world.getDamageScaler(blockposition), EnumMobSpawn.EVENT, (GroupDataEntity) null, (NBTTagCompound) null); ++ entityraider.prepare(this.world, this.world.getDamageScaler(blockposition), EnumMobSpawn.EVENT, null, null); + entityraider.a(i, false); + entityraider.c(true); + this.world.addEntity(entityraider, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.RAID); // CraftBukkit +@@ -566,7 +566,7 @@ public class Raid { + } + + public void a(EntityRaider entityraider, boolean flag) { +- Set set = (Set) this.raiders.get(entityraider.fd()); ++ Set set = this.raiders.get(entityraider.fd()); + + if (set != null) { + boolean flag1 = set.remove(entityraider); +@@ -595,13 +595,13 @@ public class Raid { + + nbttagcompound.set("Patterns", nbttaglist); + itemstack.getOrCreateTag().setInt("HideFlags", 32); +- itemstack.a((IChatBaseComponent) (new ChatMessage("block.minecraft.ominous_banner")).a(EnumChatFormat.GOLD)); ++ itemstack.a((new ChatMessage("block.minecraft.ominous_banner")).a(EnumChatFormat.GOLD)); + return itemstack; + } + + @Nullable + public EntityRaider b(int i) { +- return (EntityRaider) this.f.get(i); ++ return this.f.get(i); + } + + @Nullable +@@ -616,7 +616,7 @@ public class Raid { + int k1 = this.world.a(HeightMap.Type.WORLD_SURFACE, i1, j1); + + blockposition_mutableblockposition.d(i1, k1, j1); +- if ((!this.world.b_(blockposition_mutableblockposition) || i >= 2) && this.world.isAreaLoaded(blockposition_mutableblockposition.getX() - 10, blockposition_mutableblockposition.getY() - 10, blockposition_mutableblockposition.getZ() - 10, blockposition_mutableblockposition.getX() + 10, blockposition_mutableblockposition.getY() + 10, blockposition_mutableblockposition.getZ() + 10) && this.world.getChunkProvider().a(new ChunkCoordIntPair(blockposition_mutableblockposition)) && (SpawnerCreature.a(EntityPositionTypes.Surface.ON_GROUND, (IWorldReader) this.world, blockposition_mutableblockposition, EntityTypes.RAVAGER) || this.world.getType(blockposition_mutableblockposition.down()).a(Blocks.SNOW) && this.world.getType(blockposition_mutableblockposition).isAir())) { ++ if ((!this.world.b_(blockposition_mutableblockposition) || i >= 2) && this.world.isAreaLoaded(blockposition_mutableblockposition.getX() - 10, blockposition_mutableblockposition.getY() - 10, blockposition_mutableblockposition.getZ() - 10, blockposition_mutableblockposition.getX() + 10, blockposition_mutableblockposition.getY() + 10, blockposition_mutableblockposition.getZ() + 10) && this.world.getChunkProvider().a(new ChunkCoordIntPair(blockposition_mutableblockposition)) && (SpawnerCreature.a(EntityPositionTypes.Surface.ON_GROUND, this.world, blockposition_mutableblockposition, EntityTypes.RAVAGER) || this.world.getType(blockposition_mutableblockposition.down()).a(Blocks.SNOW) && this.world.getType(blockposition_mutableblockposition).isAir())) { + return blockposition_mutableblockposition; + } + } +@@ -632,7 +632,7 @@ public class Raid { + this.raiders.computeIfAbsent(i, (integer) -> { + return Sets.newHashSet(); + }); +- Set set = (Set) this.raiders.get(i); ++ Set set = this.raiders.get(i); + EntityRaider entityraider1 = null; + Iterator iterator = set.iterator(); + +diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java +index 1584f6e83abd213309ea9dde2f567329eae0f8ed..e095d27dbc35f466bb882617a3afd4bcfdb80729 100644 +--- a/src/main/java/net/minecraft/server/RandomPositionGenerator.java ++++ b/src/main/java/net/minecraft/server/RandomPositionGenerator.java +@@ -9,7 +9,7 @@ public class RandomPositionGenerator { + + @Nullable + public static Vec3D a(EntityCreature entitycreature, int i, int j) { +- return a(entitycreature, i, j, 0, (Vec3D) null, true, 1.5707963705062866D, entitycreature::f, false, 0, 0, true); ++ return a(entitycreature, i, j, 0, null, true, 1.5707963705062866D, entitycreature::f, false, 0, 0, true); + } + + @Nullable +@@ -25,12 +25,12 @@ public class RandomPositionGenerator { + + @Nullable + public static Vec3D a(EntityCreature entitycreature, int i, int j, ToDoubleFunction todoublefunction) { +- return a(entitycreature, i, j, 0, (Vec3D) null, false, 0.0D, todoublefunction, true, 0, 0, true); ++ return a(entitycreature, i, j, 0, null, false, 0.0D, todoublefunction, true, 0, 0, true); + } + + @Nullable + public static Vec3D a(EntityCreature entitycreature, int i, int j, Vec3D vec3d, float f, int k, int l) { +- return a(entitycreature, i, j, 0, vec3d, false, (double) f, entitycreature::f, true, k, l, true); ++ return a(entitycreature, i, j, 0, vec3d, false, f, entitycreature::f, true, k, l, true); + } + + @Nullable +@@ -82,7 +82,7 @@ public class RandomPositionGenerator { + boolean flag3; + + if (entitycreature.eA()) { +- flag3 = entitycreature.ex().a((IPosition) entitycreature.getPositionVector(), (double) (entitycreature.ey() + (float) i) + 1.0D); ++ flag3 = entitycreature.ex().a(entitycreature.getPositionVector(), (double) (entitycreature.ey() + (float) i) + 1.0D); + } else { + flag3 = false; + } +@@ -125,8 +125,8 @@ public class RandomPositionGenerator { + } + + Fluid fluid = entitycreature.world.getFluidIfLoaded(blockposition2); // Paper +- if (flag || (fluid != null && !fluid.a((Tag) TagsFluid.WATER))) { // Paper +- PathType pathtype = PathfinderNormal.a((IBlockAccess) entitycreature.world, blockposition2.i()); ++ if (flag || (fluid != null && !fluid.a(TagsFluid.WATER))) { // Paper ++ PathType pathtype = PathfinderNormal.a(entitycreature.world, blockposition2.i()); + + if (entitycreature.a(pathtype) == 0.0F) { + double d2 = todoublefunction.applyAsDouble(blockposition2); +@@ -143,7 +143,7 @@ public class RandomPositionGenerator { + } + + if (flag4) { +- return Vec3D.c((BaseBlockPosition) blockposition); ++ return Vec3D.c(blockposition); + } else { + return null; + } +@@ -161,7 +161,7 @@ public class RandomPositionGenerator { + if (Math.abs(d4) <= (double) i && Math.abs(d5) <= (double) i) { + int l = random.nextInt(2 * j + 1) - j + k; + +- return new BlockPosition(d4, (double) l, d5); ++ return new BlockPosition(d4, l, d5); + } else { + return null; + } +diff --git a/src/main/java/net/minecraft/server/RecipeBookServer.java b/src/main/java/net/minecraft/server/RecipeBookServer.java +index 03778e6381fe6b9d6264774fae7acba483474947..b83c0d07d93d1e02a801484aaae22be4366d5e85 100644 +--- a/src/main/java/net/minecraft/server/RecipeBookServer.java ++++ b/src/main/java/net/minecraft/server/RecipeBookServer.java +@@ -32,7 +32,7 @@ public class RecipeBookServer extends RecipeBook { + } + } + +- this.a(PacketPlayOutRecipes.Action.ADD, entityplayer, (List) list); ++ this.a(PacketPlayOutRecipes.Action.ADD, entityplayer, list); + return i; + } + +@@ -52,7 +52,7 @@ public class RecipeBookServer extends RecipeBook { + } + } + +- this.a(PacketPlayOutRecipes.Action.REMOVE, entityplayer, (List) list); ++ this.a(PacketPlayOutRecipes.Action.REMOVE, entityplayer, list); + return i; + } + +diff --git a/src/main/java/net/minecraft/server/RecipeItemStack.java b/src/main/java/net/minecraft/server/RecipeItemStack.java +index 43c86b27b811f1fe5e3578973637f8d9bd20d246..0f4a50ce6972da1d30dae82abc0c5781a7d2db2a 100644 +--- a/src/main/java/net/minecraft/server/RecipeItemStack.java ++++ b/src/main/java/net/minecraft/server/RecipeItemStack.java +@@ -21,8 +21,8 @@ public final class RecipeItemStack implements Predicate { + public boolean exact; // CraftBukkit + + public RecipeItemStack(Stream stream) { +- this.b = (RecipeItemStack.Provider[]) stream.toArray((i) -> { +- return new RecipeItemStack.Provider[i]; ++ this.b = stream.toArray((i) -> { ++ return new Provider[i]; + }); + } + +@@ -37,7 +37,7 @@ public final class RecipeItemStack implements Predicate { + } + } + } +- this.choices = (ItemStack[]) list.toArray(new ItemStack[0]); ++ this.choices = list.toArray(new ItemStack[0]); + } + + } +@@ -153,7 +153,7 @@ public final class RecipeItemStack implements Predicate { + + return b(Stream.generate(() -> { + return new RecipeItemStack.StackProvider(packetdataserializer.m()); +- }).limit((long) i)); ++ }).limit(i)); + } + + public static RecipeItemStack a(@Nullable JsonElement jsonelement) { +@@ -186,7 +186,7 @@ public final class RecipeItemStack implements Predicate { + + if (jsonobject.has("item")) { + minecraftkey = new MinecraftKey(ChatDeserializer.h(jsonobject, "item")); +- Item item = (Item) IRegistry.ITEM.getOptional(minecraftkey).orElseThrow(() -> { ++ Item item = IRegistry.ITEM.getOptional(minecraftkey).orElseThrow(() -> { + return new JsonSyntaxException("Unknown item '" + minecraftkey + "'"); + }); + +diff --git a/src/main/java/net/minecraft/server/RecipeSmithing.java b/src/main/java/net/minecraft/server/RecipeSmithing.java +index 02c972d6e882fba22fc3f0285244bb848ad443aa..9c095f0375c35eebe82bad64124aec959f1819cd 100644 +--- a/src/main/java/net/minecraft/server/RecipeSmithing.java ++++ b/src/main/java/net/minecraft/server/RecipeSmithing.java +@@ -81,8 +81,8 @@ public class RecipeSmithing implements IRecipe { + + @Override + public RecipeSmithing a(MinecraftKey minecraftkey, JsonObject jsonobject) { +- RecipeItemStack recipeitemstack = RecipeItemStack.a((JsonElement) ChatDeserializer.t(jsonobject, "base")); +- RecipeItemStack recipeitemstack1 = RecipeItemStack.a((JsonElement) ChatDeserializer.t(jsonobject, "addition")); ++ RecipeItemStack recipeitemstack = RecipeItemStack.a(ChatDeserializer.t(jsonobject, "base")); ++ RecipeItemStack recipeitemstack1 = RecipeItemStack.a(ChatDeserializer.t(jsonobject, "addition")); + ItemStack itemstack = ShapedRecipes.a(ChatDeserializer.t(jsonobject, "result")); + + return new RecipeSmithing(minecraftkey, recipeitemstack, recipeitemstack1, itemstack); +diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java +index 2a36e621898ea4b70184130d57fa7db72aa4486f..b2ca0f3bdb983af0afbdaf145d5d8dfda10facdd 100644 +--- a/src/main/java/net/minecraft/server/RegionFile.java ++++ b/src/main/java/net/minecraft/server/RegionFile.java +@@ -121,7 +121,7 @@ public class RegionFile implements AutoCloseable { + + // search the regionfile from start to finish for the most up-to-date chunk data + +- for (long i = 2, maxSector = Math.min((long)(Integer.MAX_VALUE >>> 8), totalSectors); i < maxSector; ++i) { // first two sectors are header, skip ++ for (long i = 2, maxSector = Math.min(Integer.MAX_VALUE >>> 8, totalSectors); i < maxSector; ++i) { // first two sectors are header, skip + int chunkDataLength = this.getLength(i); + NBTTagCompound compound = this.attemptRead(i, chunkDataLength, fileLength); + if (compound == null || compound == OVERSIZED_COMPOUND) { +@@ -409,7 +409,7 @@ public class RegionFile implements AutoCloseable { + initOversizedState(); + this.freeSectors = new RegionFileBitSet(); + this.e = regionfilecompression; +- if (!Files.isDirectory(java_nio_file_path1, new LinkOption[0])) { ++ if (!Files.isDirectory(java_nio_file_path1)) { + throw new IllegalArgumentException("Expected directory, got " + java_nio_file_path1.toAbsolutePath()); + } else { + this.d = java_nio_file_path1; +@@ -551,7 +551,7 @@ public class RegionFile implements AutoCloseable { + int l = k * 4096; + ByteBuffer bytebuffer = ByteBuffer.allocate(l); + +- this.dataFile.read(bytebuffer, (long) (j * 4096)); ++ this.dataFile.read(bytebuffer, j * 4096); + ((java.nio.Buffer) bytebuffer).flip(); + if (bytebuffer.remaining() < 5) { + // Tuinity start - recalculate header on regionfile corruption +@@ -634,7 +634,7 @@ public class RegionFile implements AutoCloseable { + private DataInputStream a(ChunkCoordIntPair chunkcoordintpair, byte b0) throws IOException { + java.nio.file.Path java_nio_file_path = this.e(chunkcoordintpair); + +- if (!Files.isRegularFile(java_nio_file_path, new LinkOption[0])) { ++ if (!Files.isRegularFile(java_nio_file_path)) { + RegionFile.LOGGER.error("External chunk path {} is not file", java_nio_file_path); + return null; + } else { +@@ -673,7 +673,7 @@ public class RegionFile implements AutoCloseable { + ByteBuffer bytebuffer = ByteBuffer.allocate(5); + + try { +- this.dataFile.read(bytebuffer, (long) (j * 4096)); ++ this.dataFile.read(bytebuffer, j * 4096); + ((java.nio.Buffer) bytebuffer).flip(); + if (bytebuffer.remaining() != 5) { + return false; +@@ -686,7 +686,7 @@ public class RegionFile implements AutoCloseable { + return false; + } + +- if (!Files.isRegularFile(this.e(chunkcoordintpair), new LinkOption[0])) { ++ if (!Files.isRegularFile(this.e(chunkcoordintpair))) { + return false; + } + } else { +@@ -715,7 +715,7 @@ public class RegionFile implements AutoCloseable { + } + + public DataOutputStream c(ChunkCoordIntPair chunkcoordintpair) throws IOException { +- return new DataOutputStream(new BufferedOutputStream(this.e.a((OutputStream) (new RegionFile.ChunkBuffer(chunkcoordintpair))))); ++ return new DataOutputStream(new BufferedOutputStream(this.e.a(new ChunkBuffer(chunkcoordintpair)))); + } + + public void a() throws IOException { +@@ -741,13 +741,13 @@ public class RegionFile implements AutoCloseable { + regionfile_b = this.a(java_nio_file_path, bytebuffer); + ByteBuffer bytebuffer1 = this.b(); + +- this.dataFile.write(bytebuffer1, (long) (k1 * 4096)); ++ this.dataFile.write(bytebuffer1, k1 * 4096); + } else { + k1 = this.freeSectors.a(j1); + regionfile_b = () -> { + Files.deleteIfExists(this.e(chunkcoordintpair)); + }; +- this.dataFile.write(bytebuffer, (long) (k1 * 4096)); ++ this.dataFile.write(bytebuffer, k1 * 4096); + } + + int l1 = (int) (SystemUtils.getTimeMillis() / 1000L); +@@ -777,7 +777,7 @@ public class RegionFile implements AutoCloseable { + } + + private RegionFile.b a(java.nio.file.Path java_nio_file_path, ByteBuffer bytebuffer) throws IOException { +- java.nio.file.Path java_nio_file_path1 = Files.createTempFile(this.d, "tmp", (String) null); ++ java.nio.file.Path java_nio_file_path1 = Files.createTempFile(this.d, "tmp", null); + FileChannel filechannel = FileChannel.open(java_nio_file_path1, StandardOpenOption.CREATE, StandardOpenOption.WRITE); + Throwable throwable = null; + +@@ -858,7 +858,7 @@ public class RegionFile implements AutoCloseable { + ByteBuffer bytebuffer = RegionFile.b.duplicate(); + + ((java.nio.Buffer) bytebuffer).position(0); +- this.dataFile.write(bytebuffer, (long) (j - 1)); ++ this.dataFile.write(bytebuffer, j - 1); + } + + } +diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java +index 50822874f484dc35c75195add9a478b23a4f96db..e44c727ed6b575f9a9d9e16eaef48aaba097724e 100644 +--- a/src/main/java/net/minecraft/server/RegionFileCache.java ++++ b/src/main/java/net/minecraft/server/RegionFileCache.java +@@ -62,7 +62,7 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final + public synchronized RegionFile getFile(ChunkCoordIntPair chunkcoordintpair, boolean existingOnly, boolean lock) throws IOException { + // Paper end + long i = ChunkCoordIntPair.pair(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()); +- RegionFile regionfile = (RegionFile) this.cache.getAndMoveToFirst(i); ++ RegionFile regionfile = this.cache.getAndMoveToFirst(i); + + if (regionfile != null) { + // Paper start +@@ -74,7 +74,7 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final + return regionfile; + } else { + if (this.cache.size() >= com.destroystokyo.paper.PaperConfig.regionFileCacheSize) { // Paper - configurable +- ((RegionFile) this.cache.removeLast()).close(); ++ this.cache.removeLast().close(); + } + + if (!this.b.exists()) { +diff --git a/src/main/java/net/minecraft/server/RegionFileCompression.java b/src/main/java/net/minecraft/server/RegionFileCompression.java +index a4c1eb60ab7349cb3146018642cc753f403b61d9..7aaea270a9414f79ab3f880a3aadc15ca634a832 100644 +--- a/src/main/java/net/minecraft/server/RegionFileCompression.java ++++ b/src/main/java/net/minecraft/server/RegionFileCompression.java +@@ -39,7 +39,7 @@ public class RegionFileCompression { + + @Nullable public static RegionFileCompression getByType(int type) { return RegionFileCompression.a(type); } // Tuinity - OBFHELPER + @Nullable public static RegionFileCompression a(int i) { // Tuinity - OBFHELPER +- return (RegionFileCompression) RegionFileCompression.d.get(i); ++ return RegionFileCompression.d.get(i); + } + + public static boolean b(int i) { +@@ -51,12 +51,12 @@ public class RegionFileCompression { + } + + public OutputStream a(OutputStream outputstream) throws IOException { +- return (OutputStream) this.g.wrap(outputstream); ++ return this.g.wrap(outputstream); + } + + public final InputStream wrap(InputStream inputstream) throws IOException { return this.a(inputstream); } // Tuinity - OBFHELPER + public InputStream a(InputStream inputstream) throws IOException { +- return (InputStream) this.f.wrap(inputstream); ++ return this.f.wrap(inputstream); + } + + @FunctionalInterface +diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java +index 41e1f7c8e22fadc7fe45e03f480f5ee9fef192b2..046ff8ec7f04089d913b561afb68e93120161b5a 100644 +--- a/src/main/java/net/minecraft/server/RegionFileSection.java ++++ b/src/main/java/net/minecraft/server/RegionFileSection.java +@@ -49,7 +49,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + + @Nullable + protected Optional c(long i) { +- return (Optional) this.c.get(i); ++ return this.c.get(i); + } + + protected Optional d(long i) { +@@ -66,7 +66,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + this.b(sectionposition.r()); + optional = this.c(i); + if (optional == null) { +- throw (IllegalStateException) SystemUtils.c(new IllegalStateException()); ++ throw SystemUtils.c(new IllegalStateException()); + } else { + return optional; + } +@@ -152,7 +152,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + + private void d(ChunkCoordIntPair chunkcoordintpair) { + Dynamic dynamic = this.a(chunkcoordintpair, DynamicOpsNBT.a); // Paper - conflict here to avoid adding obfhelpers :) +- NBTBase nbtbase = (NBTBase) dynamic.getValue(); ++ NBTBase nbtbase = dynamic.getValue(); + + if (nbtbase instanceof NBTTagCompound) { + try { this.write(chunkcoordintpair, (NBTTagCompound) nbtbase); } catch (IOException ioexception) { RegionFileSection.LOGGER.error("Error writing data to disk", ioexception); } // Paper - nuke IOWorker // TODO make this write async +@@ -165,7 +165,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + // Paper start - internal get data function, copied from above + private NBTTagCompound getDataInternal(ChunkCoordIntPair chunkcoordintpair) { + Dynamic dynamic = this.a(chunkcoordintpair, DynamicOpsNBT.a); +- NBTBase nbtbase = (NBTBase) dynamic.getValue(); ++ NBTBase nbtbase = dynamic.getValue(); + + if (nbtbase instanceof NBTTagCompound) { + return (NBTTagCompound)nbtbase; +@@ -183,7 +183,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + long j = SectionPosition.a(chunkcoordintpair, i).s(); + + this.d.remove(j); +- Optional optional = (Optional) this.c.get(j); ++ Optional optional = this.c.get(j); + + if (optional != null && optional.isPresent()) { + DataResult dataresult = ((Codec) this.e.apply(() -> { +@@ -205,7 +205,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + protected void b(long i) {} + + protected void a(long i) { +- Optional optional = (Optional) this.c.get(i); ++ Optional optional = this.c.get(i); + + if (optional != null && optional.isPresent()) { + this.d.add(i); +diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +index 43180bb5b7fb6de1455bbe11b25925e28bd04826..63228525274bea20814a2bced1cc9d018742258a 100644 +--- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java ++++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +@@ -32,12 +32,12 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed { + private final ChunkCoordIntPair o; + + public RegionLimitedWorldAccess(WorldServer worldserver, List list) { +- int i = MathHelper.floor(Math.sqrt((double) list.size())); ++ int i = MathHelper.floor(Math.sqrt(list.size())); + + if (i * i != list.size()) { +- throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Cache size is not a square.")); ++ throw SystemUtils.c(new IllegalStateException("Cache size is not a square.")); + } else { +- ChunkCoordIntPair chunkcoordintpair = ((IChunkAccess) list.get(list.size() / 2)).getPos(); ++ ChunkCoordIntPair chunkcoordintpair = list.get(list.size() / 2).getPos(); + + this.b = list; + this.c = chunkcoordintpair.x; +@@ -49,8 +49,8 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed { + this.i = worldserver.getRandom(); + this.j = worldserver.getDimensionManager(); + this.m = new BiomeManager(this, BiomeManager.a(this.g), worldserver.getDimensionManager().getGenLayerZoomer()); +- this.n = ((IChunkAccess) list.get(0)).getPos(); +- this.o = ((IChunkAccess) list.get(list.size() - 1)).getPos(); ++ this.n = list.get(0).getPos(); ++ this.o = list.get(list.size() - 1).getPos(); + } + } + +@@ -76,7 +76,7 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed { + int k = i - this.n.x; + int l = j - this.n.z; + +- ichunkaccess = (IChunkAccess) this.b.get(k + l * this.e); ++ ichunkaccess = this.b.get(k + l * this.e); + if (ichunkaccess.getChunkStatus().b(chunkstatus)) { + return ichunkaccess; + } +@@ -90,9 +90,9 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed { + RegionLimitedWorldAccess.LOGGER.error("Requested chunk : {} {}", i, j); + RegionLimitedWorldAccess.LOGGER.error("Region bounds : {} {} | {} {}", this.n.x, this.n.z, this.o.x, this.o.z); + if (ichunkaccess != null) { +- throw (RuntimeException) SystemUtils.c(new RuntimeException(String.format("Chunk is not of correct status. Expecting %s, got %s | %s %s", chunkstatus, ichunkaccess.getChunkStatus(), i, j))); ++ throw SystemUtils.c(new RuntimeException(String.format("Chunk is not of correct status. Expecting %s, got %s | %s %s", chunkstatus, ichunkaccess.getChunkStatus(), i, j))); + } else { +- throw (RuntimeException) SystemUtils.c(new RuntimeException(String.format("We are asking a region for a chunk out of bound | %s %s", i, j))); ++ throw SystemUtils.c(new RuntimeException(String.format("We are asking a region for a chunk out of bound | %s %s", i, j))); + } + } + } +diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java +index 636709f303401e528a539837917dac959d7e383b..8cc154f543aca12ee648441e865ec21013e3b7de 100644 +--- a/src/main/java/net/minecraft/server/RegistryBlockID.java ++++ b/src/main/java/net/minecraft/server/RegistryBlockID.java +@@ -43,7 +43,7 @@ public class RegistryBlockID implements Registry { + } + + public int getId(T t0) { +- Integer integer = (Integer) this.b.get(t0); ++ Integer integer = this.b.get(t0); + + return integer == null ? -1 : integer; + } +diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java +index 7cf11307b18d66186bc592568f2ea0833a57faab..aa78cd0e6388614843c4c358a133a9a7e4df99fb 100644 +--- a/src/main/java/net/minecraft/server/RegistryID.java ++++ b/src/main/java/net/minecraft/server/RegistryID.java +@@ -159,8 +159,8 @@ public class RegistryID implements Registry { + } + + public void a() { +- Arrays.fill(this.b, (Object) null); +- Arrays.fill(this.d, (Object) null); ++ Arrays.fill(this.b, null); ++ Arrays.fill(this.d, null); + this.e = 0; + this.f = 0; + this.usedIds.clear(); // Paper +diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java +index 075e250f451f64b91e748d42fdf4ceed91bf4667..1e7f424a942caadc8db650895674de41f1b4c81a 100644 +--- a/src/main/java/net/minecraft/server/RegistryMaterials.java ++++ b/src/main/java/net/minecraft/server/RegistryMaterials.java +@@ -55,7 +55,7 @@ public class RegistryMaterials extends IRegistryWritable { + @Nullable + @Override + public MinecraftKey getKey(T t0) { +- return (MinecraftKey) this.c.inverse().get(t0); ++ return this.c.inverse().get(t0); + } + + @Override +@@ -147,7 +147,7 @@ public class RegistryMaterials extends IRegistryWritable { + while (iterator.hasNext()) { + Pair, T> pair = (Pair) iterator.next(); + +- registrymaterials.a((ResourceKey) pair.getFirst(), pair.getSecond()); ++ registrymaterials.a(pair.getFirst(), pair.getSecond()); + } + + return registrymaterials; +diff --git a/src/main/java/net/minecraft/server/RemoteControlCommandListener.java b/src/main/java/net/minecraft/server/RemoteControlCommandListener.java +index fbb8cde603b7cd916d2b6323dcaba38f2615c7d7..b8413f744406791963933d03caca9a918ee98ebc 100644 +--- a/src/main/java/net/minecraft/server/RemoteControlCommandListener.java ++++ b/src/main/java/net/minecraft/server/RemoteControlCommandListener.java +@@ -23,7 +23,7 @@ public class RemoteControlCommandListener implements ICommandListener { + public CommandListenerWrapper getWrapper() { + WorldServer worldserver = this.server.D(); + +- return new CommandListenerWrapper(this, Vec3D.b((BaseBlockPosition) worldserver.getSpawn()), Vec2F.a, worldserver, 4, "Rcon", RemoteControlCommandListener.b, this.server, (Entity) null); ++ return new CommandListenerWrapper(this, Vec3D.b(worldserver.getSpawn()), Vec2F.a, worldserver, 4, "Rcon", RemoteControlCommandListener.b, this.server, null); + } + + // CraftBukkit start - Send a String +diff --git a/src/main/java/net/minecraft/server/Reputation.java b/src/main/java/net/minecraft/server/Reputation.java +index 8c155b4a649b783996161991f04f7a130d354666..e0743e55e86c1fbb57ffb402c3fea084de72242c 100644 +--- a/src/main/java/net/minecraft/server/Reputation.java ++++ b/src/main/java/net/minecraft/server/Reputation.java +@@ -37,7 +37,7 @@ public class Reputation { + + private Stream c() { + return this.a.entrySet().stream().flatMap((entry) -> { +- return ((Reputation.a) entry.getValue()).a((UUID) entry.getKey()); ++ return entry.getValue().a(entry.getKey()); + }); + } + +@@ -64,7 +64,7 @@ public class Reputation { + int j = 0; + + for (int k = 0; k < list.size(); ++k) { +- Reputation.b reputation_b = (Reputation.b) list.get(k); ++ Reputation.b reputation_b = list.get(k); + + j += Math.abs(reputation_b.a()); + aint[k] = j - 1; +@@ -84,8 +84,8 @@ public class Reputation { + } + + private Reputation.a a(UUID uuid) { +- return (Reputation.a) this.a.computeIfAbsent(uuid, (uuid1) -> { +- return new Reputation.a(); ++ return this.a.computeIfAbsent(uuid, (uuid1) -> { ++ return new a(); + }); + } + +@@ -103,7 +103,7 @@ public class Reputation { + } + + public int a(UUID uuid, Predicate predicate) { +- Reputation.a reputation_a = (Reputation.a) this.a.get(uuid); ++ Reputation.a reputation_a = this.a.get(uuid); + + return reputation_a != null ? reputation_a.a(predicate) : 0; + } +@@ -175,7 +175,7 @@ public class Reputation { + + public Stream a(UUID uuid) { + return this.a.object2IntEntrySet().stream().map((entry) -> { +- return new Reputation.b(uuid, (ReputationType) entry.getKey(), entry.getIntValue()); ++ return new Reputation.b(uuid, entry.getKey(), entry.getIntValue()); + }); + } + +@@ -184,7 +184,7 @@ public class Reputation { + + while (objectiterator.hasNext()) { + Entry entry = (Entry) objectiterator.next(); +- int i = entry.getIntValue() - ((ReputationType) entry.getKey()).i; ++ int i = entry.getIntValue() - entry.getKey().i; + + if (i < 2) { + objectiterator.remove(); +diff --git a/src/main/java/net/minecraft/server/ReputationType.java b/src/main/java/net/minecraft/server/ReputationType.java +index 35b9248af248f0a37013d9f938c29ca779903c23..4bae4afebecb98e63b1efa983f0d0997f4b6977f 100644 +--- a/src/main/java/net/minecraft/server/ReputationType.java ++++ b/src/main/java/net/minecraft/server/ReputationType.java +@@ -16,7 +16,7 @@ public enum ReputationType { + public final int h; + public final int i; + public final int j; +- private static final Map k = (Map) Stream.of(values()).collect(ImmutableMap.toImmutableMap((reputationtype) -> { ++ private static final Map k = Stream.of(values()).collect(ImmutableMap.toImmutableMap((reputationtype) -> { + return reputationtype.f; + }, Function.identity())); + +@@ -30,6 +30,6 @@ public enum ReputationType { + + @Nullable + public static ReputationType a(String s) { +- return (ReputationType) ReputationType.k.get(s); ++ return ReputationType.k.get(s); + } + } +diff --git a/src/main/java/net/minecraft/server/SaddleStorage.java b/src/main/java/net/minecraft/server/SaddleStorage.java +index 4c558da0e0ea3e6269c6d682349e4a8cd7a0e83b..f5bfcedef32dd996485cf85f9dd2f10cb9d2c394 100644 +--- a/src/main/java/net/minecraft/server/SaddleStorage.java ++++ b/src/main/java/net/minecraft/server/SaddleStorage.java +@@ -20,7 +20,7 @@ public class SaddleStorage { + public void a() { + this.a = true; + this.b = 0; +- this.c = (Integer) this.d.get(this.e); ++ this.c = this.d.get(this.e); + } + + public boolean a(Random random) { +@@ -57,6 +57,6 @@ public class SaddleStorage { + } + + public boolean hasSaddle() { +- return (Boolean) this.d.get(this.f); ++ return this.d.get(this.f); + } + } +diff --git a/src/main/java/net/minecraft/server/ScoreboardServer.java b/src/main/java/net/minecraft/server/ScoreboardServer.java +index cf15f7038ab4c392623b39ef676d3a24227f6e51..3bbabe64acff9ea947e76e8e57303067268bb238 100644 +--- a/src/main/java/net/minecraft/server/ScoreboardServer.java ++++ b/src/main/java/net/minecraft/server/ScoreboardServer.java +@@ -32,7 +32,7 @@ public class ScoreboardServer extends Scoreboard { + @Override + public void handlePlayerRemoved(String s) { + super.handlePlayerRemoved(s); +- this.sendAll(new PacketPlayOutScoreboardScore(ScoreboardServer.Action.REMOVE, (String) null, s, 0)); ++ this.sendAll(new PacketPlayOutScoreboardScore(ScoreboardServer.Action.REMOVE, null, s, 0)); + this.b(); + } + +@@ -136,7 +136,7 @@ public class ScoreboardServer extends Scoreboard { + } + + public void a(Runnable runnable) { +- this.c = (Runnable[]) Arrays.copyOf(this.c, this.c.length + 1); ++ this.c = Arrays.copyOf(this.c, this.c.length + 1); + this.c[this.c.length - 1] = runnable; + } + +@@ -240,7 +240,7 @@ public class ScoreboardServer extends Scoreboard { + + // CraftBukkit start - Send to players + private void sendAll(Packet packet) { +- for (EntityPlayer entityplayer : (List) this.a.getPlayerList().players) { ++ for (EntityPlayer entityplayer : this.a.getPlayerList().players) { + if (entityplayer.getBukkitEntity().getScoreboard().getHandle() == this) { + entityplayer.playerConnection.sendPacket(packet); + } +diff --git a/src/main/java/net/minecraft/server/SectionPosition.java b/src/main/java/net/minecraft/server/SectionPosition.java +index 7806f3c351cba3f0388da11888f900c48004dadf..bba26f988c34c675ca6d570033848816546967bb 100644 +--- a/src/main/java/net/minecraft/server/SectionPosition.java ++++ b/src/main/java/net/minecraft/server/SectionPosition.java +@@ -162,7 +162,7 @@ public class SectionPosition extends BaseBlockPosition { + } + + public static Stream a(final int i, final int j, final int k, final int l, final int i1, final int j1) { +- return StreamSupport.stream(new AbstractSpliterator((long) ((l - i + 1) * (i1 - j + 1) * (j1 - k + 1)), 64) { ++ return StreamSupport.stream(new AbstractSpliterator((l - i + 1) * (i1 - j + 1) * (j1 - k + 1), 64) { + final CursorPosition a = new CursorPosition(i, j, k, l, i1, j1); + + public boolean tryAdvance(Consumer consumer) { +diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java +index d8efb35f1c22c1ed495461d73f2ec124ce542e24..0d367548a88212a827db8d7dc3c613ff81c54c71 100644 +--- a/src/main/java/net/minecraft/server/ServerConnection.java ++++ b/src/main/java/net/minecraft/server/ServerConnection.java +@@ -68,7 +68,7 @@ public class ServerConnection { + ServerConnection.LOGGER.info("Using default channel type"); + } + +- this.listeningChannels.add(((ServerBootstrap) ((ServerBootstrap) (new ServerBootstrap()).channel(oclass)).childHandler(new ChannelInitializer() { ++ this.listeningChannels.add((new ServerBootstrap()).channel(oclass).childHandler(new ChannelInitializer() { + protected void initChannel(Channel channel) throws Exception { + try { + channel.config().setOption(ChannelOption.TCP_NODELAY, true); +@@ -84,7 +84,7 @@ public class ServerConnection { + channel.pipeline().addLast("packet_handler", networkmanager); + networkmanager.setPacketListener(new HandshakeListener(ServerConnection.this.e, networkmanager)); + } +- }).group((EventLoopGroup) lazyinitvar.a()).localAddress(inetaddress, i)).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit ++ }).group((EventLoopGroup) lazyinitvar.a()).localAddress(inetaddress, i).option(ChannelOption.AUTO_READ, false).bind().syncUninterruptibly()); // CraftBukkit + } + } + +diff --git a/src/main/java/net/minecraft/server/ServerGUI.java b/src/main/java/net/minecraft/server/ServerGUI.java +index fe87c689d774666c0d39af80ca54aba259e954e6..478d2b5f5b2ba9bf12c536213494b39b7b042aca 100644 +--- a/src/main/java/net/minecraft/server/ServerGUI.java ++++ b/src/main/java/net/minecraft/server/ServerGUI.java +@@ -41,7 +41,7 @@ public class ServerGUI extends JComponent { + jframe.setDefaultCloseOperation(2); + jframe.add(servergui); + jframe.pack(); +- jframe.setLocationRelativeTo((Component) null); ++ jframe.setLocationRelativeTo(null); + jframe.setVisible(true); + jframe.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent windowevent) { +@@ -165,7 +165,7 @@ public class ServerGUI extends JComponent { + } + + try { +- document.insertString(document.getLength(), ANSI.matcher(s).replaceAll(""), (AttributeSet) null); // CraftBukkit ++ document.insertString(document.getLength(), ANSI.matcher(s).replaceAll(""), null); // CraftBukkit + } catch (BadLocationException badlocationexception) { + ; + } +diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java +index e5b69c561f3ff2e76351f784d970f77d381f284d..9b93843b2a7bd303af7c272b41e18bc04f7c18dc 100644 +--- a/src/main/java/net/minecraft/server/ServerPing.java ++++ b/src/main/java/net/minecraft/server/ServerPing.java +@@ -57,15 +57,15 @@ public class ServerPing { + ServerPing serverping = new ServerPing(); + + if (jsonobject.has("description")) { +- serverping.setMOTD((IChatBaseComponent) jsondeserializationcontext.deserialize(jsonobject.get("description"), IChatBaseComponent.class)); ++ serverping.setMOTD(jsondeserializationcontext.deserialize(jsonobject.get("description"), IChatBaseComponent.class)); + } + + if (jsonobject.has("players")) { +- serverping.setPlayerSample((ServerPing.ServerPingPlayerSample) jsondeserializationcontext.deserialize(jsonobject.get("players"), ServerPing.ServerPingPlayerSample.class)); ++ serverping.setPlayerSample(jsondeserializationcontext.deserialize(jsonobject.get("players"), ServerPingPlayerSample.class)); + } + + if (jsonobject.has("version")) { +- serverping.setServerInfo((ServerPing.ServerData) jsondeserializationcontext.deserialize(jsonobject.get("version"), ServerPing.ServerData.class)); ++ serverping.setServerInfo(jsondeserializationcontext.deserialize(jsonobject.get("version"), ServerData.class)); + } + + if (jsonobject.has("favicon")) { +diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java +index 48a6f61bfd7408f2bdebcdd9bf07bde1c750209a..9762d26791a0c5993e1ec2bdaa568fcb42694a3e 100644 +--- a/src/main/java/net/minecraft/server/ServerStatisticManager.java ++++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java +@@ -180,15 +180,15 @@ public class ServerStatisticManager extends StatisticManager { + + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); +- JsonElement jsonelement = (JsonElement) entry.getValue(); ++ JsonElement jsonelement = entry.getValue(); + + if (jsonelement.isJsonObject()) { +- nbttagcompound.set((String) entry.getKey(), a(jsonelement.getAsJsonObject())); ++ nbttagcompound.set(entry.getKey(), a(jsonelement.getAsJsonObject())); + } else if (jsonelement.isJsonPrimitive()) { + JsonPrimitive jsonprimitive = jsonelement.getAsJsonPrimitive(); + + if (jsonprimitive.isNumber()) { +- nbttagcompound.setInt((String) entry.getKey(), jsonprimitive.getAsInt()); ++ nbttagcompound.setInt(entry.getKey(), jsonprimitive.getAsInt()); + } + } + } +@@ -202,11 +202,11 @@ public class ServerStatisticManager extends StatisticManager { + + while (objectiterator.hasNext()) { + it.unimi.dsi.fastutil.objects.Object2IntMap.Entry> it_unimi_dsi_fastutil_objects_object2intmap_entry = (it.unimi.dsi.fastutil.objects.Object2IntMap.Entry) objectiterator.next(); +- Statistic statistic = (Statistic) it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey(); ++ Statistic statistic = it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey(); + +- ((JsonObject) map.computeIfAbsent(statistic.getWrapper(), (statisticwrapper) -> { ++ map.computeIfAbsent(statistic.getWrapper(), (statisticwrapper) -> { + return new JsonObject(); +- })).addProperty(b(statistic).toString(), it_unimi_dsi_fastutil_objects_object2intmap_entry.getIntValue()); ++ }).addProperty(b(statistic).toString(), it_unimi_dsi_fastutil_objects_object2intmap_entry.getIntValue()); + } + + JsonObject jsonobject = new JsonObject(); +@@ -215,7 +215,7 @@ public class ServerStatisticManager extends StatisticManager { + while (iterator.hasNext()) { + Entry, JsonObject> entry = (Entry) iterator.next(); + +- jsonobject.add(IRegistry.STATS.getKey(entry.getKey()).toString(), (JsonElement) entry.getValue()); ++ jsonobject.add(IRegistry.STATS.getKey(entry.getKey()).toString(), entry.getValue()); + } + + JsonObject jsonobject1 = new JsonObject(); +diff --git a/src/main/java/net/minecraft/server/ShapedRecipes.java b/src/main/java/net/minecraft/server/ShapedRecipes.java +index 05e39e5a9a6d8a89a4087429b7944de74d94dab1..f2aa061b3024fd8adc329356c03725bd294787d1 100644 +--- a/src/main/java/net/minecraft/server/ShapedRecipes.java ++++ b/src/main/java/net/minecraft/server/ShapedRecipes.java +@@ -138,9 +138,9 @@ public class ShapedRecipes implements RecipeCrafting { + + if (i1 >= 0 && j1 >= 0 && i1 < this.width && j1 < this.height) { + if (flag) { +- recipeitemstack = (RecipeItemStack) this.items.get(this.width - i1 - 1 + j1 * this.width); ++ recipeitemstack = this.items.get(this.width - i1 - 1 + j1 * this.width); + } else { +- recipeitemstack = (RecipeItemStack) this.items.get(i1 + j1 * this.width); ++ recipeitemstack = this.items.get(i1 + j1 * this.width); + } + } + +@@ -174,7 +174,7 @@ public class ShapedRecipes implements RecipeCrafting { + for (int k = 0; k < astring.length; ++k) { + for (int l = 0; l < astring[k].length(); ++l) { + String s = astring[k].substring(l, l + 1); +- RecipeItemStack recipeitemstack = (RecipeItemStack) map.get(s); ++ RecipeItemStack recipeitemstack = map.get(s); + + if (recipeitemstack == null) { + throw new JsonSyntaxException("Pattern references symbol '" + s + "' but it's not defined in the key"); +@@ -283,15 +283,15 @@ public class ShapedRecipes implements RecipeCrafting { + while (iterator.hasNext()) { + Entry entry = (Entry) iterator.next(); + +- if (((String) entry.getKey()).length() != 1) { +- throw new JsonSyntaxException("Invalid key entry: '" + (String) entry.getKey() + "' is an invalid symbol (must be 1 character only)."); ++ if (entry.getKey().length() != 1) { ++ throw new JsonSyntaxException("Invalid key entry: '" + entry.getKey() + "' is an invalid symbol (must be 1 character only)."); + } + + if (" ".equals(entry.getKey())) { + throw new JsonSyntaxException("Invalid key entry: ' ' is a reserved symbol."); + } + +- map.put(entry.getKey(), RecipeItemStack.a((JsonElement) entry.getValue())); ++ map.put(entry.getKey(), RecipeItemStack.a(entry.getValue())); + } + + map.put(" ", RecipeItemStack.a); +@@ -300,14 +300,14 @@ public class ShapedRecipes implements RecipeCrafting { + + public static ItemStack a(JsonObject jsonobject) { + String s = ChatDeserializer.h(jsonobject, "item"); +- Item item = (Item) IRegistry.ITEM.getOptional(new MinecraftKey(s)).orElseThrow(() -> { ++ Item item = IRegistry.ITEM.getOptional(new MinecraftKey(s)).orElseThrow(() -> { + return new JsonSyntaxException("Unknown item '" + s + "'"); + }); + + if (jsonobject.has("data")) { + throw new JsonParseException("Disallowed data tag found"); + } else { +- int i = ChatDeserializer.a(jsonobject, "count", (int) 1); ++ int i = ChatDeserializer.a(jsonobject, "count", 1); + + return new ItemStack(item, i); + } +diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java +index 600b508846d2e6654c74b61b04b7ef9c6095e856..3a01220df4bedf1f56aa5885550234d103e8bb6b 100644 +--- a/src/main/java/net/minecraft/server/SpawnerCreature.java ++++ b/src/main/java/net/minecraft/server/SpawnerCreature.java +@@ -26,7 +26,7 @@ public final class SpawnerCreature { + list.add(enumcreaturetype); + } + } +- c = (EnumCreatureType[]) list.toArray(new EnumCreatureType[0]); ++ c = list.toArray(new EnumCreatureType[0]); + } + + public static SpawnerCreature.d a(int i, Iterable iterable, SpawnerCreature.b spawnercreature_b) { +@@ -75,7 +75,7 @@ public final class SpawnerCreature { + object2intopenhashmap.addTo(enumcreaturetype, 1); + // Paper start + if (countMobs) { +- ((WorldServer)chunk.world).getChunkProvider().playerChunkMap.updatePlayerMobTypeMap(entity); ++ chunk.world.getChunkProvider().playerChunkMap.updatePlayerMobTypeMap(entity); + } + // Paper end + }); +@@ -179,7 +179,7 @@ public final class SpawnerCreature { + BlockPosition blockposition = getRandomPosition(worldserver, chunk); + + if (blockposition.getY() >= 1) { +- return spawnMobsInternal(enumcreaturetype, worldserver, (IChunkAccess) chunk, blockposition, spawnercreature_c, spawnercreature_a, maxSpawns, trackEntity); ++ return spawnMobsInternal(enumcreaturetype, worldserver, chunk, blockposition, spawnercreature_c, spawnercreature_a, maxSpawns, trackEntity); + } + return 0; // Paper + } +@@ -220,14 +220,14 @@ public final class SpawnerCreature { + blockposition_mutableblockposition.d(l, i, i1); + double d0 = (double) l + 0.5D; + double d1 = (double) i1 + 0.5D; +- EntityHuman entityhuman = worldserver.a(d0, (double) i, d1, -1.0D, false); ++ EntityHuman entityhuman = worldserver.a(d0, i, d1, -1.0D, false); + + if (entityhuman != null) { +- double d2 = entityhuman.g(d0, (double) i, d1); ++ double d2 = entityhuman.g(d0, i, d1); + + if (a(worldserver, ichunkaccess, blockposition_mutableblockposition, d2) && worldserver.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn + if (biomebase_biomemeta == null) { +- biomebase_biomemeta = a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, worldserver.random, (BlockPosition) blockposition_mutableblockposition); ++ biomebase_biomemeta = a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, worldserver.random, blockposition_mutableblockposition); + if (biomebase_biomemeta == null) { + break label53; + } +@@ -247,9 +247,9 @@ public final class SpawnerCreature { + return j; // Paper + } + +- entityinsentient.setPositionRotation(d0, (double) i, d1, worldserver.random.nextFloat() * 360.0F, 0.0F); ++ entityinsentient.setPositionRotation(d0, i, d1, worldserver.random.nextFloat() * 360.0F, 0.0F); + if (a(worldserver, entityinsentient, d2)) { +- groupdataentity = entityinsentient.prepare(worldserver, worldserver.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null); ++ groupdataentity = entityinsentient.prepare(worldserver, worldserver.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.NATURAL, groupdataentity, null); + // CraftBukkit start + if (worldserver.addEntity(entityinsentient, SpawnReason.NATURAL)) { + ++j; // Paper - force diff on name change - we expect this to be the total amount spawned +@@ -291,7 +291,7 @@ public final class SpawnerCreature { + private static boolean a(WorldServer worldserver, IChunkAccess ichunkaccess, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) { + if (d0 <= 576.0D) { + return false; +- } else if (worldserver.getSpawn().a((IPosition) (new Vec3D((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D)), 24.0D)) { ++ } else if (worldserver.getSpawn().a(new Vec3D((double) blockposition_mutableblockposition.getX() + 0.5D, blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D), 24.0D)) { + return false; + } else { + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition_mutableblockposition); +@@ -323,10 +323,10 @@ public final class SpawnerCreature { + return false; + } else if (!entitytypes.d() && d0 > (double) (entitytypes.e().f() * entitytypes.e().f())) { + return false; +- } else if (entitytypes.b() && a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) { ++ } else if (entitytypes.b() && a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, biomebase_biomemeta, blockposition_mutableblockposition)) { + EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(entitytypes); + +- return !a(entitypositiontypes_surface, (IWorldReader) worldserver, blockposition_mutableblockposition, entitytypes) ? false : (!EntityPositionTypes.a(entitytypes, worldserver, EnumMobSpawn.NATURAL, blockposition_mutableblockposition, worldserver.random) ? false : worldserver.b(entitytypes.a((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D))); ++ return !a(entitypositiontypes_surface, worldserver, blockposition_mutableblockposition, entitytypes) ? false : (!EntityPositionTypes.a(entitytypes, worldserver, EnumMobSpawn.NATURAL, blockposition_mutableblockposition, worldserver.random) ? false : worldserver.b(entitytypes.a((double) blockposition_mutableblockposition.getX() + 0.5D, blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D))); + } else { + return false; + } +@@ -335,7 +335,7 @@ public final class SpawnerCreature { + @Nullable + private static EntityInsentient a(WorldServer worldserver, EntityTypes entitytypes) { + try { +- Entity entity = entitytypes.a((World) worldserver); ++ Entity entity = entitytypes.a(worldserver); + + if (!(entity instanceof EntityInsentient)) { + throw new IllegalStateException("Trying to spawn a non-mob: " + IRegistry.ENTITY_TYPE.getKey(entitytypes)); +@@ -352,7 +352,7 @@ public final class SpawnerCreature { + } + + private static boolean a(WorldServer worldserver, EntityInsentient entityinsentient, double d0) { +- return d0 > (double) (entityinsentient.getEntityType().e().f() * entityinsentient.getEntityType().e().f()) && entityinsentient.isTypeNotPersistent(d0) ? false : entityinsentient.a((GeneratorAccess) worldserver, EnumMobSpawn.NATURAL) && entityinsentient.a((IWorldReader) worldserver); ++ return d0 > (double) (entityinsentient.getEntityType().e().f() * entityinsentient.getEntityType().e().f()) && entityinsentient.isTypeNotPersistent(d0) ? false : entityinsentient.a(worldserver, EnumMobSpawn.NATURAL) && entityinsentient.a((IWorldReader) worldserver); + } + + @Nullable +@@ -364,12 +364,12 @@ public final class SpawnerCreature { + } else { + List list = a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, blockposition, biomebase); + +- return list.isEmpty() ? null : (BiomeBase.BiomeMeta) WeightedRandom.a(random, list); ++ return list.isEmpty() ? null : WeightedRandom.a(random, list); + } + } + + private static boolean a(WorldServer worldserver, StructureManager structuremanager, ChunkGenerator chunkgenerator, EnumCreatureType enumcreaturetype, BiomeBase.BiomeMeta biomebase_biomemeta, BlockPosition blockposition) { +- return a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, blockposition, (BiomeBase) null).contains(biomebase_biomemeta); ++ return a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, blockposition, null).contains(biomebase_biomemeta); + } + + private static List a(WorldServer worldserver, StructureManager structuremanager, ChunkGenerator chunkgenerator, EnumCreatureType enumcreaturetype, BlockPosition blockposition, @Nullable BiomeBase biomebase) { +@@ -387,7 +387,7 @@ public final class SpawnerCreature { + } + + public static boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid, EntityTypes entitytypes) { +- return iblockdata.r(iblockaccess, blockposition) ? false : (iblockdata.isPowerSource() ? false : (!fluid.isEmpty() ? false : (iblockdata.a((Tag) TagsBlock.PREVENT_MOB_SPAWNING_INSIDE) ? false : !entitytypes.a(iblockdata)))); ++ return iblockdata.r(iblockaccess, blockposition) ? false : (iblockdata.isPowerSource() ? false : (!fluid.isEmpty() ? false : (iblockdata.a(TagsBlock.PREVENT_MOB_SPAWNING_INSIDE) ? false : !entitytypes.a(iblockdata)))); + } + + public static boolean a(EntityPositionTypes.Surface entitypositiontypes_surface, IWorldReader iworldreader, BlockPosition blockposition, @Nullable EntityTypes entitytypes) { +@@ -401,14 +401,14 @@ public final class SpawnerCreature { + + switch (entitypositiontypes_surface) { + case IN_WATER: +- return fluid.a((Tag) TagsFluid.WATER) && iworldreader.getFluid(blockposition2).a((Tag) TagsFluid.WATER) && !iworldreader.getType(blockposition1).isOccluding(iworldreader, blockposition1); ++ return fluid.a(TagsFluid.WATER) && iworldreader.getFluid(blockposition2).a(TagsFluid.WATER) && !iworldreader.getType(blockposition1).isOccluding(iworldreader, blockposition1); + case IN_LAVA: +- return fluid.a((Tag) TagsFluid.LAVA); ++ return fluid.a(TagsFluid.LAVA); + case ON_GROUND: + default: + IBlockData iblockdata1 = iworldreader.getType(blockposition2); + +- return !iblockdata1.a((IBlockAccess) iworldreader, blockposition2, entitytypes) ? false : a((IBlockAccess) iworldreader, blockposition, iblockdata, fluid, entitytypes) && a((IBlockAccess) iworldreader, blockposition1, iworldreader.getType(blockposition1), iworldreader.getFluid(blockposition1), entitytypes); ++ return !iblockdata1.a(iworldreader, blockposition2, entitytypes) ? false : a(iworldreader, blockposition, iblockdata, fluid, entitytypes) && a(iworldreader, blockposition1, iworldreader.getType(blockposition1), iworldreader.getFluid(blockposition1), entitytypes); + } + } else { + return false; +@@ -423,7 +423,7 @@ public final class SpawnerCreature { + int l = j << 4; + + while (random.nextFloat() < biomebase.f()) { +- BiomeBase.BiomeMeta biomebase_biomemeta = (BiomeBase.BiomeMeta) WeightedRandom.a(random, list); ++ BiomeBase.BiomeMeta biomebase_biomemeta = WeightedRandom.a(random, list); + int i1 = biomebase_biomemeta.d + random.nextInt(1 + biomebase_biomemeta.e - biomebase_biomemeta.d); + GroupDataEntity groupdataentity = null; + int j1 = k + random.nextInt(16); +@@ -437,12 +437,12 @@ public final class SpawnerCreature { + for (int k2 = 0; !flag && k2 < 4; ++k2) { + BlockPosition blockposition = a(generatoraccess, biomebase_biomemeta.c, j1, k1); + +- if (biomebase_biomemeta.c.b() && a(EntityPositionTypes.a(biomebase_biomemeta.c), (IWorldReader) generatoraccess, blockposition, biomebase_biomemeta.c)) { ++ if (biomebase_biomemeta.c.b() && a(EntityPositionTypes.a(biomebase_biomemeta.c), generatoraccess, blockposition, biomebase_biomemeta.c)) { + float f = biomebase_biomemeta.c.j(); +- double d0 = MathHelper.a((double) j1, (double) k + (double) f, (double) k + 16.0D - (double) f); +- double d1 = MathHelper.a((double) k1, (double) l + (double) f, (double) l + 16.0D - (double) f); ++ double d0 = MathHelper.a(j1, (double) k + (double) f, (double) k + 16.0D - (double) f); ++ double d1 = MathHelper.a(k1, (double) l + (double) f, (double) l + 16.0D - (double) f); + +- if (!generatoraccess.b(biomebase_biomemeta.c.a(d0, (double) blockposition.getY(), d1)) || !EntityPositionTypes.a(biomebase_biomemeta.c, generatoraccess, EnumMobSpawn.CHUNK_GENERATION, new BlockPosition(d0, (double) blockposition.getY(), d1), generatoraccess.getRandom())) { ++ if (!generatoraccess.b(biomebase_biomemeta.c.a(d0, blockposition.getY(), d1)) || !EntityPositionTypes.a(biomebase_biomemeta.c, generatoraccess, EnumMobSpawn.CHUNK_GENERATION, new BlockPosition(d0, blockposition.getY(), d1), generatoraccess.getRandom())) { + continue; + } + +@@ -456,12 +456,12 @@ public final class SpawnerCreature { + continue; + } + +- entity.setPositionRotation(d0, (double) blockposition.getY(), d1, random.nextFloat() * 360.0F, 0.0F); ++ entity.setPositionRotation(d0, blockposition.getY(), d1, random.nextFloat() * 360.0F, 0.0F); + if (entity instanceof EntityInsentient) { + EntityInsentient entityinsentient = (EntityInsentient) entity; + +- if (entityinsentient.a(generatoraccess, EnumMobSpawn.CHUNK_GENERATION) && entityinsentient.a((IWorldReader) generatoraccess)) { +- groupdataentity = entityinsentient.prepare(generatoraccess, generatoraccess.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.CHUNK_GENERATION, groupdataentity, (NBTTagCompound) null); ++ if (entityinsentient.a(generatoraccess, EnumMobSpawn.CHUNK_GENERATION) && entityinsentient.a(generatoraccess)) { ++ groupdataentity = entityinsentient.prepare(generatoraccess, generatoraccess.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.CHUNK_GENERATION, groupdataentity, null); + generatoraccess.addEntity(entityinsentient, SpawnReason.CHUNK_GEN); // CraftBukkit + flag = true; + } +@@ -497,7 +497,7 @@ public final class SpawnerCreature { + if (EntityPositionTypes.a(entitytypes) == EntityPositionTypes.Surface.ON_GROUND) { + BlockPosition blockposition = blockposition_mutableblockposition.down(); + +- if (iworldreader.getType(blockposition).a((IBlockAccess) iworldreader, blockposition, PathMode.LAND)) { ++ if (iworldreader.getType(blockposition).a(iworldreader, blockposition, PathMode.LAND)) { + return blockposition; + } + } +diff --git a/src/main/java/net/minecraft/server/StatisticWrapper.java b/src/main/java/net/minecraft/server/StatisticWrapper.java +index 795ea6fece2e28645e99f4578e26a6d12b4c1bf8..baf69c3471302ae8cb192b070f94bfa44c81658c 100644 +--- a/src/main/java/net/minecraft/server/StatisticWrapper.java ++++ b/src/main/java/net/minecraft/server/StatisticWrapper.java +@@ -14,7 +14,7 @@ public class StatisticWrapper implements Iterable> { + } + + public Statistic a(T t0, Counter counter) { +- return (Statistic) this.b.computeIfAbsent(t0, (object) -> { ++ return this.b.computeIfAbsent(t0, (object) -> { + return new Statistic<>(this, object, counter); + }); + } +diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java +index f9200b8e6f915b401dc35ac88da31948b18aa551..35975233c6fef6455c72682fabb0c7f0be752ad0 100644 +--- a/src/main/java/net/minecraft/server/StructureGenerator.java ++++ b/src/main/java/net/minecraft/server/StructureGenerator.java +@@ -27,7 +27,7 @@ public abstract class StructureGenerator + public static final StructureGenerator IGLOO = a("Igloo", new WorldGenFeatureIgloo(WorldGenFeatureEmptyConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES); + public static final StructureGenerator RUINED_PORTAL = a("Ruined_Portal", new WorldGenFeatureRuinedPortal(WorldGenFeatureRuinedPortalConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES); + public static final StructureGenerator SHIPWRECK = a("Shipwreck", new WorldGenFeatureShipwreck(WorldGenFeatureShipwreckConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES); +- public static final WorldGenFeatureSwampHut SWAMP_HUT = (WorldGenFeatureSwampHut) a("Swamp_Hut", new WorldGenFeatureSwampHut(WorldGenFeatureEmptyConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES); ++ public static final WorldGenFeatureSwampHut SWAMP_HUT = a("Swamp_Hut", new WorldGenFeatureSwampHut(WorldGenFeatureEmptyConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES); + public static final StructureGenerator STRONGHOLD = a("Stronghold", new WorldGenStronghold(WorldGenFeatureEmptyConfiguration.a), WorldGenStage.Decoration.STRONGHOLDS); + public static final StructureGenerator MONUMENT = a("Monument", new WorldGenMonument(WorldGenFeatureEmptyConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES); + public static final StructureGenerator OCEAN_RUIN = a("Ocean_Ruin", new WorldGenFeatureOceanRuin(WorldGenFeatureOceanRuinConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES); +@@ -55,7 +55,7 @@ public abstract class StructureGenerator + } + + public WorldGenStage.Decoration f() { +- return (WorldGenStage.Decoration) StructureGenerator.u.get(this); ++ return StructureGenerator.u.get(this); + } + + public static void g() {} +@@ -67,7 +67,7 @@ public abstract class StructureGenerator + if ("INVALID".equals(s)) { + return StructureStart.a; + } else { +- StructureGenerator structuregenerator = (StructureGenerator) IRegistry.STRUCTURE_FEATURE.get(new MinecraftKey(s.toLowerCase(Locale.ROOT))); ++ StructureGenerator structuregenerator = IRegistry.STRUCTURE_FEATURE.get(new MinecraftKey(s.toLowerCase(Locale.ROOT))); + + if (structuregenerator == null) { + StructureGenerator.LOGGER.error("Unknown feature id: {}", s); +@@ -85,7 +85,7 @@ public abstract class StructureGenerator + for (int i1 = 0; i1 < nbttaglist.size(); ++i1) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompound(i1); + String s1 = nbttagcompound1.getString("id"); +- WorldGenFeatureStructurePieceType worldgenfeaturestructurepiecetype = (WorldGenFeatureStructurePieceType) IRegistry.STRUCTURE_PIECE.get(new MinecraftKey(s1.toLowerCase(Locale.ROOT))); ++ WorldGenFeatureStructurePieceType worldgenfeaturestructurepiecetype = IRegistry.STRUCTURE_PIECE.get(new MinecraftKey(s1.toLowerCase(Locale.ROOT))); + + if (worldgenfeaturestructurepiecetype == null) { + StructureGenerator.LOGGER.error("Unknown structure piece id: {}", s1); +@@ -230,7 +230,7 @@ public abstract class StructureGenerator + public abstract StructureGenerator.a a(); + + public String i() { +- return (String) StructureGenerator.a.inverse().get(this); ++ return StructureGenerator.a.inverse().get(this); + } + + public List c() { +diff --git a/src/main/java/net/minecraft/server/StructureSettings.java b/src/main/java/net/minecraft/server/StructureSettings.java +index a5be5d4d9ea2429279594e8aa4664a6cf1b33d1c..e713df3e429fc0fd04ce49209652ca84d807e8b2 100644 +--- a/src/main/java/net/minecraft/server/StructureSettings.java ++++ b/src/main/java/net/minecraft/server/StructureSettings.java +@@ -25,7 +25,7 @@ public class StructureSettings { + private final StructureSettingsStronghold e; + + public StructureSettings(Optional optional, Map, StructureSettingsFeature> map) { +- this.e = (StructureSettingsStronghold) optional.orElse(null); ++ this.e = optional.orElse(null); + this.d = Maps.newHashMap(map); // Spigot + } + +@@ -39,7 +39,7 @@ public class StructureSettings { + } + + public StructureSettingsFeature a(StructureGenerator structuregenerator) { +- return (StructureSettingsFeature) this.d.getOrDefault(structuregenerator, new StructureSettingsFeature(1, 0, 0)); ++ return this.d.getOrDefault(structuregenerator, new StructureSettingsFeature(1, 0, 0)); + } + + @Nullable +diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java +index cfaab66b1e7d8dd54340af2956d24de426e0baad..ed8850fad1ecf3d92fd133c3671a3e47346e9029 100644 +--- a/src/main/java/net/minecraft/server/SystemUtils.java ++++ b/src/main/java/net/minecraft/server/SystemUtils.java +@@ -91,7 +91,7 @@ public class SystemUtils { + } + }*/ // Paper end + +- return (ExecutorService) object; ++ return object; + } + + public static Executor e() { +@@ -269,7 +269,7 @@ public class SystemUtils { + } + + public static Stream a(Optional optional) { +- return (Stream) DataFixUtils.orElseGet(optional.map(Stream::of), Stream::empty); ++ return DataFixUtils.orElseGet(optional.map(Stream::of), Stream::empty); + } + + public static Optional a(Optional optional, Consumer consumer, Runnable runnable) { +@@ -339,7 +339,7 @@ public class SystemUtils { + } + + public static DataResult a(IntStream intstream, int i) { +- int[] aint = intstream.limit((long) (i + 1)).toArray(); ++ int[] aint = intstream.limit(i + 1).toArray(); + + if (aint.length != i) { + String s = "Input is not a list of " + i + " ints"; +diff --git a/src/main/java/net/minecraft/server/TagRegistry.java b/src/main/java/net/minecraft/server/TagRegistry.java +index 0cce20c6115e9ef5eb0bba678951cb8a60013ec9..8208eb70a919a9b0c2d523528d35b9d34926ba83 100644 +--- a/src/main/java/net/minecraft/server/TagRegistry.java ++++ b/src/main/java/net/minecraft/server/TagRegistry.java +@@ -65,10 +65,10 @@ public class TagRegistry implements IReloadListener { + + ireloadlistener_a.getClass(); + return completablefuture4.thenCompose(ireloadlistener_a::a).thenAcceptAsync((ovoid) -> { +- this.blockTags.a((Map) completablefuture.join()); +- this.itemTags.a((Map) completablefuture1.join()); +- this.fluidTags.a((Map) completablefuture2.join()); +- this.entityTags.a((Map) completablefuture3.join()); ++ this.blockTags.a(completablefuture.join()); ++ this.itemTags.a(completablefuture1.join()); ++ this.fluidTags.a(completablefuture2.join()); ++ this.entityTags.a(completablefuture3.join()); + // CraftBukkit start + this.blockTags.version++; + this.itemTags.version++; +@@ -83,18 +83,18 @@ public class TagRegistry implements IReloadListener { + multimap.putAll("fluids", TagsFluid.b(this.fluidTags)); + multimap.putAll("entity_types", TagsEntity.b(this.entityTags)); + if (!multimap.isEmpty()) { +- throw new IllegalStateException("Missing required tags: " + (String) multimap.entries().stream().map((entry) -> { +- return (String) entry.getKey() + ":" + entry.getValue(); ++ throw new IllegalStateException("Missing required tags: " + multimap.entries().stream().map((entry) -> { ++ return entry.getKey() + ":" + entry.getValue(); + }).sorted().collect(Collectors.joining(","))); + } + }, executor1); + } + + public void bind() { +- TagsBlock.a((Tags) this.blockTags); +- TagsItem.a((Tags) this.itemTags); +- TagsFluid.a((Tags) this.fluidTags); +- TagsEntity.a((Tags) this.entityTags); ++ TagsBlock.a(this.blockTags); ++ TagsItem.a(this.itemTags); ++ TagsFluid.a(this.fluidTags); ++ TagsEntity.a(this.entityTags); + Blocks.a(); + } + } +diff --git a/src/main/java/net/minecraft/server/TagsServer.java b/src/main/java/net/minecraft/server/TagsServer.java +index c312f892153b81a6ba6ffdf6fcffb8ae5257be5a..cfac2686616e1f5224b3c54e91b303d07c869c46 100644 +--- a/src/main/java/net/minecraft/server/TagsServer.java ++++ b/src/main/java/net/minecraft/server/TagsServer.java +@@ -27,7 +27,7 @@ public class TagsServer extends Tags { + while (iterator.hasNext()) { + Entry> entry = (Entry) iterator.next(); + +- packetdataserializer.a((MinecraftKey) entry.getKey()); ++ packetdataserializer.a(entry.getKey()); + packetdataserializer.d(((Tag) entry.getValue()).getTagged().size()); + Iterator iterator1 = ((Tag) entry.getValue()).getTagged().iterator(); + +@@ -56,6 +56,6 @@ public class TagsServer extends Tags { + map.put(minecraftkey, Tag.b(builder.build())); + } + +- this.b((Map) map); ++ this.b(map); + } + } +diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java +index 68e3314de4c0be6ab54594c0533ed69f37a5e9ce..7354cdc3acf450a0953a886c5471cfdbd8303f4b 100644 +--- a/src/main/java/net/minecraft/server/ThreadedMailbox.java ++++ b/src/main/java/net/minecraft/server/ThreadedMailbox.java +@@ -71,7 +71,7 @@ public class ThreadedMailbox implements Mailbox, AutoCloseable, Runnable { + if (!this.d()) { + return false; + } else { +- Runnable runnable = (Runnable) this.a.a(); ++ Runnable runnable = this.a.a(); + + if (runnable == null) { + return false; +diff --git a/src/main/java/net/minecraft/server/TickListChunk.java b/src/main/java/net/minecraft/server/TickListChunk.java +index 56bd6ba96ea4331dbe1275840fded27428ea8fc3..14c177807e76088de1d754b7426a21240c554a0e 100644 +--- a/src/main/java/net/minecraft/server/TickListChunk.java ++++ b/src/main/java/net/minecraft/server/TickListChunk.java +@@ -13,8 +13,8 @@ public class TickListChunk implements TickList { + private final Function b; + + public TickListChunk(Function function, List> list, long i) { +- this(function, (List) list.stream().map((nextticklistentry) -> { +- return new TickListChunk.a<>(nextticklistentry.b(), nextticklistentry.a, (int) (nextticklistentry.b - i), nextticklistentry.c); ++ this(function, list.stream().map((nextticklistentry) -> { ++ return new a<>(nextticklistentry.b(), nextticklistentry.a, (int) (nextticklistentry.b - i), nextticklistentry.c); + }).collect(Collectors.toList())); + } + +@@ -46,7 +46,7 @@ public class TickListChunk implements TickList { + TickListChunk.a ticklistchunk_a = (TickListChunk.a) iterator.next(); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + +- nbttagcompound.setString("i", ((MinecraftKey) this.b.apply(ticklistchunk_a.d)).toString()); ++ nbttagcompound.setString("i", this.b.apply(ticklistchunk_a.d).toString()); + nbttagcompound.setInt("x", ticklistchunk_a.a.getX()); + nbttagcompound.setInt("y", ticklistchunk_a.a.getY()); + nbttagcompound.setInt("z", ticklistchunk_a.a.getZ()); +diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java +index 454beb548ca3eb05e9ae39c8a4fb2ab25137ed69..aaece812229b7c86effd96302f99d28642ec1f48 100644 +--- a/src/main/java/net/minecraft/server/TickListServer.java ++++ b/src/main/java/net/minecraft/server/TickListServer.java +@@ -67,7 +67,7 @@ public class TickListServer implements TickList { + NextTickListEntry nextticklistentry; + + while (i > 0 && iterator.hasNext()) { +- nextticklistentry = (NextTickListEntry) iterator.next(); ++ nextticklistentry = iterator.next(); + if (nextticklistentry.b > this.e.getTime()) { + break; + } +@@ -84,7 +84,7 @@ public class TickListServer implements TickList { + this.timingTicking.startTiming(); // Paper + //this.e.getMethodProfiler().exitEnter("ticking"); // Akarin - remove caller + +- while ((nextticklistentry = (NextTickListEntry) this.f.poll()) != null) { ++ while ((nextticklistentry = this.f.poll()) != null) { + if (chunkproviderserver.a(nextticklistentry.a)) { + try { + this.g.add(nextticklistentry); +@@ -93,7 +93,7 @@ public class TickListServer implements TickList { + CrashReport crashreport = CrashReport.a(throwable, "Exception while ticking"); + CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Block being ticked"); + +- CrashReportSystemDetails.a(crashreportsystemdetails, nextticklistentry.a, (IBlockData) null); ++ CrashReportSystemDetails.a(crashreportsystemdetails, nextticklistentry.a, null); + throw new ReportedException(crashreport); + } + } else { +@@ -138,7 +138,7 @@ public class TickListServer implements TickList { + } + public List> getEntriesInBoundingBox(StructureBoundingBox structureboundingbox, boolean flag, boolean flag1) { + // Paper end +- List> list = this.a((List) null, this.nextTickList, structureboundingbox, flag); ++ List> list = this.a(null, this.nextTickList, structureboundingbox, flag); + + if (flag && list != null) { + this.nextTickListHash.removeAll(list); +@@ -169,11 +169,11 @@ public class TickListServer implements TickList { + list = Lists.newArrayList(); + } + +- ((List) list).add(nextticklistentry); ++ list.add(nextticklistentry); + } + } + +- return (List) list; ++ return list; + } + + public void a(StructureBoundingBox structureboundingbox, BlockPosition blockposition) { +@@ -188,8 +188,8 @@ public class TickListServer implements TickList { + while (iterator.hasNext()) { + NextTickListEntry nextticklistentry = (NextTickListEntry) iterator.next(); + +- if (structureboundingbox.b((BaseBlockPosition) nextticklistentry.a)) { +- BlockPosition blockposition1 = nextticklistentry.a.a((BaseBlockPosition) blockposition); ++ if (structureboundingbox.b(nextticklistentry.a)) { ++ BlockPosition blockposition1 = nextticklistentry.a.a(blockposition); + T t0 = nextticklistentry.b(); + + this.a(new NextTickListEntry<>(blockposition1, t0, nextticklistentry.b, nextticklistentry.c)); +@@ -218,7 +218,7 @@ public class TickListServer implements TickList { + NextTickListEntry nextticklistentry = (NextTickListEntry) iterator.next(); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + +- nbttagcompound.setString("i", ((MinecraftKey) function.apply(nextticklistentry.b())).toString()); ++ nbttagcompound.setString("i", function.apply(nextticklistentry.b()).toString()); + nbttagcompound.setInt("x", nextticklistentry.a.getX()); + nbttagcompound.setInt("y", nextticklistentry.a.getY()); + nbttagcompound.setInt("z", nextticklistentry.a.getZ()); +diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java +index c19ffb925a02d123da8a5c77186e6105422dccf7..fed148d45d0350911108caca13b9dac07854960e 100644 +--- a/src/main/java/net/minecraft/server/Ticket.java ++++ b/src/main/java/net/minecraft/server/Ticket.java +@@ -43,7 +43,7 @@ public final class Ticket implements Comparable> { + } + + public int hashCode() { +- return Objects.hash(new Object[]{this.a, this.b, this.identifier}); ++ return Objects.hash(this.a, this.b, this.identifier); + } + + public String toString() { +diff --git a/src/main/java/net/minecraft/server/TicketType.java b/src/main/java/net/minecraft/server/TicketType.java +index 4657b05a4213c534a653aefd991645e27a6a4b3b..f9289a211a265c810b0eb3774c27e22e432dfeec 100644 +--- a/src/main/java/net/minecraft/server/TicketType.java ++++ b/src/main/java/net/minecraft/server/TicketType.java +@@ -34,7 +34,7 @@ public class TicketType { + } + + public static TicketType a(String s, Comparator comparator, int i) { +- return new TicketType<>(s, comparator, (long) i); ++ return new TicketType<>(s, comparator, i); + } + + protected TicketType(String s, Comparator comparator, long i) { +diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java +index 3f9201d2ae8fa86cfb2707bc3c4c9266dcf76dfe..c9ea02a8b412d465081ab188f8603b5b85f14b0e 100644 +--- a/src/main/java/net/minecraft/server/TileEntity.java ++++ b/src/main/java/net/minecraft/server/TileEntity.java +@@ -162,7 +162,7 @@ public abstract class TileEntity implements KeyedObject, Cloneable { // Paper // + public static TileEntity create(IBlockData iblockdata, NBTTagCompound nbttagcompound) { + String s = nbttagcompound.getString("id"); + +- return (TileEntity) IRegistry.BLOCK_ENTITY_TYPE.getOptional(new MinecraftKey(s)).map((tileentitytypes) -> { ++ return IRegistry.BLOCK_ENTITY_TYPE.getOptional(new MinecraftKey(s)).map((tileentitytypes) -> { + try { + return tileentitytypes.a(); + } catch (Throwable throwable) { +@@ -270,9 +270,9 @@ public abstract class TileEntity implements KeyedObject, Cloneable { // Paper // + public void w() { + if (!this.g) { + this.g = true; +- TileEntity.LOGGER.warn("Block entity invalid: {} @ {}", new Supplier[]{() -> { ++ TileEntity.LOGGER.warn("Block entity invalid: {} @ {}", () -> { + return IRegistry.BLOCK_ENTITY_TYPE.getKey(this.getTileType()); +- }, this::getPosition}); ++ }, this::getPosition); + } + } + +diff --git a/src/main/java/net/minecraft/server/TileEntityBanner.java b/src/main/java/net/minecraft/server/TileEntityBanner.java +index 94a3f51d35930e86507490aaa942921dd4277cd6..5dc07d9afaeedd1ac205da5156119780e9e545d9 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBanner.java ++++ b/src/main/java/net/minecraft/server/TileEntityBanner.java +@@ -30,7 +30,7 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity { + + @Override + public IChatBaseComponent getDisplayName() { +- return (IChatBaseComponent) (this.a != null ? this.a : new ChatMessage("block.minecraft.banner")); ++ return this.a != null ? this.a : new ChatMessage("block.minecraft.banner"); + } + + @Nullable +@@ -115,7 +115,7 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity { + + public EnumColor a(Supplier supplier) { + if (this.color == null) { +- this.color = ((BlockBannerAbstract) ((IBlockData) supplier.get()).getBlock()).getColor(); ++ this.color = ((BlockBannerAbstract) supplier.get().getBlock()).getColor(); + } + + return this.color; +diff --git a/src/main/java/net/minecraft/server/TileEntityBarrel.java b/src/main/java/net/minecraft/server/TileEntityBarrel.java +index b7f1418aa0f10024159994cc57c67762c6a1bbd2..a9bcc3ed65aee7441d6ce6c755dbfeac2f83f5d1 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBarrel.java ++++ b/src/main/java/net/minecraft/server/TileEntityBarrel.java +@@ -112,7 +112,7 @@ public class TileEntityBarrel extends TileEntityLootable { + + ++this.b; + IBlockData iblockdata = this.getBlock(); +- boolean flag = (Boolean) iblockdata.get(BlockBarrel.b); ++ boolean flag = iblockdata.get(BlockBarrel.b); + + if (!flag) { + this.a(iblockdata, SoundEffects.BLOCK_BARREL_OPEN); +@@ -144,7 +144,7 @@ public class TileEntityBarrel extends TileEntityLootable { + return; + } + +- boolean flag = (Boolean) iblockdata.get(BlockBarrel.b) && !opened; // CraftBukkit - only set flag if Barrel isn't set open by API. ++ boolean flag = iblockdata.get(BlockBarrel.b) && !opened; // CraftBukkit - only set flag if Barrel isn't set open by API. + + if (flag) { + this.a(iblockdata, SoundEffects.BLOCK_BARREL_CLOSE); +@@ -163,15 +163,15 @@ public class TileEntityBarrel extends TileEntityLootable { + } + + public void a(IBlockData iblockdata, boolean flag) { // PAIL private -> public, rename setFlag +- this.world.setTypeAndData(this.getPosition(), (IBlockData) iblockdata.set(BlockBarrel.b, flag), 3); ++ this.world.setTypeAndData(this.getPosition(), iblockdata.set(BlockBarrel.b, flag), 3); + } + + public void a(IBlockData iblockdata, SoundEffect soundeffect) { // PAIL private -> public, rename playSound +- BaseBlockPosition baseblockposition = ((EnumDirection) iblockdata.get(BlockBarrel.a)).p(); ++ BaseBlockPosition baseblockposition = iblockdata.get(BlockBarrel.a).p(); + double d0 = (double) this.position.getX() + 0.5D + (double) baseblockposition.getX() / 2.0D; + double d1 = (double) this.position.getY() + 0.5D + (double) baseblockposition.getY() / 2.0D; + double d2 = (double) this.position.getZ() + 0.5D + (double) baseblockposition.getZ() / 2.0D; + +- this.world.playSound((EntityHuman) null, d0, d1, d2, soundeffect, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); ++ this.world.playSound(null, d0, d1, d2, soundeffect, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); + } + } +diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java +index 1c91cc5ce28e936e62a5276ed82ddfebb2f233e6..e4945d2d8469554e2bf0fab055de90ed5448c811 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBeacon.java ++++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java +@@ -23,7 +23,7 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic + set.add(mobEffectList); + } + } +- b = (Set) set; ++ b = set; + } + + private List c = Lists.newArrayList(); +@@ -123,7 +123,7 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic + blockposition = new BlockPosition(i, this.i + 1, k); + } + +- TileEntityBeacon.BeaconColorTracker tileentitybeacon_beaconcolortracker = this.g.isEmpty() ? null : (TileEntityBeacon.BeaconColorTracker) this.g.get(this.g.size() - 1); ++ TileEntityBeacon.BeaconColorTracker tileentitybeacon_beaconcolortracker = this.g.isEmpty() ? null : this.g.get(this.g.size() - 1); + int l = this.world.a(HeightMap.Type.WORLD_SURFACE, i, k); + + int i1; +@@ -182,7 +182,7 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic + + if (!flag && flag1) { + this.a(SoundEffects.BLOCK_BEACON_ACTIVATE); +- Iterator iterator = this.world.a(EntityPlayer.class, (new AxisAlignedBB((double) i, (double) j, (double) k, (double) i, (double) (j - 4), (double) k)).grow(10.0D, 5.0D, 10.0D)).iterator(); ++ Iterator iterator = this.world.a(EntityPlayer.class, (new AxisAlignedBB(i, j, k, i, j - 4, k)).grow(10.0D, 5.0D, 10.0D)).iterator(); + + while (iterator.hasNext()) { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); +@@ -211,7 +211,7 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic + + for (int j1 = i - l; j1 <= i + l && flag; ++j1) { + for (int k1 = k - l; k1 <= k + l; ++k1) { +- if (!this.world.getType(new BlockPosition(j1, i1, k1)).a((Tag) TagsBlock.BEACON_BASE_BLOCKS)) { ++ if (!this.world.getType(new BlockPosition(j1, i1, k1)).a(TagsBlock.BEACON_BASE_BLOCKS)) { + flag = false; + break; + } +@@ -253,9 +253,9 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic + + public List getHumansInRange() { + { +- double d0 = (double) (this.levels * 10 + 10); ++ double d0 = this.levels * 10 + 10; + +- AxisAlignedBB axisalignedbb = (new AxisAlignedBB(this.position)).g(d0).b(0.0D, (double) this.world.getBuildHeight(), 0.0D); ++ AxisAlignedBB axisalignedbb = (new AxisAlignedBB(this.position)).g(d0).b(0.0D, this.world.getBuildHeight(), 0.0D); + List list = this.world.a(EntityHuman.class, axisalignedbb); + + return list; +@@ -304,7 +304,7 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic + + private void applyEffects() { + if (!this.world.isClientSide && this.primaryEffect != null) { +- double d0 = (double) (this.levels * 10 + 10); ++ double d0 = this.levels * 10 + 10; + byte b0 = getAmplification(); + + int i = getLevel(); +@@ -321,7 +321,7 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic + // CraftBukkit end + + public void a(SoundEffect soundeffect) { +- this.world.playSound((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ this.world.playSound(null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + + public int h() { +@@ -387,7 +387,7 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic + + @Override + public IChatBaseComponent getScoreboardDisplayName() { +- return (IChatBaseComponent) (this.customName != null ? this.customName : new ChatMessage("container.beacon")); ++ return this.customName != null ? this.customName : new ChatMessage("container.beacon"); + } + + public static class BeaconColorTracker { +diff --git a/src/main/java/net/minecraft/server/TileEntityBeehive.java b/src/main/java/net/minecraft/server/TileEntityBeehive.java +index ce66802b437b57e0f6a66be3c6d69b36228a4afc..6cd1d33cd2f47af528f09039ef34100318386517 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBeehive.java ++++ b/src/main/java/net/minecraft/server/TileEntityBeehive.java +@@ -27,7 +27,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + @Override + public void update() { + if (this.d()) { +- this.a((EntityHuman) null, this.world.getType(this.getPosition()), TileEntityBeehive.ReleaseStatus.EMERGENCY); ++ this.a(null, this.world.getType(this.getPosition()), TileEntityBeehive.ReleaseStatus.EMERGENCY); + } + + super.update(); +@@ -110,7 +110,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + } + + public static int a(IBlockData iblockdata) { +- return (Integer) iblockdata.get(BlockBeehive.b); ++ return iblockdata.get(BlockBeehive.b); + } + + public boolean isSedated() { +@@ -152,7 +152,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + + BlockPosition blockposition = this.getPosition(); + +- this.world.playSound((EntityHuman) null, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), SoundEffects.BLOCK_BEEHIVE_ENTER, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ this.world.playSound(null, blockposition.getX(), blockposition.getY(), blockposition.getZ(), SoundEffects.BLOCK_BEEHIVE_ENTER, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + + entity.die(); +@@ -175,7 +175,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + nbttagcompound.remove("Passengers"); + nbttagcompound.remove("Leash"); + nbttagcompound.remove("UUID"); +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockBeehive.a); ++ EnumDirection enumdirection = iblockdata.get(BlockBeehive.a); + BlockPosition blockposition1 = blockposition.shift(enumdirection); + boolean flag = !this.world.getType(blockposition1).getCollisionShape(this.world, blockposition1).isEmpty(); + +@@ -187,7 +187,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + }); + + if (entity != null) { +- if (!entity.getEntityType().a((Tag) TagsEntity.BEEHIVE_INHABITORS)) { ++ if (!entity.getEntityType().a(TagsEntity.BEEHIVE_INHABITORS)) { + return false; + } else { + // CraftBukkit start +@@ -211,7 +211,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + + if (tileentitybeehive_releasestatus == TileEntityBeehive.ReleaseStatus.HONEY_DELIVERED) { + entitybee.fc(); +- if (iblockdata.getBlock().a((Tag) TagsBlock.BEEHIVES)) { ++ if (iblockdata.getBlock().a(TagsBlock.BEEHIVES)) { + int i = a(iblockdata); + + if (i < 5) { +@@ -221,7 +221,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + --j; + } + +- this.world.setTypeUpdate(this.getPosition(), (IBlockData) iblockdata.set(BlockBeehive.b, i + j)); ++ this.world.setTypeUpdate(this.getPosition(), iblockdata.set(BlockBeehive.b, i + j)); + } + } + } +@@ -242,7 +242,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + */ // CraftBukkit end + } + +- this.world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_BEEHIVE_EXIT, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ this.world.playSound(null, blockposition, SoundEffects.BLOCK_BEEHIVE_EXIT, SoundCategory.BLOCKS, 1.0F, 1.0F); + return true; // return this.world.addEntity(entity); // CraftBukkit - moved up + } + } else { +@@ -275,11 +275,11 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + TileEntityBeehive.HiveBee tileentitybeehive_hivebee; + + for (IBlockData iblockdata = this.getBlock(); iterator.hasNext(); tileentitybeehive_hivebee.ticksInHive++) { +- tileentitybeehive_hivebee = (TileEntityBeehive.HiveBee) iterator.next(); ++ tileentitybeehive_hivebee = iterator.next(); + if (tileentitybeehive_hivebee.ticksInHive > tileentitybeehive_hivebee.minOccupationTicks) { + TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus = tileentitybeehive_hivebee.entityData.getBoolean("HasNectar") ? TileEntityBeehive.ReleaseStatus.HONEY_DELIVERED : TileEntityBeehive.ReleaseStatus.BEE_RELEASED; + +- if (this.releaseBee(iblockdata, tileentitybeehive_hivebee, (List) null, tileentitybeehive_releasestatus)) { ++ if (this.releaseBee(iblockdata, tileentitybeehive_hivebee, null, tileentitybeehive_releasestatus)) { + iterator.remove(); + } + // CraftBukkit start +@@ -300,10 +300,10 @@ public class TileEntityBeehive extends TileEntity implements ITickable { + + if (this.bees.size() > 0 && this.world.getRandom().nextDouble() < 0.005D) { + double d0 = (double) blockposition.getX() + 0.5D; +- double d1 = (double) blockposition.getY(); ++ double d1 = blockposition.getY(); + double d2 = (double) blockposition.getZ() + 0.5D; + +- this.world.playSound((EntityHuman) null, d0, d1, d2, SoundEffects.BLOCK_BEEHIVE_WORK, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ this.world.playSound(null, d0, d1, d2, SoundEffects.BLOCK_BEEHIVE_WORK, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + + this.l(); +diff --git a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java +index 568bde484cdfe2e2f4a55fe6fd5616263c0e4c37..e6b070a944610e2e03e89cc34726943748743201 100644 +--- a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java ++++ b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java +@@ -135,7 +135,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + + @Override + public void tick() { +- ItemStack itemstack = (ItemStack) this.items.get(4); ++ ItemStack itemstack = this.items.get(4); + + if (this.fuelLevel <= 0 && itemstack.getItem() == Items.BLAZE_POWDER) { + // CraftBukkit start +@@ -156,7 +156,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + + boolean flag = this.h(); + boolean flag1 = this.brewTime > 0; +- ItemStack itemstack1 = (ItemStack) this.items.get(3); ++ ItemStack itemstack1 = this.items.get(3); + + // CraftBukkit start - Use wall time instead of ticks for brewing + int elapsedTicks = MinecraftServer.currentTick - this.lastTick; +@@ -196,7 +196,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + } + + for (int i = 0; i < BlockBrewingStand.HAS_BOTTLE.length; ++i) { +- iblockdata = (IBlockData) iblockdata.set(BlockBrewingStand.HAS_BOTTLE[i], aboolean[i]); ++ iblockdata = iblockdata.set(BlockBrewingStand.HAS_BOTTLE[i], aboolean[i]); + } + + this.world.setTypeAndData(this.position, iblockdata, 2); +@@ -209,7 +209,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + boolean[] aboolean = new boolean[3]; + + for (int i = 0; i < 3; ++i) { +- if (!((ItemStack) this.items.get(i)).isEmpty()) { ++ if (!this.items.get(i).isEmpty()) { + aboolean[i] = true; + } + } +@@ -218,7 +218,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + } + + private boolean h() { +- ItemStack itemstack = (ItemStack) this.items.get(3); ++ ItemStack itemstack = this.items.get(3); + + if (itemstack.isEmpty()) { + return false; +@@ -226,7 +226,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + return false; + } else { + for (int i = 0; i < 3; ++i) { +- ItemStack itemstack1 = (ItemStack) this.items.get(i); ++ ItemStack itemstack1 = this.items.get(i); + + if (!itemstack1.isEmpty() && PotionBrewer.a(itemstack1, itemstack)) { + return true; +@@ -238,7 +238,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + } + + private void j() { +- ItemStack itemstack = (ItemStack) this.items.get(3); ++ ItemStack itemstack = this.items.get(3); + // CraftBukkit start + InventoryHolder owner = this.getOwner(); + if (owner != null) { +@@ -251,7 +251,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + // CraftBukkit end + + for (int i = 0; i < 3; ++i) { +- this.items.set(i, PotionBrewer.d(itemstack, (ItemStack) this.items.get(i))); ++ this.items.set(i, PotionBrewer.d(itemstack, this.items.get(i))); + } + + itemstack.subtract(1); +@@ -263,7 +263,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + if (itemstack.isEmpty()) { + itemstack = itemstack1; + } else if (!this.world.isClientSide) { +- InventoryUtils.dropItem(this.world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1); ++ InventoryUtils.dropItem(this.world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), itemstack1); + } + } + +@@ -291,7 +291,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl + + @Override + public ItemStack getItem(int i) { +- return i >= 0 && i < this.items.size() ? (ItemStack) this.items.get(i) : ItemStack.b; ++ return i >= 0 && i < this.items.size() ? this.items.get(i) : ItemStack.b; + } + + @Override +diff --git a/src/main/java/net/minecraft/server/TileEntityCampfire.java b/src/main/java/net/minecraft/server/TileEntityCampfire.java +index d3fb2f4a190742441e88c497ff5f915055b4df19..eae0aefaa17b725e261bc2edb85cecbcd86f7351 100644 +--- a/src/main/java/net/minecraft/server/TileEntityCampfire.java ++++ b/src/main/java/net/minecraft/server/TileEntityCampfire.java +@@ -24,7 +24,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab + + @Override + public void tick() { +- boolean flag = (Boolean) this.getBlock().get(BlockCampfire.b); ++ boolean flag = this.getBlock().get(BlockCampfire.b); + boolean flag1 = this.world.isClientSide; + + if (flag1) { +@@ -48,14 +48,14 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab + + private void h() { + for (int i = 0; i < this.items.size(); ++i) { +- ItemStack itemstack = (ItemStack) this.items.get(i); ++ ItemStack itemstack = this.items.get(i); + + if (!itemstack.isEmpty()) { + int j = this.cookingTimes[i]++; + + if (this.cookingTimes[i] >= this.cookingTotalTimes[i]) { +- InventorySubcontainer inventorysubcontainer = new InventorySubcontainer(new ItemStack[]{itemstack}); +- ItemStack itemstack1 = (ItemStack) this.world.getCraftingManager().craft(Recipes.CAMPFIRE_COOKING, inventorysubcontainer, this.world).map((recipecampfire) -> { ++ InventorySubcontainer inventorysubcontainer = new InventorySubcontainer(itemstack); ++ ItemStack itemstack1 = this.world.getCraftingManager().craft(Recipes.CAMPFIRE_COOKING, inventorysubcontainer, this.world).map((recipecampfire) -> { + return recipecampfire.a(inventorysubcontainer); + }).orElse(itemstack); + BlockPosition blockposition = this.getPosition(); +@@ -74,7 +74,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab + result = blockCookEvent.getResult(); + itemstack1 = CraftItemStack.asNMSCopy(result); + // CraftBukkit end +- InventoryUtils.dropItem(this.world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1); ++ InventoryUtils.dropItem(this.world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), itemstack1); + this.items.set(i, ItemStack.b); + this.k(); + } +@@ -93,14 +93,14 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab + + if (random.nextFloat() < 0.11F) { + for (i = 0; i < random.nextInt(2) + 2; ++i) { +- BlockCampfire.a(world, blockposition, (Boolean) this.getBlock().get(BlockCampfire.c), false); ++ BlockCampfire.a(world, blockposition, this.getBlock().get(BlockCampfire.c), false); + } + } + +- i = ((EnumDirection) this.getBlock().get(BlockCampfire.e)).get2DRotationValue(); ++ i = this.getBlock().get(BlockCampfire.e).get2DRotationValue(); + + for (int j = 0; j < this.items.size(); ++j) { +- if (!((ItemStack) this.items.get(j)).isEmpty() && random.nextFloat() < 0.2F) { ++ if (!this.items.get(j).isEmpty() && random.nextFloat() < 0.2F) { + EnumDirection enumdirection = EnumDirection.fromType2(Math.floorMod(j + i, 4)); + float f = 0.3125F; + double d0 = (double) blockposition.getX() + 0.5D - (double) ((float) enumdirection.getAdjacentX() * 0.3125F) + (double) ((float) enumdirection.g().getAdjacentX() * 0.3125F); +@@ -167,7 +167,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab + public Optional a(ItemStack itemstack) { + for (ItemStack item : this.items) { + if (item.isEmpty()) { +- return this.world.getCraftingManager().craft(Recipes.CAMPFIRE_COOKING, new InventorySubcontainer(new ItemStack[]{itemstack}), this.world); ++ return this.world.getCraftingManager().craft(Recipes.CAMPFIRE_COOKING, new InventorySubcontainer(itemstack), this.world); + } + } + return Optional.empty(); +@@ -175,7 +175,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab + + public boolean a(ItemStack itemstack, int i) { + for (int j = 0; j < this.items.size(); ++j) { +- ItemStack itemstack1 = (ItemStack) this.items.get(j); ++ ItemStack itemstack1 = this.items.get(j); + + if (itemstack1.isEmpty()) { + this.cookingTotalTimes[j] = i; +diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java +index 2e638f09369f5041222f57cdef2fbb903da9ba88..90f3b258cd860574f441ee3df3e2c4d65e34f395 100644 +--- a/src/main/java/net/minecraft/server/TileEntityChest.java ++++ b/src/main/java/net/minecraft/server/TileEntityChest.java +@@ -172,7 +172,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic + public static int a(World world, TileEntityContainer tileentitycontainer, int i, int j, int k) { + int l = 0; + float f = 5.0F; +- List list = world.a(EntityHuman.class, new AxisAlignedBB((double) ((float) i - 5.0F), (double) ((float) j - 5.0F), (double) ((float) k - 5.0F), (double) ((float) (i + 1) + 5.0F), (double) ((float) (j + 1) + 5.0F), (double) ((float) (k + 1) + 5.0F))); ++ List list = world.a(EntityHuman.class, new AxisAlignedBB((float) i - 5.0F, (float) j - 5.0F, (float) k - 5.0F, (float) (i + 1) + 5.0F, (float) (j + 1) + 5.0F, (float) (k + 1) + 5.0F)); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { +@@ -181,7 +181,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic + if (entityhuman.activeContainer instanceof ContainerChest) { + IInventory iinventory = ((ContainerChest) entityhuman.activeContainer).e(); + +- if (iinventory == tileentitycontainer || iinventory instanceof InventoryLargeChest && ((InventoryLargeChest) iinventory).a((IInventory) tileentitycontainer)) { ++ if (iinventory == tileentitycontainer || iinventory instanceof InventoryLargeChest && ((InventoryLargeChest) iinventory).a(tileentitycontainer)) { + ++l; + } + } +@@ -192,7 +192,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic + + public void a(SoundEffect soundeffect) { // PAIL private -> public, rename playSound + if (!this.getBlock().b(BlockChest.c)) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074 +- BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) this.getBlock().get(BlockChest.c); ++ BlockPropertyChestType blockpropertychesttype = this.getBlock().get(BlockChest.c); + + if (blockpropertychesttype != BlockPropertyChestType.LEFT) { + double d0 = (double) this.position.getX() + 0.5D; +@@ -206,7 +206,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic + d2 += (double) enumdirection.getAdjacentZ() * 0.5D; + } + +- this.world.playSound((EntityHuman) null, d0, d1, d2, soundeffect, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); ++ this.world.playSound(null, d0, d1, d2, soundeffect, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); + } + } + +diff --git a/src/main/java/net/minecraft/server/TileEntityCommand.java b/src/main/java/net/minecraft/server/TileEntityCommand.java +index 31059a17765c03f36b6540f7669cbdedf89c6c0d..f2d0fa89981f835226c1b2d1f1a2891b7aa3170e 100644 +--- a/src/main/java/net/minecraft/server/TileEntityCommand.java ++++ b/src/main/java/net/minecraft/server/TileEntityCommand.java +@@ -36,7 +36,7 @@ public class TileEntityCommand extends TileEntity { + + @Override + public CommandListenerWrapper getWrapper() { +- return new CommandListenerWrapper(this, Vec3D.a((BaseBlockPosition) TileEntityCommand.this.position), Vec2F.a, this.d(), 2, this.getName().getString(), this.getName(), this.d().getMinecraftServer(), (Entity) null); ++ return new CommandListenerWrapper(this, Vec3D.a(TileEntityCommand.this.position), Vec2F.a, this.d(), 2, this.getName().getString(), this.getName(), this.d().getMinecraftServer(), null); + } + }; + +@@ -133,7 +133,7 @@ public class TileEntityCommand extends TileEntity { + public boolean k() { + this.c = true; + if (this.x()) { +- BlockPosition blockposition = this.position.shift(((EnumDirection) this.world.getType(this.position).get(BlockCommand.a)).opposite()); ++ BlockPosition blockposition = this.position.shift(this.world.getType(this.position).get(BlockCommand.a).opposite()); + + if (this.world.getType(blockposition).getBlock() instanceof BlockCommand) { + TileEntity tileentity = this.world.getTileEntity(blockposition); +@@ -164,7 +164,7 @@ public class TileEntityCommand extends TileEntity { + public boolean x() { + IBlockData iblockdata = this.world.getType(this.getPosition()); + +- return iblockdata.getBlock() instanceof BlockCommand ? (Boolean) iblockdata.get(BlockCommand.b) : false; ++ return iblockdata.getBlock() instanceof BlockCommand ? iblockdata.get(BlockCommand.b) : false; + } + + @Override +diff --git a/src/main/java/net/minecraft/server/TileEntityConduit.java b/src/main/java/net/minecraft/server/TileEntityConduit.java +index adbfb11064fe38648588b167e1f9db2130a6a0da..d3195fa0d9e30ceb3a31908be2f04df15aa37fd7 100644 +--- a/src/main/java/net/minecraft/server/TileEntityConduit.java ++++ b/src/main/java/net/minecraft/server/TileEntityConduit.java +@@ -169,7 +169,7 @@ public class TileEntityConduit extends TileEntity implements ITickable { + int k = this.position.getX(); + int l = this.position.getY(); + int i1 = this.position.getZ(); +- AxisAlignedBB axisalignedbb = (new AxisAlignedBB((double) k, (double) l, (double) i1, (double) (k + 1), (double) (l + 1), (double) (i1 + 1))).g((double) j).b(0.0D, (double) this.world.getBuildHeight(), 0.0D); ++ AxisAlignedBB axisalignedbb = (new AxisAlignedBB(k, l, i1, k + 1, l + 1, i1 + 1)).g(j).b(0.0D, this.world.getBuildHeight(), 0.0D); + List list = this.world.a(EntityHuman.class, axisalignedbb); + + if (!list.isEmpty()) { +@@ -178,7 +178,7 @@ public class TileEntityConduit extends TileEntity implements ITickable { + while (iterator.hasNext()) { + EntityHuman entityhuman = (EntityHuman) iterator.next(); + +- if (this.position.a((BaseBlockPosition) entityhuman.getChunkCoordinates(), (double) j) && entityhuman.isInWaterOrRain()) { ++ if (this.position.a(entityhuman.getChunkCoordinates(), j) && entityhuman.isInWaterOrRain()) { + entityhuman.addEffect(new MobEffect(MobEffects.CONDUIT_POWER, 260, 0, true, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONDUIT); // CraftBukkit + } + } +@@ -196,14 +196,14 @@ public class TileEntityConduit extends TileEntity implements ITickable { + this.target = this.x(); + this.k = null; + } else if (this.target == null) { +- List list = this.world.a(EntityLiving.class, this.m(), (java.util.function.Predicate) (entityliving1) -> { // CraftBukkit - decompile error ++ List list = this.world.a(EntityLiving.class, this.m(), (entityliving1) -> { // CraftBukkit - decompile error + return entityliving1 instanceof IMonster && entityliving1.isInWaterOrRain(); + }); + + if (!list.isEmpty()) { +- this.target = (EntityLiving) list.get(this.world.random.nextInt(list.size())); ++ this.target = list.get(this.world.random.nextInt(list.size())); + } +- } else if (!this.target.isAlive() || !this.position.a((BaseBlockPosition) this.target.getChunkCoordinates(), 8.0D)) { ++ } else if (!this.target.isAlive() || !this.position.a(this.target.getChunkCoordinates(), 8.0D)) { + this.target = null; + } + +@@ -211,7 +211,7 @@ public class TileEntityConduit extends TileEntity implements ITickable { + // CraftBukkit start + CraftEventFactory.blockDamage = CraftBlock.at(this.world, this.position); + if (this.target.damageEntity(DamageSource.MAGIC, 4.0F)) { +- this.world.playSound((EntityHuman) null, this.target.locX(), this.target.locY(), this.target.locZ(), SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ this.world.playSound(null, this.target.locX(), this.target.locY(), this.target.locZ(), SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + CraftEventFactory.blockDamage = null; + // CraftBukkit end +@@ -242,21 +242,21 @@ public class TileEntityConduit extends TileEntity implements ITickable { + int j = this.position.getY(); + int k = this.position.getZ(); + +- return (new AxisAlignedBB((double) i, (double) j, (double) k, (double) (i + 1), (double) (j + 1), (double) (k + 1))).g(8.0D); ++ return (new AxisAlignedBB(i, j, k, i + 1, j + 1, k + 1)).g(8.0D); + } + + @Nullable + private EntityLiving x() { +- List list = this.world.a(EntityLiving.class, this.m(), (java.util.function.Predicate) (entityliving) -> { // CraftBukkit - decompile error ++ List list = this.world.a(EntityLiving.class, this.m(), (entityliving) -> { // CraftBukkit - decompile error + return entityliving.getUniqueID().equals(this.k); + }); + +- return list.size() == 1 ? (EntityLiving) list.get(0) : null; ++ return list.size() == 1 ? list.get(0) : null; + } + + private void y() { + Random random = this.world.random; +- double d0 = (double) (MathHelper.sin((float) (this.a + 35) * 0.1F) / 2.0F + 0.5F); ++ double d0 = MathHelper.sin((float) (this.a + 35) * 0.1F) / 2.0F + 0.5F; + + d0 = (d0 * d0 + d0) * 0.30000001192092896D; + Vec3D vec3d = new Vec3D((double) this.position.getX() + 0.5D, (double) this.position.getY() + 1.5D + d0, (double) this.position.getZ() + 0.5D); +@@ -273,7 +273,7 @@ public class TileEntityConduit extends TileEntity implements ITickable { + f1 = -2.0F + random.nextFloat(); + float f2 = -0.5F + random.nextFloat(); + BlockPosition blockposition1 = blockposition.b(this.position); +- Vec3D vec3d1 = (new Vec3D((double) f, (double) f1, (double) f2)).add((double) blockposition1.getX(), (double) blockposition1.getY(), (double) blockposition1.getZ()); ++ Vec3D vec3d1 = (new Vec3D(f, f1, f2)).add(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ()); + + this.world.addParticle(Particles.NAUTILUS, vec3d.x, vec3d.y, vec3d.z, vec3d1.x, vec3d1.y, vec3d1.z); + } +@@ -285,7 +285,7 @@ public class TileEntityConduit extends TileEntity implements ITickable { + + f = -1.0F + random.nextFloat() * this.target.getHeight(); + f1 = (-0.5F + random.nextFloat()) * (3.0F + this.target.getWidth()); +- Vec3D vec3d3 = new Vec3D((double) f3, (double) f, (double) f1); ++ Vec3D vec3d3 = new Vec3D(f3, f, f1); + + this.world.addParticle(Particles.NAUTILUS, vec3d2.x, vec3d2.y, vec3d2.z, vec3d3.x, vec3d3.y, vec3d3.z); + } +@@ -309,6 +309,6 @@ public class TileEntityConduit extends TileEntity implements ITickable { + } + + public void a(SoundEffect soundeffect) { +- this.world.playSound((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ this.world.playSound(null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + } +diff --git a/src/main/java/net/minecraft/server/TileEntityContainer.java b/src/main/java/net/minecraft/server/TileEntityContainer.java +index 9ce4f340d097132401054a1bb38abb73aa6a5fb1..16d690397459f804d6784d41b01ae2a367d2c3ed 100644 +--- a/src/main/java/net/minecraft/server/TileEntityContainer.java ++++ b/src/main/java/net/minecraft/server/TileEntityContainer.java +@@ -61,7 +61,7 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento + + public static boolean a(EntityHuman entityhuman, ChestLock chestlock, IChatBaseComponent ichatbasecomponent) { + if (!entityhuman.isSpectator() && !chestlock.a(entityhuman.getItemInMainHand())) { +- entityhuman.a((IChatBaseComponent) (new ChatMessage("container.isLocked", new Object[]{ichatbasecomponent})), true); ++ entityhuman.a(new ChatMessage("container.isLocked", new Object[]{ichatbasecomponent}), true); + entityhuman.a(SoundEffects.BLOCK_CHEST_LOCKED, SoundCategory.BLOCKS, 1.0F, 1.0F); + return false; + } else { +diff --git a/src/main/java/net/minecraft/server/TileEntityDispenser.java b/src/main/java/net/minecraft/server/TileEntityDispenser.java +index 2fdee45e359d21fd73a1748ec0e534a6260c1588..4a0c893fe53e14aa4d990d2309c6ae780d7261e0 100644 +--- a/src/main/java/net/minecraft/server/TileEntityDispenser.java ++++ b/src/main/java/net/minecraft/server/TileEntityDispenser.java +@@ -57,12 +57,12 @@ public class TileEntityDispenser extends TileEntityLootable { + } + + public int h() { +- this.d((EntityHuman) null); ++ this.d(null); + int i = -1; + int j = 1; + + for (int k = 0; k < this.items.size(); ++k) { +- if (!((ItemStack) this.items.get(k)).isEmpty() && TileEntityDispenser.a.nextInt(j++) == 0) { ++ if (!this.items.get(k).isEmpty() && TileEntityDispenser.a.nextInt(j++) == 0) { + i = k; + } + } +@@ -72,7 +72,7 @@ public class TileEntityDispenser extends TileEntityLootable { + + public int addItem(ItemStack itemstack) { + for (int i = 0; i < this.items.size(); ++i) { +- if (((ItemStack) this.items.get(i)).isEmpty()) { ++ if (this.items.get(i).isEmpty()) { + this.setItem(i, itemstack); + return i; + } +diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java +index 159db8d095f9abed59348594147a640cec96889f..bacd53bee064f28a0556aaa59b1409d11b91eaec 100644 +--- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java ++++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java +@@ -194,21 +194,21 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick + } + + private void a(WorldServer worldserver) { +- Vec3D vec3d = (new Vec3D((double) this.getPosition().getX(), 0.0D, (double) this.getPosition().getZ())).d(); ++ Vec3D vec3d = (new Vec3D(this.getPosition().getX(), 0.0D, this.getPosition().getZ())).d(); + Vec3D vec3d1 = vec3d.a(1024.0D); + + int i; + +- for (i = 16; a((World) worldserver, vec3d1).b() > 0 && i-- > 0; vec3d1 = vec3d1.e(vec3d.a(-16.0D))) { ++ for (i = 16; a(worldserver, vec3d1).b() > 0 && i-- > 0; vec3d1 = vec3d1.e(vec3d.a(-16.0D))) { + TileEntityEndGateway.LOGGER.debug("Skipping backwards past nonempty chunk at {}", vec3d1); + } + +- for (i = 16; a((World) worldserver, vec3d1).b() == 0 && i-- > 0; vec3d1 = vec3d1.e(vec3d.a(16.0D))) { ++ for (i = 16; a(worldserver, vec3d1).b() == 0 && i-- > 0; vec3d1 = vec3d1.e(vec3d.a(16.0D))) { + TileEntityEndGateway.LOGGER.debug("Skipping forward past empty chunk at {}", vec3d1); + } + + TileEntityEndGateway.LOGGER.debug("Found chunk at {}", vec3d1); +- Chunk chunk = a((World) worldserver, vec3d1); ++ Chunk chunk = a(worldserver, vec3d1); + + this.exitPortal = a(chunk); + if (this.exitPortal == null) { +diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java +index 9d03a9ae7fe85fdd0550f737246eef2688a51c8e..303b92c9692a3d1f959a9a1f5667b4ea273a15a7 100644 +--- a/src/main/java/net/minecraft/server/TileEntityEnderChest.java ++++ b/src/main/java/net/minecraft/server/TileEntityEnderChest.java +@@ -38,7 +38,7 @@ public class TileEntityEnderChest extends TileEntity { // Paper - Remove ITickab + double d1 = (double) i + 0.5D; + + d0 = (double) k + 0.5D; +- this.world.playSound((EntityHuman) null, d1, (double) j + 0.5D, d0, SoundEffects.BLOCK_ENDER_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); ++ this.world.playSound(null, d1, (double) j + 0.5D, d0, SoundEffects.BLOCK_ENDER_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); + } + // Paper start + } +@@ -72,7 +72,7 @@ public class TileEntityEnderChest extends TileEntity { // Paper - Remove ITickab + double d2 = (double) k + 0.5D; + + MCUtil.scheduleTask(10, () -> { +- this.world.playSound((EntityHuman) null, d0, (double) j + 0.5D, d2, SoundEffects.BLOCK_ENDER_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); ++ this.world.playSound(null, d0, (double) j + 0.5D, d2, SoundEffects.BLOCK_ENDER_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); + }, "Chest Sounds"); + + if (this.a < 0.0F) { +diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java +index 497ca14dd5c6df02dfce897820967c3f6094a255..f7e757ebad8b70f6602c8ed3a7920924dbfef78e 100644 +--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java ++++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java +@@ -107,66 +107,66 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + } + Map map = Maps.newLinkedHashMap(); + +- a(map, (IMaterial) Items.LAVA_BUCKET, 20000); +- a(map, (IMaterial) Blocks.COAL_BLOCK, 16000); +- a(map, (IMaterial) Items.BLAZE_ROD, 2400); +- a(map, (IMaterial) Items.COAL, 1600); +- a(map, (IMaterial) Items.CHARCOAL, 1600); +- a(map, (Tag) TagsItem.LOGS, 300); +- a(map, (Tag) TagsItem.PLANKS, 300); +- a(map, (Tag) TagsItem.WOODEN_STAIRS, 300); +- a(map, (Tag) TagsItem.WOODEN_SLABS, 150); +- a(map, (Tag) TagsItem.WOODEN_TRAPDOORS, 300); +- a(map, (Tag) TagsItem.WOODEN_PRESSURE_PLATES, 300); +- a(map, (IMaterial) Blocks.OAK_FENCE, 300); +- a(map, (IMaterial) Blocks.BIRCH_FENCE, 300); +- a(map, (IMaterial) Blocks.SPRUCE_FENCE, 300); +- a(map, (IMaterial) Blocks.JUNGLE_FENCE, 300); +- a(map, (IMaterial) Blocks.DARK_OAK_FENCE, 300); +- a(map, (IMaterial) Blocks.ACACIA_FENCE, 300); +- a(map, (IMaterial) Blocks.OAK_FENCE_GATE, 300); +- a(map, (IMaterial) Blocks.BIRCH_FENCE_GATE, 300); +- a(map, (IMaterial) Blocks.SPRUCE_FENCE_GATE, 300); +- a(map, (IMaterial) Blocks.JUNGLE_FENCE_GATE, 300); +- a(map, (IMaterial) Blocks.DARK_OAK_FENCE_GATE, 300); +- a(map, (IMaterial) Blocks.ACACIA_FENCE_GATE, 300); +- a(map, (IMaterial) Blocks.NOTE_BLOCK, 300); +- a(map, (IMaterial) Blocks.BOOKSHELF, 300); +- a(map, (IMaterial) Blocks.LECTERN, 300); +- a(map, (IMaterial) Blocks.JUKEBOX, 300); +- a(map, (IMaterial) Blocks.CHEST, 300); +- a(map, (IMaterial) Blocks.TRAPPED_CHEST, 300); +- a(map, (IMaterial) Blocks.CRAFTING_TABLE, 300); +- a(map, (IMaterial) Blocks.DAYLIGHT_DETECTOR, 300); +- a(map, (Tag) TagsItem.BANNERS, 300); +- a(map, (IMaterial) Items.BOW, 300); +- a(map, (IMaterial) Items.FISHING_ROD, 300); +- a(map, (IMaterial) Blocks.LADDER, 300); +- a(map, (Tag) TagsItem.SIGNS, 200); +- a(map, (IMaterial) Items.WOODEN_SHOVEL, 200); +- a(map, (IMaterial) Items.WOODEN_SWORD, 200); +- a(map, (IMaterial) Items.WOODEN_HOE, 200); +- a(map, (IMaterial) Items.WOODEN_AXE, 200); +- a(map, (IMaterial) Items.WOODEN_PICKAXE, 200); +- a(map, (Tag) TagsItem.WOODEN_DOORS, 200); +- a(map, (Tag) TagsItem.BOATS, 1200); +- a(map, (Tag) TagsItem.WOOL, 100); +- a(map, (Tag) TagsItem.WOODEN_BUTTONS, 100); +- a(map, (IMaterial) Items.STICK, 100); +- a(map, (Tag) TagsItem.SAPLINGS, 100); +- a(map, (IMaterial) Items.BOWL, 100); +- a(map, (Tag) TagsItem.CARPETS, 67); +- a(map, (IMaterial) Blocks.DRIED_KELP_BLOCK, 4001); +- a(map, (IMaterial) Items.CROSSBOW, 300); +- a(map, (IMaterial) Blocks.BAMBOO, 50); +- a(map, (IMaterial) Blocks.DEAD_BUSH, 100); +- a(map, (IMaterial) Blocks.SCAFFOLDING, 400); +- a(map, (IMaterial) Blocks.LOOM, 300); +- a(map, (IMaterial) Blocks.BARREL, 300); +- a(map, (IMaterial) Blocks.CARTOGRAPHY_TABLE, 300); +- a(map, (IMaterial) Blocks.FLETCHING_TABLE, 300); +- a(map, (IMaterial) Blocks.SMITHING_TABLE, 300); +- a(map, (IMaterial) Blocks.COMPOSTER, 300); ++ a(map, Items.LAVA_BUCKET, 20000); ++ a(map, Blocks.COAL_BLOCK, 16000); ++ a(map, Items.BLAZE_ROD, 2400); ++ a(map, Items.COAL, 1600); ++ a(map, Items.CHARCOAL, 1600); ++ a(map, TagsItem.LOGS, 300); ++ a(map, TagsItem.PLANKS, 300); ++ a(map, TagsItem.WOODEN_STAIRS, 300); ++ a(map, TagsItem.WOODEN_SLABS, 150); ++ a(map, TagsItem.WOODEN_TRAPDOORS, 300); ++ a(map, TagsItem.WOODEN_PRESSURE_PLATES, 300); ++ a(map, Blocks.OAK_FENCE, 300); ++ a(map, Blocks.BIRCH_FENCE, 300); ++ a(map, Blocks.SPRUCE_FENCE, 300); ++ a(map, Blocks.JUNGLE_FENCE, 300); ++ a(map, Blocks.DARK_OAK_FENCE, 300); ++ a(map, Blocks.ACACIA_FENCE, 300); ++ a(map, Blocks.OAK_FENCE_GATE, 300); ++ a(map, Blocks.BIRCH_FENCE_GATE, 300); ++ a(map, Blocks.SPRUCE_FENCE_GATE, 300); ++ a(map, Blocks.JUNGLE_FENCE_GATE, 300); ++ a(map, Blocks.DARK_OAK_FENCE_GATE, 300); ++ a(map, Blocks.ACACIA_FENCE_GATE, 300); ++ a(map, Blocks.NOTE_BLOCK, 300); ++ a(map, Blocks.BOOKSHELF, 300); ++ a(map, Blocks.LECTERN, 300); ++ a(map, Blocks.JUKEBOX, 300); ++ a(map, Blocks.CHEST, 300); ++ a(map, Blocks.TRAPPED_CHEST, 300); ++ a(map, Blocks.CRAFTING_TABLE, 300); ++ a(map, Blocks.DAYLIGHT_DETECTOR, 300); ++ a(map, TagsItem.BANNERS, 300); ++ a(map, Items.BOW, 300); ++ a(map, Items.FISHING_ROD, 300); ++ a(map, Blocks.LADDER, 300); ++ a(map, TagsItem.SIGNS, 200); ++ a(map, Items.WOODEN_SHOVEL, 200); ++ a(map, Items.WOODEN_SWORD, 200); ++ a(map, Items.WOODEN_HOE, 200); ++ a(map, Items.WOODEN_AXE, 200); ++ a(map, Items.WOODEN_PICKAXE, 200); ++ a(map, TagsItem.WOODEN_DOORS, 200); ++ a(map, TagsItem.BOATS, 1200); ++ a(map, TagsItem.WOOL, 100); ++ a(map, TagsItem.WOODEN_BUTTONS, 100); ++ a(map, Items.STICK, 100); ++ a(map, TagsItem.SAPLINGS, 100); ++ a(map, Items.BOWL, 100); ++ a(map, TagsItem.CARPETS, 67); ++ a(map, Blocks.DRIED_KELP_BLOCK, 4001); ++ a(map, Items.CROSSBOW, 300); ++ a(map, Blocks.BAMBOO, 50); ++ a(map, Blocks.DEAD_BUSH, 100); ++ a(map, Blocks.SCAFFOLDING, 400); ++ a(map, Blocks.LOOM, 300); ++ a(map, Blocks.BARREL, 300); ++ a(map, Blocks.CARTOGRAPHY_TABLE, 300); ++ a(map, Blocks.FLETCHING_TABLE, 300); ++ a(map, Blocks.SMITHING_TABLE, 300); ++ a(map, Blocks.COMPOSTER, 300); + cachedFuelMap = map; // Yatopia + return map; + } +@@ -223,7 +223,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + + if (b(item)) { + if (SharedConstants.d) { +- throw (IllegalStateException) SystemUtils.c(new IllegalStateException("A developer tried to explicitly make fire resistant item " + item.h((ItemStack) null).getString() + " a furnace fuel. That will not work!")); ++ throw SystemUtils.c(new IllegalStateException("A developer tried to explicitly make fire resistant item " + item.h(null).getString() + " a furnace fuel. That will not work!")); + } + } else { + map.put(item, i); +@@ -242,7 +242,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + this.burnTime = nbttagcompound.getShort("BurnTime"); + this.cookTime = nbttagcompound.getShort("CookTime"); + this.cookTimeTotal = nbttagcompound.getShort("CookTimeTotal"); +- this.ticksForCurrentFuel = this.fuelTime((ItemStack) this.items.get(1)); ++ this.ticksForCurrentFuel = this.fuelTime(this.items.get(1)); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("RecipesUsed"); + Iterator iterator = nbttagcompound1.getKeys().iterator(); + +@@ -288,9 +288,9 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + } + + if (!this.world.isClientSide) { +- ItemStack itemstack = (ItemStack) this.items.get(1); ++ ItemStack itemstack = this.items.get(1); + +- if (!this.isBurning() && (itemstack.isEmpty() || ((ItemStack) this.items.get(0)).isEmpty())) { ++ if (!this.isBurning() && (itemstack.isEmpty() || this.items.get(0).isEmpty())) { + if (!this.isBurning() && this.cookTime > 0) { + this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal); + } +@@ -341,7 +341,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + + if (flag != this.isBurning()) { + flag1 = true; +- this.world.setTypeAndData(this.position, (IBlockData) this.world.getType(this.position).set(BlockFurnace.LIT, this.isBurning()), 3); ++ this.world.setTypeAndData(this.position, this.world.getType(this.position).set(BlockFurnace.LIT, this.isBurning()), 3); + } + } + +@@ -352,13 +352,13 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + } + + protected boolean canBurn(@Nullable IRecipe irecipe) { +- if (!((ItemStack) this.items.get(0)).isEmpty() && irecipe != null) { ++ if (!this.items.get(0).isEmpty() && irecipe != null) { + ItemStack itemstack = irecipe.getResult(); + + if (itemstack.isEmpty()) { + return false; + } else { +- ItemStack itemstack1 = (ItemStack) this.items.get(2); ++ ItemStack itemstack1 = this.items.get(2); + + return itemstack1.isEmpty() ? true : (!itemstack1.doMaterialsMatch(itemstack) ? false : (itemstack1.getCount() < this.getMaxStackSize() && itemstack1.getCount() < itemstack1.getMaxStackSize() ? true : itemstack1.getCount() < itemstack.getMaxStackSize())); + } +@@ -369,9 +369,9 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + + private void burn(@Nullable IRecipe irecipe) { + if (irecipe != null && this.canBurn(irecipe)) { +- ItemStack itemstack = (ItemStack) this.items.get(0); ++ ItemStack itemstack = this.items.get(0); + ItemStack itemstack1 = irecipe.getResult(); +- ItemStack itemstack2 = (ItemStack) this.items.get(2); ++ ItemStack itemstack2 = this.items.get(2); + + // CraftBukkit start - fire FurnaceSmeltEvent + CraftItemStack source = CraftItemStack.asCraftMirror(itemstack); +@@ -410,7 +410,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + this.a(irecipe); + } + +- if (itemstack.getItem() == Blocks.WET_SPONGE.getItem() && !((ItemStack) this.items.get(1)).isEmpty() && ((ItemStack) this.items.get(1)).getItem() == Items.BUCKET) { ++ if (itemstack.getItem() == Blocks.WET_SPONGE.getItem() && !this.items.get(1).isEmpty() && this.items.get(1).getItem() == Items.BUCKET) { + this.items.set(1, new ItemStack(Items.WATER_BUCKET)); + } + +@@ -424,12 +424,12 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + } else { + Item item = itemstack.getItem(); + +- return (Integer) f().getOrDefault(item, 0); ++ return f().getOrDefault(item, 0); + } + } + + protected int getRecipeCookingTime() { +- return (this.hasWorld()) ? (Integer) this.world.getCraftingManager().craft((Recipes) this.c, this, this.world).map(RecipeCooking::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302 // Eclipse fail ++ return (this.hasWorld()) ? this.world.getCraftingManager().craft((Recipes) this.c, this, this.world).map(RecipeCooking::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302 // Eclipse fail + } + + public static boolean isFuel(ItemStack itemstack) { +@@ -483,7 +483,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + + @Override + public ItemStack getItem(int i) { +- return (ItemStack) this.items.get(i); ++ return this.items.get(i); + } + + @Override +@@ -498,7 +498,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + + @Override + public void setItem(int i, ItemStack itemstack) { +- ItemStack itemstack1 = (ItemStack) this.items.get(i); ++ ItemStack itemstack1 = this.items.get(i); + boolean flag = !itemstack.isEmpty() && itemstack.doMaterialsMatch(itemstack1) && ItemStack.equals(itemstack, itemstack1); + + this.items.set(i, itemstack); +@@ -526,7 +526,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + } else if (i != 1) { + return true; + } else { +- ItemStack itemstack1 = (ItemStack) this.items.get(1); ++ ItemStack itemstack1 = this.items.get(1); + + return isFuel(itemstack) || itemstack.getItem() == Items.BUCKET && itemstack1.getItem() != Items.BUCKET; + } +@@ -576,7 +576,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + while (objectiterator.hasNext()) { + Entry entry = (Entry) objectiterator.next(); + +- world.getCraftingManager().a((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> { ++ world.getCraftingManager().a(entry.getKey()).ifPresent((irecipe) -> { + list.add(irecipe); + a(world, vec3d, entry.getIntValue(), ((RecipeCooking) irecipe).getExperience(), entityhuman, itemstack, amount); // CraftBukkit + }); +diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java +index 4285e9e4c1064468922b66d8cafbd102827f7f24..fc20b6d0ab48b733a82b2aae5ceafbbd6ed47e67 100644 +--- a/src/main/java/net/minecraft/server/TileEntityHopper.java ++++ b/src/main/java/net/minecraft/server/TileEntityHopper.java +@@ -86,7 +86,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + + @Override + public ItemStack splitStack(int i, int j) { +- this.d((EntityHuman) null); ++ this.d(null); + return ContainerUtil.a(this.f(), i, j); + } + +@@ -109,7 +109,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + + @Override + public void setItem(int i, ItemStack itemstack) { +- this.d((EntityHuman) null); ++ this.d(null); + this.f().set(i, itemstack); + if (itemstack.getCount() > this.getMaxStackSize()) { + itemstack.setCount(this.getMaxStackSize()); +@@ -131,7 +131,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + this.setCooldown(0); + // Spigot start + boolean result = this.a(() -> { +- return a((IHopper) this); ++ return a(this); + }); + if (!result && this.world.spigotConfig.hopperCheck > 1 && this.world.spigotConfig.hopperCheck > this.getCooldown()) { // Origami - only set check cooldown if it's bigger than already set one + this.setCooldown(this.world.spigotConfig.hopperCheck); +@@ -164,7 +164,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + + private boolean a(Supplier supplier) { + if (this.world != null && !this.world.isClientSide) { +- if (!this.m() && (Boolean) this.getBlock().get(BlockHopper.ENABLED)) { ++ if (!this.m() && this.getBlock().get(BlockHopper.ENABLED)) { + boolean flag = false; + + if (!this.isEmpty()) { +@@ -176,7 +176,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + } + + if (!this.j()) { +- flag |= (Boolean) supplier.get(); ++ flag |= supplier.get(); + } + + if (flag) { +@@ -374,7 +374,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + if (iinventory == null) { + return false; + } else { +- EnumDirection enumdirection = ((EnumDirection) this.getBlock().get(BlockHopper.FACING)).opposite(); ++ EnumDirection enumdirection = this.getBlock().get(BlockHopper.FACING).opposite(); + + if (this.b(iinventory, enumdirection)) { + return false; +@@ -504,7 +504,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + } + + entityitem = (EntityItem) iterator.next(); +- } while (!a((IInventory) ihopper, entityitem)); ++ } while (!a(ihopper, entityitem)); + + if (ihopper instanceof TileEntityHopper) ((TileEntityHopper) ihopper).shouldTick = true; // Origami - don't tick empty hoppers + return true; +@@ -569,7 +569,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + } + // CraftBukkit end + ItemStack itemstack = entityitem.getItemStack().cloneItemStack(); +- ItemStack itemstack1 = addItem((IInventory) null, iinventory, itemstack, (EnumDirection) null); ++ ItemStack itemstack1 = addItem(null, iinventory, itemstack, null); + + if (itemstack1.isEmpty()) { + flag = true; +@@ -662,7 +662,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + if(this.cachedPush != null) { + return this.cachedPush; + } +- EnumDirection enumdirection = (EnumDirection) this.getBlock().get(BlockHopper.FACING); ++ EnumDirection enumdirection = this.getBlock().get(BlockHopper.FACING); + + IInventory tmp = b(this.getWorld(), this.position.shift(enumdirection), this.cachedPushAir); + if(tmp != null && !(tmp instanceof IWorldInventory) && !(tmp instanceof Entity)) { +@@ -731,7 +731,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + TileEntity tileentity = world.getTileEntity(blockposition); + + if (tileentity instanceof IInventory) { +- object = (IInventory) tileentity; ++ object = tileentity; + if (object instanceof TileEntityChest && block instanceof BlockChest) { + object = BlockChest.getInventory((BlockChest) block, iblockdata, world, blockposition, true); + } +@@ -743,7 +743,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + List list = world.getEntities((Entity) null, new AxisAlignedBB(d0 - 0.5D, d1 - 0.5D, d2 - 0.5D, d0 + 0.5D, d1 + 0.5D, d2 + 0.5D), IEntitySelector.d); + + if (!list.isEmpty()) { +- object = (IInventory) list.get(world.random.nextInt(list.size())); ++ object = list.get(world.random.nextInt(list.size())); + } + } + +@@ -795,10 +795,10 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi + if (entity instanceof EntityItem) { + BlockPosition blockposition = this.getPosition(); + +- if (VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), this.ac_(), OperatorBoolean.AND)) { ++ if (VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d(-blockposition.getX(), -blockposition.getY(), -blockposition.getZ())), this.ac_(), OperatorBoolean.AND)) { + enableTicking(this, 0); // Origami - don't tick empty hoppers + this.a(() -> { +- return a((IInventory) this, (EntityItem) entity); ++ return a(this, (EntityItem) entity); + }); + } + } +diff --git a/src/main/java/net/minecraft/server/TileEntityLectern.java b/src/main/java/net/minecraft/server/TileEntityLectern.java +index 0651a733c7d18606e637fae3ab6602e544dd92da..e99b2ee69f299b0c76dc72380e51d66523b24e24 100644 +--- a/src/main/java/net/minecraft/server/TileEntityLectern.java ++++ b/src/main/java/net/minecraft/server/TileEntityLectern.java +@@ -54,7 +54,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv + + @Override + public InventoryHolder getOwner() { +- return (Lectern) TileEntityLectern.this.getOwner(); ++ return TileEntityLectern.this.getOwner(); + } + // CraftBukkit end + +@@ -194,7 +194,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv + } + + public void setBook(ItemStack itemstack) { +- this.a(itemstack, (EntityHuman) null); ++ this.a(itemstack, null); + } + + private void k() { +@@ -277,7 +277,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv + object = entityhuman.getScoreboardDisplayName(); + } + +- Vec3D vec3d = Vec3D.a((BaseBlockPosition) this.position); ++ Vec3D vec3d = Vec3D.a(this.position); + + // CraftBukkit - this + return new CommandListenerWrapper(this, vec3d, Vec2F.a, (WorldServer) this.world, 2, s, (IChatBaseComponent) object, this.world.getMinecraftServer(), entityhuman); +@@ -292,7 +292,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv + public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) { + super.load(iblockdata, nbttagcompound); + if (nbttagcompound.hasKeyOfType("Book", 10)) { +- this.book = this.b(ItemStack.a(nbttagcompound.getCompound("Book")), (EntityHuman) null); ++ this.book = this.b(ItemStack.a(nbttagcompound.getCompound("Book")), null); + } else { + this.book = ItemStack.b; + } +diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java +index 634f7a444e98537a6895c2ac2a892f9f39e2fde9..0e1fe9e3b01313bba6d8bd2ccf09724791621686 100644 +--- a/src/main/java/net/minecraft/server/TileEntityLootable.java ++++ b/src/main/java/net/minecraft/server/TileEntityLootable.java +@@ -77,7 +77,7 @@ public abstract class TileEntityLootable extends TileEntityContainer { + + @Override + public boolean isEmpty() { +- this.d((EntityHuman) null); ++ this.d(null); + // Paper start + for (ItemStack itemStack : this.f()) { + if (!itemStack.isEmpty()) { +@@ -90,13 +90,13 @@ public abstract class TileEntityLootable extends TileEntityContainer { + + @Override + public ItemStack getItem(int i) { +- if (i == 0) this.d((EntityHuman) null); // Paper +- return (ItemStack) this.f().get(i); ++ if (i == 0) this.d(null); // Paper ++ return this.f().get(i); + } + + @Override + public ItemStack splitStack(int i, int j) { +- this.d((EntityHuman) null); ++ this.d(null); + ItemStack itemstack = ContainerUtil.a(this.f(), i, j); + + if (!itemstack.isEmpty()) { +@@ -108,13 +108,13 @@ public abstract class TileEntityLootable extends TileEntityContainer { + + @Override + public ItemStack splitWithoutUpdate(int i) { +- this.d((EntityHuman) null); ++ this.d(null); + return ContainerUtil.a(this.f(), i); + } + + @Override + public void setItem(int i, ItemStack itemstack) { +- this.d((EntityHuman) null); ++ this.d(null); + this.f().set(i, itemstack); + if (itemstack.getCount() > this.getMaxStackSize()) { + itemstack.setCount(this.getMaxStackSize()); +diff --git a/src/main/java/net/minecraft/server/TileEntityPiston.java b/src/main/java/net/minecraft/server/TileEntityPiston.java +index faf5e4aff0584df082fad8337d15b325fb9cea08..085c7d659e9ce5791118a72edf9ee183d2a5bcae 100644 +--- a/src/main/java/net/minecraft/server/TileEntityPiston.java ++++ b/src/main/java/net/minecraft/server/TileEntityPiston.java +@@ -73,17 +73,17 @@ public class TileEntityPiston extends TileEntity implements ITickable { + } + + private IBlockData x() { +- return !this.d() && this.h() && this.a.getBlock() instanceof BlockPiston ? (IBlockData) ((IBlockData) ((IBlockData) Blocks.PISTON_HEAD.getBlockData().set(BlockPistonExtension.SHORT, this.i > 0.25F)).set(BlockPistonExtension.TYPE, this.a.a(Blocks.STICKY_PISTON) ? BlockPropertyPistonType.STICKY : BlockPropertyPistonType.DEFAULT)).set(BlockPistonExtension.FACING, this.a.get(BlockPiston.FACING)) : this.a; ++ return !this.d() && this.h() && this.a.getBlock() instanceof BlockPiston ? Blocks.PISTON_HEAD.getBlockData().set(BlockPistonExtension.SHORT, this.i > 0.25F).set(BlockPistonExtension.TYPE, this.a.a(Blocks.STICKY_PISTON) ? BlockPropertyPistonType.STICKY : BlockPropertyPistonType.DEFAULT).set(BlockDirectional.FACING, this.a.get(BlockDirectional.FACING)) : this.a; + } + + private void f(float f) { + EnumDirection enumdirection = this.j(); +- double d0 = (double) (f - this.i); ++ double d0 = f - this.i; + VoxelShape voxelshape = this.x().getCollisionShape(this.world, this.getPosition()); + + if (!voxelshape.isEmpty()) { + AxisAlignedBB axisalignedbb = this.a(voxelshape.getBoundingBox()); +- List list = this.world.getEntities((Entity) null, PistonUtil.a(axisalignedbb, enumdirection, d0).b(axisalignedbb)); ++ List list = this.world.getEntities(null, PistonUtil.a(axisalignedbb, enumdirection, d0).b(axisalignedbb)); + + if (!list.isEmpty()) { + List list1 = voxelshape.d(); +@@ -102,13 +102,13 @@ public class TileEntityPiston extends TileEntity implements ITickable { + + switch (enumdirection.n()) { + case X: +- d1 = (double) enumdirection.getAdjacentX(); ++ d1 = enumdirection.getAdjacentX(); + break; + case Y: +- d2 = (double) enumdirection.getAdjacentY(); ++ d2 = enumdirection.getAdjacentY(); + break; + case Z: +- d3 = (double) enumdirection.getAdjacentZ(); ++ d3 = enumdirection.getAdjacentZ(); + } + + entity.setMot(d1, d2, d3); +@@ -165,7 +165,7 @@ public class TileEntityPiston extends TileEntity implements ITickable { + if (enumdirection.n().d()) { + double d0 = this.a.getCollisionShape(this.world, this.position).c(EnumDirection.EnumAxis.Y); + AxisAlignedBB axisalignedbb = this.a(new AxisAlignedBB(0.0D, d0, 0.0D, 1.0D, 1.5000000999999998D, 1.0D)); +- double d1 = (double) (f - this.i); ++ double d1 = f - this.i; + List list = this.world.getEntities((Entity) null, axisalignedbb, (entity) -> { + return a(axisalignedbb, entity); + }); +@@ -212,7 +212,7 @@ public class TileEntityPiston extends TileEntity implements ITickable { + } + + private AxisAlignedBB a(AxisAlignedBB axisalignedbb) { +- double d0 = (double) this.e(this.i); ++ double d0 = this.e(this.i); + + return axisalignedbb.d((double) this.position.getX() + d0 * (double) this.b.getAdjacentX(), (double) this.position.getY() + d0 * (double) this.b.getAdjacentY(), (double) this.position.getZ() + d0 * (double) this.b.getAdjacentZ()); + } +@@ -250,7 +250,7 @@ public class TileEntityPiston extends TileEntity implements ITickable { + if (this.g) { + iblockdata = Blocks.AIR.getBlockData(); + } else { +- iblockdata = Block.b(this.a, (GeneratorAccess) this.world, this.position); ++ iblockdata = Block.b(this.a, this.world, this.position); + } + + // Tuinity start - pushable TE's +@@ -288,14 +288,14 @@ public class TileEntityPiston extends TileEntity implements ITickable { + this.world.removeTileEntity(this.position); + this.an_(); + if (this.a != null && this.world.getType(this.position).a(Blocks.MOVING_PISTON)) { +- IBlockData iblockdata = Block.b(this.a, (GeneratorAccess) this.world, this.position); ++ IBlockData iblockdata = Block.b(this.a, this.world, this.position); + + if (iblockdata.isAir()) { + this.world.setTypeAndData(this.position, this.a, com.destroystokyo.paper.PaperConfig.allowPistonDuplication ? 84 : (84 | 2)); // Paper - force notify (flag 2), it's possible the set type by the piston block (which doesn't notify) set this block to air + Block.a(this.a, iblockdata, this.world, this.position, 3); + } else { +- if (iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C)) { +- iblockdata = (IBlockData) iblockdata.set(BlockProperties.C, false); ++ if (iblockdata.b(BlockProperties.C) && iblockdata.get(BlockProperties.C)) { ++ iblockdata = iblockdata.set(BlockProperties.C, false); + } + + // Tuinity start - pushable TE's +@@ -365,12 +365,12 @@ public class TileEntityPiston extends TileEntity implements ITickable { + VoxelShape voxelshape; + + if (!this.c && this.g) { +- voxelshape = ((IBlockData) this.a.set(BlockPiston.EXTENDED, true)).getCollisionShape(iblockaccess, blockposition); ++ voxelshape = this.a.set(BlockPiston.EXTENDED, true).getCollisionShape(iblockaccess, blockposition); + } else { + voxelshape = VoxelShapes.a(); + } + +- EnumDirection enumdirection = (EnumDirection) TileEntityPiston.h.get(); ++ EnumDirection enumdirection = TileEntityPiston.h.get(); + + if ((double) this.i < 1.0D && enumdirection == this.j()) { + return voxelshape; +@@ -378,15 +378,15 @@ public class TileEntityPiston extends TileEntity implements ITickable { + IBlockData iblockdata; + + if (this.h()) { +- iblockdata = (IBlockData) ((IBlockData) Blocks.PISTON_HEAD.getBlockData().set(BlockPistonExtension.FACING, this.b)).set(BlockPistonExtension.SHORT, this.c != 1.0F - this.i < 0.25F); ++ iblockdata = Blocks.PISTON_HEAD.getBlockData().set(BlockDirectional.FACING, this.b).set(BlockPistonExtension.SHORT, this.c != 1.0F - this.i < 0.25F); + } else { + iblockdata = this.a; + } + + float f = this.e(this.i); +- double d0 = (double) ((float) this.b.getAdjacentX() * f); +- double d1 = (double) ((float) this.b.getAdjacentY() * f); +- double d2 = (double) ((float) this.b.getAdjacentZ() * f); ++ double d0 = (float) this.b.getAdjacentX() * f; ++ double d1 = (float) this.b.getAdjacentY() * f; ++ double d2 = (float) this.b.getAdjacentZ() * f; + + return VoxelShapes.a(voxelshape, iblockdata.getCollisionShape(iblockaccess, blockposition).a(d0, d1, d2)); + } +diff --git a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java +index 9eee9c250d4b6cf28951cf9c0cee961268947320..b3d7164620aae7a45709bd9ae39992234e339d19 100644 +--- a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java ++++ b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java +@@ -70,7 +70,7 @@ public class TileEntityShulkerBox extends TileEntityLootable implements IWorldIn + } + + public TileEntityShulkerBox() { +- this((EnumColor) null); ++ this(null); + this.m = true; + } + +@@ -117,32 +117,32 @@ public class TileEntityShulkerBox extends TileEntityLootable implements IWorldIn + } + + public AxisAlignedBB a(IBlockData iblockdata) { +- return this.b((EnumDirection) iblockdata.get(BlockShulkerBox.a)); ++ return this.b(iblockdata.get(BlockShulkerBox.a)); + } + + public AxisAlignedBB b(EnumDirection enumdirection) { + float f = this.a(1.0F); + +- return VoxelShapes.b().getBoundingBox().b((double) (0.5F * f * (float) enumdirection.getAdjacentX()), (double) (0.5F * f * (float) enumdirection.getAdjacentY()), (double) (0.5F * f * (float) enumdirection.getAdjacentZ())); ++ return VoxelShapes.b().getBoundingBox().b(0.5F * f * (float) enumdirection.getAdjacentX(), 0.5F * f * (float) enumdirection.getAdjacentY(), 0.5F * f * (float) enumdirection.getAdjacentZ()); + } + + private AxisAlignedBB c(EnumDirection enumdirection) { + EnumDirection enumdirection1 = enumdirection.opposite(); + +- return this.b(enumdirection).a((double) enumdirection1.getAdjacentX(), (double) enumdirection1.getAdjacentY(), (double) enumdirection1.getAdjacentZ()); ++ return this.b(enumdirection).a(enumdirection1.getAdjacentX(), enumdirection1.getAdjacentY(), enumdirection1.getAdjacentZ()); + } + + private void m() { + IBlockData iblockdata = this.world.getType(this.getPosition()); + + if (iblockdata.getBlock() instanceof BlockShulkerBox) { +- EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockShulkerBox.a); ++ EnumDirection enumdirection = iblockdata.get(BlockShulkerBox.a); + AxisAlignedBB axisalignedbb = this.c(enumdirection).a(this.position); +- List list = this.world.getEntities((Entity) null, axisalignedbb); ++ List list = this.world.getEntities(null, axisalignedbb); + + if (!list.isEmpty()) { + for (int i = 0; i < list.size(); ++i) { +- Entity entity = (Entity) list.get(i); ++ Entity entity = list.get(i); + + if (entity.getPushReaction() != EnumPistonReaction.IGNORE) { + double d0 = 0.0D; +@@ -227,7 +227,7 @@ public class TileEntityShulkerBox extends TileEntityLootable implements IWorldIn + if (opened) return; // CraftBukkit - only animate if the ShulkerBox hasn't been forced open already by an API call. + this.world.playBlockAction(this.position, this.getBlock().getBlock(), 1, this.c); + if (this.c == 1) { +- this.world.playSound((EntityHuman) null, this.position, SoundEffects.BLOCK_SHULKER_BOX_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); ++ this.world.playSound(null, this.position, SoundEffects.BLOCK_SHULKER_BOX_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); + } + } + +@@ -240,7 +240,7 @@ public class TileEntityShulkerBox extends TileEntityLootable implements IWorldIn + if (opened) return; // CraftBukkit - only animate if the ShulkerBox hasn't been forced open already by an API call. + this.world.playBlockAction(this.position, this.getBlock().getBlock(), 1, this.c); + if (this.c <= 0) { +- this.world.playSound((EntityHuman) null, this.position, SoundEffects.BLOCK_SHULKER_BOX_CLOSE, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); ++ this.world.playSound(null, this.position, SoundEffects.BLOCK_SHULKER_BOX_CLOSE, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F); + } + } + +diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java +index fa63d9c7eae6f38a953176be8bcf1125094c3c52..db650b20e3a7b0b1b4f6d8107e0129b4d33737b4 100644 +--- a/src/main/java/net/minecraft/server/TileEntitySign.java ++++ b/src/main/java/net/minecraft/server/TileEntitySign.java +@@ -73,7 +73,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // + + if (this.world instanceof WorldServer) { + try { +- this.lines[i] = ChatComponentUtils.filterForDisplay(this.a((EntityPlayer) null), ichatmutablecomponent, (Entity) null, 0); ++ this.lines[i] = ChatComponentUtils.filterForDisplay(this.a((EntityPlayer) null), ichatmutablecomponent, null, 0); + } catch (CommandSyntaxException commandsyntaxexception) { + this.lines[i] = ichatmutablecomponent; + } +@@ -175,7 +175,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // + Object object = entityplayer == null ? new ChatComponentText("Sign") : entityplayer.getScoreboardDisplayName(); + + // CraftBukkit - this +- return new CommandListenerWrapper(this, Vec3D.a((BaseBlockPosition) this.position), Vec2F.a, (WorldServer) this.world, 2, s, (IChatBaseComponent) object, this.world.getMinecraftServer(), entityplayer); ++ return new CommandListenerWrapper(this, Vec3D.a(this.position), Vec2F.a, (WorldServer) this.world, 2, s, (IChatBaseComponent) object, this.world.getMinecraftServer(), entityplayer); + } + + public EnumColor getColor() { +diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java +index b9def7587a1dad2acce3509cc7b82e9768f8b1bc..c3d5475e5953aa72a6bdca971809d32b1ddeea71 100644 +--- a/src/main/java/net/minecraft/server/TileEntitySkull.java ++++ b/src/main/java/net/minecraft/server/TileEntitySkull.java +@@ -125,7 +125,7 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa + String s = nbttagcompound.getString("ExtraType"); + + if (!UtilColor.b(s)) { +- this.setGameProfile(new GameProfile((UUID) null, s)); ++ this.setGameProfile(new GameProfile(null, s)); + } + } + +diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java +index d9421dc1afc86c8f1f4acacbe23a70ac8143bb19..6e66fbac665dcd26336bd1022ae4ff9881810687 100644 +--- a/src/main/java/net/minecraft/server/UserCache.java ++++ b/src/main/java/net/minecraft/server/UserCache.java +@@ -60,7 +60,7 @@ public class UserCache { + + gameprofilerepository.findProfilesByNames(new String[]{s}, Agent.MINECRAFT, profilelookupcallback); + if (!d() && agameprofile[0] == null && !org.apache.commons.lang3.StringUtils.isBlank(s)) { // Paper - Don't lookup a profile with a blank name +- UUID uuid = EntityHuman.a(new GameProfile((UUID) null, s)); ++ UUID uuid = EntityHuman.a(new GameProfile(null, s)); + GameProfile gameprofile = new GameProfile(uuid, s); + + profilelookupcallback.onProfileLookupSucceeded(gameprofile); +@@ -79,7 +79,7 @@ public class UserCache { + + public void saveProfile(GameProfile gameprofile) { a(gameprofile); } // Paper - OBFHELPER + public void a(GameProfile gameprofile) { +- this.a(gameprofile, (Date) null); ++ this.a(gameprofile, null); + } + + private void a(GameProfile gameprofile, Date date) { // Paper - synchronize // Tuinity - allow better concurrency +@@ -97,7 +97,7 @@ public class UserCache { + + try { this.stateLock.lock(); // Tuinity - allow better concurrency + //if (this.e.containsKey(uuid)) { // Paper +- UserCache.UserCacheEntry usercache_usercacheentry1 = (UserCache.UserCacheEntry) this.e.get(uuid); ++ UserCache.UserCacheEntry usercache_usercacheentry1 = this.e.get(uuid); + if (usercache_usercacheentry1 != null) { // Paper + + this.d.remove(usercache_usercacheentry1.a().getName().toLowerCase(Locale.ROOT)); +@@ -115,7 +115,7 @@ public class UserCache { + public GameProfile getProfile(String s) { // Paper - synchronize // Tuinity start - allow better concurrency + String s1 = s.toLowerCase(Locale.ROOT); + boolean stateLocked = true; try { this.stateLock.lock(); // Tuinity - allow better concurrency +- UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(s1); ++ UserCache.UserCacheEntry usercache_usercacheentry = this.d.get(s1); + + if (usercache_usercacheentry != null && (new Date()).getTime() >= usercache_usercacheentry.c.getTime()) { + this.e.remove(usercache_usercacheentry.a().getId()); +@@ -138,7 +138,7 @@ public class UserCache { + } finally { this.lookupLock.unlock(); } // Tuinity - allow better concurrency + if (gameprofile != null) { + this.a(gameprofile); +- usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(s1); ++ usercache_usercacheentry = this.d.get(s1); + } + } + +@@ -156,13 +156,13 @@ public class UserCache { + + @Nullable + public GameProfile getProfile(UUID uuid) { +- UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.e.get(uuid); ++ UserCache.UserCacheEntry usercache_usercacheentry = this.e.get(uuid); + + return usercache_usercacheentry == null ? null : usercache_usercacheentry.a(); + } + + private UserCache.UserCacheEntry b(UUID uuid) { +- UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.e.get(uuid); ++ UserCache.UserCacheEntry usercache_usercacheentry = this.e.get(uuid); + + if (usercache_usercacheentry != null) { + GameProfile gameprofile = usercache_usercacheentry.a(); +@@ -179,7 +179,7 @@ public class UserCache { + + try { + bufferedreader = Files.newReader(this.h, StandardCharsets.UTF_8); +- List list = (List) ChatDeserializer.a(this.b, (Reader) bufferedreader, UserCache.i); ++ List list = ChatDeserializer.a(this.b, bufferedreader, UserCache.i); + + this.d.clear(); + this.e.clear(); +diff --git a/src/main/java/net/minecraft/server/Vec3D.java b/src/main/java/net/minecraft/server/Vec3D.java +index 84858ba3923845a630d4886ecbd001c60d46131e..7c654a044a990f6f10b713094cc4e9af3c67b997 100644 +--- a/src/main/java/net/minecraft/server/Vec3D.java ++++ b/src/main/java/net/minecraft/server/Vec3D.java +@@ -14,11 +14,11 @@ public class Vec3D implements IPosition { + } + + public static Vec3D b(BaseBlockPosition baseblockposition) { +- return new Vec3D((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ()); ++ return new Vec3D(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()); + } + + public static Vec3D c(BaseBlockPosition baseblockposition) { +- return new Vec3D((double) baseblockposition.getX() + 0.5D, (double) baseblockposition.getY(), (double) baseblockposition.getZ() + 0.5D); ++ return new Vec3D((double) baseblockposition.getX() + 0.5D, baseblockposition.getY(), (double) baseblockposition.getZ() + 0.5D); + } + + public static Vec3D a(BaseBlockPosition baseblockposition, double d0) { +@@ -32,7 +32,7 @@ public class Vec3D implements IPosition { + } + + public Vec3D(Vector3fa vector3fa) { +- this((double) vector3fa.a(), (double) vector3fa.b(), (double) vector3fa.c()); ++ this(vector3fa.a(), vector3fa.b(), vector3fa.c()); + } + + public Vec3D a(Vec3D vec3d) { +@@ -40,7 +40,7 @@ public class Vec3D implements IPosition { + } + + public Vec3D d() { +- double d0 = (double) MathHelper.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); ++ double d0 = MathHelper.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + + return d0 < 1.0E-4D ? Vec3D.a : new Vec3D(this.x / d0, this.y / d0, this.z / d0); + } +@@ -79,7 +79,7 @@ public class Vec3D implements IPosition { + double d1 = vec3d.y - this.y; + double d2 = vec3d.z - this.z; + +- return (double) MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); ++ return MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + } + + public double distanceSquared(Vec3D vec3d) { +@@ -112,7 +112,7 @@ public class Vec3D implements IPosition { + + public final double magnitude() { return this.f(); } // Tuinity - OBFHELPER + public double f() { +- return (double) MathHelper.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); ++ return MathHelper.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + } + + public final double magnitudeSquared() { return this.g(); } // Tuinity - OBFHELPER +diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java +index 1e75251c2a47f524ad7f2dbb864674c7707bc58b..525b6c72905e507e3d6df604392648cfd90c55ca 100644 +--- a/src/main/java/net/minecraft/server/VillagePlace.java ++++ b/src/main/java/net/minecraft/server/VillagePlace.java +@@ -34,11 +34,11 @@ public class VillagePlace extends RegionFileSection { + } + + public void a(BlockPosition blockposition, VillagePlaceType villageplacetype) { +- ((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).a(blockposition, villageplacetype); ++ this.e(SectionPosition.a(blockposition).s()).a(blockposition, villageplacetype); + } + + public void a(BlockPosition blockposition) { +- ((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).a(blockposition); ++ this.e(SectionPosition.a(blockposition).s()).a(blockposition); + } + + public long a(Predicate predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { +@@ -46,9 +46,9 @@ public class VillagePlace extends RegionFileSection { + } + + public boolean a(VillagePlaceType villageplacetype, BlockPosition blockposition) { +- Optional optional = ((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).d(blockposition); ++ Optional optional = this.e(SectionPosition.a(blockposition).s()).d(blockposition); + +- return optional.isPresent() && ((VillagePlaceType) optional.get()).equals(villageplacetype); ++ return optional.isPresent() && optional.get().equals(villageplacetype); + } + + public Stream b(Predicate predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { +@@ -71,7 +71,7 @@ public class VillagePlace extends RegionFileSection { + return IntStream.range(0, 16).boxed().map((integer) -> { + return this.d(SectionPosition.a(chunkcoordintpair, integer).s()); + }).filter(Optional::isPresent).flatMap((optional) -> { +- return ((VillagePlaceSection) optional.get()).a(predicate, villageplace_occupancy); ++ return optional.get().a(predicate, villageplace_occupancy); + }); + } + +@@ -99,7 +99,7 @@ public class VillagePlace extends RegionFileSection { + } + + public Optional a(Predicate predicate, Predicate predicate1, VillagePlace.Occupancy villageplace_occupancy, BlockPosition blockposition, int i, Random random) { +- List list = (List) this.c(predicate, blockposition, i, villageplace_occupancy).collect(Collectors.toList()); ++ List list = this.c(predicate, blockposition, i, villageplace_occupancy).collect(Collectors.toList()); + + Collections.shuffle(list, random); + for (VillagePlaceRecord villageplacerecord : list) { +@@ -111,17 +111,17 @@ public class VillagePlace extends RegionFileSection { + } + + public boolean b(BlockPosition blockposition) { +- return ((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).c(blockposition); ++ return this.e(SectionPosition.a(blockposition).s()).c(blockposition); + } + + public boolean a(BlockPosition blockposition, Predicate predicate) { +- return (Boolean) this.d(SectionPosition.a(blockposition).s()).map((villageplacesection) -> { ++ return this.d(SectionPosition.a(blockposition).s()).map((villageplacesection) -> { + return villageplacesection.a(blockposition, predicate); + }).orElse(false); + } + + public Optional c(BlockPosition blockposition) { +- VillagePlaceSection villageplacesection = (VillagePlaceSection) this.e(SectionPosition.a(blockposition).s()); ++ VillagePlaceSection villageplacesection = this.e(SectionPosition.a(blockposition).s()); + + return villageplacesection.d(blockposition); + } +@@ -134,8 +134,8 @@ public class VillagePlace extends RegionFileSection { + private boolean f(long i) { + Optional optional = this.c(i); + +- return optional == null ? false : (Boolean) optional.map((villageplacesection) -> { +- return villageplacesection.a(VillagePlaceType.b, VillagePlace.Occupancy.IS_OCCUPIED).count() > 0L; ++ return optional == null ? false : optional.map((villageplacesection) -> { ++ return villageplacesection.a(VillagePlaceType.b, Occupancy.IS_OCCUPIED).count() > 0L; + }).orElse(false); + } + +@@ -146,8 +146,8 @@ public class VillagePlace extends RegionFileSection { + super.a(booleansupplier); + } else { + //super.a(booleansupplier); // re-implement below +- while (!((RegionFileSection)this).d.isEmpty() && booleansupplier.getAsBoolean()) { +- ChunkCoordIntPair chunkcoordintpair = SectionPosition.a(((RegionFileSection)this).d.firstLong()).r(); ++ while (!this.d.isEmpty() && booleansupplier.getAsBoolean()) { ++ ChunkCoordIntPair chunkcoordintpair = SectionPosition.a(this.d.firstLong()).r(); + + NBTTagCompound data; + try (co.aikar.timings.Timing ignored1 = this.world.timings.poiSaveDataSerialization.startTiming()) { +@@ -184,7 +184,7 @@ public class VillagePlace extends RegionFileSection { + }); + }, () -> { + if (a(chunksection)) { +- VillagePlaceSection villageplacesection = (VillagePlaceSection) this.e(sectionposition.s()); ++ VillagePlaceSection villageplacesection = this.e(sectionposition.s()); + + this.a(chunksection, sectionposition, villageplacesection::a); + } +@@ -215,7 +215,7 @@ public class VillagePlace extends RegionFileSection { + }).filter((pair) -> { + return !(Boolean) (pair.getSecond()).map(VillagePlaceSection::a).orElse(false); // Paper - decompile fix + }).map((pair) -> { +- return ((SectionPosition) pair.getFirst()).r(); ++ return pair.getFirst().r(); + }).filter((chunkcoordintpair) -> { + return this.b.add(chunkcoordintpair.pair()); + }).forEach((chunkcoordintpair) -> { +diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java +index 31783b9b1fe53ccb3ae39149bc066037b3074843..1dd54cc3bb470bd6a0dd247dd5590a17fc53d963 100644 +--- a/src/main/java/net/minecraft/server/VillageSiege.java ++++ b/src/main/java/net/minecraft/server/VillageSiege.java +@@ -100,7 +100,7 @@ public class VillageSiege implements MobSpawner { + + try { + entityzombie = new EntityZombie(worldserver); +- entityzombie.prepare(worldserver, worldserver.getDamageScaler(entityzombie.getChunkCoordinates()), EnumMobSpawn.EVENT, (GroupDataEntity) null, (NBTTagCompound) null); ++ entityzombie.prepare(worldserver, worldserver.getDamageScaler(entityzombie.getChunkCoordinates()), EnumMobSpawn.EVENT, null, null); + } catch (Exception exception) { + exception.printStackTrace(); + ServerInternalException.reportInternalException(exception); // Paper +@@ -121,7 +121,7 @@ public class VillageSiege implements MobSpawner { + BlockPosition blockposition1 = new BlockPosition(j, l, k); + + if (worldserver.b_(blockposition1) && EntityMonster.c(EntityTypes.ZOMBIE, worldserver, EnumMobSpawn.EVENT, blockposition1, worldserver.random)) { +- return Vec3D.c((BaseBlockPosition) blockposition1); ++ return Vec3D.c(blockposition1); + } + } + +diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java +index 9eb3996a0e927276327402653de395f6cfa3669f..5be45afb9e6cc9755583cd99bd44289785bd04ab 100644 +--- a/src/main/java/net/minecraft/server/VillagerTrades.java ++++ b/src/main/java/net/minecraft/server/VillagerTrades.java +@@ -100,7 +100,7 @@ public class VillagerTrades { + + ItemWorldMap.applySepiaFilter(worldserver, itemstack); + WorldMap.decorateMap(itemstack, blockposition, "+", this.c); +- itemstack.a((IChatBaseComponent) (new ChatMessage("filled_map." + this.b.i().toLowerCase(Locale.ROOT)))); ++ itemstack.a(new ChatMessage("filled_map." + this.b.i().toLowerCase(Locale.ROOT))); + return new MerchantRecipe(new ItemStack(Items.EMERALD, this.a), new ItemStack(Items.COMPASS), itemstack, this.d, this.e, 0.2F); + } else { + return null; +@@ -119,8 +119,8 @@ public class VillagerTrades { + + @Override + public MerchantRecipe a(Entity entity, Random random) { +- List list = (List) IRegistry.ENCHANTMENT.e().filter(Enchantment::h).collect(Collectors.toList()); +- Enchantment enchantment = (Enchantment) list.get(random.nextInt(list.size())); ++ List list = IRegistry.ENCHANTMENT.e().filter(Enchantment::h).collect(Collectors.toList()); ++ Enchantment enchantment = list.get(random.nextInt(list.size())); + int i = MathHelper.nextInt(random, enchantment.getStartLevel(), enchantment.getMaxLevel()); + ItemStack itemstack = ItemEnchantedBook.a(new WeightedRandomEnchant(enchantment, i)); + int j = 2 + random.nextInt(5 + i * 10) + 3 * i; +@@ -208,10 +208,10 @@ public class VillagerTrades { + @Override + public MerchantRecipe a(Entity entity, Random random) { + ItemStack itemstack = new ItemStack(Items.EMERALD, this.c); +- List list = (List) IRegistry.POTION.e().filter((potionregistry) -> { ++ List list = IRegistry.POTION.e().filter((potionregistry) -> { + return !potionregistry.a().isEmpty() && PotionBrewer.a(potionregistry); + }).collect(Collectors.toList()); +- PotionRegistry potionregistry = (PotionRegistry) list.get(random.nextInt(list.size())); ++ PotionRegistry potionregistry = list.get(random.nextInt(list.size())); + ItemStack itemstack1 = PotionUtil.a(new ItemStack(this.a.getItem(), this.b), potionregistry); + + return new MerchantRecipe(itemstack, new ItemStack(this.f, this.g), itemstack1, this.d, this.e, this.h); +@@ -336,7 +336,7 @@ public class VillagerTrades { + @Override + public MerchantRecipe a(Entity entity, Random random) { + if (entity instanceof VillagerDataHolder) { +- ItemStack itemstack = new ItemStack((IMaterial) this.a.get(((VillagerDataHolder) entity).getVillagerData().getType()), this.b); ++ ItemStack itemstack = new ItemStack(this.a.get(((VillagerDataHolder) entity).getVillagerData().getType()), this.b); + + return new MerchantRecipe(itemstack, new ItemStack(Items.EMERALD), this.c, this.d, 0.05F); + } else { +diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java +index f7a647ce5ae20843f2b2274857cd71eca399fa46..a0fb0341842670a474686904cf00bd4357b3fdd7 100644 +--- a/src/main/java/net/minecraft/server/VoxelShape.java ++++ b/src/main/java/net/minecraft/server/VoxelShape.java +@@ -31,7 +31,7 @@ public abstract class VoxelShape { + + public AxisAlignedBB getBoundingBox() { + if (this.isEmpty()) { +- throw (UnsupportedOperationException) SystemUtils.c(new UnsupportedOperationException("No bounds for empty shape.")); ++ throw SystemUtils.c(new UnsupportedOperationException("No bounds for empty shape.")); + } else { + return new AxisAlignedBB(this.b(EnumDirection.EnumAxis.X), this.b(EnumDirection.EnumAxis.Y), this.b(EnumDirection.EnumAxis.Z), this.c(EnumDirection.EnumAxis.X), this.c(EnumDirection.EnumAxis.Y), this.c(EnumDirection.EnumAxis.Z)); + } +@@ -49,7 +49,7 @@ public abstract class VoxelShape { + + public final VoxelShape offset(double x, double y, double z) { return this.a(x, y, z); } // Paper - OBFHELPER + public VoxelShape a(double d0, double d1, double d2) { +- return (VoxelShape) (this.isEmpty() ? VoxelShapes.a() : new VoxelShapeArray(this.a, new DoubleListOffset(this.a(EnumDirection.EnumAxis.X), d0), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Y), d1), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Z), d2))); ++ return this.isEmpty() ? VoxelShapes.a() : new VoxelShapeArray(this.a, new DoubleListOffset(this.a(EnumDirection.EnumAxis.X), d0), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Y), d1), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Z), d2)); + } + + // Tuinity start - optimise multi-aabb shapes +diff --git a/src/main/java/net/minecraft/server/VoxelShapeArray.java b/src/main/java/net/minecraft/server/VoxelShapeArray.java +index ee8b29fabcd706dfd324732daf22035848109aac..884ad8544822112507aaafef256135efc2c2ed65 100644 +--- a/src/main/java/net/minecraft/server/VoxelShapeArray.java ++++ b/src/main/java/net/minecraft/server/VoxelShapeArray.java +@@ -21,7 +21,7 @@ public final class VoxelShapeArray extends VoxelShape { + // Tuinity end - optimise multi-aabb shapes + + protected VoxelShapeArray(VoxelShapeDiscrete voxelshapediscrete, double[] adouble, double[] adouble1, double[] adouble2) { +- this(voxelshapediscrete, (DoubleList) DoubleArrayList.wrap(Arrays.copyOf(adouble, voxelshapediscrete.b() + 1)), (DoubleList) DoubleArrayList.wrap(Arrays.copyOf(adouble1, voxelshapediscrete.c() + 1)), (DoubleList) DoubleArrayList.wrap(Arrays.copyOf(adouble2, voxelshapediscrete.d() + 1))); ++ this(voxelshapediscrete, DoubleArrayList.wrap(Arrays.copyOf(adouble, voxelshapediscrete.b() + 1)), DoubleArrayList.wrap(Arrays.copyOf(adouble1, voxelshapediscrete.c() + 1)), DoubleArrayList.wrap(Arrays.copyOf(adouble2, voxelshapediscrete.d() + 1))); + } + + VoxelShapeArray(VoxelShapeDiscrete voxelshapediscrete, DoubleList doublelist, DoubleList doublelist1, DoubleList doublelist2) { +@@ -40,7 +40,7 @@ public final class VoxelShapeArray extends VoxelShape { + this.c = doublelist1; + this.d = doublelist2; + } else { +- throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException("Lengths of point arrays must be consistent with the size of the VoxelShape.")); ++ throw SystemUtils.c(new IllegalArgumentException("Lengths of point arrays must be consistent with the size of the VoxelShape.")); + } + // Tuinity start - optimise multi-aabb shapes + this.boundingBoxesRepresentation = boundingBoxesRepresentation == null ? this.getBoundingBoxesRepresentation().toArray(EMPTY) : boundingBoxesRepresentation; // Tuinity - optimise multi-aabb shapes +diff --git a/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java b/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java +index 30d9414d20617c3b6f58994f4268a81461b1d011..f5b472461fc924d3eadb8e01b3797317f0f0e45e 100644 +--- a/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java ++++ b/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java +@@ -88,18 +88,18 @@ public class VoxelShapeSpliterator extends AbstractSpliterator { + continue; + } + +- VoxelShape voxelshape = iblockdata.b((IBlockAccess) this.g, this.e, this.c); ++ VoxelShape voxelshape = iblockdata.b(this.g, this.e, this.c); + + if (voxelshape == VoxelShapes.b()) { +- if (!this.b.a((double) i, (double) j, (double) k, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D)) { ++ if (!this.b.a(i, j, k, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D)) { + continue; + } + +- consumer.accept(voxelshape.a((double) i, (double) j, (double) k)); ++ consumer.accept(voxelshape.a(i, j, k)); + return true; + } + +- VoxelShape voxelshape1 = voxelshape.a((double) i, (double) j, (double) k); ++ VoxelShape voxelshape1 = voxelshape.a(i, j, k); + + if (!VoxelShapes.c(voxelshape1, this.f, OperatorBoolean.AND)) { + continue; +@@ -148,10 +148,10 @@ public class VoxelShapeSpliterator extends AbstractSpliterator { + } + + public static boolean a(WorldBorder worldborder, AxisAlignedBB axisalignedbb) { +- double d0 = (double) MathHelper.floor(worldborder.e()); +- double d1 = (double) MathHelper.floor(worldborder.f()); +- double d2 = (double) MathHelper.f(worldborder.g()); +- double d3 = (double) MathHelper.f(worldborder.h()); ++ double d0 = MathHelper.floor(worldborder.e()); ++ double d1 = MathHelper.floor(worldborder.f()); ++ double d2 = MathHelper.f(worldborder.g()); ++ double d3 = MathHelper.f(worldborder.h()); + + return axisalignedbb.minX > d0 && axisalignedbb.minX < d2 && axisalignedbb.minZ > d1 && axisalignedbb.minZ < d3 && axisalignedbb.maxX > d0 && axisalignedbb.maxX < d2 && axisalignedbb.maxZ > d1 && axisalignedbb.maxZ < d3; + } +diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java +index fa35fe79d1d35a6862151aca0dba09237236227d..3d1cd6769326e15c0661370987f3b940e59b9617 100644 +--- a/src/main/java/net/minecraft/server/VoxelShapes.java ++++ b/src/main/java/net/minecraft/server/VoxelShapes.java +@@ -12,7 +12,7 @@ import java.util.stream.Stream; + + public final class VoxelShapes { + +- private static final VoxelShape b = (VoxelShape) SystemUtils.a(() -> { ++ private static final VoxelShape b = SystemUtils.a(() -> { + VoxelShapeBitSet voxelshapebitset = new VoxelShapeBitSet(1, 1, 1); + + voxelshapebitset.a(0, 0, 0, true, true); +@@ -119,9 +119,9 @@ public final class VoxelShapes { + int l2 = (int) Math.round(axisalignedbb.maxZ * (double) j1); + VoxelShapeBitSet voxelshapebitset = new VoxelShapeBitSet(l, i1, j1, k1, i2, k2, l1, j2, l2); + +- for (long i3 = (long) k1; i3 < (long) l1; ++i3) { +- for (long j3 = (long) i2; j3 < (long) j2; ++j3) { +- for (long k3 = (long) k2; k3 < (long) l2; ++k3) { ++ for (long i3 = k1; i3 < (long) l1; ++i3) { ++ for (long j3 = i2; j3 < (long) j2; ++j3) { ++ for (long k3 = k2; k3 < (long) l2; ++k3) { + voxelshapebitset.a((int) i3, (int) j3, (int) k3, false, true); + } + } +@@ -166,7 +166,7 @@ public final class VoxelShapes { + for (VoxelShape voxelShape : avoxelshape) { + acc = a(acc, voxelShape); + } +- return (VoxelShape) acc; ++ return acc; + } + + public static VoxelShape a(VoxelShape voxelshape, VoxelShape voxelshape1, OperatorBoolean operatorboolean) { +@@ -175,7 +175,7 @@ public final class VoxelShapes { + + public static VoxelShape b(VoxelShape voxelshape, VoxelShape voxelshape1, OperatorBoolean operatorboolean) { + if (operatorboolean.apply(false, false)) { +- throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException()); ++ throw SystemUtils.c(new IllegalArgumentException()); + } else if (voxelshape == voxelshape1) { + return operatorboolean.apply(true, true) ? voxelshape : a(); + } else { +@@ -192,7 +192,7 @@ public final class VoxelShapes { + VoxelShapeMerger voxelshapemerger2 = a((voxelshapemerger.a().size() - 1) * (voxelshapemerger1.a().size() - 1), voxelshape.a(EnumDirection.EnumAxis.Z), voxelshape1.a(EnumDirection.EnumAxis.Z), flag, flag1); + VoxelShapeBitSet voxelshapebitset = VoxelShapeBitSet.a(voxelshape.a, voxelshape1.a, voxelshapemerger, voxelshapemerger1, voxelshapemerger2, operatorboolean); + +- return (VoxelShape) (voxelshapemerger instanceof VoxelShapeCubeMerger && voxelshapemerger1 instanceof VoxelShapeCubeMerger && voxelshapemerger2 instanceof VoxelShapeCubeMerger ? new VoxelShapeCube(voxelshapebitset) : new VoxelShapeArray(voxelshapebitset, voxelshapemerger.a(), voxelshapemerger1.a(), voxelshapemerger2.a())); ++ return voxelshapemerger instanceof VoxelShapeCubeMerger && voxelshapemerger1 instanceof VoxelShapeCubeMerger && voxelshapemerger2 instanceof VoxelShapeCubeMerger ? new VoxelShapeCube(voxelshapebitset) : new VoxelShapeArray(voxelshapebitset, voxelshapemerger.a(), voxelshapemerger1.a(), voxelshapemerger2.a()); + } + } + } +@@ -204,9 +204,9 @@ public final class VoxelShapes { + if (voxelshape instanceof com.tuinity.tuinity.voxel.AABBVoxelShape && voxelshape1 instanceof com.tuinity.tuinity.voxel.AABBVoxelShape) { + return ((com.tuinity.tuinity.voxel.AABBVoxelShape)voxelshape).aabb.intersects(((com.tuinity.tuinity.voxel.AABBVoxelShape)voxelshape1).aabb); + } else if (voxelshape instanceof com.tuinity.tuinity.voxel.AABBVoxelShape && voxelshape1 instanceof VoxelShapeArray) { +- return ((VoxelShapeArray)voxelshape1).intersects(((com.tuinity.tuinity.voxel.AABBVoxelShape)voxelshape).aabb); ++ return voxelshape1.intersects(((com.tuinity.tuinity.voxel.AABBVoxelShape)voxelshape).aabb); + } else if (voxelshape1 instanceof com.tuinity.tuinity.voxel.AABBVoxelShape && voxelshape instanceof VoxelShapeArray) { +- return ((VoxelShapeArray)voxelshape).intersects(((com.tuinity.tuinity.voxel.AABBVoxelShape)voxelshape1).aabb); ++ return voxelshape.intersects(((com.tuinity.tuinity.voxel.AABBVoxelShape)voxelshape1).aabb); + } + } + return abstract_c(voxelshape, voxelshape1, operatorboolean); +@@ -214,7 +214,7 @@ public final class VoxelShapes { + public static boolean abstract_c(VoxelShape voxelshape, VoxelShape voxelshape1, OperatorBoolean operatorboolean) { + // Tuinity end - optimise voxelshape + if (operatorboolean.apply(false, false)) { +- throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException()); ++ throw SystemUtils.c(new IllegalArgumentException()); + } else if (voxelshape == voxelshape1) { + return operatorboolean.apply(true, true); + } else if (voxelshape.isEmpty()) { +@@ -324,7 +324,7 @@ public final class VoxelShapes { + if (iblockdata == null) return 0.0D; // Paper + + if (!iblockdata.isAir() && (k2 != 1 || iblockdata.d()) && (k2 != 2 || iblockdata.a(Blocks.MOVING_PISTON))) { // Paper +- d0 = iblockdata.b((IBlockAccess) iworldreader, blockposition_mutableblockposition, voxelshapecollision).a(enumdirection_enumaxis2, axisalignedbb.d((double) (-blockposition_mutableblockposition.getX()), (double) (-blockposition_mutableblockposition.getY()), (double) (-blockposition_mutableblockposition.getZ())), d0); ++ d0 = iblockdata.b(iworldreader, blockposition_mutableblockposition, voxelshapecollision).a(enumdirection_enumaxis2, axisalignedbb.d(-blockposition_mutableblockposition.getX(), -blockposition_mutableblockposition.getY(), -blockposition_mutableblockposition.getZ()), d0); + if (Math.abs(d0) < 1.0E-7D) { + return 0.0D; + } +@@ -370,7 +370,7 @@ public final class VoxelShapes { + i = 0; + } + +- return (VoxelShape) (!flag ? a() : new VoxelShapeSlice(voxelshape, enumdirection_enumaxis, i)); ++ return !flag ? a() : new VoxelShapeSlice(voxelshape, enumdirection_enumaxis, i); + } + } + +diff --git a/src/main/java/net/minecraft/server/WeightedList.java b/src/main/java/net/minecraft/server/WeightedList.java +index 5d9d58411f2fad9d5da703f964d269b4a7c2b205..395ee6a1bbdf2da6e6e5a37fccf86812ceebad0a 100644 +--- a/src/main/java/net/minecraft/server/WeightedList.java ++++ b/src/main/java/net/minecraft/server/WeightedList.java +@@ -88,7 +88,7 @@ public class WeightedList { + } + + private void a(float f) { +- this.c = -Math.pow((double) f, (double) (1.0F / (float) this.b)); ++ this.c = -Math.pow(f, 1.0F / (float) this.b); + } + + public T a() { +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index f4058e70aea8295942c16041e0eb332b59894cd2..cc3b91e0a61231851d98600df800da907c6242a7 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -112,7 +112,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + // Paper start + @Override + public boolean isChunkLoaded(int x, int z) { +- return ((WorldServer)this).getChunkIfLoaded(x, z) != null; ++ return this.getChunkIfLoaded(x, z) != null; + } + // Paper end + +@@ -205,7 +205,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + return true; + } + +- voxelshape = voxelshape.offset((double) position.getX(), (double) position.getY(), (double) position.getZ()); ++ voxelshape = voxelshape.offset(position.getX(), position.getY(), position.getZ()); + if (voxelshape.isEmpty()) { + return true; + } +@@ -568,7 +568,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + + // CraftBukkit start + iblockdata1.b(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam +- CraftWorld world = ((WorldServer) this).getWorld(); ++ CraftWorld world = this.getWorld(); + if (world != null && ((WorldServer)this).hasPhysicsEvent) { // Paper + BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); + this.getServer().getPluginManager().callEvent(event); +@@ -687,7 +687,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + + try { + // CraftBukkit start +- CraftWorld world = ((WorldServer) this).getWorld(); ++ CraftWorld world = this.getWorld(); + if (world != null && ((WorldServer)this).hasPhysicsEvent) { // Paper + BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata), world.getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ())); + this.getServer().getPluginManager().callEvent(event); +@@ -805,9 +805,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + + public boolean a(TileEntity tileentity) { + if (this.tickingTileEntities) { +- World.LOGGER.error("Adding block entity while ticking: {} @ {}", new org.apache.logging.log4j.util.Supplier[]{() -> { ++ World.LOGGER.error("Adding block entity while ticking: {} @ {}", () -> { + return IRegistry.BLOCK_ENTITY_TYPE.getKey(tileentity.getTileType()); +- }, tileentity::getPosition}); ++ }, tileentity::getPosition); + } + + boolean flag = true; // Paper - remove unused list +@@ -862,7 +862,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + int tilesThisCycle = 0; + for (tileTickPosition = 0; tileTickPosition < tileEntityListTick.size(); tileTickPosition++) { // Paper - Disable tick limiters + tileTickPosition = (tileTickPosition < tileEntityListTick.size()) ? tileTickPosition : 0; +- TileEntity tileentity = (TileEntity) this.tileEntityListTick.get(tileTickPosition); ++ TileEntity tileentity = this.tileEntityListTick.get(tileTickPosition); + // Spigot start + if (tileentity == null) { + getServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash"); +@@ -927,7 +927,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + //gameprofilerfiller.exitEnter("pendingBlockEntities"); // Akarin - remove caller + if (!this.tileEntityListPending.isEmpty()) { + for (int i = 0; i < this.tileEntityListPending.size(); ++i) { +- TileEntity tileentity1 = (TileEntity) this.tileEntityListPending.get(i); ++ TileEntity tileentity1 = this.tileEntityListPending.get(i); + + if (!tileentity1.isRemoved()) { + /* CraftBukkit start - Order matters, moved down +@@ -986,11 +986,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + // Paper end + + public Explosion explode(@Nullable Entity entity, double d0, double d1, double d2, float f, Explosion.Effect explosion_effect) { +- return this.createExplosion(entity, (DamageSource) null, (ExplosionDamageCalculator) null, d0, d1, d2, f, false, explosion_effect); ++ return this.createExplosion(entity, null, null, d0, d1, d2, f, false, explosion_effect); + } + + public Explosion createExplosion(@Nullable Entity entity, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) { +- return this.createExplosion(entity, (DamageSource) null, (ExplosionDamageCalculator) null, d0, d1, d2, f, flag, explosion_effect); ++ return this.createExplosion(entity, null, null, d0, d1, d2, f, flag, explosion_effect); + } + + public Explosion createExplosion(@Nullable Entity entity, @Nullable DamageSource damagesource, @Nullable ExplosionDamageCalculator explosiondamagecalculator, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) { +@@ -1044,7 +1044,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + @Nullable + private TileEntity D(BlockPosition blockposition) { + for (int i = 0; i < this.tileEntityListPending.size(); ++i) { +- TileEntity tileentity = (TileEntity) this.tileEntityListPending.get(i); ++ TileEntity tileentity = this.tileEntityListPending.get(i); + + if (!tileentity.isRemoved() && tileentity.getPosition().equals(blockposition)) { + return tileentity; +@@ -1115,7 +1115,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + } else { + IChunkAccess ichunkaccess = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4); // Paper + +- return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a((IBlockAccess) this, blockposition, entity, enumdirection); ++ return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a(this, blockposition, entity, enumdirection); + } + } + +@@ -1126,7 +1126,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + public void N() { + double d0 = 1.0D - (double) (this.d(1.0F) * 5.0F) / 16.0D; + double d1 = 1.0D - (double) (this.b(1.0F) * 5.0F) / 16.0D; +- double d2 = 0.5D + 2.0D * MathHelper.a((double) MathHelper.cos(this.f(1.0F) * 6.2831855F), -0.25D, 0.25D); ++ double d2 = 0.5D + 2.0D * MathHelper.a(MathHelper.cos(this.f(1.0F) * 6.2831855F), -0.25D, 0.25D); + + this.d = (int) ((1.0D - d2 * d0 * d1) * 11.0D); + } +@@ -1339,7 +1339,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + + public int getBlockFacePower(BlockPosition blockposition, EnumDirection enumdirection) { + IBlockData iblockdata = this.getType(blockposition); +- int i = iblockdata.b((IBlockAccess) this, blockposition, enumdirection); ++ int i = iblockdata.b(this, blockposition, enumdirection); + + return iblockdata.isOccluding(this, blockposition) ? Math.max(i, this.getBlockPower(blockposition)) : i; + } +@@ -1568,7 +1568,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + } + + public GameProfilerFiller getMethodProfiler() { +- return (GameProfilerFiller) this.methodProfiler.get(); ++ return this.methodProfiler.get(); + } + + public Supplier getMethodProfilerSupplier() { +diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java +index b9c4e82524f842475811eae5bbe4547d12f2ceba..81831ae5ff643d0f973870437ba42802ccc4064a 100644 +--- a/src/main/java/net/minecraft/server/WorldBorder.java ++++ b/src/main/java/net/minecraft/server/WorldBorder.java +@@ -167,7 +167,7 @@ public class WorldBorder { + } + + public void transitionSizeBetween(double d0, double d1, long i) { +- this.j = (WorldBorder.a) (d0 == d1 ? new WorldBorder.d(d1) : new WorldBorder.b(d0, d1, i)); ++ this.j = d0 == d1 ? new d(d1) : new b(d0, d1, i); + Iterator iterator = this.l().iterator(); + + while (iterator.hasNext()) { +@@ -376,8 +376,8 @@ public class WorldBorder { + nbttagcompound.setDouble("BorderSafeZone", this.d); + nbttagcompound.setDouble("BorderDamagePerBlock", this.c); + nbttagcompound.setDouble("BorderSizeLerpTarget", this.i); +- nbttagcompound.setDouble("BorderWarningBlocks", (double) this.e); +- nbttagcompound.setDouble("BorderWarningTime", (double) this.f); ++ nbttagcompound.setDouble("BorderWarningBlocks", this.e); ++ nbttagcompound.setDouble("BorderWarningTime", this.f); + } + } + +@@ -431,10 +431,10 @@ public class WorldBorder { + } + + private void n() { +- this.c = Math.max(WorldBorder.this.getCenterX() - this.b / 2.0D, (double) (-WorldBorder.this.i)); +- this.d = Math.max(WorldBorder.this.getCenterZ() - this.b / 2.0D, (double) (-WorldBorder.this.i)); +- this.e = Math.min(WorldBorder.this.getCenterX() + this.b / 2.0D, (double) WorldBorder.this.i); +- this.f = Math.min(WorldBorder.this.getCenterZ() + this.b / 2.0D, (double) WorldBorder.this.i); ++ this.c = Math.max(WorldBorder.this.getCenterX() - this.b / 2.0D, -WorldBorder.this.i); ++ this.d = Math.max(WorldBorder.this.getCenterZ() - this.b / 2.0D, -WorldBorder.this.i); ++ this.e = Math.min(WorldBorder.this.getCenterX() + this.b / 2.0D, WorldBorder.this.i); ++ this.f = Math.min(WorldBorder.this.getCenterZ() + this.b / 2.0D, WorldBorder.this.i); + this.g = VoxelShapes.a(VoxelShapes.a, VoxelShapes.create(Math.floor(this.a()), Double.NEGATIVE_INFINITY, Math.floor(this.c()), Math.ceil(this.b()), Double.POSITIVE_INFINITY, Math.ceil(this.d())), OperatorBoolean.ONLY_FIRST); + } + +@@ -477,22 +477,22 @@ public class WorldBorder { + + @Override + public double a() { +- return Math.max(WorldBorder.this.getCenterX() - this.e() / 2.0D, (double) (-WorldBorder.this.i)); ++ return Math.max(WorldBorder.this.getCenterX() - this.e() / 2.0D, -WorldBorder.this.i); + } + + @Override + public double c() { +- return Math.max(WorldBorder.this.getCenterZ() - this.e() / 2.0D, (double) (-WorldBorder.this.i)); ++ return Math.max(WorldBorder.this.getCenterZ() - this.e() / 2.0D, -WorldBorder.this.i); + } + + @Override + public double b() { +- return Math.min(WorldBorder.this.getCenterX() + this.e() / 2.0D, (double) WorldBorder.this.i); ++ return Math.min(WorldBorder.this.getCenterX() + this.e() / 2.0D, WorldBorder.this.i); + } + + @Override + public double d() { +- return Math.min(WorldBorder.this.getCenterZ() + this.e() / 2.0D, (double) WorldBorder.this.i); ++ return Math.min(WorldBorder.this.getCenterZ() + this.e() / 2.0D, WorldBorder.this.i); + } + + @Override +@@ -520,7 +520,7 @@ public class WorldBorder { + + @Override + public WorldBorder.a l() { +- return (WorldBorder.a) (this.g() <= 0L ? WorldBorder.this.new d(this.c) : this); ++ return this.g() <= 0L ? WorldBorder.this.new d(this.c) : this; + } + + @Override +diff --git a/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java b/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java +index 0f00d4c9bdf09eece00547c8a66db2e90eff1e5a..05d14132deab60d1939c158937cc87836dd6526e 100644 +--- a/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java ++++ b/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java +@@ -59,8 +59,8 @@ public class WorldChunkManagerTheEnd extends WorldChunkManager { + + for (int k1 = -12; k1 <= 12; ++k1) { + for (int l1 = -12; l1 <= 12; ++l1) { +- long i2 = (long) (k + k1); +- long j2 = (long) (l + l1); ++ long i2 = k + k1; ++ long j2 = l + l1; + + if (i2 * i2 + j2 * j2 > 4096L && noisegenerator3handler.a((double) i2, (double) j2) < -0.8999999761581421D) { + float f1 = (MathHelper.e((float) i2) * 3439.0F + MathHelper.e((float) j2) * 147.0F) % 13.0F + 9.0F; +diff --git a/src/main/java/net/minecraft/server/WorldDataServer.java b/src/main/java/net/minecraft/server/WorldDataServer.java +index 98e70eb333793e7d28d77c9ad3627453d469c6e8..bd4066b9aab0f2295bfbe138845057615611288b 100644 +--- a/src/main/java/net/minecraft/server/WorldDataServer.java ++++ b/src/main/java/net/minecraft/server/WorldDataServer.java +@@ -89,19 +89,19 @@ public class WorldDataServer implements IWorldDataServer, SaveData { + } + + public WorldDataServer(WorldSettings worldsettings, GeneratorSettings generatorsettings, Lifecycle lifecycle) { +- this((DataFixer) null, SharedConstants.getGameVersion().getWorldVersion(), (NBTTagCompound) null, false, 0, 0, 0, 0L, 0L, 19133, 0, 0, false, 0, false, false, false, WorldBorder.b, 0, 0, (UUID) null, Sets.newLinkedHashSet(), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.a), (NBTTagCompound) null, new NBTTagCompound(), worldsettings.h(), generatorsettings, lifecycle); ++ this(null, SharedConstants.getGameVersion().getWorldVersion(), null, false, 0, 0, 0, 0L, 0L, 19133, 0, 0, false, 0, false, false, false, WorldBorder.b, 0, 0, null, Sets.newLinkedHashSet(), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.a), null, new NBTTagCompound(), worldsettings.h(), generatorsettings, lifecycle); + } + + public static WorldDataServer a(Dynamic dynamic, DataFixer datafixer, int i, @Nullable NBTTagCompound nbttagcompound, WorldSettings worldsettings, LevelVersion levelversion, GeneratorSettings generatorsettings, Lifecycle lifecycle) { + long j = dynamic.get("Time").asLong(0L); + NBTTagCompound nbttagcompound1 = (NBTTagCompound) dynamic.get("DragonFight").result().map(Dynamic::getValue).orElseGet(() -> { +- return (NBTBase) dynamic.get("DimensionData").get("1").get("DragonFight").orElseEmptyMap().getValue(); ++ return dynamic.get("DimensionData").get("1").get("DragonFight").orElseEmptyMap().getValue(); + }); + + // CraftBukkit - decompile error +- return new WorldDataServer(datafixer, i, nbttagcompound, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), j, dynamic.get("DayTime").asLong(j), levelversion.a(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.c.a(dynamic, WorldBorder.b), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID) dynamic.get("WanderingTraderId").read(MinecraftSerializableUUID.a).result().orElse(null), (LinkedHashSet) dynamic.get("ServerBrands").asStream().flatMap((dynamic1) -> { +- return SystemUtils.a(dynamic1.asString().result()); +- }).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.a, dynamic.get("ScheduledEvents").asStream()), (NBTTagCompound) dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), nbttagcompound1, worldsettings, generatorsettings, lifecycle); ++ return new WorldDataServer(datafixer, i, nbttagcompound, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), j, dynamic.get("DayTime").asLong(j), levelversion.a(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.c.a(dynamic, WorldBorder.b), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), dynamic.get("WanderingTraderId").read(MinecraftSerializableUUID.a).result().orElse(null), dynamic.get("ServerBrands").asStream().flatMap((dynamic1) -> { ++ return SystemUtils.a(dynamic1.asString().result()); ++ }).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.a, dynamic.get("ScheduledEvents").asStream()), (NBTTagCompound) dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), nbttagcompound1, worldsettings, generatorsettings, lifecycle); + } + + @Override +@@ -213,7 +213,7 @@ public class WorldDataServer implements IWorldDataServer, SaveData { + if (!this.l && this.m != null) { + if (this.k < SharedConstants.getGameVersion().getWorldVersion()) { + if (this.j == null) { +- throw (NullPointerException) SystemUtils.c(new NullPointerException("Fixer Upper not set inside LevelData, and the player tag is not upgraded.")); ++ throw SystemUtils.c(new NullPointerException("Fixer Upper not set inside LevelData, and the player tag is not upgraded.")); + } + + this.m = GameProfileSerializer.a(this.j, DataFixTypes.PLAYER, this.m, this.k); +@@ -404,7 +404,7 @@ public class WorldDataServer implements IWorldDataServer, SaveData { + this.b = this.b.a(enumdifficulty); + // CraftBukkit start + PacketPlayOutServerDifficulty packet = new PacketPlayOutServerDifficulty(this.getDifficulty(), this.isDifficultyLocked()); +- for (EntityPlayer player : (java.util.List) (java.util.List) world.getPlayers()) { ++ for (EntityPlayer player : (java.util.List) world.getPlayers()) { + player.playerConnection.sendPacket(packet); + } + // CraftBukkit end +diff --git a/src/main/java/net/minecraft/server/WorldGenMegaTreeProvider.java b/src/main/java/net/minecraft/server/WorldGenMegaTreeProvider.java +index 4000ba57175bcf8ac940573f3685ca27303ef707..8fd5162dfa3be996d3ab050559be0c8c2efbcabe 100644 +--- a/src/main/java/net/minecraft/server/WorldGenMegaTreeProvider.java ++++ b/src/main/java/net/minecraft/server/WorldGenMegaTreeProvider.java +@@ -29,7 +29,7 @@ public abstract class WorldGenMegaTreeProvider extends WorldGenTreeProvider { + if (worldgenfeatureconfigured == null) { + return false; + } else { +- ((WorldGenFeatureTreeConfiguration) worldgenfeatureconfigured.e).a(); ++ worldgenfeatureconfigured.e.a(); + setTreeType(worldgenfeatureconfigured); // CraftBukkit + IBlockData iblockdata1 = Blocks.AIR.getBlockData(); + +diff --git a/src/main/java/net/minecraft/server/WorldGenTreeProvider.java b/src/main/java/net/minecraft/server/WorldGenTreeProvider.java +index 6e340b2581529dc52b739d43e58c74c80f5c1b01..6ba0be5d8ec5337a725eee5d506f9b3abd8798ed 100644 +--- a/src/main/java/net/minecraft/server/WorldGenTreeProvider.java ++++ b/src/main/java/net/minecraft/server/WorldGenTreeProvider.java +@@ -21,7 +21,7 @@ public abstract class WorldGenTreeProvider { + } else { + setTreeType(worldgenfeatureconfigured); // CraftBukkit + worldserver.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 4); +- ((WorldGenFeatureTreeConfiguration) worldgenfeatureconfigured.e).a(); ++ worldgenfeatureconfigured.e.a(); + if (worldgenfeatureconfigured.a(worldserver, worldserver.getStructureManager(), chunkgenerator, random, blockposition)) { + return true; + } else { +@@ -32,7 +32,7 @@ public abstract class WorldGenTreeProvider { + } + + private boolean a(GeneratorAccess generatoraccess, BlockPosition blockposition) { +- Iterator iterator = BlockPosition.MutableBlockPosition.a(blockposition.down().north(2).west(2), blockposition.up().south(2).east(2)).iterator(); ++ Iterator iterator = BlockPosition.a(blockposition.down().north(2).west(2), blockposition.up().south(2).east(2)).iterator(); + + BlockPosition blockposition1; + +@@ -42,7 +42,7 @@ public abstract class WorldGenTreeProvider { + } + + blockposition1 = (BlockPosition) iterator.next(); +- } while (!generatoraccess.getType(blockposition1).a((Tag) TagsBlock.FLOWERS)); ++ } while (!generatoraccess.getType(blockposition1).a(TagsBlock.FLOWERS)); + + return true; + } +diff --git a/src/main/java/net/minecraft/server/WorldGenWitchHut.java b/src/main/java/net/minecraft/server/WorldGenWitchHut.java +index 4bf293881fa027a117ca2752935e91d08fe31f4d..38508970aba044cbdb77a15feb257940e83c2055 100644 +--- a/src/main/java/net/minecraft/server/WorldGenWitchHut.java ++++ b/src/main/java/net/minecraft/server/WorldGenWitchHut.java +@@ -50,19 +50,19 @@ public class WorldGenWitchHut extends WorldGenScatteredPiece { + this.a(generatoraccessseed, Blocks.CAULDRON.getBlockData(), 4, 2, 6, structureboundingbox); + this.a(generatoraccessseed, Blocks.OAK_FENCE.getBlockData(), 1, 2, 1, structureboundingbox); + this.a(generatoraccessseed, Blocks.OAK_FENCE.getBlockData(), 5, 2, 1, structureboundingbox); +- IBlockData iblockdata = (IBlockData) Blocks.SPRUCE_STAIRS.getBlockData().set(BlockStairs.FACING, EnumDirection.NORTH); +- IBlockData iblockdata1 = (IBlockData) Blocks.SPRUCE_STAIRS.getBlockData().set(BlockStairs.FACING, EnumDirection.EAST); +- IBlockData iblockdata2 = (IBlockData) Blocks.SPRUCE_STAIRS.getBlockData().set(BlockStairs.FACING, EnumDirection.WEST); +- IBlockData iblockdata3 = (IBlockData) Blocks.SPRUCE_STAIRS.getBlockData().set(BlockStairs.FACING, EnumDirection.SOUTH); ++ IBlockData iblockdata = Blocks.SPRUCE_STAIRS.getBlockData().set(BlockStairs.FACING, EnumDirection.NORTH); ++ IBlockData iblockdata1 = Blocks.SPRUCE_STAIRS.getBlockData().set(BlockStairs.FACING, EnumDirection.EAST); ++ IBlockData iblockdata2 = Blocks.SPRUCE_STAIRS.getBlockData().set(BlockStairs.FACING, EnumDirection.WEST); ++ IBlockData iblockdata3 = Blocks.SPRUCE_STAIRS.getBlockData().set(BlockStairs.FACING, EnumDirection.SOUTH); + + this.a(generatoraccessseed, structureboundingbox, 0, 4, 1, 6, 4, 1, iblockdata, iblockdata, false); + this.a(generatoraccessseed, structureboundingbox, 0, 4, 2, 0, 4, 7, iblockdata1, iblockdata1, false); + this.a(generatoraccessseed, structureboundingbox, 6, 4, 2, 6, 4, 7, iblockdata2, iblockdata2, false); + this.a(generatoraccessseed, structureboundingbox, 0, 4, 8, 6, 4, 8, iblockdata3, iblockdata3, false); +- this.a(generatoraccessseed, (IBlockData) iblockdata.set(BlockStairs.SHAPE, BlockPropertyStairsShape.OUTER_RIGHT), 0, 4, 1, structureboundingbox); +- this.a(generatoraccessseed, (IBlockData) iblockdata.set(BlockStairs.SHAPE, BlockPropertyStairsShape.OUTER_LEFT), 6, 4, 1, structureboundingbox); +- this.a(generatoraccessseed, (IBlockData) iblockdata3.set(BlockStairs.SHAPE, BlockPropertyStairsShape.OUTER_LEFT), 0, 4, 8, structureboundingbox); +- this.a(generatoraccessseed, (IBlockData) iblockdata3.set(BlockStairs.SHAPE, BlockPropertyStairsShape.OUTER_RIGHT), 6, 4, 8, structureboundingbox); ++ this.a(generatoraccessseed, iblockdata.set(BlockStairs.SHAPE, BlockPropertyStairsShape.OUTER_RIGHT), 0, 4, 1, structureboundingbox); ++ this.a(generatoraccessseed, iblockdata.set(BlockStairs.SHAPE, BlockPropertyStairsShape.OUTER_LEFT), 6, 4, 1, structureboundingbox); ++ this.a(generatoraccessseed, iblockdata3.set(BlockStairs.SHAPE, BlockPropertyStairsShape.OUTER_LEFT), 0, 4, 8, structureboundingbox); ++ this.a(generatoraccessseed, iblockdata3.set(BlockStairs.SHAPE, BlockPropertyStairsShape.OUTER_RIGHT), 6, 4, 8, structureboundingbox); + + int i; + int j; +@@ -78,18 +78,18 @@ public class WorldGenWitchHut extends WorldGenScatteredPiece { + i = this.d(2); + int k = this.b(2, 5); + +- if (structureboundingbox.b((BaseBlockPosition) (new BlockPosition(j, i, k)))) { ++ if (structureboundingbox.b(new BlockPosition(j, i, k))) { + this.e = true; +- EntityWitch entitywitch = (EntityWitch) EntityTypes.WITCH.a(generatoraccessseed.getMinecraftWorld()); ++ EntityWitch entitywitch = EntityTypes.WITCH.a(generatoraccessseed.getMinecraftWorld()); + + entitywitch.setPersistent(); +- entitywitch.setPositionRotation((double) j + 0.5D, (double) i, (double) k + 0.5D, 0.0F, 0.0F); +- entitywitch.prepare(generatoraccessseed, generatoraccessseed.getDamageScaler(new BlockPosition(j, i, k)), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, (NBTTagCompound) null); ++ entitywitch.setPositionRotation((double) j + 0.5D, i, (double) k + 0.5D, 0.0F, 0.0F); ++ entitywitch.prepare(generatoraccessseed, generatoraccessseed.getDamageScaler(new BlockPosition(j, i, k)), EnumMobSpawn.STRUCTURE, null, null); + generatoraccessseed.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason + } + } + +- this.a((GeneratorAccess) generatoraccessseed, structureboundingbox); ++ this.a(generatoraccessseed, structureboundingbox); + return true; + } + } +@@ -100,13 +100,13 @@ public class WorldGenWitchHut extends WorldGenScatteredPiece { + int j = this.d(2); + int k = this.b(2, 5); + +- if (structureboundingbox.b((BaseBlockPosition) (new BlockPosition(i, j, k)))) { ++ if (structureboundingbox.b(new BlockPosition(i, j, k))) { + this.f = true; +- EntityCat entitycat = (EntityCat) EntityTypes.CAT.a(generatoraccess.getMinecraftWorld()); ++ EntityCat entitycat = EntityTypes.CAT.a(generatoraccess.getMinecraftWorld()); + + entitycat.setPersistent(); +- entitycat.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F); +- entitycat.prepare(generatoraccess, generatoraccess.getDamageScaler(new BlockPosition(i, j, k)), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, (NBTTagCompound) null); ++ entitycat.setPositionRotation((double) i + 0.5D, j, (double) k + 0.5D, 0.0F, 0.0F); ++ entitycat.prepare(generatoraccess, generatoraccess.getDamageScaler(new BlockPosition(i, j, k)), EnumMobSpawn.STRUCTURE, null, null); + generatoraccess.addEntity(entitycat); + } + } +diff --git a/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java b/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java +index 3891835ccbda8cd3569b1054ec5873c1fb8e6ab1..8c499ed06bb136ca35e339ac945db057504bcbb5 100644 +--- a/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java ++++ b/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java +@@ -43,7 +43,7 @@ public class WorldLoadListenerLogger implements WorldLoadListener { + + if (SystemUtils.getMonotonicMillis() > this.e) { + this.e += 500L; +- WorldLoadListenerLogger.LOGGER.info((new ChatMessage("menu.preparingSpawn", new Object[]{MathHelper.clamp(i, 0, 100)})).getString()); ++ WorldLoadListenerLogger.LOGGER.info((new ChatMessage("menu.preparingSpawn", MathHelper.clamp(i, 0, 100))).getString()); + } + + } +diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java +index e3bcf63922639db39e83c8b6b1ad65b948295644..42cb6e947db3961d1bbd469e02b37b1db4d5048e 100644 +--- a/src/main/java/net/minecraft/server/WorldMap.java ++++ b/src/main/java/net/minecraft/server/WorldMap.java +@@ -55,7 +55,7 @@ public class WorldMap extends PersistentBase { + + public void a(int i, int j, int k, boolean flag, boolean flag1, ResourceKey resourcekey) { + this.scale = (byte) k; +- this.a((double) i, (double) j, this.scale); ++ this.a(i, j, this.scale); + this.map = resourcekey; + this.track = flag; + this.unlimitedTracking = flag1; +@@ -78,7 +78,7 @@ public class WorldMap extends PersistentBase { + + logger.getClass(); + // CraftBukkit start +- this.map = (ResourceKey) dataresult.resultOrPartial(logger::error).orElseGet(() -> { ++ this.map = dataresult.resultOrPartial(logger::error).orElseGet(() -> { + long least = nbttagcompound.getLong("UUIDLeast"); + long most = nbttagcompound.getLong("UUIDMost"); + +@@ -115,7 +115,7 @@ public class WorldMap extends PersistentBase { + MapIconBanner mapiconbanner = MapIconBanner.a(nbttaglist.getCompound(i)); + + this.m.put(mapiconbanner.f(), mapiconbanner); +- this.a(mapiconbanner.c(), (GeneratorAccess) null, mapiconbanner.f(), (double) mapiconbanner.a().getX(), (double) mapiconbanner.a().getZ(), 180.0D, mapiconbanner.d()); ++ this.a(mapiconbanner.c(), null, mapiconbanner.f(), mapiconbanner.a().getX(), mapiconbanner.a().getZ(), 180.0D, mapiconbanner.d()); + } + this.vanillaRender.buffer = colors; // Paper + +@@ -125,7 +125,7 @@ public class WorldMap extends PersistentBase { + WorldMapFrame worldmapframe = WorldMapFrame.a(nbttaglist1.getCompound(j)); + + this.n.put(worldmapframe.e(), worldmapframe); +- this.a(MapIcon.Type.FRAME, (GeneratorAccess) null, "frame-" + worldmapframe.d(), (double) worldmapframe.b().getX(), (double) worldmapframe.b().getZ(), (double) worldmapframe.c(), (IChatBaseComponent) null); ++ this.a(MapIcon.Type.FRAME, null, "frame-" + worldmapframe.d(), worldmapframe.b().getX(), worldmapframe.b().getZ(), worldmapframe.c(), null); + } + + } +@@ -212,12 +212,12 @@ public class WorldMap extends PersistentBase { + } + + for (int i = 0; i < this.i.size(); ++i) { +- WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker1 = (WorldMap.WorldMapHumanTracker) this.i.get(i); ++ WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker1 = this.i.get(i); + String s = worldmap_worldmaphumantracker1.trackee.getDisplayName().getString(); + + if (!worldmap_worldmaphumantracker1.trackee.dead && (worldmap_worldmaphumantracker1.trackee.inventory.h(itemstack) || itemstack.y())) { + if (!itemstack.y() && worldmap_worldmaphumantracker1.trackee.world.getDimensionKey() == this.map && this.track) { +- this.a(MapIcon.Type.PLAYER, worldmap_worldmaphumantracker1.trackee.world, s, worldmap_worldmaphumantracker1.trackee.locX(), worldmap_worldmaphumantracker1.trackee.locZ(), (double) worldmap_worldmaphumantracker1.trackee.yaw, (IChatBaseComponent) null); ++ this.a(MapIcon.Type.PLAYER, worldmap_worldmaphumantracker1.trackee.world, s, worldmap_worldmaphumantracker1.trackee.locX(), worldmap_worldmaphumantracker1.trackee.locZ(), worldmap_worldmaphumantracker1.trackee.yaw, null); + } + } else { + this.humans.remove(worldmap_worldmaphumantracker1.trackee); +@@ -229,7 +229,7 @@ public class WorldMap extends PersistentBase { + if (itemstack.y() && this.track) { + EntityItemFrame entityitemframe = itemstack.z(); + BlockPosition blockposition = entityitemframe.getBlockPosition(); +- WorldMapFrame worldmapframe = (WorldMapFrame) this.n.get(WorldMapFrame.a(blockposition)); ++ WorldMapFrame worldmapframe = this.n.get(WorldMapFrame.a(blockposition)); + + if (worldmapframe != null && entityitemframe.getId() != worldmapframe.d() && this.n.containsKey(worldmapframe.e())) { + this.decorations.remove("frame-" + worldmapframe.d()); +@@ -237,7 +237,7 @@ public class WorldMap extends PersistentBase { + + WorldMapFrame worldmapframe1 = new WorldMapFrame(blockposition, entityitemframe.getDirection().get2DRotationValue() * 90, entityitemframe.getId()); + +- this.a(MapIcon.Type.FRAME, entityhuman.world, "frame-" + entityitemframe.getId(), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.getDirection().get2DRotationValue() * 90), (IChatBaseComponent) null); ++ this.a(MapIcon.Type.FRAME, entityhuman.world, "frame-" + entityitemframe.getId(), blockposition.getX(), blockposition.getZ(), entityitemframe.getDirection().get2DRotationValue() * 90, null); + this.n.put(worldmapframe1.e(), worldmapframe1); + } + +@@ -250,7 +250,7 @@ public class WorldMap extends PersistentBase { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompound(j); + + if (!this.decorations.containsKey(nbttagcompound1.getString("id"))) { +- this.a(MapIcon.Type.a(nbttagcompound1.getByte("type")), entityhuman.world, nbttagcompound1.getString("id"), nbttagcompound1.getDouble("x"), nbttagcompound1.getDouble("z"), nbttagcompound1.getDouble("rot"), (IChatBaseComponent) null); ++ this.a(MapIcon.Type.a(nbttagcompound1.getByte("type")), entityhuman.world, nbttagcompound1.getString("id"), nbttagcompound1.getDouble("x"), nbttagcompound1.getDouble("z"), nbttagcompound1.getDouble("rot"), null); + } + } + } +@@ -264,15 +264,15 @@ public class WorldMap extends PersistentBase { + nbttaglist = itemstack.getTag().getList("Decorations", 10); + } else { + nbttaglist = new NBTTagList(); +- itemstack.a("Decorations", (NBTBase) nbttaglist); ++ itemstack.a("Decorations", nbttaglist); + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + nbttagcompound.setByte("type", mapicon_type.a()); + nbttagcompound.setString("id", s); +- nbttagcompound.setDouble("x", (double) blockposition.getX()); +- nbttagcompound.setDouble("z", (double) blockposition.getZ()); ++ nbttagcompound.setDouble("x", blockposition.getX()); ++ nbttagcompound.setDouble("z", blockposition.getZ()); + nbttagcompound.setDouble("rot", 180.0D); + nbttaglist.add(nbttagcompound); + if (mapicon_type.c()) { +@@ -342,7 +342,7 @@ public class WorldMap extends PersistentBase { + + @Nullable + public Packet a(ItemStack itemstack, IBlockAccess iblockaccess, EntityHuman entityhuman) { +- WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = (WorldMap.WorldMapHumanTracker) this.humans.get(entityhuman); ++ WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = this.humans.get(entityhuman); + + return worldmap_worldmaphumantracker == null ? null : worldmap_worldmaphumantracker.a(itemstack); + } +@@ -360,7 +360,7 @@ public class WorldMap extends PersistentBase { + } + + public WorldMap.WorldMapHumanTracker a(EntityHuman entityhuman) { +- WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = (WorldMap.WorldMapHumanTracker) this.humans.get(entityhuman); ++ WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = this.humans.get(entityhuman); + + if (worldmap_worldmaphumantracker == null) { + worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman); +@@ -389,7 +389,7 @@ public class WorldMap extends PersistentBase { + + boolean flag2 = true; + +- if (this.m.containsKey(mapiconbanner.f()) && ((MapIconBanner) this.m.get(mapiconbanner.f())).equals(mapiconbanner)) { ++ if (this.m.containsKey(mapiconbanner.f()) && this.m.get(mapiconbanner.f()).equals(mapiconbanner)) { + this.m.remove(mapiconbanner.f()); + this.decorations.remove(mapiconbanner.f()); + flag2 = false; +diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java +index 484058ca6e5aea094a36f6e4e0d2c3106ec2da73..491590b836bf6a916d2d41c67333e7999ea14948 100644 +--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java ++++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java +@@ -36,7 +36,7 @@ public class WorldNBTStorage { + File file1 = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat"); + File file2 = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat_old"); + +- NBTCompressedStreamTools.a(nbttagcompound, (OutputStream) (new FileOutputStream(file))); ++ NBTCompressedStreamTools.a(nbttagcompound, new FileOutputStream(file)); + SystemUtils.a(file1, file, file2); + } catch (Exception exception) { + WorldNBTStorage.LOGGER.error("Failed to save player data for {}", entityhuman.getName(), exception); // Paper +@@ -70,7 +70,7 @@ public class WorldNBTStorage { + // Spigot End + + if (normalFile) { // Akarin - avoid double I/O operation +- nbttagcompound = NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file))); ++ nbttagcompound = NBTCompressedStreamTools.a(new FileInputStream(file)); + } + // Spigot Start + if ( usingWrongFile ) +@@ -107,7 +107,7 @@ public class WorldNBTStorage { + File file1 = new File(this.playerDir, s + ".dat"); + + if (file1.exists()) { +- return NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file1))); ++ return NBTCompressedStreamTools.a(new FileInputStream(file1)); + } + } catch (Exception exception) { + LOGGER.warn("Failed to load player data for " + s); +diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java +index 045605b71a74a1ea3a29e622bb790bdd690d33dc..37c11a661c5be9c34e43b94dfdbb1d0b371462f3 100644 +--- a/src/main/java/net/minecraft/server/WorldPersistentData.java ++++ b/src/main/java/net/minecraft/server/WorldPersistentData.java +@@ -86,7 +86,7 @@ public class WorldPersistentData { + NBTTagCompound nbttagcompound1; + + if (this.a(pushbackinputstream)) { +- nbttagcompound1 = NBTCompressedStreamTools.a((InputStream) pushbackinputstream); ++ nbttagcompound1 = NBTCompressedStreamTools.a(pushbackinputstream); + } else { + DataInputStream datainputstream = new DataInputStream(pushbackinputstream); + Throwable throwable1 = null; +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 7b16515ad249fac5e9dcf12e1a59a4699005b247..988ce5aab920e0660098941e4bc89f0128cef23d 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -319,7 +319,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + this.N(); + this.O(); + this.getWorldBorder().a(minecraftserver.as()); +- this.persistentRaid = (PersistentRaid) this.getWorldPersistentData().a(() -> { ++ this.persistentRaid = this.getWorldPersistentData().a(() -> { + return new PersistentRaid(this); + }, PersistentRaid.a(this.getDimensionManager())); + if (!minecraftserver.isEmbeddedServer()) { +@@ -373,7 +373,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + int minChunkZ = minBlockZ >> 4; + int maxChunkZ = maxBlockZ >> 4; + +- ChunkProviderServer chunkProvider = (ChunkProviderServer)this.chunkProvider; ++ ChunkProviderServer chunkProvider = this.chunkProvider; + // TODO special case single chunk? + + for (int currChunkX = minChunkX; currChunkX <= maxChunkX; ++currChunkX) { +@@ -442,7 +442,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + mutablePos.setValues(blockX, currY, blockZ); + VoxelShape voxelshape2 = blockData.getCollisionShape(this, mutablePos, collisionShape); + if (voxelshape2 != VoxelShapes.getEmptyShape()) { +- VoxelShape voxelshape3 = voxelshape2.offset((double)blockX, (double)currY, (double)blockZ); ++ VoxelShape voxelshape3 = voxelshape2.offset(blockX, currY, blockZ); + + if (voxelshape3.intersects(axisalignedbb)) { + return true; +@@ -536,7 +536,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + int minChunkZ = minBlockZ >> 4; + int maxChunkZ = maxBlockZ >> 4; + +- ChunkProviderServer chunkProvider = (ChunkProviderServer)this.chunkProvider; ++ ChunkProviderServer chunkProvider = this.chunkProvider; + // TODO special case single chunk? + + for (int currChunkX = minChunkX; currChunkX <= maxChunkX; ++currChunkX) { +@@ -606,7 +606,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + mutablePos.setValues(blockX, currY, blockZ); + VoxelShape voxelshape2 = blockData.getCollisionShape(this, mutablePos, collisionShape); + if (voxelshape2 != VoxelShapes.getEmptyShape()) { +- VoxelShape voxelshape3 = voxelshape2.offset((double)blockX, (double)currY, (double)blockZ); ++ VoxelShape voxelshape3 = voxelshape2.offset(blockX, currY, blockZ); + + VoxelShapes.addBoxesToIfIntersects(voxelshape3, axisalignedbb, list); + } +@@ -824,22 +824,22 @@ public class WorldServer extends World implements GeneratorAccessSeed { + } + // */ + for (int idx = 0; idx < this.players.size(); ++idx) { +- if (((EntityPlayer) this.players.get(idx)).world == this) { +- ((EntityPlayer) this.players.get(idx)).tickWeather(); ++ if (this.players.get(idx).world == this) { ++ this.players.get(idx).tickWeather(); + } + } + + if (flag != this.isRaining()) { + // Only send weather packets to those affected + for (int idx = 0; idx < this.players.size(); ++idx) { +- if (((EntityPlayer) this.players.get(idx)).world == this) { +- ((EntityPlayer) this.players.get(idx)).setPlayerWeather((!flag ? WeatherType.DOWNFALL : WeatherType.CLEAR), false); ++ if (this.players.get(idx).world == this) { ++ this.players.get(idx).setPlayerWeather((!flag ? WeatherType.DOWNFALL : WeatherType.CLEAR), false); + } + } + } + for (int idx = 0; idx < this.players.size(); ++idx) { +- if (((EntityPlayer) this.players.get(idx)).world == this) { +- ((EntityPlayer) this.players.get(idx)).updateWeather(this.lastRainLevel, this.rainLevel, this.lastThunderLevel, this.thunderLevel); ++ if (this.players.get(idx).world == this) { ++ this.players.get(idx).updateWeather(this.lastRainLevel, this.rainLevel, this.lastThunderLevel, this.thunderLevel); + } + } + // CraftBukkit end +@@ -920,7 +920,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + org.spigotmc.ActivationRange.activateEntities(this); // Spigot + timings.entityTick.startTiming(); // Spigot + while (objectiterator.hasNext()) { +- Entity entity = (Entity) objectiterator.next(); // Tuinity ++ Entity entity = objectiterator.next(); // Tuinity + Entity entity1 = entity.getVehicle(); + + /* CraftBukkit start - We prevent spawning in general, so this butchering is not needed +@@ -992,7 +992,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + Entity entity2; + +- while ((entity2 = (Entity) this.entitiesToAdd.poll()) != null) { ++ while ((entity2 = this.entitiesToAdd.poll()) != null) { + if (!entity2.isQueuedForRegister) continue; // Paper - ignore cancelled registers + this.registerEntity(entity2); + } +@@ -1069,17 +1069,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { + boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper + + if (flag1) { +- EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a((World) this); ++ EntityHorseSkeleton entityhorseskeleton = EntityTypes.SKELETON_HORSE.a(this); + + entityhorseskeleton.t(true); + entityhorseskeleton.setAgeRaw(0); +- entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); ++ entityhorseskeleton.setPosition(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + this.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit + } + +- EntityLightning entitylightning = (EntityLightning) EntityTypes.LIGHTNING_BOLT.a((World) this); ++ EntityLightning entitylightning = EntityTypes.LIGHTNING_BOLT.a(this); + +- entitylightning.c(Vec3D.c((BaseBlockPosition) blockposition)); ++ entitylightning.c(Vec3D.c(blockposition)); + entitylightning.setEffect(flag1); + this.strikeLightning(entitylightning, org.bukkit.event.weather.LightningStrikeEvent.Cause.WEATHER); // CraftBukkit + } +@@ -1097,7 +1097,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + // Paper start - optimise chunk ticking + blockposition.setY(downY); +- if (biomebase.a((IWorldReader) this, blockposition)) { ++ if (biomebase.a(this, blockposition)) { + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.ICE.getBlockData(), null); // CraftBukkit + // Paper end + } +@@ -1110,7 +1110,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + // Paper start - optimise chunk ticking + blockposition.setY(downY); + if (flag && this.getBiome(blockposition).d() == BiomeBase.Precipitation.RAIN) { +- chunk.getType(blockposition).getBlock().c((World) this, blockposition); ++ chunk.getType(blockposition).getBlock().c(this, blockposition); + // Paper end + } + } +@@ -1163,12 +1163,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { + protected BlockPosition a(BlockPosition blockposition) { + BlockPosition blockposition1 = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, blockposition); + AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockposition1, new BlockPosition(blockposition1.getX(), this.getBuildHeight(), blockposition1.getZ()))).g(3.0D); +- List list = this.a(EntityLiving.class, axisalignedbb, (java.util.function.Predicate) (entityliving) -> { // CraftBukkit - decompile error ++ List list = this.a(EntityLiving.class, axisalignedbb, (entityliving) -> { // CraftBukkit - decompile error + return entityliving != null && entityliving.isAlive() && this.f(entityliving.getChunkCoordinates()); + }); + + if (!list.isEmpty()) { +- return ((EntityLiving) list.get(this.random.nextInt(list.size()))).getChunkCoordinates(); ++ return list.get(this.random.nextInt(list.size())).getChunkCoordinates(); + } else { + if (blockposition1.getY() == -1) { + blockposition1 = blockposition1.up(2); +@@ -1236,7 +1236,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + Fluid fluid = this.getFluid(nextticklistentry.a); + + if (fluid.getType() == nextticklistentry.b()) { +- fluid.a((World) this, nextticklistentry.a); ++ fluid.a(this, nextticklistentry.a); + } + + } +@@ -1244,7 +1244,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + private void b(NextTickListEntry nextticklistentry) { + IBlockData iblockdata = this.getType(nextticklistentry.a); + +- if (iblockdata.a((Block) nextticklistentry.b())) { ++ if (iblockdata.a(nextticklistentry.b())) { + iblockdata.a(this, nextticklistentry.a, this.random); + } + +@@ -1534,7 +1534,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + public EntityPlayer h() { + List list = this.a(EntityLiving::isAlive); + +- return list.isEmpty() ? null : (EntityPlayer) list.get(this.random.nextInt(list.size())); ++ return list.isEmpty() ? null : list.get(this.random.nextInt(list.size())); + } + + @Override +@@ -1587,7 +1587,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + } + + private void addPlayer0(EntityPlayer entityplayer) { +- Entity entity = (Entity) this.entitiesByUUID.get(entityplayer.getUniqueID()); ++ Entity entity = this.entitiesByUUID.get(entityplayer.getUniqueID()); + + if (entity != null) { + WorldServer.LOGGER.warn("Force-added player with duplicate UUID {}", entityplayer.getUniqueID().toString()); +@@ -1600,7 +1600,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entityplayer.locX() / 16.0D), MathHelper.floor(entityplayer.locZ() / 16.0D), ChunkStatus.FULL, true); + + if (ichunkaccess instanceof Chunk) { +- ichunkaccess.a((Entity) entityplayer); ++ ichunkaccess.a(entityplayer); + } + + this.registerEntity(entityplayer); +@@ -1663,7 +1663,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + } + + private boolean isUUIDTaken(Entity entity) { +- Entity entity1 = (Entity) this.entitiesByUUID.get(entity.getUniqueID()); ++ Entity entity1 = this.entitiesByUUID.get(entity.getUniqueID()); + + if (entity1 == null) { + return false; +@@ -1714,7 +1714,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + if (!(entity instanceof EntityPlayer)) { + if (false && this.tickingEntities) { // Tuinity +- throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Removing entity while ticking!")); ++ throw SystemUtils.c(new IllegalStateException("Removing entity while ticking!")); + } + + // Paper start - move out entities that shouldn't be in this chunk before it unloads +@@ -1984,7 +1984,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + public void removeEntity(Entity entity) { + if (false && this.tickingEntities) { // Tuinity +- throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Removing entity while ticking!")); ++ throw SystemUtils.c(new IllegalStateException("Removing entity while ticking!")); + } else { + this.removeEntityFromChunk(entity); + this.entitiesById.remove(entity.getId()); +@@ -1997,7 +1997,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + Chunk ichunkaccess = entity.getCurrentChunk(); // Paper - getChunkAt(x,z,full,false) is broken by CraftBukkit as it won't return an unloading chunk. Use our current chunk reference as this points to what chunk they need to be removed from anyways + + if (ichunkaccess != null) { // Paper +- ((Chunk) ichunkaccess).b(entity); ++ ichunkaccess.b(entity); + } + + } +@@ -2074,7 +2074,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + @Override + public void a(@Nullable EntityHuman entityhuman, int i, BlockPosition blockposition, int j) { +- this.server.getPlayerList().sendPacketNearby(entityhuman, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), 64.0D, this.getDimensionKey(), new PacketPlayOutWorldEvent(i, blockposition, j, false)); ++ this.server.getPlayerList().sendPacketNearby(entityhuman, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 64.0D, this.getDimensionKey(), new PacketPlayOutWorldEvent(i, blockposition, j, false)); + } + + @Override +@@ -2167,7 +2167,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); + + if (entityplayer.g(d0, d1, d2) < 4096.0D) { +- entityplayer.playerConnection.sendPacket(new PacketPlayOutExplosion(d0, d1, d2, f, explosion.getBlocks(), (Vec3D) explosion.c().get(entityplayer))); ++ entityplayer.playerConnection.sendPacket(new PacketPlayOutExplosion(d0, d1, d2, f, explosion.getBlocks(), explosion.c().get(entityplayer))); + } + } + +@@ -2181,10 +2181,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + private void ah() { + while (!this.L.isEmpty()) { +- BlockActionData blockactiondata = (BlockActionData) this.L.removeFirst(); ++ BlockActionData blockactiondata = this.L.removeFirst(); + + if (this.a(blockactiondata)) { +- this.server.getPlayerList().sendPacketNearby((EntityHuman) null, (double) blockactiondata.a().getX(), (double) blockactiondata.a().getY(), (double) blockactiondata.a().getZ(), 64.0D, this.getDimensionKey(), new PacketPlayOutBlockAction(blockactiondata.a(), blockactiondata.b(), blockactiondata.c(), blockactiondata.d())); ++ this.server.getPlayerList().sendPacketNearby(null, blockactiondata.a().getX(), blockactiondata.a().getY(), blockactiondata.a().getZ(), 64.0D, this.getDimensionKey(), new PacketPlayOutBlockAction(blockactiondata.a(), blockactiondata.b(), blockactiondata.c(), blockactiondata.d())); + } + } + +@@ -2193,7 +2193,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + private boolean a(BlockActionData blockactiondata) { + IBlockData iblockdata = this.getType(blockactiondata.a()); + +- return iblockdata.a(blockactiondata.b()) ? iblockdata.a((World) this, blockactiondata.a(), blockactiondata.c(), blockactiondata.d()) : false; ++ return iblockdata.a(blockactiondata.b()) ? iblockdata.a(this, blockactiondata.a(), blockactiondata.c(), blockactiondata.d()) : false; + } + + @Override +@@ -2259,7 +2259,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + } else { + BlockPosition blockposition = entityplayer.getChunkCoordinates(); + +- if (blockposition.a((IPosition) (new Vec3D(d0, d1, d2)), flag ? 512.0D : 32.0D)) { ++ if (blockposition.a(new Vec3D(d0, d1, d2), flag ? 512.0D : 32.0D)) { + entityplayer.playerConnection.sendPacket(packet); + return true; + } else { +@@ -2271,12 +2271,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { + @Nullable + @Override + public Entity getEntity(int i) { +- return (Entity) this.entitiesById.get(i); ++ return this.entitiesById.get(i); + } + + @Nullable + public Entity getEntity(UUID uuid) { +- return (Entity) this.entitiesByUUID.get(uuid); ++ return this.entitiesByUUID.get(uuid); + } + + @Nullable +@@ -2311,7 +2311,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + @Nullable + @Override + public WorldMap a(String s) { +- return (WorldMap) this.getMinecraftServer().D().getWorldPersistentData().b(() -> { ++ return this.getMinecraftServer().D().getWorldPersistentData().b(() -> { + // CraftBukkit start + // We only get here when the data file exists, but is not a valid map + WorldMap newMap = new WorldMap(s); +@@ -2324,12 +2324,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + @Override + public void a(WorldMap worldmap) { +- this.getMinecraftServer().D().getWorldPersistentData().a((PersistentBase) worldmap); ++ this.getMinecraftServer().D().getWorldPersistentData().a(worldmap); + } + + @Override + public int getWorldMapCount() { +- return ((PersistentIdCounts) this.getMinecraftServer().D().getWorldPersistentData().a(PersistentIdCounts::new, "idcounts")).a(); ++ return this.getMinecraftServer().D().getWorldPersistentData().a(PersistentIdCounts::new, "idcounts").a(); + } + + // Paper start - helper function for configurable spawn radius +@@ -2433,13 +2433,13 @@ public class WorldServer extends World implements GeneratorAccessSeed { + // Paper end + + public LongSet getForceLoadedChunks() { +- ForcedChunk forcedchunk = (ForcedChunk) this.getWorldPersistentData().b(ForcedChunk::new, "chunks"); ++ ForcedChunk forcedchunk = this.getWorldPersistentData().b(ForcedChunk::new, "chunks"); + +- return (LongSet) (forcedchunk != null ? LongSets.unmodifiable(forcedchunk.a()) : LongSets.EMPTY_SET); ++ return forcedchunk != null ? LongSets.unmodifiable(forcedchunk.a()) : LongSets.EMPTY_SET; + } + + public boolean setForceLoaded(int i, int j, boolean flag) { +- ForcedChunk forcedchunk = (ForcedChunk) this.getWorldPersistentData().a(ForcedChunk::new, "chunks"); ++ ForcedChunk forcedchunk = this.getWorldPersistentData().a(ForcedChunk::new, "chunks"); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); + long k = chunkcoordintpair.pair(); + boolean flag1; +@@ -2541,7 +2541,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + while (objectiterator.hasNext()) { + it.unimi.dsi.fastutil.objects.Object2IntMap.Entry it_unimi_dsi_fastutil_objects_object2intmap_entry = (it.unimi.dsi.fastutil.objects.Object2IntMap.Entry) objectiterator.next(); + +- bufferedwriter.write(String.format("spawn_count.%s: %d\n", ((EnumCreatureType) it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey()).b(), it_unimi_dsi_fastutil_objects_object2intmap_entry.getIntValue())); ++ bufferedwriter.write(String.format("spawn_count.%s: %d\n", it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey().b(), it_unimi_dsi_fastutil_objects_object2intmap_entry.getIntValue())); + } + } + +@@ -2600,7 +2600,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + Throwable throwable6 = null; + + try { +- playerchunkmap.a((Writer) bufferedwriter2); ++ playerchunkmap.a(bufferedwriter2); + } catch (Throwable throwable7) { + throwable6 = throwable7; + throw throwable7; +@@ -2624,7 +2624,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + Throwable throwable9 = null; + + try { +- a((Writer) bufferedwriter3, (Iterable) this.entitiesById.values()); ++ a(bufferedwriter3, this.entitiesById.values()); + } catch (Throwable throwable10) { + throwable9 = throwable10; + throw throwable10; +@@ -2648,7 +2648,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + Throwable throwable12 = null; + + try { +- this.a((Writer) bufferedwriter4); ++ this.a(bufferedwriter4); + } catch (Throwable throwable13) { + throwable12 = throwable13; + throw throwable13; +@@ -2699,7 +2699,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + @VisibleForTesting + public void a(StructureBoundingBox structureboundingbox) { + this.L.removeIf((blockactiondata) -> { +- return structureboundingbox.b((BaseBlockPosition) blockactiondata.a()); ++ return structureboundingbox.b(blockactiondata.a()); + }); + } + +diff --git a/src/main/java/net/minecraft/server/WorldUpgrader.java b/src/main/java/net/minecraft/server/WorldUpgrader.java +index 61adf30422dd7c7d0444696e0aaf25ea2baf3a1c..02a23ef51d7c6ac91faa7a2d98def88914ad88e4 100644 +--- a/src/main/java/net/minecraft/server/WorldUpgrader.java ++++ b/src/main/java/net/minecraft/server/WorldUpgrader.java +@@ -105,11 +105,11 @@ public class WorldUpgrader { + + for (UnmodifiableIterator unmodifiableiterator2 = this.c.iterator(); unmodifiableiterator2.hasNext(); f1 += f2) { + ResourceKey resourcekey2 = (ResourceKey) unmodifiableiterator2.next(); // CraftBukkit +- ListIterator listiterator = (ListIterator) immutablemap.get(resourcekey2); +- IChunkLoader ichunkloader = (IChunkLoader) immutablemap1.get(resourcekey2); ++ ListIterator listiterator = immutablemap.get(resourcekey2); ++ IChunkLoader ichunkloader = immutablemap1.get(resourcekey2); + + if (listiterator.hasNext()) { +- ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) listiterator.next(); ++ ChunkCoordIntPair chunkcoordintpair = listiterator.next(); + boolean flag1 = false; + + try { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +index 523314656144ce4a79a788130152ddfcdba7b252..de41d47fb284db73627e2595b567ef660dbe90b5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +@@ -31,7 +31,7 @@ public class CraftChunk implements Chunk { + public CraftChunk(net.minecraft.server.Chunk chunk) { + this.weakChunk = new WeakReference(chunk); + +- worldServer = (WorldServer) getHandle().world; ++ worldServer = getHandle().world; + x = getHandle().getPos().x; + z = getHandle().getPos().z; + } +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java +index af277342d96367cb7c6e9f80a0120181d7297024..eb96f041c414de4d19cf3878dc86db984eee08bd 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java +@@ -24,7 +24,7 @@ public class CraftIpBanList implements org.bukkit.BanList { + public org.bukkit.BanEntry getBanEntry(String target) { + Validate.notNull(target, "Target cannot be null"); + +- IpBanEntry entry = (IpBanEntry) list.get(target); ++ IpBanEntry entry = list.get(target); + if (entry == null) { + return null; + } +@@ -55,7 +55,7 @@ public class CraftIpBanList implements org.bukkit.BanList { + public Set getBanEntries() { + ImmutableSet.Builder builder = ImmutableSet.builder(); + for (String target : list.getEntries()) { +- builder.add(new CraftIpBanEntry(target, (IpBanEntry) list.get(target), list)); ++ builder.add(new CraftIpBanEntry(target, list.get(target), list)); + } + + return builder.build(); +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java +index 6239d96d78c35d1231d68b5f60fdb7dbb9214585..f12d310311515d3870d476c94cae1d012c8c19ad 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java +@@ -32,7 +32,7 @@ public class CraftProfileBanList implements org.bukkit.BanList { + return null; + } + +- GameProfileBanEntry entry = (GameProfileBanEntry) list.get(profile); ++ GameProfileBanEntry entry = list.get(profile); + if (entry == null) { + return null; + } +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index f35258fdc19a0fdb5940e3bd2339427cb1ca8a45..2445855bc4ce657afe746910b429063bf50e16c2 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -877,7 +877,7 @@ public final class CraftServer implements Server { + Map> perms; + + try { +- perms = (Map>) yaml.load(stream); ++ perms = yaml.load(stream); + } catch (MarkedYAMLException ex) { + getLogger().log(Level.WARNING, "Server permissions file " + file + " is not valid YAML: " + ex.toString()); + return; +@@ -976,8 +976,8 @@ public final class CraftServer implements Server { + + IRegistryCustom.Dimension iregistrycustom_dimension = IRegistryCustom.b(); + +- RegistryReadOps registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, console.dataPackResources.h(), (IRegistryCustom) iregistrycustom_dimension); +- WorldDataServer worlddata = (WorldDataServer) worldSession.a((DynamicOps) registryreadops, console.datapackconfiguration); ++ RegistryReadOps registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, console.dataPackResources.h(), iregistrycustom_dimension); ++ WorldDataServer worlddata = (WorldDataServer) worldSession.a(registryreadops, console.datapackconfiguration); + + WorldSettings worldSettings; + // See MinecraftServer.a(String, String, long, WorldType, JsonElement) +@@ -999,14 +999,14 @@ public final class CraftServer implements Server { + net.minecraft.server.Main.convertWorld(worldSession, DataConverterRegistry.a(), console.options.has("eraseCache"), () -> { + return true; + }, worlddata.getGeneratorSettings().e().c().stream().map((entry) -> { +- return ResourceKey.a(IRegistry.ad, ((ResourceKey) entry.getKey()).a()); ++ return ResourceKey.a(IRegistry.ad, entry.getKey().a()); + }).collect(ImmutableSet.toImmutableSet())); + } + + long j = BiomeManager.a(creator.seed()); + List list = ImmutableList.of(new MobSpawnerPhantom(), new MobSpawnerPatrol(), new MobSpawnerCat(), new VillageSiege(), new MobSpawnerTrader(worlddata)); + RegistryMaterials registrymaterials = worlddata.getGeneratorSettings().e(); +- WorldDimension worlddimension = (WorldDimension) registrymaterials.a(actualDimension); ++ WorldDimension worlddimension = registrymaterials.a(actualDimension); + DimensionManager dimensionmanager; + net.minecraft.server.ChunkGenerator chunkgenerator; + +@@ -1018,12 +1018,12 @@ public final class CraftServer implements Server { + chunkgenerator = worlddimension.c(); + } + +- ResourceKey typeKey = (ResourceKey) console.f.a().c(dimensionmanager).orElseThrow(() -> { ++ ResourceKey typeKey = console.f.a().c(dimensionmanager).orElseThrow(() -> { + return new IllegalStateException("Unregistered dimension type: " + dimensionmanager); + }); + ResourceKey worldKey = ResourceKey.a(IRegistry.ae, new MinecraftKey(name.toLowerCase(java.util.Locale.ENGLISH))); + +- WorldServer internal = (WorldServer) new WorldServer(console, console.executorService, worldSession, worlddata, worldKey, typeKey, dimensionmanager, getServer().worldLoadListenerFactory.create(11), ++ WorldServer internal = new WorldServer(console, console.executorService, worldSession, worlddata, worldKey, typeKey, dimensionmanager, getServer().worldLoadListenerFactory.create(11), + chunkgenerator, worlddata.getGeneratorSettings().isDebugWorld(), j, creator.environment() == Environment.NORMAL ? list : ImmutableList.of(), true, creator.environment(), generator); + + if (!(worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) { +@@ -1766,7 +1766,7 @@ public final class CraftServer implements Server { + getLogger().log(Level.SEVERE, "Exception when " + player.getName() + " attempted to tab complete " + message, ex); + } + +- return completions == null ? ImmutableList.of() : completions; ++ return completions == null ? ImmutableList.of() : completions; + } + + public List tabCompleteChat(Player player, String message) { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index ad8627fd5e04d93ba78f0e0dbeba956f1d5d9fee..a1f8a15f121919f236786192e1a25ab529f5ac15 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -1718,7 +1718,7 @@ public class CraftWorld implements World { + AxisAlignedBB bb = (ItemFrame.class.isAssignableFrom(clazz)) + ? EntityItemFrame.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).opposite(), width, height) + : EntityHanging.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).opposite(), width, height); +- List list = (List) world.getEntities(null, bb); ++ List list = world.getEntities(null, bb); + for (Iterator it = list.iterator(); !taken && it.hasNext();) { + net.minecraft.server.Entity e = it.next(); + if (e instanceof EntityHanging) { +@@ -1780,7 +1780,7 @@ public class CraftWorld implements World { + Preconditions.checkArgument(entity != null, "Cannot spawn null entity"); + + if (entity instanceof EntityInsentient) { +- ((EntityInsentient) entity).prepare(getHandle(), getHandle().getDamageScaler(entity.getChunkCoordinates()), EnumMobSpawn.COMMAND, (GroupDataEntity) null, null); ++ ((EntityInsentient) entity).prepare(getHandle(), getHandle().getDamageScaler(entity.getChunkCoordinates()), EnumMobSpawn.COMMAND, null, null); + } + + if (function != null) { +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java +index 678aa09d477f653461276e5eab277e1abc253dd8..b8ebe277086480943a4e571369a441e3baab1a5b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java +@@ -26,7 +26,7 @@ public abstract class CraftLootable extends CraftC + super.applyTo(lootable); + + if (this.getSnapshot().lootTable == null) { +- lootable.setLootTable((MinecraftKey) null, 0L); ++ lootable.setLootTable(null, 0L); + } + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +index 782c50c392222bb47de7c16b569257df4ed0d04c..d8f72d904a812a6827ef2c12dfaef375425d341a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -275,7 +275,7 @@ public class CraftBlockData implements BlockData { + NBTTagCompound compound = new NBTTagCompound(); + + for (Map.Entry, Comparable> entry : state.getStateMap().entrySet()) { +- IBlockState iblockstate = (IBlockState) entry.getKey(); ++ IBlockState iblockstate = entry.getKey(); + + compound.setString(iblockstate.getName(), iblockstate.a(entry.getValue())); + } +diff --git a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java +index e512df675cc01a7ff5d50cdec0ba08f23b454d6e..bba52d6cd94a0b7326e412cee2775c4cdd99cd8f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java +@@ -1,5 +1,6 @@ + package org.bukkit.craftbukkit.command; + ++import net.md_5.bungee.api.chat.BaseComponent; + import org.bukkit.Bukkit; + import org.bukkit.Server; + import org.bukkit.command.CommandSender; +@@ -96,13 +97,13 @@ public abstract class ServerCommandSender implements CommandSender { + @Override + public void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) + { +- ServerCommandSender.this.sendMessage(net.md_5.bungee.api.chat.TextComponent.toLegacyText(component)); ++ ServerCommandSender.this.sendMessage(BaseComponent.toLegacyText(component)); + } + + @Override + public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) + { +- ServerCommandSender.this.sendMessage(net.md_5.bungee.api.chat.TextComponent.toLegacyText(components)); ++ ServerCommandSender.this.sendMessage(BaseComponent.toLegacyText(components)); + } + }; + +diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +index 9f7ead4c0fc24fb7412a4164741a3fd57617e198..51aa6f04350e622b94b01b55c09cb0d428a12062 100644 +--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java ++++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +@@ -67,7 +67,7 @@ public final class VanillaCommandWrapper extends BukkitCommand { + return ((CraftBlockCommandSender) sender).getWrapper(); + } + if (sender instanceof CommandMinecart) { +- return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock().getWrapper(); ++ return ((CraftMinecartCommand) sender).getHandle().getCommandBlock().getWrapper(); + } + if (sender instanceof RemoteConsoleCommandSender) { + return ((DedicatedServer) MinecraftServer.getServer()).remoteControlCommandListener.getWrapper(); +diff --git a/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java b/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java +index 0e584c04c8deb199e573e6eefb3dcfe5eec7d54c..b40502d2ed20949433ab144f9217d16fdcea5caa 100644 +--- a/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java ++++ b/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java +@@ -31,9 +31,7 @@ public class ConversationTracker { + if (conversationQueue.getFirst() == conversation) { + conversation.abandon(details); + } +- if (conversationQueue.contains(conversation)) { +- conversationQueue.remove(conversation); +- } ++ conversationQueue.remove(conversation); + if (!conversationQueue.isEmpty()) { + conversationQueue.getFirst().outputNextPrompt(); + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java +index 6593347c49963a70be100a109be9d3aa934b572d..f7b498db147f4089d6c642f8482ad7b7f784d743 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java +@@ -224,9 +224,9 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud + @Override + public void setSource(ProjectileSource shooter) { + if (shooter instanceof CraftLivingEntity) { +- getHandle().setSource((EntityLiving) ((CraftLivingEntity) shooter).getHandle()); ++ getHandle().setSource(((CraftLivingEntity) shooter).getHandle()); + } else { +- getHandle().setSource((EntityLiving) null); ++ getHandle().setSource(null); + } + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexPart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexPart.java +index c1829a0d041330f37d7c6f5aa833e9fafcd7c13a..65542eb83f1e2714603992ddd8e1cc528abbc86b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexPart.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexPart.java +@@ -15,7 +15,7 @@ public class CraftComplexPart extends CraftEntity implements ComplexEntityPart { + + @Override + public ComplexLivingEntity getParent() { +- return (ComplexLivingEntity) ((EntityEnderDragon) getHandle().owner).getBukkitEntity(); ++ return (ComplexLivingEntity) getHandle().owner.getBukkitEntity(); + } + + @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java +index 46d8e36ac1f9ecb98e6f08af7ef16117998394cb..7b26d853e14d866c0d60b35326960b22c7088dfc 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java +@@ -31,7 +31,7 @@ public class CraftEnderCrystal extends CraftEntity implements EnderCrystal { + @Override + public void setBeamTarget(Location location) { + if (location == null) { +- getHandle().setBeamTarget((BlockPosition) null); ++ getHandle().setBeamTarget(null); + } else if (location.getWorld() != getWorld()) { + throw new IllegalArgumentException("Cannot set beam target location to different world"); + } else { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +index a2e283b941f399380551920a0533f7cdc15df8f5..a68271c5d896acf4ad600250a12445c1bfeb523e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +@@ -123,7 +123,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { + } + + // From BlockBed +- iblockdata = (IBlockData) iblockdata.set(BlockBed.OCCUPIED, true); ++ iblockdata = iblockdata.set(BlockBed.OCCUPIED, true); + getHandle().world.setTypeAndData(blockposition, iblockdata, 4); + + return true; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +index d9d4ba1f0b9e47b8632b2488f7a639e303b392d6..88fa1e4ce55b0de9b0b381f2377038d8dcfab260 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +@@ -430,7 +430,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + launch = new EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ()); + } + +- ((EntityFireball) launch).projectileSource = this; ++ launch.projectileSource = this; + launch.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + } else if (LlamaSpit.class.isAssignableFrom(projectile)) { + Location location = getEyeLocation(); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 3dbf0254047bc0c8a0bb06091b7e4407f285832c..e407b0a5b99b870af766de95ed877d37b33f7995 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -301,7 +301,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + name = getName(); + } + getHandle().listName = name.equals(getName()) ? null : CraftChatMessage.fromStringOrNull(name); +- for (EntityPlayer player : (List) server.getHandle().players) { ++ for (EntityPlayer player : server.getHandle().players) { + if (player.getBukkitEntity().canSee(this)) { + player.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, getHandle())); + } +@@ -1620,7 +1620,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + @Override + public float getFlySpeed() { +- return (float) getHandle().abilities.flySpeed * 2f; ++ return getHandle().abilities.flySpeed * 2f; + } + + @Override +@@ -1728,7 +1728,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + sendHealthUpdate(); + } + } +- getHandle().getDataWatcher().set(EntityLiving.HEALTH, (float) getScaledHealth()); ++ getHandle().getDataWatcher().set(EntityLiving.HEALTH, getScaledHealth()); + + getHandle().maxHealthCache = getMaxHealth(); + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftProjectile.java +index f947a6e8c664d017d3df7093161558d6203f62af..aab7639dc3a26fb72389aae10ac6fedaac69a0a8 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftProjectile.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftProjectile.java +@@ -19,7 +19,7 @@ public abstract class CraftProjectile extends AbstractProjectile implements Proj + @Override + public void setShooter(ProjectileSource shooter) { + if (shooter instanceof CraftLivingEntity) { +- getHandle().setShooter((EntityLiving) ((CraftLivingEntity) shooter).entity); ++ getHandle().setShooter(((CraftLivingEntity) shooter).entity); + } else { + getHandle().setShooter(null); + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java +index d68a84a17ee2964edca4e4370b584c2809c03d4b..838bee2db8a7b09955b3ba27118edd87f82bbbe6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java +@@ -32,7 +32,7 @@ public abstract class CraftRaider extends CraftMonster implements Raider { + @Override + public void setPatrolTarget(Block block) { + if (block == null) { +- getHandle().setPatrolTarget((BlockPosition) null); ++ getHandle().setPatrolTarget(null); + } else { + Preconditions.checkArgument(block.getWorld().equals(this.getWorld()), "Block must be in same world"); + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java +index 60d3135d5a503a982bea7f3738f2439c57244057..c37f147470a227f6de31df69669d74a1db9c0bc6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java +@@ -81,7 +81,7 @@ public class CraftVillagerZombie extends CraftZombie implements ZombieVillager { + getHandle().conversionPlayer = null; + getHandle().removeEffect(MobEffects.INCREASE_DAMAGE, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); + } else { +- getHandle().startConversion((UUID) null, time); ++ getHandle().startConversion(null, time); + } + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java b/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java +index e96c9887cf6900ef75d289ab97533635fb9244b9..389f10ed2d1b1fe3e065776c6230a226fdca96e1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java +@@ -17,11 +17,11 @@ public final class CraftMemoryMapper { + if (object instanceof GlobalPos) { + return fromNms((GlobalPos) object); + } else if (object instanceof Long) { +- return (Long) object; ++ return object; + } else if (object instanceof UUID) { +- return (UUID) object; ++ return object; + } else if (object instanceof Boolean) { +- return (Boolean) object; ++ return object; + } + + throw new UnsupportedOperationException("Do not know how to map " + object); +@@ -33,11 +33,11 @@ public final class CraftMemoryMapper { + } else if (object instanceof Location) { + return toNms((Location) object); + } else if (object instanceof Long) { +- return (Long) object; ++ return object; + } else if (object instanceof UUID) { +- return (UUID) object; ++ return object; + } else if (object instanceof Boolean) { +- return (Boolean) object; ++ return object; + } + + throw new UnsupportedOperationException("Do not know how to map " + object); +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +index a3fc8c0b641f0224affc399a73ef55f324c336b4..4788eed5f2f0d070dd49487a158dc63edf9dd288 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -127,7 +127,7 @@ public class CraftEventFactory { + * Entity Enter Love Mode Event + */ + public static EntityEnterLoveModeEvent callEntityEnterLoveModeEvent(EntityHuman entityHuman, EntityAnimal entityAnimal, int loveTicks) { +- EntityEnterLoveModeEvent entityEnterLoveModeEvent = new EntityEnterLoveModeEvent((Animals) entityAnimal.getBukkitEntity(), entityHuman != null ? (HumanEntity) entityHuman.getBukkitEntity() : null, loveTicks); ++ EntityEnterLoveModeEvent entityEnterLoveModeEvent = new EntityEnterLoveModeEvent((Animals) entityAnimal.getBukkitEntity(), entityHuman != null ? entityHuman.getBukkitEntity() : null, loveTicks); + Bukkit.getPluginManager().callEvent(entityEnterLoveModeEvent); + return entityEnterLoveModeEvent; + } +@@ -368,7 +368,7 @@ public class CraftEventFactory { + public static EntityShootBowEvent callEntityShootBowEvent(EntityLiving who, ItemStack itemstack, ItemStack arrowItem, IProjectile entityArrow, float force) { // paper + LivingEntity shooter = (LivingEntity) who.getBukkitEntity(); + CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack); +- org.bukkit.entity.Entity arrow = ((Entity) entityArrow).getBukkitEntity(); // Paper ++ org.bukkit.entity.Entity arrow = entityArrow.getBukkitEntity(); // Paper + + if (itemInHand != null && (itemInHand.getType() == Material.AIR || itemInHand.getAmount() == 0)) { + itemInHand = null; +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +index 967eb9ab814b594247bf999b017af5c38ac3fb4f..97a704196419a4f0054b15d0ef3470970e85e6ff 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +@@ -233,7 +233,7 @@ public final class CraftItemStack extends ItemStack { + + @Override + public Map getEnchantments() { +- return hasItemMeta() ? getItemMeta().getEnchants() : ImmutableMap.of(); // Paper - use Item Meta ++ return hasItemMeta() ? getItemMeta().getEnchants() : ImmutableMap.of(); // Paper - use Item Meta + } + + static Map getEnchantments(net.minecraft.server.ItemStack item) { +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java +index bcc3b23e39e4e4516655f0b725077567c7fd3ad4..7defc725eb9c98a0a3770f7cccbd95862ea9ded0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java +@@ -140,7 +140,7 @@ class CraftMetaEnchantedBook extends CraftMetaItem implements EnchantmentStorage + + @Override + public Map getStoredEnchants() { +- return hasStoredEnchants() ? ImmutableMap.copyOf(enchantments) : ImmutableMap.of(); ++ return hasStoredEnchants() ? ImmutableMap.copyOf(enchantments) : ImmutableMap.of(); + } + + @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +index 54820c36311d5bd2a7d5f600ec3deaf92e81b85c..2ffc76c0efdaaf20b33a6d37421214da24a00138 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +@@ -371,7 +371,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { + + @Override + public List getEffects() { +- return this.effects == null ? ImmutableList.of() : ImmutableList.copyOf(this.effects); ++ return this.effects == null ? ImmutableList.of() : ImmutableList.copyOf(this.effects); + } + + @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +index 23df1af99051e565f03f63f0b5a9acc55575b22f..90353b05e8e3a2ee74ad3b9d18edf3c30c3ea361 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +@@ -910,7 +910,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { + + @Override + public Map getEnchants() { +- return hasEnchants() ? ImmutableSortedMap.copyOfSorted(enchantments) : ImmutableMap.of(); // Paper ++ return hasEnchants() ? ImmutableSortedMap.copyOfSorted(enchantments) : ImmutableMap.of(); // Paper + } + + @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +index 4d93b4a6670d1e13e6ec5123d91170a5b47122f1..0f1b07910cf079b3487bf32258b63b55aa3bfe6c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java ++++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +@@ -411,6 +411,6 @@ public final class CraftLegacy { + } + + public static void main(String[] args) { +- System.err.println(""); ++ System.err.println(); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java +index 93b39092c6f3cefc9b29d29aaae3876a12d7c383..6a4dc203b0e8bf1be65d91e160375ee079c7d0c7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java ++++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java +@@ -41,7 +41,7 @@ public class CraftMapRenderer extends MapRenderer { + continue; + } + +- MapIcon decoration = (MapIcon) worldMap.decorations.get(key); ++ MapIcon decoration = worldMap.decorations.get(key); + cursors.addCursor(decoration.getX(), decoration.getY(), (byte) (decoration.getRotation() & 15), decoration.getType().a(), true, CraftChatMessage.fromComponent(decoration.getName())); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java +index 6592b115cdfb5e9a182a6232505770da16add13f..68d976b21648bebad07c421711b6b7ec5cd7f5b7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java ++++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java +@@ -136,7 +136,7 @@ public final class CraftMapView implements MapView { + renderCache.put(context ? player : null, render); + } + +- if (context && renderCache.containsKey(null)) { ++ if (context) { + renderCache.remove(null); + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java +index 5453271e6ac11511fb2ee88b4eb2e5d262df550c..039ff6a0152ca2b0e1b2336f8c26ec8a2fb0f9dd 100644 +--- a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java ++++ b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java +@@ -39,7 +39,7 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { + SourceBlock isourceblock = new SourceBlock(dispenserBlock.getWorld(), dispenserBlock.getPosition()); + // Copied from DispenseBehaviorProjectile + IPosition iposition = BlockDispenser.a(isourceblock); +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ EnumDirection enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); + net.minecraft.server.World world = dispenserBlock.getWorld(); + net.minecraft.server.Entity launch = null; + +@@ -70,7 +70,7 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { + launch = new EntityTippedArrow(world, iposition.getX(), iposition.getY(), iposition.getZ()); + } + ((EntityArrow) launch).fromPlayer = EntityArrow.PickupStatus.ALLOWED; +- ((EntityArrow) launch).projectileSource = this; ++ launch.projectileSource = this; + } else if (Fireball.class.isAssignableFrom(projectile)) { + double d0 = iposition.getX() + (double) ((float) enumdirection.getAdjacentX() * 0.3F); + double d1 = iposition.getY() + (double) ((float) enumdirection.getAdjacentY() * 0.3F); +@@ -85,7 +85,7 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { + } else if (WitherSkull.class.isAssignableFrom(projectile)) { + launch = EntityTypes.WITHER_SKULL.a(world); + launch.setPosition(d0, d1, d2); +- double d6 = (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5); ++ double d6 = MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5); + + ((EntityFireball) launch).dirX = d3 / d6 * 0.1D; + ((EntityFireball) launch).dirY = d4 / d6 * 0.1D; +@@ -93,21 +93,21 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { + } else { + launch = EntityTypes.FIREBALL.a(world); + launch.setPosition(d0, d1, d2); +- double d6 = (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5); ++ double d6 = MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5); + + ((EntityFireball) launch).dirX = d3 / d6 * 0.1D; + ((EntityFireball) launch).dirY = d4 / d6 * 0.1D; + ((EntityFireball) launch).dirZ = d5 / d6 * 0.1D; + } + +- ((EntityFireball) launch).projectileSource = this; ++ launch.projectileSource = this; + } + + Validate.notNull(launch, "Projectile not supported"); + + if (launch instanceof IProjectile) { + if (launch instanceof EntityProjectile) { +- ((EntityProjectile) launch).projectileSource = this; ++ launch.projectileSource = this; + } + // Values from DispenseBehaviorProjectile + float a = 6.0F; +@@ -118,7 +118,7 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { + b *= 1.25F; + } + // Copied from DispenseBehaviorProjectile +- ((IProjectile) launch).shoot((double) enumdirection.getAdjacentX(), (double) ((float) enumdirection.getAdjacentY() + 0.1F), (double) enumdirection.getAdjacentZ(), b, a); ++ ((IProjectile) launch).shoot(enumdirection.getAdjacentX(), (float) enumdirection.getAdjacentY() + 0.1F, enumdirection.getAdjacentZ(), b, a); + } + + if (velocity != null) { +diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +index 3b7090b7e0415ebd2df4ce5e4a60be55f0852651..caa6b70273e54d7ea57e35362db1a2432883f083 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java ++++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +@@ -58,7 +58,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { + Validate.notNull(criteria, "Criteria cannot be null"); + + ImmutableSet.Builder objectives = ImmutableSet.builder(); +- for (ScoreboardObjective netObjective : (Collection) this.board.getObjectives()) { ++ for (ScoreboardObjective netObjective : this.board.getObjectives()) { + CraftObjective objective = new CraftObjective(this, netObjective); + if (objective.getCriteria().equals(criteria)) { + objectives.add(objective); +@@ -69,7 +69,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { + + @Override + public ImmutableSet getObjectives() { +- return ImmutableSet.copyOf(Iterables.transform((Collection) this.board.getObjectives(), new Function() { ++ return ImmutableSet.copyOf(Iterables.transform(this.board.getObjectives(), new Function() { + + @Override + public Objective apply(ScoreboardObjective input) { +@@ -100,7 +100,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { + Validate.notNull(entry, "Entry cannot be null"); + + ImmutableSet.Builder scores = ImmutableSet.builder(); +- for (ScoreboardObjective objective : (Collection) this.board.getObjectives()) { ++ for (ScoreboardObjective objective : this.board.getObjectives()) { + scores.add(new CraftScore(new CraftObjective(this, objective), entry)); + } + return scores.build(); +@@ -117,7 +117,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { + public void resetScores(String entry) throws IllegalArgumentException { + Validate.notNull(entry, "Entry cannot be null"); + +- for (ScoreboardObjective objective : (Collection) this.board.getObjectives()) { ++ for (ScoreboardObjective objective : this.board.getObjectives()) { + board.resetPlayerScores(entry, objective); + } + } +@@ -148,7 +148,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { + + @Override + public ImmutableSet getTeams() { +- return ImmutableSet.copyOf(Iterables.transform((Collection) this.board.getTeams(), new Function() { ++ return ImmutableSet.copyOf(Iterables.transform(this.board.getTeams(), new Function() { + + @Override + public Team apply(ScoreboardTeam input) { +diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +index 0f8d2ffd5a293856b2fb8e6122a39cfd25d28d82..345f68ba2a9b39a021d556d080253dd4b913c838 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java ++++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +@@ -38,7 +38,7 @@ public final class CraftScoreboardManager implements ScoreboardManager { + // CraftBukkit method + public CraftScoreboard getPlayerBoard(CraftPlayer player) { + CraftScoreboard board = playerBoards.get(player); +- return (CraftScoreboard) (board == null ? getMainScoreboard() : board); ++ return board == null ? getMainScoreboard() : board; + } + + // CraftBukkit method +@@ -57,7 +57,7 @@ public final class CraftScoreboardManager implements ScoreboardManager { + if (scoreboard == mainScoreboard) { + playerBoards.remove(player); + } else { +- playerBoards.put(player, (CraftScoreboard) scoreboard); ++ playerBoards.put(player, scoreboard); + } + + // Old objective tracking +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +index f00d81077e372d6dbe34ab0d703316f397083978..016bf6fd0539d22305527bcd940c46c5304ea1dc 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +@@ -136,7 +136,7 @@ public final class CraftChatMessage { + } + modifier = modifier.setChatClickable(new ChatClickable(EnumClickAction.OPEN_URL, match)); + appendNewComponent(matcher.end(groupId)); +- modifier = modifier.setChatClickable((ChatClickable) null); ++ modifier = modifier.setChatClickable(null); + break; + case 3: + if (needsAdd) { +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index 58ac86c205fa8f2b18412d8524731c2322d4077d..2b8a6df9cff432f8eb0555ed3c74ffa2e92d664d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -202,7 +202,7 @@ public final class CraftMagicNumbers implements UnsafeValues { + net.minecraft.server.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack); + + try { +- nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments)); ++ nmsStack.setTag(MojangsonParser.parse(arguments)); + } catch (CommandSyntaxException ex) { + Logger.getLogger(CraftMagicNumbers.class.getName()).log(Level.SEVERE, null, ex); + } +diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java +index d842b72d1fad93b7e499bb7af6fa0cae2cb04e8b..8c6e8078efb65c9d77c9c4d74a13fa6d68f3e742 100644 +--- a/src/main/java/org/spigotmc/SpigotConfig.java ++++ b/src/main/java/org/spigotmc/SpigotConfig.java +@@ -142,7 +142,7 @@ public class SpigotConfig + private static List getList(String path, T def) + { + config.addDefault( path, def ); +- return (List) config.getList( path, config.getList( path ) ); ++ return config.getList( path, config.getList( path ) ); + } + + private static String getString(String path, String def) +@@ -186,7 +186,7 @@ public class SpigotConfig + public static String unknownCommandMessage; + public static String serverFullMessage; + public static String outdatedClientMessage = "Outdated client! Please use {0}"; +- public static String outdatedServerMessage = "Outdated server! I\'m still on {0}"; ++ public static String outdatedServerMessage = "Outdated server! I'm still on {0}"; + private static String transform(String s) + { + return ChatColor.translateAlternateColorCodes( '&', s ).replaceAll( "\\\\n", "\n" ); +@@ -290,10 +290,7 @@ public class SpigotConfig + public static List spamExclusions; + private static void spamExclusions() + { +- spamExclusions = getList( "commands.spam-exclusions", Arrays.asList( new String[] +- { +- "/skill" +- } ) ); ++ spamExclusions = getList( "commands.spam-exclusions", Arrays.asList("/skill") ); + } + + public static boolean silentCommandBlocks; +@@ -378,7 +375,7 @@ public class SpigotConfig + public static List disabledAdvancements; + private static void disabledAdvancements() { + disableAdvancementSaving = getBoolean("advancements.disable-saving", false); +- disabledAdvancements = getList("advancements.disabled", Arrays.asList(new String[]{"minecraft:story/disabled"})); ++ disabledAdvancements = getList("advancements.disabled", Arrays.asList("minecraft:story/disabled")); + } + + public static boolean logVillagerDeaths; +diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +index e92462eaa355a325a78c5b16c7d44dbcacf586c8..ca71e3d446f01bd41f0252ace03be57de6847d72 100644 +--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java ++++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +@@ -66,7 +66,7 @@ public class SpigotWorldConfig + public List getList(String path, T def) // Paper - private -> public + { + config.addDefault( "world-settings.default." + path, def ); +- return (List) config.getList( "world-settings." + worldName + "." + path, config.getList( "world-settings.default." + path ) ); ++ return config.getList( "world-settings." + worldName + "." + path, config.getList( "world-settings.default." + path ) ); + } + + public String getString(String path, String def) // Paper - private -> public +diff --git a/src/test/java/org/bukkit/BlockDataConversionTest.java b/src/test/java/org/bukkit/BlockDataConversionTest.java +index a1719437849ea14c4ce53f72cd9ad0aeb40d1035..71dd4587f2b1303dc613a48852f99709c5dfa8ac 100644 +--- a/src/test/java/org/bukkit/BlockDataConversionTest.java ++++ b/src/test/java/org/bukkit/BlockDataConversionTest.java +@@ -23,7 +23,7 @@ public class BlockDataConversionTest extends AbstractTestingBase { + @Parameterized.Parameters(name = "{index}: {0}") + public static List args() { + List list = new ArrayList<>(); +- for (Block block : (Iterable) IRegistry.BLOCK) { ++ for (Block block : IRegistry.BLOCK) { + list.add(new Object[]{block.getBlockData()}); + } + return list; +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/CompositeSerialization.java b/src/test/java/org/bukkit/craftbukkit/inventory/CompositeSerialization.java +index 3a405223002a15210e6b05c62030310f2ad21855..5de9423776f04897b1ba527462e870e43d716e07 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/CompositeSerialization.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/CompositeSerialization.java +@@ -67,7 +67,7 @@ public class CompositeSerialization extends AbstractTestingBase { + assertThat(stacks, hasSize(raw.size())); + + for (int i = 0; i < raw.size(); i++) { +- assertThat(String.valueOf(i), (Object) stacks.get(i), is((Object) raw.get(i))); ++ assertThat(String.valueOf(i), (Object) stacks.get(i), is(raw.get(i))); + } + } + } +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +index 6adc6850effe0e75ea16d5bd03c7defdf4eaa952..4ac41485ee0ceaedaee99fc61443f11c8d5bee45 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +@@ -145,7 +145,7 @@ public class ItemMetaTest extends AbstractTestingBase { + craft.setItemMeta(craft.getItemMeta()); + ItemStack bukkit = new ItemStack(craft); + assertThat(craft, is(bukkit)); +- assertThat(bukkit, is((ItemStack) craft)); ++ assertThat(bukkit, is(craft)); + } + + @Test