2
0
Fork 0

still broken

frozen
KeyLime17 2 years ago
parent 12f858bbbd
commit bd53f99b20

Binary file not shown.

@ -445,6 +445,7 @@ public class CinderLoE {
alatarStaff = (new AlatarStaff()).setUnlocalizedName("lotr:alatarStaff").setTextureName("lotr:alatarStaff");
sarumanStaff = (new SarumanStaff()).setUnlocalizedName("lotr:sarumanStaff").setTextureName("lotr:sarumanStaff");
welfRelic = (new WoodElfRelic()).setUnlocalizedName("lotr:welfRelic").setTextureName("lotr:welfRelic");
utumnoSlaveSpawnEgg = new CinderLoESpawnEgg(UtumnoSlaveTrader.class).setTextureName("lotr:spawn_egg");
@ -501,10 +502,10 @@ public class CinderLoE {
linkLOTRWeapon(sarumanStaff, "sarumanStaff");
//Relics
welfRelic = (new WoodElfRelic()).setUnlocalizedName("lotr:welfRelic").setTextureName("lotr:welfRelic");
ItemRegistration.registerItem(welfRelic, "welfRelic", 87);
linkLOTRWeapon(welfRelic, "welfRelic");
// Misc
EVENT = getLOTRMaterialByName("EVENT");
frostblade = (new LOTRItemSword(EVENT)).setUnlocalizedName("lotr:frostblade").setTextureName("lotr:frostblade");

@ -14,7 +14,7 @@ import java.util.Map;
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"};
return new String[] {"com.zivilon.cinder_loe.coremod.LOTRMaterialTransformer","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

@ -1,144 +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.LOTREntities;
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.entity.npc.LOTREntityNPCRideable;
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.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class LimwaithCrocodile extends LOTREntityNPCRideable {
public LimwaithCrocodile(World world) {
super(world);
this.setSize(2.1f, 0.7f);
((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.5D, 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, 12.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));
this.addTargetTasks(true);
this.spawnsInDarkness = true;
}
protected void entityInit() {
super.entityInit();
((Entity) this).getDataWatcher().addObject(20, (Object) 0);
}
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 int getSnapTime() {
return ((Entity) this).getDataWatcher().getWatchableObjectInt(20);
}
public void setSnapTime(int i) {
((Entity) this).getDataWatcher().updateObject(20, (Object) i);
}
public boolean isAIEnabled() {
return true;
}
public boolean canBreatheUnderwater() {
return true;
}
public boolean attackEntityAsMob(Entity entity) {
boolean flag = super.attackEntityAsMob(entity);
if (flag) {
if (!((Entity) this).worldObj.isRemote) {
this.setSnapTime(20);
}
((Entity) this).worldObj.playSoundAtEntity((Entity) this, "lotr:crocodile.snap", this.getSoundVolume(), this.getSoundPitch());
}
return flag;
}
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.bone, 1);
int meats = 2 + rand.nextInt(3) + rand.nextInt(1 + i);
for (int j = 0; j < meats; j++) {
if (isBurning()) {
dropItem(Items.fish, 1);
} else {
dropItem(Items.leather, 1);
}
}
dropItem(LOTRMod.zebraRaw, 1);
}
protected String getLivingSound() {
return "lotr:crocodile.say";
}
protected String getHurtSound() {
return "lotr:crocodile.say";
}
protected String getDeathSound() {
return "lotr:crocodile.death";
}
public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {
// No ranged attack implemented
}
@Override
public ItemStack getPickedResult(MovingObjectPosition target) {
return new ItemStack(LOTRMod.spawnEgg, 1, LOTREntities.getEntityID((Entity) this));
}
@Override
public boolean isMountSaddled() {
return this.isNPCTamed() && ((Entity) this).riddenByEntity instanceof EntityPlayer;
}
@Override
public boolean getBelongsToNPC() {
return false;
}
@Override
public void setBelongsToNPC(boolean flag) {
}
@Override
public String getMountArmorTexture() {
return null;
}
public void onLivingUpdate() {
super.onLivingUpdate();
if (!((Entity) this).worldObj.isRemote) {
Entity rider = ((Entity) this).riddenByEntity;
}
if (!((Entity) this).worldObj.isRemote && ((Entity) this).riddenByEntity instanceof EntityPlayer && LOTRLevelData.getData((EntityPlayer) ((Entity) this).riddenByEntity).getAlignment(this.getFaction()) < 50.0f) {
((Entity) this).riddenByEntity.mountEntity(null);
}
}
}

@ -1,9 +1,12 @@
package com.zivilon.cinder_loe.items;
import com.zivilon.cinder_loe.CinderLoE;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.fac.LOTRFaction;
import lotr.common.item.LOTRItemSword;
import lotr.common.item.LOTRStoryItem;
import lotr.common.network.LOTRPacketHandler;
import lotr.common.network.LOTRPacketWeaponFX;
import net.minecraft.entity.Entity;
@ -24,11 +27,12 @@ public class WoodElfRelic extends WizardStaff {
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);
LOTRFaction faction = LOTRFaction.WOOD_ELF;
if (!world.isRemote) {
List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, ((Entity)entityplayer).boundingBox.expand(12.0D, 8.0D, 12.0D));
if (!entities.isEmpty())
@ -53,12 +57,4 @@ public class WoodElfRelic extends WizardStaff {
}
return itemstack;
}
private LOTRFaction getFaction(EntityPlayer player) {
LOTRFaction faction = LOTRFaction.WOOD_ELF;
if (faction == null) {
faction = LOTRFaction.WOOD_ELF;
}
return faction;
}
}
Loading…
Cancel
Save