Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,19 @@ jobs:
runs-on: ubuntu-latest
needs: build
outputs:
changelog: ${{ steps.changelog.outputs.release-notes }}
changelog: ${{ steps.read-changelog.outputs.changelog }}
release_type: ${{ steps.release-type.outputs.release_type }}

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Generate Changelog from commits
id: changelog
uses: johnyherangi/create-release-notes@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
format: "- {{subject}}"
- name: Read CHANGELOG.md
id: read-changelog
run: |
# Read file, escape % and newlines for GitHub Actions
CONTENT=$(cat CHANGELOG.md | sed 's/%/%25/g' | sed ':a;N;$!ba;s/\n/%0A/g')
echo "changelog=$CONTENT" >> $GITHUB_OUTPUT

- name: Determine release type
id: release-type
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## V1.9.7 RELEASE - Minecraft 1.21.8

---

### Changelog:
- Potentially fixed permission
- Fixed compatibility with CraftBukkit

Please report any bugs to the [Discord Server](https://discord.gg/VNXV4PDhfK). The sooner the bug is reported, the faster I can release a new fix which patches it.
Thanks for all the support with this plugin ! <3
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>fr.gamecreep</groupId>
<artifactId>BasicHomes</artifactId>
<version>1.9.6-RELEASE-1.21.8</version>
<version>1.9.7-RELEASE-1.21.8</version>
<packaging>jar</packaging>

<name>BasicHomes</name>
Expand Down
15 changes: 13 additions & 2 deletions src/main/java/fr/gamecreep/basichomes/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Constants {

public static final String PLUGIN_VERSION = "1.9.6";
public static final String PLUGIN_VERSION = "1.9.7";
public static final int BSTATS_PLUGIN_ID = 25429;

public static final ChatColor INFO_COLOR = ChatColor.DARK_AQUA;
public static final ChatColor SUCCESS_COLOR = ChatColor.GREEN;
public static final ChatColor WARNING_COLOR = ChatColor.RED;
public static final ChatColor SPECIAL_COLOR = ChatColor.GOLD;
public static final net.md_5.bungee.api.ChatColor PLUGIN_COLOR = net.md_5.bungee.api.ChatColor.of("#2596be");

public static final String PLUGIN_COLOR;
static {
String colorTemp;
try {
colorTemp = net.md_5.bungee.api.ChatColor.of("#2596be").toString();
} catch (Throwable t) {
colorTemp = ChatColor.DARK_AQUA.toString();
}
PLUGIN_COLOR = colorTemp;
}


public static final String MY_HOMES_MENU_NAME = SPECIAL_COLOR + "My Homes";
public static final String HOMES_OF_START_MENU_NAME = SPECIAL_COLOR + "Homes of" + INFO_COLOR + " ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,26 +141,27 @@ public List<DefaultPermissions.GroupPermission> getPlayerGroups(@NonNull final P
public void applyPermissions(@NonNull final Player player) {
final UUID playerId = player.getUniqueId();

final PermissionAttachment permissionAttachment =
this.plugin.getPermissionAttachments().getOrDefault(playerId, player.addAttachment(this.plugin));
final PermissionAttachment oldAttachment = this.plugin.getPermissionAttachments().remove(playerId);
if (oldAttachment != null) {
player.removeAttachment(oldAttachment);
}

permissionAttachment.getPermissions().clear();
final PermissionAttachment newAttachment = player.addAttachment(this.plugin);

final List<DefaultPermissions.GroupPermission> groups = this.getPlayerGroups(player);

for (final DefaultPermissions.GroupPermission group : groups) {
this.getDefaultPermissions(group).forEach(permissionAttachment::setPermission);
this.getDefaultPermissions(group).forEach(newAttachment::setPermission);
}
this.getPlayerPermissions(playerId).forEach(permissionAttachment::setPermission);

this.plugin.getPermissionAttachments().put(playerId, permissionAttachment);
this.getPlayerPermissions(playerId).forEach(newAttachment::setPermission);

this.plugin.getPermissionAttachments().put(playerId, newAttachment);
}

public void applyPermissions(@NonNull final UUID playerId) {
for (final Player player : this.plugin.getServer().getOnlinePlayers()) {
if (player.getUniqueId().equals(playerId)) {
this.applyPermissions(player);
}
final Player player = this.plugin.getServer().getPlayer(playerId);
if (player != null && player.isOnline()) {
this.applyPermissions(player);
}
}

Expand Down
Loading