This repository has been archived by the owner on Dec 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes #14, and adds fire amulet and new textures
- Loading branch information
1 parent
8921720
commit 3c2ac7e
Showing
23 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/com/baublelicious/items/ItemAmuletFieryCore.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.baublelicious.items; | ||
|
||
import baubles.api.BaubleType; | ||
import baubles.api.IBauble; | ||
import baubles.common.container.InventoryBaubles; | ||
import baubles.common.lib.PlayerHandler; | ||
import cpw.mods.fml.relauncher.ReflectionHelper; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.MathHelper; | ||
import net.minecraft.world.World; | ||
|
||
public class ItemAmuletFieryCore extends ItemBaubles implements IBauble { | ||
|
||
public ItemAmuletFieryCore(){ | ||
this.setUnlocalizedName("ItemAmuletFieryCore"); | ||
setMaxDamage(2002); | ||
} | ||
public static final String[] IS_IMMUNE_TO_FIRE = new String[] { "isImmuneToFire", "field_70178_ae", "ag" }; | ||
@Override | ||
public void onWornTick(ItemStack stack, EntityLivingBase player) { | ||
World par2World = player.worldObj; | ||
World world = player.worldObj; | ||
int x = MathHelper.floor_double(player.posX); | ||
int y = MathHelper.floor_double(player.boundingBox.minY); | ||
int z = MathHelper.floor_double(player.posZ); | ||
Material mlava = world.getBlock(x, y, z).getMaterial(); | ||
EntityPlayer playerEntity = (EntityPlayer) player; | ||
ItemStack amulet = PlayerHandler.getPlayerBaubles(playerEntity).getStackInSlot(0); | ||
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(playerEntity); | ||
if(mlava == Material.lava){ | ||
|
||
|
||
|
||
|
||
|
||
stack.damageItem(1, playerEntity); | ||
|
||
if (stack.getItemDamage() == 2002) | ||
baubles.setInventorySlotContents(0, null); | ||
setImmunity(player, false); | ||
if (amulet.getItem() == null) par2World.playSoundAtEntity(playerEntity, "random.break", 1.0F, 1.0F); | ||
|
||
|
||
} | ||
setImmunity(player, true); | ||
|
||
} | ||
|
||
@Override | ||
public void onUnequipped(ItemStack stack, EntityLivingBase player) { | ||
setImmunity(player, false); | ||
} | ||
|
||
private void setImmunity(Entity entity, boolean immune) { | ||
ReflectionHelper.setPrivateValue(Entity.class, entity, immune, IS_IMMUNE_TO_FIRE); | ||
} | ||
@Override | ||
public BaubleType getBaubleType(ItemStack arg0) { | ||
return BaubleType.AMULET; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-54 Bytes
(90%)
src/main/resources/assets/baublelicious/textures/items/ItemAmulet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-53 Bytes
(91%)
src/main/resources/assets/baublelicious/textures/items/ItemAmuletGrowth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-57 Bytes
(91%)
src/main/resources/assets/baublelicious/textures/items/ItemBelt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-42 Bytes
(93%)
src/main/resources/assets/baublelicious/textures/items/ItemBeltStepAssist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-41 Bytes
(94%)
src/main/resources/assets/baublelicious/textures/items/ItemBeltWaterWalking.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-40 Bytes
(94%)
src/main/resources/assets/baublelicious/textures/items/ItemFallingBelt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-8 Bytes
(98%)
src/main/resources/assets/baublelicious/textures/items/ItemFlyingRing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-18 Bytes
(96%)
src/main/resources/assets/baublelicious/textures/items/ItemMagicCore0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-42 Bytes
(90%)
src/main/resources/assets/baublelicious/textures/items/ItemMagicCore1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-20 Bytes
(95%)
src/main/resources/assets/baublelicious/textures/items/ItemMagicCore2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-108 Bytes
(76%)
src/main/resources/assets/baublelicious/textures/items/ItemMagnetRing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-44 Bytes
(92%)
src/main/resources/assets/baublelicious/textures/items/ItemNecklaceDiving.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5 Bytes
(100%)
src/main/resources/assets/baublelicious/textures/items/ItemRing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-28 Bytes
(96%)
src/main/resources/assets/baublelicious/textures/items/ItemSpeedBelt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-32 Bytes
(94%)
src/main/resources/assets/baublelicious/textures/items/ItemsAmuletNightvision.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-118 Bytes
(70%)
src/main/resources/assets/baublelicious/textures/items/bindingGem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-135 Bytes
(80%)
src/main/resources/assets/baublelicious/textures/items/entangledAmulet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.