Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGoosik committed Apr 1, 2023
1 parent 3fcdf90 commit ff799d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs = -Xmx1G
org.gradle.jvmargs = -Xmx2G
org.gradle.parallel = true

# Mod Properties
maven_group = ru.pinkgoosik
archives_base_name = skylands
mod_version = 0.3.6
mod_version = 0.3.7

# Dependencies | Check these on https://fabricmc.net/develop
minecraft_version = 1.19.4
Expand Down
21 changes: 12 additions & 9 deletions src/main/java/skylands/logic/Island.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.commons.io.FileUtils;
import skylands.SkylandsMod;
import skylands.api.SkylandsAPI;
import skylands.util.Players;
import skylands.util.Texts;
import xyz.nucleoid.fantasy.Fantasy;
import xyz.nucleoid.fantasy.RuntimeWorldConfig;
Expand Down Expand Up @@ -195,6 +194,10 @@ public List<ServerPlayerEntity> getPlayers() {
}).toList();
}

public Optional<ServerPlayerEntity> getOwner() {
return Optional.ofNullable(server.getPlayerManager().getPlayer(this.owner.uuid));
}

@Override
public boolean equals(Object obj) {
if(obj instanceof Island isl) return isl.owner.uuid.equals(this.owner.uuid);
Expand Down Expand Up @@ -279,22 +282,22 @@ public ServerWorld getWorld() {
return handler.asWorld();
}

public void visit(PlayerEntity player, Vec3d pos, float yaw, float pitch) {
public void visit(PlayerEntity visitor, Vec3d pos, float yaw, float pitch) {
ServerWorld world = this.getWorld();
player.teleport(world, pos.getX(), pos.getY(), pos.getZ(), Set.of(), yaw, pitch);
visitor.teleport(world, pos.getX(), pos.getY(), pos.getZ(), Set.of(), yaw, pitch);

if(!isMember(player)) {
Players.get(this.owner.name).ifPresent(owner -> {
if(!player.getUuid().equals(owner.getUuid())) {
owner.sendMessage(Texts.prefixed("message.skylands.island_visit.visit", map -> map.put("%visitor%", player.getName().getString())));
if(!isMember(visitor)) {
this.getOwner().ifPresent(owner -> {
if(!visitor.getUuid().equals(owner.getUuid())) {
owner.sendMessage(Texts.prefixed("message.skylands.island_visit.visit", map -> map.put("%visitor%", visitor.getName().getString())));
}
});
}

SkylandsAPI.ON_ISLAND_VISIT.invoker().invoke(player, world, this);
SkylandsAPI.ON_ISLAND_VISIT.invoker().invoke(visitor, world, this);

if (this.freshCreated) {
this.onFirstLoad(player);
this.onFirstLoad(visitor);
this.freshCreated = false;
}
}
Expand Down

0 comments on commit ff799d3

Please sign in to comment.