-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Arctic-Gaming-LLC/dev-temp
0.1.17
- Loading branch information
Showing
30 changed files
with
257 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
src/main/java/net/pentlock/thunderdataengine/profiles/House.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package net.pentlock.thunderdataengine.profiles; | ||
|
||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
public class House { | ||
private UUID uuid; // UUID of house group | ||
private String name; // name of house | ||
private double cost; | ||
private String[] doorLocation; // exact location of door | ||
private String[] arrivalLocation; // this is location outside the door | ||
private Map<UUID, String[]> instances; // these are the house instances UUIDs and locations | ||
private Map<UUID, String[]> instanceLocation; // this is a map of locations tied to player UUID | ||
|
||
public House(UUID uuid, String name, double cost, String[] doorLocation, String[] arrivalLocation, Map<UUID, String[]> instances, Map<UUID, String[]> instanceLocation) { | ||
this.uuid = uuid; | ||
this.name = name; | ||
this.cost = cost; | ||
this.doorLocation = doorLocation; | ||
this.arrivalLocation = arrivalLocation; | ||
this.instances = instances; | ||
this.instanceLocation = instanceLocation; | ||
} | ||
|
||
public UUID getUUID() { | ||
return uuid; | ||
} | ||
|
||
public void setUUID(UUID uuid) { | ||
this.uuid = uuid; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public double getCost() { | ||
return cost; | ||
} | ||
|
||
public void setCost(double cost) { | ||
this.cost = cost; | ||
} | ||
|
||
public String[] getDoorLocation() { | ||
return doorLocation; | ||
} | ||
|
||
public void setDoorLocation(String[] doorLocation) { | ||
this.doorLocation = doorLocation; | ||
} | ||
|
||
public String[] getArrivalLocation() { | ||
return arrivalLocation; | ||
} | ||
|
||
public void setArrivalLocation(String[] arrivalLocation) { | ||
this.arrivalLocation = arrivalLocation; | ||
} | ||
|
||
public Map<UUID, String[]> getInstances() { | ||
return instances; | ||
} | ||
|
||
public void setInstances(Map<UUID, String[]> instances) { | ||
this.instances = instances; | ||
} | ||
|
||
public Map<UUID, String[]> getInstanceLocation() { | ||
return instanceLocation; | ||
} | ||
|
||
public void setInstanceLocation(Map<UUID, String[]> instanceLocation) { | ||
this.instanceLocation = instanceLocation; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
src/main/java/net/pentlock/thunderdataengine/utilities/HouseUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
package net.pentlock.thunderdataengine.utilities; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.GsonBuilder; | ||
import net.pentlock.thunderdataengine.ThunderDataEngine; | ||
import net.pentlock.thunderdataengine.profiles.House; | ||
|
||
import java.io.*; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
public class HouseUtil { | ||
|
||
public static final Map<UUID, House> HOUSES = new HashMap<>(); | ||
|
||
/** | ||
* | ||
* @param uuid UUID of house | ||
* @param name Name of house | ||
* @param cost cost of house | ||
* @param doorLocation exact location of door to be clicked | ||
* @param arrivalLocation the location player should be when leaving home | ||
* @param instances Map of UUID to String[] to hold locations of available houses | ||
* @param instanceLocation Map of player UUID to the location player arrives at in house world | ||
* @return this is the house object after it has been created | ||
*/ | ||
|
||
public static House createHouse(UUID uuid, String name, double cost, String[] doorLocation, String[] arrivalLocation, | ||
Map<UUID, String[]> instances, Map<UUID, String[]> instanceLocation) { | ||
|
||
House house = new House(uuid, name, cost, doorLocation, arrivalLocation, instances, instanceLocation); | ||
|
||
HOUSES.put(uuid, house); | ||
|
||
return house; | ||
} | ||
|
||
/** | ||
* | ||
* @param uuid UUID of house | ||
*/ | ||
public static void deleteHouse(UUID uuid) { | ||
HOUSES.remove(uuid); | ||
File file = new File(ThunderDataEngine.getPlugin().getDataFolder().getAbsolutePath() + "/HouseData/" + uuid + ".json"); | ||
if (file.exists()) { | ||
file.delete(); | ||
} | ||
} | ||
|
||
/** | ||
* | ||
* @param uuid UUID of house | ||
* @return the house object to be found | ||
*/ | ||
public static House findHouse(UUID uuid) { | ||
return HOUSES.get(uuid); | ||
} | ||
|
||
/** | ||
* | ||
* @param uuid UUID of house | ||
* @param newHouse House object to pass in | ||
* @return the house the has been updated | ||
*/ | ||
public static House updateHouse(UUID uuid, House newHouse) { | ||
House house = HOUSES.get(uuid); | ||
|
||
house.setUUID(newHouse.getUUID()); | ||
house.setName(newHouse.getName()); | ||
house.setCost(newHouse.getCost()); | ||
house.setDoorLocation(newHouse.getDoorLocation()); | ||
house.setArrivalLocation(newHouse.getArrivalLocation()); | ||
house.setInstances(newHouse.getInstances()); | ||
house.setInstanceLocation(newHouse.getInstanceLocation()); | ||
|
||
return house; | ||
} | ||
|
||
/** | ||
* | ||
* @param uuid UUID of house | ||
* @throws IOException an exception? | ||
*/ | ||
public static void saveHouse(UUID uuid) throws IOException { | ||
|
||
Gson gson = new GsonBuilder().setPrettyPrinting().create(); | ||
File file = new File(ThunderDataEngine.getPlugin().getDataFolder().getAbsolutePath() + "/HouseData/" + uuid + ".json"); | ||
if (!file.exists()) { | ||
file.getParentFile().mkdir(); | ||
} | ||
|
||
file.createNewFile(); | ||
House house = HOUSES.get(uuid); | ||
if (house != null) { | ||
Writer writer = new FileWriter(file, false); | ||
gson.toJson(house, writer); | ||
writer.flush(); | ||
writer.close(); | ||
} | ||
} | ||
|
||
/** | ||
* | ||
* @param uuid UUID of house | ||
* @throws FileNotFoundException an exception? | ||
*/ | ||
public static void loadHouse(UUID uuid) throws FileNotFoundException { | ||
Gson gson = new Gson(); | ||
File file = new File(ThunderDataEngine.getPlugin().getDataFolder().getAbsolutePath() + "/HouseData/" + uuid + ".json"); | ||
|
||
if (file.exists()) { | ||
Reader reader = new FileReader(file); | ||
House house = gson.fromJson(reader, House.class); | ||
HOUSES.put(uuid, house); | ||
} | ||
} | ||
|
||
public static void unLoadHouse(UUID uuid) { | ||
try { | ||
saveHouse(uuid); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
HOUSES.remove(uuid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Empty file.
Binary file added
BIN
+1.77 KB
target/classes/net/pentlock/thunderdataengine/ThunderDataEngine$1.class
Binary file not shown.
Binary file added
BIN
+4.51 KB
target/classes/net/pentlock/thunderdataengine/ThunderDataEngine.class
Binary file not shown.
Binary file added
BIN
+4.05 KB
target/classes/net/pentlock/thunderdataengine/listeners/PlayerLoginListener.class
Binary file not shown.
Binary file added
BIN
+4.79 KB
target/classes/net/pentlock/thunderdataengine/listeners/PlayerLogoutListener.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+12 KB
target/classes/net/pentlock/thunderdataengine/profiles/ThunderPlayer.class
Binary file not shown.
Binary file added
BIN
+1.75 KB
target/classes/net/pentlock/thunderdataengine/utilities/ArrayUtil.class
Binary file not shown.
Binary file added
BIN
+6.63 KB
target/classes/net/pentlock/thunderdataengine/utilities/GuildUtil.class
Binary file not shown.
Binary file added
BIN
+5.09 KB
target/classes/net/pentlock/thunderdataengine/utilities/HouseUtil.class
Binary file not shown.
Binary file added
BIN
+4.23 KB
target/classes/net/pentlock/thunderdataengine/utilities/PartyUtil.class
Binary file not shown.
Binary file added
BIN
+9.32 KB
target/classes/net/pentlock/thunderdataengine/utilities/PlayerUtil.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: ThunderDataEngine | ||
version: '0.1.17' | ||
main: net.pentlock.thunderdataengine.ThunderDataEngine | ||
api-version: 1.19 | ||
prefix: ThunderDataEngine | ||
loadbefore: [ ThunderCombatSystem, ThunderResourceControl, ThunderPlayerHousing ] | ||
authors: [ pentlock ] | ||
description: This is required to run anything in the thunder family. | ||
website: pentlock.net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#Generated by Maven | ||
#Sat Jun 25 07:27:44 EDT 2022 | ||
groupId=net.pentlock | ||
artifactId=ThunderDataEngine | ||
version=0.1.17 |
14 changes: 14 additions & 0 deletions
14
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
net\pentlock\thunderdataengine\listeners\PlayerLoginListener.class | ||
net\pentlock\thunderdataengine\profiles\Data.class | ||
net\pentlock\thunderdataengine\ThunderDataEngine.class | ||
net\pentlock\thunderdataengine\utilities\GuildUtil.class | ||
net\pentlock\thunderdataengine\utilities\PlayerUtil.class | ||
net\pentlock\thunderdataengine\utilities\PartyUtil.class | ||
net\pentlock\thunderdataengine\utilities\ArrayUtil.class | ||
net\pentlock\thunderdataengine\ThunderDataEngine$1.class | ||
net\pentlock\thunderdataengine\profiles\Party.class | ||
net\pentlock\thunderdataengine\utilities\HouseUtil.class | ||
net\pentlock\thunderdataengine\profiles\Guild.class | ||
net\pentlock\thunderdataengine\profiles\ThunderPlayer.class | ||
net\pentlock\thunderdataengine\listeners\PlayerLogoutListener.class | ||
net\pentlock\thunderdataengine\profiles\House.class |
13 changes: 13 additions & 0 deletions
13
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\utilities\PartyUtil.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\profiles\ThunderPlayer.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\utilities\PlayerUtil.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\profiles\House.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\listeners\PlayerLoginListener.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\profiles\Party.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\profiles\Guild.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\listeners\PlayerLogoutListener.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\utilities\ArrayUtil.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\utilities\GuildUtil.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\utilities\HouseUtil.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\ThunderDataEngine.java | ||
E:\Projects\ThunderDataEngine\src\main\java\net\pentlock\thunderdataengine\profiles\Data.java |
Empty file.
Empty file.
Binary file not shown.