mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-29 22:23:50 +01:00
32454 lines
1.9 MiB
32454 lines
1.9 MiB
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Bud Gidiere <sgidiere@gmail.com>
|
|
Date: Sun, 9 Aug 2020 17:22:50 -0500
|
|
Subject: [PATCH] Intellij Code Clean Up
|
|
|
|
Do not update, just regen.
|
|
|
|
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<String> 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 <T> List getList(String path, T def) {
|
|
config.addDefault(path, def);
|
|
- return (List<T>) 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 <T> List<T> getList(String path, List<T> 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<T> extends TickListServer<T> { // 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 <T> List getList(String path, T def) {
|
|
config.addDefault(path, def);
|
|
- return (List<T>) 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 <T> List<T> getList(String path, List<T> 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<String> 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 a7ffc8705040572555625fd0d375126667dd1b61..6d3a2c874077f3abaeda1e365963ce601c901085 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 <T> List getList(String path, T def) {
|
|
config.addDefault(path, def);
|
|
- return (List<T>) 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<String, Criterion> 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<Advancement, AdvancementProgress> 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<MinecraftKey, AdvancementProgress> map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue());
|
|
+ Map<MinecraftKey, AdvancementProgress> 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<MinecraftKey, AdvancementProgress> 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<Advancement, AdvancementProgress> 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<String, Criterion> 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<CriterionInstance> 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<String, Criterion> 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<CriterionInstance> 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<SuggestionsBuilder, Tags<Block>, CompletableFuture<Suggestions>> h = (suggestionsbuilder, tags) -> {
|
|
@@ -318,15 +318,15 @@ public class ArgumentBlock {
|
|
}
|
|
|
|
private CompletableFuture<Suggestions> k(SuggestionsBuilder suggestionsbuilder, Tags<Block> 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<Suggestions> l(SuggestionsBuilder suggestionsbuilder, Tags<Block> 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<T> 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<Suggestions> a(SuggestionsBuilder suggestionsbuilder, Tags<Block> tags) {
|
|
- return (CompletableFuture) this.s.apply(suggestionsbuilder.createOffset(this.i.getCursor()), tags);
|
|
+ return this.s.apply(suggestionsbuilder.createOffset(this.i.getCursor()), tags);
|
|
}
|
|
|
|
public Map<String, String> 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<EntitySelector> {
|
|
}
|
|
|
|
public static Entity a(CommandContext<CommandListenerWrapper> 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<EntitySelector> {
|
|
}
|
|
|
|
public static Collection<? extends Entity> c(CommandContext<CommandListenerWrapper> 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<EntityPlayer> d(CommandContext<CommandListenerWrapper> 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<EntitySelector> {
|
|
}
|
|
|
|
public static EntityPlayer e(CommandContext<CommandListenerWrapper> 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<EntitySelector> {
|
|
}
|
|
|
|
public static Collection<EntityPlayer> f(CommandContext<CommandListenerWrapper> commandcontext, String s) throws CommandSyntaxException {
|
|
- List<EntityPlayer> list = ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).d((CommandListenerWrapper) commandcontext.getSource());
|
|
+ List<EntityPlayer> 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<EntitySelector> {
|
|
Collection<String> collection = icompletionprovider.l();
|
|
Iterable<String> 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<Vec3D, List<? extends Entity>> 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<Entity> a(CriterionConditionRange criterionconditionrange, ToDoubleFunction<Entity> 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<Suggestions> a(SuggestionsBuilder suggestionsbuilder, Consumer<SuggestionsBuilder> 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<T> extends AbstractSet<T> {
|
|
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<T> extends AbstractSet<T> {
|
|
}
|
|
|
|
public Object[] toArray() {
|
|
- return (Object[]) this.b.clone();
|
|
+ return this.b.clone();
|
|
}
|
|
|
|
public <U> U[] toArray(U[] au) {
|
|
@@ -180,7 +180,7 @@ public class ArraySetSorted<T> extends AbstractSet<T> {
|
|
}
|
|
|
|
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<BaseBlockPosition> {
|
|
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<BaseBlockPosition> {
|
|
}
|
|
|
|
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<BaseBlockPosition> {
|
|
|
|
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<E extends EntityInsentient> 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 <E extends EntityLiving> boolean a(E e0) {
|
|
Optional<Long> 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<EntityLiving> 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<E extends EntityInsentient> extends Behavio
|
|
if (!this.b.test(e0)) {
|
|
return false;
|
|
} else {
|
|
- Optional<? extends EntityLiving> optional = (Optional) this.c.apply(e0);
|
|
+ Optional<? extends EntityLiving> 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<EntityVillager> {
|
|
}
|
|
|
|
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/BehaviorController.java b/src/main/java/net/minecraft/server/BehaviorController.java
|
|
index 00f509613a7e67fa89325f66728fe1f20c0a8821..19d484b287a32f1f0e0fb5c4e8655d910d4efc26 100644
|
|
--- a/src/main/java/net/minecraft/server/BehaviorController.java
|
|
+++ b/src/main/java/net/minecraft/server/BehaviorController.java
|
|
@@ -86,7 +86,7 @@ public class BehaviorController<E extends EntityLiving> {
|
|
return recordbuilder;
|
|
}
|
|
}).fieldOf("memories").codec());
|
|
- return (Codec) mutableobject.getValue();
|
|
+ return mutableobject.getValue();
|
|
}
|
|
|
|
public BehaviorController(Collection<? extends MemoryModuleType<?>> collection, Collection<? extends SensorType<? extends Sensor<? super E>>> collection1, ImmutableList<BehaviorController.a<?>> immutablelist, Supplier<Codec<BehaviorController<E>>> supplier) {
|
|
@@ -198,7 +198,7 @@ public class BehaviorController<E extends EntityLiving> {
|
|
}
|
|
|
|
public boolean a(MemoryModuleType<?> memorymoduletype, MemoryStatus memorystatus) {
|
|
- Optional<? extends ExpirableMemory<?>> optional = (Optional) this.memories.get(memorymoduletype);
|
|
+ Optional<? extends ExpirableMemory<?>> optional = this.memories.get(memorymoduletype);
|
|
|
|
return optional == null ? false : memorystatus == MemoryStatus.REGISTERED || memorystatus == MemoryStatus.VALUE_PRESENT && optional.isPresent() || memorystatus == MemoryStatus.VALUE_ABSENT && !optional.isPresent();
|
|
}
|
|
@@ -286,7 +286,7 @@ public class BehaviorController<E extends EntityLiving> {
|
|
Activity activity1 = (Activity) iterator.next();
|
|
|
|
if (activity1 != activity) {
|
|
- Set<MemoryModuleType<?>> set = (Set) this.h.get(activity1);
|
|
+ Set<MemoryModuleType<?>> set = this.h.get(activity1);
|
|
|
|
if (set != null) {
|
|
Iterator iterator1 = set.iterator();
|
|
@@ -381,9 +381,9 @@ public class BehaviorController<E extends EntityLiving> {
|
|
|
|
while (iterator.hasNext()) {
|
|
Entry<MemoryModuleType<?>, Optional<? extends ExpirableMemory<?>>> entry = (Entry) iterator.next();
|
|
- MemoryModuleType<?> memorymoduletype = (MemoryModuleType) entry.getKey();
|
|
+ MemoryModuleType<?> memorymoduletype = entry.getKey();
|
|
|
|
- if (((Optional) entry.getValue()).isPresent()) {
|
|
+ if (entry.getValue().isPresent()) {
|
|
behaviorcontroller.memories.put(memorymoduletype, entry.getValue());
|
|
}
|
|
}
|
|
@@ -415,7 +415,7 @@ public class BehaviorController<E extends EntityLiving> {
|
|
while (iterator.hasNext()) {
|
|
Entry<MemoryModuleType<?>, Optional<? extends ExpirableMemory<?>>> entry = (Entry) iterator.next();
|
|
|
|
- if (((Optional) entry.getValue()).isPresent()) {
|
|
+ if (entry.getValue().isPresent()) {
|
|
ExpirableMemory<?> expirablememory = (ExpirableMemory) ((Optional) entry.getValue()).get();
|
|
|
|
expirablememory.a();
|
|
@@ -449,10 +449,10 @@ public class BehaviorController<E extends EntityLiving> {
|
|
|
|
while (iterator1.hasNext()) {
|
|
Entry<Activity, Set<Behavior<? super E>>> entry = (Entry) iterator1.next();
|
|
- Activity activity = (Activity) entry.getKey();
|
|
+ Activity activity = entry.getKey();
|
|
|
|
if (this.j.contains(activity)) {
|
|
- Set<Behavior<? super E>> set = (Set) entry.getValue();
|
|
+ Set<Behavior<? super E>> set = entry.getValue();
|
|
Iterator iterator2 = set.iterator();
|
|
|
|
while (iterator2.hasNext()) {
|
|
@@ -496,8 +496,8 @@ public class BehaviorController<E extends EntityLiving> {
|
|
|
|
Pair<MemoryModuleType<?>, MemoryStatus> pair = (Pair) iterator.next();
|
|
|
|
- memorymoduletype = (MemoryModuleType) pair.getFirst();
|
|
- memorystatus = (MemoryStatus) pair.getSecond();
|
|
+ memorymoduletype = pair.getFirst();
|
|
+ memorystatus = pair.getSecond();
|
|
} while (this.a(memorymoduletype, memorystatus));
|
|
|
|
return false;
|
|
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<EntityVillager> {
|
|
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<EntityVillager> {
|
|
|
|
@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<EntityVillager> {
|
|
}
|
|
|
|
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<EntityVillager> {
|
|
}
|
|
|
|
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<E extends EntityLiving> extends Behavior<E> {
|
|
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<E extends EntityLiving> extends Behavior<E> {
|
|
|
|
@Override
|
|
public String toString() {
|
|
- Set<? extends Behavior<? super E>> set = (Set) this.e.c().filter((behavior) -> {
|
|
- return behavior.a() == Behavior.Status.RUNNING;
|
|
+ Set<? extends Behavior<? super E>> 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<EntityLiving> {
|
|
@Override
|
|
protected void a(WorldServer worldserver, EntityLiving entityliving, long i) {
|
|
BehaviorController<?> behaviorcontroller = entityliving.getBehaviorController();
|
|
- PathEntity pathentity = (PathEntity) behaviorcontroller.getMemory(MemoryModuleType.PATH).get();
|
|
- List<GlobalPos> list = (List) behaviorcontroller.getMemory(MemoryModuleType.INTERACTABLE_DOORS).get();
|
|
+ PathEntity pathentity = behaviorcontroller.getMemory(MemoryModuleType.PATH).get();
|
|
+ List<GlobalPos> list = behaviorcontroller.getMemory(MemoryModuleType.INTERACTABLE_DOORS).get();
|
|
List<BlockPosition> result = new ArrayList<>();
|
|
for (PathPoint pathpoint : pathentity.d()) {
|
|
BlockPosition blockPosition = new BlockPosition(pathpoint.a, pathpoint.b, pathpoint.c);
|
|
result.add(blockPosition);
|
|
}
|
|
- List<BlockPosition> list1 = (List) result;
|
|
+ List<BlockPosition> list1 = result;
|
|
Set<BlockPosition> set = this.a(worldserver, list, list1);
|
|
int j = pathentity.f() - 1;
|
|
|
|
@@ -64,7 +64,7 @@ public class BehaviorInteractDoor extends Behavior<EntityLiving> {
|
|
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<EntityLiving> {
|
|
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<EntityVillager> {
|
|
}
|
|
|
|
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<EntityVillager> {
|
|
Optional<EntityVillager> 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<EntityVillager> {
|
|
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<BlockPosition> 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<EntityLiving> {
|
|
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<EntityLiving> {
|
|
Optional<Long> 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<EntityLiving> {
|
|
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<EntityLiving> {
|
|
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<EntityLiving> {
|
|
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<EntityLiving> 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<EntityVillager> a(EntityVillager entityvillager, Predicate<EntityVillager> 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<EntityVillager> {
|
|
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<EntityVillager> {
|
|
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<GlobalPos> 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<EntityTypes<?>, BiomeBase.e> w = Maps.newHashMap();
|
|
private final List<BiomeBase.d> x;
|
|
private final ThreadLocal<Long2FloatLinkedOpenHashMap> 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 <C extends WorldGenCarverConfiguration> WorldGenCarverWrapper<C> a(WorldGenCarverAbstract<C> 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<BiomeBase.BiomeMeta> 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 <C extends WorldGenCarverConfiguration> void a(WorldGenStage.Features worldgenstage_features, WorldGenCarverWrapper<C> 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<WorldGenCarverWrapper<?>> 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<WorldGenFeatureConfigured<?, ?>> h() {
|
|
@@ -333,7 +333,7 @@ public class BiomeBase {
|
|
}
|
|
|
|
public List<WorldGenFeatureConfigured<?, ?>> 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<Entity> 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<Entity> 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<A> {
|
|
@@ -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<Vec3D> 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<Block, IBlockData> 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<ItemStack> 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<? extends Entity> 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<Block, IBlockData> 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<RecipeCampfire> 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<TileEntityChest> 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<TileEntityTypes<? extends TileEntityChest>> 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<TileEntityChest> 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<TileEntityChest> 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<TileEntityChest> 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<TileEntityChest> 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<? extends TileEntityChest> a(IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) {
|
|
@@ -249,7 +249,7 @@ public class BlockChest extends BlockChestAbstract<TileEntityChest> 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<TileEntityChest> implements I
|
|
return false;
|
|
}
|
|
// Paper end
|
|
- List<EntityCat> 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<EntityCat> 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<TileEntityChest> 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<Block, IBlockData> 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<IMaterial> 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<World> 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<Block, IBlockData> 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<EnumDirection, BlockStateBoolean> p = (Map) BlockSprawling.g.entrySet().stream().filter((entry) -> {
|
|
+ private static final Map<EnumDirection, BlockStateBoolean> p = BlockSprawling.g.entrySet().stream().filter((entry) -> {
|
|
return entry.getKey() != EnumDirection.DOWN;
|
|
}).collect(SystemUtils.a());
|
|
private final Object2IntMap<Block> 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<Block, IBlockData> 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<EntityMinecartAbstract> list = this.a(world, blockposition, EntityMinecartAbstract.class, (Predicate) null);
|
|
+ List<EntityMinecartAbstract> 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<EntityMinecartCommandBlock> list = this.a(world, blockposition, EntityMinecartCommandBlock.class, (Predicate) null);
|
|
+ if (iblockdata.get(BlockMinecartDetector.POWERED)) {
|
|
+ List<EntityMinecartCommandBlock> 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<EntityMinecartAbstract> 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<BlockPropertyTrackPosition> 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<Block, IBlockData> 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.<org.bukkit.block.Block>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<IBlockData> 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<BlockPosition, IBlockData> 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<Block, IBlockData> 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<BlockPropertyPistonType> 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<ItemStack> 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<EntityItemFrame> 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>) (entityitemframe) -> {
|
|
+ List<EntityItemFrame> 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<Block, IBlockData> 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<BlockRedstoneTorch.RedstoneUpdateInfo> 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<EnumDirection, BlockStateEnum<BlockPropertyRedstoneSide>> 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<EnumDirection, VoxelShape> 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<EnumDirection, VoxelShape> 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<EnumDirection, VoxelShape> 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<IBlockData, VoxelShape> 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<BlockPosition> 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<BlockPosition, Integer> tuple = (Tuple) queue.poll();
|
|
- BlockPosition blockposition1 = (BlockPosition) tuple.a();
|
|
- int j = (Integer) tuple.b();
|
|
+ Tuple<BlockPosition, Integer> 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<T extends Enum<T> & INamable> extends IBlockState<T>
|
|
|
|
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<T extends Enum<T> & INamable> extends IBlockState<T>
|
|
}
|
|
|
|
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<T extends Enum<T> & INamable> extends IBlockState<T>
|
|
}
|
|
|
|
public static <T extends Enum<T> & INamable> BlockStateEnum<T> of(String s, Class<T> oclass) {
|
|
- return a(s, oclass, (Predicate) Predicates.alwaysTrue());
|
|
+ return a(s, oclass, Predicates.alwaysTrue());
|
|
}
|
|
|
|
public static <T extends Enum<T> & INamable> BlockStateEnum<T> a(String s, Class<T> oclass, Predicate<T> predicate) {
|
|
@@ -77,11 +77,11 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends IBlockState<T>
|
|
list.add(t);
|
|
}
|
|
}
|
|
- return a(s, oclass, (Collection) list);
|
|
+ return a(s, oclass, list);
|
|
}
|
|
|
|
public static <T extends Enum<T> & INamable> BlockStateEnum<T> of(String s, Class<T> oclass, T... at) {
|
|
- return a(s, oclass, (Collection) Lists.newArrayList(at));
|
|
+ return a(s, oclass, Lists.newArrayList(at));
|
|
}
|
|
|
|
public static <T extends Enum<T> & INamable> BlockStateEnum<T> a(String s, Class<T> oclass, Collection<T> 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<Block, IBlockData> 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<? extends Entity> list = world.getEntities((Entity) null, iblockdata.getShape(world, blockposition).getBoundingBox().a(blockposition));
|
|
+ List<? extends Entity> 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<EnumDirection, BlockStateBoolean> f = (Map) BlockSprawling.g.entrySet().stream().filter((entry) -> {
|
|
+ public static final Map<EnumDirection, BlockStateBoolean> 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<EnumChatFormat, ChatHexColor> a = (Map) Stream.of(EnumChatFormat.values()).filter(EnumChatFormat::d).collect(ImmutableMap.toImmutableMap(Function.identity(), (enumchatformat) -> {
|
|
+ private static final Map<EnumChatFormat, ChatHexColor> 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<String, ChatHexColor> b = (Map) ChatHexColor.a.values().stream().collect(ImmutableMap.toImmutableMap((chathexcolor) -> {
|
|
+ private static final Map<String, ChatHexColor> 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<ChatModifier>, JsonSerializer<ChatModifier> {
|
|
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<HeightMap.Type, HeightMap> 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<PlayerChunk.State> 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<List<ObjectSet<BlockPosition>>> 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<ObjectSet<BlockPosition>> list = (List) this.g.get();
|
|
+ int i = iblockdata2.get(BlockProperties.an);
|
|
+ List<ObjectSet<BlockPosition>> 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<ObjectSet<BlockPosition>> list = (List) this.g.get();
|
|
+ List<ObjectSet<BlockPosition>> list = this.g.get();
|
|
|
|
for (int i = 2; i < list.size(); ++i) {
|
|
int j = i - 1;
|
|
- ObjectSet<BlockPosition> objectset = (ObjectSet) list.get(j);
|
|
- ObjectSet<BlockPosition> objectset1 = (ObjectSet) list.get(i);
|
|
+ ObjectSet<BlockPosition> objectset = list.get(j);
|
|
+ ObjectSet<BlockPosition> 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<ChunkCoordIntPair>((long) (i * j), 64) {
|
|
+ return StreamSupport.stream(new AbstractSpliterator<ChunkCoordIntPair>(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<Ticket<?>> 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<Ticket<?>> 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<Ticket<?>> 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<EntityPlayer> objectset = (ObjectSet) this.c.get(i);
|
|
+ ObjectSet<EntityPlayer> 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<Ticket<?>> arraysetsorted = (ArraySetSorted) this.tickets.get(i);
|
|
+ ArraySetSorted<Ticket<?>> 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<Ticket<?>> arraysetsorted = (ArraySetSorted) ChunkMapDistance.this.tickets.get(i);
|
|
+ ArraySetSorted<Ticket<?>> 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<EntityPlayer> objectset = (ObjectSet) ChunkMapDistance.this.c.get(i);
|
|
+ ObjectSet<EntityPlayer> 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<IChunkAccess> 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<HeightMap.Type, HeightMap> 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<StructureGenerator<?>, 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<StructureGenerator<?>, 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<ChunkStatus> 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>) (intarraylist) -> { // CraftBukkit - decompile error
|
|
+ private static final IntList r = SystemUtils.a((new IntArrayList(a().size())), (java.util.function.Consumer<IntArrayList>) (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<Either<IChunkAccess, PlayerChunk.Failure>> a(WorldServer worldserver, ChunkGenerator chunkgenerator, DefinedStructureManager definedstructuremanager, LightEngineThreaded lightenginethreaded, Function<IChunkAccess, CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>>> function, List<IChunkAccess> 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<Either<IChunkAccess, PlayerChunk.Failure>> a(WorldServer worldserver, DefinedStructureManager definedstructuremanager, LightEngineThreaded lightenginethreaded, Function<IChunkAccess, CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>>> 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<HeightMap.Type> 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<BlockPosition> 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<CommandListenerWrapper> 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<CommandListenerWrapper> 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<ICompletionProvider> 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<String> 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 <S> CommandSyntaxException a(ParseResults<S> 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<CommandListenerWrapper> 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<CommandListenerWrapper> com_mojang_brigadier_commanddispatcher) {
|
|
- LiteralArgumentBuilder<CommandListenerWrapper> literalargumentbuilder = (LiteralArgumentBuilder) CommandDispatcher.a("gamemode").requires((commandlistenerwrapper) -> {
|
|
+ LiteralArgumentBuilder<CommandListenerWrapper> 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<CommandListenerWrapper> com_mojang_brigadier_commanddispatcher) {
|
|
- final LiteralArgumentBuilder<CommandListenerWrapper> literalargumentbuilder = (LiteralArgumentBuilder) CommandDispatcher.a("gamerule").requires((commandlistenerwrapper) -> {
|
|
+ final LiteralArgumentBuilder<CommandListenerWrapper> literalargumentbuilder = CommandDispatcher.a("gamerule").requires((commandlistenerwrapper) -> {
|
|
return commandlistenerwrapper.hasPermission(2);
|
|
});
|
|
|
|
@@ -14,7 +14,7 @@ public class CommandGamerule {
|
|
@Override
|
|
public <T extends GameRules.GameRuleValue<T>> void a(GameRules.GameRuleKey<T> gamerules_gamerulekey, GameRules.GameRuleDefinition<T> 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 <T extends GameRules.GameRuleValue<T>> int b(CommandContext<CommandListenerWrapper> commandcontext, GameRules.GameRuleKey<T> 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 <T extends GameRules.GameRuleValue<T>> int b(CommandListenerWrapper commandlistenerwrapper, GameRules.GameRuleKey<T> 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<CommandListenerWrapper> resultconsumer, BinaryOperator<ResultConsumer<CommandListenerWrapper>> binaryoperator) {
|
|
- ResultConsumer<CommandListenerWrapper> resultconsumer1 = (ResultConsumer) binaryoperator.apply(this.l, resultconsumer);
|
|
+ ResultConsumer<CommandListenerWrapper> 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<CommandListenerWrapper> 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<? extends Entity> 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<CommandListenerWrapper> com_mojang_brigadier_commanddispatcher) {
|
|
- LiteralCommandNode<CommandListenerWrapper> literalcommandnode = com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("teleport").requires((commandlistenerwrapper) -> {
|
|
+ LiteralCommandNode<CommandListenerWrapper> 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<CommandListenerWrapper> 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<ItemStack> 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<WeightedRandomEnchant> 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<WeightedRandomEnchant> a(ItemStack itemstack, int i, int j) {
|
|
- this.h.setSeed((long) (this.i.get() + i));
|
|
+ this.h.setSeed(this.i.get() + i);
|
|
List<WeightedRandomEnchant> 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<IInventory> {
|
|
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<IInventory> {
|
|
@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<IInventory> {
|
|
}
|
|
|
|
protected boolean a(ItemStack itemstack) {
|
|
- return this.c.getCraftingManager().craft((Recipes<RecipeCooking>) this.f, new InventorySubcontainer(new ItemStack[]{itemstack}), this.c).isPresent(); // Eclipse fail
|
|
+ return this.c.getCraftingManager().craft((Recipes<RecipeCooking>) 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<Enchantment, Integer> 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<Enchantment, Integer> 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<Enchantment, Integer> map = (Map) result;
|
|
+ Map<Enchantment, Integer> 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<InventoryCrafting> {
|
|
// 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<InventoryCrafting> {
|
|
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<InventoryCrafting> {
|
|
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<InventoryCrafting> {
|
|
@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<InventoryCrafting> {
|
|
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<InventoryCrafting> {
|
|
// 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<InventoryCrafting> {
|
|
Optional<RecipeCrafting> 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<InventoryCrafting> {
|
|
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<InventoryCrafting> {
|
|
@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<T extends Container> {
|
|
private final Containers.Supplier<T> y;
|
|
|
|
private static <T extends Container> Containers<T> a(String s, Containers.Supplier<T> 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<T> 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<? extends Dynamic<?>> 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<NBTBase> 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<File, DataFixer, WorldDataServer> b(DynamicOps<NBTBase> 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<File, DataFixer, WorldInfo> 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<NBTBase> 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<MinecraftKey, JsonElement> 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 <C extends IInventory, T extends IRecipe<C>> List<T> b(Recipes<T> 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<MinecraftKey> 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<String> list = (List) SystemUtils.j().collect(Collectors.toList());
|
|
+ List<String> 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<CustomFunction> 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<String, String> a = (Map) DataFixUtils.make(Maps.newHashMap(), (hashmap) -> {
|
|
+ private static final Map<String, String> 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<String> 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<String> 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<Pair<String, String>> 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<DataWatcher.Item<?>> 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<DedicatedServerPr
|
|
public DedicatedServerProperties(Properties properties, OptionSet optionset) {
|
|
super(properties, optionset);
|
|
// CraftBukkit end
|
|
- this.difficulty = (EnumDifficulty) this.a("difficulty", a(EnumDifficulty::getById, EnumDifficulty::a), EnumDifficulty::c, EnumDifficulty.EASY);
|
|
- this.gamemode = (EnumGamemode) this.a("gamemode", a(EnumGamemode::getById, EnumGamemode::a), EnumGamemode::b, EnumGamemode.SURVIVAL);
|
|
+ this.difficulty = this.a("difficulty", a(EnumDifficulty::getById, EnumDifficulty::a), EnumDifficulty::c, EnumDifficulty.EASY);
|
|
+ this.gamemode = this.a("gamemode", a(EnumGamemode::getById, EnumGamemode::a), EnumGamemode::b, EnumGamemode.SURVIVAL);
|
|
this.levelName = this.getString("level-name", "world");
|
|
this.serverPort = this.getInt("server-port", 25565);
|
|
this.maxBuildHeight = this.a("max-build-height", (integer) -> {
|
|
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<DedicatedServerProperties> 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<DefinedStructure.BlockInfo> list = Lists.newArrayList();
|
|
List<DefinedStructure.BlockInfo> list1 = Lists.newArrayList();
|
|
List<DefinedStructure.BlockInfo> 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<DefinedStructure.BlockInfo> list3 = a((List) list, (List) list1, (List) list2);
|
|
+ List<DefinedStructure.BlockInfo> 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<BlockPosition, NBTTagCompound> 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<BlockPosition, NBTTagCompound> 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<DefinedStructure.BlockInfo> list1 = ((DefinedStructure.a) this.a.get(0)).a();
|
|
+ List<DefinedStructure.BlockInfo> 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<DefinedStructure.BlockInfo> list3 = a((List) list, (List) list1, (List) list2);
|
|
+ List<DefinedStructure.BlockInfo> list3 = a(list, list1, list2);
|
|
|
|
this.a.add(new DefinedStructure.a(list3));
|
|
}
|
|
@@ -804,14 +804,14 @@ public class DefinedStructure {
|
|
}
|
|
|
|
public List<DefinedStructure.BlockInfo> a(Block block) {
|
|
- return (List) this.b.computeIfAbsent(block, (block1) -> {
|
|
+ return this.b.computeIfAbsent(block, (block1) -> {
|
|
List<BlockInfo> 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 <S extends TileEntity> DoubleBlockFinder.Result<S> a(TileEntityTypes<S> tileentitytypes, Function<IBlockData, DoubleBlockFinder.BlockType> function, Function<IBlockData, EnumDirection> function1, BlockStateDirection blockstatedirection, IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, BiPredicate<GeneratorAccess, BlockPosition> 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<Enchantment, Integer> 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<EnumItemSlot, ItemStack> 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<AxisAlignedBB> 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<Entity, Integer> 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<Entity> 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<EntityBat> 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<IBlockData> 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<BlockPosition> 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<Entity> 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<Boolean> bA = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
|
|
private static final DataWatcherObject<Boolean> bB = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
|
|
private static final DataWatcherObject<Integer> bC = DataWatcher.a(EntityCat.class, DataWatcherRegistry.b);
|
|
- public static final Map<Integer, MinecraftKey> bx = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
|
+ public static final Map<Integer, MinecraftKey> 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<EntityDolphin> 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<EntityItem> 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<EntityDrowned> 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<EntityPlayer>) ((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<EnumItemSlot, ItemStack> entry = EnchantmentManager.a(Enchantments.MENDING, (EntityLiving) entityhuman, ItemStack::f);
|
|
+ Entry<EnumItemSlot, ItemStack> 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<Entity> 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<ItemStack> 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<EntityItem> 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<String, EntityFox.Type> 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<? extends SensorType<? extends Sensor<? super EntityHoglin>>> bv = ImmutableList.of(SensorType.c, SensorType.d, SensorType.n, SensorType.m);
|
|
// CraftBukkit - decompile error
|
|
- protected static final ImmutableList<? extends MemoryModuleType<?>> bw = ImmutableList.<MemoryModuleType<?>>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<? extends MemoryModuleType<?>> bw = ImmutableList.<MemoryModuleType<?>>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<? extends EntityHoglin> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
@@ -69,7 +69,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin {
|
|
|
|
@Override
|
|
protected BehaviorController.b<EntityHoglin> 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<EntityPose, EntitySize> b = ImmutableMap.<EntityPose, EntitySize>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<EntityPose, EntitySize> b = ImmutableMap.<EntityPose, EntitySize>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<Float> c = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c);
|
|
private static final DataWatcherObject<Integer> d = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.b);
|
|
protected static final DataWatcherObject<Byte> bp = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); public static DataWatcherObject<Byte> 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<Entity> 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<EntityLiving> 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<Vec3D> optional = BlockRespawnAnchor.a(EntityTypes.PLAYER, (IWorldReader) worldserver, blockposition);
|
|
+ if (block instanceof BlockRespawnAnchor && iblockdata.get(BlockRespawnAnchor.a) > 0 && BlockRespawnAnchor.a(worldserver)) {
|
|
+ Optional<Vec3D> 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<ItemStack> 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<ItemStack> 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<? extends EntityInsentient> 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<EntityIronGolem.CrackLevel> e = (List) Stream.of(values()).sorted(Comparator.comparingDouble((entityirongolem_cracklevel) -> {
|
|
- return (double) entityirongolem_cracklevel.f;
|
|
+ private static final List<EntityIronGolem.CrackLevel> 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<EntityPlayer>) (List) this.world.getPlayers()) {
|
|
+ int viewDistance = this.world.getServer().getViewDistance() * 16;
|
|
+ for (EntityPlayer player : (List<EntityPlayer>) 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<NBTBase> 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<EnumItemSlot, ItemStack> 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<BlockPosition> 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<MobEffect, Float> 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<Vec3D> 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<Boolean> g = DataWatcher.a(EntityMinecartAbstract.class, DataWatcherRegistry.i);
|
|
private static final ImmutableMap<EntityPose, ImmutableList<Integer>> 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<BlockPropertyTrackPosition, Pair<BaseBlockPosition, BaseBlockPosition>> ap = (Map) SystemUtils.a(Maps.newEnumMap(BlockPropertyTrackPosition.class), (enummap) -> { // CraftBukkit - decompile error
|
|
+ private static final Map<BlockPropertyTrackPosition, Pair<BaseBlockPosition, BaseBlockPosition>> 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<BaseBlockPosition, BaseBlockPosition> 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<BaseBlockPosition, BaseBlockPosition> 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<BaseBlockPosition, BaseBlockPosition> 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<EntityItem> 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<ItemStack> 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<MobEffectList, Integer> pair = (Pair) optional.get();
|
|
+ Pair<MobEffectList, Integer> 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<Paintings> 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<EntityItem> 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<Item> bE = Sets.newHashSet(new Item[]{Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS});
|
|
- private static final Map<EntityTypes<?>, SoundEffect> bF = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
|
+ private static final Set<Item> bE = Sets.newHashSet(Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS);
|
|
+ private static final Map<EntityTypes<?>, 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<EntityInsentient> 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<EntityParrot> 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<EntityTypes<?>> 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<EntityHuman> list = EntityPhantom.this.world.a(this.b, (EntityLiving) EntityPhantom.this, EntityPhantom.this.getBoundingBox().grow(16.0D, 64.0D, 16.0D));
|
|
+ List<EntityHuman> 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<SensorType<? extends Sensor<? super EntityPiglin>>> b = ImmutableList.of(SensorType.c, SensorType.d, SensorType.b, SensorType.g, SensorType.e, SensorType.l);
|
|
- protected static final ImmutableList<MemoryModuleType<?>> 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<MemoryModuleType<?>> 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<? extends EntityMonster> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
@@ -150,7 +150,7 @@ public class EntityPiglin extends EntityMonster implements ICrossbow {
|
|
|
|
@Override
|
|
protected BehaviorController.b<EntityPiglin> 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<Entity> 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<Enchantment, Integer> 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 bfcc647d9269f04ccf628e746cb521d7d3cd5a7d..64e998d2ea864afe015551588d78889c3b89e0e6 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
@@ -154,7 +154,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;
|
|
@@ -164,7 +164,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);
|
|
@@ -192,7 +192,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;
|
|
@@ -202,7 +202,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);
|
|
@@ -359,7 +359,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
|
|
@@ -498,7 +498,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);
|
|
@@ -564,7 +564,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
|
|
@@ -677,11 +677,11 @@ 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)});
|
|
+ ChatMessage chatmessage = new ChatMessage("death.attack.message_too_long", (new ChatComponentText(s)).a(EnumChatFormat.YELLOW));
|
|
IChatMutableComponent ichatmutablecomponent = (new ChatMessage("death.attack.even_more_magic", new Object[]{this.getScoreboardDisplayName()})).format((chatmodifier) -> {
|
|
return chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatmessage));
|
|
});
|
|
@@ -694,7 +694,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);
|
|
}
|
|
@@ -897,9 +897,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 {
|
|
@@ -1102,9 +1102,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<EntityMonster> 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()) {
|
|
@@ -1122,7 +1122,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|
|
|
@Override
|
|
public Either<EntityHuman.EnumBedResult, Unit> 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<EntityHuman.EnumBedResult, Unit> bedResult = this.getBedResult(blockposition, enumdirection);
|
|
|
|
if (bedResult.left().orElse(null) == EntityHuman.EnumBedResult.OTHER_PROBLEM) {
|
|
@@ -1165,7 +1165,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;
|
|
}
|
|
@@ -1289,7 +1289,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();
|
|
@@ -1337,7 +1337,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();
|
|
}
|
|
|
|
@@ -1404,7 +1404,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|
}
|
|
|
|
public void o() {
|
|
- this.activeContainer.b((EntityHuman) this);
|
|
+ this.activeContainer.b(this);
|
|
this.activeContainer = this.defaultContainer;
|
|
}
|
|
|
|
@@ -1551,7 +1551,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;
|
|
@@ -1678,7 +1678,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);
|
|
@@ -1723,8 +1723,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() {
|
|
@@ -1754,15 +1754,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
|
|
@@ -1777,7 +1777,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<EntityItem> 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<EntityItem> 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<Entity> 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<Entity> 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<Byte> bv = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a);
|
|
- private static final Map<EnumColor, IMaterial> bw = (Map) SystemUtils.a(Maps.newEnumMap(EnumColor.class), (enummap) -> { // CraftBukkit - decompile error
|
|
+ private static final Map<EnumColor, IMaterial> 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<BlockPosition> optional = (Optional) this.datawatcher.get(EntityShulker.c);
|
|
+ Optional<BlockPosition> optional = this.datawatcher.get(EntityShulker.c);
|
|
Optional<BlockPosition> 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<EnumDirection> 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<BlockPosition> 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<EntityTurtle> 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<T extends Entity> {
|
|
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<T extends Entity> {
|
|
|
|
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<T extends Entity> {
|
|
axisalignedbb1 = axisalignedbb1.b(0.0D, -1.0D, 0.0D);
|
|
}
|
|
|
|
- Stream<VoxelShape> stream = iworldreader.d((Entity) null, axisalignedbb1, (entity) -> {
|
|
+ Stream<VoxelShape> stream = iworldreader.d(null, axisalignedbb1, (entity) -> {
|
|
return true;
|
|
});
|
|
|
|
@@ -330,7 +330,7 @@ public class EntityTypes<T extends Entity> {
|
|
}
|
|
|
|
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<T extends Entity> {
|
|
|
|
@Nullable
|
|
public static Entity a(NBTTagCompound nbttagcompound, World world, Function<Entity, Entity> 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<VillagerData> by = DataWatcher.a(EntityVillager.class, DataWatcherRegistry.q);
|
|
public static final Map<Item, Integer> bw = ImmutableMap.of(Items.BREAD, 4, Items.POTATO, 1, Items.CARROT, 1, Items.BEETROOT, 1);
|
|
- private static final Set<Item> 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<Item> 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<MemoryModuleType<?>> 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<MemoryModuleType<?>> 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<SensorType<? extends Sensor<? super EntityVillager>>> 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<MemoryModuleType<GlobalPos>, BiPredicate<EntityVillager, VillagePlaceType>> 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<EntityVillager> 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<NBTBase> 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<VillagerData> 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<VillagePlaceType> optional = villageplace.c(globalpos.getBlockPosition());
|
|
- BiPredicate<EntityVillager, VillagePlaceType> bipredicate = (BiPredicate) EntityVillager.bx.get(memorymoduletype);
|
|
+ BiPredicate<EntityVillager, VillagePlaceType> 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<VillagerTrades.IMerchantRecipeOption[]> int2objectmap = (Int2ObjectMap) VillagerTrades.a.get(villagerdata.getProfession());
|
|
+ Int2ObjectMap<VillagerTrades.IMerchantRecipeOption[]> 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<EntityVillager> list1 = (List) result;
|
|
+ List<EntityVillager> 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<Long> 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<Enchantment, Integer> 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<EntityPlayer>)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<EntityLiving> 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<? extends EntityZombie> 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<EntityChicken> 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<? extends EntityZombieVillager> 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<NBTBase> 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<VillagerData> 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<String, EnumDirection> o = (Map) Arrays.stream(EnumDirection.n).collect(Collectors.toMap(EnumDirection::m, (enumdirection) -> {
|
|
+ private static final Map<String, EnumDirection> 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<EnumDirection> r = (Long2ObjectMap) Arrays.stream(EnumDirection.n).collect(Collectors.toMap((enumdirection) -> {
|
|
+ private static final Long2ObjectMap<EnumDirection> 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<EnumDirection.EnumAxis> d = INamable.a(EnumDirection.EnumAxis::values, EnumDirection.EnumAxis::a);
|
|
- private static final Map<String, EnumDirection.EnumAxis> f = (Map) Arrays.stream(EnumDirection.EnumAxis.e).collect(Collectors.toMap(EnumDirection.EnumAxis::b, (enumdirection_enumaxis) -> {
|
|
+ private static final Map<String, EnumDirection.EnumAxis> 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<? extends Packet<T>> supplier = (Supplier) this.b.get(i);
|
|
+ Supplier<? extends Packet<T>> supplier = this.b.get(i);
|
|
|
|
- return supplier != null ? (Packet) supplier.get() : null;
|
|
+ return supplier != null ? supplier.get() : null;
|
|
}
|
|
|
|
public Iterable<Class<? extends Packet<?>>> 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<Float> 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<Entity> 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>) entity -> IEntitySelector.canAITarget().test(entity) && !entity.dead && !(entity instanceof EntityItem)); // Paper - Fix lag from explosions processing dead entities
|
|
+ List<Entity> list = this.world.getEntities(this.source, new AxisAlignedBB(i, l, j1, j, i1, k1), (com.google.common.base.Predicate<Entity>) 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<org.bukkit.block.Block> 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<ItemStack, BlockPosition> 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<ItemStack, BlockPosition> pair = (Pair) objectarraylist.get(j);
|
|
- ItemStack itemstack1 = (ItemStack) pair.getFirst();
|
|
+ Pair<ItemStack, BlockPosition> 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<FluidType, Fluid> {
|
|
|
|
- public static final Codec<Fluid> a = a((Codec) IRegistry.FLUID, FluidType::h).stable();
|
|
+ public static final Codec<Fluid> a = a(IRegistry.FLUID, FluidType::h).stable();
|
|
|
|
// Tuinity start
|
|
protected final boolean isEmpty;
|
|
@@ -19,7 +19,7 @@ public final class Fluid extends IBlockDataHolder<FluidType, Fluid> {
|
|
}
|
|
|
|
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<EnumDirection, Fluid> map = this.b((IWorldReader) generatoraccess, blockposition, iblockdata);
|
|
+ Map<EnumDirection, Fluid> map = this.b(generatoraccess, blockposition, iblockdata);
|
|
Iterator iterator = map.entrySet().iterator();
|
|
|
|
while (iterator.hasNext()) {
|
|
Entry<EnumDirection, Fluid> 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<FluidType, Fluid> 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<GameProfile> {
|
|
|
|
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<GameProfile> {
|
|
@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<IBlockState<?>, 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 <T extends GameRules.GameRuleValue<T>> GameRules.GameRuleKey<T> a(String s, GameRules.GameRuleCategory gamerules_gamerulecategory, GameRules.GameRuleDefinition<T> gamerules_gameruledefinition) {
|
|
GameRules.GameRuleKey<T> 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.GameRuleBoolean> gamerules_gamerulekey) {
|
|
- return ((GameRules.GameRuleBoolean) this.get(gamerules_gamerulekey)).a();
|
|
+ return this.get(gamerules_gamerulekey).a();
|
|
}
|
|
|
|
public int getInt(GameRules.GameRuleKey<GameRules.GameRuleInt> gamerules_gamerulekey) {
|
|
- return ((GameRules.GameRuleInt) this.get(gamerules_gamerulekey)).a();
|
|
+ return this.get(gamerules_gamerulekey).a();
|
|
}
|
|
|
|
public static class GameRuleBoolean extends GameRules.GameRuleValue<GameRules.GameRuleBoolean> {
|
|
@@ -295,7 +295,7 @@ public class GameRules {
|
|
|
|
public void b(CommandContext<CommandListenerWrapper> 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<IBlockData> j;
|
|
- private static final Map<String, HeightMap.Type> k = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // Tuinity - decompile fix
|
|
- HeightMap.Type[] aheightmap_type = values();
|
|
+ private static final Map<String, HeightMap.Type> 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<IBlockData> 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<IBlockData> b = a((Codec) IRegistry.BLOCK, Block::getBlockData).stable();
|
|
+ public static final Codec<IBlockData> 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<IChatBaseComponent> {
|
|
|
|
default Stream<IChatBaseComponent> 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<IC
|
|
int j = i - stringbuilder.length();
|
|
|
|
if (j <= 0) {
|
|
- return IChatBaseComponent.b;
|
|
+ return IChatFormatted.b;
|
|
} else {
|
|
stringbuilder.append(s.length() <= j ? s : s.substring(0, j));
|
|
return Optional.empty();
|
|
@@ -90,16 +90,16 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
|
|
|
|
public static class ChatSerializer implements JsonDeserializer<IChatMutableComponent>, JsonSerializer<IChatBaseComponent> {
|
|
|
|
- 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<IC
|
|
throw new IllegalStateException("Couldn't get field 'pos' for JsonReader", nosuchfieldexception);
|
|
}
|
|
});
|
|
- private static final Field c = (Field) SystemUtils.a(() -> {
|
|
+ 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<IC
|
|
}
|
|
}
|
|
|
|
- ((IChatMutableComponent) object).setChatModifier((ChatModifier) jsondeserializationcontext.deserialize(jsonelement, ChatModifier.class));
|
|
+ ((IChatMutableComponent) object).setChatModifier(jsondeserializationcontext.deserialize(jsonelement, ChatModifier.class));
|
|
return (IChatMutableComponent) object;
|
|
}
|
|
}
|
|
@@ -239,7 +239,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
|
|
while (iterator.hasNext()) {
|
|
Entry<String, JsonElement> 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<IC
|
|
@Nullable public static IChatBaseComponent jsonToComponent(String json) { return a(json);} // Paper - OBFHELPER
|
|
@Nullable
|
|
public static IChatMutableComponent a(String s) {
|
|
- return (IChatMutableComponent) ChatDeserializer.a(IChatBaseComponent.ChatSerializer.a, s, IChatMutableComponent.class, false);
|
|
+ return ChatDeserializer.a(ChatSerializer.a, s, IChatMutableComponent.class, false);
|
|
}
|
|
|
|
@Nullable
|
|
public static IChatMutableComponent a(JsonElement jsonelement) {
|
|
- return (IChatMutableComponent) IChatBaseComponent.ChatSerializer.a.fromJson(jsonelement, IChatMutableComponent.class);
|
|
+ return ChatSerializer.a.fromJson(jsonelement, IChatMutableComponent.class);
|
|
}
|
|
|
|
@Nullable
|
|
public static IChatMutableComponent b(String s) {
|
|
- return (IChatMutableComponent) ChatDeserializer.a(IChatBaseComponent.ChatSerializer.a, s, IChatMutableComponent.class, true);
|
|
+ return ChatDeserializer.a(ChatSerializer.a, s, IChatMutableComponent.class, true);
|
|
}
|
|
|
|
public static IChatMutableComponent a(com.mojang.brigadier.StringReader com_mojang_brigadier_stringreader) {
|
|
@@ -364,7 +364,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
|
|
JsonReader jsonreader = new JsonReader(new StringReader(com_mojang_brigadier_stringreader.getRemaining()));
|
|
|
|
jsonreader.setLenient(false);
|
|
- IChatMutableComponent ichatmutablecomponent = (IChatMutableComponent) IChatBaseComponent.ChatSerializer.a.getAdapter(IChatMutableComponent.class).read(jsonreader);
|
|
+ IChatMutableComponent ichatmutablecomponent = ChatSerializer.a.getAdapter(IChatMutableComponent.class).read(jsonreader);
|
|
|
|
com_mojang_brigadier_stringreader.setCursor(com_mojang_brigadier_stringreader.getCursor() + a(jsonreader));
|
|
return ichatmutablecomponent;
|
|
diff --git a/src/main/java/net/minecraft/server/IChunkLoader.java b/src/main/java/net/minecraft/server/IChunkLoader.java
|
|
index 69d138f2bb4625ff96223c8d70217c3ffef6de5d..9b994bcfaddf8a1e8145b334da461bc24511bb28 100644
|
|
--- a/src/main/java/net/minecraft/server/IChunkLoader.java
|
|
+++ b/src/main/java/net/minecraft/server/IChunkLoader.java
|
|
@@ -76,7 +76,7 @@ public class IChunkLoader implements AutoCloseable {
|
|
if (nbttagcompound.getCompound("Level").getBoolean("hasLegacyStructureData")) {
|
|
synchronized (this.persistentDataLock) { // Paper - Async chunk loading
|
|
if (this.c == null) {
|
|
- this.c = PersistentStructureLegacy.a(resourcekey, (WorldPersistentData) supplier.get());
|
|
+ this.c = PersistentStructureLegacy.a(resourcekey, supplier.get());
|
|
}
|
|
|
|
nbttagcompound = this.c.a(nbttagcompound);
|
|
diff --git a/src/main/java/net/minecraft/server/ICollisionAccess.java b/src/main/java/net/minecraft/server/ICollisionAccess.java
|
|
index 37d5c492a1cfa137abfd3b801a7f1020e5289e00..8394345c3ecf50498accf66d24c85004caba2d7c 100644
|
|
--- a/src/main/java/net/minecraft/server/ICollisionAccess.java
|
|
+++ b/src/main/java/net/minecraft/server/ICollisionAccess.java
|
|
@@ -18,9 +18,9 @@ public interface ICollisionAccess extends IBlockAccess {
|
|
}
|
|
|
|
default boolean a(IBlockData iblockdata, BlockPosition blockposition, VoxelShapeCollision voxelshapecollision) {
|
|
- VoxelShape voxelshape = iblockdata.b((IBlockAccess) this, blockposition, voxelshapecollision);
|
|
+ VoxelShape voxelshape = iblockdata.b(this, blockposition, voxelshapecollision);
|
|
|
|
- return voxelshape.isEmpty() || this.a((Entity) null, voxelshape.a((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()));
|
|
+ return voxelshape.isEmpty() || this.a(null, voxelshape.a(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
|
}
|
|
|
|
default boolean i(Entity entity) {
|
|
@@ -28,7 +28,7 @@ public interface ICollisionAccess extends IBlockAccess {
|
|
}
|
|
|
|
default boolean b(AxisAlignedBB axisalignedbb) {
|
|
- return this.b((Entity) null, axisalignedbb, (entity) -> {
|
|
+ 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<EntityLiving> 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<EntityHorseAbstract> 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<EntityHorseChestedAbstract> 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<Void> 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<Void> 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<Entry<ChunkCoordIntPair, IOWorker.a>> iterator = this.e.entrySet().iterator();
|
|
|
|
if (iterator.hasNext()) {
|
|
- Entry<ChunkCoordIntPair, IOWorker.a> entry = (Entry) iterator.next();
|
|
+ Entry<ChunkCoordIntPair, IOWorker.a> 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<HumanEntity> 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<ItemStack> f() {
|
|
@@ -95,7 +95,7 @@ public class InventorySubcontainer implements IInventory, AutoRecipeOutput {
|
|
result.add(itemstack);
|
|
}
|
|
}
|
|
- List<ItemStack> list = (List) result;
|
|
+ List<ItemStack> 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<AttributeBase, AttributeModifier> 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<EntityLiving> 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<AttributeBase, AttributeModifier> 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 65558af58dfaf8c92e4d6f766f97e007154ae709..5cf0ff0b66e98459cf62b0fa49484127a6f6b2aa 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 <T extends Comparable<T>> IBlockData a(IBlockData iblockdata, IBlockState<T> 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<ItemStack> 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<ItemStack> e() {
|
|
- return ItemCrossbow.b;
|
|
+ return ItemProjectileWeapon.b;
|
|
}
|
|
|
|
@Override
|
|
public Predicate<ItemStack> 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 <T extends Comparable<T>> IBlockData a(IBlockData iblockdata, IBlockState<T> 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> T a(Iterable<T> 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<Entity> 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<Entity> 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<ItemStack> 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<GameProfile>() {
|
|
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<ItemStack>(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<ItemStack> 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<AttributeBase, AttributeModifier> 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<K, V extends JsonListEntry<K>> {
|
|
// 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<K, V extends JsonListEntry<K>> {
|
|
}
|
|
|
|
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<K, V extends JsonListEntry<K>> {
|
|
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<K, V extends JsonListEntry<K>> {
|
|
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<LightEngineStorageB
|
|
long j1 = BlockPosition.getAdjacent(x, y, z, enumdirection); // Paper
|
|
long k1 = SectionPosition.getAdjacentFromBlockPos(x, y, z, enumdirection); // Paper
|
|
|
|
- if (k == k1 || ((LightEngineStorageBlock) this.c).g(k1)) {
|
|
+ if (k == k1 || this.c.g(k1)) {
|
|
this.b(i, j1, j, flag);
|
|
}
|
|
}
|
|
@@ -129,7 +129,7 @@ public final class LightEngineBlock extends LightEngineLayer<LightEngineStorageB
|
|
if (j1 == j2) {
|
|
nibblearray1 = nibblearray;
|
|
} else {
|
|
- nibblearray1 = ((LightEngineStorageBlock) this.c).updating.getUpdatingOptimized(j2); // Paper
|
|
+ nibblearray1 = this.c.updating.getUpdatingOptimized(j2); // Paper
|
|
}
|
|
|
|
if (nibblearray1 != null) {
|
|
@@ -151,7 +151,7 @@ public final class LightEngineBlock extends LightEngineLayer<LightEngineStorageB
|
|
|
|
@Override
|
|
public void a(BlockPosition blockposition, int i) {
|
|
- ((LightEngineStorageBlock) this.c).d();
|
|
+ this.c.d();
|
|
this.a(Long.MAX_VALUE, blockposition.asLong(), 15 - i, true);
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/LightEngineLayer.java b/src/main/java/net/minecraft/server/LightEngineLayer.java
|
|
index 56c2ee99ab1d2ec28befaf3383e83a8f70fbdb20..248162db63e3c99e9fe4b33e88abe53c213612b8 100644
|
|
--- a/src/main/java/net/minecraft/server/LightEngineLayer.java
|
|
+++ b/src/main/java/net/minecraft/server/LightEngineLayer.java
|
|
@@ -84,7 +84,7 @@ public abstract class LightEngineLayer<M extends LightEngineStorageArray<M>, 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<LightEngineStorageSky
|
|
return 15;
|
|
} else {
|
|
if (i == Long.MAX_VALUE) {
|
|
- if (!((LightEngineStorageSky) this.c).m(j)) {
|
|
+ if (!this.c.m(j)) {
|
|
return 15;
|
|
}
|
|
|
|
@@ -111,7 +111,7 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
|
|
} else {
|
|
int l1;
|
|
|
|
- for (l1 = 0; !((LightEngineStorageSky) this.c).g(SectionPosition.a(k, 0, -l1 - 1, 0)) && ((LightEngineStorageSky) this.c).a(j1 - l1 - 1); ++l1) {
|
|
+ for (l1 = 0; !this.c.g(SectionPosition.a(k, 0, -l1 - 1, 0)) && this.c.a(j1 - l1 - 1); ++l1) {
|
|
;
|
|
}
|
|
|
|
@@ -122,14 +122,14 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
|
|
long i2 = BlockPosition.asLong(baseX, newBaseY, baseZ); // Paper
|
|
long j2 = SectionPosition.blockPosAsSectionLong(baseX, newBaseY, baseZ); // Paper
|
|
|
|
- if (k == j2 || ((LightEngineStorageSky) this.c).g(j2)) {
|
|
+ if (k == j2 || this.c.g(j2)) {
|
|
this.b(i, i2, j, flag);
|
|
}
|
|
|
|
long k2 = BlockPosition.asLong(baseX, baseY + 1, baseZ); // Paper
|
|
long l2 = SectionPosition.blockPosAsSectionLong(baseX, baseY + 1, baseZ); // Paper
|
|
|
|
- if (k == l2 || ((LightEngineStorageSky) this.c).g(l2)) {
|
|
+ if (k == l2 || this.c.g(l2)) {
|
|
this.b(i, k2, j, flag);
|
|
}
|
|
|
|
@@ -148,7 +148,7 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
|
|
if (k == i4) {
|
|
this.b(i, l3, j, flag);
|
|
} else {
|
|
- if (((LightEngineStorageSky) this.c).g(i4)) {
|
|
+ if (this.c.g(i4)) {
|
|
this.b(i, l3, j, flag);
|
|
}
|
|
|
|
@@ -205,7 +205,7 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
|
|
if (j1 == j2) {
|
|
nibblearray1 = nibblearray;
|
|
} else {
|
|
- nibblearray1 = ((LightEngineStorageSky) this.c).updating.getUpdatingOptimized(j2); // Paper
|
|
+ nibblearray1 = this.c.updating.getUpdatingOptimized(j2); // Paper
|
|
}
|
|
|
|
if (nibblearray1 != null) {
|
|
@@ -221,7 +221,7 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
|
|
}
|
|
}
|
|
} else if (enumdirection != EnumDirection.DOWN) {
|
|
- for (i2 = BlockPosition.f(i2); !((LightEngineStorageSky) this.c).g(j2) && !((LightEngineStorageSky) this.c).n(j2); i2 = BlockPosition.a(i2, 0, 16, 0)) {
|
|
+ for (i2 = BlockPosition.f(i2); !this.c.g(j2) && !this.c.n(j2); i2 = BlockPosition.a(i2, 0, 16, 0)) {
|
|
j2 = SectionPosition.a(j2, EnumDirection.UP);
|
|
}
|
|
|
|
@@ -233,7 +233,7 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
|
|
if (nibblearray2 != null) {
|
|
l2 = this.b(i2, i, this.a(nibblearray2, i2));
|
|
} else {
|
|
- l2 = ((LightEngineStorageSky) this.c).o(j2) ? 0 : 15;
|
|
+ l2 = this.c.o(j2) ? 0 : 15;
|
|
}
|
|
|
|
if (l > l2) {
|
|
@@ -252,17 +252,17 @@ public final class LightEngineSky extends LightEngineLayer<LightEngineStorageSky
|
|
|
|
@Override
|
|
protected void f(long i) {
|
|
- ((LightEngineStorageSky) this.c).d();
|
|
+ this.c.d();
|
|
long j = SectionPosition.e(i);
|
|
|
|
- if (((LightEngineStorageSky) this.c).g(j)) {
|
|
+ if (this.c.g(j)) {
|
|
super.f(i);
|
|
} else {
|
|
- for (i = BlockPosition.f(i); !((LightEngineStorageSky) this.c).g(j) && !((LightEngineStorageSky) this.c).n(j); i = BlockPosition.a(i, 0, 16, 0)) {
|
|
+ for (i = BlockPosition.f(i); !this.c.g(j) && !this.c.n(j); i = BlockPosition.a(i, 0, 16, 0)) {
|
|
j = SectionPosition.a(j, EnumDirection.UP);
|
|
}
|
|
|
|
- if (((LightEngineStorageSky) this.c).g(j)) {
|
|
+ if (this.c.g(j)) {
|
|
super.f(i);
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/LightEngineStorage.java b/src/main/java/net/minecraft/server/LightEngineStorage.java
|
|
index e06de856b8d889c4235cb0a443d9df808cfe34d3..1e7fbdffe873b1f97cd0417a24659d6084c5c171 100644
|
|
--- a/src/main/java/net/minecraft/server/LightEngineStorage.java
|
|
+++ b/src/main/java/net/minecraft/server/LightEngineStorage.java
|
|
@@ -59,7 +59,7 @@ public abstract class LightEngineStorage<M extends LightEngineStorageArray<M>> 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<M extends LightEngineStorageArray<M>> 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<M extends LightEngineStorageArray<M>> 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<M extends LightEngineStorageArray<
|
|
@Nullable
|
|
public NibbleArray d(long i) {
|
|
if (this.isVisible) { throw new IllegalStateException("writing to visible data"); } // Paper - avoid copying light data
|
|
- return (NibbleArray) this.data.queueRemove(i); // Paper - avoid copying light data
|
|
+ return this.data.queueRemove(i); // Paper - avoid copying light data
|
|
}
|
|
|
|
public void a(long i, NibbleArray nibblearray) {
|
|
diff --git a/src/main/java/net/minecraft/server/LightEngineStorageSky.java b/src/main/java/net/minecraft/server/LightEngineStorageSky.java
|
|
index d29e1edffd6c27b351eebb385ceac23db6101713..e033ae8bc7691149d8eb28cd5bc5e1fc55b4d299 100644
|
|
--- a/src/main/java/net/minecraft/server/LightEngineStorageSky.java
|
|
+++ b/src/main/java/net/minecraft/server/LightEngineStorageSky.java
|
|
@@ -29,7 +29,7 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
// Paper end
|
|
int k = SectionPosition.c(j);
|
|
synchronized (this.visibleUpdateLock) { // Paper - avoid copying light data
|
|
- LightEngineStorageSky.a lightenginestoragesky_a = (LightEngineStorageSky.a) this.e_visible; // Paper - avoid copying light data - must be after lock acquire
|
|
+ LightEngineStorageSky.a lightenginestoragesky_a = this.e_visible; // Paper - avoid copying light data - must be after lock acquire
|
|
int l = lightenginestoragesky_a.otherData.getVisibleAsync(SectionPosition.f(j)); // Paper - avoid copying light data
|
|
|
|
if (l != lightenginestoragesky_a.b && k < l) {
|
|
@@ -47,7 +47,7 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
}
|
|
}
|
|
|
|
- return nibblearray.a(baseX & 15, (int) ((i << 52) >> 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<LightEngineStorage
|
|
protected void k(long i) {
|
|
int j = SectionPosition.c(i);
|
|
|
|
- if (((LightEngineStorageSky.a) this.f).b > 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<LightEngineStorage
|
|
|
|
int k = SectionPosition.c(i);
|
|
|
|
- if (((LightEngineStorageSky.a) this.f).otherData.getUpdating(j) == k + 1) { // Paper - avoid copying light data
|
|
+ if (this.f.otherData.getUpdating(j) == k + 1) { // Paper - avoid copying light data
|
|
long l;
|
|
|
|
for (l = i; !this.g(l) && this.a(k); l = SectionPosition.a(l, EnumDirection.DOWN)) {
|
|
@@ -115,12 +115,12 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
}
|
|
|
|
if (this.g(l)) {
|
|
- ((LightEngineStorageSky.a) this.f).otherData.queueUpdate(j, k + 1); // Paper - avoid copying light data
|
|
+ this.f.otherData.queueUpdate(j, k + 1); // Paper - avoid copying light data
|
|
if (flag) {
|
|
this.q(l);
|
|
}
|
|
} else {
|
|
- ((LightEngineStorageSky.a) this.f).otherData.queueRemove(j); // Paper - avoid copying light data
|
|
+ this.f.otherData.queueRemove(j); // Paper - avoid copying light data
|
|
}
|
|
}
|
|
|
|
@@ -134,9 +134,9 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
protected void b(long i, boolean flag) {
|
|
this.d();
|
|
if (flag && this.o.add(i)) {
|
|
- int j = ((LightEngineStorageSky.a) this.f).otherData.getUpdating(i); // Paper - avoid copying light data
|
|
+ int j = this.f.otherData.getUpdating(i); // Paper - avoid copying light data
|
|
|
|
- if (j != ((LightEngineStorageSky.a) this.f).b) {
|
|
+ if (j != this.f.b) {
|
|
long k = SectionPosition.b(SectionPosition.b(i), j - 1, SectionPosition.d(i));
|
|
|
|
this.q(k);
|
|
@@ -155,15 +155,15 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
|
|
@Override
|
|
protected NibbleArray j(long i) {
|
|
- NibbleArray nibblearray = (NibbleArray) this.i.get(i);
|
|
+ NibbleArray nibblearray = this.i.get(i);
|
|
|
|
if (nibblearray != null) {
|
|
return nibblearray;
|
|
} else {
|
|
long j = SectionPosition.a(i, EnumDirection.UP);
|
|
- int k = ((LightEngineStorageSky.a) this.f).otherData.getUpdating(SectionPosition.f(i)); // Paper - avoid copying light data
|
|
+ int k = this.f.otherData.getUpdating(SectionPosition.f(i)); // Paper - avoid copying light data
|
|
|
|
- if (k != ((LightEngineStorageSky.a) this.f).b && SectionPosition.c(j) < k) {
|
|
+ if (k != this.f.b && SectionPosition.c(j) < k) {
|
|
NibbleArray nibblearray1;
|
|
|
|
while ((nibblearray1 = this.updating.getUpdatingOptimized(j)) == null) { // Paper
|
|
@@ -201,7 +201,7 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
if (j == 1) {
|
|
this.a(lightenginelayer, i);
|
|
if (this.g.add(i)) {
|
|
- ((LightEngineStorageSky.a) this.f).a(i);
|
|
+ this.f.a(i);
|
|
}
|
|
|
|
Arrays.fill(this.updating.getUpdatingOptimized(i).asBytesPoolSafe(), (byte) -1); // Paper - use optimized
|
|
@@ -295,7 +295,7 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
}
|
|
|
|
protected boolean a(int i) {
|
|
- return i >= ((LightEngineStorageSky.a) this.f).b;
|
|
+ return i >= this.f.b;
|
|
}
|
|
|
|
protected boolean m(long i) {
|
|
@@ -310,7 +310,7 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
if (!this.o.contains(l)) {
|
|
return false;
|
|
} else {
|
|
- int i1 = ((LightEngineStorageSky.a) this.f).otherData.getUpdating(l); // Paper - avoid copying light data
|
|
+ int i1 = this.f.otherData.getUpdating(l); // Paper - avoid copying light data
|
|
|
|
return SectionPosition.c(i1) == j + 16;
|
|
}
|
|
@@ -319,9 +319,9 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
|
|
|
|
protected boolean n(long i) {
|
|
long j = SectionPosition.f(i);
|
|
- int k = ((LightEngineStorageSky.a) this.f).otherData.getUpdating(j); // Paper - avoid copying light data
|
|
+ int k = this.f.otherData.getUpdating(j); // Paper - avoid copying light data
|
|
|
|
- return k == ((LightEngineStorageSky.a) this.f).b || SectionPosition.c(i) >= 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<String, String> 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<String, JsonElement> 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<MinecraftKey, JsonElement> map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) {
|
|
Builder<MinecraftKey, LootTable> 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<ResourcePackLoader> resourcepackrepository = new ResourcePackRepository<>(ResourcePackLoader::new, new ResourcePackSource[]{new ResourcePackSourceVanilla(), new ResourcePackSourceFolder(convertable_conversionsession.getWorldFolder(SavedFile.DATAPACKS).toFile(), PackSource.c)});
|
|
+ ResourcePackRepository<ResourcePackLoader> 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 efe4638481d3c78d251dbe0f3b07d98845776e8e..6a151e60b7f203b629c55c80ac998a80fef2f67d 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<TickTas
|
|
public static <S extends MinecraftServer> S a(Function<Thread, S> function) {
|
|
AtomicReference<S> 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<TickTas
|
|
// CraftBukkit end
|
|
|
|
private void initializeScoreboards(WorldPersistentData worldpersistentdata) {
|
|
- PersistentScoreboard persistentscoreboard = (PersistentScoreboard) worldpersistentdata.a(PersistentScoreboard::new, "scoreboard");
|
|
+ PersistentScoreboard persistentscoreboard = worldpersistentdata.a(PersistentScoreboard::new, "scoreboard");
|
|
|
|
- persistentscoreboard.a((Scoreboard) this.getScoreboard());
|
|
- this.getScoreboard().a((Runnable) (new RunnableSaveScoreboard(persistentscoreboard)));
|
|
+ persistentscoreboard.a(this.getScoreboard());
|
|
+ this.getScoreboard().a(new RunnableSaveScoreboard(persistentscoreboard));
|
|
}
|
|
|
|
protected abstract boolean init() throws IOException;
|
|
@@ -346,8 +346,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
|
|
IRegistryCustom.Dimension iregistrycustom_dimension = IRegistryCustom.b();
|
|
|
|
- RegistryReadOps<NBTBase> registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, this.dataPackResources.h(), (IRegistryCustom) iregistrycustom_dimension);
|
|
- worlddata = (WorldDataServer) worldSession.a((DynamicOps) registryreadops, datapackconfiguration);
|
|
+ RegistryReadOps<NBTBase> 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<TickTas
|
|
net.minecraft.server.Main.convertWorld(worldSession, DataConverterRegistry.a(), 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()));
|
|
}
|
|
|
|
@@ -380,7 +380,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
long j = BiomeManager.a(i);
|
|
List<MobSpawner> list = ImmutableList.of(new MobSpawnerPhantom(), new MobSpawnerPatrol(), new MobSpawnerCat(), new VillageSiege(), new MobSpawnerTrader(iworlddataserver));
|
|
RegistryMaterials<WorldDimension> 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<TickTas
|
|
chunkgenerator = worlddimension.c();
|
|
}
|
|
|
|
- ResourceKey<DimensionManager> typeKey = (ResourceKey) this.f.a().c(dimensionmanager).orElseThrow(() -> {
|
|
+ ResourceKey<DimensionManager> typeKey = this.f.a().c(dimensionmanager).orElseThrow(() -> {
|
|
return new IllegalStateException("Unregistered dimension type: " + dimensionmanager);
|
|
});
|
|
ResourceKey<World> worldKey = ResourceKey.a(IRegistry.ae, dimensionKey.a());
|
|
@@ -631,7 +631,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
|
|
if (true) {
|
|
WorldServer worldserver1 = worldserver;
|
|
- ForcedChunk forcedchunk = (ForcedChunk) worldserver.getWorldPersistentData().b(ForcedChunk::new, "chunks");
|
|
+ ForcedChunk forcedchunk = worldserver.getWorldPersistentData().b(ForcedChunk::new, "chunks");
|
|
// CraftBukkit end
|
|
|
|
if (forcedchunk != null) {
|
|
@@ -698,7 +698,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.getDimensionKey().a());
|
|
}
|
|
|
|
- worldserver.save((IProgressUpdate) null, flag1, worldserver.savingDisabled && !flag2);
|
|
+ worldserver.save(null, flag1, worldserver.savingDisabled && !flag2);
|
|
}
|
|
|
|
// CraftBukkit start - moved to WorldServer.save
|
|
@@ -1136,7 +1136,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
}
|
|
|
|
double overuseCount = (double)overuse/(double)MAX_CHUNK_EXEC_TIME;
|
|
- long extraSleep = (long)Math.round(overuseCount*CHUNK_TASK_QUEUE_BACKOFF_MIN_TIME);
|
|
+ long extraSleep = Math.round(overuseCount*CHUNK_TASK_QUEUE_BACKOFF_MIN_TIME);
|
|
|
|
lastMidTickExecute = currTime + extraSleep;
|
|
return;
|
|
@@ -1225,8 +1225,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
try {
|
|
BufferedImage bufferedimage = ImageIO.read(file);
|
|
|
|
- Validate.validState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]);
|
|
- Validate.validState(bufferedimage.getHeight() == 64, "Must be 64 pixels high", new Object[0]);
|
|
+ Validate.validState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide");
|
|
+ Validate.validState(bufferedimage.getHeight() == 64, "Must be 64 pixels high");
|
|
ImageIO.write(bufferedimage, "PNG", new ByteBufOutputStream(bytebuf));
|
|
ByteBuffer bytebuffer = Base64.getEncoder().encode(bytebuf.nioBuffer());
|
|
|
|
@@ -1272,7 +1272,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
int j = MathHelper.nextInt(this.r, 0, this.getPlayerCount() - agameprofile.length);
|
|
|
|
for (int k = 0; k < agameprofile.length; ++k) {
|
|
- agameprofile[k] = ((EntityPlayer) this.playerList.getPlayers().get(j + k)).getProfile();
|
|
+ agameprofile[k] = this.playerList.getPlayers().get(j + k).getProfile();
|
|
}
|
|
|
|
Collections.shuffle(Arrays.asList(agameprofile));
|
|
@@ -1456,7 +1456,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
|
|
MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper
|
|
for (int i = 0; i < this.tickables.size(); ++i) {
|
|
- ((Runnable) this.tickables.get(i)).run();
|
|
+ this.tickables.get(i).run();
|
|
}
|
|
MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper
|
|
|
|
@@ -1480,12 +1480,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
}
|
|
|
|
public final WorldServer D() {
|
|
- return (WorldServer) this.worldServer.get(World.OVERWORLD);
|
|
+ return this.worldServer.get(World.OVERWORLD);
|
|
}
|
|
|
|
@Nullable
|
|
public WorldServer getWorldServer(ResourceKey<World> resourcekey) {
|
|
- return (WorldServer) this.worldServer.get(resourcekey);
|
|
+ return this.worldServer.get(resourcekey);
|
|
}
|
|
|
|
public Set<ResourceKey<World>> E() {
|
|
@@ -1872,9 +1872,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
ResourcePackRepository resourcepackrepository = this.resourcePackRepository;
|
|
|
|
this.resourcePackRepository.getClass();
|
|
- return stream.<ResourcePackLoader>map(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<IResourcePack>) 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;
|
|
@@ -1899,7 +1899,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
public static DataPackConfiguration a(ResourcePackRepository<ResourcePackLoader> 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<String> set = Sets.newLinkedHashSet();
|
|
@@ -1932,7 +1932,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
set.add("vanilla");
|
|
}
|
|
|
|
- resourcepackrepository.a((Collection) set);
|
|
+ resourcepackrepository.a(set);
|
|
return a(resourcepackrepository);
|
|
}
|
|
}
|
|
@@ -1940,7 +1940,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
private static DataPackConfiguration a(ResourcePackRepository<?> resourcepackrepository) {
|
|
Collection<String> collection = resourcepackrepository.d();
|
|
List<String> list = ImmutableList.copyOf(collection);
|
|
- List<String> list1 = (List) resourcepackrepository.b().stream().filter((s) -> {
|
|
+ List<String> list1 = resourcepackrepository.b().stream().filter((s) -> {
|
|
return !collection.contains(s);
|
|
}).collect(ImmutableList.toImmutableList());
|
|
|
|
@@ -1976,7 +1976,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
public CommandListenerWrapper getServerCommandListener() {
|
|
WorldServer worldserver = this.D();
|
|
|
|
- return new CommandListenerWrapper(this, worldserver == null ? Vec3D.a : Vec3D.b((BaseBlockPosition) worldserver.getSpawn()), Vec2F.a, worldserver, 4, "Server", new ChatComponentText("Server"), this, (Entity) null);
|
|
+ return new CommandListenerWrapper(this, worldserver == null ? Vec3D.a : Vec3D.b(worldserver.getSpawn()), Vec2F.a, worldserver, 4, "Server", new ChatComponentText("Server"), this, null);
|
|
}
|
|
|
|
@Override
|
|
@@ -2039,7 +2039,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
|
|
public int b(GameProfile gameprofile) {
|
|
if (this.getPlayerList().isOp(gameprofile)) {
|
|
- OpListEntry oplistentry = (OpListEntry) this.getPlayerList().getOPs().get(gameprofile);
|
|
+ OpListEntry oplistentry = this.getPlayerList().getOPs().get(gameprofile);
|
|
|
|
return oplistentry != null ? oplistentry.a() : (this.a(gameprofile) ? 4 : (this.isEmbeddedServer() ? (this.getPlayerList().u() ? 4 : 0) : this.g()));
|
|
} else {
|
|
@@ -2059,11 +2059,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
|
|
while (iterator.hasNext()) {
|
|
Entry<ResourceKey<World>, 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<AttributeBase, AttributeModifier> 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<AttributeBase, AttributeModifier> 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<BlockPosition> 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<NBTTagByte> {
|
|
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<NBTTagByte> {
|
|
|
|
@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<NBTTagCompound> 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<NBTTagInt> {
|
|
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<NBTTagInt> {
|
|
|
|
@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<NBTBase> {
|
|
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<NBTBase> {
|
|
|
|
@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<NBTBase> {
|
|
|
|
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<NBTBase> {
|
|
|
|
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<NBTBase> {
|
|
|
|
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<NBTBase> {
|
|
|
|
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<NBTBase> {
|
|
|
|
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<NBTBase> {
|
|
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<NBTBase> {
|
|
|
|
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<NBTBase> {
|
|
|
|
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<NBTBase> {
|
|
}
|
|
|
|
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<NBTBase> {
|
|
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<NBTBase> {
|
|
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<String, String[]> 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<String, String[]> 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<BlockPosition> 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<Packet<?>> {
|
|
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<Packet<?>> {
|
|
}
|
|
|
|
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<Packet<?>> {
|
|
// Paper end
|
|
|
|
public void sendPacket(Packet<?> packet) {
|
|
- this.sendPacket(packet, (GenericFutureListener) null);
|
|
+ this.sendPacket(packet, null);
|
|
}
|
|
|
|
public void sendPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
|
|
@@ -281,7 +281,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
|
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<T> {
|
|
}
|
|
|
|
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<T> 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<NBTBase> 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<Packet<?>> {
|
|
}
|
|
|
|
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<PacketListenerPlayIn> {
|
|
@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<PacketListenerPlayIn> {
|
|
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<PacketListenerPlayIn> {
|
|
@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<PacketListenerPlayIn> {
|
|
@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<PacketListenerPlayIn> {
|
|
}
|
|
|
|
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<PacketListenerPlayIn> {
|
|
@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<PacketListenerPlayOut
|
|
this.j = packetdataserializer.readByte();
|
|
this.e = packetdataserializer.e(40);
|
|
this.f = packetdataserializer.e(40);
|
|
- this.g = (EnumChatFormat) packetdataserializer.a(EnumChatFormat.class);
|
|
+ this.g = packetdataserializer.a(EnumChatFormat.class);
|
|
this.c = packetdataserializer.h();
|
|
this.d = packetdataserializer.h();
|
|
}
|
|
@@ -107,7 +107,7 @@ public class PacketPlayOutScoreboardTeam implements Packet<PacketListenerPlayOut
|
|
packetdataserializer.writeByte(this.j);
|
|
packetdataserializer.a(this.e);
|
|
packetdataserializer.a(!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions ? "never" : this.f); // Paper
|
|
- packetdataserializer.a((Enum) this.g);
|
|
+ packetdataserializer.a(this.g);
|
|
packetdataserializer.a(this.c);
|
|
packetdataserializer.a(this.d);
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
|
|
index 4edf99eb64be454eae25da128a81795038ca8f97..1fcd19eb8e53312efd74abd0ff4f4b4aee84ba79 100644
|
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
|
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
|
|
@@ -31,7 +31,7 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
|
|
|
|
@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<PacketListenerPlayOut> {
|
|
|
|
@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<PacketListenerPlayOut> {
|
|
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<PacketListenerPlayOut> {
|
|
|
|
@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<PacketListenerPlayOut> {
|
|
|
|
@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<T, F> {
|
|
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<PathPoint> 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<PathPoint> 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<PathDestination, BlockPosition> 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<EntityLiving> list = this.a.world.a(EntityVillager.class, this.c, this.a, axisalignedbb);
|
|
- List<EntityHuman> list1 = this.a.world.a(this.c, (EntityLiving) this.a, axisalignedbb);
|
|
+ List<EntityHuman> 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<T extends EntityLiving> exten
|
|
}
|
|
|
|
public PathfinderGoalNearestAttackableTarget(EntityInsentient entityinsentient, Class<T> 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<T> oclass, int i, boolean flag, boolean flag1, @Nullable Predicate<EntityLiving> 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<VillagePlaceRecord> list = (List) this.b.x().c(VillagePlaceType.b, blockposition, 64, VillagePlace.Occupancy.IS_OCCUPIED).collect(Collectors.toList());
|
|
+ List<VillagePlaceRecord> 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<String, String> a = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
|
+ private static final Map<String, String> 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<String, String> b = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
|
+ private static final Map<String, String> 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<NBTTagCompound> long2objectmap = (Long2ObjectMap) this.d.get(s);
|
|
+ Long2ObjectMap<NBTTagCompound> 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<EntityPiglin> behaviorcontroller) {
|
|
@@ -77,7 +77,7 @@ public class PiglinAI {
|
|
|
|
private static BehaviorGateSingle<EntityPiglin> 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<EntityLiving>) 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<BlockPosition> c() {
|
|
@@ -94,10 +94,10 @@ public class PiglinAI {
|
|
|
|
protected static void b(EntityPiglin entitypiglin) {
|
|
BehaviorController<EntityPiglin> 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<EntityHuman> 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<EntityPiglin> 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<EntityLiving> optional = BehaviorUtil.a((EntityLiving) entitypiglin, MemoryModuleType.ANGRY_AT);
|
|
+ Optional<EntityLiving> 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<EntityHuman> 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<EntityPiglin> 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<EntityPiglin> 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<EntityPiglin> 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<EntityHuman> 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<EntityLiving> 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<EntityLiving> t(EntityPiglin entitypiglin) {
|
|
- return BehaviorUtil.a((EntityLiving) entitypiglin, MemoryModuleType.ANGRY_AT);
|
|
+ return BehaviorUtil.a(entitypiglin, MemoryModuleType.ANGRY_AT);
|
|
}
|
|
|
|
public static Optional<EntityLiving> h(EntityPiglin entitypiglin) {
|
|
@@ -579,9 +579,9 @@ public class PiglinAI {
|
|
|
|
private static void i(EntityPiglin entitypiglin, EntityLiving entityliving) {
|
|
BehaviorController<EntityPiglin> 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<Either<IChunkAccess, PlayerChunk.Failure>> statusFuture = this.getStatusFutureUnchecked(ChunkStatus.FULL);
|
|
- Either<IChunkAccess, PlayerChunk.Failure> either = (Either<IChunkAccess, PlayerChunk.Failure>) statusFuture.getNow(null);
|
|
+ Either<IChunkAccess, PlayerChunk.Failure> 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<Either<IChunkAccess, PlayerChunk.Failure>> statusFuture = this.getStatusFutureUnchecked(ChunkStatus.FULL);
|
|
- Either<IChunkAccess, PlayerChunk.Failure> either = (Either<IChunkAccess, PlayerChunk.Failure>) statusFuture.getNow(null);
|
|
+ Either<IChunkAccess, PlayerChunk.Failure> either = statusFuture.getNow(null);
|
|
return either == null ? null : (Chunk) either.left().orElse(null);
|
|
}
|
|
|
|
@@ -303,7 +303,7 @@ public class PlayerChunk {
|
|
// Paper end
|
|
|
|
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
|
|
- CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.statusFutures.get(chunkstatus.c());
|
|
+ CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> 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<Either<Chunk, PlayerChunk.Failure>> completablefuture = this.a();
|
|
- Either<Chunk, PlayerChunk.Failure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
|
|
+ Either<Chunk, PlayerChunk.Failure> 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<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = this.getStatusFutureUnchecked(chunkstatus);
|
|
|
|
if (!completablefuture.isCompletedExceptionally()) {
|
|
Optional<IChunkAccess> 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<Either<IChunkAccess, PlayerChunk.Failure>> getOrCreateFuture(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) { return this.a(chunkstatus, playerchunkmap); } // Tuinity - OBFHELPER
|
|
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) {
|
|
int i = chunkstatus.c();
|
|
- CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.statusFutures.get(i);
|
|
+ CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = this.statusFutures.get(i);
|
|
|
|
if (completablefuture != null) {
|
|
- Either<IChunkAccess, PlayerChunk.Failure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
|
|
+ Either<IChunkAccess, PlayerChunk.Failure> 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<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.statusFutures.get(i);
|
|
+ CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = this.statusFutures.get(i);
|
|
|
|
if (completablefuture != null) {
|
|
Optional<IChunkAccess> 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<Either<IChunkAccess, PlayerChunk.Failure>> 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<PlayerChunk> list = (List) result; // Paper - remove cloning of visible chunks
|
|
+ List<PlayerChunk> 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<Either<IChunkAccess, PlayerChunk.Failure>> 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<PlayerChunk> entry = (Entry) objectbidirectionaliterator.next();
|
|
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(entry.getLongKey());
|
|
- PlayerChunk playerchunk = (PlayerChunk) entry.getValue();
|
|
+ PlayerChunk playerchunk = entry.getValue();
|
|
Optional<IChunkAccess> optional = Optional.ofNullable(playerchunk.f());
|
|
Optional<Chunk> 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<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
|
|
try {
|
|
- Either<Chunk, PlayerChunk.Failure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
|
|
+ Either<Chunk, PlayerChunk.Failure> 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.<PacketPlayOutPosition.EnumPlayerTeleportFlags>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.<PacketPlayOutPosition.EnumPlayerTeleportFlags>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<PacketPlayOutPosition.EnumPlayerTeleportFlags> 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.<PacketPlayOutPosition.EnumPlayerTeleportFlags>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<PacketPlayOutPosition.EnumPlayerTeleportFlags> 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<? extends Future<? super Void>> 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<ItemStack> 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<ItemStack> 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 <T extends PacketListener> void ensureMainThread(Packet<T> 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<ItemStack> interactionresultwrapper = itemstack.a(world, (EntityHuman) entityplayer, enumhand);
|
|
- ItemStack itemstack1 = (ItemStack) interactionresultwrapper.b();
|
|
+ InteractionResultWrapper<ItemStack> 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<ItemStack> 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<ItemStack> 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<ItemStack> 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 bffb8fcdd32c98b3253430d06955a4e2f170dbea..794a899c83a97fb5ba78ca90b04e8acb699ddd42 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
|
|
@@ -470,13 +470,13 @@ public abstract class PlayerList {
|
|
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)
|
|
entityplayer.lastSave = MinecraftServer.currentTick; // Yatopia
|
|
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();
|
|
@@ -537,7 +537,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);
|
|
@@ -558,7 +558,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);
|
|
@@ -584,7 +584,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);
|
|
}
|
|
@@ -620,9 +620,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;
|
|
@@ -633,9 +633,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;
|
|
@@ -785,7 +785,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);
|
|
@@ -844,7 +844,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
|
|
@@ -892,7 +892,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<EntityPlayer>() {
|
|
@Override
|
|
@@ -909,7 +909,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);
|
|
}
|
|
|
|
}
|
|
@@ -921,7 +921,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);
|
|
}
|
|
}
|
|
|
|
@@ -935,7 +935,7 @@ public abstract class PlayerList {
|
|
|
|
public void a(Packet<?> packet, ResourceKey<World> 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);
|
|
@@ -970,7 +970,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());
|
|
@@ -984,7 +984,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;
|
|
@@ -1260,8 +1260,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!");
|
|
}
|
|
@@ -1309,7 +1309,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) {
|
|
@@ -1354,7 +1354,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();
|
|
@@ -1389,7 +1389,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<VillagePlaceRecord> list = (List) villageplace.b((villageplacetype) -> {
|
|
+ List<VillagePlaceRecord> 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<VillagePlaceRecord> 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<MobEffect> 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<MobEffect> b(@Nullable NBTTagCompound nbttagcompound) {
|
|
List<MobEffect> 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<MobEffect> 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<T extends PropertyManager<T>> {
|
|
|
|
@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<T extends PropertyManager<T>> {
|
|
}
|
|
|
|
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<T>.EditableProperty<Integer> b(String s, int i) {
|
|
@@ -194,11 +194,11 @@ public abstract class PropertyManager<T extends PropertyManager<T>> {
|
|
}
|
|
|
|
protected int a(String s, UnaryOperator<Integer> 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<T extends PropertyManager<T>> {
|
|
|
|
@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<BlockPosition, TileEntity> 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<EntityRaider> set = (Set) iterator.next();
|
|
+ Set<EntityRaider> 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<EntityRaider> set = (Set) this.raiders.get(entityraider.fd());
|
|
+ Set<EntityRaider> 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<EntityRaider> set = (Set) this.raiders.get(i);
|
|
+ Set<EntityRaider> 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<BlockPosition> 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<ItemStack> {
|
|
public boolean exact; // CraftBukkit
|
|
|
|
public RecipeItemStack(Stream<? extends RecipeItemStack.Provider> 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<ItemStack> {
|
|
}
|
|
}
|
|
}
|
|
- 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<ItemStack> {
|
|
|
|
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<ItemStack> {
|
|
|
|
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<IInventory> {
|
|
|
|
@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<R> extends RegionFileCache implements AutoCloseab
|
|
|
|
@Nullable
|
|
protected Optional<R> c(long i) {
|
|
- return (Optional) this.c.get(i);
|
|
+ return this.c.get(i);
|
|
}
|
|
|
|
protected Optional<R> d(long i) {
|
|
@@ -66,7 +66,7 @@ public class RegionFileSection<R> 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<R> extends RegionFileCache implements AutoCloseab
|
|
|
|
private void d(ChunkCoordIntPair chunkcoordintpair) {
|
|
Dynamic<NBTBase> 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<R> extends RegionFileCache implements AutoCloseab
|
|
// Paper start - internal get data function, copied from above
|
|
private NBTTagCompound getDataInternal(ChunkCoordIntPair chunkcoordintpair) {
|
|
Dynamic<NBTBase> 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<R> extends RegionFileCache implements AutoCloseab
|
|
long j = SectionPosition.a(chunkcoordintpair, i).s();
|
|
|
|
this.d.remove(j);
|
|
- Optional<R> optional = (Optional) this.c.get(j);
|
|
+ Optional<R> optional = this.c.get(j);
|
|
|
|
if (optional != null && optional.isPresent()) {
|
|
DataResult<T> dataresult = ((Codec) this.e.apply(() -> {
|
|
@@ -205,7 +205,7 @@ public class RegionFileSection<R> extends RegionFileCache implements AutoCloseab
|
|
protected void b(long i) {}
|
|
|
|
protected void a(long i) {
|
|
- Optional<R> optional = (Optional) this.c.get(i);
|
|
+ Optional<R> 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<IChunkAccess> 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<T> implements Registry<T> {
|
|
}
|
|
|
|
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<K> implements Registry<K> {
|
|
}
|
|
|
|
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<T> extends IRegistryWritable<T> {
|
|
@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<T> extends IRegistryWritable<T> {
|
|
while (iterator.hasNext()) {
|
|
Pair<ResourceKey<T>, 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<Reputation.b> 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<ReputationType> 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<Reputation.b> 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<ReputationType> 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<String, ReputationType> k = (Map) Stream.of(values()).collect(ImmutableMap.toImmutableMap((reputationtype) -> {
|
|
+ private static final Map<String, ReputationType> 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<EntityPlayer>) 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<SectionPosition> a(final int i, final int j, final int k, final int l, final int i1, final int j1) {
|
|
- return StreamSupport.stream(new AbstractSpliterator<SectionPosition>((long) ((l - i + 1) * (i1 - j + 1) * (j1 - k + 1)), 64) {
|
|
+ return StreamSupport.stream(new AbstractSpliterator<SectionPosition>((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<? super SectionPosition> 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<Channel>() {
|
|
+ this.listeningChannels.add((new ServerBootstrap()).channel(oclass).childHandler(new ChannelInitializer<Channel>() {
|
|
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<String, JsonElement> 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<Statistic<?>> 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<StatisticWrapper<?>, 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<String, JsonElement> 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<Entity> 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<BiomeBase.BiomeMeta> 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<BiomeBase.BiomeMeta> 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<T> implements Iterable<Statistic<T>> {
|
|
}
|
|
|
|
public Statistic<T> 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<C extends WorldGenFeatureConfiguration>
|
|
public static final StructureGenerator<WorldGenFeatureEmptyConfiguration> IGLOO = a("Igloo", new WorldGenFeatureIgloo(WorldGenFeatureEmptyConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES);
|
|
public static final StructureGenerator<WorldGenFeatureRuinedPortalConfiguration> RUINED_PORTAL = a("Ruined_Portal", new WorldGenFeatureRuinedPortal(WorldGenFeatureRuinedPortalConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES);
|
|
public static final StructureGenerator<WorldGenFeatureShipwreckConfiguration> 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<WorldGenFeatureEmptyConfiguration> STRONGHOLD = a("Stronghold", new WorldGenStronghold(WorldGenFeatureEmptyConfiguration.a), WorldGenStage.Decoration.STRONGHOLDS);
|
|
public static final StructureGenerator<WorldGenFeatureEmptyConfiguration> MONUMENT = a("Monument", new WorldGenMonument(WorldGenFeatureEmptyConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES);
|
|
public static final StructureGenerator<WorldGenFeatureOceanRuinConfiguration> OCEAN_RUIN = a("Ocean_Ruin", new WorldGenFeatureOceanRuin(WorldGenFeatureOceanRuinConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES);
|
|
@@ -55,7 +55,7 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration>
|
|
}
|
|
|
|
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<C extends WorldGenFeatureConfiguration>
|
|
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<C extends WorldGenFeatureConfiguration>
|
|
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<C extends WorldGenFeatureConfiguration>
|
|
public abstract StructureGenerator.a<C> a();
|
|
|
|
public String i() {
|
|
- return (String) StructureGenerator.a.inverse().get(this);
|
|
+ return StructureGenerator.a.inverse().get(this);
|
|
}
|
|
|
|
public List<BiomeBase.BiomeMeta> 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<StructureSettingsStronghold> optional, Map<StructureGenerator<?>, 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 <T> Stream<T> a(Optional<? extends T> optional) {
|
|
- return (Stream) DataFixUtils.orElseGet(optional.map(Stream::of), Stream::empty);
|
|
+ return DataFixUtils.orElseGet(optional.map(Stream::of), Stream::empty);
|
|
}
|
|
|
|
public static <T> Optional<T> a(Optional<T> optional, Consumer<T> consumer, Runnable runnable) {
|
|
@@ -339,7 +339,7 @@ public class SystemUtils {
|
|
}
|
|
|
|
public static DataResult<int[]> 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<T> extends Tags<T> {
|
|
while (iterator.hasNext()) {
|
|
Entry<MinecraftKey, Tag<T>> 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<T> extends Tags<T> {
|
|
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<T> implements Mailbox<T>, 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<T> implements TickList<T> {
|
|
private final Function<T, MinecraftKey> b;
|
|
|
|
public TickListChunk(Function<T, MinecraftKey> function, List<NextTickListEntry<T>> 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<T> implements TickList<T> {
|
|
TickListChunk.a<T> 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<T> implements TickList<T> {
|
|
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<T> implements TickList<T> {
|
|
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<T> implements TickList<T> {
|
|
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<T> implements TickList<T> {
|
|
}
|
|
public List<NextTickListEntry<T>> getEntriesInBoundingBox(StructureBoundingBox structureboundingbox, boolean flag, boolean flag1) {
|
|
// Paper end
|
|
- List<NextTickListEntry<T>> list = this.a((List) null, this.nextTickList, structureboundingbox, flag);
|
|
+ List<NextTickListEntry<T>> list = this.a(null, this.nextTickList, structureboundingbox, flag);
|
|
|
|
if (flag && list != null) {
|
|
this.nextTickListHash.removeAll(list);
|
|
@@ -169,11 +169,11 @@ public class TickListServer<T> implements TickList<T> {
|
|
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<T> implements TickList<T> {
|
|
while (iterator.hasNext()) {
|
|
NextTickListEntry<T> 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<T> implements TickList<T> {
|
|
NextTickListEntry<T> 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<T> implements Comparable<Ticket<?>> {
|
|
}
|
|
|
|
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<T> {
|
|
}
|
|
|
|
public static <T> TicketType<T> a(String s, Comparator<T> comparator, int i) {
|
|
- return new TicketType<>(s, comparator, (long) i);
|
|
+ return new TicketType<>(s, comparator, i);
|
|
}
|
|
|
|
protected TicketType(String s, Comparator<T> 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<IBlockData> 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<TileEntityBeacon.BeaconColorTracker> 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<EntityHuman> 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<RecipeCampfire> 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<EntityHuman> 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<EntityHuman> 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<EntityHuman> 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<EntityLiving> list = this.world.a(EntityLiving.class, this.m(), (java.util.function.Predicate<EntityLiving>) (entityliving1) -> { // CraftBukkit - decompile error
|
|
+ List<EntityLiving> 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<EntityLiving> list = this.world.a(EntityLiving.class, this.m(), (java.util.function.Predicate<EntityLiving>) (entityliving) -> { // CraftBukkit - decompile error
|
|
+ List<EntityLiving> 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<Item, Integer> 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<RecipeCooking>) this.c, this, this.world).map(RecipeCooking::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302 // Eclipse fail
|
|
+ return (this.hasWorld()) ? this.world.getCraftingManager().craft((Recipes<RecipeCooking>) 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<MinecraftKey> 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<Boolean> 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<Entity> 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<Entity> list = this.world.getEntities((Entity) null, PistonUtil.a(axisalignedbb, enumdirection, d0).b(axisalignedbb));
|
|
+ List<Entity> list = this.world.getEntities(null, PistonUtil.a(axisalignedbb, enumdirection, d0).b(axisalignedbb));
|
|
|
|
if (!list.isEmpty()) {
|
|
List<AxisAlignedBB> 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<Entity> 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<Entity> list = this.world.getEntities((Entity) null, axisalignedbb);
|
|
+ List<Entity> 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<UserCache.UserCacheEntry> list = (List) ChatDeserializer.a(this.b, (Reader) bufferedreader, UserCache.i);
|
|
+ List<UserCache.UserCacheEntry> 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<VillagePlaceSection> {
|
|
}
|
|
|
|
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<VillagePlaceType> predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) {
|
|
@@ -46,9 +46,9 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
|
}
|
|
|
|
public boolean a(VillagePlaceType villageplacetype, BlockPosition blockposition) {
|
|
- Optional<VillagePlaceType> optional = ((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).d(blockposition);
|
|
+ Optional<VillagePlaceType> 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<VillagePlaceRecord> b(Predicate<VillagePlaceType> predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) {
|
|
@@ -71,7 +71,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
|
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<VillagePlaceSection> {
|
|
}
|
|
|
|
public Optional<BlockPosition> a(Predicate<VillagePlaceType> predicate, Predicate<BlockPosition> predicate1, VillagePlace.Occupancy villageplace_occupancy, BlockPosition blockposition, int i, Random random) {
|
|
- List<VillagePlaceRecord> list = (List) this.c(predicate, blockposition, i, villageplace_occupancy).collect(Collectors.toList());
|
|
+ List<VillagePlaceRecord> 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<VillagePlaceSection> {
|
|
}
|
|
|
|
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<VillagePlaceType> 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<VillagePlaceType> 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<VillagePlaceSection> {
|
|
private boolean f(long i) {
|
|
Optional<VillagePlaceSection> 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<VillagePlaceSection> {
|
|
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<VillagePlaceSection> {
|
|
});
|
|
}, () -> {
|
|
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<VillagePlaceSection> {
|
|
}).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<Enchantment> list = (List) IRegistry.ENCHANTMENT.e().filter(Enchantment::h).collect(Collectors.toList());
|
|
- Enchantment enchantment = (Enchantment) list.get(random.nextInt(list.size()));
|
|
+ List<Enchantment> 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<PotionRegistry> list = (List) IRegistry.POTION.e().filter((potionregistry) -> {
|
|
+ List<PotionRegistry> 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<VoxelShape> {
|
|
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<VoxelShape> {
|
|
}
|
|
|
|
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<U> {
|
|
}
|
|
|
|
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<GameProfilerFiller> 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<NBTBase> 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<EntityPlayer>) (java.util.List) world.getPlayers()) {
|
|
+ for (EntityPlayer player : (java.util.List<EntityPlayer>) 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<World> 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 709e24cc1a7970ce5bb318b949114ffea5e34923..f01dc9b4ef5315acbc2cc1965ea03722832d8ba5 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);
|
|
}
|
|
@@ -926,7 +926,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
|
|
@@ -998,7 +998,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);
|
|
}
|
|
@@ -1075,17 +1075,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
|
|
}
|
|
@@ -1103,7 +1103,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
|
|
}
|
|
@@ -1116,7 +1116,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
|
|
}
|
|
}
|
|
@@ -1169,12 +1169,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<EntityLiving> list = this.a(EntityLiving.class, axisalignedbb, (java.util.function.Predicate<EntityLiving>) (entityliving) -> { // CraftBukkit - decompile error
|
|
+ List<EntityLiving> 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);
|
|
@@ -1242,7 +1242,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);
|
|
}
|
|
|
|
}
|
|
@@ -1250,7 +1250,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
|
private void b(NextTickListEntry<Block> 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);
|
|
}
|
|
|
|
@@ -1540,7 +1540,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
|
public EntityPlayer h() {
|
|
List<EntityPlayer> 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
|
|
@@ -1593,7 +1593,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());
|
|
@@ -1606,7 +1606,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);
|
|
@@ -1669,7 +1669,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;
|
|
@@ -1720,7 +1720,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
|
|
@@ -1990,7 +1990,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());
|
|
@@ -2003,7 +2003,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);
|
|
}
|
|
|
|
}
|
|
@@ -2080,7 +2080,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
|
|
@@ -2173,7 +2173,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)));
|
|
}
|
|
}
|
|
|
|
@@ -2187,10 +2187,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()));
|
|
}
|
|
}
|
|
|
|
@@ -2199,7 +2199,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
|
|
@@ -2265,7 +2265,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 {
|
|
@@ -2277,12 +2277,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
|
|
@@ -2317,7 +2317,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);
|
|
@@ -2330,12 +2330,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
|
|
@@ -2439,13 +2439,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;
|
|
@@ -2547,7 +2547,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
|
while (objectiterator.hasNext()) {
|
|
it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<EnumCreatureType> 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()));
|
|
}
|
|
}
|
|
|
|
@@ -2606,7 +2606,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;
|
|
@@ -2630,7 +2630,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;
|
|
@@ -2654,7 +2654,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;
|
|
@@ -2705,7 +2705,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<DimensionManager> resourcekey2 = (ResourceKey) unmodifiableiterator2.next(); // CraftBukkit
|
|
- ListIterator<ChunkCoordIntPair> listiterator = (ListIterator) immutablemap.get(resourcekey2);
|
|
- IChunkLoader ichunkloader = (IChunkLoader) immutablemap1.get(resourcekey2);
|
|
+ ListIterator<ChunkCoordIntPair> 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<net.minecraft.server.Chunk>(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<org.bukkit.BanEntry> getBanEntries() {
|
|
ImmutableSet.Builder<org.bukkit.BanEntry> 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<String, Map<String, Object>> perms;
|
|
|
|
try {
|
|
- perms = (Map<String, Map<String, Object>>) 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<NBTBase> registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, console.dataPackResources.h(), (IRegistryCustom) iregistrycustom_dimension);
|
|
- WorldDataServer worlddata = (WorldDataServer) worldSession.a((DynamicOps) registryreadops, console.datapackconfiguration);
|
|
+ RegistryReadOps<NBTBase> 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<MobSpawner> list = ImmutableList.of(new MobSpawnerPhantom(), new MobSpawnerPatrol(), new MobSpawnerCat(), new VillageSiege(), new MobSpawnerTrader(worlddata));
|
|
RegistryMaterials<WorldDimension> 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<DimensionManager> typeKey = (ResourceKey) console.f.a().c(dimensionmanager).orElseThrow(() -> {
|
|
+ ResourceKey<DimensionManager> typeKey = console.f.a().c(dimensionmanager).orElseThrow(() -> {
|
|
return new IllegalStateException("Unregistered dimension type: " + dimensionmanager);
|
|
});
|
|
ResourceKey<net.minecraft.server.World> 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.<String>of() : completions;
|
|
+ return completions == null ? ImmutableList.of() : completions;
|
|
}
|
|
|
|
public List<String> 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<net.minecraft.server.Entity> list = (List<net.minecraft.server.Entity>) world.getEntities(null, bb);
|
|
+ List<net.minecraft.server.Entity> list = world.getEntities(null, bb);
|
|
for (Iterator<net.minecraft.server.Entity> 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<T extends TileEntityLootable> 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<IBlockState<?>, 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<EntityPlayer>) 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<Enchantment, Integer> getEnchantments() {
|
|
- return hasItemMeta() ? getItemMeta().getEnchants() : ImmutableMap.<Enchantment, Integer>of(); // Paper - use Item Meta
|
|
+ return hasItemMeta() ? getItemMeta().getEnchants() : ImmutableMap.of(); // Paper - use Item Meta
|
|
}
|
|
|
|
static Map<Enchantment, Integer> 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<Enchantment, Integer> getStoredEnchants() {
|
|
- return hasStoredEnchants() ? ImmutableMap.copyOf(enchantments) : ImmutableMap.<Enchantment, Integer>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<FireworkEffect> getEffects() {
|
|
- return this.effects == null ? ImmutableList.<FireworkEffect>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<Enchantment, Integer> getEnchants() {
|
|
- return hasEnchants() ? ImmutableSortedMap.copyOfSorted(enchantments) : ImmutableMap.<Enchantment, Integer>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<Objective> objectives = ImmutableSet.builder();
|
|
- for (ScoreboardObjective netObjective : (Collection<ScoreboardObjective>) 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<Objective> getObjectives() {
|
|
- return ImmutableSet.copyOf(Iterables.transform((Collection<ScoreboardObjective>) this.board.getObjectives(), new Function<ScoreboardObjective, Objective>() {
|
|
+ return ImmutableSet.copyOf(Iterables.transform(this.board.getObjectives(), new Function<ScoreboardObjective, Objective>() {
|
|
|
|
@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<Score> scores = ImmutableSet.builder();
|
|
- for (ScoreboardObjective objective : (Collection<ScoreboardObjective>) 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<ScoreboardObjective>) 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<Team> getTeams() {
|
|
- return ImmutableSet.copyOf(Iterables.transform((Collection<ScoreboardTeam>) this.board.getTeams(), new Function<ScoreboardTeam, Team>() {
|
|
+ return ImmutableSet.copyOf(Iterables.transform(this.board.getTeams(), new Function<ScoreboardTeam, Team>() {
|
|
|
|
@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 <T> List getList(String path, T def)
|
|
{
|
|
config.addDefault( path, def );
|
|
- return (List<T>) 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<String> 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<String> 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 <T> List getList(String path, T def) // Paper - private -> public
|
|
{
|
|
config.addDefault( "world-settings.default." + path, def );
|
|
- return (List<T>) 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<Object[]> args() {
|
|
List<Object[]> list = new ArrayList<>();
|
|
- for (Block block : (Iterable<Block>) 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
|