Archived
74 lines
3.2 KiB
Java
74 lines
3.2 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* cpw.mods.fml.common.eventhandler.SubscribeEvent
|
|
* cpw.mods.fml.common.registry.GameRegistry
|
|
* cpw.mods.fml.common.registry.VillagerRegistry
|
|
* cpw.mods.fml.common.registry.VillagerRegistry$IVillageTradeHandler
|
|
* mods.flammpfeil.slashblade.ItemSlashBlade
|
|
* mods.flammpfeil.slashblade.ItemSlashBladeNamed
|
|
* mods.flammpfeil.slashblade.SlashBlade
|
|
* mods.flammpfeil.slashblade.named.event.LoadEvent$InitEvent
|
|
* mods.flammpfeil.slashblade.named.event.LoadEvent$PostInitEvent
|
|
* net.minecraft.entity.passive.EntityVillager
|
|
* net.minecraft.init.Items
|
|
* net.minecraft.item.Item
|
|
* net.minecraft.item.Item$ToolMaterial
|
|
* net.minecraft.item.ItemStack
|
|
* net.minecraft.nbt.NBTTagCompound
|
|
* net.minecraft.village.MerchantRecipe
|
|
* net.minecraft.village.MerchantRecipeList
|
|
*/
|
|
package mods.flammpfeil.toyako.named;
|
|
|
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
|
import cpw.mods.fml.common.registry.VillagerRegistry;
|
|
import java.util.Random;
|
|
import mods.flammpfeil.slashblade.ItemSlashBlade;
|
|
import mods.flammpfeil.slashblade.ItemSlashBladeNamed;
|
|
import mods.flammpfeil.slashblade.SlashBlade;
|
|
import mods.flammpfeil.slashblade.named.event.LoadEvent;
|
|
import net.minecraft.entity.passive.EntityVillager;
|
|
import net.minecraft.init.Items;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
import net.minecraft.village.MerchantRecipe;
|
|
import net.minecraft.village.MerchantRecipeList;
|
|
|
|
public class ToyakoBokutou
|
|
implements VillagerRegistry.IVillageTradeHandler {
|
|
String name = "flammpfeil.slashblade.named.toyako";
|
|
|
|
@SubscribeEvent
|
|
public void init(LoadEvent.InitEvent event) {
|
|
ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0);
|
|
NBTTagCompound tag = new NBTTagCompound();
|
|
customblade.func_77982_d(tag);
|
|
ItemSlashBladeNamed.CurrentItemName.set(tag, this.name);
|
|
ItemSlashBladeNamed.CustomMaxDamage.set(tag, Integer.valueOf(70));
|
|
ItemSlashBlade.setBaseAttackModifier((NBTTagCompound)tag, (float)(4.0f + Item.ToolMaterial.STONE.func_78000_c()));
|
|
ItemSlashBlade.TextureName.set(tag, "named/toyako/toyako");
|
|
ItemSlashBlade.ModelName.set(tag, "named/toyako/toyako");
|
|
ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(4));
|
|
ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(1));
|
|
GameRegistry.registerCustomItemStack((String)this.name, (ItemStack)customblade);
|
|
ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + this.name);
|
|
}
|
|
|
|
@SubscribeEvent
|
|
public void postinit(LoadEvent.PostInitEvent event) {
|
|
VillagerRegistry.instance().registerVillageTradeHandler(3, (VillagerRegistry.IVillageTradeHandler)this);
|
|
}
|
|
|
|
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
|
|
if (villager.func_70946_n() == 3) {
|
|
ItemStack blade = SlashBlade.getCustomBlade((String)"flammpfeil.slashblade", (String)this.name);
|
|
recipeList.add((Object)new MerchantRecipe(new ItemStack(Items.field_151166_bC, 3 + random.nextInt(5)), blade));
|
|
}
|
|
}
|
|
}
|
|
|