36 lines
2.1 KiB
Diff
36 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Arthur Blanchot <blanchot.arthur@protonmail.ch>
|
|
Date: Fri, 24 Jun 2022 20:10:19 +0200
|
|
Subject: [PATCH] Configurable enchantment table book animation tick
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
|
index 2341a5a249d455628165fc6ba508fc6d70c3dbfb..e42acd14f2521b6adde094cea756f217c95aba86 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
|
|
@@ -48,6 +48,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
|
|
}
|
|
|
|
public static void bookAnimationTick(Level world, BlockPos pos, BlockState state, EnchantmentTableBlockEntity blockEntity) {
|
|
+ if (wtf.etil.mirai.MiraiConfig.bookAnimationTick) return; // Mirai - skip enchantment table book tick
|
|
blockEntity.oOpen = blockEntity.open;
|
|
blockEntity.oRot = blockEntity.rot;
|
|
Player player = world.getNearestPlayer((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 3.0D, false);
|
|
diff --git a/src/main/java/wtf/etil/mirai/MiraiConfig.java b/src/main/java/wtf/etil/mirai/MiraiConfig.java
|
|
index f6d9bc16896198c53d6ab7945df3205bf1054487..7339e70f8182209e6274c7f1f1f3558adcaa2cfa 100644
|
|
--- a/src/main/java/wtf/etil/mirai/MiraiConfig.java
|
|
+++ b/src/main/java/wtf/etil/mirai/MiraiConfig.java
|
|
@@ -202,4 +202,11 @@ public class MiraiConfig {
|
|
"Whether or not entities should be able to use portals.");
|
|
}
|
|
|
|
+ public static boolean bookAnimationTick;
|
|
+ private static void bookTicking() {
|
|
+ bookAnimationTick = getBoolean("disable-enchantment-table-book-animation", true,
|
|
+ "Whether or not server should animate enchantment table book.",
|
|
+ "Disabling it can save MSPT, especially with quite a lot of enchantment tables.");
|
|
+ }
|
|
+
|
|
}
|
|
\ No newline at end of file
|