2020-09-02 21:06:17 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Ivan Pekov <ivan@mrivanplays.com>
|
|
|
|
Date: Tue, 1 Sep 2020 19:11:50 +0300
|
|
|
|
Subject: [PATCH] Nuke streams off BlockPosition
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java
|
2021-01-21 11:58:52 +01:00
|
|
|
index 8724ad342bec7c733b3c825bd62dbfa5c28c06dd..9907047028b754fe0e314a7d5c5238ce4286c373 100644
|
2020-09-02 21:06:17 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockBase.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockBase.java
|
2021-01-21 11:58:52 +01:00
|
|
|
@@ -681,6 +681,7 @@ public abstract class BlockBase {
|
2020-09-02 21:06:17 +02:00
|
|
|
return this.getBlock().getInventory(this.p(), world, blockposition);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public final boolean hasTag(Tag<Block> tag) { return a(tag); } // Yatopia - OBFHELPER
|
|
|
|
public boolean a(Tag<Block> tag) {
|
|
|
|
return this.getBlock().a(tag);
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
2021-01-21 11:58:52 +01:00
|
|
|
index 7fddef0afbcf1f9f391c540b8fce1bebf8faa452..f13b4e6ec815792c2f2b49193707da94df427424 100644
|
2020-09-02 21:06:17 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
2020-10-06 02:40:09 +02:00
|
|
|
@@ -318,7 +318,15 @@ public class BlockPosition extends BaseBlockPosition {
|
2020-09-02 21:06:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static Optional<BlockPosition> a(BlockPosition blockposition, int i, int j, Predicate<BlockPosition> predicate) {
|
|
|
|
- return b(blockposition, i, j, i).filter(predicate).findFirst();
|
2020-10-06 02:40:09 +02:00
|
|
|
+ // Yatopia start - avoid using stream
|
|
|
|
+ // return b(blockposition, i, j, i).filter(predicate).findFirst();
|
2020-09-29 23:54:47 +02:00
|
|
|
+ for (BlockPosition pos : a(blockposition, i, j, i)) {
|
2020-09-02 21:06:17 +02:00
|
|
|
+ if (predicate.test(pos)) {
|
2020-10-06 02:40:09 +02:00
|
|
|
+ return Optional.of(pos);
|
2020-09-02 21:06:17 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
2020-10-06 02:40:09 +02:00
|
|
|
+ return Optional.empty();
|
2020-09-02 21:06:17 +02:00
|
|
|
+ // Yatopia end
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Stream<BlockPosition> b(BlockPosition blockposition, int i, int j, int k) {
|