Compare commits

...

4 commits

Author SHA1 Message Date
19ab653181
Fix config mistake
All checks were successful
/ build (push) Successful in 59s
2025-01-05 10:29:48 +01:00
e0d7e636a6
Unupdate to 1.21.1 2025-01-03 14:20:14 +01:00
9bcdcc17ba
Elaborate on warning 2025-01-03 14:12:24 +01:00
a48fe97b4d
Elaborate on slow module
Not even my fault
2025-01-03 13:54:48 +01:00
4 changed files with 20 additions and 6 deletions

View file

@ -17,8 +17,8 @@
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.nms.version>v1_21_R2</project.nms.version>
<project.minecraft.version>1.21.3</project.minecraft.version>
<project.nms.version>v1_21_R1</project.nms.version>
<project.minecraft.version>1.21.1</project.minecraft.version>
<project.spigot.version>${project.minecraft.version}-R0.1-SNAPSHOT</project.spigot.version>
</properties>

View file

@ -142,7 +142,7 @@ public record TweaksConfig(
boolean swingEnabled = config.getBoolean("swing.enabled");
TweaksConfig.config = new TweaksConfig(
debug, metrics, locale,
metrics, debug, locale,
worldborderExpand, worldborderHide,
brandEnabled, brandText, brandShowPing, brandShowMspt,
doorDoubleOpen, doorKnocking,

View file

@ -49,8 +49,14 @@ public class KnockbackModule extends TweaksModule implements Listener {
modifiers.put(type, new Vector(mod, mod >= 1 ? mod : 1, mod)); // don't touch vertical
});
if (!modifiers.isEmpty())
if (!modifiers.isEmpty()) {
registerEvents(this);
try {
Class.forName("com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent");
DebugLogger.warning("Ignore that. Server performance will NOT be affected.");
} catch (ClassNotFoundException ignored) { }
}
}
@EventHandler

View file

@ -1,11 +1,12 @@
/*
* Copyright (C) 2024 Minecon724
* Copyright (C) 2025 Minecon724
* Tweaks724 is licensed under the GNU General Public License. See the LICENSE.md file
* in the project root for the full license text.
*/
package eu.m724.tweaks.redstone;
import eu.m724.tweaks.DebugLogger;
import eu.m724.tweaks.Language;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
@ -18,14 +19,21 @@ public class GatewayItem {
private final NamespacedKey gatewayKey;
public GatewayItem(Plugin plugin) {
this.gatewayKey = new NamespacedKey(plugin, "gateway");
var start = System.nanoTime();
this.gatewayKey = new NamespacedKey(plugin, "gateway");
var recipe = new ShapelessRecipe(gatewayKey, itemStack());
// this takes a long time for some reason. The first one especially
// do this somewhere off measure to JIT and skew the measurement: new RecipeChoice.MaterialChoice(Material.DIRT);
recipe.addIngredient(Material.NETHER_STAR);
recipe.addIngredient(Material.ENDER_CHEST);
recipe.addIngredient(Material.CHORUS_FLOWER);
recipe.addIngredient(Material.DAYLIGHT_DETECTOR);
plugin.getServer().addRecipe(recipe);
DebugLogger.finer("Adding the recipe took %d ms, which is a long time", (System.nanoTime() - start) / 1000000);
}
public ItemStack itemStack() {