Skip to content

Commit

Permalink
Update to 1.20.5 with datafixer support. Testing still required
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Apr 24, 2024
1 parent f7f1f48 commit 3f38980
Show file tree
Hide file tree
Showing 38 changed files with 491 additions and 237 deletions.
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id 'fabric-loom' version '1.4.+'
id 'fabric-loom' version '1.6.+'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
id 'com.matthewprenger.cursegradle' version '1.4.0'
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand Down Expand Up @@ -56,13 +56,13 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"


modImplementation include("eu.pb4:sgui:1.4.2+1.20.4")
modImplementation include("eu.pb4:placeholder-api:2.3.0+1.20.3")
modImplementation include('xyz.nucleoid:server-translations-api:2.2.0+1.20.3-rc1')
modImplementation include('eu.pb4:polymer-core:0.7.7+1.20.4')
modImplementation include('eu.pb4:polymer-resource-pack:0.7.7+1.20.4')
modImplementation include('eu.pb4:polymer-virtual-entity:0.7.7+1.20.4')
modImplementation include('eu.pb4:predicate-api:0.3.0+1.20.2')
modImplementation include("eu.pb4:sgui:1.5.0+1.20.5")
modImplementation include("eu.pb4:placeholder-api:2.4.0-pre.1+1.20.5")
modImplementation include('xyz.nucleoid:server-translations-api:2.3.0+1.20.5-rc2')
modImplementation include('eu.pb4:polymer-core:0.8.0-beta.6+1.20.5')
modImplementation include('eu.pb4:polymer-resource-pack:0.8.0-beta.6+1.20.5')
modImplementation include('eu.pb4:polymer-virtual-entity:0.8.0-beta.6+1.20.5')
modImplementation include('eu.pb4:predicate-api:0.4.0+1.20.5')
modImplementation include("eu.pb4:common-protection-api:1.0.0")

modImplementation include("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.1
loader_version=0.15.3
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.15.10

fabric_version=0.91.1+1.20.4
fabric_version=0.95.6+1.20.5


# Mod Properties
mod_version = 3.2.2+1.20.4
mod_version = 3.3.0+1.20.5
maven_group = eu.pb4
archives_base_name = graves

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
46 changes: 35 additions & 11 deletions src/main/java/eu/pb4/graves/CardboardWarning.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,37 @@

import com.mojang.logging.LogUtils;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;
import org.slf4j.Logger;

import java.util.List;

public class CardboardWarning implements PreLaunchEntrypoint {
public static final String MOD_NAME = "Universal Graves";
public static final Logger LOGGER = LogUtils.getLogger();
public static final boolean LOADED = FabricLoader.getInstance().isModLoaded("cardboard") || FabricLoader.getInstance().isModLoaded("banner");

// Overwrite heavy and generally problematic bukkit implementation
private static final List<String> BROKEN_BUKKIT_IMPL = List.of("cardboard", "banner", "arclight");

public static final String BUKKIT_NAME;
public static final boolean LOADED;

static {
var name = "";
var loaded = false;
for (var x : BROKEN_BUKKIT_IMPL) {
var m = FabricLoader.getInstance().getModContainer(x);
if (m.isPresent()) {
name = m.get().getMetadata().getName() + " (" + x + ")";
loaded = true;
break;
}
}

BUKKIT_NAME = name;
LOADED = loaded;
}

@Override
public void onPreLaunch() {
Expand All @@ -17,15 +42,14 @@ public void onPreLaunch() {
public static void checkAndAnnounce() {
if (LOADED) {
LOGGER.error("==============================================");
for (var i = 0; i < 4; i++) {
LOGGER.error("");
LOGGER.error("Cardboard/Banner detected! This mod doesn't work with it!");
LOGGER.error("You won't get any support as long as it's present!");
LOGGER.error("");
LOGGER.error("Read more at: https://gist.github.com/Patbox/e44844294c358b614d347d369b0fc3bf");
LOGGER.error("");
LOGGER.error("==============================================");
}
LOGGER.error("");
LOGGER.error(BUKKIT_NAME + " detected! This mod is known to cause issues!");
LOGGER.error(MOD_NAME + " might not work correctly because of it.");
LOGGER.error("You won't get any support as long as it's present!");
LOGGER.error("");
LOGGER.error("Read more at: https://gist.github.com/Patbox/e44844294c358b614d347d369b0fc3bf");
LOGGER.error("");
LOGGER.error("==============================================");
}
}
}
}
8 changes: 6 additions & 2 deletions src/main/java/eu/pb4/graves/GravesMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import eu.pb4.graves.registry.*;
import eu.pb4.polymer.core.api.block.PolymerBlockUtils;
import eu.pb4.polymer.core.api.entity.PolymerEntityUtils;
import eu.pb4.polymer.core.api.item.PolymerItemUtils;
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.ModInitializer;
Expand Down Expand Up @@ -57,6 +58,9 @@ public void onInitialize() {
Registry.register(Registries.BLOCK, new Identifier("universal_graves", "container_grave"), ContainerGraveBlock.INSTANCE);
Registry.register(Registries.BLOCK, new Identifier("universal_graves", "temp_block"), TempBlock.INSTANCE);
Registry.register(Registries.ENTITY_TYPE, new Identifier("universal_graves", "xp"), SafeXPEntity.TYPE);
Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("universal_graves", "compass"), GraveCompassComponent.TYPE);
Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("universal_graves", "texture"), IconItem.TEXTURE);
PolymerItemUtils.markAsPolymer(GraveCompassComponent.TYPE, IconItem.TEXTURE);
PolymerEntityUtils.registerType(SafeXPEntity.TYPE);
GraveBlockEntity.BLOCK_ENTITY_TYPE = Registry.register(Registries.BLOCK_ENTITY_TYPE, "universal_graves:grave", FabricBlockEntityTypeBuilder.create(GraveBlockEntity::new, GraveBlock.INSTANCE).build(null));
VisualGraveBlockEntity.BLOCK_ENTITY_TYPE = Registry.register(Registries.BLOCK_ENTITY_TYPE, "universal_graves:visual_grave", FabricBlockEntityTypeBuilder.create(VisualGraveBlockEntity::new, VisualGraveBlock.INSTANCE).build(null));
Expand Down Expand Up @@ -94,14 +98,14 @@ public void onInitialize() {
SaveGearOnDeathCompat.register();
}

ServerLifecycleEvents.SERVER_STARTING.register((server) -> ConfigManager.loadConfig());
ServerLifecycleEvents.SERVER_STARTING.register((server) -> ConfigManager.loadConfig(server.getRegistryManager()));
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
CardboardWarning.checkAndAnnounce();
});

ServerWorldEvents.LOAD.register(((server, world) -> {
if (world == server.getOverworld()) {
GraveManager.INSTANCE = world.getPersistentStateManager().getOrCreate(GraveManager.TYPE, "universal-graves");
GraveManager.INSTANCE = world.getPersistentStateManager().getOrCreate(GraveManager.getType(server), "universal-graves");
GraveManager.INSTANCE.setServer(server);
}
}));
Expand Down
Loading

0 comments on commit 3f38980

Please sign in to comment.