mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-20 04:09:46 +00:00
1.1.0 Preperation
Big release with big changes
This commit is contained in:
1 parent
da4b6d76d5
commit
037379f3e9
277 files changed
+2638
-252
No files matched your search
@@ -0,0 +1,7 @@
|
||||
package baubles.api;
|
||||
|
||||
public enum BaubleType {
|
||||
RING,
|
||||
AMULET,
|
||||
BELT
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package baubles.api;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
*/
|
||||
public class BaublesApi
|
||||
{
|
||||
static Method getBaubles;
|
||||
|
||||
/**
|
||||
* Retrieves the baubles inventory for the supplied player
|
||||
*/
|
||||
public static IInventory getBaubles(EntityPlayer player)
|
||||
{
|
||||
IInventory ot = null;
|
||||
|
||||
try
|
||||
{
|
||||
if(getBaubles == null)
|
||||
{
|
||||
Class<?> fake = Class.forName("baubles.common.lib.PlayerHandler");
|
||||
getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class);
|
||||
}
|
||||
|
||||
ot = (IInventory) getBaubles.invoke(null, player);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles");
|
||||
}
|
||||
|
||||
return ot;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package baubles.api;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* This interface should be extended by items that can be worn in bauble slots
|
||||
*
|
||||
* @author Azanor
|
||||
*/
|
||||
|
||||
public interface IBauble {
|
||||
|
||||
/**
|
||||
* This method return the type of bauble this is.
|
||||
* Type is used to determine the slots it can go into.
|
||||
*/
|
||||
public BaubleType getBaubleType(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* This method is called once per tick if the bauble is being worn by a player
|
||||
*/
|
||||
public void onWornTick(ItemStack itemstack, EntityLivingBase player);
|
||||
|
||||
/**
|
||||
* This method is called when the bauble is equipped by a player
|
||||
*/
|
||||
public void onEquipped(ItemStack itemstack, EntityLivingBase player);
|
||||
|
||||
/**
|
||||
* This method is called when the bauble is unequipped by a player
|
||||
*/
|
||||
public void onUnequipped(ItemStack itemstack, EntityLivingBase player);
|
||||
|
||||
/**
|
||||
* can this bauble be placed in a bauble slot
|
||||
*/
|
||||
public boolean canEquip(ItemStack itemstack, EntityLivingBase player);
|
||||
|
||||
/**
|
||||
* Can this bauble be removed from a bauble slot
|
||||
*/
|
||||
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
@API(owner = "Baubles", apiVersion = baubles.common.Baubles.VERSION, provides = "Baubles|API")
|
||||
package baubles.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
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.VampireRing;
|
||||
import com.arc.bloodarsenal.items.tinkers.BloodArsenalTinkers;
|
||||
import com.arc.bloodarsenal.items.tinkers.RecipeHelper;
|
||||
import com.arc.bloodarsenal.potion.PotionBleeding;
|
||||
import com.arc.bloodarsenal.potion.PotionSwimming;
|
||||
import com.arc.bloodarsenal.potion.PotionVampiricAura;
|
||||
import com.arc.bloodarsenal.rituals.RitualRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
@@ -11,6 +17,8 @@ import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
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;
|
||||
@@ -26,7 +34,7 @@ import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
@Mod(modid="BloodArsenal", version="1.0.0", name="Blood Arsenal", dependencies="required-after:AWWayofTime", guiFactory = "com.arc.bloodarsenal.gui.ConfigGuiFactory")
|
||||
@Mod(modid="BloodArsenal", version="1.0.0", 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";
|
||||
@@ -43,13 +51,14 @@ public class BloodArsenal
|
||||
public static Potion swimming;
|
||||
|
||||
public static Item.ToolMaterial infusedWood = EnumHelper.addToolMaterial("InfusedWood", 1, 0, 4.0F, 1.0F, 0);
|
||||
public static Item.ToolMaterial infusedIron = EnumHelper.addToolMaterial("InfusedIron", 3, 0, 10.0F, 4.0F, 0);
|
||||
public static Item.ToolMaterial infusedDiamond = EnumHelper.addToolMaterial("InfusedDiamond", 4, 0, 16.0F, 9.0F, 0);
|
||||
public static Item.ToolMaterial infusedNetherium = EnumHelper.addToolMaterial("InfusedNetherium", 5, 0, 21.0F, 11.0F, 0);
|
||||
public static Item.ToolMaterial infusedIron = EnumHelper.addToolMaterial("InfusedIron", 4, 0, 10.0F, 4.0F, 0);
|
||||
public static Item.ToolMaterial infusedDiamond = EnumHelper.addToolMaterial("InfusedDiamond", 6, 0, 16.0F, 9.0F, 0);
|
||||
public static Item.ToolMaterial infusedNetherium = EnumHelper.addToolMaterial("InfusedNetherium", 9, 0, 31.0F, 18.0F, 0);
|
||||
|
||||
public static ItemArmor.ArmorMaterial vampireArmor = EnumHelper.addArmorMaterial("VampireArmor", 0, new int[]{3, 8, 6, 3}, 0);
|
||||
|
||||
public static boolean isBaublesLoaded;
|
||||
public static boolean isTinkersConstructLoaded;
|
||||
|
||||
public static Logger logger = LogManager.getLogger(MODID);
|
||||
public static CreativeTabs BA_TAB = new CreativeTabs("BA_TAB")
|
||||
@@ -100,13 +109,14 @@ public class BloodArsenal
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Object dropsEvent = new ModLivingDropsEvent();
|
||||
MinecraftForge.EVENT_BUS.register(dropsEvent);
|
||||
|
||||
Object eventHook = new BloodArsenalEventHooks();
|
||||
FMLCommonHandler.instance().bus().register(eventHook);
|
||||
MinecraftForge.EVENT_BUS.register(eventHook);
|
||||
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
@@ -114,7 +124,6 @@ public class BloodArsenal
|
||||
{
|
||||
BloodArsenalRecipes.registerBindingRecipes();
|
||||
BloodArsenalRecipes.registerAltarRecipes();
|
||||
BloodArsenalRecipes.registerOrbRecipes();
|
||||
BloodArsenalRecipes.registerRecipes();
|
||||
RitualRegistry.initRituals();
|
||||
|
||||
@@ -122,8 +131,8 @@ public class BloodArsenal
|
||||
proxy.registerEvents();
|
||||
|
||||
vampiricAura = (new PotionVampiricAura(BloodArsenalConfig.vampiricAuraID, false, 0).setIconIndex(0, 0).setPotionName("Vampiric Aura"));
|
||||
bleeding = (new PotionVampiricAura(BloodArsenalConfig.bleedingID, true, 0).setIconIndex(0, 0).setPotionName("Bleeding"));
|
||||
swimming = (new PotionVampiricAura(BloodArsenalConfig.swimmingID, false, 0).setIconIndex(0, 0).setPotionName("Swimming"));
|
||||
bleeding = (new PotionBleeding(BloodArsenalConfig.bleedingID, true, 0).setIconIndex(0, 0).setPotionName("Bleeding"));
|
||||
swimming = (new PotionSwimming(BloodArsenalConfig.swimmingID, false, 0).setIconIndex(0, 0).setPotionName("Swimming"));
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
@@ -133,10 +142,27 @@ public class BloodArsenal
|
||||
{
|
||||
isBaublesLoaded = true;
|
||||
logger.info("Loaded Baubles integration");
|
||||
|
||||
ModItems.vampire_ring = new VampireRing();
|
||||
GameRegistry.registerItem(ModItems.vampire_ring, "vampire_ring");
|
||||
}
|
||||
else
|
||||
{
|
||||
isBaublesLoaded = false;
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("TConstruct"))
|
||||
{
|
||||
isTinkersConstructLoaded = true;
|
||||
logger.info("Loaded Tinker's Construct integration");
|
||||
|
||||
BloodArsenalTinkers.addMaterials();
|
||||
BloodArsenalTinkers.addParts();
|
||||
RecipeHelper.addRecipes();
|
||||
}
|
||||
else
|
||||
{
|
||||
isTinkersConstructLoaded = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,10 @@ public class BloodArsenalConfig
|
||||
public static Configuration config;
|
||||
|
||||
// Config Categories
|
||||
public static String misc = "Miscellaneous";
|
||||
public static String potionid = "Potion ID";
|
||||
public static String ritualblacklist = "Ritual Blacklist";
|
||||
public static String toolsetting = "Tool Settings";
|
||||
public static String misc = "Miscellaneous";
|
||||
|
||||
// Config Options
|
||||
// Potion ID's
|
||||
@@ -22,6 +22,7 @@ public class BloodArsenalConfig
|
||||
|
||||
// Tool Settings
|
||||
public static boolean diamondToolsAllowed;
|
||||
public static boolean tinkerToolsAllowed;
|
||||
|
||||
// Ritual Blacklist
|
||||
public static boolean ritualDisabledMidas;
|
||||
@@ -29,30 +30,44 @@ public class BloodArsenalConfig
|
||||
|
||||
// Miscellaneous
|
||||
public static boolean isRedGood;
|
||||
public static boolean cakeIsLie;
|
||||
|
||||
public static void init(File file)
|
||||
{
|
||||
config = new Configuration(file);
|
||||
syncConfig();
|
||||
try
|
||||
{
|
||||
syncConfig();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
BloodArsenal.logger.error("There has been an error loading the configurations, go ask on the forums.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
|
||||
public static void syncConfig()
|
||||
{
|
||||
config.addCustomCategoryComment(potionid, "Change potion ID's here if you have conflicts");
|
||||
config.addCustomCategoryComment(toolsetting, "Settings for various tools");
|
||||
config.addCustomCategoryComment(ritualblacklist, "Blacklist rituals that you don't want/like.");
|
||||
config.addCustomCategoryComment(misc, "Random things'n'stuff.");
|
||||
config.addCustomCategoryComment(ritualblacklist, "Blacklist rituals that you don't want/like");
|
||||
config.addCustomCategoryComment(misc, "Random stuffs");
|
||||
|
||||
vampiricAuraID = config.get(potionid, "Vampiric Aura", 30).getInt(vampiricAuraID);
|
||||
bleedingID = config.get(potionid, "Bleeding", 31).getInt(bleedingID);
|
||||
swimmingID = config.get(potionid, "Swimming", 32).getInt(swimmingID);
|
||||
vampiricAuraID = config.get(potionid, "Vampiric Aura", 150).getInt(vampiricAuraID);
|
||||
bleedingID = config.get(potionid, "Bleeding", 151).getInt(bleedingID);
|
||||
swimmingID = config.get(potionid, "Swimming", 152).getInt(swimmingID);
|
||||
|
||||
diamondToolsAllowed = config.get(toolsetting, "Are Infused Diamond tools allowed", true).getBoolean(diamondToolsAllowed);
|
||||
tinkerToolsAllowed = config.get(toolsetting, "Are Tinker's Construct tools allowed (only when TConstruct is found)", true).getBoolean(tinkerToolsAllowed);
|
||||
|
||||
ritualDisabledWither = config.get(ritualblacklist, "Ritual of Withering", false).getBoolean(ritualDisabledWither);
|
||||
ritualDisabledMidas = config.get(ritualblacklist, "Midas Touch", false).getBoolean(ritualDisabledMidas);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
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.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
public class BloodArsenalEventHooks
|
||||
{
|
||||
public final float speed = 0.025F;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityDamaged(LivingAttackEvent event)
|
||||
{
|
||||
@@ -24,15 +29,101 @@ public class BloodArsenalEventHooks
|
||||
((EntityLivingBase) entityAttacking).setHealth(((EntityLivingBase) entityAttacking).getHealth() + drainedHealth);
|
||||
}
|
||||
}
|
||||
|
||||
if (entityAttacked.isPotionActive(BloodArsenal.swimming))
|
||||
{
|
||||
if (entityAttacked.isInsideOfMaterial(Material.lava))
|
||||
{
|
||||
if (event.source.isFireDamage())
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
|
||||
{
|
||||
if (event.modID.equals(BloodArsenal.MODID))
|
||||
{
|
||||
BloodArsenalConfig.syncConfig();
|
||||
BloodArsenal.logger.info("Refreshing configuration file.");
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onEntityUpdate(LivingEvent.LivingUpdateEvent event)
|
||||
{
|
||||
EntityLivingBase entityLiving = event.entityLiving;
|
||||
|
||||
if (entityLiving.isPotionActive(BloodArsenal.bleeding))
|
||||
{
|
||||
int i = entityLiving.getActivePotionEffect(BloodArsenal.bleeding).getAmplifier();
|
||||
int j = i + 1;
|
||||
|
||||
// if (entityLiving.worldObj.getWorldTime() % (20 / (i + 1)) == 0)
|
||||
// {
|
||||
// entityLiving.attackEntityFrom(BloodArsenal.deathFromBlood, 2);
|
||||
// entityLiving.hurtResistantTime = Math.min(entityLiving.hurtResistantTime, 20 / (i + 1));
|
||||
// }
|
||||
}
|
||||
|
||||
if (entityLiving.isPotionActive(BloodArsenal.swimming))
|
||||
{
|
||||
if (entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityLivingBase player = (EntityPlayer) entityLiving;
|
||||
if (player.isInWater())
|
||||
{
|
||||
player.motionX *= 1.2D;
|
||||
if (player.motionY > 0.0D)
|
||||
{
|
||||
player.motionY *= 1.2D;
|
||||
}
|
||||
player.motionZ *= 1.2D;
|
||||
double maxSpeed = 0.2D;
|
||||
if (player.motionX > maxSpeed)
|
||||
{
|
||||
player.motionX = maxSpeed;
|
||||
}
|
||||
else if (player.motionX < -maxSpeed)
|
||||
{
|
||||
player.motionX = -maxSpeed;
|
||||
}
|
||||
if (player.motionY > maxSpeed)
|
||||
{
|
||||
player.motionY = maxSpeed;
|
||||
}
|
||||
if (player.motionZ > maxSpeed)
|
||||
{
|
||||
player.motionZ = maxSpeed;
|
||||
}
|
||||
else if (player.motionZ < -maxSpeed)
|
||||
{
|
||||
player.motionZ = -maxSpeed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* if (entityLiving.isInsideOfMaterial(Material.lava))
|
||||
{
|
||||
if (entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
|
||||
entityLiving.extinguish();
|
||||
|
||||
if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)
|
||||
{
|
||||
player.moveFlying(0F, 1F, player.capabilities.isFlying ? speed : speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/ }
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void breakSpeed(PlayerEvent.BreakSpeed event)
|
||||
{
|
||||
EntityLivingBase entityLiving = event.entityLiving;
|
||||
|
||||
if (entityLiving.isPotionActive(BloodArsenal.swimming))
|
||||
{
|
||||
if (entityLiving.isInsideOfMaterial(Material.water) || entityLiving.isInsideOfMaterial(Material.lava))
|
||||
{
|
||||
event.newSpeed = 1.75F;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,13 +17,13 @@ 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, 40000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_iron), new ItemStack(Items.iron_ingot), 2, 5000, 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(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.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(ModBlocks.blood_cake), new ItemStack(Blocks.cake), 4, 10000, 5, 5, false);
|
||||
}
|
||||
|
||||
public static void registerBindingRecipes()
|
||||
@@ -39,7 +39,7 @@ public class BloodArsenalRecipes
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.vampire_boots), new ItemStack(Items.leather_boots));
|
||||
}
|
||||
|
||||
public static void registerOrbRecipes()
|
||||
public static void registerRecipes()
|
||||
{
|
||||
int craftingConstant = OreDictionary.WILDCARD_VALUE;
|
||||
|
||||
@@ -52,13 +52,10 @@ public class BloodArsenalRecipes
|
||||
ItemStack magicianOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.magicianBloodOrb, 1, craftingConstant);
|
||||
ItemStack masterOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.masterBloodOrb, 1, craftingConstant);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stone, 4), "aba", "bcb", "aba", 'a', Blocks.stone, 'b', blankSlate, 'c', weakOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stone, 4, 1), "aba", "bcb", "aba", 'a', Blocks.stone, 'b', reinforcedSlate, 'c', apprenticeOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stone, 4, 2), "aba", "bcb", "aba", 'a', Blocks.stone, 'b', imbuedSlate, 'c', magicianOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModBlocks.blood_stone, 4, 3), "aba", "bcb", "aba", 'a', Blocks.stone, 'b', demonicSlate, 'c', masterOrb));
|
||||
|
||||
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(ModBlocks.blood_infused_iron_block), "aaa", "aba", "aaa", 'a', ModItems.blood_infused_iron, '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));
|
||||
@@ -69,13 +66,16 @@ public class BloodArsenalRecipes
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_pickaxe_diamond), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_diamond_bound, 'b', ModItems.blood_infused_pickaxe_iron, 'c', ModItems.amorphic_catalyst, 'd', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.blood_infused_shovel_diamond), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_diamond_bound, 'b', ModItems.blood_infused_shovel_iron, 'c', ModItems.amorphic_catalyst, 'd', masterOrb));
|
||||
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', masterOrb));
|
||||
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(ModItems.soul_nullifier), "aaa", "aba", "aca", 'a', ModItems.soul_fragment, 'b', WayofTime.alchemicalWizardry.ModItems.armourInhibitor, 'c', 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));
|
||||
|
||||
public static void registerRecipes()
|
||||
{
|
||||
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_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);
|
||||
@@ -87,9 +87,13 @@ public class BloodArsenalRecipes
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.blood_infused_sword_wood), " a ", " a ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.blood_infused_planks, 4), ModBlocks.blood_infused_wood);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.blankSlate, 9), ModBlocks.blood_stone);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.reinforcedSlate, 9), new ItemStack(ModBlocks.blood_stone, 1, 1));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.imbuedSlate, 9), new ItemStack(ModBlocks.blood_stone, 1, 2));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.demonicSlate, 9), new ItemStack(ModBlocks.blood_stone, 1, 3));
|
||||
//This is a long one
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.amorphic_catalyst), WayofTime.alchemicalWizardry.ModItems.blankSlate, WayofTime.alchemicalWizardry.ModItems.aether, WayofTime.alchemicalWizardry.ModItems.terrae, WayofTime.alchemicalWizardry.ModItems.crystallos, WayofTime.alchemicalWizardry.ModItems.sanctus, WayofTime.alchemicalWizardry.ModItems.magicales, WayofTime.alchemicalWizardry.ModItems.crepitous, WayofTime.alchemicalWizardry.ModItems.incendium, WayofTime.alchemicalWizardry.ModItems.aquasalus);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.blood_infused_iron, 8), ModBlocks.blood_infused_iron_block);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
package com.arc.bloodarsenal;
|
||||
|
||||
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 cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public void registerRenders()
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.energy_gatling, new ItemRenderGatling());
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGatlingProjectile.class, new RenderEntityGatlingProjectile());
|
||||
}
|
||||
|
||||
public void registerEntities()
|
||||
@@ -22,9 +31,4 @@ public class ClientProxy extends CommonProxy
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public ModelBiped getArmorModel(int id)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import com.arc.bloodarsenal.BloodArsenalConfig;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -10,11 +10,7 @@ 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.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -26,10 +22,6 @@ public class BlockBloodCake extends Block
|
||||
private IIcon cakeTop;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon cakeBottom;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon cakeInner;
|
||||
|
||||
private String owner;
|
||||
|
||||
public BlockBloodCake()
|
||||
{
|
||||
@@ -85,7 +77,7 @@ public class BlockBloodCake extends Block
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int par1, int x)
|
||||
{
|
||||
return par1 == 1 ? cakeTop : (par1 == 0 ? cakeBottom : (x > 0 && par1 == 4 ? cakeInner : blockIcon));
|
||||
return par1 == 1 ? cakeTop : (par1 == 0 ? cakeBottom : (x > 0 && par1 == 4 ? null : blockIcon));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +85,6 @@ public class BlockBloodCake extends Block
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_cake_side");
|
||||
cakeInner = iconRegister.registerIcon("BloodArsenal:cake_inner");
|
||||
cakeTop = iconRegister.registerIcon("BloodArsenal:blood_cake_top");
|
||||
cakeBottom = iconRegister.registerIcon("BloodArsenal:blood_cake_bottom");
|
||||
}
|
||||
@@ -107,49 +98,37 @@ public class BlockBloodCake extends Block
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
eatCake(world, x, y, z, player);
|
||||
eatCake(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
eatCake(world, x, y, z, player);
|
||||
eatCake(player);
|
||||
}
|
||||
|
||||
public void eatCake(World world, int x, int y, int z, EntityPlayer player)
|
||||
public void eatCake(EntityPlayer player)
|
||||
{
|
||||
World worldSave = MinecraftServer.getServer().worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
|
||||
String playerEating = player.getCommandSenderName();
|
||||
|
||||
if (data == null)
|
||||
if (player.canEat(false))
|
||||
{
|
||||
data = new LifeEssenceNetwork(owner);
|
||||
worldSave.setItemData(owner, data);
|
||||
}
|
||||
player.getFoodStats().addStats(2, 1.5F);
|
||||
SoulNetworkHandler.syphonFromNetwork(playerEating, 200);
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
|
||||
if (currentEssence >= 200)
|
||||
{
|
||||
if (player.canEat(false))
|
||||
if (BloodArsenalConfig.cakeIsLie)
|
||||
{
|
||||
player.getFoodStats().addStats(2, 1.5F);
|
||||
SoulNetworkHandler.syphonFromNetwork(owner, 200);
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("Omm nom nom"));
|
||||
}
|
||||
else if (player.canEat(true))
|
||||
{
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("You are too full to eat any cake"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setHealth(player.getHealth() - 2);
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("The cake is a lie!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("Omm nom nom"));
|
||||
}
|
||||
}
|
||||
else if (player.canEat(true))
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("You are too full to eat any cake"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockBloodInfusedDiamond extends Block
|
||||
{
|
||||
public BlockBloodInfusedDiamond()
|
||||
{
|
||||
super(Material.iron);
|
||||
setBlockName("blood_infused_diamond_block");
|
||||
setBlockTextureName("BloodArsenal:blood_infused_diamond_block");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(10.0F);
|
||||
setResistance(12.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.items.ModItems;
|
||||
import net.minecraft.block.BlockGlowstone;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBloodInfusedGlowstone extends BlockGlowstone
|
||||
{
|
||||
public BlockBloodInfusedGlowstone()
|
||||
{
|
||||
super(Material.glass);
|
||||
setBlockName("blood_infused_glowstone");
|
||||
setBlockTextureName("BloodArsenal:blood_infused_glowstone");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(0.5F);
|
||||
setResistance(0.75F);
|
||||
setStepSound(soundTypeGlass);
|
||||
setLightLevel(1.0F);
|
||||
}
|
||||
|
||||
public Item getItemDropped(int par1, Random random, int par3) {return ModItems.blood_infused_glowstone_dust;}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockBloodLamp extends Block
|
||||
{
|
||||
public BlockBloodLamp()
|
||||
{
|
||||
super(Material.iron);
|
||||
setBlockName("blood_lamp");
|
||||
setBlockTextureName("BloodArsenal:blood_lamp");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setStepSound(soundTypePiston);
|
||||
setHardness(5.0F);
|
||||
setResistance(6.0F);
|
||||
setLightLevel(1.0F);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class BlockBloodStone extends Block
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1Item, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
if(this.equals(ModBlocks.blood_stone))
|
||||
if (this.equals(ModBlocks.blood_stone))
|
||||
{
|
||||
par3List.add(new ItemStack(par1Item, 1, 0));
|
||||
par3List.add(new ItemStack(par1Item, 1, 1));
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import net.minecraft.block.BlockTorch;
|
||||
|
||||
public class BlockBloodTorch extends BlockTorch
|
||||
{
|
||||
public BlockBloodTorch()
|
||||
{
|
||||
super();
|
||||
setBlockName("blood_torch");
|
||||
setBlockTextureName("BloodArsenal:blood_torch");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(0.0F);
|
||||
setLightLevel(0.9375F);
|
||||
setStepSound(soundTypeWood);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ public class BlockInfusedIron extends Block
|
||||
setBlockTextureName("BloodArsenal:blood_infused_iron_block");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setHardness(7.5F);
|
||||
setResistance(1.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.arc.bloodarsenal.blocks;
|
||||
|
||||
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;
|
||||
@@ -12,6 +14,7 @@ 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;
|
||||
@@ -284,19 +287,16 @@ public class BlockInfusedIronDoor extends BlockContainer
|
||||
if (tileEntity.owner.equals(null))
|
||||
{
|
||||
tileEntity.setOwner(playerName);
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentTranslation("Door successfully bounded to you!"));
|
||||
player.addChatMessage(new ChatComponentTranslation("Door successfully bounded to you!"));
|
||||
}
|
||||
else if (tileEntity.owner.equals(playerName))
|
||||
{
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentTranslation("Door is already bound to you!"));
|
||||
player.addChatMessage(new ChatComponentTranslation("Door is already bound to you!"));
|
||||
}
|
||||
else if (!tileEntity.owner.equals(playerName))
|
||||
{
|
||||
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentTranslation("You feel an odd draining sensation as the door actively resists you."));
|
||||
player.addChatMessage(new ChatComponentTranslation("You feel an odd draining sensation as the door actively resists you."));
|
||||
player.setHealth(player.getHealth() - 1);
|
||||
|
||||
if (player.getHealth() <= 0.0005f)
|
||||
|
||||
@@ -140,10 +140,22 @@ public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int par5, EntityPlayer player)
|
||||
{
|
||||
String playerHarvest = player.getCommandSenderName();
|
||||
TileOwned tileEntity = (TileOwned) world.getTileEntity(x, y, z);
|
||||
|
||||
if (player.capabilities.isCreativeMode && (par5 & 8) != 0 && world.getBlock(x, y - 1, z) == this)
|
||||
{
|
||||
world.setBlockToAir(x, y - 1, z);
|
||||
}
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!(tileEntity.getOwner().equals(playerHarvest)))
|
||||
{
|
||||
player.setHealth(player.getHealth() - 8);
|
||||
player.addChatMessage(new ChatComponentText("You have severed a connection to the Soul Network!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -283,22 +295,19 @@ public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
String playerName = player.getCommandSenderName();
|
||||
TileOwned tileEntity = (TileOwned) world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity.owner.equals(null))
|
||||
if (tileEntity.getOwner() == null)
|
||||
{
|
||||
tileEntity.setOwner(playerName);
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("Door successfully bounded to you!"));
|
||||
player.addChatMessage(new ChatComponentText("Door successfully bounded to you!"));
|
||||
}
|
||||
else if (tileEntity.owner.equals(playerName))
|
||||
else if (tileEntity.getOwner().equals(playerName))
|
||||
{
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("Door is already bound to you!"));
|
||||
player.addChatMessage(new ChatComponentText("Door is already bound to you!"));
|
||||
}
|
||||
else if (!tileEntity.owner.equals(playerName))
|
||||
else if (!(tileEntity.getOwner().equals(playerName)))
|
||||
{
|
||||
player.hurtTime = 2;
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("You feel an odd draining sensation as the door actively resists you."));
|
||||
player.setHealth(player.getHealth() - 2);
|
||||
player.addChatMessage(new ChatComponentText("You feel an odd draining sensation as the door actively resists you."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +317,7 @@ public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
TileOwned tileEntity = (TileOwned) world.getTileEntity(x, y, z);
|
||||
tileEntity.setOwner(tileEntity.owner);
|
||||
|
||||
if (player.getCommandSenderName().equals(tileEntity.owner))
|
||||
if (player.getCommandSenderName().equals(tileEntity.getOwner()))
|
||||
{
|
||||
int i1 = getFullMetadata(world, x, y, z);
|
||||
int j1 = i1 & 7;
|
||||
@@ -327,8 +336,7 @@ public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
|
||||
if (currentEssence < 10)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("You are too weak to open the door."));
|
||||
player.addChatMessage(new ChatComponentText("You are too weak to open the door."));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -349,8 +357,8 @@ public class BlockInfusedWoodenDoor extends BlockContainer
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!world.isRemote)
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("The door is locked."));
|
||||
player.setHealth(player.getHealth() - 2);
|
||||
player.addChatMessage(new ChatComponentText("You feel an odd draining sensation as the door actively resists you."));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.arc.bloodarsenal.blocks;
|
||||
import com.arc.bloodarsenal.items.block.BloodStoneBlock;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class ModBlocks
|
||||
{
|
||||
@@ -18,6 +17,11 @@ public class ModBlocks
|
||||
public static Block blood_door_wood;
|
||||
public static Block blood_door_iron;
|
||||
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 void init()
|
||||
{
|
||||
@@ -32,6 +36,11 @@ public class ModBlocks
|
||||
blood_door_wood = new BlockInfusedWoodenDoor();
|
||||
blood_door_iron = new BlockInfusedIronDoor();
|
||||
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();
|
||||
}
|
||||
|
||||
public static void registerBlocksInPre()
|
||||
@@ -47,5 +56,10 @@ public class ModBlocks
|
||||
GameRegistry.registerBlock(ModBlocks.blood_door_wood, "blood_door_wood");
|
||||
GameRegistry.registerBlock(ModBlocks.blood_door_iron, "blood_door_iron");
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,501 @@
|
||||
package com.arc.bloodarsenal.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.common.registry.IThrowableEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class EntityGatlingProjectile extends Entity implements IProjectile, IThrowableEntity
|
||||
{
|
||||
protected int xTile = -1;
|
||||
protected int yTile = -1;
|
||||
protected int zTile = -1;
|
||||
protected int inTile = 0;
|
||||
protected int inData = 0;
|
||||
protected boolean inGround = false;
|
||||
public EntityLivingBase shootingEntity;
|
||||
protected int ticksInAir = 0;
|
||||
protected int maxTicksInAir = 600;
|
||||
private int ricochetCounter = 0;
|
||||
private boolean scheduledForDeath = false;
|
||||
protected int projectileDamage = 4;
|
||||
|
||||
public EntityGatlingProjectile(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
setSize(0.5F, 0.5F);
|
||||
maxTicksInAir = 600;
|
||||
}
|
||||
|
||||
public EntityGatlingProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage)
|
||||
{
|
||||
super(par1World);
|
||||
shootingEntity = par2EntityPlayer;
|
||||
float par3 = 0.8F;
|
||||
setSize(0.5F, 0.5F);
|
||||
setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||
posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
posY -= 0.2D;
|
||||
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
setPosition(posX, posY, posZ);
|
||||
yOffset = 0.0F;
|
||||
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
|
||||
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
|
||||
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI);
|
||||
setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F);
|
||||
projectileDamage = damage;
|
||||
maxTicksInAir = 600;
|
||||
}
|
||||
|
||||
public EntityGatlingProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch)
|
||||
{
|
||||
super(par1World);
|
||||
shootingEntity = par2EntityPlayer;
|
||||
float par3 = 0.8F;
|
||||
setSize(0.5F, 0.5F);
|
||||
setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
|
||||
posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
posY -= 0.2D;
|
||||
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
setPosition(posX, posY, posZ);
|
||||
yOffset = 0.0F;
|
||||
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
|
||||
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
|
||||
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI);
|
||||
setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F);
|
||||
projectileDamage = damage;
|
||||
}
|
||||
|
||||
public EntityGatlingProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir)
|
||||
{
|
||||
super(par1World);
|
||||
renderDistanceWeight = 10.0D;
|
||||
shootingEntity = par2EntityLivingBase;
|
||||
posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D;
|
||||
double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX;
|
||||
double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 1.5F) - posY;
|
||||
double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ;
|
||||
double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2);
|
||||
|
||||
if (d3 >= 1.0E-7D)
|
||||
{
|
||||
float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
|
||||
float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI));
|
||||
double d4 = d0 / d3;
|
||||
double d5 = d2 / d3;
|
||||
setLocationAndAngles(par2EntityLivingBase.posX + d4, posY, par2EntityLivingBase.posZ + d5, f2, f3);
|
||||
yOffset = 0.0F;
|
||||
float f4 = (float) d3 * 0.2F;
|
||||
setThrowableHeading(d0, d1, d2, par4, par5);
|
||||
}
|
||||
|
||||
projectileDamage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
dataWatcher.addObject(16, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8)
|
||||
{
|
||||
float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5);
|
||||
var1 /= var9;
|
||||
var3 /= var9;
|
||||
var5 /= var9;
|
||||
var1 += rand.nextGaussian() * 0.007499999832361937D * var8;
|
||||
var3 += rand.nextGaussian() * 0.007499999832361937D * var8;
|
||||
var5 += rand.nextGaussian() * 0.007499999832361937D * var8;
|
||||
var1 *= var7;
|
||||
var3 *= var7;
|
||||
var5 *= var7;
|
||||
motionX = var1;
|
||||
motionY = var3;
|
||||
motionZ = var5;
|
||||
float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5);
|
||||
prevRotationYaw = rotationYaw = (float) (Math.atan2(var1, var5) * 180.0D / Math.PI);
|
||||
prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
|
||||
{
|
||||
setPosition(par1, par3, par5);
|
||||
setRotation(par7, par8);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setVelocity(double par1, double par3, double par5)
|
||||
{
|
||||
motionX = par1;
|
||||
motionY = par3;
|
||||
motionZ = par5;
|
||||
|
||||
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
|
||||
{
|
||||
float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
|
||||
prevRotationYaw = rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI);
|
||||
prevRotationPitch = rotationPitch = (float) (Math.atan2(par3, var7) * 180.0D / Math.PI);
|
||||
prevRotationPitch = rotationPitch;
|
||||
prevRotationYaw = rotationYaw;
|
||||
setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
||||
if (ticksInAir > maxTicksInAir)
|
||||
{
|
||||
setDead();
|
||||
}
|
||||
|
||||
if (shootingEntity == null)
|
||||
{
|
||||
List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1));
|
||||
Iterator i = players.iterator();
|
||||
double closestDistance = Double.MAX_VALUE;
|
||||
EntityPlayer closestPlayer = null;
|
||||
|
||||
while (i.hasNext())
|
||||
{
|
||||
EntityPlayer e = (EntityPlayer) i.next();
|
||||
double distance = e.getDistanceToEntity(this);
|
||||
|
||||
if (distance < closestDistance)
|
||||
{
|
||||
closestPlayer = e;
|
||||
}
|
||||
}
|
||||
|
||||
if (closestPlayer != null)
|
||||
{
|
||||
shootingEntity = closestPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
|
||||
{
|
||||
float var1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
|
||||
prevRotationYaw = rotationYaw = (float) (Math.atan2(motionX, motionZ) * 180.0D / Math.PI);
|
||||
prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI);
|
||||
}
|
||||
|
||||
Block var16 = worldObj.getBlock(xTile, yTile, zTile);
|
||||
|
||||
if (var16 != null)
|
||||
{
|
||||
var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile);
|
||||
AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile);
|
||||
|
||||
if (var2 != null && var2.isVecInside(Vec3.createVectorHelper(posX, posY, posZ)))
|
||||
{
|
||||
inGround = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (inGround)
|
||||
{
|
||||
Block var18 = worldObj.getBlock(xTile, yTile, zTile);
|
||||
int var19 = worldObj.getBlockMetadata(xTile, yTile, zTile);
|
||||
|
||||
if (var18.equals(Block.getBlockById(inTile)) && var19 == inData){}
|
||||
}
|
||||
else
|
||||
{
|
||||
++ticksInAir;
|
||||
|
||||
if (ticksInAir > 1 && ticksInAir < 3)
|
||||
{
|
||||
for (int particles = 0; particles < 3; particles++)
|
||||
{
|
||||
doFiringParticles();
|
||||
}
|
||||
}
|
||||
|
||||
Vec3 var17 = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
Vec3 var3 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, false);
|
||||
var17 = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
var3 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
|
||||
if (var4 != null)
|
||||
{
|
||||
var3 = Vec3.createVectorHelper(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord);
|
||||
}
|
||||
|
||||
Entity var5 = null;
|
||||
List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
double var7 = 0.0D;
|
||||
Iterator var9 = var6.iterator();
|
||||
float var11;
|
||||
|
||||
while (var9.hasNext())
|
||||
{
|
||||
Entity var10 = (Entity) var9.next();
|
||||
|
||||
if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5))
|
||||
{
|
||||
var11 = 0.3F;
|
||||
AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11);
|
||||
MovingObjectPosition var13 = var12.calculateIntercept(var17, var3);
|
||||
|
||||
if (var13 != null)
|
||||
{
|
||||
double var14 = var17.distanceTo(var13.hitVec);
|
||||
|
||||
if (var14 < var7 || var7 == 0.0D)
|
||||
{
|
||||
var5 = var10;
|
||||
var7 = var14;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (var5 != null)
|
||||
{
|
||||
var4 = new MovingObjectPosition(var5);
|
||||
}
|
||||
|
||||
if (var4 != null)
|
||||
{
|
||||
onImpact(var4);
|
||||
|
||||
if (scheduledForDeath)
|
||||
{
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
|
||||
posX += motionX;
|
||||
posY += motionY;
|
||||
posZ += motionZ;
|
||||
MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
|
||||
setPosition(posX, posY, posZ);
|
||||
}
|
||||
}
|
||||
|
||||
public void doFiringParticles()
|
||||
{
|
||||
worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
|
||||
worldObj.spawnParticle("flame", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
par1NBTTagCompound.setShort("xTile", (short) xTile);
|
||||
par1NBTTagCompound.setShort("yTile", (short) yTile);
|
||||
par1NBTTagCompound.setShort("zTile", (short) zTile);
|
||||
par1NBTTagCompound.setByte("inTile", (byte) inTile);
|
||||
par1NBTTagCompound.setByte("inData", (byte) inData);
|
||||
par1NBTTagCompound.setByte("inGround", (byte) (inGround ? 1 : 0));
|
||||
par1NBTTagCompound.setInteger("ticksInAir", ticksInAir);
|
||||
par1NBTTagCompound.setInteger("maxTicksInAir", maxTicksInAir);
|
||||
par1NBTTagCompound.setInteger("projectileDamage", projectileDamage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
xTile = par1NBTTagCompound.getShort("xTile");
|
||||
yTile = par1NBTTagCompound.getShort("yTile");
|
||||
zTile = par1NBTTagCompound.getShort("zTile");
|
||||
inTile = par1NBTTagCompound.getByte("inTile") & 255;
|
||||
inData = par1NBTTagCompound.getByte("inData") & 255;
|
||||
inGround = par1NBTTagCompound.getByte("inGround") == 1;
|
||||
ticksInAir = par1NBTTagCompound.getInteger("ticksInAir");
|
||||
maxTicksInAir = par1NBTTagCompound.getInteger("maxTicksInAir");
|
||||
projectileDamage = par1NBTTagCompound.getInteger("projectileDamage");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canTriggerWalking()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttackWithItem()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onImpact(MovingObjectPosition mop)
|
||||
{
|
||||
if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null)
|
||||
{
|
||||
if (mop.entityHit == shootingEntity)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
onImpact(mop.entityHit);
|
||||
}
|
||||
else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
groundImpact(mop.sideHit);
|
||||
worldObj.createExplosion(shootingEntity, posX, posY, posZ, (float) 0.2, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void onImpact(Entity mop)
|
||||
{
|
||||
if (mop == shootingEntity && ticksInAir > 3)
|
||||
{
|
||||
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
|
||||
setDead();
|
||||
}
|
||||
else
|
||||
{
|
||||
doDamage(projectileDamage + d6(), mop);
|
||||
worldObj.createExplosion(shootingEntity, posX, posY, posZ, (float) 0.2, true);
|
||||
}
|
||||
|
||||
spawnHitParticles("magicCrit", 8);
|
||||
setDead();
|
||||
}
|
||||
|
||||
private int d6()
|
||||
{
|
||||
return rand.nextInt(6) + 2;
|
||||
}
|
||||
|
||||
protected void spawnHitParticles(String string, int i)
|
||||
{
|
||||
for (int particles = 0; particles < i; particles++)
|
||||
{
|
||||
worldObj.spawnParticle(string, posX, posY - (string == "portal" ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ));
|
||||
}
|
||||
}
|
||||
|
||||
protected void doDamage(int i, Entity mop)
|
||||
{
|
||||
mop.attackEntityFrom(getDamageSource(), i);
|
||||
}
|
||||
|
||||
public DamageSource getDamageSource()
|
||||
{
|
||||
return DamageSource.causeMobDamage(shootingEntity);
|
||||
}
|
||||
|
||||
public void groundImpact(int sideHit)
|
||||
{
|
||||
ricochet(sideHit);
|
||||
}
|
||||
|
||||
public double smallGauss(double d)
|
||||
{
|
||||
return (worldObj.rand.nextFloat() - 0.5D) * d;
|
||||
}
|
||||
|
||||
public double gaussian(double d)
|
||||
{
|
||||
return d + d * ((rand.nextFloat() - 0.5D) / 4);
|
||||
}
|
||||
|
||||
private void ricochet(int sideHit)
|
||||
{
|
||||
switch (sideHit)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
// topHit, bottomHit, reflect Y
|
||||
motionY = motionY * -1;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
// westHit, eastHit, reflect Z
|
||||
motionZ = motionZ * -1;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
// southHit, northHit, reflect X
|
||||
motionX = motionX * -1;
|
||||
break;
|
||||
}
|
||||
|
||||
ricochetCounter++;
|
||||
|
||||
if (ricochetCounter > getRicochetMax())
|
||||
{
|
||||
scheduledForDeath = true;
|
||||
|
||||
for (int particles = 0; particles < 4; particles++)
|
||||
{
|
||||
switch (sideHit)
|
||||
{
|
||||
case 0:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 1:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 4:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 5:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getRicochetMax()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity getThrower()
|
||||
{
|
||||
return shootingEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThrower(Entity entity)
|
||||
{
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
shootingEntity = (EntityLivingBase) entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,25 +6,27 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class ConfigGuiFactory implements IModGuiFactory {
|
||||
public class ConfigGuiFactory implements IModGuiFactory
|
||||
{
|
||||
|
||||
@Override
|
||||
public void initialize(Minecraft minecraftInstance) {
|
||||
|
||||
}
|
||||
public void initialize(Minecraft minecraftInstance) {}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiScreen> mainConfigGuiClass() {
|
||||
public Class<? extends GuiScreen> mainConfigGuiClass()
|
||||
{
|
||||
return ConfigGui.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
|
||||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
|
||||
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.arc.bloodarsenal.gui;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GuiHandler implements IGuiHandler
|
||||
{
|
||||
@Override
|
||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
BloodArsenal.logger.info("Open Gui");
|
||||
// return new ItemGuiBaseBook();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,6 @@ 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.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -46,7 +44,7 @@ public class ItemHeart extends Item
|
||||
}
|
||||
else
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodAresnal:heart");
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:heart");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
package com.arc.bloodarsenal.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -29,7 +30,7 @@ public class ItemSoulNullifier extends Item implements IBindable
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
/* EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
|
||||
@@ -43,7 +44,6 @@ public class ItemSoulNullifier extends Item implements IBindable
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
*/
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
@@ -71,28 +71,36 @@ public class ItemSoulNullifier extends Item implements IBindable
|
||||
}
|
||||
}
|
||||
|
||||
Collection<PotionEffect> potions = par3EntityPlayer.getActivePotionEffects();
|
||||
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive") && !par2World.isRemote)
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0));
|
||||
|
||||
if (par3EntityPlayer.isBurning())
|
||||
if (par3EntityPlayer.ticksExisted % 20 == 0)
|
||||
{
|
||||
par3EntityPlayer.extinguish();
|
||||
}
|
||||
else for (PotionEffect potion : potions)
|
||||
{
|
||||
int id = potion.getPotionID();
|
||||
boolean removed = false;
|
||||
Collection<PotionEffect> potions = par3EntityPlayer.getActivePotionEffects();
|
||||
|
||||
if (!par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionSoulFray.id))
|
||||
if (par3EntityPlayer.isBurning())
|
||||
{
|
||||
par3EntityPlayer.removePotionEffect(id);
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 100);
|
||||
par3EntityPlayer.extinguish();
|
||||
removed = true;
|
||||
}
|
||||
else
|
||||
else for (PotionEffect potion : potions)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 0);
|
||||
int id = potion.getPotionID();
|
||||
boolean badEffect;
|
||||
|
||||
badEffect = ReflectionHelper.getPrivateValue(Potion.class, Potion.potionTypes[id], new String[]{"isBadEffect", "field_76418_K"});
|
||||
|
||||
if (badEffect)
|
||||
{
|
||||
par3EntityPlayer.removePotionEffect(id);
|
||||
removed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (removed)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.blocks.ModBlocks;
|
||||
import com.arc.bloodarsenal.items.armor.VampireCostume;
|
||||
import com.arc.bloodarsenal.items.bauble.VampireRing;
|
||||
import com.arc.bloodarsenal.items.block.*;
|
||||
import com.arc.bloodarsenal.items.sigil.SigilEnder;
|
||||
import com.arc.bloodarsenal.items.sigil.SigilSwimming;
|
||||
import com.arc.bloodarsenal.items.tool.*;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -52,6 +53,11 @@ public class ModItems
|
||||
public static Item vampire_greaves;
|
||||
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 void init()
|
||||
{
|
||||
@@ -92,7 +98,11 @@ public class ModItems
|
||||
vampire_cape = new VampireCostume(1).setUnlocalizedName("vampire_cape");
|
||||
vampire_greaves = new VampireCostume(2).setUnlocalizedName("vampire_greaves");
|
||||
vampire_boots = new VampireCostume(3).setUnlocalizedName("vampire_boots");
|
||||
vampire_ring = new VampireRing();
|
||||
energy_gatling = new EnergyGatling();
|
||||
creative_dagger = new ItemCreativeDagger();
|
||||
sigil_of_swimming = new SigilSwimming();
|
||||
sigil_of_ender = new SigilEnder();
|
||||
blood_infused_glowstone_dust = new ItemBloodInfusedGlowstoneDust();
|
||||
}
|
||||
|
||||
public static void registerItems()
|
||||
@@ -133,6 +143,10 @@ public class ModItems
|
||||
GameRegistry.registerItem(ModItems.vampire_cape, "vampire_cape");
|
||||
GameRegistry.registerItem(ModItems.vampire_greaves, "vampire_greaves");
|
||||
GameRegistry.registerItem(ModItems.vampire_boots, "vampire_boots");
|
||||
GameRegistry.registerItem(ModItems.vampire_ring, "vampire_ring");
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,14 @@ import baubles.api.IBauble;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles")
|
||||
public abstract class ItemBauble extends Item implements IBauble
|
||||
{
|
||||
public ItemBauble()
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
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 net.minecraft.entity.item.EntityEnderPearl;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilEnder extends EnergyItems implements IBindable
|
||||
{
|
||||
public SigilEnder()
|
||||
{
|
||||
super();
|
||||
setUnlocalizedName("sigil_of_ender");
|
||||
setTextureName("BloodArsenal:sigil_of_ender");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Sticking your hand into the End");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
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());
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.isSneaking() && !par3EntityPlayer.isSwingInProgress)
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
else
|
||||
{
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "mob.endermen.portal", 1F, 1F);
|
||||
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par2World.spawnEntityInWorld(new EntityEnderPearl(par2World, par3EntityPlayer));
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
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.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilSwimming extends EnergyItems implements ArmourUpgrade, IBindable
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static IIcon passiveIcon;
|
||||
|
||||
public SigilSwimming()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("sigil_of_swimming");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Just keep swimming!");
|
||||
|
||||
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_swimming_deactivated");
|
||||
activeIcon = iconRegister.registerIcon("BloodArsenal:sigil_of_swimming_activated");
|
||||
passiveIcon = iconRegister.registerIcon("BloodArsenal:sigil_of_swimming_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(BloodArsenalConfig.swimmingID, 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(BloodArsenalConfig.swimmingID, 2, 0));
|
||||
}
|
||||
|
||||
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(BloodArsenalConfig.swimmingID, 2, 0, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyForTenSeconds()
|
||||
{
|
||||
return 150;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.arc.bloodarsenal.items.tinkers;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.client.TConstructClientRegistry;
|
||||
|
||||
public class BloodArsenalTinkers
|
||||
{
|
||||
public static PartHelper ARROWHEAD;
|
||||
public static PartHelper AXE_HEAD;
|
||||
public static PartHelper BATTLE_SIGN_HEAD;
|
||||
public static PartHelper BINDING;
|
||||
public static PartHelper CHISEL_HEAD;
|
||||
public static PartHelper CHUNK;
|
||||
public static PartHelper CROSSBAR;
|
||||
public static PartHelper EXCAVATOR_HEAD;
|
||||
public static PartHelper FRYPAN_HEAD;
|
||||
public static PartHelper FULL_GUARD;
|
||||
public static PartHelper HAMMER_HEAD;
|
||||
public static PartHelper KNIFE_BLADE;
|
||||
public static PartHelper LARGE_GUARD;
|
||||
public static PartHelper LARGE_SWORD_BLADE;
|
||||
public static PartHelper LARGEPLATE;
|
||||
public static PartHelper LUMBERAXE_HEAD;
|
||||
public static PartHelper MEDIUM_GUARD;
|
||||
public static PartHelper PICKAXE_HEAD;
|
||||
public static PartHelper SCYTHE_HEAD;
|
||||
public static PartHelper SHOVEL_HEAD;
|
||||
public static PartHelper SWORD_BLADE;
|
||||
public static PartHelper TOOLROD;
|
||||
public static PartHelper TOUGHBIND;
|
||||
public static PartHelper TOUGHROD;
|
||||
|
||||
public static void addMaterials()
|
||||
{
|
||||
if (BloodArsenal.isTinkersConstructLoaded)
|
||||
{
|
||||
TConstructRegistry.addToolMaterial(250, "Blood Infused Iron", 3, 250, 2000, 2, 0.75F, 0, 0.0F , "", "");
|
||||
|
||||
TConstructClientRegistry.addMaterialRenderMapping(250, "BloodArsenal", "blood_infused_iron", true);
|
||||
|
||||
TConstructRegistry.addBowMaterial(250, 500, 40, 1.2F);
|
||||
|
||||
TConstructRegistry.addArrowMaterial(250, 4.7F, 0.2F, 100.0F);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addParts()
|
||||
{
|
||||
initParts();
|
||||
|
||||
addMaterialToParts(250, "blood.infused.iron", "blood_infused_iron");
|
||||
|
||||
registerParts();
|
||||
}
|
||||
|
||||
private static void initParts()
|
||||
{
|
||||
ARROWHEAD = new PartHelper("arrowhead", 0, "");
|
||||
AXE_HEAD = new PartHelper("axe.head", 0, "");
|
||||
BATTLE_SIGN_HEAD = new PartHelper("battle.sign", 0, "");
|
||||
BINDING = new PartHelper("binding", 0, "");
|
||||
CHISEL_HEAD = new PartHelper("chisel.head", 0, "");
|
||||
CHUNK = new PartHelper("chunk", 0, "");
|
||||
CROSSBAR = new PartHelper("crossbar", 0, "");
|
||||
EXCAVATOR_HEAD = new PartHelper("excavator.head", 0, "");
|
||||
FRYPAN_HEAD = new PartHelper("frypan.head", 0, "");
|
||||
FULL_GUARD = new PartHelper("full.guard", 0, "");
|
||||
HAMMER_HEAD = new PartHelper("hammer.head", 0, "");
|
||||
KNIFE_BLADE = new PartHelper("knife.blade", 0, "");
|
||||
LARGE_GUARD = new PartHelper("large.guard", 0, "");
|
||||
LARGE_SWORD_BLADE = new PartHelper("large.sword.blade", 0, "");
|
||||
LARGEPLATE = new PartHelper("largeplate", 0, "");
|
||||
LUMBERAXE_HEAD = new PartHelper("lumberaxe.head", 0, "");
|
||||
MEDIUM_GUARD = new PartHelper("medium.guard", 0, "");
|
||||
PICKAXE_HEAD = new PartHelper("pickaxe.head", 0, "");
|
||||
SCYTHE_HEAD = new PartHelper("scythe.head", 0, "");
|
||||
SHOVEL_HEAD = new PartHelper("shovel.head", 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)
|
||||
{
|
||||
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");
|
||||
CHISEL_HEAD.addMaterial(materialID, unlocalizedName, texture + "_chisel_head");
|
||||
CHUNK.addMaterial(materialID, unlocalizedName, texture + "_chunk");
|
||||
CROSSBAR.addMaterial(materialID, unlocalizedName, texture + "_crossbar");
|
||||
EXCAVATOR_HEAD.addMaterial(materialID, unlocalizedName, texture + "_excavator_head");
|
||||
FRYPAN_HEAD.addMaterial(materialID, unlocalizedName, texture + "_frypan_head");
|
||||
FULL_GUARD.addMaterial(materialID, unlocalizedName, texture + "_full_guard");
|
||||
HAMMER_HEAD.addMaterial(materialID, unlocalizedName, texture + "_hammer_head");
|
||||
KNIFE_BLADE.addMaterial(materialID, unlocalizedName, texture + "_knife_blade");
|
||||
LARGE_GUARD.addMaterial(materialID, unlocalizedName, texture + "_large_guard");
|
||||
LARGE_SWORD_BLADE.addMaterial(materialID, unlocalizedName, texture + "_large_sword_blade");
|
||||
LARGEPLATE.addMaterial(materialID, unlocalizedName, texture + "_largeplate");
|
||||
LUMBERAXE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_lumberaxe_head");
|
||||
MEDIUM_GUARD.addMaterial(materialID, unlocalizedName, texture + "_medium_guard");
|
||||
PICKAXE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_pickaxe_head");
|
||||
SCYTHE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_scythe_head");
|
||||
SHOVEL_HEAD.addMaterial(materialID, unlocalizedName, texture + "_shovel_head");
|
||||
SWORD_BLADE.addMaterial(materialID, unlocalizedName, texture + "_sword_blade");
|
||||
TOOLROD.addMaterial(materialID, unlocalizedName, texture + "_rod");
|
||||
TOUGHBIND.addMaterial(materialID, unlocalizedName, texture + "_toughbind");
|
||||
TOUGHROD.addMaterial(materialID, unlocalizedName, texture + "_toughrod");
|
||||
}
|
||||
|
||||
private static void registerParts()
|
||||
{
|
||||
GameRegistry.registerItem(ARROWHEAD, "arrowhead");
|
||||
GameRegistry.registerItem(AXE_HEAD, "axeHead");
|
||||
GameRegistry.registerItem(BATTLE_SIGN_HEAD, "battleSign");
|
||||
GameRegistry.registerItem(BINDING, "binding");
|
||||
GameRegistry.registerItem(CHISEL_HEAD, "chiselHead");
|
||||
GameRegistry.registerItem(CHUNK, "chunk");
|
||||
GameRegistry.registerItem(CROSSBAR, "crossbar");
|
||||
GameRegistry.registerItem(EXCAVATOR_HEAD, "excavatorHead");
|
||||
GameRegistry.registerItem(FRYPAN_HEAD, "frypanHead");
|
||||
GameRegistry.registerItem(FULL_GUARD, "fullGuard");
|
||||
GameRegistry.registerItem(HAMMER_HEAD, "hammerHead");
|
||||
GameRegistry.registerItem(KNIFE_BLADE, "knifeBlade");
|
||||
GameRegistry.registerItem(LARGE_GUARD, "largeGuard");
|
||||
GameRegistry.registerItem(LARGE_SWORD_BLADE, "largeSwordBlade");
|
||||
GameRegistry.registerItem(LARGEPLATE, "largeplate");
|
||||
GameRegistry.registerItem(LUMBERAXE_HEAD, "lumberaxeHead");
|
||||
GameRegistry.registerItem(MEDIUM_GUARD, "mediumGuard");
|
||||
GameRegistry.registerItem(PICKAXE_HEAD, "pickaxeHead");
|
||||
GameRegistry.registerItem(SCYTHE_HEAD, "scytheHead");
|
||||
GameRegistry.registerItem(SHOVEL_HEAD, "shovelHead");
|
||||
GameRegistry.registerItem(SWORD_BLADE, "swordBlade");
|
||||
GameRegistry.registerItem(TOOLROD, "toolrod");
|
||||
GameRegistry.registerItem(TOUGHBIND, "toughbind");
|
||||
GameRegistry.registerItem(TOUGHROD, "toughrod");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.arc.bloodarsenal.items.tinkers;
|
||||
|
||||
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.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import tconstruct.library.util.IToolPart;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
public class PartHelper extends Item implements IToolPart
|
||||
{
|
||||
protected String defaultTexture;
|
||||
protected int defaultMaterialID;
|
||||
protected String unlocalizedPartName;
|
||||
protected HashMap<Integer, String> unlocalizedMaterialNames = new HashMap();
|
||||
protected HashMap<Integer, String> textures = new HashMap();
|
||||
protected HashMap<Integer, IIcon> icons = new HashMap();
|
||||
protected static final String texturePath = "BloodArsenal".toLowerCase(Locale.ENGLISH) + ":" + "tinkers/parts/";
|
||||
|
||||
public PartHelper(String defaultUnlocalizedPartName, int defaultMaterialID, String defaultTexture)
|
||||
{
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setMaxStackSize(64);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
|
||||
setUnlocalizedName("default." + defaultUnlocalizedPartName);
|
||||
this.unlocalizedPartName = defaultUnlocalizedPartName;
|
||||
this.defaultMaterialID = defaultMaterialID;
|
||||
this.defaultTexture = (texturePath + defaultTexture);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister icon)
|
||||
{
|
||||
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();
|
||||
|
||||
IIcon _icon = icon.registerIcon(texturePath + textureName);
|
||||
|
||||
this.icons.put(Integer.valueOf(materialID), _icon);
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaterialID(ItemStack itemStack)
|
||||
{
|
||||
int damageValue = itemStack.getItemDamage();
|
||||
if (damageValue >= 100)
|
||||
{
|
||||
return itemStack.getItemDamage();
|
||||
}
|
||||
return this.defaultMaterialID;
|
||||
}
|
||||
|
||||
public void addMaterial(int materialId, String unlocalizedName, String texture)
|
||||
{
|
||||
this.unlocalizedMaterialNames.put(Integer.valueOf(materialId), unlocalizedName);
|
||||
this.textures.put(Integer.valueOf(materialId), texture);
|
||||
}
|
||||
|
||||
public IIcon getIconFromDamage(int damageValue)
|
||||
{
|
||||
if (this.icons.containsKey(Integer.valueOf(damageValue)))
|
||||
{
|
||||
return (IIcon)this.icons.get(Integer.valueOf(damageValue));
|
||||
}
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
public void getSubItems(Item item, CreativeTabs tab, List itemStackList)
|
||||
{
|
||||
if (!this.unlocalizedMaterialNames.isEmpty())
|
||||
{
|
||||
for (Map.Entry<Integer, String> subItem : this.unlocalizedMaterialNames.entrySet())
|
||||
{
|
||||
int materialId = ((Integer)subItem.getKey()).intValue();
|
||||
itemStackList.add(new ItemStack(item, 1, materialId));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemStackList.add(new ItemStack(this, 1));
|
||||
}
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
int damageValue = itemStack.getItemDamage();
|
||||
|
||||
if (this.unlocalizedMaterialNames.containsKey(Integer.valueOf(damageValue)))
|
||||
{
|
||||
return "item." + (String)this.unlocalizedMaterialNames.get(Integer.valueOf(damageValue)) + "." + this.unlocalizedPartName;
|
||||
}
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack itemStack)
|
||||
{
|
||||
int damageValue = itemStack.getItemDamage();
|
||||
String displayName;
|
||||
|
||||
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 localizedPartName = StatCollector.translateToLocal("part." + this.unlocalizedPartName);
|
||||
String localizedMaterialName = StatCollector.translateToLocal("material." + unlocalizedMaterialName);
|
||||
displayName = localizedPartName.replaceAll("@material@", localizedMaterialName);
|
||||
}
|
||||
else
|
||||
{
|
||||
displayName = getUnlocalizedName(itemStack) + ".name";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
displayName = getUnlocalizedName() + ".name";
|
||||
}
|
||||
return displayName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package com.arc.bloodarsenal.items.tinkers;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeHelper
|
||||
{
|
||||
private static Item pattern = TConstructRegistry.getItem("woodPattern");
|
||||
|
||||
private static final ItemStack toolRodPattern = TConstructRegistry.getItemStack("toolRodPattern");
|
||||
private static final ItemStack pickaxeHeadPattern = TConstructRegistry.getItemStack("pickaxeHeadPattern");
|
||||
private static final ItemStack shovelHeadPattern = TConstructRegistry.getItemStack("shovelHeadPattern");
|
||||
private static final ItemStack hatchetHeadPattern = TConstructRegistry.getItemStack("hatchetHeadPattern");
|
||||
private static final ItemStack swordBladePattern = TConstructRegistry.getItemStack("swordBladePattern");
|
||||
private static final ItemStack wideGuardPattern = TConstructRegistry.getItemStack("wideGuardPattern");
|
||||
private static final ItemStack handGuardPattern = TConstructRegistry.getItemStack("handGuardPattern");
|
||||
private static final ItemStack crossbarPattern = TConstructRegistry.getItemStack("crossbarPattern");
|
||||
private static final ItemStack bindingPattern = TConstructRegistry.getItemStack("bindingPattern");
|
||||
private static final ItemStack frypanHeadPattern = TConstructRegistry.getItemStack("frypanHeadPattern");
|
||||
private static final ItemStack signHeadPattern = TConstructRegistry.getItemStack("signHeadPattern");
|
||||
private static final ItemStack knifeBladePattern = TConstructRegistry.getItemStack("knifeBladePattern");
|
||||
private static final ItemStack chiselHeadPattern = TConstructRegistry.getItemStack("chiselHeadPattern");
|
||||
private static final ItemStack toughRodPattern = TConstructRegistry.getItemStack("toughRodPattern");
|
||||
private static final ItemStack toughBindingPattern = TConstructRegistry.getItemStack("toughBindingPattern");
|
||||
private static final ItemStack largePlatePattern = TConstructRegistry.getItemStack("largePlatePattern");
|
||||
private static final ItemStack broadAxeHeadPattern = TConstructRegistry.getItemStack("broadAxeHeadPattern");
|
||||
private static final ItemStack scytheHeadPattern = TConstructRegistry.getItemStack("scytheHeadPattern");
|
||||
private static final ItemStack excavatorHeadPattern = TConstructRegistry.getItemStack("excavatorHeadPattern");
|
||||
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 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 _CHISEL_HEAD = BloodArsenalTinkers.CHISEL_HEAD;
|
||||
private static PartHelper _CHUNK = BloodArsenalTinkers.CHUNK;
|
||||
private static PartHelper _CROSSBAR = BloodArsenalTinkers.CROSSBAR;
|
||||
private static PartHelper _EXCAVATOR_HEAD = BloodArsenalTinkers.EXCAVATOR_HEAD;
|
||||
private static PartHelper _FRYPAN_HEAD = BloodArsenalTinkers.FRYPAN_HEAD;
|
||||
private static PartHelper _FULL_GUARD = BloodArsenalTinkers.FULL_GUARD;
|
||||
private static PartHelper _HAMMER_HEAD = BloodArsenalTinkers.HAMMER_HEAD;
|
||||
private static PartHelper _KNIFE_BLADE = BloodArsenalTinkers.KNIFE_BLADE;
|
||||
private static PartHelper _LARGE_GUARD = BloodArsenalTinkers.LARGE_GUARD;
|
||||
private static PartHelper _LARGE_SWORD_BLADE = BloodArsenalTinkers.LARGE_SWORD_BLADE;
|
||||
private static PartHelper _LARGEPLATE = BloodArsenalTinkers.LARGEPLATE;
|
||||
private static PartHelper _LUMBERAXE_HEAD = BloodArsenalTinkers.LUMBERAXE_HEAD;
|
||||
private static PartHelper _MEDIUM_GUARD = BloodArsenalTinkers.MEDIUM_GUARD;
|
||||
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 _SWORD_BLADE = BloodArsenalTinkers.SWORD_BLADE;
|
||||
private static PartHelper _TOOLROD = BloodArsenalTinkers.TOOLROD;
|
||||
private static PartHelper _TOUGHBIND = BloodArsenalTinkers.TOUGHBIND;
|
||||
private static PartHelper _TOUGHROD = BloodArsenalTinkers.TOUGHROD;
|
||||
|
||||
public static void addRecipes()
|
||||
{
|
||||
addPartRecipes();
|
||||
addToolRecipes();
|
||||
addCraftingRecipes();
|
||||
}
|
||||
|
||||
public static void addCraftingRecipes() {}
|
||||
|
||||
public static void addPartRecipes()
|
||||
{
|
||||
if (BloodArsenal.isTinkersConstructLoaded)
|
||||
{
|
||||
Item bloodIron = GameRegistry.findItem("BloodArsenal", "blood_infused_iron");
|
||||
|
||||
if (bloodIron != null)
|
||||
{
|
||||
ItemStack _bloodIron = new ItemStack(bloodIron);
|
||||
|
||||
addPartBuilding(250);
|
||||
unregisterMaterial(_bloodIron);
|
||||
registerWithStation(new ItemStack(bloodIron, 1, 0), "Blood Infused Iron", 250, new ItemStack(_CHUNK, 1, 250));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerWithStation(String ingotName, String materialName, int materialID)
|
||||
{
|
||||
ArrayList<ItemStack> ingots = OreDictionary.getOres(ingotName);
|
||||
if (!ingots.isEmpty())
|
||||
{
|
||||
for (ItemStack ingot : ingots)
|
||||
{
|
||||
registerWithStation(ingot, materialName, materialID, new ItemStack(_CHUNK, 1, materialID));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerWithStation(ItemStack material, String materialName, int materialID, ItemStack chunk)
|
||||
{
|
||||
PatternBuilder.instance.registerFullMaterial(material, 2, materialName, chunk, new ItemStack(_TOOLROD, 1, materialID), materialID);
|
||||
}
|
||||
|
||||
private static void unregisterMaterial(ItemStack material)
|
||||
{
|
||||
List<PatternBuilder.ItemKey> materials = PatternBuilder.instance.materials;
|
||||
for (int i = 0; i < materials.size(); i++)
|
||||
{
|
||||
PatternBuilder.ItemKey itemKey = (PatternBuilder.ItemKey)materials.get(i);
|
||||
if ((itemKey.item == material.getItem()) && (material.getItemDamage() == itemKey.damage))
|
||||
{
|
||||
materials.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack getItemStackfromCraftingManager(String itemName)
|
||||
{
|
||||
List list = CraftingManager.getInstance().getRecipeList();
|
||||
|
||||
ItemStack itemStack = null;
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
IRecipe recipe = (IRecipe)list.get(i);
|
||||
ItemStack currentItemStack = recipe.getRecipeOutput();
|
||||
if (currentItemStack != null)
|
||||
{
|
||||
Item item = currentItemStack.getItem();
|
||||
if (item != null)
|
||||
{
|
||||
String foundItemName = currentItemStack.getUnlocalizedName();
|
||||
if (foundItemName.equals(itemName))
|
||||
{
|
||||
itemStack = currentItemStack;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
private static void addItemStackPartBuilding(ItemStack pattern, int materialID, ItemStack part)
|
||||
{
|
||||
TConstructRegistry.addPartMapping(pattern.getItem(), pattern.getItemDamage(), materialID, part);
|
||||
}
|
||||
|
||||
private static void addPartBuilding(int materialID)
|
||||
{
|
||||
addItemStackPartBuilding(toolRodPattern, materialID, new ItemStack(_TOOLROD, 1, materialID));
|
||||
addItemStackPartBuilding(pickaxeHeadPattern, materialID, new ItemStack(_PICKAXE_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(shovelHeadPattern, materialID, new ItemStack(_SHOVEL_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(hatchetHeadPattern, materialID, new ItemStack(_AXE_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(swordBladePattern, materialID, new ItemStack(_SWORD_BLADE, 1, materialID));
|
||||
addItemStackPartBuilding(wideGuardPattern, materialID, new ItemStack(_LARGE_GUARD, 1, materialID));
|
||||
addItemStackPartBuilding(handGuardPattern, materialID, new ItemStack(_MEDIUM_GUARD, 1, materialID));
|
||||
addItemStackPartBuilding(crossbarPattern, materialID, new ItemStack(_CROSSBAR, 1, materialID));
|
||||
addItemStackPartBuilding(bindingPattern, materialID, new ItemStack(_BINDING, 1, materialID));
|
||||
addItemStackPartBuilding(frypanHeadPattern, materialID, new ItemStack(_FRYPAN_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(signHeadPattern, materialID, new ItemStack(_BATTLE_SIGN_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(knifeBladePattern, materialID, new ItemStack(_KNIFE_BLADE, 1, materialID));
|
||||
addItemStackPartBuilding(chiselHeadPattern, materialID, new ItemStack(_CHISEL_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(toughRodPattern, materialID, new ItemStack(_TOUGHROD, 1, materialID));
|
||||
addItemStackPartBuilding(toughBindingPattern, materialID, new ItemStack(_TOUGHBIND, 1, materialID));
|
||||
addItemStackPartBuilding(largePlatePattern, materialID, new ItemStack(_LARGEPLATE, 1, materialID));
|
||||
addItemStackPartBuilding(broadAxeHeadPattern, materialID, new ItemStack(_LUMBERAXE_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(scytheHeadPattern, materialID, new ItemStack(_SCYTHE_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(excavatorHeadPattern, materialID, new ItemStack(_EXCAVATOR_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(largeBladePattern, materialID, new ItemStack(_LARGE_SWORD_BLADE, 1, materialID));
|
||||
addItemStackPartBuilding(hammerHeadPattern, materialID, new ItemStack(_HAMMER_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(fullGuardPattern, materialID, new ItemStack(_FULL_GUARD, 1, materialID));
|
||||
addItemStackPartBuilding(arrowHeadPattern, materialID, new ItemStack(_ARROWHEAD, 1, materialID));
|
||||
}
|
||||
|
||||
public static void addToolRecipes()
|
||||
{
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.arrow, new Item[] { _ARROWHEAD, _TOOLROD, TinkerTools.fletching });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.battleaxe, new Item[] { _LUMBERAXE_HEAD, _TOUGHROD, _LUMBERAXE_HEAD, _TOUGHBIND });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.battlesign, new Item[] { _BATTLE_SIGN_HEAD, _TOOLROD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.broadsword, new Item[] { _SWORD_BLADE, _TOOLROD, _LARGE_GUARD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.chisel, new Item[] { _CHISEL_HEAD, _TOOLROD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.cleaver, new Item[] { _LARGE_SWORD_BLADE, _TOUGHROD, _LARGEPLATE, _TOUGHROD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.cutlass, new Item[] { _SWORD_BLADE, _TOOLROD, _FULL_GUARD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.dagger, new Item[] { _KNIFE_BLADE, _TOOLROD, _CROSSBAR });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.excavator, new Item[] { _EXCAVATOR_HEAD, _TOUGHROD, _LARGEPLATE, _TOUGHBIND });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.frypan, new Item[] { _FRYPAN_HEAD, _TOOLROD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.hammer, new Item[] { _HAMMER_HEAD, _TOUGHROD, _LARGEPLATE, _LARGEPLATE });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.hatchet, new Item[] { _AXE_HEAD, _TOOLROD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.longsword, new Item[] { _SWORD_BLADE, _TOOLROD, _MEDIUM_GUARD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.lumberaxe, new Item[] { _LUMBERAXE_HEAD, _TOUGHROD, _LARGEPLATE, _TOUGHBIND });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.mattock, new Item[] { _AXE_HEAD, _TOOLROD, _SHOVEL_HEAD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.pickaxe, new Item[] { _PICKAXE_HEAD, _TOOLROD, _BINDING });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.rapier, new Item[] { _SWORD_BLADE, _TOOLROD, _CROSSBAR });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.scythe, new Item[] { _SCYTHE_HEAD, _TOUGHROD, _TOUGHBIND, _TOUGHROD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.shortbow, new Item[] { _TOOLROD, TinkerTools.bowstring, _TOOLROD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.shortbow, new Item[] { TinkerTools.toolRod, TinkerTools.bowstring, _TOOLROD });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.shortbow, new Item[] { _TOOLROD, TinkerTools.bowstring, TinkerTools.toolRod });
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.shovel, new Item[] { _SHOVEL_HEAD, _TOOLROD });
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public class BoundBow extends ItemBow implements IBindable
|
||||
|
||||
public int getItemEnchantability()
|
||||
{
|
||||
return 30;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack)
|
||||
|
||||
@@ -137,11 +137,9 @@ public class BoundFlintAndSteel extends Item implements IBindable
|
||||
world.setBlock(x, y, z, Blocks.fire);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
package com.arc.bloodarsenal.items.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityGatlingProjectile;
|
||||
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 EnergyGatling extends EnergyItems implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private static IIcon activeIcon;
|
||||
private static IIcon passiveIcon;
|
||||
|
||||
private static int damage;
|
||||
|
||||
public EnergyGatling()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("energy_gatling");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(200);
|
||||
setFull3D();
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i)
|
||||
{
|
||||
energyUsed = i;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par2World.spawnEntityInWorld(new EntityGatlingProjectile(par2World, par3EntityPlayer, damage));
|
||||
}
|
||||
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:energy_gatling");
|
||||
activeIcon = iconRegister.registerIcon("BloodArsenal:energy_gatling");
|
||||
passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Point and click");
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
par3List.add("Activated");
|
||||
} else
|
||||
{
|
||||
par3List.add("Deactivated");
|
||||
}
|
||||
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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 (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 500);
|
||||
}
|
||||
}
|
||||
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
if (par3EntityPlayer.getActivePotionEffect(Potion.moveSlowdown) != null)
|
||||
{
|
||||
par3EntityPlayer.removePotionEffect(Potion.moveSlowdown.id);
|
||||
}
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,6 @@ import java.util.List;
|
||||
|
||||
public class InfusedDiamondAxe extends ItemAxe implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public static ArrayList<List> oreDictLogs = new ArrayList();
|
||||
|
||||
public InfusedDiamondAxe()
|
||||
@@ -83,11 +81,13 @@ public class InfusedDiamondAxe extends ItemAxe implements IBindable
|
||||
{
|
||||
World world = player.worldObj;
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
|
||||
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsAxe))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
MovingObjectPosition block = ToolCapabilities.raytraceFromEntity(world, player, true, 4.5);
|
||||
|
||||
if (block == null)
|
||||
{
|
||||
return false;
|
||||
@@ -131,7 +131,7 @@ public class InfusedDiamondAxe extends ItemAxe implements IBindable
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(stack, player, 3000);
|
||||
EnergyItems.syphonBatteries(stack, player, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
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;
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ import java.util.Arrays;
|
||||
|
||||
public final class ToolCapabilities
|
||||
{
|
||||
public int count;
|
||||
|
||||
public static Material[] materialsPick = new Material[]{ Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil };
|
||||
public static Material[] materialsShovel = new Material[]{ Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay };
|
||||
public static Material[] materialsAxe = new Material[]{ Material.coral, Material.leaves, Material.plants, Material.wood };
|
||||
@@ -162,10 +164,8 @@ public final class ToolCapabilities
|
||||
return worked;
|
||||
}
|
||||
|
||||
private static void findBlocks(World world, int x, int y, int z, Block block)
|
||||
public static void findBlocks(World world, int x, int y, int z, Block block)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
for (int xx = -2; xx <= 2; xx++)
|
||||
{
|
||||
for (int yy = 2; yy >= -2; yy--)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.arc.bloodarsenal.potion;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
|
||||
public class PotionBleeding extends Potion
|
||||
{
|
||||
public PotionBleeding(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Potion setIconIndex(int par1, int par2)
|
||||
{
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.arc.bloodarsenal.potion;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
|
||||
public class PotionSwimming extends Potion
|
||||
{
|
||||
public PotionSwimming(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Potion setIconIndex(int par1, int par2)
|
||||
{
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.arc.bloodarsenal.renderer;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.BloodArsenalConfig;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemRenderGatling implements IItemRenderer
|
||||
{
|
||||
protected ModelEnergyGatling gatlingModel;
|
||||
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "models/armor/EnergyGatling.png");
|
||||
private static final ResourceLocation resourceLocation2 = new ResourceLocation("bloodarsenal", "models/armor/EnergyGatling2.png");
|
||||
|
||||
public ItemRenderGatling()
|
||||
{
|
||||
gatlingModel = new ModelEnergyGatling();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case EQUIPPED: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
double rx = 100.0D;
|
||||
double ry = 20.0D;
|
||||
double rz = -90.0D;
|
||||
double tx = 0.15D;
|
||||
double ty = 0.1D;
|
||||
double tz = -0.5D;
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case EQUIPPED:
|
||||
{
|
||||
if (item.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (BloodArsenalConfig.isRedGood)
|
||||
{
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation2);
|
||||
}
|
||||
else
|
||||
{
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation);
|
||||
}
|
||||
|
||||
GL11.glRotatef((float) rx, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef((float) ry, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef((float) rz, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
GL11.glTranslatef((float) tx, (float) ty, (float) tz);
|
||||
|
||||
float scale = 1.8F;
|
||||
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
gatlingModel.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.arc.bloodarsenal.renderer;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelEnergyGatling extends ModelBase
|
||||
{
|
||||
ModelRenderer Barrel1;
|
||||
ModelRenderer Barrel2;
|
||||
ModelRenderer Barrel3;
|
||||
ModelRenderer Barrel4;
|
||||
ModelRenderer Barrel5;
|
||||
ModelRenderer Barrel6;
|
||||
ModelRenderer Barrel7;
|
||||
ModelRenderer Barrel8;
|
||||
ModelRenderer Barrel9;
|
||||
ModelRenderer Barrel10;
|
||||
ModelRenderer Barrel11;
|
||||
ModelRenderer Barrel12;
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
|
||||
public ModelEnergyGatling()
|
||||
{
|
||||
textureWidth = 64;
|
||||
textureHeight = 32;
|
||||
|
||||
Barrel1 = new ModelRenderer(this, 0, 0);
|
||||
Barrel1.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel1.setRotationPoint(0.5F, 8.5F, -13F);
|
||||
Barrel1.setTextureSize(64, 32);
|
||||
Barrel1.mirror = true;
|
||||
setRotation(Barrel1, 0F, 0F, 0F);
|
||||
|
||||
Barrel2 = new ModelRenderer(this, 0, 0);
|
||||
Barrel2.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel2.setRotationPoint(-0.5F, 8.5F, -13F);
|
||||
Barrel2.setTextureSize(64, 32);
|
||||
Barrel2.mirror = true;
|
||||
setRotation(Barrel2, 0F, 0F, 0F);
|
||||
|
||||
Barrel3 = new ModelRenderer(this, 0, 0);
|
||||
Barrel3.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel3.setRotationPoint(-1F, 9F, -13F);
|
||||
Barrel3.setTextureSize(64, 32);
|
||||
Barrel3.mirror = true;
|
||||
setRotation(Barrel3, 0F, 0F, 0F);
|
||||
|
||||
Barrel4 = new ModelRenderer(this, 0, 0);
|
||||
Barrel4.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel4.setRotationPoint(1F, 9F, -13F);
|
||||
Barrel4.setTextureSize(64, 32);
|
||||
Barrel4.mirror = true;
|
||||
setRotation(Barrel4, 0F, 0F, 0F);
|
||||
|
||||
Barrel5 = new ModelRenderer(this, 0, 0);
|
||||
Barrel5.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel5.setRotationPoint(-1.5F, 9.5F, -13F);
|
||||
Barrel5.setTextureSize(64, 32);
|
||||
Barrel5.mirror = true;
|
||||
setRotation(Barrel5, 0F, 0F, 0F);
|
||||
|
||||
Barrel6 = new ModelRenderer(this, 0, 0);
|
||||
Barrel6.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel6.setRotationPoint(1.5F, 9.5F, -13F);
|
||||
Barrel6.setTextureSize(64, 32);
|
||||
Barrel6.mirror = true;
|
||||
setRotation(Barrel6, 0F, 0F, 0F);
|
||||
|
||||
Barrel7 = new ModelRenderer(this, 0, 0);
|
||||
Barrel7.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel7.setRotationPoint(-1.5F, 10.5F, -13F);
|
||||
Barrel7.setTextureSize(64, 32);
|
||||
Barrel7.mirror = true;
|
||||
setRotation(Barrel7, 0F, 0F, 0F);
|
||||
|
||||
Barrel8 = new ModelRenderer(this, 0, 0);
|
||||
Barrel8.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel8.setRotationPoint(1.5F, 10.5F, -13F);
|
||||
Barrel8.setTextureSize(64, 32);
|
||||
Barrel8.mirror = true;
|
||||
setRotation(Barrel8, 0F, 0F, 0F);
|
||||
|
||||
Barrel9 = new ModelRenderer(this, 0, 0);
|
||||
Barrel9.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel9.setRotationPoint(-1F, 11F, -13F);
|
||||
Barrel9.setTextureSize(64, 32);
|
||||
Barrel9.mirror = true;
|
||||
setRotation(Barrel9, 0F, 0F, 0F);
|
||||
|
||||
Barrel10 = new ModelRenderer(this, 0, 0);
|
||||
Barrel10.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel10.setRotationPoint(1F, 11F, -13F);
|
||||
Barrel10.setTextureSize(64, 32);
|
||||
Barrel10.mirror = true;
|
||||
setRotation(Barrel10, 0F, 0F, 0F);
|
||||
|
||||
Barrel11 = new ModelRenderer(this, 0, 0);
|
||||
Barrel11.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel11.setRotationPoint(-0.5F, 11.5F, -13F);
|
||||
Barrel11.setTextureSize(64, 32);
|
||||
Barrel11.mirror = true;
|
||||
setRotation(Barrel11, 0F, 0F, 0F);
|
||||
|
||||
Barrel12 = new ModelRenderer(this, 0, 0);
|
||||
Barrel12.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel12.setRotationPoint(0.5F, 11.5F, -13F);
|
||||
Barrel12.setTextureSize(64, 32);
|
||||
Barrel12.mirror = true;
|
||||
setRotation(Barrel12, 0F, 0F, 0F);
|
||||
|
||||
Shape1 = new ModelRenderer(this, 0, 17);
|
||||
Shape1.addBox(0F, 0F, 0F, 5, 5, 5);
|
||||
Shape1.setRotationPoint(-2F, 8F, 0F);
|
||||
Shape1.setTextureSize(64, 32);
|
||||
Shape1.mirror = true;
|
||||
setRotation(Shape1, 0F, 0F, 0F);
|
||||
|
||||
Shape2 = new ModelRenderer(this, 0, 0);
|
||||
Shape2.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
Shape2.setRotationPoint(-1F, 5F, 4F);
|
||||
Shape2.setTextureSize(64, 32);
|
||||
Shape2.mirror = true;
|
||||
setRotation(Shape2, 0F, 0F, 0F);
|
||||
|
||||
Shape3 = new ModelRenderer(this, 0, 4);
|
||||
Shape3.addBox(0F, 0F, 0F, 1, 1, 1);
|
||||
Shape3.setRotationPoint(-1F, 5F, 3F);
|
||||
Shape3.setTextureSize(64, 32);
|
||||
Shape3.mirror = true;
|
||||
setRotation(Shape3, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
Barrel1.render(f5);
|
||||
Barrel2.render(f5);
|
||||
Barrel3.render(f5);
|
||||
Barrel4.render(f5);
|
||||
Barrel5.render(f5);
|
||||
Barrel6.render(f5);
|
||||
Barrel7.render(f5);
|
||||
Barrel8.render(f5);
|
||||
Barrel9.render(f5);
|
||||
Barrel10.render(f5);
|
||||
Barrel11.render(f5);
|
||||
Barrel12.render(f5);
|
||||
Shape1.render(f5);
|
||||
Shape2.render(f5);
|
||||
Shape3.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
|
||||
{
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.arc.bloodarsenal.renderer;
|
||||
|
||||
import com.arc.bloodarsenal.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.entity.projectile.EntityGatlingProjectile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderEntityGatlingProjectile extends Render
|
||||
{
|
||||
public void renderEntityGatling(Entity entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.1F, 0.1F, 0.1F);
|
||||
bindTexture(getEntityTexture(entity));
|
||||
Tessellator var12 = Tessellator.instance;
|
||||
GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
var12.startDrawingQuads();
|
||||
var12.setNormal(0.0F, 1.0F, 0.0F);
|
||||
var12.addVertexWithUV(-0.5F, -0.25F, 0.0D, 0, 1);
|
||||
var12.addVertexWithUV(0.5F, -0.25F, 0.0D, 1, 1);
|
||||
var12.addVertexWithUV(0.5F, 0.75F, 0.0D, 1, 0);
|
||||
var12.addVertexWithUV(-0.5F, 0.75F, 0.0D, 0, 0);
|
||||
var12.draw();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
if (par1Entity instanceof IProjectile)
|
||||
{
|
||||
renderEntityGatling(par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity)
|
||||
{
|
||||
if (BloodArsenalConfig.isRedGood)
|
||||
{
|
||||
if (entity instanceof EntityGatlingProjectile)
|
||||
{
|
||||
return new ResourceLocation("bloodarsenal", "textures/entities/energyGatlingProjectile2.png");
|
||||
}
|
||||
}
|
||||
|
||||
return new ResourceLocation("bloodarsenal", "textures/entities/energyGatlingProjectile.png");
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,9 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.FishingHooks;
|
||||
|
||||
import java.awt.geom.Area;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -23,7 +25,7 @@ public class RitualEffectFishing extends RitualEffect
|
||||
private static final int terraeDrain = 20;
|
||||
private static final int orbisTerraeDrain = 20;
|
||||
|
||||
protected Random random = null;
|
||||
protected static double rand;
|
||||
protected float next = Float.NaN;
|
||||
|
||||
@Override
|
||||
@@ -104,11 +106,11 @@ public class RitualEffectFishing extends RitualEffect
|
||||
for (int j = -1; j <= 1; j++)
|
||||
{
|
||||
Block block = world.getBlock(x + i, y - 1, z + j);
|
||||
|
||||
rand = Math.random();
|
||||
{
|
||||
if (block.isAssociatedBlock(Blocks.water) || block.isAssociatedBlock(Blocks.flowing_water))
|
||||
{
|
||||
|
||||
// doDrop(FishingHooks.getRandomFishable(rand, next, ))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.arc.bloodarsenal.rituals;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.AlchemyCircleRenderer;
|
||||
import com.arc.bloodarsenal.BloodArsenal;
|
||||
import com.arc.bloodarsenal.BloodArsenalConfig;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RitualRegistry
|
||||
@@ -11,4 +13,19 @@ public class RitualRegistry
|
||||
Rituals.registerRitual("ARC001Wither", 1, 75000, new RitualEffectWithering(), "Ritual of Withering", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 1.5, false));
|
||||
Rituals.registerRitual("ARC002Midas", 1, 5000, new RitualEffectMidas(), "Midas Touch", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"), 0, 0, 0, 255, 0, 0.501, 0.501, 0, 2.5, false));
|
||||
}
|
||||
|
||||
public static void blacklistRituals()
|
||||
{
|
||||
if (BloodArsenalConfig.ritualDisabledWither)
|
||||
{
|
||||
Rituals.ritualMap.remove("ARC001Wither");
|
||||
Rituals.keyList.remove("ARC001Wither");
|
||||
}
|
||||
|
||||
if (BloodArsenalConfig.ritualDisabledMidas)
|
||||
{
|
||||
Rituals.ritualMap.remove("ARC002Midas");
|
||||
Rituals.keyList.remove("ARC002Midas");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,11 @@
|
||||
package com.arc.bloodarsenal.tileentity;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TileOwned extends TileEntity
|
||||
{
|
||||
public String owner;
|
||||
@@ -35,27 +32,27 @@ public class TileOwned extends TileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound)
|
||||
public void readFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
super.readFromNBT(nbttagcompound);
|
||||
owner = nbttagcompound.getString("owner");
|
||||
super.readFromNBT(tag);
|
||||
this.owner = tag.getString("owner");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound)
|
||||
public void writeToNBT(NBTTagCompound tag)
|
||||
{
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setString("owner", owner);
|
||||
super.writeToNBT(tag);
|
||||
tag.setString("owner", owner);
|
||||
}
|
||||
|
||||
public void readCustomNBT(NBTTagCompound nbttagcompound)
|
||||
public void readCustomNBT(NBTTagCompound tag)
|
||||
{
|
||||
this.owner = nbttagcompound.getString("owner");
|
||||
|
||||
}
|
||||
|
||||
public void writeCustomNBT(NBTTagCompound nbttagcompound)
|
||||
public void writeCustomNBT(NBTTagCompound tag)
|
||||
{
|
||||
nbttagcompound.setString("owner", this.owner);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user