Skip to content

Commit

Permalink
Added more achievements + Minor Fixes/Additions
Browse files Browse the repository at this point in the history
Fixed Wyvern Ostrich and Nether Ostrich feet in 16x texture.

Fixed predators making eating sounds and destroying own drops when killed.

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.
  • Loading branch information
Rozmir-Rohi committed Jan 9, 2025
1 parent fd56dc2 commit 2385fd4
Show file tree
Hide file tree
Showing 20 changed files with 118 additions and 40 deletions.
3 changes: 0 additions & 3 deletions src/main/java/drzhark/mocreatures/MoCEventHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import drzhark.mocreatures.entity.IMoCTameable;
import drzhark.mocreatures.entity.MoCEntityAquatic;
import drzhark.mocreatures.entity.ambient.MoCEntityBee;
import drzhark.mocreatures.entity.animal.MoCEntityHorse;
import drzhark.mocreatures.entity.animal.MoCEntityKitty;
import drzhark.mocreatures.entity.animal.MoCEntityOstrich;
import drzhark.mocreatures.entity.animal.MoCEntityPetScorpion;
import drzhark.mocreatures.entity.witchery_integration.MoCEntityWerewolfVillagerWitchery;
import drzhark.mocreatures.entity.witchery_integration.MoCEntityWerewolfWitchery;
import net.minecraft.block.Block;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/drzhark/mocreatures/MoCreatures.java
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ public class MoCreatures {
public static Item achievementIconTameBigCat;
public static Item achievementIconTameKitty;
public static Item achievementIconKittyBed;
public static Item achievementIconBreedKitty;


public static Item achievementIconTameBird;
Expand All @@ -434,6 +435,8 @@ public class MoCreatures {
public static Item achievementIconUndeadOstrich;
public static Item achievementIconUnihornOstrich;

public static Item achievementIconTameDolphin;

public static Item spawnEgg;

static int entitySpawnEggSubId = mocEntityID;
Expand Down Expand Up @@ -1105,6 +1108,7 @@ protected void InitItems()
achievementIconTameBigCat = new MoCItem("achievement_icon_tame_big_cat");
achievementIconTameKitty = new MoCItem("achievement_icon_tame_kitty");
achievementIconKittyBed = new MoCItem("achievement_icon_kitty_bed");
achievementIconBreedKitty = new MoCItem("achievement_icon_breed_kitty");
achievementIconTameBird = new MoCItem("achievement_icon_tame_bird");
achievementIconFeedSnakeWithLiveMouse = new MoCItem("achievement_icon_feed_snake_with_live_mouse");
achievementIconTamePanda = new MoCItem("achievement_icon_tame_panda");
Expand All @@ -1119,7 +1123,9 @@ protected void InitItems()
achievementIconUndeadOstrich = new MoCItem("achievement_icon_undead_ostrich");
achievementIconUnihornOstrich = new MoCItem("achievement_icon_unihorn_ostrich");

achievementIconTameDolphin = new MoCItem("achievement_icon_tame_dolphin");


//new blocks
mocStone = new MoCBlockStone("MoCStone").setHardness(1.5F).setResistance(10.0F).setStepSound(Block.soundTypeStone);
mocGrass = new MoCBlockGrass("MoCGrass").setHardness(0.5F).setStepSound(Block.soundTypeGrass);
Expand Down
42 changes: 28 additions & 14 deletions src/main/java/drzhark/mocreatures/achievements/MoCAchievements.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import cpw.mods.fml.common.FMLCommonHandler;
import drzhark.mocreatures.MoCreatures;
import drzhark.mocreatures.item.MoCItem;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.stats.AchievementList;
Expand Down Expand Up @@ -81,6 +81,7 @@ public class MoCAchievements {
public static Achievement kitty_litter;
public static Achievement kitty_bed;
public static Achievement pet_food;
public static Achievement breed_kitty;
public static Achievement wool_ball;

public static Achievement tame_big_cat;
Expand Down Expand Up @@ -110,9 +111,12 @@ public class MoCAchievements {
public static Achievement undead_ostrich;
public static Achievement unihorn_ostrich;

public static Achievement tame_dolphin;


public static Achievement pet_amulet;

public static Achievement milk_goat;
public static Achievement cook_omelette;
public static Achievement cook_turkey;
public static Achievement cook_ostrich;
Expand Down Expand Up @@ -220,9 +224,11 @@ public static void initilization()
tame_kitty = new Achievement("achievement.tame_kitty", "tame_kitty", 4, 6, new ItemStack(MoCreatures.achievementIconTameKitty), craft_medallion).registerStat();
kitty_litter_box = new Achievement("achievement.kitty_litter_box", "kitty_litter_box", 3, 8, new ItemStack(MoCreatures.litterbox), tame_kitty).registerStat();
kitty_litter = new Achievement("achievement.kitty_litter", "kitty_litter", 3, 10, new ItemStack(Blocks.sand), kitty_litter_box).registerStat();
kitty_bed = new Achievement("achievement.kitty_bed", "kitty_bed", 4, 8, new ItemStack(MoCreatures.achievementIconKittyBed), tame_kitty).registerStat();
pet_food = new Achievement("achievement.pet_food", "pet_food", 4, 10, new ItemStack(MoCreatures.petFood), kitty_bed).registerStat();
wool_ball = new Achievement("achievement.wool_ball", "wool_ball", 5, 8, new ItemStack(MoCreatures.woolball), tame_kitty).registerStat();
wool_ball = new Achievement("achievement.wool_ball", "wool_ball", 4, 8, new ItemStack(MoCreatures.woolball), tame_kitty).registerStat();
kitty_bed = new Achievement("achievement.kitty_bed", "kitty_bed", 5, 8, new ItemStack(MoCreatures.achievementIconKittyBed), tame_kitty).registerStat();
pet_food = new Achievement("achievement.pet_food", "pet_food", 5, 10, new ItemStack(MoCreatures.petFood), kitty_bed).registerStat();
breed_kitty = new Achievement("achievement.breed_kitty", "breed_kitty", 7, 8, new ItemStack(MoCreatures.achievementIconBreedKitty), kitty_bed).registerStat();


tame_big_cat = new Achievement("achievement.tame_big_cat", "tame_big_cat", 0, 6, new ItemStack(MoCreatures.achievementIconTameBigCat), craft_medallion).registerStat();

Expand Down Expand Up @@ -250,22 +256,25 @@ public static void initilization()
tame_scorpion = new Achievement("achievement.tame_scorpion", "tame_scorpion", -13, 2, new ItemStack(MoCreatures.achievementIconTameScorpion), (Achievement)null).initIndependentStat().registerStat();

ostrich_egg = new Achievement("achievement.ostrich_egg", "ostrich_egg", -15, 2, new ItemStack(MoCreatures.mocegg), (Achievement)null).initIndependentStat().registerStat();
ostrich_helmet = new Achievement("achievement.ostrich_helmet", "ostrich_helmet", -17, 4, new ItemStack(MoCreatures.achievementIconOstrichHelmet), ostrich_egg).registerStat();
ostrich_chest = new Achievement("achievement.ostrich_chest", "ostrich_chest", -13, 4, new ItemStack(MoCreatures.achievementIconOstrichChest), ostrich_egg).registerStat();
ostrich_flag = new Achievement("achievement.ostrich_flag", "ostrich_flag", -11, 4, new ItemStack(MoCreatures.achievementIconOstrichFlag), ostrich_chest).registerStat();
ostrich_helmet = new Achievement("achievement.ostrich_helmet", "ostrich_helmet", -16, 4, new ItemStack(MoCreatures.achievementIconOstrichHelmet), ostrich_egg).registerStat();
ostrich_chest = new Achievement("achievement.ostrich_chest", "ostrich_chest", -14, 4, new ItemStack(MoCreatures.achievementIconOstrichChest), ostrich_egg).registerStat();
ostrich_flag = new Achievement("achievement.ostrich_flag", "ostrich_flag", -12, 4, new ItemStack(MoCreatures.achievementIconOstrichFlag), ostrich_chest).registerStat();

tame_dolphin = new Achievement("achievement.tame_dolphin", "tame_dolphin", -17, 2, new ItemStack(MoCreatures.achievementIconTameDolphin), (Achievement)null).initIndependentStat().registerStat();

wyvern_ostrich = new Achievement("achievement.wyvern_ostrich", "wyvern_ostrich", -14, 6, new ItemStack(MoCreatures.achievementIconWyvernOstrich), ostrich_egg).registerStat();
undead_ostrich = new Achievement("achievement.undead_ostrich", "undead_ostrich", -14, 7, new ItemStack(MoCreatures.achievementIconUndeadOstrich), ostrich_egg).registerStat();
unihorn_ostrich = new Achievement("achievement.unihorn_ostrich", "unihorn_ostrich", -16, 7, new ItemStack(MoCreatures.achievementIconUnihornOstrich), ostrich_egg).registerStat();
nether_ostrich = new Achievement("achievement.nether_ostrich", "nether_ostrich", -16, 6, new ItemStack(MoCreatures.achievementIconNetherOstrich), ostrich_egg).registerStat();

cook_omelette = new Achievement("achievement.cook_omelette", "cook_omelette", -7, -1, new ItemStack(MoCreatures.omelet), AchievementList.buildFurnace).registerStat();
cook_turkey = new Achievement("achievement.cook_turkey", "cook_turkey", -7, 0, new ItemStack(MoCreatures.turkeyCooked), AchievementList.buildFurnace).registerStat();
cook_ostrich = new Achievement("achievement.cook_ostrich", "cook_ostrich", -8, -1, new ItemStack(MoCreatures.ostrichCooked), AchievementList.buildFurnace).registerStat();
cook_rat = new Achievement("achievement.cook_rat", "cook_rat", -9, -1, new ItemStack(MoCreatures.ratCooked), AchievementList.buildFurnace).registerStat();
rat_burger = new Achievement("achievement.rat_burger", "rat_burger", -11, -1, new ItemStack(MoCreatures.ratBurger), cook_rat).registerStat();
cook_crab = new Achievement("achievement.cook_crab", "cook_crab", -8, 0, new ItemStack(MoCreatures.crabCooked), AchievementList.buildFurnace).registerStat();
cook_turtle = new Achievement("achievement.cook_turtle", "cook_turtle", -9, 0, new ItemStack(MoCreatures.turtleSoup), AchievementList.buildSword).registerStat();
milk_goat = new Achievement("achievement.milk_goat", "milk_goat", -7, 0, new ItemStack(Items.milk_bucket), (Achievement)null).initIndependentStat().registerStat();
cook_omelette = new Achievement("achievement.cook_omelette", "cook_omelette", -8, -1, new ItemStack(MoCreatures.omelet), AchievementList.buildFurnace).registerStat();
cook_turkey = new Achievement("achievement.cook_turkey", "cook_turkey", -8, 0, new ItemStack(MoCreatures.turkeyCooked), AchievementList.buildFurnace).registerStat();
cook_ostrich = new Achievement("achievement.cook_ostrich", "cook_ostrich", -9, -1, new ItemStack(MoCreatures.ostrichCooked), AchievementList.buildFurnace).registerStat();
cook_rat = new Achievement("achievement.cook_rat", "cook_rat", -10, -1, new ItemStack(MoCreatures.ratCooked), AchievementList.buildFurnace).registerStat();
rat_burger = new Achievement("achievement.rat_burger", "rat_burger", -12, -1, new ItemStack(MoCreatures.ratBurger), cook_rat).registerStat();
cook_crab = new Achievement("achievement.cook_crab", "cook_crab", -9, 0, new ItemStack(MoCreatures.crabCooked), AchievementList.buildFurnace).registerStat();
cook_turtle = new Achievement("achievement.cook_turtle", "cook_turtle", -10, 0, new ItemStack(MoCreatures.turtleSoup), AchievementList.buildSword).registerStat();


kill_wraith = new Achievement("achievement.kill_wraith", "kill_wraith", -7, -3, new ItemStack(MoCreatures.achievementIconKillWraith), AchievementList.buildSword).registerStat();
Expand Down Expand Up @@ -352,6 +361,7 @@ public static void initilization()
kitty_litter,
kitty_bed,
pet_food,
breed_kitty,
wool_ball,

tame_big_cat,
Expand All @@ -369,6 +379,7 @@ public static void initilization()
tame_bird,
feed_snake_with_live_mouse,
tame_panda,

tame_scorpion,
ostrich_egg,
ostrich_helmet,
Expand All @@ -380,8 +391,11 @@ public static void initilization()
unihorn_ostrich,
nether_ostrich,

tame_dolphin,

pet_amulet,

milk_goat,
cook_omelette,
cook_turkey,
cook_ostrich,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.DimensionManager;

public class CommandMoCTP extends CommandBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import drzhark.mocreatures.entity.IMoCTameable;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandNotFoundException;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.NumberInvalidException;
import net.minecraft.command.WrongUsageException;
Expand All @@ -30,7 +29,6 @@
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.DimensionManager;

public class CommandMoCreatures extends CommandBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ public void onLivingUpdate()
MoCTools.forceDataSync(this);
}

if (isPredator() && hasKilledPrey)
if (
isPredator()
&& hasKilledPrey
&& getHealth() > 0 //fixes predators destroying own drops when they are killed
)
{
if (MoCreatures.proxy.destroyDrops) //destroy the drops of the prey
{
Expand Down Expand Up @@ -332,6 +336,7 @@ public void onLivingUpdate()

if (
doesForageForFood()
&& getHealth() > 0 //fixes predators making eating sound they are killed
&& !isMovementCeased()
&& (getHealth() < getMaxHealth() || !isPredator() || !getIsAdult())
&& riddenByEntity == null
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/drzhark/mocreatures/entity/MoCEntityAquatic.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import drzhark.mocreatures.MoCTools;
import drzhark.mocreatures.MoCreatures;
import drzhark.mocreatures.achievements.MoCAchievements;
import drzhark.mocreatures.entity.aquatic.MoCEntityDolphin;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
Expand All @@ -21,7 +22,6 @@
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
Expand Down Expand Up @@ -379,16 +379,21 @@ public void moveEntityWithHeading(float strafe, float forward)
{
setIsJumping(false);
}
if (MoCreatures.isServer() && this instanceof IMoCTameable)
if (MoCreatures.isServer() && this instanceof IMoCTameable)
{
int tameChance = (getMaxTemper() - getTemper());
if (tameChance <= 0)
{
tameChance = 1;
}
if (rand.nextInt(tameChance * 8) == 0)
{
{
MoCTools.tameWithName((EntityPlayer) riddenByEntity, (IMoCTameable) this);

if (this instanceof MoCEntityDolphin)
{
((EntityPlayer) riddenByEntity).addStat(MoCAchievements.tame_dolphin, 1);
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,6 @@ public EntityCreature getMastersEnemy(EntityPlayer entityPlayer, double d)
@Override
public boolean interact(EntityPlayer entityPlayer)
{

if (super.interact(entityPlayer)) { return false; }

ItemStack itemStack = entityPlayer.getHeldItem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cpw.mods.fml.common.registry.GameRegistry;
import drzhark.mocreatures.MoCTools;
import drzhark.mocreatures.MoCreatures;
import drzhark.mocreatures.achievements.MoCAchievements;
import drzhark.mocreatures.entity.MoCEntityTameableAnimal;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
Expand Down Expand Up @@ -610,6 +611,7 @@ public boolean interact(EntityPlayer entityPlayer)
if (getType() == 1) { return false; }

entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, new ItemStack(Items.milk_bucket));
entityPlayer.addStat(MoCAchievements.milk_goat, 1);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2400,6 +2400,15 @@ public void onDeath(DamageSource damageSource)
@Override
public void onLivingUpdate()
{
if (
isHorsePurelyMadeFromEssenseOfLight()
&& (getHealth() < getMaxHealth())
&& rand.nextInt(100) == 0
)
{
heal(1);
}

if (entityToAttack != null && entityToAttack == riddenByEntity)
{
if (!(riddenByEntity instanceof EntityPlayer && riddenByEntity.getCommandSenderName().equals(getOwnerName()))) //if not the owner of this entity
Expand Down Expand Up @@ -2672,7 +2681,19 @@ else if ((type == 61) && owner != null) //zorse

}

/**
private boolean isHorsePurelyMadeFromEssenseOfLight()
{
int horseType = getType();

return
(
horseType == 36 //pure unicorn
|| horseType == 39 //pure pegasus
|| isFairyHorse() //fairy horse
);
}

/**
* Obtains the 'Type' of vanilla horse for inbreeding with MoC Horses
* @param horse
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,10 @@ public void onLivingUpdate()
entityToAttack = entityNearby;
((MoCEntityKitty) entityNearby).changeKittyStateTo(KITTY_STATE_IN_LOVE_STAGE_TWO);
((MoCEntityKitty) entityNearby).entityToAttack = this;

EntityPlayer player = worldObj.getClosestPlayerToEntity(this, 8D);
if (player != null) {player.addStat(MoCAchievements.breed_kitty, 1);}

break;
}
minimumListSize++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ public double getCustomSpeed()
case 1: //blue
return 1.2D;

case 2: //light blue
case 2: //teal
return 1.4D;

case 3: //pinkish blue
case 3: //purple
return 1.8D;

case 4: //black
Expand All @@ -180,10 +180,10 @@ public double getCustomDolphinJump()
case 1: //blue
return 1.0D;

case 2: //light blue
case 2: //teal
return 1.1D;

case 3: //pinkish blue
case 3: //purple
return 1.2D;

case 4: //black
Expand Down Expand Up @@ -524,8 +524,7 @@ public void onLivingUpdate()
super.onLivingUpdate();

if (MoCreatures.isServer())
{

{
if (!getIsAdult() && (rand.nextInt(50) == 0))
{
setMoCAge(getMoCAge() + 1);
Expand All @@ -539,7 +538,7 @@ public void onLivingUpdate()
setIsHungry(true);
}

if (!ReadyforParenting(this)) { return; }
if (!isReadyforParenting(this)) { return; }

int amountOfOtherDolphinsNearby = 0;

Expand Down Expand Up @@ -570,7 +569,7 @@ public void onLivingUpdate()

MoCEntityDolphin entityDolphinNearby = (MoCEntityDolphin) entityNearby1;

if (!ReadyforParenting(this) || !ReadyforParenting(entityDolphinNearby))
if (!isReadyforParenting(this) || !isReadyforParenting(entityDolphinNearby))
{
continue;
}
Expand Down Expand Up @@ -639,9 +638,15 @@ public boolean isMyHealFood(ItemStack itemStack)
return false;
}

public boolean ReadyforParenting(MoCEntityDolphin entitydolphin)
public boolean isReadyforParenting(MoCEntityDolphin entityDolphin)
{
return (entitydolphin.riddenByEntity == null) && (entitydolphin.ridingEntity == null) && entitydolphin.getIsTamed() && entitydolphin.getHasEaten() && entitydolphin.getIsAdult();
return (
entityDolphin.riddenByEntity == null
&& entityDolphin.ridingEntity == null
&& entityDolphin.getIsTamed()
&& entityDolphin.getHasEaten()
&& entityDolphin.getIsAdult()
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import drzhark.mocreatures.achievements.MoCAchievements;
import drzhark.mocreatures.entity.MoCEntityMob;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.player.EntityPlayer;
Expand Down
Loading

0 comments on commit 2385fd4

Please sign in to comment.