Code (Java):
package
com.live.bemmamin.example
;
import
com.live.bemmamin.gps.api.GPSAPI
;
import
org.bukkit.Bukkit
;
import
org.bukkit.Location
;
import
org.bukkit.plugin.java.JavaPlugin
;
public
class Main
extends JavaPlugin
{
private GPSAPI gpsapi
=
null
;
@Override
public
void onEnable
(
)
{
if
(Bukkit.
getPluginManager
(
).
getPlugin
(
"GPS"
).
isEnabled
(
)
)
{
gpsapi
=
new GPSAPI
(
this
)
;
initialiseCustomPoints
(
)
;
gpsapi.
startGPS
(Bukkit.
getPlayer
(
"Benz56"
),
"pluginName6"
)
;
}
}
private
void initialiseCustomPoints
(
)
{
gpsapi.
addPoint
(
"pluginName1",
new Location
(Bukkit.
getWorld
(
"world"
),
91,
60,
81
)
)
;
gpsapi.
addPoint
(
"pluginName2",
new Location
(Bukkit.
getWorld
(
"world"
),
76,
60,
85
)
)
;
gpsapi.
addPoint
(
"pluginName3",
new Location
(Bukkit.
getWorld
(
"world"
),
83,
60,
77
)
)
;
gpsapi.
addPoint
(
"pluginName4",
new Location
(Bukkit.
getWorld
(
"world"
),
74,
60,
73
)
)
;
gpsapi.
addPoint
(
"pluginName5",
new Location
(Bukkit.
getWorld
(
"world"
),
86,
60,
67
)
)
;
gpsapi.
addPoint
(
"pluginName6",
new Location
(Bukkit.
getWorld
(
"world"
),
84,
60,
61
)
)
;
gpsapi.
connect
(
"pluginName1",
"pluginName2",
true
)
;
gpsapi.
connect
(
"pluginName1",
"pluginName3",
false
)
;
gpsapi.
connect
(
"pluginName2",
"pluginName3",
true
)
;
gpsapi.
connect
(
"pluginName3",
"pluginName4",
true
)
;
gpsapi.
connect
(
"pluginName4",
"pluginName5",
true
)
;
gpsapi.
connect
(
"pluginName5",
"pluginName6",
true
)
;
}
@Override
public
void onDisable
(
)
{
gpsapi.
removeAllPoints
(
)
;
}
}