Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<name>Ultimate Foods</name>

<properties>
<java.version>1.8</java.version>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -23,14 +23,13 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -40,7 +39,7 @@
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>true</minimizeJar>
<outputFile>C:\Users\7Dev\Desktop\1.21.9\plugins\${project.artifactId}-${project.version}.jar</outputFile>
<outputFile>${project.basedir}/target/${project.artifactId}-${project.version}.jar</outputFile>
<relocations>
<relocation>
<pattern>com.google.gson</pattern>
Expand Down Expand Up @@ -130,8 +129,8 @@
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.9-R0.1-SNAPSHOT</version>
<artifactId>paper-api</artifactId>
<version>26.1.2.build.63-stable</version>
<scope>provided</scope>
</dependency>

Expand All @@ -154,7 +153,7 @@
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.0.0</version>
<version>5.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

Expand Down
28 changes: 6 additions & 22 deletions src/main/java/net/juligame/ultimatefoods/classes/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,16 @@ public boolean isValid() {
}

public static void removeRecipe(ItemStack itemStack){
ItemStack itemToRemove = null;
if (itemStack == null || itemStack.getType().equals(Material.AIR))
return;

List<org.bukkit.inventory.Recipe> recipes = UltimateFoods.instance.getServer().getRecipesFor(itemStack);

for (org.bukkit.inventory.Recipe recipe : recipes) {
if (recipe == null)
continue;

if(recipe.getResult().equals(itemStack)){
itemToRemove = recipe.getResult();
break;
}
}

if (itemToRemove != null) {
Iterator<org.bukkit.inventory.Recipe> iterator = Bukkit.getServer().recipeIterator();
while (iterator.hasNext()) {
org.bukkit.inventory.Recipe recipe = iterator.next();
if (recipe != null && recipe.getResult().equals(itemToRemove)) {
iterator.remove();
}
Material targetMaterial = itemStack.getType();
Iterator<org.bukkit.inventory.Recipe> iterator = Bukkit.getServer().recipeIterator();
while (iterator.hasNext()) {
org.bukkit.inventory.Recipe recipe = iterator.next();
if (recipe != null && recipe.getResult().getType().equals(targetMaterial)) {
iterator.remove();
}
} else {
Bukkit.getLogger().info("Item to remove not found");
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: UltimateFood
version: '1.5.0'
main: net.juligame.ultimatefoods.UltimateFoods
api-version: '1.21'
api-version: '26.1'
authors: [ JuliGame, RoloGod ]
description: The Ultimate Food plugin ;)
commands:
Expand Down