Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

Commit

Permalink
This fixes #14, and adds fire amulet and new textures
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisblokland committed Dec 15, 2016
1 parent 8921720 commit 3c2ac7e
Show file tree
Hide file tree
Showing 23 changed files with 77 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tasks.withType(JavaCompile) {
targetCompatibility = "1.7"
}

version = "1.7.10-1.2.1"
version = "1.7.10-1.2.2-final"
group= "com.baublelicious"
archivesBaseName = "baublelicious"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class BaubleliciousItems {
public static Item ItemMagicCore;
public static Item ItemsAmuletNightvision;
public static Item bindingGem;
public static Item ItemAmuletFieryCore;
public static Item entangledAmulet, entangledRing, entangledBelt;

public static void init() {
Expand All @@ -44,7 +45,8 @@ public static void init() {
ItemAmuletGrowth = new ItemAmuletGrowth();
ItemMagicCore = new ItemMagicCore();
ItemsAmuletNightvision = new ItemsAmuletNightvision();

ItemAmuletFieryCore = new ItemAmuletFieryCore();

entangledAmulet = new ItemEntangledAmulet(ModInfo.MOD_ID + ":" + ENTANGLED_AMULET_KEY);
entangledRing = new ItemEntangledRing(ModInfo.MOD_ID + ":" + ENTANGLED_RING_KEY);
entangledBelt = new ItemEntangledBelt(ModInfo.MOD_ID + ":" + ENTANGLED_BELT_KEY);
Expand Down
66 changes: 66 additions & 0 deletions src/main/java/com/baublelicious/items/ItemAmuletFieryCore.java
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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public BaubleType getBaubleType(ItemStack stack) {
@Override
public void onWornTick(ItemStack stack, EntityLivingBase entity) {
PotionEffect effect = entity.getActivePotionEffect(Potion.nightVision);
if (effect == null || effect.getDuration() < 900) entity.addPotionEffect(new PotionEffect(Potion.nightVision.id, 1000, 1, true));
if (effect == null || effect.getDuration() < 900) entity.addPotionEffect(new PotionEffect(Potion.nightVision.id, 999999, 1, true));
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/baublelicious/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ item.ItemMagicCore.tier1.name=Magic Core
item.ItemMagicCore.tier2.name=Magic Core
item.ItemMagicCore.tier3.name=Magic Core
item.ItemsAmuletNightvision.name=Amulet of Nightvision
item.ItemAmuletFieryCore.name=Amulet of the Fiery Core


#BLOCKS
tile.BlockPedestal.name=Pedestal
Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/assets/baublelicious/lang/nl_NL.lang
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ item.ItemSpeedBelt.name=Snelheids Riem
item.baublelicious:ItemMagnetRing.name=Magneet Ring
item.ItemFallingBelt.name=Val Ring
item.ItemAmuletGrowth.name=Amulet Van De Groei
item.ItemMagicCore.tier1.name=magische kern
item.ItemMagicCore.tier2.name=magische kern
item.ItemMagicCore.tier3.name=magische kern
item.ItemMagicCore.tier1.name=Magische kern
item.ItemMagicCore.tier2.name=Magische kern
item.ItemMagicCore.tier3.name=Magische kern
item.ItemsAmuletNightvision.name=Amulet van NachtVisie
item.ItemAmuletFieryCore.name=Amulet van de Vurige Kern

#BLOCKS
tile.BlockPedestal.name=Pedestal
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3c2ac7e

Please sign in to comment.