Skip to content

Commit 1546f90

Browse files
committed
bugfixes in 1.5.2
1 parent 362bebc commit 1546f90

5 files changed

Lines changed: 15 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: softprops/action-gh-release@v2
2828
with:
2929
tag_name: "latest-26.2"
30-
name: "[1.5.1 for 26.2] Development Build"
30+
name: "[1.5.2 for 26.2] Development Build"
3131
body: "Push-ly development build for Caramel. Updated on every push - ignore the 'commits to master since this release' if you're on the latest tag."
3232
prerelease: false
3333
files: |

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Caramel is a multipurpose AIO api for PaperAPI plugins. ***Caramel can not and w
2626
<dependency>
2727
<groupId>dev.klash</groupId>
2828
<artifactId>Caramel</artifactId>
29-
<version>1.5.1</version>
29+
<version>1.5.2</version>
3030
<scope>provided</scope>
3131
</dependency>
3232
```
@@ -39,7 +39,7 @@ repositories {
3939
}
4040

4141
dependencies {
42-
compileOnly("dev.klash:Caramel:1.5.1")
42+
compileOnly("dev.klash:Caramel:1.5.2")
4343
}
4444
```
4545

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>dev.klash</groupId>
88
<artifactId>Caramel</artifactId>
9-
<version>1.5.1</version>
9+
<version>1.5.2</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Caramel</name>

src/main/java/dev/klash/caramel/items/CaramelFactory.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,17 @@ public static ItemStack build(CaramelItem item) {
2323
m.lore(CaramelUtility.formatLoreString(item.getDetails().lore()));
2424
m.displayName(item.getDetails().itemName());
2525

26+
// still used for older resource packs
2627
if(item.getDetails().modelData() > 0) {
2728
m.setCustomModelData(item.getDetails().modelData());
2829
}
30+
31+
32+
m.getPersistentDataContainer().set(Caramel.getInstance().isCaramelKey, PersistentDataType.BOOLEAN, true);
33+
m.getPersistentDataContainer().set(Caramel.getInstance().caramelIDKey, PersistentDataType.STRING, item.getDetails().id());
34+
35+
i.setItemMeta(m);
36+
2937
if(item.getDetails().food() != null) {
3038
FoodProperties food = FoodProperties.food()
3139
.canAlwaysEat(item.getDetails().food().canAlwaysEat())
@@ -44,11 +52,6 @@ public static ItemStack build(CaramelItem item) {
4452
i.setData(((CIComponent.CIComponentNonvalued) component).getComponent());
4553
}
4654
}
47-
48-
m.getPersistentDataContainer().set(Caramel.getInstance().isCaramelKey, PersistentDataType.BOOLEAN, true);
49-
m.getPersistentDataContainer().set(Caramel.getInstance().caramelIDKey, PersistentDataType.STRING, item.getDetails().id());
50-
51-
i.setItemMeta(m);
5255
i.setAmount(item.getDetails().defaultStack());
5356
return item.modifyBeforeFinalizing(i);
5457
}

src/main/java/dev/klash/caramel/items/CaramelItemDetail.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
import java.util.Collections;
1212
import java.util.List;
1313

14-
public record CaramelItemDetail(String id, Component itemName, List<String> lore, int defaultStack, int modelData, Material itemBase, Key itemModel, FoodProperties food, List<CIComponent> components) {
14+
public record CaramelItemDetail(String id, Component itemName, List<String> lore, int defaultStack, @Deprecated int modelData, Material itemBase, Key itemModel, FoodProperties food, List<CIComponent> components) {
1515
public static class Builder {
1616
private String id;
1717
private Component itemName = CaramelUtility.colorcomp("No name specified");
1818
private List<String> lore = Collections.emptyList();
1919
private int defaultStack = 1;
20-
private int modelData = -1;
20+
@Deprecated private int modelData = -1;
2121
private Material itemBase = Material.STICK;
2222
@ApiStatus.Experimental private Key itemModel = null;
2323
@ApiStatus.Experimental private FoodProperties food = null;
@@ -54,6 +54,7 @@ public Builder food(FoodProperties food) {
5454
return this;
5555
}
5656

57+
@Deprecated
5758
public Builder modelData(int modelData) {
5859
this.modelData = modelData;
5960
return this;

0 commit comments

Comments
 (0)