Skip to content

Commit

Permalink
Update accuratePlacement Protocol V3 for use with Servux
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura-ryoko committed Jun 30, 2024
1 parent 1ee2221 commit 0da6cd6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ author = masa
mod_file_name = litematica-fabric

# Current mod version
mod_version = 0.18.999-sakura.11-entity_data.2
mod_version = 0.18.999-sakura.11-entity_data.3

# Required malilib version
malilib_version = 0.19.999-sakura.5
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fi/dy/masa/litematica/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Configs implements IConfigHandler

public static class Generic
{
public static final ConfigOptionList EASY_PLACE_PROTOCOL = new ConfigOptionList("easyPlaceProtocolVersion", EasyPlaceProtocol.AUTO, "The type of \"accurate placement protocol\" to use.\n- Auto: Uses v3 in single player, and by default Slabs-only in multiplayer,\n unless the server has Carpet mod that sends a 'carpet:hello'\n packet, in which case v2 is used on that server.\n- Version 3: Only supported by Litematica itself (in single player) for now.\n- Version 2: Compatible with servers with the Carpet mod\n (either QuickCarpet by skyrising and DeadlyMC,\n or CarpetExtra in addition to FabricCarpet.\n And in both cases the 'accurateBlockPlacement' Carpet rule needs\n to be enabled on the server).\n- Slabs only: Only fixes top slabs. Compatible with Paper servers.\n- None: Does not modify coordinates.");
public static final ConfigOptionList EASY_PLACE_PROTOCOL = new ConfigOptionList("easyPlaceProtocolVersion", EasyPlaceProtocol.AUTO, "The type of \"accurate placement protocol\" to use.\n- Auto: Uses v3 in single player, and by default Slabs-only in multiplayer,\n unless the server has Carpet mod that sends a 'carpet:hello'\n packet, in which case v2 is used on that server.\n- Version 3: Only supported by Litematica itself (in single player) or with Servux.\n- Version 2: Compatible with servers with the Carpet mod\n (either QuickCarpet by skyrising and DeadlyMC,\n or CarpetExtra in addition to FabricCarpet.\n And in both cases the 'accurateBlockPlacement' Carpet rule needs\n to be enabled on the server).\n- Slabs only: Only fixes top slabs. Compatible with Paper servers.\n- None: Does not modify coordinates.");
public static final ConfigOptionList PASTE_NBT_BEHAVIOR = new ConfigOptionList("pasteNbtRestoreBehavior", PasteNbtBehavior.NONE, "Whether or not the NBT data of blocks is attempted to be restored,\nand which method is used for that.\n- Place & Data Modify will try to place the \"NBT-picked\" block\n near the player, and then use the data modify\n command to transfer the NBT data to the setblock'ed block\n- Place & Clone will try to place the \"NBT-picked\" block\n near the player, and then clone it to the final location.\n- Teleport & Place will try to teleport the player nearby and then\n directly place the NBT-picked item in the correct position.\nNote that the teleport & place method doesn't currently work correctly/at all.\nThe recommended method is §ePlace & Data Modify§r, however for that to work\nyou will probably need to lower the pasteCommandLimit to 1 per tick and increase\nthe pasteCommandInterval to 1-4 ticks or something.\nThus you should only use this for pasting important blocks that need the data,\nfor example by making a schematic of just the inventories,\nand then paste that with replace behavior set to None.");
public static final ConfigOptionList PASTE_REPLACE_BEHAVIOR = new ConfigOptionList("pasteReplaceBehavior", ReplaceBehavior.NONE, "The behavior of replacing existing blocks\nin the Paste schematic tool mode");
public static final ConfigOptionList PLACEMENT_REPLACE_BEHAVIOR = new ConfigOptionList("placementReplaceBehavior", ReplaceBehavior.ALL, "The block replace behavior when adding blocks\nto the schematic world.\n\nThis allows using overlapped placements without the\nlater handled placement always overwriting earlier ones with air.\nOn the other hand some blocks like light blocks are considered\nto be air, so they would need the \"All\" replace behavior\nto get placed at all.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import fi.dy.masa.litematica.Litematica;
import fi.dy.masa.litematica.config.Configs;
import fi.dy.masa.litematica.data.DataManager;
import fi.dy.masa.litematica.data.EntitiesDataStorage;

public class PlacementHandler
{
Expand Down Expand Up @@ -87,7 +88,7 @@ public static EasyPlaceProtocol getEffectiveProtocolVersion()

if (protocol == EasyPlaceProtocol.AUTO)
{
if (MinecraftClient.getInstance().isInSingleplayer())
if (MinecraftClient.getInstance().isInSingleplayer() || EntitiesDataStorage.getInstance().hasServuxServer())
{
return EasyPlaceProtocol.V3;
}
Expand Down

0 comments on commit 0da6cd6

Please sign in to comment.