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
Showing
7 changed files
with
137 additions
and
5 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
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
50 changes: 50 additions & 0 deletions
50
v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/trait/FoxTrait.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,50 @@ | ||
package net.citizensnpcs.nms.v1_14_R1.trait; | ||
|
||
import org.bukkit.entity.Fox; | ||
|
||
import net.citizensnpcs.api.persistence.Persist; | ||
import net.citizensnpcs.api.trait.Trait; | ||
import net.citizensnpcs.api.trait.TraitName; | ||
|
||
@TraitName("foxtrait") | ||
public class FoxTrait extends Trait { | ||
@Persist | ||
private boolean crouching = false; | ||
@Persist | ||
private boolean sitting = false; | ||
@Persist | ||
private boolean sleeping = false; | ||
@Persist | ||
private Fox.Type type = Fox.Type.RED; | ||
|
||
public FoxTrait() { | ||
super("foxtrait"); | ||
} | ||
|
||
@Override | ||
public void run() { | ||
if (npc.isSpawned() && npc.getEntity() instanceof Fox) { | ||
Fox fox = (Fox) npc.getEntity(); | ||
fox.setSitting(sitting); | ||
fox.setCrouching(crouching); | ||
fox.setSleeping(sleeping); | ||
fox.setFoxType(type); | ||
} | ||
} | ||
|
||
public void setCrouching(boolean crouching) { | ||
this.crouching = crouching; | ||
} | ||
|
||
public void setSitting(boolean sitting) { | ||
this.sitting = sitting; | ||
} | ||
|
||
public void setSleeping(boolean sleeping) { | ||
this.sleeping = sleeping; | ||
} | ||
|
||
public void setType(Fox.Type type) { | ||
this.type = type; | ||
} | ||
} |
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