9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-23 16:59:23 +00:00

Simplify development run JVM arguments

This commit is contained in:
Martijn Muijsers
2023-03-22 16:49:11 +01:00
parent 43611dc086
commit b7fd9efe68
166 changed files with 29 additions and 52 deletions

View File

@@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Sun, 25 Dec 2022 20:51:32 +0100
Subject: [PATCH] Optimize identical item checks
License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 08638e5982083835cd90243e6edf45088ab695be..32d5676339365dc1a4d1ea481f40bcdb7cbf6c07 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -725,14 +725,29 @@ public final class ItemStack {
}
public static boolean tagMatches(ItemStack left, ItemStack right) {
+ // Gale start - optimize identical item checks
+ if (left == right) {
+ return true;
+ }
+ // Gale end - optimize identical item checks
return left.isEmpty() && right.isEmpty() ? true : (!left.isEmpty() && !right.isEmpty() ? (left.tag == null && right.tag != null ? false : left.tag == null || left.tag.equals(right.tag)) : false);
}
public static boolean matches(ItemStack left, ItemStack right) {
+ // Gale start - optimize identical item checks
+ if (left == right) {
+ return true;
+ }
+ // Gale end - optimize identical item checks
return left.isEmpty() && right.isEmpty() ? true : (!left.isEmpty() && !right.isEmpty() ? left.matches(right) : false);
}
private boolean matches(ItemStack stack) {
+ // Gale start - optimize identical item checks
+ if (this == stack) {
+ return true;
+ }
+ // Gale end - optimize identical item checks
return this.count != stack.count ? false : (!this.is(stack.getItem()) ? false : (this.tag == null && stack.tag != null ? false : this.tag == null || this.tag.equals(stack.tag)));
}