Unicopia/src/main/java/com/minelittlepony/unicopia/UItems.java

45 lines
1.6 KiB
Java
Raw Normal View History

2018-09-12 01:29:49 +02:00
package com.minelittlepony.unicopia;
import com.minelittlepony.unicopia.item.ItemApple;
import come.minelittlepony.unicopia.forgebullshit.RegistryLockSpinner;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.init.Items;
2018-09-12 01:29:49 +02:00
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
public class UItems {
public static final ItemApple apple = new ItemApple()
.setSubTypes("apple", "green", "sweet", "rotten", "zap", "zap_cooked")
.setTypeRarities(10, 20, 10, 30);
static void registerItems() {
RegistryLockSpinner.unlock(Item.REGISTRY);
ResourceLocation res = new ResourceLocation("apple");
Item.REGISTRY.register(Item.getIdFromItem(Items.APPLE), res, apple);
2018-09-12 01:29:49 +02:00
if (UClient.isClientSide()) {
String[] variants = apple.getVariants();
for (int i = 0; i < variants.length; i++) {
ModelLoader.setCustomModelResourceLocation(apple, i, new ModelResourceLocation("unicopia:" + variants[i]));
2018-09-12 01:29:49 +02:00
}
// ModelBakery.registerItemVariants(apple, NoNameSpacedResource.ofAllDomained("unicopia", apple.getVariants()));
2018-09-12 01:29:49 +02:00
}
RegistryLockSpinner.lock(Item.REGISTRY);
}
static void registerFuels() {
int zap = apple.getZapAppleMetadata();
FurnaceRecipes.instance().addSmeltingRecipe(
new ItemStack(UItems.apple, 1, zap),
new ItemStack(UItems.apple, 1, zap + 1), 0.1F);
}
}