mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-21 20:52:21 +00:00
Stage 1 of 1.2
This commit is contained in:
1 parent
0737bc614c
commit
781cf7a9b8
211 files changed
+630
-3791
No files matched your search
@@ -4,17 +4,11 @@ import com.arc.bloodarsenal.common.BloodArsenalConfig;
|
||||
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.entity.mob.EntityBloodHound;
|
||||
import com.arc.bloodarsenal.common.entity.projectile.EntityBloodBall;
|
||||
import com.arc.bloodarsenal.common.entity.projectile.EntityGatlingProjectile;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import com.arc.bloodarsenal.common.items.sigil.SigilUtils;
|
||||
import com.arc.bloodarsenal.common.misc.VersionChecker;
|
||||
import com.arc.bloodarsenal.client.renderer.block.*;
|
||||
import com.arc.bloodarsenal.client.renderer.entity.RenderEntityBloodHound;
|
||||
import com.arc.bloodarsenal.client.renderer.item.ItemRenderGatling;
|
||||
import com.arc.bloodarsenal.client.renderer.item.RenderBow;
|
||||
import com.arc.bloodarsenal.client.renderer.projectile.RenderEntityGatlingProjectile;
|
||||
import com.arc.bloodarsenal.client.renderer.block.TilePortableAltarRenderer;
|
||||
import com.arc.bloodarsenal.client.renderer.block.item.TilePortableAltarItemRenderer;
|
||||
import com.arc.bloodarsenal.common.tileentity.TileLifeInfuser;
|
||||
@@ -23,9 +17,6 @@ import com.arc.bloodarsenal.common.tinkers.IClientCode;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.client.model.ModelWolf;
|
||||
import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.client.renderer.entity.RenderTNTPrimed;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.world.World;
|
||||
@@ -46,20 +37,15 @@ public class ClientProxy extends CommonProxy
|
||||
@Override
|
||||
public void registerRenders()
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.energy_gatling, new ItemRenderGatling());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.bound_bow, new RenderBow());
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityGatlingProjectile.class, new RenderEntityGatlingProjectile());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBloodTNT.class, new RenderTNTPrimed());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBloodBall.class, new RenderSnowball(ModItems.blood_ball));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBloodTNT.class, new RenderBloodTNTPrimed());
|
||||
// RenderingRegistry.registerEntityRenderingHandler(EntityBloodHound.class, new RenderEntityBloodHound(new ModelWolf(), new ModelWolf(), 0.5F));
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.life_infuser), new RenderTileLifeInfuser());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePortableAltar.class, new TilePortableAltarRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileLifeInfuser.class, new TileLifeInfuserRenderer());
|
||||
|
||||
ShaderHelper.initShaders();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,5 +71,6 @@ public class ClientProxy extends CommonProxy
|
||||
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.portable_altar), new TilePortableAltarItemRenderer());
|
||||
}
|
||||
|
||||
public void executeClientCode(IClientCode clientCode) {}
|
||||
@Override
|
||||
public void executeClientCode(IClientCode clientCode) {clientCode.executeClientCode();}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.arc.bloodarsenal.client.renderer.block;
|
||||
|
||||
import com.arc.bloodarsenal.common.block.ModBlocks;
|
||||
import com.arc.bloodarsenal.common.entity.EntityBloodTNT;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBloodTNTPrimed extends Render
|
||||
{
|
||||
private RenderBlocks blockRenderer = new RenderBlocks();
|
||||
|
||||
public RenderBloodTNTPrimed()
|
||||
{
|
||||
this.shadowSize = 0.5F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (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_)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
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 (f2 < 0.0F)
|
||||
{
|
||||
f2 = 0.0F;
|
||||
}
|
||||
|
||||
if (f2 > 1.0F)
|
||||
{
|
||||
f2 = 1.0F;
|
||||
}
|
||||
|
||||
f2 *= f2;
|
||||
f2 *= f2;
|
||||
float f3 = 1.0F + f2 * 0.3F;
|
||||
GL11.glScalef(f3, f3, f3);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);
|
||||
this.blockRenderer.renderBlockAsItem(ModBlocks.blood_tnt, 0, 1.0F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_)
|
||||
{
|
||||
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_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (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_);
|
||||
}
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
package com.arc.bloodarsenal.client.renderer.block;
|
||||
|
||||
import org.lwjgl.opengl.ARBFragmentShader;
|
||||
import org.lwjgl.opengl.ARBShaderObjects;
|
||||
import org.lwjgl.opengl.ARBVertexShader;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public final class ShaderHelper
|
||||
{
|
||||
|
||||
private static final int VERT = ARBVertexShader.GL_VERTEX_SHADER_ARB;
|
||||
private static final int FRAG = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB;
|
||||
|
||||
public static int beam = 0;
|
||||
|
||||
public static void initShaders()
|
||||
{
|
||||
beam = createProgram(null, "/assets/bloodarsenal/shaders/beam.frag");
|
||||
}
|
||||
|
||||
public static void useShaderWithProps(int shader, Object... props)
|
||||
{
|
||||
ARBShaderObjects.glUseProgramObjectARB(shader);
|
||||
|
||||
if (shader != 0 && props.length % 2 == 0)
|
||||
{
|
||||
int propCount = props.length / 2;
|
||||
|
||||
for (int i = 0; i < propCount; i++)
|
||||
{
|
||||
String propName = (String) props[i * 2];
|
||||
Object propVal = props[i * 2 + 1];
|
||||
|
||||
int uniform = ARBShaderObjects.glGetUniformLocationARB(shader, propName);
|
||||
|
||||
if (propVal instanceof Integer) ARBShaderObjects.glUniform1iARB(uniform, (Integer) propVal);
|
||||
if (propVal instanceof Float) ARBShaderObjects.glUniform1fARB(uniform, (Float) propVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void useShader(int shader)
|
||||
{
|
||||
useShaderWithProps(shader);
|
||||
}
|
||||
|
||||
public static void releaseShader()
|
||||
{
|
||||
useShader(0);
|
||||
}
|
||||
|
||||
public static boolean useShaders()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Most of the code taken from the LWJGL wiki
|
||||
// http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL
|
||||
private static int createProgram(String vert, String frag)
|
||||
{
|
||||
int vertId = 0, fragId = 0, program = 0;
|
||||
|
||||
if (vert != null) vertId = createShader(vert, VERT);
|
||||
if (frag != null) fragId = createShader(frag, FRAG);
|
||||
|
||||
program = ARBShaderObjects.glCreateProgramObjectARB();
|
||||
|
||||
if (program == 0) return 0;
|
||||
|
||||
if (vert != null) ARBShaderObjects.glAttachObjectARB(program, vertId);
|
||||
if (frag != null) ARBShaderObjects.glAttachObjectARB(program, fragId);
|
||||
|
||||
ARBShaderObjects.glLinkProgramARB(program);
|
||||
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARBShaderObjects.glValidateProgramARB(program);
|
||||
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return program;
|
||||
}
|
||||
|
||||
private static int createShader(String filename, int shaderType)
|
||||
{
|
||||
int shader = 0;
|
||||
|
||||
try
|
||||
{
|
||||
shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType);
|
||||
|
||||
if (shader == 0) return 0;
|
||||
|
||||
ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename));
|
||||
ARBShaderObjects.glCompileShaderARB(shader);
|
||||
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) throw new RuntimeException("Error creating shader: " + getLogInfo(shader));
|
||||
|
||||
return shader;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ARBShaderObjects.glDeleteObjectARB(shader);
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getLogInfo(int obj)
|
||||
{
|
||||
return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));
|
||||
}
|
||||
|
||||
private static String readFileAsString(String filename) throws Exception
|
||||
{
|
||||
StringBuilder source = new StringBuilder();
|
||||
InputStream in = ShaderHelper.class.getResourceAsStream(filename);
|
||||
Exception exception = null;
|
||||
BufferedReader reader;
|
||||
|
||||
if (in == null)
|
||||
return "";
|
||||
|
||||
try
|
||||
{
|
||||
reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
|
||||
|
||||
Exception innerExc = null;
|
||||
|
||||
try
|
||||
{
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) source.append(line).append('\n');
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
exception = exc;
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
reader.close();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (innerExc == null) innerExc = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (innerExc != null) throw innerExc;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
exception = exc;
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
in.close();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (exception == null) exception = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
|
||||
if (exception != null) throw exception;
|
||||
}
|
||||
|
||||
return source.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
package com.arc.bloodarsenal.client.renderer.item;
|
||||
|
||||
import com.arc.bloodarsenal.common.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.client.renderer.model.ModelEnergyGatling;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemRenderGatling implements IItemRenderer
|
||||
{
|
||||
protected ModelEnergyGatling gatlingModel;
|
||||
|
||||
private static final ResourceLocation resourceLocation = new ResourceLocation("bloodarsenal", "models/armor/EnergyGatling.png");
|
||||
private static final ResourceLocation resourceLocation2 = new ResourceLocation("bloodarsenal", "models/armor/EnergyGatling2.png");
|
||||
|
||||
public ItemRenderGatling()
|
||||
{
|
||||
gatlingModel = new ModelEnergyGatling();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case EQUIPPED: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
double rx = 100.0D;
|
||||
double ry = 20.0D;
|
||||
double rz = -90.0D;
|
||||
double tx = 0.15D;
|
||||
double ty = 0.1D;
|
||||
double tz = -0.5D;
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case EQUIPPED:
|
||||
{
|
||||
if (item.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (BloodArsenalConfig.isRedGood)
|
||||
{
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation2);
|
||||
}
|
||||
else
|
||||
{
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation);
|
||||
}
|
||||
|
||||
GL11.glRotatef((float) rx, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef((float) ry, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef((float) rz, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
GL11.glTranslatef((float) tx, (float) ty, (float) tz);
|
||||
|
||||
float scale = 1.8F;
|
||||
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
|
||||
gatlingModel.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
package com.arc.bloodarsenal.client.renderer.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelEnergyGatling extends ModelBase
|
||||
{
|
||||
ModelRenderer Barrel1;
|
||||
ModelRenderer Barrel2;
|
||||
ModelRenderer Barrel3;
|
||||
ModelRenderer Barrel4;
|
||||
ModelRenderer Barrel5;
|
||||
ModelRenderer Barrel6;
|
||||
ModelRenderer Barrel7;
|
||||
ModelRenderer Barrel8;
|
||||
ModelRenderer Barrel9;
|
||||
ModelRenderer Barrel10;
|
||||
ModelRenderer Barrel11;
|
||||
ModelRenderer Barrel12;
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
|
||||
public ModelEnergyGatling()
|
||||
{
|
||||
textureWidth = 64;
|
||||
textureHeight = 32;
|
||||
|
||||
Barrel1 = new ModelRenderer(this, 0, 0);
|
||||
Barrel1.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel1.setRotationPoint(0.5F, 8.5F, -13F);
|
||||
Barrel1.setTextureSize(64, 32);
|
||||
Barrel1.mirror = true;
|
||||
setRotation(Barrel1, 0F, 0F, 0F);
|
||||
|
||||
Barrel2 = new ModelRenderer(this, 0, 0);
|
||||
Barrel2.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel2.setRotationPoint(-0.5F, 8.5F, -13F);
|
||||
Barrel2.setTextureSize(64, 32);
|
||||
Barrel2.mirror = true;
|
||||
setRotation(Barrel2, 0F, 0F, 0F);
|
||||
|
||||
Barrel3 = new ModelRenderer(this, 0, 0);
|
||||
Barrel3.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel3.setRotationPoint(-1F, 9F, -13F);
|
||||
Barrel3.setTextureSize(64, 32);
|
||||
Barrel3.mirror = true;
|
||||
setRotation(Barrel3, 0F, 0F, 0F);
|
||||
|
||||
Barrel4 = new ModelRenderer(this, 0, 0);
|
||||
Barrel4.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel4.setRotationPoint(1F, 9F, -13F);
|
||||
Barrel4.setTextureSize(64, 32);
|
||||
Barrel4.mirror = true;
|
||||
setRotation(Barrel4, 0F, 0F, 0F);
|
||||
|
||||
Barrel5 = new ModelRenderer(this, 0, 0);
|
||||
Barrel5.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel5.setRotationPoint(-1.5F, 9.5F, -13F);
|
||||
Barrel5.setTextureSize(64, 32);
|
||||
Barrel5.mirror = true;
|
||||
setRotation(Barrel5, 0F, 0F, 0F);
|
||||
|
||||
Barrel6 = new ModelRenderer(this, 0, 0);
|
||||
Barrel6.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel6.setRotationPoint(1.5F, 9.5F, -13F);
|
||||
Barrel6.setTextureSize(64, 32);
|
||||
Barrel6.mirror = true;
|
||||
setRotation(Barrel6, 0F, 0F, 0F);
|
||||
|
||||
Barrel7 = new ModelRenderer(this, 0, 0);
|
||||
Barrel7.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel7.setRotationPoint(-1.5F, 10.5F, -13F);
|
||||
Barrel7.setTextureSize(64, 32);
|
||||
Barrel7.mirror = true;
|
||||
setRotation(Barrel7, 0F, 0F, 0F);
|
||||
|
||||
Barrel8 = new ModelRenderer(this, 0, 0);
|
||||
Barrel8.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel8.setRotationPoint(1.5F, 10.5F, -13F);
|
||||
Barrel8.setTextureSize(64, 32);
|
||||
Barrel8.mirror = true;
|
||||
setRotation(Barrel8, 0F, 0F, 0F);
|
||||
|
||||
Barrel9 = new ModelRenderer(this, 0, 0);
|
||||
Barrel9.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel9.setRotationPoint(-1F, 11F, -13F);
|
||||
Barrel9.setTextureSize(64, 32);
|
||||
Barrel9.mirror = true;
|
||||
setRotation(Barrel9, 0F, 0F, 0F);
|
||||
|
||||
Barrel10 = new ModelRenderer(this, 0, 0);
|
||||
Barrel10.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel10.setRotationPoint(1F, 11F, -13F);
|
||||
Barrel10.setTextureSize(64, 32);
|
||||
Barrel10.mirror = true;
|
||||
setRotation(Barrel10, 0F, 0F, 0F);
|
||||
|
||||
Barrel11 = new ModelRenderer(this, 0, 0);
|
||||
Barrel11.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel11.setRotationPoint(-0.5F, 11.5F, -13F);
|
||||
Barrel11.setTextureSize(64, 32);
|
||||
Barrel11.mirror = true;
|
||||
setRotation(Barrel11, 0F, 0F, 0F);
|
||||
|
||||
Barrel12 = new ModelRenderer(this, 0, 0);
|
||||
Barrel12.addBox(0F, 0F, 0F, 1, 1, 16);
|
||||
Barrel12.setRotationPoint(0.5F, 11.5F, -13F);
|
||||
Barrel12.setTextureSize(64, 32);
|
||||
Barrel12.mirror = true;
|
||||
setRotation(Barrel12, 0F, 0F, 0F);
|
||||
|
||||
Shape1 = new ModelRenderer(this, 0, 17);
|
||||
Shape1.addBox(0F, 0F, 0F, 5, 5, 5);
|
||||
Shape1.setRotationPoint(-2F, 8F, 0F);
|
||||
Shape1.setTextureSize(64, 32);
|
||||
Shape1.mirror = true;
|
||||
setRotation(Shape1, 0F, 0F, 0F);
|
||||
|
||||
Shape2 = new ModelRenderer(this, 0, 0);
|
||||
Shape2.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
Shape2.setRotationPoint(-1F, 5F, 4F);
|
||||
Shape2.setTextureSize(64, 32);
|
||||
Shape2.mirror = true;
|
||||
setRotation(Shape2, 0F, 0F, 0F);
|
||||
|
||||
Shape3 = new ModelRenderer(this, 0, 4);
|
||||
Shape3.addBox(0F, 0F, 0F, 1, 1, 1);
|
||||
Shape3.setRotationPoint(-1F, 5F, 3F);
|
||||
Shape3.setTextureSize(64, 32);
|
||||
Shape3.mirror = true;
|
||||
setRotation(Shape3, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
Barrel1.render(f5);
|
||||
Barrel2.render(f5);
|
||||
Barrel3.render(f5);
|
||||
Barrel4.render(f5);
|
||||
Barrel5.render(f5);
|
||||
Barrel6.render(f5);
|
||||
Barrel7.render(f5);
|
||||
Barrel8.render(f5);
|
||||
Barrel9.render(f5);
|
||||
Barrel10.render(f5);
|
||||
Barrel11.render(f5);
|
||||
Barrel12.render(f5);
|
||||
Shape1.render(f5);
|
||||
Shape2.render(f5);
|
||||
Shape3.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
|
||||
{
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
}
|
||||
}
|
||||
-88
@@ -1,88 +0,0 @@
|
||||
package com.arc.bloodarsenal.client.renderer.projectile;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.projectile.EntityPotion;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class RenderEntityBloodBall extends Render
|
||||
{
|
||||
private Item field_94151_a;
|
||||
private int field_94150_f;
|
||||
|
||||
public RenderEntityBloodBall(Item item, int par2)
|
||||
{
|
||||
this.field_94151_a = item;
|
||||
this.field_94150_f = par2;
|
||||
}
|
||||
|
||||
public RenderEntityBloodBall(Item item)
|
||||
{
|
||||
this(item, 0);
|
||||
}
|
||||
|
||||
public void doRender(Entity entity, double so, double me, double thing, float dont, float know)
|
||||
{
|
||||
IIcon iicon = this.field_94151_a.getIconFromDamage(this.field_94150_f);
|
||||
|
||||
if (iicon != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)so, (float)me, (float)thing);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
this.bindEntityTexture(entity);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (iicon == ItemPotion.func_94589_d("bottle_splash"))
|
||||
{
|
||||
int i = PotionHelper.func_77915_a(((EntityPotion) entity).getPotionDamage(), false);
|
||||
float f2 = (float)(i >> 16 & 255) / 255.0F;
|
||||
float f3 = (float)(i >> 8 & 255) / 255.0F;
|
||||
float f4 = (float)(i & 255) / 255.0F;
|
||||
GL11.glColor3f(f2, f3, f4);
|
||||
GL11.glPushMatrix();
|
||||
this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay"));
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
this.func_77026_a(tessellator, iicon);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private void func_77026_a(Tessellator par1Tessellator, IIcon par2IIcon)
|
||||
{
|
||||
float f = par2IIcon.getMinU();
|
||||
float f1 = par2IIcon.getMaxU();
|
||||
float f2 = par2IIcon.getMinV();
|
||||
float f3 = par2IIcon.getMaxV();
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity)
|
||||
{
|
||||
return new ResourceLocation("bloodarsenal", "textures/items/blood_ball.png");
|
||||
}
|
||||
}
|
||||
-61
@@ -1,61 +0,0 @@
|
||||
package com.arc.bloodarsenal.client.renderer.projectile;
|
||||
|
||||
import com.arc.bloodarsenal.common.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.common.entity.projectile.EntityGatlingProjectile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderEntityGatlingProjectile extends Render
|
||||
{
|
||||
public void renderEntityGatling(Entity entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.1F, 0.1F, 0.1F);
|
||||
bindTexture(getEntityTexture(entity));
|
||||
Tessellator var12 = Tessellator.instance;
|
||||
GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
var12.startDrawingQuads();
|
||||
var12.setNormal(0.0F, 1.0F, 0.0F);
|
||||
var12.addVertexWithUV(-0.5F, -0.25F, 0.0D, 0, 1);
|
||||
var12.addVertexWithUV(0.5F, -0.25F, 0.0D, 1, 1);
|
||||
var12.addVertexWithUV(0.5F, 0.75F, 0.0D, 1, 0);
|
||||
var12.addVertexWithUV(-0.5F, 0.75F, 0.0D, 0, 0);
|
||||
var12.draw();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
if (par1Entity instanceof IProjectile)
|
||||
{
|
||||
renderEntityGatling(par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity)
|
||||
{
|
||||
if (BloodArsenalConfig.isRedGood)
|
||||
{
|
||||
if (entity instanceof EntityGatlingProjectile)
|
||||
{
|
||||
return new ResourceLocation("bloodarsenal", "textures/entities/energyGatlingProjectile2.png");
|
||||
}
|
||||
}
|
||||
|
||||
return new ResourceLocation("bloodarsenal", "textures/entities/energyGatlingProjectile.png");
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
package com.arc.bloodarsenal.common;
|
||||
|
||||
import com.arc.bloodarsenal.common.entity.ModEntities;
|
||||
import com.arc.bloodarsenal.common.entity.ModLivingDropsEvent;
|
||||
import com.arc.bloodarsenal.common.gui.GuiHandler;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import com.arc.bloodarsenal.common.items.sigil.holding.AHPacketHandler;
|
||||
import com.arc.bloodarsenal.common.tinkers.BloodArsenalModifiers;
|
||||
import com.arc.bloodarsenal.common.tinkers.BloodArsenalTinkers;
|
||||
import com.arc.bloodarsenal.common.tinkers.RecipeHelper;
|
||||
import com.arc.bloodarsenal.common.misc.CommandDownloadMod;
|
||||
import com.arc.bloodarsenal.common.potion.PotionBloodArsenal;
|
||||
import com.arc.bloodarsenal.common.rituals.RitualRegistry;
|
||||
import com.arc.bloodarsenal.common.tinkers.BloodArsenalTinkers;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
@@ -33,7 +30,7 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Calendar;
|
||||
|
||||
@Mod(modid = BloodArsenal.MODID, version = BloodArsenal.VERSION, name = "Blood Arsenal", dependencies = "required-after:AWWayofTime;after:NotEnoughItems;after:Baubles;after:TConstruct;after:Waila", guiFactory = "com.arc.bloodarsenal.common.gui.ConfigGuiFactory")
|
||||
@Mod(modid = BloodArsenal.MODID, version = BloodArsenal.VERSION, name = "Blood Arsenal", dependencies = "required-after:AWWayofTime;after:NotEnoughItems;after:Baubles;after:guideapi;after:TConstruct;after:Waila", guiFactory = "com.arc.bloodarsenal.common.gui.ConfigGuiFactory")
|
||||
public class BloodArsenal
|
||||
{
|
||||
public final static String MODID = "BloodArsenal";
|
||||
@@ -86,8 +83,6 @@ public class BloodArsenal
|
||||
|
||||
ModItems.init();
|
||||
|
||||
ModEntities.init();
|
||||
|
||||
Potion[] potionTypes;
|
||||
|
||||
for (Field f : Potion.class.getDeclaredFields())
|
||||
@@ -160,12 +155,14 @@ public class BloodArsenal
|
||||
if (BloodArsenalConfig.tinkersIntegration)
|
||||
{
|
||||
logger.info("Loaded Tinker's Construct integration");
|
||||
|
||||
BloodArsenalTinkers.init();
|
||||
BloodArsenalModifiers.init();
|
||||
RecipeHelper.addRecipes();
|
||||
BloodArsenalTinkers.INSTANCE.init();
|
||||
}
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("guideapi"))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
||||
@@ -29,14 +29,16 @@ public class BloodArsenalConfig
|
||||
public static boolean ritualDisabledEnchantment;
|
||||
|
||||
// Block Settings
|
||||
public static String[] blocksToBeDisabled = {};
|
||||
public static String[] blocksToBeDisabled;
|
||||
|
||||
// Item Settings
|
||||
public static String[] itemsToBeDisabled = {};
|
||||
public static String[] itemsToBeDisabled;
|
||||
|
||||
//ModSettings
|
||||
//Mod Settings
|
||||
public static boolean baublesIntegration;
|
||||
public static boolean tinkersIntegration;
|
||||
public static int bloodInfusedWoodID;
|
||||
public static int bloodInfusedIronID;
|
||||
|
||||
//LP Settings
|
||||
public static int sigilSwimmingCost;
|
||||
@@ -91,6 +93,8 @@ public class BloodArsenalConfig
|
||||
|
||||
baublesIntegration = config.get(modSettings, "Enable Baubles integration?", true).getBoolean(baublesIntegration);
|
||||
tinkersIntegration = config.get(modSettings, "Enable TConstruct integration?", true).getBoolean(tinkersIntegration);
|
||||
bloodInfusedWoodID = config.get(modSettings, "Material ID for Blood Infused Wood; Default: 250", 250).getInt(bloodInfusedWoodID);
|
||||
bloodInfusedIronID = config.get(modSettings, "Material ID for Blood Infused Iron; Defualt: 251", 251).getInt(bloodInfusedIronID);
|
||||
|
||||
sigilSwimmingCost = config.get(lpSettings, "Sigil of Swimming cost; Default: 150", 150).getInt(sigilSwimmingCost);
|
||||
sigilDivinityCost = config.get(lpSettings, "Sigil of Divinity cost; Default: 1000000", 1000000).getInt(sigilDivinityCost);
|
||||
|
||||
@@ -22,14 +22,13 @@ public class BloodArsenalRecipes
|
||||
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), 2, 6000, 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_ball), new ItemStack(Items.snowball), 2, 500, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_money), new ItemStack(Items.paper), 4, 10000, 5, 5, false);
|
||||
AltarRecipeRegistry.registerAltarRecipe(new ItemStack(ModItems.blood_money), new ItemStack(Items.paper), 3, 10000, 5, 5, false);
|
||||
}
|
||||
|
||||
public static void registerBindingRecipes()
|
||||
@@ -39,7 +38,6 @@ public class BloodArsenalRecipes
|
||||
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.bound_igniter), new ItemStack(Items.flint_and_steel));
|
||||
//Temporary
|
||||
if (BloodArsenal.isHalloween())
|
||||
{
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.vampire_cape), new ItemStack(Items.leather_chestplate));
|
||||
@@ -66,8 +64,8 @@ public class BloodArsenalRecipes
|
||||
|
||||
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', masterOrb, 'c', WayofTime.alchemicalWizardry.ModBlocks.blockAltar, 'd', new ItemStack(ModItems.blood_infused_diamond_bound));
|
||||
addOreDictBloodOrbRecipe(new ItemStack(ModBlocks.lp_materializer), "aba", "bcb", "aba", 'a', ModItems.blood_infused_iron, 'b', imbuedSlate, 'c', masterOrb);
|
||||
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);
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.arc.bloodarsenal.common;
|
||||
|
||||
import com.arc.bloodarsenal.common.entity.EntityBloodTNT;
|
||||
import com.arc.bloodarsenal.common.entity.mob.EntityBloodHound;
|
||||
import com.arc.bloodarsenal.common.entity.projectile.EntityBloodBall;
|
||||
import com.arc.bloodarsenal.common.entity.projectile.EntityGatlingProjectile;
|
||||
import com.arc.bloodarsenal.common.tinkers.IClientCode;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import net.minecraft.world.World;
|
||||
@@ -31,9 +28,9 @@ public class CommonProxy
|
||||
|
||||
public void registerEntityTrackers()
|
||||
{
|
||||
EntityRegistry.registerModEntity(EntityGatlingProjectile.class, "gatlingProjectile", 0, BloodArsenal.instance, 128, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityBloodTNT.class, "bloodTNT", 1, BloodArsenal.instance, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityBloodBall.class, "bloodBall", 2, BloodArsenal.instance, 128, 5, true);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.arc.bloodarsenal.common.entity.EntityBloodTNT;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.BlockTNT;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBloodTNT extends Block
|
||||
public class BlockBloodTNT extends BlockTNT
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon top;
|
||||
@@ -26,7 +26,7 @@ public class BlockBloodTNT extends Block
|
||||
|
||||
public BlockBloodTNT()
|
||||
{
|
||||
super(Material.tnt);
|
||||
super();
|
||||
setHardness(0.0F);
|
||||
setStepSound(soundTypeGrass);
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class BlockBloodTNT extends Block
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
spawnTNT(par1World, par2, par3, par4, par5, (EntityLivingBase) null);
|
||||
spawnTNT(par1World, par2, par3, par4, par5, null);
|
||||
}
|
||||
|
||||
public void spawnTNT(World par1World, int par2, int par3, int par4, int par5, EntityLivingBase par6EntityLivingBase)
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.block.fluid;
|
||||
|
||||
import com.arc.bloodarsenal.common.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class MoltenBloodInfusedIron extends BlockFluidClassic
|
||||
{
|
||||
private IIcon stillIcon;
|
||||
private IIcon flowingIcon;
|
||||
private String stillIconTexture;
|
||||
private String flowIconTexture;
|
||||
|
||||
public MoltenBloodInfusedIron(Fluid fluid, String unlocalizedName, String stillIconTexture, String flowIconTexture)
|
||||
{
|
||||
super(fluid, Material.lava);
|
||||
setResistance(100.0F);
|
||||
setLightLevel(1.0F);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setBlockName(unlocalizedName);
|
||||
|
||||
this.stillIconTexture = (BloodArsenal.MODID + ":" + stillIconTexture);
|
||||
this.flowIconTexture = (BloodArsenal.MODID + ":" + flowIconTexture);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister icon)
|
||||
{
|
||||
this.stillIcon = icon.registerIcon(this.stillIconTexture);
|
||||
this.flowingIcon = icon.registerIcon(this.flowIconTexture);
|
||||
|
||||
getFluid().setIcons(this.stillIcon, this.flowingIcon);
|
||||
}
|
||||
|
||||
public IIcon getStillIcon()
|
||||
{
|
||||
return this.stillIcon;
|
||||
}
|
||||
|
||||
public IIcon getFlowingIcon()
|
||||
{
|
||||
return this.flowingIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon func_149735_b(int side, int meta)
|
||||
{
|
||||
if (side <= 1)
|
||||
{
|
||||
return this.stillIcon;
|
||||
}
|
||||
|
||||
return this.flowingIcon;
|
||||
}
|
||||
}
|
||||
@@ -35,18 +35,22 @@ public class EntityBloodTNT extends Entity
|
||||
tntPlacedBy = par8EntityLivingBase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entityInit() {}
|
||||
|
||||
@Override
|
||||
public boolean canTriggerWalking()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith()
|
||||
{
|
||||
return !isDead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
prevPosX = posX;
|
||||
@@ -84,16 +88,19 @@ public class EntityBloodTNT extends Entity
|
||||
worldObj.createExplosion(this, posX, posY, posZ, f, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound par1)
|
||||
{
|
||||
par1.setByte("Fuse", (byte) fuse);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
fuse = par1.getByte("Fuse");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize()
|
||||
{
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.entity;
|
||||
|
||||
public class ModEntities
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
int id = 0;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityBloodBall extends EntityThrowable
|
||||
{
|
||||
public EntityBloodBall(World world)
|
||||
{
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityBloodBall(World world, EntityLivingBase entity)
|
||||
{
|
||||
super(world, entity);
|
||||
}
|
||||
|
||||
public EntityBloodBall(World world, double so, double me, double thing)
|
||||
{
|
||||
super(world, so, me, thing);
|
||||
}
|
||||
|
||||
protected void onImpact(MovingObjectPosition object)
|
||||
{
|
||||
if (object.entityHit != null)
|
||||
{
|
||||
byte b0 = 1;
|
||||
|
||||
object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0);
|
||||
EntityLivingBase thrower = this.getThrower();
|
||||
|
||||
if (thrower instanceof EntityPlayer)
|
||||
{
|
||||
String throwerName = thrower.getCommandSenderName();
|
||||
World worldSave = MinecraftServer.getServer().worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, throwerName);
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
data = new LifeEssenceNetwork(throwerName);
|
||||
worldSave.setItemData(throwerName, data);
|
||||
}
|
||||
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(throwerName, 50, data.maxOrb);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
-501
@@ -1,501 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.common.registry.IThrowableEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class EntityGatlingProjectile extends Entity implements IProjectile, IThrowableEntity
|
||||
{
|
||||
protected int xTile = -1;
|
||||
protected int yTile = -1;
|
||||
protected int zTile = -1;
|
||||
protected int inTile = 0;
|
||||
protected int inData = 0;
|
||||
protected boolean inGround = false;
|
||||
public EntityLivingBase shootingEntity;
|
||||
protected int ticksInAir = 0;
|
||||
protected int maxTicksInAir = 600;
|
||||
private int ricochetCounter = 0;
|
||||
private boolean scheduledForDeath = false;
|
||||
protected int projectileDamage = 8;
|
||||
|
||||
public EntityGatlingProjectile(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
setSize(0.5F, 0.5F);
|
||||
maxTicksInAir = 600;
|
||||
}
|
||||
|
||||
public EntityGatlingProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage)
|
||||
{
|
||||
super(par1World);
|
||||
shootingEntity = par2EntityPlayer;
|
||||
float par3 = 0.8F;
|
||||
setSize(0.5F, 0.5F);
|
||||
setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
||||
posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
posY -= 0.2D;
|
||||
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
setPosition(posX, posY, posZ);
|
||||
yOffset = 0.0F;
|
||||
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
|
||||
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
|
||||
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI);
|
||||
setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F);
|
||||
projectileDamage = damage;
|
||||
maxTicksInAir = 600;
|
||||
}
|
||||
|
||||
public EntityGatlingProjectile(World par1World, EntityLivingBase par2EntityPlayer, int damage, int maxTicksInAir, double posX, double posY, double posZ, float rotationYaw, float rotationPitch)
|
||||
{
|
||||
super(par1World);
|
||||
shootingEntity = par2EntityPlayer;
|
||||
float par3 = 0.8F;
|
||||
setSize(0.5F, 0.5F);
|
||||
setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
|
||||
posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
posY -= 0.2D;
|
||||
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
setPosition(posX, posY, posZ);
|
||||
yOffset = 0.0F;
|
||||
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
|
||||
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
|
||||
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI);
|
||||
setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F);
|
||||
projectileDamage = damage;
|
||||
}
|
||||
|
||||
public EntityGatlingProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir)
|
||||
{
|
||||
super(par1World);
|
||||
renderDistanceWeight = 10.0D;
|
||||
shootingEntity = par2EntityLivingBase;
|
||||
posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D;
|
||||
double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX;
|
||||
double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 1.5F) - posY;
|
||||
double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ;
|
||||
double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2);
|
||||
|
||||
if (d3 >= 1.0E-7D)
|
||||
{
|
||||
float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
|
||||
float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI));
|
||||
double d4 = d0 / d3;
|
||||
double d5 = d2 / d3;
|
||||
setLocationAndAngles(par2EntityLivingBase.posX + d4, posY, par2EntityLivingBase.posZ + d5, f2, f3);
|
||||
yOffset = 0.0F;
|
||||
float f4 = (float) d3 * 0.2F;
|
||||
setThrowableHeading(d0, d1, d2, par4, par5);
|
||||
}
|
||||
|
||||
projectileDamage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
dataWatcher.addObject(16, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8)
|
||||
{
|
||||
float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5);
|
||||
var1 /= var9;
|
||||
var3 /= var9;
|
||||
var5 /= var9;
|
||||
var1 += rand.nextGaussian() * 0.007499999832361937D * var8;
|
||||
var3 += rand.nextGaussian() * 0.007499999832361937D * var8;
|
||||
var5 += rand.nextGaussian() * 0.007499999832361937D * var8;
|
||||
var1 *= var7;
|
||||
var3 *= var7;
|
||||
var5 *= var7;
|
||||
motionX = var1;
|
||||
motionY = var3;
|
||||
motionZ = var5;
|
||||
float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5);
|
||||
prevRotationYaw = rotationYaw = (float) (Math.atan2(var1, var5) * 180.0D / Math.PI);
|
||||
prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
|
||||
{
|
||||
setPosition(par1, par3, par5);
|
||||
setRotation(par7, par8);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setVelocity(double par1, double par3, double par5)
|
||||
{
|
||||
motionX = par1;
|
||||
motionY = par3;
|
||||
motionZ = par5;
|
||||
|
||||
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
|
||||
{
|
||||
float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
|
||||
prevRotationYaw = rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI);
|
||||
prevRotationPitch = rotationPitch = (float) (Math.atan2(par3, var7) * 180.0D / Math.PI);
|
||||
prevRotationPitch = rotationPitch;
|
||||
prevRotationYaw = rotationYaw;
|
||||
setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
||||
if (ticksInAir > maxTicksInAir)
|
||||
{
|
||||
setDead();
|
||||
}
|
||||
|
||||
if (shootingEntity == null)
|
||||
{
|
||||
List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1));
|
||||
Iterator i = players.iterator();
|
||||
double closestDistance = Double.MAX_VALUE;
|
||||
EntityPlayer closestPlayer = null;
|
||||
|
||||
while (i.hasNext())
|
||||
{
|
||||
EntityPlayer e = (EntityPlayer) i.next();
|
||||
double distance = e.getDistanceToEntity(this);
|
||||
|
||||
if (distance < closestDistance)
|
||||
{
|
||||
closestPlayer = e;
|
||||
}
|
||||
}
|
||||
|
||||
if (closestPlayer != null)
|
||||
{
|
||||
shootingEntity = closestPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
|
||||
{
|
||||
float var1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
|
||||
prevRotationYaw = rotationYaw = (float) (Math.atan2(motionX, motionZ) * 180.0D / Math.PI);
|
||||
prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI);
|
||||
}
|
||||
|
||||
Block var16 = worldObj.getBlock(xTile, yTile, zTile);
|
||||
|
||||
if (var16 != null)
|
||||
{
|
||||
var16.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile);
|
||||
AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile);
|
||||
|
||||
if (var2 != null && var2.isVecInside(Vec3.createVectorHelper(posX, posY, posZ)))
|
||||
{
|
||||
inGround = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (inGround)
|
||||
{
|
||||
Block var18 = worldObj.getBlock(xTile, yTile, zTile);
|
||||
int var19 = worldObj.getBlockMetadata(xTile, yTile, zTile);
|
||||
|
||||
if (var18.equals(Block.getBlockById(inTile)) && var19 == inData){}
|
||||
}
|
||||
else
|
||||
{
|
||||
++ticksInAir;
|
||||
|
||||
if (ticksInAir > 1 && ticksInAir < 3)
|
||||
{
|
||||
for (int particles = 0; particles < 3; particles++)
|
||||
{
|
||||
doFiringParticles();
|
||||
}
|
||||
}
|
||||
|
||||
Vec3 var17 = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
Vec3 var3 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, false);
|
||||
var17 = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
var3 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
|
||||
if (var4 != null)
|
||||
{
|
||||
var3 = Vec3.createVectorHelper(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord);
|
||||
}
|
||||
|
||||
Entity var5 = null;
|
||||
List var6 = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
double var7 = 0.0D;
|
||||
Iterator var9 = var6.iterator();
|
||||
float var11;
|
||||
|
||||
while (var9.hasNext())
|
||||
{
|
||||
Entity var10 = (Entity) var9.next();
|
||||
|
||||
if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5))
|
||||
{
|
||||
var11 = 0.3F;
|
||||
AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11);
|
||||
MovingObjectPosition var13 = var12.calculateIntercept(var17, var3);
|
||||
|
||||
if (var13 != null)
|
||||
{
|
||||
double var14 = var17.distanceTo(var13.hitVec);
|
||||
|
||||
if (var14 < var7 || var7 == 0.0D)
|
||||
{
|
||||
var5 = var10;
|
||||
var7 = var14;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (var5 != null)
|
||||
{
|
||||
var4 = new MovingObjectPosition(var5);
|
||||
}
|
||||
|
||||
if (var4 != null)
|
||||
{
|
||||
onImpact(var4);
|
||||
|
||||
if (scheduledForDeath)
|
||||
{
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
|
||||
posX += motionX;
|
||||
posY += motionY;
|
||||
posZ += motionZ;
|
||||
MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
|
||||
setPosition(posX, posY, posZ);
|
||||
}
|
||||
}
|
||||
|
||||
public void doFiringParticles()
|
||||
{
|
||||
worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
|
||||
worldObj.spawnParticle("flame", posX, posY, posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
par1NBTTagCompound.setShort("xTile", (short) xTile);
|
||||
par1NBTTagCompound.setShort("yTile", (short) yTile);
|
||||
par1NBTTagCompound.setShort("zTile", (short) zTile);
|
||||
par1NBTTagCompound.setByte("inTile", (byte) inTile);
|
||||
par1NBTTagCompound.setByte("inData", (byte) inData);
|
||||
par1NBTTagCompound.setByte("inGround", (byte) (inGround ? 1 : 0));
|
||||
par1NBTTagCompound.setInteger("ticksInAir", ticksInAir);
|
||||
par1NBTTagCompound.setInteger("maxTicksInAir", maxTicksInAir);
|
||||
par1NBTTagCompound.setInteger("projectileDamage", projectileDamage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
xTile = par1NBTTagCompound.getShort("xTile");
|
||||
yTile = par1NBTTagCompound.getShort("yTile");
|
||||
zTile = par1NBTTagCompound.getShort("zTile");
|
||||
inTile = par1NBTTagCompound.getByte("inTile") & 255;
|
||||
inData = par1NBTTagCompound.getByte("inData") & 255;
|
||||
inGround = par1NBTTagCompound.getByte("inGround") == 1;
|
||||
ticksInAir = par1NBTTagCompound.getInteger("ticksInAir");
|
||||
maxTicksInAir = par1NBTTagCompound.getInteger("maxTicksInAir");
|
||||
projectileDamage = par1NBTTagCompound.getInteger("projectileDamage");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canTriggerWalking()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttackWithItem()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onImpact(MovingObjectPosition mop)
|
||||
{
|
||||
if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null)
|
||||
{
|
||||
if (mop.entityHit == shootingEntity)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
onImpact(mop.entityHit);
|
||||
}
|
||||
else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
groundImpact(mop.sideHit);
|
||||
worldObj.createExplosion(shootingEntity, posX, posY, posZ, (float) 0.2, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void onImpact(Entity mop)
|
||||
{
|
||||
if (mop == shootingEntity && ticksInAir > 3)
|
||||
{
|
||||
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
|
||||
setDead();
|
||||
}
|
||||
else
|
||||
{
|
||||
doDamage(projectileDamage + d6(), mop);
|
||||
worldObj.createExplosion(shootingEntity, posX, posY, posZ, (float) 0.2, true);
|
||||
}
|
||||
|
||||
spawnHitParticles("magicCrit", 8);
|
||||
setDead();
|
||||
}
|
||||
|
||||
private int d6()
|
||||
{
|
||||
return rand.nextInt() + 5;
|
||||
}
|
||||
|
||||
protected void spawnHitParticles(String string, int i)
|
||||
{
|
||||
for (int particles = 0; particles < i; particles++)
|
||||
{
|
||||
worldObj.spawnParticle(string, posX, posY - (string == "portal" ? 1 : 0), posZ, gaussian(motionX), gaussian(motionY), gaussian(motionZ));
|
||||
}
|
||||
}
|
||||
|
||||
protected void doDamage(int i, Entity mop)
|
||||
{
|
||||
mop.attackEntityFrom(getDamageSource(), i);
|
||||
}
|
||||
|
||||
public DamageSource getDamageSource()
|
||||
{
|
||||
return DamageSource.causeMobDamage(shootingEntity);
|
||||
}
|
||||
|
||||
public void groundImpact(int sideHit)
|
||||
{
|
||||
ricochet(sideHit);
|
||||
}
|
||||
|
||||
public double smallGauss(double d)
|
||||
{
|
||||
return (worldObj.rand.nextFloat() - 0.5D) * d;
|
||||
}
|
||||
|
||||
public double gaussian(double d)
|
||||
{
|
||||
return d + d * ((rand.nextFloat() - 0.5D) / 4);
|
||||
}
|
||||
|
||||
private void ricochet(int sideHit)
|
||||
{
|
||||
switch (sideHit)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
// topHit, bottomHit, reflect Y
|
||||
motionY = motionY * -1;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
// westHit, eastHit, reflect Z
|
||||
motionZ = motionZ * -1;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
// southHit, northHit, reflect X
|
||||
motionX = motionX * -1;
|
||||
break;
|
||||
}
|
||||
|
||||
ricochetCounter++;
|
||||
|
||||
if (ricochetCounter > getRicochetMax())
|
||||
{
|
||||
scheduledForDeath = true;
|
||||
|
||||
for (int particles = 0; particles < 4; particles++)
|
||||
{
|
||||
switch (sideHit)
|
||||
{
|
||||
case 0:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 1:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 4:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
|
||||
case 5:
|
||||
worldObj.spawnParticle("smoke", posX, posY, posZ, gaussian(0.1D), gaussian(0.1D), gaussian(0.1D));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getRicochetMax()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity getThrower()
|
||||
{
|
||||
return shootingEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThrower(Entity entity)
|
||||
{
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
shootingEntity = (EntityLivingBase) entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import java.util.Set;
|
||||
|
||||
public class ConfigGuiFactory implements IModGuiFactory
|
||||
{
|
||||
|
||||
@Override
|
||||
public void initialize(Minecraft minecraftInstance) {}
|
||||
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.items;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BucketHandler
|
||||
{
|
||||
private static BucketHandler INSTANCE = new BucketHandler();
|
||||
private static HashMap<Block, ItemStack> FILLED_BUCKETS = new HashMap();
|
||||
|
||||
public static BucketHandler getInstance()
|
||||
{
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public static void addBuckets()
|
||||
{
|
||||
MoltenBucket bucket = new MoltenBucket(null);
|
||||
GameRegistry.registerItem(bucket, "extra.bucket");
|
||||
|
||||
int bucketVol = 1000;
|
||||
ItemStack emptyBucketStack = FluidContainerRegistry.EMPTY_BUCKET.copy();
|
||||
|
||||
|
||||
|
||||
FluidStack fluidStack = FluidRegistry.getFluidStack("molten.blood.infused.iron", bucketVol);
|
||||
|
||||
if (fluidStack != null)
|
||||
{
|
||||
int bucketId = 1;
|
||||
|
||||
bucket.addTextureMapping(bucketId, fluidStack.getFluid().getName(), "bucket_fill_blood_infused_iron");
|
||||
|
||||
ItemStack bucketStack = new ItemStack(bucket, 1, bucketId);
|
||||
|
||||
FILLED_BUCKETS.put(fluidStack.getFluid().getBlock(), bucketStack);
|
||||
|
||||
FluidContainerRegistry.registerFluidContainer(fluidStack, bucketStack, emptyBucketStack);
|
||||
}
|
||||
}
|
||||
|
||||
public void fillEvent(FillBucketEvent event)
|
||||
{
|
||||
World world = event.world;
|
||||
MovingObjectPosition pos = event.target;
|
||||
|
||||
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
|
||||
ItemStack bucketStack = getFilledBucket(block);
|
||||
|
||||
if (bucketStack == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
|
||||
|
||||
event.result = bucketStack;
|
||||
event.setResult(Event.Result.ALLOW);
|
||||
}
|
||||
|
||||
public static HashMap<Block, ItemStack> getAllBuckets()
|
||||
{
|
||||
return FILLED_BUCKETS;
|
||||
}
|
||||
|
||||
public static ItemStack getFilledBucket(Block fluidBlock)
|
||||
{
|
||||
return FILLED_BUCKETS.get(fluidBlock);
|
||||
}
|
||||
|
||||
public static ItemStack getFilledBucket(String fluidName)
|
||||
{
|
||||
Block fluidBlock = FluidRegistry.getFluid(fluidName).getBlock();
|
||||
return FILLED_BUCKETS.get(fluidBlock).copy();
|
||||
}
|
||||
|
||||
public static boolean isAvailableBucket(int fluidBlockId)
|
||||
{
|
||||
return FILLED_BUCKETS.containsKey(Integer.valueOf(fluidBlockId));
|
||||
}
|
||||
|
||||
public static boolean isAvailableBucket(String fluidName)
|
||||
{
|
||||
Block fluidBlock = FluidRegistry.getFluid(fluidName).getBlock();
|
||||
return FILLED_BUCKETS.containsKey(fluidBlock);
|
||||
}
|
||||
|
||||
public static Block getBlock(ItemStack bucketStack)
|
||||
{
|
||||
Block block = Blocks.air;
|
||||
for (Map.Entry<Block, ItemStack> entry : FILLED_BUCKETS.entrySet())
|
||||
{
|
||||
ItemStack stack = entry.getValue();
|
||||
if (stack.isItemEqual(bucketStack))
|
||||
{
|
||||
block = entry.getKey();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return block;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.items;
|
||||
|
||||
import com.arc.bloodarsenal.common.BloodArsenal;
|
||||
import com.arc.bloodarsenal.common.entity.projectile.EntityBloodBall;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemBloodBall extends Item
|
||||
{
|
||||
public ItemBloodBall()
|
||||
{
|
||||
setUnlocalizedName("blood_ball");
|
||||
setTextureName("BloodArsenal:blood_ball");
|
||||
setMaxStackSize(16);
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
--itemStack.stackSize;
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityBloodBall(world, player));
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
|
||||
public class ItemBloodMoney extends Item
|
||||
{
|
||||
private static final int[] MONEY_MULTIPLIER = new int[]{1, 4, 16, 64};
|
||||
private final int[] MONEY_MULTIPLIER = new int[]{1, 4, 16, 64};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
@@ -57,14 +57,12 @@ public class ModItems
|
||||
public static Item vampire_greaves;
|
||||
public static Item vampire_boots;
|
||||
public static Item vampire_ring;
|
||||
public static Item energy_gatling;
|
||||
public static Item sigil_of_swimming;
|
||||
public static Item sigil_of_ender;
|
||||
public static Item blood_infused_glowstone_dust;
|
||||
public static Item self_sacrifice_amulet;
|
||||
public static Item sacrifice_amulet;
|
||||
public static Item sigil_of_divinity;
|
||||
public static Item blood_ball;
|
||||
public static Item wolf_hide;
|
||||
public static Item blood_money;
|
||||
public static Item blood_burned_string;
|
||||
@@ -125,12 +123,10 @@ public class ModItems
|
||||
vampire_cape = registerItem(new VampireCostume(1), "vampire_cape");
|
||||
vampire_greaves = registerItem(new VampireCostume(2), "vampire_greaves");
|
||||
vampire_boots = registerItem(new VampireCostume(3), "vampire_boots");
|
||||
energy_gatling = registerItem(new EnergyGatling(), "energy_gatling");
|
||||
sigil_of_swimming = registerItem(new SigilSwimming(), "sigil_of_swimming");
|
||||
sigil_of_ender = registerItem(new SigilEnder(), "sigil_of_ender");
|
||||
blood_infused_glowstone_dust = registerItem(new ItemBloodArsenal(), "blood_infused_glowstone_dust");
|
||||
sigil_of_divinity = registerItem(new SigilDivinity(), "sigil_of_divinity");
|
||||
blood_ball = registerItem(new ItemBloodBall(), "blood_ball");
|
||||
wolf_hide = registerItem(new ItemBloodArsenal(), "wolf_hide");
|
||||
blood_money = registerItem(new ItemBloodMoney(), "blood_money");
|
||||
blood_burned_string = registerItem(new ItemReed(ModBlocks.block_burned_string), "blood_burned_string");
|
||||
|
||||
@@ -1,249 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.items;
|
||||
|
||||
import com.arc.bloodarsenal.common.BloodArsenal;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class MoltenBucket extends ItemBucket
|
||||
{
|
||||
private IIcon _filling = null;
|
||||
private Block _fluidBlock = null;
|
||||
private int _capacity = 1000;
|
||||
private HashBiMap<Integer, String> fluidNames = HashBiMap.create();
|
||||
private HashMap<Integer, String> textures = new HashMap();
|
||||
private HashMap<Integer, IIcon> icons = new HashMap();
|
||||
protected static final String pathToTextures = BloodArsenal.MODID + ":" + "bucket/";
|
||||
|
||||
|
||||
public MoltenBucket(Block fluidBlock)
|
||||
{
|
||||
super(fluidBlock);
|
||||
this._fluidBlock = fluidBlock;
|
||||
setUnlocalizedName("extratic.bucket");
|
||||
setCreativeTab(BloodArsenal.BA_TAB );
|
||||
setContainerItem(Items.bucket);
|
||||
setTextureName("minecraft:bucket_empty");
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderPasses(int damage)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register)
|
||||
{
|
||||
this.itemIcon = register.registerIcon(getIconString());
|
||||
|
||||
|
||||
this._filling = register.registerIcon(pathToTextures + "bucket_fill_fblood_infused_iron");
|
||||
|
||||
for (Map.Entry<Integer, String> entry : this.textures.entrySet())
|
||||
{
|
||||
IIcon filling = register.registerIcon(pathToTextures + entry.getValue());
|
||||
|
||||
this.icons.put(entry.getKey(), filling);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack itemStack, int pass)
|
||||
{
|
||||
int index = itemStack.getItemDamage();
|
||||
|
||||
if ((pass == 0) || (index <= 0))
|
||||
{
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
IIcon icon = this.icons.get(Integer.valueOf(index));
|
||||
|
||||
if (icon != null)
|
||||
{
|
||||
return icon;
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
if ((itemStack == null) || (itemStack.getItem() != this))
|
||||
{
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
int index = itemStack.getItemDamage();
|
||||
String fluidName = this.fluidNames.get(Integer.valueOf(index));
|
||||
|
||||
if (fluidName == null)
|
||||
{
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
Block block = BucketHandler.getBlock(itemStack);
|
||||
|
||||
boolean isAir = block == null;
|
||||
|
||||
MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(world, player, isAir);
|
||||
|
||||
if (movingobjectposition == null)
|
||||
{
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int xCoord = movingobjectposition.blockX;
|
||||
int yCoord = movingobjectposition.blockY;
|
||||
int zCoord = movingobjectposition.blockZ;
|
||||
|
||||
if (!world.canMineBlock(player, xCoord, yCoord, zCoord))
|
||||
{
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
if (block == Blocks.air)
|
||||
{
|
||||
return new ItemStack(getContainerItem());
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 0)
|
||||
{
|
||||
yCoord--;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 1)
|
||||
{
|
||||
yCoord++;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 2)
|
||||
{
|
||||
zCoord--;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 3)
|
||||
{
|
||||
zCoord++;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 4)
|
||||
{
|
||||
xCoord--;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 5)
|
||||
{
|
||||
xCoord++;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(xCoord, yCoord, zCoord, movingobjectposition.sideHit, itemStack))
|
||||
{
|
||||
return itemStack;
|
||||
}
|
||||
Material material = world.getBlock(xCoord, yCoord, zCoord).getMaterial();
|
||||
|
||||
if (world.isAirBlock(xCoord, yCoord, zCoord) && !material.isSolid())
|
||||
{
|
||||
if (!world.isRemote && !material.isSolid() && !material.isLiquid())
|
||||
{
|
||||
world.func_147480_a(xCoord, yCoord, zCoord, true);
|
||||
}
|
||||
|
||||
world.setBlock(xCoord, yCoord, zCoord, block, 0, 3);
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
return new ItemStack(getContainerItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean tryPlaceContainedLiquid(World world, int xCoord, int yCoord, int zCoord)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setCapcity(int capacity)
|
||||
{
|
||||
this._capacity = capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
if (itemStack == null)
|
||||
{
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
int index = itemStack.getItemDamage();
|
||||
String fluidName = this.fluidNames.get(Integer.valueOf(index));
|
||||
|
||||
if (fluidName == null)
|
||||
{
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
return "item.ba.bucket.filled." + fluidName;
|
||||
}
|
||||
|
||||
public void addTextureMapping(int id, String fluidName, String texture)
|
||||
{
|
||||
this.fluidNames.put(id, fluidName);
|
||||
this.textures.put(id, texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List itemStackList)
|
||||
{
|
||||
if (!this.fluidNames.isEmpty())
|
||||
{
|
||||
for (Map.Entry<Integer, String> subItem : this.fluidNames.entrySet())
|
||||
{
|
||||
int entryId = subItem.getKey().intValue();
|
||||
ItemStack bucketStack = new ItemStack(this, 1, entryId);
|
||||
itemStackList.add(bucketStack);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemStackList.add(new ItemStack(this, 1, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,11 +21,14 @@ import net.minecraft.world.World;
|
||||
|
||||
public class VampireCostume extends ItemArmor
|
||||
{
|
||||
private static IIcon chestIcon;
|
||||
private static IIcon leggingsIcon;
|
||||
private static IIcon bootsIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon chestIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon leggingsIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bootsIcon;
|
||||
|
||||
private static final boolean tryComplexRendering = true;
|
||||
private boolean tryComplexRendering = true;
|
||||
|
||||
public VampireCostume(int armorType)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.arc.bloodarsenal.common.items.book;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
|
||||
import amerifrance.guideapi.api.GuideRegistry;
|
||||
import amerifrance.guideapi.api.abstraction.CategoryAbstract;
|
||||
import amerifrance.guideapi.api.base.Book;
|
||||
import amerifrance.guideapi.api.util.BookBuilder;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BloodBurnedTome
|
||||
{
|
||||
public static Book burnedTome;
|
||||
public static List<CategoryAbstract> categories = new ArrayList();
|
||||
private final static String R_LOC = "BloodArsenal:book/images/";
|
||||
|
||||
public static void registerTome()
|
||||
{
|
||||
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:textures/items/burned_tome");
|
||||
burnedTome = bookBuilder.build();
|
||||
GuideRegistry.registerBook(burnedTome);
|
||||
GameRegistry.addRecipe(new ShapelessBloodOrbRecipe(GuideRegistry.getItemStackForBook(burnedTome), ModItems.glass_shard, new ItemStack(WayofTime.alchemicalWizardry.ModItems.apprenticeBloodOrb, 1, OreDictionary.WILDCARD_VALUE)));
|
||||
}
|
||||
}
|
||||
@@ -44,11 +44,11 @@ public class TransparentOrb extends EnergyBattery
|
||||
return;
|
||||
}
|
||||
|
||||
int maxEssence = this.getMaxEssence();
|
||||
int section = maxEssence / 23;
|
||||
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);
|
||||
|
||||
@@ -27,11 +27,16 @@ import java.util.List;
|
||||
|
||||
public class BoundBow extends ItemBow implements IBindable
|
||||
{
|
||||
private static IIcon active;
|
||||
private static IIcon active_1;
|
||||
private static IIcon active_2;
|
||||
private static IIcon active_3;
|
||||
private static IIcon passive;
|
||||
@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;
|
||||
|
||||
@@ -319,4 +324,10 @@ public class BoundBow extends ItemBow implements IBindable
|
||||
return passive;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemTool(ItemStack stack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,11 @@ import java.util.List;
|
||||
public class BoundIgniter extends Item implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private static IIcon active;
|
||||
private static IIcon passive;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon active;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passive;
|
||||
|
||||
public BoundIgniter()
|
||||
{
|
||||
@@ -167,7 +169,6 @@ public class BoundIgniter extends Item implements IBindable
|
||||
}
|
||||
|
||||
par1ItemStack.setItemDamage(0);
|
||||
return;
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
|
||||
@@ -33,8 +33,10 @@ public class BoundShears extends ItemShears implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private static IIcon active;
|
||||
private static IIcon passive;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon active;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passive;
|
||||
|
||||
public BoundShears()
|
||||
{
|
||||
@@ -287,6 +289,5 @@ public class BoundShears extends ItemShears implements IBindable
|
||||
}
|
||||
|
||||
par1ItemStack.setItemDamage(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,196 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.items.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import com.arc.bloodarsenal.common.BloodArsenal;
|
||||
import com.arc.bloodarsenal.common.entity.projectile.EntityGatlingProjectile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EnergyGatling extends EnergyItems implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
private static IIcon activeIcon;
|
||||
private static IIcon passiveIcon;
|
||||
|
||||
private static int damage;
|
||||
|
||||
public EnergyGatling()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("energy_gatling");
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setEnergyUsed(200);
|
||||
setFull3D();
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i)
|
||||
{
|
||||
energyUsed = i;
|
||||
}
|
||||
|
||||
public int getEnergyUsed()
|
||||
{
|
||||
return energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par2World.spawnEntityInWorld(new EntityGatlingProjectile(par2World, par3EntityPlayer, damage));
|
||||
}
|
||||
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("BloodArsenal:energy_gatling");
|
||||
activeIcon = iconRegister.registerIcon("BloodArsenal:energy_gatling");
|
||||
passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.stackTagCompound == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.stackTagCompound;
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return activeIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
return passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.tool.energy_gatling"));
|
||||
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
par3List.add("Activated");
|
||||
} else
|
||||
{
|
||||
par3List.add("Deactivated");
|
||||
}
|
||||
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 100 == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 500);
|
||||
}
|
||||
}
|
||||
|
||||
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
|
||||
{
|
||||
if (par3EntityPlayer.getActivePotionEffect(Potion.moveSlowdown) != null)
|
||||
{
|
||||
par3EntityPlayer.removePotionEffect(Potion.moveSlowdown.id);
|
||||
}
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,6 @@ import java.util.Arrays;
|
||||
|
||||
public final class ToolCapabilities
|
||||
{
|
||||
public int count;
|
||||
|
||||
public static Material[] materialsPick = new Material[]{ Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil };
|
||||
public static Material[] materialsShovel = new Material[]{ Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay };
|
||||
public static Material[] materialsAxe = new Material[]{ Material.coral, Material.leaves, Material.plants, Material.wood };
|
||||
|
||||
@@ -6,11 +6,6 @@ import tconstruct.library.crafting.ModifyBuilder;
|
||||
|
||||
public class BloodArsenalModifiers
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
initModifiers();
|
||||
}
|
||||
|
||||
public static void initModifiers()
|
||||
{
|
||||
ItemStack masterOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.masterBloodOrb, 1, OreDictionary.WILDCARD_VALUE);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.arc.bloodarsenal.common.tinkers;
|
||||
|
||||
import com.arc.bloodarsenal.common.BloodArsenal;
|
||||
import com.arc.bloodarsenal.common.BloodArsenalConfig;
|
||||
import com.arc.bloodarsenal.common.block.ModBlocks;
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -16,303 +15,125 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.client.TConstructClientRegistry;
|
||||
import tconstruct.library.crafting.*;
|
||||
import tconstruct.library.tools.ToolMaterial;
|
||||
import tconstruct.library.crafting.FluidType;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.weaponry.TinkerWeaponry;
|
||||
|
||||
import java.util.ListIterator;
|
||||
|
||||
public class BloodArsenalTinkers
|
||||
{
|
||||
public static PartHelper ARROWHEAD;
|
||||
public static PartHelper AXE_HEAD;
|
||||
public static PartHelper BATTLE_SIGN_HEAD;
|
||||
public static PartHelper BINDING;
|
||||
public static PartHelper BOLT;
|
||||
public static PartHelper BOW_LIMB;
|
||||
public static PartHelper CHISEL_HEAD;
|
||||
public static PartHelper CHUNK;
|
||||
public static PartHelper CROSSBAR;
|
||||
public static PartHelper CROSSBOW_BODY;
|
||||
public static PartHelper CROSSBOW_LIMB;
|
||||
public static PartHelper EXCAVATOR_HEAD;
|
||||
public static PartHelper FISHING_ROD;
|
||||
public static PartHelper FRYPAN_HEAD;
|
||||
public static PartHelper FULL_GUARD;
|
||||
public static PartHelper HAMMER_HEAD;
|
||||
public static PartHelper KNIFE_BLADE;
|
||||
public static PartHelper LARGE_GUARD;
|
||||
public static PartHelper LARGE_SWORD_BLADE;
|
||||
public static PartHelper LARGEPLATE;
|
||||
public static PartHelper LUMBERAXE_HEAD;
|
||||
public static PartHelper MEDIUM_GUARD;
|
||||
public static PartHelper PICKAXE_HEAD;
|
||||
public static PartHelper SCYTHE_HEAD;
|
||||
public static PartHelper SHOVEL_HEAD;
|
||||
public static PartHelper SHURIKEN;
|
||||
public static PartHelper SWORD_BLADE;
|
||||
public static PartHelper TOOLROD;
|
||||
public static PartHelper TOUGHBIND;
|
||||
public static PartHelper TOUGHROD;
|
||||
public final static BloodArsenalTinkers INSTANCE = new BloodArsenalTinkers();
|
||||
|
||||
public static Fluid bloodInfusedIron = new Fluid("molten.bloodInfusedIron").setDensity(3000).setViscosity(6000).setTemperature(1300);
|
||||
public static Fluid bloodInfusedIronFluid;
|
||||
|
||||
public static void init()
|
||||
public BloodArsenalTinkers() {}
|
||||
|
||||
public void init()
|
||||
{
|
||||
// addMaterials();
|
||||
|
||||
addParts();
|
||||
addLifeInfusedIronMaterial();
|
||||
addLiquids();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new TConEvents());
|
||||
addBloodInfusedWoodMaterial();
|
||||
addBloodInfusedIronMaterial();
|
||||
BloodArsenalModifiers.initModifiers();
|
||||
}
|
||||
|
||||
public static void addLifeInfusedIronMaterial()
|
||||
public void addBloodInfusedWoodMaterial()
|
||||
{
|
||||
if (ModItems.itemsNotToBeRegistered.contains(ModItems.blood_infused_iron) && ModBlocks.blocksNotToBeRegistered.contains(ModBlocks.blood_infused_iron_block))
|
||||
if (ModBlocks.blood_infused_planks != null)
|
||||
{
|
||||
return;
|
||||
int id = BloodArsenalConfig.bloodInfusedWoodID;
|
||||
|
||||
if (id > 0)
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setInteger("Id", id);
|
||||
tag.setString("Name", "BloodInfusedWood");
|
||||
tag.setString("localizationString", "material.bloodarsenal.blood_infused_wood");
|
||||
tag.setInteger("Durability", 123);
|
||||
tag.setInteger("MiningSpeed", 450);
|
||||
tag.setInteger("HarvestLevel", 1);
|
||||
tag.setInteger("Attack", 1);
|
||||
tag.setFloat("HandleModifier", 1.25F);
|
||||
tag.setInteger("Reinforced", 0);
|
||||
tag.setFloat("Bow_ProjectileSpeed", 3.2F);
|
||||
tag.setInteger("Bow_DrawSpeed", 15);
|
||||
tag.setFloat("Projectile_Mass", 0.62F);
|
||||
tag.setFloat("Projectile_Fragility", 0.5F);
|
||||
tag.setString("Style", EnumChatFormatting.RED.toString());
|
||||
tag.setInteger("Color", 13178385);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addMaterial", tag);
|
||||
ItemStack itemstack = new ItemStack(ModBlocks.blood_infused_planks);
|
||||
tag = new NBTTagCompound();
|
||||
tag.setInteger("MaterialId", id);
|
||||
NBTTagCompound item = new NBTTagCompound();
|
||||
itemstack.writeToNBT(item);
|
||||
tag.setTag("Item", item);
|
||||
tag.setInteger("Value", 2);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addPartBuilderMaterial", tag);
|
||||
tag = new NBTTagCompound();
|
||||
tag.setInteger("MaterialId", id);
|
||||
tag.setInteger("Value", 2);
|
||||
item = new NBTTagCompound();
|
||||
itemstack.writeToNBT(item);
|
||||
tag.setTag("Item", item);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addMaterialItem", tag);
|
||||
}
|
||||
}
|
||||
|
||||
final int id = 250;
|
||||
|
||||
|
||||
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setInteger("Id", id);
|
||||
|
||||
final ToolMaterial material = new ToolMaterial("blood_infused_iron", "material.blood_infused_iron", 550, 1800, 3, 3, 1.5F, 0, 0.0F, EnumChatFormatting.DARK_RED.toString(), 16777215);
|
||||
|
||||
/* tag.setString("Name", "Blood Infused Iron");
|
||||
tag.setString("localizationString", "material.blood_infused_iron");
|
||||
tag.setInteger("Durability", 550);
|
||||
tag.setInteger("MiningSpeed", 1800);
|
||||
tag.setInteger("HarvestLevel", 3);
|
||||
tag.setInteger("Attack", 3);
|
||||
tag.setFloat("HandleModifier", 1.5F);
|
||||
tag.setInteger("Reinforced", 0);
|
||||
tag.setFloat("Bow_ProjectileSpeed", 3.0F);
|
||||
tag.setInteger("Bow_DrawSpeed", 40);
|
||||
tag.setFloat("Projectile_Mass", 4.7F);
|
||||
tag.setFloat("Projectile_Fragility", 0.2F);
|
||||
tag.setString("Style", EnumChatFormatting.BLACK.toString());
|
||||
tag.setInteger("Color", 16777215);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addMaterial", tag);
|
||||
|
||||
FluidRegistry.registerFluid(bloodInfusedIron);
|
||||
|
||||
FluidType.registerFluidType(bloodInfusedIron.getName(), ModBlocks.blood_infused_iron_block, 0, 850, bloodInfusedIron, true);
|
||||
Smeltery.addMelting(new ItemStack(ModBlocks.blood_infused_iron_block, 1), ModBlocks.blood_infused_iron_block, 0, 850, new FluidStack(bloodInfusedIron, 1296));
|
||||
Smeltery.addMelting(new ItemStack(ModItems.blood_infused_iron, 1, 0), ModBlocks.blood_infused_iron_block, 0, 850, new FluidStack(bloodInfusedIron, 144));
|
||||
|
||||
ItemStack ingotcast = new ItemStack(TinkerSmeltery.metalPattern, 1, 0);
|
||||
TConstructRegistry.getBasinCasting().addCastingRecipe(new ItemStack(ModBlocks.blood_infused_iron_block, 1), new FluidStack(bloodInfusedIron, 1296), null, true, 100);
|
||||
TConstructRegistry.getTableCasting().addCastingRecipe(new ItemStack(ModItems.blood_infused_iron, 1), new FluidStack(bloodInfusedIron, 144), ingotcast, false, 50);
|
||||
|
||||
tag = new NBTTagCompound();
|
||||
tag.setString("FluidName", bloodInfusedIron.getName());
|
||||
tag.setInteger("MaterialId", id);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addPartCastingMaterial", tag);
|
||||
|
||||
tag = new NBTTagCompound();
|
||||
tag.setInteger("MaterialId", id);
|
||||
tag.setTag("Item", new ItemStack(ModItems.blood_infused_iron, 1, 0).writeToNBT(new NBTTagCompound()));
|
||||
tag.setInteger("Value", 2);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addMaterialItem", tag);
|
||||
*/
|
||||
TConstructRegistry.addtoolMaterial(id, material);
|
||||
TConstructRegistry.addDefaultToolPartMaterial(id);
|
||||
TConstructRegistry.addBowMaterial(id, 40, 1.2F);
|
||||
TConstructRegistry.addArrowMaterial(id, 4.7F, 0.2F);
|
||||
|
||||
BloodArsenal.proxy.executeClientCode(new IClientCode()
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void executeClientCode()
|
||||
{
|
||||
if (FMLCommonHandler.instance().getSide().isClient()) {
|
||||
TConstructClientRegistry.addMaterialRenderMapping(id, "tinker", material.name().toLowerCase(), true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
FluidRegistry.registerFluid(bloodInfusedIron);
|
||||
|
||||
FluidType.registerFluidType(bloodInfusedIron.getName(), ModBlocks.blood_infused_iron_block, 0, 850, bloodInfusedIron, true);
|
||||
Smeltery.addMelting(new ItemStack(ModBlocks.blood_infused_iron_block, 1), ModBlocks.blood_infused_iron_block, 0, 850, new FluidStack(bloodInfusedIron, 1296));
|
||||
Smeltery.addMelting(new ItemStack(ModItems.blood_infused_iron, 1, 0), ModBlocks.blood_infused_iron_block, 0, 850, new FluidStack(bloodInfusedIron, 144));
|
||||
|
||||
ItemStack ingotcast = new ItemStack(TinkerSmeltery.metalPattern, 1, 0);
|
||||
TConstructRegistry.getBasinCasting().addCastingRecipe(new ItemStack(ModBlocks.blood_infused_iron_block, 1), new FluidStack(bloodInfusedIron, 1296), null, true, 100);
|
||||
TConstructRegistry.getTableCasting().addCastingRecipe(new ItemStack(ModItems.blood_infused_iron, 1), new FluidStack(bloodInfusedIron, 144), ingotcast, false, 50);
|
||||
|
||||
tag = new NBTTagCompound();
|
||||
tag.setString("FluidName", bloodInfusedIron.getName());
|
||||
tag.setInteger("MaterialId", id);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addPartCastingMaterial", tag);
|
||||
|
||||
tag = new NBTTagCompound();
|
||||
tag.setInteger("MaterialId", id);
|
||||
tag.setTag("Item", new ItemStack(ModItems.blood_infused_iron, 1, 0).writeToNBT(new NBTTagCompound()));
|
||||
tag.setInteger("Value", 2);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addMaterialItem", tag);
|
||||
|
||||
BloodArsenal.proxy.executeClientCode(new IClientCode()
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void executeClientCode()
|
||||
{
|
||||
new TextureResourcePackBloodInfusedIron("blood_infused_iron").register();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void addLiquids()
|
||||
public void addBloodInfusedIronMaterial()
|
||||
{
|
||||
LiquidCasting tb = TConstructRegistry.getTableCasting();
|
||||
for (ListIterator<CastingRecipe> iterator = tb.getCastingRecipes().listIterator(); iterator.hasNext();)
|
||||
if (ModBlocks.blood_infused_iron_block != null && ModItems.blood_infused_iron != null)
|
||||
{
|
||||
CastingRecipe castingRecipe = iterator.next();
|
||||
int id = BloodArsenalConfig.bloodInfusedIronID;
|
||||
|
||||
if ((castingRecipe != null) && (castingRecipe.getClass() == CastingRecipe.class) && (castingRecipe.output != null) && (castingRecipe.output.getItem() == TinkerWeaponry.partBolt) && (castingRecipe.cast != null) && (castingRecipe.cast.getItem() == TinkerTools.toolRod))
|
||||
if (id > 0)
|
||||
{
|
||||
int materialID = ToolBuilder.instance.getMaterialID(castingRecipe.cast);
|
||||
|
||||
if (materialID > 0)
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setInteger("Id", id);
|
||||
tag.setString("Name", "BloodInfusedIron");
|
||||
tag.setString("localizationString", "material.bloodarsenal.blood_infused_iron");
|
||||
tag.setInteger("Durability", 459);
|
||||
tag.setInteger("MiningSpeed", 700);
|
||||
tag.setInteger("HarvestLevel", 3);
|
||||
tag.setInteger("Attack", 3);
|
||||
tag.setFloat("HandleModifier", 1.4F);
|
||||
tag.setInteger("Reinforced", 0);
|
||||
tag.setFloat("Bow_ProjectileSpeed", 5.1F);
|
||||
tag.setInteger("Bow_DrawSpeed", 52);
|
||||
tag.setFloat("Projectile_Mass", 3.1F);
|
||||
tag.setFloat("Projectile_Fragility", 0.7F);
|
||||
tag.setString("Style", EnumChatFormatting.DARK_RED.toString());
|
||||
tag.setInteger("Color", 16777215);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addMaterial", tag);
|
||||
FluidRegistry.registerFluid(bloodInfusedIronFluid);
|
||||
FluidType.registerFluidType(bloodInfusedIronFluid.getName(), ModBlocks.blood_infused_iron_block, 0, 850, bloodInfusedIronFluid, true);
|
||||
Smeltery.addMelting(new ItemStack(ModBlocks.blood_infused_iron_block, 1), ModBlocks.blood_infused_iron_block, 0, 850, new FluidStack(bloodInfusedIronFluid, 1296));
|
||||
Smeltery.addMelting(new ItemStack(ModItems.blood_infused_iron, 1, 0), ModBlocks.blood_infused_iron_block, 0, 850, new FluidStack(bloodInfusedIronFluid, 144));
|
||||
ItemStack ingotcast = new ItemStack(TinkerSmeltery.metalPattern, 1, 0);
|
||||
TConstructRegistry.getBasinCasting().addCastingRecipe(new ItemStack(ModBlocks.blood_infused_iron_block, 1), new FluidStack(bloodInfusedIronFluid, 1296), null, true, 100);
|
||||
TConstructRegistry.getTableCasting().addCastingRecipe(new ItemStack(ModItems.blood_infused_iron, 1), new FluidStack(bloodInfusedIronFluid, 144), ingotcast, false, 50);
|
||||
tag = new NBTTagCompound();
|
||||
tag.setString("FluidName", bloodInfusedIronFluid.getName());
|
||||
tag.setInteger("MaterialId", id);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addPartCastingMaterial", tag);
|
||||
tag = new NBTTagCompound();
|
||||
tag.setInteger("MaterialId", id);
|
||||
tag.setTag("Item", (new ItemStack(ModItems.blood_infused_iron, 1, 0)).writeToNBT(new NBTTagCompound()));
|
||||
tag.setInteger("Value", 2);
|
||||
FMLInterModComms.sendMessage("TConstruct", "addMaterialItem", tag);
|
||||
BloodArsenal.proxy.executeClientCode(new IClientCode()
|
||||
{
|
||||
if (materialID == 250)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void executeClientCode()
|
||||
{
|
||||
iterator.set(new TConCastingRecipe(castingRecipe));
|
||||
(new TextureResourcePackBloodInfusedIron("BloodInfusedIron")).register();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void addMaterials()
|
||||
static
|
||||
{
|
||||
TConstructRegistry.addToolMaterial(250, "Blood Infused Iron", "blood_infused_iron", 3, 550, 1800, 3, 1.5F, 0, 0.0F, "Blood Infused Iron", 0xab0000);
|
||||
|
||||
TConstructClientRegistry.addMaterialRenderMapping(250, "BloodArsenal", "Blood Infused Iron", true);
|
||||
|
||||
TConstructRegistry.addBowMaterial(250, 40, 1.2F);
|
||||
|
||||
TConstructRegistry.addArrowMaterial(250, 4.7F, 0.2F);
|
||||
}
|
||||
|
||||
public static void addParts()
|
||||
{
|
||||
initParts();
|
||||
|
||||
// addMaterialToToolParts(250, "blood.infused.iron", "blood_infused_iron");
|
||||
|
||||
registerParts();
|
||||
}
|
||||
|
||||
private static void initParts()
|
||||
{
|
||||
ARROWHEAD = new PartHelper("arrowhead", 0, "");
|
||||
AXE_HEAD = new PartHelper("axe.head", 0, "");
|
||||
BATTLE_SIGN_HEAD = new PartHelper("battle.sign", 0, "");
|
||||
BINDING = new PartHelper("binding", 0, "");
|
||||
BOLT = new PartHelper("bolt", 0, "");
|
||||
BOW_LIMB = new PartHelper("bow.limb", 0, "");
|
||||
CHISEL_HEAD = new PartHelper("chisel.head", 0, "");
|
||||
CHUNK = new PartHelper("chunk", 0, "");
|
||||
CROSSBAR = new PartHelper("crossbar", 0, "");
|
||||
CROSSBOW_BODY = new PartHelper("crossbow.body", 0, "");
|
||||
CROSSBOW_LIMB = new PartHelper("crossbow.limb", 0, "");
|
||||
EXCAVATOR_HEAD = new PartHelper("excavator.head", 0, "");
|
||||
FISHING_ROD = new PartHelper("fishing.rod", 0, "");
|
||||
FRYPAN_HEAD = new PartHelper("frypan.head", 0, "");
|
||||
FULL_GUARD = new PartHelper("full.guard", 0, "");
|
||||
HAMMER_HEAD = new PartHelper("hammer.head", 0, "");
|
||||
KNIFE_BLADE = new PartHelper("knife.blade", 0, "");
|
||||
LARGE_GUARD = new PartHelper("large.guard", 0, "");
|
||||
LARGE_SWORD_BLADE = new PartHelper("large.sword.blade", 0, "");
|
||||
LARGEPLATE = new PartHelper("largeplate", 0, "");
|
||||
LUMBERAXE_HEAD = new PartHelper("lumberaxe.head", 0, "");
|
||||
MEDIUM_GUARD = new PartHelper("medium.guard", 0, "");
|
||||
PICKAXE_HEAD = new PartHelper("pickaxe.head", 0, "");
|
||||
SCYTHE_HEAD = new PartHelper("scythe.head", 0, "");
|
||||
SHOVEL_HEAD = new PartHelper("shovel.head", 0, "");
|
||||
SHURIKEN = new PartHelper("shuriken", 0, "");
|
||||
SWORD_BLADE = new PartHelper("sword.blade", 0, "");
|
||||
TOOLROD = new PartHelper("toolrod", 0, "");
|
||||
TOUGHBIND = new PartHelper("toughbind", 0, "");
|
||||
TOUGHROD = new PartHelper("toughrod", 0, "");
|
||||
}
|
||||
|
||||
private static void addMaterialToToolParts(int materialID, String unlocalizedName, String texture)
|
||||
{
|
||||
ARROWHEAD.addMaterial(materialID, unlocalizedName, texture + "_arrowhead");
|
||||
AXE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_axe_head");
|
||||
BATTLE_SIGN_HEAD.addMaterial(materialID, unlocalizedName, texture + "_battlesign_head");
|
||||
BINDING.addMaterial(materialID, unlocalizedName, texture + "_binding");
|
||||
BOLT.addMaterial(materialID, unlocalizedName, texture + "_bolt");
|
||||
BOW_LIMB.addMaterial(materialID, unlocalizedName, texture + "_bow_limb");
|
||||
CHISEL_HEAD.addMaterial(materialID, unlocalizedName, texture + "_chisel_head");
|
||||
CHUNK.addMaterial(materialID, unlocalizedName, texture + "_chunk");
|
||||
CROSSBAR.addMaterial(materialID, unlocalizedName, texture + "_crossbar");
|
||||
CROSSBOW_BODY.addMaterial(materialID, unlocalizedName, texture + "_crossbow_body");
|
||||
CROSSBOW_LIMB.addMaterial(materialID, unlocalizedName, texture + "_crossbow_limb");
|
||||
EXCAVATOR_HEAD.addMaterial(materialID, unlocalizedName, texture + "_excavator_head");
|
||||
FISHING_ROD.addMaterial(materialID, unlocalizedName, texture + "_fishingrod");
|
||||
FRYPAN_HEAD.addMaterial(materialID, unlocalizedName, texture + "_frypan_head");
|
||||
FULL_GUARD.addMaterial(materialID, unlocalizedName, texture + "_full_guard");
|
||||
HAMMER_HEAD.addMaterial(materialID, unlocalizedName, texture + "_hammer_head");
|
||||
KNIFE_BLADE.addMaterial(materialID, unlocalizedName, texture + "_knife_blade");
|
||||
LARGE_GUARD.addMaterial(materialID, unlocalizedName, texture + "_large_guard");
|
||||
LARGE_SWORD_BLADE.addMaterial(materialID, unlocalizedName, texture + "_large_sword_blade");
|
||||
LARGEPLATE.addMaterial(materialID, unlocalizedName, texture + "_largeplate");
|
||||
LUMBERAXE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_lumberaxe_head");
|
||||
MEDIUM_GUARD.addMaterial(materialID, unlocalizedName, texture + "_medium_guard");
|
||||
PICKAXE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_pickaxe_head");
|
||||
SCYTHE_HEAD.addMaterial(materialID, unlocalizedName, texture + "_scythe_head");
|
||||
SHOVEL_HEAD.addMaterial(materialID, unlocalizedName, texture + "_shovel_head");
|
||||
SHURIKEN.addMaterial(materialID, unlocalizedName, texture + "_shuriken");
|
||||
SWORD_BLADE.addMaterial(materialID, unlocalizedName, texture + "_sword_blade");
|
||||
TOOLROD.addMaterial(materialID, unlocalizedName, texture + "_rod");
|
||||
TOUGHBIND.addMaterial(materialID, unlocalizedName, texture + "_toughbind");
|
||||
TOUGHROD.addMaterial(materialID, unlocalizedName, texture + "_toughrod");
|
||||
}
|
||||
|
||||
private static void registerParts()
|
||||
{
|
||||
GameRegistry.registerItem(ARROWHEAD, "arrowhead");
|
||||
GameRegistry.registerItem(AXE_HEAD, "axeHead");
|
||||
GameRegistry.registerItem(BATTLE_SIGN_HEAD, "battleSign");
|
||||
GameRegistry.registerItem(BINDING, "binding");
|
||||
GameRegistry.registerItem(BOLT, "bolt");
|
||||
GameRegistry.registerItem(BOW_LIMB, "bowLimb");
|
||||
GameRegistry.registerItem(CHISEL_HEAD, "chiselHead");
|
||||
GameRegistry.registerItem(CHUNK, "chunk");
|
||||
GameRegistry.registerItem(CROSSBAR, "crossbar");
|
||||
GameRegistry.registerItem(CROSSBOW_BODY, "crossbowBody");
|
||||
GameRegistry.registerItem(CROSSBOW_LIMB, "crossbowLimb");
|
||||
GameRegistry.registerItem(EXCAVATOR_HEAD, "excavatorHead");
|
||||
// GameRegistry.registerItem(FISHING_ROD, "fishingRod");
|
||||
GameRegistry.registerItem(FRYPAN_HEAD, "frypanHead");
|
||||
GameRegistry.registerItem(FULL_GUARD, "fullGuard");
|
||||
GameRegistry.registerItem(HAMMER_HEAD, "hammerHead");
|
||||
GameRegistry.registerItem(KNIFE_BLADE, "knifeBlade");
|
||||
GameRegistry.registerItem(LARGE_GUARD, "largeGuard");
|
||||
GameRegistry.registerItem(LARGE_SWORD_BLADE, "largeSwordBlade");
|
||||
GameRegistry.registerItem(LARGEPLATE, "largeplate");
|
||||
GameRegistry.registerItem(LUMBERAXE_HEAD, "lumberaxeHead");
|
||||
GameRegistry.registerItem(MEDIUM_GUARD, "mediumGuard");
|
||||
GameRegistry.registerItem(PICKAXE_HEAD, "pickaxeHead");
|
||||
GameRegistry.registerItem(SCYTHE_HEAD, "scytheHead");
|
||||
GameRegistry.registerItem(SHOVEL_HEAD, "shovelHead");
|
||||
GameRegistry.registerItem(SHURIKEN, "shuriken");
|
||||
GameRegistry.registerItem(SWORD_BLADE, "swordBlade");
|
||||
GameRegistry.registerItem(TOOLROD, "toolrod");
|
||||
GameRegistry.registerItem(TOUGHBIND, "toughbind");
|
||||
GameRegistry.registerItem(TOUGHROD, "toughrod");
|
||||
BloodArsenal.logger.info("SOMETHING WORKED NOW DIDN'T IT?");
|
||||
MinecraftForge.EVENT_BUS.register(new TConEvents());
|
||||
bloodInfusedIronFluid = new Fluid("molten.blood_infused_iron").setDensity(3000).setViscosity(6000).setTemperature(1400);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,30 @@
|
||||
package com.arc.bloodarsenal.common.tinkers;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import tconstruct.library.modifier.IModifyable;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.modifiers.tools.ModBoolean;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ModSoulbound extends ModBoolean
|
||||
{
|
||||
public int modifiersRequired = 1;
|
||||
private String owner;
|
||||
|
||||
public ModSoulbound(ItemStack[] items)
|
||||
{
|
||||
super(items, 1, "Soulbound", "\u00a74", "Soulbound");
|
||||
super(items, 30, "Soulbound", EnumChatFormatting.DARK_RED.toString(), "Soulbound");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches (ItemStack[] input, ItemStack tool)
|
||||
public boolean matches(ItemStack[] input, ItemStack tool)
|
||||
{
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
|
||||
@@ -26,24 +34,28 @@ public class ModSoulbound extends ModBoolean
|
||||
return false;
|
||||
|
||||
ItemStack foundOrb = null;
|
||||
ItemStack masterOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.masterBloodOrb, 1, OreDictionary.WILDCARD_VALUE);
|
||||
|
||||
for (ItemStack stack : input)
|
||||
{
|
||||
if (stack == null)
|
||||
continue;
|
||||
if (stack.getItem() != masterOrb.getItem())
|
||||
continue;
|
||||
if (foundOrb != null)
|
||||
return false;
|
||||
{
|
||||
if (stack == null)
|
||||
continue;
|
||||
if (!(stack.getItem() instanceof IBloodOrb))
|
||||
continue;
|
||||
if (!(((IBloodOrb) stack.getItem()).getOrbLevel() >= 4))
|
||||
continue;
|
||||
if (SoulNetworkHandler.getOwnerName(stack).equals(""))
|
||||
continue;
|
||||
if (foundOrb != null)
|
||||
return false;
|
||||
|
||||
foundOrb = stack;
|
||||
}
|
||||
foundOrb = stack;
|
||||
}
|
||||
|
||||
if (foundOrb == null)
|
||||
return false;
|
||||
|
||||
// otherwise check if we have enough modfiers
|
||||
if (tags.getBoolean(key))
|
||||
return false;
|
||||
// otherwise check if we have enough modfiers
|
||||
else if (tags.getInteger("Modifiers") < modifiersRequired)
|
||||
return false;
|
||||
|
||||
@@ -52,7 +64,7 @@ public class ModSoulbound extends ModBoolean
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modify (ItemStack[] input, ItemStack tool)
|
||||
public void modify(ItemStack[] input, ItemStack tool)
|
||||
{
|
||||
NBTTagCompound tags = tool.getTagCompound();
|
||||
|
||||
@@ -62,27 +74,33 @@ public class ModSoulbound extends ModBoolean
|
||||
int modifiers = tags.getCompoundTag("InfiTool").getInteger("Modifiers");
|
||||
modifiers -= modifiersRequired;
|
||||
tags.getCompoundTag("InfiTool").setInteger("Modifiers", modifiers);
|
||||
addModifierTip(tool, "\u00a74");
|
||||
addModifierTip(tool, EnumChatFormatting.DARK_RED + "Soulbound");
|
||||
}
|
||||
|
||||
tags.getCompoundTag("InfiTool").setBoolean(key, true);
|
||||
|
||||
// find the battery in the input
|
||||
ItemStack inputBattery = null;
|
||||
ItemStack masterOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.masterBloodOrb, 1, OreDictionary.WILDCARD_VALUE);
|
||||
|
||||
for (ItemStack stack : input)
|
||||
{
|
||||
if (stack == null)
|
||||
continue;
|
||||
if (stack.getItem() != masterOrb.getItem())
|
||||
continue;
|
||||
{
|
||||
if (stack == null)
|
||||
continue;
|
||||
if (!(stack.getItem() instanceof IBloodOrb))
|
||||
continue;
|
||||
if (!(((IBloodOrb) stack.getItem()).getOrbLevel() >= 4))
|
||||
continue;
|
||||
if (SoulNetworkHandler.getOwnerName(stack).equals(""))
|
||||
continue;
|
||||
if (inputBattery != null)
|
||||
return;
|
||||
|
||||
// we're guaranteed to only find one battery because more are prevented above
|
||||
inputBattery = stack;
|
||||
}
|
||||
this.owner = SoulNetworkHandler.getOwnerName(stack);
|
||||
// we're guaranteed to only find one battery because more are prevented above
|
||||
inputBattery = stack;
|
||||
}
|
||||
|
||||
tags.setString("Owner", "");
|
||||
tags.setString("Owner", owner);
|
||||
tags.setInteger(key, 1);
|
||||
}
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.tinkers;
|
||||
|
||||
import com.arc.bloodarsenal.common.BloodArsenal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import tconstruct.library.util.IToolPart;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PartHelper extends Item implements IToolPart
|
||||
{
|
||||
protected String defaultTexture;
|
||||
protected int defaultMaterialID;
|
||||
protected String unlocalizedPartName;
|
||||
protected HashMap<Integer, String> unlocalizedMaterialNames = new HashMap();
|
||||
protected HashMap<Integer, String> textures = new HashMap();
|
||||
protected HashMap<Integer, IIcon> icons = new HashMap();
|
||||
protected static final String texturePath = "BloodArsenal".toLowerCase() + ":" + "tinkers/parts/";
|
||||
|
||||
public PartHelper(String defaultUnlocalizedPartName, int defaultMaterialID, String defaultTexture)
|
||||
{
|
||||
setCreativeTab(BloodArsenal.BA_TAB);
|
||||
setMaxStackSize(64);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
|
||||
setUnlocalizedName("default." + defaultUnlocalizedPartName);
|
||||
this.unlocalizedPartName = defaultUnlocalizedPartName;
|
||||
this.defaultMaterialID = defaultMaterialID;
|
||||
this.defaultTexture = (texturePath + defaultTexture);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister icon)
|
||||
{
|
||||
this.itemIcon = icon.registerIcon(this.defaultTexture);
|
||||
|
||||
for (Map.Entry<Integer, String> texture : this.textures.entrySet())
|
||||
{
|
||||
int materialID = texture.getKey().intValue();
|
||||
String textureName = texture.getValue();
|
||||
|
||||
IIcon _icon = icon.registerIcon(texturePath + textureName);
|
||||
|
||||
this.icons.put(materialID, _icon);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaterialID(ItemStack itemStack)
|
||||
{
|
||||
int damageValue = itemStack.getItemDamage();
|
||||
|
||||
if (damageValue >= 100)
|
||||
{
|
||||
return itemStack.getItemDamage();
|
||||
}
|
||||
|
||||
return this.defaultMaterialID;
|
||||
}
|
||||
|
||||
public void addMaterial(int materialId, String unlocalizedName, String texture)
|
||||
{
|
||||
this.unlocalizedMaterialNames.put(materialId, unlocalizedName);
|
||||
this.textures.put(materialId, texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damageValue)
|
||||
{
|
||||
if (this.icons.containsKey(damageValue))
|
||||
{
|
||||
return this.icons.get(damageValue);
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List itemStackList)
|
||||
{
|
||||
if (!this.unlocalizedMaterialNames.isEmpty())
|
||||
{
|
||||
for (Map.Entry<Integer, String> subItem : this.unlocalizedMaterialNames.entrySet())
|
||||
{
|
||||
int materialId = subItem.getKey().intValue();
|
||||
itemStackList.add(new ItemStack(item, 1, materialId));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemStackList.add(new ItemStack(this, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
int damageValue = itemStack.getItemDamage();
|
||||
|
||||
if (this.unlocalizedMaterialNames.containsKey(damageValue))
|
||||
{
|
||||
return "item." + this.unlocalizedMaterialNames.get(damageValue) + "." + this.unlocalizedPartName;
|
||||
}
|
||||
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemStack)
|
||||
{
|
||||
int damageValue = itemStack.getItemDamage();
|
||||
String displayName;
|
||||
/* if (this.unlocalizedMaterialNames.containsKey(damageValue))
|
||||
{
|
||||
String unlocalizedMaterialName = this.unlocalizedMaterialNames.get(damageValue);
|
||||
if (StatCollector.canTranslate("part." + this.unlocalizedPartName) && StatCollector.canTranslate("material." + unlocalizedMaterialName))
|
||||
{
|
||||
String localizedPartName = StatCollector.translateToLocal("part." + this.unlocalizedPartName);
|
||||
String localizedMaterialName = StatCollector.translateToLocal("material." + unlocalizedMaterialName);
|
||||
displayName = localizedPartName.replaceAll("@material@", localizedMaterialName);
|
||||
}
|
||||
else
|
||||
{
|
||||
displayName = getUnlocalizedName(itemStack) + ".name";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
displayName = getUnlocalizedName() + ".name";
|
||||
}
|
||||
*/
|
||||
String unlocalizedMaterialName = this.unlocalizedMaterialNames.get(damageValue);
|
||||
String localizedMaterialName = StatCollector.translateToLocal("material." + unlocalizedMaterialName);
|
||||
String partName = StatCollector.translateToLocal("part." + this.unlocalizedPartName);
|
||||
displayName = partName.replaceAll("@material@", localizedMaterialName);
|
||||
|
||||
return displayName;
|
||||
}
|
||||
}
|
||||
@@ -1,230 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.tinkers;
|
||||
|
||||
import com.arc.bloodarsenal.common.items.ModItems;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.weaponry.TinkerWeaponry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeHelper
|
||||
{
|
||||
private static Item pattern = TConstructRegistry.getItem("woodPattern");
|
||||
private static Item weaponPattern = TinkerWeaponry.woodPattern;
|
||||
|
||||
private static final ItemStack toolRodPattern = TConstructRegistry.getItemStack("toolRodPattern");
|
||||
private static final ItemStack pickaxeHeadPattern = TConstructRegistry.getItemStack("pickaxeHeadPattern");
|
||||
private static final ItemStack shovelHeadPattern = TConstructRegistry.getItemStack("shovelHeadPattern");
|
||||
private static final ItemStack hatchetHeadPattern = TConstructRegistry.getItemStack("hatchetHeadPattern");
|
||||
private static final ItemStack swordBladePattern = TConstructRegistry.getItemStack("swordBladePattern");
|
||||
private static final ItemStack wideGuardPattern = TConstructRegistry.getItemStack("wideGuardPattern");
|
||||
private static final ItemStack handGuardPattern = TConstructRegistry.getItemStack("handGuardPattern");
|
||||
private static final ItemStack crossbarPattern = TConstructRegistry.getItemStack("crossbarPattern");
|
||||
private static final ItemStack bindingPattern = TConstructRegistry.getItemStack("bindingPattern");
|
||||
private static final ItemStack frypanHeadPattern = TConstructRegistry.getItemStack("frypanHeadPattern");
|
||||
private static final ItemStack signHeadPattern = TConstructRegistry.getItemStack("signHeadPattern");
|
||||
private static final ItemStack knifeBladePattern = TConstructRegistry.getItemStack("knifeBladePattern");
|
||||
private static final ItemStack chiselHeadPattern = TConstructRegistry.getItemStack("chiselHeadPattern");
|
||||
private static final ItemStack toughRodPattern = TConstructRegistry.getItemStack("toughRodPattern");
|
||||
private static final ItemStack toughBindingPattern = TConstructRegistry.getItemStack("toughBindingPattern");
|
||||
private static final ItemStack largePlatePattern = TConstructRegistry.getItemStack("largePlatePattern");
|
||||
private static final ItemStack broadAxeHeadPattern = TConstructRegistry.getItemStack("broadAxeHeadPattern");
|
||||
private static final ItemStack scytheHeadPattern = TConstructRegistry.getItemStack("scytheHeadPattern");
|
||||
private static final ItemStack excavatorHeadPattern = TConstructRegistry.getItemStack("excavatorHeadPattern");
|
||||
private static final ItemStack largeBladePattern = TConstructRegistry.getItemStack("largeBladePattern");
|
||||
private static final ItemStack hammerHeadPattern = TConstructRegistry.getItemStack("hammerHeadPattern");
|
||||
private static final ItemStack fullGuardPattern = TConstructRegistry.getItemStack("fullGuardPattern");
|
||||
private static final ItemStack arrowHeadPattern = new ItemStack(pattern, 1, 25);
|
||||
private static final ItemStack crossbowBodyPattern = new ItemStack(weaponPattern, 1, 2);
|
||||
private static final ItemStack crossbowLimbPattern = new ItemStack(weaponPattern, 1, 1);
|
||||
private static final ItemStack shurikenPattern = new ItemStack(weaponPattern);
|
||||
|
||||
private static PartHelper _ARROWHEAD = BloodArsenalTinkers.ARROWHEAD;
|
||||
private static PartHelper _AXE_HEAD = BloodArsenalTinkers.AXE_HEAD;
|
||||
private static PartHelper _BATTLE_SIGN_HEAD = BloodArsenalTinkers.BATTLE_SIGN_HEAD;
|
||||
private static PartHelper _BINDING = BloodArsenalTinkers.BINDING;
|
||||
private static PartHelper _BOLT = BloodArsenalTinkers.BOLT;
|
||||
private static PartHelper _BOW_LIMB = BloodArsenalTinkers.BOW_LIMB;
|
||||
private static PartHelper _CHISEL_HEAD = BloodArsenalTinkers.CHISEL_HEAD;
|
||||
private static PartHelper _CHUNK = BloodArsenalTinkers.CHUNK;
|
||||
private static PartHelper _CROSSBAR = BloodArsenalTinkers.CROSSBAR;
|
||||
private static PartHelper _CROSSBOW_BODY = BloodArsenalTinkers.CROSSBOW_BODY;
|
||||
private static PartHelper _CROSSBOW_LIMB = BloodArsenalTinkers.CROSSBOW_LIMB;
|
||||
private static PartHelper _EXCAVATOR_HEAD = BloodArsenalTinkers.EXCAVATOR_HEAD;
|
||||
private static PartHelper _FISHING_ROD = BloodArsenalTinkers.FISHING_ROD;
|
||||
private static PartHelper _FRYPAN_HEAD = BloodArsenalTinkers.FRYPAN_HEAD;
|
||||
private static PartHelper _FULL_GUARD = BloodArsenalTinkers.FULL_GUARD;
|
||||
private static PartHelper _HAMMER_HEAD = BloodArsenalTinkers.HAMMER_HEAD;
|
||||
private static PartHelper _KNIFE_BLADE = BloodArsenalTinkers.KNIFE_BLADE;
|
||||
private static PartHelper _LARGE_GUARD = BloodArsenalTinkers.LARGE_GUARD;
|
||||
private static PartHelper _LARGE_SWORD_BLADE = BloodArsenalTinkers.LARGE_SWORD_BLADE;
|
||||
private static PartHelper _LARGEPLATE = BloodArsenalTinkers.LARGEPLATE;
|
||||
private static PartHelper _LUMBERAXE_HEAD = BloodArsenalTinkers.LUMBERAXE_HEAD;
|
||||
private static PartHelper _MEDIUM_GUARD = BloodArsenalTinkers.MEDIUM_GUARD;
|
||||
private static PartHelper _PICKAXE_HEAD = BloodArsenalTinkers.PICKAXE_HEAD;
|
||||
private static PartHelper _SCYTHE_HEAD = BloodArsenalTinkers.SCYTHE_HEAD;
|
||||
private static PartHelper _SHOVEL_HEAD = BloodArsenalTinkers.SHOVEL_HEAD;
|
||||
private static PartHelper _SHURIKEN = BloodArsenalTinkers.SHURIKEN;
|
||||
private static PartHelper _SWORD_BLADE = BloodArsenalTinkers.SWORD_BLADE;
|
||||
private static PartHelper _TOOLROD = BloodArsenalTinkers.TOOLROD;
|
||||
private static PartHelper _TOUGHBIND = BloodArsenalTinkers.TOUGHBIND;
|
||||
private static PartHelper _TOUGHROD = BloodArsenalTinkers.TOUGHROD;
|
||||
|
||||
public static void addRecipes()
|
||||
{
|
||||
addPartRecipes();
|
||||
addToolRecipes();
|
||||
addCraftingRecipes();
|
||||
}
|
||||
|
||||
public static void addCraftingRecipes() {}
|
||||
|
||||
public static void addPartRecipes()
|
||||
{
|
||||
Item bloodIron = GameRegistry.findItem("BloodArsenal", "blood_infused_iron");
|
||||
|
||||
if (bloodIron != null)
|
||||
{
|
||||
ItemStack _bloodIron = new ItemStack(bloodIron);
|
||||
|
||||
addPartBuilding(250);
|
||||
unregisterMaterial(_bloodIron);
|
||||
registerWithStation(new ItemStack(ModItems.blood_infused_iron, 1), "Blood Infused Iron", 250, new ItemStack(_CHUNK, 1, 250));
|
||||
// registerWithStation("Blood Infused Iron", "Blood Infused Iron", 250);
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerWithStation(String ingotName, String materialName, int materialID)
|
||||
{
|
||||
ArrayList<ItemStack> ingots = OreDictionary.getOres(ingotName);
|
||||
|
||||
if (!ingots.isEmpty())
|
||||
{
|
||||
for (ItemStack ingot : ingots)
|
||||
{
|
||||
registerWithStation(ingot, materialName, materialID, new ItemStack(_CHUNK, 1, materialID));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerWithStation(ItemStack material, String materialName, int materialID, ItemStack chunk)
|
||||
{
|
||||
PatternBuilder.instance.registerFullMaterial(material, 2, materialName, chunk, new ItemStack(_TOOLROD, 1, materialID), materialID);
|
||||
}
|
||||
|
||||
private static void unregisterMaterial(ItemStack material)
|
||||
{
|
||||
List<PatternBuilder.ItemKey> materials = PatternBuilder.instance.materials;
|
||||
|
||||
for (int i = 0; i < materials.size(); i++)
|
||||
{
|
||||
PatternBuilder.ItemKey itemKey = materials.get(i);
|
||||
if ((itemKey.item == material.getItem()) && (material.getItemDamage() == itemKey.damage))
|
||||
{
|
||||
materials.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack getItemStackfromCraftingManager(String itemName)
|
||||
{
|
||||
List list = CraftingManager.getInstance().getRecipeList();
|
||||
|
||||
ItemStack itemStack = null;
|
||||
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
IRecipe recipe = (IRecipe)list.get(i);
|
||||
ItemStack currentItemStack = recipe.getRecipeOutput();
|
||||
if (currentItemStack != null)
|
||||
{
|
||||
Item item = currentItemStack.getItem();
|
||||
if (item != null)
|
||||
{
|
||||
String foundItemName = currentItemStack.getUnlocalizedName();
|
||||
if (foundItemName.equals(itemName))
|
||||
{
|
||||
itemStack = currentItemStack;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
private static void addItemStackPartBuilding(ItemStack pattern, int materialID, ItemStack part)
|
||||
{
|
||||
TConstructRegistry.addPartMapping(pattern.getItem(), pattern.getItemDamage(), materialID, part);
|
||||
}
|
||||
|
||||
private static void addPartBuilding(int materialID)
|
||||
{
|
||||
addItemStackPartBuilding(toolRodPattern, materialID, new ItemStack(_TOOLROD, 1, materialID));
|
||||
addItemStackPartBuilding(pickaxeHeadPattern, materialID, new ItemStack(_PICKAXE_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(shovelHeadPattern, materialID, new ItemStack(_SHOVEL_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(hatchetHeadPattern, materialID, new ItemStack(_AXE_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(swordBladePattern, materialID, new ItemStack(_SWORD_BLADE, 1, materialID));
|
||||
addItemStackPartBuilding(wideGuardPattern, materialID, new ItemStack(_LARGE_GUARD, 1, materialID));
|
||||
addItemStackPartBuilding(handGuardPattern, materialID, new ItemStack(_MEDIUM_GUARD, 1, materialID));
|
||||
addItemStackPartBuilding(crossbarPattern, materialID, new ItemStack(_CROSSBAR, 1, materialID));
|
||||
addItemStackPartBuilding(bindingPattern, materialID, new ItemStack(_BINDING, 1, materialID));
|
||||
addItemStackPartBuilding(frypanHeadPattern, materialID, new ItemStack(_FRYPAN_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(signHeadPattern, materialID, new ItemStack(_BATTLE_SIGN_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(knifeBladePattern, materialID, new ItemStack(_KNIFE_BLADE, 1, materialID));
|
||||
addItemStackPartBuilding(chiselHeadPattern, materialID, new ItemStack(_CHISEL_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(toughRodPattern, materialID, new ItemStack(_TOUGHROD, 1, materialID));
|
||||
addItemStackPartBuilding(toughBindingPattern, materialID, new ItemStack(_TOUGHBIND, 1, materialID));
|
||||
addItemStackPartBuilding(largePlatePattern, materialID, new ItemStack(_LARGEPLATE, 1, materialID));
|
||||
addItemStackPartBuilding(broadAxeHeadPattern, materialID, new ItemStack(_LUMBERAXE_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(scytheHeadPattern, materialID, new ItemStack(_SCYTHE_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(excavatorHeadPattern, materialID, new ItemStack(_EXCAVATOR_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(largeBladePattern, materialID, new ItemStack(_LARGE_SWORD_BLADE, 1, materialID));
|
||||
addItemStackPartBuilding(hammerHeadPattern, materialID, new ItemStack(_HAMMER_HEAD, 1, materialID));
|
||||
addItemStackPartBuilding(fullGuardPattern, materialID, new ItemStack(_FULL_GUARD, 1, materialID));
|
||||
addItemStackPartBuilding(arrowHeadPattern, materialID, new ItemStack(_ARROWHEAD, 1, materialID));
|
||||
addItemStackPartBuilding(crossbowBodyPattern, materialID, new ItemStack(_CROSSBOW_BODY, 1, materialID));
|
||||
addItemStackPartBuilding(crossbowLimbPattern, materialID, new ItemStack(_CROSSBOW_LIMB, 1, materialID));
|
||||
addItemStackPartBuilding(shurikenPattern, materialID, new ItemStack(_SHURIKEN, 1, materialID));
|
||||
}
|
||||
|
||||
public static void addToolRecipes()
|
||||
{
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.battleaxe, _LUMBERAXE_HEAD, _TOUGHROD, _LUMBERAXE_HEAD, _TOUGHBIND);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.battlesign, _BATTLE_SIGN_HEAD, _TOOLROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.broadsword, _SWORD_BLADE, _TOOLROD, _LARGE_GUARD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.chisel, _CHISEL_HEAD, _TOOLROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.cleaver, _LARGE_SWORD_BLADE, _TOUGHROD, _LARGEPLATE, _TOUGHROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.cutlass, _SWORD_BLADE, _TOOLROD, _FULL_GUARD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.dagger, _KNIFE_BLADE, _TOOLROD, _CROSSBAR);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.excavator, _EXCAVATOR_HEAD, _TOUGHROD, _LARGEPLATE, _TOUGHBIND);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.frypan, _FRYPAN_HEAD, _TOOLROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.hammer, _HAMMER_HEAD, _TOUGHROD, _LARGEPLATE, _LARGEPLATE);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.hatchet, _AXE_HEAD, _TOOLROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.longsword, _SWORD_BLADE, _TOOLROD, _MEDIUM_GUARD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.lumberaxe, _LUMBERAXE_HEAD, _TOUGHROD, _LARGEPLATE, _TOUGHBIND);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.mattock, _AXE_HEAD, _TOOLROD, _SHOVEL_HEAD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.pickaxe, _PICKAXE_HEAD, _TOOLROD, _BINDING);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.rapier, _SWORD_BLADE, _TOOLROD, _CROSSBAR);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.scythe, _SCYTHE_HEAD, _TOUGHROD, _TOUGHBIND, _TOUGHROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerTools.shovel, _SHOVEL_HEAD, _TOOLROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.arrowAmmo, _ARROWHEAD, _TOOLROD, TinkerWeaponry.fletching);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.boltAmmo, _BOLT, TinkerWeaponry.fletching);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.crossbow, _TOUGHBIND, _CROSSBOW_LIMB, _CROSSBOW_BODY, TinkerWeaponry.bowstring);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.javelin, _ARROWHEAD, _TOUGHROD, _TOUGHROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.longbow, _BOW_LIMB, _LARGEPLATE, _BOW_LIMB, TinkerWeaponry.bowstring);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.shortbow, _TOOLROD, TinkerWeaponry.bowstring, _TOOLROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.shortbow, TinkerTools.toolRod, TinkerWeaponry.bowstring, _TOOLROD);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.shortbow, _TOOLROD, TinkerWeaponry.bowstring, TinkerTools.toolRod);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.shuriken, _SHURIKEN, _SHURIKEN, _SHURIKEN, _SHURIKEN);
|
||||
TConstructRegistry.addToolRecipe(TinkerWeaponry.throwingknife, _KNIFE_BLADE, _TOOLROD);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.tinkers;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.library.client.FluidRenderProperties;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
|
||||
public class TConCastingRecipe extends CastingRecipe
|
||||
{
|
||||
public TConCastingRecipe(ItemStack replacement, FluidStack metal, ItemStack cast, boolean consume, int delay, FluidRenderProperties props)
|
||||
{
|
||||
super(replacement, metal, cast, consume, delay, props);
|
||||
}
|
||||
|
||||
public TConCastingRecipe(CastingRecipe recipe)
|
||||
{
|
||||
super(recipe.output.copy(), recipe.castingMetal.copy(), recipe.cast.copy(), recipe.consumeCast, recipe.coolTime, recipe.fluidRenderProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(FluidStack metal, ItemStack inputCast)
|
||||
{
|
||||
return (this.castingMetal != null) && (this.castingMetal.isFluidEqual(metal)) && (inputCast != null) && (this.cast != null) && (inputCast.getItem() == this.cast.getItem()) && ((this.cast.getItemDamage() == Short.MAX_VALUE));
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,22 @@
|
||||
package com.arc.bloodarsenal.common.tinkers;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
|
||||
public class TConEvents
|
||||
{
|
||||
/* @SideOnly(Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void handleStich(TextureStitchEvent.Pre event) {
|
||||
if (event.map.getTextureType() != 0) {
|
||||
return;
|
||||
}
|
||||
BloodArsenalTinkers.bloodInfusedIron.setIcons(event.map.registerIcon("TConIntegration.bedrock"));
|
||||
|
||||
TextureAtlasSprite sprite = new TextureBedrockLava("extrautils:bedrockFluid", "lava_still");
|
||||
event.map.setTextureEntry("extrautils:bedrockFluid", sprite);
|
||||
if (BloodArsenalTinkers.bloodInfusedIron != null) {
|
||||
BloodArsenalTinkers.bloodInfusedIron.setIcons(sprite);
|
||||
}
|
||||
sprite = new TextureBedrockLava("extrautils:bedrockFluid_flowing", "lava_flow");
|
||||
if ((event.map.setTextureEntry("extrautils:bedrockFluid_flowing", sprite)) &&
|
||||
(BloodArsenalTinkers.bloodInfusedIron != null)) {
|
||||
BloodArsenalTinkers.bloodInfusedIron.setFlowingIcon(sprite);
|
||||
public void handleStich(TextureStitchEvent.Pre event)
|
||||
{
|
||||
if (event.map.getTextureType() == 0)
|
||||
{
|
||||
if (BloodArsenalTinkers.bloodInfusedIronFluid != null)
|
||||
{
|
||||
BloodArsenalTinkers.bloodInfusedIronFluid.setIcons(event.map.registerIcon("BloodArsenal:molten_blood_infused_iron_still"), event.map.registerIcon("BloodArsenal:molten_blood_infused_iron_flow"));
|
||||
}
|
||||
}
|
||||
}
|
||||
*/}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.tinkers;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.data.AnimationMetadataSection;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DirectColorModel;
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class TextureDerived extends TextureAtlasSprite
|
||||
{
|
||||
private final String baseIcon;
|
||||
private final String basePath;
|
||||
private final TextureMapType type;
|
||||
|
||||
public static enum TextureMapType
|
||||
{
|
||||
BLOCK(0, "textures/blocks"), ITEM(1, "textures/items");
|
||||
|
||||
public final int textureMapType;
|
||||
public final String basePath;
|
||||
|
||||
private TextureMapType(int textureMapType, String basePath)
|
||||
{
|
||||
this.textureMapType = textureMapType;
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
public TextureDerived(String p_i1282_1_, String baseIcon, TextureMapType type)
|
||||
{
|
||||
super(p_i1282_1_);
|
||||
this.baseIcon = baseIcon;
|
||||
this.type = type;
|
||||
this.basePath = type.basePath;
|
||||
}
|
||||
|
||||
public static DirectColorModel rgbBase = new DirectColorModel(32, 16711680, 65280, 255, -16777216);
|
||||
protected DirectColorModel rgb = rgbBase;
|
||||
|
||||
public int getLuminosity(int col)
|
||||
{
|
||||
return getLuminosity(this.rgb.getRed(col), this.rgb.getGreen(col), this.rgb.getBlue(col));
|
||||
}
|
||||
|
||||
public int getLuminosity(int r, int g, int b)
|
||||
{
|
||||
return (int)(r * 0.2126F + g * 0.7152F + b * 0.0722F);
|
||||
}
|
||||
|
||||
public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract BufferedImage processImage(BufferedImage paramBufferedImage, AnimationMetadataSection paramAnimationMetadataSection);
|
||||
|
||||
public boolean load(IResourceManager manager, ResourceLocation oldlocation)
|
||||
{
|
||||
ResourceLocation location = new ResourceLocation(this.baseIcon);
|
||||
location = completeResourceLocation(location);
|
||||
try
|
||||
{
|
||||
int mipmapLevels = Minecraft.getMinecraft().gameSettings.mipmapLevels;
|
||||
int anisotropicFiltering = Minecraft.getMinecraft().gameSettings.anisotropicFiltering;
|
||||
IResource iresource = manager.getResource(location);
|
||||
BufferedImage[] abufferedimage = new BufferedImage[1 + mipmapLevels];
|
||||
abufferedimage[0] = ImageIO.read(iresource.getInputStream());
|
||||
AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)iresource.getMetadata("animation");
|
||||
abufferedimage[0] = processImage(abufferedimage[0], animationmetadatasection);
|
||||
loadSprite(abufferedimage, animationmetadatasection, anisotropicFiltering > 1.0F);
|
||||
}
|
||||
catch (RuntimeException runtimeexception)
|
||||
{
|
||||
FMLClientHandler.instance().trackBrokenTexture(location, runtimeexception.getMessage());
|
||||
return true;
|
||||
}
|
||||
catch (IOException ioexception1)
|
||||
{
|
||||
FMLClientHandler.instance().trackMissingTexture(location);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private ResourceLocation completeResourceLocation(ResourceLocation p_147634_1_)
|
||||
{
|
||||
return new ResourceLocation(p_147634_1_.getResourceDomain(), String.format("%s/%s%s", new Object[] { this.basePath, p_147634_1_.getResourcePath(), ".png" }));
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.arc.bloodarsenal.common.tinkers;
|
||||
|
||||
public abstract class TextureLiquidLava extends TextureDerived
|
||||
{
|
||||
public TextureLiquidLava(String p_i1282_1_, String baseIcon)
|
||||
{
|
||||
super(p_i1282_1_, baseIcon, TextureDerived.TextureMapType.BLOCK);
|
||||
}
|
||||
/*
|
||||
public BufferedImage processImage(BufferedImage image, AnimationMetadataSection animationmetadatasection)
|
||||
{
|
||||
int w = image.getWidth();
|
||||
int h = image.getHeight();
|
||||
|
||||
int[] pixels = new int[h * w];
|
||||
image.getRGB(0, 0, w, h, pixels, 0, w);
|
||||
|
||||
double mean = 0.0D;
|
||||
for (int i = 0; i < pixels.length; i++)
|
||||
{
|
||||
pixels[i] = getLuminosity(pixels[i]);
|
||||
mean += pixels[i];
|
||||
}
|
||||
mean /= pixels.length;
|
||||
|
||||
BufferedImage bedrockImage = TextureResourcePackBloodInfusedIron.getBedrockImage();
|
||||
for (int i = 0; i < pixels.length; i++)
|
||||
{
|
||||
int x = i % w;
|
||||
int y = (i - x) / w % w;
|
||||
int sn = (i - x) / w / w;
|
||||
|
||||
int dx = x * bedrockImage.getWidth() / w;
|
||||
int dy = y * bedrockImage.getHeight() / w;
|
||||
|
||||
int col = bedrockImage.getRGB(dx, dy);
|
||||
|
||||
double f = pixels[i] / mean;
|
||||
|
||||
int r = clamp(this.rgb.getRed(col) * f);
|
||||
int g = clamp(this.rgb.getGreen(col) * f);
|
||||
int b = clamp(this.rgb.getBlue(col) * f);
|
||||
|
||||
pixels[i] = (0xFF000000 | r << 16 | g << 8 | b);
|
||||
}
|
||||
image.setRGB(0, 0, w, h, pixels, 0, w);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
private int clamp(double v)
|
||||
{
|
||||
return MathHelper.func_76125_a((int) v, 0, 255);
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.arc.bloodarsenal.common.tinkers;
|
||||
|
||||
import amerifrance.guideapi.util.LogHelper;
|
||||
import com.arc.bloodarsenal.common.BloodArsenal;
|
||||
import com.google.common.base.Throwables;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
@@ -17,19 +17,16 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
public abstract class TextureResourcePackBase implements IResourcePack, IResourceManagerReloadListener
|
||||
{
|
||||
public static List<IResourcePack> packs;
|
||||
protected static DirectColorModel rgb = new DirectColorModel(32, 16711680, 65280, 255, -16777216);
|
||||
protected static DirectColorModel rgb = new DirectColorModel(32, 16711680, '\uff00', 255, -16777216);
|
||||
protected final String name;
|
||||
public HashMap<ResourceLocation, byte[]> cachedImages = new HashMap();
|
||||
protected IResourcePack delegate;
|
||||
protected List<IResourcePack> resourcePacks = null;
|
||||
protected List<IResourcePack> resourcePackz = null;
|
||||
|
||||
public TextureResourcePackBase(String name)
|
||||
{
|
||||
@@ -37,172 +34,168 @@ public abstract class TextureResourcePackBase implements IResourcePack, IResourc
|
||||
this.delegate = FMLClientHandler.instance().getResourcePackFor("TConstruct");
|
||||
}
|
||||
|
||||
public int brightness(int col)
|
||||
{
|
||||
return brightness(rgb.getRed(col), rgb.getGreen(col), rgb.getBlue(col));
|
||||
public int brightness(int col) {
|
||||
return this.brightness(rgb.getRed(col), rgb.getGreen(col), rgb.getBlue(col));
|
||||
}
|
||||
|
||||
public int brightness(int r, int g, int b)
|
||||
{
|
||||
return (int)(r * 0.2126F + g * 0.7152F + b * 0.0722F);
|
||||
return (int)((float)r * 0.2126F + (float)g * 0.7152F + (float)b * 0.0722F);
|
||||
}
|
||||
|
||||
public void register()
|
||||
{
|
||||
List<IResourcePack> packs = getResourcePacks();
|
||||
List packs = this.getiResourcePacks();
|
||||
packs.add(this);
|
||||
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(this);
|
||||
LogHelper.info("Registered TConstruct Resource Pack (" + this.name + ") - " + getClass().getSimpleName());
|
||||
((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener(this);
|
||||
BloodArsenal.logger.info("Registered TCon Resource Pack (" + this.name + ") - " + this.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
public List<IResourcePack> getResourcePacks()
|
||||
public List<IResourcePack> getiResourcePacks()
|
||||
{
|
||||
List<IResourcePack> packs1 = packs;
|
||||
if (packs1 == null) {
|
||||
packs1 = ObfuscationReflectionHelper.getPrivateValue(FMLClientHandler.class, FMLClientHandler.instance(), new String[]{"resourcePackList"});
|
||||
List packs1 = packs;
|
||||
if(packs1 == null)
|
||||
{
|
||||
packs1 = (List)ObfuscationReflectionHelper.getPrivateValue(FMLClientHandler.class, FMLClientHandler.instance(), new String[]{"resourcePackList"});
|
||||
}
|
||||
|
||||
return packs1;
|
||||
}
|
||||
|
||||
public InputStream getStream(ResourceLocation location)
|
||||
{
|
||||
InputStream stream = null;
|
||||
Iterator i$ = this.getPacks().iterator();
|
||||
|
||||
for (IResourcePack iResourcePack : getPacks())
|
||||
while(i$.hasNext())
|
||||
{
|
||||
if (iResourcePack.resourceExists(location))
|
||||
IResourcePack iResourcePack = (IResourcePack)i$.next();
|
||||
if(iResourcePack.resourceExists(location))
|
||||
{
|
||||
try
|
||||
{
|
||||
stream = iResourcePack.getInputStream(location);
|
||||
}
|
||||
catch (IOException ignore) {}
|
||||
catch (IOException var6) {}
|
||||
}
|
||||
}
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
public List<IResourcePack> getPacks()
|
||||
{
|
||||
if (this.resourcePacks == null)
|
||||
if(this.resourcePackz == null)
|
||||
{
|
||||
this.resourcePacks = new ArrayList();
|
||||
this.resourcePacks.add(this.delegate);
|
||||
List<ResourcePackRepository.Entry> t = Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntriesAll();
|
||||
for (ResourcePackRepository.Entry entry : t)
|
||||
this.resourcePackz = new ArrayList();
|
||||
this.resourcePackz.add(this.delegate);
|
||||
List t = Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries();
|
||||
Iterator i$ = t.iterator();
|
||||
|
||||
while(i$.hasNext())
|
||||
{
|
||||
ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)i$.next();
|
||||
IResourcePack resourcePack = entry.getResourcePack();
|
||||
if (resourcePack.getPackName().contains("tinker"))
|
||||
if(resourcePack.getResourceDomains().contains("tinker"))
|
||||
{
|
||||
this.resourcePacks.add(resourcePack);
|
||||
this.resourcePackz.add(resourcePack);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.resourcePacks;
|
||||
|
||||
return this.resourcePackz;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException
|
||||
{
|
||||
byte[] bytes = this.cachedImages.get(p_110590_1_);
|
||||
if (bytes == null)
|
||||
byte[] bytes = (byte[])this.cachedImages.get(p_110590_1_);
|
||||
if(bytes == null)
|
||||
{
|
||||
ResourceLocation location = new ResourceLocation("tinker", p_110590_1_.getResourceDomain().replace(this.name, ""));
|
||||
InputStream inputStream = getStream(location);
|
||||
if (inputStream == null)
|
||||
ResourceLocation location = new ResourceLocation("tinker", p_110590_1_.getResourcePath().replace(this.name, ""));
|
||||
InputStream inputStream = this.getStream(location);
|
||||
if(inputStream == null)
|
||||
{
|
||||
location = new ResourceLocation("tinker", p_110590_1_.getResourceDomain().replace(this.name, "iron"));
|
||||
inputStream = getStream(location);
|
||||
location = new ResourceLocation("tinker", p_110590_1_.getResourcePath().replace(this.name, "iron"));
|
||||
inputStream = this.getStream(location);
|
||||
}
|
||||
if (inputStream == null)
|
||||
|
||||
if(inputStream == null)
|
||||
{
|
||||
location = new ResourceLocation("tinker", p_110590_1_.getResourceDomain().replace(this.name, "stone"));
|
||||
inputStream = getStream(location);
|
||||
location = new ResourceLocation("tinker", p_110590_1_.getResourcePath().replace(this.name, "stone"));
|
||||
inputStream = this.getStream(location);
|
||||
}
|
||||
if (inputStream == null)
|
||||
|
||||
if(inputStream == null)
|
||||
{
|
||||
return this.delegate.getInputStream(p_110590_1_);
|
||||
}
|
||||
|
||||
BufferedImage bufferedimage;
|
||||
try
|
||||
{
|
||||
bufferedimage = ImageIO.read(inputStream);
|
||||
}
|
||||
catch (IOException err)
|
||||
catch (IOException var9)
|
||||
{
|
||||
throw Throwables.propagate(err);
|
||||
throw Throwables.propagate(var9);
|
||||
}
|
||||
|
||||
BufferedImage image;
|
||||
try
|
||||
{
|
||||
image = modifyImage(bufferedimage);
|
||||
image = this.modifyImage(bufferedimage);
|
||||
}
|
||||
catch (Throwable t)
|
||||
catch (Throwable var8)
|
||||
{
|
||||
t.printStackTrace();
|
||||
var8.printStackTrace();
|
||||
return this.delegate.getInputStream(location);
|
||||
}
|
||||
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
ImageIO.write(image, "PNG", stream);
|
||||
bytes = stream.toByteArray();
|
||||
this.cachedImages.put(location, bytes);
|
||||
}
|
||||
|
||||
return new ByteArrayInputStream(bytes);
|
||||
}
|
||||
|
||||
public abstract BufferedImage modifyImage(BufferedImage paramBufferedImage);
|
||||
public abstract BufferedImage modifyImage(BufferedImage var1);
|
||||
|
||||
@Override
|
||||
public boolean resourceExists(ResourceLocation p_110589_1_)
|
||||
{
|
||||
if (!"tinker".equals(p_110589_1_.getResourceDomain()))
|
||||
if(!"tinker".equals(p_110589_1_.getResourceDomain()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
String resourcePath = p_110589_1_.getResourcePath();
|
||||
if ((!resourcePath.startsWith("textures/items/")) || (!resourcePath.endsWith(".png")))
|
||||
else
|
||||
{
|
||||
return false;
|
||||
String resourcePath = p_110589_1_.getResourcePath();
|
||||
return resourcePath.startsWith("textures/items/") && resourcePath.endsWith(".png")?(this.delegate.resourceExists(p_110589_1_)?false:(!resourcePath.contains(this.name)?false:this.delegate.resourceExists(new ResourceLocation("tinker", resourcePath.replace(this.name, "stone"))) || this.delegate.resourceExists(new ResourceLocation("tinker", resourcePath.replace(this.name, "iron"))) || this.delegate.resourceExists(new ResourceLocation("tinker", resourcePath.replace(this.name, ""))))):false;
|
||||
}
|
||||
if (this.delegate.resourceExists(p_110589_1_))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!resourcePath.contains(this.name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return (this.delegate.resourceExists(new ResourceLocation("tinker", resourcePath.replace(this.name, "stone")))) || (this.delegate.resourceExists(new ResourceLocation("tinker", resourcePath.replace(this.name, "iron")))) || (this.delegate.resourceExists(new ResourceLocation("tinker", resourcePath.replace(this.name, ""))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set getResourceDomains()
|
||||
{
|
||||
public Set getResourceDomains() {
|
||||
return this.delegate.getResourceDomains();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedImage getPackImage() throws IOException
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPackName()
|
||||
{
|
||||
public String getPackName() {
|
||||
return "BA_Delegate_Pack";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager p_110549_1_)
|
||||
{
|
||||
this.cachedImages.clear();
|
||||
this.resourcePacks = null;
|
||||
this.resourcePackz = null;
|
||||
}
|
||||
}
|
||||
+154
-161
@@ -6,6 +6,8 @@ import java.awt.image.BufferedImage;
|
||||
|
||||
public class TextureResourcePackBloodInfusedIron extends TextureResourcePackBase
|
||||
{
|
||||
static int[][] offsets = new int[][]{{0, 1}, {1, 1}, {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}};
|
||||
|
||||
public TextureResourcePackBloodInfusedIron(String name)
|
||||
{
|
||||
super(name);
|
||||
@@ -15,344 +17,335 @@ public class TextureResourcePackBloodInfusedIron extends TextureResourcePackBase
|
||||
{
|
||||
int w = image.getWidth();
|
||||
int h = image.getHeight();
|
||||
|
||||
image.getType();
|
||||
|
||||
int[][] pixels = new int[w][h];
|
||||
int[][] base = new int[w][h];
|
||||
|
||||
boolean[][] base = new boolean[w][h];
|
||||
int mean = 0;
|
||||
int div = 0;
|
||||
for (int x = 0; x < w; x++)
|
||||
|
||||
for(int n = 0; n < w; ++n)
|
||||
{
|
||||
for (int y = 0; y < h; y++)
|
||||
for(int baseSilhouette = 0; baseSilhouette < h; ++baseSilhouette)
|
||||
{
|
||||
int c = image.getRGB(x, y);
|
||||
pixels[x][y] = brightness(c);
|
||||
boolean nottrans = (c != 0) && (rgb.getAlpha(c) > 64);
|
||||
if (nottrans)
|
||||
int interior1 = image.getRGB(n, baseSilhouette);
|
||||
pixels[n][baseSilhouette] = this.brightness(interior1);
|
||||
boolean baseCorners = interior1 != 0 && rgb.getAlpha(interior1) > 64;
|
||||
if(baseCorners)
|
||||
{
|
||||
base[x][y] = 1;
|
||||
mean += pixels[x][y];
|
||||
div++;
|
||||
base[n][baseSilhouette] = true;
|
||||
mean += pixels[n][baseSilhouette];
|
||||
++div;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mean = mean / div * 2 / 4;
|
||||
int n;
|
||||
if (w >= 256)
|
||||
byte var26;
|
||||
if(w >= 256)
|
||||
{
|
||||
n = 5;
|
||||
var26 = 5;
|
||||
}
|
||||
else if(w >= 128)
|
||||
{
|
||||
var26 = 4;
|
||||
}
|
||||
else if(w >= 64)
|
||||
{
|
||||
var26 = 3;
|
||||
}
|
||||
else if(w >= 32)
|
||||
{
|
||||
var26 = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (w >= 128)
|
||||
{
|
||||
n = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (w >= 64)
|
||||
{
|
||||
n = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (w >= 32)
|
||||
{
|
||||
n = 2;
|
||||
} else
|
||||
{
|
||||
n = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
var26 = 1;
|
||||
}
|
||||
int[][] baseSilhouette = contract(base, n);
|
||||
|
||||
int[][] interior1 = contract(baseSilhouette, n);
|
||||
|
||||
int[][] baseCorners = multI(mult(expand(getCorners(baseSilhouette), n), baseSilhouette), interior1);
|
||||
int[][] baseCornersShift = orwise(orwise(shift(baseCorners, 0, -1), shift(baseCorners, -1, 0)), shift(baseCorners, -1, -1));
|
||||
|
||||
int[][] interior2 = contract(interior1, 2 * n);
|
||||
|
||||
int[][] interior3 = contract(interior2, n);
|
||||
int[][] interior4 = contract(interior3, n);
|
||||
|
||||
int[][] interiorCorners = multI(mult(expand(getCorners(interior2), n), interior2), interior3);
|
||||
int[][] interiorCornersShift = orwise(orwise(shift(interiorCorners, -1, 0), shift(interiorCorners, 0, -1)), shift(interiorCorners, -1, -1));
|
||||
|
||||
int trans = 0;
|
||||
int gold = -398001;
|
||||
int gold_highlight = -117;
|
||||
int wood = -6455217;
|
||||
int darkwood = -10071758;
|
||||
|
||||
boolean[][] var27 = this.contract(base, var26);
|
||||
boolean[][] var28 = this.contract(var27, var26);
|
||||
boolean[][] interior2 = this.contract(var28, 2 * var26);
|
||||
boolean[][] interior3 = this.contract(interior2, var26);
|
||||
boolean[][] interior4 = this.contract(interior3, var26);
|
||||
boolean[][] interiorCorners = this.multI(this.mult(this.expand(this.getCorners(interior2), var26), interior2), interior3);
|
||||
boolean[][] interiorCornersShift = this.orwise(this.orwise(this.shift(interiorCorners, -1, 0), this.shift(interiorCorners, 0, -1)), this.shift(interiorCorners, -1, -1));
|
||||
byte trans = 0;
|
||||
int red = 16752029;
|
||||
int pink_highlight = 16752029;
|
||||
int iron = 16752029;
|
||||
int darkiron = 13592423;
|
||||
int[][] outpixels = new int[w][w];
|
||||
for (int x = 0; x < w; x++)
|
||||
|
||||
for(int x = 0; x < w; ++x)
|
||||
{
|
||||
for (int y = 0; y < h; y++)
|
||||
for(int y = 0; y < h; ++y)
|
||||
{
|
||||
if (baseSilhouette[x][y] == 0)
|
||||
if(!var27[x][y])
|
||||
{
|
||||
if (base[x][y] != 0)
|
||||
if(base[x][y])
|
||||
{
|
||||
outpixels[x][y] = multPixel(darkwood, pixels[x][y] / 2);
|
||||
outpixels[x][y] = this.multPixel(darkiron, pixels[x][y] / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
outpixels[x][y] = trans;
|
||||
}
|
||||
}
|
||||
else if (interior1[x][y] == 0)
|
||||
else if(interior2[x][y] && !interior3[x][y])
|
||||
{
|
||||
if (baseCorners[x][y] != 0)
|
||||
if(interiorCorners[x][y])
|
||||
{
|
||||
if (baseCornersShift[x][y] != 0)
|
||||
if(interiorCornersShift[x][y])
|
||||
{
|
||||
outpixels[x][y] = multPixel(gold, Math.max(pixels[x][y], mean));
|
||||
outpixels[x][y] = this.multPixel(red, Math.max(pixels[x][y], mean));
|
||||
}
|
||||
else
|
||||
{
|
||||
outpixels[x][y] = multPixel(gold_highlight, Math.max(pixels[x][y], mean) + 5);
|
||||
outpixels[x][y] = this.multPixel(pink_highlight, Math.max(pixels[x][y], mean) + 5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outpixels[x][y] = multPixel(darkwood, pixels[x][y]);
|
||||
}
|
||||
}
|
||||
else if ((interior2[x][y] == 0) || (interior3[x][y] != 0))
|
||||
{
|
||||
if ((interior3[x][y] != 0) && (interior4[x][y] == 0))
|
||||
{
|
||||
outpixels[x][y] = multPixel(wood, pixels[x][y] * 3 / 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
outpixels[x][y] = multPixel(wood, pixels[x][y]);
|
||||
}
|
||||
}
|
||||
else if (interiorCorners[x][y] != 0)
|
||||
{
|
||||
if (interiorCornersShift[x][y] != 0)
|
||||
{
|
||||
outpixels[x][y] = multPixel(gold, Math.max(pixels[x][y], mean));
|
||||
}
|
||||
else
|
||||
{
|
||||
outpixels[x][y] = multPixel(gold_highlight, Math.max(pixels[x][y], mean) + 5);
|
||||
outpixels[x][y] = this.multPixel(red, pixels[x][y]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outpixels[x][y] = multPixel(darkwood, pixels[x][y]);
|
||||
outpixels[x][y] = this.multPixel(iron, pixels[x][y]);
|
||||
}
|
||||
|
||||
image.setRGB(x, y, outpixels[x][y]);
|
||||
}
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
private int[][] orwise(int[][] a, int[][] b)
|
||||
private boolean[][] orwise(boolean[][] a, boolean[][] b)
|
||||
{
|
||||
for (int i = 0; i < a.length; i++)
|
||||
for(int i = 0; i < a.length; ++i)
|
||||
{
|
||||
for (int j = 0; j < a[i].length; j++)
|
||||
for(int j = 0; j < a[i].length; ++j)
|
||||
{
|
||||
a[i][j] |= b[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
private int[][] mult(int[][] a, int[][] b)
|
||||
private boolean[][] mult(boolean[][] a, boolean[][] b)
|
||||
{
|
||||
for (int i = 0; i < a.length; i++)
|
||||
for(int i = 0; i < a.length; ++i)
|
||||
{
|
||||
for (int j = 0; j < a[i].length; j++)
|
||||
for(int j = 0; j < a[i].length; ++j)
|
||||
{
|
||||
a[i][j] &= b[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
private int[][] multI(int[][] a, int[][] b)
|
||||
private boolean[][] multI(boolean[][] a, boolean[][] b)
|
||||
{
|
||||
for (int i = 0; i < a.length; i++)
|
||||
for(int i = 0; i < a.length; ++i)
|
||||
{
|
||||
for (int j = 0; j < a[i].length; j++)
|
||||
for(int j = 0; j < a[i].length; ++j)
|
||||
{
|
||||
a[i][j] &= (b[i][j] == 0 ? 1 : 0);
|
||||
a[i][j] &= !b[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
private int[][] expand(int[][] base, int n)
|
||||
private boolean[][] expand(boolean[][] base, int n)
|
||||
{
|
||||
int[][] output = expand(base);
|
||||
for (int i = 0; i < n - 1; i++)
|
||||
boolean[][] output = this.expand(base);
|
||||
|
||||
for(int i = 0; i < n - 1; ++i)
|
||||
{
|
||||
output = expand(output);
|
||||
output = this.expand(output);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
private int[][] contract(int[][] base, int n)
|
||||
private boolean[][] contract(boolean[][] base, int n)
|
||||
{
|
||||
int[][] output = contract(base);
|
||||
for (int i = 0; i < n - 1; i++)
|
||||
boolean[][] output = this.contract(base);
|
||||
|
||||
for(int i = 0; i < n - 1; ++i)
|
||||
{
|
||||
output = contract(output);
|
||||
output = this.contract(output);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
public int multPixel(int col, int b)
|
||||
{
|
||||
return 0xFF000000 | clamp(rgb.getRed(col) * b / 255) << 16 | clamp(rgb.getGreen(col) * b / 255) << 8 | clamp(rgb.getBlue(col) * b / 255);
|
||||
return -16777216 | this.clamp(rgb.getRed(col) * b / 255) << 16 | this.clamp(rgb.getGreen(col) * b / 255) << 8 | this.clamp(rgb.getBlue(col) * b / 255);
|
||||
}
|
||||
|
||||
private int clamp(int i)
|
||||
{
|
||||
private int clamp(int i) {
|
||||
return MathHelper.clamp_int(i, 0, 255);
|
||||
}
|
||||
|
||||
public boolean get(int[][] img, int x, int y)
|
||||
public boolean get(boolean[][] img, int x, int y)
|
||||
{
|
||||
return (x >= 0) && (y >= 0) && (x < img.length) && (y < img[x].length) && (img[x][y] != 0);
|
||||
return x >= 0 && y >= 0 && x < img.length && y < img[x].length && img[x][y];
|
||||
}
|
||||
|
||||
static int[][] offsets = { { 0, 1 }, { 1, 1 }, { 1, 0 }, { 1, -1 }, { 0, -1 }, { -1, -1 }, { -1, 0 }, { -1, 1 } };
|
||||
|
||||
public int[][] shift(int[][] img, int dx, int dy)
|
||||
public boolean[][] shift(boolean[][] img, int dx, int dy)
|
||||
{
|
||||
int w = img.length;
|
||||
int[][] img2 = new int[w][w];
|
||||
for (int x = Math.max(-dx, 0); x < Math.min(w, w + dx); x++)
|
||||
boolean[][] img2 = new boolean[w][w];
|
||||
|
||||
for(int x = Math.max(-dx, 0); x < Math.min(w, w + dx); ++x)
|
||||
{
|
||||
System.arraycopy(img[(x + dx)], Math.max(-dy, 0) + dy, img2[x], Math.max(-dy, 0), Math.min(w, w + dy) - Math.max(-dy, 0));
|
||||
System.arraycopy(img[x + dx], Math.max(-dy, 0) + dy, img2[x], Math.max(-dy, 0), Math.min(w, w + dy) - Math.max(-dy, 0));
|
||||
}
|
||||
|
||||
return img2;
|
||||
}
|
||||
|
||||
public int[][] getCorners(int[][] img)
|
||||
public boolean[][] getCorners(boolean[][] img)
|
||||
{
|
||||
int w = img.length;
|
||||
int[][] img2 = new int[w][w];
|
||||
for (int x = 0; x < w; x++)
|
||||
boolean[][] img2 = new boolean[w][w];
|
||||
|
||||
for(int x = 0; x < w; ++x)
|
||||
{
|
||||
for (int y = 0; y < w; y++)
|
||||
for(int y = 0; y < w; ++y)
|
||||
{
|
||||
if (img[x][y] != 0)
|
||||
{
|
||||
if(img[x][y]) {
|
||||
int an = -1;
|
||||
int n = 0;
|
||||
for (int[] offset : offsets)
|
||||
int[][] arr$ = offsets;
|
||||
int len$ = arr$.length;
|
||||
|
||||
for(int i$ = 0; i$ < len$; ++i$)
|
||||
{
|
||||
if (get(img, x + offset[0], y + offset[1]))
|
||||
int[] offset = arr$[i$];
|
||||
if(this.get(img, x + offset[0], y + offset[1]))
|
||||
{
|
||||
if (an == -1)
|
||||
if(an == -1)
|
||||
{
|
||||
an = n;
|
||||
}
|
||||
|
||||
n = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
n++;
|
||||
if (n == 5)
|
||||
++n;
|
||||
if(n == 5)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (an != -1)
|
||||
|
||||
if(an != -1)
|
||||
{
|
||||
n += an;
|
||||
}
|
||||
if (n >= 5)
|
||||
|
||||
if(n >= 5)
|
||||
{
|
||||
img2[x][y] = 1;
|
||||
img2[x][y] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return img2;
|
||||
}
|
||||
|
||||
public int[][] contract(int[][] img)
|
||||
public boolean[][] contract(boolean[][] img)
|
||||
{
|
||||
int w = img.length;
|
||||
int[][] img2 = new int[w][w];
|
||||
for (int x = 0; x < w; x++)
|
||||
boolean[][] img2 = new boolean[w][w];
|
||||
|
||||
int x;
|
||||
for(x = 0; x < w; ++x)
|
||||
{
|
||||
System.arraycopy(img[x], 0, img2[x], 0, w);
|
||||
}
|
||||
for (int x = 0; x < w; x++)
|
||||
|
||||
for(x = 0; x < w; ++x)
|
||||
{
|
||||
for (int y = 0; y < w; y++)
|
||||
for(int y = 0; y < w; ++y)
|
||||
{
|
||||
if (img[x][y] != 0)
|
||||
if(img[x][y])
|
||||
{
|
||||
if ((x == 0) || (y == 0) || (x == w - 1) || (y == w - 1))
|
||||
{
|
||||
img2[x][y] = 0;
|
||||
if(x == 0 || y == 0 || x == w - 1 || y == w - 1) {
|
||||
img2[x][y] = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x > 0)
|
||||
if(x > 0)
|
||||
{
|
||||
img2[(x - 1)][y] = 0;
|
||||
img2[x - 1][y] = false;
|
||||
}
|
||||
if (y > 0)
|
||||
|
||||
if(y > 0)
|
||||
{
|
||||
img2[x][(y - 1)] = 0;
|
||||
img2[x][y - 1] = false;
|
||||
}
|
||||
if (x < w - 1)
|
||||
|
||||
if(x < w - 1)
|
||||
{
|
||||
img2[(x + 1)][y] = 0;
|
||||
img2[x + 1][y] = false;
|
||||
}
|
||||
if (y < w - 1)
|
||||
|
||||
if(y < w - 1)
|
||||
{
|
||||
img2[x][(y + 1)] = 0;
|
||||
img2[x][y + 1] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return img2;
|
||||
}
|
||||
|
||||
public int[][] expand(int[][] img)
|
||||
public boolean[][] expand(boolean[][] img)
|
||||
{
|
||||
int w = img.length;
|
||||
int[][] img2 = new int[w][w];
|
||||
for (int x = 0; x < w; x++)
|
||||
boolean[][] img2 = new boolean[w][w];
|
||||
|
||||
int x;
|
||||
for(x = 0; x < w; ++x)
|
||||
{
|
||||
System.arraycopy(img[x], 0, img2[x], 0, w);
|
||||
}
|
||||
for (int x = 0; x < w; x++)
|
||||
|
||||
for(x = 0; x < w; ++x)
|
||||
{
|
||||
for (int y = 0; y < w; y++)
|
||||
for(int y = 0; y < w; ++y)
|
||||
{
|
||||
if (img[x][y] != 0)
|
||||
{
|
||||
for (int[] offset : offsets)
|
||||
if(img[x][y]) {
|
||||
int[][] arr$ = offsets;
|
||||
int len$ = arr$.length;
|
||||
|
||||
for(int i$ = 0; i$ < len$; ++i$)
|
||||
{
|
||||
int[] offset = arr$[i$];
|
||||
int dx = x + offset[0];
|
||||
int dy = y + offset[1];
|
||||
if ((dx >= 0) && (dy >= 0) && (dx < w) && (dy < w))
|
||||
if(dx >= 0 && dy >= 0 && dx < w && dy < w)
|
||||
{
|
||||
img2[dx][dy] = 1;
|
||||
img2[dx][dy] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return img2;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user