Fix crash when beehive is broken by fake player (#7566)

This commit is contained in:
Jonathan Coates 2020-12-28 21:56:44 +00:00 committed by GitHub
parent fc68b81b21
commit 830d9699e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,14 @@
--- a/net/minecraft/block/BeehiveBlock.java
+++ b/net/minecraft/block/BeehiveBlock.java
@@ -105,7 +105,7 @@
@@ -85,6 +85,7 @@
List<BeeEntity> list = p_226881_1_.func_217357_a(BeeEntity.class, (new AxisAlignedBB(p_226881_2_)).func_72314_b(8.0D, 6.0D, 8.0D));
if (!list.isEmpty()) {
List<PlayerEntity> list1 = p_226881_1_.func_217357_a(PlayerEntity.class, (new AxisAlignedBB(p_226881_2_)).func_72314_b(8.0D, 6.0D, 8.0D));
+ if (list1.isEmpty()) return; //Forge: Prevent Error when no players are around.
int i = list1.size();
for(BeeEntity beeentity : list) {
@@ -105,7 +106,7 @@
int i = p_225533_1_.func_177229_b(field_226873_c_);
boolean flag = false;
if (i >= 5) {