2
0
Fork 0

Reverting bad update

frozen
Shinare 2 years ago
parent e59c5ede38
commit 344c89dad4

File diff suppressed because it is too large Load Diff

@ -1,38 +0,0 @@
package com.zivilon.cinder_loe;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import java.io.File;
import net.minecraftforge.common.config.Configuration;
public class CinderLoE_Config {
public static Configuration config;
public static float enchantment_color_red;
public static float enchantment_color_green;
public static float enchantment_color_blue;
public static void init(FMLPreInitializationEvent event) {
File configFile = new File(event.getModConfigurationDirectory(), "CinderLoE.cfg");
config = new Configuration(configFile);
syncConfig();
}
public static void syncConfig() {
try {
// Load the configuration file
config.load();
// Read properties, define categories and keys
enchantment_color_red = config.getFloat("EnchantmentColorRed", Configuration.CATEGORY_GENERAL, 0.38f, 0.0f, 1.0f, "Configure red color for enchantments");
enchantment_color_green = config.getFloat("EnchantmentColorGreen", Configuration.CATEGORY_GENERAL, 0.19f, 0.0f, 1.0f, "Configure green color for enchantments");
enchantment_color_blue = config.getFloat("EnchantmentColorBlue", Configuration.CATEGORY_GENERAL, 0.608f, 0.0f, 1.0f, "Configure blue color for enchantments");
// Save the configuration if it has changed
if (config.hasChanged()) {
config.save();
}
} catch (Exception e) {
}
}
}

@ -1,32 +0,0 @@
package com.zivilon.cinder_loe;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.Item;
import cpw.mods.fml.common.registry.GameRegistry;
public class ItemRegistration {
public static List<SimpleEntry<Item, String>> list = new ArrayList<>();
public static void registerItem(Item item, String item_name, int ordinal) {
while (list.size() <= ordinal) {
list.add(new SimpleEntry<>(null, null));
}
list.set(ordinal, new SimpleEntry<>(item, item_name));
}
// Register items in consistent order that persists through mod updates while enabling us to keep the item lists neatly organized.
// Unknown if this is actually necessary, but might help to prevent item ID shifts
public static void registerItems() {
for (int i = 0; i < list.size(); i++) {
SimpleEntry<Item, String> entry = list.get(i);
if (entry == null || entry.getKey() == null || entry.getValue() == null) {
break;
}
GameRegistry.registerItem(entry.getKey(), entry.getValue());
}
}
}

@ -1,69 +0,0 @@
package com.zivilon.cinder_loe;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import lotr.common.item.LOTRMaterial;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Field;
import com.zivilon.cinder_loe.CinderLoE;
public class Materials {
public static void registerMaterials() {
modifyMaterial("RED_DWARF", 700, 3.0F, 0.7F, 3, 7.0F, 10, CinderLoE.redDwarfSteel);
modifyMaterial("WIZARD", 1000, 3.0F, 0.7F, 3, 7.0F, 10, null);
modifyMaterial("LIMWAITH_BONE", 250, 2.0F, 0.7F, 2, 6.0F, 10, null);
modifyMaterial("BONEMOLD", 350, 2.0F, 0.6F, 2, 6.0F, 10, CinderLoE.bonemold);
modifyMaterial("LIMWAITH_WOOD", 230, 1.5F, 0.5F, 2, 5.0F, 10, null);
modifyMaterial("EVENT", 2400, 5.0F, 0.0F, 0, 9.0F, 10, null);
modifyMaterial("BREE", 350, 2.5F, 0.6F, 2, 6.0F, 10, Items.iron_ingot);
modifyMaterial("BATTLENUN", 300, 3F, 0.6F, 2, 6.0F, 10, Items.iron_ingot);
modifyMaterial("ASH", 2000, 4.25F, 0.6F, 2, 7.0F, 10, CinderLoE.ingotAsh);
}
public static void modifyMaterial(String fieldName, int uses, float weapon_damage, float protection, int harvest_level, float speed, int enchantability, Item crafting_item) {
try {
Class<?> lotrMaterialClass = Class.forName("lotr.common.item.LOTRMaterial");
Field materialField = lotrMaterialClass.getField(fieldName);
// Reflection to access and instantiate the private constructor of LOTRMaterial
Constructor<?> constructor = lotrMaterialClass.getDeclaredConstructor(String.class);
constructor.setAccessible(true);
Object materialLocal = constructor.newInstance(fieldName);
// Reflection to call the private methods on the new instance
Method setUses = lotrMaterialClass.getDeclaredMethod("setUses", int.class);
Method setDamage = lotrMaterialClass.getDeclaredMethod("setDamage", float.class);
Method setProtection = lotrMaterialClass.getDeclaredMethod("setProtection", float.class);
Method setHarvestLevel = lotrMaterialClass.getDeclaredMethod("setHarvestLevel", int.class);
Method setSpeed = lotrMaterialClass.getDeclaredMethod("setSpeed", float.class);
Method setEnchantability = lotrMaterialClass.getDeclaredMethod("setEnchantability", int.class);
Method setCraftingItem = lotrMaterialClass.getDeclaredMethod("setCraftingItem", Item.class);
setUses.setAccessible(true);
setDamage.setAccessible(true);
setProtection.setAccessible(true);
setHarvestLevel.setAccessible(true);
setSpeed.setAccessible(true);
setEnchantability.setAccessible(true);
setCraftingItem.setAccessible(true);
setUses.invoke(materialLocal, uses);
setDamage.invoke(materialLocal, weapon_damage);
setProtection.invoke(materialLocal, protection);
setHarvestLevel.invoke(materialLocal, harvest_level);
setSpeed.invoke(materialLocal, speed);
setEnchantability.invoke(materialLocal, enchantability);
if (crafting_item != null) {
setCraftingItem.invoke(materialLocal, crafting_item);
}
materialField.set(null, materialLocal);
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -1,51 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPane;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import lotr.common.LOTRCreativeTabs;
import lotr.common.block.LOTRBlockOrcChain;
import lotr.common.block.LOTRBlockPane;
import com.zivilon.cinder_loe.util.Utilities;
public abstract class BarsBase extends BlockPane {
public String textureName;
protected IIcon icon;
public BarsBase(String blockName) {
super("", "", Material.iron, true);
this.textureName = Utilities.toSnakeCase(blockName);
this.setBlockName(blockName);
setCreativeTab((CreativeTabs)LOTRCreativeTabs.tabDeco);
setHardness(5.0F);
setResistance(10.0F);
setStepSound(Block.soundTypeMetal);
}
public void registerBlockIcons(IIconRegister iconregister) {
this.icon = iconregister.registerIcon(textureName);
System.out.println("Registering texture " + textureName);
}
public IIcon getIcon() {
return this.icon;
}
public IIcon getIcon(int i, int j) {
return this.icon;
}
public IIcon func_150097_e() {
return this.icon;
}
}

@ -1,37 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import lotr.common.LOTRCreativeTabs;
import java.lang.reflect.Field;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockRedDwarfSteel extends Block {
public BlockRedDwarfSteel() {
super(Material.iron); // Choose the appropriate material
try {
Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabBlock"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to
LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null);
setCreativeTab((CreativeTabs)tab);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
setHardness(5.0F);
setResistance(15.0F);
setStepSound(Block.soundTypeMetal);
setBlockTextureName("lotr:red_dwarf_steel");
setBlockName("lotr:blockRedDwarfSteel");
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("lotr:red_dwarf_steel");
}
}

@ -1,105 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import lotr.common.LOTRCreativeTabs;
import lotr.common.block.LOTRBlockOrcChain;
import com.zivilon.cinder_loe.util.Utilities;
public abstract class ChandelierBase extends Block {
public String textureName;
public IIcon icon;
public ChandelierBase(String blockName) {
super(Material.circuits);
this.textureName = Utilities.toSnakeCase(blockName);
this.setBlockName(blockName);
setCreativeTab((CreativeTabs)LOTRCreativeTabs.tabDeco);
setHardness(0.0F);
setResistance(2.0F);
setStepSound(Block.soundTypeMetal);
setLightLevel(0.9375F);
setBlockBounds(0.0625F, 0.1875F, 0.0625F, 0.9375F, 1.0F, 0.9375F);
}
public IIcon getIcon(int i, int j) {
return this.icon;
}
@Override
public void registerBlockIcons(IIconRegister reg) {
icon = reg.registerIcon(this.textureName);
}
public boolean isOpaqueCube() {
return false;
}
public boolean renderAsNormalBlock() {
return false;
}
public int getRenderType() {
return 1;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) {
return null;
}
public boolean canBlockStay(World world, int i, int j, int k) {
Block block = world.getBlock(i, j + 1, k);
int meta = world.getBlockMetadata(i, j + 1, k);
if (block instanceof net.minecraft.block.BlockFence || block instanceof net.minecraft.block.BlockWall)
return true;
if (block instanceof net.minecraft.block.BlockSlab && !block.isOpaqueCube() && (meta & 0x8) == 0)
return true;
if (block instanceof net.minecraft.block.BlockStairs && (meta & 0x4) == 0)
return true;
if (block instanceof LOTRBlockOrcChain)
return true;
return world.getBlock(i, j + 1, k).isSideSolid((IBlockAccess)world, i, j + 1, k, ForgeDirection.DOWN);
}
public boolean canPlaceBlockAt(World world, int i, int j, int k) {
return canBlockStay(world, i, j, k);
}
public void onNeighborBlockChange(World world, int i, int j, int k, Block block) {
if (!canBlockStay(world, i, j, k)) {
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockToAir(i, j, k);
}
}
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int i, int j, int k, Random random) {
double d = 0.13D;
double d1 = 1.0D - d;
double d2 = 0.6875D;
spawnChandelierParticles(world, i + d, j + d2, k + d);
spawnChandelierParticles(world, i + d1, j + d2, k + d1);
spawnChandelierParticles(world, i + d, j + d2, k + d1);
spawnChandelierParticles(world, i + d1, j + d2, k + d);
}
private void spawnChandelierParticles(World world, double d, double d1, double d2) {
world.spawnParticle("smoke", d, d1, d2, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", d, d1, d2, 0.0D, 0.0D, 0.0D);
}
}

@ -1,32 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class CinderBlock extends Block {
public CinderBlock() {
super(Material.rock);
setHardness(2.0F);
setResistance(5.0F);
setBlockTextureName("lotr:cinder_block");
setBlockName("lotr:cinderBlock");
setLightLevel(0.25F);
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("lotr:cinder_block");
}
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
entity.setFire(20);
}
}

@ -1,23 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import lotr.common.LOTRCreativeTabs;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.IIcon;
import java.lang.reflect.Field;
public class FishBarrel extends StaticBlockBase3 {
public FishBarrel() {
super(Material.wood, "lotr:fishbarrel");
setStepSound(Block.soundTypeWood);
setBlockName("lotr:fishbarrel");
setHardness(1.0F);
setResistance(2.0F);
}
}

@ -1,16 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import com.zivilon.cinder_loe.blocks.RotatableBlockBase3;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class FurBundle extends RotatableBlockBase3 {
public FurBundle() {
super(Material.cloth, "lotr:furBundle");
setStepSound(Block.soundTypeCloth);
setBlockName("lotr:furBundle");
setHardness(0.5F);
setResistance(0.5F);
}
}

@ -1,17 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import com.zivilon.cinder_loe.blocks.RotatableBlockBase2;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
public class IvoryBlock extends RotatableBlockBase2 {
public IvoryBlock() {
super(Material.rock, "lotr:ivoryBlock");
setStepSound(Block.soundTypeStone);
setBlockName("lotr:ivoryBlock");
setHardness(1.0F);
setResistance(5.0F);
}
}

@ -1,16 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import com.zivilon.cinder_loe.blocks.RotatableBlockBase3;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class LeatherBundle extends RotatableBlockBase3 {
public LeatherBundle() {
super(Material.cloth, "lotr:leatherBundle");
setStepSound(Block.soundTypeCloth);
setBlockName("lotr:leatherBundle");
setHardness(0.5F);
setResistance(0.5F);
}
}

@ -1,56 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Random;
import lotr.common.LOTRDimension;
import lotr.common.block.LOTRBlockUtumnoPortal;
import lotr.common.tileentity.LOTRTileEntityUtumnoPortal;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import com.zivilon.cinder_loe.tileentity.TileEntityMistBlock;
public class MistBlock extends LOTRBlockUtumnoPortal {
public float color_red;
public float color_green;
public float color_blue;
public MistBlock() {
super();
color_red = 0.0F;
color_green = 0.0F;
color_blue = 0.0F;
setBlockTextureName("lotr:mist_block");
setBlockName("lotr:mistBlock");
}
public MistBlock(float r, float g, float b) {
super();
color_red = r;
color_green = g;
color_blue = b;
setHardness(-1.0F);
setResistance(Float.MAX_VALUE);
setBlockTextureName("lotr:mist_block");
setBlockName("lotr:mistBlock");
}
public TileEntity createNewTileEntity(World world, int i) {
return (TileEntity)new TileEntityMistBlock(color_red, color_green, color_blue);
}
@Override
public void func_149670_a(World world, int i, int j, int k, Entity entity) {}
}

@ -1,12 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import com.zivilon.cinder_loe.blocks.BarsBase;
public class RedDwarfBars extends BarsBase {
public RedDwarfBars() {
super("lotr:barsRedDwarf");
}
}

@ -1,12 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import com.zivilon.cinder_loe.blocks.ChandelierBase;
public class RedDwarfChandelier extends ChandelierBase {
public RedDwarfChandelier() {
super("lotr:chandelierRedDwarf");
}
}

@ -1,16 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import com.zivilon.cinder_loe.blocks.RotatableBlockBase3;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class ReedBale extends RotatableBlockBase3 {
public ReedBale() {
super(Material.grass, "lotr:reedBale");
setStepSound(Block.soundTypeGrass);
setBlockName("lotr:reedBale");
setHardness(0.5F);
setResistance(0.5F);
}
}

@ -1,88 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import com.zivilon.cinder_loe.util.Utilities;
public abstract class RotatableBlockBase2 extends BlockRotatedPillar {
public String textureName;
public IIcon[] icons = new IIcon[3];
public RotatableBlockBase2(Material material, String blockName) {
super(material);
this.textureName = Utilities.toSnakeCase(blockName);
this.setBlockName(blockName);
// Get LOTRCreativeTabs.tabBlock without ForgeGradle incorrectly obfuscating it. Uses cached field, not real-time reflection
this.setCreativeTab((CreativeTabs)Utilities.reflected_tab_block);
}
public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) {
int orientation = 0;
switch (side) {
case 0: // Bottom
case 1: // Top
orientation = 0;
break;
case 2: // North
case 3: // South
orientation = 1;
break;
case 4: // West
case 5: // East
orientation = 2;
break;
}
return orientation;
}
public int damageDropped(int i) {
return 0;
}
@Override
public IIcon getIcon(int side, int meta) {
switch(meta) {
case 0: // Facing up
if(side == 0 || side == 1) return this.icons[0];
else return this.icons[1];
case 1: // Facing North-South
if(side == 2 || side == 3) return this.icons[0];
if(side == 4 || side == 5) return this.icons[2];
else return this.icons[1];
case 2: // Facing East-West
if(side == 4 || side == 5) return this.icons[0];
else return this.icons[2];
case 3: // Uniform block
return this.icons[1];
}
return this.blockIcon; // Default case, should not happen
}
@Override
public void registerBlockIcons(IIconRegister reg) {
icons[0] = reg.registerIcon(this.textureName + "_top");
icons[1] = reg.registerIcon(this.textureName + "_side_0");
icons[2] = reg.registerIcon(this.textureName + "_side_90");
}
@SideOnly(Side.CLIENT)
protected IIcon getSideIcon(int i) {
return null;
}
}

@ -1,165 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
import net.minecraft.util.IIcon;
import net.minecraft.client.renderer.texture.IIconRegister;
import lotr.common.LOTRCreativeTabs;
import net.minecraft.creativetab.CreativeTabs;
import com.zivilon.cinder_loe.util.Utilities;
public abstract class RotatableBlockBase3 extends BlockRotatedPillar {
public String textureName;
public IIcon[] icons = new IIcon[6];
public RotatableBlockBase3(Material material, String blockName) {
super(material);
this.textureName = Utilities.toSnakeCase(blockName);
this.setBlockName(blockName);
// Get LOTRCreativeTabs.tabBlock without ForgeGradle incorrectly obfuscating it. Uses cached field, not real-time reflection
this.setCreativeTab((CreativeTabs)Utilities.reflected_tab_block);
/* Examples for block properties
this.setHardness(2.0F); // How long it takes to break the block
this.setResistance(10.0F); // Explosion resistance
this.setStepSound(soundTypePiston); // The sound made when walking on the block
this.setLightLevel(0.5F); // Light emitted by the block, 0.0 - 1.0
this.setLightOpacity(255); // How much light is blocked, 0 - 255
this.setBlockName("exampleBlock"); // The unique name of the block
this.setBlockTextureName("modid:exampleBlock"); // Texture for the block
this.setCreativeTab(CreativeTabs.tabBlock); // The creative tab it appears in
*/
}
public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) {
// Default orientation (meta 0)
int orientation = 0;
// Determine orientation based on the side of the block the player is placing against
switch (side) {
case 0: // Bottom
orientation = 5; // Unique orientation for bottom
break;
case 1: // Top
orientation = 0; // Default vertical orientation
break;
case 2: // North
orientation = 1; // North-South horizontal
break;
case 3: // South
orientation = 2; // South-North horizontal
break;
case 4: // West
orientation = 3; // West-East horizontal
break;
case 5: // East
orientation = 4; // East-West horizontal
break;
}
return orientation;
}
public int damageDropped(int i) {
return 0;
}
@Override
public IIcon getIcon(int side, int meta) {
switch(meta) {
case 0: // Facing up
if(side == 0) return this.icons[0];
else if(side == 1) return this.icons[1];
else return this.icons[2];
case 1: // Facing North
if(side == 0) return this.icons[2];
else if(side == 1) return this.icons[2];
else if(side == 2) return this.icons[1];
else if(side == 3) return this.icons[0];
else if(side == 4) return this.icons[5];
else if(side == 5) return this.icons[3];
case 2: // Facing South
if(side == 0) return this.icons[4];
else if(side == 1) return this.icons[4];
else if(side == 2) return this.icons[0];
else if(side == 3) return this.icons[1];
else if(side == 4) return this.icons[3];
else if(side == 5) return this.icons[5];
case 3: // Facing West
if(side == 0) return this.icons[5];
else if(side == 1) return this.icons[5];
else if(side == 2) return this.icons[3];
else if(side == 3) return this.icons[5];
else if(side == 4) return this.icons[1];
else if(side == 5) return this.icons[0];
case 4: // Facing East
if(side == 4) return this.icons[0];
else if(side == 5) return this.icons[1];
else return this.icons[2];
case 5: // Facing down
if(side == 0) return this.icons[1];
else if(side == 1) return this.icons[0];
else if (side == 2) return this.icons[3];
else if (side == 3) return this.icons[3];
else return this.icons[4];
}
return this.blockIcon;
}
@Override
public void registerBlockIcons(IIconRegister reg) {
icons[0] = reg.registerIcon(this.textureName + "_bottom");
icons[1] = reg.registerIcon(this.textureName + "_top");
icons[2] = reg.registerIcon(this.textureName + "_side_0");
icons[3] = reg.registerIcon(this.textureName + "_side_90");
icons[4] = reg.registerIcon(this.textureName + "_side_180");
icons[5] = reg.registerIcon(this.textureName + "_side_270");
}
@SideOnly(Side.CLIENT)
protected IIcon getSideIcon(int i) {
return null;
}
}
/* Example method overrides for blocks
@Override
public void onBlockAdded(World world, int x, int y, int z) {
// Called when the block is placed in the world
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int metadata) {
// Called when the block is broken
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
// Called when the player right-clicks the block
return true;
}
@Override
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
// Called when an entity walks over the block
}
@Override
public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
// Determines the redstone power output
return 15;
}
*/

@ -1,31 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import com.zivilon.cinder_loe.util.Utilities;
public class RunedDwarvenBrick extends Block {
public RunedDwarvenBrick() {
super(Material.rock); // Choose the appropriate material
// Set other properties like hardness, resistance, name, etc.
setHardness(2.0F);
setResistance(5.0F);
setBlockTextureName(Utilities.toSnakeCase("lotr:dwarven_brick_runed"));
setBlockName("lotr:dwarvenBrickRuned");
setCreativeTab((CreativeTabs)Utilities.reflected_tab_block);
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("lotr:dwarven_brick_runed");
}
}

@ -1,55 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
import net.minecraft.util.IIcon;
import net.minecraft.client.renderer.texture.IIconRegister;
import lotr.common.LOTRCreativeTabs;
import net.minecraft.creativetab.CreativeTabs;
import com.zivilon.cinder_loe.util.Utilities;
public abstract class StaticBlockBase3 extends Block {
public String textureName;
public IIcon[] icons = new IIcon[3];
public StaticBlockBase3(Material material, String blockName) {
super(material);
this.textureName = Utilities.toSnakeCase(blockName);
this.setBlockName(blockName);
this.setCreativeTab((CreativeTabs)Utilities.reflected_tab_block);
}
@Override
public IIcon getIcon(int side, int meta) {
switch(side) {
case 0: // Facing down
return this.icons[0];
case 1: // Facing up
return this.icons[1];
case 2: // Facing North
case 3: // Facing South
case 4: // Facing West
case 5: // Facing East
return this.icons[2];
}
return this.blockIcon;
}
@Override
public void registerBlockIcons(IIconRegister reg) {
icons[0] = reg.registerIcon(this.textureName + "_bottom");
icons[1] = reg.registerIcon(this.textureName + "_top");
icons[2] = reg.registerIcon(this.textureName + "_side");
}
}

@ -1,120 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import lotr.common.block.LOTRBlockChandelier;
import lotr.common.block.LOTRBlockOrcChain;
import net.minecraft.block.*;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class bronzeChain extends LOTRBlockOrcChain {
public IIcon icon;
@SideOnly(value= Side.CLIENT)
private IIcon iconMiddle;
@SideOnly(value=Side.CLIENT)
private IIcon iconTop;
@SideOnly(value=Side.CLIENT)
private IIcon iconBottom;
@SideOnly(value=Side.CLIENT)
private IIcon iconSingle;
public bronzeChain() {
this.setHardness(1.0f);
this.setStepSound(Block.soundTypeMetal);
this.textureName = "lotr:bronzeChain";
setBlockName("lotr:bronzeChain");
setBlockTextureName("lotr:bronzeChain");
float f = 0.2f;
this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, 1.0f, 0.5f + f);
}
@SideOnly(value=Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.iconMiddle = iconregister.registerIcon(this.getTextureName() + "_mid");
this.iconTop = iconregister.registerIcon(this.getTextureName() + "_top");
this.iconBottom = iconregister.registerIcon(this.getTextureName() + "_bottom");
this.iconSingle = iconregister.registerIcon(this.getTextureName() + "_single");
this.blockIcon = iconregister.registerIcon(this.getTextureName());
}
@SideOnly(value=Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int i, int j, int k, int side) {
boolean chainBelow;
Block above = world.getBlock(i, j + 1, k);
Block below = world.getBlock(i, j - 1, k);
boolean chainAbove = above instanceof bronzeChain;
boolean bl = chainBelow = below instanceof bronzeChain || below instanceof LOTRBlockChandelier;
if (chainAbove && chainBelow) {
return this.iconMiddle;
}
if (chainAbove) {
return this.iconBottom;
}
if (chainBelow) {
return this.iconTop;
}
return this.iconSingle;
}
@SideOnly(value=Side.CLIENT)
public IIcon getIcon(int i, int j) {
return this.iconMiddle;
}
@SideOnly(value=Side.CLIENT)
public String getItemIconName() {
return this.getTextureName();
}
public boolean canPlaceBlockAt(World world, int i, int j, int k) {
Block block = world.getBlock(i, j + 1, k);
int meta = world.getBlockMetadata(i, j + 1, k);
if (block instanceof bronzeChain) {
return true;
}
if (block instanceof BlockFence || block instanceof BlockWall) {
return true;
}
if (block instanceof BlockSlab && !block.isOpaqueCube() && (meta & 8) == 0) {
return true;
}
if (block instanceof BlockStairs && (meta & 4) == 0) {
return true;
}
return world.getBlock(i, j + 1, k).isSideSolid((IBlockAccess)world, i, j + 1, k, ForgeDirection.DOWN);
}
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int side, float f, float f1, float f2) {
ItemStack itemstack = entityplayer.getHeldItem();
if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock((Block)this)) {
Block block;
int j1;
for (j1 = j; j1 >= 0 && j1 < world.getHeight() && (block = world.getBlock(i, j1, k)) == this; --j1) {
}
if (j1 >= 0 && j1 < world.getHeight()) {
block = world.getBlock(i, j1, k);
if (this.canPlaceBlockOnSide(world, i, j1, k, side) && block.isReplaceable((IBlockAccess)world, i, j1, k) && !block.getMaterial().isLiquid()) {
int thisMeta = world.getBlockMetadata(i, j, k);
world.setBlock(i, j1, k, (Block)this, thisMeta, 3);
world.playSoundEffect((double)((float)i + 0.5f), (double)((float)j1 + 0.5f), (double)((float)k + 0.5f), this.stepSound.func_150496_b(), (this.stepSound.getVolume() + 1.0f) / 2.0f, this.stepSound.getPitch() * 0.8f);
if (!entityplayer.capabilities.isCreativeMode) {
--itemstack.stackSize;
}
if (itemstack.stackSize <= 0) {
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);
}
return true;
}
}
}
return false;
}
}

@ -1,28 +0,0 @@
package com.zivilon.cinder_loe.blocks;
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.creativetab.CreativeTabs;
public class cobbleDrystone extends Block {
public cobbleDrystone() {
super(Material.rock); // Choose the appropriate material
// Set other properties like hardness, resistance, name, etc.
setHardness(2.0F);
setResistance(5.0F);
setBlockTextureName(Utilities.toSnakeCase("lotr:cobble_drystone"));
setBlockName("lotr:cobbleDrystone");
setCreativeTab((CreativeTabs)Utilities.reflected_tab_block);
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("lotr:cobbleDrystone");
}
}

@ -1,28 +0,0 @@
package com.zivilon.cinder_loe.blocks;
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.creativetab.CreativeTabs;
public class cutDrystone extends Block {
public cutDrystone() {
super(Material.rock); // Choose the appropriate material
// Set other properties like hardness, resistance, name, etc.
setHardness(2.0F);
setResistance(5.0F);
setBlockTextureName(Utilities.toSnakeCase("lotr:cut_drystone"));
setBlockName("lotr:cutDrystone");
setCreativeTab((CreativeTabs)Utilities.reflected_tab_block);
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("lotr:cutDrystone");
}
}

@ -1,121 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import lotr.common.block.LOTRBlockChandelier;
import lotr.common.block.LOTRBlockOrcChain;
import net.minecraft.block.*;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class goldChain
extends LOTRBlockOrcChain {
public IIcon icon;
@SideOnly(value= Side.CLIENT)
private IIcon iconMiddle;
@SideOnly(value=Side.CLIENT)
private IIcon iconTop;
@SideOnly(value=Side.CLIENT)
private IIcon iconBottom;
@SideOnly(value=Side.CLIENT)
private IIcon iconSingle;
public goldChain() {
this.setHardness(1.0f);
this.setStepSound(Block.soundTypeMetal);
this.textureName = "lotr:goldChain";
setBlockName("lotr:goldChain");
setBlockTextureName("lotr:goldChain");
float f = 0.2f;
this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, 1.0f, 0.5f + f);
}
@SideOnly(value=Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.iconMiddle = iconregister.registerIcon(this.getTextureName() + "_mid");
this.iconTop = iconregister.registerIcon(this.getTextureName() + "_top");
this.iconBottom = iconregister.registerIcon(this.getTextureName() + "_bottom");
this.iconSingle = iconregister.registerIcon(this.getTextureName() + "_single");
this.blockIcon = iconregister.registerIcon(this.getTextureName());
}
@SideOnly(value=Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int i, int j, int k, int side) {
boolean chainBelow;
Block above = world.getBlock(i, j + 1, k);
Block below = world.getBlock(i, j - 1, k);
boolean chainAbove = above instanceof goldChain;
boolean bl = chainBelow = below instanceof goldChain || below instanceof LOTRBlockChandelier;
if (chainAbove && chainBelow) {
return this.iconMiddle;
}
if (chainAbove) {
return this.iconBottom;
}
if (chainBelow) {
return this.iconTop;
}
return this.iconSingle;
}
@SideOnly(value=Side.CLIENT)
public IIcon getIcon(int i, int j) {
return this.iconMiddle;
}
@SideOnly(value=Side.CLIENT)
public String getItemIconName() {
return this.getTextureName();
}
public boolean canPlaceBlockAt(World world, int i, int j, int k) {
Block block = world.getBlock(i, j + 1, k);
int meta = world.getBlockMetadata(i, j + 1, k);
if (block instanceof goldChain) {
return true;
}
if (block instanceof BlockFence || block instanceof BlockWall) {
return true;
}
if (block instanceof BlockSlab && !block.isOpaqueCube() && (meta & 8) == 0) {
return true;
}
if (block instanceof BlockStairs && (meta & 4) == 0) {
return true;
}
return world.getBlock(i, j + 1, k).isSideSolid((IBlockAccess)world, i, j + 1, k, ForgeDirection.DOWN);
}
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int side, float f, float f1, float f2) {
ItemStack itemstack = entityplayer.getHeldItem();
if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock((Block)this)) {
Block block;
int j1;
for (j1 = j; j1 >= 0 && j1 < world.getHeight() && (block = world.getBlock(i, j1, k)) == this; --j1) {
}
if (j1 >= 0 && j1 < world.getHeight()) {
block = world.getBlock(i, j1, k);
if (this.canPlaceBlockOnSide(world, i, j1, k, side) && block.isReplaceable((IBlockAccess)world, i, j1, k) && !block.getMaterial().isLiquid()) {
int thisMeta = world.getBlockMetadata(i, j, k);
world.setBlock(i, j1, k, (Block)this, thisMeta, 3);
world.playSoundEffect((double)((float)i + 0.5f), (double)((float)j1 + 0.5f), (double)((float)k + 0.5f), this.stepSound.func_150496_b(), (this.stepSound.getVolume() + 1.0f) / 2.0f, this.stepSound.getPitch() * 0.8f);
if (!entityplayer.capabilities.isCreativeMode) {
--itemstack.stackSize;
}
if (itemstack.stackSize <= 0) {
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);
}
return true;
}
}
}
return false;
}
}

@ -1,121 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import lotr.common.block.LOTRBlockChandelier;
import lotr.common.block.LOTRBlockOrcChain;
import net.minecraft.block.*;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class ironChain
extends LOTRBlockOrcChain {
public IIcon icon;
@SideOnly(value= Side.CLIENT)
private IIcon iconMiddle;
@SideOnly(value=Side.CLIENT)
private IIcon iconTop;
@SideOnly(value=Side.CLIENT)
private IIcon iconBottom;
@SideOnly(value=Side.CLIENT)
private IIcon iconSingle;
public ironChain() {
this.setHardness(1.0f);
this.setStepSound(Block.soundTypeMetal);
this.textureName = "lotr:ironChain";
setBlockName("lotr:ironChain");
setBlockTextureName("lotr:ironChain");
float f = 0.2f;
this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, 1.0f, 0.5f + f);
}
@SideOnly(value=Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.iconMiddle = iconregister.registerIcon(this.getTextureName() + "_mid");
this.iconTop = iconregister.registerIcon(this.getTextureName() + "_top");
this.iconBottom = iconregister.registerIcon(this.getTextureName() + "_bottom");
this.iconSingle = iconregister.registerIcon(this.getTextureName() + "_single");
this.blockIcon = iconregister.registerIcon(this.getTextureName());
}
@SideOnly(value=Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int i, int j, int k, int side) {
boolean chainBelow;
Block above = world.getBlock(i, j + 1, k);
Block below = world.getBlock(i, j - 1, k);
boolean chainAbove = above instanceof ironChain;
boolean bl = chainBelow = below instanceof ironChain || below instanceof LOTRBlockChandelier;
if (chainAbove && chainBelow) {
return this.iconMiddle;
}
if (chainAbove) {
return this.iconBottom;
}
if (chainBelow) {
return this.iconTop;
}
return this.iconSingle;
}
@SideOnly(value=Side.CLIENT)
public IIcon getIcon(int i, int j) {
return this.iconMiddle;
}
@SideOnly(value=Side.CLIENT)
public String getItemIconName() {
return this.getTextureName();
}
public boolean canPlaceBlockAt(World world, int i, int j, int k) {
Block block = world.getBlock(i, j + 1, k);
int meta = world.getBlockMetadata(i, j + 1, k);
if (block instanceof ironChain) {
return true;
}
if (block instanceof BlockFence || block instanceof BlockWall) {
return true;
}
if (block instanceof BlockSlab && !block.isOpaqueCube() && (meta & 8) == 0) {
return true;
}
if (block instanceof BlockStairs && (meta & 4) == 0) {
return true;
}
return world.getBlock(i, j + 1, k).isSideSolid((IBlockAccess)world, i, j + 1, k, ForgeDirection.DOWN);
}
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int side, float f, float f1, float f2) {
ItemStack itemstack = entityplayer.getHeldItem();
if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock((Block)this)) {
Block block;
int j1;
for (j1 = j; j1 >= 0 && j1 < world.getHeight() && (block = world.getBlock(i, j1, k)) == this; --j1) {
}
if (j1 >= 0 && j1 < world.getHeight()) {
block = world.getBlock(i, j1, k);
if (this.canPlaceBlockOnSide(world, i, j1, k, side) && block.isReplaceable((IBlockAccess)world, i, j1, k) && !block.getMaterial().isLiquid()) {
int thisMeta = world.getBlockMetadata(i, j, k);
world.setBlock(i, j1, k, (Block)this, thisMeta, 3);
world.playSoundEffect((double)((float)i + 0.5f), (double)((float)j1 + 0.5f), (double)((float)k + 0.5f), this.stepSound.func_150496_b(), (this.stepSound.getVolume() + 1.0f) / 2.0f, this.stepSound.getPitch() * 0.8f);
if (!entityplayer.capabilities.isCreativeMode) {
--itemstack.stackSize;
}
if (itemstack.stackSize <= 0) {
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);
}
return true;
}
}
}
return false;
}
}

@ -1,28 +0,0 @@
package com.zivilon.cinder_loe.blocks;
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.creativetab.CreativeTabs;
public class reeflessCoral extends Block {
public reeflessCoral() {
super(Material.rock); // Choose the appropriate material
// Set other properties like hardness, resistance, name, etc.
setHardness(2.0F);
setResistance(5.0F);
setBlockTextureName(Utilities.toSnakeCase("lotr:reeflessCoral"));
setBlockName("lotr:reeflessCoral");
setCreativeTab((CreativeTabs)Utilities.reflected_tab_block);
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("lotr:reeflessCoral");
}
}

@ -1,125 +0,0 @@
package com.zivilon.cinder_loe.blocks;
import com.zivilon.cinder_loe.util.Utilities;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import lotr.common.LOTRMod;
import lotr.common.block.LOTRBlockChandelier;
import lotr.common.block.LOTRBlockOrcChain;
import net.minecraft.block.*;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class silverChain extends LOTRBlockOrcChain {
public IIcon icon;
@SideOnly(value= Side.CLIENT)
private IIcon iconMiddle;
@SideOnly(value=Side.CLIENT)
private IIcon iconTop;
@SideOnly(value=Side.CLIENT)
private IIcon iconBottom;
@SideOnly(value=Side.CLIENT)
private IIcon iconSingle;
public silverChain() {
this.setHardness(1.0f);
this.setStepSound(Block.soundTypeMetal);
this.textureName = "lotr:silverChain";
setBlockName("lotr:silverChain");
setBlockTextureName("lotr:silverChain");
float f = 0.2f;
this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, 1.0f, 0.5f + f);
}
@SideOnly(value=Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister) {
this.iconMiddle = iconregister.registerIcon(this.getTextureName() + "_mid");
this.iconTop = iconregister.registerIcon(this.getTextureName() + "_top");
this.iconBottom = iconregister.registerIcon(this.getTextureName() + "_bottom");
this.iconSingle = iconregister.registerIcon(this.getTextureName() + "_single");
this.blockIcon = iconregister.registerIcon(this.getTextureName());
}
@SideOnly(value=Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int i, int j, int k, int side) {
boolean chainBelow;
Block above = world.getBlock(i, j + 1, k);
Block below = world.getBlock(i, j - 1, k);
boolean chainAbove = above instanceof silverChain;
boolean bl = chainBelow = below instanceof silverChain || below instanceof LOTRBlockChandelier;
if (chainAbove && chainBelow) {
return this.iconMiddle;
}
if (chainAbove) {
return this.iconBottom;
}
if (chainBelow) {
return this.iconTop;
}
return this.iconSingle;
}
@SideOnly(value=Side.CLIENT)
public IIcon getIcon(int i, int j) {
return this.iconMiddle;
}
@SideOnly(value=Side.CLIENT)
public String getItemIconName() {
return this.getTextureName();
}
public boolean canPlaceBlockAt(World world, int i, int j, int k) {
Block block = world.getBlock(i, j + 1, k);
int meta = world.getBlockMetadata(i, j + 1, k);
if (block instanceof silverChain) {
return true;
}
if (block instanceof BlockFence || block instanceof BlockWall) {
return true;
}
if (block instanceof BlockSlab && !block.isOpaqueCube() && (meta & 8) == 0) {
return true;
}
if (block instanceof BlockStairs && (meta & 4) == 0) {
return true;
}
return world.getBlock(i, j + 1, k).isSideSolid((IBlockAccess)world, i, j + 1, k, ForgeDirection.DOWN);
}
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int side, float f, float f1, float f2) {
ItemStack itemstack = entityplayer.getHeldItem();
if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock((Block)this)) {
Block block;
int j1;
for (j1 = j; j1 >= 0 && j1 < world.getHeight() && (block = world.getBlock(i, j1, k)) == this; --j1) {
}
if (j1 >= 0 && j1 < world.getHeight()) {
block = world.getBlock(i, j1, k);
if (this.canPlaceBlockOnSide(world, i, j1, k, side) && block.isReplaceable((IBlockAccess)world, i, j1, k) && !block.getMaterial().isLiquid()) {
int thisMeta = world.getBlockMetadata(i, j, k);
world.setBlock(i, j1, k, (Block)this, thisMeta, 3);
world.playSoundEffect((double)((float)i + 0.5f), (double)((float)j1 + 0.5f), (double)((float)k + 0.5f), this.stepSound.func_150496_b(), (this.stepSound.getVolume() + 1.0f) / 2.0f, this.stepSound.getPitch() * 0.8f);
if (!entityplayer.capabilities.isCreativeMode) {
--itemstack.stackSize;
}
if (itemstack.stackSize <= 0) {
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);
}
return true;
}
}
}
return false;
}
}

@ -1,79 +0,0 @@
package com.zivilon.cinder_loe.character;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.zivilon.cinder_loe.character.CharacterRoleAPI;
import com.zivilon.cinder_loe.entity.FangornAnimal;
public class CharacterEventListener {
public CharacterEventListener() {
// Register the event listener
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
public void onLivingHurt(LivingHurtEvent event) {
// Check if the entity being hurt is a character of interest
EntityLivingBase damagedEntity = event.entityLiving;
// Check if the source of damage is an entity
if (event.source.getSourceOfDamage() instanceof EntityLivingBase) {
// The entity that caused the damage
EntityLivingBase damagerEntity = (EntityLivingBase) event.source.getSourceOfDamage();
if (damagedEntity instanceof EntityPlayerMP) {
EntityPlayerMP player = (EntityPlayerMP)damagedEntity;
UUID radagast = CharacterRoleAPI.getCharacterRoleUUID("Radagast");
if (player.getUniqueID().equals(radagast)) {
List<EntityLivingBase> entities = findAnimalsAndFangornEntities((EntityLivingBase)player);
for (EntityLivingBase entity : entities) {
EntityLiving animal = (EntityLiving) entity;
animal.setAttackTarget((EntityLivingBase)damagerEntity);
}
}
}
}
}
public static List<EntityLivingBase> findAnimalsAndFangornEntities(EntityLivingBase centerEntity) {
World world = centerEntity.worldObj;
double searchRadius = 32.0D; // Define the search radius
// Calculate the search area
AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(
centerEntity.posX - searchRadius, centerEntity.posY - searchRadius, centerEntity.posZ - searchRadius,
centerEntity.posX + searchRadius, centerEntity.posY + searchRadius, centerEntity.posZ + searchRadius);
// Retrieve all entities within the search area
List entitiesWithinAABB = world.getEntitiesWithinAABB(EntityLivingBase.class, searchArea);
List<EntityLivingBase> foundEntities = new ArrayList<EntityLivingBase>();
// Manually filter the entities to match your criteria
for (Object obj : entitiesWithinAABB) {
if (obj instanceof EntityAnimal || obj instanceof FangornAnimal) { // Adjust for your custom entity
foundEntities.add((EntityLivingBase) obj);
}
}
return foundEntities;
}
}

@ -1,61 +0,0 @@
package com.zivilon.cinder_loe.character;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.*;
import java.nio.file.*;
import java.lang.reflect.Type;
import java.util.*;
public class CharacterRoleAPI {
private static final Path FILE_PATH = Paths.get("character_roles.json");
private static Map<String, UUID> characterRoles = new HashMap<>();
public static void loadRolesFromFile() {
if (!Files.exists(FILE_PATH)) {
try {
Files.createFile(FILE_PATH);
} catch (IOException e) {
e.printStackTrace();
}
return;
}
try (Reader reader = Files.newBufferedReader(FILE_PATH)) {
Gson gson = new Gson();
Type type = new TypeToken<Map<String, UUID>>() {}.getType();
characterRoles = gson.fromJson(reader, type);
if (characterRoles == null) {
characterRoles = new HashMap<>();
}
} catch (IOException e) {
e.printStackTrace();
}
}
public static void saveRolesToFile() {
Gson gson = new Gson();
try (Writer writer = Files.newBufferedWriter(FILE_PATH)) {
gson.toJson(characterRoles, writer);
} catch (IOException e) {
e.printStackTrace();
}
}
public static UUID getCharacterRoleUUID(String roleName) {
return characterRoles.get(roleName);
}
public static void setCharacterRoleUUID(String roleName, UUID playerUUID) {
characterRoles.put(roleName, playerUUID);
saveRolesToFile();
}
public static void removeCharacterRole(String roleName) {
if (characterRoles.containsKey(roleName)) {
characterRoles.remove(roleName);
saveRolesToFile();
}
}
}

@ -1,40 +0,0 @@
package com.zivilon.cinder_loe.client.model;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
//import lotr.client.model.LOTRModelBiped;
import net.minecraft.entity.Entity;
/**
* Created using Tabula 4.1.1
*/
public class ModelBreeHelmet extends ModelBiped {
public ModelRenderer shape9;
public ModelBreeHelmet() {
this.textureWidth = 64;
this.textureHeight = 32;
this.bipedHead = new ModelRenderer(this, 0, 0);
this.bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F);
this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 1.0F);
this.shape9 = new ModelRenderer(this, 0, 16);
this.shape9.setRotationPoint(0.0F, 0.0F, 0.0F);
this.shape9.addBox(-7.0F, -4.75F, -7.0F, 14, 0, 14, 1.75F);
this.bipedHead.addChild(shape9);
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
this.bipedHead.render(f5);
// this.shape9.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;
}
}

@ -1,126 +0,0 @@
package com.zivilon.cinder_loe.client.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import com.zivilon.cinder_loe.entity.FangornAuroch;
public class ModelFangornAuroch extends ModelBase {
public ModelRenderer body;
public ModelRenderer leg1;
public ModelRenderer leg2;
public ModelRenderer leg3;
public ModelRenderer leg4;
public ModelRenderer tail;
public ModelRenderer head;
public ModelRenderer horns;
public ModelRenderer hornLeft1;
public ModelRenderer hornLeft2;
public ModelRenderer hornRight1;
public ModelRenderer hornRight2;
public ModelFangornAuroch() {
this.textureWidth = 128;
this.textureHeight = 64;
this.body = new ModelRenderer(this, 0, 0);
this.body.setRotationPoint(0.0F, 2.0F, -1.0F);
this.body.addBox(-8.0F, -6.0F, -11.0F, 16, 16, 26);
this.body.setTextureOffset(28, 42).addBox(-8.0F, -8.0F, -8.0F, 16, 2, 10);
this.body.setTextureOffset(84, 31).addBox(-3.0F, 10.0F, 4.0F, 6, 1, 6);
this.leg1 = new ModelRenderer(this, 0, 42);
this.leg1.setRotationPoint(-5.0F, 12.0F, 9.0F);
this.leg1.addBox(-2.5F, 0.0F, -2.5F, 5, 12, 5);
this.leg2 = new ModelRenderer(this, 0, 42);
this.leg2.setRotationPoint(5.0F, 12.0F, 9.0F);
this.leg2.mirror = true;
this.leg2.addBox(-2.5F, 0.0F, -2.5F, 5, 12, 5);
this.leg3 = new ModelRenderer(this, 0, 42);
this.leg3.setRotationPoint(-5.0F, 12.0F, -7.0F);
this.leg3.addBox(-2.5F, 0.0F, -2.5F, 5, 12, 5);
this.leg4 = new ModelRenderer(this, 0, 42);
this.leg4.setRotationPoint(5.0F, 12.0F, -7.0F);
this.leg4.mirror = true;
this.leg4.addBox(-2.5F, 0.0F, -2.5F, 5, 12, 5);
this.tail = new ModelRenderer(this, 20, 42);
this.tail.setRotationPoint(0.0F, 1.0F, 14.0F);
this.tail.addBox(-1.0F, -1.0F, 0.0F, 2, 12, 1);
this.head = new ModelRenderer(this, 58, 0);
this.head.setRotationPoint(0.0F, -1.0F, -10.0F);
this.head.addBox(-5.0F, -4.0F, -12.0F, 10, 10, 11);
this.head.setTextureOffset(89, 0).addBox(-3.0F, 1.0F, -15.0F, 6, 4, 4);
this.head.setTextureOffset(105, 0);
this.head.addBox(-8.0F, -2.5F, -7.0F, 3, 2, 1);
this.head.mirror = true;
this.head.addBox(5.0F, -2.5F, -7.0F, 3, 2, 1);
this.head.mirror = false;
this.horns = new ModelRenderer(this, 98, 21);
this.horns.setRotationPoint(0.0F, -3.5F, -5.0F);
this.horns.addBox(-6.0F, -1.5F, -1.5F, 12, 3, 3);
this.head.addChild(this.horns);
this.hornLeft1 = new ModelRenderer(this, 112, 27);
this.hornLeft1.setRotationPoint(-6.0F, 0.0F, 0.0F);
this.hornLeft1.addBox(-5.0F, -1.0F, -1.0F, 6, 2, 2);
this.hornLeft2 = new ModelRenderer(this, 114, 31);
this.hornLeft2.setRotationPoint(-5.0F, 0.0F, 0.0F);
this.hornLeft2.addBox(-5.0F, -0.5F, -0.5F, 6, 1, 1);
this.hornLeft1.addChild(this.hornLeft2);
this.horns.addChild(this.hornLeft1);
this.hornRight1 = new ModelRenderer(this, 112, 27);
this.hornRight1.mirror = true;
this.hornRight1.setRotationPoint(6.0F, 0.0F, 0.0F);
this.hornRight1.addBox(-1.0F, -1.0F, -1.0F, 6, 2, 2);
this.hornRight2 = new ModelRenderer(this, 114, 31);
this.hornRight2.mirror = true;
this.hornRight2.setRotationPoint(5.0F, 0.0F, 0.0F);
this.hornRight2.addBox(-1.0F, -0.5F, -0.5F, 6, 1, 1);
this.hornRight1.addChild(this.hornRight2);
this.horns.addChild(this.hornRight1);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
this.horns.showModel = true;
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.head.render(f5);
this.body.render(f5);
this.leg1.render(f5);
this.leg2.render(f5);
this.leg3.render(f5);
this.leg4.render(f5);
this.tail.render(f5);
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
this.head.rotateAngleX = 0.0F;
this.head.rotateAngleY = 0.0F;
this.head.rotateAngleZ = 0.0F;
this.head.rotateAngleX += (float)Math.toRadians(f4);
this.head.rotateAngleY += (float)Math.toRadians(f3);
this.head.rotateAngleX += MathHelper.cos(f * 0.2F) * f1 * 0.4F;
this.hornLeft1.rotateAngleZ = (float)Math.toRadians(25.0D);
this.hornLeft2.rotateAngleZ = (float)Math.toRadians(15.0D);
this.hornRight1.rotateAngleZ = -this.hornLeft1.rotateAngleZ;
this.hornRight2.rotateAngleZ = -this.hornLeft2.rotateAngleZ;
this.hornLeft1.rotateAngleY = (float)Math.toRadians(-25.0D);
this.hornRight1.rotateAngleY = -this.hornLeft1.rotateAngleY;
this.hornLeft1.rotateAngleX = (float)Math.toRadians(35.0D);
this.hornRight1.rotateAngleX = this.hornLeft1.rotateAngleX;
this.leg1.rotateAngleX = MathHelper.cos(f * 0.4F) * f1 * 0.8F;
this.leg2.rotateAngleX = MathHelper.cos(f * 0.4F + 3.1415927F) * f1 * 0.8F;
this.leg3.rotateAngleX = MathHelper.cos(f * 0.4F + 3.1415927F) * f1 * 0.8F;
this.leg4.rotateAngleX = MathHelper.cos(f * 0.4F) * f1 * 0.8F;
}
}

@ -1,188 +0,0 @@
package com.zivilon.cinder_loe.client.model;
import lotr.client.LOTRTickHandlerClient;
import lotr.common.LOTRMod;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import com.zivilon.cinder_loe.entity.FangornElk;
public class ModelFangornElk extends ModelBase {
private ModelRenderer body;
private ModelRenderer leg1;
private ModelRenderer leg2;
private ModelRenderer leg3;
private ModelRenderer leg4;
private ModelRenderer head;
private ModelRenderer nose;
private ModelRenderer antlersRight_1;
private ModelRenderer antlersRight_2;
private ModelRenderer antlersRight_3;
private ModelRenderer antlersRight_4;
private ModelRenderer antlersLeft_1;
private ModelRenderer antlersLeft_2;
private ModelRenderer antlersLeft_3;
private ModelRenderer antlersLeft_4;
public ModelFangornElk() {
this(0.0F);
}
public ModelFangornElk(float f) {
this.textureWidth = 128;
this.textureHeight = 64;
this.body = new ModelRenderer(this, 0, 0);
this.body.setRotationPoint(0.0F, 4.0F, 9.0F);
this.body.addBox(-6.0F, -4.0F, -21.0F, 12, 11, 26, f);
ModelRenderer tail = new ModelRenderer(this, 0, 54);
tail.addBox(-1.0F, -5.0F, 2.0F, 2, 2, 8, f);
tail.rotateAngleX = (float)Math.toRadians(-60.0D);
this.body.addChild(tail);
this.leg1 = new ModelRenderer(this, 42, 37);
this.leg1.setRotationPoint(-4.0F, 3.0F, 8.0F);
this.leg1.addBox(-5.5F, 0.0F, -3.0F, 7, 11, 8, f);
this.leg1.setTextureOffset(26, 37).addBox(-4.0F, 11.0F, -1.0F, 4, 10, 4, f);
this.leg2 = new ModelRenderer(this, 42, 37);
this.leg2.mirror = true;
this.leg2.setRotationPoint(4.0F, 3.0F, 8.0F);
this.leg2.addBox(-1.5F, 0.0F, -3.0F, 7, 11, 8, f);
this.leg2.setTextureOffset(26, 37).addBox(0.0F, 11.0F, -1.0F, 4, 10, 4, f);
this.leg3 = new ModelRenderer(this, 0, 37);
this.leg3.setRotationPoint(-4.0F, 4.0F, -6.0F);
this.leg3.addBox(-4.5F, 0.0F, -3.0F, 6, 10, 7, f);
this.leg3.setTextureOffset(26, 37).addBox(-3.5F, 10.0F, -2.0F, 4, 10, 4, f);
this.leg4 = new ModelRenderer(this, 0, 37);
this.leg4.mirror = true;
this.leg4.setRotationPoint(4.0F, 4.0F, -6.0F);
this.leg4.addBox(-1.5F, 0.0F, -3.0F, 6, 10, 7, f);
this.leg4.setTextureOffset(26, 37).addBox(-0.5F, 10.0F, -2.0F, 4, 10, 4, f);
this.head = new ModelRenderer(this, 50, 0);
this.head.setRotationPoint(0.0F, 4.0F, -10.0F);
this.head.addBox(-2.0F, -10.0F, -4.0F, 4, 12, 8, f);
this.head.setTextureOffset(74, 0).addBox(-3.0F, -16.0F, -8.0F, 6, 6, 13, f);
this.head.setTextureOffset(50, 20);
this.head.addBox(-2.0F, -18.0F, 3.0F, 1, 2, 1, f);
this.head.mirror = true;
this.head.addBox(1.0F, -18.0F, 3.0F, 1, 2, 1, f);
this.nose = new ModelRenderer(this, 56, 20);
this.nose.addBox(-1.0F, -14.5F, -9.0F, 2, 2, 1, f);
this.antlersRight_1 = new ModelRenderer(this, 0, 0);
this.antlersRight_1.addBox(10.0F, -19.0F, 2.5F, 1, 12, 1, f);
this.antlersRight_1.rotateAngleZ = (float)Math.toRadians(-65.0D);
this.antlersRight_2 = new ModelRenderer(this, 4, 0);
this.antlersRight_2.addBox(-3.0F, -23.6F, 2.5F, 1, 8, 1, f);
this.antlersRight_2.rotateAngleZ = (float)Math.toRadians(-15.0D);
this.antlersRight_3 = new ModelRenderer(this, 8, 0);
this.antlersRight_3.addBox(-8.0F, -36.0F, 2.5F, 1, 16, 1, f);
this.antlersRight_3.rotateAngleZ = (float)Math.toRadians(-15.0D);
this.antlersRight_4 = new ModelRenderer(this, 12, 0);
this.antlersRight_4.addBox(7.5F, -35.0F, 2.5F, 1, 10, 1, f);
this.antlersRight_4.rotateAngleZ = (float)Math.toRadians(-50.0D);
this.head.addChild(this.antlersRight_1);
this.head.addChild(this.antlersRight_2);
this.head.addChild(this.antlersRight_3);
this.head.addChild(this.antlersRight_4);
this.antlersLeft_1 = new ModelRenderer(this, 0, 0);
this.antlersLeft_1.mirror = true;
this.antlersLeft_1.addBox(-11.0F, -19.0F, 2.5F, 1, 12, 1, f);
this.antlersLeft_1.rotateAngleZ = (float)Math.toRadians(65.0D);
this.antlersLeft_2 = new ModelRenderer(this, 4, 0);
this.antlersLeft_2.mirror = true;
this.antlersLeft_2.addBox(2.0F, -23.6F, 2.5F, 1, 8, 1, f);
this.antlersLeft_2.rotateAngleZ = (float)Math.toRadians(15.0D);
this.antlersLeft_3 = new ModelRenderer(this, 8, 0);
this.antlersLeft_3.mirror = true;
this.antlersLeft_3.addBox(7.0F, -36.0F, 2.5F, 1, 16, 1, f);
this.antlersLeft_3.rotateAngleZ = (float)Math.toRadians(15.0D);
this.antlersLeft_4 = new ModelRenderer(this, 12, 0);
this.antlersLeft_4.mirror = true;
this.antlersLeft_4.addBox(-8.5F, -35.0F, 2.5F, 1, 10, 1, f);
this.antlersLeft_4.rotateAngleZ = (float)Math.toRadians(50.0D);
this.head.addChild(this.antlersLeft_1);
this.head.addChild(this.antlersLeft_2);
this.head.addChild(this.antlersLeft_3);
this.head.addChild(this.antlersLeft_4);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
FangornElk elk = (FangornElk)entity;
setRotationAngles(f, f1, f2, f3, f4, f5, (Entity)elk);
GL11.glPushMatrix();
float scale = 1.0F;
GL11.glTranslatef(0.0F, 24.0F * (1.0F - scale) * f5, 0.0F);
GL11.glScalef(scale, scale, scale);
boolean showAntlers = (scale > 0.75F);
this.antlersRight_1.showModel = showAntlers;
this.antlersRight_2.showModel = showAntlers;
this.antlersRight_3.showModel = showAntlers;
this.antlersRight_4.showModel = showAntlers;
this.antlersLeft_1.showModel = showAntlers;
this.antlersLeft_2.showModel = showAntlers;
this.antlersLeft_3.showModel = showAntlers;
this.antlersLeft_4.showModel = showAntlers;
this.body.render(f5);
this.leg1.render(f5);
this.leg2.render(f5);
this.leg3.render(f5);
this.leg4.render(f5);
this.head.render(f5);
if (LOTRMod.isChristmas())
GL11.glColor3f(1.0F, 0.0F, 0.0F);
this.nose.render(f5);
if (LOTRMod.isChristmas())
GL11.glColor3f(1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
float rearAmount = 0.0F;
float antiRearAmount = 1.0F - rearAmount;
this.head.rotationPointY = 4.0F;
this.head.rotationPointZ = -10.0F;
this.head.rotateAngleX = (float)Math.toRadians(20.0D);
this.head.rotateAngleY = 0.0F;
this.head.rotationPointY = rearAmount * -6.0F + antiRearAmount * this.head.rotationPointY;
this.head.rotationPointZ = rearAmount * -1.0F + antiRearAmount * this.head.rotationPointZ;
this.head.rotateAngleX = (float)(this.head.rotateAngleX + Math.toRadians(f4));
this.head.rotateAngleY = (float)(this.head.rotateAngleY + Math.toRadians(f3));
this.head.rotateAngleX = antiRearAmount * this.head.rotateAngleX;
this.head.rotateAngleY = antiRearAmount * this.head.rotateAngleY;
if (f1 > 0.2F)
this.head.rotateAngleX += MathHelper.cos(f * 0.3F) * 0.1F * f1;
this.nose.setRotationPoint(this.head.rotationPointX, this.head.rotationPointY, this.head.rotationPointZ);
this.nose.rotateAngleX = this.head.rotateAngleX;
this.nose.rotateAngleY = this.head.rotateAngleY;
this.nose.rotateAngleZ = this.head.rotateAngleZ;
this.body.rotateAngleX = 0.0F;
this.body.rotateAngleX = rearAmount * -0.7853982F + antiRearAmount * this.body.rotateAngleX;
float legRotation = MathHelper.cos(f * 0.4F + 3.1415927F) * f1;
float f17 = -1.0471976F;
float f18 = 0.2617994F * rearAmount;
float f19 = MathHelper.cos(f2 * 0.4F + 3.1415927F);
this.leg4.rotationPointY = -2.0F * rearAmount + 4.0F * antiRearAmount;
this.leg4.rotationPointZ = -2.0F * rearAmount + -6.0F * antiRearAmount;
this.leg3.rotationPointY = this.leg4.rotationPointY;
this.leg3.rotationPointZ = this.leg4.rotationPointZ;
this.leg1.rotateAngleX = f18 + legRotation * antiRearAmount;
this.leg2.rotateAngleX = f18 + -legRotation * antiRearAmount;
this.leg3.rotateAngleX = (f17 + -f19) * rearAmount + -legRotation * 0.8F * antiRearAmount;
this.leg4.rotateAngleX = (f17 + f19) * rearAmount + legRotation * 0.8F * antiRearAmount;
}
}

@ -1,126 +0,0 @@
package com.zivilon.cinder_loe.client.model;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import com.zivilon.cinder_loe.entity.FangornWolf;
@SideOnly(Side.CLIENT)
public class ModelFangornWolf extends ModelBase {
/** main box for the wolf head */
public ModelRenderer wolfHeadMain;
/** The wolf's body */
public ModelRenderer wolfBody;
/** Wolf'se first leg */
public ModelRenderer wolfLeg1;
/** Wolf's second leg */
public ModelRenderer wolfLeg2;
/** Wolf's third leg */
public ModelRenderer wolfLeg3;
/** Wolf's fourth leg */
public ModelRenderer wolfLeg4;
/** The wolf's tail */
ModelRenderer wolfTail;
/** The wolf's mane */
ModelRenderer wolfMane;
public ModelFangornWolf()
{
float f = 0.0F;
float f1 = 13.5F;
this.wolfHeadMain = new ModelRenderer(this, 0, 0);
this.wolfHeadMain.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4, f);
this.wolfHeadMain.setRotationPoint(-1.0F, f1, -7.0F);
this.wolfBody = new ModelRenderer(this, 18, 14);
this.wolfBody.addBox(-4.0F, -2.0F, -3.0F, 6, 9, 6, f);
this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F);
this.wolfMane = new ModelRenderer(this, 21, 0);
this.wolfMane.addBox(-4.0F, -3.0F, -3.0F, 8, 6, 7, f);
this.wolfMane.setRotationPoint(-1.0F, 14.0F, 2.0F);
this.wolfLeg1 = new ModelRenderer(this, 0, 18);
this.wolfLeg1.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
this.wolfLeg2 = new ModelRenderer(this, 0, 18);
this.wolfLeg2.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
this.wolfLeg3 = new ModelRenderer(this, 0, 18);
this.wolfLeg3.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
this.wolfLeg4 = new ModelRenderer(this, 0, 18);
this.wolfLeg4.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
this.wolfTail = new ModelRenderer(this, 9, 18);
this.wolfTail.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f);
this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
this.wolfHeadMain.setTextureOffset(16, 14).addBox(-3.0F, -5.0F, 0.0F, 2, 2, 1, f);
this.wolfHeadMain.setTextureOffset(16, 14).addBox(1.0F, -5.0F, 0.0F, 2, 2, 1, f);
this.wolfHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, f);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)
{
super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_);
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
this.wolfHeadMain.renderWithRotation(p_78088_7_);
this.wolfBody.render(p_78088_7_);
this.wolfLeg1.render(p_78088_7_);
this.wolfLeg2.render(p_78088_7_);
this.wolfLeg3.render(p_78088_7_);
this.wolfLeg4.render(p_78088_7_);
this.wolfTail.renderWithRotation(p_78088_7_);
this.wolfMane.render(p_78088_7_);
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_)
{
FangornWolf entitywolf = (FangornWolf)p_78086_1_;
this.wolfTail.rotateAngleY = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F);
this.wolfBody.rotateAngleX = ((float)Math.PI / 2F);
this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F);
this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX;
this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F);
this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F);
this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F);
this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F);
this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F);
this.wolfLeg1.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
this.wolfLeg2.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_;
this.wolfLeg3.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_;
this.wolfLeg4.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_;
this.wolfHeadMain.rotateAngleZ = 0.0F;
this.wolfMane.rotateAngleZ = -0.08F;
this.wolfBody.rotateAngleZ = -0.16F;
this.wolfTail.rotateAngleZ = -0.2F;
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_)
{
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_);
this.wolfHeadMain.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI);
this.wolfHeadMain.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI);
this.wolfTail.rotateAngleX = p_78087_3_;
}
}

@ -1,61 +0,0 @@
package com.zivilon.cinder_loe.client.model;
import lotr.client.model.LOTRModelBiped;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelRedDwarfHelmet extends LOTRModelBiped {
//fields
ModelRenderer rightneckguard;
ModelRenderer leftneckguard = new ModelRenderer(this, 32, 0);
ModelRenderer shape1 = new ModelRenderer(this, 32, 18);
public ModelRedDwarfHelmet() {
}
public ModelRedDwarfHelmet(float f) {
super(f);
this.bipedHead = new ModelRenderer(this, 0, 0);
this.bipedHead.setRotationPoint(0F, 0F, 0F);
this.bipedHead.addBox(-4F, -8F, -4F, 8, 8, 8, f);
rightneckguard = new ModelRenderer(this, 32, 9);
rightneckguard.addBox(4.6F, 2.15F, -3.0F, 0, 1, 8);
rightneckguard.setRotationPoint(0F, 0F, 0F);
rightneckguard.setTextureSize(64, 32);
rightneckguard.mirror = true;
setRotation(rightneckguard, 0F, 0F, -0.2443461F);
this.bipedHead.addChild(rightneckguard);
leftneckguard = new ModelRenderer(this, 32, 0);
leftneckguard.addBox(-4.6F, 2.15F, -3.0F, 0, 1, 8);
leftneckguard.setRotationPoint(0F, 0F, 0F);
leftneckguard.setTextureSize(64, 32);
leftneckguard.mirror = true;
setRotation(leftneckguard, 0F, 0F, 0.2443461F);
this.bipedHead.addChild(leftneckguard);
shape1 = new ModelRenderer(this, 32, 18);
shape1.setRotationPoint(0F, 0F, 0F);
shape1.addBox(0F, -13F, -4F, 0, 4, 10);
shape1.setTextureSize(64, 32);
setRotation(shape1, 0F, 0F, 0F);
this.bipedHead.addChild(shape1);
this.bipedHeadwear.cubeList.clear();
this.bipedBody.cubeList.clear();
this.bipedRightArm.cubeList.clear();
this.bipedLeftArm.cubeList.clear();
this.bipedRightLeg.cubeList.clear();
this.bipedLeftLeg.cubeList.clear();
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

@ -1,40 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import com.zivilon.cinder_loe.entity.BattleNun;
import lotr.client.model.LOTRModelHuman;
import lotr.client.render.entity.LOTRRenderBiped;
import lotr.client.render.entity.LOTRRandomSkins;
import lotr.common.entity.LOTRRandomSkinEntity;
import lotr.common.entity.npc.LOTREntityNPC;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
import com.zivilon.cinder_loe.entity.Limwaith;
public class RenderBattleNun extends LOTRRenderBiped {
public static LOTRRandomSkins skinsFemale;
public ModelBiped outfitModel = (ModelBiped)new LOTRModelHuman(0.6F, false);
public RenderBattleNun() {
super((ModelBiped)new LOTRModelHuman(), 0.5F);
setRenderPassModel((ModelBase)this.outfitModel);
skinsFemale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/arnorNun/arnorNun_female");
}
public ResourceLocation getEntityTexture(Entity entity) {
BattleNun battleNun = (BattleNun)entity;
if (((LOTREntityNPC)battleNun).familyInfo.isMale())
return skinsFemale.getRandomSkin((LOTRRandomSkinEntity)battleNun);
return skinsFemale.getRandomSkin((LOTRRandomSkinEntity)battleNun);
}
public int shouldRenderPass(EntityLiving entity, int pass, float f) {
BattleNun battleNun = (BattleNun)entity;
return super.shouldRenderPass((EntityLiving)battleNun, pass, f);
}
}

@ -1,26 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import lotr.client.render.entity.LOTRRandomSkins;
import lotr.common.entity.LOTRRandomSkinEntity;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import com.zivilon.cinder_loe.client.model.ModelFangornAuroch;
import com.zivilon.cinder_loe.entity.FangornAuroch;
public class RenderFangornAuroch extends RenderLiving {
public static LOTRRandomSkins aurochsSkins;
public RenderFangornAuroch() {
super((ModelBase)new ModelFangornAuroch(), 0.5F);
aurochsSkins = LOTRRandomSkins.loadSkinsList("lotr:mob/aurochs");
}
public ResourceLocation getEntityTexture(Entity entity) {
FangornAuroch aurochs = (FangornAuroch)entity;
ResourceLocation skin = aurochsSkins.getRandomSkin((LOTRRandomSkinEntity)aurochs);
return skin;
}
}

@ -1,46 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import com.zivilon.cinder_loe.entity.FangornBear;
import java.util.HashMap;
import java.util.Map;
import lotr.client.model.LOTRModelBear;
import lotr.client.render.entity.LOTRRenderBear;
import lotr.common.entity.animal.LOTREntityBear;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class RenderFangornBear extends RenderLiving {
public static Map bearSkins = new HashMap<Object, Object>();
public RenderFangornBear() {
super((ModelBase)new LOTRModelBear(), 0.5F);
}
protected ResourceLocation getEntityTexture(Entity entity) {
FangornBear bear = (FangornBear)entity;
return getBearSkin(bear.getBearType());
}
public static ResourceLocation getBearSkin(LOTREntityBear.BearType type) {
String s = type.textureName();
ResourceLocation skin = (ResourceLocation)bearSkins.get(s);
if (skin == null) {
skin = new ResourceLocation("lotr:mob/bear/" + s + ".png");
bearSkins.put(s, skin);
}
return skin;
}
public void preRenderCallback(EntityLivingBase entity, float f) {
scaleBearModel();
}
public static void scaleBearModel() {
float scale = 1.2F;
GL11.glScalef(scale, scale, scale);
}
}

@ -1,32 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import lotr.common.entity.LOTRRandomSkinEntity;
import lotr.client.render.entity.LOTRRandomSkins;
import lotr.common.entity.animal.LOTREntityElk;
import lotr.common.entity.npc.LOTRNPCMount;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import com.zivilon.cinder_loe.client.model.ModelFangornElk;
import com.zivilon.cinder_loe.entity.FangornElk;
public class RenderFangornElk extends RenderLiving {
private static LOTRRandomSkins elkSkins;
private static ResourceLocation saddleTexture = new ResourceLocation("lotr:mob/elk/saddle.png");
public RenderFangornElk() {
super((ModelBase)new ModelFangornElk(), 0.5F);
setRenderPassModel((ModelBase)new ModelFangornElk(0.5F));
elkSkins = LOTRRandomSkins.loadSkinsList("lotr:mob/elk/elk");
}
public ResourceLocation getEntityTexture(Entity entity) {
FangornElk elk = (FangornElk)entity;
ResourceLocation elkSkin = elkSkins.getRandomSkin((LOTRRandomSkinEntity)elk);
return elkSkin;
}
}

@ -1,21 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import lotr.client.model.LOTRModelBoar;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class RenderFangornWildBoar extends RenderLiving {
public static ResourceLocation boarSkin = new ResourceLocation("lotr:mob/boar/boar.png");
public RenderFangornWildBoar() {
super((ModelBase)new LOTRModelBoar(), 0.7F);
setRenderPassModel((ModelBase)new LOTRModelBoar(0.5F));
}
protected ResourceLocation getEntityTexture(Entity entity) {
return boarSkin;
}
}

@ -1,26 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import lotr.common.entity.npc.LOTRNPCMount;
import lotr.client.render.entity.LOTRRenderHorse;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import com.zivilon.cinder_loe.entity.FangornWolf;
import com.zivilon.cinder_loe.client.model.ModelFangornWolf;
public class RenderFangornWolf extends RenderLiving {
public static final ResourceLocation wolfSkin = new ResourceLocation("minecraft:textures/entity/wolf/wolf.png");
public RenderFangornWolf() {
super((ModelBase)new ModelFangornWolf(), 0.7F);
setRenderPassModel((ModelBase)new ModelFangornWolf());
}
protected ResourceLocation getEntityTexture(Entity entity) {
return wolfSkin;
}
}

@ -1,42 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import lotr.client.model.LOTRModelHuman;
import lotr.client.render.entity.LOTRRenderBiped;
import lotr.client.render.entity.LOTRRandomSkins;
import lotr.common.entity.LOTRRandomSkinEntity;
import lotr.common.entity.npc.LOTREntityMoredain;
import lotr.common.entity.npc.LOTREntityNPC;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
import com.zivilon.cinder_loe.entity.Limwaith;
public class RenderLimwaith extends LOTRRenderBiped {
public static LOTRRandomSkins skinsMale;
public static LOTRRandomSkins skinsFemale;
public ModelBiped outfitModel = (ModelBiped)new LOTRModelHuman(0.6F, false);
public RenderLimwaith() {
super((ModelBiped)new LOTRModelHuman(), 0.5F);
setRenderPassModel((ModelBase)this.outfitModel);
skinsMale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/limwaith/limwaith_male");
skinsFemale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/limwaith/limwaith_female");
}
public ResourceLocation getEntityTexture(Entity entity) {
Limwaith limwaith = (Limwaith)entity;
if (((LOTREntityNPC)limwaith).familyInfo.isMale())
return skinsMale.getRandomSkin((LOTRRandomSkinEntity)limwaith);
return skinsFemale.getRandomSkin((LOTRRandomSkinEntity)limwaith);
}
public int shouldRenderPass(EntityLiving entity, int pass, float f) {
Limwaith limwaith = (Limwaith)entity;
return super.shouldRenderPass((EntityLiving)limwaith, pass, f);
}
}

@ -1,32 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import com.zivilon.cinder_loe.entity.Limwaith;
import lotr.client.model.LOTRModelHuman;
import lotr.client.render.entity.LOTRRandomSkins;
import lotr.client.render.entity.LOTRRenderBiped;
import lotr.common.entity.LOTRRandomSkinEntity;
import lotr.common.entity.npc.LOTREntityNPC;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
public class RenderLimwaithShaman extends RenderLimwaith {
private static LOTRRandomSkins outfits;
public RenderLimwaithShaman() {
outfits = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/limwaith/shaman_outfit");
}
@Override
public int shouldRenderPass(EntityLiving entity, int pass, float f) {
Limwaith shaman = (Limwaith) entity;
if (pass == 1 && shaman.getEquipmentInSlot(3) == null) {
this.setRenderPassModel((ModelBase)this.outfitModel);
this.bindTexture(outfits.getRandomSkin(shaman));
return 1;
}
return super.shouldRenderPass((EntityLiving)shaman, pass, f);
}
}

@ -1,50 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
import com.zivilon.cinder_loe.entity.Renegade;
import lotr.client.model.LOTRModelHuman;
import lotr.client.render.entity.LOTRRandomSkins;
import lotr.client.render.entity.LOTRRenderBiped;
import lotr.common.entity.LOTRRandomSkinEntity;
import lotr.common.entity.npc.LOTREntityNPC;
public class RenderRenegade extends LOTRRenderBiped {
private static LOTRRandomSkins skinsMale;
private static LOTRRandomSkins skinsFemale;
private static LOTRRandomSkins headwearFemale;
protected ModelBiped outfitModel = (ModelBiped) new LOTRModelHuman(0.6F, false);
public RenderRenegade() {
super((ModelBiped) new LOTRModelHuman(), 0.5F);
skinsMale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/renegade/renegade_male");
skinsFemale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/renegade/renegade_female");
headwearFemale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/renegade/headwear_female");
}
public ResourceLocation getEntityTexture(Entity entity) {
Renegade man = (Renegade) entity;
if (((LOTREntityNPC) man).familyInfo.isMale()) return skinsMale.getRandomSkin((LOTRRandomSkinEntity) man);
return skinsFemale.getRandomSkin((LOTRRandomSkinEntity) man);
}
public int shouldRenderPass(EntityLiving entity, int pass, float f) {
Renegade man = (Renegade) entity;
if (pass == 0 && man.getEquipmentInSlot(4) == null) if (!((LOTREntityNPC) man).familyInfo.isMale()
&& LOTRRandomSkins.nextInt((LOTRRandomSkinEntity) man, 4) == 0) {
setRenderPassModel((ModelBase) this.outfitModel);
bindTexture(headwearFemale.getRandomSkin((LOTRRandomSkinEntity) man));
return 1;
}
return super.shouldRenderPass((EntityLiving) man, pass, f);
}
}

@ -1,50 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import lotr.client.LOTRClientProxy;
import net.minecraft.client.renderer.Tessellator;
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.SarumanFireball;
public class RenderSarumanFireball extends Render {
public static final ResourceLocation particlesTexture = new ResourceLocation("cinder_loe:misc/particles.png");
protected ResourceLocation getEntityTexture(Entity entity) {
return particlesTexture;
}
public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) {
GL11.glPushMatrix();
GL11.glTranslatef((float)d, (float)d1, (float)d2);
GL11.glEnable(32826);
bindEntityTexture(entity);
Tessellator tessellator = Tessellator.instance;
drawSprite(tessellator, 24 + ((SarumanFireball)entity).animationTick);
GL11.glDisable(32826);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
}
private void drawSprite(Tessellator tessellator, int index) {
float f = (index % 8 * 16 + 0) / 128.0F;
float f1 = (index % 8 * 16 + 16) / 128.0F;
float f2 = (index / 8 * 16 + 0) / 128.0F;
float f3 = (index / 8 * 16 + 16) / 128.0F;
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.setBrightness(15728880);
tessellator.addVertexWithUV((0.0F - f5), (0.0F - f6), 0.0D, f, f3);
tessellator.addVertexWithUV((f4 - f5), (0.0F - f6), 0.0D, f1, f3);
tessellator.addVertexWithUV((f4 - f5), (f4 - f6), 0.0D, f1, f2);
tessellator.addVertexWithUV((0.0F - f5), (f4 - f6), 0.0D, f, f2);
tessellator.draw();
}
}

@ -1,33 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import lotr.client.model.LOTRModelHuman;
import lotr.client.render.entity.LOTRRenderBiped;
import lotr.client.render.entity.LOTRRandomSkins;
import lotr.common.entity.LOTRRandomSkinEntity;
import lotr.common.entity.npc.LOTREntityNPC;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
public class RenderUtumnoSlave extends LOTRRenderBiped {
public static LOTRRandomSkins skins;
public ModelBiped outfitModel = (ModelBiped)new LOTRModelHuman(0.6F, false);
public RenderUtumnoSlave() {
super((ModelBiped)new LOTRModelHuman(), 0.5F);
setRenderPassModel((ModelBase)this.outfitModel);
skins = LOTRRandomSkins.loadSkinsList("lotr:mob/scrapTrader");
}
public ResourceLocation getEntityTexture(Entity entity) {
LOTREntityNPC lotrEntity = (LOTREntityNPC) entity;
return skins.getRandomSkin(lotrEntity);
}
public int shouldRenderPass(EntityLiving entity, int pass, float f) {
return super.shouldRenderPass(entity, pass, f);
}
}

@ -1,43 +0,0 @@
package com.zivilon.cinder_loe.client.render;
import lotr.client.model.LOTRModelMarshWraith;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.zivilon.cinder_loe.entity.Wraith;
public class RenderWraith extends RenderLiving {
private static ResourceLocation skin = new ResourceLocation("cinder_loe:mob/wraith/wraith.png");
public RenderWraith() {
super((ModelBase)new LOTRModelMarshWraith(), 0.5F);
}
protected ResourceLocation getEntityTexture(Entity entity) {
return skin;
}
protected void preRenderCallback(EntityLivingBase entity, float f) {
super.preRenderCallback(entity, f);
float f1 = 0.9375F;
float hover = MathHelper.sin((((Entity)entity).ticksExisted + f) * 0.15F) * 0.2F - 0.5F;
GL11.glScalef(f1, f1, f1);
GL11.glTranslatef(0.0F, hover, 0.0F);
Wraith wraith = (Wraith)entity;
if (wraith.getDeathFadeTime() > 0) {
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glEnable(3008);
GL11.glColor4f(1.0F, 1.0F, 1.0F, wraith.getDeathFadeTime() / 30.0F);
}
}
protected float getDeathMaxRotation(EntityLivingBase entity) {
return 0.0F;
}
}

@ -1,43 +0,0 @@
package com.zivilon.cinder_loe.client.render.block;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import com.zivilon.cinder_loe.tileentity.TileEntityMistBlock;
import lotr.client.render.tileentity.LOTRRenderUtumnoPortal;
public class RenderMistBlock extends TileEntitySpecialRenderer {
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) {
TileEntityMistBlock mist = (TileEntityMistBlock)tileentity;
GL11.glPushMatrix();
GL11.glDisable(2884);
GL11.glDisable(3553);
GL11.glDisable(2896);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glDepthMask(false);
int passes = 60;
for (int i = 0; i < passes; i++) {
GL11.glPushMatrix();
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.0F + i * 0.5F, (float)d2 + 0.5F);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(mist.color_red, mist.color_green, mist.color_blue, (passes - i) / passes);
double width = 0.5D;
tessellator.addVertexWithUV(width, 0.0D, width, 0.0D, 0.0D);
tessellator.addVertexWithUV(width, 0.0D, -width, 0.0D, 0.0D);
tessellator.addVertexWithUV(-width, 0.0D, -width, 0.0D, 0.0D);
tessellator.addVertexWithUV(-width, 0.0D, width, 0.0D, 0.0D);
tessellator.draw();
GL11.glPopMatrix();
}
GL11.glDepthMask(true);
GL11.glEnable(3553);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(3042);
GL11.glEnable(2896);
GL11.glEnable(2884);
GL11.glPopMatrix();
}
}

@ -1,151 +0,0 @@
package com.zivilon.cinder_loe.client.render.item;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
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.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemCloth;
import net.minecraft.item.ItemMap;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.MapData;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.MinecraftForgeClient;
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
public class RenderHelper extends ItemRenderer {
public RenderHelper() {
super(Minecraft.getMinecraft());
}
public static void customRenderItemIn2D(Tessellator p_78439_0_, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int p_78439_5_, int p_78439_6_, float p_78439_7_, boolean enchant) {
if (!enchant) GL11.glPushMatrix(); // Save the current OpenGL state
if (!enchant) GL11.glEnable(GL11.GL_BLEND); // Enable blending
if (!enchant) OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); // Apply your custom blend function for semi-transparency
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(0.0F, 0.0F, 1.0F);
p_78439_0_.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)p_78439_1_, (double)p_78439_4_);
p_78439_0_.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)p_78439_3_, (double)p_78439_4_);
p_78439_0_.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)p_78439_3_, (double)p_78439_2_);
p_78439_0_.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)p_78439_1_, (double)p_78439_2_);
p_78439_0_.draw();
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(0.0F, 0.0F, -1.0F);
p_78439_0_.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_2_);
p_78439_0_.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_2_);
p_78439_0_.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_4_);
p_78439_0_.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_4_);
p_78439_0_.draw();
float f5 = 0.5F * (p_78439_1_ - p_78439_3_) / (float)p_78439_5_;
float f6 = 0.5F * (p_78439_4_ - p_78439_2_) / (float)p_78439_6_;
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(-1.0F, 0.0F, 0.0F);
int k;
float f7;
float f8;
for (k = 0; k < p_78439_5_; ++k)
{
f7 = (float)k / (float)p_78439_5_;
f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5;
p_78439_0_.addVertexWithUV((double)f7, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_);
p_78439_0_.addVertexWithUV((double)f7, 0.0D, 0.0D, (double)f8, (double)p_78439_4_);
p_78439_0_.addVertexWithUV((double)f7, 1.0D, 0.0D, (double)f8, (double)p_78439_2_);
p_78439_0_.addVertexWithUV((double)f7, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_);
}
p_78439_0_.draw();
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(1.0F, 0.0F, 0.0F);
float f9;
for (k = 0; k < p_78439_5_; ++k)
{
f7 = (float)k / (float)p_78439_5_;
f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5;
f9 = f7 + 1.0F / (float)p_78439_5_;
p_78439_0_.addVertexWithUV((double)f9, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_);
p_78439_0_.addVertexWithUV((double)f9, 1.0D, 0.0D, (double)f8, (double)p_78439_2_);
p_78439_0_.addVertexWithUV((double)f9, 0.0D, 0.0D, (double)f8, (double)p_78439_4_);
p_78439_0_.addVertexWithUV((double)f9, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_);
}
p_78439_0_.draw();
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(0.0F, 1.0F, 0.0F);
for (k = 0; k < p_78439_6_; ++k)
{
f7 = (float)k / (float)p_78439_6_;
f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6;
f9 = f7 + 1.0F / (float)p_78439_6_;
p_78439_0_.addVertexWithUV(0.0D, (double)f9, 0.0D, (double)p_78439_1_, (double)f8);
p_78439_0_.addVertexWithUV(1.0D, (double)f9, 0.0D, (double)p_78439_3_, (double)f8);
p_78439_0_.addVertexWithUV(1.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8);
p_78439_0_.addVertexWithUV(0.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8);
}
p_78439_0_.draw();
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(0.0F, -1.0F, 0.0F);
for (k = 0; k < p_78439_6_; ++k)
{
f7 = (float)k / (float)p_78439_6_;
f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6;
p_78439_0_.addVertexWithUV(1.0D, (double)f7, 0.0D, (double)p_78439_3_, (double)f8);
p_78439_0_.addVertexWithUV(0.0D, (double)f7, 0.0D, (double)p_78439_1_, (double)f8);
p_78439_0_.addVertexWithUV(0.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8);
p_78439_0_.addVertexWithUV(1.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8);
}
p_78439_0_.draw();
if (!enchant) GL11.glPopMatrix(); // Restore the saved OpenGL state
}
}

@ -1,81 +0,0 @@
package com.zivilon.cinder_loe.command;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChatComponentText;
import com.zivilon.cinder_loe.character.CharacterRoleAPI;
import com.zivilon.cinder_loe.util.Utilities;
import java.util.UUID;
public class CommandCinderCharacter extends CommandBase {
@Override
public String getCommandName() {
return "cinder_character";
}
@Override
public String getCommandUsage(ICommandSender sender) {
return "/cinder_character <set/get/remove> <character_name> [player_name]";
}
@Override
public int getRequiredPermissionLevel() {
return 4;
}
@Override
public void processCommand(ICommandSender sender, String[] args) {
if(args.length < 2) {
sender.addChatMessage(new ChatComponentText("Incorrect arguments. Usage: " + getCommandUsage(sender)));
return;
}
String action = args[0];
String character = args[1];
if (action.equals("set")) {
if(args.length < 3) {
// Set character UUID to player UUID
sender.addChatMessage(new ChatComponentText("Incorrect arguments. Please specify player: " + getCommandUsage(sender)));
} else {
String player = args[2];
EntityPlayerMP player_entity = MinecraftServer.getServer().getConfigurationManager().func_152612_a(player);
if (player_entity == null) {
sender.addChatMessage(new ChatComponentText("Invalid player name"));
} else {
sender.addChatMessage(new ChatComponentText("Setting player " + player_entity.getCommandSenderName() + " as " + character));
CharacterRoleAPI.setCharacterRoleUUID(character, player_entity.getUniqueID());
}
}
} else if (action.equals("remove")) {
UUID uuid = CharacterRoleAPI.getCharacterRoleUUID(character);
if (uuid == null) {
sender.addChatMessage(new ChatComponentText("Invalid character name"));
return;
}
sender.addChatMessage(new ChatComponentText("Cleared player for character " + character));
CharacterRoleAPI.removeCharacterRole(character);
} else if (action.equals("get")) {
UUID uuid = CharacterRoleAPI.getCharacterRoleUUID(character);
if (uuid == null) {
sender.addChatMessage(new ChatComponentText("Character " + character + " is unclaimed"));
return;
}
String player_name = Utilities.getPlayerByUUID(uuid).getCommandSenderName();
if (player_name != null) {
sender.addChatMessage(new ChatComponentText("Character " + character + " is currently set to " + player_name));
return;
}
sender.addChatMessage(new ChatComponentText("Character " + character + " is currently set to offline player " + uuid.toString()));
} else {
sender.addChatMessage(new ChatComponentText("Incorrect arguments. Usage: " + getCommandUsage(sender)));
return;
}
}
}

@ -1,43 +0,0 @@
package com.zivilon.cinder_loe.coremod;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.SortingIndex;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.Mixins;
import java.util.Map;
@TransformerExclusions({"com.zivilon.cinder_loe.coremod"})
@SortingIndex(1001)
@MCVersion("1.7.10")
public class CoreMod implements IFMLLoadingPlugin {
@Override
public String[] getASMTransformerClass() {
return new String[] {"com.zivilon.cinder_loe.coremod.LOTRMaterialTransformer","com.zivilon.cinder_loe.coremod.DwarvenForgeTransformer","com.zivilon.cinder_loe.coremod.LOTRWeaponLinker", "com.zivilon.cinder_loe.coremod.LOTRBannerAdder", "com.zivilon.cinder_loe.coremod.LOTRSpawnListLinker", "com.zivilon.cinder_loe.coremod.OptiFinePatcher"};
}
@Override
public String getModContainerClass() {
// Return the class name of your @Mod class
return null;
}
@Override
public String getSetupClass() {
// Return the class name that sets up coremod environment, or null if none
return null;
}
@Override
public void injectData(Map<String, Object> data) {
MixinBootstrap.init();
Mixins.addConfiguration("mixins.cinder_loe.json");
}
@Override
public String getAccessTransformerClass() {
// Return the class name of your access transformer or null if none
return null;
}
}

@ -1,168 +0,0 @@
package com.zivilon.cinder_loe.coremod;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.IntInsnNode;
import org.objectweb.asm.tree.TypeInsnNode;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import java.util.List;
import java.util.ArrayList;
public class LOTRBannerAdder implements IClassTransformer {
public static List<BannerInfo> custom_banners = new ArrayList<>();
public void registerBanners() {
custom_banners = new ArrayList<>();
// Arguments: enum name, texture name, ID, faction name
// register("RED_DWARF", "redDwarf", 42, "DURINS_FOLK");
// register("TEST", "test", 43, "GONDOR");
// NOT FUNCTIONAL, DO NOT REGISTER
// Non-compliant clients crash if original banner is unrecognized even if fallback is vanilla
// Most likely something in PacketEntityMetadata
}
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if ("lotr.common.item.LOTRItemBanner$BannerType".equals(transformedName)) {
registerBanners();
// Get class
ClassReader classReader = new ClassReader(basicClass);
ClassNode classNode = new ClassNode();
classReader.accept(classNode, 0);
// Add the new enum constant
for (BannerInfo banner : custom_banners) {
FieldNode newEnumConstant = new FieldNode(
Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL + Opcodes.ACC_ENUM,
banner.enum_name,
"Llotr/common/item/LOTRItemBanner$BannerType;",
null,
null
);
classNode.fields.add(newEnumConstant);
}
// Locate <clinit>
MethodNode clinit = null;
for (MethodNode method : classNode.methods) {
if ("<clinit>".equals(method.name)) {
clinit = method;
break;
}
}
InsnList insns = clinit.instructions;
AbstractInsnNode constructor_injection_point = null;
for (int i = 0; i < insns.size(); i++) {
AbstractInsnNode insn = insns.get(i);
// Check if the instruction is a BIPUSH
if (insn.getOpcode() == Opcodes.BIPUSH) {
IntInsnNode intInsn = (IntInsnNode) insn;
// Check if the operand is 42, indicating the size of the $VALUES array
if (intInsn.operand == 42) {
// Found the instruction to modify
constructor_injection_point = insn;
// Modify the operand from 42 to 43 to account for the new enum constant
intInsn.operand = 42 + custom_banners.size();
System.out.println("Enum array length set to " + intInsn.operand);
System.out.println("Banner list size: " + custom_banners.size());
break;
}
}
}
// Create the constructor instructions to add new banner
InsnList constructor_injection = new InsnList();
for (BannerInfo banner : custom_banners) {
constructor_injection.add(new TypeInsnNode(Opcodes.NEW, "lotr/common/item/LOTRItemBanner$BannerType"));
constructor_injection.add(new InsnNode(Opcodes.DUP));
System.out.println("Registering with enum " + banner.enum_name);
constructor_injection.add(new LdcInsnNode(banner.enum_name));
System.out.println("Registering with ordinal " + banner.ordinal);
constructor_injection.add(new IntInsnNode(Opcodes.BIPUSH, banner.ordinal));
constructor_injection.add(new IntInsnNode(Opcodes.BIPUSH, banner.ordinal));
System.out.println("Registering with identifier " + banner.identifier);
constructor_injection.add(new LdcInsnNode(banner.identifier));
constructor_injection.add(new FieldInsnNode(Opcodes.GETSTATIC, "lotr/common/fac/LOTRFaction", banner.faction, "Llotr/common/fac/LOTRFaction;"));
constructor_injection.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, "lotr/common/item/LOTRItemBanner$BannerType", "<init>", "(Ljava/lang/String;IILjava/lang/String;Llotr/common/fac/LOTRFaction;)V", false));
constructor_injection.add(new FieldInsnNode(Opcodes.PUTSTATIC, "lotr/common/item/LOTRItemBanner$BannerType", banner.enum_name, "Llotr/common/item/LOTRItemBanner$BannerType;"));
}
// Insert the new instructions
if (constructor_injection_point != null) {
insns.insertBefore(constructor_injection_point, constructor_injection);
}
// Modifying the $VALUES array
// Create new instruction list to be injected later
InsnList values_array_injection = new InsnList();
// Add instructions to the instruction list
for (BannerInfo banner : custom_banners) {
values_array_injection.add(new InsnNode(Opcodes.DUP));
values_array_injection.add(new IntInsnNode(Opcodes.BIPUSH, banner.ordinal));
values_array_injection.add(new FieldInsnNode(Opcodes.GETSTATIC, "lotr/common/item/LOTRItemBanner$BannerType", banner.enum_name, "Llotr/common/item/LOTRItemBanner$BannerType;"));
values_array_injection.add(new InsnNode(Opcodes.AASTORE));
}
// Find the putstatic instruction for $VALUES
// This is where the fields are injected into a list, we want to inject our instructions before this
AbstractInsnNode values_injection_point = null;
while (constructor_injection_point != null) {
constructor_injection_point = constructor_injection_point.getNext();
if (constructor_injection_point.getOpcode() == Opcodes.PUTSTATIC) {
values_injection_point = constructor_injection_point;
break;
}
}
// Insert the new instructions before the putstatic instruction
if (values_injection_point != null) {
insns.insertBefore(values_injection_point, values_array_injection);
}
// Write the modified class back to a byte array
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
classNode.accept(classWriter);
return classWriter.toByteArray(); // Return the modified class
}
return basicClass; // Return the unmodified class for all other classes
}
public void register(String enum_name, String identifier, int ordinal, String faction) {
System.out.println("Registering banner " + enum_name + " " + identifier);
custom_banners.add(new BannerInfo(enum_name, identifier, ordinal, faction));
}
public class BannerInfo {
String enum_name;
String identifier;
int ordinal;
String faction;
public BannerInfo(String enum_name, String identifier, int ordinal, String faction) {
this.enum_name = enum_name;
this.identifier = identifier;
this.ordinal = ordinal;
this.faction = faction;
}
}
}

@ -1,52 +0,0 @@
package com.zivilon.cinder_loe.coremod;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode;
public class LOTRMaterialTransformer implements IClassTransformer {
@Override
public byte[] transform(String name, String transformedName, byte[] classBytes) {
if (transformedName.equals("lotr.common.item.LOTRMaterial")) {
System.out.println("[CinderLoE] Transforming LOTRMaterial...");
ClassReader reader = new ClassReader(classBytes);
ClassNode classNode = new ClassNode();
reader.accept(classNode, 0);
// Add the RED_DWARF_STEEL field
addMaterial("RED_DWARF", classNode);
addMaterial("WIZARD", classNode);
addMaterial("LIMWAITH_BONE", classNode);
addMaterial("BONEMOLD", classNode);
addMaterial("LIMWAITH_WOOD", classNode);
addMaterial("EVENT", classNode);
addMaterial("BREE", classNode);
addMaterial("BATTLENUN", classNode);
addMaterial("ASH", classNode);
// Convert your ClassNode back to byte array with ClassWriter
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
classNode.accept(writer);
byte[] transformedBytes = writer.toByteArray();
return transformedBytes;
}
return classBytes;
}
public void addMaterial(String fieldName, ClassNode classNode) {
FieldNode field = new FieldNode(
Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC,
fieldName,
"Llotr/common/item/LOTRMaterial;", // Adjust the descriptor based on the actual package name
null,
null
);
classNode.fields.add(field);
}
}

@ -1,49 +0,0 @@
package com.zivilon.cinder_loe.coremod;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode;
public class LOTRSpawnListLinker implements IClassTransformer {
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if ("lotr.common.world.spawning.LOTRSpawnList".equals(transformedName)) {
System.out.println("[CinderLoE] Linking CinderLoE spawn-lists to LOTRMod...");
return addLinks(basicClass, "RED_DWARF", "LIMWAITH"); // Can add any number of items, append with comma
}
return basicClass;
}
private byte[] addLinks(byte[] classBytes, String... fieldNames) {
ClassReader reader = new ClassReader(classBytes);
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
reader.accept(new ClassVisitor(Opcodes.ASM5, writer) {
@Override
public void visitEnd() {
// Add each field specified in the fieldNames array
for (String fieldName : fieldNames) {
addSpawnListLink(fieldName, cv);
}
super.visitEnd();
}
}, 0);
return writer.toByteArray();
}
private void addSpawnListLink(String fieldName, ClassVisitor cv) {
// Define the field with public static access, name from the parameter, and type net.minecraft.item.Item
FieldVisitor fv = cv.visitField(Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, fieldName, "Llotr/common/world/spawning/LOTRSpawnList;", null, null);
if (fv != null) {
fv.visitEnd();
}
}
}

@ -1,58 +0,0 @@
package com.zivilon.cinder_loe.coremod;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode;
public class LOTRWeaponLinker implements IClassTransformer {
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if ("lotr.common.LOTRMod".equals(transformedName)) {
System.out.println("[CinderLoE] Linking CinderLoE items to LOTRMod...");
// Can add any number of items, append with comma
return addLinks(basicClass,
"spearRedDwarf", "crossbowRedDwarf", "swordRedDwarf", "battleaxeRedDwarf", "pikeRedDwarf", "daggerRedDwarf", "daggerRedDwarfPoisoned", "hammerRedDwarf",
"radagastStaff", "alatarStaff", "pallandoStaff", "sarumanStaff",
"spearLimwaith", "tridentLimwaith", "daggerLimwaith", "daggerLimwaithPoisoned", "truncheonLimwaith", "battleaxeLimwaith", "blowgunLimwaith",
"frostblade", "spearsolidgold", "whip",
"swordBree",
"maceArnor",
"daggerAsh","bowAsh","hammerAsh","pikeAsh","battleaxeAsh","swordAsh","spearAsh");
}
return basicClass;
}
private byte[] addLinks(byte[] classBytes, String... fieldNames) {
ClassReader reader = new ClassReader(classBytes);
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
reader.accept(new ClassVisitor(Opcodes.ASM5, writer) {
@Override
public void visitEnd() {
// Add each field specified in the fieldNames array
for (String fieldName : fieldNames) {
addItemLink(fieldName, cv);
}
super.visitEnd();
}
}, 0);
return writer.toByteArray();
}
private void addItemLink(String fieldName, ClassVisitor cv) {
// Define the field with public static access, name from the parameter, and type net.minecraft.item.Item
FieldVisitor fv = cv.visitField(Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, fieldName, "Lnet/minecraft/item/Item;", null, null);
if (fv != null) {
fv.visitEnd();
}
}
}

@ -1,130 +0,0 @@
package com.zivilon.cinder_loe.coremod;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.util.Printer;
import org.objectweb.asm.util.Textifier;
import org.objectweb.asm.util.TraceMethodVisitor;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Iterator;
import net.minecraft.launchwrapper.IClassTransformer;
public class OptiFinePatcher implements IClassTransformer {
@Override
public byte[] transform(String name, String transformedName, byte[] classBytes) {
if (transformedName.equals("ItemRendererOF")) {
System.out.println("[CinderLoE] Transforming ItemRendererOF...");
ClassReader reader = new ClassReader(classBytes);
ClassNode classNode = new ClassNode();
reader.accept(classNode, 0);
for (MethodNode method : classNode.methods) {
if (method.name.equals("func_78443_a") && method.desc.equals("(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;I)V")) {
InsnList instructions = method.instructions;
AbstractInsnNode currentNode = null;
Iterator<AbstractInsnNode> nodes = instructions.iterator();
int occurrenceCounter = 0;
while (nodes.hasNext()) {
currentNode = nodes.next();
if (currentNode.getOpcode() == Opcodes.INVOKESTATIC) {
MethodInsnNode methodCall = (MethodInsnNode) currentNode;
if (methodCall.owner.equals("ItemRendererOF") && methodCall.name.equals("func_78439_a") && methodCall.desc.equals("(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) {
occurrenceCounter++;
InsnNode bool = null;
if (occurrenceCounter == 1) {
bool = new InsnNode(Opcodes.ICONST_0);
instructions.insertBefore(currentNode, bool);
MethodInsnNode newMethodCall = new MethodInsnNode(Opcodes.INVOKESTATIC, "com/zivilon/cinder_loe/client/render/item/RenderHelper", "customRenderItemIn2D", "(Lnet/minecraft/client/renderer/Tessellator;FFFFIIFZ)V", false);
instructions.set(currentNode, newMethodCall);
}
if (occurrenceCounter == 2) {
bool = new InsnNode(Opcodes.ICONST_1);
instructions.insertBefore(currentNode, bool);
MethodInsnNode newMethodCall = new MethodInsnNode(Opcodes.INVOKESTATIC, "com/zivilon/cinder_loe/client/render/item/RenderHelper", "customRenderItemIn2D", "(Lnet/minecraft/client/renderer/Tessellator;FFFFIIFZ)V", false);
instructions.set(currentNode, newMethodCall);
}
// Modify only the second occurrence
if (occurrenceCounter == 3) {
bool = new InsnNode(Opcodes.ICONST_1);
instructions.insertBefore(currentNode, bool);
MethodInsnNode newMethodCall = new MethodInsnNode(Opcodes.INVOKESTATIC, "com/zivilon/cinder_loe/client/render/item/RenderHelper", "customRenderItemIn2D", "(Lnet/minecraft/client/renderer/Tessellator;FFFFIIFZ)V", false);
instructions.set(currentNode, newMethodCall);
break;
}
}
}
}
// Color code here
int index = -1;
for (int i = 0; i < instructions.size(); i++) {
currentNode = instructions.get(i);
if (currentNode.getOpcode() == Opcodes.LDC && ((LdcInsnNode) currentNode).cst.equals(0.7599999904632568f)) {
System.out.println("[CinderLoE-Coremod] Found Optifine code to remove...");
index = i;
break;
}
}
if (index != -1) {
for (int i = 0; i < 15; i++) {
AbstractInsnNode targetNode = instructions.get(index);
System.out.println(insnToString(targetNode));
instructions.remove(targetNode);
}
InsnList toInject = new InsnList();
toInject.add(new FieldInsnNode(Opcodes.GETSTATIC, "com/zivilon/cinder_loe/CinderLoE_Config", "enchantment_color_red", "F"));
toInject.add(new FieldInsnNode(Opcodes.GETSTATIC, "com/zivilon/cinder_loe/CinderLoE_Config", "enchantment_color_green", "F"));
toInject.add(new FieldInsnNode(Opcodes.GETSTATIC, "com/zivilon/cinder_loe/CinderLoE_Config", "enchantment_color_blue", "F"));
toInject.add(new InsnNode(Opcodes.FCONST_1));
toInject.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "org/lwjgl/opengl/GL11", "glColor4f", "(FFFF)V", false));
instructions.insertBefore(instructions.get(index), toInject);
break;
}
}
}
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
classNode.accept(writer); // Liine 104
byte[] transformedBytes = writer.toByteArray();
return transformedBytes;
}
return classBytes;
}
// Method to convert an instruction node to string
public static String insnToString(AbstractInsnNode insn){
insn.accept(new TraceMethodVisitor(new Textifier()));
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
Textifier textifier = new Textifier();
TraceMethodVisitor tmv = new TraceMethodVisitor(textifier);
insn.accept(tmv);
textifier.print(pw);
return sw.toString();
}
}

@ -1,23 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.entity.npc.LOTRBannerBearer;
import lotr.common.item.LOTRItemBanner;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class ArnorBannerBearer extends ArnorSoldier implements LOTRBannerBearer {
public ArnorBannerBearer(World world) {
super(world);
}
@Override
public LOTRItemBanner.BannerType getBannerType() {
return LOTRItemBanner.BannerType.RANGER_NORTH;
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.ArnorSoldierSpawnEgg, 1);
}
}

@ -1,74 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRCapes;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.entity.npc.LOTRUnitTradeEntries;
import lotr.common.entity.npc.LOTRUnitTradeable;
import lotr.common.world.spawning.LOTRInvasions;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class ArnorCaptain extends ArnorSoldier implements LOTRUnitTradeable {
public ArnorCaptain(World world) {
super(world);
addTargetTasks(false);
this.npcCape = LOTRCapes.RANGER;
}
public float getAlignmentBonus() {
return 5.0F;
}
public LOTRUnitTradeEntries getUnits() {
return CinderLoE.ARNOR_CAPTAIN;
}
public LOTRInvasions getWarhorn() {
return LOTRInvasions.RANGER_NORTH;
}
public void onUnitTrade(EntityPlayer entityplayer) {
}
public boolean canTradeWith(EntityPlayer entityplayer) {
return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 150.0F && isFriendlyAndAligned(entityplayer));
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.ArnorCaptainSpawnEgg, 1);
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
int i = rand.nextInt(4);
if (i == 0) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.swordArnor));
} else if (i == 1 || i == 2) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.daggerArnor));
} else if (i == 3 || i == 4) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearArnor));
}
if (rand.nextInt(4) == 0) {
this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon());
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearArnor));
}
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
setCurrentItemOrArmor(1, new ItemStack(LOTRMod.bootsArnor));
setCurrentItemOrArmor(2, new ItemStack(LOTRMod.legsArnor));
setCurrentItemOrArmor(3, new ItemStack(LOTRMod.bodyArnor));
setCurrentItemOrArmor(4, null);
return data;
}
public String getSpeechBank(EntityPlayer entityplayer) {
if (isFriendlyAndAligned(entityplayer)) {
return "arnorSoldier/captain/friendly";
}
return "arnorSoldier/captain/neutral";
}
}

@ -1,95 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.entity.ai.LOTREntityAIAttackOnCollide;
import lotr.common.entity.npc.LOTREntityDunedain;
import lotr.common.entity.npc.LOTREntityDwarfWarrior;
import lotr.common.LOTRMod;
import lotr.common.LOTRShields;
import lotr.common.entity.npc.LOTREntityGondorSoldier;
import lotr.common.fac.LOTRFaction;
import lotr.common.quest.LOTRMiniQuest;
import lotr.common.quest.LOTRMiniQuestFactory;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import com.zivilon.cinder_loe.CinderLoE;
public class ArnorSoldier extends LOTREntityDunedain {
public ArnorSoldier(World world) {
super(world);
this.npcShield = LOTRShields.ALIGNMENT_RANGER;
}
@Override
public void setupNPCGender() {
this.familyInfo.setMale(true);
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
int i = rand.nextInt(4);
if (i == 0) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.swordArnor));
} else if (i == 1 || i == 2) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.swordArnor));
} else if (i == 3 || i == 4) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearArnor));
}
if (rand.nextInt(4) == 0) {
this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon());
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearArnor));
}
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
setCurrentItemOrArmor(1, new ItemStack(LOTRMod.bootsArnor));
setCurrentItemOrArmor(2, new ItemStack(LOTRMod.legsArnor));
setCurrentItemOrArmor(3, new ItemStack(LOTRMod.bodyArnor));
setCurrentItemOrArmor(4, new ItemStack(LOTRMod.helmetArnor));
return data;
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.ArnorSoldierSpawnEgg, 1);
}
@Override
public LOTRFaction getFaction() {
return LOTRFaction.RANGER_NORTH;
}
@Override
public float getAlignmentBonus() {
return 2.0f;
}
public String getSpeechBank(EntityPlayer entityplayer) {
if (isFriendlyAndAligned(entityplayer)) {
if (this.hiredNPCInfo.getHiringPlayer() == entityplayer)
return "arnorSoldier/soldier/hired";
return "arnorSoldier/soldier/friendly";
}
return "arnorSoldier/soldier/hostile";
}
@Override
public LOTRMiniQuest createMiniQuest() {
if (rand.nextInt(8) == 0) {
return LOTRMiniQuestFactory.RANGER_NORTH_ARNOR_RELIC.createQuest(this);
}
return LOTRMiniQuestFactory.RANGER_NORTH.createQuest(this);
}
@Override
public LOTRMiniQuestFactory getBountyHelpSpeechDir() {
return LOTRMiniQuestFactory.RANGER_NORTH;
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
}
}

@ -1,54 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRMod;
import lotr.common.LOTRShields;
import lotr.common.entity.ai.LOTREntityAIRangedAttack;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.entity.projectile.LOTREntityDart;
import lotr.common.item.LOTRItemBlowgun;
import lotr.common.item.LOTRItemDart;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class ArnorSoldierArcher extends ArnorSoldier {
public ArnorSoldierArcher(World world) {
super(world);
this.spawnRidingHorse = false;
((EntityLiving)this).tasks.addTask(0, (EntityAIBase)new LOTREntityAIRangedAttack(this, 1.3, 30, 50, 16.0f));
this.npcShield = null;
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setRangedWeapon(new ItemStack(LOTRMod.rangerBow));
this.npcItemsInv.setIdleItem(this.npcItemsInv.getRangedWeapon());
return data;
}
@Override
protected void onAttackModeChange(LOTREntityNPC.AttackMode mode, boolean mounted) {
if (mode == LOTREntityNPC.AttackMode.IDLE) {
this.setCurrentItemOrArmor(0, this.npcItemsInv.getIdleItem());
} else {
this.setCurrentItemOrArmor(0, this.npcItemsInv.getRangedWeapon());
}
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase target, float f) {
npcArrowAttack(target, f);
}
@Override
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
this.dropNPCArrows(i);
}
}

@ -1,49 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRAchievement;
import lotr.common.LOTRShields;
import lotr.common.entity.npc.LOTREntityDunedain;
import lotr.common.entity.npc.LOTREntityMoredain;
import lotr.common.entity.npc.LOTRNPCMount;
import lotr.common.quest.LOTRMiniQuest;
import lotr.common.quest.LOTRMiniQuestFactory;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class BattleNun extends ArnorSoldier {
public BattleNun(World world) {
super(world);
this.spawnRidingHorse = false;
this.questInfo.setOfferChance(4000);
this.questInfo.setMinAlignment(150.0f);
this.npcShield = null;
}
@Override
public void setupNPCGender() {
this.familyInfo.setMale(false);
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.maceArnor));
this.npcItemsInv.setIdleItem(new ItemStack(CinderLoE.maceArnor));
setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsArnorBanner));
setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsArnorBanner));
setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyArnorBanner));
if (this.rand.nextBoolean()) {
this.setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetArnorBanner));
} else {
this.setCurrentItemOrArmor(4, null);
}
return data;
}
@Override
public LOTRMiniQuest createMiniQuest() {
return LOTRMiniQuestFactory.RANGER_NORTH.createQuest(this);
}
}

@ -1,64 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRAchievement;
import lotr.common.LOTRCapes;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.entity.npc.LOTRUnitTradeEntries;
import lotr.common.entity.npc.LOTRUnitTradeable;
import lotr.common.item.LOTRItemLeatherHat;
import lotr.common.world.spawning.LOTRInvasions;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class BreeCaptain extends BreeSoldier implements LOTRUnitTradeable {
public BreeCaptain(World world) {
super(world);
addTargetTasks(false);
this.npcCape = LOTRCapes.RANGER;
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setIdleItem(new ItemStack(Items.writable_book));
ItemStack hat = new ItemStack(LOTRMod.leatherHat);
LOTRItemLeatherHat.setHatColor(hat, 6834742);
LOTRItemLeatherHat.setFeatherColor(hat, 40960);
this.setCurrentItemOrArmor(4, hat);
return data;
}
public float getAlignmentBonus() {
return 5.0F;
}
public LOTRUnitTradeEntries getUnits() {
return CinderLoE.BREE_CAPTAIN;
}
public LOTRInvasions getWarhorn() {
return LOTRInvasions.BREE;
}
public void onUnitTrade(EntityPlayer entityplayer) {
LOTRLevelData.getData(entityplayer).addAchievement(LOTRAchievement.tradeBreeCaptain);
}
public boolean canTradeWith(EntityPlayer entityplayer) {
return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 150.0F && isFriendlyAndAligned(entityplayer));
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.BreeCaptainSpawnEgg, 1);
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
}
}

@ -1,53 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRMod;
import lotr.common.entity.ai.LOTREntityAIAttackOnCollide;
import lotr.common.entity.ai.LOTREntityAIRangedAttack;
import lotr.common.entity.npc.LOTREntityNPC;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class BreeCrossbowman extends BreeSoldier {
public BreeCrossbowman(World world) {
super(world);
this.npcShield = null;
}
protected int addBreeAttackAI(int prio) {
((EntityLiving)this).tasks.addTask(prio, (EntityAIBase)new LOTREntityAIRangedAttack(this, 1.25, 30, 50, 16.0f));
return prio;
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setRangedWeapon(new ItemStack(LOTRMod.ironCrossbow));
this.npcItemsInv.setIdleItem(this.npcItemsInv.getRangedWeapon());
return data;
}
@Override
protected void onAttackModeChange(LOTREntityNPC.AttackMode mode, boolean mounted) {
if (mode == LOTREntityNPC.AttackMode.IDLE) {
this.setCurrentItemOrArmor(0, this.npcItemsInv.getIdleItem());
} else {
this.setCurrentItemOrArmor(0, this.npcItemsInv.getRangedWeapon());
}
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float f) {
npcCrossbowAttack(target, f);
}
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
dropNPCCrossbowBolts(i);
}
}

@ -1,94 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRCapes;
import lotr.common.LOTRMod;
import lotr.common.LOTRShields;
import lotr.common.entity.ai.LOTREntityAIAttackOnCollide;
import lotr.common.entity.ai.LOTREntityAIRangedAttack;
import lotr.common.entity.animal.LOTREntityHorse;
import lotr.common.entity.npc.LOTREntityGondorSoldier;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.entity.npc.LOTRNPCMount;
import lotr.common.fac.LOTRFaction;
import lotr.common.quest.LOTRMiniQuest;
import lotr.common.quest.LOTRMiniQuestFactory;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class BreeOutrider extends BreeCrossbowman {
protected EntityAIBase rangedAttackAI = this.createBreeRangedAttackAI();
protected EntityAIBase meleeAttackAI;
public BreeOutrider(World world) {
super(world);
this.addTargetTasks(true);
this.npcCape = LOTRCapes.RANGER;
this.spawnRidingHorse = true;
this.npcShield = LOTRShields.ALIGNMENT_BREE;
}
protected EntityAIBase createBreeRangedAttackAI() {
return new LOTREntityAIRangedAttack(this, 1.25, 30, 40, 16.0f);
}
protected EntityAIBase addBreeAttackAI() {
return new LOTREntityAIAttackOnCollide(this, 1.45D, true);
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
return data;
}
@Override
public void onAttackModeChange(LOTREntityNPC.AttackMode mode, boolean mounted) {
if (this.rangedAttackAI == null) System.out.println("Ranged attack AI is null");
if (this.meleeAttackAI == null) System.out.println("Melee attack AI is null");
if (mode == LOTREntityNPC.AttackMode.IDLE) {
((EntityLiving)this).tasks.removeTask(this.meleeAttackAI);
((EntityLiving)this).tasks.removeTask(this.rangedAttackAI);
this.setCurrentItemOrArmor(0, this.npcItemsInv.getIdleItem());
}
if (mode == LOTREntityNPC.AttackMode.MELEE) {
((EntityLiving)this).tasks.removeTask(this.meleeAttackAI);
((EntityLiving)this).tasks.removeTask(this.rangedAttackAI);
((EntityLiving)this).tasks.addTask(2, this.meleeAttackAI);
this.setCurrentItemOrArmor(0, this.npcItemsInv.getMeleeWeapon());
}
if (mode == LOTREntityNPC.AttackMode.RANGED) {
((EntityLiving)this).tasks.removeTask(this.meleeAttackAI);
((EntityLiving)this).tasks.removeTask(this.rangedAttackAI);
((EntityLiving)this).tasks.addTask(2, this.rangedAttackAI);
this.setCurrentItemOrArmor(0, this.npcItemsInv.getRangedWeapon());
}
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.BreeOutriderSpawnEgg, 1);
}
@Override
public LOTRNPCMount createMountToRide() {
LOTREntityHorse horse = (LOTREntityHorse)super.createMountToRide();
horse.setMountArmor(new ItemStack(LOTRMod.horseArmorIron));
return horse;
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float f) {
npcCrossbowAttack(target, f);
}
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
dropNPCCrossbowBolts(i);
}
@Override
public float getAlignmentBonus() {
return 3.0f;
}
}

@ -1,30 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRMod;
import lotr.common.entity.npc.LOTREntityBreeGuard;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class BreeSoldier extends LOTREntityBreeGuard {
private static ItemStack[] guardWeapons = new ItemStack[]{new ItemStack(CinderLoE.swordBree), new ItemStack(CinderLoE.swordBree), new ItemStack(LOTRMod.pikeIron)};
public BreeSoldier(World world) {
super(world);
this.spawnRidingHorse = false;
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
int i = (rand.nextInt(guardWeapons.length));
this.npcItemsInv.setMeleeWeapon(guardWeapons[i].copy());
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsBree));
setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsBree));
setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyBree));
setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetBree));
return data;
}
}

@ -1,22 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.entity.npc.LOTRBannerBearer;
import lotr.common.item.LOTRItemBanner;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class BreeSoldierBannerBearer extends BreeSoldier implements LOTRBannerBearer {
public BreeSoldierBannerBearer(World world) {
super(world);
}
@Override
public LOTRItemBanner.BannerType getBannerType() {
return LOTRItemBanner.BannerType.BREE;
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
}
}

@ -1,85 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.LOTRAchievement;
import lotr.common.LOTRFoods;
import lotr.common.LOTRMod;
import lotr.common.entity.ai.LOTREntityAIAttackOnCollide;
import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer;
import lotr.common.entity.ai.LOTREntityAIHiredRemainStill;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.fac.LOTRFaction;
import lotr.common.quest.LOTRMiniQuest;
import lotr.common.quest.LOTRMiniQuestFactory;
import lotr.common.world.LOTRWorldChunkManager;
import lotr.common.world.biome.LOTRBiome;
import lotr.common.world.biome.variant.LOTRBiomeVariant;
import lotr.common.world.structure.LOTRChestContents;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIOpenDoor;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.EntityAIWatchClosest2;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
public abstract class FangornAnimal extends LOTREntityNPC {
public FangornAnimal(World world) {
super(world);
setSize(1.6F, 1.8F);
getNavigator().setAvoidsWater(true);
((EntityLiving)this).tasks.addTask(0, (EntityAIBase)new EntityAISwimming((EntityLiving)this));
((EntityLiving)this).tasks.addTask(1, (EntityAIBase)new LOTREntityAIHiredRemainStill(this));
((EntityLiving)this).tasks.addTask(2, (EntityAIBase)new LOTREntityAIAttackOnCollide(this, 1.6D, false));
((EntityLiving)this).tasks.addTask(3, (EntityAIBase)new LOTREntityAIFollowHiringPlayer(this));
((EntityLiving)this).tasks.addTask(4, (EntityAIBase)new EntityAIWander(this, 1.0D));
((EntityLiving)this).tasks.addTask(5, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, EntityPlayer.class, 8.0F, 0.02F));
((EntityLiving)this).tasks.addTask(6, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, LOTREntityNPC.class, 5.0F, 0.02F));
((EntityLiving)this).tasks.addTask(7, (EntityAIBase)new EntityAIWatchClosest((EntityLiving)this, EntityLiving.class, 8.0F, 0.02F));
((EntityLiving)this).tasks.addTask(8, (EntityAIBase)new EntityAILookIdle((EntityLiving)this));
addTargetTasks(true);
}
public boolean canWorldGenSpawnAt(int i, int j, int k, LOTRBiome biome, LOTRBiomeVariant variant) {
int trees = biome.decorator.getVariantTreesPerChunk(variant);
return (trees >= 1);
}
public LOTRFaction getFaction() {
return LOTRFaction.FANGORN;
}
public float getAlignmentBonus() {
return 0.0F;
}
public boolean getCanSpawnHere() {
WorldChunkManager worldChunkMgr = ((Entity)this).worldObj.getWorldChunkManager();
if (worldChunkMgr instanceof LOTRWorldChunkManager) {
int i = MathHelper.floor_double(((Entity)this).posX);
int j = MathHelper.floor_double(((Entity)this).boundingBox.minY);
int k = MathHelper.floor_double(((Entity)this).posZ);
LOTRBiome biome = (LOTRBiome)((Entity)this).worldObj.getBiomeGenForCoords(i, k);
LOTRBiomeVariant variant = ((LOTRWorldChunkManager)worldChunkMgr).getBiomeVariantAt(i, k);
return (super.getCanSpawnHere() && canWorldGenSpawnAt(i, j, k, biome, variant));
}
return super.getCanSpawnHere();
}
}

@ -1,79 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.LOTRMod;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraft.util.MovingObjectPosition;
import java.util.List;
import com.zivilon.cinder_loe.CinderLoE;
import com.zivilon.cinder_loe.entity.FangornAnimal;
public class FangornAuroch extends FangornAnimal {
public FangornAuroch(World world) {
super(world);
setSize(1.5F, 1.7F);
}
public void entityInit() {
super.entityInit();
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(30.0D);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D);
getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D);
}
public boolean attackEntityAsMob(Entity entity) {
float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f);
}
protected void dropFewItems(boolean flag, int i) {
int hides = 2 + rand.nextInt(3) + rand.nextInt(1 + i);
for (int l = 0; l < hides; l++)
dropItem(Items.leather, 1);
int meats = 2 + rand.nextInt(3) + rand.nextInt(1 + i);
for (int j = 0; j < meats; j++) {
if (isBurning()) {
dropItem(Items.cooked_beef, 1);
} else {
dropItem(Items.beef, 1);
}
}
dropItem(LOTRMod.horn, 1);
}
protected String getLivingSound() {
return "lotr:aurochs.say";
}
protected String getHurtSound() {
return "lotr:aurochs.hurt";
}
protected String getDeathSound() {
return "lotr:aurochs.hurt";
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {
// No ranged attack implemented
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.fangornAurochSpawnEgg, 1);
}
}

@ -1,148 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.LOTRMod;
import lotr.common.entity.animal.LOTREntityBear;
import lotr.common.entity.animal.LOTREntityBear.BearType;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import java.util.List;
import com.zivilon.cinder_loe.CinderLoE;
import com.zivilon.cinder_loe.entity.FangornAnimal;
public class FangornBear extends FangornAnimal {
public FangornBear(World world) {
super(world);
setSize(1.6F, 1.8F);
}
private int hostileTick = 0;
public void entityInit() {
super.entityInit();
dataWatcher.addObject(18, Byte.valueOf((byte)0));
dataWatcher.addObject(20, Byte.valueOf((byte)0));
setBearType(LOTREntityBear.BearType.forID(rand.nextInt((BearType.values()).length)));
}
public BearType getBearType() {
int i = dataWatcher.getWatchableObjectByte(18);
return BearType.forID(i);
}
public void setBearType(BearType t) {
dataWatcher.updateObject(18, Byte.valueOf((byte)t.bearID));
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D);
getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D);
}
public static class BearGroupSpawnData implements IEntityLivingData {
private BearGroupSpawnData() {}
public int numSpawned = 0;
}
public boolean attackEntityAsMob(Entity entity) {
float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f);
}
public boolean attackEntityFrom(DamageSource damagesource, float f) {
boolean flag = super.attackEntityFrom(damagesource, f);
if (flag) {
Entity attacker = damagesource.getEntity();
if (attacker instanceof EntityLivingBase)
if (isChild()) {
double range = 12.0D;
List list = ((Entity)this).worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, ((Entity)this).boundingBox.expand(range, range, range));
for (Object obj : list) {
Entity entity = (Entity)obj;
if (entity instanceof FangornBear) {
FangornBear bear = (FangornBear)entity;
if (!bear.isChild())
bear.becomeAngryAt((EntityLivingBase)attacker);
}
}
} else {
becomeAngryAt((EntityLivingBase)attacker);
}
}
return flag;
}
private void becomeAngryAt(EntityLivingBase entity) {
setAttackTarget(entity);
this.hostileTick = 200;
}
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setByte("BearType", (byte)(getBearType()).bearID);
nbt.setInteger("Angry", this.hostileTick);
}
public void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
if (nbt.hasKey("BearType"))
setBearType(BearType.forID(nbt.getByte("BearType")));
this.hostileTick = nbt.getInteger("Angry");
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
if (data == null) {
data = new BearGroupSpawnData();
((BearGroupSpawnData)data).numSpawned = 1;
} else if (data instanceof BearGroupSpawnData) {
BearGroupSpawnData bgsd = (BearGroupSpawnData)data;
bgsd.numSpawned++;
}
if (rand.nextInt(10000) == 0) setCustomNameTag("Wojtek");
return data;
}
protected void dropFewItems(boolean flag, int i) {
int furs = 1 + rand.nextInt(3) + rand.nextInt(i + 1);
for (int l = 0; l < furs; l++)
dropItem(LOTRMod.fur, 1);
if (flag) {
int rugChance = 30 - i * 5;
rugChance = Math.max(rugChance, 1);
if (rand.nextInt(rugChance) == 0)
entityDropItem(new ItemStack(LOTRMod.bearRug, 1, (getBearType()).bearID), 0.0F);
}
}
protected String getLivingSound() {
return "lotr:bear.say";
}
protected String getHurtSound() {
return "lotr:bear.hurt";
}
protected String getDeathSound() {
return "lotr:bear.death";
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {
// No ranged attack implemented
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.fangornBearSpawnEgg, 1);
}
}

@ -1,83 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.LOTRMod;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import java.util.List;
import java.util.UUID;
import com.zivilon.cinder_loe.CinderLoE;
import com.zivilon.cinder_loe.entity.FangornAnimal;
public class FangornElk extends FangornAnimal {
public FangornElk(World world) {
super(world);
setSize(1.6F, 1.8F);
}
public void entityInit() {
super.entityInit();
}
public void setUniqueID(UUID uuid) {
entityUniqueID = uuid;
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(35.0D);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D);
getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D);
}
public boolean attackEntityAsMob(Entity entity) {
float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f);
}
protected void dropFewItems(boolean flag, int i) {
int hide = rand.nextInt(3) + rand.nextInt(1 + i);
for (int l = 0; l < hide; l++)
dropItem(Items.leather, 1);
int meat = rand.nextInt(3) + rand.nextInt(1 + i);
for (int j = 0; j < meat; j++) {
if (isBurning()) {
dropItem(LOTRMod.deerCooked, 1);
} else {
dropItem(LOTRMod.deerRaw, 1);
}
}
}
protected String getLivingSound() {
return "lotr:elk.say";
}
protected String getHurtSound() {
return "lotr:elk.hurt";
}
protected String getDeathSound() {
return "lotr:elk.death";
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {
// No ranged attack implemented
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.fangornElkSpawnEgg, 1);
}
}

@ -1,74 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.LOTRMod;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import java.util.List;
import com.zivilon.cinder_loe.CinderLoE;
import com.zivilon.cinder_loe.entity.FangornAnimal;
public class FangornWildBoar extends FangornAnimal {
public FangornWildBoar(World world) {
super(world);
setSize(0.9F, 0.8F);
}
public void entityInit() {
super.entityInit();
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D);
getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D);
}
public boolean attackEntityAsMob(Entity entity) {
float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f);
}
protected void dropFewItems(boolean flag, int i) {
int meat = rand.nextInt(3) + 1 + rand.nextInt(1 + i);
for (int l = 0; l < meat; l++) {
if (isBurning()) {
dropItem(Items.cooked_porkchop, 1);
} else {
dropItem(Items.porkchop, 1);
}
}
}
protected String getLivingSound() {
return "mob.pig.say";
}
protected String getHurtSound() {
return "mob.pig.say";
}
protected String getDeathSound() {
return "mob.pig.death";
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {
// No ranged attack implemented
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.fangornWildBoarSpawnEgg, 1);
}
}

@ -1,70 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.LOTRMod;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import java.util.List;
import com.zivilon.cinder_loe.CinderLoE;
import com.zivilon.cinder_loe.entity.FangornAnimal;
public class FangornWolf extends FangornAnimal {
public FangornWolf(World world) {
super(world);
setSize(0.6F, 0.8F);
}
public void entityInit() {
super.entityInit();
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D);
}
public boolean attackEntityAsMob(Entity entity) {
float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f);
}
protected void dropFewItems(boolean flag, int i) {
int meat = rand.nextInt(3) + 1 + rand.nextInt(1 + i);
for (int l = 0; l < meat; l++) {
if (isBurning()) {
dropItem(Items.cooked_porkchop, 1);
} else {
dropItem(Items.porkchop, 1);
}
}
}
protected String getLivingSound() {
return "mob.wolf.growl";
}
protected String getHurtSound() {
return "mob.wolf.hurt";
}
protected String getDeathSound() {
return "mob.wolf.death";
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {
// No ranged attack implemented
}
}

@ -1,70 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.entity.npc.LOTREntityMoredain;
import lotr.common.entity.npc.LOTRNPCMount;
import lotr.common.LOTRAchievement;
import lotr.common.LOTRFoods;
import lotr.common.LOTRMod;
import lotr.common.entity.ai.LOTREntityAIAttackOnCollide;
import lotr.common.entity.ai.LOTREntityAIDrink;
import lotr.common.entity.ai.LOTREntityAIEat;
import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer;
import lotr.common.entity.ai.LOTREntityAIHiredRemainStill;
import lotr.common.entity.animal.LOTREntityZebra;
import lotr.common.fac.LOTRFaction;
import lotr.common.quest.LOTRMiniQuest;
import lotr.common.quest.LOTRMiniQuestFactory;
import lotr.common.world.structure.LOTRChestContents;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIOpenDoor;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.EntityAIWatchClosest2;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import com.zivilon.cinder_loe.CinderLoE;
public class Limwaith extends LOTREntityMoredain {
public Limwaith(World world) {
super(world);
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.daggerLimwaith));
this.npcItemsInv.setIdleItem(null);
return data;
}
protected LOTRAchievement getKillAchievement() {
return null;
}
public LOTRNPCMount createMountToRide() {
return null;
// return (LOTRNPCMount)new LimwaithCrocodile(((Entity)this).worldObj);
}
public String getSpeechBank(EntityPlayer entityplayer) {
if (isFriendlyAndAligned(entityplayer)) {
if (this.hiredNPCInfo.getHiringPlayer() == entityplayer)
return "limwaith/moredain/hired";
return "limwaith/moredain/friendly";
}
return "limwaith/moredain/hostile";
}
}

@ -1,24 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.entity.npc.LOTRBannerBearer;
import lotr.common.item.LOTRItemBanner;
import net.minecraft.world.World;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.item.ItemStack;
import com.zivilon.cinder_loe.entity.LimwaithWarrior;
import com.zivilon.cinder_loe.CinderLoE;
public class LimwaithBannerBearer extends LimwaithWarrior implements LOTRBannerBearer {
public LimwaithBannerBearer(World world) {
super(world);
}
public LOTRItemBanner.BannerType getBannerType() {
return LOTRItemBanner.BannerType.MOREDAIN;
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.limwaithBannerBearerSpawnEgg, 1);
}
}

@ -1,74 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.LOTRMod;
import lotr.common.entity.ai.LOTREntityAIRangedAttack;
import lotr.common.entity.projectile.LOTREntityDart;
import lotr.common.item.LOTRItemBlowgun;
import lotr.common.item.LOTRItemDart;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import com.zivilon.cinder_loe.CinderLoE;
import com.zivilon.cinder_loe.entity.Limwaith;
public class LimwaithBlowgunner extends Limwaith {
public LimwaithBlowgunner(World world) {
super(world);
}
public EntityAIBase createHaradrimAttackAI() {
return (EntityAIBase)new LOTREntityAIRangedAttack(this, 1.5D, 10, 30, 16.0F);
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(24.0D);
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.blowgunLimwaith));
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsLimwaith));
setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsLimwaith));
setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyLimwaith));
return data;
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float f) {
ItemStack heldItem = getHeldItem();
float str = 1.0F + getDistanceToEntity((Entity)target) / 16.0F * 0.015F;
str *= LOTRItemBlowgun.getBlowgunLaunchSpeedFactor(heldItem);
LOTREntityDart dart = ((LOTRItemDart)LOTRMod.tauredainDart).createDart(((Entity)this).worldObj, (EntityLivingBase)this, target, new ItemStack(LOTRMod.tauredainDart), str, 1.0F);
if (heldItem != null)
LOTRItemBlowgun.applyBlowgunModifiers(dart, heldItem);
playSound("lotr:item.dart", 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 1.2F) + 0.5F);
((Entity)this).worldObj.spawnEntityInWorld((Entity)dart);
}
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
dropNPCAmmo(LOTRMod.tauredainDart, i);
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.limwaithBlowgunnerSpawnEgg, 1);
}
}

@ -1,46 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRShields;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class LimwaithBoneWarrior extends Limwaith {
public LimwaithBoneWarrior(World world) {
super(world);
this.npcShield = LOTRShields.ALIGNMENT_MOREDAIN;
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
int i = rand.nextInt(6);
if (i == 0) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.truncheonLimwaith));
} else if (i == 1 || i == 2) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.tridentLimwaith));
} else if (i == 3 || i == 4) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearLimwaith));
} else {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.battleaxeLimwaith));
}
if (rand.nextInt(6) == 0) {
this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon());
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearLimwaith));
}
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsboneLimwaith));
setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsboneLimwaith));
setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyboneLimwaith));
if (rand.nextInt(10) != 0)
setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetboneLimwaith));
return data;
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.limwaithBoneWarriorSpawnEgg, 1);
}
}

@ -1,62 +0,0 @@
package com.zivilon.cinder_loe.entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.world.World;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import lotr.common.LOTRLevelData;
import lotr.common.entity.npc.LOTRUnitTradeable;
import lotr.common.entity.npc.LOTRUnitTradeEntries;
import lotr.common.world.spawning.LOTRInvasions;
import com.zivilon.cinder_loe.entity.LimwaithWarrior;
import com.zivilon.cinder_loe.CinderLoE;
public class LimwaithChieftain extends LimwaithBoneWarrior implements LOTRUnitTradeable {
public LimwaithChieftain(World world) {
super(world);
addTargetTasks(false);
}
public float getAlignmentBonus() {
return 5.0F;
}
public LOTRUnitTradeEntries getUnits() {
return CinderLoE.LIMWAITH_COMMANDER;
}
public LOTRInvasions getWarhorn() {
return LOTRInvasions.MOREDAIN;
}
public void onUnitTrade(EntityPlayer entityplayer) {
}
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.truncheonLimwaith));
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsboneLimwaith));
setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsboneLimwaith));
setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyboneLimwaith));
setCurrentItemOrArmor(4, null);
return data;
}
public boolean canTradeWith(EntityPlayer entityplayer) {
return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 150.0F && isFriendlyAndAligned(entityplayer));
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.limwaithChieftainSpawnEgg, 1);
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
}
}

@ -1,69 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.entity.npc.LOTREntityDwarf;
import lotr.common.entity.npc.LOTRTradeEntries;
import lotr.common.entity.npc.LOTRTradeEntries.TradeType;
import lotr.common.entity.npc.LOTRTradeEntry;
import lotr.common.entity.npc.LOTRTradeable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import static lotr.common.entity.npc.LOTRTradeEntries.HARAD_FISHMONGER_BUY;
import static lotr.common.entity.npc.LOTRTradeEntries.HARAD_FISHMONGER_SELL;
public class LimwaithFishmonger extends Limwaith implements LOTRTradeable {
public LimwaithFishmonger(World world) {
super(world);
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.tridentLimwaith));
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
return data;
}
public LOTRTradeEntries getBuyPool() {
return HARAD_FISHMONGER_BUY;
}
public LOTRTradeEntries getSellPool() {
return HARAD_FISHMONGER_SELL;
}
public float getAlignmentBonus() {
return 2.0F;
}
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
dropItem(getLimwaithTraderDrop(), 1 + rand.nextInt(3) + rand.nextInt(i + 1));
}
protected Item getLimwaithTraderDrop() {
return LOTRMod.pearl;
}
public boolean canTradeWith(EntityPlayer entityplayer) {
return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 100.0F && isFriendlyAndAligned(entityplayer));
}
@Override
public void onPlayerTrade(EntityPlayer entityplayer, TradeType type, ItemStack itemstack) {
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
}
}

@ -1,113 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRFoods;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.entity.npc.LOTREntityDwarf;
import lotr.common.entity.npc.LOTRTradeEntries;
import lotr.common.entity.npc.LOTRTradeEntries.TradeType;
import lotr.common.entity.npc.LOTRTradeEntry;
import lotr.common.entity.npc.LOTRTradeable;
import lotr.common.item.LOTRItemMug;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class LimwaithShaman extends Limwaith implements LOTRTradeable.Smith {
public static LOTRTradeEntries LIMWAITH_SHAMAN_BUY;
public static LOTRTradeEntries LIMWAITH_SHAMAN_SELL;
public LimwaithShaman(World world) {
super(world);
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.daggerLimwaithPoisoned));
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
return data;
}
public LOTRTradeEntries getBuyPool() {
return LIMWAITH_SHAMAN_BUY;
}
public LOTRTradeEntries getSellPool() {
return LIMWAITH_SHAMAN_SELL;
}
public float getAlignmentBonus() {
return 2.0F;
}
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
dropItem(getLimwaithTraderDrop(), 1 + rand.nextInt(2) + rand.nextInt(i + 1));
}
public boolean canTradeWith(EntityPlayer entityplayer) {
return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 100.0F && isFriendlyAndAligned(entityplayer));
}
static {
LIMWAITH_SHAMAN_BUY = new LOTRTradeEntries(TradeType.BUY,
new LOTRTradeEntry(new ItemStack(CinderLoE.daggerLimwaith), 12),
new LOTRTradeEntry(new ItemStack(CinderLoE.daggerLimwaithPoisoned), 20),
new LOTRTradeEntry(new ItemStack(CinderLoE.blowgunLimwaith), 25),
new LOTRTradeEntry(new ItemStack(LOTRMod.tauredainDart, 4), 5),
new LOTRTradeEntry(new ItemStack(LOTRMod.tauredainDartPoisoned, 4), 10),
new LOTRTradeEntry(new ItemStack(CinderLoE.bonemold, 2), 4),
new LOTRTradeEntry(new ItemStack(Items.bone, 1), 1),
new LOTRTradeEntry(new ItemStack(LOTRMod.bottlePoison), 10));
LIMWAITH_SHAMAN_SELL = new LOTRTradeEntries(TradeType.SELL,
new LOTRTradeEntry(new ItemStack(Items.gold_nugget), 2),
new LOTRTradeEntry(new ItemStack(LOTRMod.emerald), 15),
new LOTRTradeEntry(new ItemStack(LOTRMod.amber), 10),
new LOTRTradeEntry(new ItemStack(Items.glass_bottle), 2),
new LOTRTradeEntry(new ItemStack(LOTRMod.mug), 1),
new LOTRTradeEntry(new ItemStack(Items.bone), 1),
new LOTRTradeEntry(new ItemStack(LOTRMod.rhinoHorn), 5),
new LOTRTradeEntry(new ItemStack(Items.dye, 3, 15), 1),
new LOTRTradeEntry(new ItemStack(LOTRMod.gemsbokHorn), 4),
new LOTRTradeEntry(new ItemStack(LOTRMod.doubleFlower, 2, 2), 1),
new LOTRTradeEntry(new ItemStack(LOTRMod.doubleFlower, 2, 3), 1),
new LOTRTradeEntry(new ItemStack(Blocks.red_mushroom, 1, 0), 2),
new LOTRTradeEntry(new ItemStack(Blocks.brown_mushroom, 1, 0), 2),
new LOTRTradeEntry(new ItemStack(CinderLoE.bonemold, 2), 3),
new LOTRTradeEntry(new ItemStack(LOTRMod.mango), 1),
new LOTRTradeEntry(new ItemStack(LOTRMod.banana), 1),
new LOTRTradeEntry(new ItemStack(LOTRMod.corn, 2), 1));
}
@Override
public void onPlayerTrade(EntityPlayer entityplayer, TradeType type, ItemStack itemstack) {
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
}
protected Item getLimwaithTraderDrop() {
return LOTRMod.pearl;
}
@Override
public String getSpeechBank(EntityPlayer entityplayer) {
if (this.isFriendlyAndAligned(entityplayer)) {
if (this.canTradeWith(entityplayer)) {
return "limwaith/shaman/friendly";
}
return "limwaith/shaman/neutral";
}
return "limwaith/shaman/hostile";
}
}

@ -1,86 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.entity.npc.LOTREntityMoredain;
import lotr.common.entity.npc.LOTRNPCMount;
import lotr.common.LOTRAchievement;
import lotr.common.LOTRFoods;
import lotr.common.LOTRMod;
import lotr.common.LOTRShields;
import lotr.common.entity.ai.LOTREntityAIAttackOnCollide;
import lotr.common.entity.ai.LOTREntityAIDrink;
import lotr.common.entity.ai.LOTREntityAIEat;
import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer;
import lotr.common.entity.ai.LOTREntityAIHiredRemainStill;
import lotr.common.entity.animal.LOTREntityZebra;
import lotr.common.fac.LOTRFaction;
import lotr.common.quest.LOTRMiniQuest;
import lotr.common.quest.LOTRMiniQuestFactory;
import lotr.common.world.structure.LOTRChestContents;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIOpenDoor;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.EntityAIWatchClosest2;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import com.zivilon.cinder_loe.CinderLoE;
import com.zivilon.cinder_loe.entity.Limwaith;
public class LimwaithWarrior extends Limwaith {
public LimwaithWarrior(World world) {
super(world);
this.npcShield = LOTRShields.ALIGNMENT_MOREDAIN;
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
int i = rand.nextInt(7);
if (i == 0) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.truncheonLimwaith));
} else if (i == 1 || i == 2) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.tridentLimwaith));
} else if (i == 3 || i == 4) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearLimwaith));
} else if (i == 5) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.battleaxeLimwaith));
} else if (i == 6) {
if (rand.nextInt(2) == 0) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.daggerLimwaith));
} else {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.daggerLimwaithPoisoned));
}
}
if (rand.nextInt(6) == 0) {
this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon());
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearLimwaith));
}
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsLimwaith));
setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsLimwaith));
setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyLimwaith));
if (rand.nextInt(10) != 0)
setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetLimwaith));
return data;
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.limwaithWarriorSpawnEgg, 1);
}
}

@ -1,46 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.entity.npc.LOTREntityDwarfAxeThrower;
import lotr.common.LOTRMod;
import lotr.common.entity.ai.LOTREntityAIRangedAttack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.init.Items;
import net.minecraft.util.MovingObjectPosition;
import com.zivilon.cinder_loe.CinderLoE;
public class RedDwarfArbalest extends LOTREntityDwarfAxeThrower {
public RedDwarfArbalest(World world) {
super(world);
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
int i = rand.nextInt(5);
this.npcItemsInv.setRangedWeapon(new ItemStack(CinderLoE.crossbowRedDwarf));
this.npcItemsInv.setIdleItem(this.npcItemsInv.getRangedWeapon());
setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsRedDwarf));
setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsRedDwarf));
setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyRedDwarf));
setCurrentItemOrArmor(4, null);
if (rand.nextInt(10) != 0)
setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetRedDwarf));
return data;
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float f) {
npcCrossbowAttack(target, f);
}
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
dropNPCCrossbowBolts(i);
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.redDwarfArbalestSpawnEgg, 1);
}
}

@ -1,25 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.LOTRMod;
import lotr.common.item.LOTRItemBanner;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import lotr.common.entity.npc.LOTRBannerBearer;
import net.minecraft.util.MovingObjectPosition;
import com.zivilon.cinder_loe.CinderLoE;
public class RedDwarfBannerBearer extends RedDwarfWarrior implements LOTRBannerBearer {
public RedDwarfBannerBearer(World world) {
super(world);
}
public LOTRItemBanner.BannerType getBannerType() {
return LOTRItemBanner.BannerType.DWARF;
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.redDwarfBannerBearerSpawnEgg, 1);
}
}

@ -1,51 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.LOTRMod;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import lotr.common.entity.npc.LOTREntityDwarfCommander;
import lotr.common.entity.npc.LOTRUnitTradeable;
import lotr.common.entity.npc.LOTRUnitTradeEntries;
import net.minecraft.util.MovingObjectPosition;
import com.zivilon.cinder_loe.CinderLoE;
public class RedDwarfCommander extends LOTREntityDwarfCommander implements LOTRUnitTradeable {
public RedDwarfCommander(World world) {
super(world);
addTargetTasks(false);
}
public LOTRUnitTradeEntries getUnits() {
return CinderLoE.RED_DWARF_COMMANDER;
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
int i = rand.nextInt(5);
if (i == 0) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.swordRedDwarf));
} else if (i == 1 || i == 2) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.battleaxeRedDwarf));
} else if (i == 3 || i == 4) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearRedDwarf));
}
if (rand.nextInt(6) == 0) {
this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon());
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearRedDwarf));
}
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsRedDwarf));
setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsRedDwarf));
setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyRedDwarf));
setCurrentItemOrArmor(4, null);
if (rand.nextInt(10) != 0)
setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetRedDwarf));
return data;
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.redDwarfCommanderSpawnEgg, 1);
}
}

@ -1,127 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.entity.npc.LOTRTradeEntries;
import lotr.common.entity.npc.LOTRTradeEntries.TradeType;
import lotr.common.entity.npc.LOTRTradeable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
import lotr.common.LOTRMod;
import lotr.common.fac.LOTRFaction;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import lotr.common.entity.npc.LOTRTradeEntry;
import net.minecraft.init.Items;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import lotr.common.LOTRLevelData;
import lotr.common.entity.npc.LOTREntityDwarf;
import com.zivilon.cinder_loe.CinderLoE;
public class RedDwarfSmith extends LOTREntityDwarf implements LOTRTradeable.Smith {
public static LOTRTradeEntries RED_DWARF_SMITH_BUY;
public static LOTRTradeEntries RED_DWARF_SMITH_SELL;
public RedDwarfSmith(World world) {
super(world);
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.blacksmithHammer));
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
return data;
}
public LOTRTradeEntries getBuyPool() {
return RED_DWARF_SMITH_BUY;
}
public LOTRTradeEntries getSellPool() {
return RED_DWARF_SMITH_SELL;
}
public float getAlignmentBonus() {
return 2.0F;
}
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
dropItem(getDwarfSteelDrop(), 1 + rand.nextInt(3) + rand.nextInt(i + 1));
}
public boolean canTradeWith(EntityPlayer entityplayer) {
return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 100.0F && isFriendlyAndAligned(entityplayer));
}
static {
RED_DWARF_SMITH_BUY = new LOTRTradeEntries(TradeType.BUY,
new LOTRTradeEntry[] {
new LOTRTradeEntry(new ItemStack(LOTRMod.dwarvenTable), 100),
new LOTRTradeEntry(new ItemStack(LOTRMod.blacksmithHammer), 18),
new LOTRTradeEntry(new ItemStack(LOTRMod.dwarvenRing), 20),
new LOTRTradeEntry(new ItemStack(CinderLoE.swordRedDwarf), 16),
new LOTRTradeEntry(new ItemStack(CinderLoE.spearRedDwarf), 18),
new LOTRTradeEntry(new ItemStack(CinderLoE.battleaxeRedDwarf), 18),
new LOTRTradeEntry(new ItemStack(CinderLoE.hammerRedDwarf), 18),
new LOTRTradeEntry(new ItemStack(CinderLoE.pikeRedDwarf), 18),
new LOTRTradeEntry(new ItemStack(CinderLoE.daggerRedDwarf), 13),
new LOTRTradeEntry(new ItemStack(CinderLoE.crossbowRedDwarf), 15),
new LOTRTradeEntry(new ItemStack(CinderLoE.helmetRedDwarf), 25),
new LOTRTradeEntry(new ItemStack(CinderLoE.bodyRedDwarf), 36),
new LOTRTradeEntry(new ItemStack(CinderLoE.legsRedDwarf), 30),
new LOTRTradeEntry(new ItemStack(CinderLoE.bootsRedDwarf), 22),
new LOTRTradeEntry(new ItemStack(CinderLoE.boarArmorRedDwarf), 25),
new LOTRTradeEntry(new ItemStack(CinderLoE.barsRedDwarf, 8), 20)
}
);
RED_DWARF_SMITH_SELL = new LOTRTradeEntries(TradeType.SELL,
new LOTRTradeEntry[] {
new LOTRTradeEntry(new ItemStack(Items.iron_ingot), 3),
new LOTRTradeEntry(new ItemStack(CinderLoE.redDwarfSteel), 3),
new LOTRTradeEntry(new ItemStack(Items.coal, 2, 32767), 1),
new LOTRTradeEntry(new ItemStack(Items.gold_ingot), 15),
new LOTRTradeEntry(new ItemStack(LOTRMod.copper), 3),
new LOTRTradeEntry(new ItemStack(LOTRMod.tin), 3),
new LOTRTradeEntry(new ItemStack(LOTRMod.bronze), 3),
new LOTRTradeEntry(new ItemStack(Items.string, 3), 1),
new LOTRTradeEntry(new ItemStack(LOTRMod.diamond), 25),
new LOTRTradeEntry(new ItemStack(LOTRMod.emerald), 15),
new LOTRTradeEntry(new ItemStack(LOTRMod.sapphire), 12),
new LOTRTradeEntry(new ItemStack(LOTRMod.ruby), 12),
new LOTRTradeEntry(new ItemStack(LOTRMod.opal), 10),
new LOTRTradeEntry(new ItemStack(LOTRMod.amber), 10),
new LOTRTradeEntry(new ItemStack(LOTRMod.amethyst), 8),
new LOTRTradeEntry(new ItemStack(LOTRMod.topaz), 8),
new LOTRTradeEntry(new ItemStack(LOTRMod.pearl), 25),
new LOTRTradeEntry(new ItemStack(Items.cooked_beef), 3),
new LOTRTradeEntry(new ItemStack(Items.cooked_porkchop), 3),
new LOTRTradeEntry(new ItemStack(LOTRMod.muttonCooked), 3),
new LOTRTradeEntry(new ItemStack(Items.cooked_chicken), 3),
new LOTRTradeEntry(new ItemStack(LOTRMod.gammon), 3),
new LOTRTradeEntry(new ItemStack(Items.cooked_fished), 3),
new LOTRTradeEntry(new ItemStack(LOTRMod.rabbitCooked), 3),
new LOTRTradeEntry(new ItemStack(LOTRMod.deerCooked), 3),
new LOTRTradeEntry(new ItemStack(Items.bread), 2),
new LOTRTradeEntry(new ItemStack(Items.lava_bucket), 16)
}
);
}
@Override
public void onPlayerTrade(EntityPlayer entityplayer, LOTRTradeEntries.TradeType type, ItemStack itemstack) {
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
}
@Override
protected Item getDwarfSteelDrop() {
return CinderLoE.redDwarfSteel;
}
}

@ -1,55 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.entity.npc.LOTREntityDwarfWarrior;
import lotr.common.LOTRMod;
import lotr.common.LOTRShields;
import net.minecraft.entity.Entity;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraft.item.Item;
import com.zivilon.cinder_loe.CinderLoE;
public class RedDwarfWarrior extends LOTREntityDwarfWarrior {
public RedDwarfWarrior(World world) {
super(world);
this.npcShield = LOTRShields.ALIGNMENT_DWARF;
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
int i = rand.nextInt(6);
if (i == 0) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.swordRedDwarf));
} else if (i == 1 || i == 2) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.battleaxeRedDwarf));
} else if (i == 3 || i == 4) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.pikeRedDwarf));
} else if (i == 5) {
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.hammerRedDwarf));
}
if (rand.nextInt(6) == 0) {
this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon());
this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearRedDwarf));
}
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsRedDwarf));
setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsRedDwarf));
setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyRedDwarf));
setCurrentItemOrArmor(4, null);
if (rand.nextInt(10) != 0)
setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetRedDwarf));
return data;
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.redDwarfWarriorSpawnEgg, 1);
}
@Override
protected Item getDwarfSteelDrop() {
return CinderLoE.redDwarfSteel;
}
}

@ -1,193 +0,0 @@
package com.zivilon.cinder_loe.entity;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIOpenDoor;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.EntityAIWatchClosest2;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import lotr.common.LOTRFoods;
import lotr.common.LOTRMod;
import lotr.common.entity.ai.LOTREntityAIAttackOnCollide;
import lotr.common.entity.ai.LOTREntityAIDrink;
import lotr.common.entity.ai.LOTREntityAIEat;
import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer;
import lotr.common.entity.ai.LOTREntityAIHiredRemainStill;
import lotr.common.entity.animal.LOTREntityHorse;
import lotr.common.entity.npc.LOTREntityMan;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.entity.npc.LOTRNPCMount;
import lotr.common.entity.npc.LOTRNames;
import lotr.common.fac.LOTRFaction;
import com.zivilon.cinder_loe.CinderLoE;
public class Renegade extends LOTREntityMan {
public Renegade(World world) {
super(world);
setSize(0.6F, 1.8F);
getNavigator().setAvoidsWater(true);
getNavigator().setBreakDoors(true);
((EntityLiving) this).tasks.addTask(0, (EntityAIBase) new EntityAISwimming((EntityLiving) this));
((EntityLiving) this).tasks.addTask(1, (EntityAIBase) new LOTREntityAIHiredRemainStill(this));
((EntityLiving) this).tasks.addTask(2, (EntityAIBase) new LOTREntityAIAttackOnCollide(this, 1.3D, false));
((EntityLiving) this).tasks.addTask(3, (EntityAIBase) new LOTREntityAIFollowHiringPlayer(this));
((EntityLiving) this).tasks.addTask(4, (EntityAIBase) new EntityAIOpenDoor((EntityLiving) this, true));
((EntityLiving) this).tasks.addTask(6, (EntityAIBase) new LOTREntityAIEat(this, LOTRFoods.DUNLENDING, 8000));
((EntityLiving) this).tasks.addTask(6, (EntityAIBase) new LOTREntityAIDrink(this, LOTRFoods.DUNLENDING_DRINK, 8000));
((EntityLiving) this).tasks.addTask(7, (EntityAIBase) new EntityAIWatchClosest2((EntityLiving) this, EntityPlayer.class, 8.0F, 0.02F));
((EntityLiving) this).tasks.addTask(7, (EntityAIBase) new EntityAIWatchClosest2((EntityLiving) this, LOTREntityNPC.class, 5.0F, 0.02F));
((EntityLiving) this).tasks.addTask(8, (EntityAIBase) new EntityAIWatchClosest((EntityLiving) this, EntityLiving.class, 8.0F, 0.02F));
((EntityLiving) this).tasks.addTask(9, (EntityAIBase) new EntityAILookIdle((EntityLiving) this));
addTargetTasks(true);
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {
// Do nothing
}
public LOTRNPCMount createMountToRide() {
LOTREntityHorse horse = (LOTREntityHorse) super.createMountToRide();
horse.setMountArmor(new ItemStack(LOTRMod.horseArmorIron));
return (LOTRNPCMount) horse;
}
public void setupNPCGender() {
this.familyInfo.setMale(this.rand.nextBoolean());
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D);
}
public LOTRFaction getFaction() {
return LOTRFaction.UTUMNO;
}
public String getNPCName() {
return this.familyInfo.getName();
}
public String getNPCFormattedName(String npcName, String entityName) {
if (getClass() == Renegade.class) return StatCollector
.translateToLocalFormatted("entity.cinder_loe.Renegade.entityName", new Object[] { npcName });
return super.getNPCFormattedName(npcName, entityName);
}
protected void onAttackModeChange(LOTREntityNPC.AttackMode mode, boolean mounted) {
if (mode == LOTREntityNPC.AttackMode.IDLE) {
setCurrentItemOrArmor(0, this.npcItemsInv.getIdleItem());
} else {
setCurrentItemOrArmor(0, this.npcItemsInv.getMeleeWeapon());
((EntityLiving) this).tasks.addTask(5, (EntityAIBase) new EntityAIWander(this, 1.0D));
}
}
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
int bones = this.rand.nextInt(2) + this.rand.nextInt(i + 1);
for (int l = 0; l < bones; l++) dropItem(Items.bone, 1);
}
public boolean getCanSpawnHere() {
return false;
}
public String getSpeechBank(EntityPlayer entityplayer) {
if (isDrunkard()) return "renegade/drunkard/neutral";
return "renegade/man/hostile";
}
List<Runnable> codeOptions = Arrays.asList(() -> {
this.familyInfo.setName(LOTRNames.getGondorName(this.rand, this.familyInfo.isMale()));
}, () -> {
this.familyInfo.setName(LOTRNames.getBreeName(this.rand, this.familyInfo.isMale()));
}, () -> {
this.familyInfo.setName(LOTRNames.getRhudaurName(this.rand, this.familyInfo.isMale()));
}, () -> {
this.familyInfo.setName(LOTRNames.getRohirricName(this.rand, this.familyInfo.isMale()));
},
/*
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getDunlendingName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getDorwinionName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getDalishName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getRhunicName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getUmbarName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getHarnennorName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getSouthronCoastName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getNomadName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getGulfHaradName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getMoredainName(this.rand, this.familyInfo.isMale())),
* }
*/
() -> {
this.familyInfo.setName(LOTRNames.getTauredainName(this.rand, this.familyInfo.isMale()));
});
public void setupNPCName() {
if (this.familyInfo == null) System.out.println("[CinderCore] Family info is null");
if (this.rand == null) System.out.println("[CinderCore] rand is null");
Boolean gender = this.familyInfo.isMale();
if (gender == null) System.out.println("[CinderCore] Gender is null");
/*
* int randomIndex = this.rand.nextInt(codeOptions.size());
* codeOptions.get(randomIndex)
* .run();;
*/
this.familyInfo.setName(LOTRNames.getDorwinionName(this.rand, this.familyInfo.isMale()));
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.renegadeSpawnEgg, 1);
}
}

@ -1,37 +0,0 @@
package com.zivilon.cinder_loe.entity;
import com.zivilon.cinder_loe.CinderLoE;
import lotr.common.LOTRFoods;
import lotr.common.LOTRMod;
import lotr.common.entity.ai.*;
import lotr.common.entity.animal.LOTREntityHorse;
import lotr.common.entity.npc.LOTREntityMan;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.entity.npc.LOTRNPCMount;
import lotr.common.entity.npc.LOTRNames;
import lotr.common.fac.LOTRFaction;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.Arrays;
import java.util.List;
public class RenegadeCaptain extends Renegade {
public RenegadeCaptain(World world) {
super(world);
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.renegadeCaptainSpawnEgg, 1);
}
}

@ -1,102 +0,0 @@
package com.zivilon.cinder_loe.entity;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.entity.animal.LOTREntityHorse;
import lotr.common.entity.projectile.LOTREntityGandalfFireball;
import lotr.common.fac.LOTRFaction;
import lotr.common.network.LOTRPacketHandler;
import lotr.common.network.LOTRPacketWeaponFX;
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.attributes.IAttributeInstance;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class SarumanFireball extends LOTREntityGandalfFireball {
public SarumanFireball(World world) {
super(world);
}
public SarumanFireball(World world, EntityLivingBase entityliving) {
super(world, entityliving);
}
public SarumanFireball(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
}
protected void onImpact(MovingObjectPosition m) {
if (!((Entity)this).worldObj.isRemote)
if (m.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
explode((Entity)null);
} else if (m.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
explode(m.entityHit);
}
}
private void explode(Entity target) {
if (((Entity)this).worldObj.isRemote)
return;
((Entity)this).worldObj.playSoundAtEntity((Entity)this, "lotr:item.gandalfFireball", 4.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
List<EntityLiving> entities = ((Entity)this).worldObj.getEntitiesWithinAABB(EntityLiving.class, ((Entity)this).boundingBox.expand(6.0D, 6.0D, 6.0D));
if (!entities.isEmpty())
for (int i = 0; i < entities.size(); i++) {
Entity entity = entities.get(i);
if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer) && !(entity instanceof LOTREntityHorse && ((LOTREntityHorse)entity).getBelongsToNPC() == true)) {
targetRandomEntity((EntityLiving)entity);
}
}
setDead();
}
public void targetRandomEntity(EntityLiving npc) {
LOTRFaction faction = null;
if (npc instanceof LOTREntityNPC) {
LOTREntityNPC lotrNpc = (LOTREntityNPC) npc;
faction = lotrNpc.getFaction();
}
// Define the search area based on the npc's location
IAttributeInstance followRangeAttribute = npc.getEntityAttribute(SharedMonsterAttributes.followRange);
double range = followRangeAttribute != null ? followRangeAttribute.getAttributeValue() : 12.0D; // Default to 12 if attribute is not found
AxisAlignedBB searchArea = npc.boundingBox.expand(range, 4.0D, range);
// Filter potential targets to not include hiring player or NPCs from same faction
List<EntityLiving> allTargets = npc.worldObj.getEntitiesWithinAABB(EntityLiving.class, searchArea);
List<EntityLiving> validTargets = new ArrayList<>();
for (EntityLiving potentialTarget : allTargets) {
Entity entity = (Entity)potentialTarget; // Because for some reason I can't directly check if EntityLiving is instance of EntityPlayer
if (entity != npc &&
!(entity instanceof EntityPlayer) &&
!(entity instanceof LOTREntityNPC && faction != null && ((LOTREntityNPC)entity).getFaction() == faction) &&
!(entity instanceof LOTREntityHorse && ((LOTREntityHorse)entity).getBelongsToNPC() == true)) {
validTargets.add(potentialTarget);
}
}
// Randomly select a new target from the filtered list
if (!validTargets.isEmpty()) {
EntityLiving newTarget = validTargets.get(npc.getRNG().nextInt(validTargets.size()));
npc.setAttackTarget(newTarget); // Set the new attack target
}
}
}

@ -1,108 +0,0 @@
package com.zivilon.cinder_loe.entity;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import com.zivilon.cinder_loe.CinderLoE;
import cpw.mods.fml.common.ModContainer;
public class SpeechBankModifier {
public static List<String> loadSpeechLines(String speechBankName) {
String speechPath = "assets/cinder_loe/speech/" + speechBankName + ".txt";
List<String> lines = new ArrayList<>();
ZipFile zip = null;
try {
ModContainer modContainer = CinderLoE.getModContainer();
zip = new ZipFile(modContainer.getSource());
Enumeration<? extends ZipEntry> entries = zip.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
if (entry.getName()
.startsWith(speechPath)
&& entry.getName()
.endsWith(".txt")) {
InputStream inputStream = zip.getInputStream(entry);
BufferedReader reader = new BufferedReader(
new InputStreamReader(inputStream, StandardCharsets.UTF_8));
String line;
while ((line = reader.readLine()) != null) {
lines.add(line);
}
reader.close();
}
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (zip != null) {
try {
zip.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return lines;
}
public static Map<String, List<String>> loadSpeechBanks() {
Map<String, List<String>> speechBanks = new HashMap<>();
speechBanks.put("renegade/man/hostile", loadSpeechLines("renegade/man/hostile"));
speechBanks.put("renegade/drunkard/neutral", loadSpeechLines("renegade/drunkard/neutral"));
speechBanks.put("limwaith/moredain/friendly", loadSpeechLines("limwaith/moredain/friendly"));
speechBanks.put("limwaith/moredain/hired", loadSpeechLines("limwaith/moredain/hired"));
speechBanks.put("limwaith/moredain/hostile", loadSpeechLines("limwaith/moredain/hostile"));
speechBanks.put("limwaith/chieftain/friendly", loadSpeechLines("limwaith/chieftain/friendly"));
speechBanks.put("limwaith/chieftain/neutral", loadSpeechLines("limwaith/chieftain/neutral"));
speechBanks.put("arnorSoldier/captain/friendly", loadSpeechLines("arnorSoldier/captain/friendly"));
speechBanks.put("arnorSoldier/captain/neutral", loadSpeechLines("arnorSoldier/captain/neutral"));
speechBanks.put("arnorSoldier/soldier/friendly", loadSpeechLines("arnorSoldier/soldier/friendly"));
speechBanks.put("arnorSoldier/soldier/hired", loadSpeechLines("arnorSoldier/soldier/hired"));
speechBanks.put("arnorSoldier/soldier/hostile", loadSpeechLines("arnorSoldier/soldier/hostile"));
return speechBanks;
}
public static void insertSpeechBanks() {
Map<String, List<String>> speechBanks = loadSpeechBanks();
try {
Class<?> lotrSpeechClass = Class.forName("lotr.common.entity.npc.LOTRSpeech");
Class<?> speechBankClass = Class.forName("lotr.common.entity.npc.LOTRSpeech$SpeechBank");
Constructor<?> speechBankConstructor = speechBankClass.getDeclaredConstructor(String.class, boolean.class, List.class);
speechBankConstructor.setAccessible(true);
Field allSpeechBanksField = lotrSpeechClass.getDeclaredField("allSpeechBanks");
allSpeechBanksField.setAccessible(true);
Map<String, Object> allSpeechBanks = (Map<String, Object>) allSpeechBanksField.get(null);
for (Map.Entry<String, List<String>> entry : speechBanks.entrySet()) {
Object speechBank = speechBankConstructor.newInstance(entry.getKey(), true, entry.getValue());
allSpeechBanks.put(entry.getKey(), speechBank);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -1,160 +0,0 @@
package com.zivilon.cinder_loe.entity;
import lotr.common.entity.ai.LOTREntityAIEat;
import lotr.common.entity.npc.LOTREntityMan;
import lotr.common.entity.npc.LOTRTradeEntries;
import lotr.common.entity.npc.LOTRTradeEntries.TradeType;
import lotr.common.entity.npc.LOTRTradeable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import lotr.common.LOTRFoods;
import lotr.common.LOTRMod;
import lotr.common.fac.LOTRFaction;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.item.ItemStack;
import lotr.common.entity.npc.LOTRTradeEntry;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.init.Items;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIAvoidEntity;
import lotr.common.entity.ai.LOTREntityAIEat;
import lotr.common.entity.ai.LOTREntityAIDrink;
import net.minecraft.entity.ai.EntityAIWatchClosest2;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.EntityAILookIdle;
import lotr.common.entity.npc.LOTREntityNPC;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.util.StatCollector;
import net.minecraft.nbt.NBTTagCompound;
public class UtumnoSlaveTrader extends LOTREntityMan implements LOTRTradeable.Smith {
public static LOTRTradeEntries UTUMNO_SLAVE_BUY;
public static LOTRTradeEntries UTUMNO_SLAVE_SELL;
public boolean bound = true;
public UtumnoSlaveTrader(World world) {
super(world);
setSize(0.6F, 1.8F);
((EntityLiving)this).tasks.addTask(1, (EntityAIBase)new EntityAIPanic(this, 1.6D));
((EntityLiving)this).tasks.addTask(2, (EntityAIBase)new EntityAIWander(this, 1.0D));
((EntityLiving)this).tasks.addTask(3, (EntityAIBase)new EntityAIAvoidEntity(this, EntityPlayer.class, 12.0F, 1.5D, 1.8D));
((EntityLiving)this).tasks.addTask(4, (EntityAIBase)new LOTREntityAIEat(this, LOTRFoods.NURN_SLAVE, 8000));
((EntityLiving)this).tasks.addTask(4, (EntityAIBase)new LOTREntityAIDrink(this, LOTRFoods.NURN_SLAVE_DRINK, 8000));
((EntityLiving)this).tasks.addTask(5, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, EntityPlayer.class, 10.0F, 0.1F));
((EntityLiving)this).tasks.addTask(5, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, LOTREntityNPC.class, 5.0F, 0.05F));
((EntityLiving)this).tasks.addTask(6, (EntityAIBase)new EntityAIWatchClosest((EntityLiving)this, EntityLiving.class, 8.0F, 0.02F));
((EntityLiving)this).tasks.addTask(7, (EntityAIBase)new EntityAILookIdle((EntityLiving)this));
addTargetTasks(false);
}
public LOTRFaction getFaction() {
if (bound) return LOTRFaction.UTUMNO;
return LOTRFaction.UNALIGNED;
}
@Override
public String getNPCFormattedName(String npcName, String entityName) {
if (bound) entityName = "entity.cinder_loe.UtumnoSlaveTrader.bound.name";
return StatCollector.translateToLocal(entityName);
}
public boolean interact(EntityPlayer entityplayer) {
boolean flag = super.interact(entityplayer);
if (bound) {
bound = false;
return false;
}
return flag;
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D);
}
public boolean canTradeWith(EntityPlayer entityplayer) {
return !bound;
}
public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) {
data = super.onSpawnWithEgg(data);
this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.pouch));
this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon());
return data;
}
public LOTRTradeEntries getBuyPool() {
return UTUMNO_SLAVE_BUY;
}
public LOTRTradeEntries getSellPool() {
return UTUMNO_SLAVE_SELL;
}
// Replace with correct speechbanks
public String getSpeechBank(EntityPlayer entityplayer) {
if (isFriendlyAndAligned(entityplayer)) {
if (canTradeWith(entityplayer))
return "utumno/slaveTrader/friendly";
return "utumno/slaveTrader/neutral";
}
return "utumno/slaveTrader/hostile";
}
static {
UTUMNO_SLAVE_BUY = new LOTRTradeEntries(TradeType.BUY,
new LOTRTradeEntry[] {
new LOTRTradeEntry(new ItemStack(Items.arrow), 1),
new LOTRTradeEntry(new ItemStack(Items.iron_ingot), 6),
new LOTRTradeEntry(new ItemStack(LOTRMod.orcSteel), 6),
new LOTRTradeEntry(new ItemStack(LOTRMod.mugOrcDraught, 1, 4), 20),
new LOTRTradeEntry(new ItemStack(LOTRMod.modTemplate), 20)
}
);
UTUMNO_SLAVE_SELL = new LOTRTradeEntries(TradeType.SELL,
new LOTRTradeEntry[] {
new LOTRTradeEntry(new ItemStack(Items.bread), 3),
new LOTRTradeEntry(new ItemStack(Items.iron_ingot), 5),
new LOTRTradeEntry(new ItemStack(Items.gold_ingot), 17),
new LOTRTradeEntry(new ItemStack(Items.stick, 4), 1),
new LOTRTradeEntry(new ItemStack(LOTRMod.bronze), 5),
new LOTRTradeEntry(new ItemStack(LOTRMod.orcSteel), 5),
new LOTRTradeEntry(new ItemStack(LOTRMod.amber), 15),
new LOTRTradeEntry(new ItemStack(LOTRMod.ruby), 15),
new LOTRTradeEntry(new ItemStack(LOTRMod.amethyst), 12),
new LOTRTradeEntry(new ItemStack(LOTRMod.mugWater), 5),
new LOTRTradeEntry(new ItemStack(LOTRMod.wargBone), 3),
new LOTRTradeEntry(new ItemStack(LOTRMod.orcBone), 3),
new LOTRTradeEntry(new ItemStack(LOTRMod.trollBone), 4)
}
);
}
@Override
public void onPlayerTrade(EntityPlayer entityplayer, LOTRTradeEntries.TradeType type, ItemStack itemstack) {
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
}
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setByte("Bound", (byte)(bound ? 1 : 0));
}
public void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
bound = nbt.getByte("Bound") != 0;
}
}

@ -1,178 +0,0 @@
package com.zivilon.cinder_loe.entity;
import java.util.UUID;
import lotr.common.LOTRAchievement;
import lotr.common.enchant.LOTREnchantment;
import lotr.common.enchant.LOTREnchantmentHelper;
import lotr.common.entity.ai.LOTREntityAIAttackOnCollide;
import lotr.common.entity.ai.LOTREntityAIDrink;
import lotr.common.entity.ai.LOTREntityAIEat;
import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer;
import lotr.common.entity.ai.LOTREntityAIHiredRemainStill;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.entity.projectile.LOTREntityMarshWraithBall;
import lotr.common.fac.LOTRFaction;
import lotr.common.world.structure.LOTRChestContents;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import com.zivilon.cinder_loe.CinderLoE;
public class Wraith extends LOTREntityNPC {
public Wraith(World world) {
super(world);
setSize(0.8F, 2.5F);
((EntityLiving) this).tasks.addTask(1, (EntityAIBase) new LOTREntityAIHiredRemainStill(this));
((EntityLiving) this).tasks.addTask(2, (EntityAIBase) new LOTREntityAIAttackOnCollide(this, 1.3D, false));
((EntityLiving) this).tasks.addTask(3, (EntityAIBase) new LOTREntityAIFollowHiringPlayer(this));
((EntityLiving) this).tasks.addTask(5, (EntityAIBase) new EntityAIWander(this, 1.0D));
((EntityLiving) this).tasks.addTask(9, (EntityAIBase) new EntityAILookIdle((EntityLiving) this));
addTargetTasks(true);
}
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(17, Integer.valueOf(0));
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50.0D);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D);
}
public int getDeathFadeTime() {
return this.dataWatcher.getWatchableObjectInt(17);
}
public void setDeathFadeTime(int i) {
this.dataWatcher.updateObject(17, Integer.valueOf(i));
}
public LOTRFaction getFaction() {
return LOTRFaction.HOSTILE;
}
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setInteger("DeathFadeTime", getDeathFadeTime());
}
public void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
setDeathFadeTime(nbt.getInteger("DeathFadeTime"));
}
@Override
public void moveEntityWithHeading(float strafe, float forward) {
// First, call the super method to preserve normal movement behavior
super.moveEntityWithHeading(strafe, forward);
// Check for water at the entity's feet
int x = MathHelper.floor_double(this.posX);
int y = MathHelper.floor_double(this.posY);
int z = MathHelper.floor_double(this.posZ);
boolean isWater = this.worldObj.getBlock(x, y, z).getMaterial() == Material.water ||
this.worldObj.getBlock(x, y - 1, z).getMaterial() == Material.water; // Check below the entity too
if (isWater) {
this.onGround = true; // Treat water as solid ground
this.motionY = 0.0; // Stop falling/sinking
this.setPosition(this.posX, y + 1, this.posZ); // Adjust position to stay on top of the water
}
}
public void setInWeb() {}
public void onLivingUpdate() {
super.onLivingUpdate();
if (rand.nextBoolean())
((Entity)this).worldObj.spawnParticle("smoke", ((Entity)this).posX + (rand.nextDouble() - 0.5D) * ((Entity)this).width, ((Entity)this).posY + rand.nextDouble() * ((Entity)this).height, ((Entity)this).posZ + (rand.nextDouble() - 0.5D) * ((Entity)this).width, 0.0D, 0.0D, 0.0D);
if (!((Entity)this).worldObj.isRemote) {
if (getDeathFadeTime() > 0)
setDeathFadeTime(getDeathFadeTime() - 1);
if (getDeathFadeTime() == 1)
setDead();
}
}
public boolean attackEntityFrom(DamageSource damagesource, float f) {
boolean vulnerable = false;
Entity entity = damagesource.getEntity();
if (entity instanceof EntityLivingBase && entity == damagesource.getSourceOfDamage()) {
ItemStack itemstack = ((EntityLivingBase)entity).getHeldItem();
if (itemstack != null && LOTREnchantmentHelper.hasEnchant(itemstack, LOTREnchantment.baneWraith))
vulnerable = true;
}
if (vulnerable && getDeathFadeTime() == 0) {
boolean flag = super.attackEntityFrom(damagesource, f);
return flag;
}
return false;
}
public void onDeath(DamageSource damagesource) {
super.onDeath(damagesource);
if (!((Entity)this).worldObj.isRemote)
setDeathFadeTime(30);
}
protected void dropFewItems(boolean flag, int i) {
super.dropFewItems(flag, i);
int flesh = 1 + rand.nextInt(3) + rand.nextInt(i + 1);
for (int l = 0; l < flesh; l++)
dropItem(Items.rotten_flesh, 1);
dropChestContents(LOTRChestContents.MARSH_REMAINS, 1, 3 + i);
}
public EnumCreatureAttribute getCreatureAttribute() {
return EnumCreatureAttribute.UNDEAD;
}
protected String getHurtSound() {
return "lotr:wight.hurt";
}
protected String getDeathSound() {
return "lotr:wight.death";
}
public boolean handleWaterMovement() {
return false;
}
protected void func_145780_a(int i, int j, int k, Block block) {}
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {
// Do nothing
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(CinderLoE.wraithSpawnEgg, 1);
}
}

@ -1,71 +0,0 @@
package com.zivilon.cinder_loe.items;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import java.util.List;
import lotr.common.LOTRCreativeTabs;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.fac.LOTRFaction;
import lotr.common.network.LOTRPacketHandler;
import lotr.common.network.LOTRPacketWeaponFX;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
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.potion.PotionEffect;
import net.minecraft.potion.Potion;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import com.zivilon.cinder_loe.items.WizardStaff;
public class AlatarStaff extends WizardStaff {
public AlatarStaff() {
super();
}
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
entityplayer.swingItem();
itemstack.damageItem(2, (EntityLivingBase)entityplayer);
world.playSoundAtEntity((Entity)entityplayer, "lotr:elf.woodElf_teleport", 2.0F, (Item.itemRand.nextFloat() - Item.itemRand.nextFloat()) * 0.2F + 1.0F);
LOTRFaction faction = getFaction(entityplayer);
if (!world.isRemote) {
List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, ((Entity)entityplayer).boundingBox.expand(12.0D, 8.0D, 12.0D));
if (!entities.isEmpty())
for (int i = 0; i < entities.size(); i++) {
EntityLivingBase entity = entities.get(i);
if (entity != entityplayer) {
if (entity instanceof EntityLiving) {
EntityLiving entityliving = (EntityLiving)entity;
if (!faction.isGoodRelation(LOTRMod.getNPCFaction((Entity)entityliving)))
continue;
}
if (entity instanceof EntityPlayer)
if (!MinecraftServer.getServer().isPVPEnabled() || LOTRLevelData.getData((EntityPlayer)entity).getAlignment(faction) < 0.0F)
continue;
entity.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 1200, 0));
entity.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 1200, 0));
}
}
LOTRPacketWeaponFX packet = new LOTRPacketWeaponFX(LOTRPacketWeaponFX.Type.MACE_SAURON, (Entity)entityplayer);
LOTRPacketHandler.networkWrapper.sendToAllAround((IMessage)packet, LOTRPacketHandler.nearEntity((Entity)entityplayer, 64.0D));
}
return itemstack;
}
private LOTRFaction getFaction(EntityPlayer player) {
LOTRFaction faction = LOTRLevelData.getData(player).getPledgeFaction();
if (faction == null) {
faction = LOTRFaction.DORWINION;
}
return faction;
}
}

@ -1,66 +0,0 @@
package com.zivilon.cinder_loe.items;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import com.zivilon.cinder_loe.CinderLoE;
public class CinderLoESpawnEgg extends Item {
private Class<? extends Entity> entityClass;
public CinderLoESpawnEgg(Class<? extends Entity> entityClass) {
this.entityClass = entityClass;
this.setUnlocalizedName("spawn_egg_" + entityClass.getSimpleName().toLowerCase());
this.setTextureName("spawn_egg");
this.setCreativeTab(CreativeTabs.tabMisc); // Or any other tab you prefer
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
if (!world.isRemote) {
// Perform a ray trace to find the block the player is looking at
MovingObjectPosition target = getMovingObjectPositionFromPlayer(world, player, true);
if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
int x = target.blockX;
int y = target.blockY;
int z = target.blockZ;
// Adjust the y coordinate to spawn the entity on top of the block clicked
y += 1;
try {
Entity entity = entityClass.getConstructor(World.class).newInstance(world);
entity.setLocationAndAngles(x + 0.5, y, z + 0.5, MathHelper.wrapAngleTo180_float(world.rand.nextFloat() * 360.0F), 0.0F);
spawnCustomCreature(world, entity);
} catch (Exception e) {
e.printStackTrace(); // Log any exceptions
}
}
}
if (!player.capabilities.isCreativeMode) {
--itemStack.stackSize;
}
return itemStack;
}
public static void spawnCustomCreature(World world, Entity entity) {
if (entity instanceof EntityLiving) {
EntityLiving entityLiving = (EntityLiving)entity;
// The entity's location is already set, so we directly apply custom properties and spawn
entityLiving.onSpawnWithEgg(null); // Applies custom armor and equipment
world.spawnEntityInWorld(entity);
entityLiving.playLivingSound();
}
}
}

@ -1,71 +0,0 @@
package com.zivilon.cinder_loe.items;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import java.util.List;
import lotr.common.LOTRCreativeTabs;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.fac.LOTRFaction;
import lotr.common.network.LOTRPacketHandler;
import lotr.common.network.LOTRPacketWeaponFX;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
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.potion.PotionEffect;
import net.minecraft.potion.Potion;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import com.zivilon.cinder_loe.items.WizardStaff;
public class PallandoStaff extends WizardStaff {
public PallandoStaff() {
super();
}
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
entityplayer.swingItem();
itemstack.damageItem(2, (EntityLivingBase)entityplayer);
world.playSoundAtEntity((Entity)entityplayer, "lotr:elf.woodElf_teleport", 2.0F, (Item.itemRand.nextFloat() - Item.itemRand.nextFloat()) * 0.2F + 1.0F);
LOTRFaction faction = getFaction(entityplayer);
if (!world.isRemote) {
List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, ((Entity)entityplayer).boundingBox.expand(12.0D, 8.0D, 12.0D));
if (!entities.isEmpty())
for (int i = 0; i < entities.size(); i++) {
EntityLivingBase entity = entities.get(i);
if (entity != entityplayer) {
if (entity instanceof EntityLiving) {
EntityLiving entityliving = (EntityLiving)entity;
if (faction.isGoodRelation(LOTRMod.getNPCFaction((Entity)entityliving)))
continue;
}
if (entity instanceof EntityPlayer)
if (!MinecraftServer.getServer().isPVPEnabled() || LOTRLevelData.getData((EntityPlayer)entity).getAlignment(faction) > 0.0F)
continue;
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 1200, 0));
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1200, 0));
}
}
LOTRPacketWeaponFX packet = new LOTRPacketWeaponFX(LOTRPacketWeaponFX.Type.MACE_SAURON, (Entity)entityplayer);
LOTRPacketHandler.networkWrapper.sendToAllAround((IMessage)packet, LOTRPacketHandler.nearEntity((Entity)entityplayer, 64.0D));
}
return itemstack;
}
private LOTRFaction getFaction(EntityPlayer player) {
LOTRFaction faction = LOTRLevelData.getData(player).getPledgeFaction();
if (faction == null) {
faction = LOTRFaction.RHUDEL;
}
return faction;
}
}

@ -1,93 +0,0 @@
package com.zivilon.cinder_loe.items;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import lotr.common.LOTRCreativeTabs;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import com.zivilon.cinder_loe.util.BlockPos;
import com.zivilon.cinder_loe.items.WizardStaff;
import com.zivilon.cinder_loe.entity.FangornBear;
import com.zivilon.cinder_loe.entity.FangornWildBoar;
import com.zivilon.cinder_loe.entity.FangornAuroch;
import com.zivilon.cinder_loe.entity.FangornElk;
import com.zivilon.cinder_loe.entity.FangornAnimal;
import lotr.common.item.LOTRMaterial;
import java.util.Random;
import java.util.List;
public class RadagastStaff extends WizardStaff {
public RadagastStaff() {
super();
}
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
entityplayer.swingItem();
itemstack.damageItem(2, (EntityLivingBase)entityplayer);
if (!world.isRemote) {
BlockPos location = BlockPos.findSafeSpawnLocation(world, entityplayer);
if (location != null && !isAreaCrowded(world, entityplayer)) {
world.playSoundAtEntity((Entity)entityplayer, "lotr:ent.mallorn.summonEnt", 2.0F, (Item.itemRand.nextFloat() - Item.itemRand.nextFloat()) * 0.2F + 1.0F);
spawnAnimal(location, world);
} else {
world.playSoundAtEntity((Entity)entityplayer, "lotr:item.puff", 1.0F, 2.0F);
}
}
return itemstack;
}
public boolean isAreaCrowded(World world, EntityPlayer player) {
int radius = 30; // Check within 30 blocks
int maxEntities = 10; // Maximum allowed nearby entities
AxisAlignedBB checkArea = AxisAlignedBB.getBoundingBox(
player.posX - radius, player.posY - radius, player.posZ - radius,
player.posX + radius, player.posY + radius, player.posZ + radius
);
List<EntityAnimal> listAnimals = world.getEntitiesWithinAABB(EntityAnimal.class, checkArea);
List<FangornAnimal> listFangornBear = world.getEntitiesWithinAABB(FangornAnimal.class, checkArea);
// Combine counts from both lists
int totalAnimals = listAnimals.size() + listFangornBear.size();
return totalAnimals >= maxEntities;
}
public void spawnAnimal(BlockPos location, World world) {
Random rand = new Random();
int choice = rand.nextInt(4); // Generate a random number between 0 and 2
EntityLivingBase entity = null;
switch (choice) {
case 0:
entity = new FangornBear(world); // Assuming FangornBear is your entity class for bears
break;
case 1:
entity = new FangornWildBoar(world); // Replace with your wild boar entity class
break;
case 2:
entity = new FangornAuroch(world); // Replace with your auroch entity class
break;
case 3:
entity = new FangornElk(world); // Replace with your auroch entity class
break;
}
if (entity != null) {
entity.setPosition(location.x + 0.5, location.y, location.z + 0.5); // Center the entity on the block
world.spawnEntityInWorld(entity);
}
}
}

@ -1,46 +0,0 @@
package com.zivilon.cinder_loe.items;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import java.util.List;
import lotr.common.LOTRCreativeTabs;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.fac.LOTRFaction;
import lotr.common.network.LOTRPacketHandler;
import lotr.common.network.LOTRPacketWeaponFX;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
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.potion.PotionEffect;
import net.minecraft.potion.Potion;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import com.zivilon.cinder_loe.items.WizardStaff;
import com.zivilon.cinder_loe.entity.SarumanFireball;
public class SarumanStaff extends WizardStaff {
public SarumanStaff() {
super();
}
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
entityplayer.swingItem();
itemstack.damageItem(2, (EntityLivingBase)entityplayer);
world.playSoundAtEntity((Entity)entityplayer, "mob.ghast.fireball", 2.0F, (Item.itemRand.nextFloat() - Item.itemRand.nextFloat()) * 0.2F + 1.0F);
if (!world.isRemote) {
world.spawnEntityInWorld((Entity)new SarumanFireball(world, ((EntityLivingBase)entityplayer)));
LOTRPacketWeaponFX packet = new LOTRPacketWeaponFX(LOTRPacketWeaponFX.Type.MACE_SAURON, (Entity)entityplayer);
LOTRPacketHandler.networkWrapper.sendToAllAround((IMessage)packet, LOTRPacketHandler.nearEntity((Entity)entityplayer, 64.0D));
}
return itemstack;
}
}

@ -1,59 +0,0 @@
package com.zivilon.cinder_loe.items;
import java.util.ArrayList;
import java.util.List;
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.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 Whip extends LOTRItemSword {
public Whip() {
super(LOTRMaterial.FUR);
this.lotrWeaponDamage = 4.0F;
LOTRWeaponStats.registerMeleeReach(Whip.class, 1.5F);
}
public boolean func_77644_a(ItemStack itemstack, EntityLivingBase hitEntity, EntityLivingBase user) {
super.hitEntity(itemstack, hitEntity, user);
launchWhip(user, hitEntity);
return true;
}
public EnumAction getItemUseAction(ItemStack itemstack) {
return EnumAction.none;
}
private void launchWhip(EntityLivingBase user, EntityLivingBase hitEntity) {
World world = ((Entity)user).worldObj;
world.playSoundAtEntity((Entity)user, "lotr:item.balrogWhip", 2.0F, 0.7F + Item.itemRand.nextFloat() * 0.6F);
}
public boolean getIsRepairable(ItemStack itemstack, ItemStack repairItem) {
return (repairItem.getItem() == Items.leather);
}
private void checkIncompatibleModifiers(ItemStack itemstack) {}
}

@ -1,40 +0,0 @@
package com.zivilon.cinder_loe.items;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import lotr.common.LOTRCreativeTabs;
import lotr.common.entity.projectile.LOTREntityGandalfFireball;
import lotr.common.network.LOTRPacketHandler;
import lotr.common.network.LOTRPacketWeaponFX;
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.world.World;
import lotr.common.item.LOTRItemSword;
import lotr.common.item.LOTRStoryItem;
import com.zivilon.cinder_loe.CinderLoE;
public class WizardStaff extends LOTRItemSword implements LOTRStoryItem {
public WizardStaff() {
super(CinderLoE.getLOTRMaterialByName("WIZARD"));
setCreativeTab((CreativeTabs)LOTRCreativeTabs.tabStory);
}
public int getMaxItemUseDuration(ItemStack itemstack) {
return 40;
}
public EnumAction getItemUseAction(ItemStack itemstack) {
return EnumAction.bow;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
return itemstack;
}
}

@ -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;
}
}

@ -1,275 +0,0 @@
package com.zivilon.cinder_loe.mixins;
import com.zivilon.cinder_loe.client.render.item.RenderHelper;
import com.zivilon.cinder_loe.util.Utilities;
import com.zivilon.cinder_loe.CinderLoE_Config;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
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.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemCloth;
import net.minecraft.item.ItemMap;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.MapData;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.MinecraftForgeClient;
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
@Mixin(ItemRenderer.class)
public abstract class MixinItemRenderer {
@Shadow
private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png");
@Shadow
private RenderBlocks renderBlocksIr;
@Shadow
private Minecraft mc;
@Overwrite(remap = false)
public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_, ItemRenderType type) {
GL11.glPushMatrix();
TextureManager texturemanager = this.mc.getTextureManager();
Item item = p_78443_2_.getItem();
Block block = Block.getBlockFromItem(item);
if (p_78443_2_ != null && block != null && block.getRenderBlockPass() != 0) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
}
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(p_78443_2_, type);
if (customRenderer != null) {
texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber()));
ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, p_78443_1_, p_78443_2_);
}
else
if (p_78443_2_.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())) {
texturemanager.bindTexture(texturemanager.getResourceLocation(0));
if (p_78443_2_ != null && block != null && block.getRenderBlockPass() != 0) {
GL11.glDepthMask(false);
this.renderBlocksIr.renderBlockAsItem(block, p_78443_2_.getItemDamage(), 1.0F);
GL11.glDepthMask(true);
}
else {
this.renderBlocksIr.renderBlockAsItem(block, p_78443_2_.getItemDamage(), 1.0F);
}
}
else {
IIcon iicon = p_78443_1_.getItemIcon(p_78443_2_, p_78443_3_);
if (iicon == null) {
GL11.glPopMatrix();
return;
}
texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber()));
TextureUtil.func_152777_a(false, false, 1.0F);
Tessellator tessellator = Tessellator.instance;
float f = iicon.getMinU();
float f1 = iicon.getMaxU();
float f2 = iicon.getMinV();
float f3 = iicon.getMaxV();
float f4 = 0.0F;
float f5 = 0.3F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glTranslatef(-f4, -f5, 0.0F);
float f6 = 1.5F;
GL11.glScalef(f6, f6, f6);
GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F, false);
if (p_78443_2_.hasEffect(p_78443_3_)) {
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
texturemanager.bindTexture(RES_ITEM_GLINT);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(768, 1, 1, 0);
GL11.glColor4f(CinderLoE_Config.enchantment_color_red, CinderLoE_Config.enchantment_color_green, CinderLoE_Config.enchantment_color_blue, 1.0F);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
float f8 = 0.125F;
GL11.glScalef(f8, f8, f8);
float f9 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
GL11.glTranslatef(f9, 0.0F, 0.0F);
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
RenderHelper.customRenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, true);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glScalef(f8, f8, f8);
f9 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
GL11.glTranslatef(-f9, 0.0F, 0.0F);
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
RenderHelper.customRenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, true);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDepthFunc(GL11.GL_LEQUAL);
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber()));
TextureUtil.func_147945_b();
}
if (p_78443_2_ != null && block != null && block.getRenderBlockPass() != 0) {
GL11.glDisable(GL11.GL_BLEND);
}
GL11.glPopMatrix();
}
private void customRenderItemIn2D(Tessellator p_78439_0_, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int p_78439_5_, int p_78439_6_, float p_78439_7_, boolean enchant) {
if (!enchant) GL11.glPushMatrix(); // Save the current OpenGL state
if (!enchant) GL11.glEnable(GL11.GL_BLEND); // Enable blending
if (!enchant) OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); // Apply your custom blend function for semi-transparency
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(0.0F, 0.0F, 1.0F);
p_78439_0_.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)p_78439_1_, (double)p_78439_4_);
p_78439_0_.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)p_78439_3_, (double)p_78439_4_);
p_78439_0_.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)p_78439_3_, (double)p_78439_2_);
p_78439_0_.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)p_78439_1_, (double)p_78439_2_);
p_78439_0_.draw();
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(0.0F, 0.0F, -1.0F);
p_78439_0_.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_2_);
p_78439_0_.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_2_);
p_78439_0_.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_4_);
p_78439_0_.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_4_);
p_78439_0_.draw();
float f5 = 0.5F * (p_78439_1_ - p_78439_3_) / (float)p_78439_5_;
float f6 = 0.5F * (p_78439_4_ - p_78439_2_) / (float)p_78439_6_;
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(-1.0F, 0.0F, 0.0F);
int k;
float f7;
float f8;
for (k = 0; k < p_78439_5_; ++k) {
f7 = (float)k / (float)p_78439_5_;
f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5;
p_78439_0_.addVertexWithUV((double)f7, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_);
p_78439_0_.addVertexWithUV((double)f7, 0.0D, 0.0D, (double)f8, (double)p_78439_4_);
p_78439_0_.addVertexWithUV((double)f7, 1.0D, 0.0D, (double)f8, (double)p_78439_2_);
p_78439_0_.addVertexWithUV((double)f7, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_);
}
p_78439_0_.draw();
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(1.0F, 0.0F, 0.0F);
float f9;
for (k = 0; k < p_78439_5_; ++k) {
f7 = (float)k / (float)p_78439_5_;
f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5;
f9 = f7 + 1.0F / (float)p_78439_5_;
p_78439_0_.addVertexWithUV((double)f9, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_);
p_78439_0_.addVertexWithUV((double)f9, 1.0D, 0.0D, (double)f8, (double)p_78439_2_);
p_78439_0_.addVertexWithUV((double)f9, 0.0D, 0.0D, (double)f8, (double)p_78439_4_);
p_78439_0_.addVertexWithUV((double)f9, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_);
}
p_78439_0_.draw();
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(0.0F, 1.0F, 0.0F);
for (k = 0; k < p_78439_6_; ++k) {
f7 = (float)k / (float)p_78439_6_;
f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6;
f9 = f7 + 1.0F / (float)p_78439_6_;
p_78439_0_.addVertexWithUV(0.0D, (double)f9, 0.0D, (double)p_78439_1_, (double)f8);
p_78439_0_.addVertexWithUV(1.0D, (double)f9, 0.0D, (double)p_78439_3_, (double)f8);
p_78439_0_.addVertexWithUV(1.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8);
p_78439_0_.addVertexWithUV(0.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8);
}
p_78439_0_.draw();
p_78439_0_.startDrawingQuads();
p_78439_0_.setNormal(0.0F, -1.0F, 0.0F);
for (k = 0; k < p_78439_6_; ++k) {
f7 = (float)k / (float)p_78439_6_;
f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6;
p_78439_0_.addVertexWithUV(1.0D, (double)f7, 0.0D, (double)p_78439_3_, (double)f8);
p_78439_0_.addVertexWithUV(0.0D, (double)f7, 0.0D, (double)p_78439_1_, (double)f8);
p_78439_0_.addVertexWithUV(0.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8);
p_78439_0_.addVertexWithUV(1.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8);
}
p_78439_0_.draw();
if (!enchant) GL11.glPopMatrix(); // Restore the saved OpenGL state
}
@Overwrite
public static void renderItemIn2D(Tessellator p_78439_0_, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int p_78439_5_, int p_78439_6_, float p_78439_7_) {
// Redirect to new custom renderer. This should not be necessary but works as failsafe
RenderHelper.customRenderItemIn2D(p_78439_0_, p_78439_1_, p_78439_2_, p_78439_3_, p_78439_4_, p_78439_5_, p_78439_6_, p_78439_7_, false);
/* DEBUG
System.out.println("Printing stacktrace from original render method");
Utilities.writeLog("Printing stacktrace from original render method");
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
for (StackTraceElement element : stackTraceElements) {
Utilities.writeLog(element.toString());
}
Utilities.writeLog("");
*/
}
}

@ -1,111 +0,0 @@
package com.zivilon.cinder_loe.mixins;
import com.zivilon.cinder_loe.CinderLoE;
import com.zivilon.cinder_loe.client.model.ModelRedDwarfHelmet;
import com.zivilon.cinder_loe.client.model.ModelBreeHelmet;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.util.HashMap;
import java.util.Map;
import lotr.client.model.LOTRArmorModels;
import lotr.client.model.LOTRModelArnorHelmet;
import lotr.client.model.LOTRModelBlackNumenoreanHelmet;
import lotr.client.model.LOTRModelBlackUrukHelmet;
import lotr.client.model.LOTRModelDorwinionElfHelmet;
import lotr.client.model.LOTRModelEasterlingHelmet;
import lotr.client.model.LOTRModelGaladhrimHelmet;
import lotr.client.model.LOTRModelGemsbokHelmet;
import lotr.client.model.LOTRModelGondolinHelmet;
import lotr.client.model.LOTRModelGondorHelmet;
import lotr.client.model.LOTRModelGulfChestplate;
import lotr.client.model.LOTRModelGundabadUrukHelmet;
import lotr.client.model.LOTRModelHaradRobes;
import lotr.client.model.LOTRModelHaradTurban;
import lotr.client.model.LOTRModelHarnedorChestplate;
import lotr.client.model.LOTRModelHarnedorHelmet;
import lotr.client.model.LOTRModelHeadPlate;
import lotr.client.model.LOTRModelHighElvenHelmet;
import lotr.client.model.LOTRModelHighElvenHelmet;
import lotr.client.model.LOTRModelHighElvenHelmet;
import lotr.client.model.LOTRModelLeatherHat;
import lotr.client.model.LOTRModelMoredainLionHelmet;
import lotr.client.model.LOTRModelMorgulHelmet;
import lotr.client.model.LOTRModelNearHaradWarlordHelmet;
import lotr.client.model.LOTRModelPartyHat;
import lotr.client.model.LOTRModelRohanMarshalHelmet;
import lotr.client.model.LOTRModelSwanChestplate;
import lotr.client.model.LOTRModelSwanHelmet;
import lotr.client.model.LOTRModelTauredainChieftainHelmet;
import lotr.client.model.LOTRModelTauredainGoldHelmet;
import lotr.client.model.LOTRModelUmbarHelmet;
import lotr.client.model.LOTRModelUrukHelmet;
import lotr.client.model.LOTRModelUrukHelmet;
import lotr.client.model.LOTRModelWingedHelmet;
import lotr.common.LOTRMod;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.item.Item;
@Mixin(LOTRArmorModels.class)
public class MixinLOTRArmorModels {
@Shadow
private Map<ModelBiped, Map<Item, ModelBiped>> specialArmorModels;
@Shadow
public void copyModelRotations(ModelBiped target, ModelBiped src) {
}
private Map<Item, ModelBiped> getSpecialModels(ModelBiped key) {
Map<Item, ModelBiped> map = this.specialArmorModels.get(key);
if (map == null) {
map = new HashMap<Item, ModelBiped>();
map.put(LOTRMod.leatherHat, new LOTRModelLeatherHat());
map.put(LOTRMod.helmetGondor, new LOTRModelGondorHelmet(1.0F));
map.put(LOTRMod.helmetElven, new LOTRModelGaladhrimHelmet(1.0F));
map.put(LOTRMod.helmetGondorWinged, new LOTRModelWingedHelmet(1.0F));
map.put(LOTRMod.helmetMorgul, new LOTRModelMorgulHelmet(1.0F));
map.put(LOTRMod.helmetGemsbok, new LOTRModelGemsbokHelmet(1.0F));
map.put(LOTRMod.helmetHighElven, new LOTRModelHighElvenHelmet(1.0F));
map.put(LOTRMod.helmetBlackUruk, new LOTRModelBlackUrukHelmet(1.0F));
map.put(LOTRMod.helmetUruk, new LOTRModelUrukHelmet(1.0F));
map.put(LOTRMod.helmetNearHaradWarlord, new LOTRModelNearHaradWarlordHelmet(1.0F));
map.put(LOTRMod.helmetDolAmroth, new LOTRModelSwanHelmet(1.0F));
map.put(LOTRMod.bodyDolAmroth, new LOTRModelSwanChestplate(1.0F));
map.put(LOTRMod.helmetMoredainLion, new LOTRModelMoredainLionHelmet(1.0F));
map.put(LOTRMod.helmetHaradRobes, new LOTRModelHaradTurban());
map.put(LOTRMod.bodyHaradRobes, new LOTRModelHaradRobes(1.0F));
map.put(LOTRMod.legsHaradRobes, new LOTRModelHaradRobes(0.5F));
map.put(LOTRMod.bootsHaradRobes, new LOTRModelHaradRobes(1.0F));
map.put(LOTRMod.helmetGondolin, new LOTRModelGondolinHelmet(1.0F));
map.put(LOTRMod.helmetRohanMarshal, new LOTRModelRohanMarshalHelmet(1.0F));
map.put(LOTRMod.helmetTauredainChieftain, new LOTRModelTauredainChieftainHelmet(1.0F));
map.put(LOTRMod.helmetTauredainGold, new LOTRModelTauredainGoldHelmet(1.0F));
map.put(LOTRMod.helmetGundabadUruk, new LOTRModelGundabadUrukHelmet(1.0F));
map.put(LOTRMod.helmetUrukBerserker, new LOTRModelUrukHelmet(1.0F));
map.put(LOTRMod.helmetDorwinionElf, new LOTRModelDorwinionElfHelmet(1.0F));
map.put(LOTRMod.partyHat, new LOTRModelPartyHat(0.6F));
map.put(LOTRMod.helmetArnor, new LOTRModelArnorHelmet(1.0F));
map.put(LOTRMod.helmetRhunGold, new LOTRModelEasterlingHelmet(1.0F, false));
map.put(LOTRMod.helmetRhunWarlord, new LOTRModelEasterlingHelmet(1.0F, true));
map.put(LOTRMod.helmetRivendell, new LOTRModelHighElvenHelmet(1.0F));
map.put(LOTRMod.bodyGulfHarad, new LOTRModelGulfChestplate(1.0F));
map.put(LOTRMod.helmetUmbar, new LOTRModelUmbarHelmet(1.0F));
map.put(LOTRMod.helmetHarnedor, new LOTRModelHarnedorHelmet(1.0F));
map.put(LOTRMod.bodyHarnedor, new LOTRModelHarnedorChestplate(1.0F));
map.put(LOTRMod.helmetBlackNumenorean, new LOTRModelBlackNumenoreanHelmet(1.0F));
map.put(CinderLoE.helmetRedDwarf, new ModelRedDwarfHelmet(1.0F));
map.put(CinderLoE.helmetBree, new ModelBreeHelmet());
map.put(LOTRMod.plate, new LOTRModelHeadPlate());
map.put(LOTRMod.woodPlate, new LOTRModelHeadPlate());
map.put(LOTRMod.ceramicPlate, new LOTRModelHeadPlate());
for (ModelBiped armorModel : map.values())
copyModelRotations(armorModel, key);
this.specialArmorModels.put(key, map);
}
return map;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save