Skip to content

Commit

Permalink
Correctly send owner to client for breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiahwinsley committed Jul 5, 2024
1 parent 1e82a14 commit f43e3ed
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ runs {

server {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
programArgument '--nogui'
}

// This run config launches GameTestServer and runs all registered gametests, then exits.
Expand Down Expand Up @@ -104,7 +103,7 @@ dependencies {

runtimeOnly "curse.maven:emi-580555:5481786"
// runtimeOnly fg.deobf("curse.maven:jei-238222:4712868")
runtimeOnly "curse.maven:jade-324717:5444008"
runtimeOnly "curse.maven:jade-324717:5493270"
compileOnly "curse.maven:ftb-teams-forge-404468:5448371"
//
// compileOnly fg.deobf("maven.modrinth:argonauts:1.0.2")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mod_name=Pylons
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=5.0.0
mod_version=5.0.1
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public boolean hasTeamAccess(Player player) {
}

public boolean canAccess(Player player) {
return Objects.equals(player.getUUID(), owner) || owner == null || player.hasPermissions(2) || hasTeamAccess(player);
return Objects.equals(player.getUUID(), owner) || owner == NONE || player.hasPermissions(2) || hasTeamAccess(player);
}

private long lastTicked = 0L;
Expand Down Expand Up @@ -175,6 +175,22 @@ public void loadAdditional(CompoundTag tag, HolderLookup.Provider registries) {
super.loadAdditional(tag, registries);
}

// Called whenever a client loads a new chunk
@Override
public CompoundTag getUpdateTag(HolderLookup.Provider registries) {
CompoundTag tag = super.getUpdateTag(registries);
tag.putUUID(Constants.NBT.OWNER, owner);
return tag;
}

@Override
public void handleUpdateTag(CompoundTag tag, HolderLookup.Provider lookupProvider) {
if (!tag.isEmpty()) {
owner = tag.getUUID(Constants.NBT.OWNER);
super.handleUpdateTag(tag, lookupProvider);
}
}

// Called whenever a block update happens on the client
@Nullable
@Override
Expand Down

0 comments on commit f43e3ed

Please sign in to comment.