-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ab3230
commit 59a20ff
Showing
6 changed files
with
74 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package lee.code.pets.pets.pet.animal; | ||
|
||
import lee.code.pets.pets.controllers.ControllerLookFlying; | ||
import lee.code.pets.pets.goals.FollowOwnerGoal; | ||
import lee.code.pets.utils.CoreUtil; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.server.level.ServerLevel; | ||
import net.minecraft.world.entity.AgeableMob; | ||
import net.minecraft.world.entity.EntityType; | ||
import net.minecraft.world.entity.animal.Animal; | ||
import org.bukkit.craftbukkit.v1_20_R1.CraftWorld; | ||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.entity.EntityTargetEvent; | ||
|
||
public class BeePet extends Animal { | ||
|
||
public BeePet(Player player, boolean baby, String name) { | ||
super(EntityType.BEE, ((CraftWorld) player.getLocation().getWorld()).getHandle()); | ||
setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()); | ||
setInvulnerable(true); | ||
setCustomNameVisible(true); | ||
setPersistenceRequired(true); | ||
setNoGravity(true); | ||
collides = false; | ||
setCustomName(Component.Serializer.fromJson(CoreUtil.serializeColorComponentJson(name))); | ||
setTarget(((CraftPlayer) player).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false); | ||
moveControl = new ControllerLookFlying(this, player.getUniqueId()); | ||
if (baby) setBaby(true); | ||
} | ||
|
||
@Override | ||
protected void registerGoals() { | ||
goalSelector.addGoal(0, new FollowOwnerGoal(this, 2)); | ||
} | ||
|
||
public AgeableMob getBreedOffspring(ServerLevel world, AgeableMob entity) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void ageUp(int age) { | ||
} | ||
|
||
@Override | ||
public void ageUp(int age, boolean overGrow) { | ||
} | ||
|
||
@Override | ||
public void load(CompoundTag compoundTag) { | ||
} | ||
|
||
@Override | ||
public boolean save(CompoundTag compoundTag) { | ||
return false; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ee/code/pets/pets/pet/tamable/CatPet.java → ...lee/code/pets/pets/pet/animal/CatPet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters