Frozen Dungeon updates
@ -0,0 +1,7 @@
|
|||||||
|
package com.zivilon.cinder_loe;
|
||||||
|
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
|
||||||
|
public class LoEDamage {
|
||||||
|
public static DamageSource shadow = (new DamageSource("cinder_loe.shadow")).setDamageBypassesArmor().setMagicDamage();
|
||||||
|
}
|
||||||
@ -0,0 +1,279 @@
|
|||||||
|
package com.zivilon.cinder_loe.blocks;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.CinderLoE;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
import com.zivilon.cinder_loe.items.NimveilPart;
|
||||||
|
import com.zivilon.cinder_loe.items.Nimveil;
|
||||||
|
import com.zivilon.cinder_loe.recipe.ForgingRecipe;
|
||||||
|
import com.zivilon.cinder_loe.recipe.ForgingRecipes;
|
||||||
|
import com.zivilon.cinder_loe.tileentity.TileEntityForgingStation;
|
||||||
|
|
||||||
|
import lotr.common.item.LOTRItemHammer;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ForgingStation extends BlockContainer {
|
||||||
|
|
||||||
|
public ForgingStation() {
|
||||||
|
super(Material.anvil);
|
||||||
|
setHardness(10.0F);
|
||||||
|
setResistance(10.0F);
|
||||||
|
setBlockName("forging_station");
|
||||||
|
setCreativeTab(LoECreativeTabs.tabDecoLoE);
|
||||||
|
setBlockBounds(0, 0, 0, 1, 1, 1); // Set the block bounds to cover 1x1x1 for each individual part
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType() {
|
||||||
|
return -1; // Use custom renderer
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int meta) {
|
||||||
|
return new TileEntityForgingStation();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack) {
|
||||||
|
int direction = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||||
|
|
||||||
|
// Middle part (placed block)
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, (direction << 2) | 1, 2);
|
||||||
|
|
||||||
|
// Right and right parts based on orientation
|
||||||
|
if (direction == 0) { // South
|
||||||
|
world.setBlock(x - 1, y, z, this, (direction << 2) | 0, 2); // Right part
|
||||||
|
world.setBlock(x + 1, y, z, this, (direction << 2) | 2, 2); // Left part
|
||||||
|
} else if (direction == 1) { // West
|
||||||
|
world.setBlock(x, y, z - 1, this, (direction << 2) | 0, 2); // Right part
|
||||||
|
world.setBlock(x, y, z + 1, this, (direction << 2) | 2, 2); // Left part
|
||||||
|
} else if (direction == 2) { // North
|
||||||
|
world.setBlock(x + 1, y, z, this, (direction << 2) | 0, 2); // Right part
|
||||||
|
world.setBlock(x - 1, y, z, this, (direction << 2) | 2, 2); // Left part
|
||||||
|
} else if (direction == 3) { // East
|
||||||
|
world.setBlock(x, y, z + 1, this, (direction << 2) | 0, 2); // Right part
|
||||||
|
world.setBlock(x, y, z - 1, this, (direction << 2) | 2, 2); // Left part
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||||
|
int direction = meta >> 2;
|
||||||
|
int part = meta & 3;
|
||||||
|
|
||||||
|
if (direction == 0) { // South
|
||||||
|
if (part == 1) { // Middle
|
||||||
|
world.setBlockToAir(x - 1, y, z); // Right part
|
||||||
|
world.setBlockToAir(x + 1, y, z); // Left part
|
||||||
|
} else if (part == 0) { // Right
|
||||||
|
world.setBlockToAir(x + 1, y, z); // Middle part
|
||||||
|
world.setBlockToAir(x + 2, y, z); // Left part
|
||||||
|
} else if (part == 2) { // Left
|
||||||
|
world.setBlockToAir(x - 1, y, z); // Middle part
|
||||||
|
world.setBlockToAir(x - 2, y, z); // Right part
|
||||||
|
}
|
||||||
|
} else if (direction == 1) { // West
|
||||||
|
if (part == 1) { // Middle
|
||||||
|
world.setBlockToAir(x, y, z - 1); // Right part
|
||||||
|
world.setBlockToAir(x, y, z + 1); // Left part
|
||||||
|
} else if (part == 0) { // Right
|
||||||
|
world.setBlockToAir(x, y, z + 1); // Middle part
|
||||||
|
world.setBlockToAir(x, y, z + 2); // Left part
|
||||||
|
} else if (part == 2) { // Left
|
||||||
|
world.setBlockToAir(x, y, z - 1); // Middle part
|
||||||
|
world.setBlockToAir(x, y, z - 2); // Right part
|
||||||
|
}
|
||||||
|
} else if (direction == 2) { // North
|
||||||
|
if (part == 1) { // Middle
|
||||||
|
world.setBlockToAir(x + 1, y, z); // Right part
|
||||||
|
world.setBlockToAir(x - 1, y, z); // Left part
|
||||||
|
} else if (part == 0) { // Right
|
||||||
|
world.setBlockToAir(x - 1, y, z); // Middle part
|
||||||
|
world.setBlockToAir(x - 2, y, z); // Left part
|
||||||
|
} else if (part == 2) { // Left
|
||||||
|
world.setBlockToAir(x + 1, y, z); // Middle part
|
||||||
|
world.setBlockToAir(x + 2, y, z); // Right part
|
||||||
|
}
|
||||||
|
} else if (direction == 3) { // East
|
||||||
|
if (part == 1) { // Middle
|
||||||
|
world.setBlockToAir(x, y, z + 1); // Right part
|
||||||
|
world.setBlockToAir(x, y, z - 1); // Left part
|
||||||
|
} else if (part == 0) { // Right
|
||||||
|
world.setBlockToAir(x, y, z - 1); // Middle part
|
||||||
|
world.setBlockToAir(x, y, z - 2); // Left part
|
||||||
|
} else if (part == 2) { // Left
|
||||||
|
world.setBlockToAir(x, y, z + 1); // Middle part
|
||||||
|
world.setBlockToAir(x, y, z + 2); // Right part
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.breakBlock(world, x, y, z, block, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TileEntityForgingStation getCentralTileEntity(World world, int x, int y, int z) {
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
int direction = meta >> 2; // Extract the direction
|
||||||
|
int part = meta & 3; // Extract the part (0, 1, 2)
|
||||||
|
|
||||||
|
int centralX = x, centralZ = z;
|
||||||
|
|
||||||
|
switch (direction) {
|
||||||
|
case 0: // South
|
||||||
|
if (part == 0) {
|
||||||
|
centralX = x + 1; // Right part, middle is to the left
|
||||||
|
} else if (part == 2) {
|
||||||
|
centralX = x - 1; // Left part, middle is to the right
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1: // West
|
||||||
|
if (part == 0) {
|
||||||
|
centralZ = z + 1; // Right part, middle is to the front
|
||||||
|
} else if (part == 2) {
|
||||||
|
centralZ = z - 1; // Left part, middle is to the back
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2: // North
|
||||||
|
if (part == 0) {
|
||||||
|
centralX = x - 1; // Right part, middle is to the right
|
||||||
|
} else if (part == 2) {
|
||||||
|
centralX = x + 1; // Left part, middle is to the left
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3: // East
|
||||||
|
if (part == 0) {
|
||||||
|
centralZ = z - 1; // Right part, middle is to the back
|
||||||
|
} else if (part == 2) {
|
||||||
|
centralZ = z + 1; // Left part, middle is to the front
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
TileEntity tileEntity = world.getTileEntity(centralX, y, centralZ);
|
||||||
|
return (tileEntity instanceof TileEntityForgingStation) ? (TileEntityForgingStation) tileEntity : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {
|
||||||
|
ItemStack heldStack = player.getHeldItem();
|
||||||
|
if (heldStack == null) return;
|
||||||
|
|
||||||
|
boolean isBlessedHammer = heldStack.getItem() == CinderLoE.blessedHammer;
|
||||||
|
boolean isRegularHammer = heldStack.getItem() instanceof LOTRItemHammer;
|
||||||
|
|
||||||
|
if (!isBlessedHammer && !isRegularHammer) return;
|
||||||
|
|
||||||
|
TileEntityForgingStation tileentity = getCentralTileEntity(world, x, y, z);
|
||||||
|
if (tileentity == null) return;
|
||||||
|
|
||||||
|
ItemStack left = tileentity.getLeftItem();
|
||||||
|
ItemStack middle = tileentity.getMiddleItem();
|
||||||
|
ItemStack right = tileentity.getRightItem();
|
||||||
|
|
||||||
|
// Iterate through available recipes and find a match
|
||||||
|
for (ForgingRecipe recipe : ForgingRecipes.getAllRecipes()) {
|
||||||
|
|
||||||
|
if (recipe.matches(left, middle, right, isBlessedHammer)) {
|
||||||
|
// Clear the inputs if the recipe matches
|
||||||
|
tileentity.setLeftItem(null);
|
||||||
|
tileentity.setRightItem(null);
|
||||||
|
tileentity.setMiddleItem(recipe.getOutput());
|
||||||
|
|
||||||
|
// Damage the hammer by 1
|
||||||
|
if (heldStack.attemptDamageItem(1, player.getRNG())) {
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||||
|
} else {
|
||||||
|
player.inventory.markDirty();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||||
|
if (!world.isRemote) {
|
||||||
|
TileEntityForgingStation tileentity = getCentralTileEntity(world, x, y, z);
|
||||||
|
if (tileentity == null) return true;
|
||||||
|
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
int part = meta & 3;
|
||||||
|
|
||||||
|
ItemStack stack = null;
|
||||||
|
if (part == 0) stack = tileentity.getRightItem();
|
||||||
|
else if (part == 1) stack = tileentity.getMiddleItem();
|
||||||
|
else if (part == 2) stack = tileentity.getLeftItem();
|
||||||
|
|
||||||
|
if (stack != null) {
|
||||||
|
// Try to pick up the item
|
||||||
|
boolean hasSpace = player.inventory.addItemStackToInventory(stack);
|
||||||
|
if (hasSpace) {
|
||||||
|
if (part == 0) tileentity.setRightItem(null);
|
||||||
|
else if (part == 1) tileentity.setMiddleItem(null);
|
||||||
|
else if (part == 2) tileentity.setLeftItem(null);
|
||||||
|
|
||||||
|
if (player instanceof EntityPlayerMP) {
|
||||||
|
((EntityPlayerMP) player).sendContainerToPlayer(player.inventoryContainer);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
player.addChatMessage(new ChatComponentText("You need more inventory space"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Try to place an item
|
||||||
|
ItemStack heldStack = player.getHeldItem();
|
||||||
|
if (heldStack == null) return true;
|
||||||
|
|
||||||
|
boolean itemPlaced = false;
|
||||||
|
|
||||||
|
// Check all recipes to see if the held item matches any input slot
|
||||||
|
for (ForgingRecipe recipe : ForgingRecipes.getAllRecipes()) {
|
||||||
|
if (part == 0 && recipe.matchesItem(recipe.rightInput, heldStack)) {
|
||||||
|
tileentity.setRightItem(heldStack.splitStack(1));
|
||||||
|
itemPlaced = true;
|
||||||
|
} else if (part == 1 && recipe.matchesItem(recipe.middleInput, heldStack)) {
|
||||||
|
tileentity.setMiddleItem(heldStack.splitStack(1));
|
||||||
|
itemPlaced = true;
|
||||||
|
} else if (part == 2 && recipe.matchesItem(recipe.leftInput, heldStack)) {
|
||||||
|
tileentity.setLeftItem(heldStack.splitStack(1));
|
||||||
|
itemPlaced = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemPlaced) {
|
||||||
|
tileentity.markDirty();
|
||||||
|
if (heldStack.stackSize <= 0) {
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||||
|
}
|
||||||
|
player.inventory.markDirty();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!itemPlaced) {
|
||||||
|
player.addChatMessage(new ChatComponentText("This item does not fit here."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,51 +0,0 @@
|
|||||||
package com.zivilon.cinder_loe.blocks;
|
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.LoECreativeTabs;
|
|
||||||
import com.zivilon.cinder_loe.tileentity.TileEntityNexIceCrystal;
|
|
||||||
import com.zivilon.cinder_loe.util.Utilities;
|
|
||||||
|
|
||||||
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.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class NexIceCrystal extends Block {
|
|
||||||
|
|
||||||
public NexIceCrystal() {
|
|
||||||
super(Material.ice); // Choose the appropriate material
|
|
||||||
// Set other properties like hardness, resistance, name, etc.
|
|
||||||
setCreativeTab(LoECreativeTabs.tabDecoLoE);
|
|
||||||
setHardness(100.0F);
|
|
||||||
setResistance(100.0F);
|
|
||||||
setBlockTextureName(Utilities.toSnakeCase("lotr:nexIceCrystal"));
|
|
||||||
setBlockName("lotr:NexIceCrystal");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasTileEntity(int metadata) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity createTileEntity(World world, int metadata) {
|
|
||||||
return new TileEntityNexIceCrystal();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRenderType() {
|
|
||||||
return -1; // Custom render ID
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isOpaqueCube() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean renderAsNormalBlock() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
package com.zivilon.cinder_loe.client.model.blocks;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* forging_station - Shinare
|
||||||
|
* Created using Tabula 4.1.1
|
||||||
|
*/
|
||||||
|
public class ModelForgingStation extends ModelBase {
|
||||||
|
public ModelRenderer middle_block;
|
||||||
|
public ModelRenderer left_block;
|
||||||
|
public ModelRenderer right_block;
|
||||||
|
public ModelRenderer left_leg;
|
||||||
|
public ModelRenderer left_leg_top;
|
||||||
|
public ModelRenderer left_leg_base;
|
||||||
|
public ModelRenderer right_leg_front;
|
||||||
|
public ModelRenderer right_leg_back;
|
||||||
|
|
||||||
|
public ModelForgingStation() {
|
||||||
|
this.textureWidth = 128;
|
||||||
|
this.textureHeight = 64;
|
||||||
|
this.right_leg_back = new ModelRenderer(this, 0, 0);
|
||||||
|
this.right_leg_back.setRotationPoint(4.0F, 10.0F, 0.0F);
|
||||||
|
this.right_leg_back.addBox(0.0F, 0.0F, -2.0F, 2, 2, 16, 0.0F);
|
||||||
|
this.setRotateAngle(right_leg_back, 0.7853981633974483F, 0.0F, 0.0F);
|
||||||
|
this.left_leg = new ModelRenderer(this, 0, 32);
|
||||||
|
this.left_leg.setRotationPoint(6.0F, 2.0F, 6.0F);
|
||||||
|
this.left_leg.addBox(0.0F, 0.0F, 0.0F, 4, 14, 4, 0.0F);
|
||||||
|
this.left_leg_top = new ModelRenderer(this, 0, 32);
|
||||||
|
this.left_leg_top.setRotationPoint(-1.0F, 0.0F, -1.0F);
|
||||||
|
this.left_leg_top.addBox(0.0F, 0.0F, 0.0F, 6, 2, 6, 0.0F);
|
||||||
|
this.left_block = new ModelRenderer(this, 64, 32);
|
||||||
|
this.left_block.setRotationPoint(16.0F, 0.0F, 0.0F);
|
||||||
|
this.left_block.addBox(0.0F, 0.0F, 0.0F, 16, 2, 16, 0.0F);
|
||||||
|
this.setRotateAngle(left_block, 0.0F, 3.141592653589793F, 0.0F);
|
||||||
|
this.right_leg_front = new ModelRenderer(this, 0, 0);
|
||||||
|
this.right_leg_front.setRotationPoint(11.0F, 10.0F, 0.0F);
|
||||||
|
this.right_leg_front.addBox(0.0F, 0.0F, -2.0F, 2, 2, 16, 0.0F);
|
||||||
|
this.setRotateAngle(right_leg_front, 0.7853981633974483F, 0.0F, 0.0F);
|
||||||
|
this.left_leg_base = new ModelRenderer(this, 0, 32);
|
||||||
|
this.left_leg_base.setRotationPoint(-1.0F, 12.0F, -1.0F);
|
||||||
|
this.left_leg_base.addBox(0.0F, 0.0F, 0.0F, 6, 2, 6, 0.0F);
|
||||||
|
this.right_block = new ModelRenderer(this, 64, 0);
|
||||||
|
this.right_block.setRotationPoint(0.0F, 0.0F, 16.0F);
|
||||||
|
this.right_block.addBox(0.0F, 0.0F, 0.0F, 16, 2, 16, 0.0F);
|
||||||
|
this.middle_block = new ModelRenderer(this, 0, 0);
|
||||||
|
this.middle_block.setRotationPoint(-8.0F, 8.0F, -8.0F);
|
||||||
|
this.middle_block.addBox(0.0F, 0.0F, 0.0F, 16, 16, 16, 0.0F);
|
||||||
|
this.right_block.addChild(this.right_leg_back);
|
||||||
|
this.left_block.addChild(this.left_leg);
|
||||||
|
this.left_leg.addChild(this.left_leg_top);
|
||||||
|
this.middle_block.addChild(this.left_block);
|
||||||
|
this.right_block.addChild(this.right_leg_front);
|
||||||
|
this.left_leg.addChild(this.left_leg_base);
|
||||||
|
this.middle_block.addChild(this.right_block);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render(float f5) {
|
||||||
|
this.middle_block.render(f5);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a helper function from Tabula to set the rotation of model parts
|
||||||
|
*/
|
||||||
|
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||||
|
modelRenderer.rotateAngleX = x;
|
||||||
|
modelRenderer.rotateAngleY = y;
|
||||||
|
modelRenderer.rotateAngleZ = z;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package com.zivilon.cinder_loe.client.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.entity.NexCloud;
|
||||||
|
|
||||||
|
public class RenderNexCloud extends Render {
|
||||||
|
|
||||||
|
public static ResourceLocation GREEN_PIXEL_TEXTURE = new ResourceLocation("cinder_loe:mob/green.png");
|
||||||
|
public ModelBase model = new ModelBase() {}; // Create an empty ModelBase instance
|
||||||
|
public ModelRenderer cube;
|
||||||
|
|
||||||
|
public RenderNexCloud() {
|
||||||
|
this.cube = new ModelRenderer(this.model, 0, 0);
|
||||||
|
this.cube.addBox(-8F, -8F, -8F, 16, 16, 16); // Define a cube of 16x16x16 pixels
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||||
|
return GREEN_PIXEL_TEXTURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslatef((float) x, (float) y + entity.height / 2, (float) z);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
GL11.glDisable(GL11.GL_CULL_FACE); // Disable face culling
|
||||||
|
|
||||||
|
this.bindEntityTexture(entity); // Bind the single-pixel texture
|
||||||
|
|
||||||
|
NexCloud nexCloud = (NexCloud) entity;
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, nexCloud.opacity); // Use the opacity from the entity
|
||||||
|
|
||||||
|
// Render the cube model
|
||||||
|
GL11.glScalef(entity.width, entity.height, entity.width);
|
||||||
|
this.cube.render(0.0625F); // Render the cube with a scaling factor
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_CULL_FACE); // Re-enable face culling
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,136 @@
|
|||||||
|
package com.zivilon.cinder_loe.client.render;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.entity.effect.NimveilLightningBolt;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.entity.RenderLightningBolt;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import java.util.Random;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class RenderNimveilBolt extends RenderLightningBolt {
|
||||||
|
|
||||||
|
public void doRender(NimveilLightningBolt p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||||
|
double[] adouble = new double[8];
|
||||||
|
double[] adouble1 = new double[8];
|
||||||
|
double d3 = 0.0D;
|
||||||
|
double d4 = 0.0D;
|
||||||
|
Random random = new Random(p_76986_1_.boltVertex);
|
||||||
|
|
||||||
|
for (int i = 7; i >= 0; --i) {
|
||||||
|
adouble[i] = d3;
|
||||||
|
adouble1[i] = d4;
|
||||||
|
d3 += (double)(random.nextInt(11) - 5);
|
||||||
|
d4 += (double)(random.nextInt(11) - 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int k1 = 0; k1 < 4; ++k1) {
|
||||||
|
Random random1 = new Random(p_76986_1_.boltVertex);
|
||||||
|
|
||||||
|
for (int j = 0; j < 3; ++j) {
|
||||||
|
int k = 7;
|
||||||
|
int l = 0;
|
||||||
|
|
||||||
|
if (j > 0) {
|
||||||
|
k = 7 - j;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j > 0) {
|
||||||
|
l = k - 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
double d5 = adouble[k] - d3;
|
||||||
|
double d6 = adouble1[k] - d4;
|
||||||
|
|
||||||
|
for (int i1 = k; i1 >= l; --i1) {
|
||||||
|
double d7 = d5;
|
||||||
|
double d8 = d6;
|
||||||
|
|
||||||
|
if (j == 0) {
|
||||||
|
d5 += (double)(random1.nextInt(11) - 5);
|
||||||
|
d6 += (double)(random1.nextInt(11) - 5);
|
||||||
|
} else {
|
||||||
|
d5 += (double)(random1.nextInt(31) - 15);
|
||||||
|
d6 += (double)(random1.nextInt(31) - 15);
|
||||||
|
}
|
||||||
|
|
||||||
|
tessellator.startDrawing(5);
|
||||||
|
float f2 = 0.5F;
|
||||||
|
tessellator.setColorRGBA_F(0.9F * f2, 0.9F * f2, 1.0F * f2, 0.3F);
|
||||||
|
double d9 = 0.1D + (double)k1 * 0.2D;
|
||||||
|
|
||||||
|
if (j == 0) {
|
||||||
|
d9 *= (double)i1 * 0.1D + 1.0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
double d10 = 0.1D + (double)k1 * 0.2D;
|
||||||
|
|
||||||
|
if (j == 0) {
|
||||||
|
d10 *= (double)(i1 - 1) * 0.1D + 1.0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int j1 = 0; j1 < 5; ++j1) {
|
||||||
|
double d11 = p_76986_2_ + 0.5D - d9;
|
||||||
|
double d12 = p_76986_6_ + 0.5D - d9;
|
||||||
|
|
||||||
|
if (j1 == 1 || j1 == 2) {
|
||||||
|
d11 += d9 * 2.0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j1 == 2 || j1 == 3) {
|
||||||
|
d12 += d9 * 2.0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
double d13 = p_76986_2_ + 0.5D - d10;
|
||||||
|
double d14 = p_76986_6_ + 0.5D - d10;
|
||||||
|
|
||||||
|
if (j1 == 1 || j1 == 2) {
|
||||||
|
d13 += d10 * 2.0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j1 == 2 || j1 == 3) {
|
||||||
|
d14 += d10 * 2.0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
tessellator.addVertex(d13 + d5, p_76986_4_ + (double)(i1 * 16), d14 + d6);
|
||||||
|
tessellator.addVertex(d11 + d7, p_76986_4_ + (double)((i1 + 1) * 16), d12 + d8);
|
||||||
|
}
|
||||||
|
|
||||||
|
tessellator.draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||||
|
*/
|
||||||
|
public ResourceLocation getEntityTexture(NimveilLightningBolt p_110775_1_) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||||
|
*/
|
||||||
|
public ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||||
|
return this.getEntityTexture((NimveilLightningBolt)p_110775_1_);
|
||||||
|
}
|
||||||
|
|
||||||
|
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((NimveilLightningBolt)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,69 +0,0 @@
|
|||||||
package com.zivilon.cinder_loe.client.render.block;
|
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.client.model.ModelNexIceCrystal;
|
|
||||||
import com.zivilon.cinder_loe.tileentity.TileEntityNexIceCrystal;
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
public class RenderNexIceCrystal extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
|
||||||
public static final int renderID = RenderingRegistry.getNextAvailableRenderId();
|
|
||||||
private static final ResourceLocation texture = new ResourceLocation("lotr:textures/blocks/nex_ice_crystal.png");
|
|
||||||
private final ModelNexIceCrystal model = new ModelNexIceCrystal();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
|
|
||||||
if (tileEntity instanceof TileEntityNexIceCrystal) {
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); // Center the model
|
|
||||||
GL11.glScalef(0.5F, 0.5F, 0.5F); // Scale down the model
|
|
||||||
this.bindTexture(texture);
|
|
||||||
this.model.render(null, 0, 0, 0, 0, 0, 0.0625F);
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
|
||||||
if (modelId == renderID) {
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F); // Center the model in inventory
|
|
||||||
GL11.glScalef(0.5F, 0.5F, 0.5F); // Scale down the model
|
|
||||||
this.bindTexture(texture);
|
|
||||||
this.model.render(null, 0, 0, 0, 0, 0, 0.0625F);
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
|
||||||
if (modelId == renderID) {
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
GL11.glTranslatef(x + 0.5F, y + 0.5F, z + 0.5F); // Center the model in the world
|
|
||||||
GL11.glScalef(0.5F, 0.5F, 0.5F); // Scale down the model
|
|
||||||
this.bindTexture(texture);
|
|
||||||
this.model.render(null, 0, 0, 0, 0, 0, 0.0625F);
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean shouldRender3DInInventory(int modelId) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRenderId() {
|
|
||||||
return renderID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package com.zivilon.cinder_loe.client.render.item;
|
||||||
|
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.client.IItemRenderer;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
|
||||||
|
public class TrollClubRenderer implements IItemRenderer {
|
||||||
|
|
||||||
|
public static ResourceLocation texture = new ResourceLocation("lotr", "textures/items/troll_chieftain_club.png");
|
||||||
|
|
||||||
|
public ModelBase model;
|
||||||
|
/* public ModelTrollChieftainClub model;
|
||||||
|
|
||||||
|
public TrollClubRenderer(ModelTrollChieftainClub model) {
|
||||||
|
this.model = model;
|
||||||
|
}*/
|
||||||
|
public TrollClubRenderer() {
|
||||||
|
this.model = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||||
|
return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
|
// Position the model correctly
|
||||||
|
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||||
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||||
|
} else {
|
||||||
|
GL11.glTranslatef(0.7F, 0.4F, 0.5F);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rotate and scale the model as needed
|
||||||
|
GL11.glScalef(1.0F, 1.0F, 1.0F);
|
||||||
|
|
||||||
|
// Bind the texture
|
||||||
|
RenderManager.instance.renderEngine.bindTexture(texture);
|
||||||
|
|
||||||
|
// Render the model
|
||||||
|
model.render(null, 0, 0, 0, 0, 0, 0.0625F);
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,113 @@
|
|||||||
|
package com.zivilon.cinder_loe.client.render.tileentity;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.client.model.blocks.ModelForgingStation;
|
||||||
|
import com.zivilon.cinder_loe.tileentity.TileEntityForgingStation;
|
||||||
|
import com.zivilon.cinder_loe.client.render.item.RenderHelper;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.ItemRenderer;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
|
||||||
|
public class TileEntityForgingStationRenderer extends TileEntitySpecialRenderer {
|
||||||
|
public ModelForgingStation model = new ModelForgingStation();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick) {
|
||||||
|
|
||||||
|
if (tileEntity instanceof TileEntityForgingStation) {
|
||||||
|
TileEntityForgingStation tile = (TileEntityForgingStation) tileEntity;
|
||||||
|
|
||||||
|
// Get the metadata to determine if this is the middle part
|
||||||
|
int meta = tile.getBlockMetadata();
|
||||||
|
int direction = meta >> 2;
|
||||||
|
int part = meta & 3;
|
||||||
|
float rotation = 270F;
|
||||||
|
if (part != 1) return;
|
||||||
|
|
||||||
|
rotation = direction * 90F - 90F;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||||
|
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||||
|
GL11.glScalef(-1.0F, -1.0F, 1.0F);
|
||||||
|
GL11.glRotatef(rotation, 0F, 1F, 0F); // Adjust rotation as needed
|
||||||
|
bindTexture(new ResourceLocation("lotr:textures/blocks/forging_station.png"));
|
||||||
|
this.model.render(0.0625F); // Render the model
|
||||||
|
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
|
||||||
|
// Render the items above each part of the Forging Station
|
||||||
|
float offset = 0F;
|
||||||
|
switch (direction) {
|
||||||
|
case 1:
|
||||||
|
case 3:
|
||||||
|
offset -= 180F;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
renderStoredItems(tile, x, y, z, direction * 90F + offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderStoredItems(TileEntityForgingStation tile, double x, double y, double z, float rotation) {
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.0F, (float) z + 0.5F); // Adjust the position
|
||||||
|
GL11.glRotatef(rotation, 0F, 1F, 0F); // Rotate to match the block's orientation
|
||||||
|
|
||||||
|
ItemStack left = tile.getLeftItem();
|
||||||
|
ItemStack middle = tile.getMiddleItem();
|
||||||
|
ItemStack right = tile.getRightItem();
|
||||||
|
|
||||||
|
// Render left item
|
||||||
|
if (left != null) {
|
||||||
|
renderItemInWorld(left, 1.0, 0.0, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Render middle item
|
||||||
|
if (middle != null) {
|
||||||
|
renderItemInWorld(middle, 0.0, 0.0, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Render right item
|
||||||
|
if (right != null) {
|
||||||
|
renderItemInWorld(right, -1.0, 0.0, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderItemInWorld(ItemStack stack, double x, double y, double z) {
|
||||||
|
if (stack != null) {
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslated(x, y, z);
|
||||||
|
GL11.glScalef(1.0F, 1.0F, 1.0F); // Adjust the item size
|
||||||
|
|
||||||
|
// Bind the item texture
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationItemsTexture);
|
||||||
|
IIcon icon = stack.getIconIndex();
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
|
// Set up the item rendering parameters
|
||||||
|
float minU = icon.getMinU();
|
||||||
|
float maxU = icon.getMaxU();
|
||||||
|
float minV = icon.getMinV();
|
||||||
|
float maxV = icon.getMaxV();
|
||||||
|
|
||||||
|
// Render the item in 2D
|
||||||
|
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||||
|
GL11.glTranslatef(-0.25F, -0.25F, 0.0F);
|
||||||
|
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||||
|
|
||||||
|
RenderHelper.customRenderItemIn2D(tessellator, maxU, minV, minU, maxV, icon.getIconWidth(), icon.getIconHeight(), 0.0625F, false);
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,180 @@
|
|||||||
|
package com.zivilon.cinder_loe.entity;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import lotr.common.entity.npc.LOTREntityNPC;
|
||||||
|
import lotr.common.fac.LOTRFaction;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class NexCloud extends Entity {
|
||||||
|
public int tickCounter = 0;
|
||||||
|
public float opacity = 0.0F;
|
||||||
|
public boolean unbound = false;
|
||||||
|
|
||||||
|
public NexCloud(World world) {
|
||||||
|
super(world);
|
||||||
|
this.setSize(5.0F, 3.0F); // Set the size of the cloud
|
||||||
|
this.noClip = true; // Disable hitbox
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
this.dataWatcher.addObject(20, 0.0F); // Index 20, initial opacity
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||||
|
// Load entity data from NBT
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
||||||
|
// Save entity data to NBT
|
||||||
|
}
|
||||||
|
|
||||||
|
public void syncOpacityToClient() {
|
||||||
|
this.dataWatcher.updateObject(20, this.opacity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
super.onUpdate();
|
||||||
|
this.noClip = true;
|
||||||
|
if (worldObj.isRemote) {
|
||||||
|
this.opacity = this.dataWatcher.getWatchableObjectFloat(20);
|
||||||
|
// Update the client's position to match the server's position
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
syncOpacityToClient();
|
||||||
|
tickCounter++;
|
||||||
|
|
||||||
|
if (tickCounter <= 100) {
|
||||||
|
// Increase opacity from 0.0F to 0.5F over the first 100 ticks
|
||||||
|
opacity = 0.5F * (tickCounter / 100.0F);
|
||||||
|
} else if (tickCounter <= 200) {
|
||||||
|
// Maintain opacity at 0.5F for the next 100 ticks
|
||||||
|
opacity = 0.5F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unbound) {
|
||||||
|
followNearestPlayer();
|
||||||
|
// Apply the motion to the entity's position
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ); // Update the entity's position
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tickCounter % 10 == 0) {
|
||||||
|
if (tickCounter > 60 && tickCounter < 240)
|
||||||
|
applyPoisonEffect();
|
||||||
|
unbound = isMinibossUnbound();
|
||||||
|
/* if (unbound && tickCounter > 100) {
|
||||||
|
tickCounter = 100;
|
||||||
|
return;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if (unbound) {
|
||||||
|
return;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (tickCounter <= 300 && tickCounter > 200) {
|
||||||
|
// Decrease opacity from 0.5F to 0.0F over the next 100 ticks
|
||||||
|
opacity = 0.5F * ((300 - tickCounter) / 100.0F);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tickCounter > 300) {
|
||||||
|
// Set the entity as dead after 300 ticks
|
||||||
|
System.out.println("Setting cloud dead. Ticks: " + tickCounter + " and unbound state: " + unbound);
|
||||||
|
this.setDead();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void moveEntity(double x, double y, double z) {
|
||||||
|
if (this.noClip) {
|
||||||
|
this.setPosition(this.posX + x, this.posY + y, this.posZ + z);
|
||||||
|
} else {
|
||||||
|
super.moveEntity(x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isMinibossUnbound() {
|
||||||
|
List<Entity> entities = worldObj.getEntitiesWithinAABB(Entity.class, this.boundingBox.expand(100.0, 10.0, 100.0));
|
||||||
|
for (Entity entity : entities) {
|
||||||
|
if (entity instanceof NexToxin) {
|
||||||
|
NexToxin miniboss = (NexToxin) entity;
|
||||||
|
// System.out.println("Found miniboss. Is unbound: " + !miniboss.bound);
|
||||||
|
return !miniboss.bound;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// System.out.println("Miniboss not found");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void applyPoisonEffect() {
|
||||||
|
List<Entity> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox);
|
||||||
|
for (Entity entity : entities) {
|
||||||
|
if (entity != this && !(entity instanceof LOTREntityNPC && ((LOTREntityNPC) entity).getFaction() == LOTRFaction.UTUMNO)) {
|
||||||
|
if (entity instanceof EntityLivingBase) {
|
||||||
|
EntityLivingBase livingEntity = (EntityLivingBase) entity;
|
||||||
|
livingEntity.attackEntityFrom(DamageSource.magic, 2.0F);
|
||||||
|
livingEntity.addPotionEffect(new PotionEffect(Potion.poison.id, 200, 1)); // 10 seconds of poison (200 ticks)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getBoundingBox() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void followNearestPlayer() {
|
||||||
|
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(100.0, 4.0, 100.0));
|
||||||
|
if (!players.isEmpty()) {
|
||||||
|
EntityPlayer nearestPlayer = players.get(0);
|
||||||
|
double minDistance = this.getDistanceToEntity(nearestPlayer);
|
||||||
|
for (EntityPlayer player : players) {
|
||||||
|
double distance = this.getDistanceToEntity(player);
|
||||||
|
if (distance < minDistance) {
|
||||||
|
nearestPlayer = player;
|
||||||
|
minDistance = distance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
double speed = 0.01;
|
||||||
|
this.motionX = (nearestPlayer.posX - this.posX) * speed;
|
||||||
|
this.motionY = (nearestPlayer.posY - this.posY) * speed;
|
||||||
|
this.motionZ = (nearestPlayer.posZ - this.posZ) * speed;
|
||||||
|
} else {
|
||||||
|
this.motionX = 0;
|
||||||
|
this.motionY = 0;
|
||||||
|
this.motionZ = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBeCollidedWith() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBePushed() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,152 @@
|
|||||||
|
package com.zivilon.cinder_loe.entity;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.CinderLoE;
|
||||||
|
import com.zivilon.cinder_loe.util.Utilities;
|
||||||
|
import com.zivilon.cinder_loe.entity.Nex;
|
||||||
|
import com.zivilon.cinder_loe.entity.ai.LoEPreciseAttackOnCollide;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLiving;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
|
import net.minecraft.entity.ai.EntityAIBase;
|
||||||
|
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import lotr.common.entity.npc.LOTREntityMan;
|
||||||
|
import lotr.common.fac.LOTRFaction;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public abstract class NexMiniboss extends LOTREntityMan {
|
||||||
|
public String entity_name = "UNDEFINED";
|
||||||
|
public boolean bound = true;
|
||||||
|
|
||||||
|
public NexMiniboss(World world) {
|
||||||
|
super(world);
|
||||||
|
setSize(0.6F, 1.8F);
|
||||||
|
((EntityLiving) this).tasks.addTask(2, (EntityAIBase) new LoEPreciseAttackOnCollide(this, 1.3D, 1.0D, 40, false));
|
||||||
|
((EntityLiving) this).tasks.addTask(8, (EntityAIBase) new EntityAIWatchClosest((EntityLiving) this, Nex.class, 8.0F, 0.02F));
|
||||||
|
addTargetTasks(true);
|
||||||
|
setupEquipment();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void applyEntityAttributes() {
|
||||||
|
super.applyEntityAttributes();
|
||||||
|
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D);
|
||||||
|
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.225D);
|
||||||
|
getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D);
|
||||||
|
getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(100.0D);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LOTRFaction getFaction() {
|
||||||
|
return LOTRFaction.UTUMNO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canDespawn() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getNPCName() {
|
||||||
|
return entity_name;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getNPCFormattedName(String npcName, String entityName) {
|
||||||
|
return entity_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dropFewItems(boolean flag, int i) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getCanSpawnHere() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSpeechBank(EntityPlayer entityplayer) {
|
||||||
|
return "nex/undefined";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setupNPCName() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getPickedResult(MovingObjectPosition target) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDeath(DamageSource source) {
|
||||||
|
List<Nex> entityList = this.worldObj.getEntitiesWithinAABB(Nex.class, this.boundingBox.expand(100, 10, 100));
|
||||||
|
for (Nex nex : entityList) {
|
||||||
|
nex.next_phase();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unbind() {
|
||||||
|
System.out.println("Unbinding " + this.getClass().getSimpleName());
|
||||||
|
|
||||||
|
int x = MathHelper.floor_double(this.posX);
|
||||||
|
int y = MathHelper.floor_double(this.posY);
|
||||||
|
int z = MathHelper.floor_double(this.posZ);
|
||||||
|
|
||||||
|
Block blockAtFeet = this.worldObj.getBlock(x, y, z);
|
||||||
|
Block blockAtHead = this.worldObj.getBlock(x, y + 1, z);
|
||||||
|
if (blockAtFeet == CinderLoE.iceCage) {
|
||||||
|
this.worldObj.setBlock(x, y, z, Blocks.air);
|
||||||
|
}
|
||||||
|
if (blockAtHead == CinderLoE.iceCage) {
|
||||||
|
this.worldObj.setBlock(x, y, z, Blocks.air);
|
||||||
|
}
|
||||||
|
bound = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
super.onUpdate();
|
||||||
|
checkInsideIceCage();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkInsideIceCage() {
|
||||||
|
int x = MathHelper.floor_double(this.posX);
|
||||||
|
int y = MathHelper.floor_double(this.posY);
|
||||||
|
int z = MathHelper.floor_double(this.posZ);
|
||||||
|
|
||||||
|
|
||||||
|
Block blockAtFeet = this.worldObj.getBlock(x, y, z);
|
||||||
|
Block blockAtHead = this.worldObj.getBlock(x, y + 1, z);
|
||||||
|
|
||||||
|
if (blockAtFeet == CinderLoE.iceCage || blockAtHead == CinderLoE.iceCage) {
|
||||||
|
onBoundUpdate(x, y, z);
|
||||||
|
Utilities.setInvulnerable((Entity)this, true);
|
||||||
|
// System.out.println("Nex Miniboss vulnerable: " + this.isEntityInvulnerable());
|
||||||
|
} else {
|
||||||
|
onUnboundUpdate();
|
||||||
|
Utilities.setInvulnerable((Entity)this, false);
|
||||||
|
// System.out.println("Nex Miniboss vulnerable: " + this.isEntityInvulnerable());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void onBoundUpdate(int x, int y, int z);
|
||||||
|
public abstract void onUnboundUpdate();
|
||||||
|
public abstract void setupEquipment();
|
||||||
|
}
|
||||||
@ -0,0 +1,97 @@
|
|||||||
|
package com.zivilon.cinder_loe.entity.ai;
|
||||||
|
|
||||||
|
import lotr.common.entity.ai.LOTREntityAIAttackOnCollide;
|
||||||
|
import lotr.common.entity.npc.LOTREntityNPC;
|
||||||
|
import lotr.common.entity.projectile.LOTREntitySpear;
|
||||||
|
import lotr.common.item.LOTRItemSpear;
|
||||||
|
import lotr.common.item.LOTRWeaponStats;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityCreature;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.EntityLiving;
|
||||||
|
import net.minecraft.pathfinding.PathEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LoEPreciseAttackOnCollide extends LOTREntityAIAttackOnCollide {
|
||||||
|
public double attack_range;
|
||||||
|
public int attack_cooldown;
|
||||||
|
|
||||||
|
public LoEPreciseAttackOnCollide(EntityCreature entity, double speed, double reach, int delay, boolean flag) {
|
||||||
|
super(entity, speed, flag);
|
||||||
|
attack_range = reach;
|
||||||
|
attack_cooldown = delay;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTask() {
|
||||||
|
updateLookAndPathing();
|
||||||
|
if (this.attackTick > 0)
|
||||||
|
this.attackTick--;
|
||||||
|
ItemStack weapon = this.theOwner.getHeldItem();
|
||||||
|
|
||||||
|
// Throw a throwing spear if available
|
||||||
|
if (weapon != null && weapon.getItem() instanceof LOTRItemSpear && this.attackTick <= 0 && this.theOwner instanceof LOTREntityNPC) {
|
||||||
|
LOTREntityNPC theNPC = (LOTREntityNPC)this.theOwner;
|
||||||
|
ItemStack spearBackup = theNPC.npcItemsInv.getSpearBackup();
|
||||||
|
|
||||||
|
if (spearBackup != null) {
|
||||||
|
LOTRItemSpear spearItem = (LOTRItemSpear)weapon.getItem();
|
||||||
|
double d = this.theOwner.getDistanceToEntity((Entity)this.attackTarget);
|
||||||
|
double range = this.theOwner.getNavigator().getPathSearchRange();
|
||||||
|
if (d > 5.0D && d < range * 0.75D) {
|
||||||
|
LOTREntitySpear spear = new LOTREntitySpear(this.worldObj, (EntityLivingBase)this.theOwner, this.attackTarget, weapon.copy(), 0.75F + (float)d * 0.025F, 0.5F);
|
||||||
|
this.worldObj.playSoundAtEntity((Entity)this.theOwner, "random.bow", 1.0F, 1.0F / (this.worldObj.rand.nextFloat() * 0.4F + 1.2F) + 0.25F);
|
||||||
|
this.worldObj.spawnEntityInWorld((Entity)spear);
|
||||||
|
this.attackTick = 30 + this.theOwner.getRNG().nextInt(20);
|
||||||
|
if (ItemStack.areItemStacksEqual(theNPC.npcItemsInv.getIdleItem(), theNPC.npcItemsInv.getMeleeWeapon()))
|
||||||
|
theNPC.npcItemsInv.setIdleItem(spearBackup);
|
||||||
|
theNPC.npcItemsInv.setMeleeWeapon(spearBackup);
|
||||||
|
theNPC.npcItemsInv.setSpearBackup(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
float weaponReach = 1.0F;
|
||||||
|
if (this.theOwner.ridingEntity != null)
|
||||||
|
weaponReach = LOTREntityNPC.MOUNT_RANGE_BONUS;
|
||||||
|
if (weapon == null) {
|
||||||
|
weaponReach = (float)attack_range;
|
||||||
|
} else {
|
||||||
|
weaponReach *= LOTRWeaponStats.getMeleeReachFactor(weapon);
|
||||||
|
}
|
||||||
|
|
||||||
|
float meleeRange = (float)this.theOwner.boundingBox.getAverageEdgeLength() + weaponReach;
|
||||||
|
double distanceSq = this.theOwner.getDistanceSqToEntity((Entity)this.attackTarget);
|
||||||
|
|
||||||
|
if (distanceSq <= (meleeRange * meleeRange) || this.theOwner.boundingBox.intersectsWith(this.attackTarget.boundingBox)) {
|
||||||
|
if (this.attackTick <= 0) {
|
||||||
|
this.attackTick = (weapon == null) ? attack_cooldown : LOTRWeaponStats.getAttackTimeMob(weapon); // Apply cooldown here
|
||||||
|
this.theOwner.attackEntityAsMob((Entity)this.attackTarget);
|
||||||
|
this.theOwner.swingItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void updateLookAndPathing() {
|
||||||
|
this.theOwner.getLookHelper().setLookPositionWithEntity((Entity)this.attackTarget, 30.0F, 30.0F);
|
||||||
|
if (this.theOwner.riddenByEntity != null && this.theOwner.riddenByEntity instanceof EntityLiving) {
|
||||||
|
((EntityLiving)this.theOwner.riddenByEntity).rotationYaw = this.theOwner.rotationYaw;
|
||||||
|
((EntityLiving)this.theOwner.riddenByEntity).rotationYawHead = this.theOwner.rotationYawHead;
|
||||||
|
}
|
||||||
|
if ((this.sightNotRequired || this.theOwner.getEntitySenses().canSee((Entity)this.attackTarget)) && --this.pathCheckTimer <= 0) {
|
||||||
|
this.pathCheckTimer = 2;
|
||||||
|
PathEntity path = getPathEntity();
|
||||||
|
if (path != null)
|
||||||
|
this.theOwner.getNavigator().setPath(path, this.moveSpeed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public PathEntity getPathEntity() {
|
||||||
|
if (this.theOwner.ridingEntity != null)
|
||||||
|
return this.worldObj.getPathEntityToEntity((Entity)this.theOwner, (Entity)this.attackTarget, this.theOwner.getNavigator().getPathSearchRange(), true, this.theOwner.getNavigator().getCanBreakDoors(), this.theOwner.getNavigator().getAvoidsWater(), false);
|
||||||
|
return this.theOwner.getNavigator().getPathToEntityLiving((Entity)this.attackTarget);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
package com.zivilon.cinder_loe.entity.effect;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.effect.EntityWeatherEffect;
|
||||||
|
import net.minecraft.entity.passive.EntityPig;
|
||||||
|
import net.minecraft.entity.monster.EntityCreeper;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class NimveilLightningBolt extends EntityWeatherEffect {
|
||||||
|
/** Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. */
|
||||||
|
public int lightningState;
|
||||||
|
/** A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt */
|
||||||
|
public long boltVertex;
|
||||||
|
/** Determines the time before the NimveilLightningBolt is destroyed. It is a random integer decremented over time. */
|
||||||
|
public int boltLivingTime;
|
||||||
|
|
||||||
|
public NimveilLightningBolt(World world, double x, double y, double z) {
|
||||||
|
super(world);
|
||||||
|
this.setLocationAndAngles(x, y, z, 0.0F, 0.0F);
|
||||||
|
this.lightningState = 2;
|
||||||
|
this.boltVertex = this.rand.nextLong();
|
||||||
|
this.boltLivingTime = this.rand.nextInt(3) + 1;
|
||||||
|
}
|
||||||
|
public NimveilLightningBolt(World world) {
|
||||||
|
this(world, 0, 0, 0);// Summon line of custom lightning bolts
|
||||||
|
// Must not place fire or affect any non-EntityLivingBase targets
|
||||||
|
// Probably the most work of all of these
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called to update the entity's position/logic.
|
||||||
|
*/
|
||||||
|
public void onUpdate() {
|
||||||
|
super.onUpdate();
|
||||||
|
|
||||||
|
if (this.lightningState == 2) {
|
||||||
|
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F);
|
||||||
|
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, 0.5F + this.rand.nextFloat() * 0.2F);
|
||||||
|
}
|
||||||
|
|
||||||
|
--this.lightningState;
|
||||||
|
|
||||||
|
if (this.lightningState < 0) {
|
||||||
|
if (this.boltLivingTime == 0) {
|
||||||
|
this.setDead();
|
||||||
|
} else if (this.lightningState < -this.rand.nextInt(10)) {
|
||||||
|
--this.boltLivingTime;
|
||||||
|
this.lightningState = 1;
|
||||||
|
this.boltVertex = this.rand.nextLong();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.lightningState >= 0) {
|
||||||
|
if (this.worldObj.isRemote) {
|
||||||
|
this.worldObj.lastLightningBolt = 2;
|
||||||
|
} else {
|
||||||
|
double d0 = 3.0D;
|
||||||
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0D + d0, this.posZ + d0));
|
||||||
|
list.removeIf(entity -> !(entity instanceof EntityLivingBase));
|
||||||
|
list.removeIf(entity -> (entity instanceof EntityPig));
|
||||||
|
list.removeIf(entity -> (entity instanceof EntityCreeper));
|
||||||
|
|
||||||
|
for (int l = 0; l < list.size(); ++l) {
|
||||||
|
Entity entity = (Entity)list.get(l);
|
||||||
|
if (entity.isImmuneToFire() == false) {
|
||||||
|
entity.attackEntityFrom(DamageSource.inFire, 20.0F);
|
||||||
|
entity.setFire(8);
|
||||||
|
}
|
||||||
|
System.out.println("Striking " + entity.getCommandSenderName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void entityInit() {}
|
||||||
|
public void readEntityFromNBT(NBTTagCompound p_70037_1_) {}
|
||||||
|
public void writeEntityToNBT(NBTTagCompound p_70014_1_) {}
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.CinderLoE;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlessedHammer extends LoEHammer {
|
||||||
|
public BlessedHammer() {
|
||||||
|
super(CinderLoE.MATERIAL_NIMVEIL, CinderLoE.enchantedIce);
|
||||||
|
this.setTextureName("lotr:blessed_hammer");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack item) {
|
||||||
|
return "item.blessed_hammer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) {
|
||||||
|
list.add(EnumChatFormatting.GRAY + "This blacksmith hammer is brimming with power");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.CinderLoE;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
|
||||||
|
import lotr.common.item.LOTRItemPolearm;
|
||||||
|
import lotr.common.item.LOTRWeaponStats;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class Celeiniss extends LOTRItemPolearm {
|
||||||
|
public Celeiniss() {
|
||||||
|
super(CinderLoE.MATERIAL_NEX_ICE);
|
||||||
|
this.lotrWeaponDamage = 11.5F;
|
||||||
|
this.setUnlocalizedName("lotr:firstAgeGlaive");
|
||||||
|
this.setTextureName("lotr:firstAgeGlaive");
|
||||||
|
this.setCreativeTab(LoECreativeTabs.tabCombatLoE);
|
||||||
|
LOTRWeaponStats.registerMeleeReach(Celeiniss.class, 1.8F);
|
||||||
|
LOTRWeaponStats.registerMeleeSpeed(Celeiniss.class, 1.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsRepairable(ItemStack itemstack, ItemStack repairItem) {
|
||||||
|
return (repairItem.getItem() == Item.getItemFromBlock(CinderLoE.enchantedIce));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,57 +0,0 @@
|
|||||||
package com.zivilon.cinder_loe.items;
|
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.CinderLoE;
|
|
||||||
import com.zivilon.cinder_loe.LoECreativeTabs;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import lotr.common.LOTRBannerProtection;
|
|
||||||
import lotr.common.LOTRMod;
|
|
||||||
import lotr.common.enchant.LOTREnchantment;
|
|
||||||
import lotr.common.enchant.LOTREnchantmentHelper;
|
|
||||||
import lotr.common.item.LOTRItemSword;
|
|
||||||
import lotr.common.item.LOTRItemPolearm;
|
|
||||||
import lotr.common.item.LOTRMaterial;
|
|
||||||
import lotr.common.item.LOTRWeaponStats;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.init.Items;
|
|
||||||
import net.minecraft.item.EnumAction;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.util.Vec3;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class FirstAgeGlaive extends LOTRItemPolearm {
|
|
||||||
public FirstAgeGlaive() {
|
|
||||||
super(CinderLoE.MATERIAL_NEX_ICE);
|
|
||||||
this.lotrWeaponDamage = 11.5F;
|
|
||||||
this.setUnlocalizedName("lotr:firstAgeGlaive");
|
|
||||||
this.setTextureName("lotr:firstAgeGlaive");
|
|
||||||
this.setCreativeTab(LoECreativeTabs.tabCombatLoE);
|
|
||||||
LOTRWeaponStats.registerMeleeReach(FirstAgeGlaive.class, 1.8F);
|
|
||||||
LOTRWeaponStats.registerMeleeSpeed(FirstAgeGlaive.class, 1.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getIsRepairable(ItemStack itemstack, ItemStack repairItem) {
|
|
||||||
return (repairItem.getItem() == Item.getItemFromBlock(CinderLoE.enchantedIce));
|
|
||||||
}
|
|
||||||
|
|
||||||
// private void checkIncompatibleModifiers(ItemStack itemstack) {}
|
|
||||||
|
|
||||||
public static UUID accessWeaponDamageModifier() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class IceThawer extends Item {
|
||||||
|
|
||||||
|
public IceThawer() {
|
||||||
|
this.setUnlocalizedName("ice_thawer");
|
||||||
|
this.setTextureName("lotr:ice_thawer");
|
||||||
|
setCreativeTab(LoECreativeTabs.tabMiscLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) {
|
||||||
|
list.add(EnumChatFormatting.DARK_PURPLE + "You feel like if you held this");
|
||||||
|
list.add(EnumChatFormatting.DARK_PURPLE + "against a frozen body, it might melt.");
|
||||||
|
list.add(EnumChatFormatting.DARK_PURPLE + "But why would you need such thing?");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import lotr.common.item.LOTRMaterial;
|
||||||
|
import lotr.common.item.LOTRItemArmor;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class LoEArmor extends LOTRItemArmor {
|
||||||
|
public Item repair_item;
|
||||||
|
|
||||||
|
public LoEArmor(LOTRMaterial material, int slotType) {
|
||||||
|
this(material, slotType, "");
|
||||||
|
}
|
||||||
|
public LoEArmor(LOTRMaterial material, int slotType, String s) {
|
||||||
|
this(material, slotType, s, (Item) null);
|
||||||
|
}
|
||||||
|
public LoEArmor(LOTRMaterial material, int slotType, Item item) {
|
||||||
|
this(material, slotType, "", item);
|
||||||
|
}
|
||||||
|
public LoEArmor(LOTRMaterial material, int slotType, Block block) {
|
||||||
|
this(material, slotType, "", block);
|
||||||
|
}
|
||||||
|
public LoEArmor(LOTRMaterial material, int slotType, String s, Block block) {
|
||||||
|
this(material, slotType, s, Item.getItemFromBlock(block));
|
||||||
|
}
|
||||||
|
public LoEArmor(LOTRMaterial material, int slotType, String s, Item item) {
|
||||||
|
super(material, slotType, s);
|
||||||
|
repair_item = item;
|
||||||
|
setCreativeTab(LoECreativeTabs.tabCombatLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getIsRepairable(ItemStack item, ItemStack repair_material) {
|
||||||
|
if (repair_material.getItem() == repair_item)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import lotr.common.item.LOTRMaterial;
|
||||||
|
import lotr.common.item.LOTRItemBow;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class LoEBow extends LOTRItemBow {
|
||||||
|
public Item repair_item;
|
||||||
|
|
||||||
|
public LoEBow(LOTRMaterial material) {
|
||||||
|
this(material, (Item) null, 1.0D);
|
||||||
|
}
|
||||||
|
public LoEBow(LOTRMaterial material, Block repair_block) {
|
||||||
|
this(material, Item.getItemFromBlock(repair_block), 1.0D);
|
||||||
|
}
|
||||||
|
public LoEBow(LOTRMaterial material, Block repair_block, double damage) {
|
||||||
|
this(material, Item.getItemFromBlock(repair_block), damage);
|
||||||
|
}
|
||||||
|
public LoEBow(LOTRMaterial material, double damage, Block repair_block) {
|
||||||
|
this(material, Item.getItemFromBlock(repair_block), damage);
|
||||||
|
}
|
||||||
|
public LoEBow(LOTRMaterial material, double damage) {
|
||||||
|
this(material, (Item) null, damage);
|
||||||
|
}
|
||||||
|
public LoEBow(LOTRMaterial material, double damage, Item item) {
|
||||||
|
this(material, item, damage);
|
||||||
|
}
|
||||||
|
public LoEBow(LOTRMaterial material, Item item, double damage) {
|
||||||
|
super(material, damage);
|
||||||
|
repair_item = item;
|
||||||
|
setCreativeTab(LoECreativeTabs.tabCombatLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getIsRepairable(ItemStack item, ItemStack repair_material) {
|
||||||
|
if (repair_material.getItem() == repair_item)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import lotr.common.item.LOTRMaterial;
|
||||||
|
import lotr.common.item.LOTRItemHammer;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class LoEHammer extends LOTRItemHammer {
|
||||||
|
public Item repair_item;
|
||||||
|
|
||||||
|
public LoEHammer(LOTRMaterial material) {
|
||||||
|
this(material, (Item) null);
|
||||||
|
}
|
||||||
|
public LoEHammer(LOTRMaterial material, Block repair_block) {
|
||||||
|
this(material, Item.getItemFromBlock(repair_block));
|
||||||
|
}
|
||||||
|
public LoEHammer(LOTRMaterial material, Item item) {
|
||||||
|
super(material);
|
||||||
|
repair_item = item;
|
||||||
|
setCreativeTab(LoECreativeTabs.tabCombatLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getIsRepairable(ItemStack item, ItemStack repair_material) {
|
||||||
|
if (repair_material.getItem() == repair_item)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
|
||||||
|
import lotr.common.item.LOTRItemMug;
|
||||||
|
import lotr.common.item.LOTRItemMug.Vessel;
|
||||||
|
import lotr.client.render.LOTRDrinkIcons;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class LoEItemMug extends LOTRItemMug {
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon[] drinkIcons;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon liquidIcon;
|
||||||
|
|
||||||
|
public LoEItemMug(boolean full, boolean food) {
|
||||||
|
super(full, food, false, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoEItemMug(float alc) {
|
||||||
|
this(true, false, true, alc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoEItemMug(boolean full, boolean food, boolean brew, float alc) {
|
||||||
|
super(full, food, brew, alc);
|
||||||
|
setCreativeTab(LoECreativeTabs.tabFoodLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTextureNameFromUnlocalizedName() {
|
||||||
|
String textureName = getUnlocalizedName().substring("item.".length()); // Strip the "item." prefix
|
||||||
|
this.setTextureName(textureName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void registerIcons(IIconRegister iconregister) {
|
||||||
|
if (this.isFullMug) {
|
||||||
|
this.drinkIcons = new IIcon[(Vessel.values()).length];
|
||||||
|
for (int i = 0; i < (Vessel.values()).length; i++) {
|
||||||
|
this.drinkIcons[i] = LOTRDrinkIcons.registerDrinkIcon(iconregister, this, getIconString(), (Vessel.values()[i]).name);
|
||||||
|
}
|
||||||
|
this.liquidIcon = LOTRDrinkIcons.registerLiquidIcon(iconregister, this, getIconString());
|
||||||
|
barrelGui_emptyBucketSlotIcon = iconregister.registerIcon("lotr:barrel_emptyBucketSlot");
|
||||||
|
barrelGui_emptyMugSlotIcon = iconregister.registerIcon("lotr:barrel_emptyMugSlot");
|
||||||
|
} else {
|
||||||
|
super.registerIcons(iconregister);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public IIcon getIconFromDamage(int i) {
|
||||||
|
if (this.isFullMug) {
|
||||||
|
if (i == -1)
|
||||||
|
return this.liquidIcon;
|
||||||
|
int vessel = (getVessel(i)).id;
|
||||||
|
return this.drinkIcons[vessel];
|
||||||
|
}
|
||||||
|
return super.getIconFromDamage(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Vessel getVessel(int damage) {
|
||||||
|
int i = damage / vesselMeta;
|
||||||
|
return Vessel.forMeta(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import lotr.common.item.LOTRMaterial;
|
||||||
|
import lotr.common.item.LOTRItemSpear;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class LoESpear extends LOTRItemSpear {
|
||||||
|
public Item repair_item;
|
||||||
|
|
||||||
|
public LoESpear(LOTRMaterial material) {
|
||||||
|
this(material, (Item) null);
|
||||||
|
}
|
||||||
|
public LoESpear(LOTRMaterial material, Block repair_block) {
|
||||||
|
this(material, Item.getItemFromBlock(repair_block));
|
||||||
|
}
|
||||||
|
public LoESpear(LOTRMaterial material, Item item) {
|
||||||
|
super(material);
|
||||||
|
repair_item = item;
|
||||||
|
setCreativeTab(LoECreativeTabs.tabCombatLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getIsRepairable(ItemStack item, ItemStack repair_material) {
|
||||||
|
if (repair_material.getItem() == repair_item)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import lotr.common.item.LOTRMaterial;
|
||||||
|
import lotr.common.item.LOTRItemSword;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class LoESword extends LOTRItemSword {
|
||||||
|
public Item repair_item;
|
||||||
|
|
||||||
|
public LoESword(LOTRMaterial material) {
|
||||||
|
this(material, (Item) null);
|
||||||
|
}
|
||||||
|
public LoESword(LOTRMaterial material, Block repair_block) {
|
||||||
|
this(material, Item.getItemFromBlock(repair_block));
|
||||||
|
}
|
||||||
|
public LoESword(LOTRMaterial material, Item item) {
|
||||||
|
super(material);
|
||||||
|
repair_item = item;
|
||||||
|
setCreativeTab(LoECreativeTabs.tabCombatLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoESword setWeaponDamage(float damage) {
|
||||||
|
this.lotrWeaponDamage = damage;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getIsRepairable(ItemStack item, ItemStack repair_material) {
|
||||||
|
if (repair_material.getItem() == repair_item)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,458 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.CinderLoE;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
import com.zivilon.cinder_loe.entity.effect.NimveilLightningBolt;
|
||||||
|
import com.zivilon.cinder_loe.potion.LoEPotions;
|
||||||
|
import com.zivilon.cinder_loe.util.Utilities;
|
||||||
|
|
||||||
|
import lotr.common.LOTRLevelData;
|
||||||
|
import lotr.common.entity.npc.LOTREntityNPC;
|
||||||
|
import lotr.common.fac.LOTRFaction;
|
||||||
|
import lotr.common.item.LOTRItemSword;
|
||||||
|
import lotr.common.item.LOTRMaterial;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumAction;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Nimveil extends LOTRItemSword {
|
||||||
|
public static String NBT_STATE = "NimveilState";
|
||||||
|
public static String NBT_VARIANT = "NimveilVariant";
|
||||||
|
public static String NBT_TICK = "Tick";
|
||||||
|
public IIcon[] icons;
|
||||||
|
|
||||||
|
public Nimveil() {
|
||||||
|
super(CinderLoE.MATERIAL_NIMVEIL);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.canRepair = false;
|
||||||
|
this.setMaxDamage(300);
|
||||||
|
setCreativeTab(LoECreativeTabs.tabCombatLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsRepairable(ItemStack nimveil, ItemStack repair_material) {
|
||||||
|
if (repair_material.getItem() == Item.getItemFromBlock(CinderLoE.enchantedIce))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean showDurabilityBar(ItemStack stack) {
|
||||||
|
return true; // Always show the durability bar
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDurabilityForDisplay(ItemStack stack) {
|
||||||
|
int state = get_state(stack);
|
||||||
|
|
||||||
|
// No charges found, show recharge meter
|
||||||
|
if (state == 0) {
|
||||||
|
double damage = ((double) stack.getItemDamage() / (double) stack.getMaxDamage());
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The only variant where state is > 1 is "ancient". So we skip an NBT read here.
|
||||||
|
if (state > 1) {
|
||||||
|
double ancient_charges = 1.0D - (10.0D - (double)state) / 10.0D;
|
||||||
|
return 1.0D - ancient_charges;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If variant is not "ancient", then it can't have more than 1 charge. We already checked that there is charge, so it's at max
|
||||||
|
String variant = get_variant(stack);
|
||||||
|
if (!variant.equals("ancient"))
|
||||||
|
return 0.0D;
|
||||||
|
|
||||||
|
// If variant is "ancient" and state is 1, we know the bar is at 0.9.
|
||||||
|
return 0.9D;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nimveil state handling
|
||||||
|
*/
|
||||||
|
public static byte get_state(ItemStack stack) {
|
||||||
|
if (stack.hasTagCompound()) {
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
return tag.getByte(NBT_STATE);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
public static void set_state(ItemStack stack, byte state) {
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
if (tag == null) {
|
||||||
|
tag = new NBTTagCompound();
|
||||||
|
stack.setTagCompound(tag);
|
||||||
|
}
|
||||||
|
tag.setByte(NBT_STATE, state);
|
||||||
|
}
|
||||||
|
public static boolean decrement_state(ItemStack stack) {
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
if (tag == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
byte state = tag.getByte(NBT_STATE);
|
||||||
|
if (state > 0) {
|
||||||
|
if (state == 1)
|
||||||
|
stack.setItemDamage(300);
|
||||||
|
tag.setByte(NBT_STATE, --state);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public static int tick(ItemStack stack) {
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
if (tag == null) {
|
||||||
|
tag = new NBTTagCompound();
|
||||||
|
stack.setTagCompound(tag);
|
||||||
|
}
|
||||||
|
int tick = tag.getInteger(NBT_TICK);
|
||||||
|
if (tick >= 20) {
|
||||||
|
tick = 0;
|
||||||
|
} else {
|
||||||
|
tick++;
|
||||||
|
}
|
||||||
|
tag.setInteger(NBT_TICK, tick);
|
||||||
|
return tick;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Methods to put all variants under one item type
|
||||||
|
*/
|
||||||
|
public IIcon getIconIndex(ItemStack stack)
|
||||||
|
{
|
||||||
|
int icon_index = 0;
|
||||||
|
if (get_state(stack) != 0)
|
||||||
|
icon_index += 5;
|
||||||
|
switch(get_variant(stack)) {
|
||||||
|
case "valar":
|
||||||
|
break;
|
||||||
|
case "mortals":
|
||||||
|
icon_index += 1;
|
||||||
|
break;
|
||||||
|
case "udun":
|
||||||
|
icon_index += 2;
|
||||||
|
break;
|
||||||
|
case "sauron":
|
||||||
|
icon_index += 3;
|
||||||
|
break;
|
||||||
|
case "ancient":
|
||||||
|
icon_index += 4;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return icons[icon_index];
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.icons = new IIcon[10];
|
||||||
|
this.icons[0] = iconRegister.registerIcon("lotr:nimveil_valar");
|
||||||
|
this.icons[1] = iconRegister.registerIcon("lotr:nimveil_mortals");
|
||||||
|
this.icons[2] = iconRegister.registerIcon("lotr:nimveil_udun");
|
||||||
|
this.icons[3] = iconRegister.registerIcon("lotr:nimveil_sauron");
|
||||||
|
this.icons[4] = iconRegister.registerIcon("lotr:nimveil_ancient");
|
||||||
|
this.icons[5] = iconRegister.registerIcon("lotr:nimveil_valar_glow");
|
||||||
|
this.icons[6] = iconRegister.registerIcon("lotr:nimveil_mortals_glow");
|
||||||
|
this.icons[7] = iconRegister.registerIcon("lotr:nimveil_udun_glow");
|
||||||
|
this.icons[8] = iconRegister.registerIcon("lotr:nimveil_sauron_glow");
|
||||||
|
this.icons[9] = iconRegister.registerIcon("lotr:nimveil_ancient_glow");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack item) {
|
||||||
|
// return "item.nimveil_" + get_variant(item);
|
||||||
|
return "lotr:nimveil";
|
||||||
|
}
|
||||||
|
public static String get_variant(ItemStack stack) {
|
||||||
|
if (stack.hasTagCompound()) {
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
return tag.getString(NBT_VARIANT);
|
||||||
|
}
|
||||||
|
return "invalid";
|
||||||
|
}
|
||||||
|
public static ItemStack init_variant(ItemStack stack, String variant) {
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
if (tag == null) {
|
||||||
|
tag = new NBTTagCompound();
|
||||||
|
stack.setTagCompound(tag);
|
||||||
|
}
|
||||||
|
tag.setString(NBT_VARIANT, variant);
|
||||||
|
tag.setByte(NBT_STATE, (byte)0);
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) {
|
||||||
|
switch(get_variant(stack)) {
|
||||||
|
case "valar":
|
||||||
|
list.add(EnumChatFormatting.AQUA + "Valar");
|
||||||
|
list.add("");
|
||||||
|
list.add(EnumChatFormatting.GOLD + "Special Attack:");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + " Cast a line of lightning strikes");
|
||||||
|
return;
|
||||||
|
case "mortals":
|
||||||
|
list.add(EnumChatFormatting.DARK_GREEN + "Mortals");
|
||||||
|
list.add("");
|
||||||
|
list.add(EnumChatFormatting.GOLD + "Special Attack:");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + " Deal 25% of your missing health as damage");
|
||||||
|
return;
|
||||||
|
case "udun":
|
||||||
|
list.add(EnumChatFormatting.DARK_RED + "Udûn");
|
||||||
|
list.add("");
|
||||||
|
list.add(EnumChatFormatting.GOLD + "Special Attack:");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + " +20% Attack Damage");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + " Reverse Knockback");
|
||||||
|
return;
|
||||||
|
case "sauron":
|
||||||
|
list.add(EnumChatFormatting.DARK_PURPLE + "Sauron");
|
||||||
|
list.add(EnumChatFormatting.GOLD + "Special Attack:");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + " Apply Corrupting effect for 60 seconds");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + " Causes all NPCs to be hostile");
|
||||||
|
return;
|
||||||
|
case "ancient":
|
||||||
|
list.add(EnumChatFormatting.DARK_AQUA + "Ancient");
|
||||||
|
list.add(EnumChatFormatting.GOLD + "Special Attack:");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + " For each outnumbering non-allied NPC nearby");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + " +5% damage vs NPCs");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + " +1.25% damage vs players");
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
list.add(EnumChatFormatting.GRAY + "Invalid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||||
|
list.add(init_variant(new ItemStack(item, 1), "ancient"));
|
||||||
|
list.add(init_variant(new ItemStack(item, 1), "valar"));
|
||||||
|
list.add(init_variant(new ItemStack(item, 1), "mortals"));
|
||||||
|
list.add(init_variant(new ItemStack(item, 1), "udun"));
|
||||||
|
list.add(init_variant(new ItemStack(item, 1), "sauron"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify sword mechanics to those unique to Nimveil
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) {
|
||||||
|
if (attacker.worldObj.isRemote) return false;
|
||||||
|
if (stack.getItemDamage() != 0) return false;
|
||||||
|
|
||||||
|
if (decrement_state(stack)) {
|
||||||
|
special_damage(stack, target, attacker);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
if (world.isRemote) return stack;
|
||||||
|
if (stack.getItemDamage() != 0) return stack;
|
||||||
|
|
||||||
|
byte state = get_state(stack);
|
||||||
|
if (state == 0) {
|
||||||
|
special_action(stack, world, player);
|
||||||
|
}
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unused but here to remind they exist for later
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EnumAction getItemUseAction(ItemStack p_77661_1_) {
|
||||||
|
return EnumAction.none; // might be modified later, it's here so I remember it exists,
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recharging durability (special attack) bar
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
|
super.onUpdate(stack, world, entity, itemSlot, isSelected);
|
||||||
|
|
||||||
|
// Only run on the server-side to prevent conflicts with client-side rendering
|
||||||
|
if (!world.isRemote && get_state(stack) == 0) {
|
||||||
|
int tick = tick(stack);
|
||||||
|
if (tick == 20 && stack.getItemDamage() > 0) {
|
||||||
|
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic redirects for Nimveil special actions
|
||||||
|
*/
|
||||||
|
public void special_action(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
String variant = get_variant(stack);
|
||||||
|
switch(variant) {
|
||||||
|
case "valar":
|
||||||
|
special_action_valar(stack, world, player);
|
||||||
|
return;
|
||||||
|
case "mortals":
|
||||||
|
special_action_mortals(stack, world, player);
|
||||||
|
return;
|
||||||
|
case "udun":
|
||||||
|
special_action_udun(stack, world, player);
|
||||||
|
return;
|
||||||
|
case "sauron":
|
||||||
|
special_action_sauron(stack, world, player);
|
||||||
|
return;
|
||||||
|
case "ancient":
|
||||||
|
special_action_ancient(stack, world, player);
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void special_damage(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) {
|
||||||
|
String variant = get_variant(stack);
|
||||||
|
switch(variant) {
|
||||||
|
case "mortals":
|
||||||
|
special_damage_mortals(stack, target, attacker);
|
||||||
|
return;
|
||||||
|
case "udun":
|
||||||
|
special_damage_udun(stack, target, attacker);
|
||||||
|
return;
|
||||||
|
case "sauron":
|
||||||
|
special_damage_sauron(stack, target, attacker);
|
||||||
|
return;
|
||||||
|
case "ancient":
|
||||||
|
special_damage_ancient(stack, target, attacker);
|
||||||
|
return;
|
||||||
|
case "valar":
|
||||||
|
special_damage_valar(stack, target, attacker);
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Valar Nimveil special actions
|
||||||
|
*/
|
||||||
|
public void special_action_valar(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
// No charges because this triggers immediately. Set damage to max
|
||||||
|
stack.setItemDamage(stack.getMaxDamage());
|
||||||
|
System.out.println("Triggering Valar action. Also max damage is " + stack.getMaxDamage());
|
||||||
|
summon_lightning_line(world, player);
|
||||||
|
}
|
||||||
|
public void special_damage_valar(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) {
|
||||||
|
// Do nothing, this method should never run but exists for consistency and extensibility
|
||||||
|
}
|
||||||
|
public void summon_lightning_line(World world, EntityPlayer player) {
|
||||||
|
// Get the player's facing direction
|
||||||
|
float yaw = player.rotationYaw;
|
||||||
|
|
||||||
|
// Calculate the initial position, 4 blocks in front
|
||||||
|
double x = player.posX - Math.sin(Math.toRadians(yaw)) * 7;
|
||||||
|
double z = player.posZ + Math.cos(Math.toRadians(yaw)) * 7;
|
||||||
|
double y = player.posY;
|
||||||
|
|
||||||
|
// Summon the first lightning bolt
|
||||||
|
world.spawnEntityInWorld(new NimveilLightningBolt(world, x, y, z));
|
||||||
|
|
||||||
|
// Summon 6 more lightning bolts, each 3 blocks apart
|
||||||
|
for (int i = 1; i < 7; i++) {
|
||||||
|
x -= Math.sin(Math.toRadians(yaw)) * 5;
|
||||||
|
z += Math.cos(Math.toRadians(yaw)) * 5;
|
||||||
|
world.spawnEntityInWorld(new NimveilLightningBolt(world, x, y, z));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Udûn Nimveil special actions
|
||||||
|
*/
|
||||||
|
public void special_action_udun(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
// Set 1 charge
|
||||||
|
set_state(stack, (byte)1);
|
||||||
|
}
|
||||||
|
public void special_damage_udun(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) {
|
||||||
|
double damage = Utilities.calculate_melee_damage_on_entity(target, attacker);
|
||||||
|
target.attackEntityFrom(DamageSource.causeMobDamage(attacker), 0.2F * (float)damage);
|
||||||
|
Utilities.knockback(target, attacker, -3.0D);
|
||||||
|
target.worldObj.playSoundAtEntity(target, "lotr:item.maceSauron", 1.0F, 1.3F);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mortals Nimveil special actions
|
||||||
|
*/
|
||||||
|
public void special_action_mortals(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
// Set 1 charge
|
||||||
|
set_state(stack, (byte)1);
|
||||||
|
}
|
||||||
|
public void special_damage_mortals(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) {
|
||||||
|
// Set 1 charge
|
||||||
|
float max_health = attacker.getMaxHealth();
|
||||||
|
float current_health = attacker.getHealth();
|
||||||
|
target.attackEntityFrom(DamageSource.causeMobDamage(attacker).setDamageBypassesArmor(), 0.25F * (max_health - current_health));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sauron Nimveil special actions
|
||||||
|
*/
|
||||||
|
public void special_action_sauron(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
// Set 1 charge
|
||||||
|
set_state(stack, (byte)1);
|
||||||
|
}
|
||||||
|
public void special_damage_sauron(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) {
|
||||||
|
// Check if the target is an instance of EntityPlayer
|
||||||
|
if (target instanceof EntityPlayer) {
|
||||||
|
EntityPlayer player = (EntityPlayer) target;
|
||||||
|
|
||||||
|
// Apply the Corrupting potion effect
|
||||||
|
player.addPotionEffect(new PotionEffect(LoEPotions.corrupting.id, 1200, 0)); // 60 seconds duration (20 ticks per second)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ancient Nimveil special actions
|
||||||
|
*/
|
||||||
|
public void special_action_ancient(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
// Set 10 charges
|
||||||
|
this.set_state(stack, ((byte)10));
|
||||||
|
}
|
||||||
|
public void special_damage_ancient(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) {
|
||||||
|
if (!(attacker instanceof EntityPlayer)) return;
|
||||||
|
LOTRFaction pledged_faction = LOTRLevelData.getData(((EntityPlayer)attacker)).getPledgeFaction();
|
||||||
|
if (pledged_faction == null) {
|
||||||
|
((EntityPlayer)attacker).addChatMessage(new ChatComponentText("You need to be pledged to a faction to use this"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<LOTREntityNPC> entity_list = attacker.worldObj.getEntitiesWithinAABB(LOTREntityNPC.class, attacker.boundingBox.expand(100, 10, 100));
|
||||||
|
int friendly_count = 0;
|
||||||
|
int total_count = entity_list.size();
|
||||||
|
double damage = 0.0D;
|
||||||
|
for (LOTREntityNPC npc : entity_list) {
|
||||||
|
if (npc.getFaction().isGoodRelation(pledged_faction))
|
||||||
|
friendly_count++;
|
||||||
|
}
|
||||||
|
int outnumber_count = Math.min(total_count - friendly_count * 2, 20);
|
||||||
|
if (outnumber_count > 0)
|
||||||
|
damage = Utilities.calculate_melee_damage_on_entity(target, attacker);
|
||||||
|
float final_damage = 0.0F;
|
||||||
|
if (!(target instanceof EntityPlayer)) {
|
||||||
|
final_damage = 0.05F * (float)outnumber_count * (float)damage;
|
||||||
|
target.attackEntityFrom(DamageSource.causeMobDamage(attacker), final_damage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final_damage = 0.0125F * ((float)outnumber_count) * ((float)damage);
|
||||||
|
target.attackEntityFrom(DamageSource.causeMobDamage(attacker), final_damage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,128 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.entity.projectile.EntityWarDart;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
|
||||||
|
import lotr.common.dispenser.LOTRDispenseThrowingAxe;
|
||||||
|
import lotr.common.enchant.LOTREnchantment;
|
||||||
|
import lotr.common.enchant.LOTREnchantmentHelper;
|
||||||
|
import lotr.common.entity.projectile.LOTREntityThrowingAxe;
|
||||||
|
import lotr.common.item.LOTRMaterial;
|
||||||
|
import lotr.common.recipe.LOTRRecipes;
|
||||||
|
import net.minecraft.block.BlockDispenser;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.EnumCreatureAttribute;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class NimveilPart extends Item {
|
||||||
|
public IIcon[] icons;
|
||||||
|
|
||||||
|
public NimveilPart() {
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
setCreativeTab(LoECreativeTabs.tabMiscLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIconFromDamage(int damage) {
|
||||||
|
if (damage < 0 || damage >= icons.length) {
|
||||||
|
damage = 0;
|
||||||
|
}
|
||||||
|
return this.icons[damage];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.icons = new IIcon[7];
|
||||||
|
this.icons[0] = iconRegister.registerIcon("lotr:nimveil_hilt");
|
||||||
|
this.icons[1] = iconRegister.registerIcon("lotr:nimveil_blade");
|
||||||
|
this.icons[2] = iconRegister.registerIcon("lotr:nimveil_gem_valar");
|
||||||
|
this.icons[3] = iconRegister.registerIcon("lotr:nimveil_gem_mortals");
|
||||||
|
this.icons[4] = iconRegister.registerIcon("lotr:nimveil_gem_udun");
|
||||||
|
this.icons[5] = iconRegister.registerIcon("lotr:nimveil_gem_sauron");
|
||||||
|
this.icons[6] = iconRegister.registerIcon("lotr:nimveil_gem_ancient");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get_part_type(ItemStack item) {
|
||||||
|
switch(item.getItemDamage()) {
|
||||||
|
case 0:
|
||||||
|
return "hilt";
|
||||||
|
case 1:
|
||||||
|
return "blade";
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
case 6:
|
||||||
|
return "gem";
|
||||||
|
default:
|
||||||
|
return "hilt";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get_gem_type(ItemStack item) {
|
||||||
|
switch(item.getItemDamage()) {
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
return "invalid";
|
||||||
|
case 2:
|
||||||
|
return "valar";
|
||||||
|
case 3:
|
||||||
|
return "mortals";
|
||||||
|
case 4:
|
||||||
|
return "udun";
|
||||||
|
case 5:
|
||||||
|
return "sauron";
|
||||||
|
case 6:
|
||||||
|
return "ancient";
|
||||||
|
default:
|
||||||
|
return "invalid";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack item) {
|
||||||
|
return "item.nimveil_" + get_part_type(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) {
|
||||||
|
switch(get_gem_type(stack)) {
|
||||||
|
case "valar":
|
||||||
|
list.add(EnumChatFormatting.AQUA + "Valar");
|
||||||
|
return;
|
||||||
|
case "mortals":
|
||||||
|
list.add(EnumChatFormatting.DARK_GREEN + "Mortals");
|
||||||
|
return;
|
||||||
|
case "udun":
|
||||||
|
list.add(EnumChatFormatting.DARK_RED + "Udûn");
|
||||||
|
return;
|
||||||
|
case "sauron":
|
||||||
|
list.add(EnumChatFormatting.DARK_PURPLE + "Sauron");
|
||||||
|
return;
|
||||||
|
case "ancient":
|
||||||
|
list.add(EnumChatFormatting.DARK_AQUA + "Ancient");
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||||
|
for (int i = 0; i < icons.length; i++) {
|
||||||
|
list.add(new ItemStack(item, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,127 @@
|
|||||||
|
package com.zivilon.cinder_loe.items;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.entity.projectile.EntityWarDart;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
|
||||||
|
import lotr.common.dispenser.LOTRDispenseThrowingAxe;
|
||||||
|
import lotr.common.enchant.LOTREnchantment;
|
||||||
|
import lotr.common.enchant.LOTREnchantmentHelper;
|
||||||
|
import lotr.common.entity.projectile.LOTREntityThrowingAxe;
|
||||||
|
import lotr.common.item.LOTRMaterial;
|
||||||
|
import lotr.common.recipe.LOTRRecipes;
|
||||||
|
import net.minecraft.block.BlockDispenser;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.EnumCreatureAttribute;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class WeaponPart extends Item {
|
||||||
|
public IIcon[] icons;
|
||||||
|
|
||||||
|
public WeaponPart() {
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
setCreativeTab(LoECreativeTabs.tabMiscLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIconFromDamage(int damage) {
|
||||||
|
if (damage < 0 || damage >= icons.length) {
|
||||||
|
damage = 0;
|
||||||
|
}
|
||||||
|
return this.icons[damage];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister iconRegister) {
|
||||||
|
this.icons = new IIcon[12];
|
||||||
|
this.icons[0] = iconRegister.registerIcon("lotr:deceiver_blade_blade");
|
||||||
|
this.icons[1] = iconRegister.registerIcon("lotr:deceiver_blade_guard");
|
||||||
|
this.icons[2] = iconRegister.registerIcon("lotr:deceiver_blade_hilt");
|
||||||
|
this.icons[3] = iconRegister.registerIcon("lotr:anarore_bow_top");
|
||||||
|
this.icons[4] = iconRegister.registerIcon("lotr:anarore_bow_bottom");
|
||||||
|
this.icons[5] = iconRegister.registerIcon("lotr:anarore_bow_bowstring");
|
||||||
|
this.icons[6] = iconRegister.registerIcon("lotr:chieftain_club_???");
|
||||||
|
this.icons[7] = iconRegister.registerIcon("lotr:chieftain_club_???");
|
||||||
|
this.icons[8] = iconRegister.registerIcon("lotr:chieftain_club_???");
|
||||||
|
this.icons[9] = iconRegister.registerIcon("lotr:glaechir_spear_tip");
|
||||||
|
this.icons[10] = iconRegister.registerIcon("lotr:glaechir_spear_shaft");
|
||||||
|
this.icons[11] = iconRegister.registerIcon("lotr:glaechir_spear_???");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get_part(ItemStack item) {
|
||||||
|
switch(item.getItemDamage()) {
|
||||||
|
case 0:
|
||||||
|
return "blade";
|
||||||
|
case 1:
|
||||||
|
return "guard";
|
||||||
|
case 2:
|
||||||
|
return "hilt";
|
||||||
|
case 3:
|
||||||
|
return "top";
|
||||||
|
case 4:
|
||||||
|
return "bottom";
|
||||||
|
case 5:
|
||||||
|
return "bowstring";
|
||||||
|
case 6:
|
||||||
|
return "club";
|
||||||
|
case 7:
|
||||||
|
return "spikes";
|
||||||
|
case 8:
|
||||||
|
return "???";
|
||||||
|
case 9:
|
||||||
|
return "tip";
|
||||||
|
case 10:
|
||||||
|
return "shaft";
|
||||||
|
case 11:
|
||||||
|
return "???";
|
||||||
|
default:
|
||||||
|
return "invalid";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get_weapon(ItemStack item) {
|
||||||
|
switch(item.getItemDamage()) {
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
return "deceiver_blade";
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
return "anarore_bow";
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
case 8:
|
||||||
|
return "troll_chieftain_club";
|
||||||
|
case 9:
|
||||||
|
case 10:
|
||||||
|
case 11:
|
||||||
|
return "glaechir_spear";
|
||||||
|
default:
|
||||||
|
return "invalid";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack item) {
|
||||||
|
return "item." + get_weapon(item) + "_" + get_part(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||||
|
for (int i = 0; i < icons.length; i++) {
|
||||||
|
list.add(new ItemStack(item, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.zivilon.cinder_loe.mixins;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
import lotr.common.item.LOTRWeaponStats;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import lotr.common.enchant.LOTREnchantmentHelper;
|
||||||
|
|
||||||
|
@Mixin(EnchantmentHelper.class)
|
||||||
|
public class MixinEnchantmentHelper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shinare
|
||||||
|
* @reason Having full knockbackResistance attribute now negates bonus knockback as well
|
||||||
|
*/
|
||||||
|
@Overwrite
|
||||||
|
public static int getKnockbackModifier(EntityLivingBase attacker, EntityLivingBase target) {
|
||||||
|
int vanilla_ench_level = EnchantmentHelper.getEnchantmentLevel(Enchantment.knockback.effectId, attacker.getHeldItem());
|
||||||
|
int base_extra_knockback = LOTRWeaponStats.getBaseExtraKnockback(attacker.getHeldItem());
|
||||||
|
int modifier_extra_knockback = LOTREnchantmentHelper.calcExtraKnockback(attacker.getHeldItem());
|
||||||
|
if (target.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue() == 1.0D) return 0;
|
||||||
|
return vanilla_ench_level + base_extra_knockback + modifier_extra_knockback;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.zivilon.cinder_loe.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
@Mixin(Entity.class)
|
||||||
|
public interface MixinEntity {
|
||||||
|
|
||||||
|
@Accessor("invulnerable")
|
||||||
|
void setInvulnerable(boolean invulnerable);
|
||||||
|
}
|
||||||
@ -0,0 +1,305 @@
|
|||||||
|
package com.zivilon.cinder_loe.mixins;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
import lotr.common.item.LOTRWeaponStats;
|
||||||
|
import net.minecraft.entity.projectile.EntityArrow;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import lotr.common.enchant.LOTREnchantmentHelper;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.network.play.server.S2BPacketChangeGameState;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.entity.monster.EntityEnderman;
|
||||||
|
|
||||||
|
@Mixin(EntityArrow.class)
|
||||||
|
public abstract class MixinEntityArrow extends Entity {
|
||||||
|
|
||||||
|
public MixinEntityArrow(World world) {
|
||||||
|
super(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract void setIsCritical(boolean p_70243_1_);
|
||||||
|
@Shadow
|
||||||
|
public abstract boolean getIsCritical();
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
private Block field_145790_g;
|
||||||
|
@Shadow
|
||||||
|
private int field_145791_d;
|
||||||
|
@Shadow
|
||||||
|
private int field_145792_e;
|
||||||
|
@Shadow
|
||||||
|
private int field_145789_f;
|
||||||
|
@Shadow
|
||||||
|
private boolean inGround;
|
||||||
|
@Shadow
|
||||||
|
public int arrowShake;
|
||||||
|
@Shadow
|
||||||
|
private int inData;
|
||||||
|
@Shadow
|
||||||
|
private int ticksInGround;
|
||||||
|
@Shadow
|
||||||
|
private int ticksInAir;
|
||||||
|
@Shadow
|
||||||
|
public Entity shootingEntity;
|
||||||
|
@Shadow
|
||||||
|
private int knockbackStrength;
|
||||||
|
@Shadow
|
||||||
|
private double damage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shinare
|
||||||
|
* @reason Having full knockbackResistance attribute now negates bonus knockback as well
|
||||||
|
*/
|
||||||
|
@Overwrite
|
||||||
|
public void onUpdate() {
|
||||||
|
super.onUpdate();
|
||||||
|
|
||||||
|
EntityArrow arrow = (EntityArrow)(Object)this;
|
||||||
|
|
||||||
|
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
|
||||||
|
float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||||
|
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
|
||||||
|
}
|
||||||
|
|
||||||
|
Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||||
|
|
||||||
|
if (block.getMaterial() != Material.air) {
|
||||||
|
block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||||
|
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||||
|
|
||||||
|
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
|
||||||
|
this.inGround = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.arrowShake > 0) {
|
||||||
|
--this.arrowShake;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.inGround) {
|
||||||
|
int j = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||||
|
|
||||||
|
if (block == this.field_145790_g && j == this.inData) {
|
||||||
|
++this.ticksInGround;
|
||||||
|
|
||||||
|
if (this.ticksInGround == 1200) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.inGround = false;
|
||||||
|
this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
|
||||||
|
this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
|
||||||
|
this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
|
||||||
|
this.ticksInGround = 0;
|
||||||
|
this.ticksInAir = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
++this.ticksInAir;
|
||||||
|
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false);
|
||||||
|
vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||||
|
vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
Entity entity = null;
|
||||||
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||||
|
double d0 = 0.0D;
|
||||||
|
int i;
|
||||||
|
float f1;
|
||||||
|
|
||||||
|
for (i = 0; i < list.size(); ++i) {
|
||||||
|
Entity entity1 = (Entity)list.get(i);
|
||||||
|
|
||||||
|
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
|
||||||
|
f1 = 0.3F;
|
||||||
|
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double)f1, (double)f1, (double)f1);
|
||||||
|
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3);
|
||||||
|
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
|
double d1 = vec31.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
|
||||||
|
if (d1 < d0 || d0 == 0.0D) {
|
||||||
|
entity = entity1;
|
||||||
|
d0 = d1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity != null) {
|
||||||
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) {
|
||||||
|
EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
|
||||||
|
|
||||||
|
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) {
|
||||||
|
movingobjectposition = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float f2;
|
||||||
|
float f4;
|
||||||
|
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
if (movingobjectposition.entityHit != null) {
|
||||||
|
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||||
|
int k = MathHelper.ceiling_double_int((double)f2 * this.damage);
|
||||||
|
|
||||||
|
if (this.getIsCritical()) {
|
||||||
|
k += this.rand.nextInt(k / 2 + 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
DamageSource damagesource = null;
|
||||||
|
|
||||||
|
if (this.shootingEntity == null) {
|
||||||
|
damagesource = DamageSource.causeArrowDamage(arrow, this);
|
||||||
|
} else {
|
||||||
|
damagesource = DamageSource.causeArrowDamage(arrow, this.shootingEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrow.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) {
|
||||||
|
movingobjectposition.entityHit.setFire(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float)k)) {
|
||||||
|
if (movingobjectposition.entityHit instanceof EntityLivingBase) {
|
||||||
|
EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit;
|
||||||
|
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
|
entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double knockback_resistance = entitylivingbase.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue();
|
||||||
|
if (this.knockbackStrength > 0 && knockback_resistance < 1.0D) {
|
||||||
|
f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
|
||||||
|
if (f4 > 0.0F) {
|
||||||
|
entitylivingbase.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase) {
|
||||||
|
EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity);
|
||||||
|
EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.shootingEntity != null && entitylivingbase != this.shootingEntity && entitylivingbase instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) {
|
||||||
|
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
arrow.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
|
||||||
|
|
||||||
|
if (!(movingobjectposition.entityHit instanceof EntityEnderman)) {
|
||||||
|
arrow.setDead();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.motionX *= -0.10000000149011612D;
|
||||||
|
this.motionY *= -0.10000000149011612D;
|
||||||
|
this.motionZ *= -0.10000000149011612D;
|
||||||
|
this.rotationYaw += 180.0F;
|
||||||
|
this.prevRotationYaw += 180.0F;
|
||||||
|
this.ticksInAir = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.field_145791_d = movingobjectposition.blockX;
|
||||||
|
this.field_145792_e = movingobjectposition.blockY;
|
||||||
|
this.field_145789_f = movingobjectposition.blockZ;
|
||||||
|
this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||||
|
this.inData = arrow.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||||
|
this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX));
|
||||||
|
this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY));
|
||||||
|
this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ));
|
||||||
|
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||||
|
this.posX -= this.motionX / (double)f2 * 0.05000000074505806D;
|
||||||
|
this.posY -= this.motionY / (double)f2 * 0.05000000074505806D;
|
||||||
|
this.posZ -= this.motionZ / (double)f2 * 0.05000000074505806D;
|
||||||
|
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
|
||||||
|
this.inGround = true;
|
||||||
|
this.arrowShake = 7;
|
||||||
|
this.setIsCritical(false);
|
||||||
|
|
||||||
|
if (this.field_145790_g.getMaterial() != Material.air) {
|
||||||
|
this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrow.getIsCritical()) {
|
||||||
|
for (i = 0; i < 4; ++i) {
|
||||||
|
arrow.worldObj.spawnParticle("crit", arrow.posX + arrow.motionX * (double)i / 4.0D, arrow.posY + arrow.motionY * (double)i / 4.0D, arrow.posZ + arrow.motionZ * (double)i / 4.0D, -arrow.motionX, -arrow.motionY + 0.2D, -arrow.motionZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
arrow.posX += arrow.motionX;
|
||||||
|
arrow.posY += arrow.motionY;
|
||||||
|
arrow.posZ += arrow.motionZ;
|
||||||
|
f2 = MathHelper.sqrt_double(arrow.motionX * arrow.motionX + arrow.motionZ * arrow.motionZ);
|
||||||
|
arrow.rotationYaw = (float)(Math.atan2(arrow.motionX, arrow.motionZ) * 180.0D / Math.PI);
|
||||||
|
|
||||||
|
for (arrow.rotationPitch = (float)(Math.atan2(arrow.motionY, (double)f2) * 180.0D / Math.PI); arrow.rotationPitch - arrow.prevRotationPitch < -180.0F; arrow.prevRotationPitch -= 360.0F) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (arrow.rotationPitch - arrow.prevRotationPitch >= 180.0F) {
|
||||||
|
arrow.prevRotationPitch += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (arrow.rotationYaw - arrow.prevRotationYaw < -180.0F) {
|
||||||
|
arrow.prevRotationYaw -= 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (arrow.rotationYaw - arrow.prevRotationYaw >= 180.0F) {
|
||||||
|
arrow.prevRotationYaw += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
arrow.rotationPitch = arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * 0.2F;
|
||||||
|
arrow.rotationYaw = arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * 0.2F;
|
||||||
|
float f3 = 0.99F;
|
||||||
|
f1 = 0.05F;
|
||||||
|
|
||||||
|
if (arrow.isInWater()) {
|
||||||
|
for (int l = 0; l < 4; ++l) {
|
||||||
|
f4 = 0.25F;
|
||||||
|
arrow.worldObj.spawnParticle("bubble", arrow.posX - arrow.motionX * (double)f4, arrow.posY - arrow.motionY * (double)f4, arrow.posZ - arrow.motionZ * (double)f4, arrow.motionX, arrow.motionY, arrow.motionZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
f3 = 0.8F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrow.isWet()) {
|
||||||
|
arrow.extinguish();
|
||||||
|
}
|
||||||
|
|
||||||
|
arrow.motionX *= (double)f3;
|
||||||
|
arrow.motionY *= (double)f3;
|
||||||
|
arrow.motionZ *= (double)f3;
|
||||||
|
arrow.motionY -= (double)f1;
|
||||||
|
arrow.setPosition(arrow.posX, arrow.posY, arrow.posZ);
|
||||||
|
this.func_145775_I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,202 @@
|
|||||||
|
package com.zivilon.cinder_loe.mixins;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.entity.Nex;
|
||||||
|
import com.zivilon.cinder_loe.entity.NexMiniboss;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mixin(EntityLivingBase.class)
|
||||||
|
public abstract class MixinEntityLivingBase extends Entity {
|
||||||
|
@Shadow
|
||||||
|
protected int entityAge;
|
||||||
|
@Shadow
|
||||||
|
public int maxHurtTime;
|
||||||
|
@Shadow
|
||||||
|
public float attackedAtYaw;
|
||||||
|
@Shadow
|
||||||
|
protected EntityPlayer attackingPlayer;
|
||||||
|
@Shadow
|
||||||
|
protected int recentlyHit;
|
||||||
|
@Shadow
|
||||||
|
public int hurtTime;
|
||||||
|
@Shadow
|
||||||
|
public float prevHealth;
|
||||||
|
@Shadow
|
||||||
|
protected float lastDamage;
|
||||||
|
@Shadow
|
||||||
|
public int maxHurtResistantTime;
|
||||||
|
@Shadow
|
||||||
|
public float limbSwingAmount;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
protected abstract float getSoundPitch();
|
||||||
|
@Shadow
|
||||||
|
protected abstract float getSoundVolume();
|
||||||
|
@Shadow
|
||||||
|
protected abstract String getHurtSound();
|
||||||
|
@Shadow
|
||||||
|
public abstract void onDeath(DamageSource p_70645_1_);
|
||||||
|
@Shadow
|
||||||
|
protected abstract String getDeathSound();
|
||||||
|
@Shadow
|
||||||
|
public abstract float getHealth();
|
||||||
|
@Shadow
|
||||||
|
public abstract void knockBack(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_);
|
||||||
|
@Shadow
|
||||||
|
public abstract void setRevengeTarget(EntityLivingBase p_70604_1_);
|
||||||
|
@Shadow
|
||||||
|
protected abstract void damageEntity(DamageSource p_70665_1_, float p_70665_2_);
|
||||||
|
@Shadow
|
||||||
|
public abstract ItemStack getEquipmentInSlot(int p_71124_1_);
|
||||||
|
@Shadow
|
||||||
|
public abstract boolean isPotionActive(int p_82165_1_);
|
||||||
|
@Shadow
|
||||||
|
public abstract boolean isPotionActive(Potion p_70644_1_);
|
||||||
|
|
||||||
|
public MixinEntityLivingBase(World world) {
|
||||||
|
super(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shinare
|
||||||
|
* @reason Adding Nex fire damage modifiers
|
||||||
|
*/
|
||||||
|
@Overwrite
|
||||||
|
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
|
||||||
|
System.out.println(this.getCommandSenderName() + " received " + p_70097_2_ + " damage");
|
||||||
|
if (ForgeHooks.onLivingAttack((EntityLivingBase)(Object)this, p_70097_1_, p_70097_2_)) return false;
|
||||||
|
if (this.isEntityInvulnerable()) {
|
||||||
|
return false;
|
||||||
|
} else if (this.worldObj.isRemote) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
this.entityAge = 0;
|
||||||
|
|
||||||
|
if (this.getHealth() <= 0.0F) {
|
||||||
|
return false;
|
||||||
|
} else if (p_70097_1_.isFireDamage()) {
|
||||||
|
if ((EntityLivingBase)(Object)this instanceof Nex || (EntityLivingBase)(Object)this instanceof NexMiniboss) return false;
|
||||||
|
boolean fire_phase = Nex.is_nex_fire_phase_nearby((EntityLivingBase)(Object)this);
|
||||||
|
if (this.isPotionActive(Potion.fireResistance)) {
|
||||||
|
if (!fire_phase) return false;
|
||||||
|
p_70097_2_ *= 0.5F;
|
||||||
|
}
|
||||||
|
if (fire_phase) {
|
||||||
|
p_70097_2_ *= 3.0F;
|
||||||
|
List<EntityLivingBase> list = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(5, 5, 5));
|
||||||
|
for (EntityLivingBase entity : list) {
|
||||||
|
if (!(entity instanceof Nex || entity instanceof NexMiniboss)) {
|
||||||
|
entity.setFire(10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((p_70097_1_ == DamageSource.anvil || p_70097_1_ == DamageSource.fallingBlock) && this.getEquipmentInSlot(4) != null) {
|
||||||
|
this.getEquipmentInSlot(4).damageItem((int)(p_70097_2_ * 4.0F + this.rand.nextFloat() * p_70097_2_ * 2.0F), (EntityLivingBase)(Object)this);
|
||||||
|
p_70097_2_ *= 0.75F;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.limbSwingAmount = 1.5F;
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
if ((float)this.hurtResistantTime > (float)this.maxHurtResistantTime / 2.0F) {
|
||||||
|
if (p_70097_2_ <= this.lastDamage) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.damageEntity(p_70097_1_, p_70097_2_ - this.lastDamage);
|
||||||
|
this.lastDamage = p_70097_2_;
|
||||||
|
flag = false;
|
||||||
|
} else {
|
||||||
|
this.lastDamage = p_70097_2_;
|
||||||
|
this.prevHealth = this.getHealth();
|
||||||
|
this.hurtResistantTime = this.maxHurtResistantTime;
|
||||||
|
this.damageEntity(p_70097_1_, p_70097_2_);
|
||||||
|
this.hurtTime = this.maxHurtTime = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.attackedAtYaw = 0.0F;
|
||||||
|
Entity entity = p_70097_1_.getEntity();
|
||||||
|
|
||||||
|
if (entity != null) {
|
||||||
|
if (entity instanceof EntityLivingBase) {
|
||||||
|
this.setRevengeTarget((EntityLivingBase)entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity instanceof EntityPlayer) {
|
||||||
|
this.recentlyHit = 100;
|
||||||
|
this.attackingPlayer = (EntityPlayer)entity;
|
||||||
|
} else if (entity instanceof net.minecraft.entity.passive.EntityTameable) {
|
||||||
|
net.minecraft.entity.passive.EntityTameable entitywolf = (net.minecraft.entity.passive.EntityTameable)entity;
|
||||||
|
|
||||||
|
if (entitywolf.isTamed()) {
|
||||||
|
this.recentlyHit = 100;
|
||||||
|
this.attackingPlayer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
this.worldObj.setEntityState(this, (byte)2);
|
||||||
|
|
||||||
|
if (p_70097_1_ != DamageSource.drown) {
|
||||||
|
this.setBeenAttacked();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity != null) {
|
||||||
|
double d1 = entity.posX - this.posX;
|
||||||
|
double d0;
|
||||||
|
|
||||||
|
for (d0 = entity.posZ - this.posZ; d1 * d1 + d0 * d0 < 1.0E-4D; d0 = (Math.random() - Math.random()) * 0.01D) {
|
||||||
|
d1 = (Math.random() - Math.random()) * 0.01D;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.attackedAtYaw = (float)(Math.atan2(d0, d1) * 180.0D / Math.PI) - this.rotationYaw;
|
||||||
|
this.knockBack(entity, p_70097_2_, d1, d0);
|
||||||
|
} else {
|
||||||
|
this.attackedAtYaw = (float)((int)(Math.random() * 2.0D) * 180);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String s;
|
||||||
|
|
||||||
|
if (this.getHealth() <= 0.0F) {
|
||||||
|
s = this.getDeathSound();
|
||||||
|
|
||||||
|
if (flag && s != null) {
|
||||||
|
this.playSound(s, this.getSoundVolume(), this.getSoundPitch());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.onDeath(p_70097_1_);
|
||||||
|
} else {
|
||||||
|
s = this.getHurtSound();
|
||||||
|
|
||||||
|
if (flag && s != null) {
|
||||||
|
this.playSound(s, this.getSoundVolume(), this.getSoundPitch());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onStruckByLightning(EntityLightningBolt lightning) {
|
||||||
|
super.onStruckByLightning(lightning);
|
||||||
|
System.out.println(this.getCommandSenderName() + " was struck by lightning!");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,39 +0,0 @@
|
|||||||
package com.zivilon.cinder_loe.mixins;
|
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.Overwrite;
|
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
@Mixin(ItemBlock.class)
|
|
||||||
public abstract class MixinItemBlock {
|
|
||||||
|
|
||||||
@Shadow
|
|
||||||
public final Block field_150939_a;
|
|
||||||
|
|
||||||
public MixinItemBlock(Block block) {
|
|
||||||
this.field_150939_a = block;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Overwrite(remap = false)
|
|
||||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
|
|
||||||
|
|
||||||
System.out.println("Placing block with metadata " + metadata);
|
|
||||||
if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (world.getBlock(x, y, z) == field_150939_a) {
|
|
||||||
field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack);
|
|
||||||
field_150939_a.onPostBlockPlaced(world, x, y, z, metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.zivilon.cinder_loe.mixins;
|
||||||
|
|
||||||
|
import lotr.common.recipe.LOTRBrewingRecipes;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
@Mixin(LOTRBrewingRecipes.class)
|
||||||
|
public interface MixinLOTRBrewingRecipes {
|
||||||
|
|
||||||
|
@Invoker(value = "addBrewingRecipe", remap = false)
|
||||||
|
static void addRecipe(ItemStack result, Object... ingredients) {
|
||||||
|
throw new UnsupportedOperationException(); // This is just to satisfy the compiler; it won't be used.
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package com.zivilon.cinder_loe.mixins;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.potion.LoEPotions; // Needs to be implemented
|
||||||
|
|
||||||
|
import lotr.common.LOTRLevelData;
|
||||||
|
import lotr.common.LOTRMod;
|
||||||
|
import lotr.common.entity.ai.LOTREntityAINearestAttackableTargetBasic;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityCreature;
|
||||||
|
import net.minecraft.entity.ai.EntityAITarget;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
|
||||||
|
@Mixin(LOTREntityAINearestAttackableTargetBasic.class)
|
||||||
|
public abstract class MixinLOTREntityAINearestAttackableTargetBasic extends EntityAITarget {
|
||||||
|
|
||||||
|
public MixinLOTREntityAINearestAttackableTargetBasic(EntityCreature p_i1669_1_, boolean p_i1669_2_) {
|
||||||
|
super(p_i1669_1_, p_i1669_2_);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shinare
|
||||||
|
* @reason Added corrupting potion effect that makes all NPCs hostile
|
||||||
|
*/
|
||||||
|
@Overwrite(remap = false)
|
||||||
|
protected boolean isPlayerSuitableAlignmentTarget(EntityPlayer entityplayer) {
|
||||||
|
float alignment = LOTRLevelData.getData(entityplayer).getAlignment(LOTRMod.getNPCFaction((Entity)this.taskOwner));
|
||||||
|
if (entityplayer == null || LoEPotions.corrupting == null) return alignment < 0.0F;
|
||||||
|
boolean corrupting = entityplayer.isPotionActive(LoEPotions.corrupting); // Needs to be implemented
|
||||||
|
return (alignment < 0.0F || corrupting);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,259 @@
|
|||||||
|
package com.zivilon.cinder_loe.mixins;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
import lotr.common.item.LOTRWeaponStats;
|
||||||
|
import lotr.common.enchant.LOTREnchantmentHelper;
|
||||||
|
import lotr.common.entity.projectile.LOTREntityProjectileBase;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.IProjectile;
|
||||||
|
import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
|
import net.minecraft.entity.monster.EntityEnderman;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.network.Packet;
|
||||||
|
import net.minecraft.network.play.server.S2BPacketChangeGameState;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mixin(LOTREntityProjectileBase.class)
|
||||||
|
public abstract class MixinLOTREntityProjectileBase extends Entity {
|
||||||
|
|
||||||
|
public MixinLOTREntityProjectileBase(World world) {
|
||||||
|
super(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public abstract void setIsCritical(boolean p_70243_1_);
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public abstract boolean getIsCritical();
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public abstract float getSpeedReduction();
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public abstract String getImpactSound();
|
||||||
|
@Shadow(remap = false)
|
||||||
|
protected abstract void onCollideWithTarget(Entity entity);
|
||||||
|
@Shadow(remap = false)
|
||||||
|
protected abstract float getKnockbackFactor();
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public abstract ItemStack getProjectileItem();
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public abstract DamageSource getDamageSource();
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public abstract int maxTicksInGround();
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public abstract float getBaseImpactDamage(Entity paramEntity, ItemStack paramItemStack);
|
||||||
|
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private int xTile = -1;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private int yTile = -1;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private int zTile = -1;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private Block inTile;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private int inData;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private boolean inGround;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public int shake;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
public Entity shootingEntity;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private int ticksInGround;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private int ticksInAir;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private int knockbackStrength;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shinare
|
||||||
|
* @reason Having full knockbackResistance attribute now negates bonus knockback as well
|
||||||
|
*/
|
||||||
|
@Overwrite(remap = false)
|
||||||
|
public void func_70071_h_() {
|
||||||
|
super.onUpdate();
|
||||||
|
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
|
||||||
|
float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||||
|
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, f) * 180.0D / Math.PI);
|
||||||
|
}
|
||||||
|
Block block = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
|
||||||
|
if (block != Blocks.air) {
|
||||||
|
block.setBlockBoundsBasedOnState((IBlockAccess)this.worldObj, this.xTile, this.yTile, this.zTile);
|
||||||
|
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
|
||||||
|
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))
|
||||||
|
this.inGround = true;
|
||||||
|
}
|
||||||
|
if (this.shake > 0)
|
||||||
|
this.shake--;
|
||||||
|
if (this.inGround) {
|
||||||
|
Block j = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
|
||||||
|
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
|
||||||
|
if (j == this.inTile && k == this.inData) {
|
||||||
|
this.ticksInGround++;
|
||||||
|
if (this.ticksInGround >= maxTicksInGround())
|
||||||
|
setDead();
|
||||||
|
} else {
|
||||||
|
this.inGround = false;
|
||||||
|
this.motionX *= (this.rand.nextFloat() * 0.2F);
|
||||||
|
this.motionY *= (this.rand.nextFloat() * 0.2F);
|
||||||
|
this.motionZ *= (this.rand.nextFloat() * 0.2F);
|
||||||
|
this.ticksInGround = 0;
|
||||||
|
this.ticksInAir = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.ticksInAir++;
|
||||||
|
Vec3 vec3d = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||||
|
Vec3 vec3d1 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3d, vec3d1, false, true, false);
|
||||||
|
vec3d = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||||
|
vec3d1 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||||
|
if (movingobjectposition != null)
|
||||||
|
vec3d1 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||||
|
Entity entity = null;
|
||||||
|
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||||
|
double d = 0.0D;
|
||||||
|
int l;
|
||||||
|
for (l = 0; l < list.size(); l++) {
|
||||||
|
Entity entity1 = list.get(l);
|
||||||
|
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
|
||||||
|
float f5 = 0.3F;
|
||||||
|
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f5, f5, f5);
|
||||||
|
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3d, vec3d1);
|
||||||
|
if (movingobjectposition1 != null) {
|
||||||
|
double d1 = vec3d.distanceTo(movingobjectposition1.hitVec);
|
||||||
|
if (d1 < d || d == 0.0D) {
|
||||||
|
entity = entity1;
|
||||||
|
d = d1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entity != null)
|
||||||
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
|
if (movingobjectposition != null && movingobjectposition.entityHit instanceof EntityPlayer) {
|
||||||
|
EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
|
||||||
|
if (entityplayer.capabilities.disableDamage || (this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)))
|
||||||
|
movingobjectposition = null;
|
||||||
|
}
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
Entity hitEntity = movingobjectposition.entityHit;
|
||||||
|
if (hitEntity != null) {
|
||||||
|
ItemStack itemstack = getProjectileItem();
|
||||||
|
int damageInt = MathHelper.ceiling_double_int(getBaseImpactDamage(hitEntity, itemstack));
|
||||||
|
int fireAspect = 0;
|
||||||
|
if (itemstack != null)
|
||||||
|
if (this.shootingEntity instanceof EntityLivingBase && hitEntity instanceof EntityLivingBase) {
|
||||||
|
this.knockbackStrength += EnchantmentHelper.getKnockbackModifier((EntityLivingBase)this.shootingEntity, (EntityLivingBase)hitEntity);
|
||||||
|
} else {
|
||||||
|
this.knockbackStrength += LOTRWeaponStats.getTotalKnockback(itemstack);
|
||||||
|
}
|
||||||
|
if (getIsCritical())
|
||||||
|
damageInt += this.rand.nextInt(damageInt / 2 + 2);
|
||||||
|
double[] prevMotion = { hitEntity.motionX, hitEntity.motionY, hitEntity.motionZ };
|
||||||
|
DamageSource damagesource = getDamageSource();
|
||||||
|
if (hitEntity.attackEntityFrom(damagesource, damageInt)) {
|
||||||
|
double[] newMotion = { hitEntity.motionX, hitEntity.motionY, hitEntity.motionZ };
|
||||||
|
float kbf = getKnockbackFactor();
|
||||||
|
hitEntity.motionX = prevMotion[0] + (newMotion[0] - prevMotion[0]) * kbf;
|
||||||
|
hitEntity.motionY = prevMotion[1] + (newMotion[1] - prevMotion[1]) * kbf;
|
||||||
|
hitEntity.motionZ = prevMotion[2] + (newMotion[2] - prevMotion[2]) * kbf;
|
||||||
|
if (isBurning())
|
||||||
|
hitEntity.setFire(5);
|
||||||
|
if (hitEntity instanceof EntityLivingBase) {
|
||||||
|
EntityLivingBase hitEntityLiving = (EntityLivingBase)hitEntity;
|
||||||
|
double knockback_resistance = hitEntityLiving.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue();
|
||||||
|
if (this.knockbackStrength > 0 && knockback_resistance < 1.0D) {
|
||||||
|
float knockback = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
if (knockback > 0.0F)
|
||||||
|
hitEntityLiving.addVelocity(this.motionX * this.knockbackStrength * 0.6D / knockback, 0.1D, this.motionZ * this.knockbackStrength * 0.6D / knockback);
|
||||||
|
}
|
||||||
|
if (fireAspect > 0)
|
||||||
|
hitEntityLiving.setFire(fireAspect * 4);
|
||||||
|
if (this.shootingEntity instanceof EntityLivingBase) {
|
||||||
|
EnchantmentHelper.func_151384_a(hitEntityLiving, this.shootingEntity);
|
||||||
|
EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, (Entity)hitEntityLiving);
|
||||||
|
}
|
||||||
|
if (this.shootingEntity instanceof EntityPlayerMP && hitEntityLiving instanceof EntityPlayer)
|
||||||
|
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket((Packet)new S2BPacketChangeGameState(6, 0.0F));
|
||||||
|
}
|
||||||
|
this.worldObj.playSoundAtEntity(this, getImpactSound(), 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
|
||||||
|
onCollideWithTarget(hitEntity);
|
||||||
|
} else {
|
||||||
|
this.motionX *= -0.1D;
|
||||||
|
this.motionY *= -0.1D;
|
||||||
|
this.motionZ *= -0.1D;
|
||||||
|
this.rotationYaw += 180.0F;
|
||||||
|
this.prevRotationYaw += 180.0F;
|
||||||
|
this.ticksInAir = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.xTile = movingobjectposition.blockX;
|
||||||
|
this.yTile = movingobjectposition.blockY;
|
||||||
|
this.zTile = movingobjectposition.blockZ;
|
||||||
|
this.inTile = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
|
||||||
|
this.inData = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
|
||||||
|
this.motionX = (float)(movingobjectposition.hitVec.xCoord - this.posX);
|
||||||
|
this.motionY = (float)(movingobjectposition.hitVec.yCoord - this.posY);
|
||||||
|
this.motionZ = (float)(movingobjectposition.hitVec.zCoord - this.posZ);
|
||||||
|
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||||
|
this.posX -= this.motionX / f2 * 0.05D;
|
||||||
|
this.posY -= this.motionY / f2 * 0.05D;
|
||||||
|
this.posZ -= this.motionZ / f2 * 0.05D;
|
||||||
|
this.worldObj.playSoundAtEntity(this, getImpactSound(), 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
|
||||||
|
this.inGround = true;
|
||||||
|
this.shake = 7;
|
||||||
|
setIsCritical(false);
|
||||||
|
if (this.inTile.getMaterial() != Material.air)
|
||||||
|
this.inTile.onEntityCollidedWithBlock(this.worldObj, this.xTile, this.yTile, this.zTile, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (getIsCritical())
|
||||||
|
for (l = 0; l < 4; l++)
|
||||||
|
this.worldObj.spawnParticle("crit", this.posX + this.motionX * l / 4.0D, this.posY + this.motionY * l / 4.0D, this.posZ + this.motionZ * l / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ);
|
||||||
|
this.posX += this.motionX;
|
||||||
|
this.posY += this.motionY;
|
||||||
|
this.posZ += this.motionZ;
|
||||||
|
float f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||||
|
for (this.rotationPitch = (float)(Math.atan2(this.motionY, f3) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F);
|
||||||
|
for (; this.rotationPitch - this.prevRotationPitch >= 180.0F; this.prevRotationPitch += 360.0F);
|
||||||
|
for (; this.rotationYaw - this.prevRotationYaw < -180.0F; this.prevRotationYaw -= 360.0F);
|
||||||
|
for (; this.rotationYaw - this.prevRotationYaw >= 180.0F; this.prevRotationYaw += 360.0F);
|
||||||
|
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
|
||||||
|
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
|
||||||
|
float f4 = getSpeedReduction();
|
||||||
|
if (isInWater()) {
|
||||||
|
for (int k1 = 0; k1 < 4; k1++) {
|
||||||
|
float f7 = 0.25F;
|
||||||
|
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f7, this.posY - this.motionY * f7, this.posZ - this.motionZ * f7, this.motionX, this.motionY, this.motionZ);
|
||||||
|
}
|
||||||
|
f4 = 0.8F;
|
||||||
|
}
|
||||||
|
this.motionX *= f4;
|
||||||
|
this.motionY *= f4;
|
||||||
|
this.motionZ *= f4;
|
||||||
|
this.motionY -= 0.05000000074505806D;
|
||||||
|
setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
func_145775_I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,21 +1,200 @@
|
|||||||
package com.zivilon.cinder_loe.mixins;
|
package com.zivilon.cinder_loe.mixins;
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.client.render.item.RenderHelper;
|
import com.zivilon.cinder_loe.client.render.item.RenderHelper;
|
||||||
|
import com.zivilon.cinder_loe.items.Nimveil;
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
import lotr.client.render.item.LOTRRenderLargeItem;
|
import lotr.client.render.item.LOTRRenderLargeItem;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.client.resources.IResource;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.StringUtils;
|
||||||
|
|
||||||
|
import net.minecraftforge.client.IItemRenderer;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Mixin(LOTRRenderLargeItem.class)
|
@Mixin(LOTRRenderLargeItem.class)
|
||||||
public abstract class MixinLOTRRenderLargeItem {
|
public abstract class MixinLOTRRenderLargeItem {
|
||||||
|
private static IIcon[] nimveil_icons;
|
||||||
|
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private Item theItem;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private IIcon largeIcon;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private String folderName;
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private static Map<String, Float> sizeFolders;
|
||||||
|
|
||||||
|
@Shadow(remap = false)
|
||||||
|
private static ResourceLocation getLargeTexturePath(Item item, String folder) {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shinare
|
||||||
|
* @reason Added support for transparent textures
|
||||||
|
*/
|
||||||
@Redirect(method = "renderLargeItem(Lnet/minecraft/util/IIcon;)V", remap = false,
|
@Redirect(method = "renderLargeItem(Lnet/minecraft/util/IIcon;)V", remap = false,
|
||||||
at = @At(value = "INVOKE",
|
at = @At(value = "INVOKE",
|
||||||
target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V"))
|
target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V"))
|
||||||
private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) {
|
private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) {
|
||||||
RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false);
|
RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
@Inject(method = "registerLargeIcon", at = @At("HEAD"), cancellable = true, remap = false)
|
||||||
|
public void temp(IIconRegister register, String extra, CallbackInfoReturnable<IIcon> ci) {
|
||||||
|
System.out.println("Registering icon with folder " + this.folderName);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shinare
|
||||||
|
* @reason Added support for NBT based subtyping for Nimveil
|
||||||
|
*/
|
||||||
|
@Overwrite(remap = false)
|
||||||
|
private IIcon registerLargeIcon(IIconRegister register, String extra) {
|
||||||
|
String prefix = "lotr:";
|
||||||
|
if (this.theItem instanceof Nimveil) {
|
||||||
|
String itemName = "lotr:nimveil";
|
||||||
|
itemName = itemName.substring(itemName.indexOf(prefix) + prefix.length());
|
||||||
|
String path = prefix + this.folderName + "/" + itemName;
|
||||||
|
nimveil_icons = new IIcon[10];
|
||||||
|
nimveil_icons[0] = register.registerIcon(path + "_valar");
|
||||||
|
nimveil_icons[1] = register.registerIcon(path + "_mortals");
|
||||||
|
nimveil_icons[2] = register.registerIcon(path + "_udun");
|
||||||
|
nimveil_icons[3] = register.registerIcon(path + "_sauron");
|
||||||
|
nimveil_icons[4] = register.registerIcon(path + "_ancient");
|
||||||
|
nimveil_icons[5] = register.registerIcon(path + "_valar_glow");
|
||||||
|
nimveil_icons[6] = register.registerIcon(path + "_mortals_glow");
|
||||||
|
nimveil_icons[7] = register.registerIcon(path + "_udun_glow");
|
||||||
|
nimveil_icons[8] = register.registerIcon(path + "_sauron_glow");
|
||||||
|
nimveil_icons[9] = register.registerIcon(path + "_ancient_glow");
|
||||||
|
System.out.println("Registering large icon for " + this.theItem.getClass().getSimpleName() + " at " + path);
|
||||||
|
return nimveil_icons[0];
|
||||||
|
} else {
|
||||||
|
String itemName = this.theItem.getUnlocalizedName();
|
||||||
|
itemName = itemName.substring(itemName.indexOf(prefix) + prefix.length());
|
||||||
|
String path = prefix + this.folderName + "/" + itemName;
|
||||||
|
if (!StringUtils.isNullOrEmpty(extra))
|
||||||
|
path = path + "_" + extra;
|
||||||
|
System.out.println("Registering large icon for " + this.theItem.getClass().getSimpleName() + " at " + path);
|
||||||
|
return register.registerIcon(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shinare
|
||||||
|
* @reason Added support for NBT based subtyping for Nimveil
|
||||||
|
*/
|
||||||
|
@Overwrite(remap = false)
|
||||||
|
public static LOTRRenderLargeItem getRendererIfLarge(Item item) {
|
||||||
|
if (item instanceof Nimveil)
|
||||||
|
return new LOTRRenderLargeItem(item, "large", 2.0F);
|
||||||
|
for (String folder : sizeFolders.keySet()) {
|
||||||
|
float iconScale = ((Float)sizeFolders.get(folder)).floatValue();
|
||||||
|
try {
|
||||||
|
ResourceLocation resLoc = getLargeTexturePath(item, folder);
|
||||||
|
IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resLoc);
|
||||||
|
if (res != null)
|
||||||
|
return new LOTRRenderLargeItem(item, folder, iconScale);
|
||||||
|
} catch (IOException iOException) {}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Shinare
|
||||||
|
* @reason Added support for NBT based subtyping for Nimveil
|
||||||
|
*/
|
||||||
|
@Inject(method = "renderItem",
|
||||||
|
at = @At(value = "HEAD"),
|
||||||
|
cancellable = true, remap = false)
|
||||||
|
public void getNimveilIcon(IItemRenderer.ItemRenderType type, ItemStack itemstack, Object[] data, CallbackInfo ci) {
|
||||||
|
if (itemstack.getItem() instanceof Nimveil) {
|
||||||
|
int icon_index = 0;
|
||||||
|
if (Nimveil.get_state(itemstack) != 0)
|
||||||
|
icon_index += 5;
|
||||||
|
switch(Nimveil.get_variant(itemstack)) {
|
||||||
|
case "valar":
|
||||||
|
break;
|
||||||
|
case "mortals":
|
||||||
|
icon_index += 1;
|
||||||
|
break;
|
||||||
|
case "udun":
|
||||||
|
icon_index += 2;
|
||||||
|
break;
|
||||||
|
case "sauron":
|
||||||
|
icon_index += 3;
|
||||||
|
break;
|
||||||
|
case "ancient":
|
||||||
|
icon_index += 4;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.largeIcon = nimveil_icons[0];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.largeIcon = nimveil_icons[icon_index];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
|
||||||
|
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack itemstack, Object... data) {
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
Entity holder = (Entity)data[1];
|
||||||
|
boolean isFirstPerson = (holder == (Minecraft.getMinecraft()).thePlayer && (Minecraft.getMinecraft()).gameSettings.thirdPersonView == 0);
|
||||||
|
Item item = itemstack.getItem();
|
||||||
|
if (item instanceof lotr.common.item.LOTRItemSpear && holder instanceof EntityPlayer && ((EntityPlayer)holder).getItemInUse() == itemstack) {
|
||||||
|
GL11.glRotatef(260.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
GL11.glTranslatef(-1.0F, 0.0F, 0.0F);
|
||||||
|
}
|
||||||
|
if (item instanceof lotr.common.item.LOTRItemPike && holder instanceof EntityLivingBase) {
|
||||||
|
EntityLivingBase entityliving = (EntityLivingBase)holder;
|
||||||
|
if (entityliving.getHeldItem() == itemstack && entityliving.swingProgress <= 0.0F)
|
||||||
|
if (entityliving.isSneaking()) {
|
||||||
|
if (isFirstPerson) {
|
||||||
|
GL11.glRotatef(270.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
GL11.glTranslatef(-1.0F, 0.0F, 0.0F);
|
||||||
|
} else {
|
||||||
|
GL11.glTranslatef(0.0F, -0.1F, 0.0F);
|
||||||
|
GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
}
|
||||||
|
} else if (!isFirstPerson) {
|
||||||
|
GL11.glTranslatef(0.0F, -0.3F, 0.0F);
|
||||||
|
GL11.glRotatef(40.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (item instanceof lotr.common.item.LOTRItemLance && holder instanceof EntityLivingBase) {
|
||||||
|
EntityLivingBase entityliving = (EntityLivingBase)holder;
|
||||||
|
if (entityliving.getHeldItem() == itemstack)
|
||||||
|
if (isFirstPerson) {
|
||||||
|
GL11.glRotatef(260.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
GL11.glTranslatef(-1.0F, 0.0F, 0.0F);
|
||||||
|
} else {
|
||||||
|
GL11.glTranslatef(0.7F, 0.0F, 0.0F);
|
||||||
|
GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
GL11.glTranslatef(-1.0F, 0.0F, 0.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
renderLargeItem();
|
||||||
|
if (itemstack != null && itemstack.hasEffect(0))
|
||||||
|
LOTRClientProxy.renderEnchantmentEffect();
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}*/
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.zivilon.cinder_loe.potion;
|
||||||
|
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class LoEPotions {
|
||||||
|
public static Potion corrupting;
|
||||||
|
|
||||||
|
public static void registerPotions() {
|
||||||
|
corrupting = new PotionCorrupting(31, false, 0x7F0000).setPotionName("potion.corrupting");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PotionCorrupting extends Potion {
|
||||||
|
public PotionCorrupting(int id, boolean isBadEffect, int liquidColor) {
|
||||||
|
super(id, isBadEffect, liquidColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void performEffect(EntityLivingBase entity, int amplifier) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isReady(int duration, int amplifier) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.zivilon.cinder_loe.recipe;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ForgingRecipe {
|
||||||
|
|
||||||
|
public boolean isBlessed;
|
||||||
|
public ItemStack leftInput;
|
||||||
|
public ItemStack middleInput;
|
||||||
|
public ItemStack rightInput;
|
||||||
|
public ItemStack output;
|
||||||
|
|
||||||
|
public ForgingRecipe(ItemStack leftInput, ItemStack middleInput, ItemStack rightInput, ItemStack output, boolean isBlessed) {
|
||||||
|
this.leftInput = leftInput;
|
||||||
|
this.middleInput = middleInput;
|
||||||
|
this.rightInput = rightInput;
|
||||||
|
this.output = output;
|
||||||
|
this.isBlessed = isBlessed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean matches(ItemStack left, ItemStack middle, ItemStack right, boolean isBlessedHammer) {
|
||||||
|
if (this.isBlessed && !isBlessedHammer) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return matchesItem(leftInput, left) &&
|
||||||
|
matchesItem(middleInput, middle) &&
|
||||||
|
matchesItem(rightInput, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean matchesItem(ItemStack recipeInput, ItemStack stationInput) {
|
||||||
|
if (recipeInput == null && stationInput == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (recipeInput == null || stationInput == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return recipeInput.getItem() == stationInput.getItem() &&
|
||||||
|
recipeInput.getItemDamage() == stationInput.getItemDamage();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getOutput() {
|
||||||
|
return output.copy();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSafeName(ItemStack stack) {
|
||||||
|
if (stack == null) return "null";
|
||||||
|
return stack.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void printRecipeDetails(ForgingRecipe recipe) {
|
||||||
|
System.out.println("Left: " + getSafeName(recipe.leftInput));
|
||||||
|
System.out.println("Middle: " + getSafeName(recipe.middleInput));
|
||||||
|
System.out.println("Right: " + getSafeName(recipe.rightInput));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
package com.zivilon.cinder_loe.recipe;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.CinderLoE;
|
||||||
|
import com.zivilon.cinder_loe.items.Nimveil;
|
||||||
|
import com.zivilon.cinder_loe.util.Utilities;
|
||||||
|
|
||||||
|
import lotr.common.enchant.LOTREnchantment;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ForgingRecipes {
|
||||||
|
public static List<ForgingRecipe> recipes = new ArrayList();
|
||||||
|
|
||||||
|
public static void register_recipe(ForgingRecipe recipe) {
|
||||||
|
recipes.add(recipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void register_recipes() {
|
||||||
|
register_recipe(new ForgingRecipe(
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 2),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 1),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 0),
|
||||||
|
Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "valar"),
|
||||||
|
true
|
||||||
|
));
|
||||||
|
register_recipe(new ForgingRecipe(
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 3),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 1),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 0),
|
||||||
|
Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "mortals"),
|
||||||
|
true
|
||||||
|
));
|
||||||
|
register_recipe(new ForgingRecipe(
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 4),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 1),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 0),
|
||||||
|
Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "udun"),
|
||||||
|
true
|
||||||
|
));
|
||||||
|
register_recipe(new ForgingRecipe(
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 5),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 1),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 0),
|
||||||
|
Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "sauron"),
|
||||||
|
true
|
||||||
|
));
|
||||||
|
register_recipe(new ForgingRecipe(
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 6),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 1),
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 0),
|
||||||
|
Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "ancient"),
|
||||||
|
true
|
||||||
|
));
|
||||||
|
register_recipe(new ForgingRecipe(
|
||||||
|
null,
|
||||||
|
new ItemStack(CinderLoE.nimveil, 1),
|
||||||
|
null,
|
||||||
|
new ItemStack(CinderLoE.nimveilPart, 1, 1),
|
||||||
|
true
|
||||||
|
));
|
||||||
|
register_recipe(new ForgingRecipe(
|
||||||
|
new ItemStack(CinderLoE.weaponPart, 1, 0),
|
||||||
|
new ItemStack(CinderLoE.weaponPart, 1, 1),
|
||||||
|
new ItemStack(CinderLoE.weaponPart, 1, 2),
|
||||||
|
deceiver_blade(),
|
||||||
|
false
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemStack deceiver_blade() {
|
||||||
|
ItemStack blade = new ItemStack(CinderLoE.deceiverBlade, 1);
|
||||||
|
Utilities.setAppliedRandomEnchants(blade);
|
||||||
|
Utilities.setLOTREnchant(blade, LOTREnchantment.strong4);
|
||||||
|
Utilities.setLOTREnchant(blade, LOTREnchantment.meleeSpeed1);
|
||||||
|
Utilities.setLOTREnchant(blade, LOTREnchantment.meleeReach1);
|
||||||
|
return blade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<ForgingRecipe> getAllRecipes() {
|
||||||
|
return recipes;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,127 @@
|
|||||||
|
package com.zivilon.cinder_loe.tileentity;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.network.NetworkManager;
|
||||||
|
import net.minecraft.network.Packet;
|
||||||
|
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
|
||||||
|
public class TileEntityForgingStation extends TileEntity {
|
||||||
|
|
||||||
|
public ItemStack leftItem;
|
||||||
|
public ItemStack middleItem;
|
||||||
|
public ItemStack rightItem;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getRenderBoundingBox() {
|
||||||
|
return AxisAlignedBB.getBoundingBox(
|
||||||
|
xCoord - 1, yCoord, zCoord - 1,
|
||||||
|
xCoord + 2, yCoord + 1, zCoord + 2
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Packet getDescriptionPacket() {
|
||||||
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
|
writeToNBT(tag);
|
||||||
|
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||||
|
readFromNBT(pkt.func_148857_g());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Getters and Setters for the items
|
||||||
|
public ItemStack getLeftItem() {
|
||||||
|
return leftItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeftItem(ItemStack leftItem) {
|
||||||
|
this.leftItem = leftItem;
|
||||||
|
markDirty(); // Mark the tile entity as dirty to ensure the world saves the changes
|
||||||
|
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getMiddleItem() {
|
||||||
|
return middleItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMiddleItem(ItemStack middleItem) {
|
||||||
|
this.middleItem = middleItem;
|
||||||
|
markDirty(); // Mark the tile entity as dirty to ensure the world saves the changes
|
||||||
|
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getRightItem() {
|
||||||
|
return rightItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRightItem(ItemStack rightItem) {
|
||||||
|
this.rightItem = rightItem;
|
||||||
|
markDirty(); // Mark the tile entity as dirty to ensure the world saves the changes
|
||||||
|
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method to write data to NBT
|
||||||
|
@Override
|
||||||
|
public void writeToNBT(NBTTagCompound compound) {
|
||||||
|
super.writeToNBT(compound);
|
||||||
|
|
||||||
|
if (leftItem != null) {
|
||||||
|
NBTTagCompound leftTag = new NBTTagCompound();
|
||||||
|
leftItem.writeToNBT(leftTag);
|
||||||
|
compound.setTag("LeftItem", leftTag);
|
||||||
|
} else {
|
||||||
|
compound.removeTag("LeftItem");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (middleItem != null) {
|
||||||
|
NBTTagCompound middleTag = new NBTTagCompound();
|
||||||
|
middleItem.writeToNBT(middleTag);
|
||||||
|
compound.setTag("MiddleItem", middleTag);
|
||||||
|
} else {
|
||||||
|
compound.removeTag("MiddleItem");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rightItem != null) {
|
||||||
|
NBTTagCompound rightTag = new NBTTagCompound();
|
||||||
|
rightItem.writeToNBT(rightTag);
|
||||||
|
compound.setTag("RightItem", rightTag);
|
||||||
|
} else {
|
||||||
|
compound.removeTag("RightItem");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Method to read data from NBT
|
||||||
|
@Override
|
||||||
|
public void readFromNBT(NBTTagCompound compound) {
|
||||||
|
super.readFromNBT(compound);
|
||||||
|
|
||||||
|
if (compound.hasKey("LeftItem")) {
|
||||||
|
NBTTagCompound leftTag = compound.getCompoundTag("LeftItem");
|
||||||
|
leftItem = ItemStack.loadItemStackFromNBT(leftTag);
|
||||||
|
} else {
|
||||||
|
leftItem = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (compound.hasKey("MiddleItem")) {
|
||||||
|
NBTTagCompound middleTag = compound.getCompoundTag("MiddleItem");
|
||||||
|
middleItem = ItemStack.loadItemStackFromNBT(middleTag);
|
||||||
|
} else {
|
||||||
|
middleItem = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (compound.hasKey("RightItem")) {
|
||||||
|
NBTTagCompound rightTag = compound.getCompoundTag("RightItem");
|
||||||
|
rightItem = ItemStack.loadItemStackFromNBT(rightTag);
|
||||||
|
} else {
|
||||||
|
rightItem = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,7 +0,0 @@
|
|||||||
package com.zivilon.cinder_loe.tileentity;
|
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
public class TileEntityNexIceCrystal extends TileEntity {
|
|
||||||
// Add any data or logic specific to the tile entity here
|
|
||||||
}
|
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package com.zivilon.cinder_loe.tileentity;
|
||||||
|
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
public class TileEntityShadowTile extends TileEntity {
|
||||||
|
public long spawnTime;
|
||||||
|
public static long REMOVAL_DELAY_MS = 15000;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEntity() {
|
||||||
|
if (!worldObj.isRemote) {
|
||||||
|
if (spawnTime == 0) {
|
||||||
|
spawnTime = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
long currentTime = System.currentTimeMillis();
|
||||||
|
if (currentTime >= spawnTime + REMOVAL_DELAY_MS) {
|
||||||
|
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||||
|
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); // Force the client to update
|
||||||
|
worldObj.removeTileEntity(xCoord, yCoord, zCoord); // Clean up the tile entity
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
|
super.writeToNBT(nbt);
|
||||||
|
nbt.setLong("spawnTime", spawnTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
|
super.readFromNBT(nbt);
|
||||||
|
spawnTime = nbt.getLong("spawnTime");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.zivilon.cinder_loe.util;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.entity.Nex;
|
||||||
|
|
||||||
|
public class VT_additions {
|
||||||
|
public static String applyCustomPlaceholders(String scriptLine) {
|
||||||
|
scriptLine = scriptLine.replace("<nexphase>", String.valueOf(Nex.get_nex_phase()));
|
||||||
|
scriptLine = scriptLine.replace("<nexhealth>", String.valueOf(Nex.get_nex_health()));
|
||||||
|
return scriptLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 698 B |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 919 B |
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"animation": {
|
||||||
|
"frames": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
4,
|
||||||
|
4,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 659 B |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"animation":{"frametime":3}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
"animation": {
|
||||||
|
"frames": [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
12,
|
||||||
|
12,
|
||||||
|
12,
|
||||||
|
13,
|
||||||
|
13,
|
||||||
|
13,
|
||||||
|
14,
|
||||||
|
14,
|
||||||
|
14,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 5.5 KiB |
@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
"animation": {
|
||||||
|
"frames": [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
12,
|
||||||
|
12,
|
||||||
|
12,
|
||||||
|
13,
|
||||||
|
13,
|
||||||
|
13,
|
||||||
|
14,
|
||||||
|
14,
|
||||||
|
14,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15,
|
||||||
|
15
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 5.7 KiB |