fixed for v1.21.4

This commit is contained in:
System Administrator
2025-03-03 16:56:04 +01:00
parent 7589006e9d
commit 275397a319
40 changed files with 104 additions and 404 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -14,14 +14,14 @@
<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@@ -1,3 +1,3 @@
/Users/janik/Documents/MCPlugins/betterhoppers/src/main/java/de/hessj/betterhoppers/LoginListener.java
/Users/janik/Documents/MCPlugins/betterhoppers/src/main/java/de/hessj/betterhoppers/App.java
/Users/janik/Documents/MCPlugins/betterhoppers/src/main/java/de/hessj/betterhoppers/BetterHopperListener.java
/Users/janik/Documents/MCPlugins/betterhoppers/src/main/java/de/hessj/betterhoppers/LoginListener.java

View File

@@ -14,14 +14,14 @@
<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@@ -8,21 +8,22 @@
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies> <dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>mc-api</artifactId>
@@ -64,4 +65,6 @@
</plugin>
</plugins>
</build>
</project>

View File

@@ -5,6 +5,8 @@ import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.AbstractMap.SimpleEntry;
import java.util.Map.Entry;
import org.bukkit.Bukkit;
@@ -95,6 +97,21 @@ public class App extends JavaPlugin {
diamondDust = new ItemStack(Material.BARRIER);
ItemMeta mdiamondDust = diamondDust.getItemMeta();
mdiamondDust.setCustomModelData(1000010);
/*
CustomModelDataComponent cmdc4 = mdiamondDust.getCustomModelDataComponent();
List<String> list4 = Arrays.asList("diamond_dust");
cmdc4.setStrings(list4);
mdiamondDust.setCustomModelDataComponent(cmdc4);
*/
mdiamondDust.displayName(Component.translatable(ChatColor.WHITE + "Diamant-Staub"));
mdiamondDust.getPersistentDataContainer().set(nskdiamondDust, PersistentDataType.STRING, "R3SDiamondDust");
diamondDust.setItemMeta(mdiamondDust);

View File

@@ -1,7 +1,7 @@
main: de.hessj.dailyquests.App
name: DailyQuestsPlugin
version: 0.1
api-version: 1.19
api-version: 1.21
depend: [HelperPlugin]
commands:

View File

@@ -1,5 +1,5 @@
#Generated by Maven
#Tue Sep 10 15:22:29 CEST 2024
#Mon Mar 03 16:42:06 CET 2025
artifactId=dailyquests
groupId=de.hessj.dailyquests
version=1.0-SNAPSHOT

View File

@@ -1,3 +1,3 @@
/Users/janik/Documents/MCPlugins/dailyquests/src/main/java/de/hessj/dailyquests/DailyQuestsCommands.java
/Users/janik/Documents/MCPlugins/dailyquests/src/main/java/de/hessj/dailyquests/App.java
/Users/janik/Documents/MCPlugins/dailyquests/src/main/java/de/hessj/dailyquests/DailyQuestsCommands.java
/Users/janik/Documents/MCPlugins/dailyquests/src/main/java/de/hessj/dailyquests/DailyQuestsListeners.java

Binary file not shown.

View File

@@ -1,6 +1,6 @@
plugins {
`java-library`
id("io.papermc.paperweight.userdev") version "1.7.2"
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.environmentex"
@@ -11,9 +11,7 @@ description = "environmentex"
dependencies {
implementation(files("/Users/janik/Documents/MCPlugins/craftbukkit-1.21.1.jar"))
implementation(files("/Users/janik/Desktop/helper-1.0-SNAPSHOT.jar"))
paperweight.paperDevBundle("1.21.1-R0.1-SNAPSHOT")
// paperweight.foliaDevBundle("1.20.1-R0.1-SNAPSHOT")
// paperweight.devBundle("com.example.paperfork", "1.20.1-R0.1-SNAPSHOT")
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
}
tasks {

Binary file not shown.

246
environmentex/gradlew vendored
View File

@@ -1,246 +0,0 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

View File

@@ -1,92 +0,0 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,16 +1,21 @@
package de.hessj.environmentex;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.GameRule;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import net.kyori.adventure.text.Component;
import net.md_5.bungee.api.ChatColor;
import net.minecraft.world.item.component.CustomModelData;
import org.bukkit.NamespacedKey;
import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.block.Biome;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
@@ -21,9 +26,10 @@ import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.inventory.RecipeChoice.MaterialChoice;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.components.CustomModelDataComponent;
import org.bukkit.persistence.PersistentDataType;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -75,10 +81,19 @@ public class App extends JavaPlugin {
getLogger().info("Plugin enabled!");
main = this;
backPack = new ItemStack(Material.BARRIER, 1);
ItemMeta im = backPack.getItemMeta();
im.displayName(Component.translatable(ChatColor.WHITE + "Kleiner Rucksack"));
im.setCustomModelData(1000012);
CustomModelDataComponent cmdc = im.getCustomModelDataComponent();
List<String> list = Arrays.asList("backpack_1");
cmdc.setStrings(list);
im.setCustomModelDataComponent(cmdc);
nsk = new NamespacedKey(App.main, "key" + "R3SLeatherBackpack");
im.getPersistentDataContainer().set(nsk, PersistentDataType.STRING, "R3S_kleiner_Rucksack");
backPack.setItemMeta(im);
@@ -95,6 +110,10 @@ public class App extends JavaPlugin {
ItemMeta im2 = backPack2.getItemMeta();
im2.displayName(Component.translatable(ChatColor.WHITE + "Rucksack"));
im2.setCustomModelData(1000013);
CustomModelDataComponent cmdc2 = im2.getCustomModelDataComponent();
List<String> list2 = Arrays.asList("backpack_2");
cmdc2.setStrings(list2);
im2.setCustomModelDataComponent(cmdc2);
nsk2 = new NamespacedKey(App.main, "key" + "R3SBackpack");
im2.getPersistentDataContainer().set(nsk2, PersistentDataType.STRING, "R3S_Rucksack");
backPack2.setItemMeta(im2);
@@ -112,6 +131,10 @@ public class App extends JavaPlugin {
ItemMeta im3 = backPack3.getItemMeta();
im3.displayName(Component.translatable(ChatColor.WHITE + "Großer Rucksack"));
im3.setCustomModelData(1000014);
CustomModelDataComponent cmdc3 = im3.getCustomModelDataComponent();
List<String> list3 = Arrays.asList("backpack_3");
cmdc3.setStrings(list3);
im3.setCustomModelDataComponent(cmdc3);
nsk3 = new NamespacedKey(App.main, "key" + "R3SGoldBackpack");
im3.getPersistentDataContainer().set(nsk3, PersistentDataType.STRING, "R3S_großer_Rucksack");
backPack3.setItemMeta(im3);
@@ -127,6 +150,10 @@ public class App extends JavaPlugin {
ItemMeta im4 = backPack4.getItemMeta();
im4.displayName(Component.translatable(ChatColor.WHITE + "Riesiger Rucksack"));
im4.setCustomModelData(1000015);
CustomModelDataComponent cmdc4 = im4.getCustomModelDataComponent();
List<String> list4 = Arrays.asList("backpack_4");
cmdc4.setStrings(list4);
im4.setCustomModelDataComponent(cmdc4);
nsk4 = new NamespacedKey(App.main, "key" + "R3SDiamondBackpack");
im4.getPersistentDataContainer().set(nsk4, PersistentDataType.STRING, "R3S_riesiger_Rucksack");
backPack4.setItemMeta(im4);
@@ -352,36 +379,37 @@ public class App extends JavaPlugin {
public static String getWeather(Player p) {
Boolean snow = false;
Boolean desert = false;
switch (Bukkit.getWorlds().get(0).getBiome(p.getLocation())) {
case DESERT:
switch (Bukkit.getWorlds().get(0).getBiome(p.getLocation()).toString()) {
case "DESERT":
desert = true;
break;
case FROZEN_PEAKS:
case "FROZEN_PEAKS":
snow = true;
break;
case FROZEN_RIVER:
case "FROZEN_RIVER":
snow = true;
break;
case GROVE:
case "GROVE":
snow = true;
break;
case ICE_SPIKES:
case "ICE_SPIKES":
snow = true;
break;
case JAGGED_PEAKS:
case "JAGGED_PEAKS":
snow = true;
break;
case SNOWY_BEACH:
case "SNOWY_BEACH":
snow = true;
break;
case SNOWY_PLAINS:
case "SNOWY_PLAINS":
snow = true;
break;
case SNOWY_SLOPES:
case "SNOWY_SLOPES":
snow = true;
break;
case SNOWY_TAIGA:
case "SNOWY_TAIGA":
snow = true;
break;
default:
@@ -446,7 +474,7 @@ public class App extends JavaPlugin {
pM.registerEvents(new AFKListener(), this);
pM.registerEvents(new CauldronConcrete(), this);
pM.registerEvents(new InfinityWaterBucket(), this);
pM.registerEvents(new ArmoredElytra(), this);
//TODO pM.registerEvents(new ArmoredElytra(), this);
pM.registerEvents(new ShulkerPreview(), this);
pM.registerEvents(new BetterTotems(), this);

View File

@@ -26,7 +26,7 @@ import net.kyori.adventure.text.format.TextDecoration;
public class ArmoredElytra implements Listener {
private final List <String> CHESTPLATES = Arrays.asList("LEATHER_CHESTPLATE","IRON_CHESTPLATE","DIAMOND_CHESTPLATE","NETHERITE_CHESTPLATE","GOLDEN_CHESTPLATE","CHAINMAIL_CHESTPLATE");
//TODO: test if elytra armor works
@EventHandler
public void onElytraCombine(PrepareAnvilEvent e){
@@ -74,36 +74,36 @@ public class ArmoredElytra implements Listener {
}
if(chestPlateMeta.hasAttributeModifiers()){
if(chestPlateMeta.getAttributeModifiers(Attribute.GENERIC_ARMOR) != null){
if(chestPlateMeta.getAttributeModifiers(Attribute.ARMOR) != null){
armor=0;
for(AttributeModifier modifier : chestPlateMeta.getAttributeModifiers(Attribute.GENERIC_ARMOR)){
for(AttributeModifier modifier : chestPlateMeta.getAttributeModifiers(Attribute.ARMOR)){
armor = (int) modifier.getAmount();
}
}
if(chestPlateMeta.getAttributeModifiers(Attribute.GENERIC_ARMOR_TOUGHNESS) != null){
if(chestPlateMeta.getAttributeModifiers(Attribute.ARMOR_TOUGHNESS) != null){
toughness=0;
for(AttributeModifier modifier : chestPlateMeta.getAttributeModifiers(Attribute.GENERIC_ARMOR_TOUGHNESS)){
for(AttributeModifier modifier : chestPlateMeta.getAttributeModifiers(Attribute.ARMOR_TOUGHNESS)){
toughness = (int) modifier.getAmount();
}
}
if(chestPlateMeta.getAttributeModifiers(Attribute.GENERIC_KNOCKBACK_RESISTANCE) != null){
if(chestPlateMeta.getAttributeModifiers(Attribute.KNOCKBACK_RESISTANCE) != null){
knockbackres=0;
for(AttributeModifier modifier : chestPlateMeta.getAttributeModifiers(Attribute.GENERIC_KNOCKBACK_RESISTANCE)){
for(AttributeModifier modifier : chestPlateMeta.getAttributeModifiers(Attribute.KNOCKBACK_RESISTANCE)){
knockbackres = (int) modifier.getAmount();
}
}
}
if(armor != 0){
AttributeModifier mod = new AttributeModifier(UUID.randomUUID(), "generic.armor", armor, Operation.ADD_NUMBER, EquipmentSlot.CHEST);
meta.addAttributeModifier(Attribute.GENERIC_ARMOR, mod);
AttributeModifier mod = new AttributeModifier(UUID.randomUUID(), "armor", armor, Operation.ADD_NUMBER, EquipmentSlot.CHEST);
meta.addAttributeModifier(Attribute.ARMOR, mod);
}
if(toughness != 0){
AttributeModifier mod = new AttributeModifier(UUID.randomUUID(), "generic.armor_toughness", toughness, Operation.ADD_NUMBER, EquipmentSlot.CHEST);
meta.addAttributeModifier(Attribute.GENERIC_ARMOR_TOUGHNESS, mod);
AttributeModifier mod = new AttributeModifier(UUID.randomUUID(), "armor_toughness", toughness, Operation.ADD_NUMBER, EquipmentSlot.CHEST);
meta.addAttributeModifier(Attribute.ARMOR_TOUGHNESS, mod);
}
if(knockbackres != 0){
AttributeModifier mod = new AttributeModifier(UUID.randomUUID(), "generic.knockback_resistance", knockbackres, Operation.ADD_NUMBER, EquipmentSlot.CHEST);
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, mod);
AttributeModifier mod = new AttributeModifier(UUID.randomUUID(), "knockback_resistance", knockbackres, Operation.ADD_NUMBER, EquipmentSlot.CHEST);
meta.addAttributeModifier(Attribute.KNOCKBACK_RESISTANCE, mod);
}
for(Enchantment ench : item2.getEnchantments().keySet()){
enchants.put(ench, item2.getEnchantments().get(ench));

View File

@@ -59,7 +59,7 @@ public class HealthBarListener implements Listener {
&& en.getType() != EntityType.PLAYER && en.getType() != EntityType.ARMOR_STAND) {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
setBarString(en.getHealth(), en.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(), e.getDamage(), en);
setBarString(en.getHealth(), en.getAttribute(Attribute.MAX_HEALTH).getValue(), e.getDamage(), en);
}, (long) 1 * 1L);
}

View File

@@ -14,14 +14,14 @@
<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@@ -1,5 +1,5 @@
#Generated by Maven
#Tue Sep 10 15:00:22 CEST 2024
#Mon Mar 03 12:55:49 CET 2025
artifactId=helper
groupId=de.hessj.helper
version=1.0-SNAPSHOT

View File

@@ -1,4 +1,3 @@
de/hessj/helper/App.class
de/hessj/helper/Helper$1.class
de/hessj/helper/Helper$Type.class
de/hessj/helper/Helper.class

View File

@@ -14,14 +14,14 @@
<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@@ -1,5 +0,0 @@
#Generated by Maven
#Tue Sep 10 15:20:40 CEST 2024
artifactId=pokeballs
groupId=de.hessj.pokeballs
version=1.0-SNAPSHOT

View File

@@ -1,3 +1 @@
de/hessj/pokeballs/App.class
de/hessj/pokeballs/PokeballsListeners$1.class
de/hessj/pokeballs/PokeballsListeners.class

View File

@@ -1,2 +1,2 @@
/Users/janik/Documents/MCPlugins/pokeballs/src/main/java/de/hessj/pokeballs/PokeballsListeners.java
/Users/janik/Documents/MCPlugins/pokeballs/src/main/java/de/hessj/pokeballs/App.java
/Users/janik/Documents/MCPlugins/pokeballs/src/main/java/de/hessj/pokeballs/PokeballsListeners.java