diff --git a/patches/server/0090-lithium-tag.patch b/patches/server/0090-lithium-tag.patch new file mode 100644 index 0000000..063e4ac --- /dev/null +++ b/patches/server/0090-lithium-tag.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: JellySquid +Date: Wed, 23 Sep 2020 16:33:58 +0200 +Subject: [PATCH] lithium: tag + +Original code by CaffeineMC, licensed under GNU Lesser General Public License v3.0 +You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) + +diff --git a/src/main/java/net/minecraft/tags/SetTag.java b/src/main/java/net/minecraft/tags/SetTag.java +index d0c4a1dd2b11cfdbd3972dec5b5622e2f013ab48..9444e3dcdf3fa307c93adb2f790876fcd9ad88e7 100644 +--- a/src/main/java/net/minecraft/tags/SetTag.java ++++ b/src/main/java/net/minecraft/tags/SetTag.java +@@ -3,6 +3,8 @@ package net.minecraft.tags; + import com.google.common.annotations.VisibleForTesting; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableSet; ++import it.unimi.dsi.fastutil.objects.ReferenceArraySet; // Mirai ++import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; // Mirai + import java.util.List; + import java.util.Set; + +@@ -14,8 +16,14 @@ public class SetTag implements Tag { + + protected SetTag(Set values, Class type) { + this.closestCommonSuperType = type; +- this.values = values; + this.valuesList = ImmutableList.copyOf(values); ++ // Mirai start ++ if (values.size() <= 3) { ++ this.values = new ReferenceArraySet<>(values); ++ } else { ++ this.values = new ReferenceOpenHashSet<>(values); ++ } ++ // Mirai end + } + + public static SetTag empty() { diff --git a/patches/server/0091-Time-Utilities.patch b/patches/server/0091-Time-Utilities.patch new file mode 100644 index 0000000..df0c908 --- /dev/null +++ b/patches/server/0091-Time-Utilities.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: YatopiaMC +Date: Fri, 23 Oct 2020 09:20:01 -0700 +Subject: [PATCH] Time Utilities + +Original code by YatopiaMC, licensed under MIT +You can find the original code on https://github.com/YatopiaMC/Yatopia + +diff --git a/src/main/java/org/yatopiamc/yatopia/server/util/TimeUtils.java b/src/main/java/org/yatopiamc/yatopia/server/util/TimeUtils.java +new file mode 100644 +index 0000000000000000000000000000000000000000..bb023bcb4b1e1ab5261c83358ce0951cc35ba16d +--- /dev/null ++++ b/src/main/java/org/yatopiamc/yatopia/server/util/TimeUtils.java +@@ -0,0 +1,27 @@ ++package org.yatopiamc.yatopia.server.util; ++ ++import java.util.concurrent.TimeUnit; ++ ++public class TimeUtils { ++ ++ public static String getFriendlyName(TimeUnit unit) { ++ switch (unit) { ++ case NANOSECONDS: ++ return "ns"; ++ case MILLISECONDS: ++ return "ms"; ++ case MICROSECONDS: ++ return "micros"; ++ case SECONDS: ++ return "s"; ++ case MINUTES: ++ return "m"; ++ case DAYS: ++ return "d"; ++ case HOURS: ++ return "h"; ++ default: ++ throw new AssertionError(); ++ } ++ } ++} +\ No newline at end of file