This repository was archived by the owner on Mar 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWolf.java
More file actions
79 lines (55 loc) · 2.22 KB
/
Copy pathWolf.java
File metadata and controls
79 lines (55 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package space.codekingdoms.sapphon.libcncbr;
import com.codekingdoms.nozzle.base.BaseWolf;
import com.codekingdoms.nozzle.utils.Random;
import com.codekingdoms.nozzle.utils.Direction;
import java.lang.Math;
import java.lang.Integer;
import java.lang.Float;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.Material;
import java.util.List;
import java.util.ArrayList;
public class Wolf extends BaseWolf {
public String getBlock( int x, int y, int z ) {
String s = getWorld().getBlockAt(x, y, z).toString();
return s;
}
public void setBlock( int x, int y, int z, Material block ) {
getGame().setBlockTypeAtLocation(block, new Location(world, x, y, z));
}
public void findStoryPointWithinRadius(int radius, Player seeker){
String result = "You can detect no disturbances in the world code within that distance.";
double difference = getDistanceBetweenLocations(seeker.getLocation(), getGame().nextStoryPoint);
if(radius >= difference){
result = String.valueOf(difference);
}
getGame().broadcastMessage(result);
}
public double getDistanceBetweenLocations(Location origin, Location destination){
double xDiffSquared = squareDifference(origin.getX(), destination.getX());
double yDiffSquared = squareDifference(origin.getY(), destination.getY());
double zDiffSquared = squareDifference(origin.getZ(), destination.getZ());
return Math.sqrt(xDiffSquared + yDiffSquared + zDiffSquared);
}
public double squareDifference(double num1, double num2){
double difference = num2 - num1;
return difference * difference;
}
public void setRectangle( int x, int y, int z, int x2, int y2, int z2, String blockName ) {
Material block = Material.getMaterial(blockName.toUpperCase());
getGame().setBlockTypeInArea(block, new Location(world, x, y, z), new Location(world, x2, y2, z2));
}
public void explosion( int x, int y, int z, float power ) {
getGame().getWorld().createExplosion(new Location(world, x, y, z), power);
}
public int toI( String toConvert ) {
int toReturn = Integer.parseInt(toConvert);
return toReturn;
}
public float toF( String toConvert ) {
float toReturn = Float.parseFloat(toConvert);
return toReturn;
}
}