Even more weird indents

This commit is contained in:
Jeremy Diamond committed 2014-01-22 23:33:07 -08:00
1 parent f078212d20
commit 8ea67a4843
33 files changed
+1478 -1478

No files matched your search

+28 -28
View File
@@ -24,11 +24,11 @@ import thaumcraft.api.ItemApi;
public class Config
{
public static HashMap<String, Aspect> spawnerMobs = new HashMap<String, Aspect>();
public static HashMap<String, Aspect> spawnerMobs = new HashMap<String, Aspect>();
public static int shardID;
public static int skullAxeID;
public static int arcaneCakeItemID;
public static int skullAxeID;
public static int arcaneCakeItemID;
public static int taintShovelID;
public static int wandCoreID;
public static int resourceID;
@@ -40,7 +40,7 @@ public class Config
public static int morphShovelID;
public static int morphAxeID;
public static int arcaneCakeBlockID;
public static int arcaneCakeBlockID;
public static int blackFlowerBlockID;
public static int wrathCageID;
@@ -49,12 +49,12 @@ public class Config
public static int greedyEnchID;
public static int consumingEnchID;
public static int thaumcraftResourceID;
public static int thaumcraftResourceID;
public static int thaumcraftTaintBlockID;
public static int thaumcraftTaintPotionID;
public static int thaumcraftTaintBiomeID;
public static boolean noLust = false;
public static boolean noLust = false;
public static boolean silverfishEmeralds = true;
public static boolean noMeddling = false;
public static boolean tagResearch = true;
@@ -67,17 +67,17 @@ public class Config
public static Material taintMaterial;
public static void configurate(File targ)
{
Configuration conf = new Configuration(targ);
public static void configurate(File targ)
{
Configuration conf = new Configuration(targ);
try
{
conf.load();
int idCount = 9342;
shardID = conf.getItem("Nether Shards", idCount++).getInt();
skullAxeID = conf.getItem("Axe of the Skulltaker", idCount++).getInt();
arcaneCakeItemID = conf.getItem("Thaumic Cake", idCount++).getInt();
try
{
conf.load();
int idCount = 9342;
shardID = conf.getItem("Nether Shards", idCount++).getInt();
skullAxeID = conf.getItem("Axe of the Skulltaker", idCount++).getInt();
arcaneCakeItemID = conf.getItem("Thaumic Cake", idCount++).getInt();
taintShovelID = conf.getItem("Shovel of the Purifier", idCount++).getInt();
wandCoreID = conf.getItem("Wand Cores", idCount++).getInt();
resourceID = conf.getItem("Various Resources", idCount++).getInt();
@@ -88,9 +88,9 @@ public class Config
morphSwordID = conf.getItem("Chameleon Sword", idCount++).getInt();
morphShovelID = conf.getItem("Chameleon Shovel", idCount++).getInt();
morphAxeID = conf.getItem("Chameleon Axe", idCount++).getInt();
int blockCount = 3000;
arcaneCakeBlockID = conf.getBlock("Thaumic Cake", blockCount++).getInt();
arcaneCakeBlockID = conf.getBlock("Thaumic Cake", blockCount++).getInt();
blackFlowerBlockID = conf.getBlock("Umbral Rose", blockCount++).getInt();
wrathCageID = conf.getBlock("Wrath Cage", blockCount++).getInt();
@@ -129,15 +129,15 @@ public class Config
Property sd = conf.get("general", "Spork of Doom", spork);
sd.comment = "What is this? I don't even...";
spork = sd.getBoolean(false);
}
catch (Exception e)
{
FMLLog.log(Level.SEVERE, e, "Forbidden Magic has a problem loading its configuration.");
}
finally
{
conf.save();
}
}
catch (Exception e)
{
FMLLog.log(Level.SEVERE, e, "Forbidden Magic has a problem loading its configuration.");
}
finally
{
conf.save();
}
try {
@@ -154,7 +154,7 @@ public class Config
e.printStackTrace();
}
}
}
public static void spawnilify()
{
@@ -11,33 +11,33 @@ import thaumcraft.api.research.ResearchItem;
public class DarkResearchItem extends ResearchItem
{
public DarkResearchItem(String par1, String par2)
{
super(par1, par2);
}
public DarkResearchItem(String par1, String par2)
{
super(par1, par2);
}
public DarkResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ResourceLocation icon)
{
super(par1, par2, tags, par3, par4, par5, icon);
}
public DarkResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ResourceLocation icon)
{
super(par1, par2, tags, par3, par4, par5, icon);
}
public DarkResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ItemStack icon)
{
super(par1, par2, tags, par3, par4, par5, icon);
}
public DarkResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ItemStack icon)
{
super(par1, par2, tags, par3, par4, par5, icon);
}
@SideOnly(Side.CLIENT)
public String getName()
{
return StatCollector.translateToLocal("forbidden.research_name." + key);
}
@SideOnly(Side.CLIENT)
public String getName()
{
return StatCollector.translateToLocal("forbidden.research_name." + key);
}
@SideOnly(Side.CLIENT)
public String getText()
{
if(Config.tagResearch)
@SideOnly(Side.CLIENT)
public String getText()
{
if(Config.tagResearch)
return "[FM] " + StatCollector.translateToLocal("forbidden.research_text." + key);
else
return StatCollector.translateToLocal("forbidden.research_text." + key);
}
}
}
+105 -105
View File
@@ -50,13 +50,13 @@ import thaumcraft.api.aspects.Aspect;
public class FMEventHandler
{
Random randy = new Random();
Random randy = new Random();
final Aspect[] primals = {Aspect.ENTROPY, Aspect.ORDER, Aspect.FIRE, Aspect.WATER, Aspect.EARTH, Aspect.AIR};
@ForgeSubscribe
public void onLivingDrops(LivingDropsEvent event)
{
if(Config.silverfishEmeralds && event.entityLiving instanceof EntitySilverfish){
@ForgeSubscribe
public void onLivingDrops(LivingDropsEvent event)
{
if(Config.silverfishEmeralds && event.entityLiving instanceof EntitySilverfish){
if(event.entityLiving.worldObj.getBiomeGenForCoords((int)event.entityLiving.posX, (int)event.entityLiving.posZ).biomeID ==
BiomeGenBase.extremeHills.biomeID){
@@ -88,131 +88,131 @@ public class FMEventHandler
}
if (event.entityLiving.getClass() == EntitySkeleton.class && event.recentlyHit && event.source.getEntity() != null
&& event.source.getEntity() instanceof EntityPlayer)
{
ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
&& event.source.getEntity() instanceof EntityPlayer)
{
ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(26) <= (3 + EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap)))
{
addDrop(event, new ItemStack(Item.skull.itemID, 1, ((EntitySkeleton)event.entityLiving).getSkeletonType()));
}
}
if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(26) <= (3 + EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap)))
{
addDrop(event, new ItemStack(Item.skull.itemID, 1, ((EntitySkeleton)event.entityLiving).getSkeletonType()));
}
}
if (event.entityLiving.getClass() == EntityZombie.class && event.recentlyHit && event.source.getEntity() != null
&& event.source.getEntity() instanceof EntityPlayer)
{
ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
if (event.entityLiving.getClass() == EntityZombie.class && event.recentlyHit && event.source.getEntity() != null
&& event.source.getEntity() instanceof EntityPlayer)
{
ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(26) <= (2 + 2 * EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap)))
{
addDrop(event, new ItemStack(Item.skull.itemID, 1, 2));
}
}
if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(26) <= (2 + 2 * EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap)))
{
addDrop(event, new ItemStack(Item.skull.itemID, 1, 2));
}
}
if (event.entityLiving.getClass() == EntityCreeper.class && event.recentlyHit && event.source.getEntity() != null
&& event.source.getEntity() instanceof EntityPlayer)
{
ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
if (event.entityLiving.getClass() == EntityCreeper.class && event.recentlyHit && event.source.getEntity() != null
&& event.source.getEntity() instanceof EntityPlayer)
{
ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(26) <= (2 + 2 * EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap)))
{
addDrop(event, new ItemStack(Item.skull.itemID, 1, 4));
}
}
if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(26) <= (2 + 2 * EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap)))
{
addDrop(event, new ItemStack(Item.skull.itemID, 1, 4));
}
}
if (event.entityLiving instanceof EntityPlayer && event.recentlyHit && event.source.getEntity() != null
&& event.source.getEntity() instanceof EntityPlayer)
{
ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
if (event.entityLiving instanceof EntityPlayer && event.recentlyHit && event.source.getEntity() != null
&& event.source.getEntity() instanceof EntityPlayer)
{
ItemStack weap = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(11) <= (1 + EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap)))
{
ItemStack head = new ItemStack(Item.skull.itemID, 1, 3);
NBTTagCompound nametag = new NBTTagCompound();
nametag.setString("SkullOwner", ((EntityPlayer)event.entityLiving).username);
head.setTagInfo("SkullOwner", nametag);
addDrop(event, head);
}
}
if (weap != null && weap.itemID == ForbiddenItems.skullAxe.itemID && randy.nextInt(11) <= (1 + EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, weap)))
{
ItemStack head = new ItemStack(Item.skull.itemID, 1, 3);
NBTTagCompound nametag = new NBTTagCompound();
nametag.setString("SkullOwner", ((EntityPlayer)event.entityLiving).username);
head.setTagInfo("SkullOwner", nametag);
addDrop(event, head);
}
}
if (event.entityLiving.worldObj.provider.dimensionId != -1)
return;
if (event.entityLiving.worldObj.provider.dimensionId != -1)
return;
if (!event.recentlyHit || event.source.getEntity() == null || !(event.source.getEntity() instanceof EntityPlayer)
|| event.source.getEntity() instanceof FakePlayer)
{
if (randy.nextInt(30) < 4)
{
addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 1 + randy.nextInt(3), 5));
}
}
if (!event.recentlyHit || event.source.getEntity() == null || !(event.source.getEntity() instanceof EntityPlayer)
|| event.source.getEntity() instanceof FakePlayer)
{
if (randy.nextInt(30) < 4)
{
addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 1 + randy.nextInt(3), 5));
}
}
if (event.recentlyHit && event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer
if (event.recentlyHit && event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer
&& !(event.source.getEntity() instanceof FakePlayer))
{
if (event.entityLiving instanceof IMob)
{
int wrath = 2;
ItemStack heldItem = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
{
if (event.entityLiving instanceof IMob)
{
int wrath = 2;
ItemStack heldItem = ((EntityPlayer)event.source.getEntity()).getCurrentEquippedItem();
if (heldItem != null)
{
if (heldItem.getItem() instanceof ItemTool)
{
wrath += (int)(((ItemTool)heldItem.getItem()).damageVsEntity);
}
else if (heldItem.getItem() instanceof ItemSword)
{
wrath += (int)(((ItemSword)heldItem.getItem()).func_82803_g() + 4.0F);
}
if (heldItem != null)
{
if (heldItem.getItem() instanceof ItemTool)
{
wrath += (int)(((ItemTool)heldItem.getItem()).damageVsEntity);
}
else if (heldItem.getItem() instanceof ItemSword)
{
wrath += (int)(((ItemSword)heldItem.getItem()).func_82803_g() + 4.0F);
}
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.sharpness.effectId, heldItem);
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, heldItem);
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.sharpness.effectId, heldItem);
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, heldItem);
if (!event.entityLiving.isImmuneToFire())
{
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, heldItem);
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, heldItem);
}
if (!event.entityLiving.isImmuneToFire())
{
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.fireAspect.effectId, heldItem);
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, heldItem);
}
if (event.entityLiving.isEntityUndead())
{
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.smite.effectId, heldItem);
}
if (event.entityLiving.isEntityUndead())
{
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.smite.effectId, heldItem);
}
if (event.entityLiving.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
{
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.baneOfArthropods.effectId, heldItem);
}
}
if (event.entityLiving.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)
{
wrath += EnchantmentHelper.getEnchantmentLevel(Enchantment.baneOfArthropods.effectId, heldItem);
}
}
if (randy.nextInt(61) <= wrath)
{
addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 1, 0));
}
if (randy.nextInt(61) <= wrath)
{
addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 1, 0));
}
if(event.entityLiving instanceof IBossDisplayData){
addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 2 + randy.nextInt(1 + event.lootingLevel), 3));
}
}
}
if (event.entityLiving instanceof EntityPigZombie && !(event.source.getEntity() instanceof FakePlayer))
{
if (event.entityLiving instanceof EntityPigZombie && !(event.source.getEntity() instanceof FakePlayer))
{
if (event.entityLiving.getHeldItem() != null && event.entityLiving.getHeldItem().itemID == ForbiddenItems.deadlyShards.itemID
&& event.entityLiving.getHeldItem().getItemDamage() == 1)
{
addDrop(event, new ItemStack(ForbiddenItems.deadlyShards, 1, 1));
}
}
}
}
}
}
}
public void addDrop(LivingDropsEvent event, ItemStack drop)
{
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, drop);
entityitem.delayBeforeCanPickup = 10;
event.drops.add(entityitem);
}
public void addDrop(LivingDropsEvent event, ItemStack drop)
{
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, drop);
entityitem.delayBeforeCanPickup = 10;
event.drops.add(entityitem);
}
@ForgeSubscribe
public void onDeath(LivingDeathEvent event){
@@ -346,9 +346,9 @@ public class FMEventHandler
return;
if(event.itemStack.getItem() instanceof ItemWandCasting && ((ItemWandCasting)event.itemStack.getItem()).getRod(event.itemStack).getTag().equals("blood")){
if (!event.itemStack.stackTagCompound.getString("ownerName").equals(""))
{
event.toolTip.add("Current owner: " + event.itemStack.stackTagCompound.getString("ownerName"));
}
{
event.toolTip.add("Current owner: " + event.itemStack.stackTagCompound.getString("ownerName"));
}
}
}
@@ -11,25 +11,25 @@ import cpw.mods.fml.relauncher.SideOnly;
public class FauxResearchItem extends ResearchItem
{
public ResearchItem original;
public ResearchItem original;
public FauxResearchItem(String name, String cat, String origin, String originCategory, int x, int y, ResourceLocation icon)
{
super(name, cat, new AspectList(), x, y, 1, icon);
public FauxResearchItem(String name, String cat, String origin, String originCategory, int x, int y, ResourceLocation icon)
{
super(name, cat, new AspectList(), x, y, 1, icon);
original = ((ResearchCategoryList)ResearchCategories.researchCategories.get(originCategory)).research.get(origin);
bindToOriginal();
setStub();
setHidden();
}
}
public FauxResearchItem(String name, String cat, String origin, String originCategory, int x, int y, ItemStack icon)
{
super(name, cat, new AspectList(), x, y, 1, icon);
{
super(name, cat, new AspectList(), x, y, 1, icon);
original = ((ResearchCategoryList)ResearchCategories.researchCategories.get(originCategory)).research.get(origin);
bindToOriginal();
setStub();
setHidden();
}
}
private void bindToOriginal()
{
@@ -47,36 +47,36 @@ public class FauxResearchItem extends ResearchItem
}
}
public ResearchPage[] getPages()
{
return original.getPages();
}
public ResearchPage[] getPages()
{
return original.getPages();
}
@SideOnly(Side.CLIENT)
public String getName()
{
return original.getName();
}
@SideOnly(Side.CLIENT)
public String getName()
{
return original.getName();
}
@SideOnly(Side.CLIENT)
public String getText()
{
return original.getText();
}
@SideOnly(Side.CLIENT)
public String getText()
{
return original.getText();
}
public boolean isStub()
{
return true;
}
public boolean isStub()
{
return true;
}
public boolean isHidden()
{
return true;
}
public boolean isHidden()
{
return true;
}
public int getComplexity()
{
return 1;
}
public int getComplexity()
{
return 1;
}
}
@@ -31,9 +31,9 @@ import thaumcraft.common.items.wands.ItemWandCasting;
public class ForbiddenRecipes
{
public static void addRecipes()
{
{
ForbiddenResearch.recipes.put("SkullAxe", ThaumcraftApi.addInfusionCraftingRecipe("SKULLAXE", new ItemStack(ForbiddenItems.skullAxe), 1, (new AspectList()).add(DarkAspects.WRATH, 8).add(Aspect.WEAPON, 8).add(DarkAspects.NETHER, 8), ItemApi.getItem("itemAxeThaumium", 0), new ItemStack[] {new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 0), new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 0), new ItemStack(Item.diamond), new ItemStack(Item.skull.itemID, 1, 1)}));
ForbiddenResearch.recipes.put("ArcaneCake", ThaumcraftApi.addInfusionCraftingRecipe("ARCANECAKE", new ItemStack(ForbiddenItems.arcaneCakeItem), 3, (new AspectList()).add(DarkAspects.GLUTTONY, 12).add(Aspect.HUNGER, 24).add(Aspect.CRAFT, 24), new ItemStack(Item.cake), new ItemStack[] {ItemApi.getItem("itemResource", 14), new ItemStack(Item.egg), new ItemStack(Item.bucketMilk), new ItemStack(Item.egg), new ItemStack(Item.sugar), new ItemStack(Item.sugar)}));
ForbiddenResearch.recipes.put("ArcaneCake", ThaumcraftApi.addInfusionCraftingRecipe("ARCANECAKE", new ItemStack(ForbiddenItems.arcaneCakeItem), 3, (new AspectList()).add(DarkAspects.GLUTTONY, 12).add(Aspect.HUNGER, 24).add(Aspect.CRAFT, 24), new ItemStack(Item.cake), new ItemStack[] {ItemApi.getItem("itemResource", 14), new ItemStack(Item.egg), new ItemStack(Item.bucketMilk), new ItemStack(Item.egg), new ItemStack(Item.sugar), new ItemStack(Item.sugar)}));
ForbiddenResearch.recipes.put("TaintShovel", ThaumcraftApi.addInfusionCraftingRecipe("TAINTSHOVEL", new ItemStack(ForbiddenItems.taintShovel), 5, (new AspectList()).add(Aspect.HEAL, 8).add(Aspect.CRYSTAL, 24).add(Aspect.MINE, 12), ItemApi.getItem("itemShovelThaumium", 0), new ItemStack[]{ItemApi.getItem("itemShard", 4), ItemApi.getItem("itemShard", 4), new ItemStack(Item.diamond), ItemApi.getBlock("blockMagicalLog", 1)}));
ForbiddenResearch.recipes.put("TaintPick", ThaumcraftApi.addInfusionCraftingRecipe("TAINTPICK", new ItemStack(ForbiddenItems.taintPickaxe), 1, (new AspectList()).add(Aspect.ENTROPY, 8).add(Aspect.MINE, 8).add(Aspect.TAINT, 12), ItemApi.getItem("itemPickThaumium", 0), new ItemStack[]{ItemApi.getItem("itemShard", 5), ItemApi.getItem("itemShard", 5), new ItemStack(Item.diamond), ItemApi.getBlock("blockMagicalLog", 0)}));
ForbiddenResearch.recipes.put("MorphPick", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphPickaxe), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.TOOL, 16), ItemApi.getItem("itemPickThaumium", 0), new ItemStack[]{new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(ForbiddenItems.deadlyShards.itemID, 1, 1), new ItemStack(Item.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1)}));
@@ -109,5 +109,5 @@ public class ForbiddenRecipes
ForbiddenResearch.recipes.put("InfernalFurnace", Arrays.asList(new Object[]{(new AspectList()).add(Aspect.FIRE, 50).add(Aspect.EARTH, 50), Integer.valueOf(3), Integer.valueOf(3), Integer.valueOf(3), Arrays.asList(new ItemStack[]{new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), ItemApi.getBlock("blockHole", 15), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.lavaMoving), new ItemStack(Block.fenceIron), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.obsidian), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick), new ItemStack(Block.obsidian), new ItemStack(Block.netherBrick)})}));
}
}
}
}
@@ -28,10 +28,10 @@ import thaumcraft.api.research.ResearchPage;
public class ForbiddenResearch
{
public static HashMap recipes = new HashMap();
public static HashMap recipes = new HashMap();
public static void addResearch()
{
public static void addResearch()
{
addInfernalism();
(new DarkResearchItem("TAINTSHOVEL", "ARTIFICE", (new AspectList()).add(Aspect.CRYSTAL, 1).add(Aspect.TAINT, 2).add(Aspect.TOOL, 1), -9, 6, 4, new ItemStack(ForbiddenItems.taintShovel))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.TAINTSHOVEL.1"), new ResearchPage((InfusionRecipe)recipes.get("TaintShovel")), new ResearchPage("forbidden.research_page.TAINTSHOVEL.2")}).setParentsHidden(new String[]{"THAUMIUM", "INFUSION", "ETHEREALBLOOM"}).setConcealed().registerResearchItem();
@@ -52,7 +52,7 @@ public class ForbiddenResearch
}
}
}
public static void addInfernalism()
{
@@ -69,7 +69,7 @@ public class ForbiddenResearch
(new DarkResearchItem("NETHERSHARDS", "INFERNALISM", new AspectList(), 0, 0, 0, new ItemStack(ForbiddenItems.deadlyShards, 1, 0))).setPages(new ResearchPage[] {new ResearchPage("forbidden.research_page.NETHERSHARDS.1"), new ResearchPage("forbidden.research_page.NETHERSHARDS.2b"), new ResearchPage("forbidden.research_page.NETHERSHARDS.3")}).setStub().setRound().setAutoUnlock().registerResearchItem();
(new DarkResearchItem("SKULLAXE", "INFERNALISM", (new AspectList()).add(Aspect.WEAPON, 1).add(DarkAspects.WRATH, 2).add(DarkAspects.NETHER, 1), -8, -2, 4, new ItemStack(ForbiddenItems.skullAxe))).setPages(new ResearchPage[] {new ResearchPage("forbidden.research_page.SKULLAXE.1"), new ResearchPage((InfusionRecipe)recipes.get("SkullAxe"))}).setParents(new String[] {"THAUMIUM", "INFAUXSION"}).setConcealed().registerResearchItem();
(new DarkResearchItem("ARCANECAKE", "INFERNALISM", (new AspectList()).add(DarkAspects.GLUTTONY, 2).add(Aspect.HUNGER, 1).add(Aspect.CRAFT, 1), -8, 1, 3, new ItemStack(ForbiddenItems.arcaneCakeItem))).setPages(new ResearchPage[] {new ResearchPage("forbidden.research_page.ARCANECAKE.1"), new ResearchPage((InfusionRecipe)recipes.get("ArcaneCake"))}).setParents(new String[] {"INFAUXSION"}).setHidden().registerResearchItem();
(new DarkResearchItem("ARCANECAKE", "INFERNALISM", (new AspectList()).add(DarkAspects.GLUTTONY, 2).add(Aspect.HUNGER, 1).add(Aspect.CRAFT, 1), -8, 1, 3, new ItemStack(ForbiddenItems.arcaneCakeItem))).setPages(new ResearchPage[] {new ResearchPage("forbidden.research_page.ARCANECAKE.1"), new ResearchPage((InfusionRecipe)recipes.get("ArcaneCake"))}).setParents(new String[] {"INFAUXSION"}).setHidden().registerResearchItem();
(new DarkResearchItem("MORPHTOOLS", "INFERNALISM", (new AspectList()).add(Aspect.TOOL, 2).add(DarkAspects.ENVY, 3).add(Aspect.EXCHANGE, 2), -5, 5, 5, new ItemStack(ForbiddenItems.morphPickaxe))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.MORPHTOOLS.1"), new ResearchPage((InfusionRecipe)recipes.get("MorphPick")), new ResearchPage((InfusionRecipe)recipes.get("MorphSword")), new ResearchPage((InfusionRecipe)recipes.get("MorphShovel")), new ResearchPage((InfusionRecipe)recipes.get("MorphAxe"))}).setParentsHidden(new String[]{"THAUMIUM", "INFUSIONENCHANTMENT"}).setParents(new String[]{"INFAUXSIONENCHANTMENT"}).setConcealed().registerResearchItem();
(new DarkResearchItem("ROD_infernal", "INFERNALISM", (new AspectList()).add(DarkAspects.NETHER, 2).add(Aspect.FIRE, 1).add(Aspect.TOOL, 1), -8, 0, 5, new ItemStack(ForbiddenItems.wandCore, 1, 1))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.ROD_infernal.1"), new ResearchPage((InfusionRecipe)recipes.get("WandRodInfernal")), new ResearchPage("forbidden.research_page.ROD_infernal.2")}).setParents(new String[]{"ROD_silverwood", "INFAUXSION"}).setConcealed().registerResearchItem();
(new DarkResearchItem("CLUSTER", "INFERNALISM", (new AspectList()).add(Aspect.METAL, 1).add(Aspect.FIRE, 2).add(DarkAspects.ENVY, 1), -7, 7, 3, new ResourceLocation("forbidden", "textures/misc/lucrative.png"))).setPages(new ResearchPage[]{new ResearchPage("forbidden.research_page.CLUSTER.1"), new ResearchPage((InfusionEnchantmentRecipe)recipes.get("Cluster"))}).setParents(new String[]{"MORPHTOOLS", "ELEMENTALPICK"}).setConcealed().registerResearchItem();
+12 -12
View File
@@ -8,25 +8,25 @@ import net.minecraft.creativetab.CreativeTabs;
public final class ForbiddenTab extends CreativeTabs
{
private boolean crystal = false;
private boolean crystal = false;
public ForbiddenTab(String tabName)
{
super(tabName);
}
{
super(tabName);
}
public ForbiddenTab(String tabName, boolean mobCrystal)
{
super(tabName);
{
super(tabName);
crystal = mobCrystal;
}
}
@SideOnly(Side.CLIENT)
public int getTabIconItemIndex()
{
if(!crystal)
@SideOnly(Side.CLIENT)
public int getTabIconItemIndex()
{
if(!crystal)
return ForbiddenItems.fork.itemID;
else
return ForbiddenItems.mobCrystal.itemID;
}
}
}
@@ -17,132 +17,132 @@ import net.minecraft.world.World;
public class BlockArcaneCake extends Block
{
@SideOnly(Side.CLIENT)
private Icon cakeTopIcon;
@SideOnly(Side.CLIENT)
private Icon cakeBottomIcon;
@SideOnly(Side.CLIENT)
private Icon cakeInsideIcon;
@SideOnly(Side.CLIENT)
private Icon cakeTopIcon;
@SideOnly(Side.CLIENT)
private Icon cakeBottomIcon;
@SideOnly(Side.CLIENT)
private Icon cakeInsideIcon;
protected BlockArcaneCake(int par1)
{
super(par1, Material.cake);
this.setTickRandomly(true);
}
protected BlockArcaneCake(int par1)
{
super(par1, Material.cake);
this.setTickRandomly(true);
}
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
float f = 0.0625F;
float f1 = (float)(1 + l) / 12.0F;
this.setBlockBounds(f1, 0.0F, f, 1.0F - f, 0.5F, 1.0F - f);
}
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
float f = 0.0625F;
float f1 = (float)(1 + l) / 12.0F;
this.setBlockBounds(f1, 0.0F, f, 1.0F - f, 0.5F, 1.0F - f);
}
/**
* Sets the block's bounds for rendering it as an item
*/
public void setBlockBoundsForItemRender()
{
float f = 0.0625F;
float f1 = 0.5F;
this.setBlockBounds(f, 0.0F, f, 1.0F - f, f1, 1.0F - f);
}
/**
* Sets the block's bounds for rendering it as an item
*/
public void setBlockBoundsForItemRender()
{
float f = 0.0625F;
float f1 = 0.5F;
this.setBlockBounds(f, 0.0F, f, 1.0F - f, f1, 1.0F - f);
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
int l = par1World.getBlockMetadata(par2, par3, par4);
float f = 0.0625F;
float f1 = (float)(1 + l) / 12.0F;
float f2 = 0.5F;
return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + f1), (double)par3, (double)((float)par4 + f), (double)((float)(par2 + 1) - f), (double)((float)par3 + f2 - f), (double)((float)(par4 + 1) - f));
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
int l = par1World.getBlockMetadata(par2, par3, par4);
float f = 0.0625F;
float f1 = (float)(1 + l) / 12.0F;
float f2 = 0.5F;
return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + f1), (double)par3, (double)((float)par4 + f), (double)((float)(par2 + 1) - f), (double)((float)par3 + f2 - f), (double)((float)(par4 + 1) - f));
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT)
/**
* Returns the bounding box of the wired rectangular prism to render.
*/
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
int l = par1World.getBlockMetadata(par2, par3, par4);
float f = 0.0625F;
float f1 = (float)(1 + l) / 12.0F;
float f2 = 0.5F;
return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + f1), (double)par3, (double)((float)par4 + f), (double)((float)(par2 + 1) - f), (double)((float)par3 + f2), (double)((float)(par4 + 1) - f));
}
/**
* Returns the bounding box of the wired rectangular prism to render.
*/
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
int l = par1World.getBlockMetadata(par2, par3, par4);
float f = 0.0625F;
float f1 = (float)(1 + l) / 12.0F;
float f2 = 0.5F;
return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + f1), (double)par3, (double)((float)par4 + f), (double)((float)(par2 + 1) - f), (double)((float)par3 + f2), (double)((float)(par4 + 1) - f));
}
@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT)
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public Icon getIcon(int par1, int par2)
{
return par1 == 1 ? this.cakeTopIcon : (par1 == 0 ? this.cakeBottomIcon : (par2 > 0 && par1 == 4 ? this.cakeInsideIcon : this.blockIcon));
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public Icon getIcon(int par1, int par2)
{
return par1 == 1 ? this.cakeTopIcon : (par1 == 0 ? this.cakeBottomIcon : (par2 > 0 && par1 == 4 ? this.cakeInsideIcon : this.blockIcon));
}
@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT)
/**
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
* is the only chance you get to register icons.
*/
public void registerIcons(IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon("forbidden:cake_side");
this.cakeInsideIcon = par1IconRegister.registerIcon("forbidden:cake_inner");
this.cakeTopIcon = par1IconRegister.registerIcon("forbidden:cake_top");
this.cakeBottomIcon = par1IconRegister.registerIcon("forbidden:cake_bottom");
}
/**
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
* is the only chance you get to register icons.
*/
public void registerIcons(IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon("forbidden:cake_side");
this.cakeInsideIcon = par1IconRegister.registerIcon("forbidden:cake_inner");
this.cakeTopIcon = par1IconRegister.registerIcon("forbidden:cake_top");
this.cakeBottomIcon = par1IconRegister.registerIcon("forbidden:cake_bottom");
}
/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer);
return true;
}
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer);
return true;
}
/**
* Called when the block is clicked by a player. Args: x, y, z, entityPlayer
*/
public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer);
}
/**
* Called when the block is clicked by a player. Args: x, y, z, entityPlayer
*/
public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer);
}
/**
* Heals the player and removes a slice from the cake.
*/
private void eatCakeSlice(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
if (par5EntityPlayer.canEat(false))
{
/**
* Heals the player and removes a slice from the cake.
*/
private void eatCakeSlice(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
if (par5EntityPlayer.canEat(false))
{
par5EntityPlayer.getFoodStats().addStats(2, 3.0F);
int l = par1World.getBlockMetadata(par2, par3, par4) + 1;
@@ -155,78 +155,78 @@ public class BlockArcaneCake extends Block
par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);
}
}
}
}
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.updateTick(par1World, par2, par3, par4, par5Random);
int l = par1World.getBlockMetadata(par2, par3, par4);
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.updateTick(par1World, par2, par3, par4, par5Random);
int l = par1World.getBlockMetadata(par2, par3, par4);
if (l > 0)
{
//if (par5Random.nextInt((int)(25.0F / f) + 1) == 0)
//{
--l;
par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);
//}
}
}
if (l > 0)
{
//if (par5Random.nextInt((int)(25.0F / f) + 1) == 0)
//{
--l;
par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);
//}
}
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return !super.canPlaceBlockAt(par1World, par2, par3, par4) ? false : this.canBlockStay(par1World, par2, par3, par4);
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return !super.canPlaceBlockAt(par1World, par2, par3, par4) ? false : this.canBlockStay(par1World, par2, par3, par4);
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
if (!this.canBlockStay(par1World, par2, par3, par4))
{
par1World.setBlockToAir(par2, par3, par4);
}
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
if (!this.canBlockStay(par1World, par2, par3, par4))
{
par1World.setBlockToAir(par2, par3, par4);
}
}
/**
* Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
*/
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
return par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid();
}
/**
* Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
*/
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
return par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid();
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 0;
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 0;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return 0;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return 0;
}
@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT)
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return ForbiddenItems.arcaneCakeItem.itemID;
}
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return ForbiddenItems.arcaneCakeItem.itemID;
}
}
@@ -14,23 +14,23 @@ import net.minecraftforge.common.ForgeDirection;
public class BlockBlackFlower extends BlockFlower
{
protected BlockBlackFlower(int par1)
{
super(par1);
float f = 0.2F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
this.setTickRandomly(true);
protected BlockBlackFlower(int par1)
{
super(par1);
float f = 0.2F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
this.setTickRandomly(true);
this.setCreativeTab(Forbidden.tab);
}
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!par1World.isRemote && par5Random.nextInt(16) == 1)
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!par1World.isRemote && par5Random.nextInt(16) == 1)
spreadFlowers(par1World, par2, par3, par4, par5Random);
}
}
public void spreadFlowers(World par1World, int par2, int par3, int par4, Random par5Random){
int l = 15;
@@ -81,29 +81,29 @@ public class BlockBlackFlower extends BlockFlower
}
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return super.canPlaceBlockAt(par1World, par2, par3, par4) && this.canBlockStay(par1World, par2, par3, par4);
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return super.canPlaceBlockAt(par1World, par2, par3, par4) && this.canBlockStay(par1World, par2, par3, par4);
}
/**
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
* blockID passed in. Args: blockID
*/
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return Block.opaqueCubeLookup[par1];
}
/**
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
* blockID passed in. Args: blockID
*/
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return Block.opaqueCubeLookup[par1];
}
/**
* Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
*/
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
/**
* Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
*/
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
int l = par1World.getBlockId(par2, par3 - 1, par4);
return (l == Block.dirt.blockID || l == Block.grass.blockID);
}
}
}
@@ -20,59 +20,59 @@ import net.minecraft.world.World;
public class BlockWrathCage extends BlockContainer
{
protected BlockWrathCage(int par1)
{
super(par1, Material.iron);
protected BlockWrathCage(int par1)
{
super(par1, Material.iron);
this.setCreativeTab(Forbidden.tab);
}
}
/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*/
public TileEntity createNewTileEntity(World par1World)
{
return new TileEntityWrathCage();
}
/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*/
public TileEntity createNewTileEntity(World par1World)
{
return new TileEntityWrathCage();
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return blockID;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return blockID;
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 1;
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 1;
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
int j1 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15);
this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1);
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
int j1 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15);
this.dropXpOnBlockBreak(par1World, par2, par3, par4, j1);
}
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
{
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
{
ItemStack held = player.getCurrentEquippedItem();
if(held != null && held.itemID == ForbiddenItems.mobCrystal.itemID){
NBTTagCompound nbttagcompound = held.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("mob");
NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("mob");
if (nbttagstring != null)
{
if(!par1World.isRemote){
if (nbttagstring != null)
{
if(!par1World.isRemote){
TileEntityWrathCage spawner = (TileEntityWrathCage)par1World.getBlockTileEntity(x, y, z);
String mob = null;
ItemStack crystal = null;
@@ -90,18 +90,18 @@ public class BlockWrathCage extends BlockContainer
}
player.swingItem();
return true;
}
}
}
return false;
}
}
/**
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
* metadata
*/
public void breakBlock(World par1World, int x, int y, int z, int par5, int par6)
{
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
* metadata
*/
public void breakBlock(World par1World, int x, int y, int z, int par5, int par6)
{
TileEntityWrathCage spawner = (TileEntityWrathCage)par1World.getBlockTileEntity(x, y, z);
if (spawner != null && spawner.getSpawnerLogic().isMobSet())
@@ -124,25 +124,25 @@ public class BlockWrathCage extends BlockContainer
}
super.breakBlock(par1World, x, y, z, par5, par6);
}
super.breakBlock(par1World, x, y, z, par5, par6);
}
/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT)
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return blockID;
}
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return blockID;
}
}
@@ -15,18 +15,18 @@ import thaumcraft.api.aspects.Aspect;
public class ForbiddenBlocks
{
public static Block arcaneCake;
public static Block arcaneCake;
public static Block blackFlower;
public static Block wrathCage;
public static void addBlocks()
{
arcaneCake = new BlockArcaneCake(Config.arcaneCakeBlockID).setHardness(0.5F).setStepSound(Block.soundClothFootstep).setUnlocalizedName("ArcaneCake");
GameRegistry.registerBlock(arcaneCake, "ArcaneCake");
public static void addBlocks()
{
arcaneCake = new BlockArcaneCake(Config.arcaneCakeBlockID).setHardness(0.5F).setStepSound(Block.soundClothFootstep).setUnlocalizedName("ArcaneCake");
GameRegistry.registerBlock(arcaneCake, "ArcaneCake");
blackFlower = new BlockBlackFlower(Config.blackFlowerBlockID).setStepSound(Block.soundGrassFootstep).setTextureName("forbidden:flower_black").setUnlocalizedName("InkFlower");
GameRegistry.registerBlock(blackFlower, "InkFlower");
wrathCage = new BlockWrathCage(Config.wrathCageID).setHardness(5.0F).setResistance(2000.0F).setStepSound(Block.soundMetalFootstep).setTextureName("forbidden:spirit_box").setUnlocalizedName("WrathCage");
GameRegistry.registerBlock(wrathCage, "WrathCage");
GameRegistry.registerTileEntity(TileEntityWrathCage.class, "WrathCage");
}
}
}
@@ -14,23 +14,23 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class TileEntityWrathCageRenderer extends TileEntitySpecialRenderer
{
public void renderTileEntityWrathCage(TileEntityWrathCage wrathCage, double par2, double par4, double par6, float par8)
{
if(!wrathCage.getSpawnerLogic().isMobSet())
public void renderTileEntityWrathCage(TileEntityWrathCage wrathCage, double par2, double par4, double par6, float par8)
{
if(!wrathCage.getSpawnerLogic().isMobSet())
return;
GL11.glPushMatrix();
GL11.glTranslatef((float)par2 + 0.5F, (float)par4, (float)par6 + 0.5F);
renderMob(wrathCage.getSpawnerLogic(), par2, par4, par6, par8);
GL11.glPopMatrix();
}
GL11.glTranslatef((float)par2 + 0.5F, (float)par4, (float)par6 + 0.5F);
renderMob(wrathCage.getSpawnerLogic(), par2, par4, par6, par8);
GL11.glPopMatrix();
}
public static void renderMob(WrathSpawnerLogic spawnLogic, double par1, double par3, double par5, float par7)
{
Entity entity = spawnLogic.getEntityForRender();
public static void renderMob(WrathSpawnerLogic spawnLogic, double par1, double par3, double par5, float par7)
{
Entity entity = spawnLogic.getEntityForRender();
if (entity != null)
{
entity.setWorld(spawnLogic.getSpawnerWorld());
if (entity != null)
{
entity.setWorld(spawnLogic.getSpawnerWorld());
float f1 = 0.4375F;
if(spawnLogic.getEntityNameToSpawn().equals("Ghast"))
f1 = 0.1F;
@@ -38,19 +38,19 @@ public class TileEntityWrathCageRenderer extends TileEntitySpecialRenderer
f1 = 0.4F;
else if(spawnLogic.getEntityNameToSpawn().equals("Enderman"))
f1 = 0.3F;
GL11.glTranslatef(0.0F, 0.4F, 0.0F);
if(!spawnLogic.getSpawnerWorld().isBlockIndirectlyGettingPowered(spawnLogic.getSpawnerX(), spawnLogic.getSpawnerY(), spawnLogic.getSpawnerZ()))
GL11.glTranslatef(0.0F, 0.4F, 0.0F);
if(!spawnLogic.getSpawnerWorld().isBlockIndirectlyGettingPowered(spawnLogic.getSpawnerX(), spawnLogic.getSpawnerY(), spawnLogic.getSpawnerZ()))
GL11.glRotatef((float)(spawnLogic.field_98284_d + (spawnLogic.field_98287_c - spawnLogic.field_98284_d) * (double)par7) * 10.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
GL11.glScalef(f1, f1, f1);
entity.setLocationAndAngles(par1, par3, par5, 0.0F, 0.0F);
RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, par7);
}
}
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
GL11.glScalef(f1, f1, f1);
entity.setLocationAndAngles(par1, par3, par5, 0.0F, 0.0F);
RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, par7);
}
}
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
{
this.renderTileEntityWrathCage((TileEntityWrathCage)par1TileEntity, par2, par4, par6, par8);
}
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
{
this.renderTileEntityWrathCage((TileEntityWrathCage)par1TileEntity, par2, par4, par6, par8);
}
}
@@ -17,42 +17,42 @@ public class EnchantmentCluster extends Enchantment
@Override
/**
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 4;
}
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 4;
}
@Override
/**
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.fortune.effectId;
}
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.fortune.effectId;
}
@Override
public boolean canApply(ItemStack item)
{
if(item.getItem() instanceof ItemMorphPickaxe)
{
if(item.getItem() instanceof ItemMorphPickaxe)
return true;
else
return false;
}
}
@Override
/**
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
}
@@ -18,42 +18,42 @@ public class EnchantmentConsuming extends Enchantment
@Override
/**
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 1;
}
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 1;
}
@Override
/**
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.silkTouch.effectId;
}
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.silkTouch.effectId;
}
@Override
public boolean canApply(ItemStack item)
{
if(item.getItem() instanceof ItemPickaxe || item.getItem() instanceof ItemSpade)
{
if(item.getItem() instanceof ItemPickaxe || item.getItem() instanceof ItemSpade)
return true;
else
return false;
}
}
@Override
/**
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
}
@@ -17,49 +17,49 @@ public class EnchantmentEducational extends Enchantment
@Override
/**
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 1;
}
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 1;
}
/**
* Returns the minimal value of enchantability needed on the enchantment level passed.
*/
public int getMinEnchantability(int par1)
{
return 15;
}
* Returns the minimal value of enchantability needed on the enchantment level passed.
*/
public int getMinEnchantability(int par1)
{
return 15;
}
/**
* Returns the maximum value of enchantability nedded on the enchantment level passed.
*/
public int getMaxEnchantability(int par1)
{
return super.getMinEnchantability(par1) + 50;
}
/**
* Returns the maximum value of enchantability nedded on the enchantment level passed.
*/
public int getMaxEnchantability(int par1)
{
return super.getMinEnchantability(par1) + 50;
}
@Override
/**
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.looting.effectId;
}
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.looting.effectId;
}
@Override
/**
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
}
@@ -17,49 +17,49 @@ public class EnchantmentGreedy extends Enchantment
@Override
/**
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 1;
}
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 1;
}
/**
* Returns the minimal value of enchantability needed on the enchantment level passed.
*/
public int getMinEnchantability(int par1)
{
return 20;
}
* Returns the minimal value of enchantability needed on the enchantment level passed.
*/
public int getMinEnchantability(int par1)
{
return 20;
}
/**
* Returns the maximum value of enchantability nedded on the enchantment level passed.
*/
public int getMaxEnchantability(int par1)
{
return super.getMinEnchantability(par1) + 50;
}
/**
* Returns the maximum value of enchantability nedded on the enchantment level passed.
*/
public int getMaxEnchantability(int par1)
{
return super.getMinEnchantability(par1) + 50;
}
@Override
/**
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.looting.effectId;
}
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.looting.effectId;
}
@Override
/**
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
}
@@ -19,60 +19,60 @@ public class EnchantmentPigBane extends Enchantment
@Override
/**
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 5;
}
* Returns the maximum level that the enchantment can have.
*/
public int getMaxLevel()
{
return 5;
}
/**
* Returns the minimal value of enchantability needed on the enchantment level passed.
*/
public int getMinEnchantability(int par1)
{
return 1 + (par1 - 1) * 8;
}
* Returns the minimal value of enchantability needed on the enchantment level passed.
*/
public int getMinEnchantability(int par1)
{
return 1 + (par1 - 1) * 8;
}
/**
* Returns the maximum value of enchantability nedded on the enchantment level passed.
*/
public int getMaxEnchantability(int par1)
{
return this.getMinEnchantability(par1) + 20;
}
/**
* Returns the maximum value of enchantability nedded on the enchantment level passed.
*/
public int getMaxEnchantability(int par1)
{
return this.getMinEnchantability(par1) + 20;
}
@Override
/**
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.sharpness.effectId && ench.effectId != Enchantment.smite.effectId && ench.effectId != Enchantment.baneOfArthropods.effectId;
}
* Determines if the enchantment passed can be applyied together with this enchantment.
*/
public boolean canApplyTogether(Enchantment ench)
{
return super.canApplyTogether(ench) && ench.effectId != Enchantment.sharpness.effectId && ench.effectId != Enchantment.smite.effectId && ench.effectId != Enchantment.baneOfArthropods.effectId;
}
/**
* Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed.
*/
public float calcModifierLiving(int level, EntityLivingBase victim)
{
if(victim instanceof EntityPig || victim instanceof EntityPigZombie)
* Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed.
*/
public float calcModifierLiving(int level, EntityLivingBase victim)
{
if(victim instanceof EntityPig || victim instanceof EntityPigZombie)
return (float)level * 4.0F;
else
return 0.0F;
}
}
@Override
/**
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
* This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)}
* applies for <i>all possible</i> enchantments.
* @param stack
* @return
*/
public boolean canApplyAtEnchantingTable(ItemStack stack)
{
return false;
}
}
@@ -16,15 +16,15 @@ import thaumcraft.api.wands.WandCap;
*/
public class DarkWandCap extends WandCap
{
public DarkWandCap(String tag, float discount, ItemStack item, int craftCost, ResourceLocation skin)
{
super(tag, discount, item, craftCost);
public DarkWandCap(String tag, float discount, ItemStack item, int craftCost, ResourceLocation skin)
{
super(tag, discount, item, craftCost);
setTexture(skin);
}
}
public DarkWandCap(String tag, float discount, List<Aspect> specialAspects, float discountSpecial, ItemStack item, int craftCost, ResourceLocation skin)
{
super(tag, discount, specialAspects, discountSpecial, item, craftCost);
setTexture(skin);
}
public DarkWandCap(String tag, float discount, List<Aspect> specialAspects, float discountSpecial, ItemStack item, int craftCost, ResourceLocation skin)
{
super(tag, discount, specialAspects, discountSpecial, item, craftCost);
setTexture(skin);
}
}
@@ -17,9 +17,9 @@ import thaumcraft.api.wands.WandRod;
public class ForbiddenItems
{
public static Item deadlyShards;
public static Item skullAxe;
public static Item arcaneCakeItem;
public static Item deadlyShards;
public static Item skullAxe;
public static Item arcaneCakeItem;
public static Item taintShovel;
public static Item wandCore;
public static Item resource;
@@ -38,19 +38,19 @@ public class ForbiddenItems
public static WandRod WAND_ROD_BLOOD;
public static WandCap WAND_CAP_ORICHALCUM;
public static void addItems()
{
deadlyShards = new ItemDeadlyShard(Config.shardID).setUnlocalizedName("NetherShard");
GameRegistry.registerItem(deadlyShards, "NetherShard");
public static void addItems()
{
deadlyShards = new ItemDeadlyShard(Config.shardID).setUnlocalizedName("NetherShard");
GameRegistry.registerItem(deadlyShards, "NetherShard");
skullAxe = new ItemSkullAxe(Config.skullAxeID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("SkullAxe");
GameRegistry.registerItem(skullAxe, "SkullAxe");
GameRegistry.registerItem(skullAxe, "SkullAxe");
arcaneCakeItem = new ItemArcaneCake(Config.arcaneCakeItemID).setUnlocalizedName("ArcaneCake");
GameRegistry.registerItem(arcaneCakeItem, "ArcaneCakeItem");
GameRegistry.registerItem(arcaneCakeItem, "ArcaneCakeItem");
taintShovel = new ItemTaintShovel(Config.taintShovelID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("TaintShovel");
GameRegistry.registerItem(taintShovel, "TaintShovel");
GameRegistry.registerItem(taintShovel, "TaintShovel");
MinecraftForge.setToolClass(taintShovel, "shovel", 3);
taintPickaxe = new ItemTaintPickaxe(Config.taintPickaxeID, ThaumcraftApi.toolMatElemental).setUnlocalizedName("TaintPickaxe");
@@ -96,5 +96,5 @@ public class ForbiddenItems
fork.setUnlocalizedName("DiabolistSpork");
GameRegistry.registerItem(fork, "DiabolistFork");
}
}
}
@@ -15,92 +15,92 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemArcaneCake extends Item
{
public ItemArcaneCake(int par1)
{
super(par1);
this.setCreativeTab(Forbidden.tab);
}
public ItemArcaneCake(int par1)
{
super(par1);
this.setCreativeTab(Forbidden.tab);
}
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
int i1 = par3World.getBlockId(par4, par5, par6);
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
int i1 = par3World.getBlockId(par4, par5, par6);
if (i1 == Block.snow.blockID && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1)
{
par7 = 1;
}
else if (i1 != Block.vine.blockID && i1 != Block.tallGrass.blockID && i1 != Block.deadBush.blockID)
{
if (par7 == 0)
{
--par5;
}
if (i1 == Block.snow.blockID && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1)
{
par7 = 1;
}
else if (i1 != Block.vine.blockID && i1 != Block.tallGrass.blockID && i1 != Block.deadBush.blockID)
{
if (par7 == 0)
{
--par5;
}
if (par7 == 1)
{
++par5;
}
if (par7 == 1)
{
++par5;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
}
if (par7 == 5)
{
++par4;
}
}
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
{
return false;
}
else if (par1ItemStack.stackSize == 0)
{
return false;
}
else
{
if (par3World.canPlaceEntityOnSide(ForbiddenBlocks.arcaneCake.blockID, par4, par5, par6, false, par7, (Entity)null, par1ItemStack))
{
Block block = Block.blocksList[ForbiddenBlocks.arcaneCake.blockID];
int j1 = block.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0);
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
{
return false;
}
else if (par1ItemStack.stackSize == 0)
{
return false;
}
else
{
if (par3World.canPlaceEntityOnSide(ForbiddenBlocks.arcaneCake.blockID, par4, par5, par6, false, par7, (Entity)null, par1ItemStack))
{
Block block = Block.blocksList[ForbiddenBlocks.arcaneCake.blockID];
int j1 = block.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0);
if (par3World.setBlock(par4, par5, par6, ForbiddenBlocks.arcaneCake.blockID, j1, 3))
{
if (par3World.getBlockId(par4, par5, par6) == ForbiddenBlocks.arcaneCake.blockID)
{
Block.blocksList[ForbiddenBlocks.arcaneCake.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack);
Block.blocksList[ForbiddenBlocks.arcaneCake.blockID].onPostBlockPlaced(par3World, par4, par5, par6, j1);
}
if (par3World.setBlock(par4, par5, par6, ForbiddenBlocks.arcaneCake.blockID, j1, 3))
{
if (par3World.getBlockId(par4, par5, par6) == ForbiddenBlocks.arcaneCake.blockID)
{
Block.blocksList[ForbiddenBlocks.arcaneCake.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack);
Block.blocksList[ForbiddenBlocks.arcaneCake.blockID].onPostBlockPlaced(par3World, par4, par5, par6, j1);
}
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
--par1ItemStack.stackSize;
}
}
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
--par1ItemStack.stackSize;
}
}
return true;
}
}
return true;
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon("forbidden:cake");
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon("forbidden:cake");
}
}
@@ -15,58 +15,58 @@ import net.minecraft.util.MathHelper;
public class ItemDeadlyShard extends Item
{
public static final String[] vices = new String[] {"wrath", "envy", "taint", "pride", "lust", "sloth", "greed"};
public static final String[] vices = new String[] {"wrath", "envy", "taint", "pride", "lust", "sloth", "greed"};
@SideOnly(Side.CLIENT)
public Icon[] icons;
@SideOnly(Side.CLIENT)
public Icon[] icons;
public ItemDeadlyShard(int par1)
{
super(par1);
this.setMaxStackSize(64);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setCreativeTab(Forbidden.tab);
public ItemDeadlyShard(int par1)
{
super(par1);
this.setMaxStackSize(64);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setCreativeTab(Forbidden.tab);
if(Config.noLust)
vices[4] = "despair";
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icons = new Icon[7];
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icons = new Icon[7];
for (int x = 0; x < 7; x++)
{
icons[x] = ir.registerIcon("forbidden:" + vices[x] + "shard");
}
}
for (int x = 0; x < 7; x++)
{
icons[x] = ir.registerIcon("forbidden:" + vices[x] + "shard");
}
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int dam)
{
return this.icons[dam];
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int dam)
{
return this.icons[dam];
}
/**
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
* different names based on their damage or NBT.
*/
public String getUnlocalizedName(ItemStack par1ItemStack)
{
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 6);
return super.getUnlocalizedName() + "." + vices[i];
}
/**
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
* different names based on their damage or NBT.
*/
public String getUnlocalizedName(ItemStack par1ItemStack)
{
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 6);
return super.getUnlocalizedName() + "." + vices[i];
}
@SideOnly(Side.CLIENT)
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int j = 0; j < 7; ++j)
{
par3List.add(new ItemStack(par1, 1, j));
}
}
@SideOnly(Side.CLIENT)
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int j = 0; j < 7; ++j)
{
par3List.add(new ItemStack(par1, 1, j));
}
}
}
@@ -34,73 +34,73 @@ public class ItemDiabolistFork extends ItemSword implements IRepairable {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
if(Config.spork)
public void registerIcons(IconRegister ir)
{
if(Config.spork)
this.icon = ir.registerIcon("forbidden:spork");
else
this.icon = ir.registerIcon("forbidden:fork");
}
}
@Override
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return this.icon;
}
public Icon getIconFromDamage(int par1)
{
return this.icon;
}
@Override
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return 1.0F;
}
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return 1.0F;
}
@Override
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.none;
}
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.none;
}
@Override
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 0;
}
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 0;
}
@Override
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
return par1ItemStack;
}
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
return par1ItemStack;
}
@Override
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.itemID == Item.netherQuartz.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.itemID == Item.netherQuartz.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return false;
}
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return false;
}
}
@@ -24,110 +24,110 @@ public class ItemMobCrystal extends Item {
public ItemMobCrystal(int par1) {
super(par1);
this.setMaxStackSize(1);
//this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setCreativeTab(Forbidden.crysTab);
}
@SideOnly(Side.CLIENT)
/**
* allows items to add custom lines of information to the mouseover description
*/
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (par1ItemStack.hasTagCompound())
{
NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("mob");
if (nbttagstring != null)
{
Aspect mobAspect = Config.spawnerMobs.get(nbttagstring.toString());
if(mobAspect != null)
par3List.add(mobAspect.getName());
}
}
this.setMaxStackSize(1);
//this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setCreativeTab(Forbidden.crysTab);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icons = new Icon[2];
/**
* allows items to add custom lines of information to the mouseover description
*/
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (par1ItemStack.hasTagCompound())
{
NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("mob");
icons[0] = ir.registerIcon("forbidden:emptycrystal");
if (nbttagstring != null)
{
Aspect mobAspect = Config.spawnerMobs.get(nbttagstring.toString());
if(mobAspect != null)
par3List.add(mobAspect.getName());
}
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icons = new Icon[2];
icons[0] = ir.registerIcon("forbidden:emptycrystal");
icons[1] = ir.registerIcon("forbidden:mobcrystal");
}
}
@SideOnly(Side.CLIENT)
/**
* Player, Render pass, and item usage sensitive version of getIconIndex.
*
* @param stack The item stack to get the icon for. (Usually this, and usingItem will be the same if usingItem is not null)
* @param renderPass The pass to get the icon for, 0 is default.
* @param player The player holding the item
* @param usingItem The item the player is actively using. Can be null if not using anything.
* @param useRemaining The ticks remaining for the active item.
* @return The icon index
*/
public Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.hasTagCompound())
{
NBTTagCompound nbttagcompound = stack.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)(nbttagcompound.getTag("mob"));
* Player, Render pass, and item usage sensitive version of getIconIndex.
*
* @param stack The item stack to get the icon for. (Usually this, and usingItem will be the same if usingItem is not null)
* @param renderPass The pass to get the icon for, 0 is default.
* @param player The player holding the item
* @param usingItem The item the player is actively using. Can be null if not using anything.
* @param useRemaining The ticks remaining for the active item.
* @return The icon index
*/
public Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.hasTagCompound())
{
NBTTagCompound nbttagcompound = stack.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)(nbttagcompound.getTag("mob"));
if(nbttagstring != null)
return icons[1];
}
return icons[0];
}
}
@SideOnly(Side.CLIENT)
/**
* Returns the icon index of the stack given as argument.
*/
public Icon getIconIndex(ItemStack par1ItemStack)
{
if (par1ItemStack.hasTagCompound())
{
NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)(nbttagcompound.getTag("mob"));
* Returns the icon index of the stack given as argument.
*/
public Icon getIconIndex(ItemStack par1ItemStack)
{
if (par1ItemStack.hasTagCompound())
{
NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)(nbttagcompound.getTag("mob"));
if(nbttagstring != null)
return icons[1];
}
return icons[0];
}
}
@SideOnly(Side.CLIENT)
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(par1, 1, 0));
@SideOnly(Side.CLIENT)
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(par1, 1, 0));
for (String mob: Config.spawnerMobs.keySet()){
ItemStack crystal = new ItemStack(par1, 1, 0);
NBTTagString mobTag = new NBTTagString("mob", mob);
crystal.setTagInfo("mob", mobTag);
crystal.setTagInfo("mob", mobTag);
par3List.add(crystal);
}
}
}
public String getItemDisplayName(ItemStack par1ItemStack)
{
if (par1ItemStack.hasTagCompound())
{
NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("mob");
{
if (par1ItemStack.hasTagCompound())
{
NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound();
NBTTagString nbttagstring = (NBTTagString)nbttagcompound.getTag("mob");
if(nbttagstring != null)
return ("" + StatCollector.translateToLocal("entity." + nbttagstring.toString() + ".name") + " " + StatCollector.translateToLocal("item.MobCrystal.name")).trim();
}
return ("" + StatCollector.translateToLocal("item.MobCrystalEmpty.name")).trim();
}
}
}
@@ -21,44 +21,44 @@ import net.minecraftforge.common.ForgeHooks;
public class ItemMorphAxe extends ItemAxe implements IRepairable
{
public Icon[] icon;
public Icon[] icon;
public ItemMorphAxe(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
public ItemMorphAxe(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icon = new Icon[2];
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icon = new Icon[2];
this.icon[0] = ir.registerIcon("forbidden:chameleonaxe");
this.icon[1] = ir.registerIcon("forbidden:eyeaxe");
}
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamageForRenderPass(int par1, int renderPass) {
return renderPass != 1?icon[0]:icon[1];
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.epic;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.epic;
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
{
if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
{
if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){
NBTTagCompound tags = itemstack.getTagCompound();
byte phase = tags.getByte("phase");
NBTTagList enchants = itemstack.getEnchantmentTagList();
@@ -81,13 +81,13 @@ public class ItemMorphAxe extends ItemAxe implements IRepairable
world.playSoundEffect(player.posX, player.posY, player.posZ, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
}
return itemstack;
}
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemstack, int renderpass)
{
if(renderpass != 1)
public int getColorFromItemStack(ItemStack itemstack, int renderpass)
{
if(renderpass != 1)
return 16777215;
else
{
@@ -101,7 +101,7 @@ public class ItemMorphAxe extends ItemAxe implements IRepairable
else
return 0x980000;
}
}
}
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
@@ -21,44 +21,44 @@ import net.minecraftforge.common.ForgeHooks;
public class ItemMorphPickaxe extends ItemPickaxe implements IRepairable
{
public Icon[] icon;
public Icon[] icon;
public ItemMorphPickaxe(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
public ItemMorphPickaxe(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icon = new Icon[2];
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icon = new Icon[2];
this.icon[0] = ir.registerIcon("forbidden:chameleonpick");
this.icon[1] = ir.registerIcon("forbidden:eyepick");
}
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamageForRenderPass(int par1, int renderPass) {
return renderPass != 1?icon[0]:icon[1];
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.epic;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.epic;
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
{
if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
{
if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){
NBTTagCompound tags = itemstack.getTagCompound();
byte phase = tags.getByte("phase");
NBTTagList enchants = itemstack.getEnchantmentTagList();
@@ -81,13 +81,13 @@ public class ItemMorphPickaxe extends ItemPickaxe implements IRepairable
world.playSoundEffect(player.posX, player.posY, player.posZ, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
}
return itemstack;
}
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemstack, int renderpass)
{
if(renderpass != 1)
public int getColorFromItemStack(ItemStack itemstack, int renderpass)
{
if(renderpass != 1)
return 16777215;
else
{
@@ -101,7 +101,7 @@ public class ItemMorphPickaxe extends ItemPickaxe implements IRepairable
else
return 0x980000;
}
}
}
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
@@ -21,44 +21,44 @@ import net.minecraftforge.common.ForgeHooks;
public class ItemMorphShovel extends ItemSpade implements IRepairable
{
public Icon[] icon;
public Icon[] icon;
public ItemMorphShovel(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
public ItemMorphShovel(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icon = new Icon[2];
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icon = new Icon[2];
this.icon[0] = ir.registerIcon("forbidden:chameleonshovel");
this.icon[1] = ir.registerIcon("forbidden:eyeshovel");
}
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamageForRenderPass(int par1, int renderPass) {
return renderPass != 1?icon[0]:icon[1];
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.epic;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.epic;
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
{
if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
{
if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){
NBTTagCompound tags = itemstack.getTagCompound();
byte phase = tags.getByte("phase");
NBTTagList enchants = itemstack.getEnchantmentTagList();
@@ -81,13 +81,13 @@ public class ItemMorphShovel extends ItemSpade implements IRepairable
world.playSoundEffect(player.posX, player.posY, player.posZ, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
}
return itemstack;
}
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemstack, int renderpass)
{
if(renderpass != 1)
public int getColorFromItemStack(ItemStack itemstack, int renderpass)
{
if(renderpass != 1)
return 16777215;
else
{
@@ -101,7 +101,7 @@ public class ItemMorphShovel extends ItemSpade implements IRepairable
else
return 0x980000;
}
}
}
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
@@ -21,43 +21,43 @@ import net.minecraftforge.common.ForgeHooks;
public class ItemMorphSword extends ItemSword implements IRepairable
{
public Icon[] icon;
public Icon[] icon;
public ItemMorphSword(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
public ItemMorphSword(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icon = new Icon[2];
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icon = new Icon[2];
this.icon[0] = ir.registerIcon("forbidden:chameleonsword");
this.icon[1] = ir.registerIcon("forbidden:eyesword");
}
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamageForRenderPass(int par1, int renderPass) {
return renderPass != 1?icon[0]:icon[1];
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.epic;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.epic;
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(ForbiddenItems.deadlyShards, 1, 1)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
{
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
{
//player.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
if(player.isSneaking() && itemstack.hasTagCompound() && getMaxDamage() - itemstack.getItemDamage() > 5){
@@ -83,13 +83,13 @@ public class ItemMorphSword extends ItemSword implements IRepairable
world.playSoundEffect(player.posX, player.posY, player.posZ, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
}
return itemstack;
}
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemstack, int renderpass)
{
if(renderpass != 1)
public int getColorFromItemStack(ItemStack itemstack, int renderpass)
{
if(renderpass != 1)
return 16777215;
else
{
@@ -103,7 +103,7 @@ public class ItemMorphSword extends ItemSword implements IRepairable
else
return 0x980000;
}
}
}
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
@@ -17,76 +17,76 @@ import net.minecraft.util.MathHelper;
public class ItemResource extends Item
{
@SideOnly(Side.CLIENT)
public Icon[] icons;
@SideOnly(Side.CLIENT)
public Icon[] icons;
public ItemResource(int par1)
{
super(par1);
this.setMaxStackSize(64);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setCreativeTab(Forbidden.tab);
}
public ItemResource(int par1)
{
super(par1);
this.setMaxStackSize(64);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setCreativeTab(Forbidden.tab);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icons = new Icon[2];
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
icons = new Icon[2];
icons[0] = ir.registerIcon("forbidden:emerald_nugget");
icons[0] = ir.registerIcon("forbidden:emerald_nugget");
icons[1] = ir.registerIcon("forbidden:dye_powder_black");
}
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int dam)
{
return this.icons[dam];
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int dam)
{
return this.icons[dam];
}
/**
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
* different names based on their damage or NBT.
*/
public String getUnlocalizedName(ItemStack par1ItemStack)
{
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 6);
return super.getUnlocalizedName() + "." + i;
}
/**
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
* different names based on their damage or NBT.
*/
public String getUnlocalizedName(ItemStack par1ItemStack)
{
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 6);
return super.getUnlocalizedName() + "." + i;
}
@SideOnly(Side.CLIENT)
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int j = 0; j < 2; ++j)
{
par3List.add(new ItemStack(par1, 1, j));
}
}
@SideOnly(Side.CLIENT)
/**
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
*/
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (int j = 0; j < 2; ++j)
{
par3List.add(new ItemStack(par1, 1, j));
}
}
@Override
/**
* Returns true if the item can be used on the given entity, e.g. shears on sheep.
*/
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase)
{
if (par3EntityLivingBase instanceof EntitySheep && par1ItemStack.getItemDamage() == 1)
{
EntitySheep entitysheep = (EntitySheep)par3EntityLivingBase;
* Returns true if the item can be used on the given entity, e.g. shears on sheep.
*/
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase)
{
if (par3EntityLivingBase instanceof EntitySheep && par1ItemStack.getItemDamage() == 1)
{
EntitySheep entitysheep = (EntitySheep)par3EntityLivingBase;
if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != 15)
{
entitysheep.setFleeceColor(15);
--par1ItemStack.stackSize;
}
if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != 15)
{
entitysheep.setFleeceColor(15);
--par1ItemStack.stackSize;
}
return true;
}
else
{
return false;
}
}
return true;
}
else
{
return false;
}
}
}
@@ -17,47 +17,47 @@ import thaumcraft.api.ItemApi;
public class ItemSkullAxe extends ItemSword implements IRepairable
{
public Icon icon;
public Icon icon;
public ItemSkullAxe(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
public ItemSkullAxe(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
this.icon = ir.registerIcon("forbidden:skullaxe");
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
this.icon = ir.registerIcon("forbidden:skullaxe");
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return this.icon;
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return this.icon;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.uncommon;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.uncommon;
}
@Override
@Override
/**
* Return whether this item is repairable in an anvil.
*/
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(Config.thaumcraftResourceID, 1, 2)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
{
return par2ItemStack.isItemEqual(new ItemStack(Config.thaumcraftResourceID, 1, 2)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return 1.0F;
}
@Override
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return 1.0F;
}
}
@@ -20,40 +20,40 @@ import net.minecraftforge.common.ForgeHooks;
public class ItemTaintPickaxe extends ItemPickaxe implements IRepairable
{
public Icon icon;
public Icon icon;
public ItemTaintPickaxe(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
public ItemTaintPickaxe(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
this.icon = ir.registerIcon("forbidden:taintpickaxe");
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
this.icon = ir.registerIcon("forbidden:taintpickaxe");
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return this.icon;
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return this.icon;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.rare;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.rare;
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(Config.thaumcraftResourceID, 1, 2)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(Config.thaumcraftResourceID, 1, 2)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta)
{
if(block.blockHardness == 0.0F)
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta)
{
if(block.blockHardness == 0.0F)
return 0.0F;
else if(block.blockHardness < 5.0F)
return 0.1F;
@@ -62,5 +62,5 @@ public class ItemTaintPickaxe extends ItemPickaxe implements IRepairable
else
return 5.0F + block.blockHardness;
}
}
}
@@ -20,46 +20,46 @@ import net.minecraftforge.common.ForgeHooks;
public class ItemTaintShovel extends ItemSpade implements IRepairable
{
public Icon icon;
public Icon icon;
public ItemTaintShovel(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
public ItemTaintShovel(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, enumtoolmaterial);
this.setCreativeTab(Forbidden.tab);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
this.icon = ir.registerIcon("forbidden:taintshovel");
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
this.icon = ir.registerIcon("forbidden:taintshovel");
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return this.icon;
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return this.icon;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.rare;
}
public EnumRarity getRarity(ItemStack itemstack)
{
return EnumRarity.rare;
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(Config.thaumcraftResourceID, 1, 2)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return par2ItemStack.isItemEqual(new ItemStack(Config.thaumcraftResourceID, 1, 2)) ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta)
{
if (ForgeHooks.isToolEffective(stack, block, meta) || block.blockMaterial == Config.taintMaterial)
{
return efficiencyOnProperMaterial;
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta)
{
if (ForgeHooks.isToolEffective(stack, block, meta) || block.blockMaterial == Config.taintMaterial)
{
return efficiencyOnProperMaterial;
}
return getStrVsBlock(stack, block);
}
return getStrVsBlock(stack, block);
}
@Override
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) {
@@ -27,38 +27,38 @@ import thaumcraft.api.aspects.IEssentiaTransport;
public class TileEntityWrathCage extends TileEntity implements IAspectContainer, IEssentiaTransport
{
private final WrathSpawnerLogic spawnLogic = new WrathSpawnerLogic(this);
private final WrathSpawnerLogic spawnLogic = new WrathSpawnerLogic(this);
public int wrath = 0;
public int sloth = 0;
public int special = 0;
Aspect aspect;
@Override
@Override
/**
* Reads a tile entity from NBT.
*/
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readFromNBT(par1NBTTagCompound);
this.spawnLogic.readFromNBT(par1NBTTagCompound);
* Reads a tile entity from NBT.
*/
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readFromNBT(par1NBTTagCompound);
this.spawnLogic.readFromNBT(par1NBTTagCompound);
this.wrath = par1NBTTagCompound.getShort("Wrath");
this.sloth = par1NBTTagCompound.getShort("Sloth");
this.special = par1NBTTagCompound.getShort("Special");
aspect = spawnLogic.getAspect();
}
}
@Override
@Override
/**
* Writes a tile entity to NBT.
*/
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
this.spawnLogic.writeToNBT(par1NBTTagCompound);
* Writes a tile entity to NBT.
*/
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
this.spawnLogic.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setShort("Wrath", (short)this.wrath);
par1NBTTagCompound.setShort("Sloth", (short)this.sloth);
par1NBTTagCompound.setShort("Special", (short)this.special);
}
}
@Override
public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) {
@@ -73,21 +73,21 @@ public class TileEntityWrathCage extends TileEntity implements IAspectContainer,
return new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, tag);
}
/**
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
* ticks and creates a new spawn inside its implementation.
*/
public void updateEntity()
{
if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
/**
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
* ticks and creates a new spawn inside its implementation.
*/
public void updateEntity()
{
if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
this.spawnLogic.updateSpawner();
}
if(Config.wrathCost > 0 && spawnLogic.isMobSet() && !(special >= 64 || wrath >= 64 || sloth >= 64))
drawEssentia();
super.updateEntity();
}
}
void drawEssentia()
{
@@ -124,21 +124,21 @@ public class TileEntityWrathCage extends TileEntity implements IAspectContainer,
aspect = spawnLogic.getAspect();
}
/**
* Called when a client event is received with the event number and argument, see World.sendClientEvent
*/
public boolean receiveClientEvent(int par1, int par2)
{
return this.spawnLogic.setDelayToMin(par1) ? true : super.receiveClientEvent(par1, par2);
}
/**
* Called when a client event is received with the event number and argument, see World.sendClientEvent
*/
public boolean receiveClientEvent(int par1, int par2)
{
return this.spawnLogic.setDelayToMin(par1) ? true : super.receiveClientEvent(par1, par2);
}
/**
* Returns the spawner logic associated with this spawner
*/
public WrathSpawnerLogic getSpawnerLogic()
{
return this.spawnLogic;
}
/**
* Returns the spawner logic associated with this spawner
*/
public WrathSpawnerLogic getSpawnerLogic()
{
return this.spawnLogic;
}
public AspectList getAspects()
{
@@ -154,11 +154,11 @@ public class TileEntityWrathCage extends TileEntity implements IAspectContainer,
}
/**
* This method is used to determine of a specific aspect can be added to this container.
* @param tag
* @return true or false
*/
public boolean doesContainerAccept(Aspect tag)
* This method is used to determine of a specific aspect can be added to this container.
* @param tag
* @return true or false
*/
public boolean doesContainerAccept(Aspect tag)
{
if(Config.wrathCost <= 0)
return false;
@@ -167,12 +167,12 @@ public class TileEntityWrathCage extends TileEntity implements IAspectContainer,
}
/**
* This method is used to add a certain amount of an aspect to the tile entity.
* @param tag
* @param amount
* @return the amount of aspect left over that could not be added.
*/
public int addToContainer(Aspect tag, int amount)
* This method is used to add a certain amount of an aspect to the tile entity.
* @param tag
* @param amount
* @return the amount of aspect left over that could not be added.
*/
public int addToContainer(Aspect tag, int amount)
{
if(Config.wrathCost <= 0)
return amount;
@@ -192,34 +192,34 @@ public class TileEntityWrathCage extends TileEntity implements IAspectContainer,
return amount;
}
/**
* Removes a certain amount of a specific aspect from the tile entity
* @param tag
* @param amount
* @return true if that amount of aspect was available and was removed
*/
public boolean takeFromContainer(Aspect tag, int amount)
/**
* Removes a certain amount of a specific aspect from the tile entity
* @param tag
* @param amount
* @return true if that amount of aspect was available and was removed
*/
public boolean takeFromContainer(Aspect tag, int amount)
{
return false;
}
/**
* removes a bunch of different aspects and amounts from the tile entity.
* @param ot the ObjectTags object that contains the aspects and their amounts.
* @return true if all the aspects and their amounts were available and successfully removed
*/
public boolean takeFromContainer(AspectList ot)
/**
* removes a bunch of different aspects and amounts from the tile entity.
* @param ot the ObjectTags object that contains the aspects and their amounts.
* @return true if all the aspects and their amounts were available and successfully removed
*/
public boolean takeFromContainer(AspectList ot)
{
return false;
}
/**
* Checks if the tile entity contains the listed amount (or more) of the aspect
* @param tag
* @param amount
* @return
*/
public boolean doesContainerContainAmount(Aspect tag, int amount)
/**
* Checks if the tile entity contains the listed amount (or more) of the aspect
* @param tag
* @param amount
* @return
*/
public boolean doesContainerContainAmount(Aspect tag, int amount)
{
if(tag == DarkAspects.WRATH)
return wrath >= amount;
@@ -231,15 +231,15 @@ public class TileEntityWrathCage extends TileEntity implements IAspectContainer,
return false;
}
/**
* Checks if the tile entity contains all the listed aspects and their amounts
* @param ot the ObjectTags object that contains the aspects and their amounts.
* @return
*/
public boolean doesContainerContain(AspectList ot){
/**
* Checks if the tile entity contains all the listed aspects and their amounts
* @param ot the ObjectTags object that contains the aspects and their amounts.
* @return
*/
public boolean doesContainerContain(AspectList ot){
for (Aspect asp: ot.getAspects())
{
if(asp == DarkAspects.WRATH && wrath < ot.getAmount(DarkAspects.WRATH))
{
if(asp == DarkAspects.WRATH && wrath < ot.getAmount(DarkAspects.WRATH))
return false;
else if(asp == DarkAspects.SLOTH && sloth < ot.getAmount(DarkAspects.SLOTH))
return false;
@@ -247,16 +247,16 @@ public class TileEntityWrathCage extends TileEntity implements IAspectContainer,
return false;
else if(asp != DarkAspects.WRATH && asp != DarkAspects.SLOTH && asp != aspect)
return false;
}
}
return true;
}
/**
* Returns how much of the aspect this tile entity contains
* @param tag
* @return the amount of that aspect found
*/
public int containerContains(Aspect tag)
/**
* Returns how much of the aspect this tile entity contains
* @param tag
* @return the amount of that aspect found
*/
public int containerContains(Aspect tag)
{
if(tag == DarkAspects.WRATH)
return wrath;
@@ -269,60 +269,60 @@ public class TileEntityWrathCage extends TileEntity implements IAspectContainer,
}
/**
* Is this tile able to connect to other vis users/sources on the specified side?
* @param face
* @return
*/
public boolean isConnectable(ForgeDirection face)
* Is this tile able to connect to other vis users/sources on the specified side?
* @param face
* @return
*/
public boolean isConnectable(ForgeDirection face)
{
return true;
}
/**
* Is this side used to input essentia?
* @param face
* @return
*/
public boolean canInputFrom(ForgeDirection face)
/**
* Is this side used to input essentia?
* @param face
* @return
*/
public boolean canInputFrom(ForgeDirection face)
{
return true;
}
/**
* Is this side used to output essentia?
* @param face
* @return
*/
public boolean canOutputTo(ForgeDirection face)
/**
* Is this side used to output essentia?
* @param face
* @return
*/
public boolean canOutputTo(ForgeDirection face)
{
return false;
}
/**
* Sets the amount of suction this block will apply
* @param suction
*/
public void setSuction(AspectList suction)
/**
* Sets the amount of suction this block will apply
* @param suction
*/
public void setSuction(AspectList suction)
{
}
/**
* Sets the amount of suction this block will apply
* @param suction
*/
public void setSuction(Aspect aspect, int amount)
/**
* Sets the amount of suction this block will apply
* @param suction
*/
public void setSuction(Aspect aspect, int amount)
{
}
/**
* Returns the amount of suction this block is applying.
* @param loc
* the location from where the suction is being checked
* @return
*/
public AspectList getSuction(ForgeDirection face)
/**
* Returns the amount of suction this block is applying.
* @param loc
* the location from where the suction is being checked
* @return
*/
public AspectList getSuction(ForgeDirection face)
{
AspectList list = new AspectList();
if(Config.wrathCost <= 0)
@@ -337,36 +337,36 @@ public class TileEntityWrathCage extends TileEntity implements IAspectContainer,
return list;
}
/**
* remove the specified amount of vis from this transport tile
* @param suction
* @return how much was actually taken
*/
public int takeVis(Aspect aspect, int amount)
/**
* remove the specified amount of vis from this transport tile
* @param suction
* @return how much was actually taken
*/
public int takeVis(Aspect aspect, int amount)
{
return 0;
}
public AspectList getEssentia(ForgeDirection face)
public AspectList getEssentia(ForgeDirection face)
{
return getAspects();
}
/**
* Essentia will not be drawn from this container unless the suction exceeds this amount.
* @return the amount
*/
public int getMinimumSuction()
/**
* Essentia will not be drawn from this container unless the suction exceeds this amount.
* @return the amount
*/
public int getMinimumSuction()
{
return 9000;
}
/**
* Return true if you want the conduit to extend a little further into the block.
* Used by jars and alembics that have smaller than normal hitboxes
* @return
*/
public boolean renderExtendedTube()
/**
* Return true if you want the conduit to extend a little further into the block.
* Used by jars and alembics that have smaller than normal hitboxes
* @return
*/
public boolean renderExtendedTube()
{
return false;
}
@@ -28,60 +28,60 @@ import thaumcraft.common.Thaumcraft;
public class WrathSpawnerLogic
{
/** The mob spawner we deal with */
final TileEntityWrathCage mobSpawnerEntity;
/** The mob spawner we deal with */
final TileEntityWrathCage mobSpawnerEntity;
public boolean mobSet = false;
/** The delay to spawn. */
public int spawnDelay = 20;
private String mobID = "Pig";
public int spawnDelay = 20;
private String mobID = "Pig";
Aspect aspect = Aspect.GREED;
private boolean slothful = false;
private int fuel = 0;
public double field_98287_c;
public double field_98284_d;
private int minSpawnDelay = 200;
private int maxSpawnDelay = 300;
public double field_98287_c;
public double field_98284_d;
private int minSpawnDelay = 200;
private int maxSpawnDelay = 300;
/** A counter for spawn tries. */
private int spawnCount = 3;
private Entity renderEntity;
private int maxNearbyEntities = 6;
/** A counter for spawn tries. */
private int spawnCount = 3;
private Entity renderEntity;
private int maxNearbyEntities = 6;
/** The distance from which a player activates the spawner. */
private int activatingRangeFromPlayer = 16;
/** The distance from which a player activates the spawner. */
private int activatingRangeFromPlayer = 16;
/** The range coefficient for spawning entities around. */
private int spawnRange = 4;
/** The range coefficient for spawning entities around. */
private int spawnRange = 4;
WrathSpawnerLogic(TileEntityWrathCage par1TileEntityMobSpawner)
{
this.mobSpawnerEntity = par1TileEntityMobSpawner;
}
WrathSpawnerLogic(TileEntityWrathCage par1TileEntityMobSpawner)
{
this.mobSpawnerEntity = par1TileEntityMobSpawner;
}
/**
* Gets the entity name that should be spawned.
*/
public String getEntityNameToSpawn()
{
return this.mobID;
}
* Gets the entity name that should be spawned.
*/
public String getEntityNameToSpawn()
{
return this.mobID;
}
public Aspect getAspect()
{
return aspect;
}
public void setMobID(String par1Str)
{
this.mobID = par1Str;
public void setMobID(String par1Str)
{
this.mobID = par1Str;
if(Config.spawnerMobs.containsKey(mobID))
aspect = Config.spawnerMobs.get(mobID);
else
aspect = Aspect.GREED;
}
}
public void mobIsSet(boolean inp){
mobSet = inp;
@@ -92,33 +92,33 @@ public class WrathSpawnerLogic
return mobSet;
}
public void updateSpawnerBlock(int par1)
{
this.mobSpawnerEntity.worldObj.addBlockEvent(this.mobSpawnerEntity.xCoord, this.mobSpawnerEntity.yCoord, this.mobSpawnerEntity.zCoord, Block.mobSpawner.blockID, par1, 0);
}
public void updateSpawnerBlock(int par1)
{
this.mobSpawnerEntity.worldObj.addBlockEvent(this.mobSpawnerEntity.xCoord, this.mobSpawnerEntity.yCoord, this.mobSpawnerEntity.zCoord, Block.mobSpawner.blockID, par1, 0);
}
public World getSpawnerWorld()
{
return this.mobSpawnerEntity.worldObj;
}
public World getSpawnerWorld()
{
return this.mobSpawnerEntity.worldObj;
}
public int getSpawnerX()
{
return this.mobSpawnerEntity.xCoord;
}
public int getSpawnerX()
{
return this.mobSpawnerEntity.xCoord;
}
public int getSpawnerY()
{
return this.mobSpawnerEntity.yCoord;
}
public int getSpawnerY()
{
return this.mobSpawnerEntity.yCoord;
}
public int getSpawnerZ()
{
return this.mobSpawnerEntity.zCoord;
}
public int getSpawnerZ()
{
return this.mobSpawnerEntity.zCoord;
}
public void updateSpawner()
{
{
if(!mobSet)
return;
@@ -222,37 +222,37 @@ public class WrathSpawnerLogic
}
}
}
}
/**
* Checks if the entity's current position is a valid location to spawn this entity.
*/
public boolean entityCanSpawn(EntityLiving entity)
{
return entity.worldObj.checkNoEntityCollision(entity.boundingBox) && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty() && !entity.worldObj.isAnyLiquid(entity.boundingBox);
}
* Checks if the entity's current position is a valid location to spawn this entity.
*/
public boolean entityCanSpawn(EntityLiving entity)
{
return entity.worldObj.checkNoEntityCollision(entity.boundingBox) && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty() && !entity.worldObj.isAnyLiquid(entity.boundingBox);
}
private void updateDelay()
{
if (this.maxSpawnDelay <= this.minSpawnDelay)
{
this.spawnDelay = this.minSpawnDelay;
}
else
{
int i = this.maxSpawnDelay - this.minSpawnDelay;
this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(i);
}
{
if (this.maxSpawnDelay <= this.minSpawnDelay)
{
this.spawnDelay = this.minSpawnDelay;
}
else
{
int i = this.maxSpawnDelay - this.minSpawnDelay;
this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(i);
}
if(slothful)
spawnDelay += 200;
this.updateSpawnerBlock(1);
}
this.updateSpawnerBlock(1);
}
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
mobID = par1NBTTagCompound.getString("EntityId");
{
mobID = par1NBTTagCompound.getString("EntityId");
if(Config.spawnerMobs.containsKey(mobID))
aspect = Config.spawnerMobs.get(mobID);
else
@@ -260,84 +260,84 @@ public class WrathSpawnerLogic
mobSet = par1NBTTagCompound.getBoolean("MobSet");
slothful = par1NBTTagCompound.getBoolean("Slothful");
this.fuel = par1NBTTagCompound.getShort("Fuel");
this.spawnDelay = par1NBTTagCompound.getShort("Delay");
this.spawnDelay = par1NBTTagCompound.getShort("Delay");
//if (par1NBTTagCompound.hasKey("MinSpawnDelay"))
//{
// this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay");
// this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay");
// this.spawnCount = par1NBTTagCompound.getShort("SpawnCount");
//}
//if (par1NBTTagCompound.hasKey("MinSpawnDelay"))
//{
// this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay");
// this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay");
// this.spawnCount = par1NBTTagCompound.getShort("SpawnCount");
//}
if (par1NBTTagCompound.hasKey("MaxNearbyEntities"))
{
this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities");
}
if (par1NBTTagCompound.hasKey("MaxNearbyEntities"))
{
this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities");
}
if (par1NBTTagCompound.hasKey("SpawnRange"))
{
this.spawnRange = par1NBTTagCompound.getShort("SpawnRange");
}
if (par1NBTTagCompound.hasKey("SpawnRange"))
{
this.spawnRange = par1NBTTagCompound.getShort("SpawnRange");
}
if (this.getSpawnerWorld() != null && this.getSpawnerWorld().isRemote)
{
this.renderEntity = null;
}
}
if (this.getSpawnerWorld() != null && this.getSpawnerWorld().isRemote)
{
this.renderEntity = null;
}
}
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
par1NBTTagCompound.setString("EntityId", this.getEntityNameToSpawn());
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
par1NBTTagCompound.setString("EntityId", this.getEntityNameToSpawn());
par1NBTTagCompound.setBoolean("MobSet", mobSet);
par1NBTTagCompound.setBoolean("Slothful", slothful);
par1NBTTagCompound.setShort("Fuel", (short)this.fuel);
par1NBTTagCompound.setShort("Delay", (short)this.spawnDelay);
//par1NBTTagCompound.setShort("MinSpawnDelay", (short)this.minSpawnDelay);
//par1NBTTagCompound.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay);
//par1NBTTagCompound.setShort("SpawnCount", (short)this.spawnCount);
par1NBTTagCompound.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities);
par1NBTTagCompound.setShort("SpawnRange", (short)this.spawnRange);
par1NBTTagCompound.setShort("Delay", (short)this.spawnDelay);
//par1NBTTagCompound.setShort("MinSpawnDelay", (short)this.minSpawnDelay);
//par1NBTTagCompound.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay);
//par1NBTTagCompound.setShort("SpawnCount", (short)this.spawnCount);
par1NBTTagCompound.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities);
par1NBTTagCompound.setShort("SpawnRange", (short)this.spawnRange);
}
}
public Entity spawnMob(Entity par1Entity)
{
if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null)
{
((EntityLiving)par1Entity).onSpawnWithEgg((EntityLivingData)null);
this.getSpawnerWorld().spawnEntityInWorld(par1Entity);
}
{
if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null)
{
((EntityLiving)par1Entity).onSpawnWithEgg((EntityLivingData)null);
this.getSpawnerWorld().spawnEntityInWorld(par1Entity);
}
return par1Entity;
}
return par1Entity;
}
/**
* Sets the delay to minDelay if parameter given is 1, else return false.
*/
public boolean setDelayToMin(int par1)
{
if (par1 == 1 && this.getSpawnerWorld().isRemote)
{
this.spawnDelay = this.minSpawnDelay;
return true;
}
else
{
return false;
}
}
* Sets the delay to minDelay if parameter given is 1, else return false.
*/
public boolean setDelayToMin(int par1)
{
if (par1 == 1 && this.getSpawnerWorld().isRemote)
{
this.spawnDelay = this.minSpawnDelay;
return true;
}
else
{
return false;
}
}
@SideOnly(Side.CLIENT)
public Entity getEntityForRender()
{
if (this.renderEntity == null)
{
Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), (World)null);
entity = this.spawnMob(entity);
this.renderEntity = entity;
}
@SideOnly(Side.CLIENT)
public Entity getEntityForRender()
{
if (this.renderEntity == null)
{
Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), (World)null);
entity = this.spawnMob(entity);
this.renderEntity = entity;
}
return this.renderEntity;
}
return this.renderEntity;
}
}