Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit 6244125

Browse files
committed
1.21 support
1 parent d7e7891 commit 6244125

19 files changed

+75
-59
lines changed

pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,11 @@
166166
<version>1.18.2-R0.1-SNAPSHOT</version>
167167
<scope>provided</scope>
168168
</dependency>
169+
169170
<dependency>
170-
<groupId>com.github.Slimefun</groupId>
171+
<groupId>.com.github.Slimefun</groupId>
171172
<artifactId>Slimefun4</artifactId>
172-
<version>RC-37</version>
173+
<version>experimental-SNAPSHOT</version>
173174
<scope>provided</scope>
174175
</dependency>
175176
<dependency>

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/listeners/SingleItemRecipeGuideListener.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.lins.mmmjjkx.rykenslimefuncustomizer.objects.slimefun.AsyncChanceRecipeTask;
4444
import org.lins.mmmjjkx.rykenslimefuncustomizer.utils.CommonUtils;
4545

46-
@SuppressWarnings("deprecation")
4746
public class SingleItemRecipeGuideListener implements Listener {
4847
private static final NamespacedKey RECIPE_KEY = new NamespacedKey(RykenSlimefunCustomizer.INSTANCE, "rsc_recipe");
4948
private static final NamespacedKey RECIPE_INDEX_KEY =
@@ -296,7 +295,7 @@ public RecipeMenu(AContainer item, Player p, int index) {
296295
rawName = rawName.concat("(" + CommonUtils.formatSeconds(seconds) + "&e)");
297296
}
298297

299-
progressBar = new CustomItemStack(progressBar, rawName);
298+
progressBar = CustomItemStack.create(progressBar, rawName);
300299

301300
addItem(progressSlot, progressBar, (pl, s, is, action) -> false);
302301
}
@@ -419,7 +418,7 @@ public TemplateRecipeMenu(CustomTemplateMachine ctm, Player p, int templateIndex
419418
rawName = rawName.concat("(" + CommonUtils.formatSeconds(seconds) + "&e)");
420419
}
421420

422-
progressBar = new CustomItemStack(progressBar, rawName);
421+
progressBar = CustomItemStack.create(progressBar, rawName);
423422

424423
addItem(progressSlot, progressBar, (pl, s, is, action) -> false);
425424
}
@@ -591,7 +590,7 @@ public LinkedRecipeMenu(AContainer item, Player p, int index) {
591590
rawName = rawName.concat("(" + CommonUtils.formatSeconds(seconds) + "&e)");
592591
}
593592

594-
progressBar = new CustomItemStack(progressBar, rawName);
593+
progressBar = CustomItemStack.create(progressBar, rawName);
595594

596595
addItem(progressSlot, progressBar, (pl, s, is, action) -> false);
597596
}
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package org.lins.mmmjjkx.rykenslimefuncustomizer.objects.customs.item;
22

3-
import io.github.thebusybiscuit.slimefun4.libraries.dough.items.CustomItemStack;
43
import java.util.List;
54
import org.bukkit.inventory.ItemStack;
65

76
@SuppressWarnings("deprecation")
8-
public class RSCItemStack extends CustomItemStack {
7+
public class RSCItemStack {
8+
private final ItemStack item;
9+
910
public RSCItemStack(ItemStack item, String name, List<String> lore) {
10-
super(item, meta -> {
11+
item.editMeta(meta -> {
1112
if (name != null && !name.isBlank()) {
1213
meta.setDisplayName(name);
1314
}
@@ -16,5 +17,11 @@ public RSCItemStack(ItemStack item, String name, List<String> lore) {
1617
meta.setLore(lore);
1718
}
1819
});
20+
21+
this.item = item;
22+
}
23+
24+
public ItemStack getItem() {
25+
return item;
1926
}
2027
}

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/customs/machine/CustomGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ private boolean isBucket(ItemStack item) {
151151
ItemStackWrapper wrapper = ItemStackWrapper.wrap(item);
152152
return item.getType() == Material.LAVA_BUCKET
153153
|| item.getType() == Material.WATER_BUCKET
154-
|| SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.FUEL_BUCKET, true)
155-
|| SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.OIL_BUCKET, true);
154+
|| SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.FUEL_BUCKET.item(), true)
155+
|| SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.OIL_BUCKET.item(), true);
156156
}
157157

158158
private MachineFuel findRecipe(BlockMenu menu, Map<Integer, Integer> found) {

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/customs/machine/CustomLinkedRecipeMachine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public class CustomLinkedRecipeMachine extends AContainer implements RecipeDispl
4848
private final int saveAmount;
4949

5050
public static final ItemStack RECIPE_INPUT =
51-
new CustomItemStack(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Input", "", "&2> &aClick to view");
51+
CustomItemStack.create(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Input", "", "&2> &aClick to view");
5252
public static final ItemStack RECIPE_OUTPUT =
53-
new CustomItemStack(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Output", "", "&2> &aClick to view");
53+
CustomItemStack.create(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Output", "", "&2> &aClick to view");
5454

5555
@Getter
5656
@Nullable private final CustomMenu menu;

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/customs/machine/CustomMaterialGenerator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private void tick(Block b) {
9999
} else {
100100
if (statusSlot > -1) {
101101
blockMenu.replaceExistingItem(
102-
statusSlot, new CustomItemStack(Material.RED_STAINED_GLASS_PANE, "&4No enough energy"));
102+
statusSlot, CustomItemStack.create(Material.RED_STAINED_GLASS_PANE, "&4No enough energy"));
103103
}
104104
}
105105
}
@@ -166,7 +166,7 @@ public void tick(Block b, SlimefunItem item, Config data) {
166166

167167
@NotNull @Override
168168
public List<ItemStack> getDisplayRecipes() {
169-
ItemStack speed = new CustomItemStack(
169+
ItemStack speed = CustomItemStack.create(
170170
Material.KNOWLEDGE_BOOK,
171171
"&a&lSpeed",
172172
Collections.singletonList("&a&lGenerates per &b&l" + tickRate + " &a&lticks once"));
@@ -190,15 +190,15 @@ private void pushItems(BlockMenu blockMenu) {
190190
if (blockMenu.fits(item, getOutputSlots())) {
191191
if (blockMenu.hasViewer() && statusSlot > -1) {
192192
blockMenu.replaceExistingItem(
193-
statusSlot, new CustomItemStack(Material.LIME_STAINED_GLASS_PANE, "&aProducing"));
193+
statusSlot, CustomItemStack.create(Material.LIME_STAINED_GLASS_PANE, "&aProducing"));
194194
}
195195
blockMenu.pushItem(item.clone(), getOutputSlots());
196196
removeCharge(b.getLocation(), per);
197197
} else {
198198
if (blockMenu.hasViewer()) {
199199
if (statusSlot > -1) {
200200
blockMenu.replaceExistingItem(
201-
statusSlot, new CustomItemStack(Material.ORANGE_STAINED_GLASS_PANE, "&c空间不足"));
201+
statusSlot, CustomItemStack.create(Material.ORANGE_STAINED_GLASS_PANE, "&c空间不足"));
202202
}
203203
}
204204
}

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/customs/machine/CustomRecipeMachine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public class CustomRecipeMachine extends AContainer implements RecipeDisplayItem
4343
private final boolean hideAllRecipes;
4444

4545
public static final ItemStack RECIPE_INPUT =
46-
new CustomItemStack(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Input", "", "&2> &aClick to view");
46+
CustomItemStack.create(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Input", "", "&2> &aClick to view");
4747
public static final ItemStack RECIPE_OUTPUT =
48-
new CustomItemStack(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Output", "", "&2> &aClick to view");
48+
CustomItemStack.create(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Output", "", "&2> &aClick to view");
4949

5050
@Getter
5151
@Nullable private final CustomMenu menu;

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/customs/machine/CustomWorkbench.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ public void tick(Block block, SlimefunItem slimefunItem, Config config) {
6464
private final ScriptEval eval;
6565

6666
public static final ItemStack RECIPE_INPUT =
67-
new CustomItemStack(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Input", "", "&2> &aClick to view");
67+
CustomItemStack.create(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Input", "", "&2> &aClick to view");
6868
public static final ItemStack RECIPE_OUTPUT =
69-
new CustomItemStack(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Output", "", "&2> &aClick to view");
69+
CustomItemStack.create(Material.GREEN_STAINED_GLASS_PANE, "&aMulti-Item Output", "", "&2> &aClick to view");
7070

7171
@Getter
7272
@Nullable private final CustomMenu menu;

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/customs/machine/sf/AdvancedAnimalGrowthAccelerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.bukkit.inventory.ItemStack;
1818

1919
public class AdvancedAnimalGrowthAccelerator extends AbstractGrowthAccelerator {
20-
private static final ItemStack organicFood = ItemStackWrapper.wrap(SlimefunItems.ORGANIC_FOOD);
20+
private static final ItemStack organicFood = ItemStackWrapper.wrap(SlimefunItems.ORGANIC_FOOD.item());
2121

2222
private final int capacity;
2323
private final int radius;

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/customs/machine/sf/AdvancedAutoAnvil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected MachineRecipe findNextRecipe(BlockMenu menu) {
2828
ItemStack ductTape = menu.getItemInSlot(slot == this.getInputSlots()[0] ? this.getInputSlots()[1] : this.getInputSlots()[0]);
2929
ItemStack item = menu.getItemInSlot(slot);
3030
if (item != null && item.getType().getMaxDurability() > 0 && ((Damageable)item.getItemMeta()).getDamage() > 0) {
31-
if (SlimefunUtils.isItemSimilar(ductTape, SlimefunItems.DUCT_TAPE, true, false)) {
31+
if (SlimefunUtils.isItemSimilar(ductTape, SlimefunItems.DUCT_TAPE.item(), true, false)) {
3232
ItemStack repairedItem = this.repair(item);
3333
if (!menu.fits(repairedItem, this.getOutputSlots())) {
3434
return null;

0 commit comments

Comments
 (0)