Update Feb 2nd 2023

This commit is contained in:
Paul Reilly 2023-03-05 22:35:52 -06:00
parent 0195469165
commit 839990554e
21 changed files with 377 additions and 325 deletions

View File

@ -0,0 +1,17 @@
barrier: true
bedrock: true
bell: true
crying_obsidian: true
dragon_egg: true
eggs: true
elytra: true
end_frame: true
horse_armor: true
music_discs: true
name_tag: true
nether_star: true
nether_wart: true
saddle: true
spawner: true
totem: true
trident: true

View File

@ -0,0 +1,16 @@
name: Uncraftables
main: io.github.paldiu.Uncraftables
version: 1.2.0
author: Paldiu
description: Adds in crafting recipes for uncraftable items.
api-version: 1.19
commands:
reload:
description: Reloads the plugin.
permission: uncraftables.reload
permissions:
uncraftables.reload:
description: Allows the user to reload the plugin.
default: op

Binary file not shown.

View File

@ -0,0 +1,2 @@
Manifest-Version: 1.0

263
gradlew vendored
View File

@ -1,7 +1,7 @@
#!/bin/sh #!/usr/bin/env sh
# #
# Copyright © 2015-2021 the original authors. # Copyright 2015 the original author or authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,101 +17,67 @@
# #
############################################################################## ##############################################################################
# ##
# Gradle start up script for POSIX generated by Gradle. ## Gradle start up script for UN*X
# ##
# 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/master/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 # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
app_path=$0 PRG="$0"
# Need this for relative symlinks.
# Need this for daisy-chained symlinks. while [ -h "$PRG" ] ; do
while ls=`ls -ld "$PRG"`
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path link=`expr "$ls" : '.*-> \(.*\)$'`
[ -h "$app_path" ] if expr "$link" : '/.*' > /dev/null; then
do PRG="$link"
ls=$( ls -ld "$app_path" ) else
link=${ls#*' -> '} PRG=`dirname "$PRG"`"/$link"
case $link in #( fi
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done done
SAVED="`pwd`"
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" APP_NAME="Gradle"
APP_BASE_NAME=${0##*/} APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # 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"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD="maximum"
warn () { warn () {
echo "$*" echo "$*"
} >&2 }
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} >&2 }
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "$( uname )" in #( case "`uname`" in
CYGWIN* ) cygwin=true ;; #( CYGWIN* )
Darwin* ) darwin=true ;; #( cygwin=true
MSYS* | MINGW* ) msys=true ;; #( ;;
NONSTOP* ) nonstop=true ;; Darwin* )
darwin=true
;;
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@ -121,9 +87,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java JAVACMD="$JAVA_HOME/jre/sh/java"
else else
JAVACMD=$JAVA_HOME/bin/java JAVACMD="$JAVA_HOME/bin/java"
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -132,7 +98,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD=java JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 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 Please set the JAVA_HOME variable in your environment to match the
@ -140,101 +106,80 @@ location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
case $MAX_FD in #( MAX_FD_LIMIT=`ulimit -H -n`
max*) if [ $? -eq 0 ] ; then
MAX_FD=$( ulimit -H -n ) || if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
warn "Could not query maximum file descriptor limit" MAX_FD="$MAX_FD_LIMIT"
esac fi
case $MAX_FD in #( ulimit -n $MAX_FD
'' | soft) :;; #( if [ $? -ne 0 ] ; then
*) warn "Could not set maximum file descriptor limit: $MAX_FD"
ulimit -n "$MAX_FD" || fi
warn "Could not set maximum file descriptor limit to $MAX_FD" else
esac warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi fi
# Collect all arguments for the java command, stacking in reverse order: # For Darwin, add options to specify how the application appears in the dock
# * args from the command line if $darwin; then
# * the main class name GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
# * -classpath fi
# * -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 # For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=$( cygpath --unix "$JAVACMD" ) JAVACMD=`cygpath --unix "$JAVACMD"`
# Now convert the arguments - kludge to limit ourselves to /bin/sh # We build the pattern for arguments to be converted via cygpath
for arg do ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
if SEP=""
case $arg in #( for dir in $ROOTDIRSRAW ; do
-*) false ;; # don't mess with options #( ROOTDIRS="$ROOTDIRS$SEP$dir"
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath SEP="|"
[ -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 done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi fi
# Collect all arguments for the java command; # Escape application args
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of save () {
# shell script including quotes and variable substitutions, so put them in for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
# double quotes to make sure that they get re-expanded; and echo " "
# * put everything else in single quotes, so that it's not re-expanded. }
APP_ARGS=`save "$@"`
set -- \ # Collect all arguments for the java command, following the shell quoting and substitution rules
"-Dorg.gradle.appname=$APP_BASE_NAME" \ eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-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" "$@" exec "$JAVACMD" "$@"

10
gradlew.bat vendored
View File

@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute if "%ERRORLEVEL%" == "0" goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -75,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd if "%ERRORLEVEL%"=="0" goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL% if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
if %EXIT_CODE% equ 0 set EXIT_CODE=1 exit /b 1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal

View File

@ -1,61 +0,0 @@
package io.github.paldiu;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.inventory.CraftingInventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import org.bukkit.plugin.Plugin;
public class CraftingListener implements Listener {
public CraftingListener(Plugin instance) {
instance.getServer().getPluginManager().registerEvents(this, instance);
}
@EventHandler
public void preCraftEvent(PrepareItemCraftEvent e) {
final Recipe recipe = e.getRecipe();
if (recipe == null) { return; }
final ItemStack result = recipe.getResult();
final CraftingInventory inv = e.getInventory();
if (e.isRepair()) { return; }
if (result.getType().equals(Material.NETHER_WART)) {
result.setAmount(9);
inv.setResult(result);
}
if (result.getType().equals(Material.CRYING_OBSIDIAN)) {
result.setAmount(2);
inv.setResult(result);
}
if (result.getType().equals(Material.BEDROCK)) {
result.setAmount(4);
inv.setResult(result);
}
}
@EventHandler
public void craftEvent(CraftItemEvent e) {
final ItemStack result = e.getRecipe().getResult();
final CraftingInventory inv = e.getInventory();
if (result.getType().equals(Material.NETHER_WART)) {
result.setAmount(9);
inv.setResult(result);
}
if (result.getType().equals(Material.CRYING_OBSIDIAN)) {
result.setAmount(2);
inv.setResult(result);
}
if (result.getType().equals(Material.BEDROCK)) {
result.setAmount(4);
inv.setResult(result);
}
}
}

View File

@ -1,13 +1,17 @@
package io.github.paldiu; package io.github.paldiu;
import io.github.paldiu.config.ItemMetaSupplier;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe; import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe; import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.function.Supplier;
public class CraftingUtils { public class CraftingUtils {
private final Uncraftables plugin; private final Uncraftables plugin;
@ -26,8 +30,34 @@ public class CraftingUtils {
return new ShapedRecipe(newKey(key), is); return new ShapedRecipe(newKey(key), is);
} }
public final @NotNull ShapedRecipe shaped(Material result, int amount, String key) {
ItemStack is = new ItemStack(result);
is.setAmount(amount);
return new ShapedRecipe(newKey(key), is);
}
public final @NotNull ShapedRecipe shaped(Material result, int amount, String key, ItemMetaSupplier customData) {
ItemStack is = new ItemStack(result);
is.setAmount(amount);
is.setItemMeta(customData.getFrom(is));
return new ShapedRecipe(newKey(key), is);
}
public final @NotNull ShapelessRecipe shapeless(Material result, String key) { public final @NotNull ShapelessRecipe shapeless(Material result, String key) {
ItemStack is = new ItemStack(result); ItemStack is = new ItemStack(result);
return new ShapelessRecipe(newKey(key), is); return new ShapelessRecipe(newKey(key), is);
} }
public final @NotNull ShapelessRecipe shapeless(Material result, int amount, String key) {
ItemStack is = new ItemStack(result);
is.setAmount(amount);
return new ShapelessRecipe(newKey(key), is);
}
public final @NotNull ShapelessRecipe shapeless(Material result, int amount, String key, ItemMetaSupplier customData) {
ItemStack is = new ItemStack(result);
is.setAmount(amount);
is.setItemMeta(customData.getFrom(is));
return new ShapelessRecipe(newKey(key), is);
}
} }

View File

@ -26,7 +26,6 @@ public class Uncraftables extends JavaPlugin {
Bukkit.getLogger().info("[Uncraftables] Successfully enabled bStats metrics!"); Bukkit.getLogger().info("[Uncraftables] Successfully enabled bStats metrics!");
register(); register();
new CraftingListener(this);
Bukkit.getLogger().info("[Uncraftables] successfully loaded all recipes."); Bukkit.getLogger().info("[Uncraftables] successfully loaded all recipes.");
new ReloadCMD(this); new ReloadCMD(this);
@ -51,6 +50,7 @@ public class Uncraftables extends JavaPlugin {
new NameTagRecipe(this); new NameTagRecipe(this);
new NetherStarRecipe(this); new NetherStarRecipe(this);
new NetherWartRecipe(this); new NetherWartRecipe(this);
new PhantomMembraneRecipe(this);
new SaddleRecipe(this); new SaddleRecipe(this);
new SpawnerRecipe(this); new SpawnerRecipe(this);
new TotemRecipe(this); new TotemRecipe(this);

View File

@ -76,4 +76,16 @@ public class ConfigValues {
public boolean tridentEnabled() { public boolean tridentEnabled() {
return plugin.getYamlWrapper().getBoolean("trident"); return plugin.getYamlWrapper().getBoolean("trident");
} }
public boolean membraneEnabled() {
return plugin.getYamlWrapper().getBoolean("membrane");
}
public boolean cobWebEnabled() {
return plugin.getYamlWrapper().getBoolean("cobweb");
}
public boolean witherSkullEnabled() {
return plugin.getYamlWrapper().getBoolean("wither_skull");
}
} }

View File

@ -0,0 +1,9 @@
package io.github.paldiu.config;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@FunctionalInterface
public interface ItemMetaSupplier {
ItemMeta getFrom(ItemStack itemStack);
}

View File

@ -2,6 +2,7 @@ package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables; import io.github.paldiu.Uncraftables;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe; import org.bukkit.inventory.ShapelessRecipe;
public class BedrockRecipe extends Craftable { public class BedrockRecipe extends Craftable {
@ -10,15 +11,11 @@ public class BedrockRecipe extends Craftable {
if (!getConfigValues().bedrockEnabled()) return; if (!getConfigValues().bedrockEnabled()) return;
ShapelessRecipe recipe = getUtil().shapeless(Material.BEDROCK, "bedrock_recipe"); ShapedRecipe recipe = getUtil().shaped(Material.BEDROCK, 4, "bedrock_recipe");
recipe.addIngredient(2, Material.OBSIDIAN); recipe.shape("dod", "ono", "dod");
recipe.addIngredient(2, Material.STONE); recipe.setIngredient('d', Material.DIAMOND_BLOCK);
recipe.addIngredient(1, Material.DIAMOND); recipe.setIngredient('o', Material.OBSIDIAN);
recipe.addIngredient(1, Material.IRON_INGOT); recipe.setIngredient('n', Material.NETHERITE_BLOCK);
recipe.addIngredient(1, Material.COAL);
recipe.addIngredient(1, Material.WATER_BUCKET);
recipe.addIngredient(1, Material.LAVA_BUCKET);
recipe.getResult().setAmount(4);
getPlugin().getServer().addRecipe(recipe); getPlugin().getServer().addRecipe(recipe);
} }
} }

View File

@ -0,0 +1,17 @@
package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables;
import org.bukkit.Material;
import org.bukkit.inventory.ShapelessRecipe;
public class CobWebRecipe extends Craftable {
public CobWebRecipe(Uncraftables plugin) {
super(plugin);
if (!getConfigValues().cobWebEnabled()) return;
ShapelessRecipe cobweb = getUtil().shapeless(Material.COBWEB, 2, "cobweb_recipe");
cobweb.addIngredient(9, Material.STRING);
getPlugin().getServer().addRecipe(cobweb);
}
}

View File

@ -2,6 +2,7 @@ package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables; import io.github.paldiu.Uncraftables;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe; import org.bukkit.inventory.ShapelessRecipe;
public class CryingObsidianRecipe extends Craftable { public class CryingObsidianRecipe extends Craftable {
@ -10,10 +11,11 @@ public class CryingObsidianRecipe extends Craftable {
if (!getConfigValues().cryingObsidianEnabled()) return; if (!getConfigValues().cryingObsidianEnabled()) return;
ShapelessRecipe recipe = getUtil().shapeless(Material.CRYING_OBSIDIAN, "crying_obsidian_recipe"); ShapedRecipe recipe = getUtil().shaped(Material.CRYING_OBSIDIAN, 2, "crying_obsidian_recipe");
recipe.addIngredient(1, Material.OBSIDIAN); recipe.shape("aga", "gog", "aga");
recipe.addIngredient(4, Material.GHAST_TEAR); recipe.setIngredient('a', Material.AIR);
recipe.getResult().setAmount(2); recipe.setIngredient('o', Material.OBSIDIAN);
recipe.setIngredient('g', Material.GHAST_TEAR);
getPlugin().getServer().addRecipe(recipe); getPlugin().getServer().addRecipe(recipe);
} }
} }

View File

@ -13,7 +13,7 @@ public class DragonEggRecipe extends Craftable {
ShapedRecipe recipe = getUtil().shaped(Material.DRAGON_EGG, "dragon_egg_recipe"); ShapedRecipe recipe = getUtil().shaped(Material.DRAGON_EGG, "dragon_egg_recipe");
recipe.shape("obo", "beb", "obo"); recipe.shape("obo", "beb", "obo");
recipe.setIngredient('o', Material.OBSIDIAN); recipe.setIngredient('o', Material.CRYING_OBSIDIAN);
recipe.setIngredient('b', Material.DRAGON_BREATH); recipe.setIngredient('b', Material.DRAGON_BREATH);
recipe.setIngredient('e', Material.DRAGON_HEAD); recipe.setIngredient('e', Material.DRAGON_HEAD);
getPlugin().getServer().addRecipe(recipe); getPlugin().getServer().addRecipe(recipe);

View File

@ -2,8 +2,12 @@ package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables; import io.github.paldiu.Uncraftables;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe; import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe; import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SpawnEggMeta;
public class EggRecipes extends Craftable { public class EggRecipes extends Craftable {
public EggRecipes(Uncraftables plugin) { public EggRecipes(Uncraftables plugin) {
@ -31,6 +35,7 @@ public class EggRecipes extends Craftable {
pandaEgg(); pandaEgg();
phantomEgg(); phantomEgg();
piglinEgg(); piglinEgg();
piglinBruteEgg();
pillagerEgg(); pillagerEgg();
polarBearEgg(); polarBearEgg();
ravagerEgg(); ravagerEgg();
@ -119,7 +124,7 @@ public class EggRecipes extends Craftable {
dolphin.shape("aca", "wew", "aca"); dolphin.shape("aca", "wew", "aca");
dolphin.setIngredient('a', Material.AIR); dolphin.setIngredient('a', Material.AIR);
dolphin.setIngredient('w', Material.WATER_BUCKET); dolphin.setIngredient('w', Material.WATER_BUCKET);
dolphin.setIngredient('c', Material.COD); dolphin.setIngredient('c', Material.TROPICAL_FISH);
dolphin.setIngredient('e', Material.EGG); dolphin.setIngredient('e', Material.EGG);
getPlugin().getServer().addRecipe(dolphin); getPlugin().getServer().addRecipe(dolphin);
} }
@ -129,24 +134,30 @@ public class EggRecipes extends Craftable {
drowned.shape("awa", "fef", "awa"); drowned.shape("awa", "fef", "awa");
drowned.setIngredient('a', Material.AIR); drowned.setIngredient('a', Material.AIR);
drowned.setIngredient('w', Material.WATER_BUCKET); drowned.setIngredient('w', Material.WATER_BUCKET);
drowned.setIngredient('f', Material.FISHING_ROD); drowned.setIngredient('f', Material.KELP);
drowned.setIngredient('e', Material.ZOMBIE_SPAWN_EGG); drowned.setIngredient('e', Material.ZOMBIE_SPAWN_EGG);
getPlugin().getServer().addRecipe(drowned); getPlugin().getServer().addRecipe(drowned);
} }
private void elderGuardEgg() { private void elderGuardEgg() {
ShapedRecipe eldGuard = getUtil().shaped(Material.ELDER_GUARDIAN_SPAWN_EGG, "elder_guardian_egg_recipe"); ShapedRecipe eldGuard = getUtil().shaped(Material.ELDER_GUARDIAN_SPAWN_EGG, "elder_guardian_egg_recipe");
eldGuard.shape("apa","ses","apa"); eldGuard.shape(
eldGuard.setIngredient('a', Material.AIR); "sbs",
"pep",
"sps");
eldGuard.setIngredient('s', Material.PRISMARINE_CRYSTALS);
eldGuard.setIngredient('p', Material.PRISMARINE_SHARD); eldGuard.setIngredient('p', Material.PRISMARINE_SHARD);
eldGuard.setIngredient('e', Material.GUARDIAN_SPAWN_EGG); eldGuard.setIngredient('e', Material.GUARDIAN_SPAWN_EGG);
eldGuard.setIngredient('s', Material.SPONGE); eldGuard.setIngredient('b', Material.BEACON);
getPlugin().getServer().addRecipe(eldGuard); getPlugin().getServer().addRecipe(eldGuard);
} }
private void endermanEgg() { private void endermanEgg() {
ShapedRecipe enderman = getUtil().shaped(Material.ENDERMAN_SPAWN_EGG, "enderman_egg_recipe"); ShapedRecipe enderman = getUtil().shaped(Material.ENDERMAN_SPAWN_EGG, "enderman_egg_recipe");
enderman.shape("apa","pep","apa"); enderman.shape(
"apa",
"pep",
"apa");
enderman.setIngredient('a', Material.AIR); enderman.setIngredient('a', Material.AIR);
enderman.setIngredient('p', Material.ENDER_PEARL); enderman.setIngredient('p', Material.ENDER_PEARL);
enderman.setIngredient('e', Material.EGG); enderman.setIngredient('e', Material.EGG);
@ -213,19 +224,19 @@ public class EggRecipes extends Craftable {
private void huskEgg() { private void huskEgg() {
ShapedRecipe husk = getUtil().shaped(Material.HUSK_SPAWN_EGG, "husk_egg_recipe"); ShapedRecipe husk = getUtil().shaped(Material.HUSK_SPAWN_EGG, "husk_egg_recipe");
husk.shape("asa","rer","asa"); husk.shape("asa", "ses", "asa");
husk.setIngredient('a', Material.AIR); husk.setIngredient('a', Material.AIR);
husk.setIngredient('s', Material.SAND); husk.setIngredient('s', Material.SAND);
husk.setIngredient('e', Material.ZOMBIE_SPAWN_EGG); husk.setIngredient('e', Material.ZOMBIE_SPAWN_EGG);
husk.setIngredient('r', Material.ROTTEN_FLESH);
getPlugin().getServer().addRecipe(husk); getPlugin().getServer().addRecipe(husk);
} }
private void llamaEgg() { private void llamaEgg() {
ShapedRecipe llama = getUtil().shaped(Material.LLAMA_SPAWN_EGG, "llama_egg_recipe"); ShapedRecipe llama = getUtil().shaped(Material.LLAMA_SPAWN_EGG, "llama_egg_recipe");
llama.shape("aca","lel","aca"); llama.shape("aca", "lel", "ana");
llama.setIngredient('a', Material.AIR); llama.setIngredient('a', Material.AIR);
llama.setIngredient('c', Material.WHITE_CARPET); llama.setIngredient('c', Material.WHITE_CARPET);
llama.setIngredient('n', Material.IRON_NUGGET);
llama.setIngredient('e', Material.EGG); llama.setIngredient('e', Material.EGG);
llama.setIngredient('l', Material.LEATHER); llama.setIngredient('l', Material.LEATHER);
getPlugin().getServer().addRecipe(llama); getPlugin().getServer().addRecipe(llama);
@ -236,7 +247,7 @@ public class EggRecipes extends Craftable {
magma_cube.shape("scs", "cec", "scs"); magma_cube.shape("scs", "cec", "scs");
magma_cube.setIngredient('s', Material.SOUL_SOIL); magma_cube.setIngredient('s', Material.SOUL_SOIL);
magma_cube.setIngredient('c', Material.MAGMA_CREAM); magma_cube.setIngredient('c', Material.MAGMA_CREAM);
magma_cube.setIngredient('e', Material.EGG); magma_cube.setIngredient('e', Material.SLIME_SPAWN_EGG);
getPlugin().getServer().addRecipe(magma_cube); getPlugin().getServer().addRecipe(magma_cube);
} }
@ -268,12 +279,23 @@ public class EggRecipes extends Craftable {
getPlugin().getServer().addRecipe(piglin); getPlugin().getServer().addRecipe(piglin);
} }
private void piglinBruteEgg() {
ShapedRecipe piglin_brute = getUtil().shaped(Material.PIGLIN_BRUTE_SPAWN_EGG, "piglin_brute_egg_recipe");
piglin_brute.shape("sgs", "ael", "sgs");
piglin_brute.setIngredient('s', Material.SOUL_SOIL);
piglin_brute.setIngredient('a', Material.GOLDEN_AXE);
piglin_brute.setIngredient('l', Material.LEATHER);
piglin_brute.setIngredient('g', Material.GOLD_INGOT);
piglin_brute.setIngredient('e', Material.PIGLIN_SPAWN_EGG);
}
private void pillagerEgg() { private void pillagerEgg() {
ShapedRecipe pillager = getUtil().shaped(Material.PILLAGER_SPAWN_EGG, "pillager_egg_recipe"); ShapedRecipe pillager = getUtil().shaped(Material.PILLAGER_SPAWN_EGG, "pillager_egg_recipe");
pillager.shape("aca","*e*","aca"); pillager.shape("aca", "wew", "ada");
pillager.setIngredient('a', Material.AIR); pillager.setIngredient('a', Material.AIR);
pillager.setIngredient('c', Material.CROSSBOW); pillager.setIngredient('c', Material.CROSSBOW);
pillager.setIngredient('*', Material.ARROW); pillager.setIngredient('d', Material.EMERALD);
pillager.setIngredient('w', Material.ARROW);
pillager.setIngredient('e', Material.VILLAGER_SPAWN_EGG); pillager.setIngredient('e', Material.VILLAGER_SPAWN_EGG);
getPlugin().getServer().addRecipe(pillager); getPlugin().getServer().addRecipe(pillager);
} }
@ -290,9 +312,10 @@ public class EggRecipes extends Craftable {
private void ravagerEgg() { private void ravagerEgg() {
ShapedRecipe ravager = getUtil().shaped(Material.RAVAGER_SPAWN_EGG, "ravager_egg_recipe"); ShapedRecipe ravager = getUtil().shaped(Material.RAVAGER_SPAWN_EGG, "ravager_egg_recipe");
ravager.shape("asa","ses","asa"); ravager.shape("asa", "ded", "ada");
ravager.setIngredient('a', Material.AIR); ravager.setIngredient('a', Material.AIR);
ravager.setIngredient('s', Material.SADDLE); ravager.setIngredient('s', Material.SADDLE);
ravager.setIngredient('d', Material.EMERALD);
ravager.setIngredient('e', Material.HOGLIN_SPAWN_EGG); ravager.setIngredient('e', Material.HOGLIN_SPAWN_EGG);
getPlugin().getServer().addRecipe(ravager); getPlugin().getServer().addRecipe(ravager);
} }
@ -301,8 +324,8 @@ public class EggRecipes extends Craftable {
ShapedRecipe shulker = getUtil().shaped(Material.SHULKER_SPAWN_EGG, "shulker_egg_recipe"); ShapedRecipe shulker = getUtil().shaped(Material.SHULKER_SPAWN_EGG, "shulker_egg_recipe");
shulker.shape("scs", "beb", "scs"); shulker.shape("scs", "beb", "scs");
shulker.setIngredient('s', Material.END_STONE); shulker.setIngredient('s', Material.END_STONE);
shulker.setIngredient('c', Material.CHORUS_FRUIT); shulker.setIngredient('b', Material.CHORUS_FRUIT);
shulker.setIngredient('b', Material.SHULKER_SHELL); shulker.setIngredient('c', Material.SHULKER_SHELL);
shulker.setIngredient('e', Material.EGG); shulker.setIngredient('e', Material.EGG);
getPlugin().getServer().addRecipe(shulker); getPlugin().getServer().addRecipe(shulker);
} }
@ -319,9 +342,11 @@ public class EggRecipes extends Craftable {
private void skeletonEgg() { private void skeletonEgg() {
ShapedRecipe skeleton = getUtil().shaped(Material.SKELETON_SPAWN_EGG, "skeleton_egg_recipe"); ShapedRecipe skeleton = getUtil().shaped(Material.SKELETON_SPAWN_EGG, "skeleton_egg_recipe");
skeleton.shape("aba","beb","aba"); skeleton.shape("asa", "bex", "aba");
skeleton.setIngredient('a', Material.AIR); skeleton.setIngredient('a', Material.AIR);
skeleton.setIngredient('b', Material.BONE); skeleton.setIngredient('b', Material.BONE);
skeleton.setIngredient('x', Material.BOW);
skeleton.setIngredient('s', Material.SKELETON_SKULL);
skeleton.setIngredient('e', Material.EGG); skeleton.setIngredient('e', Material.EGG);
getPlugin().getServer().addRecipe(skeleton); getPlugin().getServer().addRecipe(skeleton);
} }
@ -349,9 +374,9 @@ public class EggRecipes extends Craftable {
ShapedRecipe stray = getUtil().shaped(Material.STRAY_SPAWN_EGG, "stray_egg_recipe"); ShapedRecipe stray = getUtil().shaped(Material.STRAY_SPAWN_EGG, "stray_egg_recipe");
stray.shape("asa", "iei", "asa"); stray.shape("asa", "iei", "asa");
stray.setIngredient('a', Material.AIR); stray.setIngredient('a', Material.AIR);
stray.setIngredient('s', Material.SNOWBALL); stray.setIngredient('s', Material.BLUE_ICE);
stray.setIngredient('e', Material.SKELETON_SPAWN_EGG); stray.setIngredient('e', Material.SKELETON_SPAWN_EGG);
stray.setIngredient('i', Material.ICE); stray.setIngredient('i', Material.PACKED_ICE);
getPlugin().getServer().addRecipe(stray); getPlugin().getServer().addRecipe(stray);
} }
@ -375,7 +400,7 @@ public class EggRecipes extends Craftable {
private void vindicatorEgg() { private void vindicatorEgg() {
ShapedRecipe vindicator = getUtil().shaped(Material.VINDICATOR_SPAWN_EGG, "vindicator_egg_recipe"); ShapedRecipe vindicator = getUtil().shaped(Material.VINDICATOR_SPAWN_EGG, "vindicator_egg_recipe");
vindicator.shape("axa","*e*","axa"); vindicator.shape("a*a", "*ex", "a*a");
vindicator.setIngredient('a', Material.AIR); vindicator.setIngredient('a', Material.AIR);
vindicator.setIngredient('x', Material.IRON_AXE); vindicator.setIngredient('x', Material.IRON_AXE);
vindicator.setIngredient('e', Material.PILLAGER_SPAWN_EGG); vindicator.setIngredient('e', Material.PILLAGER_SPAWN_EGG);
@ -385,10 +410,10 @@ public class EggRecipes extends Craftable {
private void witchEgg() { private void witchEgg() {
ShapedRecipe witch = getUtil().shaped(Material.WITCH_SPAWN_EGG, "witch_egg_recipe"); ShapedRecipe witch = getUtil().shaped(Material.WITCH_SPAWN_EGG, "witch_egg_recipe");
witch.shape("apa","ses","apa"); witch.shape("asa", "pep", "asa");
witch.setIngredient('a', Material.AIR); witch.setIngredient('a', Material.AIR);
witch.setIngredient('p', Material.SPLASH_POTION); witch.setIngredient('p', Material.SPLASH_POTION);
witch.setIngredient('s', Material.STICK); witch.setIngredient('s', Material.VINE);
witch.setIngredient('e', Material.EGG); witch.setIngredient('e', Material.EGG);
getPlugin().getServer().addRecipe(witch); getPlugin().getServer().addRecipe(witch);
} }

View File

@ -10,13 +10,13 @@ public class NetherStarRecipe extends Craftable {
if (!getConfigValues().netherStarEnabled()) return; if (!getConfigValues().netherStarEnabled()) return;
ShapedRecipe recipe = getUtil().shaped(Material.NETHER_STAR, "nether_star_recipe"); ShapedRecipe nether_star = getUtil().shaped(Material.NETHER_STAR, "nether_star_recipe");
recipe.shape("nwn","sss","bqb"); nether_star.shape("nwn","sss","bqb");
recipe.setIngredient('n', Material.NETHER_WART); nether_star.setIngredient('n', Material.NETHER_WART);
recipe.setIngredient('w', Material.WITHER_SKELETON_SKULL); nether_star.setIngredient('w', Material.WITHER_SKELETON_SKULL);
recipe.setIngredient('s', Material.SOUL_SAND); nether_star.setIngredient('s', Material.SOUL_SAND);
recipe.setIngredient('b', Material.BLAZE_ROD); nether_star.setIngredient('b', Material.BLAZE_ROD);
recipe.setIngredient('q', Material.QUARTZ); nether_star.setIngredient('q', Material.QUARTZ);
getPlugin().getServer().addRecipe(recipe); getPlugin().getServer().addRecipe(nether_star);
} }
} }

View File

@ -10,9 +10,8 @@ public class NetherWartRecipe extends Craftable {
if (!getConfigValues().netherWartEnabled()) return; if (!getConfigValues().netherWartEnabled()) return;
ShapelessRecipe recipe = getUtil().shapeless(Material.NETHER_WART, "netherwart_recipe"); ShapelessRecipe netherwart = getUtil().shapeless(Material.NETHER_WART, 9, "netherwart_recipe");
recipe.addIngredient(1, Material.NETHER_WART_BLOCK); netherwart.addIngredient(1, Material.NETHER_WART_BLOCK);
recipe.getResult().setAmount(9); getPlugin().getServer().addRecipe(netherwart);
getPlugin().getServer().addRecipe(recipe);
} }
} }

View File

@ -0,0 +1,20 @@
package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables;
import org.bukkit.Material;
import org.bukkit.inventory.ShapedRecipe;
public class PhantomMembraneRecipe extends Craftable{
public PhantomMembraneRecipe(Uncraftables plugin) {
super(plugin);
if (!getConfigValues().membraneEnabled()) return;
ShapedRecipe membrane = getUtil().shaped(Material.PHANTOM_MEMBRANE, "membrane_recipe");
membrane.shape("sfs", "frf", "sfs");
membrane.setIngredient('s', Material.SLIME_BALL);
membrane.setIngredient('f', Material.FEATHER);
membrane.setIngredient('r', Material.FIREWORK_STAR);
getPlugin().getServer().addRecipe(membrane);
}
}

View File

@ -0,0 +1,21 @@
package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables;
import org.bukkit.Material;
import org.bukkit.inventory.ShapedRecipe;
public class WitherSkullRecipe extends Craftable {
public WitherSkullRecipe(Uncraftables plugin) {
super(plugin);
if (!getConfigValues().witherSkullEnabled()) return;
ShapedRecipe recipe = getUtil().shaped(Material.WITHER_SKELETON_SKULL, "wither_skull_recipe");
recipe.shape("scs", "coc", "scs");
recipe.setIngredient('s', Material.SOUL_SOIL);
recipe.setIngredient('c', Material.COAL);
recipe.setIngredient('o', Material.SKELETON_SKULL);
getPlugin().getServer().addRecipe(recipe);
}
}

View File

@ -1,12 +1,14 @@
barrier: true barrier: true
bedrock: true bedrock: true
bell: true bell: true
cobweb: true
crying_obsidian: true crying_obsidian: true
dragon_egg: true dragon_egg: true
eggs: true eggs: true
elytra: true elytra: true
end_frame: true end_frame: true
horse_armor: true horse_armor: true
membrane: true
music_discs: true music_discs: true
name_tag: true name_tag: true
nether_star: true nether_star: true
@ -15,3 +17,4 @@ saddle: true
spawner: true spawner: true
totem: true totem: true
trident: true trident: true
wither_skull: true