Skip to content

Commit

Permalink
update to 1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGoosik committed Jan 12, 2023
1 parent bd45f10 commit 7017efb
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 51 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/publish-curseforge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ jobs:
fabric
quilt
game-versions: |
1.19
1.19.1
1.19.2
1.19.3
dependencies: |
fabric-api | depends | *
java: |
17
retry-attempts: 2
retry-delay: 10000
retry-delay: 10000
4 changes: 1 addition & 3 deletions .github/workflows/publish-modrinth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ jobs:
fabric
quilt
game-versions: |
1.19
1.19.1
1.19.2
1.19.3
dependencies: |
fabric-api | depends | *
Expand Down
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ 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:5.0.2"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.0.2"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-world:5.0.2"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.0.2"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-api:5.1.0"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.1.0"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-world:5.1.0"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.1.0"

// modImplementation include("eu.pb4:sgui:1.1.5+1.19.1")
modImplementation include("xyz.nucleoid:fantasy:0.4.7+1.19.2")
modImplementation include("xyz.nucleoid:fantasy:0.4.8+1.19.3") // https://github.com/NucleoidMC/fantasy/releases
// modImplementation include("eu.pb4:sidebar-api:0.1.1+1.19")
modImplementation include("eu.pb4:placeholder-api:2.0.0-beta.7+1.19")
modImplementation include("fr.catcore:server-translations-api:1.4.17+1.19.2")
modImplementation include("eu.pb4:placeholder-api:2.0.0-pre.2+1.19.3") // https://github.com/Patbox/TextPlaceholderAPI/releases
modImplementation include("fr.catcore:server-translations-api:1.4.19+1.19.3") // https://github.com/NucleoidMC/Server-Translations/releases
modImplementation include("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")

modLocalRuntime "maven.modrinth:ferrite-core:5.0.0-fabric"
modLocalRuntime "maven.modrinth:ferrite-core:5.1.0-fabric"
modLocalRuntime "maven.modrinth:lazydfu:0.1.3"
modLocalRuntime "maven.modrinth:starlight:1.1.1+1.19"
modLocalRuntime "maven.modrinth:lithium:mc1.19.2-0.10.1"
modLocalRuntime "maven.modrinth:lithium:mc1.19.3-0.10.4"
}

processResources {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ org.gradle.parallel = true
# Mod Properties
maven_group = ru.pinkgoosik
archives_base_name = skylands
mod_version = 0.2.0
mod_version = 0.3.0

# Dependencies | Check these on https://fabricmc.net/develop
minecraft_version = 1.19.2
yarn_mappings = 1.19.2+build.28
minecraft_version = 1.19.3
yarn_mappings = 1.19.3+build.5
fabric_loader = 0.14.12
fabric_api = 0.69.0+1.19.2
fabric_api = 0.72.0+1.19.3
25 changes: 11 additions & 14 deletions src/main/java/skylands/logic/Island.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package skylands.logic;

import com.mojang.serialization.Lifecycle;
import net.fabricmc.fabric.api.dimension.v1.FabricDimensions;
import net.minecraft.block.Block;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.structure.StructurePlacementData;
import net.minecraft.structure.StructureSet;
import net.minecraft.structure.StructureTemplate;
import net.minecraft.util.BlockMirror;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.SimpleRegistry;
import net.minecraft.util.math.random.RandomSeed;
import net.minecraft.world.Difficulty;
import net.minecraft.world.TeleportTarget;
import net.minecraft.world.biome.BiomeKeys;
Expand All @@ -32,11 +29,11 @@

import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.UUID;

public class Island {
private static final Registry<StructureSet> EMPTY_STRUCTURE_REGISTRY = new SimpleRegistry<>(Registry.STRUCTURE_SET_KEY, Lifecycle.stable(), (x) -> null).freeze();
MinecraftServer server = Skylands.instance.server;
Skylands skylands = Skylands.instance;
Fantasy fantasy = Skylands.instance.fantasy;
Expand Down Expand Up @@ -182,16 +179,16 @@ public RuntimeWorldHandle getHandler() {
}

private RuntimeWorldConfig createIslandConfig() {
FlatChunkGeneratorConfig flat = new FlatChunkGeneratorConfig(Optional.empty(), BuiltinRegistries.BIOME);
flat.setBiome(this.server.getRegistryManager().get(Registry.BIOME_KEY).getOrCreateEntry(BiomeKeys.PLAINS));
FlatChunkGenerator generator = new FlatChunkGenerator(EMPTY_STRUCTURE_REGISTRY, flat);
var biome = this.server.getRegistryManager().get(RegistryKeys.BIOME).getEntry(this.server.getRegistryManager().get(RegistryKeys.BIOME).getOrThrow(BiomeKeys.PLAINS));
FlatChunkGeneratorConfig flat = new FlatChunkGeneratorConfig(Optional.empty(), biome, List.of());
FlatChunkGenerator generator = new FlatChunkGenerator(flat);

return new RuntimeWorldConfig()
.setDimensionType(DimensionTypes.OVERWORLD)
.setGenerator(generator)
.setDifficulty(Difficulty.NORMAL)
.setShouldTickTime(true)
.setSeed(123L);
.setSeed(RandomSeed.getSeed());
}

public RuntimeWorldHandle getNetherHandler() {
Expand All @@ -202,16 +199,16 @@ public RuntimeWorldHandle getNetherHandler() {
}

private RuntimeWorldConfig createNetherConfig() {
FlatChunkGeneratorConfig flat = new FlatChunkGeneratorConfig(Optional.empty(), BuiltinRegistries.BIOME);
flat.setBiome(this.server.getRegistryManager().get(Registry.BIOME_KEY).getOrCreateEntry(BiomeKeys.NETHER_WASTES));
FlatChunkGenerator generator = new FlatChunkGenerator(EMPTY_STRUCTURE_REGISTRY, flat);
var biome = this.server.getRegistryManager().get(RegistryKeys.BIOME).getEntry(this.server.getRegistryManager().get(RegistryKeys.BIOME).getOrThrow(BiomeKeys.NETHER_WASTES));
FlatChunkGeneratorConfig flat = new FlatChunkGeneratorConfig(Optional.empty(), biome, List.of());
FlatChunkGenerator generator = new FlatChunkGenerator(flat);

return new RuntimeWorldConfig()
.setDimensionType(DimensionTypes.THE_NETHER)
.setGenerator(generator)
.setDifficulty(Difficulty.NORMAL)
.setShouldTickTime(true)
.setSeed(123L);
.setSeed(RandomSeed.getSeed());
}

public ServerWorld getEnd() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package skylands.mixin.block.entity;

import net.minecraft.block.entity.EndGatewayBlockEntity;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.registry.RegistryKey;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -11,7 +11,7 @@
@Mixin(EndGatewayBlockEntity.class)
public class EndGatewayBlockEntityMixin {

@Redirect(method = "tryTeleportingEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getRegistryKey()Lnet/minecraft/util/registry/RegistryKey;"))
@Redirect(method = "tryTeleportingEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getRegistryKey()Lnet/minecraft/registry/RegistryKey;"))
private static RegistryKey<World> tryTeleportingEntity_redirectRegistryKey(World instance) {
return Worlds.redirect(instance.getRegistryKey());
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/skylands/mixin/entity/EntityMixin.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package skylands.mixin.entity;

import net.minecraft.entity.Entity;
import net.minecraft.registry.RegistryKey;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand Down Expand Up @@ -37,18 +37,18 @@ public RegistryKey<World> tickPortal_modifyRegistryKey(RegistryKey<World> instan
return instance;
}

@Redirect(method = "getTeleportTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/util/registry/RegistryKey;"))
@Redirect(method = "getTeleportTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/registry/RegistryKey;"))
public RegistryKey<World> getTeleportTarget_redirectRegistryKey0(ServerWorld instance) {
return Worlds.redirect(instance.getRegistryKey());
}

@Redirect(method = "getTeleportTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getRegistryKey()Lnet/minecraft/util/registry/RegistryKey;"))
@Redirect(method = "getTeleportTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getRegistryKey()Lnet/minecraft/registry/RegistryKey;"))
public RegistryKey<World> getTeleportTarget_redirectRegistryKey(World instance) {
return Worlds.redirect(instance.getRegistryKey());
}


@Redirect(method = "moveToWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/util/registry/RegistryKey;", ordinal = 0))
@Redirect(method = "moveToWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/registry/RegistryKey;", ordinal = 0))
public RegistryKey<World> moveToWorld_redirectRegistryKey(ServerWorld instance) {
return Worlds.redirect(instance.getRegistryKey());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package skylands.mixin.entity;

import net.minecraft.registry.RegistryKey;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -12,17 +12,17 @@
@Mixin(ServerPlayerEntity.class)
public abstract class ServerPlayerEntityMixin {

@Redirect(method = "moveToWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/util/registry/RegistryKey;"))
@Redirect(method = "moveToWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/registry/RegistryKey;"))
public RegistryKey<World> moveToWorld_redirectRegistryKey(ServerWorld instance) {
return Worlds.redirect(instance.getRegistryKey());
}

@Redirect(method = "getTeleportTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/util/registry/RegistryKey;"))
@Redirect(method = "getTeleportTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/registry/RegistryKey;"))
public RegistryKey<World> getTeleportTarget_redirectRegistryKey(ServerWorld instance) {
return Worlds.redirect(instance.getRegistryKey());
}

@Redirect(method = "worldChanged", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/util/registry/RegistryKey;"))
@Redirect(method = "worldChanged", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;getRegistryKey()Lnet/minecraft/registry/RegistryKey;"))
public RegistryKey<World> worldChanged_redirectRegistryKey(ServerWorld instance) {
return Worlds.redirect(instance.getRegistryKey());
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/skylands/mixin/world/ServerWorldMixin.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package skylands.mixin.world;

import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.profiler.Profiler;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.MutableWorldProperties;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.World;
Expand All @@ -18,5 +18,4 @@ public abstract class ServerWorldMixin extends World implements StructureWorldAc
protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey<World> registryRef, RegistryEntry<DimensionType> dimension, Supplier<Profiler> profiler, boolean isClient, boolean debugWorld, long seed, int maxChainedNeighborUpdates) {
super(properties, registryRef, dimension, profiler, isClient, debugWorld, seed, maxChainedNeighborUpdates);
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package skylands.mixin.world.protection;

import net.minecraft.block.AbstractButtonBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.ButtonBlock;
import net.minecraft.block.WallMountedBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.ActionResult;
Expand All @@ -16,7 +16,7 @@
import skylands.util.Texts;
import skylands.util.WorldProtection;

@Mixin(AbstractButtonBlock.class)
@Mixin(ButtonBlock.class)
public abstract class ButtonMixin extends WallMountedBlock {

public ButtonMixin(Settings settings) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/skylands/util/UpdateChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static String getLatestRemote() {
if(ChronoUnit.HOURS.between(lastCheck, Instant.now()) >= 4) {
String remote = "0";
var versions = getModrinthVersions();
if(versions.isPresent()) {
if(versions.isPresent() && !versions.get().isEmpty()) {
remote = versions.get().get(0).versionNumber;
}
cachedLatest = remote;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/skylands/util/Worlds.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package skylands.util;

import net.minecraft.util.registry.RegistryKey;
import net.minecraft.registry.RegistryKey;
import net.minecraft.world.World;
import skylands.SkylandsMod;
import skylands.logic.Island;
Expand Down

0 comments on commit 7017efb

Please sign in to comment.