-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
121 additions
and
22 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/dev/kikugie/shulkerfix/ShulkerFixProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package dev.kikugie.shulkerfix; | ||
|
||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.util.WorldSavePath; | ||
|
||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
public class ShulkerFixProperties { | ||
public boolean seenRuleNotification; | ||
|
||
public ShulkerFixProperties(boolean seenRuleNotification) { | ||
this.seenRuleNotification = seenRuleNotification; | ||
} | ||
|
||
public void save(MinecraftServer server) { | ||
if (seenRuleNotification) try { | ||
Path marker = server.getSavePath(WorldSavePath.ROOT).resolve("data/shulkerfix.marker"); | ||
Files.createDirectories(marker.getParent()); | ||
Files.createFile(marker); | ||
Files.writeString(marker, "\uD83C\uDF4C"); | ||
} catch (Exception e) { | ||
ShulkerFixMod.LOGGER.warn("Failed to create marker file for shulkerfix", e); | ||
} | ||
} | ||
|
||
public static ShulkerFixProperties load(MinecraftServer server) { | ||
Path marker = server.getSavePath(WorldSavePath.ROOT).resolve("data/shulkerfix.marker"); | ||
boolean marked = Files.exists(marker); | ||
return new ShulkerFixProperties(marked); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/dev/kikugie/shulkerfix/mixin/compat/CarpetSettingsManagerAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package dev.kikugie.shulkerfix.mixin.compat; | ||
|
||
import carpet.api.settings.CarpetRule; | ||
import carpet.api.settings.SettingsManager; | ||
import net.minecraft.server.command.ServerCommandSource; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Invoker; | ||
|
||
@Mixin(value = SettingsManager.class, remap = false) | ||
public interface CarpetSettingsManagerAccessor { | ||
@Invoker | ||
@SuppressWarnings("UnusedReturnValue") | ||
int invokeSetDefault(ServerCommandSource source, CarpetRule<?> rule, String stringValue); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
{ | ||
"carpet.category.shulkerfix": "ShulkerFix", | ||
"carpet.rule.hopperShulkerStacking.name": "Hopper Shulker Box Stacking", | ||
"carpet.rule.hopperShulkerStacking.desc": "Controls whenever hopper transfers should stack shulkers in containers.", | ||
"carpet.rule.overstackedShulkerSignalStrength.name": "Overstacked Shulker Signal Strength", | ||
"carpet.rule.overstackedShulkerSignalStrength.desc": "Makes stacked shulkers create stronger comparator output, also known as OSS/HSS.", | ||
"carpet.rule.clientShulkerSync.name": "Sync Stacked Shulker Count", | ||
"carpet.rule.clientShulkerSync.desc": "Fixes displayed shulker amount on vanilla clients. See issue #1899 in Carpet's repo.", | ||
"carpet.rule.hopperCollectSingleShulkers.name": "Hoppers Collect Single Shulkers", | ||
"carpet.rule.hopperCollectSingleShulkers.desc": "Makes hoppers pick up single shulkers from a stack entity.", | ||
"carpet.rule.minecartCollectSingleShulkers.name": "Hopper Minecarts Collect Single Shulkers", | ||
"carpet.rule.minecartCollectSingleShulkers.desc": "Makes hopper minecarts pick up single shulkers from a stack entity.", | ||
"carpet.rule.overstackedMinecartSlowdown.name": "Overstacked Minecart Slowdown", | ||
"carpet.rule.overstackedMinecartSlowdown.desc": "Disables additional slowdown caused by overstacked shulker boxes when set to false." | ||
"carpet.rule.overstackedMinecartSlowdown.desc": "Disables additional slowdown caused by overstacked shulker boxes when set to false.", | ||
|
||
"shulkerfix.message.seenRuleNotification": "§a[ShulkerFix]§r The default functionality of this mod has been moved to §bhopperShulkerStacking§b and §boverstackedShulkerSignalStrength§r Carpet rules. For compatibility reasons the functionality has been enabled for this world. This only happens for the first time a world is loaded and you can disable the rules if you want." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters