本文整理匯總了Java中net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java PlayerEvent.ItemCraftedEvent方法的具體用法?Java PlayerEvent.ItemCraftedEvent怎麽用?Java PlayerEvent.ItemCraftedEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.fml.common.gameevent.PlayerEvent
的用法示例。
在下文中一共展示了PlayerEvent.ItemCraftedEvent方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCrafting
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onCrafting(PlayerEvent.ItemCraftedEvent event) {
//TODO: Extractify
EntityPlayer player = event.player;
ItemStack stack = event.crafting;
IInventory craftMatrix = event.craftMatrix;
for (int i = 0; i < craftMatrix.getSizeInventory(); i++) {
ItemStack here = craftMatrix.getStackInSlot(i);
if (here == null) {
continue;
}
Item item = here.getItem();
if (item instanceof IActOnCraft) {
((IActOnCraft) item).onCraft(here, craftMatrix, i, stack, player);
}
}
}
示例2: event
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void event(PlayerEvent.ItemCraftedEvent e) {
if (e.crafting.getItem() instanceof Bag) {
giveAchievement(e.player, Achievements.firstBag);
Bag bag = (Bag) e.crafting.getItem();
Bagginses.analytics.eventDesign("BagCrafted:" + bag.getType().name().toLowerCase() + bag.getColor() + ":" + (isSoulBound(e.crafting) ? "soulbound" : "notSoulbound"), Bagginses.analytics.userPrefix());
if (((Bag) e.crafting.getItem()).getType() == BagTypes.VOID) {
giveAchievement(e.player, Achievements.voidBag);
}
else if(((Bag) e.crafting.getItem()).getType() == BagTypes.ENDER) {
giveAchievement(e.player, Achievements.enderBag);
}
else if (((Bag) e.crafting.getItem()).getType() == BagTypes.TIER2) {
giveAchievement(e.player, Achievements.tier2Bag);
}
else if (((Bag) e.crafting.getItem()).getType() == BagTypes.TIER3) {
giveAchievement(e.player, Achievements.tier3Bag);
}
}
}
示例3: onItemCraft
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onItemCraft(PlayerEvent.ItemCraftedEvent event) {
ItemStack stack = event.crafting;
if (stack.getItem() == FirstAidItems.BANDAGE) {
String username = event.player.getName();
if (username.equalsIgnoreCase("ichun"))
stack.setStackDisplayName("MediChun's Healthkit"); //Yup, I *had* to do this
}
}
示例4: onItemCrafted
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onItemCrafted(PlayerEvent.ItemCraftedEvent event) {
ItemStack stack = event.crafting;
if (stack != null && stack.getItem() instanceof ICraftAchievement) {
Achievement achievement = ((ICraftAchievement)stack.getItem()).getAchievementOnCraft(stack, event.player, event.craftMatrix);
if (achievement != null) {
event.player.addStat(achievement, 1);
}
}
}
示例5: onItemCraft
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onItemCraft( PlayerEvent.ItemCraftedEvent event ){
for( Achievement a : Achievements.craftAchievements ){
if( Achievements.achievementsIgnoreMeta.get( a.hashCode() ) ){
if( event.crafting.getItem() == a.theItemStack.getItem() ){
Achievements.trigger( a, event.player );
}
} else{
if( ItemStack.areItemsEqual( event.crafting, a.theItemStack ) ){
Achievements.trigger( a, event.player );
}
}
}
}
示例6: onItemCrafted
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onItemCrafted(PlayerEvent.ItemCraftedEvent event)
{
// Item item = event.crafting.getItem();
//
// if (item == Item.getItemFromBlock(ModBlocks.UNCRAFTING_TABLE))
// {
// event.player.addStat(CRAFT_TABLE);
// }
}
示例7: onCrafting
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onCrafting(PlayerEvent.ItemCraftedEvent event)
{
Item item = event.crafting.getItem();
EntityPlayer player = event.player;
if(item instanceof ItemMHSword)
player.addStat(MHAchievements.firstSword);
}
示例8: CraftingEvent
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void CraftingEvent(PlayerEvent.ItemCraftedEvent event) {
if (event.crafting.getItem() == ModItems.nileEssence) {
event.player.addStat(ModAchievements.nileStart, 1);
}
if (event.crafting.getItem() == ModItems.nileDust) {
event.player.addStat(ModAchievements.nileStart, 1);
}
if (event.crafting.getItem() == ModItems.nileSword) {
event.player.addStat(ModAchievements.buildNileSword, 1);
}
if (event.crafting.getItem() == Item.getItemFromBlock(ModBlocks.nileWorktable)) {
event.player.addStat(ModAchievements.buildNWorkBench, 1);
}
if (event.crafting.getItem() == ModItems.nileBone) {
event.player.addStat(ModAchievements.buildNileBone, 1);
}
if (Constants.DEF_DARKLOAD == true) {
if (event.crafting.getItem() == ModItems.darkEssence) {
event.player.addStat(ModAchievements.darkStart, 1);
}
if (event.crafting.getItem() == ModItems.darkDust) {
event.player.addStat(ModAchievements.darkStart, 1);
}
if (event.crafting.getItem() == ModItems.darkSword) {
event.player.addStat(ModAchievements.buildDarkSword, 1);
}
if (event.crafting.getItem() == ModItems.darkBone) {
event.player.addStat(ModAchievements.buildDarkBone, 1);
}
}
}
示例9: onCrafting
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onCrafting(PlayerEvent.ItemCraftedEvent event){
Item item = event.crafting.getItem();
EntityPlayer thePlayer = event.player;
if (item.equals(Item.getItemFromBlock(BlockLoader.cheesePress))){
event.player.addStat(AchieveLoad.cheesePress, 1);
}else if (item.equals(ItemLoader.knife)){
//EFLog.error("PING!");
event.player.addStat(AchieveLoad.obtainKnife, 1);
}
}
示例10: onCrafting
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onCrafting(PlayerEvent.ItemCraftedEvent event)
{
/*if (event.crafting.getItem() == ItemRegistry.bucketliquidWaterSource ) {
event.player.addStat(AchievementRegistry.stickyooze, 1);
}
if (event.crafting.getItem() == ItemRegistry.bucketliquidFire ) {
event.player.addStat(AchievementRegistry.stickyooze, 1);
}
if (event.crafting.getItem() == ItemRegistry.bucketliquidGrass ) {
event.player.addStat(AchievementRegistry.stickyooze, 1);
}
*/
}
示例11: onCraftingCake
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onCraftingCake(PlayerEvent.ItemCraftedEvent event) {
if (event.crafting.getItem() instanceof ItemFruitCake || event.crafting.getItem() instanceof ItemVegetableCake)
event.craftMatrix.setInventorySlotContents(1, new ItemStack(FCRItems.GLASS_BOTTLE));
}
示例12: onPlayerCrafting
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPlayerCrafting(PlayerEvent.ItemCraftedEvent event) {
if (event.crafting.getItem().equals(PLBlocks.carbonizeFurnace.getItem())) {
event.player.addStat(PLAchievement.getCarbonizeFurnace, 1);
}
}
示例13: onItemCrafted
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onItemCrafted (PlayerEvent.ItemCraftedEvent event) {
}
示例14: onCraftingEvent
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
/**
* Method used to decrease item damage of forging item after each used.
*
* @param event = event passed as reference.
*/
@SubscribeEvent
public void onCraftingEvent(PlayerEvent.ItemCraftedEvent event) {
}