diff --git a/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityElephant.java b/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityElephant.java index cc3a40c..060d348 100644 --- a/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityElephant.java +++ b/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityElephant.java @@ -516,7 +516,6 @@ public boolean interact(EntityPlayer entityPlayer) if (getStorage() == 0 ) { setStorage((byte) 1); - entityPlayer.inventory.addItemStackToInventory(new ItemStack(MoCreatures.key)); entityPlayer.addStat(MoCAchievements.elephant_chest, 1); return true; } @@ -615,13 +614,6 @@ public boolean interact(EntityPlayer entityPlayer) } } - - - if (item == MoCreatures.key && getStorage() > 0) - { - if (tryToOpenElephantChest(entityPlayer)) {return true;}; - - } if (getTusks() > 0 && (item == Items.shears)) { MoCTools.playCustomSound(this, "armoroff", worldObj); @@ -635,21 +627,28 @@ public boolean interact(EntityPlayer entityPlayer) || !(MoCreatures.proxy.emptyHandMountAndPickUpOnly) ) { - if ( + if (entityPlayer.isSneaking() && getStorage() > 0) + { + if (tryToOpenElephantChest(entityPlayer)) {return true;}; + + } + + else if + ( sitCounter != 0 && getIsTamed() && getIsAdult() && riddenByEntity == null && getArmorType() >= 1 //wearing elephant harness ) - { - entityPlayer.rotationYaw = rotationYaw; - entityPlayer.rotationPitch = rotationPitch; - sitCounter = 0; - entityPlayer.mountEntity(this); - entityPlayer.addStat(MoCAchievements.mount_elephant, 1); - return true; - } + { + entityPlayer.rotationYaw = rotationYaw; + entityPlayer.rotationPitch = rotationPitch; + sitCounter = 0; + entityPlayer.mountEntity(this); + entityPlayer.addStat(MoCAchievements.mount_elephant, 1); + return true; + } } return false; diff --git a/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityHorse.java b/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityHorse.java index d8cc805..54d46b2 100644 --- a/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityHorse.java +++ b/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityHorse.java @@ -1421,22 +1421,6 @@ public boolean interact(EntityPlayer entityPlayer) { if (interactIfItemstackIsAmulet(entityPlayer, horseType, item)) {return true;}; - if ((item == MoCreatures.key) && getIsChestedHorse()) - { - // if first time opening horse chest, we must initialize it - if (localHorseChest == null) - { - localHorseChest = new MoCAnimalChest(StatCollector.translateToLocal("container.MoCreatures.HorseChest"), getInventorySize());// , new - } - // only open this chest on server side - if (!worldObj.isRemote) - { - entityPlayer.displayGUIChest(localHorseChest); - } - return true; - - } - if (interactIfItemstackIsHorseArmor(entityPlayer, itemStack, item)) {return true;}; if (interactIfItemstackIsEssenceOfDarkness(entityPlayer, horseType, itemStack, owner, item)) {return true;}; @@ -1455,7 +1439,6 @@ public boolean interact(EntityPlayer entityPlayer) entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, null); } - entityPlayer.inventory.addItemStackToInventory(new ItemStack(MoCreatures.key)); setChestedHorse(true); return true; } @@ -1471,16 +1454,35 @@ public boolean interact(EntityPlayer entityPlayer) (MoCreatures.proxy.emptyHandMountAndPickUpOnly && itemStack == null) || !(MoCreatures.proxy.emptyHandMountAndPickUpOnly) ) - && !(entityPlayer.isSneaking()) && getIsRideable() && getIsAdult() && (riddenByEntity == null) - && !(isFlyer() && entityPlayer.riddenByEntity != null) //stops players from riding a flying horse with a creature picked up or on their head. This fixes the flying speed glitch. - ) - { - entityPlayer.rotationYaw = rotationYaw; - entityPlayer.rotationPitch = rotationPitch; - setEating(false); - if (MoCreatures.isServer()) {entityPlayer.mountEntity(this);} - gestationTime = 0; - return true; + ) + { + if (entityPlayer.isSneaking() && getIsChestedHorse()) + { + // if first time opening horse chest, we must initialize it + if (localHorseChest == null) + { + localHorseChest = new MoCAnimalChest(StatCollector.translateToLocal("container.MoCreatures.HorseChest"), getInventorySize());// , new + } + // only open this chest on server side + if (!worldObj.isRemote) + { + entityPlayer.displayGUIChest(localHorseChest); + } + return true; + } + else if + ( + !(entityPlayer.isSneaking()) && getIsRideable() && getIsAdult() && (riddenByEntity == null) + && !(isFlyer() && entityPlayer.riddenByEntity != null) //stops players from riding a flying horse with a creature picked up or on their head. This fixes the flying speed glitch. + ) + { + entityPlayer.rotationYaw = rotationYaw; + entityPlayer.rotationPitch = rotationPitch; + setEating(false); + if (MoCreatures.isServer()) {entityPlayer.mountEntity(this);} + gestationTime = 0; + return true; + } } return false; diff --git a/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityOstrich.java b/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityOstrich.java index 3d1028f..13fa8e4 100644 --- a/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityOstrich.java +++ b/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityOstrich.java @@ -518,6 +518,15 @@ public void onLivingUpdate() { super.onLivingUpdate(); + if ( + getType() == 8 //unihorn ostrich + && (getHealth() < getMaxHealth()) + && rand.nextInt(100) == 0 + ) + { + heal(1); + } + if (getIsTamed() && MoCreatures.isServer() && (rand.nextInt(300) == 0) && (getHealth() <= getMaxHealth()) && (deathTime == 0)) { setHealth(getHealth() + 1); @@ -736,26 +745,10 @@ public boolean interact(EntityPlayer entityPlayer) entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, null); } - entityPlayer.inventory.addItemStackToInventory(new ItemStack(MoCreatures.key)); setIsChested(true); entityPlayer.addStat(MoCAchievements.ostrich_chest, 1); return true; } - - if ((item == MoCreatures.key) && getIsChested()) - { - // if first time opening horse chest, we must initialize it - if (localChest == null) - { - localChest = new MoCAnimalChest(StatCollector.translateToLocal("container.MoCreatures.OstrichChest"), 9); - } - // only open this chest on server side - if (MoCreatures.isServer()) - { - entityPlayer.displayGUIChest(localChest); - } - return true; - } if (interactIfPlayerIsHoldingWearableHelmet(entityPlayer, item)) {return true;}; } @@ -778,18 +771,41 @@ else if (getType() == 2 && item == Items.melon_seeds) //breeding item (MoCreatures.proxy.emptyHandMountAndPickUpOnly && itemStack == null) || (!(MoCreatures.proxy.emptyHandMountAndPickUpOnly)) ) - && !(entityPlayer.isSneaking()) && getIsRideable() && getIsAdult() && (riddenByEntity == null) ) { - entityPlayer.rotationYaw = rotationYaw; - entityPlayer.rotationPitch = rotationPitch; - setHiding(false); - - if (!worldObj.isRemote && (riddenByEntity == null || riddenByEntity == entityPlayer)) - { - entityPlayer.mountEntity(this); - } - return true; + if (entityPlayer.isSneaking() && getIsChested()) + { + // if first time opening horse chest, we must initialize it + if (localChest == null) + { + localChest = new MoCAnimalChest(StatCollector.translateToLocal("container.MoCreatures.OstrichChest"), 9); + } + // only open this chest on server side + if (MoCreatures.isServer()) + { + entityPlayer.displayGUIChest(localChest); + } + return true; + } + + else if + ( + !(entityPlayer.isSneaking()) + && getIsRideable() + && getIsAdult() + && (riddenByEntity == null) + ) + { + entityPlayer.rotationYaw = rotationYaw; + entityPlayer.rotationPitch = rotationPitch; + setHiding(false); + + if (!worldObj.isRemote && (riddenByEntity == null || riddenByEntity == entityPlayer)) + { + entityPlayer.mountEntity(this); + } + return true; + } } return false; } diff --git a/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityWyvern.java b/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityWyvern.java index e09c79f..389b561 100644 --- a/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityWyvern.java +++ b/src/main/java/drzhark/mocreatures/entity/animal/MoCEntityWyvern.java @@ -405,27 +405,11 @@ public boolean interact(EntityPlayer entityPlayer) entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, null); } - entityPlayer.inventory.addItemStackToInventory(new ItemStack(MoCreatures.key)); setIsChested(true); playSound("mob.chicken.plop", 1.0F, ((rand.nextFloat() - rand.nextFloat()) * 0.2F) + 1.0F); return true; } - if ((item == MoCreatures.key) && getIsChested()) - { - // if first time opening horse chest, we must initialize it - if (localchest == null) - { - localchest = new MoCAnimalChest(StatCollector.translateToLocal("container.MoCreatures.WyvernChest"), 14);// - } - // only open this chest on server side - if (MoCreatures.isServer()) - { - entityPlayer.displayGUIChest(localchest); - } - return true; - } - if ((item == MoCreatures.essenceLight) && getMoCAge() > 90 && getType() < 5) // wyvern types below 5: Jungle, Swamp, Savanna, Sand { if (--itemStack.stackSize == 0) @@ -516,11 +500,32 @@ public boolean interact(EntityPlayer entityPlayer) (MoCreatures.proxy.emptyHandMountAndPickUpOnly && itemStack == null) || (!(MoCreatures.proxy.emptyHandMountAndPickUpOnly)) ) - && !(entityPlayer.isSneaking()) && getIsRideable() && getMoCAge() > 90 && (riddenByEntity == null) - && entityPlayer.riddenByEntity == null //stops players from riding a wyvern with a creature picked up or on their head. This fixes the flying speed glitch. ) { - if (MoCreatures.isServer()) + if (entityPlayer.isSneaking() && getIsChested()) + { + // if first time opening horse chest, we must initialize it + if (localchest == null) + { + localchest = new MoCAnimalChest(StatCollector.translateToLocal("container.MoCreatures.WyvernChest"), 14);// + } + // only open this chest on server side + if (MoCreatures.isServer()) + { + entityPlayer.displayGUIChest(localchest); + } + return true; + } + + else if + ( + !(entityPlayer.isSneaking()) + && getIsRideable() + && getMoCAge() > 90 + && (riddenByEntity == null) + && entityPlayer.riddenByEntity == null //stops players from riding a wyvern with a creature picked up or on their head. This fixes the flying speed glitch. + && MoCreatures.isServer() + ) { entityPlayer.rotationYaw = rotationYaw; entityPlayer.rotationPitch = rotationPitch; diff --git a/src/main/resources/Rozmirs modifications to Mo Creatures.txt b/src/main/resources/Rozmirs modifications to Mo Creatures.txt index c6acece..46e14f8 100644 --- a/src/main/resources/Rozmirs modifications to Mo Creatures.txt +++ b/src/main/resources/Rozmirs modifications to Mo Creatures.txt @@ -1501,4 +1501,16 @@ Added kitty breeder, dolphin tamer, and goat milker achievements. Changed icon of ostrich helmet achievement. -Horses that are purely made from essences of light (pegasus, unicorn, and fairy horse) now have slow passive regeneration to make up for them only able to be healed using essences of light which is expensive. \ No newline at end of file +Horses that are purely made from essences of light (pegasus, unicorn, and fairy horse) now have slow passive regeneration to make up for them only able to be healed using essences of light which is expensive. + + +Removed the requirement of needing to use a key to open chests on elephants, horses, ostrich, and wyverns. Now players only need to right click while sneaking to open the chest. This is also now affected by the emptyHandPickUpAndMount config setting. + + +Unihorn ostriches also now have passive regeneration like light essence horses. + + +Fixed title of Unihorned Ostrich achievement. + + +Updated various achievement descriptions. \ No newline at end of file diff --git a/src/main/resources/assets/mocreatures/lang/en_US.lang b/src/main/resources/assets/mocreatures/lang/en_US.lang index ce689c2..cd4f38f 100644 --- a/src/main/resources/assets/mocreatures/lang/en_US.lang +++ b/src/main/resources/assets/mocreatures/lang/en_US.lang @@ -343,14 +343,14 @@ achievement.essence_undead=Essence of Undead achievement.essence_undead.desc=Craft an essence of undead. achievement.undead_horse=Undead Horse -achievement.undead_horse.desc=Obtain an undead horse by feeding a pet zorse or special horse with an essence of undead. Riders of this horse will be ignored by undead mobs under 50 HP. This horse can only be healed using essences of undead. +achievement.undead_horse.desc=Obtain an undead horse by feeding a pet zorse or special horse with an essence of undead. Riders of this horse will be ignored by undead mobs under 50 HP. This horse can be healed using essences of undead. achievement.amulet_bone=Skeleton Horse Storage achievement.amulet_bone.desc=Craft a bone amulet. achievement.ghost_horse=Ghost Horse -achievement.ghost_horse.desc=Obtain a pet ghost horse. Sometimes when a tier 3+ horse dies, it might become a ghost horse. Riders of this horse will be ignored by undead mobs under 50 HP. This horse can only be healed using essences of undead. +achievement.ghost_horse.desc=Obtain a pet ghost horse. Sometimes when a tier 3+ horse dies, it might become a ghost horse. Riders of this horse will be ignored by undead mobs under 50 HP. This horse can be healed using essences of undead. achievement.amulet_ghost=Ghost Horse Storage achievement.amulet_ghost.desc=Craft a ghost amulet. @@ -362,7 +362,7 @@ achievement.essence_fire=Essence of Fire achievement.essence_fire.desc=Craft an essence of fire. achievement.nightmare_horse=Nightmare Horse -achievement.nightmare_horse.desc=Obtain a nightmare horse by feeding a pet zorse with an essence of fire. This horse is fire-proof. This horse can only be healed using essences of fire. +achievement.nightmare_horse.desc=Obtain a nightmare horse by feeding a pet zorse with an essence of fire. This horse is fire-proof. This horse can be healed using essences of fire. achievement.heart_darkness=Heart of Darkness achievement.heart_darkness.desc=Obtain a heart of darkness from a bat horse mob. @@ -371,7 +371,7 @@ achievement.essence_darkness=Essence of Darkness achievement.essence_darkness.desc=Craft an essence of darkness. achievement.bat_horse=Bat Horse -achievement.bat_horse.desc=Obtain a bat horse by feeding a pet zorse with an essence of darkness. This horse can fly. This horse can only be healed using essences of darkness. +achievement.bat_horse.desc=Obtain a bat horse by feeding a pet zorse with an essence of darkness. This horse can fly. This horse can be healed using essences of darkness. achievement.crystal_horse_armor=Crystal Horse Armor achievement.crystal_horse_armor.desc=Craft crystal horse armor. This is the strongest horse armor, and it can only be worn by special horses. @@ -380,19 +380,19 @@ achievement.essence_light=Essence of Light achievement.essence_light.desc=Craft an essence of light by combining the three base essences. achievement.pegasus=Pegasus -achievement.pegasus.desc=Obtain a pegasus by feeding a pet bat horse with an essence of light while it is above y level 150. This horse can fly and can carry a chest. This horse can only be healed using essences of light. +achievement.pegasus.desc=Obtain a pegasus by feeding a pet bat horse with an essence of light while it is above y level 150. This horse can fly, regenerate and can carry a chest. This horse can be healed using essences of light. achievement.unicorn=Unicorn -achievement.unicorn.desc=Obtain a unicorn by feeding a pet nightmare horse with an essence of light. This horse can ram, and glide. This horse can only be healed using essences of light. +achievement.unicorn.desc=Obtain a unicorn by feeding a pet nightmare horse with an essence of light. This horse can regenerate, ram, and glide. This horse can be healed using essences of light. achievement.amulet_sky=Pegasus Storage achievement.amulet_sky.desc=Craft a sky amulet. The fire for the amulet's crafting recipie can be obtained from hell rats. achievement.dark_pegasus=Dark Pegasus -achievement.dark_pegasus.desc=Obtain a dark pegasus by feeding a pet pegasus with an essence of darkness. This is the strongest horse, it also fire-proof, can fly, and can carry a chest. This horse can only be healed using essences of light. +achievement.dark_pegasus.desc=Obtain a dark pegasus by feeding a pet pegasus with an essence of darkness. This is the strongest horse, it also fire-proof, can fly, and can carry a chest. This horse can be healed using essences of light. achievement.fairy_horse=Fairy Horse! -achievement.fairy_horse.desc=Obtain a fairy horse by breeding a pegasus with a unicorn using essences of light. This is the fastest flying horse, it can also carry a chest, and it can ram when on the ground. Feed this horse a dye to permanently change it's fairy type. This horse can only be healed using essences of light. +achievement.fairy_horse.desc=Obtain a fairy horse by breeding a pegasus with a unicorn using essences of light. This is the fastest flying horse, it can also regenerate, carry a chest, and ram when on the ground. Feed this horse a dye to permanently change it's fairy type. This horse can be healed using essences of light. achievement.amulet_fairy=Fairy Horse Storage achievement.amulet_fairy.desc=Craft a fairy amulet. The fire for the amulet's crafting recipie can be obtained from hell rats. @@ -497,16 +497,16 @@ achievement.ostrich_flag=Flag Bearer achievement.ostrich_flag.desc=Put any wool block on an ostrich that is carrying a chest. achievement.wyvern_ostrich=Wyvern Ostrich -achievement.wyvern_ostrich.desc=Obtain an wyvern ostrich by feeding an adult pet ostrich with an essence of darkness. This ostrich can fly thrust. This ostrich can only be healed using essences of darkness. +achievement.wyvern_ostrich.desc=Obtain an wyvern ostrich by feeding an adult pet ostrich with an essence of darkness. This ostrich can fly thrust. This ostrich can be healed using essences of darkness. achievement.undead_ostrich=Undead Ostrich -achievement.undead_ostrich.desc=Obtain an undead ostrich by feeding an adult pet ostrich with an essence of undead. Riders of this ostrich will be ignored by undead mobs under 50 HP. This ostrich can only be healed using essences of undead. +achievement.undead_ostrich.desc=Obtain an undead ostrich by feeding an adult pet ostrich with an essence of undead. Riders of this ostrich will be ignored by undead mobs under 50 HP. This ostrich can be healed using essences of undead. -achievement.unihorn_ostrich=Unihorn Ostrich -achievement.unihorn_ostrich.desc=Obtain a unicorn by feeding an adult pet ostrich with an essence of light. This ostrich can ram. This ostrich can only be healed using essences of light. +achievement.unihorn_ostrich=Unihorned Ostrich +achievement.unihorn_ostrich.desc=Obtain a unihorned ostrich by feeding an adult pet ostrich with an essence of light. This ostrich can regenerate and ram. This ostrich can be healed using essences of light. achievement.nether_ostrich=Nether Ostrich -achievement.nether_ostrich.desc=Obtain a nether ostrich by feeding an adult pet ostrich with an essence of fire. This ostrich can fly hop. This ostrich can only be healed using essences of fire. +achievement.nether_ostrich.desc=Obtain a nether ostrich by feeding an adult pet ostrich with an essence of fire. This ostrich can fly hop. This ostrich can be healed using essences of fire. achievement.tame_dolphin=Dolphin Tamer achievement.tame_dolphin.desc=Tame an adult dolphin by riding them. Dolphins protect riders from sharks and can jump near the water surface. Dolphin breeds vary in speed and jump power, and adults can be bred using fish.