Add setName and setNameVisible to PlayerWatcher
This commit is contained in:
		
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							| @@ -5,7 +5,7 @@ | |||||||
|     <!-- A good example on why temporary names for project identification shouldn't be used --> |     <!-- A good example on why temporary names for project identification shouldn't be used --> | ||||||
|     <groupId>LibsDisguises</groupId> |     <groupId>LibsDisguises</groupId> | ||||||
|     <artifactId>LibsDisguises</artifactId> |     <artifactId>LibsDisguises</artifactId> | ||||||
|     <version>10.0.5</version> |     <version>10.0.5-SNAPSHOT</version> | ||||||
|  |  | ||||||
|     <build> |     <build> | ||||||
|         <defaultGoal>exec:java clean install</defaultGoal> |         <defaultGoal>exec:java clean install</defaultGoal> | ||||||
|   | |||||||
| @@ -29,6 +29,24 @@ public class PlayerWatcher extends LivingWatcher { | |||||||
|         alwaysShowInTab = showPlayerInTab; |         alwaysShowInTab = showPlayerInTab; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public boolean isNameVisible() { | ||||||
|  |         return ((PlayerDisguise) getDisguise()).isNameVisible(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setNameVisible(boolean nameVisible) { | ||||||
|  |         ((PlayerDisguise) getDisguise()).setNameVisible(nameVisible); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @RandomDefaultValue | ||||||
|  |     public String getName() { | ||||||
|  |         return ((PlayerDisguise) getDisguise()).getName(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @RandomDefaultValue | ||||||
|  |     public void setName(String name) { | ||||||
|  |         ((PlayerDisguise) getDisguise()).setName(name); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PlayerWatcher clone(Disguise disguise) { |     public PlayerWatcher clone(Disguise disguise) { | ||||||
|         PlayerWatcher watcher = (PlayerWatcher) super.clone(disguise); |         PlayerWatcher watcher = (PlayerWatcher) super.clone(disguise); | ||||||
|   | |||||||
| @@ -144,9 +144,7 @@ public class ParamInfoManager { | |||||||
|  |  | ||||||
|         if (watcherClass == PlayerWatcher.class) { |         if (watcherClass == PlayerWatcher.class) { | ||||||
|             try { |             try { | ||||||
|                 methods.add(PlayerDisguise.class.getMethod("setNameVisible", boolean.class)); |  | ||||||
|                 methods.add(PlayerDisguise.class.getMethod("setDynamicName", boolean.class)); |                 methods.add(PlayerDisguise.class.getMethod("setDynamicName", boolean.class)); | ||||||
|                 methods.add(PlayerDisguise.class.getMethod("setName", String.class)); |  | ||||||
|             } |             } | ||||||
|             catch (NoSuchMethodException e) { |             catch (NoSuchMethodException e) { | ||||||
|                 e.printStackTrace(); |                 e.printStackTrace(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user