diff --git a/build.gradle b/build.gradle index 1b97fc4..7ab749e 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,7 @@ repositories { maven { url "https://maven.shedaniel.me/" } maven { url "https://maven.kotlindiscord.com/repository/terraformers/" } maven {url "https://maven.kyrptonaught.dev"} + maven { url "https://maven.terraformersmc.com/releases"} } dependencies { @@ -29,7 +30,7 @@ dependencies { } modApi("com.terraformersmc:modmenu:${project.modmenu_version}") - //modImplementation('net.kyrptonaught:quickshulker:1.2.2-1.17') + modImplementation('net.kyrptonaught:quickshulker:1.3.1-1.18') } processResources { diff --git a/gradle.properties b/gradle.properties index 3d2e0f7..22c60a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ yarn_mappings=1.18+build.1 loader_version=0.12.6 # Mod Properties -mod_version=2.4.0-1.18.0 +mod_version=2.5.0-1.18.0 maven_group=de.dafuqs.lootcrates archives_base_name=ModularLootcrates diff --git a/src/main/java/de/dafuqs/lootcrates/compat/QuickShulkerCompat.java b/src/main/java/de/dafuqs/lootcrates/compat/QuickShulkerCompat.java index 1147dcc..0df8fc7 100644 --- a/src/main/java/de/dafuqs/lootcrates/compat/QuickShulkerCompat.java +++ b/src/main/java/de/dafuqs/lootcrates/compat/QuickShulkerCompat.java @@ -1,7 +1,8 @@ -/*package de.dafuqs.lootcrates.compat; +package de.dafuqs.lootcrates.compat; import de.dafuqs.lootcrates.LootCrateAtlas; import de.dafuqs.lootcrates.LootCrates; +import de.dafuqs.lootcrates.blocks.barrel.LootBarrelBlock; import de.dafuqs.lootcrates.blocks.chest.ChestLootCrateBlock; import de.dafuqs.lootcrates.blocks.shulker.ShulkerLootCrateBlock; import de.dafuqs.lootcrates.enums.LootCrateRarity; @@ -42,6 +43,7 @@ public class QuickShulkerCompat implements RegisterQuickShulker { public void registerProviders() { QuickOpenableRegistry.register(ShulkerLootCrateBlock.class, true, false, ((player, stack) -> { if (LootCrates.CONFIG.ShulkerCratesKeepTheirInventory) { + checkRelock(player, stack); if (isLocked(stack)) { if(consumeKey(player, LootCrateAtlas.getCrateItemRarity(stack.getItem()))) { unlock(player, stack); @@ -58,6 +60,7 @@ public void registerProviders() { QuickOpenableRegistry.register(ChestLootCrateBlock.class, true, false, ((player, stack) -> { if (LootCrates.CONFIG.ChestCratesKeepTheirInventory) { + checkRelock(player, stack); if (isLocked(stack)) { if(consumeKey(player, LootCrateAtlas.getCrateItemRarity(stack.getItem()))) { unlock(player, stack); @@ -71,6 +74,23 @@ public void registerProviders() { } } })); + + QuickOpenableRegistry.register(LootBarrelBlock.class, true, false, ((player, stack) -> { + if (LootCrates.CONFIG.LootBarrelsKeepTheirInventory) { + checkRelock(player, stack); + if (isLocked(stack)) { + if(consumeKey(player, LootCrateAtlas.getCrateItemRarity(stack.getItem()))) { + unlock(player, stack); + } else { + printLockedMessage(player, stack); + } + } else { + checkLootInteraction(stack, (ServerPlayerEntity) player); + player.openHandledScreen(new SimpleNamedScreenHandlerFactory((i, playerInventory, playerEntity) -> + new ShulkerBoxScreenHandler(i, player.getInventory(), ShulkerUtils.getInventoryFromShulker(stack)), stack.hasCustomName() ? stack.getName() : new TranslatableText("container.lootcrates.loot_barrel"))); + } + } + })); } private boolean isLocked(ItemStack stack) { @@ -237,4 +257,4 @@ public void saveNbtToStack(ItemStack stack, long lastReplenishTimeTick, boolean } } } -}*/ \ No newline at end of file +} \ No newline at end of file