mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-19 16:03:22 +02:00
Merge branch '1.21.4' into 1.21.1
# Conflicts: # gradle.properties
This commit is contained in:
commit
e64027930d
43 changed files with 215 additions and 117 deletions
|
@ -91,19 +91,27 @@ public class CustomBlock {
|
|||
}
|
||||
|
||||
// a boolean to check if one of the blocks are in a filtered tag
|
||||
boolean tagCheck = false;
|
||||
// & a switch for if there is only not(!) tags
|
||||
boolean tagCheck = false, hasPositiveTags = false;
|
||||
|
||||
// for all the entered tags
|
||||
for (String tag : blockTags) {
|
||||
// substring to remove # and if needed, !
|
||||
// if there is a math for the NOT(!) tag, return false
|
||||
if (tag.startsWith("!") && blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), Identifier.of(tag.substring(2))))) return false;
|
||||
// if there is a match, return true
|
||||
if (blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), Identifier.tryParse(tag.substring(1))))) tagCheck = true;
|
||||
if (tag.startsWith("!")) {
|
||||
// if there is a match for the NOT(!) tag, return false
|
||||
Identifier id = Identifier.tryParse(tag.substring(2));
|
||||
if (id != null && blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), id))) return false;
|
||||
} else {
|
||||
// flip the hasPositiveTags boolean
|
||||
hasPositiveTags = true;
|
||||
// if there is a match, return true
|
||||
Identifier id = Identifier.tryParse(tag.substring(1));
|
||||
if (id != null && blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), id))) tagCheck = true;
|
||||
}
|
||||
}
|
||||
|
||||
// not returning true in the loop because there might be a (!) not tag that the block might fall into, after the block was already in another tag
|
||||
return tagCheck;
|
||||
// if there were any required tags, return whether we matched one
|
||||
// if there were only not(!) tags, and we didn't violate any, return true
|
||||
return hasPositiveTags? tagCheck : true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -51,22 +51,27 @@ public class CustomItem {
|
|||
}
|
||||
|
||||
// a boolean to check if one of the items are in a filtered tag
|
||||
boolean tagCheck = false;
|
||||
// & a switch for if there is only not(!) tags
|
||||
boolean tagCheck = false, hasPositiveTags = false;
|
||||
|
||||
// check the custom item tags
|
||||
for (String tag : itemTags) {
|
||||
// substring to remove # and if needed, "!"
|
||||
// if a NOT tag
|
||||
if (tag.startsWith("!")) {
|
||||
// if there is a math for the NOT(!) tag, return false
|
||||
if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), Identifier.of(tag.substring(2))))) return false;
|
||||
Identifier id = Identifier.tryParse(tag.substring(2));
|
||||
if (id != null && itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), id))) return false;
|
||||
} else {
|
||||
// flip the hasPositiveTags boolean
|
||||
hasPositiveTags = true;
|
||||
// else (normal tag), if there is a match, set tagCheck to true
|
||||
Identifier id = Identifier.tryParse(tag.substring(1));
|
||||
if (id != null && itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), id))) tagCheck = true;
|
||||
}
|
||||
// else (normal tag), if there is a match, set tagCheck to true
|
||||
else if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), Identifier.of(tag.substring(1))))) tagCheck = true;
|
||||
}
|
||||
|
||||
// not returning true in the loop because there might be a (!) not tag that the item might fall into, after the item was already in another tag
|
||||
return tagCheck;
|
||||
// if there were any required tags, return whether we matched one
|
||||
// if there were only not(!) tags, and we didn't violate any, return true
|
||||
return hasPositiveTags? tagCheck : true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,12 +27,12 @@ import java.util.stream.Collectors;
|
|||
public class ServerConfig implements CustomFile<ServerConfig> {
|
||||
|
||||
@SerializedName("version")
|
||||
private Double version = 2.2;
|
||||
private Double version = 2.3;
|
||||
|
||||
@SerializedName("lang")
|
||||
private String lang = "en_US";
|
||||
private String lang = "en_us";
|
||||
@SerializedName("lang-options")
|
||||
private final String langOptions = "en_US, it_IT, pt_BR, tr_TR, zh_TW, zh_CH, de_DE";
|
||||
private final String langOptions = "en_us, it_it, pt_br, tr_tr, zh_tw, zh_ch, de_de";
|
||||
|
||||
@SerializedName("keep-active")
|
||||
private Boolean keepActive = true;
|
||||
|
@ -276,6 +276,11 @@ public class ServerConfig implements CustomFile<ServerConfig> {
|
|||
if (version >= 2.0 && version <= 2.1) {
|
||||
version = 2.2;
|
||||
}
|
||||
if (version == 2.2) {
|
||||
// make sure that the lang is all lowercase
|
||||
version = 2.3;
|
||||
this.lang = this.lang.substring(0,3)+this.lang.substring(3).toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -77,7 +77,8 @@ public class Logic {
|
|||
* @return true if sitting was successful
|
||||
*/
|
||||
public static boolean sitLooking(ServerPlayerEntity player) {
|
||||
return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getServerWorld(),player,5),null);
|
||||
return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getServerWorld(),player,
|
||||
Utl.getPlayerReach(player)),null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.block.*;
|
|||
import net.minecraft.block.enums.BlockHalf;
|
||||
import net.minecraft.block.enums.SlabType;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.decoration.DisplayEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItem;
|
||||
|
@ -481,4 +482,13 @@ public class Utl {
|
|||
|
||||
return new BlockPos(player.getBlockPos());
|
||||
}
|
||||
|
||||
public static double getPlayerReach(PlayerEntity player) {
|
||||
// use the BLOCK_INTERACTION_RANGE attribute if available
|
||||
if (player.getAttributeInstance(EntityAttributes.BLOCK_INTERACTION_RANGE) != null) {
|
||||
return player.getAttributeValue(EntityAttributes.BLOCK_INTERACTION_RANGE);
|
||||
}
|
||||
// fallback to 5
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "Sitzen",
|
||||
"key.sit!.config": "Konfiguration öffnen",
|
||||
"sit!.screen.config": "Sit! Konfiguration",
|
||||
"sit!.gui.button.file": "Datei öffnen",
|
||||
"sit!.gui.button.folder": "Ordner öffnen",
|
||||
"sit!.gui.button.reset": "Zurücksetzen",
|
||||
"sit!.gui.button.issues": "Probleme",
|
||||
"sit!.gui.button.donate": "Spenden",
|
||||
"sit!.gui.button.revert": "Änderungen rückgängig machen",
|
||||
"sit!.gui.button.save": "Speichern und schließen",
|
||||
"sit!.gui.button.website": "Website",
|
||||
"sit!.console.connected": "Verbunden mit Sit! Server: %s",
|
||||
"sit!.console.player_settings": "Benutzerdefinierte Sitzungseinstellungen von %s erhalten!",
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "Sentarse",
|
||||
"key.sit!.config": "Abrir configuración",
|
||||
"sit!.screen.config": "Configuracion de Sit!",
|
||||
"sit!.gui.button.file": "Abrir Archivo",
|
||||
"sit!.gui.button.folder": "Abrir Carpeta",
|
||||
"sit!.gui.button.reset": "Reiniciar",
|
||||
"sit!.gui.button.issues": "Problemas",
|
||||
"sit!.gui.button.donate": "Donar",
|
||||
"sit!.gui.button.revert": "Revertir cambios",
|
||||
"sit!.gui.button.save": "Guardar y salir",
|
||||
"sit!.gui.button.website": "Sitio web ",
|
||||
"sit!.console.player_settings": "¡Se recibió configuraciones personalizadas dé %s!",
|
||||
"modmenu.descriptionTranslation.sit-oth3r": "¡Añade la capacidad de sentarse a Minecraft! Configuración extensa para restricciones de mano y bloques sentables.\n ¡Los jugadores pueden tener su propia configuración cuando usan Sit! del lado del cliente en un servidor!"
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "S'asseoir",
|
||||
"key.sit!.config": "Ouvrir la configuration",
|
||||
"sit!.screen.config": "Sit! Config",
|
||||
"sit!.gui.button.file": "Ouvrir le fichier",
|
||||
"sit!.gui.button.folder": "Ouvrir le dossier",
|
||||
"sit!.gui.button.reset": "Restaurer",
|
||||
"sit!.gui.button.issues": "Problèmes",
|
||||
"sit!.gui.button.donate": "Faire un don",
|
||||
"sit!.gui.button.revert": "Annuler les modifications",
|
||||
"sit!.gui.button.save": "Enregistrer et fermer",
|
||||
"sit!.gui.button.website": "Site web",
|
||||
"sit!.console.connected": "Connecté au serveur Sit! : %s",
|
||||
"sit!.console.player_settings": "Reçu les paramètres de séance personnalisés de %s!",
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "Siediti",
|
||||
"key.sit!.config": "Apri Impostazioni",
|
||||
"sit!.screen.config": "Impostazioni Sit!",
|
||||
"sit!.gui.button.file": "Apri File",
|
||||
"sit!.gui.button.folder": "Apri Cartella",
|
||||
"sit!.gui.button.reset": "Resetta",
|
||||
"sit!.gui.button.issues": "Problemi",
|
||||
"sit!.gui.button.donate": "Dona",
|
||||
"sit!.gui.button.revert": "Annulla i Cambiamenti",
|
||||
"sit!.gui.button.save": "Salva ed Esci",
|
||||
"sit!.gui.button.website": "Sito Web",
|
||||
"sit!.console.connected": "Connesso al server Sit!: %s",
|
||||
"sit!.console.player_settings": "Ricevute impostazioni custom da %s!",
|
|
@ -44,12 +44,7 @@
|
|||
"key.sit!.toggle": "Przełącz możliwość siadania",
|
||||
"key.sit!.config": "Otwórz ustawienia",
|
||||
"sit!.screen.config": "Konfiguracja Sit!",
|
||||
"sit!.gui.button.file": "Otwórz plik",
|
||||
"sit!.gui.button.folder": "Otwórz folder",
|
||||
"sit!.gui.button.reset": "Reset",
|
||||
"sit!.gui.button.donate": "Wesprzyj",
|
||||
"sit!.gui.button.revert": "Cofnij zmiany",
|
||||
"sit!.gui.button.save": "Zapisz i zamknij",
|
||||
"sit!.gui.button.website": "Strona",
|
||||
"sit!.console.connected": "Połączono z serwerem wspierającym Sit!: %s",
|
||||
"sit!.console.player_settings": "Otrzymano niestandardowe ustawienia z: %s!",
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "Sentar",
|
||||
"key.sit!.config": "Abrir Configuração",
|
||||
"sit!.screen.config": "Configuração do Sit!",
|
||||
"sit!.gui.button.file": "Abrir Arquivo",
|
||||
"sit!.gui.button.folder": "Abrir Pasta",
|
||||
"sit!.gui.button.reset": "Reiniciar",
|
||||
"sit!.gui.button.issues": "Problemas",
|
||||
"sit!.gui.button.donate": "Doar",
|
||||
"sit!.gui.button.revert": "Reverter Alterações",
|
||||
"sit!.gui.button.save": "Salvar e Fechar",
|
||||
"sit!.gui.button.website": "Website",
|
||||
"sit!.console.connected": "Conectado ao servidor Sit!: %s",
|
||||
"sit!.console.player_settings": "Recebidas configurações de sentar personalizadas de %s!",
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "Sentar",
|
||||
"key.sit!.config": "Abrir definições",
|
||||
"sit!.screen.config": "Definições do Sit!",
|
||||
"sit!.gui.button.file": "Abrir ficheiro",
|
||||
"sit!.gui.button.folder": "Abrir pasta",
|
||||
"sit!.gui.button.reset": "Repor",
|
||||
"sit!.gui.button.issues": "Problemas",
|
||||
"sit!.gui.button.donate": "Doar",
|
||||
"sit!.gui.button.revert": "Reverter alterações",
|
||||
"sit!.gui.button.save": "Guardar e fechar",
|
||||
"sit!.gui.button.website": "Website",
|
||||
"sit!.console.connected": "Conectado ao servidor Sit!: %s",
|
||||
"sit!.console.player_settings": "Recebidas definições de sentar personalizadas de %s!",
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "Сесть",
|
||||
"key.sit!.config": "Открыть Конфигурацию",
|
||||
"sit!.screen.config": "Конфигурация Sit!",
|
||||
"sit!.gui.button.file": "Открыть Файл",
|
||||
"sit!.gui.button.folder": "Открыть Папку",
|
||||
"sit!.gui.button.reset": "Сбросить",
|
||||
"sit!.gui.button.issues": "Баг‑трекер",
|
||||
"sit!.gui.button.donate": "Пожертвовать",
|
||||
"sit!.gui.button.revert": "Отменить Изменения",
|
||||
"sit!.gui.button.save": "Сохранить и Закрыть",
|
||||
"sit!.gui.button.website": "Веб-сайт",
|
||||
"sit!.console.connected": "Подключено к серверу Sit!: %s",
|
||||
"sit!.console.player_settings": "Получены пользовательские настройки сидения от %s!",
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "Otur",
|
||||
"key.sit!.config": "Ayarlandırmaları aç",
|
||||
"sit!.screen.config": "Sit! Ayarlandırmaları",
|
||||
"sit!.gui.button.file": "Dosya Aç",
|
||||
"sit!.gui.button.folder": "Klasörü Aç",
|
||||
"sit!.gui.button.reset": "Sıfırla",
|
||||
"sit!.gui.button.issues": "Sorunlar",
|
||||
"sit!.gui.button.donate": "Bağış yap",
|
||||
"sit!.gui.button.revert": "Değişiklikleri Geri Al",
|
||||
"sit!.gui.button.save": "Kaydet ve Kapat",
|
||||
"sit!.gui.button.website": "İnternet Sitesi",
|
||||
"sit!.console.connected": "Sit! sunucusuna bağlanıldı: %s",
|
||||
"sit!.console.player_settings": "Özel oturma ayarları %s alındı!",
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "坐下",
|
||||
"key.sit!.config": "打开配置",
|
||||
"sit!.screen.config": "Sit! 配置",
|
||||
"sit!.gui.button.file": "打开文件",
|
||||
"sit!.gui.button.folder": "打开文件夹",
|
||||
"sit!.gui.button.reset": "重置",
|
||||
"sit!.gui.button.issues": "问题反馈",
|
||||
"sit!.gui.button.donate": "赞助",
|
||||
"sit!.gui.button.revert": "还原更改",
|
||||
"sit!.gui.button.save": "保存并关闭",
|
||||
"sit!.gui.button.website": "网站",
|
||||
"sit!.console.connected": "已连接到 Sit! 服务器: %s",
|
||||
"sit!.console.player_settings": "已从 %s 获得自定义坐下设置。",
|
|
@ -68,13 +68,8 @@
|
|||
"key.sit!.sit": "坐下",
|
||||
"key.sit!.config": "開啟設定",
|
||||
"sit!.screen.config": "坐下! 設定",
|
||||
"sit!.gui.button.file": "開啟檔案",
|
||||
"sit!.gui.button.folder": "開啟資料夾",
|
||||
"sit!.gui.button.reset": "重置",
|
||||
"sit!.gui.button.issues": "問題",
|
||||
"sit!.gui.button.donate": "贊助",
|
||||
"sit!.gui.button.revert": "還原變更",
|
||||
"sit!.gui.button.save": "儲存並關閉",
|
||||
"sit!.gui.button.website": "網站",
|
||||
"sit!.console.connected": "已連線至 Sit! 伺服器: %s",
|
||||
"sit!.console.player_settings": "已從 %s 收到自訂坐下設定!",
|
|
@ -29,7 +29,7 @@
|
|||
"fabricloader": ">=0.14.21",
|
||||
"minecraft": ">=${min_minecraft_version} <=${max_minecraft_version}",
|
||||
"fabric": "*",
|
||||
"otterlib": ">=${otterlib_version}"
|
||||
"otterlib": ">=${otterlib_version} <${otterlib_max_version}"
|
||||
},
|
||||
"suggests": {
|
||||
"modmenu": "*"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue