mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-21 12:42:16 +00:00
1.1.3 Update
This commit is contained in:
1 parent
97e688ccdd
commit
65163a6ca3
158 files changed
+3273
-632
No files matched your search
@@ -3,6 +3,8 @@ package com.arc.bloodarsenal;
|
||||
import com.arc.bloodarsenal.entity.ModLivingDropsEvent;
|
||||
import com.arc.bloodarsenal.gui.GuiHandler;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import com.arc.bloodarsenal.items.bauble.SacrificeAmulet;
|
||||
import com.arc.bloodarsenal.items.bauble.SelfSacrificeAmulet;
|
||||
import com.arc.bloodarsenal.items.bauble.VampireRing;
|
||||
import com.arc.bloodarsenal.items.tinkers.BloodArsenalTinkers;
|
||||
import com.arc.bloodarsenal.items.tinkers.RecipeHelper;
|
||||
@@ -19,7 +21,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import com.arc.bloodarsenal.blocks.ModBlocks;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -32,12 +34,10 @@ import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
@Mod(modid="BloodArsenal", version="1.1.0", name="Blood Arsenal", dependencies="required-after:AWWayofTime;after:NotEnoughItems;after:Baubles;after:TConstruct", guiFactory = "com.arc.bloodarsenal.gui.ConfigGuiFactory")
|
||||
@Mod(modid="BloodArsenal", version="1.1.3", name="Blood Arsenal", dependencies="required-after:AWWayofTime;after:NotEnoughItems;after:Baubles;after:TConstruct", guiFactory = "com.arc.bloodarsenal.gui.ConfigGuiFactory")
|
||||
public class BloodArsenal
|
||||
{
|
||||
public static String MODID = "BloodArsenal";
|
||||
public static String VERSION = "1.1.0";
|
||||
public static String NAME = "Blood Arsenal";
|
||||
|
||||
@SidedProxy(clientSide = "com.arc.bloodarsenal.ClientProxy", serverSide = "com.arc.bloodarsenal.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
@@ -129,8 +129,8 @@ public class BloodArsenal
|
||||
proxy.registerEvents();
|
||||
|
||||
vampiricAura = new PotionVampiricAura(BloodArsenalConfig.vampiricAuraID, false, 0).setIconIndex(0, 0).setPotionName("Vampiric Aura");
|
||||
bleeding = new PotionVampiricAura(BloodArsenalConfig.bleedingID, false, 0).setIconIndex(0, 0).setPotionName("Bleeding");
|
||||
swimming = new PotionVampiricAura(BloodArsenalConfig.swimmingID, false, 0).setIconIndex(0, 0).setPotionName("Swimming");
|
||||
bleeding = new PotionVampiricAura(BloodArsenalConfig.bleedingID, false, 0).setIconIndex(1, 0).setPotionName("Bleeding");
|
||||
swimming = new PotionVampiricAura(BloodArsenalConfig.swimmingID, false, 0).setIconIndex(2, 0).setPotionName("Swimming");
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
@@ -142,7 +142,12 @@ public class BloodArsenal
|
||||
logger.info("Loaded Baubles integration");
|
||||
|
||||
ModItems.vampire_ring = new VampireRing();
|
||||
ModItems.self_sacrifice_amulet = new SelfSacrificeAmulet();
|
||||
ModItems.sacrifice_amulet = new SacrificeAmulet();
|
||||
|
||||
GameRegistry.registerItem(ModItems.vampire_ring, "vampire_ring");
|
||||
GameRegistry.registerItem(ModItems.self_sacrifice_amulet, "self_sacrifice_amulet");
|
||||
GameRegistry.registerItem(ModItems.sacrifice_amulet, "sacrifice_amulet");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class BloodArsenalConfig
|
||||
{
|
||||
@@ -13,6 +17,7 @@ public class BloodArsenalConfig
|
||||
public static String ritualBlacklist = "Ritual Blacklist";
|
||||
public static String toolSetting = "Tool Settings";
|
||||
public static String modSettings = "Mod Settings";
|
||||
public static String lpSettings = "LP Settings";
|
||||
public static String misc = "Miscellaneous";
|
||||
|
||||
// Config Options
|
||||
@@ -21,6 +26,10 @@ public class BloodArsenalConfig
|
||||
public static int swimmingID;
|
||||
public static int vampiricAuraID;
|
||||
|
||||
// Ritual Blacklist
|
||||
public static boolean ritualDisabledMidas;
|
||||
public static boolean ritualDisabledWither;
|
||||
|
||||
// Tool Settings
|
||||
public static boolean diamondToolsAllowed;
|
||||
|
||||
@@ -28,9 +37,9 @@ public class BloodArsenalConfig
|
||||
public static boolean baublesIntegration;
|
||||
public static boolean tinkersIntegration;
|
||||
|
||||
// Ritual Blacklist
|
||||
public static boolean ritualDisabledMidas;
|
||||
public static boolean ritualDisabledWither;
|
||||
//LP Settings
|
||||
public static int sigilSwimmingCost;
|
||||
public static int sigilDivinityCost;
|
||||
|
||||
// Miscellaneous
|
||||
public static boolean isRedGood;
|
||||
@@ -56,26 +65,37 @@ public class BloodArsenalConfig
|
||||
public static void syncConfig()
|
||||
{
|
||||
config.addCustomCategoryComment(potionId, "Change potion ID's here if you have conflicts");
|
||||
config.addCustomCategoryComment(ritualBlacklist, "Blacklist rituals that you don't want/like");
|
||||
config.addCustomCategoryComment(toolSetting, "Settings for various tools");
|
||||
config.addCustomCategoryComment(modSettings, "Disable mod integration here");
|
||||
config.addCustomCategoryComment(ritualBlacklist, "Blacklist rituals that you don't want/like");
|
||||
config.addCustomCategoryComment(modSettings, "Disable mod integration");
|
||||
config.addCustomCategoryComment(lpSettings, "Change the LP costs for things");
|
||||
config.addCustomCategoryComment(misc, "Random stuffs");
|
||||
|
||||
vampiricAuraID = config.get(potionId, "Vampiric Aura", 50).getInt(vampiricAuraID);
|
||||
bleedingID = config.get(potionId, "Bleeding", 51).getInt(bleedingID);
|
||||
swimmingID = config.get(potionId, "Swimming", 52).getInt(swimmingID);
|
||||
|
||||
ritualDisabledWither = config.get(ritualBlacklist, "Ritual of Withering", false).getBoolean(ritualDisabledWither);
|
||||
ritualDisabledMidas = config.get(ritualBlacklist, "Midas Touch", false).getBoolean(ritualDisabledMidas);
|
||||
|
||||
diamondToolsAllowed = config.get(toolSetting, "Are Infused Diamond tools allowed", true).getBoolean(diamondToolsAllowed);
|
||||
|
||||
baublesIntegration = config.get(modSettings, "Disable Baubles integration?", false).getBoolean(baublesIntegration);
|
||||
tinkersIntegration = config.get(modSettings, "Disable TConstruct integration?", false).getBoolean(tinkersIntegration);
|
||||
|
||||
ritualDisabledWither = config.get(ritualBlacklist, "Ritual of Withering", false).getBoolean(ritualDisabledWither);
|
||||
ritualDisabledMidas = config.get(ritualBlacklist, "Midas Touch", false).getBoolean(ritualDisabledMidas);
|
||||
sigilSwimmingCost = config.get(lpSettings, "Sigil of Swimming cost; Default: 150", 150).getInt(sigilSwimmingCost);
|
||||
sigilDivinityCost = config.get(lpSettings, "Sigil of Divinity cost; Default: 1000000", 1000000).getInt(sigilDivinityCost);
|
||||
|
||||
isRedGood = config.get(misc, "Is RED > PURPLE?", false, "Purple is always better than Red. But I won't tell you how to live your life. Even if it is incorrectly.").getBoolean(isRedGood);
|
||||
cakeIsLie = config.get(misc, "The cake is a lie", false, "The cake is a lie").getBoolean(cakeIsLie);
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
public static void lpDouble(AltarRecipe altarRecipe)
|
||||
{
|
||||
List<AltarRecipe> recipeList = AltarRecipeRegistry.altarRecipes;
|
||||
int recipeCost = altarRecipe.getLiquidRequired();
|
||||
int newCost = recipeCost * 2;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,25 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import baubles.common.network.PacketHandler;
|
||||
import baubles.common.network.PacketSyncBauble;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import com.arc.bloodarsenal.items.bauble.SacrificeAmulet;
|
||||
import com.arc.bloodarsenal.items.bauble.SelfSacrificeAmulet;
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
@@ -21,13 +32,13 @@ public class BloodArsenalEventHooks
|
||||
{
|
||||
EntityLivingBase entityAttacked = event.entityLiving;
|
||||
Entity entityAttacking = event.source.getSourceOfDamage();
|
||||
float damageDone = event.ammount;
|
||||
|
||||
if (entityAttacking != null && entityAttacking instanceof EntityLivingBase)
|
||||
{
|
||||
if (((EntityLivingBase) entityAttacking).isPotionActive(BloodArsenal.vampiricAura))
|
||||
{
|
||||
float damage = entityAttacked.getMaxHealth() - entityAttacked.getHealth();
|
||||
float drainedHealth = damage / 4;
|
||||
float drainedHealth = damageDone / 4;
|
||||
|
||||
((EntityLivingBase) entityAttacking).setHealth(((EntityLivingBase) entityAttacking).getHealth() + drainedHealth);
|
||||
}
|
||||
@@ -46,6 +57,85 @@ public class BloodArsenalEventHooks
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entityAttacked instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) entityAttacked;
|
||||
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
|
||||
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
|
||||
if (stack != null && stack.getItem() == ModItems.self_sacrifice_amulet)
|
||||
{
|
||||
SelfSacrificeAmulet selfSacrificeAmulet = (SelfSacrificeAmulet) ModItems.self_sacrifice_amulet;
|
||||
int lpReceived = (int) damageDone;
|
||||
boolean shouldExecute = selfSacrificeAmulet.getStoredLP(stack) < 10000;
|
||||
|
||||
if (shouldExecute)
|
||||
{
|
||||
PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
|
||||
|
||||
if (regenEffect != null && regenEffect.getAmplifier() >= 2)
|
||||
{
|
||||
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + lpReceived / 2, 10000));
|
||||
}
|
||||
else
|
||||
{
|
||||
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + lpReceived, 10000));
|
||||
}
|
||||
}
|
||||
|
||||
if (player instanceof EntityPlayerMP)
|
||||
{
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, i), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void こんちは(EntityPlayer player)
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("こんにちは!"));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingDeath(LivingDeathEvent event)
|
||||
{
|
||||
Entity killer = event.source.getEntity();
|
||||
EntityLivingBase victim = event.entityLiving;
|
||||
|
||||
if (killer instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) killer;
|
||||
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
|
||||
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
|
||||
if (stack != null && stack.getItem() == ModItems.sacrifice_amulet)
|
||||
{
|
||||
SacrificeAmulet sacrificeAmulet = (SacrificeAmulet) ModItems.sacrifice_amulet;
|
||||
float victimHealth = victim.getMaxHealth();
|
||||
boolean healthGood = victimHealth > 4.0F;
|
||||
int lpReceived = healthGood ? 200 : 50;
|
||||
boolean shouldExecute = sacrificeAmulet.getStoredLP(stack) < 10000;
|
||||
|
||||
if (shouldExecute)
|
||||
{
|
||||
sacrificeAmulet.setStoredLP(stack, Math.min(sacrificeAmulet.getStoredLP(stack) + lpReceived, 10000));
|
||||
}
|
||||
|
||||
if (player instanceof EntityPlayerMP)
|
||||
{
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, i), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.arc.bloodarsenal;
|
||||
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
|
||||
import com.arc.bloodarsenal.blocks.ModBlocks;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -17,13 +19,16 @@ public class BloodArsenalRecipes
|
||||
{
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_tnt), new ItemStack(Blocks.tnt), 3, 5000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_infused_wood), new ItemStack(Blocks.log), 2, 3000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_infused_iron_block), new ItemStack(Blocks.iron_block), 2, 72000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_cake), new ItemStack(Items.cake), 4, 10000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_iron), new ItemStack(Items.iron_ingot), 2, 8000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_infused_iron_block), new ItemStack(Blocks.iron_block), 3, 72000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_torch), new ItemStack(Blocks.torch), 2, 1000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.item_blood_cake), new ItemStack(Items.cake), 3, 10000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_iron), new ItemStack(Items.iron_ingot), 3, 8000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_orange), new ItemStack(Items.dye, 1, 14), 1, 200, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_diamond_active), new ItemStack(ModItems.blood_infused_diamond_unactive), 4, 50000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_diamond_active), new ItemStack(ModItems.blood_infused_diamond_unactive), 4, 80000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.soul_fragment), new ItemStack(ModItems.heart), 4, 10000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_cookie), new ItemStack(Items.cookie), 1, 2000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_glowstone_dust), new ItemStack(Items.glowstone_dust), 3, 2500, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_ball), new ItemStack(Items.snowball), 2, 500, 5, 5, false);
|
||||
}
|
||||
|
||||
public static void registerBindingRecipes()
|
||||
@@ -47,15 +52,16 @@ public class BloodArsenalRecipes
|
||||
ItemStack reinforcedSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.reinforcedSlate);
|
||||
ItemStack imbuedSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.imbuedSlate);
|
||||
ItemStack demonicSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.demonicSlate);
|
||||
ItemStack etherealSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.baseItems, 1, 27);
|
||||
ItemStack weakOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.weakBloodOrb, 1, craftingConstant);
|
||||
ItemStack apprenticeOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.apprenticeBloodOrb, 1, craftingConstant);
|
||||
ItemStack magicianOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.magicianBloodOrb, 1, craftingConstant);
|
||||
ItemStack masterOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.masterBloodOrb, 1, craftingConstant);
|
||||
|
||||
ItemStack archmageOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.archmageBloodOrb, 1, craftingConstant);
|
||||
ItemStack transcendentOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.transcendentBloodOrb, 1, craftingConstant);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stained_ice, 8), "aaa", "aba", "aaa", 'a', Blocks.ice, 'b', apprenticeOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stained_glass, 8), "aaa", "aba", "aaa", 'a', Blocks.glass, 'b', apprenticeOrb));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_axe_iron), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_iron, 'b', ModItems.blood_infused_axe_wood, 'c', ModItems.amorphic_catalyst, 'd', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_pickaxe_iron), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_iron, 'b', ModItems.blood_infused_pickaxe_wood, 'c', ModItems.amorphic_catalyst, 'd', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_shovel_iron), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_iron, 'b', ModItems.blood_infused_shovel_wood, 'c', ModItems.amorphic_catalyst, 'd', magicianOrb));
|
||||
@@ -68,18 +74,25 @@ public class BloodArsenalRecipes
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_sword_diamond), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_diamond_bound, 'b', ModItems.blood_infused_sword_iron, 'c', ModItems.amorphic_catalyst, 'd', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.soul_booster), "aaa", "aba", "aca", 'a', ModItems.soul_fragment, 'b', Blocks.beacon, 'c', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.soul_nullifier), "aaa", "aba", "aca", 'a', ModItems.soul_fragment, 'b', WayofTime.alchemicalWizardry.ModItems.armourInhibitor, 'c', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.vampire_ring),"ab ", "bcb", " b ", 'a', ModItems.blood_infused_diamond_bound, 'b', Blocks.stone, 'c', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.sigil_of_swimming), "aba", "cdc", "aea", 'a', Items.water_bucket, 'b', Items.bucket, 'c', Items.lava_bucket, 'd', WayofTime.alchemicalWizardry.ModItems.voidSigil, 'e', apprenticeOrb));
|
||||
// GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.self_sacrifice_amulet), "aaa", "aba", "caa", 'a', Items.string, 'b', weakOrb, 'c', WayofTime.alchemicalWizardry.ModBlocks.runeOfSelfSacrifice));
|
||||
// GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.sacrifice_amulet), "aaa", "aba", "caa", 'a', Items.string, 'b', weakOrb, 'c', WayofTime.alchemicalWizardry.ModBlocks.runeOfSacrifice));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.sigil_of_ender), "aba", "cdc", "efe", 'a', Blocks.obsidian, 'b', Items.ender_eye, 'c', Items.ender_pearl, 'd', imbuedSlate, 'e', Blocks.ender_chest, 'f', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.sigil_of_divinity), "aba", "cde", "fgf", 'a', ModBlocks.blood_infused_glowstone, 'b', new ItemStack(Items.golden_apple, 1, 1), 'c', Items.nether_star, 'd', WayofTime.alchemicalWizardry.ModItems.sigilOfElementalAffinity, 'e', ModItems.blood_infused_diamond_bound, 'f', ModItems.amorphic_catalyst, 'g', transcendentOrb));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_stone), "aaa", "aaa", "aaa", 'a', blankSlate);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_stone, 1, 1), "aaa", "aaa", "aaa", 'a', reinforcedSlate);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_stone, 1, 2), "aaa", "aaa", "aaa", 'a', imbuedSlate);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_stone, 1, 3), "aaa", "aaa", "aaa", 'a', demonicSlate);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_stone, 1, 4), "aaa", "aaa", "aaa", 'a', etherealSlate);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_infused_iron_block), "aaa", "aaa", "aaa", 'a', ModItems.blood_infused_iron);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_door_wood), "aa", "aa", "aa", 'a', ModBlocks.blood_infused_planks);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_stained_ice_packed), "aa", "aa", 'a', ModBlocks.blood_stained_ice);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_door_wood), "aa", "aa", "aa", 'a', ModBlocks.blood_infused_planks);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_door_iron), "aa", "aa", "aa", 'a', ModItems.blood_infused_iron);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_infused_glowstone), "aa", "aa", 'a', ModItems.blood_infused_glowstone_dust);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_lamp), "aba", "bcb", "aba", 'a', ModItems.blood_infused_iron, 'b', ModBlocks.blood_stained_glass, 'c', ModBlocks.blood_infused_glowstone);
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_infused_diamond_block), "aaa", "aaa", "aaa", 'a', ModItems.blood_infused_diamond_bound);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_stick), "a", "a", 'a', ModBlocks.blood_infused_planks);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_pickaxe_wood), "aaa", " b ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_axe_wood), "aa ", "ab ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
|
||||
@@ -96,5 +109,18 @@ public class BloodArsenalRecipes
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.blood_infused_iron, 9), ModBlocks.blood_infused_iron_block);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.orange_juice), ModItems.blood_orange, Items.glass_bottle);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.juice_and_cookies), Items.cookie, ModItems.orange_juice);
|
||||
|
||||
if (Loader.isModLoaded("Baubles"))
|
||||
{
|
||||
// GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.vampire_ring),"ab ", "bcb", " b ", 'a', ModItems.blood_infused_diamond_bound, 'b', Blocks.stone, 'c', masterOrb));
|
||||
// GameRegistry.addRecipe(new ItemStack(ModItems.self_sacrifice_amulet), "a", 'a', new ItemStack(Items.slime_ball));
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
ItemStack flintSteel = new ItemStack(ModItems.bound_flint_and_steel, 1, craftingConstant);
|
||||
|
||||
// GameRegistry.addRecipe(new ItemStack(ModBlocks.blood_torch, 2), "a", "b", 'a', flintSteel, 'b', ModItems.blood_infused_stick);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,67 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
import WayofTime.alchemicalWizardry.client.ClientEventHandler;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import com.arc.bloodarsenal.entity.EntityBloodTNT;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityBloodBall;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityEnderSigilPearl;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityGatlingProjectile;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import com.arc.bloodarsenal.renderer.ItemRenderGatling;
|
||||
import com.arc.bloodarsenal.renderer.RenderEntityGatlingProjectile;
|
||||
import com.arc.bloodarsenal.renderer.item.ItemRenderGatling;
|
||||
import com.arc.bloodarsenal.renderer.projectile.RenderEntityBloodBall;
|
||||
import com.arc.bloodarsenal.renderer.projectile.RenderEntityGatlingProjectile;
|
||||
import com.arc.bloodarsenal.renderer.block.TilePortableAltarRenderer;
|
||||
import com.arc.bloodarsenal.renderer.block.item.TilePortableAltarItemRenderer;
|
||||
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.client.renderer.entity.RenderTNTPrimed;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
public static int renderPass;
|
||||
public static int altarRenderType;
|
||||
|
||||
@Override
|
||||
public void registerRenders()
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.energy_gatling, new ItemRenderGatling());
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGatlingProjectile.class, new RenderEntityGatlingProjectile());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBloodTNT.class, new RenderTNTPrimed());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBloodBall.class, new RenderSnowball(ModItems.blood_ball));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEnderSigilPearl.class, new RenderSnowball(Items.ender_pearl));
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePortableAltar.class, new TilePortableAltarRenderer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerEntities()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerEvents()
|
||||
{
|
||||
FMLCommonHandler.instance().bus().register(new ClientEventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getClientWorld()
|
||||
{
|
||||
return null;
|
||||
return FMLClientHandler.instance().getClient().theWorld;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initRendering()
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.portable_altar), new TilePortableAltarItemRenderer());
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CommonProxy
|
||||
@@ -22,4 +23,14 @@ public class CommonProxy
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void registerTileEntities()
|
||||
{
|
||||
GameRegistry.registerTileEntity(TilePortableAltar.class, "containerPortableAltar");
|
||||
}
|
||||
|
||||
public void initRendering()
|
||||
{
|
||||
//TODO Auto-generated stub
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import com.arc.bloodarsenal.BloodArsenalConfig;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
+7
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -19,6 +19,7 @@ public class BlockBloodStone extends Block
|
||||
private IIcon blood_stone_2;
|
||||
private IIcon blood_stone_3;
|
||||
private IIcon blood_stone_4;
|
||||
private IIcon blood_stone_5;
|
||||
|
||||
public BlockBloodStone()
|
||||
{
|
||||
@@ -38,6 +39,7 @@ public class BlockBloodStone extends Block
|
||||
blood_stone_2 = iconRegister.registerIcon("BloodArsenal:blood_stone_2");
|
||||
blood_stone_3 = iconRegister.registerIcon("BloodArsenal:blood_stone_3");
|
||||
blood_stone_4 = iconRegister.registerIcon("BloodArsenal:blood_stone_4");
|
||||
blood_stone_5 = iconRegister.registerIcon("BloodArsenal:blood_stone_5");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -49,6 +51,7 @@ public class BlockBloodStone extends Block
|
||||
par3List.add(new ItemStack(par1Item, 1, 1));
|
||||
par3List.add(new ItemStack(par1Item, 1, 2));
|
||||
par3List.add(new ItemStack(par1Item, 1, 3));
|
||||
par3List.add(new ItemStack(par1Item, 1, 4));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -74,6 +77,9 @@ public class BlockBloodStone extends Block
|
||||
case 3:
|
||||
return blood_stone_4;
|
||||
|
||||
case 4:
|
||||
return blood_stone_5;
|
||||
|
||||
default:
|
||||
return blood_stone_1;
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.entity.EntityBloodTNT;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.BlockTorch;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
+1
-4
@@ -1,7 +1,5 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import com.arc.bloodarsenal.tileentity.TileOwned;
|
||||
@@ -14,7 +12,6 @@ import net.minecraft.client.renderer.IconFlipped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockPortableAltar extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static IIcon sideIcon1;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static IIcon sideIcon2;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static IIcon bottomIcon;
|
||||
|
||||
public BlockPortableAltar()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setBlockName("portable_altar");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top");
|
||||
this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType1");
|
||||
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2");
|
||||
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
case 1:
|
||||
return topIcon;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int meta)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile instanceof TilePortableAltar)
|
||||
{
|
||||
ItemStack stack = ((TilePortableAltar) tile).getStackInSlot(0);
|
||||
|
||||
if (stack != null && stack.getItem() instanceof EnergyBattery)
|
||||
{
|
||||
EnergyBattery bloodOrb = (EnergyBattery) stack.getItem();
|
||||
int maxEssence = bloodOrb.getMaxEssence();
|
||||
int currentEssence = bloodOrb.getCurrentEssence(stack);
|
||||
int level = currentEssence * 15 / maxEssence;
|
||||
return ((int) (Math.min(15, level))) % 16;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
{
|
||||
TilePortableAltar tileEntity = (TilePortableAltar) world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
|
||||
if (playerItem != null)
|
||||
{
|
||||
if (playerItem.getItem().equals(ModItems.divinationSigil))
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (playerItem.getItem().equals(ModItems.itemSeerSigil))
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendMoreChatInfoToPlayer(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
}else if(playerItem.getItem() instanceof IAltarManipulator)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
|
||||
{
|
||||
ItemStack item = ((SigilOfHolding) playerItem.getItem()).getCurrentItem(playerItem);
|
||||
|
||||
if (item != null && item.getItem().equals(ModItems.divinationSigil))
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (item != null && item.getItem().equals(ModItems.itemSeerSigil))
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendMoreChatInfoToPlayer(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tileEntity.getStackInSlot(0) == null && playerItem != null)
|
||||
{
|
||||
ItemStack newItem = playerItem.copy();
|
||||
newItem.stackSize = 1;
|
||||
--playerItem.stackSize;
|
||||
tileEntity.setInventorySlotContents(0, newItem);
|
||||
tileEntity.startCycle();
|
||||
} else if (tileEntity.getStackInSlot(0) != null && playerItem == null)
|
||||
{
|
||||
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
|
||||
tileEntity.setInventorySlotContents(0, null);
|
||||
tileEntity.setActive();
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
{
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z)
|
||||
{
|
||||
Random rand = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
|
||||
if (!(tileEntity instanceof IInventory))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IInventory inventory = (IInventory) tileEntity;
|
||||
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack item = inventory.getStackInSlot(i);
|
||||
|
||||
if (item != null && item.stackSize > 0)
|
||||
{
|
||||
float rx = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = rand.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world,
|
||||
x + rx, y + ry, z + rz,
|
||||
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float factor = 0.05F;
|
||||
entityItem.motionX = rand.nextGaussian() * factor;
|
||||
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
entityItem.motionZ = rand.nextGaussian() * factor;
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
item.stackSize = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
TilePortableAltar tileEntity = (TilePortableAltar) world.getTileEntity(x, y, z);
|
||||
|
||||
if (!tileEntity.isActive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (rand.nextInt(3) != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TilePortableAltar();
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
package com.arc.bloodarsenal.block;
|
||||
|
||||
import com.arc.bloodarsenal.items.block.BloodStoneBlock;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -19,9 +19,9 @@ public class ModBlocks
|
||||
public static Block blood_cake;
|
||||
public static Block blood_torch;
|
||||
public static Block blood_infused_glowstone;
|
||||
public static Block blood_infused_redstone_lamp;
|
||||
public static Block blood_lamp;
|
||||
public static Block blood_infused_diamond_block;
|
||||
public static BlockPortableAltar portable_altar;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
@@ -38,9 +38,9 @@ public class ModBlocks
|
||||
blood_cake = new BlockBloodCake();
|
||||
blood_torch = new BlockBloodTorch();
|
||||
blood_infused_glowstone = new BlockBloodInfusedGlowstone();
|
||||
blood_infused_redstone_lamp = new BlockBloodInfusedRedstoneLamp();
|
||||
blood_lamp = new BlockBloodLamp();
|
||||
blood_infused_diamond_block = new BlockBloodInfusedDiamond();
|
||||
portable_altar = new BlockPortableAltar();
|
||||
}
|
||||
|
||||
public static void registerBlocksInPre()
|
||||
@@ -58,8 +58,8 @@ public class ModBlocks
|
||||
GameRegistry.registerBlock(ModBlocks.blood_cake, "blood_cake");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_torch, "blood_torch");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_infused_glowstone, "blood_infused_glowstone");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_infused_redstone_lamp, "blood_infused_redstone_lamp");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_lamp, "blood_lamp");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_infused_diamond_block, "blood_infused_diamond_block");
|
||||
GameRegistry.registerBlock(ModBlocks.portable_altar, "portable_altar");
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBloodInfusedRedstoneLamp extends Block
|
||||
{
|
||||
private boolean isOn = false;
|
||||
|
||||
public BlockBloodInfusedRedstoneLamp()
|
||||
{
|
||||
super(Material.redstoneLight);
|
||||
|
||||
setBlockName("blood_infused_redstone_lamp");
|
||||
setBlockTextureName("BloodArsenal:blood_infused_redstone_lamp_off");
|
||||
setHardness(0.5F);
|
||||
setResistance(0.75F);
|
||||
setStepSound(soundTypeGlass);
|
||||
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
|
||||
if (isOn)
|
||||
{
|
||||
setLightLevel(1.0F);
|
||||
setBlockTextureName("BloodArsenal:blood_infused_redstone_lamp_on");
|
||||
}
|
||||
}
|
||||
|
||||
public void onBlockAdded(World world, int x, int y, int z)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (isOn && !world.isBlockIndirectlyGettingPowered(x, y, z))
|
||||
{
|
||||
world.scheduleBlockUpdate(x, y, z, this, 4);
|
||||
}
|
||||
else if (!isOn && world.isBlockIndirectlyGettingPowered(x, y, z))
|
||||
{
|
||||
isOn = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (isOn && !world.isBlockIndirectlyGettingPowered(x, y, z))
|
||||
{
|
||||
world.scheduleBlockUpdate(x, y, z, this, 4);
|
||||
}
|
||||
else if (!isOn && world.isBlockIndirectlyGettingPowered(x, y, z))
|
||||
{
|
||||
isOn = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if (!world.isRemote && isOn && !world.isBlockIndirectlyGettingPowered(x, y, z))
|
||||
{
|
||||
isOn = true;
|
||||
setLightLevel(1.0F);
|
||||
setBlockTextureName("BloodArsenal:blood_infused_redstone_lamp_on");
|
||||
world.scheduleBlockUpdate(x, y, z, this, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
isOn = false;
|
||||
setLightLevel(0.0F);
|
||||
setBlockTextureName("BloodArsenal:blood_infused_redstone_lamp_off");
|
||||
world.scheduleBlockUpdate(x, y, z, this, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.arc.bloodarsenal.items.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@@ -16,10 +17,11 @@ public class ModLivingDropsEvent
|
||||
@SubscribeEvent
|
||||
public void onEntityDrop(LivingDropsEvent event)
|
||||
{
|
||||
rand = Math.random();
|
||||
|
||||
if (event.source.getDamageType().equals("player"))
|
||||
{
|
||||
PotionEffect effect = event.entityLiving.getActivePotionEffect(Potion.weakness);
|
||||
rand = Math.random();
|
||||
|
||||
if (event.entityLiving instanceof EntityZombie)
|
||||
{
|
||||
@@ -51,5 +53,13 @@ public class ModLivingDropsEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving instanceof EntityWolf)
|
||||
{
|
||||
if (rand < 0.4F)
|
||||
{
|
||||
event.entityLiving.dropItem(ModItems.wolf_hide, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.arc.bloodarsenal.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityBloodBall extends EntityThrowable
|
||||
{
|
||||
public EntityBloodBall(World world)
|
||||
{
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityBloodBall(World world, EntityLivingBase entity)
|
||||
{
|
||||
super(world, entity);
|
||||
}
|
||||
|
||||
public EntityBloodBall(World world, double so, double me, double thing)
|
||||
{
|
||||
super(world, so, me, thing);
|
||||
}
|
||||
|
||||
protected void onImpact(MovingObjectPosition object)
|
||||
{
|
||||
if (object.entityHit != null)
|
||||
{
|
||||
byte b0 = 1;
|
||||
|
||||
object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0);
|
||||
EntityLivingBase thrower = this.getThrower();
|
||||
|
||||
if (thrower instanceof EntityPlayer)
|
||||
{
|
||||
String throwerName = thrower.getCommandSenderName();
|
||||
World worldSave = MinecraftServer.getServer().worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, throwerName);
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
data = new LifeEssenceNetwork(throwerName);
|
||||
worldSave.setItemData(throwerName, data);
|
||||
}
|
||||
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(throwerName, 50, data.maxOrb);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.arc.bloodarsenal.entity.projectile;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityEnderPearl;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
|
||||
public class EntityEnderSigilPearl extends EntityEnderPearl
|
||||
{
|
||||
public EntityEnderSigilPearl(World par1World, EntityLivingBase par2EntityLivingBase)
|
||||
{
|
||||
super(par1World, par2EntityLivingBase);
|
||||
this.setSize(0.01F, 0.01F);
|
||||
}
|
||||
|
||||
public EntityEnderSigilPearl(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityEnderSigilPearl(World par1World, double par2, double par4, double par6)
|
||||
{
|
||||
super(par1World, par2, par4, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float func_70182_d()
|
||||
{
|
||||
return 1.2F;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getGravityVelocity()
|
||||
{
|
||||
return 0.03F;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
||||
{
|
||||
if (par1MovingObjectPosition.entityHit != null)
|
||||
{
|
||||
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; ++i)
|
||||
{
|
||||
this.worldObj.spawnParticle("portal", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian());
|
||||
}
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP)
|
||||
{
|
||||
EntityPlayerMP entityplayermp = (EntityPlayerMP)this.getThrower();
|
||||
if (entityplayermp.worldObj == this.worldObj)
|
||||
{
|
||||
EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5);
|
||||
if (!MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
this.getThrower().setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
|
||||
this.getThrower().fallDistance = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.arc.bloodarsenal.gui;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BindingRecipeNEI extends TemplateRecipeHandler
|
||||
{
|
||||
public class CachedBindingRecipe extends CachedRecipe
|
||||
{
|
||||
PositionedStack input;
|
||||
PositionedStack output;
|
||||
|
||||
public CachedBindingRecipe(BindingRecipe recipe)
|
||||
{
|
||||
input = new PositionedStack(recipe.requiredItem, 38, 2, false);
|
||||
output = new PositionedStack(recipe.outputItem, 132, 32, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getIngredient()
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult()
|
||||
{
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results)
|
||||
{
|
||||
if (outputId.equals("alchemicalwizardry.binding"))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result)
|
||||
{
|
||||
for(BindingRecipe recipe: BindingRegistry.bindingRecipes)
|
||||
{
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.outputItem, result))
|
||||
{
|
||||
if (recipe != null && recipe.outputItem != null) arecipes.add(new CachedBindingRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,10 +23,11 @@ public class ConfigGui extends GuiConfig {
|
||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
|
||||
// Adds sections declared in BloodArsenalConfig. toLowerCase() is used because the configuration class automatically does this, so must we.
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(misc.toLowerCase())));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(potionId.toLowerCase())));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(ritualBlacklist.toLowerCase())));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(toolSetting.toLowerCase())));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(lpSettings.toLowerCase())));
|
||||
list.add(new ConfigElement<ConfigCategory>(config.getCategory(misc.toLowerCase())));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemAmorphicCatalyst extends Item
|
||||
{
|
||||
public ItemAmorphicCatalyst()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("amorphic_catalyst");
|
||||
setTextureName("BloodArsenal:amorphic_catalyst");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("A coagulated mess");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBloodArsenal extends Item
|
||||
{
|
||||
private static final String[] ITEM_NAMES = new String[] {"amorphic_catalyst", "blood_infused_stick", "blood_infused_iron", "soul_fragment", "orange_juice", "blood_infused_glowstone_dust", "wolf_hide"};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public ItemBloodArsenal()
|
||||
{
|
||||
super();
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
/* icons = new IIcon[ITEM_NAMES.length];
|
||||
|
||||
for (int i = 0; i < ITEM_NAMES.length; ++i)
|
||||
{
|
||||
icons[i] = iconRegister.registerIcon("BloodArsenal:" + ITEM_NAMES[i]);
|
||||
}
|
||||
|
||||
if (AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
ModItems.heart.setTextureName("BloodArsenal:heart2");
|
||||
}
|
||||
else
|
||||
{
|
||||
ModItems.heart.setTextureName("BloodArsenal:heart");
|
||||
}
|
||||
*/
|
||||
|
||||
if (this.equals(ModItems.amorphic_catalyst))
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:amorphic_catalyst");
|
||||
else if (this.equals(ModItems.blood_infused_iron))
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_iron");
|
||||
else if (this.equals(ModItems.soul_fragment))
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:soul_fragment");
|
||||
else if (this.equals(ModItems.heart))
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:heart2");
|
||||
else if (this.equals(ModItems.blood_infused_stick))
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_stick");
|
||||
else if (this.equals(ModItems.blood_cookie))
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_cookie");
|
||||
else if (this.equals(ModItems.orange_juice))
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:orange_juice");
|
||||
else if (this.equals(ModItems.blood_infused_glowstone_dust))
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_glowstone_dust");
|
||||
else if (this.equals(ModItems.wolf_hide))
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:wolf_hide");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
if (this.equals(ModItems.amorphic_catalyst))
|
||||
{
|
||||
par3List.add("A coagulated mess");
|
||||
}
|
||||
if (this.equals(ModItems.blood_infused_stick))
|
||||
{
|
||||
par3List.add("A stick infused with life!");
|
||||
}
|
||||
if (this.equals(ModItems.blood_infused_iron))
|
||||
{
|
||||
par3List.add("Mundane iron infused");
|
||||
par3List.add("with life essence");
|
||||
}
|
||||
if (this.equals(ModItems.heart))
|
||||
{
|
||||
if (AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
par3List.add("Bright red in color");
|
||||
}
|
||||
else
|
||||
{
|
||||
par3List.add("Fresh from a body");
|
||||
}
|
||||
}
|
||||
if (this.equals(ModItems.soul_fragment))
|
||||
{
|
||||
par3List.add("The raw essence of a soul");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityBloodBall;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemBloodBall extends Item
|
||||
{
|
||||
public ItemBloodBall()
|
||||
{
|
||||
setUnlocalizedName("blood_ball");
|
||||
setTextureName("BloodArsenal:blood_ball");
|
||||
setMaxStackSize(16);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
--itemStack.stackSize;
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityBloodBall(world, player));
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemBloodInfusedGlowstoneDust extends Item
|
||||
{
|
||||
public ItemBloodInfusedGlowstoneDust()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("blood_infused_glowstone_dust");
|
||||
setTextureName("BloodArsenal:blood_infused_glowstone_dust");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
public class ItemCreativeDagger extends Item
|
||||
{
|
||||
public ItemCreativeDagger()
|
||||
{
|
||||
super();
|
||||
setTextureName("AlchemicalWizardry:SacrificialDagger");
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setFull3D();
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (par3EntityPlayer instanceof FakePlayer)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
double posX = par3EntityPlayer.posX;
|
||||
double posY = par3EntityPlayer.posY;
|
||||
double posZ = par3EntityPlayer.posZ;
|
||||
par2World.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F);
|
||||
float f = (float) 1.0F;
|
||||
float f1 = f * 0.6F + 0.4F;
|
||||
float f2 = f * f * 0.7F - 0.5F;
|
||||
float f3 = f * f * 0.6F - 0.7F;
|
||||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
par2World.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
|
||||
if (!par2World.isRemote && SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
findAndFillAltar(par2World, par3EntityPlayer, Integer.MAX_VALUE);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public void findAndFillAltar(World world, EntityPlayer player, int amount)
|
||||
{
|
||||
int posX = (int) Math.round(player.posX - 0.5f);
|
||||
int posY = (int) player.posY;
|
||||
int posZ = (int) Math.round(player.posZ - 0.5f);
|
||||
TEAltar altarEntity = getAltar(world, posX, posY, posZ);
|
||||
|
||||
if (altarEntity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
altarEntity.sacrificialDaggerCall(amount, false);
|
||||
altarEntity.startCycle();
|
||||
}
|
||||
|
||||
public TEAltar getAltar(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tileEntity = null;
|
||||
|
||||
for (int i = -2; i <= 2; i++)
|
||||
{
|
||||
for (int j = -2; j <= 2; j++)
|
||||
{
|
||||
for (int k = -2; k <= 1; k++)
|
||||
{
|
||||
tileEntity = world.getTileEntity(i + x, k + y, j + z);
|
||||
|
||||
if ((tileEntity instanceof TEAltar))
|
||||
{
|
||||
return (TEAltar) tileEntity;
|
||||
}
|
||||
}
|
||||
|
||||
if ((tileEntity instanceof TEAltar))
|
||||
{
|
||||
return (TEAltar) tileEntity;
|
||||
}
|
||||
}
|
||||
|
||||
if ((tileEntity instanceof TEAltar))
|
||||
{
|
||||
return (TEAltar) tileEntity;
|
||||
}
|
||||
}
|
||||
|
||||
if ((tileEntity instanceof TEAltar))
|
||||
{
|
||||
return (TEAltar) tileEntity;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemHeart extends Item
|
||||
{
|
||||
public ItemHeart()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("heart");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
if (AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
par3List.add("Bright red in color");
|
||||
}
|
||||
else
|
||||
{
|
||||
par3List.add("Fresh from a body");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:heart2");
|
||||
}
|
||||
else
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:heart");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemOrangeJuice extends Item
|
||||
{
|
||||
public ItemOrangeJuice()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("orange_juice");
|
||||
setTextureName("BloodArsenal:orange_juice");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemSoulFragment extends Item
|
||||
{
|
||||
public ItemSoulFragment()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("soul_fragment");
|
||||
setTextureName("BloodArsenal:soul_fragment");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("The raw essence");
|
||||
par3List.add("of a soul");
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,10 @@ package com.arc.bloodarsenal.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.blocks.ModBlocks;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import com.arc.bloodarsenal.items.armor.VampireCostume;
|
||||
import com.arc.bloodarsenal.items.block.*;
|
||||
import com.arc.bloodarsenal.items.sigil.SigilDivinity;
|
||||
import com.arc.bloodarsenal.items.sigil.SigilEnder;
|
||||
import com.arc.bloodarsenal.items.sigil.SigilSwimming;
|
||||
import com.arc.bloodarsenal.items.tool.*;
|
||||
@@ -54,10 +55,14 @@ public class ModItems
|
||||
public static Item vampire_boots;
|
||||
public static Item vampire_ring;
|
||||
public static Item energy_gatling;
|
||||
public static Item creative_dagger;
|
||||
public static Item sigil_of_swimming;
|
||||
public static Item sigil_of_ender;
|
||||
public static Item blood_infused_glowstone_dust;
|
||||
public static Item self_sacrifice_amulet;
|
||||
public static Item sacrifice_amulet;
|
||||
public static Item sigil_of_divinity;
|
||||
public static Item blood_ball;
|
||||
public static Item wolf_hide;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
@@ -67,14 +72,14 @@ public class ModItems
|
||||
blood_infused_axe_wood = new InfusedWoodAxe();
|
||||
blood_infused_shovel_wood = new InfusedWoodShovel();
|
||||
blood_infused_sword_wood = new InfusedWoodSword();
|
||||
amorphic_catalyst = new ItemAmorphicCatalyst();
|
||||
blood_infused_stick = new InfusedStick();
|
||||
amorphic_catalyst = new ItemBloodArsenal().setUnlocalizedName("amorphic_catalyst");
|
||||
blood_infused_stick = new ItemBloodArsenal().setUnlocalizedName("blood_infused_stick");
|
||||
bound_sickle = new BoundSickle(AlchemicalWizardry.bloodBoundToolMaterial);
|
||||
blood_infused_pickaxe_iron = new InfusedIronPickaxe();
|
||||
blood_infused_axe_iron = new InfusedIronAxe();
|
||||
blood_infused_shovel_iron = new InfusedIronShovel();
|
||||
blood_infused_sword_iron = new InfusedIronSword();
|
||||
blood_infused_iron = new InfusedIron();
|
||||
blood_infused_iron = new ItemBloodArsenal().setUnlocalizedName("blood_infused_iron");
|
||||
bound_shears = new BoundShears();
|
||||
blood_diamond = new InfusedDiamond().setUnlocalizedName("blood_diamond");
|
||||
blood_infused_diamond_unactive = new InfusedDiamond().setUnlocalizedName("blood_infused_diamond_unactive");
|
||||
@@ -84,69 +89,74 @@ public class ModItems
|
||||
blood_infused_axe_diamond = new InfusedDiamondAxe();
|
||||
blood_infused_shovel_diamond = new InfusedDiamondShovel();
|
||||
blood_infused_sword_diamond = new InfusedDiamondSword();
|
||||
heart = new ItemHeart();
|
||||
soul_fragment = new ItemSoulFragment();
|
||||
heart = new ItemBloodArsenal().setUnlocalizedName("heart");
|
||||
soul_fragment = new ItemBloodArsenal().setUnlocalizedName("soul_fragment");
|
||||
item_blood_door_wood = new BloodDoor(Material.wood).setUnlocalizedName("item_blood_door_wood").setTextureName("BloodArsenal:item_blood_door_wood");
|
||||
item_blood_door_iron = new BloodDoor(Material.iron).setUnlocalizedName("item_blood_door_iron").setTextureName("BloodArsenal:item_blood_door_iron");
|
||||
bound_flint_and_steel = new BoundFlintAndSteel();
|
||||
soul_booster = new ItemSoulBooster();
|
||||
soul_nullifier = new ItemSoulNullifier();
|
||||
blood_cookie = new ItemBloodCookie();
|
||||
orange_juice = new ItemOrangeJuice();
|
||||
orange_juice = new ItemBloodArsenal().setUnlocalizedName("orange_juice");
|
||||
juice_and_cookies = new ItemJuiceAndCookies();
|
||||
item_blood_cake = new ItemReed(ModBlocks.blood_cake).setUnlocalizedName("item_blood_cake").setTextureName("BloodArsenal:item_blood_cake").setCreativeTab(BloodArsenal.BA_TAB);
|
||||
vampire_cape = new VampireCostume(1).setUnlocalizedName("vampire_cape");
|
||||
vampire_greaves = new VampireCostume(2).setUnlocalizedName("vampire_greaves");
|
||||
vampire_boots = new VampireCostume(3).setUnlocalizedName("vampire_boots");
|
||||
energy_gatling = new EnergyGatling();
|
||||
creative_dagger = new ItemCreativeDagger();
|
||||
sigil_of_swimming = new SigilSwimming();
|
||||
sigil_of_ender = new SigilEnder();
|
||||
blood_infused_glowstone_dust = new ItemBloodInfusedGlowstoneDust();
|
||||
blood_infused_glowstone_dust = new ItemBloodArsenal().setUnlocalizedName("blood_infused_glowstone_dust");
|
||||
sigil_of_divinity = new SigilDivinity();
|
||||
blood_ball = new ItemBloodBall();
|
||||
wolf_hide = new ItemBloodArsenal().setUnlocalizedName("wolf_hide");
|
||||
}
|
||||
|
||||
public static void registerItems()
|
||||
{
|
||||
GameRegistry.registerItem(ModItems.bound_bow, "bound_bow");
|
||||
GameRegistry.registerItem(ModItems.blood_orange, "blood_orange");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_pickaxe_wood, "blood_infused_pickaxe_wood");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_axe_wood, "blood_infused_axe_wood");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_shovel_wood, "blood_infused_shovel_wood");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_sword_wood, "blood_infused_sword_wood");
|
||||
GameRegistry.registerItem(ModItems.amorphic_catalyst, "amorphic_catalyst");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_stick, "blood_infused_stick");
|
||||
GameRegistry.registerItem(ModItems.bound_sickle, "bound_sickle");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_pickaxe_iron, "blood_infused_pickaxe_iron");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_axe_iron, "blood_infused_axe_iron");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_shovel_iron, "blood_infused_shovel_iron");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_sword_iron, "blood_infused_sword_iron");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_iron, "blood_infused_iron");
|
||||
GameRegistry.registerItem(ModItems.bound_shears, "bound_shears");
|
||||
GameRegistry.registerItem(ModItems.blood_diamond, "blood_diamond");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_diamond_unactive, "blood_infused_diamond_unactive");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_diamond_active, "blood_infused_diamond_active");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_diamond_bound, "blood_infused_diamond_bound");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_pickaxe_diamond, "blood_infused_pickaxe_diamond");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_axe_diamond, "blood_infused_axe_diamond");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_shovel_diamond, "blood_infused_shovel_diamond");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_sword_diamond, "blood_infused_sword_diamond");
|
||||
GameRegistry.registerItem(ModItems.heart, "heart");
|
||||
GameRegistry.registerItem(ModItems.soul_fragment, "soul_fragment");
|
||||
GameRegistry.registerItem(ModItems.item_blood_door_wood, "item_blood_door_wood");
|
||||
GameRegistry.registerItem(ModItems.item_blood_door_iron, "item_blood_door_iron");
|
||||
GameRegistry.registerItem(ModItems.bound_flint_and_steel, "bound_flint_and_steel");
|
||||
GameRegistry.registerItem(ModItems.soul_booster, "soul_booster");
|
||||
GameRegistry.registerItem(ModItems.soul_nullifier, "soul_nullfier");
|
||||
GameRegistry.registerItem(ModItems.blood_cookie, "blood_cookie");
|
||||
GameRegistry.registerItem(ModItems.orange_juice, "orange_juice");
|
||||
GameRegistry.registerItem(ModItems.juice_and_cookies, "juice_and_cookies");
|
||||
GameRegistry.registerItem(ModItems.vampire_cape, "vampire_cape");
|
||||
GameRegistry.registerItem(ModItems.vampire_greaves, "vampire_greaves");
|
||||
GameRegistry.registerItem(ModItems.vampire_boots, "vampire_boots");
|
||||
GameRegistry.registerItem(ModItems.energy_gatling, "energy_gatling");
|
||||
GameRegistry.registerItem(ModItems.creative_dagger, "creative_dagger");
|
||||
GameRegistry.registerItem(ModItems.sigil_of_swimming, "sigil_of_swimming");
|
||||
GameRegistry.registerItem(ModItems.sigil_of_ender, "sigil_of_ender");
|
||||
GameRegistry.registerItem(ModItems.blood_infused_glowstone_dust, "blood_infused_glowstone_dust");
|
||||
GameRegistry.registerItem(bound_bow, "bound_bow");
|
||||
GameRegistry.registerItem(blood_orange, "blood_orange");
|
||||
GameRegistry.registerItem(blood_infused_pickaxe_wood, "blood_infused_pickaxe_wood");
|
||||
GameRegistry.registerItem(blood_infused_axe_wood, "blood_infused_axe_wood");
|
||||
GameRegistry.registerItem(blood_infused_shovel_wood, "blood_infused_shovel_wood");
|
||||
GameRegistry.registerItem(blood_infused_sword_wood, "blood_infused_sword_wood");
|
||||
GameRegistry.registerItem(amorphic_catalyst, "amorphic_catalyst");
|
||||
GameRegistry.registerItem(blood_infused_stick, "blood_infused_stick");
|
||||
GameRegistry.registerItem(bound_sickle, "bound_sickle");
|
||||
GameRegistry.registerItem(blood_infused_pickaxe_iron, "blood_infused_pickaxe_iron");
|
||||
GameRegistry.registerItem(blood_infused_axe_iron, "blood_infused_axe_iron");
|
||||
GameRegistry.registerItem(blood_infused_shovel_iron, "blood_infused_shovel_iron");
|
||||
GameRegistry.registerItem(blood_infused_sword_iron, "blood_infused_sword_iron");
|
||||
GameRegistry.registerItem(blood_infused_iron, "blood_infused_iron");
|
||||
GameRegistry.registerItem(bound_shears, "bound_shears");
|
||||
GameRegistry.registerItem(blood_diamond, "blood_diamond");
|
||||
GameRegistry.registerItem(blood_infused_diamond_unactive, "blood_infused_diamond_unactive");
|
||||
GameRegistry.registerItem(blood_infused_diamond_active, "blood_infused_diamond_active");
|
||||
GameRegistry.registerItem(blood_infused_diamond_bound, "blood_infused_diamond_bound");
|
||||
GameRegistry.registerItem(blood_infused_pickaxe_diamond, "blood_infused_pickaxe_diamond");
|
||||
GameRegistry.registerItem(blood_infused_axe_diamond, "blood_infused_axe_diamond");
|
||||
GameRegistry.registerItem(blood_infused_shovel_diamond, "blood_infused_shovel_diamond");
|
||||
GameRegistry.registerItem(blood_infused_sword_diamond, "blood_infused_sword_diamond");
|
||||
GameRegistry.registerItem(heart, "heart");
|
||||
GameRegistry.registerItem(soul_fragment, "soul_fragment");
|
||||
GameRegistry.registerItem(item_blood_door_wood, "item_blood_door_wood");
|
||||
GameRegistry.registerItem(item_blood_door_iron, "item_blood_door_iron");
|
||||
GameRegistry.registerItem(item_blood_cake, "item_blood_cake");
|
||||
GameRegistry.registerItem(bound_flint_and_steel, "bound_flint_and_steel");
|
||||
GameRegistry.registerItem(soul_booster, "soul_booster");
|
||||
GameRegistry.registerItem(soul_nullifier, "soul_nullfier");
|
||||
GameRegistry.registerItem(blood_cookie, "blood_cookie");
|
||||
GameRegistry.registerItem(orange_juice, "orange_juice");
|
||||
GameRegistry.registerItem(juice_and_cookies, "juice_and_cookies");
|
||||
GameRegistry.registerItem(vampire_cape, "vampire_cape");
|
||||
GameRegistry.registerItem(vampire_greaves, "vampire_greaves");
|
||||
GameRegistry.registerItem(vampire_boots, "vampire_boots");
|
||||
GameRegistry.registerItem(energy_gatling, "energy_gatling");
|
||||
GameRegistry.registerItem(sigil_of_swimming, "sigil_of_swimming");
|
||||
GameRegistry.registerItem(sigil_of_ender, "sigil_of_ender");
|
||||
GameRegistry.registerItem(blood_infused_glowstone_dust, "blood_infused_glowstone_dust");
|
||||
GameRegistry.registerItem(sigil_of_divinity, "sigil_of_divinity");
|
||||
GameRegistry.registerItem(blood_ball, "blood_ball");
|
||||
GameRegistry.registerItem(wolf_hide, "wolf_hide");
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.arc.bloodarsenal.items.armor;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import com.arc.bloodarsenal.renderer.ModelVampireCostume;
|
||||
import com.arc.bloodarsenal.renderer.model.ModelVampireCostume;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
|
||||
@@ -74,7 +74,7 @@ public abstract class ItemBauble extends Item implements IBauble
|
||||
@Override
|
||||
public void onWornTick(ItemStack stack, EntityLivingBase player)
|
||||
{
|
||||
if(player.ticksExisted == 1)
|
||||
if (player.ticksExisted == 1)
|
||||
{
|
||||
onEquippedOrLoadedIntoWorld(stack, player);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.arc.bloodarsenal.items.bauble;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import baubles.api.BaubleType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SacrificeAmulet extends ItemBauble implements IAltarManipulator
|
||||
{
|
||||
public SacrificeAmulet()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("sacrifice_amulet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Collecting some blood!");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
par3List.add("Stored LP: " + this.getStoredLP(par1ItemStack));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player)
|
||||
{
|
||||
super.onWornTick(par1ItemStack, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack par1ItemStack)
|
||||
{
|
||||
return BaubleType.AMULET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
|
||||
if (movingobjectposition == null)
|
||||
{
|
||||
return super.onItemRightClick(itemStack, world, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (!(tile instanceof TEAltar))
|
||||
{
|
||||
return super.onItemRightClick(itemStack, world, player);
|
||||
}
|
||||
|
||||
TEAltar altar = (TEAltar)tile;
|
||||
|
||||
if (!altar.isActive())
|
||||
{
|
||||
int amount = this.getStoredLP(itemStack);
|
||||
if (amount > 0)
|
||||
{
|
||||
int filledAmount = altar.fillMainTank(amount);
|
||||
amount -= filledAmount;
|
||||
this.setStoredLP(itemStack, amount);
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("BloodArsenal:sacrifice_amulet");
|
||||
}
|
||||
|
||||
public void setStoredLP(ItemStack itemStack, int lp)
|
||||
{
|
||||
if (!itemStack.hasTagCompound())
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = itemStack.getTagCompound();
|
||||
|
||||
tag.setInteger("storedLP", lp);
|
||||
}
|
||||
|
||||
public int getStoredLP(ItemStack itemStack)
|
||||
{
|
||||
if (!itemStack.hasTagCompound())
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = itemStack.getTagCompound();
|
||||
|
||||
return tag.getInteger("storedLP");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.arc.bloodarsenal.items.bauble;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import baubles.api.BaubleType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SelfSacrificeAmulet extends ItemBauble implements IAltarManipulator
|
||||
{
|
||||
public SelfSacrificeAmulet()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("self_sacrifice_amulet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Collecting your blood!");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
par3List.add("Stored LP: " + this.getStoredLP(par1ItemStack));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player)
|
||||
{
|
||||
super.onWornTick(par1ItemStack, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack par1ItemStack)
|
||||
{
|
||||
return BaubleType.AMULET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
|
||||
if (movingobjectposition == null)
|
||||
{
|
||||
return super.onItemRightClick(itemStack, world, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (!(tile instanceof TEAltar))
|
||||
{
|
||||
return super.onItemRightClick(itemStack, world, player);
|
||||
}
|
||||
|
||||
TEAltar altar = (TEAltar)tile;
|
||||
|
||||
if (!altar.isActive())
|
||||
{
|
||||
int amount = this.getStoredLP(itemStack);
|
||||
if (amount > 0)
|
||||
{
|
||||
int filledAmount = altar.fillMainTank(amount);
|
||||
amount -= filledAmount;
|
||||
this.setStoredLP(itemStack, amount);
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("BloodArsenal:self_sacrifice_amulet");
|
||||
}
|
||||
|
||||
public void setStoredLP(ItemStack itemStack, int lp)
|
||||
{
|
||||
if (!itemStack.hasTagCompound())
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = itemStack.getTagCompound();
|
||||
|
||||
tag.setInteger("storedLP", lp);
|
||||
}
|
||||
|
||||
public int getStoredLP(ItemStack itemStack)
|
||||
{
|
||||
if (!itemStack.hasTagCompound())
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = itemStack.getTagCompound();
|
||||
|
||||
return tag.getInteger("storedLP");
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.arc.bloodarsenal.items.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.blocks.ModBlocks;
|
||||
import com.arc.bloodarsenal.tileentity.TileOwned;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.arc.bloodarsenal.items.block;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.blocks.ModBlocks;
|
||||
import com.arc.bloodarsenal.tileentity.TileOwned;
|
||||
import com.arc.bloodarsenal.block.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -14,7 +14,7 @@ public class BloodStoneBlock extends ItemBlock
|
||||
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
String name = "";
|
||||
String name;
|
||||
|
||||
switch (itemStack.getItemDamage())
|
||||
{
|
||||
@@ -34,6 +34,10 @@ public class BloodStoneBlock extends ItemBlock
|
||||
name = "blood_stone_4";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
name = "blood_stone_5";
|
||||
break;
|
||||
|
||||
default:
|
||||
name = "blood_stone";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.arc.bloodarsenal.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.BloodArsenalConfig;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilDivinity extends EnergyItems implements ArmourUpgrade, IBindable
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon passiveIcon;
|
||||
|
||||
public SigilDivinity()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("sigil_of_divinity");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(50000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("May the Divines protect you!");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
par3List.add("Activated");
|
||||
}
|
||||
else
|
||||
{
|
||||
par3List.add("Deactivated");
|
||||
}
|
||||
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:sigil_of_divinity_deactivated");
|
||||
activeIcon = iconRegister.registerIcon("BloodArsenal:sigil_of_divinity_activated");
|
||||
passiveIcon = iconRegister.registerIcon("BloodArsenal:sigil_of_divinity_deactivated");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.stackTagCompound == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.stackTagCompound;
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return activeIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
return passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (par1 == 1)
|
||||
{
|
||||
return activeIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
return passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.stackTagCompound;
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2, 0));
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2, 4));
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World par1World, EntityPlayer par2EntityPlayer, ItemStack par3ItemStack)
|
||||
{
|
||||
if (par3ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par3ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
par2EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2, 0, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyForTenSeconds()
|
||||
{
|
||||
return BloodArsenalConfig.sigilDivinityCost;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.arc.bloodarsenal.items.sigil;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityEnderSigilPearl;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.item.EntityEnderPearl;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -20,7 +22,6 @@ public class SigilEnder extends EnergyItems implements IBindable
|
||||
setUnlocalizedName("sigil_of_ender");
|
||||
setTextureName("BloodArsenal:sigil_of_ender");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,11 +40,6 @@ public class SigilEnder extends EnergyItems implements IBindable
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
par3EntityPlayer.displayGUIChest(par3EntityPlayer.getInventoryEnderChest());
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "mob.endermen.portal", 1F, 1F);
|
||||
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 500);
|
||||
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
@@ -51,20 +47,20 @@ public class SigilEnder extends EnergyItems implements IBindable
|
||||
|
||||
if (par3EntityPlayer.isSneaking() && !par3EntityPlayer.isSwingInProgress)
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
else
|
||||
{
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "mob.endermen.portal", 1F, 1F);
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par2World.spawnEntityInWorld(new EntityEnderPearl(par2World, par3EntityPlayer));
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par2World.spawnEntityInWorld(new EntityEnderSigilPearl(par2World, par3EntityPlayer));
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 300);
|
||||
}
|
||||
|
||||
}
|
||||
else if (!par3EntityPlayer.isSneaking())
|
||||
{
|
||||
par3EntityPlayer.displayGUIChest(par3EntityPlayer.getInventoryEnderChest());
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "mob.endermen.portal", 1F, 1F);
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 200);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
|
||||
@@ -184,6 +184,6 @@ public class SigilSwimming extends EnergyItems implements ArmourUpgrade, IBindab
|
||||
@Override
|
||||
public int getEnergyForTenSeconds()
|
||||
{
|
||||
return 150;
|
||||
return BloodArsenalConfig.sigilSwimmingCost;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.arc.bloodarsenal.items.tinkers;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.BloodArsenalConfig;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.client.TConstructClientRegistry;
|
||||
@@ -12,10 +11,14 @@ public class BloodArsenalTinkers
|
||||
public static PartHelper AXE_HEAD;
|
||||
public static PartHelper BATTLE_SIGN_HEAD;
|
||||
public static PartHelper BINDING;
|
||||
public static PartHelper BOW_LIMB;
|
||||
public static PartHelper CHISEL_HEAD;
|
||||
public static PartHelper CHUNK;
|
||||
public static PartHelper CROSSBAR;
|
||||
public static PartHelper CROSSBOW_BODY;
|
||||
public static PartHelper CROSSBOW_LIMB;
|
||||
public static PartHelper EXCAVATOR_HEAD;
|
||||
public static PartHelper FISHING_ROD;
|
||||
public static PartHelper FRYPAN_HEAD;
|
||||
public static PartHelper FULL_GUARD;
|
||||
public static PartHelper HAMMER_HEAD;
|
||||
@@ -28,6 +31,7 @@ public class BloodArsenalTinkers
|
||||
public static PartHelper PICKAXE_HEAD;
|
||||
public static PartHelper SCYTHE_HEAD;
|
||||
public static PartHelper SHOVEL_HEAD;
|
||||
public static PartHelper SHURIKEN;
|
||||
public static PartHelper SWORD_BLADE;
|
||||
public static PartHelper TOOLROD;
|
||||
public static PartHelper TOUGHBIND;
|
||||
@@ -37,29 +41,24 @@ public class BloodArsenalTinkers
|
||||
{
|
||||
if (BloodArsenal.isTinkersConstructLoaded)
|
||||
{
|
||||
if (BloodArsenalConfig.tinkersIntegration)
|
||||
{
|
||||
TConstructRegistry.addToolMaterial(250, "Blood Infused Iron", 3, 550, 1800, 3, 1.5F, 0, 0.0F, "", "");
|
||||
// TConstructRegistry.addToolMaterial(250, "Blood Infused Iron", 3, 550, 1800, 3, 1.5F, 0, 0.0F, "", "");
|
||||
TConstructRegistry.addToolMaterial(250, "Blood Infused Iron", "blood_infused_iron", 3, 550, 1800, 3, 1.5F, 0, 0.0F, "Blood Infused Iron", 0xff0000);
|
||||
|
||||
TConstructClientRegistry.addMaterialRenderMapping(250, "BloodArsenal", "blood_infused_iron", true);
|
||||
TConstructClientRegistry.addMaterialRenderMapping(250, "BloodArsenal", "blood_infused_iron", true);
|
||||
|
||||
TConstructRegistry.addBowMaterial(250, 500, 40, 1.2F);
|
||||
TConstructRegistry.addBowMaterial(250, 40, 1.2F);
|
||||
|
||||
TConstructRegistry.addArrowMaterial(250, 4.7F, 0.2F, 100.0F);
|
||||
}
|
||||
TConstructRegistry.addArrowMaterial(250, 4.7F, 0.2F);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addParts()
|
||||
{
|
||||
if (BloodArsenalConfig.tinkersIntegration)
|
||||
{
|
||||
initParts();
|
||||
initParts();
|
||||
|
||||
addMaterialToParts(250, "blood.infused.iron", "blood_infused_iron");
|
||||
addMaterialToToolParts(250, "blood.infused.iron", "blood_infused_iron");
|
||||
|
||||
registerParts();
|
||||
}
|
||||
registerParts();
|
||||
}
|
||||
|
||||
private static void initParts()
|
||||
@@ -68,10 +67,14 @@ public class BloodArsenalTinkers
|
||||
AXE_HEAD = new PartHelper("axe.head", 0, "");
|
||||
BATTLE_SIGN_HEAD = new PartHelper("battle.sign", 0, "");
|
||||
BINDING = new PartHelper("binding", 0, "");
|
||||
BOW_LIMB = new PartHelper("bow.limb", 0, "");
|
||||
CHISEL_HEAD = new PartHelper("chisel.head", 0, "");
|
||||
CHUNK = new PartHelper("chunk", 0, "");
|
||||
CROSSBAR = new PartHelper("crossbar", 0, "");
|
||||
CROSSBOW_BODY = new PartHelper("crossbow.body", 0, "");
|
||||
CROSSBOW_LIMB = new PartHelper("crossbow.limb", 0, "");
|
||||
EXCAVATOR_HEAD = new PartHelper("excavator.head", 0, "");
|
||||
FISHING_ROD = new PartHelper("fishing.rod", 0, "");
|
||||
FRYPAN_HEAD = new PartHelper("frypan.head", 0, "");
|
||||
FULL_GUARD = new PartHelper("full.guard", 0, "");
|
||||
HAMMER_HEAD = new PartHelper("hammer.head", 0, "");
|
||||
@@ -84,22 +87,27 @@ public class BloodArsenalTinkers
|
||||
PICKAXE_HEAD = new PartHelper("pickaxe.head", 0, "");
|
||||
SCYTHE_HEAD = new PartHelper("scythe.head", 0, "");
|
||||
SHOVEL_HEAD = new PartHelper("shovel.head", 0, "");
|
||||
SHURIKEN = new PartHelper("shuriken", 0, "");
|
||||
SWORD_BLADE = new PartHelper("sword.blade", 0, "");
|
||||
TOOLROD = new PartHelper("toolrod", 0, "");
|
||||
TOUGHBIND = new PartHelper("toughbind", 0, "");
|
||||
TOUGHROD = new PartHelper("toughrod", 0, "");
|
||||
}
|
||||
|
||||
private static void addMaterialToParts(int materialID, String unlocalizedName, String texture)
|
||||
private static void addMaterialToToolParts(int materialID, String unlocalizedName, String texture)
|
||||
{
|
||||
ARROWHEAD.addMaterial(materialID, unlocalizedName, texture + "_arrowhead");
|
||||
AXE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_axe_head");
|
||||
BATTLE_SIGN_HEAD.addMaterial(materialID, unlocalizedName, texture + "_battlesign_head");
|
||||
BINDING.addMaterial(materialID, unlocalizedName, texture + "_binding");
|
||||
BOW_LIMB.addMaterial(materialID, unlocalizedName, texture + "_bow_limb");
|
||||
CHISEL_HEAD.addMaterial(materialID, unlocalizedName, texture + "_chisel_head");
|
||||
CHUNK.addMaterial(materialID, unlocalizedName, texture + "_chunk");
|
||||
CROSSBAR.addMaterial(materialID, unlocalizedName, texture + "_crossbar");
|
||||
CROSSBOW_BODY.addMaterial(materialID, unlocalizedName, texture + "_crossbow_body");
|
||||
CROSSBOW_LIMB.addMaterial(materialID, unlocalizedName, texture + "_crossbow_limb");
|
||||
EXCAVATOR_HEAD.addMaterial(materialID, unlocalizedName, texture + "_excavator_head");
|
||||
FISHING_ROD.addMaterial(materialID, unlocalizedName, texture + "_fishingrod");
|
||||
FRYPAN_HEAD.addMaterial(materialID, unlocalizedName, texture + "_frypan_head");
|
||||
FULL_GUARD.addMaterial(materialID, unlocalizedName, texture + "_full_guard");
|
||||
HAMMER_HEAD.addMaterial(materialID, unlocalizedName, texture + "_hammer_head");
|
||||
@@ -112,6 +120,7 @@ public class BloodArsenalTinkers
|
||||
PICKAXE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_pickaxe_head");
|
||||
SCYTHE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_scythe_head");
|
||||
SHOVEL_HEAD.addMaterial(materialID, unlocalizedName, texture + "_shovel_head");
|
||||
SHURIKEN.addMaterial(materialID, unlocalizedName, texture + "_shuriken");
|
||||
SWORD_BLADE.addMaterial(materialID, unlocalizedName, texture + "_sword_blade");
|
||||
TOOLROD.addMaterial(materialID, unlocalizedName, texture + "_rod");
|
||||
TOUGHBIND.addMaterial(materialID, unlocalizedName, texture + "_toughbind");
|
||||
@@ -124,10 +133,14 @@ public class BloodArsenalTinkers
|
||||
GameRegistry.registerItem(AXE_HEAD, "axeHead");
|
||||
GameRegistry.registerItem(BATTLE_SIGN_HEAD, "battleSign");
|
||||
GameRegistry.registerItem(BINDING, "binding");
|
||||
GameRegistry.registerItem(BOW_LIMB, "bowLimb");
|
||||
GameRegistry.registerItem(CHISEL_HEAD, "chiselHead");
|
||||
GameRegistry.registerItem(CHUNK, "chunk");
|
||||
GameRegistry.registerItem(CROSSBAR, "crossbar");
|
||||
GameRegistry.registerItem(CROSSBOW_BODY, "crossbowBody");
|
||||
GameRegistry.registerItem(CROSSBOW_LIMB, "crossbowLimb");
|
||||
GameRegistry.registerItem(EXCAVATOR_HEAD, "excavatorHead");
|
||||
GameRegistry.registerItem(FISHING_ROD, "fishingRod");
|
||||
GameRegistry.registerItem(FRYPAN_HEAD, "frypanHead");
|
||||
GameRegistry.registerItem(FULL_GUARD, "fullGuard");
|
||||
GameRegistry.registerItem(HAMMER_HEAD, "hammerHead");
|
||||
@@ -140,9 +153,11 @@ public class BloodArsenalTinkers
|
||||
GameRegistry.registerItem(PICKAXE_HEAD, "pickaxeHead");
|
||||
GameRegistry.registerItem(SCYTHE_HEAD, "scytheHead");
|
||||
GameRegistry.registerItem(SHOVEL_HEAD, "shovelHead");
|
||||
GameRegistry.registerItem(SHURIKEN, "shuriken");
|
||||
GameRegistry.registerItem(SWORD_BLADE, "swordBlade");
|
||||
GameRegistry.registerItem(TOOLROD, "toolrod");
|
||||
GameRegistry.registerItem(TOUGHBIND, "toughbind");
|
||||
GameRegistry.registerItem(TOUGHROD, "toughrod");
|
||||
BloodArsenal.logger.info("SOMETHING WORKED NOW DIDN'T IT?");
|
||||
}
|
||||
}
|
||||
@@ -45,8 +45,8 @@ public class PartHelper extends Item implements IToolPart
|
||||
this.itemIcon = icon.registerIcon(this.defaultTexture);
|
||||
for (Map.Entry<Integer, String> texture : this.textures.entrySet())
|
||||
{
|
||||
int materialID = (Integer)texture.getKey().intValue();
|
||||
String textureName = (String)texture.getValue();
|
||||
int materialID = texture.getKey().intValue();
|
||||
String textureName = texture.getValue();
|
||||
|
||||
IIcon _icon = icon.registerIcon(texturePath + textureName);
|
||||
|
||||
@@ -74,7 +74,7 @@ public class PartHelper extends Item implements IToolPart
|
||||
{
|
||||
if (this.icons.containsKey(Integer.valueOf(damageValue)))
|
||||
{
|
||||
return (IIcon)this.icons.get(Integer.valueOf(damageValue));
|
||||
return this.icons.get(Integer.valueOf(damageValue));
|
||||
}
|
||||
return this.itemIcon;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class PartHelper extends Item implements IToolPart
|
||||
{
|
||||
for (Map.Entry<Integer, String> subItem : this.unlocalizedMaterialNames.entrySet())
|
||||
{
|
||||
int materialId = (Integer)subItem.getKey().intValue();
|
||||
int materialId = subItem.getKey().intValue();
|
||||
itemStackList.add(new ItemStack(item, 1, materialId));
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class PartHelper extends Item implements IToolPart
|
||||
|
||||
if (this.unlocalizedMaterialNames.containsKey(Integer.valueOf(damageValue)))
|
||||
{
|
||||
return "item." + (String)this.unlocalizedMaterialNames.get(Integer.valueOf(damageValue)) + "." + this.unlocalizedPartName;
|
||||
return "item." + this.unlocalizedMaterialNames.get(Integer.valueOf(damageValue)) + "." + this.unlocalizedPartName;
|
||||
}
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
@@ -113,8 +113,8 @@ public class PartHelper extends Item implements IToolPart
|
||||
|
||||
if (this.unlocalizedMaterialNames.containsKey(Integer.valueOf(damageValue)))
|
||||
{
|
||||
String unlocalizedMaterialName = (String)this.unlocalizedMaterialNames.get(Integer.valueOf(damageValue));
|
||||
if ((StatCollector.canTranslate("part." + this.unlocalizedPartName)) && (StatCollector.canTranslate("material." + unlocalizedMaterialName)))
|
||||
String unlocalizedMaterialName = this.unlocalizedMaterialNames.get(Integer.valueOf(damageValue));
|
||||
if (StatCollector.canTranslate("part." + this.unlocalizedPartName) && StatCollector.canTranslate("material." + unlocalizedMaterialName))
|
||||
{
|
||||
String localizedPartName = StatCollector.translateToLocal("part." + this.unlocalizedPartName);
|
||||
String localizedMaterialName = StatCollector.translateToLocal("material." + unlocalizedMaterialName);
|
||||
|
||||
@@ -41,16 +41,21 @@ public class RecipeHelper
|
||||
private static final ItemStack largeBladePattern = TConstructRegistry.getItemStack("largeBladePattern");
|
||||
private static final ItemStack hammerHeadPattern = TConstructRegistry.getItemStack("hammerHeadPattern");
|
||||
private static final ItemStack fullGuardPattern = TConstructRegistry.getItemStack("fullGuardPattern");
|
||||
private static final ItemStack crossbowBodyPattern = TConstructRegistry.getItemStack("crossbowBodyPattern");
|
||||
private static final ItemStack arrowHeadPattern = new ItemStack(pattern, 1, 25);
|
||||
|
||||
private static PartHelper _ARROWHEAD = BloodArsenalTinkers.ARROWHEAD;
|
||||
private static PartHelper _AXE_HEAD = BloodArsenalTinkers.AXE_HEAD;
|
||||
private static PartHelper _BATTLE_SIGN_HEAD = BloodArsenalTinkers.BATTLE_SIGN_HEAD;
|
||||
private static PartHelper _BINDING = BloodArsenalTinkers.BINDING;
|
||||
private static PartHelper _BOW_LIMB = BloodArsenalTinkers.BOW_LIMB;
|
||||
private static PartHelper _CHISEL_HEAD = BloodArsenalTinkers.CHISEL_HEAD;
|
||||
private static PartHelper _CHUNK = BloodArsenalTinkers.CHUNK;
|
||||
private static PartHelper _CROSSBAR = BloodArsenalTinkers.CROSSBAR;
|
||||
private static PartHelper _CROSSBOW_BODY = BloodArsenalTinkers.CROSSBOW_BODY;
|
||||
private static PartHelper _CROSSBOW_LIMB = BloodArsenalTinkers.CROSSBOW_LIMB;
|
||||
private static PartHelper _EXCAVATOR_HEAD = BloodArsenalTinkers.EXCAVATOR_HEAD;
|
||||
private static PartHelper _FISHING_ROD = BloodArsenalTinkers.FISHING_ROD;
|
||||
private static PartHelper _FRYPAN_HEAD = BloodArsenalTinkers.FRYPAN_HEAD;
|
||||
private static PartHelper _FULL_GUARD = BloodArsenalTinkers.FULL_GUARD;
|
||||
private static PartHelper _HAMMER_HEAD = BloodArsenalTinkers.HAMMER_HEAD;
|
||||
@@ -63,6 +68,7 @@ public class RecipeHelper
|
||||
private static PartHelper _PICKAXE_HEAD = BloodArsenalTinkers.PICKAXE_HEAD;
|
||||
private static PartHelper _SCYTHE_HEAD = BloodArsenalTinkers.SCYTHE_HEAD;
|
||||
private static PartHelper _SHOVEL_HEAD = BloodArsenalTinkers.SHOVEL_HEAD;
|
||||
private static PartHelper _SHURIKEN = BloodArsenalTinkers.SHURIKEN;
|
||||
private static PartHelper _SWORD_BLADE = BloodArsenalTinkers.SWORD_BLADE;
|
||||
private static PartHelper _TOOLROD = BloodArsenalTinkers.TOOLROD;
|
||||
private static PartHelper _TOUGHBIND = BloodArsenalTinkers.TOUGHBIND;
|
||||
@@ -117,7 +123,7 @@ public class RecipeHelper
|
||||
List<PatternBuilder.ItemKey> materials = PatternBuilder.instance.materials;
|
||||
for (int i = 0; i < materials.size(); i++)
|
||||
{
|
||||
PatternBuilder.ItemKey itemKey = (PatternBuilder.ItemKey)materials.get(i);
|
||||
PatternBuilder.ItemKey itemKey = materials.get(i);
|
||||
if ((itemKey.item == material.getItem()) && (material.getItemDamage() == itemKey.damage))
|
||||
{
|
||||
materials.remove(i);
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.arc.bloodarsenal.items.tool;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedIron extends Item
|
||||
{
|
||||
public InfusedIron()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("blood_infused_iron");
|
||||
setTextureName("BloodArsenal:blood_infused_iron");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Mundane iron infused");
|
||||
par3List.add("with life essence");
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,6 @@ public class InfusedIronSword extends ItemSword implements IBindable
|
||||
|
||||
}
|
||||
}
|
||||
par2EntityLivingBase.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.arc.bloodarsenal.items.tool;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InfusedStick extends Item
|
||||
{
|
||||
public InfusedStick()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("blood_infused_stick");
|
||||
setTextureName("BloodArsenal:blood_infused_stick");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("It's a stick");
|
||||
par3List.add("infused with life!");
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,6 @@ public class InfusedWoodSword extends ItemSword implements IBindable
|
||||
|
||||
}
|
||||
}
|
||||
par2EntityLivingBase.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
package com.arc.bloodarsenal.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionBleeding extends Potion
|
||||
{
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "textures/misc/potions.png");
|
||||
|
||||
public PotionBleeding(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
@@ -15,4 +21,11 @@ public class PotionBleeding extends Potion
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex()
|
||||
{
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.arc.bloodarsenal.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionSoulBurn extends Potion
|
||||
{
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "textures/misc/potions.png");
|
||||
|
||||
public PotionSoulBurn(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Potion setIconIndex(int par1, int par2)
|
||||
{
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex()
|
||||
{
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,15 @@
|
||||
package com.arc.bloodarsenal.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionSwimming extends Potion
|
||||
{
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "textures/misc/potions.png");
|
||||
|
||||
public PotionSwimming(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
@@ -15,4 +21,11 @@ public class PotionSwimming extends Potion
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex()
|
||||
{
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionVampiricAura extends Potion
|
||||
{
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("BloodArsenal", "textures/misc/potions.png");
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "textures/misc/potions.png");
|
||||
|
||||
public PotionVampiricAura(int par1, boolean par2, int par3)
|
||||
{
|
||||
@@ -22,11 +22,10 @@ public class PotionVampiricAura extends Potion
|
||||
return this;
|
||||
}
|
||||
|
||||
/* @SideOnly(Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex()
|
||||
{
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
package com.arc.bloodarsenal.renderer.block;
|
||||
|
||||
import com.arc.bloodarsenal.renderer.model.ModelPortableBloodAltar;
|
||||
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TilePortableAltarRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
private ModelPortableBloodAltar modelBloodAltar = new ModelPortableBloodAltar();
|
||||
private final RenderItem customRenderItem;
|
||||
|
||||
public TilePortableAltarRenderer()
|
||||
{
|
||||
customRenderItem = new RenderItem()
|
||||
{
|
||||
@Override
|
||||
public boolean shouldBob()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
customRenderItem.setRenderManager(RenderManager.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
|
||||
{
|
||||
modelBloodAltar.renderBloodAltar((TilePortableAltar) tileEntity, d0, d1, d2);
|
||||
modelBloodAltar.renderBloodLevel((TilePortableAltar) tileEntity, d0, d1, d2);
|
||||
|
||||
if (tileEntity instanceof TilePortableAltar)
|
||||
{
|
||||
TilePortableAltar tileAltar = (TilePortableAltar) tileEntity;
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (tileAltar.getStackInSlot(0) != null)
|
||||
{
|
||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
||||
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||
ghostEntityItem.hoverStart = 0.0F;
|
||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||
float displacement = 0.2F;
|
||||
|
||||
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F);
|
||||
}
|
||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private float getGhostItemScaleFactor(ItemStack itemStack)
|
||||
{
|
||||
float scaleFactor = 1.0F;
|
||||
|
||||
if (itemStack != null)
|
||||
{
|
||||
if (itemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.90F;
|
||||
|
||||
case 2:
|
||||
return 0.90F;
|
||||
|
||||
case 3:
|
||||
return 0.90F;
|
||||
|
||||
case 4:
|
||||
return 0.90F;
|
||||
|
||||
case 5:
|
||||
return 0.80F;
|
||||
|
||||
default:
|
||||
return 0.90F;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.65F;
|
||||
|
||||
case 2:
|
||||
return 0.65F;
|
||||
|
||||
case 3:
|
||||
return 0.65F;
|
||||
|
||||
case 4:
|
||||
return 0.65F;
|
||||
|
||||
default:
|
||||
return 0.65F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return scaleFactor;
|
||||
}
|
||||
|
||||
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection)
|
||||
{
|
||||
if (ghostItemStack != null)
|
||||
{
|
||||
if (ghostItemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
switch (forgeDirection)
|
||||
{
|
||||
case DOWN:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case UP:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case NORTH:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F);
|
||||
return;
|
||||
}
|
||||
|
||||
case SOUTH:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F);
|
||||
return;
|
||||
}
|
||||
|
||||
case EAST:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case WEST:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case UNKNOWN:
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (forgeDirection)
|
||||
{
|
||||
case DOWN:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case UP:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case NORTH:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F);
|
||||
return;
|
||||
}
|
||||
|
||||
case SOUTH:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F);
|
||||
return;
|
||||
}
|
||||
|
||||
case EAST:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case WEST:
|
||||
{
|
||||
GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F);
|
||||
return;
|
||||
}
|
||||
|
||||
case UNKNOWN:
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.arc.bloodarsenal.renderer.block.item;
|
||||
|
||||
import com.arc.bloodarsenal.renderer.model.ModelPortableBloodAltar;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TilePortableAltarItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelPortableBloodAltar modelBloodAltar;
|
||||
|
||||
public TilePortableAltarItemRenderer()
|
||||
{
|
||||
modelBloodAltar = new ModelPortableBloodAltar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
float scale = 0.08f;
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0, scale);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0.5f, scale);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, +0.5f, 0.5f, +0.5f, scale);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, -0.5f, -0.75f, -0.5f, scale);
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void renderBloodAltar(RenderBlocks render, ItemStack item, float x, float y, float z, float scale)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, z);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glRotatef(180f, 0f, 1f, 0f);
|
||||
ResourceLocation test = new ResourceLocation("bloodarsenal:textures/models/altar.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
modelBloodAltar.renderBloodAltar();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package com.arc.bloodarsenal.renderer;
|
||||
package com.arc.bloodarsenal.renderer.item;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.renderer.model.ModelEnergyGatling;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.renderer;
|
||||
package com.arc.bloodarsenal.renderer.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.arc.bloodarsenal.renderer.model;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModelPortableBloodAltar extends ModelBase
|
||||
{
|
||||
private static final ResourceLocation altar_texture = new ResourceLocation("bloodarsenal:textures/models/altar.png");
|
||||
|
||||
private IModelCustom modelBloodAltar;
|
||||
|
||||
public ModelPortableBloodAltar()
|
||||
{
|
||||
modelBloodAltar = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodaltar-fixeUV.obj"));
|
||||
}
|
||||
|
||||
public void renderBloodAltar()
|
||||
{
|
||||
modelBloodAltar.renderAll();
|
||||
}
|
||||
|
||||
public void renderBloodAltar(TilePortableAltar altar, double x, double y, double z)
|
||||
{
|
||||
float scale = 0.1f;
|
||||
// Push a blank matrix onto the stack
|
||||
GL11.glPushMatrix();
|
||||
// Move the object into the correct position on the block (because the OBJ's origin is the center of the object)
|
||||
GL11.glTranslatef((float) x + 0.5f, (float) y, (float) z + 0.5f);
|
||||
// Scale our object to about half-size in all directions (the OBJ file is a little large)
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
// Bind the texture, so that OpenGL properly textures our block.
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(altar_texture);
|
||||
// Render the object, using modelTutBox.renderAll();
|
||||
this.renderBloodAltar();
|
||||
// Pop this matrix from the stack.
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderBloodLevel(TilePortableAltar altar, double x, double y, double z)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float level = altar.getFluidAmount();
|
||||
GL11.glTranslatef((float) x , (float) y + 0.6499f + 0.12f * (level / altar.getCapacity()), (float) z);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
renderBloodLevel(AlchemicalWizardry.lifeEssenceFluid.getStillIcon());
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderBloodLevel(IIcon icon)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
double minU = (double) icon.getInterpolatedU(0);
|
||||
double maxU = (double) icon.getInterpolatedU(16);
|
||||
double minV = (double) icon.getInterpolatedV(0);
|
||||
double maxV = (double) icon.getInterpolatedV(16);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0, 1, 0);
|
||||
tessellator.addVertexWithUV(1, 0, 1, maxU, maxV);
|
||||
tessellator.addVertexWithUV(1, 0, 0, maxU, minV);
|
||||
tessellator.addVertexWithUV(0, 0, 0, minU, minV);
|
||||
tessellator.addVertexWithUV(0, 0, 1, minU, maxV);
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.renderer;
|
||||
package com.arc.bloodarsenal.renderer.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.arc.bloodarsenal.renderer.projectile;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.projectile.EntityPotion;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class RenderEntityBloodBall extends Render
|
||||
{
|
||||
private Item field_94151_a;
|
||||
private int field_94150_f;
|
||||
|
||||
public RenderEntityBloodBall(Item item, int par2)
|
||||
{
|
||||
this.field_94151_a = item;
|
||||
this.field_94150_f = par2;
|
||||
}
|
||||
|
||||
public RenderEntityBloodBall(Item item)
|
||||
{
|
||||
this(item, 0);
|
||||
}
|
||||
|
||||
public void doRender(Entity entity, double so, double me, double thing, float dont, float know)
|
||||
{
|
||||
IIcon iicon = this.field_94151_a.getIconFromDamage(this.field_94150_f);
|
||||
|
||||
if (iicon != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)so, (float)me, (float)thing);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
this.bindEntityTexture(entity);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (iicon == ItemPotion.func_94589_d("bottle_splash"))
|
||||
{
|
||||
int i = PotionHelper.func_77915_a(((EntityPotion) entity).getPotionDamage(), false);
|
||||
float f2 = (float)(i >> 16 & 255) / 255.0F;
|
||||
float f3 = (float)(i >> 8 & 255) / 255.0F;
|
||||
float f4 = (float)(i & 255) / 255.0F;
|
||||
GL11.glColor3f(f2, f3, f4);
|
||||
GL11.glPushMatrix();
|
||||
this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay"));
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
this.func_77026_a(tessellator, iicon);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private void func_77026_a(Tessellator par1Tessellator, IIcon par2IIcon)
|
||||
{
|
||||
float f = par2IIcon.getMinU();
|
||||
float f1 = par2IIcon.getMaxU();
|
||||
float f2 = par2IIcon.getMinV();
|
||||
float f3 = par2IIcon.getMaxV();
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity)
|
||||
{
|
||||
return new ResourceLocation("bloodarsenal", "textures/items/blood_ball.png");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.arc.bloodarsenal.renderer;
|
||||
package com.arc.bloodarsenal.renderer.projectile;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityGatlingProjectile;
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.arc.bloodarsenal.tileentity;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.FMLEmbeddedChannel;
|
||||
import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec;
|
||||
import cpw.mods.fml.common.network.FMLOutboundHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
public enum PacketHandler
|
||||
{
|
||||
INSTANCE;
|
||||
|
||||
private EnumMap<Side, FMLEmbeddedChannel> channels;
|
||||
|
||||
private PacketHandler()
|
||||
{
|
||||
// request a channel pair for IronChest from the network registry
|
||||
// Add the IronChestCodec as a member of both channel pipelines
|
||||
this.channels = NetworkRegistry.INSTANCE.newChannel("BloodArsenal", new TilePortableAltarCodec());
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
||||
{
|
||||
addClientHandler();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void addClientHandler()
|
||||
{
|
||||
FMLEmbeddedChannel clientChannel = this.channels.get(Side.CLIENT);
|
||||
|
||||
String tileAltarCodec = clientChannel.findChannelHandlerNameForType(TilePortableAltarCodec.class);
|
||||
clientChannel.pipeline().addAfter(tileAltarCodec, "TlePortableAltarHandler", new TilePortableAltarMessageHandler());
|
||||
}
|
||||
|
||||
private static class TilePortableAltarMessageHandler extends SimpleChannelInboundHandler<TilePortableAltarMessage>
|
||||
{
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, TilePortableAltarMessage msg) throws Exception
|
||||
{
|
||||
World world = BloodArsenal.proxy.getClientWorld();
|
||||
TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z);
|
||||
if (te instanceof TilePortableAltar)
|
||||
{
|
||||
TilePortableAltar altar = (TilePortableAltar) te;
|
||||
|
||||
altar.handlePacketData(msg.items, msg.fluids, msg.capacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class BAMessage
|
||||
{
|
||||
int index;
|
||||
}
|
||||
|
||||
public static class TilePortableAltarMessage extends BAMessage
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
|
||||
int[] items;
|
||||
int[] fluids;
|
||||
int capacity;
|
||||
}
|
||||
|
||||
private class TilePortableAltarCodec extends FMLIndexedMessageToMessageCodec<BAMessage>
|
||||
{
|
||||
public TilePortableAltarCodec()
|
||||
{
|
||||
addDiscriminator(0, TilePortableAltarMessage.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encodeInto(ChannelHandlerContext ctx, BAMessage msg, ByteBuf target) throws Exception
|
||||
{
|
||||
target.writeInt(msg.index);
|
||||
|
||||
target.writeInt(((TilePortableAltarMessage) msg).x);
|
||||
target.writeInt(((TilePortableAltarMessage) msg).y);
|
||||
target.writeInt(((TilePortableAltarMessage) msg).z);
|
||||
|
||||
target.writeBoolean(((TilePortableAltarMessage) msg).items != null);
|
||||
if (((TilePortableAltarMessage) msg).items != null)
|
||||
{
|
||||
int[] items = ((TilePortableAltarMessage) msg).items;
|
||||
for (int j = 0; j < items.length; j++)
|
||||
{
|
||||
int i = items[j];
|
||||
target.writeInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
target.writeBoolean(((TilePortableAltarMessage) msg).fluids != null);
|
||||
if (((TilePortableAltarMessage) msg).fluids != null)
|
||||
{
|
||||
int[] fluids = ((TilePortableAltarMessage) msg).fluids;
|
||||
for (int j = 0; j < fluids.length; j++)
|
||||
{
|
||||
int i = fluids[j];
|
||||
target.writeInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
target.writeInt(((TilePortableAltarMessage) msg).capacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, BAMessage msg)
|
||||
{
|
||||
int index = dat.readInt();
|
||||
|
||||
((TilePortableAltarMessage) msg).x = dat.readInt();
|
||||
((TilePortableAltarMessage) msg).y = dat.readInt();
|
||||
((TilePortableAltarMessage) msg).z = dat.readInt();
|
||||
boolean hasStacks = dat.readBoolean();
|
||||
|
||||
((TilePortableAltarMessage) msg).items = new int[TilePortableAltar.sizeInv * 3];
|
||||
if (hasStacks)
|
||||
{
|
||||
((TilePortableAltarMessage) msg).items = new int[TilePortableAltar.sizeInv * 3];
|
||||
for (int i = 0; i < ((TilePortableAltarMessage) msg).items.length; i++)
|
||||
{
|
||||
((TilePortableAltarMessage) msg).items[i] = dat.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
boolean hasFluids = dat.readBoolean();
|
||||
((TilePortableAltarMessage) msg).fluids = new int[6];
|
||||
if (hasFluids)
|
||||
{
|
||||
for (int i = 0; i < ((TilePortableAltarMessage) msg).fluids.length; i++)
|
||||
{
|
||||
((TilePortableAltarMessage) msg).fluids[i] = dat.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
((TilePortableAltarMessage) msg).capacity = dat.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
public static Packet getPacket(TilePortableAltar tileAltar)
|
||||
{
|
||||
TilePortableAltarMessage msg = new TilePortableAltarMessage();
|
||||
msg.index = 0;
|
||||
msg.x = tileAltar.xCoord;
|
||||
msg.y = tileAltar.yCoord;
|
||||
msg.z = tileAltar.zCoord;
|
||||
msg.items = tileAltar.buildIntDataList();
|
||||
msg.fluids = tileAltar.buildFluidList();
|
||||
msg.capacity = tileAltar.getCapacity();
|
||||
|
||||
return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg);
|
||||
}
|
||||
|
||||
public void sendTo(Packet message, EntityPlayerMP player)
|
||||
{
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player);
|
||||
this.channels.get(Side.SERVER).writeAndFlush(message);
|
||||
}
|
||||
|
||||
public void sendToAll(Packet message)
|
||||
{
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
|
||||
this.channels.get(Side.SERVER).writeAndFlush(message);
|
||||
}
|
||||
|
||||
public void sendToAllAround(Packet message, NetworkRegistry.TargetPoint point)
|
||||
{
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT);
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point);
|
||||
this.channels.get(Side.SERVER).writeAndFlush(message);
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.arc.bloodarsenal.tileentity;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileBloodArsenal extends TileEntity
|
||||
{
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.readFromNBT(nbttagcompound);
|
||||
readCustomNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
public void readCustomNBT(NBTTagCompound nbttagcompound) {}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.writeToNBT(nbttagcompound);
|
||||
writeCustomNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
public void writeCustomNBT(NBTTagCompound nbttagcompound) {}
|
||||
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
writeCustomNBT(nbttagcompound);
|
||||
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound);
|
||||
}
|
||||
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
|
||||
{
|
||||
super.onDataPacket(net, pkt);
|
||||
readCustomNBT(pkt.func_148857_g());
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,91 @@
|
||||
package com.arc.bloodarsenal.tileentity.container;
|
||||
|
||||
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerPortableAltar extends Container
|
||||
{
|
||||
protected TilePortableAltar tileEntity;
|
||||
|
||||
public ContainerPortableAltar(InventoryPlayer inventoryPlayer, TilePortableAltar te)
|
||||
{
|
||||
tileEntity = te;
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
addSlotToContainer(new Slot(tileEntity, j + i * 3, 62 + j * 18, 17 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
bindPlayerInventory(inventoryPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
protected void bindPlayerInventory(InventoryPlayer inventoryPlayer)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int j = 0; j < 9; j++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot)
|
||||
{
|
||||
ItemStack stack = null;
|
||||
Slot slotObject = (Slot) inventorySlots.get(slot);
|
||||
if (slotObject != null && slotObject.getHasStack())
|
||||
{
|
||||
ItemStack stackInSlot = slotObject.getStack();
|
||||
stack = stackInSlot.copy();
|
||||
if (slot < 9)
|
||||
{
|
||||
if (!this.mergeItemStack(stackInSlot, 0, 35, true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(stackInSlot, 0, 9, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (stackInSlot.stackSize == 0)
|
||||
{
|
||||
slotObject.putStack(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slotObject.onSlotChanged();
|
||||
}
|
||||
|
||||
if (stackInSlot.stackSize == stack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
slotObject.onPickupFromSlot(player, stackInSlot);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user