Commits

Martoph authored and md_5 committed 2e13cff7448
#589: Expand the FishHook API
No tags

src/main/java/org/bukkit/entity/FishHook.java

Modified
1 1 package org.bukkit.entity;
2 2
3 3 import org.jetbrains.annotations.NotNull;
4 4 import org.jetbrains.annotations.Nullable;
5 5
6 6 /**
7 7 * Represents a fishing hook.
8 8 */
9 9 public interface FishHook extends Projectile {
10 10
11 11 /**
12 - * Get the minimum number of ticks one has to wait for a fish biting.
12 + * Get the minimum number of ticks one has to wait for a fish appearing.
13 13 * <p>
14 14 * The default is 100 ticks (5 seconds).<br>
15 15 * Note that this is before applying lure.
16 16 *
17 - * @return Minimum number of ticks one has to wait for a fish biting
17 + * @return Minimum number of ticks one has to wait for a fish appearing
18 18 */
19 19 public int getMinWaitTime();
20 20
21 21 /**
22 - * Set the minimum number of ticks one has to wait for a fish biting.
22 + * Set the minimum number of ticks one has to wait for a fish appearing.
23 23 * <p>
24 24 * The default is 100 ticks (5 seconds).<br>
25 25 * Note that this is before applying lure.
26 26 *
27 27 * @param minWaitTime Minimum number of ticks one has to wait for a fish
28 - * biting
28 + * appearing
29 29 */
30 30 public void setMinWaitTime(int minWaitTime);
31 31
32 32 /**
33 - * Get the maximum number of ticks one has to wait for a fish biting.
33 + * Get the maximum number of ticks one has to wait for a fish appearing.
34 34 * <p>
35 35 * The default is 600 ticks (30 seconds).<br>
36 36 * Note that this is before applying lure.
37 37 *
38 - * @return Maximum number of ticks one has to wait for a fish biting
38 + * @return Maximum number of ticks one has to wait for a fish appearing
39 39 */
40 40 public int getMaxWaitTime();
41 41
42 42 /**
43 - * Set the maximum number of ticks one has to wait for a fish biting.
43 + * Set the maximum number of ticks one has to wait for a fish appearing.
44 44 * <p>
45 45 * The default is 600 ticks (30 seconds).<br>
46 46 * Note that this is before applying lure.
47 47 *
48 48 * @param maxWaitTime Maximum number of ticks one has to wait for a fish
49 - * biting
49 + * appearing
50 50 */
51 51 public void setMaxWaitTime(int maxWaitTime);
52 52
53 + /**
54 + * Set both the minimum (default 100) and maximum (default 600) amount
55 + * of ticks one has to wait for a fish appearing.
56 + *
57 + * @param min minimum ticks for a fish to appear
58 + * @param max maximum ticks for a fish to appear
59 + */
60 + public void setWaitTime(int min, int max);
61 +
62 + /**
63 + * Get the minimum number of ticks one has to wait for a fish to bite
64 + * after appearing.
65 + * <p>
66 + * The default is 20 ticks (1 second).<br>
67 + * Lure does not affect this value.
68 + * This will also effect the radius (0.1 * lureTime) of where
69 + * the fish will appear.
70 + *
71 + * @return Minimum number of ticks one has to wait for a fish to bite
72 + */
73 + public int getMinLureTime();
74 +
75 + /**
76 + * Set the minimum number of ticks one has to wait for a fish to bite
77 + * after appearing.
78 + * <p>
79 + * The default is 20 ticks (1 second).<br>
80 + * Lure does not affect this value.
81 + * This will also effect the radius (0.1 * lureTime) of where
82 + * the fish will appear.
83 + *
84 + * @param minLureTime Minimum number of ticks one has to wait for a fish
85 + * to bite
86 + */
87 + public void setMinLureTime(int minLureTime);
88 +
89 + /**
90 + * Get the maximum number of ticks one has to wait for a fish to bite
91 + * after appearing.
92 + * <p>
93 + * The default is 80 ticks (4 second).<br>
94 + * Lure does not affect this value.
95 + * This will also effect the radius (0.1 * lureTime) of where
96 + * the fish will appear.
97 + *
98 + * @return Maximum number of ticks one has to wait for a fish to bite
99 + */
100 + public int getMaxLureTime();
101 +
102 + /**
103 + * Set the maximum number of ticks one has to wait for a fish to bite
104 + * after appearing.
105 + * <p>
106 + * The default is 80 ticks (4 second).<br>
107 + * Lure does not affect this value.
108 + * This will also effect the radius (0.1 * lureTime) of where
109 + * the fish will appear.
110 + *
111 + * @param maxLureTime Maximum number of ticks one has to wait for a fish
112 + * to bite
113 + */
114 + public void setMaxLureTime(int maxLureTime);
115 +
116 + /**
117 + * Set both the minimum (default 20) and maximum (default 80) amount
118 + * of ticks one has to wait for a fish to bite after appearing.
119 + *
120 + * @param min minimum ticks to wait for a bite
121 + * @param max maximum ticks to wait for a bite
122 + */
123 + public void setLureTime(int min, int max);
124 +
125 + /**
126 + * Get the minimum angle (in degrees, 0 being positive Z 90 being negative
127 + * X) of where a fish will appear after the wait time.
128 + * <p>
129 + * The default is 0 degrees.
130 + *
131 + * @return Minimum angle of where a fish will appear
132 + */
133 + public float getMinLureAngle();
134 +
135 + /**
136 + * Set the minimum angle (in degrees, 0 being positive Z 90 being negative
137 + * X) of where a fish will appear after the wait time.
138 + * <p>
139 + * The default is 0 degrees.
140 + *
141 + * @param minLureAngle Minimum angle of where a fish may appear
142 + */
143 + public void setMinLureAngle(float minLureAngle);
144 +
145 + /**
146 + * Get the maximum angle (in degrees, 0 being positive Z 90 being negative
147 + * X) of where a fish will appear after the wait time.
148 + * <p>
149 + * The default is 360 degrees.
150 + *
151 + * @return Maximum angle of where a fish will appear
152 + */
153 + public float getMaxLureAngle();
154 +
155 + /**
156 + * Set the maximum angle (in degrees, 0 being positive Z 90 being negative
157 + * X) of where a fish will appear after the wait time.
158 + * <p>
159 + * The default is 360 degrees.
160 + *
161 + * @param maxLureAngle Maximum angle of where a fish may appear
162 + */
163 + public void setMaxLureAngle(float maxLureAngle);
164 +
165 + /**
166 + * Set both the minimum (default 0) and maximum (default 360) angle of where
167 + * a fish will appear after the wait time.
168 + *
169 + * 0 degrees is positive Z, 90 degrees is negative X.
170 + *
171 + * @param min minimum angle in degrees
172 + * @param max maximum angle in degrees
173 + */
174 + public void setLureAngle(float min, float max);
175 +
53 176 /**
54 177 * Get whether the lure enchantment should be applied to reduce the wait
55 178 * time.
56 179 * <p>
57 180 * The default is true.<br>
58 181 * Lure reduces the wait time by 100 ticks (5 seconds) for each level of the
59 182 * enchantment.
60 183 *
61 184 * @return Whether the lure enchantment should be applied to reduce the wait
62 185 * time
128 251 public void setHookedEntity(@Nullable Entity entity);
129 252
130 253 /**
131 254 * Pull the hooked entity to the caster of this fish hook. If no entity is
132 255 * hooked, this method has no effect.
133 256 *
134 257 * @return true if pulled, false if no entity is hooked
135 258 */
136 259 public boolean pullHookedEntity();
137 260
261 + /**
262 + * Whether or not wait and lure time will be impacted by direct sky access.
263 + *
264 + * True by default, causes a 50% time increase on average.
265 + *
266 + * @return skylight access influences catch rate
267 + */
268 + public boolean isSkyInfluenced();
269 +
270 + /**
271 + * Set whether or not wait and lure time will be impacted by direct sky
272 + * access.
273 + *
274 + * True by default, causes a 50% time increase on average.
275 + *
276 + * @param skyInfluenced if this hook is influenced by skylight access
277 + */
278 + public void setSkyInfluenced(boolean skyInfluenced);
279 +
280 + /**
281 + * Whether or not wait and lure time will be impacted by rain.
282 + *
283 + * True by default, causes a 25% time decrease on average.
284 + *
285 + * @return rain influences catch rate
286 + */
287 + public boolean isRainInfluenced();
288 +
289 + /**
290 + * Set whether or not wait and lure time will be impacted by rain.
291 + *
292 + * True by default, causes a 25% time decrease on average.
293 + *
294 + * @param rainInfluenced if this hook is influenced by rain
295 + */
296 + public void setRainInfluenced(boolean rainInfluenced);
297 +
138 298 /**
139 299 * Get the current state of this fish hook.
140 300 *
141 301 * @return the fish hook state
142 302 */
143 303 @NotNull
144 304 public HookState getState();
145 305
146 306 /**
147 307 * Represents a state in which a fishing hook may be.

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut