File tree Expand file tree Collapse file tree
src/main/java/de/ntcomputer/minecraft/controllablemobs/api/ai/behaviors Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 <modelVersion >4.0.0</modelVersion >
44 <groupId >de.ntcomputer</groupId >
55 <artifactId >controllable-mobs-api</artifactId >
6- <version >1.6.4 .6-SNAPSHOT</version >
6+ <version >1.7.2 .6-SNAPSHOT</version >
77 <name >Controllable Mobs API</name >
88 <url >http://dev.bukkit.org/bukkit-plugins/controllable-mobs-api/</url >
99
1010 <properties >
1111 <maven .compiler.source>1.6</maven .compiler.source>
1212 <maven .compiler.target>1.6</maven .compiler.target>
1313 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
14- <minecraft .version>1.6.4 </minecraft .version>
15- <minecraft_version >1_6_R3 </minecraft_version >
14+ <minecraft .version>1.7.2 </minecraft .version>
15+ <minecraft_version >1_7_R1 </minecraft_version >
1616 <github .global.server>github</github .global.server>
1717 </properties >
1818
Original file line number Diff line number Diff line change 1+ package de .ntcomputer .minecraft .controllablemobs .api .ai .behaviors ;
2+
3+ import net .minecraft .server .v1_7_R1 .EntityVillager ;
4+ import net .minecraft .server .v1_7_R1 .PathfinderGoal ;
5+ import net .minecraft .server .v1_7_R1 .PathfinderGoalTradeWithPlayer ;
6+
7+ import org .bukkit .entity .Villager ;
8+
9+ import de .ntcomputer .minecraft .controllablemobs .api .ai .AIType ;
10+ import de .ntcomputer .minecraft .controllablemobs .implementation .CraftControllableMob ;
11+
12+ /**
13+ * This AI behavior will mark a villager as trading with a player.
14+ *
15+ * @author DevCybran
16+ * @version 1.7.2.6
17+ *
18+ */
19+ public final class AIPlayerTrade extends AIBehavior <Villager > {
20+
21+ public AIPlayerTrade (int priority ) {
22+ super (priority );
23+ }
24+
25+ @ Override
26+ public AIType getType () {
27+ return AIType .ACTION_PLAYERTRADE ;
28+ }
29+
30+ @ Override
31+ public PathfinderGoal createPathfinderGoal (CraftControllableMob <? extends Villager > mob ) {
32+ return new PathfinderGoalTradeWithPlayer ((EntityVillager ) mob .nmsEntity );
33+ }
34+
35+ }
Original file line number Diff line number Diff line change 1+ package de .ntcomputer .minecraft .controllablemobs .api .ai .behaviors ;
2+
3+ import net .minecraft .server .v1_7_R1 .EntityVillager ;
4+ import net .minecraft .server .v1_7_R1 .PathfinderGoal ;
5+ import net .minecraft .server .v1_7_R1 .PathfinderGoalLookAtTradingPlayer ;
6+
7+ import org .bukkit .entity .Villager ;
8+
9+ import de .ntcomputer .minecraft .controllablemobs .api .ai .AIType ;
10+ import de .ntcomputer .minecraft .controllablemobs .implementation .CraftControllableMob ;
11+
12+ /**
13+ * This AI behavior will make a villager look at the player he is trading with (if any).
14+ *
15+ * @author DevCybran
16+ * @version 1.7.2.6
17+ *
18+ */
19+ public final class AIPlayerTradingLook extends AIBehavior <Villager > {
20+
21+ public AIPlayerTradingLook (int priority ) {
22+ super (priority );
23+ }
24+
25+ @ Override
26+ public AIType getType () {
27+ return AIType .ACTION_PLAYERTRADINGLOOK ;
28+ }
29+
30+ @ Override
31+ public PathfinderGoal createPathfinderGoal (CraftControllableMob <? extends Villager > mob ) {
32+ return new PathfinderGoalLookAtTradingPlayer ((EntityVillager ) mob .nmsEntity );
33+ }
34+
35+ }
You can’t perform that action at this time.
0 commit comments