Skip to content

Commit

Permalink
Merge pull request #2 from freeserverproject/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Alpha9n authored Nov 23, 2022
2 parents 53206bd + dcff40f commit 7fbccec
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>pro.freeserver.plugin.alphakun</groupId>
<artifactId>CraftSupporter</artifactId>
<version>2.0.0-release</version>
<version>2.0.1-release</version>
<packaging>jar</packaging>

<name>CraftSupporter</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ class Ingredient(ingredientKey: Char, material: String, amount: Int, customModel
private var ingredientmKey: Char
private var material: String
private var amount: Int
private var customModelData: Int
private var customModelData: Int?

init {
this.ingredientmKey = ingredientKey
this.material = material
this.amount = amount
this.customModelData = customModelData
if (customModelData == 0) {
this.customModelData = null
} else {
this.customModelData = customModelData
}
}

fun getIngredientKey(): Char {
Expand All @@ -27,7 +31,7 @@ class Ingredient(ingredientKey: Char, material: String, amount: Int, customModel
return amount
}

fun getCustomModelData(): Int {
fun getCustomModelData(): Int? {
return customModelData
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ class ItemStackAPI(material: Material, amount: Int? = null, itemName: String? =
this.itemName = itemName?:""
this.lore = lore
this.enchant = enchant?: mapOf()
this.customModelData = customModelData
if (customModelData == 0) {
this.customModelData = null
} else {
this.customModelData = customModelData
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Racipe(recipeName: String, itemName: String?, material: String?, amount: I
for (i in ingredients) {
item = ItemStackAPI(material = i.getMaterial()?:Material.STONE ,amount= i.getAmount(), customModelData = i.getCustomModelData())
recipe.addIngredient(item.getItemStack())
println(i.getMaterial().toString() + "'s customModelData is" + i.getCustomModelData())
}
}
if (Bukkit.addRecipe(recipe)) {
Expand Down

0 comments on commit 7fbccec

Please sign in to comment.