Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config option for Greater Teleport item splatting #841

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public interface ServerConfigAccess {

boolean isActionAllowedInCircles(ResourceLocation actionID);

boolean doesGreaterTeleportSplatItems();

boolean doVillagersTakeOffenseAtMindMurder();

// fun fact, although dimension keys are a RegistryHolder, they aren't a registry, so i can't do tags
Expand All @@ -81,6 +83,7 @@ public interface ServerConfigAccess {
int DEFAULT_OP_BREAK_HARVEST_LEVEL = 3;

double DEFAULT_TRADER_SCROLL_CHANCE = 0.2;
boolean DEFAULT_GREATER_TELEPORT_SPLATS_ITEMS = true;

boolean DEFAULT_VILLAGERS_DISLIKE_MIND_MURDER = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object OpTeleport : SpellAction {

teleportRespectSticky(teleportee, delta, env.world)

if (teleportee is ServerPlayer && teleportee == env.castingEntity) {
if (HexConfig.server().doesGreaterTeleportSplatItems() && teleportee is ServerPlayer && teleportee == env.castingEntity) {
// Drop items conditionally, based on distance teleported.
// MOST IMPORTANT: Never drop main hand item, since if it's a trinket, it will get duplicated later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@
"": "Circle Action Deny List",
"@Tooltip": "Resource locations of disallowed actions within circles. Trying to cast one of these from a circle will result in a mishap.",
},
greaterTeleportSplatsItems: {
"": "Greater Teleport Splats Items",
"@Tooltip": "Whether items should fly out of the player's inventory when using Greater Teleport"
},
villagersOffendedByMindMurder: {
"": "Villagers Offended By Mind Murder",
"@Tooltip": "Whether villagers should be angry at the player when other villagers are mindflayed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ public static final class Server implements HexConfig.ServerConfigAccess, Config
@ConfigEntry.Gui.Tooltip
private List<String> circleActionDenyList = List.of();
@ConfigEntry.Gui.Tooltip
private boolean greaterTeleportSplatsItems = DEFAULT_GREATER_TELEPORT_SPLATS_ITEMS;
@ConfigEntry.Gui.Tooltip
private boolean villagersOffendedByMindMurder = DEFAULT_VILLAGERS_DISLIKE_MIND_MURDER;
@ConfigEntry.Gui.Tooltip
private boolean doesTrueNameHaveAmbit = DEFAULT_TRUE_NAME_HAS_AMBIT;
Expand Down Expand Up @@ -291,6 +293,9 @@ public boolean isActionAllowedInCircles(ResourceLocation actionID) {
return noneMatch(circleActionDenyList, actionID);
}

@Override
public boolean doesGreaterTeleportSplatItems() { return greaterTeleportSplatsItems; }

@Override
public boolean doVillagersTakeOffenseAtMindMurder() {
return villagersOffendedByMindMurder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ public static class Server implements HexConfig.ServerConfigAccess {
private static ForgeConfigSpec.IntValue maxSpellCircleLength;
private static ForgeConfigSpec.ConfigValue<List<? extends String>> actionDenyList;
private static ForgeConfigSpec.ConfigValue<List<? extends String>> circleActionDenyList;

private static ForgeConfigSpec.BooleanValue greaterTeleportSplatsItems;
private static ForgeConfigSpec.BooleanValue villagersOffendedByMindMurder;
private static ForgeConfigSpec.ConfigValue<List<? extends String>> tpDimDenyList;
private static ForgeConfigSpec.BooleanValue doesTrueNameHaveAmbit;
Expand Down Expand Up @@ -176,6 +178,10 @@ public Server(ForgeConfigSpec.Builder builder) {
"Resource locations of disallowed actions. Trying to cast one of these will result in a mishap.")
.defineList("actionDenyList", List.of(), Server::isValidReslocArg);

greaterTeleportSplatsItems = builder.comment(
"Should items fly out of the player's inventory when using Greater Teleport?"
).define("greaterTeleportSplatsItems", DEFAULT_GREATER_TELEPORT_SPLATS_ITEMS);

villagersOffendedByMindMurder = builder.comment(
"Should villagers take offense when you flay the mind of their fellow villagers?")
.define("villagersOffendedByMindMurder", true);
Expand Down Expand Up @@ -213,6 +219,9 @@ public boolean isActionAllowedInCircles(ResourceLocation actionID) {
return noneMatch(circleActionDenyList.get(), actionID);
}

@Override
public boolean doesGreaterTeleportSplatItems() { return greaterTeleportSplatsItems.get(); }

@Override
public boolean doVillagersTakeOffenseAtMindMurder() {
return villagersOffendedByMindMurder.get();
Expand Down
Loading