updateBuildScript & spotlessApply

This commit is contained in:
miozune committed 2022-11-01 11:09:22 +09:00
1 parent 91e16818d5
commit 932ec20cfb
138 files changed
+6082 -7070

No files matched your search

@@ -1,14 +1,14 @@
package com.arc.bloodarsenal.client;
import com.arc.bloodarsenal.client.renderer.block.*;
import com.arc.bloodarsenal.client.renderer.block.TilePortableAltarRenderer;
import com.arc.bloodarsenal.client.renderer.block.item.TilePortableAltarItemRenderer;
import com.arc.bloodarsenal.client.renderer.item.RenderBow;
import com.arc.bloodarsenal.common.CommonProxy;
import com.arc.bloodarsenal.common.block.ModBlocks;
import com.arc.bloodarsenal.common.entity.EntityBloodTNT;
import com.arc.bloodarsenal.common.items.ModItems;
import com.arc.bloodarsenal.common.items.sigil.SigilUtils;
import com.arc.bloodarsenal.client.renderer.block.*;
import com.arc.bloodarsenal.client.renderer.item.RenderBow;
import com.arc.bloodarsenal.client.renderer.block.TilePortableAltarRenderer;
import com.arc.bloodarsenal.client.renderer.block.item.TilePortableAltarItemRenderer;
import com.arc.bloodarsenal.common.tileentity.TileLifeInfuser;
import com.arc.bloodarsenal.common.tileentity.TilePortableAltar;
import com.arc.bloodarsenal.common.tinkers.IClientCode;
@@ -21,11 +21,9 @@ import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
public class ClientProxy extends CommonProxy
{
public class ClientProxy extends CommonProxy {
@Override
public void init()
{
public void init() {
registerRenders();
registerEvents();
getClientWorld();
@@ -33,37 +31,38 @@ public class ClientProxy extends CommonProxy
}
@Override
public void registerRenders()
{
public void registerRenders() {
MinecraftForgeClient.registerItemRenderer(ModItems.bound_bow, new RenderBow());
RenderingRegistry.registerEntityRenderingHandler(EntityBloodTNT.class, new RenderBloodTNTPrimed());
// RenderingRegistry.registerEntityRenderingHandler(EntityBloodHound.class, new RenderEntityBloodHound(new ModelWolf(), new ModelWolf(), 0.5F));
// RenderingRegistry.registerEntityRenderingHandler(EntityBloodHound.class, new
// RenderEntityBloodHound(new ModelWolf(), new ModelWolf(), 0.5F));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.life_infuser), new RenderTileLifeInfuser());
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.life_infuser), new RenderTileLifeInfuser());
ClientRegistry.bindTileEntitySpecialRenderer(TilePortableAltar.class, new TilePortableAltarRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileLifeInfuser.class, new TileLifeInfuserRenderer());
}
@Override
public void registerEvents()
{
public void registerEvents() {
MinecraftForge.EVENT_BUS.register(new SigilUtils());
}
@Override
public World getClientWorld()
{
public World getClientWorld() {
return FMLClientHandler.instance().getClient().theWorld;
}
@Override
public void initRendering()
{
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.portable_altar), new TilePortableAltarItemRenderer());
public void initRendering() {
MinecraftForgeClient.registerItemRenderer(
ItemBlock.getItemFromBlock(ModBlocks.portable_altar), new TilePortableAltarItemRenderer());
}
@Override
public void executeClientCode(IClientCode clientCode) {clientCode.executeClientCode();}
public void executeClientCode(IClientCode clientCode) {
clientCode.executeClientCode();
}
}
@@ -12,12 +12,10 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderBloodTNTPrimed extends Render
{
public class RenderBloodTNTPrimed extends Render {
private RenderBlocks blockRenderer = new RenderBlocks();
public RenderBloodTNTPrimed()
{
public RenderBloodTNTPrimed() {
this.shadowSize = 0.5F;
}
@@ -27,23 +25,25 @@ public class RenderBloodTNTPrimed extends Render
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityBloodTNT p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
public void doRender(
EntityBloodTNT p_76986_1_,
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
float p_76986_9_) {
GL11.glPushMatrix();
GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
float f2;
if ((float)p_76986_1_.fuse - p_76986_9_ + 1.0F < 10.0F)
{
f2 = 1.0F - ((float)p_76986_1_.fuse - p_76986_9_ + 1.0F) / 10.0F;
if ((float) p_76986_1_.fuse - p_76986_9_ + 1.0F < 10.0F) {
f2 = 1.0F - ((float) p_76986_1_.fuse - p_76986_9_ + 1.0F) / 10.0F;
if (f2 < 0.0F)
{
if (f2 < 0.0F) {
f2 = 0.0F;
}
if (f2 > 1.0F)
{
if (f2 > 1.0F) {
f2 = 1.0F;
}
@@ -53,12 +53,11 @@ public class RenderBloodTNTPrimed extends Render
GL11.glScalef(f3, f3, f3);
}
f2 = (1.0F - ((float)p_76986_1_.fuse - p_76986_9_ + 1.0F) / 100.0F) * 0.8F;
f2 = (1.0F - ((float) p_76986_1_.fuse - p_76986_9_ + 1.0F) / 100.0F) * 0.8F;
this.bindEntityTexture(p_76986_1_);
this.blockRenderer.renderBlockAsItem(ModBlocks.blood_tnt, 0, p_76986_1_.getBrightness(p_76986_9_));
if (p_76986_1_.fuse / 5 % 2 == 0)
{
if (p_76986_1_.fuse / 5 % 2 == 0) {
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
@@ -77,17 +76,15 @@ public class RenderBloodTNTPrimed extends Render
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityBloodTNT p_110775_1_)
{
protected ResourceLocation getEntityTexture(EntityBloodTNT p_110775_1_) {
return TextureMap.locationBlocksTexture;
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityBloodTNT)p_110775_1_);
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return this.getEntityTexture((EntityBloodTNT) p_110775_1_);
}
/**
@@ -96,8 +93,13 @@ public class RenderBloodTNTPrimed extends Render
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
this.doRender((EntityBloodTNT)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
public void doRender(
Entity p_76986_1_,
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
float p_76986_9_) {
this.doRender((EntityBloodTNT) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
}
@@ -10,25 +10,25 @@ import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderTileLifeInfuser implements IItemRenderer
{
public class RenderTileLifeInfuser implements IItemRenderer {
private ModelLifeInfuser modelLifeInfuser = new ModelLifeInfuser();
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type){
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper){
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data){
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch(type){
switch (type) {
case ENTITY: {
render(0.0F, 0.0F, 1.0F, 1.0F);
return;
@@ -50,7 +50,7 @@ public class RenderTileLifeInfuser implements IItemRenderer
}
}
private void render(float x, float y, float z, float scale){
private void render(float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glRotatef(-90F, 1F, 0, 0);
@@ -71,4 +71,4 @@ public class RenderTileLifeInfuser implements IItemRenderer
// GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}
}
@@ -15,18 +15,14 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class TileLifeInfuserRenderer extends TileEntitySpecialRenderer
{
public class TileLifeInfuserRenderer extends TileEntitySpecialRenderer {
private ModelLifeInfuser modelLifeInfuser = new ModelLifeInfuser();
RenderItem customRenderItem;
public TileLifeInfuserRenderer()
{
customRenderItem = new RenderItem()
{
public TileLifeInfuserRenderer() {
customRenderItem = new RenderItem() {
@Override
public boolean shouldBob()
{
public boolean shouldBob() {
return false;
}
};
@@ -34,10 +30,8 @@ public class TileLifeInfuserRenderer extends TileEntitySpecialRenderer
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
{
if (tileEntity instanceof TileLifeInfuser)
{
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) {
if (tileEntity instanceof TileLifeInfuser) {
ResourceLocation test = new ResourceLocation("bloodarsenal:textures/models/LifeInfuser.png");
TileLifeInfuser tile = (TileLifeInfuser) tileEntity;
@@ -51,21 +45,19 @@ public class TileLifeInfuserRenderer extends TileEntitySpecialRenderer
GL11.glPopMatrix();
GL11.glPushMatrix();
if (tile.getStackInSlot(0) != null)
{
if (tile.getStackInSlot(0) != null) {
float scaleFactor = getGhostItemScaleFactor(tile.getStackInSlot(0));
float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0;
float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics
? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL)
: 0;
EntityItem ghostEntityItem = new EntityItem(tile.getWorldObj());
ghostEntityItem.hoverStart = 0.0F;
ghostEntityItem.setEntityItemStack(tile.getStackInSlot(0));
float displacement = 0.3F;
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
{
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) {
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.25F, (float) d2 + 0.5F);
}
else
{
} else {
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.25F, (float) d2 + 0.5F);
}
@@ -91,16 +83,12 @@ public class TileLifeInfuserRenderer extends TileEntitySpecialRenderer
}
}
private float getGhostItemScaleFactor(ItemStack itemStack)
{
private float getGhostItemScaleFactor(ItemStack itemStack) {
float scaleFactor = 5F;
if (itemStack != null)
{
if (itemStack.getItem() instanceof ItemBlock)
{
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
{
if (itemStack != null) {
if (itemStack.getItem() instanceof ItemBlock) {
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) {
case 1:
return 1.20F;
@@ -119,11 +107,8 @@ public class TileLifeInfuserRenderer extends TileEntitySpecialRenderer
default:
return 1.20F;
}
}
else
{
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
{
} else {
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) {
case 1:
return 0.95F;
@@ -12,18 +12,14 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
public class TilePortableAltarRenderer extends TileEntitySpecialRenderer
{
public class TilePortableAltarRenderer extends TileEntitySpecialRenderer {
private ModelPortableBloodAltar modelBloodAltar = new ModelPortableBloodAltar();
private final RenderItem customRenderItem;
public TilePortableAltarRenderer()
{
customRenderItem = new RenderItem()
{
public TilePortableAltarRenderer() {
customRenderItem = new RenderItem() {
@Override
public boolean shouldBob()
{
public boolean shouldBob() {
return false;
}
};
@@ -31,18 +27,15 @@ public class TilePortableAltarRenderer extends TileEntitySpecialRenderer
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
{
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) {
modelBloodAltar.renderBloodAltar((TilePortableAltar) tileEntity, d0, d1, d2);
modelBloodAltar.renderBloodLevel((TilePortableAltar) tileEntity, d0, d1, d2);
if (tileEntity instanceof TilePortableAltar)
{
if (tileEntity instanceof TilePortableAltar) {
TilePortableAltar tileAltar = (TilePortableAltar) tileEntity;
GL11.glPushMatrix();
if (tileAltar.getStackInSlot(0) != null)
{
if (tileAltar.getStackInSlot(0) != null) {
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
@@ -50,12 +43,9 @@ public class TilePortableAltarRenderer extends TileEntitySpecialRenderer
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
float displacement = 0.2F;
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
{
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) {
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F);
}
else
{
} else {
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F);
}
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
@@ -67,16 +57,12 @@ public class TilePortableAltarRenderer extends TileEntitySpecialRenderer
}
}
private float getGhostItemScaleFactor(ItemStack itemStack)
{
private float getGhostItemScaleFactor(ItemStack itemStack) {
float scaleFactor = 1.0F;
if (itemStack != null)
{
if (itemStack.getItem() instanceof ItemBlock)
{
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
{
if (itemStack != null) {
if (itemStack.getItem() instanceof ItemBlock) {
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) {
case 1:
return 0.90F;
@@ -95,11 +81,8 @@ public class TilePortableAltarRenderer extends TileEntitySpecialRenderer
default:
return 0.90F;
}
}
else
{
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
{
} else {
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) {
case 1:
return 0.65F;
@@ -121,108 +104,86 @@ public class TilePortableAltarRenderer extends TileEntitySpecialRenderer
return scaleFactor;
}
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection)
{
if (ghostItemStack != null)
{
if (ghostItemStack.getItem() instanceof ItemBlock)
{
switch (forgeDirection)
{
case DOWN:
{
private void translateGhostItemByOrientation(
ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) {
if (ghostItemStack != null) {
if (ghostItemStack.getItem() instanceof ItemBlock) {
switch (forgeDirection) {
case DOWN: {
GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F);
return;
}
case UP:
{
case UP: {
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F);
return;
}
case NORTH:
{
case NORTH: {
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F);
return;
}
case SOUTH:
{
case SOUTH: {
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F);
return;
}
case EAST:
{
case EAST: {
GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F);
return;
}
case WEST:
{
case WEST: {
GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F);
return;
}
case UNKNOWN:
{
case UNKNOWN: {
return;
}
default:
{
default: {
return;
}
}
}
else
{
switch (forgeDirection)
{
case DOWN:
{
} else {
switch (forgeDirection) {
case DOWN: {
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F);
return;
}
case UP:
{
case UP: {
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F);
return;
}
case NORTH:
{
case NORTH: {
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F);
return;
}
case SOUTH:
{
case SOUTH: {
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F);
return;
}
case EAST:
{
case EAST: {
GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F);
return;
}
case WEST:
{
case WEST: {
GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F);
return;
}
case UNKNOWN:
{
case UNKNOWN: {
return;
}
default:
{
default: {
return;
}
}
@@ -8,33 +8,27 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
public class TilePortableAltarItemRenderer implements IItemRenderer
{
public class TilePortableAltarItemRenderer implements IItemRenderer {
private ModelPortableBloodAltar modelBloodAltar;
public TilePortableAltarItemRenderer()
{
public TilePortableAltarItemRenderer() {
modelBloodAltar = new ModelPortableBloodAltar();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
float scale = 0.08f;
switch (type)
{
switch (type) {
case ENTITY:
renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0, scale);
break;
@@ -53,8 +47,7 @@ public class TilePortableAltarItemRenderer implements IItemRenderer
}
}
private void renderBloodAltar(RenderBlocks render, ItemStack item, float x, float y, float z, float scale)
{
private void renderBloodAltar(RenderBlocks render, ItemStack item, float x, float y, float z, float scale) {
GL11.glPushMatrix();
GL11.glTranslatef(x, y, z);
GL11.glScalef(scale, scale, scale);
@@ -11,14 +11,14 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderEntityBloodHound extends RenderLiving
{
public class RenderEntityBloodHound extends RenderLiving {
private static final ResourceLocation wolfTextures = new ResourceLocation("textures/entity/wolf/wolf.png");
private static final ResourceLocation tamedWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_tame.png");
private static final ResourceLocation anrgyWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_angry.png");
private static final ResourceLocation tamedWolfTextures =
new ResourceLocation("textures/entity/wolf/wolf_tame.png");
private static final ResourceLocation anrgyWolfTextures =
new ResourceLocation("textures/entity/wolf/wolf_angry.png");
public RenderEntityBloodHound(ModelBase p_i1269_1_, ModelBase p_i1269_2_, float p_i1269_3_)
{
public RenderEntityBloodHound(ModelBase p_i1269_1_, ModelBase p_i1269_2_, float p_i1269_3_) {
super(p_i1269_1_, p_i1269_3_);
this.setRenderPassModel(p_i1269_2_);
}
@@ -26,25 +26,20 @@ public class RenderEntityBloodHound extends RenderLiving
/**
* Defines what float the third param in setRotationAngles of ModelBase is
*/
protected float handleRotationFloat(EntityBloodHound p_77044_1_, float p_77044_2_)
{
protected float handleRotationFloat(EntityBloodHound p_77044_1_, float p_77044_2_) {
return p_77044_1_.getTailRotation();
}
/**
* Queries whether should render the specified pass or not.
*/
protected int shouldRenderPass(EntityBloodHound p_77032_1_, int p_77032_2_, float p_77032_3_)
{
if (p_77032_2_ == 0 && p_77032_1_.getWolfShaking())
{
protected int shouldRenderPass(EntityBloodHound p_77032_1_, int p_77032_2_, float p_77032_3_) {
if (p_77032_2_ == 0 && p_77032_1_.getWolfShaking()) {
float f1 = p_77032_1_.getBrightness(p_77032_3_) * p_77032_1_.getShadingWhileShaking(p_77032_3_);
this.bindTexture(wolfTextures);
GL11.glColor3f(f1, f1, f1);
return 1;
}
else
{
} else {
return -1;
}
}
@@ -52,32 +47,28 @@ public class RenderEntityBloodHound extends RenderLiving
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityBloodHound p_110775_1_)
{
protected ResourceLocation getEntityTexture(EntityBloodHound p_110775_1_) {
return p_110775_1_.isTamed() ? tamedWolfTextures : (p_110775_1_.isAngry() ? anrgyWolfTextures : wolfTextures);
}
/**
* Queries whether should render the specified pass or not.
*/
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
{
return this.shouldRenderPass((EntityBloodHound)p_77032_1_, p_77032_2_, p_77032_3_);
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) {
return this.shouldRenderPass((EntityBloodHound) p_77032_1_, p_77032_2_, p_77032_3_);
}
/**
* Defines what float the third param in setRotationAngles of ModelBase is
*/
protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_)
{
return this.handleRotationFloat((EntityBloodHound)p_77044_1_, p_77044_2_);
protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) {
return this.handleRotationFloat((EntityBloodHound) p_77044_1_, p_77044_2_);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityBloodHound)p_110775_1_);
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return this.getEntityTexture((EntityBloodHound) p_110775_1_);
}
}
@@ -9,30 +9,24 @@ import net.minecraft.util.IIcon;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
public class RenderBow implements IItemRenderer
{
public static final String[] ITEM_IN_USE = new String[] { "itemInUse", "field_71074_e", "f" };
public static final String[] ITEM_IN_USE_COUNT = new String[] { "itemInUseCount", "field_71072_f", "g" };
public class RenderBow implements IItemRenderer {
public static final String[] ITEM_IN_USE = new String[] {"itemInUse", "field_71074_e", "f"};
public static final String[] ITEM_IN_USE_COUNT = new String[] {"itemInUseCount", "field_71072_f", "g"};
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return type != ItemRenderType.INVENTORY;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type)
{
case ENTITY :
{
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch (type) {
case ENTITY: {
GL11.glPushMatrix();
GL11.glTranslatef(-0.5F, 0F, 0F);
if (item.isOnItemFrame()) GL11.glTranslatef(0F, -0.3F, 0.01F);
@@ -41,38 +35,34 @@ public class RenderBow implements IItemRenderer
break;
}
case EQUIPPED :
{
case EQUIPPED: {
render(item, data[1] instanceof EntityPlayer ? (EntityPlayer) data[1] : null, true);
break;
}
case EQUIPPED_FIRST_PERSON :
{
case EQUIPPED_FIRST_PERSON: {
render(item, data[1] instanceof EntityPlayer ? (EntityPlayer) data[1] : null, false);
break;
}
default : break;
default:
break;
}
}
public void render(ItemStack item, EntityPlayer player, boolean transform)
{
public void render(ItemStack item, EntityPlayer player, boolean transform) {
int dmg = item.getItemDamage();
IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 0);
if (player != null)
{
if (player != null) {
ItemStack using = ReflectionHelper.getPrivateValue(EntityPlayer.class, player, ITEM_IN_USE);
int time = ReflectionHelper.getPrivateValue(EntityPlayer.class, player, ITEM_IN_USE_COUNT);
icon = item.getItem().getIcon(item, 0, player, using, time);
if (transform)
{
if (transform) {
GL11.glTranslatef(0.2F, -0.3F, 0.1F);
//GL11.glRotatef(20.0F, 0.0F, 1.0F, 0.0F);
//GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
// GL11.glRotatef(20.0F, 0.0F, 1.0F, 0.0F);
// GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
}
}
@@ -86,7 +76,8 @@ public class RenderBow implements IItemRenderer
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1F, 1F, 1F, 1F);
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale);
ItemRenderer.renderItemIn2D(
Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
@@ -12,9 +12,9 @@ import org.lwjgl.opengl.GL11;
* LifeInfuser - Arcaratus
* Created using Tabula 4.0.2
*/
public class ModelLifeInfuser extends ModelBase
{
private static final ResourceLocation texture = new ResourceLocation("bloodarsenal:textures/models/LifeInfuser.png");
public class ModelLifeInfuser extends ModelBase {
private static final ResourceLocation texture =
new ResourceLocation("bloodarsenal:textures/models/LifeInfuser.png");
private IModelCustom modelLifeInfuser;
public ModelRenderer Base;
@@ -25,8 +25,7 @@ public class ModelLifeInfuser extends ModelBase
public ModelRenderer Plate1;
public ModelRenderer Plate2;
public ModelLifeInfuser()
{
public ModelLifeInfuser() {
this.textureWidth = 64;
this.textureHeight = 32;
this.Pillar2 = new ModelRenderer(this, 0, 0);
@@ -54,8 +53,7 @@ public class ModelLifeInfuser extends ModelBase
this.Pillar1.addBox(0.0F, 0.0F, 0.0F, 2, 12, 2);
}
public void render()
{
public void render() {
float f = 1F / 16F;
this.Pillar2.render(f);
this.Pillar3.render(f);
@@ -66,13 +64,11 @@ public class ModelLifeInfuser extends ModelBase
this.Pillar1.render(f);
}
public void renderLifeInfuser()
{
public void renderLifeInfuser() {
modelLifeInfuser.renderAll();
}
public void renderLifeInfuser(TileLifeInfuser lifeInfuser, double x, double y, double z)
{
public void renderLifeInfuser(TileLifeInfuser lifeInfuser, double x, double y, double z) {
float scale = 0.1f;
// Push a blank matrix onto the stack
GL11.glPushMatrix();
@@ -87,5 +83,4 @@ public class ModelLifeInfuser extends ModelBase
// Pop this matrix from the stack.
GL11.glPopMatrix();
}
}
@@ -12,24 +12,22 @@ import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
public class ModelPortableBloodAltar extends ModelBase
{
private static final ResourceLocation altar_texture = new ResourceLocation("bloodarsenal:textures/models/altar.png");
public class ModelPortableBloodAltar extends ModelBase {
private static final ResourceLocation altar_texture =
new ResourceLocation("bloodarsenal:textures/models/altar.png");
private IModelCustom modelBloodAltar;
public ModelPortableBloodAltar()
{
modelBloodAltar = AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodaltar-fixeUV.obj"));
public ModelPortableBloodAltar() {
modelBloodAltar =
AdvancedModelLoader.loadModel(new ResourceLocation("alchemicalwizardry:models/bloodaltar-fixeUV.obj"));
}
public void renderBloodAltar()
{
public void renderBloodAltar() {
modelBloodAltar.renderAll();
}
public void renderBloodAltar(TilePortableAltar altar, double x, double y, double z)
{
public void renderBloodAltar(TilePortableAltar altar, double x, double y, double z) {
float scale = 0.1f;
// Push a blank matrix onto the stack
GL11.glPushMatrix();
@@ -45,18 +43,16 @@ public class ModelPortableBloodAltar extends ModelBase
GL11.glPopMatrix();
}
public void renderBloodLevel(TilePortableAltar altar, double x, double y, double z)
{
public void renderBloodLevel(TilePortableAltar altar, double x, double y, double z) {
GL11.glPushMatrix();
float level = altar.getFluidAmount();
GL11.glTranslatef((float) x , (float) y + 0.6499f + 0.12f * (level / altar.getCapacity()), (float) z);
GL11.glTranslatef((float) x, (float) y + 0.6499f + 0.12f * (level / altar.getCapacity()), (float) z);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
renderBloodLevel(AlchemicalWizardry.lifeEssenceFluid.getStillIcon());
GL11.glPopMatrix();
}
public void renderBloodLevel(IIcon icon)
{
public void renderBloodLevel(IIcon icon) {
Tessellator tessellator = Tessellator.instance;
double minU = (double) icon.getInterpolatedU(0);
@@ -4,8 +4,7 @@ import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelVampireCostume extends ModelBiped
{
public class ModelVampireCostume extends ModelBiped {
ModelRenderer Cape;
ModelRenderer CowlL1;
ModelRenderer CowlR1;
@@ -30,9 +29,8 @@ public class ModelVampireCostume extends ModelBiped
ModelRenderer ShoulderR3;
ModelRenderer ShoulderL4;
ModelRenderer ShoulderR4;
public ModelVampireCostume(float f, boolean addHelmet, boolean addChest, boolean addLeggings, boolean addBoots)
{
public ModelVampireCostume(float f, boolean addHelmet, boolean addChest, boolean addLeggings, boolean addBoots) {
super(f, 0.0f, 64, 32);
textureWidth = 64;
textureHeight = 32;
@@ -47,43 +45,43 @@ public class ModelVampireCostume extends ModelBiped
CowlL1 = new ModelRenderer(this, 0, 0);
CowlL1.mirror = true;
CowlL1.addBox(0F, 0F, 0F, 0, 4, 8);
CowlL1.setRotationPoint(6F, -3F, -4F);//6F, -3F, -4F
CowlL1.setRotationPoint(6F, -3F, -4F); // 6F, -3F, -4F
CowlL1.setTextureSize(64, 32);
CowlL1.mirror = true;
setRotation(CowlL1, 0F, 0F, 0.5235988F);
CowlR1 = new ModelRenderer(this, 0, 0);
CowlR1.addBox(0F, 0F, 0F, 0, 4, 8);
CowlR1.setRotationPoint(-6F, -3F, -4F);//-6F, -3F, -4F
CowlR1.setRotationPoint(-6F, -3F, -4F); // -6F, -3F, -4F
CowlR1.setTextureSize(64, 32);
CowlR1.mirror = true;
setRotation(CowlR1, 0F, 0F, -0.5235988F);
CowlB = new ModelRenderer(this, 16, 0);
CowlB.addBox(0F, 0F, 0F, 8, 4, 0);
CowlB.setRotationPoint(-4F, -3F, 6F);//-4, -3, 6
CowlB.setRotationPoint(-4F, -3F, 6F); // -4, -3, 6
CowlB.setTextureSize(64, 32);
CowlB.mirror = true;
setRotation(CowlB, -0.5235988F, 0F, 0F);
/* CowlL2 = new ModelRenderer(this, 16, 4);
CowlL2.mirror = true;
CowlL2.addBox(0F, 0F, 0F, 0, 4, 3);
CowlL2.setRotationPoint(4F, -3F, 6F);//4F, -3F, 6F
CowlL2.setTextureSize(64, 32);
CowlL2.mirror = true;
setRotation(CowlL2, 0F, 2.356194F, 0.35F);
/* CowlL2 = new ModelRenderer(this, 16, 4);
CowlL2.mirror = true;
CowlL2.addBox(0F, 0F, 0F, 0, 4, 3);
CowlL2.setRotationPoint(4F, -3F, 6F);//4F, -3F, 6F
CowlL2.setTextureSize(64, 32);
CowlL2.mirror = true;
setRotation(CowlL2, 0F, 2.356194F, 0.35F);
CowlR2 = new ModelRenderer(this, 16, 4);
CowlR2.addBox(0F, 0F, 0F, 0, 4, 3);
CowlR2.setRotationPoint(-6F, -3F, 4F);//-6F, -3F, 4F
CowlR2.setTextureSize(64, 32);
CowlR2.mirror = true;
setRotation(CowlR2, 0F, 0.7853982F, -0.3490659F);
*/
CowlR2 = new ModelRenderer(this, 16, 4);
CowlR2.addBox(0F, 0F, 0F, 0, 4, 3);
CowlR2.setRotationPoint(-6F, -3F, 4F);//-6F, -3F, 4F
CowlR2.setTextureSize(64, 32);
CowlR2.mirror = true;
setRotation(CowlR2, 0F, 0.7853982F, -0.3490659F);
*/
GreaveR = new ModelRenderer(this, 0, 25);
GreaveR.addBox(0F, 0F, 0F, 4, 6, 1);
GreaveR.setRotationPoint(-2F, 3F, -3F);//-4F, 14F, -3F
GreaveR.setRotationPoint(-2F, 3F, -3F); // -4F, 14F, -3F
GreaveR.setTextureSize(64, 32);
GreaveR.mirror = true;
setRotation(GreaveR, 0F, 0F, 0F);
@@ -91,14 +89,14 @@ public class ModelVampireCostume extends ModelBiped
GreaveL = new ModelRenderer(this, 0, 25);
GreaveL.mirror = true;
GreaveL.addBox(0F, 0F, 0F, 4, 6, 1);
GreaveL.setRotationPoint(-2F, 3F, -3F);//0F, 14F, -3F
GreaveL.setRotationPoint(-2F, 3F, -3F); // 0F, 14F, -3F
GreaveL.setTextureSize(64, 32);
GreaveL.mirror = true;
setRotation(GreaveL, 0F, 0F, 0F);
ShoeBR = new ModelRenderer(this, 0, 21);
ShoeBR.addBox(0F, 0F, 0F, 4, 0, 4);
ShoeBR.setRotationPoint(-2F, 13F, -2F);//-4F, 24F, -2F
ShoeBR.setRotationPoint(-2F, 13F, -2F); // -4F, 24F, -2F
ShoeBR.setTextureSize(64, 32);
ShoeBR.mirror = true;
setRotation(ShoeBR, 0F, 0F, 0F);
@@ -106,14 +104,14 @@ public class ModelVampireCostume extends ModelBiped
ShoeBL = new ModelRenderer(this, 0, 21);
ShoeBL.mirror = true;
ShoeBL.addBox(0F, 0F, 0F, 4, 0, 4);
ShoeBL.setRotationPoint(-2F, 13F, -2F);//0F, 24F, -2F
ShoeBL.setRotationPoint(-2F, 13F, -2F); // 0F, 24F, -2F
ShoeBL.setTextureSize(64, 32);
ShoeBL.mirror = true;
setRotation(ShoeBL, 0F, 0F, 0F);
ShoeRB = new ModelRenderer(this, 2, 16);
ShoeRB.addBox(0F, 0F, 0F, 4, 2, 0);
ShoeRB.setRotationPoint(-2F, 11F, 2F);//-4F, 22F, 2F
ShoeRB.setRotationPoint(-2F, 11F, 2F); // -4F, 22F, 2F
ShoeRB.setTextureSize(64, 32);
ShoeRB.mirror = true;
setRotation(ShoeRB, 0F, 0F, 0F);
@@ -121,7 +119,7 @@ public class ModelVampireCostume extends ModelBiped
ShoeLB = new ModelRenderer(this, 2, 16);
ShoeLB.mirror = true;
ShoeLB.addBox(0F, 0F, 0F, 4, 2, 0);
ShoeLB.setRotationPoint(-2F, 11F, 2F);//0F, 22F, 2F
ShoeLB.setRotationPoint(-2F, 11F, 2F); // 0F, 22F, 2F
ShoeLB.setTextureSize(64, 32);
ShoeLB.mirror = true;
setRotation(ShoeLB, 0F, 0F, 0F);
@@ -129,14 +127,14 @@ public class ModelVampireCostume extends ModelBiped
ShoeL1 = new ModelRenderer(this, 0, 9);
ShoeL1.mirror = true;
ShoeL1.addBox(0F, 0F, 0F, 0, 2, 4);
ShoeL1.setRotationPoint(-2F, 11F, -2F);//4F, 22F, -2F
ShoeL1.setRotationPoint(-2F, 11F, -2F); // 4F, 22F, -2F
ShoeL1.setTextureSize(64, 32);
ShoeL1.mirror = true;
setRotation(ShoeL1, 0F, 0F, 0F);
ShoeR1 = new ModelRenderer(this, 0, 9);
ShoeR1.addBox(0F, 0F, 0F, 0, 2, 4);
ShoeR1.setRotationPoint(-2F, 11F, -2F);//-4F, 22F, -2F
ShoeR1.setRotationPoint(-2F, 11F, -2F); // -4F, 22F, -2F
ShoeR1.setTextureSize(64, 32);
ShoeR1.mirror = true;
setRotation(ShoeR1, 0F, 0F, 0F);
@@ -144,14 +142,14 @@ public class ModelVampireCostume extends ModelBiped
ShoeL2 = new ModelRenderer(this, 0, 16);
ShoeL2.mirror = true;
ShoeL2.addBox(0F, 0F, 0F, 4, 1, 2);
ShoeL2.setRotationPoint(-2F, 12F, -4F);//0F, 23F, -4F
ShoeL2.setRotationPoint(-2F, 12F, -4F); // 0F, 23F, -4F
ShoeL2.setTextureSize(64, 32);
ShoeL2.mirror = true;
setRotation(ShoeL2, 0F, 0F, 0F);
ShoeR2 = new ModelRenderer(this, 0, 16);
ShoeR2.addBox(0F, 0F, 0F, 4, 1, 2);
ShoeR2.setRotationPoint(-2F, 12F, -4F);//-4F, 23F, -4F
ShoeR2.setRotationPoint(-2F, 12F, -4F); // -4F, 23F, -4F
ShoeR2.setTextureSize(64, 32);
ShoeR2.mirror = true;
setRotation(ShoeR2, 0F, 0F, 0F);
@@ -159,14 +157,14 @@ public class ModelVampireCostume extends ModelBiped
ShoulderL1 = new ModelRenderer(this, 42, 19);
ShoulderL1.mirror = true;
ShoulderL1.addBox(0F, 0F, 0F, 5, 1, 6);
ShoulderL1.setRotationPoint(-1F, -3F, -3F);//-9F, -1F, -3F
ShoulderL1.setRotationPoint(-1F, -3F, -3F); // -9F, -1F, -3F
ShoulderL1.setTextureSize(64, 32);
ShoulderL1.mirror = true;
setRotation(ShoulderL1, 0F, 0F, 0F);
ShoulderR1 = new ModelRenderer(this, 42, 19);
ShoulderR1.addBox(0F, 0F, 0F, 5, 1, 6);
ShoulderR1.setRotationPoint(-4F, -3F, -3F);//4F, -1F, -3F
ShoulderR1.setRotationPoint(-4F, -3F, -3F); // 4F, -1F, -3F
ShoulderR1.setTextureSize(64, 32);
ShoulderR1.mirror = true;
setRotation(ShoulderR1, 0F, 0F, 0F);
@@ -174,14 +172,14 @@ public class ModelVampireCostume extends ModelBiped
ShoulderL2 = new ModelRenderer(this, 52, 26);
ShoulderL2.mirror = true;
ShoulderL2.addBox(0F, 0F, 0F, 5, 1, 1);
ShoulderL2.setRotationPoint(-1F, -2F, -3F);//4F, -1F, -3F
ShoulderL2.setRotationPoint(-1F, -2F, -3F); // 4F, -1F, -3F
ShoulderL2.setTextureSize(64, 32);
ShoulderL2.mirror = true;
setRotation(ShoulderL2, 0F, 0F, 0F);
ShoulderR2 = new ModelRenderer(this, 52, 26);
ShoulderR2.addBox(0F, 0F, 0F, 5, 1, 1);
ShoulderR2.setRotationPoint(-4F, -2F, -3F);//4F, 0F, -3F
ShoulderR2.setRotationPoint(-4F, -2F, -3F); // 4F, 0F, -3F
ShoulderR2.setTextureSize(64, 32);
ShoulderR2.mirror = true;
setRotation(ShoulderR2, 0F, 0F, 0F);
@@ -189,14 +187,14 @@ public class ModelVampireCostume extends ModelBiped
ShoulderL3 = new ModelRenderer(this, 40, 26);
ShoulderL3.mirror = true;
ShoulderL3.addBox(0F, 0F, 0F, 1, 1, 5);
ShoulderL3.setRotationPoint(3F, -2F, -2F);//-9F, 0F, -2F
ShoulderL3.setRotationPoint(3F, -2F, -2F); // -9F, 0F, -2F
ShoulderL3.setTextureSize(64, 32);
ShoulderL3.mirror = true;
setRotation(ShoulderL3, 0F, 0F, 0F);
ShoulderR3 = new ModelRenderer(this, 40, 26);
ShoulderR3.addBox(0F, 0F, 0F, 1, 1, 5);
ShoulderR3.setRotationPoint(-4F, -2F, -2F);//8F, 0F, -2F
ShoulderR3.setRotationPoint(-4F, -2F, -2F); // 8F, 0F, -2F
ShoulderR3.setTextureSize(64, 32);
ShoulderR3.mirror = true;
setRotation(ShoulderR3, 0F, 0F, 0F);
@@ -204,33 +202,32 @@ public class ModelVampireCostume extends ModelBiped
ShoulderL4 = new ModelRenderer(this, 54, 28);
ShoulderL4.mirror = true;
ShoulderL4.addBox(0F, 0F, 0F, 4, 1, 1);
ShoulderL4.setRotationPoint(-1F, -2F, 2F);//-8F, 0F, 2F
ShoulderL4.setRotationPoint(-1F, -2F, 2F); // -8F, 0F, 2F
ShoulderL4.setTextureSize(64, 32);
ShoulderL4.mirror = true;
setRotation(ShoulderL4, 0F, 0F, 0F);
ShoulderR4 = new ModelRenderer(this, 54, 28);
ShoulderR4.addBox(0F, 0F, 0F, 4, 1, 1);
ShoulderR4.setRotationPoint(-3F, -2F, 2F);//4F, 0F, 2F
ShoulderR4.setRotationPoint(-3F, -2F, 2F); // 4F, 0F, 2F
ShoulderR4.setTextureSize(64, 32);
ShoulderR4.mirror = true;
setRotation(ShoulderR4, 0F, 0F, 0F);
this.bipedHead.cubeList.clear();
this.bipedHeadwear.cubeList.clear();
/* if (addChest)
{
this.bipedHead.addChild(this.CowlL1);
this.bipedHead.addChild(this.CowlL2);
this.bipedHead.addChild(this.CowlR1);
this.bipedHead.addChild(this.CowlR2);
}
*/
/* if (addChest)
{
this.bipedHead.addChild(this.CowlL1);
this.bipedHead.addChild(this.CowlL2);
this.bipedHead.addChild(this.CowlR1);
this.bipedHead.addChild(this.CowlR2);
}
*/
this.bipedBody.cubeList.clear();
this.bipedRightArm.cubeList.clear();
this.bipedLeftArm.cubeList.clear();
if (addChest)
{
if (addChest) {
this.bipedBody.addChild(this.Cape);
this.bipedLeftArm.addChild(this.ShoulderL1);
this.bipedLeftArm.addChild(this.ShoulderL2);
@@ -243,18 +240,16 @@ public class ModelVampireCostume extends ModelBiped
this.bipedBody.addChild(this.CowlB);
this.bipedBody.addChild(this.CowlL1);
// this.bipedBody.addChild(this.CowlL2);
// this.bipedBody.addChild(this.CowlL2);
this.bipedBody.addChild(this.CowlR1);
// this.bipedBody.addChild(this.CowlR2);
// this.bipedBody.addChild(this.CowlR2);
}
this.bipedLeftLeg.cubeList.clear();
if (addLeggings)
{
if (addLeggings) {
this.bipedLeftLeg.addChild(this.GreaveL);
}
if (addBoots)
{
if (addBoots) {
this.bipedLeftLeg.addChild(this.ShoeBL);
this.bipedLeftLeg.addChild(this.ShoeL1);
this.bipedLeftLeg.addChild(this.ShoeL2);
@@ -262,21 +257,18 @@ public class ModelVampireCostume extends ModelBiped
}
this.bipedRightLeg.cubeList.clear();
if (addLeggings)
{
if (addLeggings) {
this.bipedRightLeg.addChild(this.GreaveR);
}
if (addBoots)
{
if (addBoots) {
this.bipedRightLeg.addChild(this.ShoeBR);
this.bipedRightLeg.addChild(this.ShoeR1);
this.bipedRightLeg.addChild(this.ShoeR2);
this.bipedRightLeg.addChild(this.ShoeRB);
}
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.bipedHead.render(f5);
@@ -287,15 +279,13 @@ public class ModelVampireCostume extends ModelBiped
this.bipedLeftLeg.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
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)
{
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);
}
}
@@ -1,5 +1,6 @@
package com.arc.bloodarsenal.common;
import com.arc.bloodarsenal.common.block.ModBlocks;
import com.arc.bloodarsenal.common.entity.ModLivingDropsEvent;
import com.arc.bloodarsenal.common.gui.GuiHandler;
import com.arc.bloodarsenal.common.items.ModItems;
@@ -15,9 +16,12 @@ import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.NetworkRegistry;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Calendar;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import com.arc.bloodarsenal.common.block.ModBlocks;
import net.minecraft.item.ItemArmor;
import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource;
@@ -26,19 +30,22 @@ import net.minecraftforge.common.util.EnumHelper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Calendar;
@Mod(
modid = BloodArsenal.MODID,
version = BloodArsenal.VERSION,
name = "GRADLETOKEN_MODNAME",
dependencies =
"required-after:AWWayofTime;after:NotEnoughItems;after:Baubles;after:guideapi;after:TConstruct;after:Waila;after:ForbiddenMagic",
guiFactory = "com.arc.bloodarsenal.common.gui.ConfigGuiFactory")
public class BloodArsenal {
public static final String MODID = "GRADLETOKEN_MODID";
public static final String VERSION = "GRADLETOKEN_VERSION";
@Mod(modid = BloodArsenal.MODID, version = BloodArsenal.VERSION, name = "GRADLETOKEN_MODNAME", dependencies = "required-after:AWWayofTime;after:NotEnoughItems;after:Baubles;after:guideapi;after:TConstruct;after:Waila;after:ForbiddenMagic", guiFactory = "com.arc.bloodarsenal.common.gui.ConfigGuiFactory")
public class BloodArsenal
{
public final static String MODID = "GRADLETOKEN_MODID";
public final static String VERSION = "GRADLETOKEN_VERSION";
@SidedProxy(clientSide = "com.arc.bloodarsenal.client.ClientProxy", serverSide = "com.arc.bloodarsenal.common.CommonProxy")
@SidedProxy(
clientSide = "com.arc.bloodarsenal.client.ClientProxy",
serverSide = "com.arc.bloodarsenal.common.CommonProxy")
public static CommonProxy proxy;
@Mod.Instance("BloodArsenal")
public static BloodArsenal instance;
@@ -50,19 +57,22 @@ public class BloodArsenal
public static Item.ToolMaterial infusedWood = EnumHelper.addToolMaterial("InfusedWood", 1, 0, 5.0F, 1.0F, 0);
public static Item.ToolMaterial infusedIron = EnumHelper.addToolMaterial("InfusedIron", 3, 0, 11.0F, 4.0F, 0);
public static Item.ToolMaterial infusedDiamond = EnumHelper.addToolMaterial("InfusedDiamond", 5, 0, 17.0F, 9.0F, 0);
public static Item.ToolMaterial infusedNetherium = EnumHelper.addToolMaterial("InfusedNetherium", 8, 0, 31.0F, 18.0F, 0);
public static Item.ToolMaterial infusedNetherium =
EnumHelper.addToolMaterial("InfusedNetherium", 8, 0, 31.0F, 18.0F, 0);
public static ItemArmor.ArmorMaterial vampireArmor = EnumHelper.addArmorMaterial("VampireArmor", 0, new int[]{2, 7, 4, 2}, 0);
public static ItemArmor.ArmorMaterial lifeImbuedArmor = EnumHelper.addArmorMaterial("ImbuedArmor", 0, new int[]{4, 13, 9, 4}, 0);
public static ItemArmor.ArmorMaterial glassArmor = EnumHelper.addArmorMaterial("GlassArmor", 0, new int[]{1, 4, 3, 1}, 4);
public static ItemArmor.ArmorMaterial elementalLifeImbuedArmor = EnumHelper.addArmorMaterial("ElementalImbuedArmor", 0, new int[]{6, 16, 12, 6}, 0);
public static ItemArmor.ArmorMaterial vampireArmor =
EnumHelper.addArmorMaterial("VampireArmor", 0, new int[] {2, 7, 4, 2}, 0);
public static ItemArmor.ArmorMaterial lifeImbuedArmor =
EnumHelper.addArmorMaterial("ImbuedArmor", 0, new int[] {4, 13, 9, 4}, 0);
public static ItemArmor.ArmorMaterial glassArmor =
EnumHelper.addArmorMaterial("GlassArmor", 0, new int[] {1, 4, 3, 1}, 4);
public static ItemArmor.ArmorMaterial elementalLifeImbuedArmor =
EnumHelper.addArmorMaterial("ElementalImbuedArmor", 0, new int[] {6, 16, 12, 6}, 0);
public static Logger logger = LogManager.getLogger(MODID);
public static CreativeTabs BA_TAB = new CreativeTabs("BA_TAB")
{
public static Logger logger = LogManager.getLogger(MODID);
public static CreativeTabs BA_TAB = new CreativeTabs("BA_TAB") {
@Override
public Item getTabIconItem()
{
public Item getTabIconItem() {
return ModItems.bound_bow;
}
};
@@ -70,45 +80,38 @@ public class BloodArsenal
public static final AHPacketHandler packetPipeline = new AHPacketHandler();
public static DamageSource deathFromBlood = new DamageSource("deathFromBlood").setDamageBypassesArmor();
public static boolean isHalloween()
{
public static boolean isHalloween() {
Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.MONTH) == Calendar.OCTOBER;
}
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
BloodArsenalConfig.init(new File(event.getModConfigurationDirectory(), "BloodArsenal.cfg"));
public void preInit(FMLPreInitializationEvent event) {
BloodArsenalConfig.init(new File(event.getModConfigurationDirectory(), "BloodArsenal.cfg"));
ModBlocks.init();
ModBlocks.init();
ModBlocks.registerTileEntities();
ModItems.init();
ModItems.init();
Potion[] potionTypes;
Potion[] potionTypes;
for (Field f : Potion.class.getDeclaredFields())
{
f.setAccessible(true);
for (Field f : Potion.class.getDeclaredFields()) {
f.setAccessible(true);
try
{
if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a"))
{
Field modfield = Field.class.getDeclaredField("modifiers");
modfield.setAccessible(true);
modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
potionTypes = (Potion[]) f.get(null);
final Potion[] newPotionTypes = new Potion[256];
System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
f.set(null, newPotionTypes);
try {
if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
Field modfield = Field.class.getDeclaredField("modifiers");
modfield.setAccessible(true);
modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
potionTypes = (Potion[]) f.get(null);
final Potion[] newPotionTypes = new Potion[256];
System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
f.set(null, newPotionTypes);
}
}
catch (Exception e)
{
logger.error("ポケモン!");
logger.error(e);
} catch (Exception e) {
logger.error("ポケモン!");
logger.error(e);
}
}
@@ -124,56 +127,58 @@ public class BloodArsenal
}
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
public void init(FMLInitializationEvent event) {
BloodArsenalRecipes.registerBindingRecipes();
BloodArsenalRecipes.registerAltarRecipes();
BloodArsenalRecipes.registerRecipes();
RitualRegistry.initRituals();
proxy.init();
//manual call to registerEntityTrackers bc it wont get called client side... also removed the internal call from the proxy
CommonProxy.registerEntityTrackers();
// manual call to registerEntityTrackers bc it wont get called client side... also removed the internal call
// from the proxy
CommonProxy.registerEntityTrackers();
FMLInterModComms.sendMessage("Waila", "register", "com.arc.bloodarsenal.common.misc.WAILAPlugin.registerAddon");
vampiricAura = new PotionBloodArsenal(BloodArsenalConfig.vampiricAuraID, false, 0).setIconIndex(0, 0).setPotionName("Vampiric Aura");
bleeding = new PotionBloodArsenal(BloodArsenalConfig.bleedingID, true, 0).setIconIndex(1, 0).setPotionName("Bleeding");
swimming = new PotionBloodArsenal(BloodArsenalConfig.swimmingID, false, 0).setIconIndex(2, 0).setPotionName("Swimming");
soulBurn = new PotionBloodArsenal(BloodArsenalConfig.soulBurnID, true, 0).setIconIndex(3, 0).setPotionName("Soul Burn");
vampiricAura = new PotionBloodArsenal(BloodArsenalConfig.vampiricAuraID, false, 0)
.setIconIndex(0, 0)
.setPotionName("Vampiric Aura");
bleeding = new PotionBloodArsenal(BloodArsenalConfig.bleedingID, true, 0)
.setIconIndex(1, 0)
.setPotionName("Bleeding");
swimming = new PotionBloodArsenal(BloodArsenalConfig.swimmingID, false, 0)
.setIconIndex(2, 0)
.setPotionName("Swimming");
soulBurn = new PotionBloodArsenal(BloodArsenalConfig.soulBurnID, true, 0)
.setIconIndex(3, 0)
.setPotionName("Soul Burn");
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
if (Loader.isModLoaded("Baubles") && BloodArsenalConfig.baublesIntegration)
{
public void postInit(FMLPostInitializationEvent event) {
if (Loader.isModLoaded("Baubles") && BloodArsenalConfig.baublesIntegration) {
logger.info("Loaded Baubles integration");
ModItems.registerBaubles();
BloodArsenalRecipes.addBaublesRecipe();
}
if (Loader.isModLoaded("TConstruct") && BloodArsenalConfig.tinkersIntegration)
{
if (Loader.isModLoaded("TConstruct") && BloodArsenalConfig.tinkersIntegration) {
logger.info("Loaded Tinker's Construct integration");
BloodArsenalTinkers.INSTANCE.init();
}
if (Loader.isModLoaded("guideapi") && BloodArsenalConfig.guideAPIIntegration)
{
if (Loader.isModLoaded("guideapi") && BloodArsenalConfig.guideAPIIntegration) {
logger.info("Loaded Guide-API integration");
BloodBurnedTome.registerTome();
}
if (Loader.isModLoaded("ForbiddenMagic") && BloodArsenalConfig.thaumcraftIntegration)
{
if (Loader.isModLoaded("ForbiddenMagic") && BloodArsenalConfig.thaumcraftIntegration) {
logger.info("Loaded Thaumcraft/Forbidden Magic integration");
ModItems.registerThaumcraftItems();
BloodArsenalThaumcraft.addResearch();
}
if (Loader.isModLoaded("ForgeMultipart") && BloodArsenalConfig.forgeMultipartIntegration)
{
if (Loader.isModLoaded("ForgeMultipart") && BloodArsenalConfig.forgeMultipartIntegration) {
logger.info("Loaded Forge Multipart integration");
ModBlocks.registerMultiparts();
}
@@ -1,27 +1,25 @@
package com.arc.bloodarsenal.common;
import java.io.File;
import net.minecraftforge.common.config.Configuration;
import java.io.File;
public class BloodArsenalConfig
{
public class BloodArsenalConfig {
public static Configuration config;
// Config Categories
public static String potionId = "Potion ID";
public static String ritualBlacklist = "Ritual Blacklist";
// Config Categories
public static String potionId = "Potion ID";
public static String ritualBlacklist = "Ritual Blacklist";
public static String blockSettings = "Block Settings";
public static String itemSettings = "Item Settings";
public static String itemSettings = "Item Settings";
public static String modSettings = "Mod Settings";
public static String lpSettings = "LP Settings";
public static String misc = "Miscellaneous";
// Config Options
// Potion ID's
// Config Options
// Potion ID's
public static int vampiricAuraID;
public static int bleedingID;
public static int swimmingID;
public static int bleedingID;
public static int swimmingID;
public static int soulBurnID;
// Ritual Blacklist
@@ -34,10 +32,10 @@ public class BloodArsenalConfig
// Block Settings
public static String[] blocksToBeDisabled;
// Item Settings
// Item Settings
public static String[] itemsToBeDisabled;
//Mod Settings
// Mod Settings
public static boolean baublesIntegration;
public static boolean forgeMultipartIntegration;
public static boolean guideAPIIntegration;
@@ -47,7 +45,7 @@ public class BloodArsenalConfig
public static int bloodInfusedWoodID;
public static int bloodInfusedIronID;
//LP Settings
// LP Settings
public static int sigilSwimmingCost;
public static int sigilDivinityCost;
public static int enderSigilOpenCost;
@@ -55,71 +53,103 @@ public class BloodArsenalConfig
public static int lightningSigilMultiplier;
public static int lpMaterializerCost;
// Miscellaneous
public static boolean isRedGood;
// Miscellaneous
public static boolean isRedGood;
public static boolean cakeIsLie;
public static boolean isGlassDangerous;
public static void init(File file)
{
config = new Configuration(file);
try
{
public static void init(File file) {
config = new Configuration(file);
try {
syncConfig();
}
catch (Exception e)
{
BloodArsenal.logger.error("There has been an error loading the configurations, go report this on the forum.");
}
finally
{
} catch (Exception e) {
BloodArsenal.logger.error(
"There has been an error loading the configurations, go report this on the forum.");
} finally {
config.save();
}
}
}
public static void syncConfig()
{
config.addCustomCategoryComment(potionId, "Change potion ID's here if you have conflicts");
public static void syncConfig() {
config.addCustomCategoryComment(potionId, "Change potion ID's here if you have conflicts");
config.addCustomCategoryComment(ritualBlacklist, "Blacklist rituals that you don't want/like");
config.addCustomCategoryComment(itemSettings, "Settings for items");
config.addCustomCategoryComment(itemSettings, "Settings for items");
config.addCustomCategoryComment(modSettings, "Toggle mod integration");
config.addCustomCategoryComment(lpSettings, "Change the LP costs for things");
config.addCustomCategoryComment(misc, "Random stuffs");
config.addCustomCategoryComment(misc, "Random stuffs");
vampiricAuraID = config.get(potionId, "Vampiric Aura", 120).getInt(vampiricAuraID);
bleedingID = config.get(potionId, "Bleeding", 121).getInt(bleedingID);
swimmingID = config.get(potionId, "Swimming", 122).getInt(swimmingID);
soulBurnID = config.get(potionId, "Soul Burn", 123).getInt(soulBurnID);
ritualDisabledWither = config.get(ritualBlacklist, "Ritual of Withering", false).getBoolean(ritualDisabledWither);
ritualDisabledWither =
config.get(ritualBlacklist, "Ritual of Withering", false).getBoolean(ritualDisabledWither);
ritualDisabledMidas = config.get(ritualBlacklist, "Midas Touch", false).getBoolean(ritualDisabledMidas);
ritualDisabledEnchantment = config.get(ritualBlacklist, "The Enchantress's Spell", false).getBoolean(ritualDisabledEnchantment);
ritualDisabledMobOppression = config.get(ritualBlacklist, "Ritual of Mob Oppression", false).getBoolean(ritualDisabledMobOppression);
ritualDisabledFisherman = config.get(ritualBlacklist, "Fisherman's Hymn", false).getBoolean(ritualDisabledFisherman);
ritualDisabledEnchantment =
config.get(ritualBlacklist, "The Enchantress's Spell", false).getBoolean(ritualDisabledEnchantment);
ritualDisabledMobOppression =
config.get(ritualBlacklist, "Ritual of Mob Oppression", false).getBoolean(ritualDisabledMobOppression);
ritualDisabledFisherman =
config.get(ritualBlacklist, "Fisherman's Hymn", false).getBoolean(ritualDisabledFisherman);
blocksToBeDisabled = config.getStringList("Disable blocks here", blockSettings, new String[]{""}, "Type in the unlocalized name of the block you want disabled here (separate them using ENTER)");
itemsToBeDisabled = config.getStringList("Disable items here", itemSettings, new String[]{""}, "Type in the unlocalized name of the item you want disabled (separate them using ENTER)");
blocksToBeDisabled = config.getStringList(
"Disable blocks here",
blockSettings,
new String[] {""},
"Type in the unlocalized name of the block you want disabled here (separate them using ENTER)");
itemsToBeDisabled = config.getStringList(
"Disable items here",
itemSettings,
new String[] {""},
"Type in the unlocalized name of the item you want disabled (separate them using ENTER)");
baublesIntegration = config.get(modSettings, "Enable Baubles integration?", true).getBoolean(baublesIntegration);
forgeMultipartIntegration = config.get(modSettings, "Enable Forge Multipart Integration?", true).getBoolean(forgeMultipartIntegration);
guideAPIIntegration = config.get(modSettings, "Enable the Blood Burned Tome from Guide-API?", true).getBoolean(guideAPIIntegration);
thaumcraftIntegration = config.get(modSettings, "Enable Thaumcraft/Forbidden Magic integration?", true).getBoolean(thaumcraftIntegration);
tinkersIntegration = config.get(modSettings, "Enable Tinker's Construct integration?", true).getBoolean(tinkersIntegration);
researchTag = config.get(modSettings, "Add [BA] to all of Blood Arsenal's research?", true).getBoolean(researchTag);
bloodInfusedWoodID = config.get(modSettings, "[Tinker's Construct] Material ID for Blood Infused Wood; Default: 250", 250).getInt(bloodInfusedWoodID);
bloodInfusedIronID = config.get(modSettings, "[Tinker's Construct] Material ID for Blood Infused Iron; Default: 251", 251).getInt(bloodInfusedIronID);
baublesIntegration =
config.get(modSettings, "Enable Baubles integration?", true).getBoolean(baublesIntegration);
forgeMultipartIntegration = config.get(modSettings, "Enable Forge Multipart Integration?", true)
.getBoolean(forgeMultipartIntegration);
guideAPIIntegration = config.get(modSettings, "Enable the Blood Burned Tome from Guide-API?", true)
.getBoolean(guideAPIIntegration);
thaumcraftIntegration = config.get(modSettings, "Enable Thaumcraft/Forbidden Magic integration?", true)
.getBoolean(thaumcraftIntegration);
tinkersIntegration = config.get(modSettings, "Enable Tinker's Construct integration?", true)
.getBoolean(tinkersIntegration);
researchTag = config.get(modSettings, "Add [BA] to all of Blood Arsenal's research?", true)
.getBoolean(researchTag);
bloodInfusedWoodID = config.get(
modSettings, "[Tinker's Construct] Material ID for Blood Infused Wood; Default: 250", 250)
.getInt(bloodInfusedWoodID);
bloodInfusedIronID = config.get(
modSettings, "[Tinker's Construct] Material ID for Blood Infused Iron; Default: 251", 251)
.getInt(bloodInfusedIronID);
sigilSwimmingCost = config.get(lpSettings, "Sigil of Swimming cost; Default: 250", 250).getInt(sigilSwimmingCost);
sigilDivinityCost = config.get(lpSettings, "Sigil of Divinity cost; Default: 1000000", 1000000).getInt(sigilDivinityCost);
enderSigilOpenCost = config.get(lpSettings, "Ender Sigil cost (to open the Ender Chest); Default: 400", 400).getInt(enderSigilOpenCost);
enderSigilTeleportMultiplier = config.get(lpSettings, "Ender Sigil cost (to teleport (multiplier)); Default: 500", 500).getInt(enderSigilTeleportMultiplier);
lightningSigilMultiplier = config.get(lpSettings, "Lightning Sigil cost (multiplier); Default: 1500", 1500).getInt(lightningSigilMultiplier);
lpMaterializerCost = config.get(lpSettings, "Converts this number to 100LE (from this (SN) to 100 (LE)); Default: 150", 150).getInt(lpMaterializerCost);
sigilSwimmingCost = config.get(lpSettings, "Sigil of Swimming cost; Default: 250", 250)
.getInt(sigilSwimmingCost);
sigilDivinityCost = config.get(lpSettings, "Sigil of Divinity cost; Default: 1000000", 1000000)
.getInt(sigilDivinityCost);
enderSigilOpenCost = config.get(lpSettings, "Ender Sigil cost (to open the Ender Chest); Default: 400", 400)
.getInt(enderSigilOpenCost);
enderSigilTeleportMultiplier = config.get(
lpSettings, "Ender Sigil cost (to teleport (multiplier)); Default: 500", 500)
.getInt(enderSigilTeleportMultiplier);
lightningSigilMultiplier = config.get(lpSettings, "Lightning Sigil cost (multiplier); Default: 1500", 1500)
.getInt(lightningSigilMultiplier);
lpMaterializerCost = config.get(
lpSettings, "Converts this number to 100LE (from this (SN) to 100 (LE)); Default: 150", 150)
.getInt(lpMaterializerCost);
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 incorrect.").getBoolean(isRedGood);
cakeIsLie = config.get(misc, "The cake is a lie", false, "The cake is a lie").getBoolean(cakeIsLie);
isGlassDangerous = config.get(misc, "Is glass dangerous?", true, "Breaking glass is dangerous unless you're a wimp").getBoolean(isGlassDangerous);
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 incorrect.")
.getBoolean(isRedGood);
cakeIsLie = config.get(misc, "The cake is a lie", false, "The cake is a lie")
.getBoolean(cakeIsLie);
isGlassDangerous = config.get(
misc, "Is glass dangerous?", true, "Breaking glass is dangerous unless you're a wimp")
.getBoolean(isGlassDangerous);
config.save();
}
@@ -6,6 +6,7 @@ import com.arc.bloodarsenal.common.items.armor.GlassArmor;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockGlass;
import net.minecraft.block.material.Material;
@@ -17,147 +18,124 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.common.util.FakePlayer;
import java.util.Random;
public class BloodArsenalEventHooks
{
public class BloodArsenalEventHooks {
private Random rand = new Random();
@SubscribeEvent
public void onEntityDamaged(LivingAttackEvent event)
{
public void onEntityDamaged(LivingAttackEvent event) {
EntityLivingBase entityAttacked = event.entityLiving;
Entity entityAttacking = event.source.getSourceOfDamage();
float damageDone = event.ammount;
if (entityAttacking != null && entityAttacked != null)
{
if (entityAttacking instanceof EntityLivingBase)
{
if (((EntityLivingBase) entityAttacking).isPotionActive(BloodArsenal.vampiricAura))
{
if (entityAttacking != null && entityAttacked != null) {
if (entityAttacking instanceof EntityLivingBase) {
if (((EntityLivingBase) entityAttacking).isPotionActive(BloodArsenal.vampiricAura)) {
float drainedHealth = damageDone / 4;
((EntityLivingBase) entityAttacking).setHealth(((EntityLivingBase) entityAttacking).getHealth() + drainedHealth);
((EntityLivingBase) entityAttacking)
.setHealth(((EntityLivingBase) entityAttacking).getHealth() + drainedHealth);
}
}
if (entityAttacked instanceof EntityPlayer)
{
if (entityAttacked.isPotionActive(BloodArsenal.swimming))
{
if (entityAttacked.isInsideOfMaterial(Material.lava))
{
if (event.source.isFireDamage())
{
if (entityAttacked instanceof EntityPlayer) {
if (entityAttacked.isPotionActive(BloodArsenal.swimming)) {
if (entityAttacked.isInsideOfMaterial(Material.lava)) {
if (event.source.isFireDamage()) {
event.setCanceled(true);
}
}
}
if (entityAttacked instanceof EntityPlayerMP && !(entityAttacked instanceof FakePlayer))
{
EntityPlayerMP player = (EntityPlayerMP) entityAttacked;
if (entityAttacked instanceof EntityPlayerMP && !(entityAttacked instanceof FakePlayer)) {
EntityPlayerMP player = (EntityPlayerMP) entityAttacked;
if (player.inventory.armorInventory != null)
{
for (int i = 0; i < 4; i++)
{
ItemStack armorStack = player.inventory.armorInventory[3 - i];
if (player.inventory.armorInventory != null) {
for (int i = 0; i < 4; i++) {
ItemStack armorStack = player.inventory.armorInventory[3 - i];
if (armorStack != null && armorStack.getItem() instanceof GlassArmor)
{
if (entityAttacking instanceof EntityLivingBase)
{
((EntityLivingBase) entityAttacking).addPotionEffect(new PotionEffect(BloodArsenalConfig.bleedingID, rand.nextInt(3) * 20, rand.nextInt(1)));
}
}
}
}
if (armorStack != null && armorStack.getItem() instanceof GlassArmor) {
if (entityAttacking instanceof EntityLivingBase) {
((EntityLivingBase) entityAttacking)
.addPotionEffect(new PotionEffect(
BloodArsenalConfig.bleedingID,
rand.nextInt(3) * 20,
rand.nextInt(1)));
}
}
}
}
}
}
}
}
@SubscribeEvent
public void onEntityUpdate(LivingEvent.LivingUpdateEvent event)
{
public void onEntityUpdate(LivingEvent.LivingUpdateEvent event) {
EntityLivingBase entityLiving = event.entityLiving;
if (entityLiving != null)
{
if (entityLiving instanceof FakePlayer)
return;
if (entityLiving != null) {
if (entityLiving instanceof FakePlayer) return;
if (entityLiving.isPotionActive(BloodArsenal.bleeding))
{
int amplifier = entityLiving.getActivePotionEffect(BloodArsenal.bleeding).getAmplifier();
int duration = entityLiving.getActivePotionEffect(BloodArsenal.bleeding).getDuration();
if (entityLiving.isPotionActive(BloodArsenal.bleeding)) {
int amplifier = entityLiving
.getActivePotionEffect(BloodArsenal.bleeding)
.getAmplifier();
int duration = entityLiving
.getActivePotionEffect(BloodArsenal.bleeding)
.getDuration();
int damage = (rand.nextInt(2) * (amplifier + 1) + rand.nextInt(2));
entityLiving.addPotionEffect(new PotionEffect(Potion.blindness.id, duration, 1));
if (entityLiving.worldObj.getWorldTime() % (60 / (amplifier + 1)) == 0)
{
if (entityLiving.worldObj.getWorldTime() % (60 / (amplifier + 1)) == 0) {
entityLiving.attackEntityFrom(BloodArsenal.deathFromBlood, damage);
entityLiving.hurtResistantTime = Math.min(entityLiving.hurtResistantTime, 60 / (amplifier + 1));
entityLiving.onEntityUpdate();
}
}
if (entityLiving.isPotionActive(BloodArsenal.soulBurn))
{
int amplifier = entityLiving.getActivePotionEffect(BloodArsenal.soulBurn).getAmplifier();
if (entityLiving.isPotionActive(BloodArsenal.soulBurn)) {
int amplifier = entityLiving
.getActivePotionEffect(BloodArsenal.soulBurn)
.getAmplifier();
entityLiving.setFire(2);
if (entityLiving instanceof EntityPlayer && entityLiving.getHealth() > 0.0)
{
if (entityLiving.worldObj.getWorldTime() % (10 / (amplifier + 1)) == 0)
{
if (entityLiving instanceof EntityPlayer && entityLiving.getHealth() > 0.0) {
if (entityLiving.worldObj.getWorldTime() % (10 / (amplifier + 1)) == 0) {
int lpToMinus = 1000 * (2 ^ (amplifier + 1));
SoulNetworkHandler.syphonAndDamageFromNetwork(entityLiving.getCommandSenderName(), (EntityPlayer) entityLiving, lpToMinus);
SoulNetworkHandler.syphonAndDamageFromNetwork(
entityLiving.getCommandSenderName(), (EntityPlayer) entityLiving, lpToMinus);
}
}
}
if (entityLiving instanceof EntityPlayer)
{
if (entityLiving.isPotionActive(BloodArsenal.swimming))
{
if (entityLiving.isInWater() || entityLiving.isInsideOfMaterial(Material.lava))
{
if (entityLiving instanceof EntityPlayer) {
if (entityLiving.isPotionActive(BloodArsenal.swimming)) {
if (entityLiving.isInWater() || entityLiving.isInsideOfMaterial(Material.lava)) {
entityLiving.setAir(300);
entityLiving.motionX *= 1.2D;
if (entityLiving.motionY > 0.0D)
{
if (entityLiving.motionY > 0.0D) {
entityLiving.motionY *= 1.2D;
}
entityLiving.motionZ *= 1.2D;
double maxSpeed = 0.2D;
if (entityLiving.motionX > maxSpeed)
{
if (entityLiving.motionX > maxSpeed) {
entityLiving.motionX = maxSpeed;
}
else if (entityLiving.motionX < -maxSpeed)
{
} else if (entityLiving.motionX < -maxSpeed) {
entityLiving.motionX = -maxSpeed;
}
if (entityLiving.motionY > maxSpeed)
{
if (entityLiving.motionY > maxSpeed) {
entityLiving.motionY = maxSpeed;
}
if (entityLiving.motionZ > maxSpeed)
{
if (entityLiving.motionZ > maxSpeed) {
entityLiving.motionZ = maxSpeed;
}
else if (entityLiving.motionZ < -maxSpeed)
{
} else if (entityLiving.motionZ < -maxSpeed) {
entityLiving.motionZ = -maxSpeed;
}
}
@@ -167,18 +145,13 @@ public class BloodArsenalEventHooks
}
@SubscribeEvent
public void breakSpeed(PlayerEvent.BreakSpeed event)
{
public void breakSpeed(PlayerEvent.BreakSpeed event) {
EntityLivingBase entityLiving = event.entityLiving;
if (entityLiving != null)
{
if (entityLiving instanceof EntityPlayer && !(entityLiving instanceof FakePlayer))
{
if (entityLiving.isPotionActive(BloodArsenal.swimming))
{
if (entityLiving.isInWater() || entityLiving.isInsideOfMaterial(Material.lava))
{
if (entityLiving != null) {
if (entityLiving instanceof EntityPlayer && !(entityLiving instanceof FakePlayer)) {
if (entityLiving.isPotionActive(BloodArsenal.swimming)) {
if (entityLiving.isInWater() || entityLiving.isInsideOfMaterial(Material.lava)) {
event.newSpeed = 1.75F;
}
}
@@ -187,39 +160,31 @@ public class BloodArsenalEventHooks
}
@SubscribeEvent
public void harvestEvent(BlockEvent.HarvestDropsEvent event)
{
if (GameRegistry.findItem(BloodArsenal.MODID, "glass_shard") != null)
{
public void harvestEvent(BlockEvent.HarvestDropsEvent event) {
if (GameRegistry.findItem(BloodArsenal.MODID, "glass_shard") != null) {
Block block = event.block;
EntityPlayer player = event.harvester;
Random random = new Random();
if (player != null && player instanceof EntityPlayerMP && !(player instanceof FakePlayer))
{
if (!event.world.isRemote && !event.isSilkTouching)
{
if (block != null && block instanceof BlockGlass)
{
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint)
{
if (player != null && player instanceof EntityPlayerMP && !(player instanceof FakePlayer)) {
if (!event.world.isRemote && !event.isSilkTouching) {
if (block != null && block instanceof BlockGlass) {
if (player.getCurrentEquippedItem() != null
&& player.getCurrentEquippedItem().getItem() == Items.flint) {
event.drops.add(new ItemStack(ModItems.glass_shard));
if (random.nextInt() + 5 < 8)
{
if (random.nextInt() + 5 < 8) {
event.drops.add(new ItemStack(ModItems.glass_shard));
}
event.dropChance = 0.25F;
if (BloodArsenalConfig.isGlassDangerous && random.nextInt(5) > 3)
{
player.addPotionEffect(new PotionEffect(BloodArsenal.bleeding.id, 4 * 20, random.nextInt(2)));
if (BloodArsenalConfig.isGlassDangerous && random.nextInt(5) > 3) {
player.addPotionEffect(
new PotionEffect(BloodArsenal.bleeding.id, 4 * 20, random.nextInt(2)));
}
}
else
{
if (BloodArsenalConfig.isGlassDangerous && random.nextInt(3) == 2)
{
player.addPotionEffect(new PotionEffect(BloodArsenal.bleeding.id, 8 * 20, random.nextInt(3)));
} else {
if (BloodArsenalConfig.isGlassDangerous && random.nextInt(3) == 2) {
player.addPotionEffect(
new PotionEffect(BloodArsenal.bleeding.id, 8 * 20, random.nextInt(3)));
}
}
}
@@ -229,10 +194,8 @@ public class BloodArsenalEventHooks
}
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.modID.equals(BloodArsenal.MODID))
{
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
if (event.modID.equals(BloodArsenal.MODID)) {
BloodArsenalConfig.syncConfig();
BloodArsenal.logger.info("Refreshing configuration file");
}
@@ -13,40 +13,68 @@ import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
public class BloodArsenalRecipes
{
public static void registerAltarRecipes()
{
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModBlocks.blood_tnt), new ItemStack(Blocks.tnt), 3, 10000, 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), 3, 54000, 5, 5, false);
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.item_blood_cake), new ItemStack(Items.cake), 3, 10000, 5, 5, false);
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_iron), new ItemStack(Items.iron_ingot), 3, 6000, 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, 80000, 5, 5, false);
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.soul_fragment), new ItemStack(ModItems.heart), 4, 75000, 5, 5, false);
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_cookie), new ItemStack(Items.cookie), 1, 2000, 5, 5, false);
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_infused_glowstone_dust), new ItemStack(Items.glowstone_dust), 3, 5000, 5, 5, false);
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_money), new ItemStack(Items.paper), 3, 10000, 5, 5, false);
public class BloodArsenalRecipes {
public static void registerAltarRecipes() {
AltarRecipeRegistry.registerAltarRecipe(
new ItemStack(ModBlocks.blood_tnt), new ItemStack(Blocks.tnt), 3, 10000, 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),
3,
54000,
5,
5,
false);
AltarRecipeRegistry.registerAltarRecipe(
new ItemStack(ModItems.item_blood_cake), new ItemStack(Items.cake), 3, 10000, 5, 5, false);
AltarRecipeRegistry.registerAltarRecipe(
new ItemStack(ModItems.blood_infused_iron), new ItemStack(Items.iron_ingot), 3, 6000, 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,
80000,
5,
5,
false);
AltarRecipeRegistry.registerAltarRecipe(
new ItemStack(ModItems.soul_fragment), new ItemStack(ModItems.heart), 4, 75000, 5, 5, false);
AltarRecipeRegistry.registerAltarRecipe(
new ItemStack(ModItems.blood_cookie), new ItemStack(Items.cookie), 1, 2000, 5, 5, false);
AltarRecipeRegistry.registerAltarRecipe(
new ItemStack(ModItems.blood_infused_glowstone_dust),
new ItemStack(Items.glowstone_dust),
3,
5000,
5,
5,
false);
AltarRecipeRegistry.registerAltarRecipe(
new ItemStack(ModItems.blood_money), new ItemStack(Items.paper), 3, 10000, 5, 5, false);
}
public static void registerBindingRecipes()
{
public static void registerBindingRecipes() {
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_bow), new ItemStack(Items.bow));
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_sickle), new ItemStack(Items.diamond_hoe));
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_shears), new ItemStack(Items.shears));
BindingRegistry.registerRecipe(new ItemStack(ModItems.blood_infused_diamond_bound), new ItemStack(ModItems.blood_infused_diamond_active));
BindingRegistry.registerRecipe(
new ItemStack(ModItems.blood_infused_diamond_bound),
new ItemStack(ModItems.blood_infused_diamond_active));
BindingRegistry.registerRecipe(new ItemStack(ModItems.bound_igniter), new ItemStack(Items.flint_and_steel));
if (BloodArsenal.isHalloween())
{
BindingRegistry.registerRecipe(new ItemStack(ModItems.vampire_cape), new ItemStack(Items.leather_chestplate));
BindingRegistry.registerRecipe(new ItemStack(ModItems.vampire_greaves), new ItemStack(Items.leather_leggings));
if (BloodArsenal.isHalloween()) {
BindingRegistry.registerRecipe(
new ItemStack(ModItems.vampire_cape), new ItemStack(Items.leather_chestplate));
BindingRegistry.registerRecipe(
new ItemStack(ModItems.vampire_greaves), new ItemStack(Items.leather_leggings));
BindingRegistry.registerRecipe(new ItemStack(ModItems.vampire_boots), new ItemStack(Items.leather_boots));
}
}
public static void registerRecipes()
{
public static void registerRecipes() {
int craftingConstant = OreDictionary.WILDCARD_VALUE;
ItemStack blankSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.blankSlate);
@@ -55,110 +83,634 @@ public class BloodArsenalRecipes
ItemStack demonicSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.demonicSlate);
ItemStack etherealSlate = new ItemStack(WayofTime.alchemicalWizardry.ModItems.baseItems, 1, 27);
ItemStack weakOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.weakBloodOrb, 1, craftingConstant);
ItemStack apprenticeOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.apprenticeBloodOrb, 1, craftingConstant);
ItemStack magicianOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.magicianBloodOrb, 1, craftingConstant);
ItemStack apprenticeOrb =
new ItemStack(WayofTime.alchemicalWizardry.ModItems.apprenticeBloodOrb, 1, craftingConstant);
ItemStack magicianOrb =
new ItemStack(WayofTime.alchemicalWizardry.ModItems.magicianBloodOrb, 1, craftingConstant);
ItemStack masterOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.masterBloodOrb, 1, craftingConstant);
ItemStack archmageOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.archmageBloodOrb, 1, craftingConstant);
ItemStack transcendentOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.transcendentBloodOrb, 1, craftingConstant);
ItemStack archmageOrb =
new ItemStack(WayofTime.alchemicalWizardry.ModItems.archmageBloodOrb, 1, craftingConstant);
ItemStack transcendentOrb =
new ItemStack(WayofTime.alchemicalWizardry.ModItems.transcendentBloodOrb, 1, craftingConstant);
addOreDictBloodOrbRecipe(new ItemStack(ModBlocks.blood_stained_ice, 8), "aaa", "aba", "aaa", 'a', Blocks.ice, 'b', apprenticeOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModBlocks.blood_stained_glass, 8), "aaa", "aba", "aaa", 'a', Blocks.glass, 'b', apprenticeOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModBlocks.life_infuser), "aba", "aca", "ada", 'a', ModItems.blood_infused_iron, 'b', magicianOrb, 'c', WayofTime.alchemicalWizardry.ModBlocks.blockAltar, 'd', Items.bucket);
addOreDictBloodOrbRecipe(new ItemStack(ModBlocks.lp_materializer), "aba", "bcb", "aba", 'a', ModItems.blood_infused_iron, 'b', imbuedSlate, 'c', magicianOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModBlocks.compacter), "aaa", "bcb", "ded", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_diamond_bound, 'c', Blocks.piston, 'd', ModBlocks.blood_infused_iron_block, 'e', archmageOrb);
addOreDictBloodOrbRecipe(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);
addOreDictBloodOrbRecipe(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);
addOreDictBloodOrbRecipe(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);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.blood_infused_sword_iron), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_iron, 'b', ModItems.blood_infused_sword_wood, 'c', ModItems.amorphic_catalyst, 'd', magicianOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.blood_diamond), "aba", "bcb", "aba", 'a', Blocks.glass, 'b', Items.diamond, 'c', masterOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.blood_infused_diamond_unactive), "aba", "bcb", "ada", 'a', ModItems.amorphic_catalyst, 'b', ModBlocks.blood_infused_iron_block, 'c', ModItems.blood_diamond, 'd', masterOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.blood_infused_axe_diamond), "aaa", "aba", "cdc", 'a', ModItems.blood_infused_diamond_bound, 'b', ModItems.blood_infused_axe_iron, 'c', ModItems.amorphic_catalyst, 'd', masterOrb);
addOreDictBloodOrbRecipe(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);
addOreDictBloodOrbRecipe(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);
addOreDictBloodOrbRecipe(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);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.soul_booster), "aaa", "aba", "aca", 'a', ModItems.soul_fragment, 'b', Blocks.beacon, 'c', magicianOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.soul_nullifier), "aaa", "aba", "aca", 'a', ModItems.soul_fragment, 'b', WayofTime.alchemicalWizardry.ModItems.armourInhibitor, 'c', magicianOrb);
addOreDictBloodOrbRecipe(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);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.sigil_of_ender), "aba", "cdc", "efe", 'a', Blocks.obsidian, 'b', Items.ender_eye, 'c', Items.ender_pearl, 'd', imbuedSlate, 'e', Blocks.ender_chest, 'f', magicianOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.sigil_of_divinity), "aba", "cde", "fgf", 'a', ModBlocks.blood_infused_glowstone, 'b', new ItemStack(Items.golden_apple, 1, 1), 'c', Items.nether_star, 'd', WayofTime.alchemicalWizardry.ModItems.sigilOfElementalAffinity, 'e', ModItems.blood_infused_diamond_bound, 'f', ModItems.amorphic_catalyst, 'g', transcendentOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.blood_burned_string, 4), "aaa", "aba", "aaa", 'a', Items.string, 'b', weakOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.sigil_of_augmented_holding), "aba", "cde", "fgf", 'a', demonicSlate, 'b', masterOrb, 'c', Items.blaze_rod, 'd', WayofTime.alchemicalWizardry.ModItems.sigilOfHolding, 'e', Items.ghast_tear, 'f', ModItems.blood_infused_iron, 'g', Blocks.chest);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.sigil_of_lightning), "aba", "cdc", "efg", 'a', new ItemStack(ModBlocks.blood_stone, 1, 3), 'b', Blocks.iron_block, 'c', ModBlocks.blood_infused_iron_block, 'd', etherealSlate, 'e', Items.nether_star, 'f', archmageOrb, 'g', ModItems.blood_infused_diamond_bound);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.glass_sacrificial_dagger), "aaa", "aba", "cdc", 'a', ModItems.glass_shard, 'b', WayofTime.alchemicalWizardry.ModItems.sacrificialDagger, 'c', ModItems.blood_infused_iron, 'd', magicianOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.glass_dagger_of_sacrifice), "aaa", "aba", "cdc", 'a', ModItems.glass_shard, 'b', WayofTime.alchemicalWizardry.ModItems.daggerOfSacrifice, 'c', ModItems.blood_infused_iron, 'd', magicianOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.glass_helmet), "aaa", "aba", 'a', ModItems.glass_shard, 'b', apprenticeOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.glass_chestplate), "aba", "aaa", "aaa", 'a', ModItems.glass_shard, 'b', apprenticeOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.glass_leggings), "aaa", "aba", "a a", 'a', ModItems.glass_shard, 'b', apprenticeOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.glass_boots), "a a", "aba", 'a', ModItems.glass_shard, 'b', apprenticeOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.transparent_orb), "aba", "bcb", "ded", 'a', ModBlocks.blood_stained_glass, 'b', Blocks.glass, 'c', transcendentOrb, 'd', ModItems.blood_burned_string, 'e', WayofTime.alchemicalWizardry.ModItems.divinationSigil);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.life_imbued_helmet), "aba", "aca", 'a', ModItems.blood_infused_iron, 'b', magicianOrb, 'c', Items.iron_helmet);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.life_imbued_chestplate), "aba", "aca", "aaa", 'a', ModItems.blood_infused_iron, 'b', magicianOrb, 'c', Items.iron_chestplate);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.life_imbued_leggings), "aba", "aca", "a a", 'a', ModItems.blood_infused_iron, 'b', magicianOrb, 'c', Items.iron_leggings);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.life_imbued_boots), "aba", "aca", 'a', ModItems.blood_infused_iron, 'b', magicianOrb, 'c', Items.iron_boots);
addOreDictBloodOrbRecipe(
new ItemStack(ModBlocks.blood_stained_ice, 8),
"aaa",
"aba",
"aaa",
'a',
Blocks.ice,
'b',
apprenticeOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModBlocks.blood_stained_glass, 8),
"aaa",
"aba",
"aaa",
'a',
Blocks.glass,
'b',
apprenticeOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModBlocks.life_infuser),
"aba",
"aca",
"ada",
'a',
ModItems.blood_infused_iron,
'b',
magicianOrb,
'c',
WayofTime.alchemicalWizardry.ModBlocks.blockAltar,
'd',
Items.bucket);
addOreDictBloodOrbRecipe(
new ItemStack(ModBlocks.lp_materializer),
"aba",
"bcb",
"aba",
'a',
ModItems.blood_infused_iron,
'b',
imbuedSlate,
'c',
magicianOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModBlocks.compacter),
"aaa",
"bcb",
"ded",
'a',
ModBlocks.blood_infused_planks,
'b',
ModItems.blood_infused_diamond_bound,
'c',
Blocks.piston,
'd',
ModBlocks.blood_infused_iron_block,
'e',
archmageOrb);
addOreDictBloodOrbRecipe(
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);
addOreDictBloodOrbRecipe(
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);
addOreDictBloodOrbRecipe(
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);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.blood_infused_sword_iron),
"aaa",
"aba",
"cdc",
'a',
ModItems.blood_infused_iron,
'b',
ModItems.blood_infused_sword_wood,
'c',
ModItems.amorphic_catalyst,
'd',
magicianOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.blood_diamond),
"aba",
"bcb",
"aba",
'a',
Blocks.glass,
'b',
Items.diamond,
'c',
masterOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.blood_infused_diamond_unactive),
"aba",
"bcb",
"ada",
'a',
ModItems.amorphic_catalyst,
'b',
ModBlocks.blood_infused_iron_block,
'c',
ModItems.blood_diamond,
'd',
masterOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.blood_infused_axe_diamond),
"aaa",
"aba",
"cdc",
'a',
ModItems.blood_infused_diamond_bound,
'b',
ModItems.blood_infused_axe_iron,
'c',
ModItems.amorphic_catalyst,
'd',
masterOrb);
addOreDictBloodOrbRecipe(
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);
addOreDictBloodOrbRecipe(
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);
addOreDictBloodOrbRecipe(
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);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.soul_booster),
"aaa",
"aba",
"aca",
'a',
ModItems.soul_fragment,
'b',
Blocks.beacon,
'c',
magicianOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.soul_nullifier),
"aaa",
"aba",
"aca",
'a',
ModItems.soul_fragment,
'b',
WayofTime.alchemicalWizardry.ModItems.armourInhibitor,
'c',
magicianOrb);
addOreDictBloodOrbRecipe(
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);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.sigil_of_ender),
"aba",
"cdc",
"efe",
'a',
Blocks.obsidian,
'b',
Items.ender_eye,
'c',
Items.ender_pearl,
'd',
imbuedSlate,
'e',
Blocks.ender_chest,
'f',
magicianOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.sigil_of_divinity),
"aba",
"cde",
"fgf",
'a',
ModBlocks.blood_infused_glowstone,
'b',
new ItemStack(Items.golden_apple, 1, 1),
'c',
Items.nether_star,
'd',
WayofTime.alchemicalWizardry.ModItems.sigilOfElementalAffinity,
'e',
ModItems.blood_infused_diamond_bound,
'f',
ModItems.amorphic_catalyst,
'g',
transcendentOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.blood_burned_string, 4), "aaa", "aba", "aaa", 'a', Items.string, 'b', weakOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.sigil_of_augmented_holding),
"aba",
"cde",
"fgf",
'a',
demonicSlate,
'b',
masterOrb,
'c',
Items.blaze_rod,
'd',
WayofTime.alchemicalWizardry.ModItems.sigilOfHolding,
'e',
Items.ghast_tear,
'f',
ModItems.blood_infused_iron,
'g',
Blocks.chest);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.sigil_of_lightning),
"aba",
"cdc",
"efg",
'a',
new ItemStack(ModBlocks.blood_stone, 1, 3),
'b',
Blocks.iron_block,
'c',
ModBlocks.blood_infused_iron_block,
'd',
etherealSlate,
'e',
Items.nether_star,
'f',
archmageOrb,
'g',
ModItems.blood_infused_diamond_bound);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.glass_sacrificial_dagger),
"aaa",
"aba",
"cdc",
'a',
ModItems.glass_shard,
'b',
WayofTime.alchemicalWizardry.ModItems.sacrificialDagger,
'c',
ModItems.blood_infused_iron,
'd',
magicianOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.glass_dagger_of_sacrifice),
"aaa",
"aba",
"cdc",
'a',
ModItems.glass_shard,
'b',
WayofTime.alchemicalWizardry.ModItems.daggerOfSacrifice,
'c',
ModItems.blood_infused_iron,
'd',
magicianOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.glass_helmet), "aaa", "aba", 'a', ModItems.glass_shard, 'b', apprenticeOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.glass_chestplate),
"aba",
"aaa",
"aaa",
'a',
ModItems.glass_shard,
'b',
apprenticeOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.glass_leggings),
"aaa",
"aba",
"a a",
'a',
ModItems.glass_shard,
'b',
apprenticeOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.glass_boots), "a a", "aba", 'a', ModItems.glass_shard, 'b', apprenticeOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.transparent_orb),
"aba",
"bcb",
"ded",
'a',
ModBlocks.blood_stained_glass,
'b',
Blocks.glass,
'c',
transcendentOrb,
'd',
ModItems.blood_burned_string,
'e',
WayofTime.alchemicalWizardry.ModItems.divinationSigil);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.life_imbued_helmet),
"aba",
"aca",
'a',
ModItems.blood_infused_iron,
'b',
magicianOrb,
'c',
Items.iron_helmet);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.life_imbued_chestplate),
"aba",
"aca",
"aaa",
'a',
ModItems.blood_infused_iron,
'b',
magicianOrb,
'c',
Items.iron_chestplate);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.life_imbued_leggings),
"aba",
"aca",
"a a",
'a',
ModItems.blood_infused_iron,
'b',
magicianOrb,
'c',
Items.iron_leggings);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.life_imbued_boots),
"aba",
"aca",
'a',
ModItems.blood_infused_iron,
'b',
magicianOrb,
'c',
Items.iron_boots);
addOreDictRecipe(new ItemStack(ModBlocks.blood_stone), "aaa", "aaa", "aaa", 'a', blankSlate);
addOreDictRecipe(new ItemStack(ModBlocks.blood_stone, 1, 1), "aaa", "aaa", "aaa", 'a', reinforcedSlate);
addOreDictRecipe(new ItemStack(ModBlocks.blood_stone, 1, 2), "aaa", "aaa", "aaa", 'a', imbuedSlate);
addOreDictRecipe(new ItemStack(ModBlocks.blood_stone, 1, 3), "aaa", "aaa", "aaa", 'a', demonicSlate);
addOreDictRecipe(new ItemStack(ModBlocks.blood_stone, 1, 4), "aaa", "aaa", "aaa", 'a', etherealSlate);
addOreDictRecipe(new ItemStack(ModBlocks.blood_infused_iron_block), "aaa", "aaa", "aaa", 'a', ModItems.blood_infused_iron);
addOreDictRecipe(new ItemStack(ModBlocks.blood_stained_ice_packed), "aa", "aa", 'a', ModBlocks.blood_stained_ice);
addOreDictRecipe(new ItemStack(ModBlocks.blood_infused_glowstone), "aa", "aa", 'a', ModItems.blood_infused_glowstone_dust);
addOreDictRecipe(new ItemStack(ModBlocks.blood_lamp), "aba", "bcb", "aba", 'a', ModItems.blood_infused_iron, 'b', ModBlocks.blood_stained_glass, 'c', ModBlocks.blood_infused_glowstone);
addOreDictRecipe(new ItemStack(ModBlocks.blood_infused_diamond_block), "aaa", "aaa", "aaa", 'a', ModItems.blood_infused_diamond_bound);
addOreDictRecipe(new ItemStack(ModBlocks.blood_torch), "a", "b", 'a', ModItems.bound_igniter, 'b', ModItems.blood_infused_stick);
addOreDictRecipe(
new ItemStack(ModBlocks.blood_infused_iron_block),
"aaa",
"aaa",
"aaa",
'a',
ModItems.blood_infused_iron);
addOreDictRecipe(
new ItemStack(ModBlocks.blood_stained_ice_packed), "aa", "aa", 'a', ModBlocks.blood_stained_ice);
addOreDictRecipe(
new ItemStack(ModBlocks.blood_infused_glowstone),
"aa",
"aa",
'a',
ModItems.blood_infused_glowstone_dust);
addOreDictRecipe(
new ItemStack(ModBlocks.blood_lamp),
"aba",
"bcb",
"aba",
'a',
ModItems.blood_infused_iron,
'b',
ModBlocks.blood_stained_glass,
'c',
ModBlocks.blood_infused_glowstone);
addOreDictRecipe(
new ItemStack(ModBlocks.blood_infused_diamond_block),
"aaa",
"aaa",
"aaa",
'a',
ModItems.blood_infused_diamond_bound);
addOreDictRecipe(
new ItemStack(ModBlocks.blood_torch),
"a",
"b",
'a',
ModItems.bound_igniter,
'b',
ModItems.blood_infused_stick);
addOreDictRecipe(new ItemStack(ModItems.blood_infused_stick), "a", "a", 'a', ModBlocks.blood_infused_planks);
addOreDictRecipe(new ItemStack(ModItems.blood_infused_pickaxe_wood), "aaa", " b ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
addOreDictRecipe(new ItemStack(ModItems.blood_infused_axe_wood), "aa ", "ab ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
addOreDictRecipe(new ItemStack(ModItems.blood_infused_shovel_wood), " a ", " b ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
addOreDictRecipe(new ItemStack(ModItems.blood_infused_sword_wood), " a ", " a ", " b ", 'a', ModBlocks.blood_infused_planks, 'b', ModItems.blood_infused_stick);
addOreDictRecipe(new ItemStack(ModItems.blood_money, 1, 1), "aa", "aa", 'a', new ItemStack(ModItems.blood_money));
addOreDictRecipe(new ItemStack(ModItems.blood_money, 1, 2), "aa", "aa", 'a', new ItemStack(ModItems.blood_money, 1, 1));
addOreDictRecipe(new ItemStack(ModItems.blood_money, 1, 3), "aa", "aa", 'a', new ItemStack(ModItems.blood_money, 1, 2));
addOreDictRecipe(
new ItemStack(ModItems.blood_infused_pickaxe_wood),
"aaa",
" b ",
" b ",
'a',
ModBlocks.blood_infused_planks,
'b',
ModItems.blood_infused_stick);
addOreDictRecipe(
new ItemStack(ModItems.blood_infused_axe_wood),
"aa ",
"ab ",
" b ",
'a',
ModBlocks.blood_infused_planks,
'b',
ModItems.blood_infused_stick);
addOreDictRecipe(
new ItemStack(ModItems.blood_infused_shovel_wood),
" a ",
" b ",
" b ",
'a',
ModBlocks.blood_infused_planks,
'b',
ModItems.blood_infused_stick);
addOreDictRecipe(
new ItemStack(ModItems.blood_infused_sword_wood),
" a ",
" a ",
" b ",
'a',
ModBlocks.blood_infused_planks,
'b',
ModItems.blood_infused_stick);
addOreDictRecipe(
new ItemStack(ModItems.blood_money, 1, 1), "aa", "aa", 'a', new ItemStack(ModItems.blood_money));
addOreDictRecipe(
new ItemStack(ModItems.blood_money, 1, 2), "aa", "aa", 'a', new ItemStack(ModItems.blood_money, 1, 1));
addOreDictRecipe(
new ItemStack(ModItems.blood_money, 1, 3), "aa", "aa", 'a', new ItemStack(ModItems.blood_money, 1, 2));
addShapelessOreDictRecipe(new ItemStack(ModBlocks.blood_infused_planks, 4), ModBlocks.blood_infused_wood);
addShapelessOreDictRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.blankSlate, 9), ModBlocks.blood_stone);
addShapelessOreDictRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.reinforcedSlate, 9), new ItemStack(ModBlocks.blood_stone, 1, 1));
addShapelessOreDictRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.imbuedSlate, 9), new ItemStack(ModBlocks.blood_stone, 1, 2));
addShapelessOreDictRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.demonicSlate, 9), new ItemStack(ModBlocks.blood_stone, 1, 3));
addShapelessOreDictRecipe(new ItemStack(WayofTime.alchemicalWizardry.ModItems.baseAlchemyItems, 9, 27), new ItemStack(ModBlocks.blood_stone, 1, 4));
//This is a long one
addShapelessOreDictRecipe(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);
addShapelessOreDictRecipe(
new ItemStack(WayofTime.alchemicalWizardry.ModItems.blankSlate, 9), ModBlocks.blood_stone);
addShapelessOreDictRecipe(
new ItemStack(WayofTime.alchemicalWizardry.ModItems.reinforcedSlate, 9),
new ItemStack(ModBlocks.blood_stone, 1, 1));
addShapelessOreDictRecipe(
new ItemStack(WayofTime.alchemicalWizardry.ModItems.imbuedSlate, 9),
new ItemStack(ModBlocks.blood_stone, 1, 2));
addShapelessOreDictRecipe(
new ItemStack(WayofTime.alchemicalWizardry.ModItems.demonicSlate, 9),
new ItemStack(ModBlocks.blood_stone, 1, 3));
addShapelessOreDictRecipe(
new ItemStack(WayofTime.alchemicalWizardry.ModItems.baseAlchemyItems, 9, 27),
new ItemStack(ModBlocks.blood_stone, 1, 4));
// This is a long one
addShapelessOreDictRecipe(
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);
addShapelessOreDictRecipe(new ItemStack(ModItems.blood_infused_iron, 9), ModBlocks.blood_infused_iron_block);
addShapelessOreDictRecipe(new ItemStack(ModItems.orange_juice), ModItems.blood_orange, Items.glass_bottle);
addShapelessOreDictRecipe(new ItemStack(ModItems.juice_and_cookies), Items.cookie, ModItems.orange_juice);
}
public static void addBaublesRecipe()
{
public static void addBaublesRecipe() {
int craftingConstant = OreDictionary.WILDCARD_VALUE;
ItemStack weakOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.weakBloodOrb, 1, craftingConstant);
// ItemStack apprenticeOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.apprenticeBloodOrb, 1, craftingConstant);
// ItemStack magicianOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.magicianBloodOrb, 1, craftingConstant);
// ItemStack apprenticeOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.apprenticeBloodOrb, 1,
// craftingConstant);
// ItemStack magicianOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.magicianBloodOrb, 1,
// craftingConstant);
ItemStack masterOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.masterBloodOrb, 1, craftingConstant);
// ItemStack archmageOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.archmageBloodOrb, 1, craftingConstant);
// ItemStack transcendentOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.transcendentBloodOrb, 1, craftingConstant);
// ItemStack archmageOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.archmageBloodOrb, 1,
// craftingConstant);
// ItemStack transcendentOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.transcendentBloodOrb,
// 1, craftingConstant);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.vampire_ring), "ab ", "bcb", " b ", 'a', ModItems.blood_infused_diamond_bound, 'b', Blocks.stone, 'c', masterOrb);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.sacrifice_amulet), "aaa", "aba", "caa", 'a', ModItems.blood_burned_string, 'b', weakOrb, 'c', Items.gold_ingot);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.self_sacrifice_amulet), "aaa", "aba", "caa", 'a', ModItems.blood_burned_string, 'b', weakOrb, 'c', Items.glowstone_dust);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.empowered_self_sacrifice_amulet), "aba", "cdc", "ecf", 'a', ModItems.blood_infused_glowstone_dust, 'b', Items.blaze_rod, 'c', WayofTime.alchemicalWizardry.ModBlocks.runeOfSelfSacrifice, 'd', ModItems.self_sacrifice_amulet, 'e', Blocks.glowstone, 'f', ModItems.amorphic_catalyst);
addOreDictBloodOrbRecipe(new ItemStack(ModItems.empowered_sacrifice_amulet), "aba", "cdc", "ecf", 'a', ModItems.blood_infused_glowstone_dust, 'b', Items.blaze_rod, 'c', WayofTime.alchemicalWizardry.ModBlocks.runeOfSacrifice, 'd', ModItems.sacrifice_amulet, 'e', Blocks.gold_block, 'f', ModItems.amorphic_catalyst);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.vampire_ring),
"ab ",
"bcb",
" b ",
'a',
ModItems.blood_infused_diamond_bound,
'b',
Blocks.stone,
'c',
masterOrb);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.sacrifice_amulet),
"aaa",
"aba",
"caa",
'a',
ModItems.blood_burned_string,
'b',
weakOrb,
'c',
Items.gold_ingot);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.self_sacrifice_amulet),
"aaa",
"aba",
"caa",
'a',
ModItems.blood_burned_string,
'b',
weakOrb,
'c',
Items.glowstone_dust);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.empowered_self_sacrifice_amulet),
"aba",
"cdc",
"ecf",
'a',
ModItems.blood_infused_glowstone_dust,
'b',
Items.blaze_rod,
'c',
WayofTime.alchemicalWizardry.ModBlocks.runeOfSelfSacrifice,
'd',
ModItems.self_sacrifice_amulet,
'e',
Blocks.glowstone,
'f',
ModItems.amorphic_catalyst);
addOreDictBloodOrbRecipe(
new ItemStack(ModItems.empowered_sacrifice_amulet),
"aba",
"cdc",
"ecf",
'a',
ModItems.blood_infused_glowstone_dust,
'b',
Items.blaze_rod,
'c',
WayofTime.alchemicalWizardry.ModBlocks.runeOfSacrifice,
'd',
ModItems.sacrifice_amulet,
'e',
Blocks.gold_block,
'f',
ModItems.amorphic_catalyst);
}
public static void addOreDictRecipe(ItemStack output, Object... recipe)
{
public static void addOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(output, recipe));
}
public static void addOreDictBloodOrbRecipe(ItemStack output, Object... recipe)
{
public static void addOreDictBloodOrbRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapedBloodOrbRecipe(output, recipe));
}
public static void addShapelessOreDictRecipe(ItemStack output, Object... recipe)
{
public static void addShapelessOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(output, recipe));
}
}
@@ -5,37 +5,32 @@ import com.arc.bloodarsenal.common.tinkers.IClientCode;
import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraft.world.World;
public class CommonProxy
{
public void init()
{
//registerEntityTrackers();
public class CommonProxy {
public void init() {
// registerEntityTrackers();
}
public void registerRenders()
{
//Absolutely nothing
public void registerRenders() {
// Absolutely nothing
}
public void registerEvents()
{
}
public void registerEvents() {}
public World getClientWorld()
{
public World getClientWorld() {
return null;
}
public static void registerEntityTrackers() {
int entityID = EntityRegistry.findGlobalUniqueEntityId();
EntityRegistry.registerGlobalEntityID(EntityBloodTNT.class, "bloodTNT", entityID);
EntityRegistry.registerModEntity(EntityBloodTNT.class, "bloodTNT", entityID, BloodArsenal.instance, 64, 100, true);
// EntityRegistry.registerModEntity(EntityBloodHound.class, "BloodHound", 3, BloodArsenal.instance, 96, 3, true);
EntityRegistry.registerModEntity(
EntityBloodTNT.class, "bloodTNT", entityID, BloodArsenal.instance, 64, 100, true);
// EntityRegistry.registerModEntity(EntityBloodHound.class, "BloodHound", 3, BloodArsenal.instance, 96,
// 3, true);
}
public void initRendering()
{
//TODO Auto-generated stub
public void initRendering() {
// TODO Auto-generated stub
}
public void executeClientCode(IClientCode clientCode) {}
@@ -6,6 +6,7 @@ import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -19,25 +20,22 @@ import squeek.applecore.api.food.FoodValues;
import squeek.applecore.api.food.IEdibleBlock;
import squeek.applecore.api.food.ItemFoodProxy;
import java.util.Random;
@Optional.Interface(iface = "squeek.applecore.api.food.IEdibleBlock", modid = "AppleCore")
public class BlockBloodCake extends Block implements IEdibleBlock
{
public class BlockBloodCake extends Block implements IEdibleBlock {
private boolean isEdibleAtMaxHunger = false;
@SideOnly(Side.CLIENT)
private IIcon cakeTop;
@SideOnly(Side.CLIENT)
private IIcon cakeBottom;
public BlockBloodCake()
{
public BlockBloodCake() {
super(Material.cake);
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
{
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
int l = world.getBlockMetadata(x, y, z);
float f = 0.0625F;
float f1 = (float) (1 + l) / 12.0F;
@@ -45,170 +43,151 @@ public class BlockBloodCake extends Block implements IEdibleBlock
}
@Override
public void setBlockBoundsForItemRender()
{
public void setBlockBoundsForItemRender() {
float f = 0.0625F;
float f1 = 0.5F;
this.setBlockBounds(f, 0.0F, f, 1.0F - f, f1, 1.0F - f);
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
{
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
int l = world.getBlockMetadata(x, y, z);
float f = 0.0625F;
float f1 = (float) (1 + l) / 12.0F;
float f2 = 0.5F;
return AxisAlignedBB.getBoundingBox((double)((float)x + f1), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)y + f2 - f), (double)((float)(z + 1) - f));
return AxisAlignedBB.getBoundingBox(
(double) ((float) x + f1),
(double) y,
(double) ((float) z + f),
(double) ((float) (x + 1) - f),
(double) ((float) y + f2 - f),
(double) ((float) (z + 1) - f));
}
@Override
public boolean renderAsNormalBlock()
{
public boolean renderAsNormalBlock() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z)
{
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
int l = world.getBlockMetadata(x, y, z);
float f = 0.0625F;
float f1 = (float) (1 + l) / 12.0F;
float f2 = 0.5F;
return AxisAlignedBB.getBoundingBox((double)((float)x + f1), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)y + f2), (double)((float)(z + 1) - f));
return AxisAlignedBB.getBoundingBox(
(double) ((float) x + f1),
(double) y,
(double) ((float) z + f),
(double) ((float) (x + 1) - f),
(double) ((float) y + f2),
(double) ((float) (z + 1) - f));
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int x)
{
public IIcon getIcon(int par1, int x) {
return par1 == 1 ? cakeTop : (par1 == 0 ? cakeBottom : (x > 0 && par1 == 4 ? null : blockIcon));
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_cake_side");
cakeTop = iconRegister.registerIcon("BloodArsenal:blood_cake_top");
cakeBottom = iconRegister.registerIcon("BloodArsenal:blood_cake_bottom");
}
@Override
public boolean isOpaqueCube()
{
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
eatCake(player);
return true;
}
@Override
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player)
{
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {
eatCake(player);
}
public void eatCake(EntityPlayer player)
{
public void eatCake(EntityPlayer player) {
String playerEating = player.getCommandSenderName();
if (player.canEat(isEdibleAtMaxHunger))
{
if (Loader.isModLoaded("AppleCore"))
{
if (player.canEat(isEdibleAtMaxHunger)) {
if (Loader.isModLoaded("AppleCore")) {
onEatenCompatibility(new ItemStack(this), player);
}
else
{
} else {
player.getFoodStats().addStats(2, 1.5F);
}
SoulNetworkHandler.syphonFromNetwork(playerEating, 200);
if (BloodArsenalConfig.cakeIsLie)
{
if (BloodArsenalConfig.cakeIsLie) {
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.cake.lie")));
}
else
{
} else {
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.cake.eating")));
}
}
else if (player.canEat(true))
{
if (BloodArsenalConfig.cakeIsLie)
{
} else if (player.canEat(true)) {
if (BloodArsenalConfig.cakeIsLie) {
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.cake.lie")));
}
else
{
} else {
player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.cake.tooFull")));
}
}
}
@Override
public boolean canPlaceBlockAt(World world, int x, int y, int z)
{
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
return super.canPlaceBlockAt(world, x, y, z) && canBlockStay(world, x, y, z);
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
if (!this.canBlockStay(world, x, y, z))
{
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
if (!this.canBlockStay(world, x, y, z)) {
world.setBlockToAir(x, y, z);
}
}
@Override
public boolean canBlockStay(World world, int x, int y, int z)
{
public boolean canBlockStay(World world, int x, int y, int z) {
return world.getBlock(x, y - 1, z).getMaterial().isSolid();
}
@Override
public int quantityDropped(Random par1Random)
{
public int quantityDropped(Random par1Random) {
return 0;
}
@Override
public Item getItem(World world, int x, int y, int z)
{
public Item getItem(World world, int x, int y, int z) {
return null;
}
@Override
@SideOnly(Side.CLIENT)
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
return new ItemStack(this);
}
// === AppleCore methods ===
@Override
public void setEdibleAtMaxHunger(boolean edibleAtMaxHunger)
{
public void setEdibleAtMaxHunger(boolean edibleAtMaxHunger) {
isEdibleAtMaxHunger = edibleAtMaxHunger;
}
@Override
public FoodValues getFoodValues(ItemStack itemStack)
{
public FoodValues getFoodValues(ItemStack itemStack) {
return new FoodValues(2, 1.5f);
}
@Optional.Method(modid = "AppleCore")
public void onEatenCompatibility(ItemStack itemStack, EntityPlayer player)
{
public void onEatenCompatibility(ItemStack itemStack, EntityPlayer player) {
player.getFoodStats().func_151686_a(new ItemFoodProxy(this), itemStack);
}
}
@@ -4,10 +4,8 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
public class BlockBloodInfusedDiamond extends Block
{
public BlockBloodInfusedDiamond()
{
public class BlockBloodInfusedDiamond extends Block {
public BlockBloodInfusedDiamond() {
super(Material.iron);
setHardness(10.0F);
setResistance(12.0F);
@@ -15,8 +13,7 @@ public class BlockBloodInfusedDiamond extends Block
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
{
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
return true;
}
}
@@ -1,16 +1,13 @@
package com.arc.bloodarsenal.common.block;
import com.arc.bloodarsenal.common.items.ModItems;
import java.util.Random;
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()
{
public class BlockBloodInfusedGlowstone extends BlockGlowstone {
public BlockBloodInfusedGlowstone() {
super(Material.glass);
setHardness(0.5F);
setResistance(0.75F);
@@ -18,5 +15,7 @@ public class BlockBloodInfusedGlowstone extends BlockGlowstone
setLightLevel(1.0F);
}
public Item getItemDropped(int par1, Random random, int par3) {return ModItems.blood_infused_glowstone_dust;}
public Item getItemDropped(int par1, Random random, int par3) {
return ModItems.blood_infused_glowstone_dust;
}
}
@@ -3,10 +3,8 @@ package com.arc.bloodarsenal.common.block;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class BlockBloodInfusedPlanks extends Block
{
public BlockBloodInfusedPlanks()
{
public class BlockBloodInfusedPlanks extends Block {
public BlockBloodInfusedPlanks() {
super(Material.wood);
setHardness(3.0F);
setResistance(6.0F);
@@ -7,13 +7,11 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
public class BlockBloodInfusedWood extends BlockRotatedPillar
{
public class BlockBloodInfusedWood extends BlockRotatedPillar {
@SideOnly(Side.CLIENT)
private IIcon top;
public BlockBloodInfusedWood()
{
public BlockBloodInfusedWood() {
super(Material.wood);
setHardness(3.0F);
setResistance(6.0F);
@@ -21,20 +19,17 @@ public class BlockBloodInfusedWood extends BlockRotatedPillar
}
@SideOnly(Side.CLIENT)
public IIcon getSideIcon(int par1)
{
public IIcon getSideIcon(int par1) {
return blockIcon;
}
@SideOnly(Side.CLIENT)
public IIcon getTopIcon(int par1)
{
public IIcon getTopIcon(int par1) {
return top;
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_wood");
top = iconRegister.registerIcon("BloodArsenal:blood_infused_wood_top");
}
@@ -3,10 +3,8 @@ package com.arc.bloodarsenal.common.block;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class BlockBloodLamp extends Block
{
public BlockBloodLamp()
{
public class BlockBloodLamp extends Block {
public BlockBloodLamp() {
super(Material.iron);
setStepSound(soundTypePiston);
setHardness(5.0F);
@@ -2,16 +2,13 @@ package com.arc.bloodarsenal.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import java.util.Random;
public class BlockBloodStainedGlass extends BlockBreakable
{
public BlockBloodStainedGlass()
{
public class BlockBloodStainedGlass extends BlockBreakable {
public BlockBloodStainedGlass() {
super("blood_stained_glass", Material.glass, false);
setHardness(1.0F);
setResistance(4.0F);
@@ -20,27 +17,28 @@ public class BlockBloodStainedGlass extends BlockBreakable
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass()
{
public int getRenderBlockPass() {
return 1;
}
@Override
public boolean renderAsNormalBlock()
{
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int quantityDropped(Random par1Random) {return 0;}
public int quantityDropped(Random par1Random) {
return 0;
}
@Override
protected boolean canSilkHarvest() {return true;}
protected boolean canSilkHarvest() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_stained_glass");
}
}
@@ -2,6 +2,8 @@ package com.arc.bloodarsenal.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
@@ -16,13 +18,8 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory;
import java.util.ArrayList;
import java.util.Random;
public class BlockBloodStainedIce extends BlockBreakable
{
public BlockBloodStainedIce()
{
public class BlockBloodStainedIce extends BlockBreakable {
public BlockBloodStainedIce() {
super("blood_stained_ice", Material.ice, false);
slipperiness = 0.99F;
setTickRandomly(true);
@@ -34,39 +31,33 @@ public class BlockBloodStainedIce extends BlockBreakable
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass()
{
public int getRenderBlockPass() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, 1 - par5);
}
@Override
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
par2EntityPlayer.addExhaustion(0.025F);
if (canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
{
if (canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6)
&& EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) {
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
ItemStack itemstack = createStackedBlock(par6);
if (itemstack != null) items.add(itemstack);
ForgeEventFactory.fireBlockHarvesting(items, par1World, this, par3, par4, par5, par6, 0, 1.0f, true, par2EntityPlayer);
for (ItemStack is : items)
dropBlockAsItem(par1World, par3, par4, par5, is);
}
else
{
if (par1World.provider.isHellWorld)
{
ForgeEventFactory.fireBlockHarvesting(
items, par1World, this, par3, par4, par5, par6, 0, 1.0f, true, par2EntityPlayer);
for (ItemStack is : items) dropBlockAsItem(par1World, par3, par4, par5, is);
} else {
if (par1World.provider.isHellWorld) {
par1World.setBlockToAir(par3, par4, par5);
return;
}
@@ -77,26 +68,21 @@ public class BlockBloodStainedIce extends BlockBreakable
harvesters.set(null);
Material material = par1World.getBlock(par3, par4 - 1, par5).getMaterial();
if (material.blocksMovement() || material.isLiquid())
{
if (material.blocksMovement() || material.isLiquid()) {
par1World.setBlock(par3, par4, par5, Blocks.flowing_water);
}
}
}
@Override
public int quantityDropped(Random par1Random)
{
public int quantityDropped(Random par1Random) {
return 0;
}
@Override
public void updateTick(World par1World, int par2, int par3, int par4, Random par5)
{
if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11 - getLightOpacity())
{
if (par1World.provider.isHellWorld)
{
public void updateTick(World par1World, int par2, int par3, int par4, Random par5) {
if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11 - getLightOpacity()) {
if (par1World.provider.isHellWorld) {
par1World.setBlock(par2, par3, par4, Blocks.air);
return;
}
@@ -107,15 +93,13 @@ public class BlockBloodStainedIce extends BlockBreakable
}
@Override
public int getMobilityFlag()
{
public int getMobilityFlag() {
return 0;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_stained_ice");
}
}
@@ -1,14 +1,11 @@
package com.arc.bloodarsenal.common.block;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import java.util.Random;
public class BlockBloodStainedPackedIce extends Block
{
public BlockBloodStainedPackedIce()
{
public class BlockBloodStainedPackedIce extends Block {
public BlockBloodStainedPackedIce() {
super(Material.packedIce);
slipperiness = 0.99F;
setHardness(1.0F);
@@ -16,8 +13,7 @@ public class BlockBloodStainedPackedIce extends Block
setStepSound(soundTypeGlass);
}
public int quantityDropped(Random par1)
{
public int quantityDropped(Random par1) {
return 0;
}
}
@@ -2,6 +2,7 @@ package com.arc.bloodarsenal.common.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -10,18 +11,14 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import java.util.List;
public class BlockBloodStone extends Block
{
public class BlockBloodStone extends Block {
private IIcon blood_stone_1;
private IIcon blood_stone_2;
private IIcon blood_stone_3;
private IIcon blood_stone_4;
private IIcon blood_stone_5;
public BlockBloodStone()
{
public BlockBloodStone() {
super(Material.iron);
setHardness(2.0F);
setResistance(5.0F);
@@ -30,8 +27,7 @@ public class BlockBloodStone extends Block
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
blood_stone_1 = iconRegister.registerIcon("BloodArsenal:blood_stone_1");
blood_stone_2 = iconRegister.registerIcon("BloodArsenal:blood_stone_2");
blood_stone_3 = iconRegister.registerIcon("BloodArsenal:blood_stone_3");
@@ -41,28 +37,22 @@ public class BlockBloodStone extends Block
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item par1Item, CreativeTabs par2CreativeTabs, List par3List)
{
if (this.equals(ModBlocks.blood_stone))
{
public void getSubBlocks(Item par1Item, CreativeTabs par2CreativeTabs, List par3List) {
if (this.equals(ModBlocks.blood_stone)) {
par3List.add(new ItemStack(par1Item, 1, 0));
par3List.add(new ItemStack(par1Item, 1, 1));
par3List.add(new ItemStack(par1Item, 1, 2));
par3List.add(new ItemStack(par1Item, 1, 3));
par3List.add(new ItemStack(par1Item, 1, 4));
}
else
{
} else {
super.getSubBlocks(par1Item, par2CreativeTabs, par3List);
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
switch (meta)
{
public IIcon getIcon(int side, int meta) {
switch (meta) {
case 0:
return blood_stone_1;
@@ -84,8 +74,7 @@ public class BlockBloodStone extends Block
}
@Override
public int damageDropped(int metadata)
{
public int damageDropped(int metadata) {
return metadata;
}
}
@@ -4,6 +4,7 @@ import com.arc.bloodarsenal.common.entity.EntityBloodTNT;
import com.arc.bloodarsenal.common.items.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockTNT;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -16,17 +17,14 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import java.util.Random;
public class BlockBloodTNT extends BlockTNT
{
public class BlockBloodTNT extends BlockTNT {
@SideOnly(Side.CLIENT)
private IIcon top;
@SideOnly(Side.CLIENT)
private IIcon bottom;
public BlockBloodTNT()
{
public BlockBloodTNT() {
super();
setHardness(0.0F);
setStepSound(soundTypeGrass);
@@ -34,63 +32,62 @@ public class BlockBloodTNT extends BlockTNT
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2)
{
public IIcon getIcon(int par1, int par2) {
return par1 == 0 ? bottom : (par1 == 1 ? top : blockIcon);
}
@Override
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
super.onBlockAdded(par1World, par2, par3, par4);
if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) {
onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockToAir(par2, par3, par4);
}
}
@Override
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5Block)
{
if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5Block) {
if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) {
onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockToAir(par2, par3, par4);
}
}
@Override
public int quantityDropped(Random par1Random)
{
public int quantityDropped(Random par1Random) {
return 1;
}
@Override
public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion)
{
if (!par1World.isRemote)
{
EntityBloodTNT entitytntprimed = new EntityBloodTNT(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par5Explosion.getExplosivePlacedBy());
public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) {
if (!par1World.isRemote) {
EntityBloodTNT entitytntprimed = new EntityBloodTNT(
par1World,
(double) ((float) par2 + 0.5F),
(double) ((float) par3 + 0.5F),
(double) ((float) par4 + 0.5F),
par5Explosion.getExplosivePlacedBy());
entitytntprimed.fuse = par1World.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
par1World.spawnEntityInWorld(entitytntprimed);
}
}
@Override
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
{
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {
spawnTNT(par1World, par2, par3, par4, par5, null);
}
public void spawnTNT(World par1World, int par2, int par3, int par4, int par5, EntityLivingBase par6EntityLivingBase)
{
if (!par1World.isRemote)
{
if ((par5 & 1) == 1)
{
EntityBloodTNT entitytntprimed = new EntityBloodTNT(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par6EntityLivingBase);
public void spawnTNT(
World par1World, int par2, int par3, int par4, int par5, EntityLivingBase par6EntityLivingBase) {
if (!par1World.isRemote) {
if ((par5 & 1) == 1) {
EntityBloodTNT entitytntprimed = new EntityBloodTNT(
par1World,
(double) ((float) par2 + 0.5F),
(double) ((float) par3 + 0.5F),
(double) ((float) par4 + 0.5F),
par6EntityLivingBase);
par1World.spawnEntityInWorld(entitytntprimed);
par1World.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F);
}
@@ -98,46 +95,56 @@ public class BlockBloodTNT extends BlockTNT
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5, int par6, float par7, float par8, float par9)
{
if (par5.getCurrentEquippedItem() != null && (par5.getCurrentEquippedItem().getItem() == Items.flint_and_steel || par5.getCurrentEquippedItem().getItem() == ModItems.bound_igniter))
{
public boolean onBlockActivated(
World par1World,
int par2,
int par3,
int par4,
EntityPlayer par5,
int par6,
float par7,
float par8,
float par9) {
if (par5.getCurrentEquippedItem() != null
&& (par5.getCurrentEquippedItem().getItem() == Items.flint_and_steel
|| par5.getCurrentEquippedItem().getItem() == ModItems.bound_igniter)) {
spawnTNT(par1World, par2, par3, par4, 1, par5);
par1World.setBlockToAir(par2, par3, par4);
par5.getCurrentEquippedItem().damageItem(1, par5);
return true;
}
else
{
} else {
return super.onBlockActivated(par1World, par2, par3, par4, par5, par6, par7, par8, par9);
}
}
@Override
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
if (par5Entity instanceof EntityArrow && !par1World.isRemote)
{
EntityArrow entityarrow = (EntityArrow)par5Entity;
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
if (par5Entity instanceof EntityArrow && !par1World.isRemote) {
EntityArrow entityarrow = (EntityArrow) par5Entity;
if (entityarrow.isBurning())
{
spawnTNT(par1World, par2, par3, par4, 1, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)entityarrow.shootingEntity : null);
if (entityarrow.isBurning()) {
spawnTNT(
par1World,
par2,
par3,
par4,
1,
entityarrow.shootingEntity instanceof EntityLivingBase
? (EntityLivingBase) entityarrow.shootingEntity
: null);
par1World.setBlockToAir(par2, par3, par4);
}
}
}
@Override
public boolean canDropFromExplosion(Explosion par1Explosion)
{
public boolean canDropFromExplosion(Explosion par1Explosion) {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
blockIcon = iconRegister.registerIcon("BloodArsenal:blood_tnt_side");
top = iconRegister.registerIcon("BloodArsenal:blood_tnt_top");
bottom = iconRegister.registerIcon("BloodArsenal:blood_tnt_bottom");
@@ -2,10 +2,8 @@ package com.arc.bloodarsenal.common.block;
import net.minecraft.block.BlockTorch;
public class BlockBloodTorch extends BlockTorch
{
public BlockBloodTorch()
{
public class BlockBloodTorch extends BlockTorch {
public BlockBloodTorch() {
super();
setHardness(0.0F);
setLightLevel(0.9375F);
@@ -3,6 +3,9 @@ package com.arc.bloodarsenal.common.block;
import com.arc.bloodarsenal.common.items.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@@ -15,143 +18,129 @@ import net.minecraft.util.Direction;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
public class BlockBurnedString extends Block
{
public BlockBurnedString()
{
public class BlockBurnedString extends Block {
public BlockBurnedString() {
super(Material.circuits);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F);
setTickRandomly(true);
}
@Override
public int tickRate(World p_149738_1_)
{
public int tickRate(World p_149738_1_) {
return 10;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
{
public AxisAlignedBB getCollisionBoundingBoxFromPool(
World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
return null;
}
@Override
public boolean isOpaqueCube()
{
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock()
{
public boolean renderAsNormalBlock() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass()
{
public int getRenderBlockPass() {
return 1;
}
@Override
public int getRenderType()
{
public int getRenderType() {
return 30;
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return ModItems.blood_burned_string;
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{
public void setBlockBoundsBasedOnState(
IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) {
int l = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_);
boolean flag = (l & 4) == 4;
boolean flag1 = (l & 2) == 2;
if (!flag1)
{
if (!flag1) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.09375F, 1.0F);
}
else if (!flag)
{
} else if (!flag) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
else
{
} else {
this.setBlockBounds(0.0F, 0.0625F, 0.0F, 1.0F, 0.15625F, 1.0F);
}
}
@Override
@SideOnly(Side.CLIENT)
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
{
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
return ModItems.blood_burned_string;
}
@Override
public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_)
{
public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {
int l = World.doesBlockHaveSolidTopSurface(p_149726_1_, p_149726_2_, p_149726_3_ - 1, p_149726_4_) ? 0 : 2;
p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, l, 3);
this.func_150138_a(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_, l);
}
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{
public void breakBlock(
World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
this.func_150138_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_6_ | 1);
}
@Override
public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_)
{
if (!p_149681_1_.isRemote)
{
if (p_149681_6_.getCurrentEquippedItem() != null && p_149681_6_.getCurrentEquippedItem().getItem() == Items.shears)
{
public void onBlockHarvested(
World p_149681_1_,
int p_149681_2_,
int p_149681_3_,
int p_149681_4_,
int p_149681_5_,
EntityPlayer p_149681_6_) {
if (!p_149681_1_.isRemote) {
if (p_149681_6_.getCurrentEquippedItem() != null
&& p_149681_6_.getCurrentEquippedItem().getItem() == Items.shears) {
p_149681_1_.setBlockMetadataWithNotify(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_ | 8, 4);
}
}
}
private void func_150138_a(World p_150138_1_, int p_150138_2_, int p_150138_3_, int p_150138_4_, int p_150138_5_)
{
private void func_150138_a(World p_150138_1_, int p_150138_2_, int p_150138_3_, int p_150138_4_, int p_150138_5_) {
int i1 = 0;
while (i1 < 2)
{
while (i1 < 2) {
int j1 = 1;
while (true)
{
if (j1 < 42)
{
while (true) {
if (j1 < 42) {
int k1 = p_150138_2_ + Direction.offsetX[i1] * j1;
int l1 = p_150138_4_ + Direction.offsetZ[i1] * j1;
Block block = p_150138_1_.getBlock(k1, p_150138_3_, l1);
if (block == Blocks.tripwire_hook)
{
if (block == Blocks.tripwire_hook) {
int i2 = p_150138_1_.getBlockMetadata(k1, p_150138_3_, l1) & 3;
if (i2 == Direction.rotateOpposite[i1])
{
Blocks.tripwire_hook.func_150136_a(p_150138_1_, k1, p_150138_3_, l1, false, p_150138_1_.getBlockMetadata(k1, p_150138_3_, l1), true, j1, p_150138_5_);
if (i2 == Direction.rotateOpposite[i1]) {
Blocks.tripwire_hook.func_150136_a(
p_150138_1_,
k1,
p_150138_3_,
l1,
false,
p_150138_1_.getBlockMetadata(k1, p_150138_3_, l1),
true,
j1,
p_150138_5_);
}
}
else if (block == Blocks.tripwire)
{
} else if (block == Blocks.tripwire) {
++j1;
continue;
}
@@ -164,12 +153,10 @@ public class BlockBurnedString extends Block
}
@Override
public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_)
{
if (!p_149670_1_.isRemote)
{
if ((p_149670_1_.getBlockMetadata(p_149670_2_, p_149670_3_, p_149670_4_) & 1) != 1)
{
public void onEntityCollidedWithBlock(
World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) {
if (!p_149670_1_.isRemote) {
if ((p_149670_1_.getBlockMetadata(p_149670_2_, p_149670_3_, p_149670_4_) & 1) != 1) {
this.func_150140_e(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_);
}
@@ -177,85 +164,82 @@ public class BlockBurnedString extends Block
}
}
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
{
if (!p_149674_1_.isRemote)
{
if ((p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_) & 1) == 1)
{
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {
if (!p_149674_1_.isRemote) {
if ((p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_) & 1) == 1) {
this.func_150140_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_);
}
}
}
private void func_150140_e(World p_150140_1_, int p_150140_2_, int p_150140_3_, int p_150140_4_)
{
private void func_150140_e(World p_150140_1_, int p_150140_2_, int p_150140_3_, int p_150140_4_) {
int l = p_150140_1_.getBlockMetadata(p_150140_2_, p_150140_3_, p_150140_4_);
boolean flag = (l & 1) == 1;
boolean flag1 = false;
List list = p_150140_1_.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox((double)p_150140_2_ + this.minX, (double)p_150140_3_ + this.minY, (double)p_150140_4_ + this.minZ, (double)p_150140_2_ + this.maxX, (double)p_150140_3_ + this.maxY, (double)p_150140_4_ + this.maxZ));
List list = p_150140_1_.getEntitiesWithinAABBExcludingEntity(
(Entity) null,
AxisAlignedBB.getBoundingBox(
(double) p_150140_2_ + this.minX,
(double) p_150140_3_ + this.minY,
(double) p_150140_4_ + this.minZ,
(double) p_150140_2_ + this.maxX,
(double) p_150140_3_ + this.maxY,
(double) p_150140_4_ + this.maxZ));
if (!list.isEmpty())
{
if (!list.isEmpty()) {
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
Entity entity = (Entity)iterator.next();
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
if (!entity.doesEntityNotTriggerPressurePlate())
{
if (!entity.doesEntityNotTriggerPressurePlate()) {
flag1 = true;
break;
}
}
}
if (flag1 && !flag)
{
if (flag1 && !flag) {
l |= 1;
}
if (!flag1 && flag)
{
if (!flag1 && flag) {
l &= -2;
}
if (flag1 != flag)
{
if (flag1 != flag) {
p_150140_1_.setBlockMetadataWithNotify(p_150140_2_, p_150140_3_, p_150140_4_, l, 3);
this.func_150138_a(p_150140_1_, p_150140_2_, p_150140_3_, p_150140_4_, l);
}
if (flag1)
{
if (flag1) {
p_150140_1_.scheduleBlockUpdate(p_150140_2_, p_150140_3_, p_150140_4_, this, this.tickRate(p_150140_1_));
}
}
@SideOnly(Side.CLIENT)
public static boolean func_150139_a(IBlockAccess p_150139_0_, int p_150139_1_, int p_150139_2_, int p_150139_3_, int p_150139_4_, int p_150139_5_)
{
public static boolean func_150139_a(
IBlockAccess p_150139_0_,
int p_150139_1_,
int p_150139_2_,
int p_150139_3_,
int p_150139_4_,
int p_150139_5_) {
int j1 = p_150139_1_ + Direction.offsetX[p_150139_5_];
int k1 = p_150139_3_ + Direction.offsetZ[p_150139_5_];
Block block = p_150139_0_.getBlock(j1, p_150139_2_, k1);
boolean flag = (p_150139_4_ & 2) == 2;
int l1;
if (block == Blocks.tripwire_hook)
{
if (block == Blocks.tripwire_hook) {
l1 = p_150139_0_.getBlockMetadata(j1, p_150139_2_, k1);
int i2 = l1 & 3;
return i2 == Direction.rotateOpposite[p_150139_5_];
}
else if (block == Blocks.tripwire)
{
} else if (block == Blocks.tripwire) {
l1 = p_150139_0_.getBlockMetadata(j1, p_150139_2_, k1);
boolean flag1 = (l1 & 2) == 2;
return flag == flag1;
}
else
{
} else {
return false;
}
}
@@ -6,6 +6,8 @@ import WayofTime.alchemicalWizardry.common.items.ActivationCrystal;
import com.arc.bloodarsenal.common.tileentity.TileCompactedMRS;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
@@ -19,13 +21,8 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class BlockCompactedMRS extends BlockMasterStone
{
public BlockCompactedMRS()
{
public class BlockCompactedMRS extends BlockMasterStone {
public BlockCompactedMRS() {
super();
setBlockName("compacted_mrs");
setHardness(4.0F);
@@ -34,21 +31,17 @@ public class BlockCompactedMRS extends BlockMasterStone
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
blockIcon = iconRegister.registerIcon("BloodArsenal:compacted_mrs");
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
{
if (this.equals(ModBlocks.compacted_mrs))
{
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
if (this.equals(ModBlocks.compacted_mrs)) {
par3List.add(new ItemStack(par1, 1, 0));
for (String ritualName : Rituals.keyList)
{
for (String ritualName : Rituals.keyList) {
ItemStack stack = new ItemStack(par1, 1, 0);
NBTTagCompound tag = new NBTTagCompound();
TileCompactedMRS tile = new TileCompactedMRS();
@@ -57,8 +50,7 @@ public class BlockCompactedMRS extends BlockMasterStone
NBTTagCompound savedTag = new NBTTagCompound();
if (tile != null)
{
if (tile != null) {
tile.writeToNBT(savedTag);
}
@@ -70,41 +62,33 @@ public class BlockCompactedMRS extends BlockMasterStone
par3List.add(stack);
}
}
else
{
} else {
super.getSubBlocks(par1, par2CreativeTabs, par3List);
}
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack)
{
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileCompactedMRS)
{
if (tile instanceof TileCompactedMRS) {
NBTTagCompound tag = stack.getTagCompound();
if (tag != null)
{
if (tag != null) {
((TileCompactedMRS) tile).readNBTOnPlace(tag);
}
}
}
@Override
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player)
{
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileCompactedMRS)
{
if (tile instanceof TileCompactedMRS) {
((TileCompactedMRS) tile).useOnRitualBroken();
}
if (!player.capabilities.isCreativeMode)
{
if (!player.capabilities.isCreativeMode) {
dropBlockAsItem(world, x, y, z, meta, 0);
}
@@ -112,14 +96,12 @@ public class BlockCompactedMRS extends BlockMasterStone
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
{
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> list = new ArrayList();
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileCompactedMRS)
{
if (tile instanceof TileCompactedMRS) {
ItemStack drop = new ItemStack(this);
NBTTagCompound tag = new NBTTagCompound();
((TileCompactedMRS) tile).writeNBTOnHarvest(tag);
@@ -132,67 +114,58 @@ public class BlockCompactedMRS extends BlockMasterStone
}
@Override
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
{
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) {
super.onBlockDestroyedByExplosion(world, x, y, z, explosion);
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileCompactedMRS)
{
if (tile instanceof TileCompactedMRS) {
((TileCompactedMRS) tile).useOnRitualBrokenExplosion();
}
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
{
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) {
TileCompactedMRS tileEntity = (TileCompactedMRS) world.getTileEntity(x, y, z);
if (tileEntity != null)
{
if (tileEntity != null) {
ItemStack playerItem = player.getCurrentEquippedItem();
if (playerItem == null)
{
if (playerItem == null) {
return false;
}
else
{
} else {
Item item = playerItem.getItem();
if (!(item instanceof ActivationCrystal))
{
if (!(item instanceof ActivationCrystal)) {
return false;
}
else
{
} else {
ActivationCrystal acItem = (ActivationCrystal) item;
tileEntity.activateRitual(world, acItem.getCrystalLevel(playerItem), playerItem, player, ActivationCrystal.getOwnerName(playerItem));
tileEntity.activateRitual(
world,
acItem.getCrystalLevel(playerItem),
playerItem,
player,
ActivationCrystal.getOwnerName(playerItem));
world.markBlockForUpdate(x, y, z);
return true;
}
}
}
else
{
} else {
return false;
}
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
{
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
Item item = getItem(world, x, y, z);
if (item == null)
{
if (item == null) {
return null;
}
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileCompactedMRS)
{
if (tile instanceof TileCompactedMRS) {
ItemStack drop = new ItemStack(this);
NBTTagCompound tag = new NBTTagCompound();
((TileCompactedMRS) tile).writeNBTOnHarvest(tag);
@@ -204,8 +177,7 @@ public class BlockCompactedMRS extends BlockMasterStone
}
@Override
public TileEntity createNewTileEntity(World world, int meta)
{
public TileEntity createNewTileEntity(World world, int meta) {
return new TileCompactedMRS();
}
}
@@ -16,6 +16,7 @@ import com.arc.bloodarsenal.common.tileentity.TileCompacter;
import com.arc.bloodarsenal.common.tileentity.TilePortableAltar;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -31,10 +32,7 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidContainerRegistry;
import java.util.List;
public class BlockCompacter extends BlockContainer
{
public class BlockCompacter extends BlockContainer {
private String ritualName;
private int direction;
@@ -62,11 +60,11 @@ public class BlockCompacter extends BlockContainer
@SideOnly(Side.CLIENT)
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private IIcon sideIcon;
public BlockCompacter()
{
public BlockCompacter() {
super(Material.iron);
setHardness(8.0F);
setResistance(5.0F);
@@ -74,33 +72,25 @@ public class BlockCompacter extends BlockContainer
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
{
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) {
world.markBlockForUpdate(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity != null && !player.isSneaking())
{
if (tileEntity != null && !player.isSneaking()) {
ItemStack playerItem = player.getCurrentEquippedItem();
if (playerItem == null)
{
if (playerItem == null) {
return false;
}
else
{
} else {
Item item = playerItem.getItem();
if (!(item instanceof IBloodOrb))
{
if (!(item instanceof IBloodOrb)) {
return false;
}
else
{
} else {
Block block = world.getBlock(x, y + 1, z);
if (block != null)
{
if (block != null) {
TileEntity tile;
world.markBlockForUpdate(x, y, z);
@@ -109,28 +99,22 @@ public class BlockCompacter extends BlockContainer
String owner = player.getCommandSenderName();
int currentEssence = SoulNetworkHandler.getCurrentEssence(owner);
if (block instanceof BlockMasterStone)
{
if (block instanceof BlockMasterStone) {
tile = world.getTileEntity(x, y + 1, z);
checkRitual(tile);
List<RitualComponent> ritualList = Rituals.getRitualList(ritualName);
if (ritualList == null)
{
if (ritualList == null) {
return false;
}
else
{
} else {
float multiplier = 1;
for (RitualComponent ritualComponent : ritualList)
{
for (RitualComponent ritualComponent : ritualList) {
int stoneType = ritualComponent.getStoneType();
switch (stoneType)
{
switch (stoneType) {
case 0:
break;
@@ -157,43 +141,37 @@ public class BlockCompacter extends BlockContainer
}
int activationCost = Rituals.getCostForActivation(ritualName);
int cost = (activationCost * (int) multiplier) / 2; //Divided by 2 since this fires twice apparently and also because I'm nice
int cost = (activationCost * (int) multiplier)
/ 2; // Divided by 2 since this fires twice apparently and also because I'm nice
if (cost <= currentEssence)
{
if (cost <= currentEssence) {
compactRitual(tile);
SoulNetworkHandler.syphonFromNetwork(owner, cost);
--player.inventory.getCurrentItem().stackSize;
}
else
{
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.compacter.notEnoughLP")));
} else {
player.addChatComponentMessage(new ChatComponentText(
StatCollector.translateToLocal("message.compacter.notEnoughLP")));
return true;
}
}
return true;
}
else if (block instanceof BlockAltar && world.getTileEntity(x, y + 1, z) != null)
{
} else if (block instanceof BlockAltar && world.getTileEntity(x, y + 1, z) != null) {
tile = world.getTileEntity(x, y + 1, z);
TEAltar altar = (TEAltar) tile;
checkAltar(altar);
if (tier == 0)
{
if (tier == 0) {
return false;
}
else if (altar.getStackInSlot(0) != null)
{
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.compacter.itemInAltar")));
}
else
{
} else if (altar.getStackInSlot(0) != null) {
player.addChatComponentMessage(new ChatComponentText(
StatCollector.translateToLocal("message.compacter.itemInAltar")));
} else {
float multiplier = 1;
AltarUpgradeComponent upgradeComponent = UpgradedAltars.getUpgrades(world, x, y + 1, z, tier);
AltarUpgradeComponent upgradeComponent =
UpgradedAltars.getUpgrades(world, x, y + 1, z, tier);
int speedUpgrades = upgradeComponent.getSpeedUpgrades();
int efficiencyUpgrades = upgradeComponent.getEfficiencyUpgrades();
@@ -217,24 +195,20 @@ public class BlockCompacter extends BlockContainer
IBloodOrb bloodOrb = (IBloodOrb) item;
if (bloodOrb.getOrbLevel() >= tier)
{
if (bloodOrb.getOrbLevel() >= tier) {
int cost = ((tier * 10) * (int) (multiplier * 5)) + capacity;
if (cost <= currentEssence)
{
if (cost <= currentEssence) {
compactAltar(tile);
SoulNetworkHandler.syphonFromNetwork(owner, cost);
--player.inventory.getCurrentItem().stackSize;
} else {
player.addChatComponentMessage(new ChatComponentText(
StatCollector.translateToLocal("message.compacter.notEnoughLP")));
}
else
{
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.compacter.notEnoughLP")));
}
}
else
{
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.compacter.wrongOrbTier")));
} else {
player.addChatComponentMessage(new ChatComponentText(
StatCollector.translateToLocal("message.compacter.wrongOrbTier")));
}
}
@@ -245,37 +219,31 @@ public class BlockCompacter extends BlockContainer
return true;
}
}
}
else
{
} else {
return false;
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
public IIcon getIcon(int side, int meta) {
return side == 1 ? this.topIcon : (side == 0 ? this.blockIcon : this.sideIcon);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_)
{
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_bottom");
this.topIcon = p_149651_1_.registerIcon(this.getTextureName() + "_top");
this.sideIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side");
}
@Override
public TileEntity createNewTileEntity(World world, int meta)
{
public TileEntity createNewTileEntity(World world, int meta) {
return new TileCompacter();
}
private void checkRitual(TileEntity tileEntity)
{
private void checkRitual(TileEntity tileEntity) {
TEMasterStone masterStone = (TEMasterStone) tileEntity;
World world = masterStone.getWorld();
int x = masterStone.xCoord;
@@ -284,12 +252,9 @@ public class BlockCompacter extends BlockContainer
ritualName = Rituals.checkValidRitual(world, x, y, z);
if (ritualName.equals(""))
{
if (ritualName.equals("")) {
return;
}
else
{
} else {
direction = Rituals.getDirectionOfRitual(world, x, y, z, ritualName);
}
@@ -297,8 +262,7 @@ public class BlockCompacter extends BlockContainer
world.markBlockForUpdate(x, y + 1, z);
}
private void compactRitual(TileEntity tileEntity)
{
private void compactRitual(TileEntity tileEntity) {
TEMasterStone masterStone = (TEMasterStone) tileEntity;
World world = masterStone.getWorld();
int x = masterStone.xCoord;
@@ -307,16 +271,20 @@ public class BlockCompacter extends BlockContainer
List<RitualComponent> ritualList = Rituals.getRitualList(ritualName);
if (ritualList == null)
{
if (ritualList == null) {
return;
}
for (RitualComponent ritualComponent : ritualList)
{
world.setBlockToAir(x + ritualComponent.getX(direction), y + ritualComponent.getY(), z + ritualComponent.getZ(direction));
for (RitualComponent ritualComponent : ritualList) {
world.setBlockToAir(
x + ritualComponent.getX(direction),
y + ritualComponent.getY(),
z + ritualComponent.getZ(direction));
world.setBlockToAir(x, y, z);
world.markBlockForUpdate(x + ritualComponent.getX(direction), y + ritualComponent.getY(), z + ritualComponent.getZ(direction));
world.markBlockForUpdate(
x + ritualComponent.getX(direction),
y + ritualComponent.getY(),
z + ritualComponent.getZ(direction));
}
world.setBlock(x, y, z, ModBlocks.compacted_mrs);
@@ -325,12 +293,9 @@ public class BlockCompacter extends BlockContainer
world.markBlockForUpdate(x, y, z);
}
private void configureMRS(World world, int x, int y, int z, Block block)
{
if (block instanceof BlockCompactedMRS)
{
if (world.getBlock(x, y, z) == block)
{
private void configureMRS(World world, int x, int y, int z, Block block) {
if (block instanceof BlockCompactedMRS) {
if (world.getBlock(x, y, z) == block) {
TileCompactedMRS tile = (TileCompactedMRS) world.getTileEntity(x, y, z);
tile.setRitualName(ritualName);
@@ -340,23 +305,20 @@ public class BlockCompacter extends BlockContainer
}
}
private void checkAltar(TEAltar altar)
{
private void checkAltar(TEAltar altar) {
World world = altar.getWorldObj();
int x = altar.xCoord;
int y = altar.yCoord;
int z = altar.zCoord;
tier = altar.getTier();
if (tier == 0)
{
if (tier == 0) {
return;
}
AltarUpgradeComponent upgrades = UpgradedAltars.getUpgrades(world, x, y, z, tier);
if (upgrades == null)
{
if (upgrades == null) {
this.consumptionMultiplier = 0;
this.efficiencyMultiplier = 1;
this.sacrificeEfficiencyMultiplier = 0;
@@ -373,7 +335,8 @@ public class BlockCompacter extends BlockContainer
efficiencyMultiplier = (float) Math.pow(0.80, upgrades.getSpeedUpgrades());
sacrificeEfficiencyMultiplier = (float) (0.12 * upgrades.getSacrificeUpgrades());
selfSacrificeEfficiencyMultiplier = (float) (0.12 * upgrades.getSelfSacrificeUpgrades());
capacityMultiplier = (float) ((1 * Math.pow(1.14, upgrades.getBetterCapacitiveUpgrades()) + 0.20 * upgrades.getAltarCapacitiveUpgrades()));
capacityMultiplier = (float) ((1 * Math.pow(1.14, upgrades.getBetterCapacitiveUpgrades())
+ 0.20 * upgrades.getAltarCapacitiveUpgrades()));
dislocationMultiplier = (float) (Math.pow(1.5, upgrades.getDisplacementUpgrades()));
orbCapacityMultiplier = (float) (1 + 0.04 * upgrades.getOrbCapacitiveUpgrades());
capacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 10 * capacityMultiplier);
@@ -393,8 +356,7 @@ public class BlockCompacter extends BlockContainer
world.markBlockForUpdate(x, y - 1, z);
}
private void compactAltar(TileEntity tileEntity)
{
private void compactAltar(TileEntity tileEntity) {
TEAltar altar = (TEAltar) tileEntity;
World world = altar.getWorldObj();
int x = altar.xCoord;
@@ -403,13 +365,12 @@ public class BlockCompacter extends BlockContainer
List<AltarComponent> altarComponents = UpgradedAltars.getAltarUpgradeListForTier(tier);
if (altarComponents != null && !world.isRemote)
{
for (AltarComponent altarComponent : altarComponents)
{
if (altarComponents != null && !world.isRemote) {
for (AltarComponent altarComponent : altarComponents) {
world.setBlockToAir(x + altarComponent.getX(), y + altarComponent.getY(), z + altarComponent.getZ());
world.setBlockToAir(x, y, z);
world.markBlockForUpdate(x + altarComponent.getX(), y + altarComponent.getY(), z + altarComponent.getZ());
world.markBlockForUpdate(
x + altarComponent.getX(), y + altarComponent.getY(), z + altarComponent.getZ());
}
}
@@ -420,12 +381,9 @@ public class BlockCompacter extends BlockContainer
world.markBlockForUpdate(x, y - 1, z);
}
private void configureAltar(World world, int x, int y, int z, Block block)
{
if (block instanceof BlockPortableAltar)
{
if (world.getBlock(x, y, z) == block)
{
private void configureAltar(World world, int x, int y, int z, Block block) {
if (block instanceof BlockPortableAltar) {
if (world.getBlock(x, y, z) == block) {
TilePortableAltar altar = (TilePortableAltar) world.getTileEntity(x, y, z);
altar.setTier(tier);
@@ -439,7 +397,16 @@ public class BlockCompacter extends BlockContainer
altar.setCapacityMultiplier(capacityMultiplier);
altar.setCapacity(capacity);
altar.setBufferCapacity(bufferCapacity);
altar.setUpgrades(speedUpgrades, efficiencyUpgrades, sacrificeUpgrades, selfSacrificeUpgrades, displacementUpgrades, altarCapacitiveUpgrades, orbCapacitiveUpgrades, betterCapacitiveUpgrades, accelerationUpgrades);
altar.setUpgrades(
speedUpgrades,
efficiencyUpgrades,
sacrificeUpgrades,
selfSacrificeUpgrades,
displacementUpgrades,
altarCapacitiveUpgrades,
orbCapacitiveUpgrades,
betterCapacitiveUpgrades,
accelerationUpgrades);
world.markBlockForUpdate(x, y, z);
@@ -4,10 +4,8 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
public class BlockInfusedIron extends Block
{
public BlockInfusedIron()
{
public class BlockInfusedIron extends Block {
public BlockInfusedIron() {
super(Material.iron);
setHardness(7.5F);
setResistance(5.0F);
@@ -15,8 +13,7 @@ public class BlockInfusedIron extends Block
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
{
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
return true;
}
}
@@ -1,7 +1,12 @@
package com.arc.bloodarsenal.common.block;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
import com.arc.bloodarsenal.common.tileentity.TileLPMaterializer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -17,24 +22,15 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidContainerRegistry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
import com.arc.bloodarsenal.common.tileentity.TileLPMaterializer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockLPMaterializer extends BlockContainer
{
public class BlockLPMaterializer extends BlockContainer {
@SideOnly(Side.CLIENT)
private IIcon output;
@SideOnly(Side.CLIENT)
private IIcon side;
public BlockLPMaterializer()
{
public BlockLPMaterializer() {
super(Material.iron);
setHardness(7.0F);
setResistance(14.0F);
@@ -42,107 +38,84 @@ public class BlockLPMaterializer extends BlockContainer
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2)
{
public IIcon getIcon(int par1, int par2) {
return par1 == 0 || par1 == 1 ? output : side;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass()
{
public int getRenderBlockPass() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess blockSide, int x, int y, int z, int side)
{
public boolean shouldSideBeRendered(IBlockAccess blockSide, int x, int y, int z, int side) {
return true;
}
@Override
public boolean isOpaqueCube()
{
public boolean isOpaqueCube() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
blockIcon = iconRegister.registerIcon("BloodArsenal:lp_materializer_output");
output = iconRegister.registerIcon("BloodArsenal:lp_materializer_output");
side = iconRegister.registerIcon("BloodArsenal:lp_materializer_side");
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
{
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) {
TileLPMaterializer tileEntity = (TileLPMaterializer) world.getTileEntity(x, y, z);
if (tileEntity == null)
{
if (tileEntity == null) {
return false;
}
ItemStack playerItem = player.getCurrentEquippedItem();
if (playerItem != null)// <--
if (playerItem != null) // <--
{
if (playerItem.getItem().equals(ModItems.divinationSigil))
{
if (player.worldObj.isRemote)
{
if (playerItem.getItem().equals(ModItems.divinationSigil)) {
if (player.worldObj.isRemote) {
world.markBlockForUpdate(x, y, z);
}
else
{
} else {
tileEntity.sendChatInfoToPlayer(player);
}
return true;
}
else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
{
} else if (playerItem.getItem().equals(ModItems.sigilOfHolding)) {
ItemStack item = ((SigilOfHolding) playerItem.getItem()).getCurrentSigil(playerItem);
if (item != null && item.getItem().equals(ModItems.divinationSigil))
{
if (player.worldObj.isRemote)
{
if (item != null && item.getItem().equals(ModItems.divinationSigil)) {
if (player.worldObj.isRemote) {
world.markBlockForUpdate(x, y, z);
}
else
{
} else {
tileEntity.sendChatInfoToPlayer(player);
}
return true;
}
}
else if (playerItem.getItem() == Items.bucket)
{
if (tileEntity.getFluidAmount() >= FluidContainerRegistry.BUCKET_VOLUME)
{
} else if (playerItem.getItem() == Items.bucket) {
if (tileEntity.getFluidAmount() >= FluidContainerRegistry.BUCKET_VOLUME) {
--playerItem.stackSize;
player.inventory.addItemStackToInventory(new ItemStack(ModItems.bucketLife));
tileEntity.drain(FluidContainerRegistry.BUCKET_VOLUME, true);
}
}
if (tileEntity.getStackInSlot(0) == null && playerItem.getItem() instanceof IBloodOrb)
{
if (tileEntity.getStackInSlot(0) == null && playerItem.getItem() instanceof IBloodOrb) {
ItemStack newItem = playerItem.copy();
newItem.stackSize = 1;
--playerItem.stackSize;
tileEntity.setInventorySlotContents(0, newItem);
}
}
else if (player.isSneaking())
{
if (tileEntity.getStackInSlot(0) != null)
{
} else if (player.isSneaking()) {
if (tileEntity.getStackInSlot(0) != null) {
ItemStack newItem = tileEntity.getStackInSlot(0).copy();
newItem.stackSize = 1;
player.inventory.addItemStackToInventory(newItem);
@@ -154,38 +127,38 @@ public class BlockLPMaterializer extends BlockContainer
}
@Override
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
{
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
dropItems(world, x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
}
private void dropItems(World world, int x, int y, int z)
{
private void dropItems(World world, int x, int y, int z) {
Random rand = new Random();
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (!(tileEntity instanceof IInventory))
{
if (!(tileEntity instanceof IInventory)) {
return;
}
IInventory inventory = (IInventory) tileEntity;
for (int i = 0; i < inventory.getSizeInventory(); i++)
{
for (int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack item = inventory.getStackInSlot(i);
if (item != null && item.stackSize > 0)
{
if (item != null && item.stackSize > 0) {
float rx = rand.nextFloat() * 0.8F + 0.1F;
float ry = rand.nextFloat() * 0.8F + 0.1F;
float rz = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
EntityItem entityItem = new EntityItem(
world,
x + rx,
y + ry,
z + rz,
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
if (item.hasTagCompound())
{
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
if (item.hasTagCompound()) {
entityItem.getEntityItem().setTagCompound((NBTTagCompound)
item.getTagCompound().copy());
}
float factor = 0.05F;
@@ -199,14 +172,12 @@ public class BlockLPMaterializer extends BlockContainer
}
@Override
public TileEntity createNewTileEntity(World world, int meta)
{
public TileEntity createNewTileEntity(World world, int meta) {
return new TileLPMaterializer();
}
@Override
public boolean hasTileEntity()
{
public boolean hasTileEntity() {
return true;
}
}
@@ -1,7 +1,9 @@
package com.arc.bloodarsenal.common.block;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
import com.arc.bloodarsenal.common.tileentity.TileLifeInfuser;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -14,15 +16,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidContainerRegistry;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
import com.arc.bloodarsenal.common.tileentity.TileLifeInfuser;
public class BlockLifeInfuser extends BlockContainer
{
public BlockLifeInfuser()
{
public class BlockLifeInfuser extends BlockContainer {
public BlockLifeInfuser() {
super(Material.iron);
setHardness(6.0F);
setResistance(12.0F);
@@ -32,73 +28,55 @@ public class BlockLifeInfuser extends BlockContainer
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
{
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) {
TileLifeInfuser tileEntity = (TileLifeInfuser) world.getTileEntity(x, y, z);
if (tileEntity == null || player.isSneaking())
{
if (tileEntity == null || player.isSneaking()) {
return false;
}
ItemStack playerItem = player.getCurrentEquippedItem();
ItemStack bucket = new ItemStack(Items.bucket);
if (playerItem != null)// <--
if (playerItem != null) // <--
{
if (playerItem.getItem().equals(ModItems.divinationSigil) || playerItem.getItem().equals(ModItems.itemSeerSigil))
{
if (player.worldObj.isRemote)
{
if (playerItem.getItem().equals(ModItems.divinationSigil)
|| playerItem.getItem().equals(ModItems.itemSeerSigil)) {
if (player.worldObj.isRemote) {
world.markBlockForUpdate(x, y, z);
}
else
{
} else {
tileEntity.sendChatInfoToPlayer(player);
}
return true;
}
else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
{
} else if (playerItem.getItem().equals(ModItems.sigilOfHolding)) {
ItemStack item = ((SigilOfHolding) playerItem.getItem()).getCurrentSigil(playerItem);
if (item != null && item.getItem().equals(ModItems.divinationSigil))
{
if (player.worldObj.isRemote)
{
if (item != null && item.getItem().equals(ModItems.divinationSigil)) {
if (player.worldObj.isRemote) {
world.markBlockForUpdate(x, y, z);
}
else
{
} else {
tileEntity.sendChatInfoToPlayer(player);
}
return true;
}
}
else if (playerItem.getItem().equals(ModItems.bucketLife))
{
if (tileEntity.getFluid().amount <= tileEntity.capacity - FluidContainerRegistry.BUCKET_VOLUME)
{
if (!player.capabilities.isCreativeMode)
{
} else if (playerItem.getItem().equals(ModItems.bucketLife)) {
if (tileEntity.getFluid().amount <= tileEntity.capacity - FluidContainerRegistry.BUCKET_VOLUME) {
if (!player.capabilities.isCreativeMode) {
--playerItem.stackSize;
player.inventory.addItemStackToInventory(bucket);
}
tileEntity.fillMainTank(FluidContainerRegistry.BUCKET_VOLUME);
}
}
else if (tileEntity.getStackInSlot(0) == null)
{
} else if (tileEntity.getStackInSlot(0) == null) {
ItemStack newItem = playerItem.copy();
newItem.stackSize = 1;
--playerItem.stackSize;
tileEntity.setInventorySlotContents(0, newItem);
}
}
else if (tileEntity.getStackInSlot(0) != null && playerItem == null)
{
} else if (tileEntity.getStackInSlot(0) != null && playerItem == null) {
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
tileEntity.setInventorySlotContents(0, null);
}
@@ -107,38 +85,38 @@ public class BlockLifeInfuser extends BlockContainer
}
@Override
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
{
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
dropItems(world, x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
}
private void dropItems(World world, int x, int y, int z)
{
private void dropItems(World world, int x, int y, int z) {
Random rand = new Random();
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (!(tileEntity instanceof IInventory))
{
if (!(tileEntity instanceof IInventory)) {
return;
}
IInventory inventory = (IInventory) tileEntity;
for (int i = 0; i < inventory.getSizeInventory(); i++)
{
for (int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack item = inventory.getStackInSlot(i);
if (item != null && item.stackSize > 0)
{
if (item != null && item.stackSize > 0) {
float rx = rand.nextFloat() * 0.8F + 0.1F;
float ry = rand.nextFloat() * 0.8F + 0.1F;
float rz = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
EntityItem entityItem = new EntityItem(
world,
x + rx,
y + ry,
z + rz,
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
if (item.hasTagCompound())
{
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
if (item.hasTagCompound()) {
entityItem.getEntityItem().setTagCompound((NBTTagCompound)
item.getTagCompound().copy());
}
float factor = 0.05F;
@@ -152,26 +130,22 @@ public class BlockLifeInfuser extends BlockContainer
}
@Override
public TileEntity createNewTileEntity(World world, int meta)
{
public TileEntity createNewTileEntity(World world, int meta) {
return new TileLifeInfuser();
}
@Override
public boolean renderAsNormalBlock()
{
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int getRenderType()
{
public int getRenderType() {
return -1;
}
@Override
public boolean isOpaqueCube()
{
public boolean isOpaqueCube() {
return false;
}
}
@@ -1,8 +1,14 @@
package com.arc.bloodarsenal.common.block;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
import com.arc.bloodarsenal.common.tileentity.TilePortableAltar;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -18,29 +24,21 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
import com.arc.bloodarsenal.common.tileentity.TilePortableAltar;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPortableAltar extends BlockContainer
{
public class BlockPortableAltar extends BlockContainer {
@SideOnly(Side.CLIENT)
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private IIcon sideIcon1;
@SideOnly(Side.CLIENT)
private IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private IIcon bottomIcon;
public BlockPortableAltar()
{
public BlockPortableAltar() {
super(Material.rock);
setHardness(7.0F);
setResistance(10.0F);
@@ -50,8 +48,7 @@ public class BlockPortableAltar extends BlockContainer
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top");
this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType1");
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2");
@@ -60,10 +57,8 @@ public class BlockPortableAltar extends BlockContainer
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
switch (side)
{
public IIcon getIcon(int side, int meta) {
switch (side) {
case 0:
return bottomIcon;
case 1:
@@ -74,22 +69,18 @@ public class BlockPortableAltar extends BlockContainer
}
@Override
public boolean hasComparatorInputOverride()
{
public boolean hasComparatorInputOverride() {
return true;
}
@Override
public int getComparatorInputOverride(World world, int x, int y, int z, int meta)
{
public int getComparatorInputOverride(World world, int x, int y, int z, int meta) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TilePortableAltar)
{
if (tile instanceof TilePortableAltar) {
ItemStack stack = ((TilePortableAltar) tile).getStackInSlot(0);
if (stack != null && stack.getItem() instanceof EnergyBattery)
{
if (stack != null && stack.getItem() instanceof EnergyBattery) {
EnergyBattery bloodOrb = (EnergyBattery) stack.getItem();
int maxEssence = bloodOrb.getMaxEssence();
int currentEssence = bloodOrb.getCurrentEssence(stack);
@@ -102,74 +93,50 @@ public class BlockPortableAltar extends BlockContainer
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
{
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) {
TilePortableAltar tileEntity = (TilePortableAltar) world.getTileEntity(x, y, z);
if (tileEntity == null || player.isSneaking())
{
if (tileEntity == null || player.isSneaking()) {
return false;
}
ItemStack playerItem = player.getCurrentEquippedItem();
if (playerItem != null)
{
if (playerItem.getItem().equals(ModItems.divinationSigil))
{
if (player.worldObj.isRemote)
{
if (playerItem != null) {
if (playerItem.getItem().equals(ModItems.divinationSigil)) {
if (player.worldObj.isRemote) {
world.markBlockForUpdate(x, y, z);
}
else
{
} else {
tileEntity.sendChatInfoToPlayer(player);
}
return true;
}
else if (playerItem.getItem().equals(ModItems.itemSeerSigil))
{
if (player.worldObj.isRemote)
{
} else if (playerItem.getItem().equals(ModItems.itemSeerSigil)) {
if (player.worldObj.isRemote) {
world.markBlockForUpdate(x, y, z);
}
else
{
} else {
tileEntity.sendMoreChatInfoToPlayer(player);
}
return true;
}
else if (playerItem.getItem() instanceof IAltarManipulator)
{
} else if (playerItem.getItem() instanceof IAltarManipulator) {
return false;
}
else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
{
} else if (playerItem.getItem().equals(ModItems.sigilOfHolding)) {
ItemStack item = ((SigilOfHolding) playerItem.getItem()).getCurrentSigil(playerItem);
if (item != null && item.getItem().equals(ModItems.divinationSigil))
{
if (player.worldObj.isRemote)
{
if (item != null && item.getItem().equals(ModItems.divinationSigil)) {
if (player.worldObj.isRemote) {
world.markBlockForUpdate(x, y, z);
}
else
{
} else {
tileEntity.sendChatInfoToPlayer(player);
}
return true;
}
else if (item != null && item.getItem().equals(ModItems.itemSeerSigil))
{
if (player.worldObj.isRemote)
{
} else if (item != null && item.getItem().equals(ModItems.itemSeerSigil)) {
if (player.worldObj.isRemote) {
world.markBlockForUpdate(x, y, z);
}
else
{
} else {
tileEntity.sendMoreChatInfoToPlayer(player);
}
@@ -178,16 +145,13 @@ public class BlockPortableAltar extends BlockContainer
}
}
if (tileEntity.getStackInSlot(0) == null && playerItem != null)
{
if (tileEntity.getStackInSlot(0) == null && playerItem != null) {
ItemStack newItem = playerItem.copy();
newItem.stackSize = 1;
--playerItem.stackSize;
tileEntity.setInventorySlotContents(0, newItem);
tileEntity.startCycle();
}
else if (tileEntity.getStackInSlot(0) != null && playerItem == null)
{
} else if (tileEntity.getStackInSlot(0) != null && playerItem == null) {
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
tileEntity.setInventorySlotContents(0, null);
tileEntity.setActive(false);
@@ -197,40 +161,38 @@ public class BlockPortableAltar extends BlockContainer
}
@Override
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
{
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
dropItems(world, x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
}
private void dropItems(World world, int x, int y, int z)
{
private void dropItems(World world, int x, int y, int z) {
Random rand = new Random();
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (!(tileEntity instanceof IInventory))
{
if (!(tileEntity instanceof IInventory)) {
return;
}
IInventory inventory = (IInventory) tileEntity;
for (int i = 0; i < inventory.getSizeInventory(); i++)
{
for (int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack item = inventory.getStackInSlot(i);
if (item != null && item.stackSize > 0)
{
if (item != null && item.stackSize > 0) {
float rx = rand.nextFloat() * 0.8F + 0.1F;
float ry = rand.nextFloat() * 0.8F + 0.1F;
float rz = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem = new EntityItem(world,
x + rx, y + ry, z + rz,
EntityItem entityItem = new EntityItem(
world,
x + rx,
y + ry,
z + rz,
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
if (item.hasTagCompound())
{
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
if (item.hasTagCompound()) {
entityItem.getEntityItem().setTagCompound((NBTTagCompound)
item.getTagCompound().copy());
}
float factor = 0.05F;
@@ -244,30 +206,25 @@ public class BlockPortableAltar extends BlockContainer
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack)
{
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TilePortableAltar)
{
if (tile instanceof TilePortableAltar) {
NBTTagCompound tag = stack.getTagCompound();
if (tag != null)
{
if (tag != null) {
((TilePortableAltar) tile).readNBTOnPlace(tag);
}
}
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
{
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> list = new ArrayList();
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TilePortableAltar)
{
if (tile instanceof TilePortableAltar) {
ItemStack drop = new ItemStack(this);
NBTTagCompound tag = new NBTTagCompound();
((TilePortableAltar) tile).writeNBTOnHarvest(tag);
@@ -280,10 +237,8 @@ public class BlockPortableAltar extends BlockContainer
}
@Override
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player)
{
if (!player.capabilities.isCreativeMode)
{
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
if (!player.capabilities.isCreativeMode) {
dropBlockAsItem(world, x, y, z, meta, 0);
}
@@ -291,43 +246,36 @@ public class BlockPortableAltar extends BlockContainer
}
@Override
public boolean renderAsNormalBlock()
{
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int getRenderType()
{
public int getRenderType() {
return -1;
}
@Override
public boolean isOpaqueCube()
{
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean hasTileEntity()
{
public boolean hasTileEntity() {
return true;
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
{
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
Item item = getItem(world, x, y, z);
if (item == null)
{
if (item == null) {
return null;
}
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TilePortableAltar)
{
if (tile instanceof TilePortableAltar) {
ItemStack drop = new ItemStack(this);
NBTTagCompound tag = new NBTTagCompound();
((TilePortableAltar) tile).writeNBTOnHarvest(tag);
@@ -339,24 +287,20 @@ public class BlockPortableAltar extends BlockContainer
}
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
{
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
TilePortableAltar tileEntity = (TilePortableAltar) world.getTileEntity(x, y, z);
if (!tileEntity.isActive())
{
if (!tileEntity.isActive()) {
return;
}
if (rand.nextInt(3) != 0)
{
if (rand.nextInt(3) != 0) {
return;
}
}
@Override
public TileEntity createNewTileEntity(World var1, int var2)
{
public TileEntity createNewTileEntity(World var1, int var2) {
return new TilePortableAltar();
}
}
@@ -7,13 +7,11 @@ import com.arc.bloodarsenal.common.items.block.CompactedMRSBlock;
import com.arc.bloodarsenal.common.items.block.PortableAltarBlock;
import com.arc.bloodarsenal.common.tileentity.*;
import cpw.mods.fml.common.registry.GameRegistry;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import java.util.ArrayList;
public class ModBlocks
{
public class ModBlocks {
public static Block blood_stone;
public static Block blood_tnt;
public static Block blood_stained_glass;
@@ -36,8 +34,7 @@ public class ModBlocks
public static ArrayList<String> blocksNotToBeRegistered = new ArrayList<String>();
public static void init()
{
public static void init() {
blood_stone = registerBlock(new BlockBloodStone(), BloodStoneBlock.class, "blood_stone");
blood_tnt = registerBlock(new BlockBloodTNT(), "blood_tnt");
blood_stained_glass = registerBlock(new BlockBloodStainedGlass(), "blood_stained_glass");
@@ -51,7 +48,8 @@ public class ModBlocks
blood_infused_glowstone = registerBlock(new BlockBloodInfusedGlowstone(), "blood_infused_glowstone");
blood_lamp = registerBlock(new BlockBloodLamp(), "blood_lamp");
blood_infused_diamond_block = registerBlock(new BlockBloodInfusedDiamond(), "blood_infused_diamond_block");
portable_altar = (BlockPortableAltar) registerBlock(new BlockPortableAltar(), PortableAltarBlock.class, "portable_altar");
portable_altar = (BlockPortableAltar)
registerBlock(new BlockPortableAltar(), PortableAltarBlock.class, "portable_altar");
life_infuser = registerBlock(new BlockLifeInfuser(), "life_infuser");
compacter = registerBlock(new BlockCompacter(), "compacter");
lp_materializer = registerBlock(new BlockLPMaterializer(), "lp_materializer");
@@ -59,8 +57,7 @@ public class ModBlocks
block_burned_string = registerBlock(new BlockBurnedString(), "block_burned_string");
}
public static void registerTileEntities()
{
public static void registerTileEntities() {
GameRegistry.registerTileEntity(TilePortableAltar.class, "portable_altar");
GameRegistry.registerTileEntity(TileLifeInfuser.class, "life_infuser");
GameRegistry.registerTileEntity(TileCompacter.class, "compacter");
@@ -68,59 +65,48 @@ public class ModBlocks
GameRegistry.registerTileEntity(TileCompactedMRS.class, "compacted_mrs");
}
public static Block registerBlock(Block block, String unlocalizedName)
{
public static Block registerBlock(Block block, String unlocalizedName) {
block.setBlockName(unlocalizedName);
block.setBlockTextureName(BloodArsenal.MODID + ":" + unlocalizedName);
if (!(block instanceof BlockBloodCake || block instanceof BlockBurnedString))
{
if (!(block instanceof BlockBloodCake || block instanceof BlockBurnedString)) {
block.setCreativeTab(BloodArsenal.BA_TAB);
}
blocksNotToBeRegistered.clear();
for (String unlocName : BloodArsenalConfig.blocksToBeDisabled)
{
if (unlocName.equals(unlocalizedName))
{
for (String unlocName : BloodArsenalConfig.blocksToBeDisabled) {
if (unlocName.equals(unlocalizedName)) {
blocksNotToBeRegistered.add(unlocName);
}
}
if (!blocksNotToBeRegistered.contains(unlocalizedName))
{
if (!blocksNotToBeRegistered.contains(unlocalizedName)) {
GameRegistry.registerBlock(block, unlocalizedName);
}
return block;
}
public static Block registerBlock(Block block, Class<? extends ItemBlock> itemBlockClass, String unlocalizedName)
{
public static Block registerBlock(Block block, Class<? extends ItemBlock> itemBlockClass, String unlocalizedName) {
block.setCreativeTab(BloodArsenal.BA_TAB);
for (String unlocName : BloodArsenalConfig.blocksToBeDisabled)
{
for (String unlocName : BloodArsenalConfig.blocksToBeDisabled) {
System.out.println(unlocName);
if (unlocName.equals(unlocalizedName))
{
if (unlocName.equals(unlocalizedName)) {
blocksNotToBeRegistered.add(unlocName);
}
}
if (!blocksNotToBeRegistered.contains(unlocalizedName))
{
if (!blocksNotToBeRegistered.contains(unlocalizedName)) {
GameRegistry.registerBlock(block, itemBlockClass, unlocalizedName);
}
return block;
}
public static void registerMultiparts()
{
try
{
public static void registerMultiparts() {
try {
Class clazz = Class.forName("com.arc.bloodarsenal.common.block.MultipartHandler");
clazz.newInstance();
} catch (Throwable e) {
}
catch(Throwable e) {}
}
}
@@ -12,17 +12,14 @@ package com.arc.bloodarsenal.common.block;
import codechicken.microblock.BlockMicroMaterial;
import codechicken.microblock.MicroMaterialRegistry;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import java.util.List;
public class MultipartHandler
{
public MultipartHandler()
{
public class MultipartHandler {
public MultipartHandler() {
registerAllMultiparts(ModBlocks.blood_stone);
registerAllMultiparts(ModBlocks.blood_stained_glass);
registerAllMultiparts(ModBlocks.blood_infused_wood);
@@ -35,31 +32,26 @@ public class MultipartHandler
registerAllMultiparts(ModBlocks.blood_infused_diamond_block);
}
private static void registerAllMultiparts(Block block)
{
private static void registerAllMultiparts(Block block) {
List<ItemStack> stacks = new ArrayList<ItemStack>();
Item item = Item.getItemFromBlock(block);
block.getSubBlocks(item, block.getCreativeTabToDisplayOn(), stacks);
for (ItemStack stack : stacks)
{
if (stack.getItem() == item)
{
for (ItemStack stack : stacks) {
if (stack.getItem() == item) {
registerMultipart(block, stack.getItemDamage());
}
}
}
private static void registerMultipartMetadataLine(Block block, int maxMeta)
{
for (int i = 0; i < maxMeta; i++)
{
private static void registerMultipartMetadataLine(Block block, int maxMeta) {
for (int i = 0; i < maxMeta; i++) {
registerMultipart(block, i);
}
}
private static void registerMultipart(Block block, int meta)
{
MicroMaterialRegistry.registerMaterial(new BlockMicroMaterial(block, meta), block.getUnlocalizedName() + (meta == 0 ? "" : "_" + meta));
private static void registerMultipart(Block block, int meta) {
MicroMaterialRegistry.registerMaterial(
new BlockMicroMaterial(block, meta), block.getUnlocalizedName() + (meta == 0 ? "" : "_" + meta));
}
}
@@ -7,27 +7,25 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class EntityBloodTNT extends Entity
{
public class EntityBloodTNT extends Entity {
public int fuse;
private EntityLivingBase tntPlacedBy;
public EntityBloodTNT(World par1World)
{
public EntityBloodTNT(World par1World) {
super(par1World);
preventEntitySpawning = true;
setSize(0.98F, 0.98F);
yOffset = height / 2.0F;
}
public EntityBloodTNT(World par1World, double par2, double par4, double par6, EntityLivingBase par8EntityLivingBase)
{
public EntityBloodTNT(
World par1World, double par2, double par4, double par6, EntityLivingBase par8EntityLivingBase) {
this(par1World);
setPosition(par2, par4, par6);
float f = (float)(Math.random() * Math.PI * 2.0D);
motionX = (double)(-((float)Math.sin((double)f)) * 0.02F);
float f = (float) (Math.random() * Math.PI * 2.0D);
motionX = (double) (-((float) Math.sin((double) f)) * 0.02F);
motionY = 0.20000000298023224D;
motionZ = (double)(-((float)Math.cos((double)f)) * 0.02F);
motionZ = (double) (-((float) Math.cos((double) f)) * 0.02F);
fuse = 60;
prevPosX = par2;
prevPosY = par4;
@@ -39,20 +37,17 @@ public class EntityBloodTNT extends Entity
public void entityInit() {}
@Override
public boolean canTriggerWalking()
{
public boolean canTriggerWalking() {
return false;
}
@Override
public boolean canBeCollidedWith()
{
public boolean canBeCollidedWith() {
return !isDead;
}
@Override
public void onUpdate()
{
public void onUpdate() {
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
@@ -62,53 +57,43 @@ public class EntityBloodTNT extends Entity
motionY *= 0.9800000190734863D;
motionZ *= 0.9800000190734863D;
if (onGround)
{
if (onGround) {
motionY *= -0.5D;
}
if (fuse-- <= 0)
{
if (fuse-- <= 0) {
setDead();
if (!worldObj.isRemote)
{
if (!worldObj.isRemote) {
explode();
}
}
else
{
} else {
worldObj.spawnParticle("smoke", posX, posY + 0.5D, posZ, 0.0D, 0.0D, 0.0D);
}
}
private void explode()
{
private void explode() {
float f = 6.0F;
worldObj.createExplosion(this, posX, posY, posZ, f, true);
}
@Override
protected void writeEntityToNBT(NBTTagCompound par1)
{
protected void writeEntityToNBT(NBTTagCompound par1) {
par1.setByte("Fuse", (byte) fuse);
}
@Override
protected void readEntityFromNBT(NBTTagCompound par1)
{
protected void readEntityFromNBT(NBTTagCompound par1) {
fuse = par1.getByte("Fuse");
}
@Override
@SideOnly(Side.CLIENT)
public float getShadowSize()
{
public float getShadowSize() {
return 0.0F;
}
public EntityLivingBase getTntPlacedBy()
{
public EntityLivingBase getTntPlacedBy() {
return tntPlacedBy;
}
}
@@ -4,6 +4,7 @@ import com.arc.bloodarsenal.common.BloodArsenal;
import com.arc.bloodarsenal.common.items.ModItems;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import java.util.Random;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.passive.EntityWolf;
@@ -12,59 +13,42 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import java.util.Random;
public class ModLivingDropsEvent
{
public class ModLivingDropsEvent {
@SubscribeEvent
public void onEntityDrop(LivingDropsEvent event)
{
public void onEntityDrop(LivingDropsEvent event) {
Random random = new Random();
if (GameRegistry.findItem(BloodArsenal.MODID, "heart") != null)
{
if (event.source.getDamageType().equals("player"))
{
if (GameRegistry.findItem(BloodArsenal.MODID, "heart") != null) {
if (event.source.getDamageType().equals("player")) {
PotionEffect effect = event.entityLiving.getActivePotionEffect(Potion.weakness);
if (event.entityLiving instanceof EntityZombie)
{
if (effect != null)
{
if (random.nextFloat() < 0.01F)
{
if (event.entityLiving instanceof EntityZombie) {
if (effect != null) {
if (random.nextFloat() < 0.01F) {
event.entityLiving.dropItem(ModItems.heart, 1);
}
}
}
if (event.entityLiving instanceof EntityVillager)
{
if (effect != null)
{
if (random.nextFloat() < 0.25F)
{
if (event.entityLiving instanceof EntityVillager) {
if (effect != null) {
if (random.nextFloat() < 0.25F) {
event.entityLiving.dropItem(ModItems.heart, 1);
}
}
}
if (event.entityLiving instanceof EntityPlayer)
{
if (effect != null)
{
if (event.entityLiving instanceof EntityPlayer) {
if (effect != null) {
event.entityLiving.dropItem(ModItems.heart, 1);
}
}
}
}
if (GameRegistry.findItem(BloodArsenal.MODID, "wolf_hide") != null)
{
if (event.entityLiving instanceof EntityWolf)
{
if (random.nextFloat() < 0.4F)
{
if (GameRegistry.findItem(BloodArsenal.MODID, "wolf_hide") != null) {
if (event.entityLiving instanceof EntityWolf) {
if (random.nextFloat() < 0.4F) {
event.entityLiving.dropItem(ModItems.wolf_hide, 1);
}
}
@@ -8,8 +8,7 @@ import net.minecraft.pathfinding.PathPoint;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class AIAttackOnCollide extends EntityAIBase
{
public class AIAttackOnCollide extends EntityAIBase {
World worldObj;
EntityCreature attacker;
int attackTick;
@@ -24,14 +23,12 @@ public class AIAttackOnCollide extends EntityAIBase
private int failedPathFindingPenalty;
public AIAttackOnCollide(EntityCreature p_i1635_1_, Class p_i1635_2_, double p_i1635_3_, boolean p_i1635_5_)
{
public AIAttackOnCollide(EntityCreature p_i1635_1_, Class p_i1635_2_, double p_i1635_3_, boolean p_i1635_5_) {
this(p_i1635_1_, p_i1635_3_, p_i1635_5_);
this.classTarget = p_i1635_2_;
}
public AIAttackOnCollide(EntityCreature p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_)
{
public AIAttackOnCollide(EntityCreature p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_) {
this.attacker = p_i1636_1_;
this.worldObj = p_i1636_1_.worldObj;
this.speedTowardsTarget = p_i1636_2_;
@@ -40,117 +37,107 @@ public class AIAttackOnCollide extends EntityAIBase
}
@Override
public boolean shouldExecute()
{
public boolean shouldExecute() {
EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
if (entitylivingbase == null)
{
if (entitylivingbase == null) {
return false;
}
else if (!entitylivingbase.isEntityAlive())
{
} else if (!entitylivingbase.isEntityAlive()) {
return false;
}
else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass()))
{
} else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) {
return false;
}
else
{
if (-- this.field_75445_i <= 0)
{
} else {
if (--this.field_75445_i <= 0) {
this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase);
this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7);
return this.entityPathEntity != null;
}
else
{
} else {
return true;
}
}
}
@Override
public boolean continueExecuting()
{
public boolean continueExecuting() {
EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
return entitylivingbase != null && entitylivingbase.isEntityAlive() && (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.isWithinHomeDistance(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)));
return entitylivingbase != null
&& entitylivingbase.isEntityAlive()
&& (!this.longMemory
? !this.attacker.getNavigator().noPath()
: this.attacker.isWithinHomeDistance(
MathHelper.floor_double(entitylivingbase.posX),
MathHelper.floor_double(entitylivingbase.posY),
MathHelper.floor_double(entitylivingbase.posZ)));
}
@Override
public void startExecuting()
{
public void startExecuting() {
this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget);
this.field_75445_i = 0;
}
@Override
public void resetTask()
{
public void resetTask() {
this.attacker.getNavigator().clearPathEntity();
}
@Override
public void updateTask()
{
public void updateTask() {
EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
this.attacker.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F);
double d0 = this.attacker.getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ);
double d1 = (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + entitylivingbase.width);
double d0 = this.attacker.getDistanceSq(
entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ);
double d1 = (double) (this.attacker.width * 2.0F * this.attacker.width * 2.0F + entitylivingbase.width);
--this.field_75445_i;
if ((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase)) && this.field_75445_i <= 0 && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D || entitylivingbase.getDistanceSq(this.field_151497_i, this.field_151495_j, this.field_151496_k) >= 1.0D || this.attacker.getRNG().nextFloat() < 0.05F))
{
if ((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase))
&& this.field_75445_i <= 0
&& (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D
|| entitylivingbase.getDistanceSq(this.field_151497_i, this.field_151495_j, this.field_151496_k)
>= 1.0D
|| this.attacker.getRNG().nextFloat() < 0.05F)) {
this.field_151497_i = entitylivingbase.posX;
this.field_151495_j = entitylivingbase.boundingBox.minY;
this.field_151496_k = entitylivingbase.posZ;
this.field_75445_i = failedPathFindingPenalty + 4 + this.attacker.getRNG().nextInt(7);
this.field_75445_i =
failedPathFindingPenalty + 4 + this.attacker.getRNG().nextInt(7);
if (this.attacker.getNavigator().getPath() != null)
{
PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint();
if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1)
{
if (this.attacker.getNavigator().getPath() != null) {
PathPoint finalPathPoint =
this.attacker.getNavigator().getPath().getFinalPathPoint();
if (finalPathPoint != null
&& entitylivingbase.getDistanceSq(
finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord)
< 1) {
failedPathFindingPenalty = 0;
}
else
{
} else {
failedPathFindingPenalty += 10;
}
}
else
{
} else {
failedPathFindingPenalty += 10;
}
if (d0 > 1024.0D)
{
if (d0 > 1024.0D) {
this.field_75445_i += 10;
}
else if (d0 > 256.0D)
{
} else if (d0 > 256.0D) {
this.field_75445_i += 5;
}
if (!this.attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget))
{
if (!this.attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) {
this.field_75445_i += 15;
}
}
this.attackTick = Math.max(this.attackTick - 1, 0);
if (d0 <= d1 && this.attackTick <= 20)
{
if (d0 <= d1 && this.attackTick <= 20) {
this.attackTick = 20;
if (this.attacker.getHeldItem() != null)
{
if (this.attacker.getHeldItem() != null) {
this.attacker.swingItem();
}
this.attacker.attackEntityAsMob(entitylivingbase);
}
}
}
}
@@ -7,8 +7,7 @@ import net.minecraft.pathfinding.PathNavigate;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class AIFollowOwner extends EntityAIBase
{
public class AIFollowOwner extends EntityAIBase {
private EntityTameable thePet;
private EntityLivingBase theOwner;
World theWorld;
@@ -19,8 +18,7 @@ public class AIFollowOwner extends EntityAIBase
float minDist;
private boolean field_75344_i;
public AIFollowOwner(EntityTameable p_i1625_1_, double p_i1625_2_, float p_i1625_4_, float p_i1625_5_)
{
public AIFollowOwner(EntityTameable p_i1625_1_, double p_i1625_2_, float p_i1625_4_, float p_i1625_5_) {
this.thePet = p_i1625_1_;
this.theWorld = p_i1625_1_.worldObj;
this.field_75336_f = p_i1625_2_;
@@ -33,24 +31,16 @@ public class AIFollowOwner extends EntityAIBase
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
public boolean shouldExecute() {
EntityLivingBase entitylivingbase = this.thePet.getOwner();
if (entitylivingbase == null)
{
if (entitylivingbase == null) {
return false;
}
else if (this.thePet.isSitting())
{
} else if (this.thePet.isSitting()) {
return false;
}
else if (this.thePet.getDistanceSqToEntity(entitylivingbase) < (double)(this.minDist * this.minDist))
{
} else if (this.thePet.getDistanceSqToEntity(entitylivingbase) < (double) (this.minDist * this.minDist)) {
return false;
}
else
{
} else {
this.theOwner = entitylivingbase;
return true;
}
@@ -59,16 +49,16 @@ public class AIFollowOwner extends EntityAIBase
/**
* Returns whether an in-progress EntityAIBase should continue executing
*/
public boolean continueExecuting()
{
return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) && !this.thePet.isSitting();
public boolean continueExecuting() {
return !this.petPathfinder.noPath()
&& this.thePet.getDistanceSqToEntity(this.theOwner) > (double) (this.maxDist * this.maxDist)
&& !this.thePet.isSitting();
}
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
public void startExecuting() {
this.field_75343_h = 0;
this.field_75344_i = this.thePet.getNavigator().getAvoidsWater();
this.thePet.getNavigator().setAvoidsWater(false);
@@ -77,8 +67,7 @@ public class AIFollowOwner extends EntityAIBase
/**
* Resets the task
*/
public void resetTask()
{
public void resetTask() {
this.theOwner = null;
this.petPathfinder.clearPathEntity();
this.thePet.getNavigator().setAvoidsWater(this.field_75344_i);
@@ -87,33 +76,37 @@ public class AIFollowOwner extends EntityAIBase
/**
* Updates the task
*/
public void updateTask()
{
this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed());
public void updateTask() {
this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)
this.thePet.getVerticalFaceSpeed());
if (!this.thePet.isSitting())
{
if (--this.field_75343_h <= 0)
{
if (!this.thePet.isSitting()) {
if (--this.field_75343_h <= 0) {
this.field_75343_h = 10;
if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f))
{
if (!this.thePet.getLeashed())
{
if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D)
{
if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f)) {
if (!this.thePet.getLeashed()) {
if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) {
int i = MathHelper.floor_double(this.theOwner.posX) - 2;
int j = MathHelper.floor_double(this.theOwner.posZ) - 2;
int k = MathHelper.floor_double(this.theOwner.boundingBox.minY);
for (int l = 0; l <= 4; ++l)
{
for (int i1 = 0; i1 <= 4; ++i1)
{
if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && World.doesBlockHaveSolidTopSurface(this.theWorld, i + l, k - 1, j + i1) && !this.theWorld.getBlock(i + l, k, j + i1).isNormalCube() && !this.theWorld.getBlock(i + l, k + 1, j + i1).isNormalCube())
{
this.thePet.setLocationAndAngles((double)((float)(i + l) + 0.5F), (double)k, (double)((float)(j + i1) + 0.5F), this.thePet.rotationYaw, this.thePet.rotationPitch);
for (int l = 0; l <= 4; ++l) {
for (int i1 = 0; i1 <= 4; ++i1) {
if ((l < 1 || i1 < 1 || l > 3 || i1 > 3)
&& World.doesBlockHaveSolidTopSurface(this.theWorld, i + l, k - 1, j + i1)
&& !this.theWorld
.getBlock(i + l, k, j + i1)
.isNormalCube()
&& !this.theWorld
.getBlock(i + l, k + 1, j + i1)
.isNormalCube()) {
this.thePet.setLocationAndAngles(
(double) ((float) (i + l) + 0.5F),
(double) k,
(double) ((float) (j + i1) + 0.5F),
this.thePet.rotationYaw,
this.thePet.rotationPitch);
this.petPathfinder.clearPathEntity();
return;
}
@@ -125,4 +118,4 @@ public class AIFollowOwner extends EntityAIBase
}
}
}
}
}
@@ -1,19 +1,16 @@
package com.arc.bloodarsenal.common.entity.ai;
import java.util.Iterator;
import java.util.List;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.ai.EntityAITarget;
import net.minecraft.util.AxisAlignedBB;
import java.util.Iterator;
import java.util.List;
public class AIHurtByTarget extends EntityAITarget
{
public class AIHurtByTarget extends EntityAITarget {
boolean entityCallsForHelp;
private int field_142052_b;
public AIHurtByTarget(EntityCreature p_i1660_1_, boolean p_i1660_2_)
{
public AIHurtByTarget(EntityCreature p_i1660_1_, boolean p_i1660_2_) {
super(p_i1660_1_, false);
this.entityCallsForHelp = p_i1660_2_;
this.setMutexBits(1);
@@ -22,8 +19,7 @@ public class AIHurtByTarget extends EntityAITarget
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
public boolean shouldExecute() {
int i = this.taskOwner.func_142015_aE();
return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false);
}
@@ -31,23 +27,30 @@ public class AIHurtByTarget extends EntityAITarget
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
public void startExecuting() {
this.taskOwner.setAttackTarget(this.taskOwner.getAITarget());
this.field_142052_b = this.taskOwner.func_142015_aE();
if (this.entityCallsForHelp)
{
if (this.entityCallsForHelp) {
double d0 = this.getTargetDistance();
List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0));
List list = this.taskOwner.worldObj.getEntitiesWithinAABB(
this.taskOwner.getClass(),
AxisAlignedBB.getBoundingBox(
this.taskOwner.posX,
this.taskOwner.posY,
this.taskOwner.posZ,
this.taskOwner.posX + 1.0D,
this.taskOwner.posY + 1.0D,
this.taskOwner.posZ + 1.0D)
.expand(d0, 10.0D, d0));
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
EntityCreature entitycreature = (EntityCreature)iterator.next();
while (iterator.hasNext()) {
EntityCreature entitycreature = (EntityCreature) iterator.next();
if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget()))
{
if (this.taskOwner != entitycreature
&& entitycreature.getAttackTarget() == null
&& !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) {
entitycreature.setAttackTarget(this.taskOwner.getAITarget());
}
}
@@ -5,48 +5,43 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.util.MathHelper;
public class AILeapAtTarget extends EntityAIBase
{
public class AILeapAtTarget extends EntityAIBase {
EntityLiving leaper;
EntityLivingBase leapTarget;
float leapMotionY;
public AILeapAtTarget(EntityLiving entity, float leapMotionY)
{
public AILeapAtTarget(EntityLiving entity, float leapMotionY) {
this.leaper = entity;
this.leapMotionY = leapMotionY;
setMutexBits(5);
}
@Override
public boolean shouldExecute()
{
public boolean shouldExecute() {
this.leapTarget = this.leaper.getAttackTarget();
if (this.leapTarget == null)
{
if (this.leapTarget == null) {
return false;
}
else
{
} else {
double d0 = this.leaper.getDistanceSqToEntity(this.leapTarget);
return d0 >= 4.0D && d0 <= 16.0D && this.leaper.onGround && this.leaper.getRNG().nextInt(5) == 0;
return d0 >= 4.0D
&& d0 <= 16.0D
&& this.leaper.onGround
&& this.leaper.getRNG().nextInt(5) == 0;
}
}
@Override
public boolean continueExecuting()
{
public boolean continueExecuting() {
return !this.leaper.onGround;
}
public void startExecuting()
{
public void startExecuting() {
double d0 = this.leapTarget.posX - this.leaper.posX;
double d1 = this.leapTarget.posZ - this.leaper.posZ;
float f = MathHelper.sqrt_double(d0 * d0 + d1 * d1);
this.leaper.motionX += d0 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D;
this.leaper.motionZ += d1 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D;
this.leaper.motionY = (double)this.leapMotionY;
this.leaper.motionX += d0 / (double) f * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D;
this.leaper.motionZ += d1 / (double) f * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D;
this.leaper.motionY = (double) this.leapMotionY;
}
}
@@ -4,14 +4,12 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAITarget;
import net.minecraft.entity.passive.EntityTameable;
public class AIOwnerHurtByTarget extends EntityAITarget
{
public class AIOwnerHurtByTarget extends EntityAITarget {
EntityTameable theDefendingTameable;
EntityLivingBase theOwnerAttacker;
private int field_142051_e;
public AIOwnerHurtByTarget(EntityTameable p_i1667_1_)
{
public AIOwnerHurtByTarget(EntityTameable p_i1667_1_) {
super(p_i1667_1_, false);
this.theDefendingTameable = p_i1667_1_;
this.setMutexBits(1);
@@ -20,25 +18,20 @@ public class AIOwnerHurtByTarget extends EntityAITarget
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!this.theDefendingTameable.isTamed())
{
public boolean shouldExecute() {
if (!this.theDefendingTameable.isTamed()) {
return false;
}
else
{
} else {
EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner();
if (entitylivingbase == null)
{
if (entitylivingbase == null) {
return false;
}
else
{
} else {
this.theOwnerAttacker = entitylivingbase.getAITarget();
int i = entitylivingbase.func_142015_aE();
return i != this.field_142051_e && this.isSuitableTarget(this.theOwnerAttacker, false) && this.theDefendingTameable.func_142018_a(this.theOwnerAttacker, entitylivingbase);
return i != this.field_142051_e
&& this.isSuitableTarget(this.theOwnerAttacker, false)
&& this.theDefendingTameable.func_142018_a(this.theOwnerAttacker, entitylivingbase);
}
}
}
@@ -46,16 +39,14 @@ public class AIOwnerHurtByTarget extends EntityAITarget
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
public void startExecuting() {
this.taskOwner.setAttackTarget(this.theOwnerAttacker);
EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner();
if (entitylivingbase != null)
{
if (entitylivingbase != null) {
this.field_142051_e = entitylivingbase.func_142015_aE();
}
super.startExecuting();
}
}
}
@@ -4,14 +4,12 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAITarget;
import net.minecraft.entity.passive.EntityTameable;
public class AIOwnerHurtTarget extends EntityAITarget
{
public class AIOwnerHurtTarget extends EntityAITarget {
EntityTameable theEntityTameable;
EntityLivingBase theTarget;
private int field_142050_e;
public AIOwnerHurtTarget(EntityTameable p_i1668_1_)
{
public AIOwnerHurtTarget(EntityTameable p_i1668_1_) {
super(p_i1668_1_, false);
this.theEntityTameable = p_i1668_1_;
this.setMutexBits(1);
@@ -20,25 +18,20 @@ public class AIOwnerHurtTarget extends EntityAITarget
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!this.theEntityTameable.isTamed())
{
public boolean shouldExecute() {
if (!this.theEntityTameable.isTamed()) {
return false;
}
else
{
} else {
EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner();
if (entitylivingbase == null)
{
if (entitylivingbase == null) {
return false;
}
else
{
} else {
this.theTarget = entitylivingbase.getLastAttacker();
int i = entitylivingbase.getLastAttackerTime();
return i != this.field_142050_e && this.isSuitableTarget(this.theTarget, false) && this.theEntityTameable.func_142018_a(this.theTarget, entitylivingbase);
return i != this.field_142050_e
&& this.isSuitableTarget(this.theTarget, false)
&& this.theEntityTameable.func_142018_a(this.theTarget, entitylivingbase);
}
}
}
@@ -46,13 +39,11 @@ public class AIOwnerHurtTarget extends EntityAITarget
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
public void startExecuting() {
this.taskOwner.setAttackTarget(this.theTarget);
EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner();
if (entitylivingbase != null)
{
if (entitylivingbase != null) {
this.field_142050_e = entitylivingbase.getLastAttackerTime();
}
@@ -25,19 +25,19 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class EntityBloodHound extends EntityTameable
{
public class EntityBloodHound extends EntityTameable {
private float field_70926_e;
private float field_70924_f;
/** true is the wolf is wet else false */
private boolean isShaking;
private boolean field_70928_h;
/** This time increases while wolf is shaking and emitting water particles. */
private float timeWolfIsShaking;
private float prevTimeWolfIsShaking;
public EntityBloodHound(World world)
{
public EntityBloodHound(World world) {
super(world);
setSize(0.9F, 1.2F);
this.tasks.addTask(1, new EntityAISwimming(this));
@@ -52,17 +52,13 @@ public class EntityBloodHound extends EntityTameable
this.setTamed(true);
}
protected void applyEntityAttributes()
{
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D);
if (this.isTamed())
{
if (this.isTamed()) {
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
}
else
{
} else {
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D);
}
}
@@ -70,24 +66,19 @@ public class EntityBloodHound extends EntityTameable
/**
* Returns true if the newer Entity AI code should be run
*/
public boolean isAIEnabled()
{
public boolean isAIEnabled() {
return true;
}
/**
* Sets the active target the Task system uses for tracking
*/
public void setAttackTarget(EntityLivingBase p_70624_1_)
{
public void setAttackTarget(EntityLivingBase p_70624_1_) {
super.setAttackTarget(p_70624_1_);
if (p_70624_1_ == null)
{
if (p_70624_1_ == null) {
this.setAngry(false);
}
else if (!this.isTamed())
{
} else if (!this.isTamed()) {
this.setAngry(true);
}
}
@@ -95,29 +86,25 @@ public class EntityBloodHound extends EntityTameable
/**
* main AI tick function, replaces updateEntityActionState
*/
protected void updateAITick()
{
protected void updateAITick() {
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, (byte) 0);
this.dataWatcher.addObject(20, (byte) BlockColored.func_150032_b(1));
}
protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_)
{
protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) {
this.playSound("mob.wolf.step", 0.15F, 1.0F);
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
{
public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
super.writeEntityToNBT(p_70014_1_);
p_70014_1_.setBoolean("Angry", this.isAngry());
}
@@ -125,8 +112,7 @@ public class EntityBloodHound extends EntityTameable
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
{
public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
super.readEntityFromNBT(p_70037_1_);
this.setAngry(p_70037_1_.getBoolean("Angry"));
}
@@ -134,37 +120,38 @@ public class EntityBloodHound extends EntityTameable
/**
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound()
{
return this.isAngry() ? "mob.wolf.growl" : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark");
protected String getLivingSound() {
return this.isAngry()
? "mob.wolf.growl"
: (this.rand.nextInt(3) == 0
? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F
? "mob.wolf.whine"
: "mob.wolf.panting")
: "mob.wolf.bark");
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
protected String getHurtSound() {
return "mob.wolf.hurt";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
protected String getDeathSound() {
return "mob.wolf.death";
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume()
{
protected float getSoundVolume() {
return 0.4F;
}
protected Item getDropItem()
{
protected Item getDropItem() {
return Item.getItemById(-1);
}
@@ -172,84 +159,79 @@ public class EntityBloodHound extends EntityTameable
* Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
* use this to react to sunlight and start to burn.
*/
public void onLivingUpdate()
{
public void onLivingUpdate() {
super.onLivingUpdate();
if (!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround)
{
if (!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround) {
this.field_70928_h = true;
this.timeWolfIsShaking = 0.0F;
this.prevTimeWolfIsShaking = 0.0F;
this.worldObj.setEntityState(this, (byte)8);
this.worldObj.setEntityState(this, (byte) 8);
}
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
public void onUpdate() {
super.onUpdate();
this.field_70924_f = this.field_70926_e;
if (this.func_70922_bv())
{
if (this.func_70922_bv()) {
this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F;
}
else
{
} else {
this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F;
}
if (this.func_70922_bv())
{
if (this.func_70922_bv()) {
this.numTicksToChaseTarget = 10;
}
if (this.isWet())
{
if (this.isWet()) {
this.isShaking = true;
this.field_70928_h = false;
this.timeWolfIsShaking = 0.0F;
this.prevTimeWolfIsShaking = 0.0F;
}
else if ((this.isShaking || this.field_70928_h) && this.field_70928_h)
{
if (this.timeWolfIsShaking == 0.0F)
{
this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
} else if ((this.isShaking || this.field_70928_h) && this.field_70928_h) {
if (this.timeWolfIsShaking == 0.0F) {
this.playSound(
"mob.wolf.shake",
this.getSoundVolume(),
(this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
}
this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
this.timeWolfIsShaking += 0.05F;
if (this.prevTimeWolfIsShaking >= 2.0F)
{
if (this.prevTimeWolfIsShaking >= 2.0F) {
this.isShaking = false;
this.field_70928_h = false;
this.prevTimeWolfIsShaking = 0.0F;
this.timeWolfIsShaking = 0.0F;
}
if (this.timeWolfIsShaking > 0.4F)
{
float f = (float)this.boundingBox.minY;
int i = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float) Math.PI) * 7.0F);
if (this.timeWolfIsShaking > 0.4F) {
float f = (float) this.boundingBox.minY;
int i = (int) (MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float) Math.PI) * 7.0F);
for (int j = 0; j < i; ++j)
{
for (int j = 0; j < i; ++j) {
float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
this.worldObj.spawnParticle("splash", this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ);
this.worldObj.spawnParticle(
"splash",
this.posX + (double) f1,
(double) (f + 0.8F),
this.posZ + (double) f2,
this.motionX,
this.motionY,
this.motionZ);
}
}
}
}
@SideOnly(Side.CLIENT)
public boolean getWolfShaking()
{
public boolean getWolfShaking() {
return this.isShaking;
}
@@ -257,64 +239,60 @@ public class EntityBloodHound extends EntityTameable
* Used when calculating the amount of shading to apply while the wolf is shaking.
*/
@SideOnly(Side.CLIENT)
public float getShadingWhileShaking(float p_70915_1_)
{
return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_) / 2.0F * 0.25F;
public float getShadingWhileShaking(float p_70915_1_) {
return 0.75F
+ (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_)
/ 2.0F
* 0.25F;
}
@SideOnly(Side.CLIENT)
public float getShakeAngle(float p_70923_1_, float p_70923_2_)
{
float f2 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_ + p_70923_2_) / 1.8F;
public float getShakeAngle(float p_70923_1_, float p_70923_2_) {
float f2 = (this.prevTimeWolfIsShaking
+ (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_
+ p_70923_2_)
/ 1.8F;
if (f2 < 0.0F)
{
if (f2 < 0.0F) {
f2 = 0.0F;
}
else if (f2 > 1.0F)
{
} else if (f2 > 1.0F) {
f2 = 1.0F;
}
return MathHelper.sin(f2 * (float)Math.PI) * MathHelper.sin(f2 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI;
return MathHelper.sin(f2 * (float) Math.PI)
* MathHelper.sin(f2 * (float) Math.PI * 11.0F)
* 0.15F
* (float) Math.PI;
}
public float getEyeHeight()
{
public float getEyeHeight() {
return this.height * 0.8F;
}
@SideOnly(Side.CLIENT)
public float getInterestedAngle(float p_70917_1_)
{
return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * p_70917_1_) * 0.15F * (float)Math.PI;
public float getInterestedAngle(float p_70917_1_) {
return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * p_70917_1_) * 0.15F * (float) Math.PI;
}
/**
* The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
* use in wolves.
*/
public int getVerticalFaceSpeed()
{
public int getVerticalFaceSpeed() {
return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
}
/**
* Called when the entity is attacked.
*/
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_)
{
if (this.isEntityInvulnerable())
{
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
if (this.isEntityInvulnerable()) {
return false;
}
else
{
} else {
Entity entity = p_70097_1_.getEntity();
this.aiSit.setSitting(false);
if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow))
{
if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) {
p_70097_2_ = (p_70097_2_ + 1.0F) / 2.0F;
}
@@ -322,38 +300,30 @@ public class EntityBloodHound extends EntityTameable
}
}
public boolean attackEntityAsMob(Entity p_70652_1_)
{
public boolean attackEntityAsMob(Entity p_70652_1_) {
int i = this.isTamed() ? 4 : 2;
return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float)i);
return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i);
}
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(EntityPlayer p_70085_1_)
{
public boolean interact(EntityPlayer p_70085_1_) {
ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
if (this.isTamed())
{
if (itemstack != null)
{
if (itemstack.getItem() instanceof ItemFood)
{
ItemFood itemfood = (ItemFood)itemstack.getItem();
if (this.isTamed()) {
if (itemstack != null) {
if (itemstack.getItem() instanceof ItemFood) {
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F)
{
if (!p_70085_1_.capabilities.isCreativeMode)
{
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) {
if (!p_70085_1_.capabilities.isCreativeMode) {
--itemstack.stackSize;
}
this.heal((float)itemfood.func_150905_g(itemstack));
this.heal((float) itemfood.func_150905_g(itemstack));
if (itemstack.stackSize <= 0)
{
if (itemstack.stackSize <= 0) {
p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null);
}
@@ -362,31 +332,24 @@ public class EntityBloodHound extends EntityTameable
}
}
if (this.func_152114_e(p_70085_1_) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack))
{
if (this.func_152114_e(p_70085_1_) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack)) {
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
}
else if (itemstack != null && itemstack.getItem() == Items.bone && !this.isAngry())
{
if (!p_70085_1_.capabilities.isCreativeMode)
{
} else if (itemstack != null && itemstack.getItem() == Items.bone && !this.isAngry()) {
if (!p_70085_1_.capabilities.isCreativeMode) {
--itemstack.stackSize;
}
if (itemstack.stackSize <= 0)
{
if (itemstack.stackSize <= 0) {
p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null);
}
if (!this.worldObj.isRemote)
{
if (this.rand.nextInt(3) == 0)
{
if (!this.worldObj.isRemote) {
if (this.rand.nextInt(3) == 0) {
this.setTamed(true);
this.setPathToEntity(null);
this.setAttackTarget(null);
@@ -394,12 +357,10 @@ public class EntityBloodHound extends EntityTameable
this.setHealth(20.0F);
this.func_152115_b(p_70085_1_.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte)7);
}
else
{
this.worldObj.setEntityState(this, (byte) 7);
} else {
this.playTameEffect(false);
this.worldObj.setEntityState(this, (byte)6);
this.worldObj.setEntityState(this, (byte) 6);
}
}
@@ -410,96 +371,84 @@ public class EntityBloodHound extends EntityTameable
}
@SideOnly(Side.CLIENT)
public void handleHealthUpdate(byte p_70103_1_)
{
if (p_70103_1_ == 8)
{
public void handleHealthUpdate(byte p_70103_1_) {
if (p_70103_1_ == 8) {
this.field_70928_h = true;
this.timeWolfIsShaking = 0.0F;
this.prevTimeWolfIsShaking = 0.0F;
}
else
{
} else {
super.handleHealthUpdate(p_70103_1_);
}
}
@SideOnly(Side.CLIENT)
public float getTailRotation()
{
return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F));
public float getTailRotation() {
return this.isAngry()
? 1.5393804F
: (this.isTamed()
? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float) Math.PI
: ((float) Math.PI / 5F));
}
/**
* Will return how many at most can spawn in a chunk at once.
*/
public int getMaxSpawnedInChunk()
{
public int getMaxSpawnedInChunk() {
return 8;
}
/**
* Determines whether this wolf is angry or not.
*/
public boolean isAngry()
{
public boolean isAngry() {
return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0;
}
/**
* Sets whether this wolf is angry or not.
*/
public void setAngry(boolean p_70916_1_)
{
public void setAngry(boolean p_70916_1_) {
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
if (p_70916_1_)
{
if (p_70916_1_) {
this.dataWatcher.updateObject(16, b0 | 2);
}
else
{
} else {
this.dataWatcher.updateObject(16, b0 & -3);
}
}
public boolean func_70922_bv()
{
public boolean func_70922_bv() {
return this.dataWatcher.getWatchableObjectByte(19) == 1;
}
/**
* Determines if an entity can be despawned, used on idle far away entities
*/
protected boolean canDespawn()
{
protected boolean canDespawn() {
return !this.isTamed() && this.ticksExisted > 2400;
}
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
{
if (p_142018_1_ instanceof EntityWolf)
{
EntityWolf entitywolf = (EntityWolf)p_142018_1_;
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
if (p_142018_1_ instanceof EntityWolf) {
EntityWolf entitywolf = (EntityWolf) p_142018_1_;
if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
{
if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_) {
return false;
}
}
return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
}
else
{
return p_142018_1_ instanceof EntityPlayer
&& p_142018_2_ instanceof EntityPlayer
&& !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_)
? false
: !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
} else {
return false;
}
}
public EntityWolf createChild(EntityAgeable p_90011_1_)
{
public EntityWolf createChild(EntityAgeable p_90011_1_) {
EntityWolf entitywolf = new EntityWolf(this.worldObj);
return entitywolf;
@@ -1,37 +1,40 @@
package com.arc.bloodarsenal.common.gui;
import static com.arc.bloodarsenal.common.BloodArsenalConfig.*;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.client.config.*;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.ConfigElement;
import java.util.ArrayList;
import java.util.List;
public class ConfigGui extends GuiConfig {
public ConfigGui(GuiScreen parentScreen) {
super(
parentScreen,
getConfigElements(parentScreen),
BloodArsenal.MODID,
false,
false,
"BloodArsenal Configuration");
}
import static com.arc.bloodarsenal.common.BloodArsenalConfig.*;
@SuppressWarnings("rawtypes")
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
List<IConfigElement> list = new ArrayList<IConfigElement>();
public class ConfigGui extends GuiConfig
{
public ConfigGui(GuiScreen parentScreen)
{
super(parentScreen, getConfigElements(parentScreen), BloodArsenal.MODID, false, false, "BloodArsenal Configuration");
}
@SuppressWarnings("rawtypes")
private static List<IConfigElement> getConfigElements(GuiScreen parent)
{
List<IConfigElement> list = new ArrayList<IConfigElement>();
// Adds sections declared in BloodArsenalConfig. toLowerCase() is used because the configuration class automatically does this, so must we.
list.add(new ConfigElement<ConfigCategory>(config.getCategory(potionId.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(ritualBlacklist.toLowerCase())));
// Adds sections declared in BloodArsenalConfig. toLowerCase() is used because the configuration class
// automatically does this, so must we.
list.add(new ConfigElement<ConfigCategory>(config.getCategory(potionId.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(ritualBlacklist.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(blockSettings.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(itemSettings.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(modSettings.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(lpSettings.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(misc.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(itemSettings.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(modSettings.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(lpSettings.toLowerCase())));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(misc.toLowerCase())));
return list;
}
}
return list;
}
}
@@ -1,31 +1,26 @@
package com.arc.bloodarsenal.common.gui;
import cpw.mods.fml.client.IModGuiFactory;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import java.util.Set;
public class ConfigGuiFactory implements IModGuiFactory {
@Override
public void initialize(Minecraft minecraftInstance) {}
public class ConfigGuiFactory implements IModGuiFactory
{
@Override
public void initialize(Minecraft minecraftInstance) {}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
return ConfigGui.class;
}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass()
{
return ConfigGui.class;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
return null;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories()
{
return null;
}
@Override
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element)
{
return null;
}
@Override
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
return null;
}
}
@@ -7,13 +7,10 @@ import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler
{
public class GuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
{
switch (id)
{
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
switch (id) {
case 0:
return new ContainerAugmentedHolding(player, new InventoryAugmentedHolding(player.getHeldItem()));
}
@@ -22,10 +19,8 @@ public class GuiHandler implements IGuiHandler
}
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
{
switch (id)
{
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
switch (id) {
case 0:
return new GuiAugmentedHolding(player, new InventoryAugmentedHolding(player.getHeldItem()));
}
@@ -2,28 +2,33 @@ package com.arc.bloodarsenal.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import java.util.List;
public class ItemBloodArsenal extends Item
{
private static final String[] ITEM_NAMES = new String[] {"amorphic_catalyst", "blood_infused_stick", "blood_infused_iron", "soul_fragment", "orange_juice", "blood_infused_glowstone_dust", "wolf_hide"};
public class ItemBloodArsenal extends Item {
private static final String[] ITEM_NAMES = new String[] {
"amorphic_catalyst",
"blood_infused_stick",
"blood_infused_iron",
"soul_fragment",
"orange_juice",
"blood_infused_glowstone_dust",
"wolf_hide"
};
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ItemBloodArsenal()
{
public ItemBloodArsenal() {
super();
// setCreativeTab(BloodArsenal.BA_TAB);
// setCreativeTab(BloodArsenal.BA_TAB);
}
/* @Override
/* @Override
public void registerIcons(IIconRegister iconRegister)
{
icons = new IIcon[ITEM_NAMES.length];
@@ -43,60 +48,53 @@ public class ItemBloodArsenal extends Item
}
*/
// String unlocalizedName = this.getUnlocalizedName().replaceAll("item.", "");
// itemIcon = iconRegister.registerIcon(BloodArsenal.MODID + ":" + unlocalizedName);
// String unlocalizedName = this.getUnlocalizedName().replaceAll("item.", "");
// itemIcon = iconRegister.registerIcon(BloodArsenal.MODID + ":" + unlocalizedName);
/* if (this.equals(ModItems.amorphic_catalyst))
itemIcon = iconRegister.registerIcon("BloodArsenal:amorphic_catalyst");
else if (this.equals(ModItems.blood_infused_iron))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_iron");
else if (this.equals(ModItems.soul_fragment))
itemIcon = iconRegister.registerIcon("BloodArsenal:soul_fragment");
else if (this.equals(ModItems.heart))
itemIcon = iconRegister.registerIcon("BloodArsenal:heart");
else if (this.equals(ModItems.blood_infused_stick))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_stick");
else if (this.equals(ModItems.blood_cookie))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_cookie");
else if (this.equals(ModItems.orange_juice))
itemIcon = iconRegister.registerIcon("BloodArsenal:orange_juice");
else if (this.equals(ModItems.blood_infused_glowstone_dust))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_glowstone_dust");
else if (this.equals(ModItems.wolf_hide))
itemIcon = iconRegister.registerIcon("BloodArsenal:wolf_hide");
else if (this.equals(ModItems.blood_burned_string))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_burned_string");
else if (this.equals(ModItems.glass_shard))
itemIcon = iconRegister.registerIcon("BloodArsenal:glass_shard");
/* if (this.equals(ModItems.amorphic_catalyst))
itemIcon = iconRegister.registerIcon("BloodArsenal:amorphic_catalyst");
else if (this.equals(ModItems.blood_infused_iron))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_iron");
else if (this.equals(ModItems.soul_fragment))
itemIcon = iconRegister.registerIcon("BloodArsenal:soul_fragment");
else if (this.equals(ModItems.heart))
itemIcon = iconRegister.registerIcon("BloodArsenal:heart");
else if (this.equals(ModItems.blood_infused_stick))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_stick");
else if (this.equals(ModItems.blood_cookie))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_cookie");
else if (this.equals(ModItems.orange_juice))
itemIcon = iconRegister.registerIcon("BloodArsenal:orange_juice");
else if (this.equals(ModItems.blood_infused_glowstone_dust))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_glowstone_dust");
else if (this.equals(ModItems.wolf_hide))
itemIcon = iconRegister.registerIcon("BloodArsenal:wolf_hide");
else if (this.equals(ModItems.blood_burned_string))
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_burned_string");
else if (this.equals(ModItems.glass_shard))
itemIcon = iconRegister.registerIcon("BloodArsenal:glass_shard");
}
*/
}
*/
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
if (this.equals(ModItems.amorphic_catalyst))
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (this.equals(ModItems.amorphic_catalyst)) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.amorphic_catalyst"));
}
if (this.equals(ModItems.blood_infused_stick))
{
if (this.equals(ModItems.blood_infused_stick)) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_infused_stick"));
}
if (this.equals(ModItems.blood_infused_iron))
{
if (this.equals(ModItems.blood_infused_iron)) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_infused_iron1"));
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_infused_iron2"));
}
if (this.equals(ModItems.heart))
{
if (this.equals(ModItems.heart)) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.heart"));
}
if (this.equals(ModItems.soul_fragment))
{
if (this.equals(ModItems.soul_fragment)) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_fragment"));
}
if (this.equals(ModItems.glass_shard))
{
if (this.equals(ModItems.glass_shard)) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.glass_shard"));
}
}
@@ -1,6 +1,7 @@
package com.arc.bloodarsenal.common.items;
import com.arc.bloodarsenal.common.BloodArsenal;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
@@ -9,12 +10,8 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class ItemBloodCookie extends ItemFood
{
public ItemBloodCookie()
{
public class ItemBloodCookie extends ItemFood {
public ItemBloodCookie() {
super(2, 0.3F, false);
setUnlocalizedName("blood_cookie");
setTextureName("BloodArsenal:blood_cookie");
@@ -23,20 +20,15 @@ public class ItemBloodCookie extends ItemFood
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_cookie"));
}
@Override
public void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par2World.isRemote)
{
public void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (!par2World.isRemote) {
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 20, 2));
}
else
{
} else {
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
}
}
@@ -6,6 +6,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,17 +18,13 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class ItemBloodMoney extends Item
{
private final int[] MONEY_MULTIPLIER = new int[]{1, 4, 16, 64};
public class ItemBloodMoney extends Item {
private final int[] MONEY_MULTIPLIER = new int[] {1, 4, 16, 64};
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ItemBloodMoney()
{
public ItemBloodMoney() {
super();
setUnlocalizedName("blood_money");
setCreativeTab(BloodArsenal.BA_TAB);
@@ -36,19 +33,16 @@ public class ItemBloodMoney extends Item
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
icons = new IIcon[MONEY_MULTIPLIER.length];
for (int i = 0; i < MONEY_MULTIPLIER.length; ++i)
{
for (int i = 0; i < MONEY_MULTIPLIER.length; ++i) {
icons[i] = iconRegister.registerIcon("BloodArsenal:" + "blood_money" + MONEY_MULTIPLIER[i]);
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
String player = par3EntityPlayer.getCommandSenderName();
World world = par3EntityPlayer.worldObj;
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, player);
@@ -56,69 +50,55 @@ public class ItemBloodMoney extends Item
int currentEssence = SoulNetworkHandler.getCurrentEssence(player);
int CONSTANT = 10000;
if (data == null)
{
if (data == null) {
data = new LifeEssenceNetwork(player);
world.setItemData(player, data);
}
if (world.isRemote)
{
if (world.isRemote) {
return par1ItemStack;
}
if (SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
if (SpellHelper.isFakePlayer(par2World, par3EntityPlayer)) {
return par1ItemStack;
}
int meta = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, MONEY_MULTIPLIER.length - 1);
if (meta == 0)
{
if ((maxLP - currentEssence) >= (MONEY_MULTIPLIER[meta] * CONSTANT) && maxLP >= (MONEY_MULTIPLIER[meta] * CONSTANT))
{
if (meta == 0) {
if ((maxLP - currentEssence) >= (MONEY_MULTIPLIER[meta] * CONSTANT)
&& maxLP >= (MONEY_MULTIPLIER[meta] * CONSTANT)) {
SoulNetworkHandler.addCurrentEssenceToMaximum(player, MONEY_MULTIPLIER[meta] * CONSTANT, maxLP);
}
else
{
par3EntityPlayer.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.bloodMoney.tooMuch")));
} else {
par3EntityPlayer.addChatComponentMessage(
new ChatComponentText(StatCollector.translateToLocal("message.bloodMoney.tooMuch")));
return par1ItemStack;
}
}
else if (meta == 1)
{
if ((maxLP - currentEssence) >= (MONEY_MULTIPLIER[meta] * CONSTANT) && maxLP >= (MONEY_MULTIPLIER[meta] * CONSTANT))
{
} else if (meta == 1) {
if ((maxLP - currentEssence) >= (MONEY_MULTIPLIER[meta] * CONSTANT)
&& maxLP >= (MONEY_MULTIPLIER[meta] * CONSTANT)) {
SoulNetworkHandler.addCurrentEssenceToMaximum(player, MONEY_MULTIPLIER[meta] * CONSTANT, maxLP);
}
else
{
par3EntityPlayer.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.bloodMoney.tooMuch")));
} else {
par3EntityPlayer.addChatComponentMessage(
new ChatComponentText(StatCollector.translateToLocal("message.bloodMoney.tooMuch")));
return par1ItemStack;
}
}
else if (meta == 2)
{
if ((maxLP - currentEssence) >= (MONEY_MULTIPLIER[meta] * CONSTANT) && maxLP >= (MONEY_MULTIPLIER[meta] * CONSTANT))
{
} else if (meta == 2) {
if ((maxLP - currentEssence) >= (MONEY_MULTIPLIER[meta] * CONSTANT)
&& maxLP >= (MONEY_MULTIPLIER[meta] * CONSTANT)) {
SoulNetworkHandler.addCurrentEssenceToMaximum(player, MONEY_MULTIPLIER[meta] * CONSTANT, maxLP);
}
else
{
par3EntityPlayer.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.bloodMoney.tooMuch")));
} else {
par3EntityPlayer.addChatComponentMessage(
new ChatComponentText(StatCollector.translateToLocal("message.bloodMoney.tooMuch")));
return par1ItemStack;
}
}
else if (meta == 3)
{
if ((maxLP - currentEssence) >= (MONEY_MULTIPLIER[meta] * CONSTANT) && maxLP >= (MONEY_MULTIPLIER[meta] * CONSTANT))
{
} else if (meta == 3) {
if ((maxLP - currentEssence) >= (MONEY_MULTIPLIER[meta] * CONSTANT)
&& maxLP >= (MONEY_MULTIPLIER[meta] * CONSTANT)) {
SoulNetworkHandler.addCurrentEssenceToMaximum(player, MONEY_MULTIPLIER[meta] * CONSTANT, maxLP);
}
else
{
par3EntityPlayer.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.bloodMoney.tooMuch")));
} else {
par3EntityPlayer.addChatComponentMessage(
new ChatComponentText(StatCollector.translateToLocal("message.bloodMoney.tooMuch")));
return par1ItemStack;
}
}
@@ -129,8 +109,7 @@ public class ItemBloodMoney extends Item
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, MONEY_MULTIPLIER.length - 1);
return ("" + "item.blood_money" + MONEY_MULTIPLIER[meta]);
@@ -138,25 +117,21 @@ public class ItemBloodMoney extends Item
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
public IIcon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, MONEY_MULTIPLIER.length - 1);
return icons[j];
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List list)
{
for (int meta = 0; meta < MONEY_MULTIPLIER.length; ++meta)
{
public void getSubItems(Item id, CreativeTabs creativeTab, List list) {
for (int meta = 0; meta < MONEY_MULTIPLIER.length; ++meta) {
list.add(new ItemStack(id, 1, meta));
}
}
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4)
{
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
list.add(StatCollector.translateToLocal("tooltip.bloodMoney.money"));
}
}
@@ -1,17 +1,14 @@
package com.arc.bloodarsenal.common.items;
import com.arc.bloodarsenal.common.BloodArsenal;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import java.util.List;
public class ItemBloodOrange extends ItemFood
{
public ItemBloodOrange()
{
public class ItemBloodOrange extends ItemFood {
public ItemBloodOrange() {
super(2, 0.2F, false);
setUnlocalizedName("blood_orange");
setTextureName("BloodArsenal:blood_orange");
@@ -19,8 +16,7 @@ public class ItemBloodOrange extends ItemFood
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.blood_orange"));
}
}
@@ -2,6 +2,7 @@ package com.arc.bloodarsenal.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,36 +12,29 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import java.util.List;
public class ItemBoundDiamondShards extends Item
{
private final String[] shardTypes = new String[]{"", "air", "earth", "fire", "water", "dusk", "dawn"};
public class ItemBoundDiamondShards extends Item {
private final String[] shardTypes = new String[] {"", "air", "earth", "fire", "water", "dusk", "dawn"};
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public ItemBoundDiamondShards()
{
public ItemBoundDiamondShards() {
super();
setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
icons = new IIcon[shardTypes.length];
for (int i = 0; i < shardTypes.length; ++i)
{
for (int i = 0; i < shardTypes.length; ++i) {
icons[i] = iconRegister.registerIcon("BloodArsenal:" + "bound_diamond_shard_" + shardTypes[i]);
}
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
public String getUnlocalizedName(ItemStack itemStack) {
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, shardTypes.length - 1);
return "item.bound_diamond_shard_" + shardTypes[meta];
@@ -48,25 +42,21 @@ public class ItemBoundDiamondShards extends Item
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
public IIcon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, shardTypes.length - 1);
return icons[j];
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List list)
{
for (int meta = 0; meta < shardTypes.length; ++meta)
{
public void getSubItems(Item id, CreativeTabs creativeTab, List list) {
for (int meta = 0; meta < shardTypes.length; ++meta) {
list.add(new ItemStack(id, 1, meta));
}
}
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4)
{
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
list.add(StatCollector.translateToLocal("tooltip.boundDiamondShard.shard"));
}
}
@@ -1,6 +1,7 @@
package com.arc.bloodarsenal.common.items;
import com.arc.bloodarsenal.common.BloodArsenal;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
@@ -8,12 +9,8 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import java.util.List;
public class ItemJuiceAndCookies extends ItemFood
{
public ItemJuiceAndCookies()
{
public class ItemJuiceAndCookies extends ItemFood {
public ItemJuiceAndCookies() {
super(6, 0.6F, false);
setMaxStackSize(1);
setUnlocalizedName("juice_and_cookies");
@@ -23,21 +20,16 @@ public class ItemJuiceAndCookies extends ItemFood
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add("Eat after losing");
par3List.add("some blood");
}
@Override
public void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par2World.isRemote)
{
public void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (!par2World.isRemote) {
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 40, 4));
}
else
{
} else {
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
}
}
@@ -3,6 +3,7 @@ package com.arc.bloodarsenal.common.items;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -13,12 +14,8 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class ItemSoulBooster extends Item implements IBindable
{
public ItemSoulBooster()
{
public class ItemSoulBooster extends Item implements IBindable {
public ItemSoulBooster() {
super();
setMaxStackSize(1);
setUnlocalizedName("soul_booster");
@@ -27,20 +24,17 @@ public class ItemSoulBooster extends Item implements IBindable
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
setActivated(par1ItemStack, !getActivated(par1ItemStack));
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
return par1ItemStack;
}
if (!getActivated(par1ItemStack))
{
if (!getActivated(par1ItemStack)) {
return par1ItemStack;
}
@@ -48,30 +42,25 @@ public class ItemSoulBooster extends Item implements IBindable
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
if (!(par3Entity instanceof EntityPlayer))
{
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)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay")
&& par1ItemStack.stackTagCompound.getBoolean("isActive")) {
if (!par3EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 1000);
}
}
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 2, 0));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 2, 0));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.jump.id, 2, 0));
@@ -80,24 +69,20 @@ public class ItemSoulBooster extends Item implements IBindable
}
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
{
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
}
public boolean getActivated(ItemStack par1ItemStack)
{
public boolean getActivated(ItemStack par1ItemStack) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
@@ -105,24 +90,18 @@ public class ItemSoulBooster extends Item implements IBindable
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_booster1"));
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_booster2"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3List.add("Activated");
}
else
{
} else {
par3List.add("Deactivated");
}
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
@@ -4,6 +4,8 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.ReflectionHelper;
import java.util.Collection;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -14,13 +16,8 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.Collection;
import java.util.List;
public class ItemSoulNullifier extends Item implements IBindable
{
public ItemSoulNullifier()
{
public class ItemSoulNullifier extends Item implements IBindable {
public ItemSoulNullifier() {
super();
setMaxStackSize(1);
setUnlocalizedName("soul_nullifier");
@@ -29,20 +26,17 @@ public class ItemSoulNullifier extends Item implements IBindable
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
setActivated(par1ItemStack, !getActivated(par1ItemStack));
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
return par1ItemStack;
}
if (!getActivated(par1ItemStack))
{
if (!getActivated(par1ItemStack)) {
return par1ItemStack;
}
@@ -50,81 +44,68 @@ public class ItemSoulNullifier extends Item implements IBindable
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
if (!(par3Entity instanceof EntityPlayer))
{
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)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay")
&& par1ItemStack.stackTagCompound.getBoolean("isActive")) {
if (!par3EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50);
}
}
if (par1ItemStack.stackTagCompound.getBoolean("isActive") && !par2World.isRemote)
{
if (par3EntityPlayer.ticksExisted % 20 == 0)
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive") && !par2World.isRemote) {
if (par3EntityPlayer.ticksExisted % 20 == 0) {
boolean removed = false;
Collection<PotionEffect> potions = par3EntityPlayer.getActivePotionEffects();
if (par3EntityPlayer.isBurning())
{
if (par3EntityPlayer.isBurning()) {
par3EntityPlayer.extinguish();
removed = true;
}
else for (PotionEffect potion : potions)
{
int id = potion.getPotionID();
boolean badEffect;
} else
for (PotionEffect potion : potions) {
int id = potion.getPotionID();
boolean badEffect;
badEffect = ReflectionHelper.getPrivateValue(Potion.class, Potion.potionTypes[id], new String[]{"isBadEffect", "field_76418_K"});
badEffect = ReflectionHelper.getPrivateValue(
Potion.class, Potion.potionTypes[id], new String[] {"isBadEffect", "field_76418_K"});
if (badEffect)
{
par3EntityPlayer.removePotionEffect(id);
removed = true;
break;
if (badEffect) {
par3EntityPlayer.removePotionEffect(id);
removed = true;
break;
}
}
}
if (removed)
{
if (removed) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 500);
}
}
}
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
{
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
}
public boolean getActivated(ItemStack par1ItemStack)
{
public boolean getActivated(ItemStack par1ItemStack) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
@@ -132,24 +113,18 @@ public class ItemSoulNullifier extends Item implements IBindable
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_nullifier1"));
par3List.add(StatCollector.translateToLocal("tooltip.itemba.soul_nullifier2"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3List.add("Activated");
}
else
{
} else {
par3List.add("Deactivated");
}
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
@@ -15,6 +15,8 @@ import com.arc.bloodarsenal.common.items.tool.*;
import com.arc.bloodarsenal.common.thaumcraft.*;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
import java.util.ArrayList;
import java.util.Arrays;
import net.minecraft.item.Item;
import net.minecraft.item.ItemReed;
import net.minecraft.item.ItemStack;
@@ -24,11 +26,7 @@ import thaumcraft.api.wands.StaffRod;
import thaumcraft.api.wands.WandCap;
import thaumcraft.api.wands.WandRod;
import java.util.ArrayList;
import java.util.Arrays;
public class ModItems
{
public class ModItems {
public static Item bound_bow;
public static Item blood_orange;
public static Item blood_infused_pickaxe_wood;
@@ -103,8 +101,7 @@ public class ModItems
public static ArrayList<String> itemsNotToBeRegistered = new ArrayList<String>();
public static void init()
{
public static void init() {
bound_bow = registerItem(new BoundBow(), "bound_bow");
blood_orange = registerItem(new ItemBloodOrange(), "blood_orange");
blood_infused_pickaxe_wood = registerItem(new InfusedWoodPickaxe(), "blood_infused_pickaxe_wood");
@@ -165,44 +162,58 @@ public class ModItems
}
@Optional.Method(modid = "Baubles")
public static void registerBaubles()
{
public static void registerBaubles() {
vampire_ring = registerItem(new VampireRing(), "vampire_ring");
self_sacrifice_amulet = registerItem(new SelfSacrificeAmulet(), "self_sacrifice_amulet");
sacrifice_amulet = registerItem(new SacrificeAmulet(), "sacrifice_amulet");
empowered_sacrifice_amulet = registerItem(new EmpoweredSacrificeAmulet(), "empowered_sacrifice_amulet");
empowered_self_sacrifice_amulet = registerItem(new EmpoweredSelfSacrificeAmulet(), "empowered_self_sacrifice_amulet");
empowered_self_sacrifice_amulet =
registerItem(new EmpoweredSelfSacrificeAmulet(), "empowered_self_sacrifice_amulet");
}
@Optional.Method(modid = "Thaumcraft")
public static void registerThaumcraftItems()
{
public static void registerThaumcraftItems() {
wandCore = (new ItemWandCores()).setUnlocalizedName("wand_cores");
GameRegistry.registerItem(wandCore, "wand_cores");
wandCap = (new ItemWandCaps()).setUnlocalizedName("wand_caps");
GameRegistry.registerItem(wandCap, "wand_caps");
WAND_ROD_BLOOD_INFUSED_WOOD = new WandRod("blood_wood", 100, new ItemStack(wandCore, 1, 0), 16, new BloodWoodWandUpdate(), new ResourceLocation("bloodarsenal", "models/wand_rod_blood_wood.png"));
STAFF_ROD_BLOOD_INFUSED_WOOD = new StaffRod("blood_wood", 60, new ItemStack(wandCore, 1, 1), 27, new BloodWoodStaffUpdate(), new ResourceLocation("bloodarsenal", "models/wand_rod_blood_wood.png"));
WAND_CAP_BLOOD_INFUSED_IRON = new BloodyWandCap("blood_iron", 0.85F, Arrays.asList(new Aspect[]{Aspect.WATER}), 0.80F, new ItemStack(wandCap, 1, 0), 5, new ResourceLocation("bloodarsenal", "models/wand_cap_blood_iron.png"));
WAND_ROD_BLOOD_INFUSED_WOOD = new WandRod(
"blood_wood",
100,
new ItemStack(wandCore, 1, 0),
16,
new BloodWoodWandUpdate(),
new ResourceLocation("bloodarsenal", "models/wand_rod_blood_wood.png"));
STAFF_ROD_BLOOD_INFUSED_WOOD = new StaffRod(
"blood_wood",
60,
new ItemStack(wandCore, 1, 1),
27,
new BloodWoodStaffUpdate(),
new ResourceLocation("bloodarsenal", "models/wand_rod_blood_wood.png"));
WAND_CAP_BLOOD_INFUSED_IRON = new BloodyWandCap(
"blood_iron",
0.85F,
Arrays.asList(new Aspect[] {Aspect.WATER}),
0.80F,
new ItemStack(wandCap, 1, 0),
5,
new ResourceLocation("bloodarsenal", "models/wand_cap_blood_iron.png"));
}
public static Item registerItem(Item item, String unlocalizedName)
{
public static Item registerItem(Item item, String unlocalizedName) {
item.setUnlocalizedName(unlocalizedName);
item.setTextureName(BloodArsenal.MODID + ":" + unlocalizedName);
item.setCreativeTab(BloodArsenal.BA_TAB);
itemsNotToBeRegistered.clear();
for (String unlocName : BloodArsenalConfig.itemsToBeDisabled)
{
if (unlocName.equals(unlocalizedName))
{
for (String unlocName : BloodArsenalConfig.itemsToBeDisabled) {
if (unlocName.equals(unlocalizedName)) {
itemsNotToBeRegistered.add(unlocName);
}
}
if (!itemsNotToBeRegistered.contains(unlocalizedName))
{
if (!itemsNotToBeRegistered.contains(unlocalizedName)) {
GameRegistry.registerItem(item, unlocalizedName);
}
@@ -4,6 +4,8 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import com.arc.bloodarsenal.common.BloodArsenal;
import com.arc.bloodarsenal.common.items.ModItems;
import com.arc.bloodarsenal.common.items.tool.IFillable;
import java.util.List;
import java.util.Random;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -22,37 +24,28 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import java.util.List;
import java.util.Random;
public class ElementalLifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillable
{
public class ElementalLifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillable {
private final int maxLP = 100000;
private String LP_STORED = "LPStored";
public ElementalLifeImbuedArmor(int armorType)
{
public ElementalLifeImbuedArmor(int armorType) {
super(BloodArsenal.elementalLifeImbuedArmor, 0, armorType);
}
/** IFillable */
@Override
public int getMaxLP()
{
public int getMaxLP() {
return maxLP;
}
@Override
public void incrementLPStored(ItemStack itemStack, int incrementAmount)
{
public void incrementLPStored(ItemStack itemStack, int incrementAmount) {
setCurrentLPStored(itemStack, getLPStored(itemStack) + incrementAmount);
}
@Override
public int getLPStored(ItemStack container)
{
if (container.stackTagCompound == null)
{
public int getLPStored(ItemStack container) {
if (container.stackTagCompound == null) {
setCurrentLPStored(container, 0);
}
@@ -60,66 +53,54 @@ public class ElementalLifeImbuedArmor extends ItemArmor implements ISpecialArmor
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.armor.elementalLifeImbuedArmor"));
par3List.add(StatCollector.translateToLocal("tooltip.fillable.currentAmount") + " " + EnumChatFormatting.RED + par1ItemStack.getTagCompound().getInteger(LP_STORED));
par3List.add(StatCollector.translateToLocal("tooltip.fillable.currentAmount") + " " + EnumChatFormatting.RED
+ par1ItemStack.getTagCompound().getInteger(LP_STORED));
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if (this != ModItems.life_imbued_leggings)
{
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
if (this != ModItems.life_imbued_leggings) {
return "BloodArsenal:models/armor/life_imbued_layer_1.png";
}
else
{
} else {
return "BloodArsenal:models/armor/life_imbued_layer_2.png";
}
}
@Override
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack)
{
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack) {
return false;
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
return super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
}
@Override
public int getMaxDamage(ItemStack stack)
{
public int getMaxDamage(ItemStack stack) {
return maxLP;
}
@Override
public EnumRarity getRarity(ItemStack stack)
{
public EnumRarity getRarity(ItemStack stack) {
return EnumRarity.rare;
}
@Override
public void setDamage(ItemStack stack, int damage)
{
public void setDamage(ItemStack stack, int damage) {
super.setDamage(stack, 0);
}
@Override
public boolean isDamaged(ItemStack stack)
{
public boolean isDamaged(ItemStack stack) {
return true;
}
@Override
public int getDisplayDamage(ItemStack stack)
{
if (stack.stackTagCompound == null)
{
public int getDisplayDamage(ItemStack stack) {
if (stack.stackTagCompound == null) {
setCurrentLPStored(stack, 0);
}
@@ -127,22 +108,18 @@ public class ElementalLifeImbuedArmor extends ItemArmor implements ISpecialArmor
}
@Override
public boolean showDurabilityBar(ItemStack stack)
{
public boolean showDurabilityBar(ItemStack stack) {
return stack.stackTagCompound == null || !stack.stackTagCompound.getBoolean("CreativeTab");
}
@Override
public void getSubItems(Item item, CreativeTabs tab, List list)
{
public void getSubItems(Item item, CreativeTabs tab, List list) {
list.add(setCurrentLPStored(new ItemStack(item, 1, 0), 0));
list.add(setCurrentLPStored(new ItemStack(item, 1, 0), maxLP));
}
private ItemStack setCurrentLPStored(ItemStack itemStack, int amount)
{
if (itemStack.stackTagCompound == null)
{
private ItemStack setCurrentLPStored(ItemStack itemStack, int amount) {
if (itemStack.stackTagCompound == null) {
itemStack.setTagCompound(new NBTTagCompound());
}
@@ -150,15 +127,12 @@ public class ElementalLifeImbuedArmor extends ItemArmor implements ISpecialArmor
return itemStack;
}
protected int getBaseAbsorption()
{
protected int getBaseAbsorption() {
return 18;
}
protected int getAbsorptionRatio()
{
switch (armorType)
{
protected int getAbsorptionRatio() {
switch (armorType) {
case 0:
return 15;
case 1:
@@ -173,54 +147,49 @@ public class ElementalLifeImbuedArmor extends ItemArmor implements ISpecialArmor
}
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot)
{
if (getLPStored(armor) >= getLPPerDamage(armor))
{
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
if (getLPStored(armor) >= getLPPerDamage(armor)) {
return Math.min(getBaseAbsorption(), 20) * getAbsorptionRatio() / 100;
}
return 0;
}
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot)
{
public ArmorProperties getProperties(
EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
final double absorbRatio = 0.5;
if (source.isUnblockable())
{
if (source.isUnblockable()) {
int absorbMax = getLPPerDamage(armor) > 0 ? 25 * getLPStored(armor) / getLPPerDamage(armor) : 0;
return new ArmorProperties(0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.025, absorbMax);
return new ArmorProperties(
0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.025, absorbMax);
}
int absorbMax = getLPPerDamage(armor) > 0 ? 25 * getLPStored(armor) / getLPPerDamage(armor) : 0;
return new ArmorProperties(0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.05, absorbMax);
return new ArmorProperties(
0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.05, absorbMax);
}
@Override
public void damageArmor(EntityLivingBase entity, ItemStack armor, DamageSource source, int damage, int slot)
{
public void damageArmor(EntityLivingBase entity, ItemStack armor, DamageSource source, int damage, int slot) {
subtractLP(armor, damage * getLPPerDamage(armor), false);
}
protected int getLPPerDamage(ItemStack stack)
{
int unbreakingLevel = MathHelper.clamp_int(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack), 0, 4);
protected int getLPPerDamage(ItemStack stack) {
int unbreakingLevel = MathHelper.clamp_int(
EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack), 0, 4);
return 100 * (5 - unbreakingLevel) / 5;
}
public int subtractLP(ItemStack container, int maxExtract, boolean simulate)
{
if (container.stackTagCompound == null)
{
public int subtractLP(ItemStack container, int maxExtract, boolean simulate) {
if (container.stackTagCompound == null) {
setCurrentLPStored(container, 0);
}
int stored = container.stackTagCompound.getInteger(LP_STORED);
int extract = Math.min(maxExtract, stored);
if (!simulate)
{
if (!simulate) {
stored -= extract;
container.stackTagCompound.setInteger(LP_STORED, stored);
}
@@ -229,21 +198,19 @@ public class ElementalLifeImbuedArmor extends ItemArmor implements ISpecialArmor
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack armor)
{
if (hasArmorSetItem(player, 0) && hasArmorSetItem(player, 1) && hasArmorSetItem(player, 2) && hasArmorSetItem(player, 3))
{
if (player.getHealth() < player.getMaxHealth() && !player.isPotionActive(AlchemicalWizardry.customPotionInhibit))
{
if (world.getWorldTime() % 50 == 0)
{
public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {
if (hasArmorSetItem(player, 0)
&& hasArmorSetItem(player, 1)
&& hasArmorSetItem(player, 2)
&& hasArmorSetItem(player, 3)) {
if (player.getHealth() < player.getMaxHealth()
&& !player.isPotionActive(AlchemicalWizardry.customPotionInhibit)) {
if (world.getWorldTime() % 50 == 0) {
Random random = new Random();
if (random.nextInt(9) > 7)
{
if (random.nextInt(9) > 7) {
LifeImbuedArmor thisArmor = (LifeImbuedArmor) armor.getItem();
if (thisArmor.getLPStored(armor) >= 2000)
{
if (thisArmor.getLPStored(armor) >= 2000) {
float healHealth = player.getMaxHealth() - player.getHealth();
player.heal(healHealth);
thisArmor.subtractLP(armor, ((int) healHealth) * 500, false);
@@ -254,21 +221,22 @@ public class ElementalLifeImbuedArmor extends ItemArmor implements ISpecialArmor
}
}
public boolean hasArmorSetItem(EntityPlayer player, int i)
{
public boolean hasArmorSetItem(EntityPlayer player, int i) {
ItemStack stack = player.inventory.armorInventory[3 - i];
if (stack == null)
{
if (stack == null) {
return false;
}
switch (i)
{
case 0: return stack.getItem() == ModItems.life_imbued_helmet_water;
case 1: return stack.getItem() == ModItems.life_imbued_chestplate_fire;
case 2: return stack.getItem() == ModItems.life_imbued_leggings_earth;
case 3: return stack.getItem() == ModItems.life_imbued_boots_air;
switch (i) {
case 0:
return stack.getItem() == ModItems.life_imbued_helmet_water;
case 1:
return stack.getItem() == ModItems.life_imbued_chestplate_fire;
case 2:
return stack.getItem() == ModItems.life_imbued_leggings_earth;
case 3:
return stack.getItem() == ModItems.life_imbued_boots_air;
}
return false;
@@ -2,6 +2,7 @@ package com.arc.bloodarsenal.common.items.armor;
import com.arc.bloodarsenal.common.BloodArsenal;
import com.arc.bloodarsenal.common.items.ModItems;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
@@ -9,38 +10,28 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class GlassArmor extends ItemArmor
{
public GlassArmor(int armorType)
{
public class GlassArmor extends ItemArmor {
public GlassArmor(int armorType) {
super(BloodArsenal.glassArmor, 1, armorType);
setMaxDamage(42); // The answer to everything in the universe
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.armor.glassArmor"));
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if (this != ModItems.glass_leggings)
{
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
if (this != ModItems.glass_leggings) {
return "BloodArsenal:models/armor/glass_layer_1.png";
}
else
{
} else {
return "BloodArsenal:models/armor/glass_layer_2.png";
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
return super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
}
}
@@ -4,6 +4,8 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import com.arc.bloodarsenal.common.BloodArsenal;
import com.arc.bloodarsenal.common.items.ModItems;
import com.arc.bloodarsenal.common.items.tool.IFillable;
import java.util.List;
import java.util.Random;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -22,39 +24,30 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import java.util.List;
import java.util.Random;
public class LifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillable
{
public class LifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillable {
private int maxLP = 100000;
private String LP_STORED = "LPStored";
public double absorbRatio = 0.5;
public LifeImbuedArmor(int armorType)
{
public LifeImbuedArmor(int armorType) {
super(BloodArsenal.lifeImbuedArmor, 0, armorType);
setCreativeTab(BloodArsenal.BA_TAB);
}
/** IFillable */
@Override
public int getMaxLP()
{
public int getMaxLP() {
return maxLP;
}
@Override
public void incrementLPStored(ItemStack itemStack, int incrementAmount)
{
public void incrementLPStored(ItemStack itemStack, int incrementAmount) {
setCurrentLPStored(itemStack, getLPStored(itemStack) + incrementAmount);
}
@Override
public int getLPStored(ItemStack container)
{
if (container.stackTagCompound == null)
{
public int getLPStored(ItemStack container) {
if (container.stackTagCompound == null) {
setCurrentLPStored(container, 0);
}
@@ -62,66 +55,54 @@ public class LifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillab
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.armor.lifeImbuedArmor"));
par3List.add(StatCollector.translateToLocal("tooltip.fillable.currentAmount") + " " + EnumChatFormatting.RED + par1ItemStack.getTagCompound().getInteger(LP_STORED));
par3List.add(StatCollector.translateToLocal("tooltip.fillable.currentAmount") + " " + EnumChatFormatting.RED
+ par1ItemStack.getTagCompound().getInteger(LP_STORED));
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if (this != ModItems.life_imbued_leggings)
{
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
if (this != ModItems.life_imbued_leggings) {
return "BloodArsenal:models/armor/life_imbued_layer_1.png";
}
else
{
} else {
return "BloodArsenal:models/armor/life_imbued_layer_2.png";
}
}
@Override
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack)
{
public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack) {
return false;
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
return super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
}
@Override
public int getMaxDamage(ItemStack stack)
{
public int getMaxDamage(ItemStack stack) {
return maxLP;
}
@Override
public EnumRarity getRarity(ItemStack stack)
{
public EnumRarity getRarity(ItemStack stack) {
return EnumRarity.rare;
}
@Override
public void setDamage(ItemStack stack, int damage)
{
public void setDamage(ItemStack stack, int damage) {
super.setDamage(stack, 0);
}
@Override
public boolean isDamaged(ItemStack stack)
{
public boolean isDamaged(ItemStack stack) {
return true;
}
@Override
public int getDisplayDamage(ItemStack stack)
{
if (stack.stackTagCompound == null)
{
public int getDisplayDamage(ItemStack stack) {
if (stack.stackTagCompound == null) {
setCurrentLPStored(stack, 0);
}
@@ -129,22 +110,18 @@ public class LifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillab
}
@Override
public boolean showDurabilityBar(ItemStack stack)
{
public boolean showDurabilityBar(ItemStack stack) {
return stack.stackTagCompound == null || !stack.stackTagCompound.getBoolean("CreativeTab");
}
@Override
public void getSubItems(Item item, CreativeTabs tab, List list)
{
public void getSubItems(Item item, CreativeTabs tab, List list) {
list.add(setCurrentLPStored(new ItemStack(item, 1, 0), 0));
list.add(setCurrentLPStored(new ItemStack(item, 1, 0), maxLP));
}
private ItemStack setCurrentLPStored(ItemStack itemStack, int amount)
{
if (itemStack.stackTagCompound == null)
{
private ItemStack setCurrentLPStored(ItemStack itemStack, int amount) {
if (itemStack.stackTagCompound == null) {
itemStack.setTagCompound(new NBTTagCompound());
}
@@ -152,15 +129,12 @@ public class LifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillab
return itemStack;
}
protected int getBaseAbsorption()
{
protected int getBaseAbsorption() {
return 18;
}
protected int getAbsorptionRatio()
{
switch (armorType)
{
protected int getAbsorptionRatio() {
switch (armorType) {
case 0:
return 15;
case 1:
@@ -175,52 +149,47 @@ public class LifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillab
}
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot)
{
if (getLPStored(armor) >= getLPPerDamage(armor))
{
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
if (getLPStored(armor) >= getLPPerDamage(armor)) {
return Math.min(getBaseAbsorption(), 20) * getAbsorptionRatio() / 100;
}
return 0;
}
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot)
{
if (source.isUnblockable())
{
public ArmorProperties getProperties(
EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
if (source.isUnblockable()) {
int absorbMax = getLPPerDamage(armor) > 0 ? 25 * getLPStored(armor) / getLPPerDamage(armor) : 0;
return new ArmorProperties(0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.025, absorbMax);
return new ArmorProperties(
0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.025, absorbMax);
}
int absorbMax = getLPPerDamage(armor) > 0 ? 25 * getLPStored(armor) / getLPPerDamage(armor) : 0;
return new ArmorProperties(0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.05, absorbMax);
return new ArmorProperties(
0, absorbRatio * getArmorMaterial().getDamageReductionAmount(armorType) * 0.05, absorbMax);
}
@Override
public void damageArmor(EntityLivingBase entity, ItemStack armor, DamageSource source, int damage, int slot)
{
public void damageArmor(EntityLivingBase entity, ItemStack armor, DamageSource source, int damage, int slot) {
subtractLP(armor, damage * getLPPerDamage(armor), false);
}
protected int getLPPerDamage(ItemStack stack)
{
int unbreakingLevel = MathHelper.clamp_int(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack), 0, 4);
protected int getLPPerDamage(ItemStack stack) {
int unbreakingLevel = MathHelper.clamp_int(
EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack), 0, 4);
return 100 * (5 - unbreakingLevel) / 5;
}
public int subtractLP(ItemStack container, int maxExtract, boolean simulate)
{
if (container.stackTagCompound == null)
{
public int subtractLP(ItemStack container, int maxExtract, boolean simulate) {
if (container.stackTagCompound == null) {
setCurrentLPStored(container, 0);
}
int stored = container.stackTagCompound.getInteger(LP_STORED);
int extract = Math.min(maxExtract, stored);
if (!simulate)
{
if (!simulate) {
stored -= extract;
container.stackTagCompound.setInteger(LP_STORED, stored);
}
@@ -229,21 +198,19 @@ public class LifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillab
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack armor)
{
if (hasArmorSetItem(player, 0) && hasArmorSetItem(player, 1) && hasArmorSetItem(player, 2) && hasArmorSetItem(player, 3))
{
if (player.getHealth() < player.getMaxHealth() && !player.isPotionActive(AlchemicalWizardry.customPotionInhibit))
{
if (world.getWorldTime() % 50 == 0)
{
public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {
if (hasArmorSetItem(player, 0)
&& hasArmorSetItem(player, 1)
&& hasArmorSetItem(player, 2)
&& hasArmorSetItem(player, 3)) {
if (player.getHealth() < player.getMaxHealth()
&& !player.isPotionActive(AlchemicalWizardry.customPotionInhibit)) {
if (world.getWorldTime() % 50 == 0) {
Random random = new Random();
if (random.nextInt(9) > 7)
{
if (random.nextInt(9) > 7) {
LifeImbuedArmor thisArmor = (LifeImbuedArmor) armor.getItem();
if (thisArmor.getLPStored(armor) >= 2000)
{
if (thisArmor.getLPStored(armor) >= 2000) {
float healHealth = player.getMaxHealth() - player.getHealth();
player.setHealth(player.getHealth() + healHealth);
player.onUpdate();
@@ -255,21 +222,22 @@ public class LifeImbuedArmor extends ItemArmor implements ISpecialArmor, IFillab
}
}
public boolean hasArmorSetItem(EntityPlayer player, int i)
{
public boolean hasArmorSetItem(EntityPlayer player, int i) {
ItemStack stack = player.inventory.armorInventory[3 - i];
if (stack == null)
{
if (stack == null) {
return false;
}
switch (i)
{
case 0: return stack.getItem() == ModItems.life_imbued_helmet;
case 1: return stack.getItem() == ModItems.life_imbued_chestplate;
case 2: return stack.getItem() == ModItems.life_imbued_leggings;
case 3: return stack.getItem() == ModItems.life_imbued_boots;
switch (i) {
case 0:
return stack.getItem() == ModItems.life_imbued_helmet;
case 1:
return stack.getItem() == ModItems.life_imbued_chestplate;
case 2:
return stack.getItem() == ModItems.life_imbued_leggings;
case 3:
return stack.getItem() == ModItems.life_imbued_boots;
}
return false;
@@ -1,8 +1,8 @@
package com.arc.bloodarsenal.common.items.armor;
import com.arc.bloodarsenal.client.renderer.model.ModelVampireCostume;
import com.arc.bloodarsenal.common.BloodArsenal;
import com.arc.bloodarsenal.common.items.ModItems;
import com.arc.bloodarsenal.client.renderer.model.ModelVampireCostume;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
@@ -19,19 +19,19 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class VampireCostume extends ItemArmor
{
public class VampireCostume extends ItemArmor {
@SideOnly(Side.CLIENT)
private IIcon chestIcon;
@SideOnly(Side.CLIENT)
private IIcon leggingsIcon;
@SideOnly(Side.CLIENT)
private IIcon bootsIcon;
private boolean tryComplexRendering = true;
public VampireCostume(int armorType)
{
public VampireCostume(int armorType) {
super(BloodArsenal.vampireArmor, 0, armorType);
setMaxDamage(0);
}
@@ -42,33 +42,25 @@ public class VampireCostume extends ItemArmor
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot)
{
if (tryComplexRendering)
{
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
if (tryComplexRendering) {
int type = ((ItemArmor) itemStack.getItem()).armorType;
if (this.model1 == null)
{
if (this.model1 == null) {
this.model1 = new ModelVampireCostume(1.0f, false, true, false, true);
}
if (this.model2 == null)
{
if (this.model2 == null) {
this.model2 = new ModelVampireCostume(0.5f, false, false, true, false);
}
if (type == 1 || type == 3)
{
if (type == 1 || type == 3) {
this.model = model1;
}
else
{
} else {
this.model = model2;
}
if (this.model != null)
{
if (this.model != null) {
this.model.bipedHead.showModel = (type == 1);
this.model.bipedHeadwear.showModel = (type == 1);
this.model.bipedBody.showModel = (type == 1);
@@ -82,18 +74,14 @@ public class VampireCostume extends ItemArmor
this.model.aimedBow = false;
this.model.heldItemRight = (entityLiving.getHeldItem() != null ? 1 : 0);
if (entityLiving instanceof EntityPlayer)
{
if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0)
{
EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction();
if (entityLiving instanceof EntityPlayer) {
if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0) {
EnumAction enumaction =
((EntityPlayer) entityLiving).getItemInUse().getItemUseAction();
if (enumaction == EnumAction.block)
{
if (enumaction == EnumAction.block) {
this.model.heldItemRight = 3;
}
else if (enumaction == EnumAction.bow)
{
} else if (enumaction == EnumAction.bow) {
this.model.aimedBow = true;
}
}
@@ -101,17 +89,14 @@ public class VampireCostume extends ItemArmor
}
return model;
}
else
{
} else {
return super.getArmorModel(entityLiving, itemStack, armorSlot);
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
chestIcon = iconRegister.registerIcon("BloodArsenal:vampire_cape");
leggingsIcon = iconRegister.registerIcon("BloodArsenal:vampire_greaves");
@@ -120,20 +105,16 @@ public class VampireCostume extends ItemArmor
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (equals(ModItems.vampire_cape))
{
public IIcon getIconFromDamage(int par1) {
if (equals(ModItems.vampire_cape)) {
return chestIcon;
}
if (equals(ModItems.vampire_greaves))
{
if (equals(ModItems.vampire_greaves)) {
return leggingsIcon;
}
if (equals(ModItems.vampire_boots))
{
if (equals(ModItems.vampire_boots)) {
return bootsIcon;
}
@@ -141,63 +122,48 @@ public class VampireCostume extends ItemArmor
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if (tryComplexRendering)
{
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
if (tryComplexRendering) {
return "BloodArsenal:models/armor/VampireCostume.png";
}
if (entity instanceof EntityLivingBase)
{
if (this.getIsInvisible(stack))
{
if (this == ModItems.vampire_cape || this == ModItems.vampire_boots)
{
if (entity instanceof EntityLivingBase) {
if (this.getIsInvisible(stack)) {
if (this == ModItems.vampire_cape || this == ModItems.vampire_boots) {
return "BloodArsenal:models/armor/VampireCostume_invisible.png";
}
if (this == ModItems.vampire_greaves)
{
if (this == ModItems.vampire_greaves) {
return "BloodArsenal:models/armor/VampireCostume_invisible2.png";
}
}
}
if (this == ModItems.vampire_cape || this == ModItems.vampire_boots)
{
if (this == ModItems.vampire_cape || this == ModItems.vampire_boots) {
return "AlchemicalWizardry:models/armor/boundArmour_layer_1.png";
}
if (this == ModItems.vampire_greaves)
{
if (this == ModItems.vampire_greaves) {
return "AlchemicalWizardry:models/armor/boundArmour_layer_2.png";
}
else
{
} else {
return null;
}
}
@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
return false;
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
return super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack armor)
{
if (hasArmorSetItem(player, 1) && hasArmorSetItem(player, 2) && hasArmorSetItem(player, 3))
{
if (player.getActivePotionEffect(Potion.damageBoost) != null)
{
public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {
if (hasArmorSetItem(player, 1) && hasArmorSetItem(player, 2) && hasArmorSetItem(player, 3)) {
if (player.getActivePotionEffect(Potion.damageBoost) != null) {
player.removePotionEffect(Potion.damageBoost.id);
}
@@ -207,43 +173,39 @@ public class VampireCostume extends ItemArmor
setIsInvisible(armor, player.isPotionActive(Potion.invisibility.id));
}
public boolean hasArmorSetItem(EntityPlayer player, int i)
{
public boolean hasArmorSetItem(EntityPlayer player, int i) {
ItemStack stack = player.inventory.armorInventory[3 - i];
if (stack == null)
{
if (stack == null) {
return false;
}
switch (i)
{
case 1: return stack.getItem() == ModItems.vampire_cape;
case 2: return stack.getItem() == ModItems.vampire_greaves;
case 3: return stack.getItem() == ModItems.vampire_boots;
switch (i) {
case 1:
return stack.getItem() == ModItems.vampire_cape;
case 2:
return stack.getItem() == ModItems.vampire_greaves;
case 3:
return stack.getItem() == ModItems.vampire_boots;
}
return false;
}
public boolean getIsInvisible(ItemStack itemStack)
{
public boolean getIsInvisible(ItemStack itemStack) {
NBTTagCompound tag = itemStack.getTagCompound();
if (tag != null)
{
if (tag != null) {
return tag.getBoolean("invisible");
}
return false;
}
public void setIsInvisible(ItemStack itemStack, boolean invisible)
{
public void setIsInvisible(ItemStack itemStack, boolean invisible) {
NBTTagCompound tag = itemStack.getTagCompound();
if (tag == null)
{
if (tag == null) {
itemStack.setTagCompound(new NBTTagCompound());
tag = itemStack.getTagCompound();
}
@@ -14,6 +14,7 @@ import com.arc.bloodarsenal.common.items.ModItems;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -30,12 +31,8 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import java.util.List;
public class EmpoweredSacrificeAmulet extends SacrificeAmulet implements IBauble, IBindable
{
public EmpoweredSacrificeAmulet()
{
public class EmpoweredSacrificeAmulet extends SacrificeAmulet implements IBauble, IBindable {
public EmpoweredSacrificeAmulet() {
super();
setHasSubtypes(true);
MinecraftForge.EVENT_BUS.register(this);
@@ -43,34 +40,33 @@ public class EmpoweredSacrificeAmulet extends SacrificeAmulet implements IBauble
@Override
@SubscribeEvent
public void sacrificeHandler(LivingDeathEvent event)
{
public void sacrificeHandler(LivingDeathEvent event) {
Entity killer = event.source.getEntity();
if (killer != null && killer instanceof EntityPlayerMP && !(killer instanceof FakePlayer) && BloodArsenalConfig.baublesIntegration)
{
if (killer != null
&& killer instanceof EntityPlayerMP
&& !(killer instanceof FakePlayer)
&& BloodArsenalConfig.baublesIntegration) {
EntityLivingBase victim = event.entityLiving;
EntityPlayer player = (EntityPlayer) killer;
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
for (int i = 0; i < inv.getSizeInventory(); i++)
{
for (int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if (stack != null)
{
if (stack.getItem() == ModItems.empowered_sacrifice_amulet)
{
EmpoweredSacrificeAmulet sacrificeAmulet = (EmpoweredSacrificeAmulet) ModItems.empowered_sacrifice_amulet;
if (stack != null) {
if (stack.getItem() == ModItems.empowered_sacrifice_amulet) {
EmpoweredSacrificeAmulet sacrificeAmulet =
(EmpoweredSacrificeAmulet) ModItems.empowered_sacrifice_amulet;
float victimHealth = victim.getMaxHealth();
boolean healthGood = victimHealth > 4.0F;
int lpReceived = healthGood ? 200 : 50;
boolean shouldExecute = sacrificeAmulet.getStoredLP(stack) < 50000;
if (shouldExecute)
{
sacrificeAmulet.setStoredLP(stack, Math.min(sacrificeAmulet.getStoredLP(stack) + (lpReceived * 5), 50000));
if (shouldExecute) {
sacrificeAmulet.setStoredLP(
stack, Math.min(sacrificeAmulet.getStoredLP(stack) + (lpReceived * 5), 50000));
}
}
}
@@ -79,47 +75,42 @@ public class EmpoweredSacrificeAmulet extends SacrificeAmulet implements IBauble
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.bauble.empowered_sacrifice"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (!(par1ItemStack.stackTagCompound == null)) {
par3List.add("Stored LP: " + EnumChatFormatting.RED + this.getStoredLP(par1ItemStack));
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
@Override
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player)
{
if (par1ItemStack.getItemDamage() == 1)
{
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player) {
if (par1ItemStack.getItemDamage() == 1) {
String owner = par1ItemStack.stackTagCompound.getString("ownerName");
World world = player.worldObj;
if (!world.isRemote)
{
if (!owner.equals(""))
{
if (player instanceof EntityPlayer)
{
if (owner.equals(SpellHelper.getUsername((EntityPlayer) player)))
{
if (!world.isRemote)
{
if (this.getStoredLP(par1ItemStack) >= 50)
{
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, 50, SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
if (!world.isRemote) {
if (!owner.equals("")) {
if (player instanceof EntityPlayer) {
if (owner.equals(SpellHelper.getUsername((EntityPlayer) player))) {
if (!world.isRemote) {
if (this.getStoredLP(par1ItemStack) >= 50) {
SoulNetworkHandler.addCurrentEssenceToMaximum(
owner,
50,
SoulNetworkHandler.getMaximumForOrbTier(
SoulNetworkHandler.getCurrentMaxOrb(owner)));
setStoredLP(par1ItemStack, getStoredLP(par1ItemStack) - 50);
}
else if (this.getStoredLP(par1ItemStack) > 0)
{
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, this.getStoredLP(par1ItemStack), SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
} else if (this.getStoredLP(par1ItemStack) > 0) {
SoulNetworkHandler.addCurrentEssenceToMaximum(
owner,
this.getStoredLP(par1ItemStack),
SoulNetworkHandler.getMaximumForOrbTier(
SoulNetworkHandler.getCurrentMaxOrb(owner)));
setStoredLP(par1ItemStack, 0);
}
}
@@ -131,61 +122,48 @@ public class EmpoweredSacrificeAmulet extends SacrificeAmulet implements IBauble
}
@Override
public BaubleType getBaubleType(ItemStack par1ItemStack)
{
public BaubleType getBaubleType(ItemStack par1ItemStack) {
return BaubleType.AMULET;
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
EnergyItems.checkAndSetItemOwner(itemStack, player);
if (world.isRemote)
{
if (world.isRemote) {
return itemStack;
}
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
if (player.isSneaking())
{
if (getDamage(itemStack) == 1)
{
if (player.isSneaking()) {
if (getDamage(itemStack) == 1) {
this.setDamage(itemStack, 0);
}
else
{
} else {
setDamage(itemStack, 1);
}
}
if (movingobjectposition == null || movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS)
{
if (movingobjectposition == null
|| movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS) {
return itemStack;
}
else
{
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
} else {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int x = movingobjectposition.blockX;
int y = movingobjectposition.blockY;
int z = movingobjectposition.blockZ;
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TEAltar))
{
if (!(tile instanceof TEAltar)) {
return super.onItemRightClick(itemStack, world, player);
}
TEAltar altar = (TEAltar)tile;
TEAltar altar = (TEAltar) tile;
if (!altar.isActive())
{
if (!altar.isActive()) {
int amount = this.getStoredLP(itemStack);
if (amount > 0)
{
if (amount > 0) {
int filledAmount = altar.fillMainTank(amount);
amount -= filledAmount;
this.setStoredLP(itemStack, amount);
@@ -200,35 +178,30 @@ public class EmpoweredSacrificeAmulet extends SacrificeAmulet implements IBauble
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
if (stack.getItemDamage() == 1)
{
return super.getItemStackDisplayName(stack) + " " + StatCollector.translateToLocal("item.empowered_amulet_soul_network");
}
else
{
return super.getItemStackDisplayName(stack) + " " + StatCollector.translateToLocal("item.empowered_amulet_containing");
public String getItemStackDisplayName(ItemStack stack) {
if (stack.getItemDamage() == 1) {
return super.getItemStackDisplayName(stack) + " "
+ StatCollector.translateToLocal("item.empowered_amulet_soul_network");
} else {
return super.getItemStackDisplayName(stack) + " "
+ StatCollector.translateToLocal("item.empowered_amulet_containing");
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("BloodArsenal:sacrifice_amulet");
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack p_77636_1_, int pass)
{
public boolean hasEffect(ItemStack p_77636_1_, int pass) {
return true;
}
@Override
public EnumRarity getRarity(ItemStack p_77613_1_)
{
public EnumRarity getRarity(ItemStack p_77613_1_) {
return EnumRarity.rare;
}
}
@@ -14,6 +14,7 @@ import com.arc.bloodarsenal.common.items.ModItems;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -31,12 +32,8 @@ import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import java.util.List;
public class EmpoweredSelfSacrificeAmulet extends SelfSacrificeAmulet implements IBauble, IBindable
{
public EmpoweredSelfSacrificeAmulet()
{
public class EmpoweredSelfSacrificeAmulet extends SelfSacrificeAmulet implements IBauble, IBindable {
public EmpoweredSelfSacrificeAmulet() {
super();
setHasSubtypes(true);
MinecraftForge.EVENT_BUS.register(this);
@@ -44,41 +41,43 @@ public class EmpoweredSelfSacrificeAmulet extends SelfSacrificeAmulet implements
@Override
@SubscribeEvent
public void selfSacrificeHandler(LivingAttackEvent event)
{
public void selfSacrificeHandler(LivingAttackEvent event) {
EntityLivingBase entityAttacked = event.entityLiving;
Entity entityAttacking = event.source.getSourceOfDamage();
if (entityAttacking != null && entityAttacked != null && entityAttacked instanceof EntityPlayerMP && BloodArsenalConfig.baublesIntegration)
{
if (entityAttacking != null
&& entityAttacked != null
&& entityAttacked instanceof EntityPlayerMP
&& BloodArsenalConfig.baublesIntegration) {
float damageDone = event.ammount;
EntityPlayer player = (EntityPlayer) entityAttacked;
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
for (int i = 0; i < inv.getSizeInventory(); i++)
{
for (int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if (stack != null)
{
if (stack.getItem() == ModItems.empowered_self_sacrifice_amulet)
{
EmpoweredSelfSacrificeAmulet selfSacrificeAmulet = (EmpoweredSelfSacrificeAmulet) ModItems.empowered_self_sacrifice_amulet;
if (stack != null) {
if (stack.getItem() == ModItems.empowered_self_sacrifice_amulet) {
EmpoweredSelfSacrificeAmulet selfSacrificeAmulet =
(EmpoweredSelfSacrificeAmulet) ModItems.empowered_self_sacrifice_amulet;
int lpReceived = (int) damageDone;
boolean shouldExecute = selfSacrificeAmulet.getStoredLP(stack) < 50000;
if (shouldExecute)
{
if (shouldExecute) {
PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
if (regenEffect != null && regenEffect.getAmplifier() >= 2)
{
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 5) / (regenEffect.getAmplifier() + 1), 50000));
}
else
{
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 5), 50000));
if (regenEffect != null && regenEffect.getAmplifier() >= 2) {
selfSacrificeAmulet.setStoredLP(
stack,
Math.min(
selfSacrificeAmulet.getStoredLP(stack)
+ (lpReceived * 5) / (regenEffect.getAmplifier() + 1),
50000));
} else {
selfSacrificeAmulet.setStoredLP(
stack,
Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 5), 50000));
}
}
}
@@ -88,47 +87,42 @@ public class EmpoweredSelfSacrificeAmulet extends SelfSacrificeAmulet implements
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.bauble.empowered_self_sacrifice"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (!(par1ItemStack.stackTagCompound == null)) {
par3List.add("Stored LP: " + EnumChatFormatting.RED + this.getStoredLP(par1ItemStack));
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
@Override
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player)
{
if (par1ItemStack.getItemDamage() == 1)
{
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player) {
if (par1ItemStack.getItemDamage() == 1) {
String owner = par1ItemStack.getTagCompound().getString("ownerName");
World world = player.worldObj;
if (!world.isRemote)
{
if (!owner.equals(""))
{
if (player instanceof EntityPlayer)
{
if (owner.equals(SpellHelper.getUsername((EntityPlayer) player)))
{
if (!world.isRemote)
{
if (this.getStoredLP(par1ItemStack) >= 50)
{
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, 50, SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
if (!world.isRemote) {
if (!owner.equals("")) {
if (player instanceof EntityPlayer) {
if (owner.equals(SpellHelper.getUsername((EntityPlayer) player))) {
if (!world.isRemote) {
if (this.getStoredLP(par1ItemStack) >= 50) {
SoulNetworkHandler.addCurrentEssenceToMaximum(
owner,
50,
SoulNetworkHandler.getMaximumForOrbTier(
SoulNetworkHandler.getCurrentMaxOrb(owner)));
setStoredLP(par1ItemStack, getStoredLP(par1ItemStack) - 50);
}
else if (this.getStoredLP(par1ItemStack) > 0)
{
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, this.getStoredLP(par1ItemStack), SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(owner)));
} else if (this.getStoredLP(par1ItemStack) > 0) {
SoulNetworkHandler.addCurrentEssenceToMaximum(
owner,
this.getStoredLP(par1ItemStack),
SoulNetworkHandler.getMaximumForOrbTier(
SoulNetworkHandler.getCurrentMaxOrb(owner)));
setStoredLP(par1ItemStack, 0);
}
}
@@ -140,61 +134,48 @@ public class EmpoweredSelfSacrificeAmulet extends SelfSacrificeAmulet implements
}
@Override
public BaubleType getBaubleType(ItemStack par1ItemStack)
{
public BaubleType getBaubleType(ItemStack par1ItemStack) {
return BaubleType.AMULET;
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
EnergyItems.checkAndSetItemOwner(itemStack, player);
if (world.isRemote)
{
if (world.isRemote) {
return itemStack;
}
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
if (player.isSneaking())
{
if (getDamage(itemStack) == 1)
{
if (player.isSneaking()) {
if (getDamage(itemStack) == 1) {
this.setDamage(itemStack, 0);
}
else
{
} else {
setDamage(itemStack, 1);
}
}
if (movingobjectposition == null || movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS)
{
if (movingobjectposition == null
|| movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS) {
return itemStack;
}
else
{
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
} else {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int x = movingobjectposition.blockX;
int y = movingobjectposition.blockY;
int z = movingobjectposition.blockZ;
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TEAltar))
{
if (!(tile instanceof TEAltar)) {
return super.onItemRightClick(itemStack, world, player);
}
TEAltar altar = (TEAltar)tile;
TEAltar altar = (TEAltar) tile;
if (!altar.isActive())
{
if (!altar.isActive()) {
int amount = this.getStoredLP(itemStack);
if (amount > 0)
{
if (amount > 0) {
int filledAmount = altar.fillMainTank(amount);
amount -= filledAmount;
this.setStoredLP(itemStack, amount);
@@ -210,34 +191,29 @@ public class EmpoweredSelfSacrificeAmulet extends SelfSacrificeAmulet implements
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("BloodArsenal:self_sacrifice_amulet");
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack p_77636_1_, int pass)
{
public boolean hasEffect(ItemStack p_77636_1_, int pass) {
return true;
}
@Override
public EnumRarity getRarity(ItemStack p_77613_1_)
{
public EnumRarity getRarity(ItemStack p_77613_1_) {
return EnumRarity.rare;
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
if (stack.getItemDamage() == 1)
{
return super.getItemStackDisplayName(stack) + " " + StatCollector.translateToLocal("item.empowered_amulet_soul_network");
}
else
{
return super.getItemStackDisplayName(stack) + " " + StatCollector.translateToLocal("item.empowered_amulet_containing");
public String getItemStackDisplayName(ItemStack stack) {
if (stack.getItemDamage() == 1) {
return super.getItemStackDisplayName(stack) + " "
+ StatCollector.translateToLocal("item.empowered_amulet_soul_network");
} else {
return super.getItemStackDisplayName(stack) + " "
+ StatCollector.translateToLocal("item.empowered_amulet_containing");
}
}
}
@@ -11,42 +11,35 @@ 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()
{
public abstract class ItemBauble extends Item implements IBauble {
public ItemBauble() {
super();
setMaxStackSize(1);
setMaxDamage(0);
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer);
for (int i = 0; i < baubles.getSizeInventory(); i++)
{
if (baubles.isItemValidForSlot(i, par1ItemStack))
{
for (int i = 0; i < baubles.getSizeInventory(); i++) {
if (baubles.isItemValidForSlot(i, par1ItemStack)) {
ItemStack stackInSlot = baubles.getStackInSlot(i);
if (stackInSlot == null || ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, par3EntityPlayer))
{
if (!par2World.isRemote)
{
if (stackInSlot == null
|| ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, par3EntityPlayer)) {
if (!par2World.isRemote) {
baubles.setInventorySlotContents(i, par1ItemStack.copy());
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null);
if (!par3EntityPlayer.capabilities.isCreativeMode) {
par3EntityPlayer.inventory.setInventorySlotContents(
par3EntityPlayer.inventory.currentItem, null);
}
}
onEquipped(par1ItemStack, par3EntityPlayer);
if (stackInSlot != null)
{
if (stackInSlot != null) {
((IBauble) stackInSlot.getItem()).onUnequipped(stackInSlot, par3EntityPlayer);
return stackInSlot.copy();
}
@@ -59,47 +52,40 @@ public abstract class ItemBauble extends Item implements IBauble
}
@Override
public boolean canEquip(ItemStack stack, EntityLivingBase player)
{
public boolean canEquip(ItemStack stack, EntityLivingBase player) {
return true;
}
@Override
public boolean canUnequip(ItemStack stack, EntityLivingBase player)
{
public boolean canUnequip(ItemStack stack, EntityLivingBase player) {
return true;
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {}
@Override
public void onEquipped(ItemStack stack, EntityLivingBase player)
{
public void onEquipped(ItemStack stack, EntityLivingBase player) {
onEquippedOrLoadedIntoWorld(stack, player);
}
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player)
{
}
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {}
@Override
public boolean hasContainerItem(ItemStack stack)
{
public boolean hasContainerItem(ItemStack stack) {
return getContainerItem(stack) != null;
}
@Override
public ItemStack getContainerItem(ItemStack itemStack)
{
public ItemStack getContainerItem(ItemStack itemStack) {
return itemStack;
}
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_)
{
public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_) {
return false;
}
}
@@ -11,6 +11,7 @@ import com.arc.bloodarsenal.common.items.ModItems;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -27,45 +28,39 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import java.util.List;
public class SacrificeAmulet extends ItemBauble implements IAltarManipulator, IBauble
{
public SacrificeAmulet()
{
public class SacrificeAmulet extends ItemBauble implements IAltarManipulator, IBauble {
public SacrificeAmulet() {
super();
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void sacrificeHandler(LivingDeathEvent event)
{
public void sacrificeHandler(LivingDeathEvent event) {
Entity killer = event.source.getEntity();
if (killer != null && killer instanceof EntityPlayerMP && !(killer instanceof FakePlayer) && BloodArsenalConfig.baublesIntegration)
{
if (killer != null
&& killer instanceof EntityPlayerMP
&& !(killer instanceof FakePlayer)
&& BloodArsenalConfig.baublesIntegration) {
EntityLivingBase victim = event.entityLiving;
EntityPlayer player = (EntityPlayer) killer;
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
for (int i = 0; i < inv.getSizeInventory(); i++)
{
for (int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if (stack != null)
{
if (stack.getItem() == ModItems.sacrifice_amulet)
{
if (stack != null) {
if (stack.getItem() == ModItems.sacrifice_amulet) {
SacrificeAmulet sacrificeAmulet = (SacrificeAmulet) ModItems.sacrifice_amulet;
float victimHealth = victim.getMaxHealth();
boolean healthGood = victimHealth > 4.0F;
int lpReceived = healthGood ? 200 : 50;
boolean shouldExecute = sacrificeAmulet.getStoredLP(stack) < 10000;
if (shouldExecute)
{
sacrificeAmulet.setStoredLP(stack, Math.min(sacrificeAmulet.getStoredLP(stack) + (lpReceived * 2), 10000));
if (shouldExecute) {
sacrificeAmulet.setStoredLP(
stack, Math.min(sacrificeAmulet.getStoredLP(stack) + (lpReceived * 2), 10000));
}
}
}
@@ -74,64 +69,51 @@ public class SacrificeAmulet extends ItemBauble implements IAltarManipulator, IB
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.bauble.sacrifice"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (!(par1ItemStack.stackTagCompound == null)) {
par3List.add("Stored LP: " + EnumChatFormatting.RED + this.getStoredLP(par1ItemStack));
}
}
@Override
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player)
{
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player) {
super.onWornTick(par1ItemStack, player);
}
@Override
public BaubleType getBaubleType(ItemStack par1ItemStack)
{
public BaubleType getBaubleType(ItemStack par1ItemStack) {
return BaubleType.AMULET;
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
if (world.isRemote)
{
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
if (world.isRemote) {
return itemStack;
}
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
if (movingobjectposition == null)
{
if (movingobjectposition == null) {
return super.onItemRightClick(itemStack, world, player);
}
else
{
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
} else {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int x = movingobjectposition.blockX;
int y = movingobjectposition.blockY;
int z = movingobjectposition.blockZ;
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TEAltar))
{
if (!(tile instanceof TEAltar)) {
return super.onItemRightClick(itemStack, world, player);
}
TEAltar altar = (TEAltar)tile;
TEAltar altar = (TEAltar) tile;
if (!altar.isActive())
{
if (!altar.isActive()) {
int amount = this.getStoredLP(itemStack);
if (amount > 0)
{
if (amount > 0) {
int filledAmount = altar.fillMainTank(amount);
amount -= filledAmount;
this.setStoredLP(itemStack, amount);
@@ -147,15 +129,12 @@ public class SacrificeAmulet extends ItemBauble implements IAltarManipulator, IB
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("BloodArsenal:sacrifice_amulet");
}
public void setStoredLP(ItemStack itemStack, int lp)
{
if (!itemStack.hasTagCompound())
{
public void setStoredLP(ItemStack itemStack, int lp) {
if (!itemStack.hasTagCompound()) {
itemStack.setTagCompound(new NBTTagCompound());
}
@@ -164,10 +143,8 @@ public class SacrificeAmulet extends ItemBauble implements IAltarManipulator, IB
tag.setInteger("storedLP", lp);
}
public int getStoredLP(ItemStack itemStack)
{
if (!itemStack.hasTagCompound())
{
public int getStoredLP(ItemStack itemStack) {
if (!itemStack.hasTagCompound()) {
itemStack.setTagCompound(new NBTTagCompound());
}
@@ -11,6 +11,7 @@ import com.arc.bloodarsenal.common.items.ModItems;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -27,51 +28,47 @@ import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import java.util.List;
public class SelfSacrificeAmulet extends ItemBauble implements IAltarManipulator, IBauble
{
public SelfSacrificeAmulet()
{
public class SelfSacrificeAmulet extends ItemBauble implements IAltarManipulator, IBauble {
public SelfSacrificeAmulet() {
super();
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void selfSacrificeHandler(LivingAttackEvent event)
{
public void selfSacrificeHandler(LivingAttackEvent event) {
EntityLivingBase entityAttacked = event.entityLiving;
if (entityAttacked != null && entityAttacked instanceof EntityPlayerMP && BloodArsenalConfig.baublesIntegration)
{
if (entityAttacked != null
&& entityAttacked instanceof EntityPlayerMP
&& BloodArsenalConfig.baublesIntegration) {
float damageDone = event.ammount;
EntityPlayer player = (EntityPlayer) entityAttacked;
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
for (int i = 0; i < inv.getSizeInventory(); i++)
{
for (int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if (stack != null)
{
if (stack.getItem() == ModItems.self_sacrifice_amulet)
{
if (stack != null) {
if (stack.getItem() == ModItems.self_sacrifice_amulet) {
SelfSacrificeAmulet selfSacrificeAmulet = (SelfSacrificeAmulet) ModItems.self_sacrifice_amulet;
int lpReceived = (int) damageDone;
boolean shouldExecute = selfSacrificeAmulet.getStoredLP(stack) < 10000;
if (shouldExecute)
{
if (shouldExecute) {
PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
if (regenEffect != null && regenEffect.getAmplifier() >= 2)
{
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 2) / (regenEffect.getAmplifier() + 1), 10000));
}
else
{
selfSacrificeAmulet.setStoredLP(stack, Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 2), 10000));
if (regenEffect != null && regenEffect.getAmplifier() >= 2) {
selfSacrificeAmulet.setStoredLP(
stack,
Math.min(
selfSacrificeAmulet.getStoredLP(stack)
+ (lpReceived * 2) / (regenEffect.getAmplifier() + 1),
10000));
} else {
selfSacrificeAmulet.setStoredLP(
stack,
Math.min(selfSacrificeAmulet.getStoredLP(stack) + (lpReceived * 2), 10000));
}
}
}
@@ -81,64 +78,51 @@ public class SelfSacrificeAmulet extends ItemBauble implements IAltarManipulator
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.bauble.self_sacrifice"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (!(par1ItemStack.stackTagCompound == null)) {
par3List.add("Stored LP: " + EnumChatFormatting.RED + this.getStoredLP(par1ItemStack));
}
}
@Override
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player)
{
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player) {
super.onWornTick(par1ItemStack, player);
}
@Override
public BaubleType getBaubleType(ItemStack par1ItemStack)
{
public BaubleType getBaubleType(ItemStack par1ItemStack) {
return BaubleType.AMULET;
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
if (world.isRemote)
{
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
if (world.isRemote) {
return itemStack;
}
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
if (movingobjectposition == null)
{
if (movingobjectposition == null) {
return super.onItemRightClick(itemStack, world, player);
}
else
{
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
} else {
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int x = movingobjectposition.blockX;
int y = movingobjectposition.blockY;
int z = movingobjectposition.blockZ;
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TEAltar))
{
if (!(tile instanceof TEAltar)) {
return super.onItemRightClick(itemStack, world, player);
}
TEAltar altar = (TEAltar)tile;
TEAltar altar = (TEAltar) tile;
if (!altar.isActive())
{
if (!altar.isActive()) {
int amount = this.getStoredLP(itemStack);
if (amount > 0)
{
if (amount > 0) {
int filledAmount = altar.fillMainTank(amount);
amount -= filledAmount;
this.setStoredLP(itemStack, amount);
@@ -154,15 +138,12 @@ public class SelfSacrificeAmulet extends ItemBauble implements IAltarManipulator
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("BloodArsenal:self_sacrifice_amulet");
}
public void setStoredLP(ItemStack itemStack, int lp)
{
if (!itemStack.hasTagCompound())
{
public void setStoredLP(ItemStack itemStack, int lp) {
if (!itemStack.hasTagCompound()) {
itemStack.setTagCompound(new NBTTagCompound());
}
@@ -171,10 +152,8 @@ public class SelfSacrificeAmulet extends ItemBauble implements IAltarManipulator
tag.setInteger("storedLP", lp);
}
public int getStoredLP(ItemStack itemStack)
{
if (!itemStack.hasTagCompound())
{
public int getStoredLP(ItemStack itemStack) {
if (!itemStack.hasTagCompound()) {
itemStack.setTagCompound(new NBTTagCompound());
}
@@ -12,24 +12,19 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
public class VampireRing extends ItemBauble implements IBauble
{
public VampireRing()
{
public class VampireRing extends ItemBauble implements IBauble {
public VampireRing() {
super();
setMaxStackSize(1);
setHasSubtypes(true);
}
@Override
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player)
{
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player) {
super.onWornTick(par1ItemStack, player);
if (player instanceof EntityPlayerMP && !player.worldObj.isRemote)
{
if (player.getActivePotionEffect(BloodArsenal.vampiricAura) != null)
{
if (player instanceof EntityPlayerMP && !player.worldObj.isRemote) {
if (player.getActivePotionEffect(BloodArsenal.vampiricAura) != null) {
player.removePotionEffect(BloodArsenalConfig.vampiricAuraID);
}
player.addPotionEffect(new PotionEffect(BloodArsenalConfig.vampiricAuraID, Integer.MAX_VALUE, 0, true));
@@ -37,26 +32,22 @@ public class VampireRing extends ItemBauble implements IBauble
}
@Override
public void onUnequipped(ItemStack par1ItemStack, EntityLivingBase player)
{
public void onUnequipped(ItemStack par1ItemStack, EntityLivingBase player) {
PotionEffect effect = player.getActivePotionEffect(BloodArsenal.vampiricAura);
if (effect != null)
{
if (effect != null) {
player.removePotionEffect(BloodArsenalConfig.vampiricAuraID);
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("BloodArsenal:vampire_ring");
}
@Override
public BaubleType getBaubleType(ItemStack par1ItemStack)
{
public BaubleType getBaubleType(ItemStack par1ItemStack) {
return BaubleType.RING;
}
}
@@ -4,21 +4,17 @@ import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class BloodStoneBlock extends ItemBlock
{
public BloodStoneBlock(Block block)
{
public class BloodStoneBlock extends ItemBlock {
public BloodStoneBlock(Block block) {
super(block);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
public String getUnlocalizedName(ItemStack itemStack) {
String name;
switch (itemStack.getItemDamage())
{
switch (itemStack.getItemDamage()) {
case 0:
name = "blood_stone_1";
break;
@@ -47,8 +43,7 @@ public class BloodStoneBlock extends ItemBlock
}
@Override
public int getMetadata(int par1)
{
public int getMetadata(int par1) {
return par1;
}
}
@@ -3,6 +3,7 @@ package com.arc.bloodarsenal.common.items.block;
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
@@ -10,40 +11,30 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import java.util.List;
public class CompactedMRSBlock extends ItemBlock
{
public CompactedMRSBlock(Block block)
{
public class CompactedMRSBlock extends ItemBlock {
public CompactedMRSBlock(Block block) {
super(block);
setMaxStackSize(1);
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
if (GuiScreen.isShiftKeyDown())
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (GuiScreen.isShiftKeyDown()) {
addHiddenTooltip(par1ItemStack, par3List);
}
else
{
} else {
addStringToTooltip(StatCollector.translateToLocal("tooltip.shiftinfo"), par3List);
}
}
public void addHiddenTooltip(ItemStack par1ItemStack, List par3List)
{
public void addHiddenTooltip(ItemStack par1ItemStack, List par3List) {
String ritualID = par1ItemStack.getTagCompound().getString("ritualName");
String ritualName = Rituals.getNameOfRitual(ritualID);
addStringToTooltip(StatCollector.translateToLocal("tooltip.ritualName") + " &c" + ritualName + "&7", par3List);
}
public void addStringToTooltip(String s, List<String> tooltip)
{
public void addStringToTooltip(String s, List<String> tooltip) {
tooltip.add(s.replaceAll("&", "\u00a7"));
}
}
@@ -2,6 +2,7 @@ package com.arc.bloodarsenal.common.items.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
@@ -9,32 +10,23 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import java.util.List;
public class PortableAltarBlock extends ItemBlock
{
public PortableAltarBlock(Block block)
{
public class PortableAltarBlock extends ItemBlock {
public PortableAltarBlock(Block block) {
super(block);
setMaxStackSize(1);
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
if (GuiScreen.isShiftKeyDown())
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (GuiScreen.isShiftKeyDown()) {
addHiddenTooltip(par1ItemStack, par3List);
}
else
{
} else {
addStringToTooltip(StatCollector.translateToLocal("tooltip.shiftinfo"), par3List);
}
}
public void addHiddenTooltip(ItemStack par1ItemStack, List par3List)
{
public void addHiddenTooltip(ItemStack par1ItemStack, List par3List) {
if (!par1ItemStack.hasTagCompound()) return;
String capacity = par1ItemStack.getTagCompound().getString("capacity");
@@ -42,12 +34,12 @@ public class PortableAltarBlock extends ItemBlock
int currentEssence = par1ItemStack.getTagCompound().getInteger("currentEssence");
addStringToTooltip(StatCollector.translateToLocal("tooltip.altarTier") + " &c" + alterTier + "&7", par3List);
addStringToTooltip(StatCollector.translateToLocal("tooltip.currentEssence") + " &c" + currentEssence + "&7", par3List);
addStringToTooltip(
StatCollector.translateToLocal("tooltip.currentEssence") + " &c" + currentEssence + "&7", par3List);
addStringToTooltip(StatCollector.translateToLocal("tooltip.capacity") + " &c" + capacity + "&7", par3List);
}
public void addStringToTooltip(String s, List<String> tooltip)
{
public void addStringToTooltip(String s, List<String> tooltip) {
tooltip.add(s.replaceAll("&", "\u00a7"));
}
}
@@ -14,6 +14,8 @@ import amerifrance.guideapi.pages.PageIRecipe;
import amerifrance.guideapi.pages.PageUnlocImage;
import com.arc.bloodarsenal.common.items.ModItems;
import cpw.mods.fml.common.registry.GameRegistry;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
@@ -22,64 +24,65 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.List;
public class BloodBurnedTome
{
public class BloodBurnedTome {
public static Book burnedTome;
public static List<CategoryAbstract> categories = new ArrayList<CategoryAbstract>();
private final static String R_LOC = "BloodArsenal:book/images/";
private static final String R_LOC = "BloodArsenal:book/images/";
public static void registerTome()
{
public static void registerTome() {
registerLifebringer();
BookBuilder bookBuilder = new BookBuilder();
bookBuilder.setCategories(categories).setUnlocBookTitle("guide.bloodarsenal.book.title").setUnlocWelcomeMessage("guide.bloodarsenal.book.welcomeMessage").setUnlocDisplayName("guide.bloodarsenal.book.name").setAuthor("-An Arc Mage").setItemTexture("BloodArsenal:burned_tome");
bookBuilder
.setCategories(categories)
.setUnlocBookTitle("guide.bloodarsenal.book.title")
.setUnlocWelcomeMessage("guide.bloodarsenal.book.welcomeMessage")
.setUnlocDisplayName("guide.bloodarsenal.book.name")
.setAuthor("-An Arc Mage")
.setItemTexture("BloodArsenal:burned_tome");
burnedTome = bookBuilder.build();
GuideRegistry.registerBook(burnedTome);
GameRegistry.addRecipe(new ShapelessBloodOrbRecipe(GuideRegistry.getItemStackForBook(burnedTome), ModItems.glass_shard, Items.writable_book, new ItemStack(WayofTime.alchemicalWizardry.ModItems.apprenticeBloodOrb, 1, OreDictionary.WILDCARD_VALUE)));
GameRegistry.addRecipe(new ShapelessBloodOrbRecipe(
GuideRegistry.getItemStackForBook(burnedTome),
ModItems.glass_shard,
Items.writable_book,
new ItemStack(
WayofTime.alchemicalWizardry.ModItems.apprenticeBloodOrb, 1, OreDictionary.WILDCARD_VALUE)));
RecipeHolder.init();
}
private static void registerLifebringer()
{
private static void registerLifebringer() {
List<EntryAbstract> lifeBringerEntries = new ArrayList<EntryAbstract>();
{
//A Different Backstory
// A Different Backstory
ArrayList<IPage> backstoryPages = new ArrayList<IPage>();
makePage(lifeBringerEntries, backstoryPages, "backstory");
}
{
//Glass Is Dangerous
// Glass Is Dangerous
ArrayList<IPage> glass = new ArrayList<IPage>();
makePage(lifeBringerEntries, glass, "glass");
}
categories.add(new CategoryItemStack(lifeBringerEntries, "guide.bloodarsenal.category.lifeBringer", new ItemStack(ModItems.bound_bow)));
categories.add(new CategoryItemStack(
lifeBringerEntries, "guide.bloodarsenal.category.lifeBringer", new ItemStack(ModItems.bound_bow)));
}
private static void makePage(List<EntryAbstract> entries, ArrayList<IPage> pages, String name, Object... others)
{
pages.addAll(PageHelper.pagesForLongText(replaceColors(StatCollector.translateToLocal("guide.bloodarsenal.entry." + name))));
private static void makePage(List<EntryAbstract> entries, ArrayList<IPage> pages, String name, Object... others) {
pages.addAll(PageHelper.pagesForLongText(
replaceColors(StatCollector.translateToLocal("guide.bloodarsenal.entry." + name))));
if (others != null)
{
for (Object code : others)
{
if (code instanceof IPage)
{
if (others != null) {
for (Object code : others) {
if (code instanceof IPage) {
pages.add((IPage) code);
}
if (code instanceof Object[])
{
if (code instanceof Object[]) {
Object[] objects = (Object[]) code;
for (Object object : objects)
{
for (Object object : objects) {
pages.add((IPage) object);
}
}
@@ -88,23 +91,20 @@ public class BloodBurnedTome
entries.add(new EntryUniText(pages, "guide.bloodarsenal.entryTitles." + name));
}
private static Object[] s(String pageName)
{
if (pageName != null)
{
return PageHelper.pagesForLongText(replaceColors(StatCollector.translateToLocal("guide.bloodarsenal.entry." + pageName))).toArray();
private static Object[] s(String pageName) {
if (pageName != null) {
return PageHelper.pagesForLongText(
replaceColors(StatCollector.translateToLocal("guide.bloodarsenal.entry." + pageName)))
.toArray();
}
return null;
}
private static Object[] r(IRecipe... recipes)
{
if (recipes != null)
{
private static Object[] r(IRecipe... recipes) {
if (recipes != null) {
ArrayList<PageIRecipe> pageIRecipes = new ArrayList<PageIRecipe>();
for (IRecipe recipe : recipes)
{
for (IRecipe recipe : recipes) {
pageIRecipes.add(new PageIRecipe(recipe));
}
return pageIRecipes.toArray();
@@ -113,14 +113,14 @@ public class BloodBurnedTome
return null;
}
private static Object[] i(String... names)
{
if (names != null)
{
private static Object[] i(String... names) {
if (names != null) {
ArrayList<PageUnlocImage> images = new ArrayList<PageUnlocImage>();
for (String name : names)
{
images.add(new PageUnlocImage(replaceColors(StatCollector.translateToLocal("guide.bloodarsenal.caption." + name)), new ResourceLocation(R_LOC + name + ".png"), true));
for (String name : names) {
images.add(new PageUnlocImage(
replaceColors(StatCollector.translateToLocal("guide.bloodarsenal.caption." + name)),
new ResourceLocation(R_LOC + name + ".png"),
true));
}
return images.toArray();
@@ -129,28 +129,25 @@ public class BloodBurnedTome
return null;
}
protected static String replaceColors(String text)
{
if (text != null)
{
protected static String replaceColors(String text) {
if (text != null) {
return text.replace("@BLD@", EnumChatFormatting.BOLD.toString())
.replace("@UND@", EnumChatFormatting.UNDERLINE.toString())
.replace("@ITC@", EnumChatFormatting.ITALIC.toString())
.replace("@AQA@", EnumChatFormatting.AQUA.toString())
.replace("@GLD@", EnumChatFormatting.GOLD.toString())
.replace("@DRED@", EnumChatFormatting.DARK_RED.toString())
.replace("@RED@", EnumChatFormatting.RED.toString())
.replace("@LPRP@", EnumChatFormatting.LIGHT_PURPLE.toString())
.replace("@PRP@", EnumChatFormatting.DARK_PURPLE.toString())
.replace("@GRN@", EnumChatFormatting.GREEN.toString())
.replace("@DGRN@", EnumChatFormatting.DARK_GREEN.toString())
.replace("@BLU@", EnumChatFormatting.BLUE.toString())
.replace("@DBLU@", EnumChatFormatting.DARK_BLUE.toString())
.replace("@GRY@", EnumChatFormatting.GRAY.toString())
.replace("@DGRY@", EnumChatFormatting.DARK_GRAY.toString())
.replace("@RST@", EnumChatFormatting.RESET.toString())
.replace("@END@", EnumChatFormatting.BLACK.toString());
.replace("@UND@", EnumChatFormatting.UNDERLINE.toString())
.replace("@ITC@", EnumChatFormatting.ITALIC.toString())
.replace("@AQA@", EnumChatFormatting.AQUA.toString())
.replace("@GLD@", EnumChatFormatting.GOLD.toString())
.replace("@DRED@", EnumChatFormatting.DARK_RED.toString())
.replace("@RED@", EnumChatFormatting.RED.toString())
.replace("@LPRP@", EnumChatFormatting.LIGHT_PURPLE.toString())
.replace("@PRP@", EnumChatFormatting.DARK_PURPLE.toString())
.replace("@GRN@", EnumChatFormatting.GREEN.toString())
.replace("@DGRN@", EnumChatFormatting.DARK_GREEN.toString())
.replace("@BLU@", EnumChatFormatting.BLUE.toString())
.replace("@DBLU@", EnumChatFormatting.DARK_BLUE.toString())
.replace("@GRY@", EnumChatFormatting.GRAY.toString())
.replace("@DGRY@", EnumChatFormatting.DARK_GRAY.toString())
.replace("@RST@", EnumChatFormatting.RESET.toString())
.replace("@END@", EnumChatFormatting.BLACK.toString());
}
return null;
@@ -2,31 +2,25 @@ package com.arc.bloodarsenal.common.items.book;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import java.util.List;
public class RecipeHolder
{
public class RecipeHolder {
private static List recipeList;
public static IRecipe glassSacrificialDagger;
public static IRecipe glassDaggerOfSacrifice;
public static void init()
{
public static void init() {
recipeList = CraftingManager.getInstance().getRecipeList();
}
private static IRecipe getRecipeForItemStack(ItemStack stack)
{
for (Object obj : recipeList)
{
private static IRecipe getRecipeForItemStack(ItemStack stack) {
for (Object obj : recipeList) {
IRecipe recipe = (IRecipe) obj;
if (recipe.getRecipeOutput() != null && stack.isItemEqual(recipe.getRecipeOutput()))
{
if (recipe.getRecipeOutput() != null && stack.isItemEqual(recipe.getRecipeOutput())) {
return recipe;
}
}
@@ -34,12 +28,9 @@ public class RecipeHolder
return null;
}
private static AltarRecipe getAltarRecipeForItemStack(ItemStack stack)
{
for (AltarRecipe recipe : AltarRecipeRegistry.altarRecipes)
{
if (recipe.getResult() != null && stack.isItemEqual(recipe.getResult()))
{
private static AltarRecipe getAltarRecipeForItemStack(ItemStack stack) {
for (AltarRecipe recipe : AltarRecipeRegistry.altarRecipes) {
if (recipe.getResult() != null && stack.isItemEqual(recipe.getResult())) {
return recipe;
}
}
@@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,89 +13,72 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class TransparentOrb extends EnergyBattery
{
public class TransparentOrb extends EnergyBattery {
IIcon icons[] = new IIcon[45];
public TransparentOrb(int damage)
{
public TransparentOrb(int damage) {
super(damage);
orbLevel = 6;
}
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean something)
{
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean something) {
list.add(StatCollector.translateToLocal("tooltip.energybattery.desc"));
if (itemStack.getTagCompound() != null)
{
list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + itemStack.getTagCompound().getString("ownerName"));
list.add(StatCollector.translateToLocal("tooltip.energybattery.currentLP") + " " + this.getCurrentEssence(itemStack));
if (itemStack.getTagCompound() != null) {
list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
+ itemStack.getTagCompound().getString("ownerName"));
list.add(StatCollector.translateToLocal("tooltip.energybattery.currentLP") + " "
+ this.getCurrentEssence(itemStack));
}
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_)
{
if (itemStack.getTagCompound() == null)
{
public void onUpdate(ItemStack itemStack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) {
if (itemStack.getTagCompound() == null) {
return;
}
int maxEssence = SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(SoulNetworkHandler.getOwnerName(itemStack)));
int maxEssence = SoulNetworkHandler.getMaximumForOrbTier(
SoulNetworkHandler.getCurrentMaxOrb(SoulNetworkHandler.getOwnerName(itemStack)));
int section = maxEssence / 44;
int currentEssence = SoulNetworkHandler.getCurrentEssence(SoulNetworkHandler.getOwnerName(itemStack));
if (currentEssence > 0)
{
if (currentEssence > 0) {
int metaToBe = (currentEssence / section);
itemStack.setItemDamage(metaToBe);
}
else
{
} else {
itemStack.setItemDamage(0);
}
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses()
{
public boolean requiresMultipleRenderPasses() {
return true;
}
@Override
public IIcon getIcon(ItemStack stack, int pass)
{
public IIcon getIcon(ItemStack stack, int pass) {
int i = stack.getItemDamage() + 1;
if (i != stack.getItemDamage() && i < icons.length)
{
if (i != stack.getItemDamage() && i < icons.length) {
i = stack.getItemDamage() + 1;
return icons[i - 1];
}
else if (i <= icons.length)
{
} else if (i <= icons.length) {
return icons[icons.length - 1];
}
else
{
} else {
return itemIcon;
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("BloodArsenal:orb/orb_0");
icons[0] = iconRegister.registerIcon("BloodArsenal:orb/orb_0");
for (int i = 0; i < icons.length; i++)
{
for (int i = 0; i < icons.length; i++) {
icons[i] = iconRegister.registerIcon("BloodArsenal:orb/orb_" + i);
}
}
@@ -7,6 +7,7 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenalConfig;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -18,35 +19,27 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class SigilDivinity extends EnergyItems implements ArmourUpgrade, IBindable, ISigil
{
public class SigilDivinity extends EnergyItems implements ArmourUpgrade, IBindable, ISigil {
@SideOnly(Side.CLIENT)
public IIcon activeIcon;
@SideOnly(Side.CLIENT)
public IIcon passiveIcon;
public SigilDivinity()
{
public SigilDivinity() {
super();
setMaxStackSize(1);
setEnergyUsed(50000);
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.sigil.divinity"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3List.add("Activated");
}
else
{
} else {
par3List.add("Deactivated");
}
@@ -56,8 +49,7 @@ public class SigilDivinity extends EnergyItems implements ArmourUpgrade, IBindab
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("BloodArsenal:sigil_of_divinity_deactivated");
activeIcon = iconRegister.registerIcon("BloodArsenal:sigil_of_divinity_activated");
passiveIcon = iconRegister.registerIcon("BloodArsenal:sigil_of_divinity_deactivated");
@@ -65,70 +57,54 @@ public class SigilDivinity extends EnergyItems implements ArmourUpgrade, IBindab
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.stackTagCompound == null)
{
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"))
{
if (tag.getBoolean("isActive")) {
return activeIcon;
}
else
{
} else {
return passiveIcon;
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (par1 == 1)
{
public IIcon getIconFromDamage(int par1) {
if (par1 == 1) {
return activeIcon;
}
else
{
} else {
return passiveIcon;
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
return par1ItemStack;
}
if (par1ItemStack.stackTagCompound == null)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = par1ItemStack.stackTagCompound;
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (tag.getBoolean("isActive"))
{
if (tag.getBoolean("isActive")) {
par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2, 0));
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (!par3EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
}
}
else
{
} else {
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
}
@@ -136,39 +112,32 @@ public class SigilDivinity extends EnergyItems implements ArmourUpgrade, IBindab
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
if (!(par3Entity instanceof EntityPlayer))
{
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)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2, 4));
}
if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
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)
{
public void onArmourUpdate(World par1World, EntityPlayer par2EntityPlayer, ItemStack par3ItemStack) {
if (par3ItemStack.stackTagCompound == null) {
par3ItemStack.setTagCompound(new NBTTagCompound());
}
@@ -176,14 +145,12 @@ public class SigilDivinity extends EnergyItems implements ArmourUpgrade, IBindab
}
@Override
public boolean isUpgrade()
{
public boolean isUpgrade() {
return true;
}
@Override
public int getEnergyForTenSeconds()
{
public int getEnergyForTenSeconds() {
return BloodArsenalConfig.sigilDivinityCost;
}
}
@@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenalConfig;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -13,56 +14,49 @@ import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import java.util.List;
public class SigilEnder extends EnergyItems implements IBindable, ISigil
{
public SigilEnder()
{
public class SigilEnder extends EnergyItems implements IBindable, ISigil {
public SigilEnder() {
super();
setMaxStackSize(1);
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.sigil.ender1"));
par3List.add(StatCollector.translateToLocal("tooltip.sigil.ender2"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (!(par1ItemStack.stackTagCompound == null)) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
EnergyItems.checkAndSetItemOwner(itemStack, player);
Vec3 playerPrevPos = Vec3.createVectorHelper(player.prevPosX, player.prevPosY, player.prevPosZ);
if (itemStack.stackTagCompound == null)
{
if (itemStack.stackTagCompound == null) {
itemStack.setTagCompound(new NBTTagCompound());
}
if (player.isSneaking() && !player.isSwingInProgress)
{
MovingObjectPosition mop = SigilUtils.getTargetBlock(world, (player.prevPosX + (player.posX - player.prevPosX)),
if (player.isSneaking() && !player.isSwingInProgress) {
MovingObjectPosition mop = SigilUtils.getTargetBlock(
world,
(player.prevPosX + (player.posX - player.prevPosX)),
(player.prevPosY + (player.posY - player.prevPosY) + 1.62 - player.yOffset),
(player.prevPosZ + (player.posZ - player.prevPosZ)),
(player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw)),
(player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch)), false, 128.0);
(player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch)),
false,
128.0);
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mop.sideHit != -1)
{
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mop.sideHit != -1) {
double ex = mop.hitVec.xCoord;
double wy = mop.hitVec.yCoord;
double zee = mop.hitVec.zCoord;
switch (mop.sideHit)
{
switch (mop.sideHit) {
case 0:
wy -= 2.0;
break;
@@ -85,24 +79,38 @@ public class SigilEnder extends EnergyItems implements IBindable, ISigil
Vec3 vec3 = Vec3.createVectorHelper(ex, wy, zee);
double distance = playerPrevPos.distanceTo(vec3);
if (SoulNetworkHandler.getCurrentEssence(itemStack.getTagCompound().getString("ownerName")) >= distance * BloodArsenalConfig.enderSigilTeleportMultiplier || player.capabilities.isCreativeMode)
{
for (int k = 0; k < 8; ++k)
{
world.spawnParticle("portal", player.posX + (world.rand.nextDouble() - 0.5D) * (double)player.width, player.posY + world.rand.nextDouble() * (double)player.height - 0.25D, player.posZ + (world.rand.nextDouble() - 0.5D) * (double)player.width, 0, 0, 0);
world.spawnParticle("portal", ex + (world.rand.nextDouble() - 0.5D) * (double)player.width, wy + world.rand.nextDouble() * (double) player.height - 0.25D, zee + (world.rand.nextDouble() - 0.5D) * (double)player.width, 0, 0, 0);
if (SoulNetworkHandler.getCurrentEssence(
itemStack.getTagCompound().getString("ownerName"))
>= distance * BloodArsenalConfig.enderSigilTeleportMultiplier
|| player.capabilities.isCreativeMode) {
for (int k = 0; k < 8; ++k) {
world.spawnParticle(
"portal",
player.posX + (world.rand.nextDouble() - 0.5D) * (double) player.width,
player.posY + world.rand.nextDouble() * (double) player.height - 0.25D,
player.posZ + (world.rand.nextDouble() - 0.5D) * (double) player.width,
0,
0,
0);
world.spawnParticle(
"portal",
ex + (world.rand.nextDouble() - 0.5D) * (double) player.width,
wy + world.rand.nextDouble() * (double) player.height - 0.25D,
zee + (world.rand.nextDouble() - 0.5D) * (double) player.width,
0,
0,
0);
}
player.setPositionAndUpdate(ex, wy, zee);
EnergyItems.syphonBatteries(itemStack, player, (int) distance * BloodArsenalConfig.enderSigilTeleportMultiplier);
EnergyItems.syphonBatteries(
itemStack, player, (int) distance * BloodArsenalConfig.enderSigilTeleportMultiplier);
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F);
player.swingItem();
player.setVelocity(0.0D, 0.0D, 0.0D);
}
}
}
else if (!player.isSneaking())
{
} else if (!player.isSneaking()) {
player.displayGUIChest(player.getInventoryEnderChest());
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F);
EnergyItems.syphonBatteries(itemStack, player, BloodArsenalConfig.enderSigilOpenCost);
@@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenalConfig;
import java.util.List;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -15,72 +16,62 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class SigilLightning extends EnergyItems implements IBindable, ISigil
{
public SigilLightning()
{
public class SigilLightning extends EnergyItems implements IBindable, ISigil {
public SigilLightning() {
super();
setMaxStackSize(1);
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
int mode = par1ItemStack.getItemDamage();
par3List.add(StatCollector.translateToLocal("tooltip.sigil.lightning"));
par3List.add(StatCollector.translateToLocal("tooltip.sigil.lightning2") + " " + (mode + 1));
if (!(par1ItemStack.stackTagCompound == null))
{
if (!(par1ItemStack.stackTagCompound == null)) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
EnergyItems.checkAndSetItemOwner(itemStack, player);
if (itemStack.stackTagCompound == null)
{
if (itemStack.stackTagCompound == null) {
itemStack.setTagCompound(new NBTTagCompound());
}
if (player.isSneaking())
{
if (!player.isSwingInProgress)
{
if (player.isSneaking()) {
if (!player.isSwingInProgress) {
changeMode(itemStack, true);
}
if (world.isRemote)
{
if (world.isRemote) {
int mode = itemStack.getItemDamage();
IChatComponent chatComponent = new ChatComponentText(StatCollector.translateToLocal("tooltip.sigil.lightning2") + " " + (mode + 1));
IChatComponent chatComponent = new ChatComponentText(
StatCollector.translateToLocal("tooltip.sigil.lightning2") + " " + (mode + 1));
player.addChatComponentMessage(chatComponent);
}
player.swingItem();
}
else
{
} else {
int mode = itemStack.getItemDamage();
MovingObjectPosition mop = SigilUtils.getTargetBlock(world, (player.prevPosX + (player.posX - player.prevPosX)),
MovingObjectPosition mop = SigilUtils.getTargetBlock(
world,
(player.prevPosX + (player.posX - player.prevPosX)),
(player.prevPosY + (player.posY - player.prevPosY) + 1.62 - player.yOffset),
(player.prevPosZ + (player.posZ - player.prevPosZ)),
(player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw)),
(player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch)), false, 128.0);
(player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch)),
false,
128.0);
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mop.sideHit != -1)
{
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mop.sideHit != -1) {
double ex = mop.hitVec.xCoord;
double wy = mop.hitVec.yCoord;
double zee = mop.hitVec.zCoord;
switch (mop.sideHit)
{
switch (mop.sideHit) {
case 0:
wy -= 2.0;
break;
@@ -102,9 +93,8 @@ public class SigilLightning extends EnergyItems implements IBindable, ISigil
int cost = 0;
switch (mode)
{
// 8 per lightning bolt
switch (mode) {
// 8 per lightning bolt
case 0:
cost = 8 * BloodArsenalConfig.lightningSigilMultiplier;
break;
@@ -122,10 +112,11 @@ public class SigilLightning extends EnergyItems implements IBindable, ISigil
break;
}
if (SoulNetworkHandler.getCurrentEssence(itemStack.getTagCompound().getString("ownerName")) >= cost || player.capabilities.isCreativeMode)
{
switch (mode)
{
if (SoulNetworkHandler.getCurrentEssence(
itemStack.getTagCompound().getString("ownerName"))
>= cost
|| player.capabilities.isCreativeMode) {
switch (mode) {
case 0:
world.spawnEntityInWorld(new EntityLightningBolt(world, ex, wy, zee));
break;
@@ -193,17 +184,12 @@ public class SigilLightning extends EnergyItems implements IBindable, ISigil
return itemStack;
}
private void changeMode(ItemStack itemStack, boolean next)
{
private void changeMode(ItemStack itemStack, boolean next) {
int mode = itemStack.getItemDamage();
if (next)
{
if (mode < 4)
{
if (next) {
if (mode < 4) {
mode++;
}
else
{
} else {
mode = 0;
}
}
@@ -7,6 +7,7 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenalConfig;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,35 +18,27 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class SigilSwimming extends EnergyItems implements ArmourUpgrade, IBindable, ISigil
{
public class SigilSwimming extends EnergyItems implements ArmourUpgrade, IBindable, ISigil {
@SideOnly(Side.CLIENT)
private static IIcon activeIcon;
@SideOnly(Side.CLIENT)
private static IIcon passiveIcon;
public SigilSwimming()
{
public SigilSwimming() {
super();
setMaxStackSize(1);
setEnergyUsed(100);
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.sigil.swimming"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3List.add("Activated");
}
else
{
} else {
par3List.add("Deactivated");
}
@@ -55,8 +48,7 @@ public class SigilSwimming extends EnergyItems implements ArmourUpgrade, IBindab
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
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");
@@ -64,70 +56,54 @@ public class SigilSwimming extends EnergyItems implements ArmourUpgrade, IBindab
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.stackTagCompound == null)
{
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"))
{
if (tag.getBoolean("isActive")) {
return activeIcon;
}
else
{
} else {
return passiveIcon;
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (par1 == 1)
{
public IIcon getIconFromDamage(int par1) {
if (par1 == 1) {
return activeIcon;
}
else
{
} else {
return passiveIcon;
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
return par1ItemStack;
}
if (par1ItemStack.stackTagCompound == null)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound tag = par1ItemStack.stackTagCompound;
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
if (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)
{
if (!par3EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
}
}
else
{
} else {
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
}
@@ -135,39 +111,32 @@ public class SigilSwimming extends EnergyItems implements ArmourUpgrade, IBindab
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
if (!(par3Entity instanceof EntityPlayer))
{
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)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
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)
{
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)
{
public void onArmourUpdate(World par1World, EntityPlayer par2EntityPlayer, ItemStack par3ItemStack) {
if (par3ItemStack.stackTagCompound == null) {
par3ItemStack.setTagCompound(new NBTTagCompound());
}
@@ -175,14 +144,12 @@ public class SigilSwimming extends EnergyItems implements ArmourUpgrade, IBindab
}
@Override
public boolean isUpgrade()
{
public boolean isUpgrade() {
return true;
}
@Override
public int getEnergyForTenSeconds()
{
public int getEnergyForTenSeconds() {
return BloodArsenalConfig.sigilSwimmingCost;
}
}
@@ -17,10 +17,9 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.client.event.MouseEvent;
public class SigilUtils
{
public static MovingObjectPosition getTargetBlock(World world, double x, double y, double z, float yaw, float pitch, boolean par3, double range)
{
public class SigilUtils {
public static MovingObjectPosition getTargetBlock(
World world, double x, double y, double z, float yaw, float pitch, boolean par3, double range) {
Vec3 var13 = Vec3.createVectorHelper(x, y, z);
float var14 = MathHelper.cos(-yaw * 0.01745329F - 3.141593F);
float var15 = MathHelper.sin(-yaw * 0.01745329F - 3.141593F);
@@ -35,20 +34,16 @@ public class SigilUtils
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onMouseEvent(MouseEvent event)
{
public void onMouseEvent(MouseEvent event) {
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
if (event.dwheel != 0 && player != null && player.isSneaking())
{
if (event.dwheel != 0 && player != null && player.isSneaking()) {
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null)
{
if (stack != null) {
Item item = stack.getItem();
if (item instanceof SigilAugmentedHolding)
{
if (item instanceof SigilAugmentedHolding) {
cycleSigil(stack, player, event.dwheel);
event.setCanceled(true);
}
@@ -56,8 +51,7 @@ public class SigilUtils
}
}
private void cycleSigil(ItemStack stack, EntityPlayer player, int dWheel)
{
private void cycleSigil(ItemStack stack, EntityPlayer player, int dWheel) {
int mode = SigilAugmentedHolding.getCurrentItem(stack);
mode = dWheel < 0 ? SigilAugmentedHolding.next(mode) : SigilAugmentedHolding.prev(mode);
SigilAugmentedHolding.cycleSigil(stack, mode);
@@ -4,12 +4,10 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side;
public class AHPacketHandler
{
public class AHPacketHandler {
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("AugmentedHolding");
public static void init()
{
public static void init() {
INSTANCE.registerMessage(AHPacketProcessor.class, AHPacketProcessor.class, 0, Side.SERVER);
}
}
@@ -6,45 +6,38 @@ import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
public class AHPacketProcessor implements IMessage, IMessageHandler<AHPacketProcessor, IMessage>
{
public class AHPacketProcessor implements IMessage, IMessageHandler<AHPacketProcessor, IMessage> {
private int slot;
private int mode;
public AHPacketProcessor() {}
public AHPacketProcessor(int slot, int mode)
{
public AHPacketProcessor(int slot, int mode) {
this.slot = slot;
this.mode = mode;
}
@Override
public void toBytes(ByteBuf buffer)
{
public void toBytes(ByteBuf buffer) {
buffer.writeInt(slot);
buffer.writeInt(mode);
}
@Override
public void fromBytes(ByteBuf buffer)
{
public void fromBytes(ByteBuf buffer) {
slot = buffer.readInt();
mode = buffer.readInt();
}
@Override
public IMessage onMessage(AHPacketProcessor message, MessageContext ctx)
{
public IMessage onMessage(AHPacketProcessor message, MessageContext ctx) {
ItemStack itemStack = null;
if (message.slot > -1 && message.slot < 9)
{
if (message.slot > -1 && message.slot < 9) {
itemStack = ctx.getServerHandler().playerEntity.inventory.getStackInSlot(message.slot);
}
if (itemStack != null)
{
if (itemStack != null) {
SigilAugmentedHolding.cycleSigil(itemStack, message.mode);
}
@@ -8,8 +8,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerAugmentedHolding extends Container
{
public class ContainerAugmentedHolding extends Container {
protected final int PLAYER_INVENTORY_ROWS = 3;
protected final int PLAYER_INVENTORY_COLUMNS = 9;
@@ -18,117 +17,99 @@ public class ContainerAugmentedHolding extends Container
private final EntityPlayer player;
public final InventoryAugmentedHolding inventoryHolding;
public ContainerAugmentedHolding(EntityPlayer player, InventoryAugmentedHolding inventoryHolding)
{
public ContainerAugmentedHolding(EntityPlayer player, InventoryAugmentedHolding inventoryHolding) {
this.player = player;
this.inventoryHolding = inventoryHolding;
int currentSlotHeldIn = player.inventory.currentItem;
for (int columnIndex = 0; columnIndex < inventoryColumns; ++columnIndex)
{
this.addSlotToContainer(new SlotHolding(this, inventoryHolding, player, columnIndex, 8 + columnIndex * 18, 15));
for (int columnIndex = 0; columnIndex < inventoryColumns; ++columnIndex) {
this.addSlotToContainer(
new SlotHolding(this, inventoryHolding, player, columnIndex, 8 + columnIndex * 18, 15));
}
for (int rowIndex = 0; rowIndex < PLAYER_INVENTORY_ROWS; ++rowIndex)
{
for (int columnIndex = 0; columnIndex < PLAYER_INVENTORY_COLUMNS; ++columnIndex)
{
this.addSlotToContainer(new Slot(player.inventory, columnIndex + rowIndex * 9 + 9, 8 + columnIndex * 18, 39 + rowIndex * 18));
for (int rowIndex = 0; rowIndex < PLAYER_INVENTORY_ROWS; ++rowIndex) {
for (int columnIndex = 0; columnIndex < PLAYER_INVENTORY_COLUMNS; ++columnIndex) {
this.addSlotToContainer(new Slot(
player.inventory, columnIndex + rowIndex * 9 + 9, 8 + columnIndex * 18, 39 + rowIndex * 18));
}
}
for (int actionBarIndex = 0; actionBarIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarIndex)
{
if (actionBarIndex == currentSlotHeldIn)
{
this.addSlotToContainer(new SlotDisabled(player.inventory, actionBarIndex, 8 + actionBarIndex * 18, 97));
}
else
{
for (int actionBarIndex = 0; actionBarIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarIndex) {
if (actionBarIndex == currentSlotHeldIn) {
this.addSlotToContainer(
new SlotDisabled(player.inventory, actionBarIndex, 8 + actionBarIndex * 18, 97));
} else {
this.addSlotToContainer(new Slot(player.inventory, actionBarIndex, 8 + actionBarIndex * 18, 97));
}
}
}
@Override
public boolean canInteractWith(EntityPlayer entityPlayer)
{
public boolean canInteractWith(EntityPlayer entityPlayer) {
return true;
}
@Override
public void onContainerClosed(EntityPlayer entityPlayer)
{
public void onContainerClosed(EntityPlayer entityPlayer) {
super.onContainerClosed(entityPlayer);
if (!entityPlayer.worldObj.isRemote)
{
if (!entityPlayer.worldObj.isRemote) {
saveInventory(entityPlayer);
}
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
if (!player.worldObj.isRemote)
{
if (!player.worldObj.isRemote) {
saveInventory(player);
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex)
{
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) {
ItemStack stack = null;
Slot slotObject = (Slot) inventorySlots.get(slotIndex);
int slots = inventorySlots.size();
if (slotObject != null && slotObject.getHasStack())
{
if (slotObject != null && slotObject.getHasStack()) {
ItemStack stackInSlot = slotObject.getStack();
stack = stackInSlot.copy();
if (stack.getItem() instanceof ISigil)
{
if (slotIndex < inventoryColumns)
{
if (!this.mergeItemStack(stackInSlot, inventoryColumns, slots, false))
{
if (stack.getItem() instanceof ISigil) {
if (slotIndex < inventoryColumns) {
if (!this.mergeItemStack(stackInSlot, inventoryColumns, slots, false)) {
return null;
}
}
else if (!this.mergeItemStack(stackInSlot, 0, inventoryColumns, false))
{
} else if (!this.mergeItemStack(stackInSlot, 0, inventoryColumns, false)) {
return null;
}
}
else if (stack.getItem() instanceof SigilAugmentedHolding)
{
if (slotIndex < inventoryColumns + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS))
{
if (!this.mergeItemStack(stackInSlot, inventoryColumns + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS), inventorySlots.size(), false))
{
} else if (stack.getItem() instanceof SigilAugmentedHolding) {
if (slotIndex < inventoryColumns + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS)) {
if (!this.mergeItemStack(
stackInSlot,
inventoryColumns + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS),
inventorySlots.size(),
false)) {
return null;
}
}
else if (!this.mergeItemStack(stackInSlot, inventoryColumns, inventoryColumns + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS), false))
{
} else if (!this.mergeItemStack(
stackInSlot,
inventoryColumns,
inventoryColumns + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS),
false)) {
return null;
}
}
if (stackInSlot.stackSize == 0)
{
if (stackInSlot.stackSize == 0) {
slotObject.putStack(null);
} else
{
} else {
slotObject.onSlotChanged();
}
if (stackInSlot.stackSize == stack.stackSize)
{
if (stackInSlot.stackSize == stack.stackSize) {
return null;
}
@@ -138,58 +119,54 @@ public class ContainerAugmentedHolding extends Container
return stack;
}
public void saveInventory(EntityPlayer entityPlayer)
{
public void saveInventory(EntityPlayer entityPlayer) {
inventoryHolding.onGuiSaved(entityPlayer);
}
private class SlotHolding extends Slot
{
private class SlotHolding extends Slot {
private final EntityPlayer player;
private ContainerAugmentedHolding containerHolding;
public SlotHolding(ContainerAugmentedHolding containerHolding, IInventory inventory, EntityPlayer player, int slotIndex, int x, int y)
{
public SlotHolding(
ContainerAugmentedHolding containerHolding,
IInventory inventory,
EntityPlayer player,
int slotIndex,
int x,
int y) {
super(inventory, slotIndex, x, y);
this.player = player;
this.containerHolding = containerHolding;
}
@Override
public void onSlotChanged()
{
public void onSlotChanged() {
super.onSlotChanged();
if (FMLCommonHandler.instance().getEffectiveSide().isServer())
{
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
containerHolding.saveInventory(player);
}
}
@Override
public boolean isItemValid(ItemStack itemStack)
{
public boolean isItemValid(ItemStack itemStack) {
return itemStack.getItem() instanceof ISigil;
}
}
private class SlotDisabled extends Slot
{
public SlotDisabled(IInventory inventory, int slotIndex, int x, int y)
{
private class SlotDisabled extends Slot {
public SlotDisabled(IInventory inventory, int slotIndex, int x, int y) {
super(inventory, slotIndex, x, y);
}
@Override
public boolean isItemValid(ItemStack itemStack)
{
public boolean isItemValid(ItemStack itemStack) {
return false;
}
@Override
public boolean canTakeStack(EntityPlayer player)
{
public boolean canTakeStack(EntityPlayer player) {
return false;
}
}
}
}
@@ -8,26 +8,22 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GuiAugmentedHolding extends GuiContainer
{
public GuiAugmentedHolding(EntityPlayer player, InventoryAugmentedHolding inventoryHolding)
{
public class GuiAugmentedHolding extends GuiContainer {
public GuiAugmentedHolding(EntityPlayer player, InventoryAugmentedHolding inventoryHolding) {
super(new ContainerAugmentedHolding(player, inventoryHolding));
xSize = 176;
ySize = 121;
}
@Override
protected void drawGuiContainerForegroundLayer(int param1, int param2)
{
//the parameters for drawString are: string, x, y, color
protected void drawGuiContainerForegroundLayer(int param1, int param2) {
// the parameters for drawString are: string, x, y, color
fontRendererObj.drawString("Sigil of Augmented Holding", 24, 4, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
//draw your Gui here, only thing you need to change is the path
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
// draw your Gui here, only thing you need to change is the path
ResourceLocation test = new ResourceLocation("bloodarsenal", "textures/gui/SigilAugmentedHolding.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(test);
@@ -1,16 +1,14 @@
package com.arc.bloodarsenal.common.items.sigil.holding;
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import java.util.UUID;
public class InventoryAugmentedHolding implements IInventory
{
public class InventoryAugmentedHolding implements IInventory {
public ItemStack parentItemStack;
protected ItemStack[] inventory;
@@ -18,8 +16,7 @@ public class InventoryAugmentedHolding implements IInventory
protected static String NBT_LEAST_SIG = "LeastSig";
protected static String NBT_ITEMS = "Items";
public InventoryAugmentedHolding(ItemStack itemStack)
{
public InventoryAugmentedHolding(ItemStack itemStack) {
parentItemStack = itemStack;
inventory = new ItemStack[9];
@@ -27,29 +24,26 @@ public class InventoryAugmentedHolding implements IInventory
readFromNBT(itemStack.getTagCompound());
}
public void onGuiSaved(EntityPlayer entityPlayer)
{
public void onGuiSaved(EntityPlayer entityPlayer) {
parentItemStack = findParentItemStack(entityPlayer);
if (parentItemStack != null)
{
if (parentItemStack != null) {
save();
}
}
public ItemStack findParentItemStack(EntityPlayer entityPlayer)
{
if (hasUUID(parentItemStack))
{
UUID parentItemStackUUID = new UUID(parentItemStack.getTagCompound().getLong(NBT_MOST_SIG), parentItemStack.getTagCompound().getLong(NBT_LEAST_SIG));
for (int i = 0; i < entityPlayer.inventory.getSizeInventory(); i++)
{
public ItemStack findParentItemStack(EntityPlayer entityPlayer) {
if (hasUUID(parentItemStack)) {
UUID parentItemStackUUID = new UUID(
parentItemStack.getTagCompound().getLong(NBT_MOST_SIG),
parentItemStack.getTagCompound().getLong(NBT_LEAST_SIG));
for (int i = 0; i < entityPlayer.inventory.getSizeInventory(); i++) {
ItemStack itemStack = entityPlayer.inventory.getStackInSlot(i);
if (hasUUID(itemStack))
{
if (itemStack.getTagCompound().getLong(NBT_MOST_SIG) == parentItemStackUUID.getMostSignificantBits() && itemStack.getTagCompound().getLong(NBT_LEAST_SIG) == parentItemStackUUID.getLeastSignificantBits())
{
if (hasUUID(itemStack)) {
if (itemStack.getTagCompound().getLong(NBT_MOST_SIG) == parentItemStackUUID.getMostSignificantBits()
&& itemStack.getTagCompound().getLong(NBT_LEAST_SIG)
== parentItemStackUUID.getLeastSignificantBits()) {
return itemStack;
}
}
@@ -59,12 +53,10 @@ public class InventoryAugmentedHolding implements IInventory
return null;
}
public void save()
{
public void save() {
NBTTagCompound nbtTagCompound = parentItemStack.getTagCompound();
if (nbtTagCompound == null)
{
if (nbtTagCompound == null) {
nbtTagCompound = new NBTTagCompound();
UUID uuid = UUID.randomUUID();
@@ -77,32 +69,24 @@ public class InventoryAugmentedHolding implements IInventory
}
@Override
public int getSizeInventory()
{
public int getSizeInventory() {
return inventory.length;
}
@Override
public ItemStack getStackInSlot(int slotIndex)
{
public ItemStack getStackInSlot(int slotIndex) {
return slotIndex >= 0 && slotIndex < this.inventory.length ? inventory[slotIndex] : null;
}
@Override
public ItemStack decrStackSize(int slotIndex, int decrementAmount)
{
public ItemStack decrStackSize(int slotIndex, int decrementAmount) {
ItemStack itemStack = getStackInSlot(slotIndex);
if (itemStack != null)
{
if (itemStack.stackSize <= decrementAmount)
{
if (itemStack != null) {
if (itemStack.stackSize <= decrementAmount) {
setInventorySlotContents(slotIndex, null);
}
else
{
} else {
itemStack = itemStack.splitStack(decrementAmount);
if (itemStack.stackSize == 0)
{
if (itemStack.stackSize == 0) {
setInventorySlotContents(slotIndex, null);
}
}
@@ -112,92 +96,73 @@ public class InventoryAugmentedHolding implements IInventory
}
@Override
public ItemStack getStackInSlotOnClosing(int slotIndex)
{
if (inventory[slotIndex] != null)
{
public ItemStack getStackInSlotOnClosing(int slotIndex) {
if (inventory[slotIndex] != null) {
ItemStack itemStack = inventory[slotIndex];
inventory[slotIndex] = null;
return itemStack;
}
else
{
} else {
return null;
}
}
@Override
public void setInventorySlotContents(int slotIndex, ItemStack itemStack)
{
if (slotIndex >= 0 && slotIndex < this.inventory.length)
{
public void setInventorySlotContents(int slotIndex, ItemStack itemStack) {
if (slotIndex >= 0 && slotIndex < this.inventory.length) {
this.inventory[slotIndex] = itemStack;
}
}
@Override
public String getInventoryName()
{
public String getInventoryName() {
return "SigilOfAugmentedHolding";
}
@Override
public boolean hasCustomInventoryName()
{
public boolean hasCustomInventoryName() {
return false;
}
@Override
public int getInventoryStackLimit()
{
public int getInventoryStackLimit() {
return 1;
}
@Override
public void markDirty()
{
public void markDirty() {
// NOOP
}
@Override
public boolean isUseableByPlayer(EntityPlayer entityPlayer)
{
public boolean isUseableByPlayer(EntityPlayer entityPlayer) {
return true;
}
@Override
public void openInventory()
{
public void openInventory() {
// NOOP
}
@Override
public void closeInventory()
{
public void closeInventory() {
// NOOP
}
@Override
public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack)
{
public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack) {
return itemStack.getItem() instanceof ISigil;
}
public void readFromNBT(NBTTagCompound nbtTagCompound)
{
if (nbtTagCompound != null && nbtTagCompound.hasKey(NBT_ITEMS))
{
public void readFromNBT(NBTTagCompound nbtTagCompound) {
if (nbtTagCompound != null && nbtTagCompound.hasKey(NBT_ITEMS)) {
// Read in the ItemStacks in the inventory from NBT
if (nbtTagCompound.hasKey(NBT_ITEMS))
{
if (nbtTagCompound.hasKey(NBT_ITEMS)) {
NBTTagList tagList = nbtTagCompound.getTagList(NBT_ITEMS, 10);
inventory = new ItemStack[this.getSizeInventory()];
for (int i = 0; i < tagList.tagCount(); ++i)
{
for (int i = 0; i < tagList.tagCount(); ++i) {
NBTTagCompound tagCompound = tagList.getCompoundTagAt(i);
byte slotIndex = tagCompound.getByte("Slot");
if (slotIndex >= 0 && slotIndex < inventory.length)
{
if (slotIndex >= 0 && slotIndex < inventory.length) {
inventory[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound);
}
}
@@ -205,14 +170,11 @@ public class InventoryAugmentedHolding implements IInventory
}
}
public void writeToNBT(NBTTagCompound nbtTagCompound)
{
public void writeToNBT(NBTTagCompound nbtTagCompound) {
// Write the ItemStacks in the inventory to NBT
NBTTagList tagList = new NBTTagList();
for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex)
{
if (inventory[currentIndex] != null)
{
for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) {
if (inventory[currentIndex] != null) {
NBTTagCompound tagCompound = new NBTTagCompound();
tagCompound.setByte("Slot", (byte) currentIndex);
inventory[currentIndex].writeToNBT(tagCompound);
@@ -222,40 +184,33 @@ public class InventoryAugmentedHolding implements IInventory
nbtTagCompound.setTag(NBT_ITEMS, tagList);
}
public static boolean hasTag(ItemStack itemStack, String keyName)
{
public static boolean hasTag(ItemStack itemStack, String keyName) {
return itemStack != null && itemStack.stackTagCompound != null && itemStack.stackTagCompound.hasKey(keyName);
}
public static boolean hasUUID(ItemStack itemStack)
{
public static boolean hasUUID(ItemStack itemStack) {
return hasTag(itemStack, NBT_MOST_SIG) && hasTag(itemStack, NBT_LEAST_SIG);
}
public static void setUUID(ItemStack itemStack)
{
public static void setUUID(ItemStack itemStack) {
initNBTTagCompound(itemStack);
if (!hasTag(itemStack, NBT_MOST_SIG) && !hasTag(itemStack, NBT_LEAST_SIG))
{
if (!hasTag(itemStack, NBT_MOST_SIG) && !hasTag(itemStack, NBT_LEAST_SIG)) {
UUID itemUUID = UUID.randomUUID();
setLong(itemStack, NBT_MOST_SIG, itemUUID.getMostSignificantBits());
setLong(itemStack, NBT_LEAST_SIG, itemUUID.getLeastSignificantBits());
}
}
private static void initNBTTagCompound(ItemStack itemStack)
{
if (itemStack.stackTagCompound == null)
{
private static void initNBTTagCompound(ItemStack itemStack) {
if (itemStack.stackTagCompound == null) {
itemStack.setTagCompound(new NBTTagCompound());
}
}
public static void setLong(ItemStack itemStack, String keyName, long keyValue)
{
public static void setLong(ItemStack itemStack, String keyName, long keyValue) {
initNBTTagCompound(itemStack);
itemStack.stackTagCompound.setLong(keyName, keyValue);
}
}
}
@@ -2,6 +2,7 @@ package com.arc.bloodarsenal.common.items.sigil.holding;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -12,36 +13,28 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class SigilAugmentedHolding extends EnergyItems
{
public class SigilAugmentedHolding extends EnergyItems {
private static int invSize = 8;
private static final String NBT_CURRENT_SIGIL = "CurrentSigil";
public SigilAugmentedHolding()
{
public SigilAugmentedHolding() {
super();
setMaxStackSize(1);
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (!(stack.getTagCompound() == null))
{
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
if (!(stack.getTagCompound() == null)) {
ItemStack[] inv = getInternalInventory(stack);
if (inv == null)
{
if (inv == null) {
return this.itemIcon;
}
ItemStack item = getCurrentSigil(stack);
if (item != null)
{
if (item != null) {
return item.getIconIndex();
}
}
@@ -50,59 +43,62 @@ public class SigilAugmentedHolding extends EnergyItems
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.sigil.augmentedHolding"));
if (!(par1ItemStack.getTagCompound() == null))
{
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
if (!(par1ItemStack.getTagCompound() == null)) {
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
+ par1ItemStack.getTagCompound().getString("ownerName"));
ItemStack[] inv = getInternalInventory(par1ItemStack);
if (inv == null)
{
if (inv == null) {
return;
}
int currentSlot = getCurrentItem(par1ItemStack);
ItemStack item = inv[currentSlot];
if (item != null)
{
if (item != null) {
par3List.add(StatCollector.translateToLocal("tooltip.item.currentitem") + " " + item.getDisplayName());
}
for (int i = 0; i <= invSize; i++)
{
if (inv[i] != null)
{
par3List.add(StatCollector.translateToLocal("tooltip.item.iteminslot") + " " + (i + 1) + ": " + inv[i].getDisplayName());
for (int i = 0; i <= invSize; i++) {
if (inv[i] != null) {
par3List.add(StatCollector.translateToLocal("tooltip.item.iteminslot") + " " + (i + 1) + ": "
+ inv[i].getDisplayName());
}
}
}
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (checkAndSetItemOwner(par1ItemStack, par2EntityPlayer))
{
public boolean onItemUse(
ItemStack par1ItemStack,
EntityPlayer par2EntityPlayer,
World par3World,
int par4,
int par5,
int par6,
int par7,
float par8,
float par9,
float par10) {
if (checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) {
int currentSlot = getCurrentItem(par1ItemStack);
ItemStack[] inv = getInternalInventory(par1ItemStack);
if (inv == null)
{
if (inv == null) {
return false;
}
ItemStack itemUsed = inv[currentSlot];
if (itemUsed == null)
{
if (itemUsed == null) {
return false;
}
boolean bool = itemUsed.getItem().onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
boolean bool = itemUsed.getItem()
.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
saveInventory(par1ItemStack, inv);
@@ -113,29 +109,30 @@ public class SigilAugmentedHolding extends EnergyItems
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
{
if (par3EntityPlayer.isSneaking())
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
if (par3EntityPlayer.isSneaking()) {
InventoryAugmentedHolding.setUUID(par1ItemStack);
par3EntityPlayer.openGui(BloodArsenal.instance, 0, par3EntityPlayer.worldObj, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ);
par3EntityPlayer.openGui(
BloodArsenal.instance,
0,
par3EntityPlayer.worldObj,
(int) par3EntityPlayer.posX,
(int) par3EntityPlayer.posY,
(int) par3EntityPlayer.posZ);
return par1ItemStack;
}
int currentSlot = getCurrentItem(par1ItemStack);
ItemStack[] inv = getInternalInventory(par1ItemStack);
if (inv == null)
{
if (inv == null) {
return par1ItemStack;
}
ItemStack itemUsed = inv[currentSlot];
if (itemUsed == null)
{
if (itemUsed == null) {
return par1ItemStack;
}
@@ -146,47 +143,38 @@ public class SigilAugmentedHolding extends EnergyItems
return par1ItemStack;
}
public static int next(int mode)
{
public static int next(int mode) {
int index = mode + 1;
if (index >= invSize + 1)
{
if (index >= invSize + 1) {
index = 0;
}
return index;
}
public static int prev(int mode)
{
public static int prev(int mode) {
int index = mode - 1;
if (index < 0)
{
if (index < 0) {
index = invSize;
}
return index;
}
private static void initModeTag(ItemStack itemStack)
{
if (itemStack.stackTagCompound == null)
{
private static void initModeTag(ItemStack itemStack) {
if (itemStack.stackTagCompound == null) {
itemStack.stackTagCompound = new NBTTagCompound();
itemStack.stackTagCompound.setInteger(NBT_CURRENT_SIGIL, invSize);
}
}
public static ItemStack getCurrentSigil(ItemStack itemStack)
{
if (itemStack != null && itemStack.getItem() instanceof SigilAugmentedHolding)
{
public static ItemStack getCurrentSigil(ItemStack itemStack) {
if (itemStack != null && itemStack.getItem() instanceof SigilAugmentedHolding) {
ItemStack[] itemStacks = getInternalInventory(itemStack);
int currentSlot = getCurrentItem(itemStack);
if (itemStacks != null)
{
if (itemStacks != null) {
return itemStacks[currentSlot];
}
}
@@ -194,10 +182,8 @@ public class SigilAugmentedHolding extends EnergyItems
return null;
}
public static int getCurrentItem(ItemStack itemStack)
{
if (itemStack != null && itemStack.getItem() instanceof SigilAugmentedHolding)
{
public static int getCurrentItem(ItemStack itemStack) {
if (itemStack != null && itemStack.getItem() instanceof SigilAugmentedHolding) {
initModeTag(itemStack);
int currentSigil = itemStack.stackTagCompound.getInteger(NBT_CURRENT_SIGIL);
currentSigil = MathHelper.clamp_int(currentSigil, 0, invSize);
@@ -207,31 +193,26 @@ public class SigilAugmentedHolding extends EnergyItems
return 8;
}
public static ItemStack[] getInternalInventory(ItemStack itemStack)
{
public static ItemStack[] getInternalInventory(ItemStack itemStack) {
initModeTag(itemStack);
NBTTagCompound tagCompound = itemStack.getTagCompound();
if (tagCompound == null)
{
if (tagCompound == null) {
return null;
}
ItemStack[] inv = new ItemStack[9];
NBTTagList tagList = tagCompound.getTagList(InventoryAugmentedHolding.NBT_ITEMS, 10);
if (tagList == null)
{
if (tagList == null) {
return null;
}
for (int i = 0; i < tagList.tagCount(); i++)
{
for (int i = 0; i < tagList.tagCount(); i++) {
NBTTagCompound tag = tagList.getCompoundTagAt(i);
int slot = tag.getByte("Slot");
if (slot >= 0 && slot <= invSize)
{
if (slot >= 0 && slot <= invSize) {
inv[slot] = ItemStack.loadItemStackFromNBT(tag);
}
}
@@ -239,21 +220,17 @@ public class SigilAugmentedHolding extends EnergyItems
return inv;
}
public void saveInventory(ItemStack itemStack, ItemStack[] inventory)
{
public void saveInventory(ItemStack itemStack, ItemStack[] inventory) {
NBTTagCompound itemTag = itemStack.getTagCompound();
if (itemTag == null)
{
if (itemTag == null) {
itemStack.setTagCompound(new NBTTagCompound());
}
NBTTagList itemList = new NBTTagList();
for (int i = 0; i <= invSize; i++)
{
if (inventory[i] != null)
{
for (int i = 0; i <= invSize; i++) {
if (inventory[i] != null) {
NBTTagCompound tag = new NBTTagCompound();
tag.setByte("Slot", (byte) i);
inventory[i].writeToNBT(tag);
@@ -264,37 +241,30 @@ public class SigilAugmentedHolding extends EnergyItems
itemTag.setTag(InventoryAugmentedHolding.NBT_ITEMS, itemList);
}
public static void cycleSigil(ItemStack itemStack, int mode)
{
if (itemStack != null && itemStack.getItem() instanceof SigilAugmentedHolding)
{
public static void cycleSigil(ItemStack itemStack, int mode) {
if (itemStack != null && itemStack.getItem() instanceof SigilAugmentedHolding) {
initModeTag(itemStack);
itemStack.stackTagCompound.setInteger(NBT_CURRENT_SIGIL, mode);
}
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
if (!(par1ItemStack.getTagCompound() == null))
{
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
if (!(par1ItemStack.getTagCompound() == null)) {
this.tickInternalInventory(par1ItemStack, par2World, par3Entity, par4, par5);
}
}
public void tickInternalInventory(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
public void tickInternalInventory(
ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
ItemStack[] inv = getInternalInventory(par1ItemStack);
if (inv == null)
{
if (inv == null) {
return;
}
for (int i = 0; i < invSize; i++)
{
if (inv[i] == null)
{
for (int i = 0; i < invSize; i++) {
if (inv[i] == null) {
continue;
}
@@ -5,17 +5,18 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemBow;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.init.Items;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -23,25 +24,25 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
import java.util.List;
public class BoundBow extends ItemBow implements IBindable
{
public class BoundBow extends ItemBow implements IBindable {
@SideOnly(Side.CLIENT)
private IIcon active;
@SideOnly(Side.CLIENT)
private IIcon active_1;
@SideOnly(Side.CLIENT)
private IIcon active_2;
@SideOnly(Side.CLIENT)
private IIcon active_3;
@SideOnly(Side.CLIENT)
private IIcon passive;
private int energyUsed;
public BoundBow()
{
public BoundBow() {
setMaxStackSize(1);
setMaxDamage(0);
setUnlocalizedName("bound_bow");
@@ -50,129 +51,110 @@ public class BoundBow extends ItemBow implements IBindable
setFull3D();
}
public void setEnergyUsed(int i)
{
public void setEnergyUsed(int i) {
energyUsed = i;
}
public int getEnergyUsed()
{
public int getEnergyUsed() {
return energyUsed;
}
@Override
public boolean isFull3D()
{
public boolean isFull3D() {
return true;
}
@Override
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
{
public void onPlayerStoppedUsing(
ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) {
int j = getMaxItemUseDuration(par1ItemStack) - par4;
ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())
{
if (event.isCanceled()) {
return;
}
j = event.charge;
boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
boolean flag = par3EntityPlayer.capabilities.isCreativeMode
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
if (flag || par3EntityPlayer.inventory.hasItem(Items.arrow))
{
float f = (float)j / 6.0F;
if (flag || par3EntityPlayer.inventory.hasItem(Items.arrow)) {
float f = (float) j / 6.0F;
f = (f * f + f * 2.0F) / 3.0F;
if ((double)f < 0.1D)
{
if ((double) f < 0.1D) {
return;
}
if (f > 1.0F)
{
if (f > 1.0F) {
f = 1.0F;
}
EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 3.0F);
if (f == 1.0F)
{
if (f == 1.0F) {
entityarrow.setIsCritical(true);
}
int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);
if (k > 0)
{
entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
if (k > 0) {
entityarrow.setDamage(entityarrow.getDamage() + (double) k * 0.5D + 0.5D);
}
int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);
if (l > 0)
{
if (l > 0) {
entityarrow.setKnockbackStrength(l);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
{
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) {
entityarrow.setFire(100);
}
par1ItemStack.damageItem(1, par3EntityPlayer);
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
par2World.playSoundAtEntity(
par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
if (flag)
{
if (flag) {
entityarrow.canBePickedUp = 2;
}
else
{
} else {
par3EntityPlayer.inventory.consumeInventoryItem(Items.arrow);
}
if (!par2World.isRemote)
{
if (!par2World.isRemote) {
par2World.spawnEntityInWorld(entityarrow);
entityarrow.setDamage(entityarrow.getDamage() * 1.259178F);
}
}
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (!par3EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 200);
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
setActivated(par1ItemStack, !getActivated(par1ItemStack));
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
return par1ItemStack;
}
if (!getActivated(par1ItemStack))
{
if (!getActivated(par1ItemStack)) {
return par1ItemStack;
}
ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())
{
if (event.isCanceled()) {
return event.result;
}
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Items.arrow))
{
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Items.arrow)) {
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
}
@@ -180,48 +162,40 @@ public class BoundBow extends ItemBow implements IBindable
}
@Override
public int getItemEnchantability()
{
public int getItemEnchantability() {
return 1;
}
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
return EnumAction.bow;
}
@Override
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
public int getMaxItemUseDuration(ItemStack par1ItemStack) {
return 36000;
}
@Override
public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
return par1ItemStack;
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
if (!(par3Entity instanceof EntityPlayer))
{
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)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay")
&& par1ItemStack.stackTagCompound.getBoolean("isActive")) {
if (!par3EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50);
}
}
@@ -229,24 +203,20 @@ public class BoundBow extends ItemBow implements IBindable
par1ItemStack.setItemDamage(0);
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
{
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
}
public boolean getActivated(ItemStack par1ItemStack)
{
public boolean getActivated(ItemStack par1ItemStack) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
@@ -254,23 +224,17 @@ public class BoundBow extends ItemBow implements IBindable
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_bow"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3List.add("Activated");
}
else
{
} else {
par3List.add("Deactivated");
}
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
@@ -278,8 +242,7 @@ public class BoundBow extends ItemBow implements IBindable
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("BloodArsenal:bound_bow");
active = iconRegister.registerIcon("BloodArsenal:bound_bow");
active_1 = iconRegister.registerIcon("BloodArsenal:bound_bow_pulling_0");
@@ -289,45 +252,33 @@ public class BoundBow extends ItemBow implements IBindable
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.stackTagCompound == null)
{
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"))
{
if (useRemaining > 0)
{
if (tag.getBoolean("isActive")) {
if (useRemaining > 0) {
int draw = stack.getMaxItemUseDuration() - useRemaining;
if (draw > 17)
{
if (draw > 17) {
return active_3;
}
else if (draw > 13)
{
} else if (draw > 13) {
return active_2;
}
else if (draw > 0)
{
} else if (draw > 0) {
return active_1;
}
}
return active;
}
else
{
} else {
return passive;
}
}
@Override
public boolean isItemTool(ItemStack stack)
{
public boolean isItemTool(ItemStack stack) {
return true;
}
}
@@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -17,19 +18,16 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class BoundIgniter extends Item implements IBindable
{
public class BoundIgniter extends Item implements IBindable {
private int energyUsed;
@SideOnly(Side.CLIENT)
private IIcon active;
@SideOnly(Side.CLIENT)
private IIcon passive;
public BoundIgniter()
{
public BoundIgniter() {
super();
setUnlocalizedName("bound_igniter");
setMaxStackSize(1);
@@ -37,106 +35,99 @@ public class BoundIgniter extends Item implements IBindable
setEnergyUsed(100);
}
public void setEnergyUsed(int i)
{
public void setEnergyUsed(int i) {
energyUsed = i;
}
public int getEnergyUsed()
{
public int getEnergyUsed() {
return energyUsed;
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.stackTagCompound == null)
{
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"))
{
if (tag.getBoolean("isActive")) {
return active;
}
else
{
} else {
return passive;
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
setActivated(par1ItemStack, !getActivated(par1ItemStack));
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
return par1ItemStack;
}
if (!getActivated(par1ItemStack))
{
if (!getActivated(par1ItemStack)) {
return par1ItemStack;
}
return par1ItemStack;
}
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int hitSide, float hitX, float hitY, float hitZ)
{
public boolean onItemUse(
ItemStack itemStack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int hitSide,
float hitX,
float hitY,
float hitZ) {
NBTTagCompound tag = itemStack.stackTagCompound;
if (tag.getBoolean("isActive"))
{
if (!player.capabilities.isCreativeMode)
{
if (tag.getBoolean("isActive")) {
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(itemStack, player, 50);
}
if (hitSide == 0)
{
if (hitSide == 0) {
--y;
}
if (hitSide == 1)
{
if (hitSide == 1) {
++y;
}
if (hitSide == 2)
{
if (hitSide == 2) {
--z;
}
if (hitSide == 3)
{
if (hitSide == 3) {
++z;
}
if (hitSide == 4)
{
if (hitSide == 4) {
--x;
}
if (hitSide == 5)
{
if (hitSide == 5) {
++x;
}
if (!player.canPlayerEdit(x, y, z, hitSide, itemStack))
{
if (!player.canPlayerEdit(x, y, z, hitSide, itemStack)) {
return false;
}
else
{
if (world.isAirBlock(x, y, z))
{
world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
} else {
if (world.isAirBlock(x, y, z)) {
world.playSoundEffect(
(double) x + 0.5D,
(double) y + 0.5D,
(double) z + 0.5D,
"fire.ignite",
1.0F,
itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlock(x, y, z, Blocks.fire);
}
}
@@ -146,24 +137,20 @@ public class BoundIgniter extends Item implements IBindable
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
if (!(par3Entity instanceof EntityPlayer))
{
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)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay")
&& par1ItemStack.stackTagCompound.getBoolean("isActive")) {
if (!par3EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50);
}
}
@@ -171,24 +158,20 @@ public class BoundIgniter extends Item implements IBindable
par1ItemStack.setItemDamage(0);
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
{
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
}
public boolean getActivated(ItemStack par1ItemStack)
{
public boolean getActivated(ItemStack par1ItemStack) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
@@ -196,8 +179,7 @@ public class BoundIgniter extends Item implements IBindable
}
@Override
public boolean onLeftClickEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, Entity par3Entity)
{
public boolean onLeftClickEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, Entity par3Entity) {
EntityLivingBase living = (EntityLivingBase) par3Entity;
living.setFire(4);
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, 50);
@@ -206,49 +188,39 @@ public class BoundIgniter extends Item implements IBindable
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_igniter"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3List.add("Activated");
}
else
{
} else {
par3List.add("Deactivated");
}
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
{
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) {
return false;
}
@Override
public ItemStack getContainerItem(ItemStack itemStack)
{
public ItemStack getContainerItem(ItemStack itemStack) {
return itemStack;
}
@Override
public boolean hasContainerItem(ItemStack stack)
{
public boolean hasContainerItem(ItemStack stack) {
return true;
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("BloodArsenal:bound_igniter");
active = iconRegister.registerIcon("BloodArsenal:bound_igniter");
passive = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
@@ -6,6 +6,9 @@ import com.arc.bloodarsenal.common.BloodArsenal;
import com.arc.bloodarsenal.common.entity.mob.EntityBloodHound;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -25,21 +28,16 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.IShearable;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class BoundShears extends ItemShears implements IBindable
{
public class BoundShears extends ItemShears implements IBindable {
private int energyUsed;
@SideOnly(Side.CLIENT)
private IIcon active;
@SideOnly(Side.CLIENT)
private IIcon passive;
public BoundShears()
{
public BoundShears() {
super();
setMaxStackSize(1);
setUnlocalizedName("bound_shears");
@@ -47,73 +45,77 @@ public class BoundShears extends ItemShears implements IBindable
setEnergyUsed(50);
}
public void setEnergyUsed(int i)
{
public void setEnergyUsed(int i) {
energyUsed = i;
}
public int getEnergyUsed()
{
public int getEnergyUsed() {
return energyUsed;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
{
public boolean onBlockDestroyed(
ItemStack par1ItemStack,
World par2World,
Block par3Block,
int par4,
int par5,
int par6,
EntityLivingBase par7EntityLivingBase) {
if (!(par7EntityLivingBase instanceof EntityPlayer)) return false;
EntityPlayer player = (EntityPlayer) par7EntityLivingBase;
if (!player.capabilities.isCreativeMode)
{
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, player, 50);
}
if (par3Block.getMaterial() != Material.leaves && par3Block != Blocks.web && par3Block != Blocks.tallgrass && par3Block != Blocks.vine && par3Block != Blocks.tripwire && !(par3Block instanceof IShearable))
{
if (par3Block.getMaterial() != Material.leaves
&& par3Block != Blocks.web
&& par3Block != Blocks.tallgrass
&& par3Block != Blocks.vine
&& par3Block != Blocks.tripwire
&& !(par3Block instanceof IShearable)) {
return super.onBlockDestroyed(par1ItemStack, par2World, par3Block, par4, par5, par6, par7EntityLivingBase);
}
else
{
} else {
return true;
}
}
public boolean func_150897_b(Block par1Block)
{
public boolean func_150897_b(Block par1Block) {
return par1Block == Blocks.web || par1Block == Blocks.redstone_wire || par1Block == Blocks.tripwire;
}
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
{
return par2Block != Blocks.web && par2Block.getMaterial() != Material.leaves ? (par2Block == Blocks.wool ? 5.0F : super.func_150893_a(par1ItemStack, par2Block)) : 15.0F;
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) {
return par2Block != Blocks.web && par2Block.getMaterial() != Material.leaves
? (par2Block == Blocks.wool ? 5.0F : super.func_150893_a(par1ItemStack, par2Block))
: 15.0F;
}
@Override
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity)
{
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) {
NBTTagCompound tag = itemstack.stackTagCompound;
if (tag.getBoolean("isActive"))
{
if (!player.capabilities.isCreativeMode)
{
if (tag.getBoolean("isActive")) {
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(itemstack, player, 50);
}
if (entity.worldObj.isRemote)
{
if (entity.worldObj.isRemote) {
return false;
}
if (entity instanceof IShearable)
{
IShearable target = (IShearable)entity;
if (target.isShearable(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ))
{
ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ,
if (entity instanceof IShearable) {
IShearable target = (IShearable) entity;
if (target.isShearable(
itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
ArrayList<ItemStack> drops = target.onSheared(
itemstack,
entity.worldObj,
(int) entity.posX,
(int) entity.posY,
(int) entity.posZ,
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
Random rand = new Random();
for (ItemStack stack : drops)
{
for (ItemStack stack : drops) {
EntityItem ent = entity.entityDropItem(stack, 1.0F);
ent.motionY += rand.nextFloat() * 0.05F;
ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
@@ -127,33 +129,33 @@ public class BoundShears extends ItemShears implements IBindable
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player)
{
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
NBTTagCompound tag = itemstack.stackTagCompound;
if (tag.getBoolean("isActive"))
{
if (player.worldObj.isRemote)
{
if (tag.getBoolean("isActive")) {
if (player.worldObj.isRemote) {
return false;
}
Block block = player.worldObj.getBlock(x, y, z);
if (block instanceof IShearable)
{
IShearable target = (IShearable)block;
if (target.isShearable(itemstack, player.worldObj, x, y, z))
{
ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z,
if (block instanceof IShearable) {
IShearable target = (IShearable) block;
if (target.isShearable(itemstack, player.worldObj, x, y, z)) {
ArrayList<ItemStack> drops = target.onSheared(
itemstack,
player.worldObj,
x,
y,
z,
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
Random rand = new Random();
for(ItemStack stack : drops)
{
for (ItemStack stack : drops) {
float f = 0.7F;
double d = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(player.worldObj, (double)x + d, (double)y + d1, (double)z + d2, stack);
double d = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double d1 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double d2 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(
player.worldObj, (double) x + d, (double) y + d1, (double) z + d2, stack);
entityitem.delayBeforeCanPickup = 10;
player.worldObj.spawnEntityInWorld(entityitem);
}
@@ -165,23 +167,17 @@ public class BoundShears extends ItemShears implements IBindable
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_shears1"));
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_shears2"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3List.add("Activated");
}
else
{
} else {
par3List.add("Deactivated");
}
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
@@ -189,76 +185,62 @@ public class BoundShears extends ItemShears implements IBindable
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("BloodArsenal:bound_shears");
active = iconRegister.registerIcon("BloodArsenal:bound_shears");
passive = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.stackTagCompound == null)
{
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"))
{
if (tag.getBoolean("isActive")) {
return active;
}
else
{
} else {
return passive;
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
setActivated(par1ItemStack, !getActivated(par1ItemStack));
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
return par1ItemStack;
}
if (!getActivated(par1ItemStack))
{
if (!getActivated(par1ItemStack)) {
return par1ItemStack;
}
if (!par2World.isRemote)
{
if (!par2World.isRemote) {
par2World.spawnEntityInWorld(new EntityBloodHound(par2World));
}
return par1ItemStack;
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
{
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
}
public boolean getActivated(ItemStack par1ItemStack)
{
public boolean getActivated(ItemStack par1ItemStack) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
@@ -266,24 +248,20 @@ public class BoundShears extends ItemShears implements IBindable
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
if (!(par3Entity instanceof EntityPlayer))
{
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)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay")
&& par1ItemStack.stackTagCompound.getBoolean("isActive")) {
if (!par3EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20);
}
}
@@ -1,12 +1,14 @@
package com.arc.bloodarsenal.common.items.tool;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.google.common.collect.Sets;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import com.google.common.collect.Sets;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -23,11 +25,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.UseHoeEvent;
import java.util.List;
import java.util.Set;
public class BoundSickle extends ItemTool implements IBindable
{
public class BoundSickle extends ItemTool implements IBindable {
private int energyUsed;
private int radiusLeaf = 3;
@@ -36,10 +34,24 @@ public class BoundSickle extends ItemTool implements IBindable
private static IIcon active;
private static IIcon passive;
private static final Set toolBlocks = Sets.newHashSet(new Block[] { Blocks.leaves, Blocks.leaves2, Blocks.wheat, Blocks.potatoes, Blocks.carrots, Blocks.nether_wart, Blocks.red_mushroom, Blocks.brown_mushroom, Blocks.reeds, Blocks.tallgrass, Blocks.vine, Blocks.waterlily, Blocks.red_flower, Blocks.yellow_flower });
private static final Set toolBlocks = Sets.newHashSet(new Block[] {
Blocks.leaves,
Blocks.leaves2,
Blocks.wheat,
Blocks.potatoes,
Blocks.carrots,
Blocks.nether_wart,
Blocks.red_mushroom,
Blocks.brown_mushroom,
Blocks.reeds,
Blocks.tallgrass,
Blocks.vine,
Blocks.waterlily,
Blocks.red_flower,
Blocks.yellow_flower
});
public BoundSickle(ToolMaterial toolMaterial)
{
public BoundSickle(ToolMaterial toolMaterial) {
super(1.0F, toolMaterial, toolBlocks);
setUnlocalizedName("bound_sickle");
setMaxStackSize(1);
@@ -49,51 +61,46 @@ public class BoundSickle extends ItemTool implements IBindable
setEnergyUsed(50);
}
public void setEnergyUsed(int i)
{
public void setEnergyUsed(int i) {
energyUsed = i;
}
public int getEnergyUsed()
{
public int getEnergyUsed() {
return energyUsed;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int x, int y, int z, EntityLivingBase par7EntityLivingBase)
{
public boolean onBlockDestroyed(
ItemStack par1ItemStack,
World par2World,
Block par3Block,
int x,
int y,
int z,
EntityLivingBase par7EntityLivingBase) {
NBTTagCompound tag = par1ItemStack.stackTagCompound;
boolean use = false;
if (tag.getBoolean("isActive"))
{
if (!(par7EntityLivingBase instanceof EntityPlayer))
{
if (tag.getBoolean("isActive")) {
if (!(par7EntityLivingBase instanceof EntityPlayer)) {
return false;
}
EntityPlayer player = (EntityPlayer) par7EntityLivingBase;
if (!player.capabilities.isCreativeMode)
{
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, player, 50);
}
if ((par3Block !=null) && (par3Block.isLeaves(par2World, x, y, z)))
{
for (int i = -radiusLeaf; i <= radiusLeaf; i++)
{
for (int j = -radiusLeaf; j <= radiusLeaf; j++)
{
for (int k = -radiusLeaf; k <= radiusLeaf; k++)
{
if ((par3Block != null) && (par3Block.isLeaves(par2World, x, y, z))) {
for (int i = -radiusLeaf; i <= radiusLeaf; i++) {
for (int j = -radiusLeaf; j <= radiusLeaf; j++) {
for (int k = -radiusLeaf; k <= radiusLeaf; k++) {
Block blockToCheck = par2World.getBlock(x + i, y + j, z + k);
int meta = par2World.getBlockMetadata(x + i, y + j, z + k);
if ((blockToCheck !=null) && (blockToCheck.isLeaves(par2World, x + i, y + j, z + k)))
{
if (blockToCheck.canHarvestBlock(player, meta))
{
if ((blockToCheck != null) && (blockToCheck.isLeaves(par2World, x + i, y + j, z + k))) {
if (blockToCheck.canHarvestBlock(player, meta)) {
blockToCheck.harvestBlock(par2World, player, x + i, y + j, z + k, meta);
}
par2World.setBlock(x + i, y + j, z + k, Blocks.air);
@@ -104,19 +111,14 @@ public class BoundSickle extends ItemTool implements IBindable
}
}
for (int i = -radiusCrop; i <= radiusCrop; i++)
{
for (int j = -radiusCrop; j <= radiusCrop; j++)
{
for (int i = -radiusCrop; i <= radiusCrop; i++) {
for (int j = -radiusCrop; j <= radiusCrop; j++) {
Block blockToCheck = par2World.getBlock(x + i, y, z + j);
int meta = par2World.getBlockMetadata(x + i, y, z + j);
if (blockToCheck !=null)
{
if(blockToCheck instanceof BlockBush)
{
if (blockToCheck.canHarvestBlock(player, meta))
{
if (blockToCheck != null) {
if (blockToCheck instanceof BlockBush) {
if (blockToCheck.canHarvestBlock(player, meta)) {
blockToCheck.harvestBlock(par2World, player, x + i, y, z + j, meta);
}
par2World.setBlock(x + i, y, z + j, Blocks.air);
@@ -130,153 +132,136 @@ public class BoundSickle extends ItemTool implements IBindable
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_sickle1"));
par3List.add(StatCollector.translateToLocal("tooltip.tool.bound_sickle2"));
if (!(par1ItemStack.stackTagCompound == null))
{
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (par1ItemStack.stackTagCompound.getBoolean("isActive")) {
par3List.add("Activated");
}
else
{
} else {
par3List.add("Deactivated");
}
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10)
{
public boolean onItemUse(
ItemStack par1ItemStack,
EntityPlayer par2EntityPlayer,
World par3World,
int x,
int y,
int z,
int par7,
float par8,
float par9,
float par10) {
NBTTagCompound tag = par1ItemStack.stackTagCompound;
if (tag.getBoolean("isActive"))
{
if (!par2EntityPlayer.capabilities.isCreativeMode)
{
if (tag.getBoolean("isActive")) {
if (!par2EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, 50);
}
if (!par2EntityPlayer.canPlayerEdit(x, y, z, par7, par1ItemStack))
{
if (!par2EntityPlayer.canPlayerEdit(x, y, z, par7, par1ItemStack)) {
return false;
}
else
{
} else {
UseHoeEvent event = new UseHoeEvent(par2EntityPlayer, par1ItemStack, par3World, x, y, z);
if (MinecraftForge.EVENT_BUS.post(event))
{
if (MinecraftForge.EVENT_BUS.post(event)) {
return false;
}
if (event.getResult() == Event.Result.ALLOW)
{
if (event.getResult() == Event.Result.ALLOW) {
return true;
}
Block block = par3World.getBlock(x, y, z);
if (par7 != 0 && par3World.getBlock(x, y + 1, z).isAir(par3World, x, y + 1, z) && (block == Blocks.grass || block == Blocks.dirt))
{
if (par7 != 0
&& par3World.getBlock(x, y + 1, z).isAir(par3World, x, y + 1, z)
&& (block == Blocks.grass || block == Blocks.dirt)) {
Block block1 = Blocks.farmland;
par3World.playSoundEffect((double)((float) x + 0.5F), (double)((float) y + 0.5F), (double)((float) z + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F);
par3World.playSoundEffect(
(double) ((float) x + 0.5F),
(double) ((float) y + 0.5F),
(double) ((float) z + 0.5F),
block1.stepSound.getStepResourcePath(),
(block1.stepSound.getVolume() + 1.0F) / 2.0F,
block1.stepSound.getPitch() * 0.8F);
if (par3World.isRemote)
{
if (par3World.isRemote) {
return true;
}
else
{
} else {
par3World.setBlock(x, y, z, block1);
return true;
}
}
else
{
} else {
return false;
}
}
}
else
{
} else {
return false;
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("BloodArsenal:bound_sickle");
active = iconRegister.registerIcon("BloodArsenal:bound_sickle");
passive = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if (stack.stackTagCompound == null)
{
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"))
{
if (tag.getBoolean("isActive")) {
return active;
}
else
{
} else {
return passive;
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
setActivated(par1ItemStack, !getActivated(par1ItemStack));
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
return par1ItemStack;
}
if (!getActivated(par1ItemStack))
{
if (!getActivated(par1ItemStack)) {
return par1ItemStack;
}
return par1ItemStack;
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
{
public void setActivated(ItemStack par1ItemStack, boolean newActivated) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
itemTag.setBoolean("isActive", newActivated);
}
public boolean getActivated(ItemStack par1ItemStack)
{
public boolean getActivated(ItemStack par1ItemStack) {
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
if (itemTag == null)
{
if (itemTag == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
@@ -284,24 +269,20 @@ public class BoundSickle extends ItemTool implements IBindable
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
{
if (!(par3Entity instanceof EntityPlayer))
{
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)
{
if (par1ItemStack.stackTagCompound == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (par2World.getWorldTime() % 200 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay")
&& par1ItemStack.stackTagCompound.getBoolean("isActive")) {
if (!par3EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50);
}
}
@@ -311,8 +292,7 @@ public class BoundSickle extends ItemTool implements IBindable
}
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
public boolean isFull3D() {
return true;
}
}
@@ -8,6 +8,8 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import com.arc.bloodarsenal.common.BloodArsenal;
import com.arc.bloodarsenal.common.BloodArsenalConfig;
import com.google.common.collect.Multimap;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
@@ -26,15 +28,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
import java.util.Random;
public class GlassDaggerOfSacrifice extends EnergyItems
{
public class GlassDaggerOfSacrifice extends EnergyItems {
private float weaponDamage;
public GlassDaggerOfSacrifice()
{
public GlassDaggerOfSacrifice() {
super();
setMaxStackSize(1);
setEnergyUsed(100);
@@ -44,33 +41,35 @@ public class GlassDaggerOfSacrifice extends EnergyItems
}
@Override
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{
if (par3EntityLivingBase == null || par2EntityLivingBase == null || par3EntityLivingBase.worldObj.isRemote || (par3EntityLivingBase instanceof EntityPlayer && SpellHelper.isFakePlayer(par3EntityLivingBase.worldObj, (EntityPlayer) par3EntityLivingBase)))
{
public boolean hitEntity(
ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) {
if (par3EntityLivingBase == null
|| par2EntityLivingBase == null
|| par3EntityLivingBase.worldObj.isRemote
|| (par3EntityLivingBase instanceof EntityPlayer
&& SpellHelper.isFakePlayer(
par3EntityLivingBase.worldObj, (EntityPlayer) par3EntityLivingBase))) {
return false;
}
if (par2EntityLivingBase instanceof IHoardDemon)
{
if (par2EntityLivingBase instanceof IHoardDemon) {
return false;
}
if (par2EntityLivingBase.isChild() || par2EntityLivingBase instanceof EntityPlayer || par2EntityLivingBase instanceof IBossDisplayData)
{
if (par2EntityLivingBase.isChild()
|| par2EntityLivingBase instanceof EntityPlayer
|| par2EntityLivingBase instanceof IBossDisplayData) {
return false;
}
World world = par2EntityLivingBase.worldObj;
if (par2EntityLivingBase.isDead || par2EntityLivingBase.getHealth() < 0.5f)
{
if (par2EntityLivingBase.isDead || par2EntityLivingBase.getHealth() < 0.5f) {
return false;
}
if (par2EntityLivingBase instanceof IDemon)
{
((IDemon)par2EntityLivingBase).setDropCrystal(false);
if (par2EntityLivingBase instanceof IDemon) {
((IDemon) par2EntityLivingBase).setDropCrystal(false);
this.findAndNotifyAltarOfDemon(world, par2EntityLivingBase);
}
@@ -83,23 +82,21 @@ public class GlassDaggerOfSacrifice extends EnergyItems
else if (par2EntityLivingBase instanceof EntityEnderman) lifeEssence = 300;
else if (par2EntityLivingBase instanceof EntityAnimal) lifeEssence = 350;
if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, lifeEssence))
{
if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, lifeEssence)) {
double posX = par2EntityLivingBase.posX;
double posY = par2EntityLivingBase.posY;
double posZ = par2EntityLivingBase.posZ;
for (int i = 0; i < 8; i++)
{
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ);
for (int i = 0; i < 8; i++) {
SpellHelper.sendIndexedParticleToAllAround(
world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ);
}
par2EntityLivingBase.setHealth(-1);
par2EntityLivingBase.onDeath(BloodArsenal.deathFromBlood);
}
if (!par2EntityLivingBase.isDead)
{
if (!par2EntityLivingBase.isDead) {
par2EntityLivingBase.addPotionEffect(new PotionEffect(BloodArsenalConfig.bleedingID, 20, 0));
}
@@ -107,47 +104,47 @@ public class GlassDaggerOfSacrifice extends EnergyItems
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.glassDaggerOfSacrifice"));
}
@Override
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
{
if (par2Block == Blocks.web)
{
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) {
if (par2Block == Blocks.web) {
return 15.0F;
} else
{
} else {
Material material = par2Block.getMaterial();
return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.gourd ? 1.0F : 1.5F;
return material != Material.plants
&& material != Material.vine
&& material != Material.coral
&& material != Material.leaves
&& material != Material.gourd
? 1.0F
: 1.5F;
}
}
@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
return false;
}
@Override
public Multimap getItemAttributeModifiers()
{
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", 2.0d, 0));
multimap.put(
SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Tool modifier", 2.0d, 0));
return multimap;
}
public boolean findAndNotifyAltarOfDemon(World world, EntityLivingBase sacrifice)
{
public boolean findAndNotifyAltarOfDemon(World world, EntityLivingBase sacrifice) {
int posX = (int) Math.round(sacrifice.posX - 0.5f);
int posY = (int) sacrifice.posY;
int posZ = (int) Math.round(sacrifice.posZ - 0.5f);
IBloodAltar altarEntity = this.getAltar(world, posX, posY, posZ);
if (altarEntity == null)
{
if (altarEntity == null) {
return false;
}
@@ -156,15 +153,13 @@ public class GlassDaggerOfSacrifice extends EnergyItems
return true;
}
public boolean findAndFillAltar(World world, EntityLivingBase sacrifice, int amount)
{
public boolean findAndFillAltar(World world, EntityLivingBase sacrifice, int amount) {
int posX = (int) Math.round(sacrifice.posX - 0.5f);
int posY = (int) sacrifice.posY;
int posZ = (int) Math.round(sacrifice.posZ - 0.5f);
IBloodAltar altarEntity = this.getAltar(world, posX, posY, posZ);
if (altarEntity == null)
{
if (altarEntity == null) {
return false;
}
@@ -173,20 +168,15 @@ public class GlassDaggerOfSacrifice extends EnergyItems
return true;
}
public IBloodAltar getAltar(World world, int x, int y, int z)
{
public IBloodAltar getAltar(World world, int x, int y, int z) {
TileEntity tileEntity;
for (int i = -2; i <= 2; i++)
{
for (int j = -2; j <= 2; j++)
{
for (int k = -2; k <= 1; k++)
{
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 IBloodAltar)
{
if (tileEntity instanceof IBloodAltar) {
return (IBloodAltar) tileEntity;
}
}
@@ -9,6 +9,8 @@ import com.arc.bloodarsenal.common.BloodArsenal;
import com.arc.bloodarsenal.common.BloodArsenalConfig;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -22,13 +24,8 @@ import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.FakePlayer;
import java.util.List;
import java.util.Random;
public class GlassSacrificialDagger extends Item
{
public GlassSacrificialDagger()
{
public class GlassSacrificialDagger extends Item {
public GlassSacrificialDagger() {
super();
setMaxStackSize(1);
setFull3D();
@@ -36,118 +33,109 @@ public class GlassSacrificialDagger extends Item
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
if (AlchemicalWizardry.wimpySettings)
{
public void registerIcons(IIconRegister iconRegister) {
if (AlchemicalWizardry.wimpySettings) {
this.itemIcon = iconRegister.registerIcon("BloodArsenal:glass_sacrificial_orb");
}
else
{
} else {
this.itemIcon = iconRegister.registerIcon("BloodArsenal:glass_sacrificial_dagger");
}
}
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.glassSacrificeDagger"));
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{
if (this.canUseForSacrifice(stack))
{
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (this.canUseForSacrifice(stack)) {
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
return stack;
}
if (!player.capabilities.isCreativeMode)
{
if (!player.capabilities.isCreativeMode) {
SacrificeKnifeUsedEvent evt = new SacrificeKnifeUsedEvent(player, true, true, 2);
if (MinecraftForge.EVENT_BUS.post(evt))
{
if (MinecraftForge.EVENT_BUS.post(evt)) {
return stack;
}
if (evt.shouldDrainHealth)
{
if (evt.shouldDrainHealth) {
player.setHealth(player.getHealth() - 2);
}
if (!evt.shouldFillAltar)
{
if (!evt.shouldFillAltar) {
return stack;
}
}
if (player instanceof FakePlayer)
{
if (player instanceof FakePlayer) {
return stack;
}
double posX = player.posX;
double posY = player.posY;
double posZ = player.posZ;
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
world.playSoundEffect(
(double) ((float) posX + 0.5F),
(double) ((float) posY + 0.5F),
(double) ((float) posZ + 0.5F),
"random.fizz",
0.5F,
2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
float f = 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)
{
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
for (int l = 0; l < 8; ++l) {
world.spawnParticle(
"reddust",
posX + Math.random() - Math.random(),
posY + Math.random() - Math.random(),
posZ + Math.random() - Math.random(),
f1,
f2,
f3);
}
if (!world.isRemote && SpellHelper.isFakePlayer(world, player))
{
if (!world.isRemote && SpellHelper.isFakePlayer(world, player)) {
return stack;
}
if (player.isPotionActive(AlchemicalWizardry.customPotionSoulFray))
{
if (player.isPotionActive(AlchemicalWizardry.customPotionSoulFray)) {
findAndFillAltar(world, player, 50);
} else
{
} else {
findAndFillAltar(world, player, 500);
}
if (player.getHealth() <= 0.001f)
{
if (player.getHealth() <= 0.001f) {
player.onDeath(BloodArsenal.deathFromBlood);
}
Random random = new Random();
if (random.nextInt(4) < 1)
{
if (random.nextInt(4) < 1) {
player.addPotionEffect(new PotionEffect(BloodArsenalConfig.bleedingID, random.nextInt(5) * 20, 0));
}
return stack;
}
@Override
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int itemInUseCount)
{
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int itemInUseCount) {
PlayerSacrificeHandler.sacrificePlayerHealth(player);
}
@Override
public int getMaxItemUseDuration(ItemStack stack)
{
public int getMaxItemUseDuration(ItemStack stack) {
return 72000;
}
public void findAndFillAltar(World world, EntityPlayer player, int amount)
{
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);
IBloodAltar altarEntity = getAltar(world, posX, posY, posZ);
if (altarEntity == null)
{
if (altarEntity == null) {
return;
}
@@ -155,20 +143,15 @@ public class GlassSacrificialDagger extends Item
altarEntity.startCycle();
}
public IBloodAltar getAltar(World world, int x, int y, int z)
{
public IBloodAltar getAltar(World world, int x, int y, int z) {
TileEntity tileEntity;
for (int i = -2; i <= 2; i++)
{
for (int j = -2; j <= 2; j++)
{
for (int k = -2; k <= 1; k++)
{
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 IBloodAltar))
{
if ((tileEntity instanceof IBloodAltar)) {
return (IBloodAltar) tileEntity;
}
}
@@ -179,41 +162,33 @@ public class GlassSacrificialDagger extends Item
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5)
{
if (!world.isRemote && entity instanceof EntityPlayer)
{
this.setUseForSacrifice(stack, this.isPlayerPreparedForSacrifice(world, (EntityPlayer)entity));
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
if (!world.isRemote && entity instanceof EntityPlayer) {
this.setUseForSacrifice(stack, this.isPlayerPreparedForSacrifice(world, (EntityPlayer) entity));
}
}
@Override
public String getItemStackDisplayName(ItemStack stack)
{
if (AlchemicalWizardry.wimpySettings)
{
public String getItemStackDisplayName(ItemStack stack) {
if (AlchemicalWizardry.wimpySettings) {
return StatCollector.translateToLocal("item.glass_sacrificial_orb.name");
}
return super.getItemStackDisplayName(stack);
}
public boolean isPlayerPreparedForSacrifice(World world, EntityPlayer player)
{
public boolean isPlayerPreparedForSacrifice(World world, EntityPlayer player) {
return !world.isRemote && (PlayerSacrificeHandler.getPlayerIncense(player) > 0);
}
public boolean canUseForSacrifice(ItemStack stack)
{
public boolean canUseForSacrifice(ItemStack stack) {
NBTTagCompound tag = stack.getTagCompound();
return tag != null && tag.getBoolean("sacrifice");
}
public void setUseForSacrifice(ItemStack stack, boolean sacrifice)
{
public void setUseForSacrifice(ItemStack stack, boolean sacrifice) {
NBTTagCompound tag = stack.getTagCompound();
if (tag == null)
{
if (tag == null) {
tag = new NBTTagCompound();
stack.setTagCompound(tag);
}
@@ -223,8 +198,7 @@ public class GlassSacrificialDagger extends Item
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack stack, int pass)
{
public boolean hasEffect(ItemStack stack, int pass) {
return this.canUseForSacrifice(stack) || super.hasEffect(stack, pass);
}
}
}
@@ -2,8 +2,7 @@ package com.arc.bloodarsenal.common.items.tool;
import net.minecraft.item.ItemStack;
public interface IFillable
{
public interface IFillable {
int getMaxLP();
int getLPStored(ItemStack container);
@@ -4,6 +4,7 @@ import com.arc.bloodarsenal.common.BloodArsenal;
import com.arc.bloodarsenal.common.items.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -11,74 +12,53 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import java.util.List;
public class InfusedDiamond extends Item
{
public InfusedDiamond()
{
public class InfusedDiamond extends Item {
public InfusedDiamond() {
super();
setMaxStackSize(1);
setCreativeTab(BloodArsenal.BA_TAB);
}
@Override
public void registerIcons(IIconRegister iconRegister)
{
if (equals(ModItems.blood_diamond))
{
public void registerIcons(IIconRegister iconRegister) {
if (equals(ModItems.blood_diamond)) {
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_diamond");
}
else if (equals(ModItems.blood_infused_diamond_unactive))
{
} else if (equals(ModItems.blood_infused_diamond_unactive)) {
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_diamond_unactive");
}
else if (equals(ModItems.blood_infused_diamond_active))
{
} else if (equals(ModItems.blood_infused_diamond_active)) {
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_diamond_active");
}
else if (equals(ModItems.blood_infused_diamond_bound))
{
} else if (equals(ModItems.blood_infused_diamond_bound)) {
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_infused_diamond_bound");
}
}
@Override
public EnumRarity getRarity(ItemStack stack)
{
if (equals(ModItems.blood_infused_diamond_bound))
{
public EnumRarity getRarity(ItemStack stack) {
if (equals(ModItems.blood_infused_diamond_bound)) {
return EnumRarity.uncommon;
}
else
{
} else {
return EnumRarity.common;
}
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
if (equals(ModItems.blood_infused_diamond_unactive))
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (equals(ModItems.blood_infused_diamond_unactive)) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_unactive1"));
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_unactive2"));
}
if (equals(ModItems.blood_infused_diamond_active))
{
if (equals(ModItems.blood_infused_diamond_active)) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_active1"));
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_active2"));
}
if (equals(ModItems.blood_infused_diamond_bound))
{
if (equals(ModItems.blood_infused_diamond_bound)) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_diamond_bound"));
}
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack, int pass)
{
public boolean hasEffect(ItemStack par1ItemStack, int pass) {
return equals(ModItems.blood_infused_diamond_bound);
}
}
@@ -5,6 +5,8 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
@@ -19,15 +21,10 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.ArrayList;
import java.util.List;
public class InfusedDiamondAxe extends ItemAxe implements IBindable
{
public class InfusedDiamondAxe extends ItemAxe implements IBindable {
public static ArrayList<List> oreDictLogs = new ArrayList();
public InfusedDiamondAxe()
{
public InfusedDiamondAxe() {
super(BloodArsenal.infusedIron);
setMaxStackSize(1);
setUnlocalizedName("blood_infused_axe_diamond");
@@ -38,39 +35,29 @@ public class InfusedDiamondAxe extends ItemAxe implements IBindable
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_infused_diamond_axe"));
if (par1ItemStack.getItemDamage() == 0)
{
if (par1ItemStack.getItemDamage() == 0) {
par3List.add("Normal Mode");
}
else if (par1ItemStack.getItemDamage() == 1)
{
} else if (par1ItemStack.getItemDamage() == 1) {
par3List.add("Area Mode");
}
else if (par1ItemStack.getItemDamage() == 2)
{
} else if (par1ItemStack.getItemDamage() == 2) {
par3List.add("Tree Mode");
}
if (!(par1ItemStack.stackTagCompound == null))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
ToolCapabilities.changeMode(par1ItemStack);
}
@@ -78,38 +65,30 @@ public class InfusedDiamondAxe extends ItemAxe implements IBindable
}
@Override
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player)
{
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
World world = player.worldObj;
Material mat = world.getBlock(x, y, z).getMaterial();
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsAxe))
{
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsAxe)) {
return false;
}
MovingObjectPosition block = ToolCapabilities.raytraceFromEntity(world, player, true, 4.5);
if (block == null)
{
if (block == null) {
return false;
}
ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
switch (ToolCapabilities.getMode(stack))
{
case 0:
{
if (!player.capabilities.isCreativeMode)
{
switch (ToolCapabilities.getMode(stack)) {
case 0: {
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(stack, player, 100);
}
break;
}
case 1:
{
if (!player.capabilities.isCreativeMode)
{
case 1: {
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(stack, player, 1000);
}
@@ -117,28 +96,37 @@ public class InfusedDiamondAxe extends ItemAxe implements IBindable
boolean doY = direction.offsetY == 0;
boolean doZ = direction.offsetZ == 0;
ToolCapabilities.removeBlocksInIteration(player, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, null, ToolCapabilities.materialsAxe);
ToolCapabilities.removeBlocksInIteration(
player,
world,
x,
y,
z,
doX ? -2 : 0,
doY ? -1 : 0,
doZ ? -2 : 0,
doX ? 3 : 1,
doY ? 4 : 1,
doZ ? 3 : 1,
null,
ToolCapabilities.materialsAxe);
break;
}
case 2:
{
case 2: {
Block blck = world.getBlock(x, y, z);
if (ToolCapabilities.isWood(world, x, y, z))
{
while (blck != Blocks.air)
{
if (ToolCapabilities.isWood(world, x, y, z)) {
while (blck != Blocks.air) {
ToolCapabilities.breakFurthestBlock(world, x, y, z, blck, player);
blck = world.getBlock(x, y, z);
if (!player.capabilities.isCreativeMode)
{
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(stack, player, 5000);
}
}
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - 5, y - 1, z - 5, x + 5, y + 64, z + 5));
for (EntityItem item : items)
{
List<EntityItem> items = world.getEntitiesWithinAABB(
EntityItem.class, AxisAlignedBB.getBoundingBox(x - 5, y - 1, z - 5, x + 5, y + 64, z + 5));
for (EntityItem item : items) {
item.setPosition(x + 0.5, y + 0.5, z + 0.5);
item.ticksExisted += 20;
}
@@ -151,22 +139,19 @@ public class InfusedDiamondAxe extends ItemAxe implements IBindable
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
public boolean isFull3D() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack, int pass)
{
public boolean hasEffect(ItemStack par1ItemStack, int pass) {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack)
{
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.rare;
}
}
}
@@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
@@ -17,14 +18,10 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.List;
public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable
{
public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable {
private int energyUsed;
public InfusedDiamondPickaxe()
{
public InfusedDiamondPickaxe() {
super(BloodArsenal.infusedIron);
setMaxStackSize(1);
setUnlocalizedName("blood_infused_pickaxe_diamond");
@@ -35,50 +32,38 @@ public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable
setEnergyUsed(300);
}
public void setEnergyUsed(int par1)
{
public void setEnergyUsed(int par1) {
energyUsed = par1;
}
public int getEnergyUsed()
{
public int getEnergyUsed() {
return energyUsed;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_infused_diamond_pickaxe"));
if (par1ItemStack.getItemDamage() == 0)
{
if (par1ItemStack.getItemDamage() == 0) {
par3List.add("Normal Mode");
}
else if (par1ItemStack.getItemDamage() == 1)
{
} else if (par1ItemStack.getItemDamage() == 1) {
par3List.add("Line Mode");
}
else if (par1ItemStack.getItemDamage() == 2)
{
} else if (par1ItemStack.getItemDamage() == 2) {
par3List.add("Square Mode");
}
if (!(par1ItemStack.stackTagCompound == null))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
ToolCapabilities.changeMode(par1ItemStack);
}
@@ -86,10 +71,15 @@ public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
{
if (par7EntityLivingBase instanceof EntityPlayer)
{
public boolean onBlockDestroyed(
ItemStack par1ItemStack,
World par2World,
Block par3Block,
int par4,
int par5,
int par6,
EntityLivingBase par7EntityLivingBase) {
if (par7EntityLivingBase instanceof EntityPlayer) {
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
}
@@ -97,37 +87,29 @@ public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable
}
@Override
public boolean onBlockStartBreak(ItemStack par1ItemStack, int x, int y, int z, EntityPlayer par5EntityPlayer)
{
public boolean onBlockStartBreak(ItemStack par1ItemStack, int x, int y, int z, EntityPlayer par5EntityPlayer) {
World world = par5EntityPlayer.worldObj;
Material mat = world.getBlock(x, y, z).getMaterial();
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsPick))
{
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsPick)) {
return false;
}
MovingObjectPosition block = ToolCapabilities.raytraceFromEntity(world, par5EntityPlayer, true, 4.5);
if (block == null)
{
if (block == null) {
return false;
}
ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
switch (ToolCapabilities.getMode(par1ItemStack))
{
case 0:
{
if (!par5EntityPlayer.capabilities.isCreativeMode)
{
switch (ToolCapabilities.getMode(par1ItemStack)) {
case 0: {
if (!par5EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 100);
}
break;
}
case 1:
{
if (!par5EntityPlayer.capabilities.isCreativeMode)
{
case 1: {
if (!par5EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 1000);
}
@@ -135,13 +117,24 @@ public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable
int yo = -direction.offsetY;
int zo = -direction.offsetZ;
ToolCapabilities.removeBlocksInIteration(par5EntityPlayer, world, x, y, z, xo >= 0 ? 0 : -10, yo >= 0 ? 0 : -10, zo >= 0 ? 0 : -10, xo > 0 ? 10 : 1, yo > 0 ? 10 : 1, zo > 0 ? 10 : 1, null, ToolCapabilities.materialsPick);
ToolCapabilities.removeBlocksInIteration(
par5EntityPlayer,
world,
x,
y,
z,
xo >= 0 ? 0 : -10,
yo >= 0 ? 0 : -10,
zo >= 0 ? 0 : -10,
xo > 0 ? 10 : 1,
yo > 0 ? 10 : 1,
zo > 0 ? 10 : 1,
null,
ToolCapabilities.materialsPick);
break;
}
case 2:
{
if (!par5EntityPlayer.capabilities.isCreativeMode)
{
case 2: {
if (!par5EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 2500);
}
@@ -149,7 +142,20 @@ public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable
boolean doY = direction.offsetY == 0;
boolean doZ = direction.offsetZ == 0;
ToolCapabilities.removeBlocksInIteration(par5EntityPlayer, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, null, ToolCapabilities.materialsPick);
ToolCapabilities.removeBlocksInIteration(
par5EntityPlayer,
world,
x,
y,
z,
doX ? -2 : 0,
doY ? -1 : 0,
doZ ? -2 : 0,
doX ? 3 : 1,
doY ? 4 : 1,
doZ ? 3 : 1,
null,
ToolCapabilities.materialsPick);
break;
}
}
@@ -158,22 +164,19 @@ public class InfusedDiamondPickaxe extends ItemPickaxe implements IBindable
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
public boolean isFull3D() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack, int pass)
{
public boolean hasEffect(ItemStack par1ItemStack, int pass) {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack)
{
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.rare;
}
}
}
@@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@@ -15,12 +16,8 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.List;
public class InfusedDiamondShovel extends ItemSpade implements IBindable
{
public InfusedDiamondShovel()
{
public class InfusedDiamondShovel extends ItemSpade implements IBindable {
public InfusedDiamondShovel() {
super(BloodArsenal.infusedIron);
setMaxStackSize(1);
setUnlocalizedName("blood_infused_shovel_diamond");
@@ -31,39 +28,29 @@ public class InfusedDiamondShovel extends ItemSpade implements IBindable
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_infused_diamond_shovel"));
if (par1ItemStack.getItemDamage() == 0)
{
if (par1ItemStack.getItemDamage() == 0) {
par3List.add("Normal Mode");
}
else if (par1ItemStack.getItemDamage() == 1)
{
} else if (par1ItemStack.getItemDamage() == 1) {
par3List.add("Line Mode");
}
else if (par1ItemStack.getItemDamage() == 2)
{
} else if (par1ItemStack.getItemDamage() == 2) {
par3List.add("Square Mode");
}
if (!(par1ItemStack.stackTagCompound == null))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
ToolCapabilities.changeMode(par1ItemStack);
}
@@ -71,37 +58,29 @@ public class InfusedDiamondShovel extends ItemSpade implements IBindable
}
@Override
public boolean onBlockStartBreak(ItemStack par1ItemStack, int x, int y, int z, EntityPlayer par5EntityPlayer)
{
public boolean onBlockStartBreak(ItemStack par1ItemStack, int x, int y, int z, EntityPlayer par5EntityPlayer) {
World world = par5EntityPlayer.worldObj;
Material mat = world.getBlock(x, y, z).getMaterial();
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsShovel))
{
if (!ToolCapabilities.isRightMaterial(mat, ToolCapabilities.materialsShovel)) {
return false;
}
MovingObjectPosition block = ToolCapabilities.raytraceFromEntity(world, par5EntityPlayer, true, 4.5);
if (block == null)
{
if (block == null) {
return false;
}
ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
switch (ToolCapabilities.getMode(par1ItemStack))
{
case 0:
{
if (!par5EntityPlayer.capabilities.isCreativeMode)
{
switch (ToolCapabilities.getMode(par1ItemStack)) {
case 0: {
if (!par5EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 100);
}
break;
}
case 1:
{
if (!par5EntityPlayer.capabilities.isCreativeMode)
{
case 1: {
if (!par5EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 1000);
}
@@ -109,13 +88,24 @@ public class InfusedDiamondShovel extends ItemSpade implements IBindable
int yo = -direction.offsetY;
int zo = -direction.offsetZ;
ToolCapabilities.removeBlocksInIteration(par5EntityPlayer, world, x, y, z, xo >= 0 ? 0 : -10, yo >= 0 ? 0 : -10, zo >= 0 ? 0 : -10, xo > 0 ? 10 : 1, yo > 0 ? 10 : 1, zo > 0 ? 10 : 1, null, ToolCapabilities.materialsShovel);
ToolCapabilities.removeBlocksInIteration(
par5EntityPlayer,
world,
x,
y,
z,
xo >= 0 ? 0 : -10,
yo >= 0 ? 0 : -10,
zo >= 0 ? 0 : -10,
xo > 0 ? 10 : 1,
yo > 0 ? 10 : 1,
zo > 0 ? 10 : 1,
null,
ToolCapabilities.materialsShovel);
break;
}
case 2:
{
if (!par5EntityPlayer.capabilities.isCreativeMode)
{
case 2: {
if (!par5EntityPlayer.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(par1ItemStack, par5EntityPlayer, 2500);
}
@@ -123,7 +113,20 @@ public class InfusedDiamondShovel extends ItemSpade implements IBindable
boolean doY = direction.offsetY == 0;
boolean doZ = direction.offsetZ == 0;
ToolCapabilities.removeBlocksInIteration(par5EntityPlayer, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, null, ToolCapabilities.materialsShovel);
ToolCapabilities.removeBlocksInIteration(
par5EntityPlayer,
world,
x,
y,
z,
doX ? -2 : 0,
doY ? -1 : 0,
doZ ? -2 : 0,
doX ? 3 : 1,
doY ? 4 : 1,
doZ ? 3 : 1,
null,
ToolCapabilities.materialsShovel);
break;
}
}
@@ -132,22 +135,19 @@ public class InfusedDiamondShovel extends ItemSpade implements IBindable
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
public boolean isFull3D() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack, int pass)
{
public boolean hasEffect(ItemStack par1ItemStack, int pass) {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack)
{
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.rare;
}
}
}
@@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,12 +18,8 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
public class InfusedDiamondSword extends ItemSword implements IBindable
{
public InfusedDiamondSword()
{
public class InfusedDiamondSword extends ItemSword implements IBindable {
public InfusedDiamondSword() {
super(BloodArsenal.infusedDiamond);
setMaxStackSize(1);
setUnlocalizedName("blood_infused_sword_diamond");
@@ -33,27 +30,19 @@ public class InfusedDiamondSword extends ItemSword implements IBindable
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.tool.blood_infused_diamond_sword"));
if (par1ItemStack.getItemDamage() == 0)
{
if (par1ItemStack.getItemDamage() == 0) {
par3List.add("Normal Mode");
}
else if (par1ItemStack.getItemDamage() == 1)
{
} else if (par1ItemStack.getItemDamage() == 1) {
par3List.add("Area Mode");
}
else if (par1ItemStack.getItemDamage() == 2)
{
} else if (par1ItemStack.getItemDamage() == 2) {
par3List.add("Fire Mode");
}
if (!(par1ItemStack.stackTagCompound == null))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
if (!(par1ItemStack.stackTagCompound == null)) {
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
@@ -62,45 +51,46 @@ public class InfusedDiamondSword extends ItemSword implements IBindable
boolean ignoreLeftClick = false;
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
{
if (!ignoreLeftClick && entity instanceof EntityLivingBase && ((EntityLivingBase) entity).hurtTime == 0 && !((EntityLivingBase) entity).isDead)
{
switch (ToolCapabilities.getMode(stack))
{
case 0:
{
if (!player.capabilities.isCreativeMode)
{
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
if (!ignoreLeftClick
&& entity instanceof EntityLivingBase
&& ((EntityLivingBase) entity).hurtTime == 0
&& !((EntityLivingBase) entity).isDead) {
switch (ToolCapabilities.getMode(stack)) {
case 0: {
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(stack, player, 100);
}
break;
}
case 1:
{
case 1: {
int range = 3;
List<Entity> entities = player.worldObj.getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range));
List<Entity> entities = player.worldObj.getEntitiesWithinAABB(
entity.getClass(),
AxisAlignedBB.getBoundingBox(
entity.posX - range,
entity.posY - range,
entity.posZ - range,
entity.posX + range,
entity.posY + range,
entity.posZ + range));
ignoreLeftClick = true;
for (Entity entity_ : entities)
{
for (Entity entity_ : entities) {
player.attackTargetEntityWithCurrentItem(entity_);
if (!player.capabilities.isCreativeMode)
{
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(stack, player, 3000);
}
}
ignoreLeftClick = false;
break;
}
case 2:
{
case 2: {
EntityLivingBase living = (EntityLivingBase) entity;
living.setFire(3);
if (!player.capabilities.isCreativeMode)
{
if (!player.capabilities.isCreativeMode) {
EnergyItems.syphonBatteries(stack, player, 300);
}
break;
@@ -112,10 +102,9 @@ public class InfusedDiamondSword extends ItemSword implements IBindable
}
@Override
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{
if (par3EntityLivingBase instanceof EntityPlayer)
{
public boolean hitEntity(
ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) {
if (par3EntityLivingBase instanceof EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase);
}
par2EntityLivingBase.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
@@ -123,12 +112,10 @@ public class InfusedDiamondSword extends ItemSword implements IBindable
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
if (par3EntityPlayer.isSneaking())
{
if (par3EntityPlayer.isSneaking()) {
ToolCapabilities.changeMode(par1ItemStack);
}
@@ -138,23 +125,19 @@ public class InfusedDiamondSword extends ItemSword implements IBindable
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
public boolean isFull3D() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack, int pass)
{
public boolean hasEffect(ItemStack par1ItemStack, int pass) {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack)
{
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.rare;
}
}
@@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -13,14 +14,10 @@ import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import java.util.List;
public class InfusedIronAxe extends ItemAxe implements IBindable
{
public class InfusedIronAxe extends ItemAxe implements IBindable {
private int energyUsed;
public InfusedIronAxe()
{
public InfusedIronAxe() {
super(BloodArsenal.infusedIron);
setMaxStackSize(1);
setUnlocalizedName("blood_infused_axe_iron");
@@ -30,41 +27,40 @@ public class InfusedIronAxe extends ItemAxe implements IBindable
setEnergyUsed(75);
}
public void setEnergyUsed(int par1)
{
public void setEnergyUsed(int par1) {
energyUsed = par1;
}
public int getEnergyUsed()
{
public int getEnergyUsed() {
return energyUsed;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
{
if (!(par1ItemStack.stackTagCompound == null))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (!(par1ItemStack.stackTagCompound == null)) {
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
return par1ItemStack;
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
{
if (par7EntityLivingBase instanceof EntityPlayer)
{
public boolean onBlockDestroyed(
ItemStack par1ItemStack,
World par2World,
Block par3Block,
int par4,
int par5,
int par6,
EntityLivingBase par7EntityLivingBase) {
if (par7EntityLivingBase instanceof EntityPlayer) {
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
}
@@ -72,14 +68,12 @@ public class InfusedIronAxe extends ItemAxe implements IBindable
}
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
public boolean isFull3D() {
return true;
}
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack)
{
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.uncommon;
}
}
@@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -13,14 +14,10 @@ import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import java.util.List;
public class InfusedIronPickaxe extends ItemPickaxe implements IBindable
{
public class InfusedIronPickaxe extends ItemPickaxe implements IBindable {
private int energyUsed;
public InfusedIronPickaxe()
{
public InfusedIronPickaxe() {
super(BloodArsenal.infusedIron);
setMaxStackSize(1);
setUnlocalizedName("blood_infused_pickaxe_iron");
@@ -30,41 +27,40 @@ public class InfusedIronPickaxe extends ItemPickaxe implements IBindable
setEnergyUsed(75);
}
public void setEnergyUsed(int par1)
{
public void setEnergyUsed(int par1) {
energyUsed = par1;
}
public int getEnergyUsed()
{
public int getEnergyUsed() {
return energyUsed;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
{
if (!(par1ItemStack.stackTagCompound == null))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (!(par1ItemStack.stackTagCompound == null)) {
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
return par1ItemStack;
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
{
if (par7EntityLivingBase instanceof EntityPlayer)
{
public boolean onBlockDestroyed(
ItemStack par1ItemStack,
World par2World,
Block par3Block,
int par4,
int par5,
int par6,
EntityLivingBase par7EntityLivingBase) {
if (par7EntityLivingBase instanceof EntityPlayer) {
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
}
@@ -72,14 +68,12 @@ public class InfusedIronPickaxe extends ItemPickaxe implements IBindable
}
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
public boolean isFull3D() {
return true;
}
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack)
{
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.uncommon;
}
}
@@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.common.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -13,14 +14,10 @@ import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import java.util.List;
public class InfusedIronShovel extends ItemSpade implements IBindable
{
public class InfusedIronShovel extends ItemSpade implements IBindable {
private int energyUsed;
public InfusedIronShovel()
{
public InfusedIronShovel() {
super(BloodArsenal.infusedIron);
setMaxStackSize(1);
setUnlocalizedName("blood_infused_shovel_iron");
@@ -30,41 +27,40 @@ public class InfusedIronShovel extends ItemSpade implements IBindable
setEnergyUsed(75);
}
public void setEnergyUsed(int par1)
{
public void setEnergyUsed(int par1) {
energyUsed = par1;
}
public int getEnergyUsed()
{
public int getEnergyUsed() {
return energyUsed;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer , List par3List, boolean par4)
{
if (!(par1ItemStack.stackTagCompound == null))
{
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
{
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (!(par1ItemStack.stackTagCompound == null)) {
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals("")) {
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
}
}
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
return par1ItemStack;
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3Block, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
{
if (par7EntityLivingBase instanceof EntityPlayer)
{
public boolean onBlockDestroyed(
ItemStack par1ItemStack,
World par2World,
Block par3Block,
int par4,
int par5,
int par6,
EntityLivingBase par7EntityLivingBase) {
if (par7EntityLivingBase instanceof EntityPlayer) {
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
}
@@ -72,14 +68,12 @@ public class InfusedIronShovel extends ItemSpade implements IBindable
}
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
public boolean isFull3D() {
return true;
}
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack)
{
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.uncommon;
}
}
Loaded 100 of 138 files, more files were not shown because too many files have changed in this diff. Show more