Skip to content

Commit

Permalink
Travis CI - more WG refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
rlf committed Dec 30, 2014
1 parent 9533008 commit e8f9ade
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ cache:
env:
global:
secure: dGzZ9hl0ezUCYs72+Z4LUgtny0qsUn3HibpBKo4hriRPMY8EQqaJfi1ZDQTKr3ctjJMtQtcgnlC0BujEV+1W2tObjSJsCAdEbzKYZijwRXSK5jT1sua3EQScKYelpv0z4fd9LIYJJ95xwXMNMmAFSjdu3fRDkxtGgIIKbka8YiE=
after_success:
- 'REPO_URI=repos/rlf/uSkyBlock/releases'
- 'RELEASEID=814169'
- 'ARTIFACT=uSkyBlock.jar'
- 'ASSETID=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/${REPO_URI}/${RELEASEID}/assets" | jq ".[0].id")'
- 'curl -XDELETE -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/${REPO_URI}/assets/${ASSETID}"'
- 'curl -XPOST -s -H "Authorization: token ${GITHUB_TOKEN}" -H "Content-Type: application/octet-stream" --data-binary @target/${ARTIFACT} "https://uploads.github.com/${REPO_URI}/814169/assets?name=${ARTIFACT}"'
deploy:
provider: releases
api-key: ${GITHUB_TOKEN}
file: target/uSkyBlock.jar
skip_cleanup: true
on:
tags: true
all_branches: true
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,9 @@ public static String getRegionAt(Location location) {
}
return null;
}

public static void removeIslandRegion(String islandName) {
RegionManager regionManager = getWorldGuard().getRegionManager(uSkyBlock.getSkyBlockWorld());
regionManager.removeRegion(islandName + "island");
}
}
6 changes: 2 additions & 4 deletions src/main/java/us/talabrek/ultimateskyblock/uSkyBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,7 @@ public void deletePlayerIsland(final String player) {
final PlayerInfo pi = activePlayers.containsKey(player) ? activePlayers.get(player) : new PlayerInfo(player);
orphaned.push(pi.getIslandLocation());
islandLogic.clearIsland(pi.getIslandLocation());
RegionManager regionManager = WorldGuardHandler.getWorldGuard().getRegionManager(getSkyBlockWorld());
regionManager.removeRegion(player + "Island");
WorldGuardHandler.removeIslandRegion(pi.locationForParty());
String islandLocation = pi.locationForParty();
islandLogic.deleteIslandConfig(islandLocation);
pi.removeFromIsland();
Expand Down Expand Up @@ -905,14 +904,13 @@ public void removeActivePlayer(final String player) {
}

public PlayerInfo loadPlayerData(Player player) {
uSkyBlock.log(Level.INFO, "Loading player data for " + player.getName());
final PlayerInfo pi = loadPlayerInfo(player.getName());
if (pi.getHasIsland()) {
IslandInfo islandInfo = islandLogic.getIslandInfo(pi);
WorldGuardHandler.protectIsland(player, pi);
islandLogic.clearFlatland(player, pi.getIslandLocation(), 200);
}
addActivePlayer(player.getName(), pi);
uSkyBlock.log(Level.INFO, "Loaded player file for " + player.getName());
return pi;
}

Expand Down

0 comments on commit e8f9ade

Please sign in to comment.