migrate to new buildscript

Class Registries are merged together into one. All subprojects are also merged into one. It's probably possible to split stuff into multiple source sets and not merging the registries, but I'm just too lazy for that.
This commit is contained in:
Glease committed 2022-03-05 03:02:05 +08:00
1 parent 7c4b38e853
commit 38c46d61d9
341 files changed
+1027 -11951

No files matched your search

@@ -0,0 +1,53 @@
package minetweaker.api.vanilla;
import minetweaker.api.item.WeightedItemStack;
import stanhebben.zenscript.annotations.*;
/**
* @author Stan
*/
@ZenClass("vanilla.LootEntry")
public class LootEntry {
private final WeightedItemStack item;
private final int minAmount;
private final int maxAmount;
public LootEntry(WeightedItemStack item, int minAmount, int maxAmount) {
this.item = item;
this.minAmount = minAmount;
this.maxAmount = maxAmount;
}
@ZenGetter("item")
public WeightedItemStack getItem() {
return item;
}
@ZenGetter("minAmount")
public int getMinAmount() {
return minAmount;
}
@ZenGetter("maxAmount")
public int getMaxAmount() {
return maxAmount;
}
@Override
public String toString() {
StringBuilder message = new StringBuilder();
message.append(getItem().getStack());
message.append(" (weight ");
message.append((int) getItem().getChance());
if(getMinAmount() != 0 || getMaxAmount() != 1) {
message.append(", ");
message.append(getMinAmount());
message.append("-");
message.append(getMaxAmount());
}
message.append(")");
return message.toString();
}
}