mirror of https://github.com/YatopiaMC/Yatopia.git
43 lines
2.3 KiB
Diff
43 lines
2.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Paul Sauve <paul@technove.co>
|
|
Date: Fri, 15 Jan 2021 20:08:54 -0600
|
|
Subject: [PATCH] Don't get entity equipment if not needed
|
|
|
|
Airplane
|
|
Copyright (C) 2020 Technove LLC
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
index 56812a96b57586d91c0f218f4720807e2d957627..6b82dffa3d0938a94114ead277b42c71ea3bb52b 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
@@ -910,11 +910,13 @@ public abstract class EntityLiving extends Entity {
|
|
}
|
|
|
|
if (entity != null) {
|
|
- ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);
|
|
- Item item = itemstack.getItem();
|
|
+ // Airplane start - don't get equipment if not needed
|
|
+ //ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);
|
|
+ //Item item = itemstack.getItem();
|
|
EntityTypes<?> entitytypes = entity.getEntityType();
|
|
|
|
- if (entitytypes == EntityTypes.SKELETON && item == Items.SKELETON_SKULL || entitytypes == EntityTypes.ZOMBIE && item == Items.ZOMBIE_HEAD || entitytypes == EntityTypes.CREEPER && item == Items.CREEPER_HEAD) {
|
|
+ if (entitytypes == EntityTypes.SKELETON && this.getEquipment(EnumItemSlot.HEAD).getItem() == Items.SKELETON_SKULL || entitytypes == EntityTypes.ZOMBIE && this.getEquipment(EnumItemSlot.HEAD).getItem() == Items.ZOMBIE_HEAD || entitytypes == EntityTypes.CREEPER && this.getEquipment(EnumItemSlot.HEAD).getItem() == Items.CREEPER_HEAD) {
|
|
+ // Airplane end
|
|
d0 *= 0.5D;
|
|
}
|
|
}
|