Skip to content

Commit

Permalink
update to 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGoosik committed Jun 8, 2023
1 parent 135369e commit 01af1af
Show file tree
Hide file tree
Showing 66 changed files with 264 additions and 272 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/publish-curseforge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,23 @@ jobs:
- name: Build artifacts
run: ./gradlew build
- name: publish artifacts
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3
with:
curseforge-id: 688057
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

files-primary: build/libs/!(*-@(dev|sources)).jar
files-secondary: build/libs/*-@(dev|sources).jar
files: build/libs/*.jar

version-type: beta
loaders: |
fabric
quilt
game-versions: |
1.19.4
dependencies: |
fabric-api | depends | *
game-version-filter: releases

java: |
17
retry-attempts: 2
retry-delay: 10000
fail-mode: fail
12 changes: 5 additions & 7 deletions .github/workflows/publish-modrinth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,23 @@ jobs:
- name: Build artifacts
run: ./gradlew build
- name: publish artifacts
uses: Kir-Antipov/mc-publish@v3.2
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: wbrBu6hJ
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

files-primary: build/libs/!(*-@(dev|sources)).jar
files-secondary: build/libs/*-@(dev|sources).jar
files: build/libs/*.jar

version-type: beta
loaders: |
fabric
quilt
game-versions: |
1.19.4
dependencies: |
fabric-api | depends | *
game-version-filter: releases

java: |
17
retry-attempts: 2
retry-delay: 10000
fail-mode: fail
22 changes: 8 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id "fabric-loom" version "1.1-SNAPSHOT"
id "io.github.juuxel.loom-quiltflower" version "1.8.0"
id "fabric-loom" version "1.2-SNAPSHOT"
id "io.github.juuxel.loom-quiltflower" version "1.10.0"
}

version = project.mod_version + "+" + project.minecraft_version
version = project.mod_version
group = project.maven_group

repositories {
Expand All @@ -14,7 +14,6 @@ repositories {
maven { url "https://maven.nucleoid.xyz" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://ladysnake.jfrog.io/artifactory/mods" }
maven { url "https://jitpack.io" }
}

dependencies {
Expand All @@ -23,20 +22,15 @@ dependencies {

modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api}"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-api:${project.cca}"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca}"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-world:${project.cca}"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca}"

modImplementation include("com.github.tyap-lyap:fantasy:${project.fantasy}")
// modImplementation include("xyz.nucleoid:fantasy:${project.fantasy}")
modImplementation include("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca}")
modImplementation include("dev.onyxstudios.cardinal-components-api:cardinal-components-world:${project.cca}")
modImplementation include("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca}")

modImplementation include("xyz.nucleoid:fantasy:${project.fantasy}")
modImplementation include("eu.pb4:placeholder-api:${project.placeholder_api}")
modImplementation include("xyz.nucleoid:server-translations-api:${project.server_translations_api}")
modImplementation include("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")

modLocalRuntime "maven.modrinth:dcwa:4.0"
modLocalRuntime "maven.modrinth:starlight:1.1.1+1.19"
modLocalRuntime "maven.modrinth:lithium:mc1.19.4-0.11.1"
}

loom {
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ org.gradle.parallel = true
# Mod Properties
maven_group = ru.pinkgoosik
archives_base_name = skylands
mod_version = 0.3.8
mod_version = 0.3.9+1.20

# Dependencies | Check these on https://fabricmc.net/develop
minecraft_version = 1.19.4
yarn_mappings = 1.19.4+build.1
fabric_loader = 0.14.17
fabric_api = 0.76.0+1.19.4
minecraft_version = 1.20
yarn_mappings = 1.20+build.1
fabric_loader = 0.14.21
fabric_api = 0.83.0+1.20

# https://github.com/OnyxStudios/Cardinal-Components-API/releases
cca = 5.1.0
cca = 5.2.0
# https://github.com/NucleoidMC/fantasy/releases
fantasy = 15b00d289f
fantasy = 0.4.11+1.20-rc1
# https://github.com/Patbox/TextPlaceholderAPI/releases
placeholder_api = 2.0.0-rc.1+1.19.3
placeholder_api = 2.1.1+1.20
# https://github.com/NucleoidMC/Server-Translations/releases
server_translations_api = 2.0.0-beta.2+1.19.4-pre2
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
17 changes: 8 additions & 9 deletions src/main/java/skylands/command/AcceptCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import net.minecraft.server.network.ServerPlayerEntity;
import skylands.data.SkylandsComponents;
import skylands.logic.Skylands;
import skylands.util.Players;
import skylands.util.Texts;
import skylands.util.SkylandsTexts;

import static com.mojang.brigadier.arguments.StringArgumentType.word;
import static net.minecraft.server.command.CommandManager.argument;
Expand All @@ -29,28 +28,28 @@ static void init(CommandDispatcher<ServerCommandSource> dispatcher) {
}

static void run(ServerPlayerEntity player, String ownerName) {
var inviter = Players.get(ownerName);
if(inviter.isPresent()) {
var island = Skylands.instance.islands.get(inviter.get());
if(player.getServer() != null) {
var inviter = player.getServer().getPlayerManager().getPlayer(ownerName);
var island = Skylands.getIslands().get(inviter);
if(island.isPresent()) {
var invite = Skylands.instance.invites.get(island.get(), player);
if(invite.isPresent()) {
if(!invite.get().accepted) {
invite.get().accept(player);
player.sendMessage(Texts.prefixed("message.skylands.accept.success", map -> map.put("%owner%", ownerName)));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.accept.success", map -> map.put("%owner%", ownerName)));
SkylandsComponents.PLAYER_DATA.get(player).addIsland(ownerName);
}
}
else {
player.sendMessage(Texts.prefixed("message.skylands.accept.fail"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.accept.fail"));
}
}
else {
player.sendMessage(Texts.prefixed("message.skylands.accept.no_island"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.accept.no_island"));
}
}
else {
player.sendMessage(Texts.prefixed("message.skylands.accept.no_player"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.accept.no_player"));
}
}
}
26 changes: 13 additions & 13 deletions src/main/java/skylands/command/BanCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import net.minecraft.server.network.ServerPlayerEntity;
import skylands.logic.Member;
import skylands.logic.Skylands;
import skylands.util.Texts;
import skylands.util.Worlds;
import skylands.util.SkylandsTexts;
import skylands.util.SkylandsWorlds;

import static com.mojang.brigadier.arguments.StringArgumentType.word;
import static net.minecraft.command.argument.EntityArgumentType.player;
Expand Down Expand Up @@ -61,42 +61,42 @@ static void init(CommandDispatcher<ServerCommandSource> dispatcher) {
static void ban(ServerPlayerEntity player, ServerPlayerEntity banned) {
Skylands.instance.islands.get(player).ifPresentOrElse(island -> {
if(player.getName().getString().equals(banned.getName().getString())) {
player.sendMessage(Texts.prefixed("message.skylands.ban_player.yourself"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.ban_player.yourself"));
}
else {
if(island.isMember(banned)) {
player.sendMessage(Texts.prefixed("message.skylands.ban_player.member"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.ban_player.member"));
}
else {
if(island.isBanned(banned)) {
player.sendMessage(Texts.prefixed("message.skylands.ban_player.fail"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.ban_player.fail"));
}
else {
island.bans.add(new Member(banned));
player.sendMessage(Texts.prefixed("message.skylands.ban_player.success", map -> map.put("%player%", banned.getName().getString())));
banned.sendMessage(Texts.prefixed("message.skylands.ban_player.ban", map -> map.put("%owner%", island.owner.name)));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.ban_player.success", map -> map.put("%player%", banned.getName().getString())));
banned.sendMessage(SkylandsTexts.prefixed("message.skylands.ban_player.ban", map -> map.put("%owner%", island.owner.name)));

Worlds.getIsland(banned.getWorld()).ifPresent(isl -> {
SkylandsWorlds.getIsland(banned.getWorld()).ifPresent(isl -> {
if(isl.owner.uuid.equals(island.owner.uuid)) {
banned.sendMessage(Texts.prefixed("message.skylands.hub_visit"));
banned.sendMessage(SkylandsTexts.prefixed("message.skylands.hub_visit"));
Skylands.instance.hub.visit(player);
}
});
}
}
}
}, () -> player.sendMessage(Texts.prefixed("message.skylands.ban_player.no_island")));
}, () -> player.sendMessage(SkylandsTexts.prefixed("message.skylands.ban_player.no_island")));
}

static void unban(ServerPlayerEntity player, String unbanned) {
Skylands.instance.islands.get(player).ifPresentOrElse(island -> {
if(!island.isBanned(unbanned)) {
player.sendMessage(Texts.prefixed("message.skylands.unban_player.fail"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.unban_player.fail"));
}
else {
island.bans.removeIf(member -> member.name.equals(unbanned));
player.sendMessage(Texts.prefixed("message.skylands.unban_player.success", map -> map.put("%player%", unbanned)));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.unban_player.success", map -> map.put("%player%", unbanned)));
}
}, () -> player.sendMessage(Texts.prefixed("message.skylands.unban_player.no_island")));
}, () -> player.sendMessage(SkylandsTexts.prefixed("message.skylands.unban_player.no_island")));
}
}
6 changes: 3 additions & 3 deletions src/main/java/skylands/command/CreateCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import skylands.logic.Island;
import skylands.logic.IslandStuck;
import skylands.logic.Skylands;
import skylands.util.Texts;
import skylands.util.SkylandsTexts;

import static net.minecraft.server.command.CommandManager.literal;

Expand All @@ -28,14 +28,14 @@ static void run(ServerPlayerEntity player) {
IslandStuck islands = Skylands.instance.islands;

if(islands.get(player).isPresent()) {
player.sendMessage(Texts.prefixed("message.skylands.island_create.fail"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.island_create.fail"));
}
else {
Island island = islands.create(player);
if(Skylands.config.teleportAfterIslandCreation) {
island.visitAsMember(player);
}
player.sendMessage(Texts.prefixed("message.skylands.island_create.success"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.island_create.success"));
}
}
}
16 changes: 8 additions & 8 deletions src/main/java/skylands/command/DeleteCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.minecraft.server.network.ServerPlayerEntity;
import skylands.logic.IslandStuck;
import skylands.logic.Skylands;
import skylands.util.Texts;
import skylands.util.SkylandsTexts;

import java.time.Instant;
import java.time.temporal.ChronoUnit;
Expand Down Expand Up @@ -43,18 +43,18 @@ static void run(ServerPlayerEntity player, String confirmWord) {

if(seconds >= Skylands.config.islandDeletionCooldown) {
islands.delete(player);
player.sendMessage(Texts.prefixed("message.skylands.island_delete.success"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.island_delete.success"));
}
else {
player.sendMessage(Texts.prefixed("message.skylands.island_delete.too_often"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.island_delete.too_often"));
}

}, () -> {
player.sendMessage(Texts.prefixed("message.skylands.island_delete.fail"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.island_delete.fail"));
});
}
else {
player.sendMessage(Texts.prefixed("message.skylands.island_delete.warning"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.island_delete.warning"));
}
}

Expand All @@ -67,14 +67,14 @@ static void warn(ServerPlayerEntity player) {
var hours = ChronoUnit.HOURS.between(created, now);

if(hours >= 24) {
player.sendMessage(Texts.prefixed("message.skylands.island_delete.warning"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.island_delete.warning"));
}
else {
player.sendMessage(Texts.prefixed("message.skylands.island_delete.too_often"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.island_delete.too_often"));
}

}, () -> {
player.sendMessage(Texts.prefixed("message.skylands.island_delete.fail"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.island_delete.fail"));
});
}
}
16 changes: 8 additions & 8 deletions src/main/java/skylands/command/HomeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import skylands.SkylandsMod;
import skylands.data.SkylandsComponents;
import skylands.logic.Skylands;
import skylands.util.Texts;
import skylands.util.SkylandsTexts;

import static com.mojang.brigadier.arguments.StringArgumentType.word;
import static net.minecraft.server.command.CommandManager.argument;
Expand Down Expand Up @@ -53,33 +53,33 @@ static void init(CommandDispatcher<ServerCommandSource> dispatcher) {
public static void run(ServerPlayerEntity player) {
Skylands.instance.islands.get(player).ifPresentOrElse(island -> {
if(player.getWorld().getRegistryKey().getValue().equals(SkylandsMod.id(player.getUuid().toString()))) {
player.sendMessage(Texts.prefixed("message.skylands.home.fail"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.home.fail"));
}
else {
player.sendMessage(Texts.prefixed("message.skylands.home.success"));
player.sendMessage(SkylandsTexts.prefixed("message.skylands.home.success"));
island.visitAsMember(player);
}
}, () -> player.sendMessage(Texts.prefixed("message.skylands.home.no_island")));
}, () -> player.sendMessage(SkylandsTexts.prefixed("message.skylands.home.no_island")));
}

public static void run(ServerPlayerEntity visitor, String islandOwner) {
Skylands.instance.islands.get(islandOwner).ifPresentOrElse(island -> {
if(visitor.getWorld().getRegistryKey().getValue().equals(SkylandsMod.id(island.owner.uuid.toString()))) {
visitor.sendMessage(Texts.prefixed("message.skylands.visit_home.fail", map -> map.put("%owner%", islandOwner)));
visitor.sendMessage(SkylandsTexts.prefixed("message.skylands.visit_home.fail", map -> map.put("%owner%", islandOwner)));
}
else {
if(island.isMember(visitor)) {
visitor.sendMessage(Texts.prefixed("message.skylands.visit_home.success", map -> map.put("%owner%", islandOwner)));
visitor.sendMessage(SkylandsTexts.prefixed("message.skylands.visit_home.success", map -> map.put("%owner%", islandOwner)));
island.visitAsMember(visitor);
SkylandsComponents.PLAYER_DATA.get(visitor).addIsland(islandOwner);
}
else {
visitor.sendMessage(Texts.prefixed("message.skylands.visit_home.not_member"));
visitor.sendMessage(SkylandsTexts.prefixed("message.skylands.visit_home.not_member"));
SkylandsComponents.PLAYER_DATA.get(visitor).removeIsland(islandOwner);
}
}
}, () -> {
visitor.sendMessage(Texts.prefixed("message.skylands.visit_home.no_island"));
visitor.sendMessage(SkylandsTexts.prefixed("message.skylands.visit_home.no_island"));
SkylandsComponents.PLAYER_DATA.get(visitor).removeIsland(islandOwner);
});
}
Expand Down
Loading

0 comments on commit 01af1af

Please sign in to comment.