-
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
2f1ccee
commit dbb3533
Showing
6 changed files
with
179 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package lee.code.pets.pets.pet.mob; | ||
|
||
import lee.code.pets.pets.controllers.ControllerWASD; | ||
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.world.entity.EntityType; | ||
import net.minecraft.world.entity.monster.Creeper; | ||
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 CreeperPet extends Creeper { | ||
|
||
public CreeperPet(Player player, String name, boolean powered) { | ||
super(EntityType.CREEPER, ((CraftWorld) player.getLocation().getWorld()).getHandle()); | ||
setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()); | ||
setInvulnerable(true); | ||
setCustomNameVisible(true); | ||
setPersistenceRequired(true); | ||
collides = false; | ||
setCustomName(Component.Serializer.fromJson(CoreUtil.serializeColorComponentJson(name))); | ||
setTarget(((CraftPlayer) player).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false); | ||
moveControl = new ControllerWASD(this, player.getUniqueId()); | ||
setPowered(powered); | ||
} | ||
|
||
@Override | ||
protected void registerGoals() { | ||
goalSelector.addGoal(0, new FollowOwnerGoal(this, 2)); | ||
} | ||
|
||
@Override | ||
public void load(CompoundTag compoundTag) { | ||
} | ||
|
||
@Override | ||
public boolean save(CompoundTag compoundTag) { | ||
return false; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/lee/code/pets/pets/pet/mob/MagmaCubePet.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package lee.code.pets.pets.pet.mob; | ||
|
||
import lee.code.pets.pets.controllers.ControllerWASD; | ||
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.world.entity.EntityType; | ||
import net.minecraft.world.entity.monster.MagmaCube; | ||
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 MagmaCubePet extends MagmaCube { | ||
|
||
public MagmaCubePet(Player player, String name, String size) { | ||
super(EntityType.MAGMA_CUBE, ((CraftWorld) player.getLocation().getWorld()).getHandle()); | ||
setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()); | ||
setInvulnerable(true); | ||
setCustomNameVisible(true); | ||
setPersistenceRequired(true); | ||
collides = false; | ||
setCustomName(Component.Serializer.fromJson(CoreUtil.serializeColorComponentJson(name))); | ||
setTarget(((CraftPlayer) player).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false); | ||
moveControl = new ControllerWASD(this, player.getUniqueId()); | ||
setSize(Integer.parseInt(size), true); | ||
} | ||
|
||
@Override | ||
protected void registerGoals() { | ||
goalSelector.addGoal(0, new FollowOwnerGoal(this, 0.7)); | ||
} | ||
|
||
@Override | ||
public void load(CompoundTag compoundTag) { | ||
} | ||
|
||
@Override | ||
public boolean save(CompoundTag compoundTag) { | ||
return false; | ||
} | ||
} |
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,44 @@ | ||
package lee.code.pets.pets.pet.mob; | ||
|
||
import lee.code.pets.pets.controllers.ControllerWASD; | ||
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.world.entity.EntityType; | ||
import net.minecraft.world.entity.Mob; | ||
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 RavagerPet extends Mob { | ||
|
||
//TODO CONTROLLER WONT WORK | ||
|
||
public RavagerPet(Player player, String name) { | ||
super(EntityType.RAVAGER, ((CraftWorld) player.getLocation().getWorld()).getHandle()); | ||
setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()); | ||
setInvulnerable(true); | ||
setCustomNameVisible(true); | ||
setPersistenceRequired(true); | ||
collides = false; | ||
setCustomName(Component.Serializer.fromJson(CoreUtil.serializeColorComponentJson(name))); | ||
setTarget(((CraftPlayer) player).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false); | ||
moveControl = new ControllerWASD(this, player.getUniqueId()); | ||
} | ||
|
||
@Override | ||
protected void registerGoals() { | ||
goalSelector.addGoal(0, new FollowOwnerGoal(this, 2)); | ||
} | ||
|
||
@Override | ||
public void load(CompoundTag compoundTag) { | ||
} | ||
|
||
@Override | ||
public boolean save(CompoundTag compoundTag) { | ||
return false; | ||
} | ||
} |
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,43 @@ | ||
package lee.code.pets.pets.pet.mob; | ||
|
||
import lee.code.pets.pets.controllers.ControllerWASD; | ||
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.world.entity.EntityType; | ||
import net.minecraft.world.entity.monster.Slime; | ||
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 SlimePet extends Slime { | ||
|
||
public SlimePet(Player player, String name, String size) { | ||
super(EntityType.SLIME, ((CraftWorld) player.getLocation().getWorld()).getHandle()); | ||
setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()); | ||
setInvulnerable(true); | ||
setCustomNameVisible(true); | ||
setPersistenceRequired(true); | ||
collides = false; | ||
setCustomName(Component.Serializer.fromJson(CoreUtil.serializeColorComponentJson(name))); | ||
setTarget(((CraftPlayer) player).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false); | ||
moveControl = new ControllerWASD(this, player.getUniqueId()); | ||
setSize(Integer.parseInt(size), true); | ||
} | ||
|
||
@Override | ||
protected void registerGoals() { | ||
goalSelector.addGoal(0, new FollowOwnerGoal(this, 0.7)); | ||
} | ||
|
||
@Override | ||
public void load(CompoundTag compoundTag) { | ||
} | ||
|
||
@Override | ||
public boolean save(CompoundTag compoundTag) { | ||
return false; | ||
} | ||
} |