mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-19 16:03:22 +02:00
Merge branch 'master' into snapshot
# Conflicts: # gradle.properties # src/main/java/one/oth3r/sit/ModMenu.java # src/main/resources/fabric.mod.json
This commit is contained in:
commit
7365b31f66
11 changed files with 105 additions and 61 deletions
|
@ -7,6 +7,8 @@
|
|||
Sit on **stairs**, **slabs**, **carpets** by default, and sit on everything else using the config!
|
||||
You can also customize hand restrictions to stop accidentally sitting down!
|
||||
The mod also has full Geyser support! Enjoy sitting with everyone, weather they are on Bedrock or Java!
|
||||
### Where to install?
|
||||
**Sit!** works on the server (singleplayer included), with support for clients that join in to use their own settings to sit.
|
||||
## Help localize Sit! on [Crowdin](https://crowdin.com/project/oth3r-sit)!
|
||||

|
||||
## Check out my other Projects!
|
||||
|
@ -16,8 +18,10 @@ The mod also has full Geyser support! Enjoy sitting with everyone, weather they
|
|||
# Features
|
||||
### Hand Restrictions
|
||||
Don't want to accidentally sit down? Set custom restrictions for each hand in the config!
|
||||
* Per player hand restrictions when connecting to a `Sit!` server on a `Sit!` Client!
|
||||
|
||||

|
||||
|
||||
### Custom Blocks
|
||||
Want to sit on _**EVERY**_ block? With the config you can add more options to sit on! Custom block states are also supported.
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ org.gradle.parallel=true
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=1.20.3-rc1
|
||||
yarn_mappings=1.20.3-rc1+build.2
|
||||
minecraft_version=1.20.4
|
||||
yarn_mappings=1.20.4+build.1
|
||||
loader_version=0.15.0
|
||||
|
||||
# Mod Properties
|
||||
mod_version=s1.1.0+1.20.3-pre1-1.20.3-rc1
|
||||
mod_version=1.1.3+1.20.2-1.20.4
|
||||
maven_group=one.oth3r
|
||||
archives_base_name=sit!
|
||||
|
||||
|
|
|
@ -159,10 +159,12 @@ public class Events {
|
|||
}
|
||||
}
|
||||
}
|
||||
entity.updatePositionAndAngles(entity.getX(),entity.getY(),entity.getZ(),0,0);
|
||||
//1.20.2 mounting pos change (shifts everything down by .25)
|
||||
double oneTwentyTwo = .25;
|
||||
entity.updatePositionAndAngles(entity.getX(),entity.getY()+oneTwentyTwo,entity.getZ(),0,0);
|
||||
entity.setBoundingBox(Box.of(Vec3d.of(pos),1.5,hitBoxY,1.5));
|
||||
//change pitch based on if player is sitting below block height or not
|
||||
if (entity.getY() <= pos.getY()+.35) entity.setPitch(90); // below
|
||||
if (entity.getY() <= pos.getY()+.35+oneTwentyTwo) entity.setPitch(90); // below
|
||||
else entity.setPitch(-90); // above
|
||||
}
|
||||
public static void register() {
|
||||
|
|
0
src/main/java/one/oth3r/sit/ModMenu.java
Normal file
0
src/main/java/one/oth3r/sit/ModMenu.java
Normal file
|
@ -1,5 +1,6 @@
|
|||
package one.oth3r.sit;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
@ -11,11 +12,11 @@ import java.nio.charset.StandardCharsets;
|
|||
public class PacketBuilder {
|
||||
public static final String SETTINGS = "settings_v1.0";
|
||||
private final String message;
|
||||
private PacketByteBuf packetByteBuf = PacketByteBufs.create();
|
||||
public PacketBuilder(PacketByteBuf buf) {
|
||||
private final PacketByteBuf packetByteBuf = PacketByteBufs.create();
|
||||
public PacketBuilder(ByteBuf buf) {
|
||||
// Read any data sent in the packet
|
||||
message = buf.toString(StandardCharsets.UTF_8);
|
||||
packetByteBuf = buf;
|
||||
packetByteBuf.writeBytes(buf);
|
||||
}
|
||||
public PacketBuilder(String message) {
|
||||
this.message = message;
|
||||
|
|
|
@ -41,7 +41,8 @@ public class Sit implements ModInitializer {
|
|||
//PACKETS
|
||||
ServerPlayNetworking.registerGlobalReceiver(PacketBuilder.getIdentifier(),
|
||||
(server, player, handler, buf, responseSender) -> {
|
||||
PacketBuilder packet = new PacketBuilder(buf);
|
||||
// copy to not throw errors
|
||||
PacketBuilder packet = new PacketBuilder(buf.copy());
|
||||
server.execute(() -> {
|
||||
Type hashMapToken = new TypeToken<HashMap<String, Object>>() {}.getType();
|
||||
Gson gson = new GsonBuilder().disableHtmlEscaping().create();
|
||||
|
|
|
@ -134,51 +134,47 @@ public class config {
|
|||
try (var file = Files.newBufferedWriter(configFile().toPath(), StandardCharsets.UTF_8)) {
|
||||
Gson gson = new GsonBuilder().disableHtmlEscaping().create();
|
||||
file.write("# Sit! Config\n");
|
||||
file.write(("\nversion="+defaults.version));
|
||||
file.write(("\n# all available languages: en_us, ru_ru"));
|
||||
file.write(("\nlang=" + lang));
|
||||
file.write(("\n\n# "+lang("general.keep_active.description")));
|
||||
file.write(("\nkeep-active=" + keepActive));
|
||||
file.write(("\n# "+lang("general.sit_while_seated.description")));
|
||||
file.write(("\nsit-while-seated=" + sitWhileSeated));
|
||||
file.write(("\n# "+lang("general.sittable.description")));
|
||||
file.write(("\nstairs=" + stairsOn));
|
||||
file.write(("\nslabs=" + slabsOn));
|
||||
file.write(("\ncarpets=" + carpetsOn));
|
||||
file.write(("\nfull-blocks=" + fullBlocksOn));
|
||||
file.write(("\ncustom=" + customOn));
|
||||
file.write(("\n# "+Sit.lang("config.sit."+
|
||||
file.write("\nversion="+defaults.version);
|
||||
file.write("\n# all available languages: en_us, ru_ru, es_es");
|
||||
file.write("\nlang=" + lang);
|
||||
file.write("\n\n# "+lang("general.keep_active.description"));
|
||||
file.write("\nkeep-active=" + keepActive);
|
||||
file.write("\n# "+lang("general.sit_while_seated.description"));
|
||||
file.write("\nsit-while-seated=" + sitWhileSeated);
|
||||
file.write("\n# "+lang("general.sittable.description"));
|
||||
file.write("\nstairs=" + stairsOn);
|
||||
file.write("\nslabs=" + slabsOn);
|
||||
file.write("\ncarpets=" + carpetsOn);
|
||||
file.write("\nfull-blocks=" + fullBlocksOn);
|
||||
file.write("\ncustom=" + customOn);
|
||||
file.write("\n# "+Sit.lang("config.sit."+
|
||||
"general.sittable_blocks.description")
|
||||
.append("\n# ").append(lang("general.sittable_blocks.description_2"))
|
||||
.append(lang("general.sittable_blocks.description_3",
|
||||
lang("general.sittable_blocks.description_3_2"),
|
||||
lang("general.sittable_blocks.description_3_3"),
|
||||
lang("general.sittable_blocks.description_3_4"),
|
||||
lang("general.sittable_blocks.description_3_5")))
|
||||
.append("\n# ").append(lang("general.sittable_blocks.description_2",
|
||||
"\"minecraft:campfire|0.255|1|lit=false\""))
|
||||
.append("\n# ").append(lang("general.sittable_blocks.description_4"))
|
||||
.append("\n# ").append(lang("general.sittable_blocks.description_5"))
|
||||
.append("\n# ").append(lang("general.sittable_blocks.description_6"))
|
||||
.append("\n# ").append(lang("general.sittable_blocks.description_7"))
|
||||
.append("\n# ").append(lang("general.sittable_blocks.description_8"))));
|
||||
file.write(("\ncustom-blocks="+gson.toJson(customBlocks)));
|
||||
file.write(("\n\n# "+lang("hand")));
|
||||
file.write(("\n# "+Sit.lang("config.sit."+
|
||||
.append("\n# ").append(lang("general.sittable_blocks.description_8")).getString());
|
||||
file.write("\ncustom-blocks="+gson.toJson(customBlocks));
|
||||
file.write("\n\n# "+lang("hand"));
|
||||
file.write("\n# "+Sit.lang("config.sit."+
|
||||
"hand.requirements.description")
|
||||
.append("\n# ").append(lang("hand.requirements.description_2"))
|
||||
.append("\n# ").append(lang("hand.requirements.description_3"))
|
||||
.append("\n# ").append(lang("hand.requirements.description_4"))));
|
||||
file.write(("\nhand.main.requirement=" + mainReq));
|
||||
file.write(("\nhand.main.block=" + mainBlock));
|
||||
file.write(("\nhand.main.food=" + mainFood));
|
||||
file.write(("\nhand.main.usable=" + mainUsable));
|
||||
file.write(("\nhand.main.whitelist="+gson.toJson(mainWhitelist)));
|
||||
file.write(("\nhand.main.blacklist="+gson.toJson(mainBlacklist)));
|
||||
file.write(("\nhand.off.requirement=" + offReq));
|
||||
file.write(("\nhand.off.block=" + offBlock));
|
||||
file.write(("\nhand.off.food=" + offFood));
|
||||
file.write(("\nhand.off.usable=" + offUsable));
|
||||
file.write(("\nhand.off.whitelist="+gson.toJson(offWhitelist)));
|
||||
file.write(("\nhand.off.blacklist="+gson.toJson(offBlacklist)));
|
||||
.append("\n# ").append(lang("hand.requirements.description_4")).getString());
|
||||
file.write("\nhand.main.requirement=" + mainReq);
|
||||
file.write("\nhand.main.block=" + mainBlock);
|
||||
file.write("\nhand.main.food=" + mainFood);
|
||||
file.write("\nhand.main.usable=" + mainUsable);
|
||||
file.write("\nhand.main.whitelist="+gson.toJson(mainWhitelist));
|
||||
file.write("\nhand.main.blacklist="+gson.toJson(mainBlacklist));
|
||||
file.write("\nhand.off.requirement=" + offReq);
|
||||
file.write("\nhand.off.block=" + offBlock);
|
||||
file.write("\nhand.off.food=" + offFood);
|
||||
file.write("\nhand.off.usable=" + offUsable);
|
||||
file.write("\nhand.off.whitelist="+gson.toJson(offWhitelist));
|
||||
file.write("\nhand.off.blacklist="+gson.toJson(offBlacklist));
|
||||
// send packets to update the settings on the server
|
||||
if (SitClient.inGame) SitClient.sendPackets();
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -22,12 +22,7 @@
|
|||
"config.sit.general.sittable.custom.description": "Enables adding custom blocks to sit on.",
|
||||
"config.sit.general.sittable_blocks": "Custom Sittable Blocks",
|
||||
"config.sit.general.sittable_blocks.description": "Add custom sittable blocks!",
|
||||
"config.sit.general.sittable_blocks.description_2": "Example: ",
|
||||
"config.sit.general.sittable_blocks.description_3": "\"%s|%s|%s|%s\"",
|
||||
"config.sit.general.sittable_blocks.description_3_2": "minecraft:campfire",
|
||||
"config.sit.general.sittable_blocks.description_3_3": ".255",
|
||||
"config.sit.general.sittable_blocks.description_3_4": "1",
|
||||
"config.sit.general.sittable_blocks.description_3_5": "lit=false",
|
||||
"config.sit.general.sittable_blocks.description_2": "Example: %s",
|
||||
"config.sit.general.sittable_blocks.description_4": "First entry: custom block",
|
||||
"config.sit.general.sittable_blocks.description_5": "Second entry: sitting height (number from 0-1 eg 0.52)",
|
||||
"config.sit.general.sittable_blocks.description_6": "Third entry: hitbox size (where the player spawns above the entity when dismounting)",
|
||||
|
|
51
src/main/resources/assets/sit/lang/es_es.json
Normal file
51
src/main/resources/assets/sit/lang/es_es.json
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"config.sit.empty": "Vacía",
|
||||
"config.sit.restrictive": "Restrictiva",
|
||||
"config.sit.none": "Ninguna",
|
||||
"config.sit.category.general": "General",
|
||||
"config.sit.category.general.tooltip": "Configuración general",
|
||||
"config.sit.category.main_hand": "Mano principal",
|
||||
"config.sit.category.main_hand.tooltip": "Ajustes de la mano principal",
|
||||
"config.sit.category.off_hand": "Mano secundaria",
|
||||
"config.sit.category.off_hand.tooltip": "Ajustes de la mano secundaria",
|
||||
"config.sit.general.keep_active": "Mantener activo",
|
||||
"config.sit.general.keep_active.description": "Mantener entidades activas incluso al cerrar sesión o al apagar el servidor",
|
||||
"config.sit.general.sittable": "Bloques aptos para sentarse",
|
||||
"config.sit.general.sittable.description": "Activa/Desactiva los tipos de bloques en los que se puede sentar.",
|
||||
"config.sit.general.sit_while_seated": "Cambiar de asiento",
|
||||
"config.sit.general.sit_while_seated.description": "Permite cambiar de asiento estando sentado.",
|
||||
"config.sit.general.sittable.stairs": "Escaleras",
|
||||
"config.sit.general.sittable.slabs": "Losas",
|
||||
"config.sit.general.sittable.carpets": "Alfombras",
|
||||
"config.sit.general.sittable.full_blocks": "Bloques Enteros",
|
||||
"config.sit.general.sittable.custom": "Personalizados",
|
||||
"config.sit.general.sittable.custom.description": "Permitir sentarse en los bloques personalizados.",
|
||||
"config.sit.general.sittable_blocks": "Bloques Personalizados",
|
||||
"config.sit.general.sittable_blocks.description": "¡Añadir bloques personalizados para sentarse!",
|
||||
"config.sit.general.sittable_blocks.description_2": "Ejemplo: %s",
|
||||
"config.sit.general.sittable_blocks.description_4": "Primera entrada: bloque personalizado",
|
||||
"config.sit.general.sittable_blocks.description_5": "Segunda entrada: altura del asiento (número entre 0 y 1, por ejemplo, 0.52)",
|
||||
"config.sit.general.sittable_blocks.description_6": "Tercera entrada: Altura del bloque (en que altura del bloque el jugador aparece al pararse)",
|
||||
"config.sit.general.sittable_blocks.description_7": "Cuarta entrada (opcional): estado del bloque requerido para sentarse (Usa una exclamación (!) para excluir estados)",
|
||||
"config.sit.general.sittable_blocks.description_8": "¡Separar diferentes entradas con \"|\"!",
|
||||
"config.sit.hand": "Configuración de mano",
|
||||
"config.sit.hand.requirements": "Requisitos",
|
||||
"config.sit.hand.requirements.description": "Requisitos de la mano para sentarse.",
|
||||
"config.sit.hand.requirements.description_2": "Vacía = la mano debe estar vacía",
|
||||
"config.sit.hand.requirements.description_3": "Restrictiva = establecer restricciones para el estado de la mano",
|
||||
"config.sit.hand.requirements.description_4": "Ninguna = sin restricciones ni requisitos",
|
||||
"config.sit.hand.restrictions": "Restricciones",
|
||||
"config.sit.hand.restrictions.description": "Activa/Desactiva las restricciones preestablecidas de la mano para sentarse.",
|
||||
"config.sit.hand.restrictions.blocks": "Bloques",
|
||||
"config.sit.hand.restrictions.food": "Comida",
|
||||
"config.sit.hand.restrictions.usable": "Utilizable",
|
||||
"config.sit.hand.restrictions.usable.description": "Ejemplos: arcos, tridentes, escudo",
|
||||
"config.sit.hand.whitelist": "Lista blanca",
|
||||
"config.sit.hand.whitelist.description": "Crea una lista blanca personalizada para objetos con los que el jugador puede sentarse.",
|
||||
"config.sit.hand.blacklist": "Lista negra",
|
||||
"config.sit.hand.blacklist.description": "Crea una lista negra personalizada para objetos con los que el jugador no puede sentarse.",
|
||||
"config.sit.hand.list.description": "Ejemplo: ",
|
||||
"config.sit.hand.list.description_2": "\"minecraft:torch\"",
|
||||
"key.sit.command.reloaded": "¡Configuración recargada!",
|
||||
"key.sit.command.purged": "¡Se purgaron a todas las entidades activas de sillas!"
|
||||
}
|
|
@ -22,17 +22,13 @@
|
|||
"config.sit.general.sittable.custom.description": "Позволяет добавить собственные блоки, на которые можно сесть.",
|
||||
"config.sit.general.sittable_blocks": "Собственные блоки для сидения",
|
||||
"config.sit.general.sittable_blocks.description": "Добавь свой блок для сидения!",
|
||||
"config.sit.general.sittable_blocks.description_2": "Пример: ",
|
||||
"config.sit.general.sittable_blocks.description_3": "\"%s|%s|%s|%s\"",
|
||||
"config.sit.general.sittable_blocks.description_3_2": "minecraft:campfire",
|
||||
"config.sit.general.sittable_blocks.description_3_3": ".255",
|
||||
"config.sit.general.sittable_blocks.description_3_4": "1",
|
||||
"config.sit.general.sittable_blocks.description_3_5": "lit=false",
|
||||
"config.sit.general.sittable_blocks.description_2": "Пример: %s",
|
||||
"config.sit.general.sittable_blocks.description_4": "Первый вход: собственный блок",
|
||||
"config.sit.general.sittable_blocks.description_5": "Второй вход: высота сидения (число от 0 до 1, например 0.52)",
|
||||
"config.sit.general.sittable_blocks.description_6": "Третий вход: размер хитбокса (место, где игрок появляется над объектом при спешивании)",
|
||||
"config.sit.general.sittable_blocks.description_7": "Четвертый вход (опционально): требуемое состояние блока для сидения (Вставьте \"!\" для исключения состояния блоков)",
|
||||
"config.sit.general.sittable_blocks.description_8": "Разделяйте разные входы знаком \"|\"!",
|
||||
"config.sit.hand": "Настройки руки",
|
||||
"config.sit.hand.requirements": "Требования",
|
||||
"config.sit.hand.requirements.description": "Что нужно, чтобы сесть.",
|
||||
"config.sit.hand.requirements.description_2": "Пусто = рука должна быть пуста",
|
||||
|
|
|
@ -24,9 +24,7 @@
|
|||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.21",
|
||||
"minecraft": [
|
||||
">=1.20.3-beta.1 <=1.20.3-rc.10"
|
||||
],
|
||||
"minecraft": ">=1.20.2 <=1.20.4",
|
||||
"java": ">=17",
|
||||
"fabric-api": "*"
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue