Skip to content

Commit

Permalink
3.3.0 and fix for a problem with setting values
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperFranz committed Apr 21, 2017
1 parent 503da9c commit 1c6ff04
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ This project adheres to [Semantic Versioning](http://semver.org/ ), and followin
### Fixed


## 2017-04-21 3.2.1
## 2017-04-21 3.3.0
### Changed
- Using the gameStoppingEvent instead of the GameStopped event to be sure that we can unforce properly.
- Using the gameStoppingEvent instead of the GameStopped event to be sure that we can unforce properly.

### Fixed
- setting a players personal/world is not going out from the base config option instead of 0.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = 'net.kaikk.mc'
version = '3.2.1'
version = '3.3.0'
description = 'Better Chunkloading.'
project.ext.authors = 'KaiNoMood, Rob5Underscores, KasperFranz'

Expand Down
18 changes: 14 additions & 4 deletions src/main/java/net/kaikk/mc/bcl/datastore/MySqlDataStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,14 @@ public void setOnlineOnlyChunksLimit(UUID playerId, int amount) {
public void addAlwaysOnChunksLimit(UUID playerId, int amount) {
super.addAlwaysOnChunksLimit(playerId, amount);
try {
int world = Config.getConfig().get()
.getNode("DefaultChunksAmount").getNode("World").getInt();
int personal = Config.getConfig().get()
.getNode("DefaultChunksAmount").getNode("Personal").getInt()+amount;
this.statement().executeUpdate(
"INSERT INTO bcl_playersdata VALUES (" + UUIDtoHexString(playerId) + ", " + amount + ", " + Config.getConfig().get()
.getNode("DefaultChunksAmount").getNode("World").getInt() + ") ON DUPLICATE KEY UPDATE alwayson=alwayson+" + amount);
"INSERT INTO bcl_playersdata VALUES (" + UUIDtoHexString(playerId) + ", " + personal + ", " + world + ") ON DUPLICATE KEY "
+ "UPDATE "
+ "alwayson=alwayson+" + amount);
} catch (SQLException e) {
e.printStackTrace();
}
Expand All @@ -216,8 +221,13 @@ public void addAlwaysOnChunksLimit(UUID playerId, int amount) {
public void addOnlineOnlyChunksLimit(UUID playerId, int amount) {
super.addOnlineOnlyChunksLimit(playerId, amount);
try {
this.statement().executeUpdate("INSERT INTO bcl_playersdata VALUES (" + UUIDtoHexString(playerId) + ", " + Config.getConfig().get()
.getNode("DefaultChunksAmount").getNode("Personal").getInt() + ", " + amount + ") ON DUPLICATE KEY UPDATE onlineonly=onlineonly+"
int world = Config.getConfig().get()
.getNode("DefaultChunksAmount").getNode("World").getInt()+amount;
int personal = Config.getConfig().get()
.getNode("DefaultChunksAmount").getNode("Personal").getInt();
this.statement().executeUpdate("INSERT INTO bcl_playersdata VALUES (" + UUIDtoHexString(playerId) + ", " + personal + ", " + world +
") "
+ "ON DUPLICATE KEY UPDATE onlineonly=onlineonly+"
+ amount);
} catch (SQLException e) {
e.printStackTrace();
Expand Down

0 comments on commit 1c6ff04

Please sign in to comment.