Skip to content

Commit

Permalink
Merge pull request #16 from Arctic-Gaming-LLC/dev-temp
Browse files Browse the repository at this point in the history
0.1.17
  • Loading branch information
pentlock1 authored Jun 25, 2022
2 parents f498fd8 + dd1f323 commit feb35c8
Show file tree
Hide file tree
Showing 30 changed files with 257 additions and 17 deletions.
3 changes: 0 additions & 3 deletions ThunderDataEngine.iml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,5 @@
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.9" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
<orderEntry type="library" name="Maven: com.github.jitpack:maven-modular:1.1" level="project" />
<orderEntry type="library" name="Maven: com.github.jitpack.maven-modular:module1:1.1" level="project" />
<orderEntry type="library" name="Maven: com.github.jitpack.maven-modular:module2:1.1" level="project" />
</component>
</module>
11 changes: 3 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.pentlock</groupId>
<artifactId>ThunderDataEngine</artifactId>
<version>0.1.16</version>
<version>0.1.17</version>
<packaging>jar</packaging>

<name>ThunderDataEngine</name>
Expand All @@ -25,8 +25,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -76,10 +76,5 @@
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.jitpack</groupId>
<artifactId>maven-modular</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void onPlayerLoginEvent(PlayerLoginEvent event) {
PlayerUtil.createPlayer(player.getName(), 0, 1, 0, "None", "world", 10, 10,
0, 0, 0, 0, 0, 0.0, 0.0, new Date(),
playerUUID, playerUUID, playerUUID, false, 0, 0, 0, 0,
0, 0, 0, 0, new String[0], System.currentTimeMillis(),
0, 0, 0, 0, new UUID[0], System.currentTimeMillis(),
System.currentTimeMillis(), false, true, 0, 0, 0, 0, 0L, System.currentTimeMillis(), 1, 0.0,
new long[0], new double[0], new double[0], new double[0], new double[0], new double[0], new double[0], "New", new String[0]);

Expand Down
80 changes: 80 additions & 0 deletions src/main/java/net/pentlock/thunderdataengine/profiles/House.java
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ThunderPlayer {
private int healthPerkPoints;
private int criticalStrikePerkPoints;
private int criticalPowerPerkPoints;
private String[] houses;
private UUID[] houses;
private long logout;
private long login;
private boolean godMode;
Expand All @@ -59,7 +59,7 @@ public ThunderPlayer(String name, double money, int level, long exp, String grav
int luck, int physicalDefense, int archeryDefense, int physicalOffense, int archeryOffense, double criticalStrike,
double criticalPower, Date dateCreated, UUID uuid, UUID guild, UUID party, boolean pvpEnabled, int perkPoints,
int physicalDefensePerkPoints, int archeryDefensePerkPoints, int physicalOffensePerkPoints, int archeryOffensePerkPoints,
int healthPerkPoints, int criticalStrikePerkPoints, int criticalPowerPerkPoints, String[] houses,
int healthPerkPoints, int criticalStrikePerkPoints, int criticalPowerPerkPoints, UUID[] houses,
long logout, long login, boolean godMode, boolean acceptingPay, int playerKills, int mobKills, int deaths, int fallDeaths,
long totalPlayTime, long lastDeathTime, int timesLoggedIn, double moneyFromDrops, long[] dataPlayTime, double[] dataPvpDamage,
double[] dataPvpDefenseDamage, double[] dataPveDamage, double[] dataPveDefenseDamage, double[] dataWealthGain,
Expand Down Expand Up @@ -340,11 +340,11 @@ public void setCriticalPowerPerkPoints(int criticalPowerPerkPoints) {
this.criticalPowerPerkPoints = criticalPowerPerkPoints;
}

public String[] getHouses() {
public UUID[] getHouses() {
return houses;
}

public void setHouses(String[] houses) {
public void setHouses(UUID[] houses) {
this.houses = houses;
}

Expand Down
127 changes: 127 additions & 0 deletions src/main/java/net/pentlock/thunderdataengine/utilities/HouseUtil.java
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static ThunderPlayer createPlayer(String name, double money, int level, l
int luck, int physicalDefense, int archeryDefense, int physicalOffense, int archeryOffense, double criticalStrike,
double criticalPower, Date dateCreated, UUID uuid, UUID guild, UUID party, boolean pvpEnabled, int perkPoints,
int physicalDefensePerkPoints, int archeryDefensePerkPoints, int physicalOffensePerkPoints, int archeryOffensePerkPoints,
int healthPerkPoints, int criticalStrikePerkPoints, int criticalPowerPerkPoints, String[] houses,
int healthPerkPoints, int criticalStrikePerkPoints, int criticalPowerPerkPoints, UUID[] houses,
long logout, long login, boolean godMode, boolean acceptingPay, int playerKills, int mobKills, int deaths, int fallDeaths,
long totalPlayTime, long lastDeathTime, int timesLoggedIn, double moneyFromDrops, long[] dataPlayTime,
double[] dataPvpDamage, double[] dataPvpDefenseDamage, double[] dataPveDamage, double[] dataPveDefenseDamage,
Expand Down
Binary file added target/ThunderDataEngine-0.1.17.jar
Binary file not shown.
Empty file added target/classes/config.yml
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 9 additions & 0 deletions target/classes/plugin.yml
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
5 changes: 5 additions & 0 deletions target/maven-archiver/pom.properties
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
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
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 added target/original-ThunderDataEngine-0.1.17.jar
Binary file not shown.

0 comments on commit feb35c8

Please sign in to comment.