mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
24 lines
397 B
Java
24 lines
397 B
Java
package com.hbm.util;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.WeightedRandom;
|
|
|
|
public class WeightedRandomObject extends WeightedRandom.Item {
|
|
|
|
Object item;
|
|
|
|
public WeightedRandomObject(Object o, int weight) {
|
|
super(weight);
|
|
item = o;
|
|
}
|
|
|
|
public ItemStack asStack() {
|
|
|
|
if(item instanceof ItemStack)
|
|
return ((ItemStack) item).copy();
|
|
|
|
return null;
|
|
}
|
|
|
|
}
|