This repository has been archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
92f3dc9
commit b6f0df1
Showing
13 changed files
with
176 additions
and
199 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
core-api/src/main/java/dev/compactmods/machines/api/Constants.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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
package dev.compactmods.machines.api; | ||
|
||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public interface Constants { | ||
String MOD_ID = "compactmachines"; | ||
|
||
static ResourceLocation modRL(String path) { | ||
return new ResourceLocation(MOD_ID, path); | ||
} | ||
} |
42 changes: 0 additions & 42 deletions
42
core-api/src/main/java/dev/compactmods/machines/api/Messages.java
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
core-api/src/main/java/dev/compactmods/machines/api/Tooltips.java
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
core-api/src/main/java/dev/compactmods/machines/api/Translations.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,35 @@ | ||
package dev.compactmods.machines.api; | ||
|
||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.Util; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.phys.AABB; | ||
|
||
import java.util.function.Function; | ||
import java.util.function.Supplier; | ||
|
||
import static dev.compactmods.machines.api.Constants.MOD_ID; | ||
|
||
public interface Translations { | ||
|
||
Supplier<Component> HINT_HOLD_SHIFT = () -> Component.translatableWithFallback(IDs.HINT_HOLD_SHIFT, "Hold shift for details.") | ||
.withStyle(ChatFormatting.DARK_GRAY) | ||
.withStyle(ChatFormatting.ITALIC); | ||
|
||
Supplier<Component> UNBREAKABLE_BLOCK = () -> Component.translatableWithFallback(IDs.UNBREAKABLE_BLOCK, "Warning! Unbreakable for non-creative players!") | ||
.withStyle(ChatFormatting.DARK_RED); | ||
|
||
Supplier<Component> TELEPORT_OUT_OF_BOUNDS = () -> Component | ||
.translatableWithFallback(IDs.TELEPORT_OUT_OF_BOUNDS, "An otherworldly force prevents your teleportation.") | ||
.withStyle(ChatFormatting.DARK_RED) | ||
.withStyle(ChatFormatting.ITALIC); | ||
|
||
interface IDs { | ||
String TELEPORT_OUT_OF_BOUNDS = Util.makeDescriptionId("messages", Constants.modRL("teleport_oob")); | ||
String HOW_DID_YOU_GET_HERE = Util.makeDescriptionId("messages", Constants.modRL("how_did_you_get_here")); | ||
String HINT_HOLD_SHIFT = Util.makeDescriptionId("messages", Constants.modRL("hint.hold_shift")); | ||
String UNBREAKABLE_BLOCK = Util.makeDescriptionId("messages", Constants.modRL("solid_wall")); | ||
} | ||
} |
38 changes: 0 additions & 38 deletions
38
core-api/src/main/java/dev/compactmods/machines/api/command/CMCommands.java
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
core-api/src/main/java/dev/compactmods/machines/api/command/CommandTranslations.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,33 @@ | ||
package dev.compactmods.machines.api.command; | ||
|
||
import dev.compactmods.machines.api.Constants; | ||
import net.minecraft.Util; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.entity.player.Player; | ||
|
||
import java.util.function.Function; | ||
import java.util.function.Supplier; | ||
|
||
import static dev.compactmods.machines.api.Constants.MOD_ID; | ||
|
||
public interface CommandTranslations { | ||
|
||
Supplier<Component> CANNOT_GIVE_MACHINE = () -> Component.translatableWithFallback(IDs.CANNOT_GIVE_MACHINE, "Cannot give machine."); | ||
|
||
Function<Player, Component> MACHINE_GIVEN = (player) -> Component | ||
.translatableWithFallback(IDs.MACHINE_GIVEN, "Created a new machine item and gave it to %s.", player.getDisplayName()); | ||
|
||
interface IDs { | ||
String CANNOT_GIVE_MACHINE = Util.makeDescriptionId("commands.machines", Constants.modRL("cannot_give_machine_item")); | ||
|
||
String MACHINE_GIVEN = Util.makeDescriptionId("commands.machines", Constants.modRL("machine_given_successfully")); | ||
|
||
/** | ||
* Used for displaying the number of registered rooms via summary commands. | ||
*/ | ||
String ROOM_COUNT = Util.makeDescriptionId("commands.rooms", new ResourceLocation(MOD_ID, "room_reg_count")); | ||
|
||
String SPAWN_CHANGED_SUCCESSFULLY = Util.makeDescriptionId("commands.rooms", new ResourceLocation(MOD_ID, "spawn_changed_successfully")); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
core-api/src/main/java/dev/compactmods/machines/api/machine/MachineTranslations.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,24 @@ | ||
package dev.compactmods.machines.api.machine; | ||
|
||
import dev.compactmods.machines.api.Constants; | ||
import net.minecraft.Util; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.particles.BlockParticleOption; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.resources.ResourceLocation; | ||
import org.apache.commons.lang3.function.TriFunction; | ||
|
||
import java.util.function.Function; | ||
import java.util.function.Supplier; | ||
|
||
public interface MachineTranslations { | ||
|
||
Function<BlockPos, Component> NOT_A_MACHINE_BLOCK = (pos) -> Component.empty(); | ||
|
||
interface IDs { | ||
String OWNER = Util.makeDescriptionId("machine", Constants.modRL("machine.owner")); | ||
String SIZE = Util.makeDescriptionId("machine", Constants.modRL("machine.size")); | ||
String BOUND_TO = Util.makeDescriptionId("machine", Constants.modRL("machine.bound_to")); | ||
String NEW_MACHINE = Util.makeDescriptionId("machine", Constants.modRL("new_machine")); | ||
} | ||
} |
69 changes: 0 additions & 69 deletions
69
core/src/main/java/dev/compactmods/machines/i18n/TranslationUtil.java
This file was deleted.
Oops, something went wrong.
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
61 changes: 61 additions & 0 deletions
61
room-api/src/main/java/dev/compactmods/machines/api/room/RoomTranslations.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,61 @@ | ||
package dev.compactmods.machines.api.room; | ||
|
||
import com.mojang.authlib.GameProfile; | ||
import dev.compactmods.machines.api.Constants; | ||
import dev.compactmods.machines.api.room.function.PlayerAndRoomCodeFunction; | ||
import dev.compactmods.machines.api.util.AABBHelper; | ||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.Util; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.network.chat.MutableComponent; | ||
import net.minecraft.world.entity.player.Player; | ||
|
||
import java.util.function.BiFunction; | ||
import java.util.function.Function; | ||
|
||
public interface RoomTranslations { | ||
|
||
/** | ||
* Used to show information about a player inside a Compact room. | ||
*/ | ||
PlayerAndRoomCodeFunction<Component> PLAYER_ROOM_INFO = (player, roomCode) -> | ||
Component.translatableWithFallback(IDs.PLAYER_ROOM_INFO, "%1$s is inside room '%2$s'.", | ||
player.getDisplayName(), roomCode); | ||
|
||
Function<Player, Component> PLAYER_NOT_IN_COMPACT_DIM = (player) -> Component.translatableWithFallback(IDs.Errors.PLAYER_NOT_IN_COMPACT_DIM, "", player.getDisplayName()); | ||
|
||
Function<Player, Component> UNKNOWN_ROOM_BY_PLAYER_CHUNK = (player) -> Component.translatableWithFallback(IDs.Errors.UNKNOWN_ROOM_BY_PLAYER_CHUNK, "Room not found at chunk: %s", player.chunkPosition()) | ||
.withStyle(ChatFormatting.DARK_RED); | ||
|
||
Function<String, Component> UNKNOWN_ROOM_BY_CODE = (roomCode) -> Component.translatableWithFallback(IDs.Errors.UNKNOWN_ROOM_BY_CODE, "Room not found: %s", roomCode); | ||
|
||
BiFunction<BlockPos, RoomInstance, Component> MACHINE_ROOM_INFO = (machinePos, info) -> Component.translatableWithFallback(IDs.MACHINE_ROOM_INFO, | ||
"Machine at %1$s is bound to a %2$s size room at %3$s", | ||
machinePos.toShortString(), AABBHelper.toString(info.boundaries().innerBounds()), info.boundaries().innerBounds().getCenter()); | ||
|
||
Function<GameProfile, Component> CANNOT_RENAME_NOT_OWNER = (owner) -> Component | ||
.translatableWithFallback(IDs.Errors.CANNOT_RENAME_NOT_OWNER, "You are not the room owner; only %s may make changes.", owner.getName()); | ||
|
||
PlayerAndRoomCodeFunction<Component> ROOM_SPAWNPOINT_SET = (player, roomCode) -> Component | ||
.translatableWithFallback(IDs.ROOM_SPAWNPOINT_SET, "Room spawn for %s updated.", player.getDisplayName()) | ||
.withStyle(ChatFormatting.GREEN); | ||
|
||
interface IDs { | ||
String ROOM_SPAWNPOINT_SET = Util.makeDescriptionId("rooms", Constants.modRL("spawnpoint_set")); | ||
|
||
String PLAYER_ROOM_INFO = Util.makeDescriptionId("rooms", Constants.modRL("player_room_info")); | ||
|
||
String MACHINE_ROOM_INFO = Util.makeDescriptionId("machine", Constants.modRL("machine_room_info")); | ||
|
||
interface Errors { | ||
String UNKNOWN_ROOM_BY_CODE = Util.makeDescriptionId("rooms.errors", Constants.modRL("room_not_found")); | ||
|
||
String CANNOT_ENTER_ROOM = Util.makeDescriptionId("rooms.errors", Constants.modRL("cannot_enter")); | ||
|
||
String UNKNOWN_ROOM_BY_PLAYER_CHUNK = Util.makeDescriptionId("rooms.errors", Constants.modRL("unknown_room_chunk")); | ||
|
||
String PLAYER_NOT_IN_COMPACT_DIM = Util.makeDescriptionId("rooms.errors", Constants.modRL("player_not_in_compact_dimension")); | ||
} | ||
} | ||
} |
Oops, something went wrong.