9
0
mirror of https://github.com/SparklyPower/SparklyPaper.git synced 2025-12-22 16:39:33 +00:00
Files
SparklyPaperMC/patches/server/0004-Remove-streams.patch
MrPowerGamerBR 241771b90f Rebuild patches
2021-03-15 07:55:29 -03:00

58 lines
3.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Sauve <paul@technove.co>
Date: Sat, 23 Jan 2021 16:42:24 -0600
Subject: [PATCH] Remove streams
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/server/BehaviorBetterJob.java b/src/main/java/net/minecraft/server/BehaviorBetterJob.java
index 19f8cf4384ff7a1515ad33a5f573ea0061bab93d..e6507a9bef705e1496497ad6b58a546348a0779e 100644
--- a/src/main/java/net/minecraft/server/BehaviorBetterJob.java
+++ b/src/main/java/net/minecraft/server/BehaviorBetterJob.java
@@ -14,11 +14,31 @@ public class BehaviorBetterJob extends Behavior<EntityVillager> {
protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) {
GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.JOB_SITE).get();
+ // Airplane start - remove stream
+ /*
worldserver.y().c(globalpos.getBlockPosition()).ifPresent((villageplacetype) -> {
BehaviorUtil.a(entityvillager, (entityvillager1) -> {
return this.a(globalpos, villageplacetype, entityvillager1);
}).reduce(entityvillager, BehaviorBetterJob::a);
});
+ */
+ java.util.Optional<VillagePlaceType> optVillagePlaceType = worldserver.y().c(globalpos.getBlockPosition());
+ if (optVillagePlaceType.isPresent()) {
+ VillagePlaceType villageplacetype = optVillagePlaceType.get();
+ java.util.Optional<java.util.List<EntityLiving>> optList = entityvillager.getBehaviorController().getMemory(MemoryModuleType.MOBS);
+ if (optList.isPresent()) {
+ EntityVillager previous = entityvillager;
+ for (EntityLiving entityliving : optList.get()) {
+ if (entityliving instanceof EntityVillager && entityliving != entityvillager && entityliving.isAlive()) {
+ EntityVillager entityvillager1 = (EntityVillager) entityliving;
+ if (this.a(globalpos, villageplacetype, entityvillager1)) {
+ previous = a(previous, entityvillager1);
+ }
+ }
+ }
+ }
+ }
+ // Airplane end
}
private static EntityVillager a(EntityVillager entityvillager, EntityVillager entityvillager1) {