merged chestEx into environmentex
All checks were successful
Gitea Actions Demo / Build-Gradle (push) Successful in 3m39s

This commit is contained in:
Your Name
2025-07-28 23:19:05 +02:00
parent e5edef0716
commit 7905dc816c
22 changed files with 344 additions and 438 deletions

View File

@@ -1,2 +0,0 @@
#Sun Jul 20 16:03:35 CEST 2025
gradle.version=8.14.2

View File

@@ -1,49 +0,0 @@
plugins {
`java-library`
id("io.papermc.paperweight.userdev") version "2.0.0-beta.14"
id("xyz.jpenilla.run-paper") version "2.3.1" // Adds runServer and runMojangMappedServer tasks for testing
}
group = "de.hessj.chestex"
version = "1.0-SNAPSHOT"
description = "chestex"
tasks.withType<Jar> {
destinationDirectory.set(file("../"))
}
dependencies {
//implementation(files("../craftbukkit.jar"))
implementation(files("../helper-1.0-SNAPSHOT.jar"))
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
}
tasks {
// Configure reobfJar to run when invoking the build task
assemble {
dependsOn(reobfJar)
}
compileJava {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
}
processResources {
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
val props = mapOf(
"name" to project.name,
"version" to project.version,
"description" to project.description,
"apiVersion" to "1.21"
)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
}
}

View File

@@ -1,5 +0,0 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
}
rootProject.name = "chestex"

View File

@@ -1,56 +0,0 @@
package de.hessj.chestex;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.RecipeChoice;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import net.kyori.adventure.text.Component;
import net.md_5.bungee.api.ChatColor;
public class App extends JavaPlugin {
public static App main;
public de.hessj.helper.Helper helper= new de.hessj.helper.Helper();
public NamespacedKey nskLockedChest = new NamespacedKey(this, "R3SLockedChest");
public NamespacedKey nskLockedChestRecipe = new NamespacedKey(this, "R3SLockedChestRecipe");
public ItemStack lockedChest;
@Override
public void onEnable() {
getLogger().info("Plugin enabled!");
main = this;
lockedChest = new ItemStack(Material.CHEST);
ItemMeta imlockedChest = lockedChest.getItemMeta();
imlockedChest.displayName(Component.translatable(ChatColor.AQUA + "Verschlossene Truhe"));
imlockedChest.getPersistentDataContainer().set(nskLockedChest, PersistentDataType.STRING, "R3S_LockedChest");
lockedChest.setItemMeta(imlockedChest);
ShapedRecipe safechestRecipe = new ShapedRecipe(nskLockedChestRecipe, lockedChest);
RecipeChoice rc = new RecipeChoice.MaterialChoice(Material.OAK_LOG, Material.SPRUCE_LOG, Material.BIRCH_LOG,
Material.JUNGLE_LOG, Material.ACACIA_LOG, Material.DARK_OAK_LOG);
safechestRecipe.shape("LLL", "LKL", "III");
safechestRecipe.setIngredient('L', rc);
safechestRecipe.setIngredient('K', Material.TRIPWIRE_HOOK);
safechestRecipe.setIngredient('I', Material.IRON_INGOT);
if (getServer().getRecipe(nskLockedChestRecipe) == null) {
App.main.getServer().addRecipe(safechestRecipe);
}
listenerRegistration();
}
@Override
public void onDisable() {
getLogger().info("Plugin disabled!");
}
private void listenerRegistration() {
PluginManager pM = Bukkit.getPluginManager();
pM.registerEvents(new SafeChestListener(), this);
}
}

View File

@@ -1,5 +0,0 @@
main: de.hessj.chestex.App
name: ChestExPlugin
version: 0.1
api-version: 1.21
depend: [HelperPlugin]

View File

@@ -1,2 +1,2 @@
Command: /opt/homebrew/Cellar/openjdk/23.0.2/libexec/openjdk.jdk/Contents/Home/bin/java -Xmx1G -classpath /Users/janik/.gradle/caches/modules-2/files-2.1/net.fabricmc/tiny-remapper/0.11.1/6c1f29838864ba8f495855edfc8ef17706fedb5d/tiny-remapper-0.11.1-fat.jar net.fabricmc.tinyremapper.Main /Users/janik/Desktop/MCPlugins/environmentex-1.0-SNAPSHOT.jar /Users/janik/Desktop/MCPlugins/environmentex/build/libs/environmentex-1.0-SNAPSHOT-reobf.jar /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/reobfMappings.tiny mojang spigot /Users/janik/Desktop/MCPlugins/environmentex/.gradle/caches/paperweight/taskCache/mappedServerJar.jar --threads=1
[INFO] Finished after 880,98 ms.
[INFO] Finished after 974,94 ms.

View File

@@ -650,7 +650,7 @@ code + .copy-button {
<script type="text/javascript">
function configurationCacheProblems() { return (
// begin-report-data
{"diagnostics":[{"locations":[{"path":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java"},{"taskPath":":compileJava"}],"problem":[{"text":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java verwendet oder überschreibt eine veraltete API."}],"severity":"ADVICE","problemDetails":[{"text":"Hinweis: /Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java verwendet oder überschreibt eine veraltete API."}],"contextualLabel":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java verwendet oder überschreibt eine veraltete API.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.filename","displayName":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java verwendet oder überschreibt eine veraltete API."}]},{"locations":[{"path":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/App.java"},{"taskPath":":compileJava"}],"problem":[{"text":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}],"severity":"ADVICE","problemDetails":[{"text":"Hinweis: Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}],"contextualLabel":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.recompile","displayName":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}]}],"problemsReport":{"totalProblemCount":2,"buildName":"environmentex","requestedTasks":"build","documentationLink":"https://docs.gradle.org/8.14.2/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
{"diagnostics":[{"locations":[{"path":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/MobHeads.java"},{"taskPath":":compileJava"}],"problem":[{"text":"Einige Eingabedateien verwenden oder überschreiben eine veraltete API."}],"severity":"ADVICE","problemDetails":[{"text":"Hinweis: Einige Eingabedateien verwenden oder überschreiben eine veraltete API."}],"contextualLabel":"Einige Eingabedateien verwenden oder überschreiben eine veraltete API.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.plural","displayName":"Einige Eingabedateien verwenden oder überschreiben eine veraltete API."}]},{"locations":[{"path":"/Users/janik/Desktop/MCPlugins/environmentex/src/main/java/de/hessj/environmentex/MobHeads.java"},{"taskPath":":compileJava"}],"problem":[{"text":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}],"severity":"ADVICE","problemDetails":[{"text":"Hinweis: Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}],"contextualLabel":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.recompile","displayName":"Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um Details zu erhalten."}]}],"problemsReport":{"totalProblemCount":2,"buildName":"environmentex","requestedTasks":"build","documentationLink":"https://docs.gradle.org/8.14.2/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
// end-report-data
);}
</script>

View File

@@ -59,7 +59,9 @@ public class App extends JavaPlugin {
public File tpYml = new File(this.getDataFolder() + "/texturepack.yml");
public FileConfiguration tpConfig = YamlConfiguration.loadConfiguration(tpYml);
public NamespacedKey nskLockedChest = new NamespacedKey(this, "R3SLockedChest");
public NamespacedKey nskLockedChestRecipe = new NamespacedKey(this, "R3SLockedChestRecipe");
public ItemStack lockedChest;
@Override
@@ -76,6 +78,26 @@ public class App extends JavaPlugin {
}
SquidPrevention.removeSquidReceipes();
SquidPrevention.addCustomSquidRecipes();
main = this;
lockedChest = new ItemStack(Material.CHEST);
ItemMeta imlockedChest = lockedChest.getItemMeta();
imlockedChest.displayName(Component.translatable(ChatColor.AQUA + "Verschlossene Truhe"));
imlockedChest.getPersistentDataContainer().set(nskLockedChest, PersistentDataType.STRING, "R3S_LockedChest");
lockedChest.setItemMeta(imlockedChest);
ShapedRecipe safechestRecipe = new ShapedRecipe(nskLockedChestRecipe, lockedChest);
RecipeChoice rc = new RecipeChoice.MaterialChoice(Material.OAK_LOG, Material.SPRUCE_LOG, Material.BIRCH_LOG,
Material.JUNGLE_LOG, Material.ACACIA_LOG, Material.DARK_OAK_LOG);
safechestRecipe.shape("LLL", "LKL", "III");
safechestRecipe.setIngredient('L', rc);
safechestRecipe.setIngredient('K', Material.TRIPWIRE_HOOK);
safechestRecipe.setIngredient('I', Material.IRON_INGOT);
if (getServer().getRecipe(nskLockedChestRecipe) == null) {
App.main.getServer().addRecipe(safechestRecipe);
}
getServer().recipeIterator().forEachRemaining(recipe -> {
if (recipe instanceof ShapelessRecipe) {
ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
@@ -94,7 +116,7 @@ public class App extends JavaPlugin {
}, 1000 * 20 / 1000, 1000 * 20 / 1000);
getLogger().info("Plugin enabled!");
main = this;
// if(App.main.getServer().getPort() == 25588){
@@ -460,6 +482,7 @@ public class App extends JavaPlugin {
pM.registerEvents(new SquidPrevention(), this);
pM.registerEvents(new EntityMuter(), this);
pM.registerEvents(new BetterHoes(), this);
pM.registerEvents(new ChestEx(), this);
getCommand("test").setExecutor(new EnvironmentExCommands());
getCommand("y").setExecutor(new EnvironmentExCommands());
getCommand("n").setExecutor(new EnvironmentExCommands());

View File

@@ -1,4 +1,4 @@
package de.hessj.chestex;
package de.hessj.environmentex;
import java.util.ArrayList;
import java.util.List;
@@ -23,7 +23,7 @@ import org.bukkit.persistence.PersistentDataType;
import de.hessj.helper.Helper.Type;
public class SafeChestListener implements Listener {
public class ChestEx implements Listener {
public Boolean lastPlacedIsSafeChest = false;
public de.hessj.helper.Helper helper= new de.hessj.helper.Helper();