Skip to content

Commit

Permalink
1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gliscowo committed Nov 8, 2024
1 parent a0bc169 commit 8b42efe
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 56 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation "dev.emi:trinkets:${project.trinkets_version}"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}"
// modImplementation "dev.emi:trinkets:${project.trinkets_version}"
// modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}"
// modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}"

modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"

Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_base_version=1.21
minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11
minecraft_base_version=1.21.2
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.9
# Mod Properties
mod_version=0.4.1
maven_group=com.glisco
archives_base_name=deathlog
# Dependencies
fabric_version=0.100.1+1.21
fabric_version=0.107.3+1.21.3

# https://github.com/emilyploszaj/trinkets/releases
trinkets_version=3.10.0

# https://maven.ladysnake.org/#/releases/dev/onyxstudios/cardinal-components-api/cardinal-components-api/cardinal-components-base
cca_version=6.1.0
cca_version=6.2.0

# https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu
modmenu_version=11.0.0
modmenu_version=12.0.0-beta.1

# https://maven.wispforest.io/io/wispforest/owo-lib/
owo_version=0.12.10+1.21
owo_version=0.12.18+1.21.2

14 changes: 6 additions & 8 deletions src/main/java/com/glisco/deathlog/DeathLogCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import com.glisco.deathlog.death_info.DeathInfoPropertyType;
import com.glisco.deathlog.death_info.DeathInfoPropertyTypes;
import com.glisco.deathlog.death_info.SpecialPropertyProvider;
import com.glisco.deathlog.death_info.properties.TrinketComponentProperty;
import com.glisco.deathlog.network.DeathLogPackets;
import com.glisco.deathlog.storage.DeathLogStorage;
import io.wispforest.owo.registration.reflect.AutoRegistryContainer;
Expand All @@ -18,8 +16,8 @@
public class DeathLogCommon implements ModInitializer {

public static final Registry<DeathInfoPropertyType<?>> PROPERTY_TYPES = FabricRegistryBuilder
.createSimple(RegistryKey.<DeathInfoPropertyType<?>>ofRegistry(Identifier.of("deathlog", "property_type")))
.buildAndRegister();
.createSimple(RegistryKey.<DeathInfoPropertyType<?>>ofRegistry(Identifier.of("deathlog", "property_type")))
.buildAndRegister();

private static DeathLogStorage currentStorage = null;
private static boolean usePermissions;
Expand All @@ -28,10 +26,10 @@ public class DeathLogCommon implements ModInitializer {
public void onInitialize() {
AutoRegistryContainer.register(DeathInfoPropertyTypes.class, "deathlog", false);

if (FabricLoader.getInstance().isModLoaded("trinkets")) {
SpecialPropertyProvider.register(TrinketComponentProperty::apply);
Registry.register(PROPERTY_TYPES, Identifier.of("deathlog", "trinkets"), TrinketComponentProperty.Type.INSTANCE);
}
// if (FabricLoader.getInstance().isModLoaded("trinkets")) {
// SpecialPropertyProvider.register(TrinketComponentProperty::apply);
// Registry.register(PROPERTY_TYPES, Identifier.of("deathlog", "trinkets"), TrinketComponentProperty.Type.INSTANCE);
// }

usePermissions = FabricLoader.getInstance().isModLoaded("fabric-permissions-api-v0");

Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/glisco/deathlog/client/gui/DeathLogToast.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package com.glisco.deathlog.client.gui;

import com.glisco.deathlog.mixin.SystemToastAccessor;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.toast.SystemToast;
import net.minecraft.client.toast.Toast;
import net.minecraft.client.toast.ToastManager;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import org.jetbrains.annotations.Nullable;

Expand All @@ -15,9 +10,4 @@ public DeathLogToast(Type type, Text title, @Nullable Text description) {
super(type, title, description);
}

@Override
public Visibility draw(DrawContext context, ToastManager manager, long startTime) {
super.draw(context, manager, startTime);
return startTime - ((SystemToastAccessor) this).deathlog_getStartTime() < 10000L ? Toast.Visibility.SHOW : Toast.Visibility.HIDE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public abstract class DeathInfoPropertyType<P extends DeathInfoProperty> {

public static final Endec<DeathInfoPropertyType<?>> ENDEC = MinecraftEndecs.IDENTIFIER.xmap(
identifier -> DeathLogCommon.PROPERTY_TYPES.getOrEmpty(identifier).orElse(new MissingDeathInfoProperty.Type(identifier)),
identifier -> DeathLogCommon.PROPERTY_TYPES.getOptionalValue(identifier).orElse(new MissingDeathInfoProperty.Type(identifier)),
DeathInfoPropertyType::getId
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
package com.glisco.deathlog.death_info.properties;

import com.glisco.deathlog.client.DeathInfo;
import com.glisco.deathlog.death_info.DeathInfoPropertyType;
import com.glisco.deathlog.death_info.RestorableDeathInfoProperty;
import dev.emi.trinkets.api.TrinketsApi;
import io.wispforest.endec.StructEndec;
import io.wispforest.endec.impl.StructEndecBuilder;
import io.wispforest.owo.serialization.RegistriesAttribute;
import io.wispforest.owo.serialization.format.nbt.NbtEndec;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.Inventories;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.util.collection.DefaultedList;
import org.jetbrains.annotations.Nullable;

public class TrinketComponentProperty implements RestorableDeathInfoProperty {

public static final StructEndec<TrinketComponentProperty> ENDEC = StructEndecBuilder.of(
public class TrinketComponentProperty /*implements RestorableDeathInfoProperty*/ {

/*public static final StructEndec<TrinketComponentProperty> ENDEC = StructEndecBuilder.of(
NbtEndec.COMPOUND.xmapWithContext(
(ctx, nbt) -> new NbtWithRegistries(nbt, ctx.getAttributeValue(RegistriesAttribute.REGISTRIES).registryManager()),
(ctx, nbt) -> nbt.nbt
Expand Down Expand Up @@ -90,5 +70,5 @@ public boolean displayedInInfoView() {
public StructEndec<TrinketComponentProperty> endec() {
return TrinketComponentProperty.ENDEC;
}
}
}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected BaseDeathLogStorage(DynamicRegistryManager registries) {

protected CompletableFuture<List<DeathInfo>> load(DynamicRegistryManager registries, File file) {
final var future = new CompletableFuture<List<DeathInfo>>();
Util.getIoWorkerExecutor().submit(() -> {
Util.getIoWorkerExecutor().service().submit(() -> {
if (errored) {
LOGGER.warn("Attempted to load DeathLog database even though disk operations are disabled");
future.complete(null);
Expand Down Expand Up @@ -93,7 +93,7 @@ protected CompletableFuture<List<DeathInfo>> load(DynamicRegistryManager registr

protected void save(DynamicRegistryManager registries, File file, List<DeathInfo> listIn) {
final var list = ImmutableList.copyOf(listIn);
Util.getIoWorkerExecutor().submit(() -> {
Util.getIoWorkerExecutor().service().submit(() -> {
if (errored) {
LOGGER.warn("Attempted to save DeathLog database even though disk operations are disabled");
return;
Expand Down

0 comments on commit 8b42efe

Please sign in to comment.