├── jitpack.yml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src └── main │ ├── resources │ ├── assets │ │ └── litematica │ │ │ ├── icon.png │ │ │ ├── blockstates │ │ │ ├── glass_fallback.json │ │ │ ├── red_glass_fallback.json │ │ │ ├── black_glass_fallback.json │ │ │ ├── blue_glass_fallback.json │ │ │ ├── brown_glass_fallback.json │ │ │ ├── cyan_glass_fallback.json │ │ │ ├── gray_glass_fallback.json │ │ │ ├── green_glass_fallback.json │ │ │ ├── lime_glass_fallback.json │ │ │ ├── pink_glass_fallback.json │ │ │ ├── white_glass_fallback.json │ │ │ ├── lt_blue_glass_fallback.json │ │ │ ├── lt_gray_glass_fallback.json │ │ │ ├── magenta_glass_fallback.json │ │ │ ├── orange_glass_fallback.json │ │ │ ├── purple_glass_fallback.json │ │ │ ├── tinted_glass_fallback.json │ │ │ ├── yellow_glass_fallback.json │ │ │ ├── glass_pane_fallback.json │ │ │ ├── red_glass_pane_fallback.json │ │ │ ├── blue_glass_pane_fallback.json │ │ │ ├── cyan_glass_pane_fallback.json │ │ │ ├── gray_glass_pane_fallback.json │ │ │ ├── lime_glass_pane_fallback.json │ │ │ ├── pink_glass_pane_fallback.json │ │ │ ├── black_glass_pane_fallback.json │ │ │ ├── brown_glass_pane_fallback.json │ │ │ ├── green_glass_pane_fallback.json │ │ │ ├── white_glass_pane_fallback.json │ │ │ ├── orange_glass_pane_fallback.json │ │ │ ├── purple_glass_pane_fallback.json │ │ │ ├── yellow_glass_pane_fallback.json │ │ │ ├── lt_blue_glass_pane_fallback.json │ │ │ ├── lt_gray_glass_pane_fallback.json │ │ │ └── magenta_glass_pane_fallback.json │ │ │ ├── textures │ │ │ ├── gui │ │ │ │ └── gui_widgets.png │ │ │ ├── xcf │ │ │ │ └── gui_widgets.xcf │ │ │ └── block │ │ │ │ ├── glass_fallback.png │ │ │ │ ├── red_glass_fallback.png │ │ │ │ ├── black_glass_fallback.png │ │ │ │ ├── blue_glass_fallback.png │ │ │ │ ├── brown_glass_fallback.png │ │ │ │ ├── cyan_glass_fallback.png │ │ │ │ ├── gray_glass_fallback.png │ │ │ │ ├── green_glass_fallback.png │ │ │ │ ├── lime_glass_fallback.png │ │ │ │ ├── orange_glass_fallback.png │ │ │ │ ├── pink_glass_fallback.png │ │ │ │ ├── purple_glass_fallback.png │ │ │ │ ├── tinted_glass_fallback.png │ │ │ │ ├── white_glass_fallback.png │ │ │ │ ├── yellow_glass_fallback.png │ │ │ │ ├── glass_pane_fallback_top.png │ │ │ │ ├── lt_blue_glass_fallback.png │ │ │ │ ├── lt_gray_glass_fallback.png │ │ │ │ ├── magenta_glass_fallback.png │ │ │ │ ├── blue_glass_pane_fallback_top.png │ │ │ │ ├── cyan_glass_pane_fallback_top.png │ │ │ │ ├── gray_glass_pane_fallback_top.png │ │ │ │ ├── lime_glass_pane_fallback_top.png │ │ │ │ ├── pink_glass_pane_fallback_top.png │ │ │ │ ├── red_glass_pane_fallback_top.png │ │ │ │ ├── black_glass_pane_fallback_top.png │ │ │ │ ├── brown_glass_pane_fallback_top.png │ │ │ │ ├── green_glass_pane_fallback_top.png │ │ │ │ ├── lt_blue_glass_pane_fallback_top.png │ │ │ │ ├── lt_gray_glass_pane_fallback_top.png │ │ │ │ ├── magenta_glass_pane_fallback_top.png │ │ │ │ ├── orange_glass_pane_fallback_top.png │ │ │ │ ├── purple_glass_pane_fallback_top.png │ │ │ │ ├── white_glass_pane_fallback_top.png │ │ │ │ └── yellow_glass_pane_fallback_top.png │ │ │ └── models │ │ │ └── block │ │ │ ├── glass_fallback.json │ │ │ ├── blue_glass_fallback.json │ │ │ ├── cyan_glass_fallback.json │ │ │ ├── gray_glass_fallback.json │ │ │ ├── lime_glass_fallback.json │ │ │ ├── pink_glass_fallback.json │ │ │ ├── red_glass_fallback.json │ │ │ ├── black_glass_fallback.json │ │ │ ├── brown_glass_fallback.json │ │ │ ├── green_glass_fallback.json │ │ │ ├── lt_blue_glass_fallback.json │ │ │ ├── lt_gray_glass_fallback.json │ │ │ ├── magenta_glass_fallback.json │ │ │ ├── orange_glass_fallback.json │ │ │ ├── purple_glass_fallback.json │ │ │ ├── tinted_glass_fallback.json │ │ │ ├── white_glass_fallback.json │ │ │ ├── yellow_glass_fallback.json │ │ │ ├── glass_pane_fallback_noside.json │ │ │ ├── blue_glass_pane_fallback_noside.json │ │ │ ├── cyan_glass_pane_fallback_noside.json │ │ │ ├── glass_pane_fallback_noside_alt.json │ │ │ ├── gray_glass_pane_fallback_noside.json │ │ │ ├── lime_glass_pane_fallback_noside.json │ │ │ ├── pink_glass_pane_fallback_noside.json │ │ │ ├── red_glass_pane_fallback_noside.json │ │ │ ├── black_glass_pane_fallback_noside.json │ │ │ ├── brown_glass_pane_fallback_noside.json │ │ │ ├── green_glass_pane_fallback_noside.json │ │ │ ├── orange_glass_pane_fallback_noside.json │ │ │ ├── purple_glass_pane_fallback_noside.json │ │ │ ├── white_glass_pane_fallback_noside.json │ │ │ ├── yellow_glass_pane_fallback_noside.json │ │ │ ├── black_glass_pane_fallback_noside_alt.json │ │ │ ├── blue_glass_pane_fallback_noside_alt.json │ │ │ ├── brown_glass_pane_fallback_noside_alt.json │ │ │ ├── cyan_glass_pane_fallback_noside_alt.json │ │ │ ├── gray_glass_pane_fallback_noside_alt.json │ │ │ ├── green_glass_pane_fallback_noside_alt.json │ │ │ ├── lime_glass_pane_fallback_noside_alt.json │ │ │ ├── lt_blue_glass_pane_fallback_noside.json │ │ │ ├── lt_gray_glass_pane_fallback_noside.json │ │ │ ├── magenta_glass_pane_fallback_noside.json │ │ │ ├── pink_glass_pane_fallback_noside_alt.json │ │ │ ├── red_glass_pane_fallback_noside_alt.json │ │ │ ├── white_glass_pane_fallback_noside_alt.json │ │ │ ├── lt_blue_glass_pane_fallback_noside_alt.json │ │ │ ├── lt_gray_glass_pane_fallback_noside_alt.json │ │ │ ├── magenta_glass_pane_fallback_noside_alt.json │ │ │ ├── orange_glass_pane_fallback_noside_alt.json │ │ │ ├── purple_glass_pane_fallback_noside_alt.json │ │ │ ├── yellow_glass_pane_fallback_noside_alt.json │ │ │ ├── glass_pane_fallback_post.json │ │ │ ├── glass_pane_fallback_side.json │ │ │ ├── glass_pane_fallback_side_alt.json │ │ │ ├── red_glass_pane_fallback_post.json │ │ │ ├── red_glass_pane_fallback_side.json │ │ │ ├── black_glass_pane_fallback_post.json │ │ │ ├── black_glass_pane_fallback_side.json │ │ │ ├── blue_glass_pane_fallback_post.json │ │ │ ├── blue_glass_pane_fallback_side.json │ │ │ ├── brown_glass_pane_fallback_post.json │ │ │ ├── brown_glass_pane_fallback_side.json │ │ │ ├── cyan_glass_pane_fallback_post.json │ │ │ ├── cyan_glass_pane_fallback_side.json │ │ │ ├── gray_glass_pane_fallback_post.json │ │ │ ├── gray_glass_pane_fallback_side.json │ │ │ ├── green_glass_pane_fallback_post.json │ │ │ ├── green_glass_pane_fallback_side.json │ │ │ ├── lime_glass_pane_fallback_post.json │ │ │ ├── lime_glass_pane_fallback_side.json │ │ │ ├── pink_glass_pane_fallback_post.json │ │ │ ├── pink_glass_pane_fallback_side.json │ │ │ ├── white_glass_pane_fallback_post.json │ │ │ ├── white_glass_pane_fallback_side.json │ │ │ ├── blue_glass_pane_fallback_side_alt.json │ │ │ ├── cyan_glass_pane_fallback_side_alt.json │ │ │ ├── gray_glass_pane_fallback_side_alt.json │ │ │ ├── lime_glass_pane_fallback_side_alt.json │ │ │ ├── lt_blue_glass_pane_fallback_post.json │ │ │ ├── lt_blue_glass_pane_fallback_side.json │ │ │ ├── lt_gray_glass_pane_fallback_post.json │ │ │ ├── lt_gray_glass_pane_fallback_side.json │ │ │ ├── magenta_glass_pane_fallback_post.json │ │ │ ├── magenta_glass_pane_fallback_side.json │ │ │ ├── orange_glass_pane_fallback_post.json │ │ │ ├── orange_glass_pane_fallback_side.json │ │ │ ├── pink_glass_pane_fallback_side_alt.json │ │ │ ├── purple_glass_pane_fallback_post.json │ │ │ ├── purple_glass_pane_fallback_side.json │ │ │ ├── red_glass_pane_fallback_side_alt.json │ │ │ ├── yellow_glass_pane_fallback_post.json │ │ │ ├── yellow_glass_pane_fallback_side.json │ │ │ ├── black_glass_pane_fallback_side_alt.json │ │ │ ├── brown_glass_pane_fallback_side_alt.json │ │ │ ├── green_glass_pane_fallback_side_alt.json │ │ │ ├── orange_glass_pane_fallback_side_alt.json │ │ │ ├── purple_glass_pane_fallback_side_alt.json │ │ │ ├── white_glass_pane_fallback_side_alt.json │ │ │ ├── yellow_glass_pane_fallback_side_alt.json │ │ │ ├── lt_blue_glass_pane_fallback_side_alt.json │ │ │ ├── lt_gray_glass_pane_fallback_side_alt.json │ │ │ ├── magenta_glass_pane_fallback_side_alt.json │ │ │ ├── template_glass_pane_fallback_noside.json │ │ │ ├── template_glass_pane_fallback_noside_alt.json │ │ │ ├── template_glass_pane_fallback_post.json │ │ │ ├── template_glass_pane_fallback_side.json │ │ │ └── template_glass_pane_fallback_side_alt.json │ ├── litematica.accesswidener │ ├── fabric.mod.json │ └── mixins.litematica.json │ └── java │ └── fi │ └── dy │ └── masa │ └── litematica │ ├── render │ ├── infohud │ │ ├── RenderPhase.java │ │ └── IInfoHudRenderer.java │ ├── schematic │ │ ├── IBufferBuilderPatch.java │ │ ├── IChunkRendererFactory.java │ │ ├── ao │ │ │ ├── AOLightmap.java │ │ │ ├── AOOrientation.java │ │ │ ├── AOProcessor.java │ │ │ └── AOTranslations.java │ │ ├── SchematicRenderState.java │ │ └── OverlayRenderType.java │ └── LitematicaPipelines.java │ ├── util │ ├── IEntityInvoker.java │ ├── ToBooleanFunction.java │ ├── IWorldUpdateSuppressor.java │ ├── CompatUtils.java │ ├── OverlayType.java │ ├── IEntityRendererInvoker.java │ ├── IgnoreBlockRegistry.java │ └── DebugHudMode.java │ ├── schematic │ ├── pickblock │ │ └── SchematicPickBlockEventResult.java │ ├── container │ │ ├── ILitematicaBlockStatePaletteResizer.java │ │ └── ILitematicaBlockStatePalette.java │ ├── SchematicSchema.java │ ├── conversion │ │ └── IBlockReaderWithData.java │ └── placement │ │ └── SchematicPlacementEventFlag.java │ ├── interfaces │ ├── IMixinChunkProviderClient.java │ ├── ISchematicPickBlockSlotHandler.java │ ├── ISchematicPickBlockEventManager.java │ ├── ISchematicPickBlockEventListener.java │ └── ISchematicPlacementEventManager.java │ ├── mixin │ ├── input │ │ └── IMixinKeyBinding.java │ ├── IMixinProfilerSystem.java │ ├── block │ │ ├── IMixinFenceGateBlock.java │ │ ├── IMixinVineBlock.java │ │ ├── IMixinRedstoneWireBlock.java │ │ ├── IMixinWallMountedBlock.java │ │ ├── IMixinAbstractBlock.java │ │ ├── IMixinStairsBlock.java │ │ ├── MixinBlockStateFlattening.java │ │ ├── MixinChestBlock.java │ │ ├── MixinBlock.java │ │ ├── MixinBlockStateManagers.java │ │ └── MixinRailBlocks.java │ ├── screen │ │ ├── IMixinHandledScreen.java │ │ └── MixinHandledScreen.java │ ├── world │ │ ├── IMixinWorld.java │ │ ├── IMixinWorldTickScheduler.java │ │ ├── MixinWorld.java │ │ ├── MixinWorldChunk.java │ │ └── MixinClientWorld.java │ ├── render │ │ ├── IMixinBlockRenderManager.java │ │ ├── IMixinGameRenderer.java │ │ ├── MixinBlockRenderManager.java │ │ ├── MixinGameRenderer.java │ │ └── MixinBufferBuilder.java │ ├── network │ │ ├── IMixinChunkDeltaUpdateS2CPacket.java │ │ └── MixinClientCommonNetworkHandler.java │ ├── entity │ │ ├── IMixinSignBlockEntity.java │ │ ├── IMixinEntity.java │ │ ├── MixinEntity.java │ │ └── MixinAbstractSignEditScreen.java │ ├── easyplace │ │ ├── MixinServerPlayNetworkHandler_easyPlace.java │ │ ├── MixinMinecraftClient_easyPlace.java │ │ └── MixinBlockItem_easyPlace.java │ ├── hud │ │ ├── MixinDebugHudProfile.java │ │ ├── MixinDebugHudEntries.java │ │ └── MixinDebugHud.java │ ├── server │ │ └── MixinMinecraftServer.java │ └── MixinMinecraftClient.java │ ├── materials │ ├── IMaterialList.java │ ├── MaterialListAreaAnalyzer.java │ ├── MaterialListSchematic.java │ ├── MaterialListSorter.java │ └── MaterialListPlacement.java │ ├── event │ └── ServerListener.java │ ├── compat │ ├── modmenu │ │ └── ModMenuImpl.java │ ├── sodium │ │ └── SodiumCompat.java │ └── jade │ │ └── JadeCompat.java │ ├── Reference.java │ ├── scheduler │ ├── TaskTimer.java │ ├── tasks │ │ ├── TaskCountBlocksArea.java │ │ ├── TaskDeleteArea.java │ │ └── TaskDelay.java │ ├── ITask.java │ └── ClientTickHandler.java │ ├── Litematica.java │ ├── tool │ └── ToolModeData.java │ ├── gui │ ├── widgets │ │ ├── WidgetListTasks.java │ │ ├── WidgetListLoadedSchematics.java │ │ ├── WidgetListSelectionSubRegions.java │ │ └── WidgetListSchematicPlacements.java │ ├── GuiTaskManager.java │ ├── GuiSchematicBrowserBase.java │ ├── ButtonIcons.java │ └── GuiAreaSelectionEditorSubRegion.java │ └── selection │ └── BoxSliced.java ├── .gitignore ├── settings.gradle ├── .gitattributes ├── gradle.properties ├── README.md └── .github └── workflows └── build.yml /jitpack.yml: -------------------------------------------------------------------------------- 1 | before_install: 2 | - sdk install java 21.0.9-tem 3 | - sdk use java 21.0.9-tem 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/icon.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .settings 3 | bin/ 4 | build/ 5 | eclipse/ 6 | logs/ 7 | .classpath 8 | .project 9 | build.number 10 | .idea/ 11 | run/ 12 | libs/ 13 | -------------------------------------------------------------------------------- /src/main/resources/litematica.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named 2 | accessible field net/minecraft/client/renderer/block/BlockModelShaper modelByStateCache Ljava/util/Map; 3 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/red_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/red_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/black_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/black_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/blue_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/blue_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/brown_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/brown_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/cyan_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/cyan_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/gray_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/gray_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/green_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/green_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/lime_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/lime_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/pink_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/pink_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/white_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/white_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/gui/gui_widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/gui/gui_widgets.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/xcf/gui_widgets.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/xcf/gui_widgets.xcf -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | gradlePluginPortal() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/infohud/RenderPhase.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.infohud; 2 | 3 | public enum RenderPhase 4 | { 5 | PRE, 6 | POST 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/lt_blue_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/lt_blue_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/lt_gray_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/lt_gray_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/magenta_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/magenta_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/orange_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/orange_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/purple_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/purple_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/tinted_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/tinted_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/yellow_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "litematica:block/yellow_glass_fallback" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/blue_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/blue_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/cyan_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/cyan_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/gray_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/gray_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lime_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/lime_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/pink_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/pink_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/red_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/red_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/red_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/red_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/black_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/black_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/brown_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/brown_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/green_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/green_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_blue_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/lt_blue_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_gray_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/lt_gray_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/magenta_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/magenta_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/orange_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/orange_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/purple_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/purple_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/tinted_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/tinted_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/white_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/white_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/yellow_glass_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:block/cube_all", 3 | "textures": { 4 | "all": "litematica:block/yellow_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/black_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/black_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/blue_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/blue_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/brown_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/brown_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/cyan_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/cyan_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/gray_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/gray_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/green_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/green_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/lime_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/lime_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/orange_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/orange_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/pink_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/pink_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/purple_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/purple_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/tinted_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/tinted_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/white_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/white_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/yellow_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/yellow_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/lt_blue_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/lt_blue_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/lt_gray_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/lt_gray_glass_fallback.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/magenta_glass_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/magenta_glass_fallback.png -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/util/IEntityInvoker.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.util; 2 | 3 | public interface IEntityInvoker 4 | { 5 | void litematica$toggleTouchingWater(boolean toggle); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/blue_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/blue_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/cyan_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/cyan_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/gray_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/gray_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/lime_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/lime_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/pink_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/pink_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/red_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/red_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/black_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/black_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/brown_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/brown_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/green_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/green_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/lt_blue_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/lt_blue_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/lt_gray_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/lt_gray_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/magenta_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/magenta_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/orange_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/orange_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/purple_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/purple_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/white_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/white_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/textures/block/yellow_glass_pane_fallback_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakura-ryoko/litematica/HEAD/src/main/resources/assets/litematica/textures/block/yellow_glass_pane_fallback_top.png -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/util/ToBooleanFunction.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.util; 2 | 3 | @FunctionalInterface 4 | public interface ToBooleanFunction 5 | { 6 | boolean applyAsBoolean(R value); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/schematic/IBufferBuilderPatch.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.schematic; 2 | 3 | public interface IBufferBuilderPatch 4 | { 5 | void litematica$setOffsetY(float offset); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/blue_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/blue_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/cyan_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/cyan_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/gray_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/gray_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lime_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/lime_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/pink_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/pink_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/red_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/red_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/black_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/black_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/brown_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/brown_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/green_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/green_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/orange_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/orange_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/purple_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/purple_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/white_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/white_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/yellow_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/yellow_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/schematic/pickblock/SchematicPickBlockEventResult.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.schematic.pickblock; 2 | 3 | public enum SchematicPickBlockEventResult 4 | { 5 | SUCCESS, 6 | CANCEL, 7 | ERROR 8 | } 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/black_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/black_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/blue_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/blue_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/brown_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/brown_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/cyan_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/cyan_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/gray_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/gray_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/green_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/green_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lime_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/lime_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_blue_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/lt_blue_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_gray_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/lt_gray_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/magenta_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside", 3 | "textures": { 4 | "pane": "litematica:block/magenta_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/pink_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/pink_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/red_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/red_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/white_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/white_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_blue_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/lt_blue_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_gray_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/lt_gray_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/magenta_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/magenta_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/orange_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/orange_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/purple_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/purple_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/yellow_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_noside_alt", 3 | "textures": { 4 | "pane": "litematica:block/yellow_glass_fallback" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/glass_pane_fallback_top", 5 | "pane": "litematica:block/glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/glass_pane_fallback_top", 5 | "pane": "litematica:block/glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/glass_pane_fallback_top", 5 | "pane": "litematica:block/glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/red_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/red_glass_pane_fallback_top", 5 | "pane": "litematica:block/red_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/red_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/red_glass_pane_fallback_top", 5 | "pane": "litematica:block/red_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/black_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/black_glass_pane_fallback_top", 5 | "pane": "litematica:block/black_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/black_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/black_glass_pane_fallback_top", 5 | "pane": "litematica:block/black_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/blue_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/blue_glass_pane_fallback_top", 5 | "pane": "litematica:block/blue_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/blue_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/blue_glass_pane_fallback_top", 5 | "pane": "litematica:block/blue_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/brown_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/brown_glass_pane_fallback_top", 5 | "pane": "litematica:block/brown_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/brown_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/brown_glass_pane_fallback_top", 5 | "pane": "litematica:block/brown_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/cyan_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/cyan_glass_pane_fallback_top", 5 | "pane": "litematica:block/cyan_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/cyan_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/cyan_glass_pane_fallback_top", 5 | "pane": "litematica:block/cyan_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/gray_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/gray_glass_pane_fallback_top", 5 | "pane": "litematica:block/gray_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/gray_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/gray_glass_pane_fallback_top", 5 | "pane": "litematica:block/gray_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/green_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/green_glass_pane_fallback_top", 5 | "pane": "litematica:block/green_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/green_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/green_glass_pane_fallback_top", 5 | "pane": "litematica:block/green_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lime_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/lime_glass_pane_fallback_top", 5 | "pane": "litematica:block/lime_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lime_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/lime_glass_pane_fallback_top", 5 | "pane": "litematica:block/lime_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/pink_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/pink_glass_pane_fallback_top", 5 | "pane": "litematica:block/pink_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/pink_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/pink_glass_pane_fallback_top", 5 | "pane": "litematica:block/pink_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/white_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/white_glass_pane_fallback_top", 5 | "pane": "litematica:block/white_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/white_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/white_glass_pane_fallback_top", 5 | "pane": "litematica:block/white_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/blue_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/blue_glass_pane_fallback_top", 5 | "pane": "litematica:block/blue_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/cyan_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/cyan_glass_pane_fallback_top", 5 | "pane": "litematica:block/cyan_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/gray_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/gray_glass_pane_fallback_top", 5 | "pane": "litematica:block/gray_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lime_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/lime_glass_pane_fallback_top", 5 | "pane": "litematica:block/lime_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_blue_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/lt_blue_glass_pane_fallback_top", 5 | "pane": "litematica:block/lt_blue_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_blue_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/lt_blue_glass_pane_fallback_top", 5 | "pane": "litematica:block/lt_blue_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_gray_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/lt_gray_glass_pane_fallback_top", 5 | "pane": "litematica:block/lt_gray_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_gray_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/lt_gray_glass_pane_fallback_top", 5 | "pane": "litematica:block/lt_gray_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/magenta_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/magenta_glass_pane_fallback_top", 5 | "pane": "litematica:block/magenta_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/magenta_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/magenta_glass_pane_fallback_top", 5 | "pane": "litematica:block/magenta_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/orange_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/orange_glass_pane_fallback_top", 5 | "pane": "litematica:block/orange_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/orange_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/orange_glass_pane_fallback_top", 5 | "pane": "litematica:block/orange_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/pink_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/pink_glass_pane_fallback_top", 5 | "pane": "litematica:block/pink_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/purple_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/purple_glass_pane_fallback_top", 5 | "pane": "litematica:block/purple_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/purple_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/purple_glass_pane_fallback_top", 5 | "pane": "litematica:block/purple_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/red_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/red_glass_pane_fallback_top", 5 | "pane": "litematica:block/red_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/yellow_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_post", 3 | "textures": { 4 | "edge": "litematica:block/yellow_glass_pane_fallback_top", 5 | "pane": "litematica:block/yellow_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/yellow_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side", 3 | "textures": { 4 | "edge": "litematica:block/yellow_glass_pane_fallback_top", 5 | "pane": "litematica:block/yellow_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/util/IWorldUpdateSuppressor.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.util; 2 | 3 | public interface IWorldUpdateSuppressor 4 | { 5 | boolean litematica_getShouldPreventBlockUpdates(); 6 | 7 | void litematica_setShouldPreventBlockUpdates(boolean preventUpdates); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/black_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/black_glass_pane_fallback_top", 5 | "pane": "litematica:block/black_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/brown_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/brown_glass_pane_fallback_top", 5 | "pane": "litematica:block/brown_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/green_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/green_glass_pane_fallback_top", 5 | "pane": "litematica:block/green_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/orange_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/orange_glass_pane_fallback_top", 5 | "pane": "litematica:block/orange_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/purple_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/purple_glass_pane_fallback_top", 5 | "pane": "litematica:block/purple_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/white_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/white_glass_pane_fallback_top", 5 | "pane": "litematica:block/white_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/yellow_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/yellow_glass_pane_fallback_top", 5 | "pane": "litematica:block/yellow_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_blue_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/lt_blue_glass_pane_fallback_top", 5 | "pane": "litematica:block/lt_blue_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/lt_gray_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/lt_gray_glass_pane_fallback_top", 5 | "pane": "litematica:block/lt_gray_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/magenta_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "litematica:block/template_glass_pane_fallback_side_alt", 3 | "textures": { 4 | "edge": "litematica:block/magenta_glass_pane_fallback_top", 5 | "pane": "litematica:block/magenta_glass_fallback" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/schematic/container/ILitematicaBlockStatePaletteResizer.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.schematic.container; 2 | 3 | import net.minecraft.world.level.block.state.BlockState; 4 | 5 | public interface ILitematicaBlockStatePaletteResizer 6 | { 7 | int onResize(int bits, BlockState state); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/schematic/IChunkRendererFactory.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.schematic; 2 | 3 | import fi.dy.masa.litematica.world.WorldSchematic; 4 | 5 | public interface IChunkRendererFactory 6 | { 7 | ChunkRendererSchematicVbo create(WorldSchematic worldIn, WorldRendererSchematic worldRenderer); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/interfaces/IMixinChunkProviderClient.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.interfaces; 2 | 3 | import it.unimi.dsi.fastutil.longs.Long2ObjectMap; 4 | import net.minecraft.world.level.chunk.ChunkAccess; 5 | 6 | public interface IMixinChunkProviderClient 7 | { 8 | Long2ObjectMap getLoadedChunks(); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/input/IMixinKeyBinding.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.input; 2 | 3 | /** 4 | * Post Re-Write code 5 | */ 6 | //@Mixin(KeyMapping.class) 7 | @Deprecated(forRemoval = true) 8 | public interface IMixinKeyBinding 9 | { 10 | // @Accessor("key") 11 | // InputConstants.Key litematica_getBoundKey(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/materials/IMaterialList.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.materials; 2 | 3 | import java.util.List; 4 | import fi.dy.masa.litematica.util.BlockInfoListType; 5 | 6 | public interface IMaterialList 7 | { 8 | BlockInfoListType getMaterialListType(); 9 | 10 | void setMaterialListEntries(List list); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/schematic/SchematicSchema.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.schematic; 2 | 3 | public record SchematicSchema(int litematicVersion, int minecraftDataVersion) 4 | { 5 | @Override 6 | public String toString() 7 | { 8 | return "V" + this.litematicVersion() + " / DataVersion " + this.minecraftDataVersion(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/IMixinProfilerSystem.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin; 2 | 3 | import net.minecraft.util.profiling.ActiveProfiler; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(ActiveProfiler.class) 8 | public interface IMixinProfilerSystem 9 | { 10 | @Accessor("started") 11 | boolean litematica_isStarted(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/template_glass_pane_fallback_noside.json: -------------------------------------------------------------------------------- 1 | { 2 | "ambientocclusion": false, 3 | "textures": { 4 | "particle": "#pane" 5 | }, 6 | "elements": [ 7 | { "from": [ 7, 0, 7 ], 8 | "to": [ 9, 16, 9 ], 9 | "faces": { 10 | "north": { "uv": [ 9, 0, 7, 16 ], "texture": "#pane" } 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/template_glass_pane_fallback_noside_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "ambientocclusion": false, 3 | "textures": { 4 | "particle": "#pane" 5 | }, 6 | "elements": [ 7 | { "from": [ 7, 0, 7 ], 8 | "to": [ 9, 16, 9 ], 9 | "faces": { 10 | "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#pane" } 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/util/CompatUtils.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.util; 2 | 3 | import com.mojang.blaze3d.platform.InputConstants; 4 | import net.minecraft.client.Minecraft; 5 | 6 | /** 7 | * Post Re-Write code 8 | */ 9 | public class CompatUtils 10 | { 11 | public static boolean isKeyHeld(InputConstants.Key key) 12 | { 13 | return InputConstants.isKeyDown(Minecraft.getInstance().getWindow(), key.getValue()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/template_glass_pane_fallback_post.json: -------------------------------------------------------------------------------- 1 | { 2 | "ambientocclusion": false, 3 | "textures": { 4 | "particle": "#pane" 5 | }, 6 | "elements": [ 7 | { "from": [ 7, 0, 7 ], 8 | "to": [ 9, 16, 9 ], 9 | "faces": { 10 | "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#edge" }, 11 | "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#edge" } 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/IMixinFenceGateBlock.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import net.minecraft.world.level.block.FenceGateBlock; 4 | import net.minecraft.world.level.block.state.BlockState; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Mixin(FenceGateBlock.class) 9 | public interface IMixinFenceGateBlock 10 | { 11 | @Invoker("isWall") 12 | boolean litematica_invokeIsWall(BlockState state); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/event/ServerListener.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.event; 2 | 3 | import fi.dy.masa.malilib.interfaces.IServerListener; 4 | import net.minecraft.client.server.IntegratedServer; 5 | import fi.dy.masa.litematica.data.DataManager; 6 | 7 | public class ServerListener implements IServerListener 8 | { 9 | @Override 10 | public void onServerIntegratedSetup(IntegratedServer server) 11 | { 12 | DataManager.getInstance().setHasIntegratedServer(true); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/screen/IMixinHandledScreen.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.screen; 2 | 3 | import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(AbstractContainerScreen.class) 8 | public interface IMixinHandledScreen 9 | { 10 | @Accessor("leftPos") 11 | int litematica_getX(); 12 | 13 | @Accessor("topPos") 14 | int litematica_getY(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/world/IMixinWorld.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.world; 2 | 3 | import net.minecraft.world.entity.Entity; 4 | import net.minecraft.world.level.Level; 5 | import net.minecraft.world.level.entity.LevelEntityGetter; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Invoker; 8 | 9 | @Mixin(Level.class) 10 | public interface IMixinWorld 11 | { 12 | @Invoker("getEntities") 13 | LevelEntityGetter litematica_getEntityLookup(); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/render/IMixinBlockRenderManager.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.render; 2 | 3 | import net.minecraft.client.renderer.block.BlockRenderDispatcher; 4 | import net.minecraft.client.renderer.block.LiquidBlockRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(BlockRenderDispatcher.class) 9 | public interface IMixinBlockRenderManager 10 | { 11 | @Accessor("liquidBlockRenderer") 12 | LiquidBlockRenderer litematica_getFluidRenderer(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/network/IMixinChunkDeltaUpdateS2CPacket.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.network; 2 | 3 | import net.minecraft.core.SectionPos; 4 | import net.minecraft.network.protocol.game.ClientboundSectionBlocksUpdatePacket; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(ClientboundSectionBlocksUpdatePacket.class) 9 | public interface IMixinChunkDeltaUpdateS2CPacket 10 | { 11 | @Accessor("sectionPos") 12 | SectionPos litematica_getSection(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/world/IMixinWorldTickScheduler.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.world; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.gen.Accessor; 5 | import it.unimi.dsi.fastutil.longs.Long2ObjectMap; 6 | import net.minecraft.world.ticks.LevelChunkTicks; 7 | import net.minecraft.world.ticks.LevelTicks; 8 | 9 | @Mixin(LevelTicks.class) 10 | public interface IMixinWorldTickScheduler 11 | { 12 | @Accessor("allContainers") 13 | Long2ObjectMap> litematica_getChunkTickSchedulers(); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/interfaces/ISchematicPickBlockSlotHandler.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.interfaces; 2 | 3 | import java.util.function.Supplier; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.world.item.ItemStack; 6 | import net.minecraft.world.level.Level; 7 | import fi.dy.masa.litematica.schematic.pickblock.SchematicPickBlockEventResult; 8 | 9 | public interface ISchematicPickBlockSlotHandler 10 | { 11 | Supplier getName(); 12 | 13 | SchematicPickBlockEventResult executePickBlock(Level schematicWorld, BlockPos pos, ItemStack stack); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/entity/IMixinSignBlockEntity.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.entity; 2 | 3 | import net.minecraft.world.level.block.entity.SignBlockEntity; 4 | import net.minecraft.world.level.block.entity.SignText; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(SignBlockEntity.class) 9 | public interface IMixinSignBlockEntity 10 | { 11 | @Accessor("frontText") 12 | SignText litematica_getFrontText(); 13 | 14 | @Accessor("backText") 15 | SignText litematica_getBackText(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/render/IMixinGameRenderer.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.render; 2 | 3 | import net.minecraft.client.renderer.GameRenderer; 4 | import net.minecraft.client.renderer.fog.FogRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(GameRenderer.class) 9 | public interface IMixinGameRenderer 10 | { 11 | @Accessor("fogRenderer") 12 | FogRenderer litematica_getFogRenderer(); 13 | 14 | @Accessor("renderBlockOutline") 15 | boolean litematica_isBlockOutlineEnabled(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/IMixinVineBlock.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import net.minecraft.core.BlockPos; 4 | import net.minecraft.core.Direction; 5 | import net.minecraft.world.level.BlockGetter; 6 | import net.minecraft.world.level.block.VineBlock; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.gen.Invoker; 9 | 10 | @Mixin(VineBlock.class) 11 | public interface IMixinVineBlock 12 | { 13 | @Invoker("canSupportAtFace") 14 | boolean litematica_invokeShouldConnectUp(BlockGetter blockReader, BlockPos pos, Direction side); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/compat/modmenu/ModMenuImpl.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.compat.modmenu; 2 | 3 | import com.terraformersmc.modmenu.api.ConfigScreenFactory; 4 | import com.terraformersmc.modmenu.api.ModMenuApi; 5 | import fi.dy.masa.litematica.gui.GuiConfigs; 6 | 7 | public class ModMenuImpl implements ModMenuApi 8 | { 9 | @Override 10 | public ConfigScreenFactory getModConfigScreenFactory() 11 | { 12 | return (screen) -> { 13 | GuiConfigs gui = new GuiConfigs(); 14 | gui.setParent(screen); 15 | return gui; 16 | }; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # text stuff 2 | * text=auto 3 | *.bat text eol=crlf 4 | *.groovy text eol=lf 5 | *.java text eol=crlf 6 | *.md text 7 | *.properties text eol=lf 8 | *.scala text eol=lf 9 | *.sh text eol=lf 10 | .gitattributes text eol=lf 11 | .gitignore text eol=lf 12 | build.gradle text eol=lf 13 | gradlew text eol=lf 14 | gradle/wrapper/gradle-wrapper.properties text eol=crlf 15 | COPYING.txt text eol=lf 16 | COPYING.LESSER.txt text eol=lf 17 | README.md text eol=lf 18 | 19 | #binary 20 | *.dat binary 21 | *.bin binary 22 | *.png binary 23 | *.exe binary 24 | *.dll binary 25 | *.zip binary 26 | *.jar binary 27 | *.7z binary 28 | *.db binary 29 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs = -Xmx3G 2 | org.gradle.daemon = false 3 | org.gradle.cache.cleanup = false 4 | 5 | group = fi.dy.masa 6 | mod_id = litematica 7 | mod_name = Litematica 8 | author = masa 9 | mod_file_name = litematica-fabric 10 | 11 | # Current mod version 12 | mod_version = 0.25.2 13 | 14 | # Required malilib version 15 | malilib_version = 1.21.11-0.27.2 16 | 17 | # Minecraft, Fabric Loader and API and mappings versions 18 | minecraft_version_out = 1.21.11 19 | minecraft_version = 1.21.11 20 | mappings_version = 1.21.11+build.3 21 | 22 | fabric_loader_version = 0.18.2 23 | mod_menu_version = 17.0.0-alpha.1 24 | # fabric_api_version = 0.139.5+1.21.11 25 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/IMixinRedstoneWireBlock.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import net.minecraft.core.BlockPos; 4 | import net.minecraft.world.level.BlockGetter; 5 | import net.minecraft.world.level.block.RedStoneWireBlock; 6 | import net.minecraft.world.level.block.state.BlockState; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.gen.Invoker; 9 | 10 | @Mixin(RedStoneWireBlock.class) 11 | public interface IMixinRedstoneWireBlock 12 | { 13 | @Invoker("getConnectionState") 14 | BlockState litematica_GetPlacementState(BlockGetter world, BlockState state, BlockPos pos); 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![](https://jitpack.io/v/sakura-ryoko/litematica.svg)](https://jitpack.io/#sakura-ryoko/litematica) 2 | 3 | Litematica 4 | ============== 5 | Litematica is a client-side Minecraft mod using LiteLoader. 6 | It is more or less a re-creation of or a substitute for [Schematica](https://www.curseforge.com/minecraft/mc-mods/schematica), 7 | for players who don't want to have Forge installed. 8 | For compiled builds (= downloads), see https://www.curseforge.com/minecraft/mc-mods/litematica/files/all 9 | 10 | Compiling 11 | ========= 12 | * Clone the repository 13 | * Open a command prompt/terminal to the repository directory 14 | * run 'gradlew build' 15 | * The built jar file will be in build/libs/ 16 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/IMixinWallMountedBlock.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import net.minecraft.core.BlockPos; 4 | import net.minecraft.world.level.LevelReader; 5 | import net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock; 6 | import net.minecraft.world.level.block.state.BlockState; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.gen.Invoker; 9 | 10 | @Mixin(FaceAttachedHorizontalDirectionalBlock.class) 11 | public interface IMixinWallMountedBlock 12 | { 13 | @Invoker("canSurvive") 14 | boolean litematica_invokeCanPlaceAt(BlockState state, LevelReader world, BlockPos pos); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/util/OverlayType.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.util; 2 | 3 | public enum OverlayType 4 | { 5 | NONE (0), 6 | MISSING (1), 7 | EXTRA (2), 8 | WRONG_STATE (3), 9 | WRONG_BLOCK (4), 10 | DIFF_BLOCK (5); 11 | 12 | private final int priority; 13 | 14 | OverlayType(int priority) 15 | { 16 | this.priority = priority; 17 | } 18 | 19 | /** 20 | * Higher value means higher render priority over an overlapping lower priority 21 | * @return () 22 | */ 23 | public int getRenderPriority() 24 | { 25 | return this.priority; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/interfaces/ISchematicPickBlockEventManager.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.interfaces; 2 | 3 | import fi.dy.masa.litematica.schematic.pickblock.SchematicPickBlockEventResult; 4 | import net.minecraft.world.item.ItemStack; 5 | 6 | public interface ISchematicPickBlockEventManager 7 | { 8 | void registerSchematicPickBlockEventListener(ISchematicPickBlockEventListener listener); 9 | 10 | SchematicPickBlockEventResult invokeRedirectPickBlockStack(ISchematicPickBlockEventListener listener, ItemStack newStack); 11 | 12 | SchematicPickBlockEventResult invokeRedirectPickBlockSlotHandler(ISchematicPickBlockEventListener listener, ISchematicPickBlockSlotHandler slotHandler); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/util/IEntityRendererInvoker.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.util; 2 | 3 | import net.minecraft.client.renderer.entity.EntityRenderer; 4 | import net.minecraft.client.renderer.entity.state.EntityRenderState; 5 | import net.minecraft.world.entity.Entity; 6 | 7 | /** 8 | * This code is meant to make it's "Best Effort" to get a valid 9 | * Entity Render State for Player Models; but also to not crash if it fails. 10 | */ 11 | public interface IEntityRendererInvoker 12 | { 13 | EntityRenderer litematica_getEntityRendererNullSafe(E entity); 14 | EntityRenderState litematica_getRenderStateNullSafe(E entity, float tickProgress); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/Reference.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica; 2 | 3 | import net.minecraft.SharedConstants; 4 | import fi.dy.masa.malilib.util.StringUtils; 5 | 6 | public class Reference 7 | { 8 | public static final String MOD_ID = "litematica"; 9 | public static final String MOD_NAME = "Litematica"; 10 | public static final String MOD_VERSION = StringUtils.getModVersionString(MOD_ID); 11 | public static final String MC_VERSION = SharedConstants.getCurrentVersion().id(); 12 | public static final String MOD_TYPE = "fabric"; 13 | public static final String MOD_STRING = MOD_ID+"-"+MOD_TYPE+"-"+MC_VERSION+"-"+MOD_VERSION; 14 | // public static final boolean EXPERIMENTAL = true; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/IMixinAbstractBlock.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import net.minecraft.core.BlockPos; 4 | import net.minecraft.world.item.ItemStack; 5 | import net.minecraft.world.level.LevelReader; 6 | import net.minecraft.world.level.block.state.BlockBehaviour; 7 | import net.minecraft.world.level.block.state.BlockState; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.gen.Invoker; 10 | 11 | @Mixin(BlockBehaviour.class) 12 | public interface IMixinAbstractBlock 13 | { 14 | @Invoker("getCloneItemStack") 15 | ItemStack litematica_getPickStack(LevelReader worldView, BlockPos blockPos, BlockState blockState, boolean bl); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/schematic/conversion/IBlockReaderWithData.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.schematic.conversion; 2 | 3 | import javax.annotation.Nullable; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.nbt.CompoundTag; 6 | import net.minecraft.world.level.BlockGetter; 7 | 8 | public interface IBlockReaderWithData extends BlockGetter 9 | { 10 | @Nullable 11 | CompoundTag getBlockEntityData(BlockPos pos); 12 | 13 | // TODO 1.17: These shouldn't matter here... right? 14 | @Override 15 | default int getHeight() 16 | { 17 | return 384; 18 | } 19 | 20 | @Override 21 | default int getMinY() 22 | { 23 | return -64; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/IMixinStairsBlock.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import net.minecraft.core.BlockPos; 4 | import net.minecraft.world.level.BlockGetter; 5 | import net.minecraft.world.level.block.StairBlock; 6 | import net.minecraft.world.level.block.state.BlockState; 7 | import net.minecraft.world.level.block.state.properties.StairsShape; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.gen.Invoker; 10 | 11 | @Mixin(StairBlock.class) 12 | public interface IMixinStairsBlock 13 | { 14 | @Invoker("getStairsShape") 15 | static StairsShape litematica_invokeGetStairShape(BlockState state, BlockGetter worldIn, BlockPos pos) { return null; } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/template_glass_pane_fallback_side.json: -------------------------------------------------------------------------------- 1 | { 2 | "ambientocclusion": false, 3 | "textures": { 4 | "particle": "#pane" 5 | }, 6 | "elements": [ 7 | { "from": [ 7, 0, 0 ], 8 | "to": [ 9, 16, 7 ], 9 | "faces": { 10 | "down": { "uv": [ 7, 0, 9, 7 ], "texture": "#edge" }, 11 | "up": { "uv": [ 7, 0, 9, 7 ], "texture": "#edge" }, 12 | "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, 13 | "west": { "uv": [ 16, 0, 9, 16 ], "texture": "#pane" }, 14 | "east": { "uv": [ 9, 0, 16, 16 ], "texture": "#pane" } 15 | } 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/models/block/template_glass_pane_fallback_side_alt.json: -------------------------------------------------------------------------------- 1 | { 2 | "ambientocclusion": false, 3 | "textures": { 4 | "particle": "#pane" 5 | }, 6 | "elements": [ 7 | { "from": [ 7, 0, 9 ], 8 | "to": [ 9, 16, 16 ], 9 | "faces": { 10 | "down": { "uv": [ 7, 0, 9, 7 ], "texture": "#edge" }, 11 | "up": { "uv": [ 7, 0, 9, 7 ], "texture": "#edge" }, 12 | "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "south" }, 13 | "west": { "uv": [ 7, 0, 0, 16 ], "texture": "#pane" }, 14 | "east": { "uv": [ 0, 0, 7, 16 ], "texture": "#pane" } 15 | } 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/entity/IMixinEntity.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.entity; 2 | 3 | import net.minecraft.world.entity.Entity; 4 | import net.minecraft.world.level.Level; 5 | import net.minecraft.world.level.storage.ValueInput; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | import org.spongepowered.asm.mixin.gen.Invoker; 9 | 10 | @Mixin(Entity.class) 11 | public interface IMixinEntity 12 | { 13 | @Accessor("level") 14 | void litematica_setWorld(Level world); 15 | 16 | @Invoker("readAdditionalSaveData") 17 | void litematica_readCustomData(ValueInput view); 18 | 19 | @Accessor("wasTouchingWater") 20 | boolean litematica_isTouchingWater(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/schematic/ao/AOLightmap.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.schematic.ao; 2 | 3 | import fi.dy.masa.litematica.render.schematic.BlockModelRendererSchematic; 4 | import net.minecraft.core.BlockPos; 5 | 6 | public class AOLightmap 7 | { 8 | public final BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(); 9 | public boolean hasOffset; // has Offset (field_58160) 10 | public boolean hasNeighbors; // has NeighborData (field_58161) 11 | public final float[] fs = new float[4]; 12 | public final int[] is = new int[4]; 13 | public int lastTintIndex = -1; 14 | public int colorOfLastTintIndex; 15 | public final AOBrightness brightnessCache = BlockModelRendererSchematic.BRIGHTNESS_CACHE.get(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/entity/MixinEntity.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.entity; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Shadow; 5 | 6 | import fi.dy.masa.litematica.util.IEntityInvoker; 7 | import net.minecraft.world.entity.Entity; 8 | 9 | @Mixin(Entity.class) 10 | public abstract class MixinEntity implements IEntityInvoker 11 | { 12 | @Shadow protected boolean wasTouchingWater; 13 | 14 | public MixinEntity() 15 | { 16 | super(); 17 | } 18 | 19 | @Override 20 | public void litematica$toggleTouchingWater(boolean toggle) 21 | { 22 | if (toggle != this.wasTouchingWater) 23 | { 24 | this.wasTouchingWater = toggle; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/world/MixinWorld.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.world; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Unique; 5 | import fi.dy.masa.litematica.util.IWorldUpdateSuppressor; 6 | import net.minecraft.world.level.Level; 7 | 8 | @Mixin(Level.class) 9 | public class MixinWorld implements IWorldUpdateSuppressor 10 | { 11 | @Unique private boolean litematica_preventBlockUpdates; 12 | 13 | @Override 14 | public boolean litematica_getShouldPreventBlockUpdates() 15 | { 16 | return this.litematica_preventBlockUpdates; 17 | } 18 | 19 | @Override 20 | public void litematica_setShouldPreventBlockUpdates(boolean preventUpdates) 21 | { 22 | this.litematica_preventBlockUpdates = preventUpdates; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/schematic/ao/AOOrientation.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.schematic.ao; 2 | 3 | import net.minecraft.core.Direction; 4 | 5 | public enum AOOrientation 6 | { 7 | DOWN(Direction.DOWN, false), 8 | UP(Direction.UP, false), 9 | NORTH(Direction.NORTH, false), 10 | SOUTH(Direction.SOUTH, false), 11 | WEST(Direction.WEST, false), 12 | EAST(Direction.EAST, false), 13 | FLIP_DOWN(Direction.DOWN, true), 14 | FLIP_UP(Direction.UP, true), 15 | FLIP_NORTH(Direction.NORTH, true), 16 | FLIP_SOUTH(Direction.SOUTH, true), 17 | FLIP_WEST(Direction.WEST, true), 18 | FLIP_EAST(Direction.EAST, true); 19 | 20 | final int shape; 21 | 22 | AOOrientation(final Direction face, final boolean flip) 23 | { 24 | this.shape = face.get3DDataValue() + (flip ? Direction.values().length : 0); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/scheduler/TaskTimer.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.scheduler; 2 | 3 | public class TaskTimer 4 | { 5 | private final int interval; 6 | private int counter; 7 | 8 | public TaskTimer(int interval) 9 | { 10 | this.interval = interval; 11 | this.counter = interval; 12 | } 13 | 14 | /** 15 | * Ticks the timer. Returns true when it hits 0, and then resets itself. 16 | * @return 17 | */ 18 | public boolean tick() 19 | { 20 | if (--this.counter <= 0) 21 | { 22 | this.reset(); 23 | return true; 24 | } 25 | 26 | return false; 27 | } 28 | 29 | public void reset() 30 | { 31 | this.counter = this.interval; 32 | } 33 | 34 | public void setNextDelay(int delay) 35 | { 36 | this.counter = delay; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/scheduler/tasks/TaskCountBlocksArea.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.scheduler.tasks; 2 | 3 | import fi.dy.masa.litematica.materials.IMaterialList; 4 | import fi.dy.masa.litematica.selection.AreaSelection; 5 | import net.minecraft.core.BlockPos; 6 | import net.minecraft.world.level.block.state.BlockState; 7 | 8 | public class TaskCountBlocksArea extends TaskCountBlocksBase 9 | { 10 | public TaskCountBlocksArea(AreaSelection selection, IMaterialList materialList) 11 | { 12 | super(materialList, "litematica.gui.label.task_name.area_analyzer"); 13 | 14 | this.addPerChunkBoxes(selection.getAllSubRegionBoxes()); 15 | } 16 | 17 | @Override 18 | protected void countAtPosition(BlockPos pos) 19 | { 20 | BlockState stateClient = this.clientWorld.getBlockState(pos); 21 | this.countsTotal.addTo(stateClient, 1); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/compat/sodium/SodiumCompat.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.compat.sodium; 2 | 3 | import net.fabricmc.loader.api.FabricLoader; 4 | 5 | public class SodiumCompat 6 | { 7 | public static final String SODIUM = "sodium"; 8 | private static boolean hasSodium; 9 | private static String version = ""; 10 | 11 | public static void checkForSodium() 12 | { 13 | hasSodium = FabricLoader.getInstance().isModLoaded(SODIUM); 14 | 15 | if (FabricLoader.getInstance().getModContainer(SODIUM).isPresent()) 16 | { 17 | version = FabricLoader.getInstance().getModContainer(SODIUM).get().getMetadata().getVersion().getFriendlyString(); 18 | } 19 | } 20 | 21 | public static boolean hasSodium() { return hasSodium; } 22 | 23 | public static String getVersion() { return version; } 24 | 25 | static 26 | { 27 | checkForSodium(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/render/MixinBlockRenderManager.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.render; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 7 | 8 | import fi.dy.masa.litematica.render.LitematicaRenderer; 9 | import net.minecraft.client.renderer.block.BlockRenderDispatcher; 10 | import net.minecraft.server.packs.resources.ResourceManager; 11 | 12 | @Mixin(BlockRenderDispatcher.class) 13 | public class MixinBlockRenderManager 14 | { 15 | @Inject(method = "onResourceManagerReload", at = @At("TAIL")) 16 | private void litematica_onBlockRenderManagerReload(ResourceManager manager, CallbackInfo ci) 17 | { 18 | LitematicaRenderer.getInstance().onBlockModelRendererReload((BlockRenderDispatcher) (Object) this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/render/MixinGameRenderer.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.render; 2 | 3 | import net.minecraft.client.Camera; 4 | import net.minecraft.client.renderer.GameRenderer; 5 | import org.spongepowered.asm.mixin.Final; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | import fi.dy.masa.litematica.render.LitematicaRenderer; 13 | 14 | @Mixin(GameRenderer.class) 15 | public class MixinGameRenderer 16 | { 17 | @Shadow @Final private Camera mainCamera; 18 | 19 | @Inject(method = "extractCamera", at = @At("TAIL")) 20 | private void litematica_updateCameraState(float f, CallbackInfo ci) 21 | { 22 | LitematicaRenderer.getInstance().updateCameraState(this.mainCamera, f); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/schematic/SchematicRenderState.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.schematic; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import net.minecraft.client.renderer.blockentity.state.BlockEntityRenderState; 6 | import net.minecraft.client.renderer.entity.state.EntityRenderState; 7 | import net.minecraft.client.renderer.state.CameraRenderState; 8 | 9 | public class SchematicRenderState 10 | { 11 | protected CameraRenderState cameraState; 12 | protected final List entityStates; 13 | protected final List tileEntityStates; 14 | 15 | protected SchematicRenderState() 16 | { 17 | this.cameraState = new CameraRenderState(); 18 | this.entityStates = new ArrayList<>(); 19 | this.tileEntityStates = new ArrayList<>(); 20 | } 21 | 22 | protected void clear() 23 | { 24 | this.entityStates.clear(); 25 | this.tileEntityStates.clear(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/schematic/ao/AOProcessor.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.schematic.ao; 2 | 3 | import fi.dy.masa.litematica.config.Configs; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.core.Direction; 6 | import net.minecraft.world.level.BlockAndTintGetter; 7 | import net.minecraft.world.level.block.state.BlockState; 8 | 9 | public abstract class AOProcessor extends AOLightmap 10 | { 11 | public static final Direction[] DIRECTIONS = Direction.values(); 12 | 13 | public static AOProcessor get() 14 | { 15 | if (Configs.Visuals.RENDER_AO_MODERN_ENABLE.getBooleanValue()) 16 | { 17 | return new AOProcessorModern(); 18 | } 19 | else 20 | { 21 | return new AOProcessorLegacy(); 22 | } 23 | } 24 | 25 | public void apply(BlockAndTintGetter world, BlockState state, BlockPos pos, Direction face, boolean hasShade) 26 | { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/Litematica.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica; 2 | 3 | import org.apache.logging.log4j.LogManager; 4 | import org.apache.logging.log4j.Logger; 5 | 6 | import net.fabricmc.api.ModInitializer; 7 | 8 | import fi.dy.masa.malilib.event.InitializationHandler; 9 | import fi.dy.masa.litematica.config.Configs; 10 | 11 | public class Litematica implements ModInitializer 12 | { 13 | public static final Logger LOGGER = LogManager.getLogger(Reference.MOD_ID); 14 | 15 | @Override 16 | public void onInitialize() 17 | { 18 | InitializationHandler.getInstance().registerInitializationHandler(new InitHandler()); 19 | // RenderEventHandler.getInstance().registerSpecialGuiRenderer(); 20 | } 21 | 22 | public static void debugLog(String msg, Object... args) 23 | { 24 | if (Configs.Generic.DEBUG_LOGGING.getBooleanValue()) 25 | { 26 | Litematica.LOGGER.info(msg, args); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/schematic/placement/SchematicPlacementEventFlag.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.schematic.placement; 2 | 3 | /** 4 | * The flags used by {@link SchematicPlacementEventHandler} 5 | */ 6 | public enum SchematicPlacementEventFlag 7 | { 8 | ALL_EVENTS, 9 | 10 | INIT, 11 | CREATE_FOR, 12 | FOR_CONVERSION, 13 | FROM_JSON, 14 | FROM_NBT, 15 | TO_JSON, 16 | TO_NBT, 17 | 18 | TOGGLE_LOCKED, 19 | SET_ENABLED, 20 | SET_RENDER, 21 | SET_NAME, 22 | SET_ORIGIN, 23 | SET_MIRROR, 24 | SET_ROTATION, 25 | ON_RESET, 26 | 27 | INIT_SUBREGION, 28 | SUBREGION_FROM_JSON, 29 | SUBREGION_TO_JSON, 30 | 31 | SET_SUBREGION_ENABLED, 32 | SET_SUBREGION_RENDER, 33 | SET_SUBREGION_NAME, 34 | SET_SUBREGION_ORIGIN, 35 | SET_SUBREGION_MIRROR, 36 | SET_SUBREGION_ROTATION, 37 | ON_SUBREGION_RESET, 38 | 39 | ON_SELECTED, 40 | ON_ADDED, 41 | ON_REMOVED, 42 | ON_UPDATED 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/interfaces/ISchematicPickBlockEventListener.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.interfaces; 2 | 3 | import java.util.function.Supplier; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.world.item.ItemStack; 6 | import net.minecraft.world.level.Level; 7 | import net.minecraft.world.level.block.state.BlockState; 8 | import fi.dy.masa.litematica.schematic.pickblock.SchematicPickBlockEventResult; 9 | 10 | public interface ISchematicPickBlockEventListener 11 | { 12 | Supplier getName(); 13 | 14 | void onSchematicPickBlockCancelled(Supplier cancelledBy); 15 | 16 | SchematicPickBlockEventResult onSchematicPickBlockStart(boolean closest); 17 | 18 | SchematicPickBlockEventResult onSchematicPickBlockPreGather(Level schematicWorld, BlockPos pos, BlockState expectedState); 19 | 20 | SchematicPickBlockEventResult onSchematicPickBlockPrePick(Level schematicWorld, BlockPos pos, BlockState expectedState, ItemStack stack); 21 | 22 | void onSchematicPickBlockSuccess(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/render/MixinBufferBuilder.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.render; 2 | 3 | import com.mojang.blaze3d.vertex.BufferBuilder; 4 | import fi.dy.masa.litematica.render.schematic.IBufferBuilderPatch; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Unique; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyArg; 9 | 10 | @Mixin(BufferBuilder.class) 11 | public class MixinBufferBuilder implements IBufferBuilderPatch 12 | { 13 | @Unique private float offsetY = 0.0f; 14 | 15 | @ModifyArg(method = "addVertex(FFF)Lcom/mojang/blaze3d/vertex/VertexConsumer;", at = @At(value = "INVOKE", target = "Lorg/lwjgl/system/MemoryUtil;memPutFloat(JF)V", ordinal = 1, remap = false), index = 1) 16 | private float litematica_modifyOffsetY(float value) 17 | { 18 | return value + offsetY; 19 | } 20 | 21 | @Override 22 | public void litematica$setOffsetY(float offset) 23 | { 24 | this.offsetY = offset; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/MixinBlockStateFlattening.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | import net.minecraft.util.datafix.fixes.BlockStateData; 6 | import com.mojang.serialization.Dynamic; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | import fi.dy.masa.litematica.schematic.conversion.SchematicConversionMaps; 13 | 14 | @Mixin(BlockStateData.class) 15 | public abstract class MixinBlockStateFlattening 16 | { 17 | @Inject(method = "register", at = @At("HEAD")) 18 | private static void litematica_onAddEntry(int oldIdAndMeta, Dynamic newStateDynamic, Dynamic[] oldStateDynamics, CallbackInfo ci) 19 | { 20 | List> oldDynamics = Arrays.stream(oldStateDynamics).toList(); 21 | SchematicConversionMaps.addDynamicEntry(oldIdAndMeta, newStateDynamic, oldDynamics); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/tool/ToolModeData.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.tool; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.google.gson.JsonPrimitive; 5 | import fi.dy.masa.malilib.util.JsonUtils; 6 | 7 | public class ToolModeData 8 | { 9 | public static final DeleteModeData DELETE = new DeleteModeData(); 10 | 11 | public static class DeleteModeData 12 | { 13 | private boolean usePlacement; 14 | 15 | public boolean getUsePlacement() 16 | { 17 | return this.usePlacement; 18 | } 19 | 20 | public void toggleUsePlacement() 21 | { 22 | this.usePlacement = ! this.usePlacement; 23 | } 24 | 25 | public JsonObject toJson() 26 | { 27 | JsonObject obj = new JsonObject(); 28 | obj.add("use_placement", new JsonPrimitive(this.usePlacement)); 29 | return obj; 30 | } 31 | 32 | public void fromJson(JsonObject obj) 33 | { 34 | this.usePlacement = JsonUtils.getBoolean(obj, "use_placement"); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/scheduler/tasks/TaskDeleteArea.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.scheduler.tasks; 2 | 3 | import java.util.List; 4 | import net.minecraft.world.level.block.Blocks; 5 | import fi.dy.masa.litematica.selection.Box; 6 | import fi.dy.masa.malilib.gui.Message.MessageType; 7 | import fi.dy.masa.malilib.util.InfoUtils; 8 | 9 | public class TaskDeleteArea extends TaskFillArea 10 | { 11 | public TaskDeleteArea(List boxes, boolean removeEntities) 12 | { 13 | super(boxes, Blocks.AIR.defaultBlockState(), null, removeEntities, "litematica.gui.label.task_name.delete"); 14 | } 15 | 16 | @Override 17 | protected void printCompletionMessage() 18 | { 19 | if (this.finished) 20 | { 21 | if (this.printCompletionMessage) 22 | { 23 | InfoUtils.showGuiMessage(MessageType.SUCCESS, "litematica.message.area_cleared"); 24 | } 25 | } 26 | else 27 | { 28 | InfoUtils.showGuiMessage(MessageType.ERROR, "litematica.message.error.area_deletion_aborted"); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/easyplace/MixinServerPlayNetworkHandler_easyPlace.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.easyplace; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Redirect; 6 | import fi.dy.masa.litematica.config.Configs; 7 | import net.minecraft.server.network.ServerGamePacketListenerImpl; 8 | import net.minecraft.world.phys.Vec3; 9 | 10 | @Mixin(value = ServerGamePacketListenerImpl.class, priority = 1010) 11 | public class MixinServerPlayNetworkHandler_easyPlace 12 | { 13 | @Redirect(method = "handleUseItemOn", require = 0, 14 | at = @At(value = "INVOKE", 15 | target = "Lnet/minecraft/world/phys/Vec3;subtract(Lnet/minecraft/world/phys/Vec3;)Lnet/minecraft/world/phys/Vec3;")) 16 | private Vec3 litematica_removeHitPosCheck(Vec3 hitVec, Vec3 blockCenter) 17 | { 18 | if (Configs.Generic.ITEM_USE_PACKET_CHECK_BYPASS.getBooleanValue()) 19 | { 20 | return Vec3.ZERO; 21 | } 22 | 23 | return hitVec.subtract(blockCenter); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/world/MixinWorldChunk.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.world; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Redirect; 6 | import org.spongepowered.asm.mixin.injection.Slice; 7 | import fi.dy.masa.litematica.util.WorldUtils; 8 | import net.minecraft.world.level.Level; 9 | import net.minecraft.world.level.chunk.LevelChunk; 10 | 11 | @Mixin(LevelChunk.class) 12 | public abstract class MixinWorldChunk 13 | { 14 | @Redirect(method = "setBlockState", 15 | slice = @Slice(from = @At(value = "INVOKE", 16 | target = "Lnet/minecraft/world/level/chunk/LevelChunkSection;getBlockState(III)Lnet/minecraft/world/level/block/state/BlockState;")), 17 | at = @At(value = "INVOKE", 18 | target = "Lnet/minecraft/world/level/Level;isClientSide()Z", 19 | ordinal = 0)) 20 | private boolean litematica_redirectIsRemote(Level world) 21 | { 22 | return WorldUtils.shouldPreventBlockUpdates(world) || world.isClientSide(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "litematica", 4 | "name": "Litematica", 5 | "version": "${mod_version}", 6 | 7 | "description": "A modern schematic mod for LiteLoader, Rift, Fabric etc.", 8 | "authors": [ 9 | "masa" 10 | ], 11 | "contact": { 12 | "homepage": "https://www.curseforge.com/minecraft/mc-mods/litematica", 13 | "issues": "https://github.com/maruohon/litematica/issues", 14 | "sources": "https://github.com/maruohon/litematica", 15 | "twitter": "https://twitter.com/maruohon", 16 | "discord": "https://discordapp.com/channels/211786369951989762/453662800460644354/" 17 | }, 18 | 19 | "license": "LGPLv3", 20 | "icon": "assets/litematica/icon.png", 21 | 22 | "environment": "client", 23 | "entrypoints": { 24 | "main": [ 25 | "fi.dy.masa.litematica.Litematica" 26 | ], 27 | "modmenu": [ 28 | "fi.dy.masa.litematica.compat.modmenu.ModMenuImpl" 29 | ] 30 | }, 31 | "mixins": [ 32 | "mixins.litematica.json" 33 | ], 34 | "accessWidener": "litematica.accesswidener", 35 | 36 | "depends": { 37 | "minecraft": "1.21.11", 38 | "malilib": ">=0.27.2- <0.28.0-" 39 | }, 40 | "breaks": { 41 | "malilib": "<0.27.2-" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/scheduler/tasks/TaskDelay.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.scheduler.tasks; 2 | 3 | import java.util.function.BooleanSupplier; 4 | import net.minecraft.util.profiling.ProfilerFiller; 5 | import fi.dy.masa.litematica.scheduler.TaskScheduler; 6 | 7 | public class TaskDelay extends TaskBase 8 | { 9 | protected final TaskScheduler scheduler; 10 | protected final TaskBase task; 11 | protected final BooleanSupplier startConditionChecker; 12 | protected final int interval; 13 | 14 | public TaskDelay(TaskBase task, int interval, TaskScheduler scheduler, BooleanSupplier startConditionChecker) 15 | { 16 | this.task = task; 17 | this.scheduler = scheduler; 18 | this.interval = interval; 19 | this.startConditionChecker = startConditionChecker; 20 | } 21 | 22 | @Override 23 | public boolean execute(ProfilerFiller profiler) 24 | { 25 | if (this.startConditionChecker.getAsBoolean()) 26 | { 27 | this.scheduler.scheduleTask(this.task, this.interval); 28 | this.finished = true; 29 | return true; 30 | } 31 | 32 | return false; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/LitematicaPipelines.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render; 2 | 3 | import org.jetbrains.annotations.ApiStatus; 4 | 5 | import com.mojang.blaze3d.pipeline.RenderPipeline; 6 | import net.minecraft.client.renderer.RenderPipelines; 7 | 8 | @ApiStatus.Experimental 9 | public class LitematicaPipelines 10 | { 11 | // // Snippets 12 | // public static RenderPipeline.Snippet TERRAIN_TRANSLUCENT_STAGE; 13 | // public static RenderPipeline.Snippet TERRAIN_MASA_STAGE; 14 | // 15 | // // Legacy Terrain 16 | // public static RenderPipeline SOLID_MASA; 17 | // public static RenderPipeline CUTOUT_MASA; 18 | // public static RenderPipeline CUTOUT_MIPPED_MASA; 19 | // public static RenderPipeline TRANSLUCENT_MASA; 20 | // public static RenderPipeline TRIPWIRE_MASA; 21 | // public static RenderPipeline WIREFRAME_MASA; 22 | // 23 | // // Legacy Terrain Offset 24 | // public static RenderPipeline SOLID_MASA_OFFSET; 25 | // public static RenderPipeline CUTOUT_MASA_OFFSET; 26 | // public static RenderPipeline CUTOUT_MIPPED_MASA_OFFSET; 27 | // public static RenderPipeline TRANSLUCENT_MASA_OFFSET; 28 | // public static RenderPipeline TRIPWIRE_MASA_OFFSET; 29 | // public static RenderPipeline WIREFRAME_MASA_OFFSET; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/MixinChestBlock.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 7 | import fi.dy.masa.litematica.config.Configs; 8 | import fi.dy.masa.litematica.util.BlockUtils; 9 | import net.minecraft.world.level.block.ChestBlock; 10 | import net.minecraft.world.level.block.Mirror; 11 | import net.minecraft.world.level.block.state.BlockState; 12 | import net.minecraft.world.level.block.state.properties.ChestType; 13 | 14 | @Mixin(ChestBlock.class) 15 | public class MixinChestBlock 16 | { 17 | @Inject(method = "mirror", at = @At("HEAD"), cancellable = true) 18 | private void litematica_fixChestMirror(BlockState state, Mirror mirror, CallbackInfoReturnable cir) 19 | { 20 | ChestType type = state.getValue(ChestBlock.TYPE); 21 | 22 | if (Configs.Generic.FIX_CHEST_MIRROR.getBooleanValue() && type != ChestType.SINGLE) 23 | { 24 | state = BlockUtils.fixMirrorDoubleChest(state, mirror, type); 25 | cir.setReturnValue(state); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/hud/MixinDebugHudProfile.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.hud; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 7 | 8 | import fi.dy.masa.litematica.render.LitematicaDebugHud; 9 | import net.minecraft.client.gui.components.debug.DebugScreenEntryList; 10 | 11 | @Mixin(DebugScreenEntryList.class) 12 | public abstract class MixinDebugHudProfile 13 | { 14 | @Inject(method = "rebuildCurrentList", at = @At("TAIL")) 15 | private void litematica_updateVisibleEntries(CallbackInfo ci) 16 | { 17 | LitematicaDebugHud.INSTANCE.checkConfig(); 18 | 19 | // // Shift to right side to "get out of the way" from the "Player position" display. 20 | // if (LitematicaDebugHud.INSTANCE.getMode() == DebugHudMode.VANILLA && 21 | // this.visibleEntries.contains(LitematicaDebugHud.LITEMATICA_DEBUG)) 22 | // { 23 | // if (LitematicaDebugHud.INSTANCE.shouldUseFallback()) 24 | // { 25 | // Litematica.LOGGER.error("FALLBACK: {}", this.visibleEntries.toString()); 26 | // this.visibleEntries.remove(LitematicaDebugHud.LITEMATICA_DEBUG); 27 | // } 28 | // } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/schematic/ao/AOTranslations.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.schematic.ao; 2 | 3 | import net.minecraft.core.Direction; 4 | import net.minecraft.util.Util; 5 | 6 | public enum AOTranslations 7 | { 8 | DOWN(0, 1, 2, 3), 9 | UP(2, 3, 0, 1), 10 | NORTH(3, 0, 1, 2), 11 | SOUTH(0, 1, 2, 3), 12 | WEST(3, 0, 1, 2), 13 | EAST(1, 2, 3, 0); 14 | 15 | final int vert0; 16 | final int vert1; 17 | final int vert2; 18 | final int vert3; 19 | 20 | private static final AOTranslations[] VALUES = Util.make(new AOTranslations[6], (values) -> 21 | { 22 | values[Direction.DOWN.get3DDataValue()] = DOWN; 23 | values[Direction.UP.get3DDataValue()] = UP; 24 | values[Direction.NORTH.get3DDataValue()] = NORTH; 25 | values[Direction.SOUTH.get3DDataValue()] = SOUTH; 26 | values[Direction.WEST.get3DDataValue()] = WEST; 27 | values[Direction.EAST.get3DDataValue()] = EAST; 28 | }); 29 | 30 | AOTranslations(final int vert0, final int vert1, final int vert2, final int vert3) 31 | { 32 | this.vert0 = vert0; 33 | this.vert1 = vert1; 34 | this.vert2 = vert2; 35 | this.vert3 = vert3; 36 | } 37 | 38 | public static AOTranslations getVertexTranslations(Direction face) 39 | { 40 | return VALUES[face.get3DDataValue()]; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/entity/MixinAbstractSignEditScreen.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.entity; 2 | 3 | import org.spongepowered.asm.mixin.Final; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | import fi.dy.masa.litematica.config.Configs; 10 | import fi.dy.masa.litematica.util.WorldUtils; 11 | import net.minecraft.client.gui.screens.inventory.AbstractSignEditScreen; 12 | import net.minecraft.world.level.block.entity.SignBlockEntity; 13 | 14 | @Mixin(value = AbstractSignEditScreen.class, priority = 990) 15 | public class MixinAbstractSignEditScreen 16 | { 17 | @Shadow @Final protected SignBlockEntity sign; 18 | @Shadow @Final private String[] messages; 19 | @Shadow @Final private boolean isFrontText; 20 | 21 | @Inject(method = "init", at = @At("HEAD")) 22 | private void litematica_insertSignText(CallbackInfo ci) 23 | { 24 | if (Configs.Generic.SIGN_TEXT_PASTE.getBooleanValue()) 25 | { 26 | WorldUtils.insertSignTextFromSchematic(this.sign, this.messages, this.isFrontText); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/server/MixinMinecraftServer.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.server; 2 | 3 | import net.minecraft.server.MinecraftServer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | import fi.dy.masa.litematica.scheduler.TaskScheduler; 11 | 12 | @Mixin(MinecraftServer.class) 13 | public abstract class MixinMinecraftServer 14 | { 15 | @Shadow public abstract boolean isDedicatedServer(); 16 | @Shadow public abstract boolean shouldInformAdmins(); 17 | 18 | @Inject(method = "logTickMethodTime", at = @At("HEAD")) 19 | private void litematica_onServerTickOmegaHackFixBecauseLunarBreaksMinecraftEvenThoughABooleanSupplierIsAlwaysSupposedToBeThereEvenAccordingToMojangMappingsButIsNotWhenYouAreRunningLunarAndTheyCannotExplainWhyThisWouldBreakButItDoesEvenThoughNothingHasChangedInMinecraftUnlessYouArePlayingWithLunar(long tickStartTime, CallbackInfo ci) 20 | { 21 | if (!this.isDedicatedServer() && this.shouldInformAdmins()) 22 | { 23 | TaskScheduler.getInstanceServer().runTasks(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/MixinBlock.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import java.util.function.Supplier; 4 | import net.minecraft.world.entity.item.ItemEntity; 5 | import net.minecraft.world.item.ItemStack; 6 | import net.minecraft.world.level.Level; 7 | import net.minecraft.world.level.block.Block; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | import fi.dy.masa.litematica.util.WorldUtils; 13 | 14 | @Mixin(Block.class) 15 | public class MixinBlock 16 | { 17 | @Inject(method = "popResource(Lnet/minecraft/world/level/Level;Ljava/util/function/Supplier;Lnet/minecraft/world/item/ItemStack;)V", 18 | at = @At("HEAD"), cancellable = true) 19 | private static void litematica_preventItemDrops(Level world, 20 | Supplier itemEntitySupplier, 21 | ItemStack stack, 22 | CallbackInfo ci) 23 | { 24 | if (WorldUtils.shouldPreventBlockUpdates(world)) 25 | { 26 | ci.cancel(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/hud/MixinDebugHudEntries.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.hud; 2 | 3 | @Deprecated 4 | //@Mixin(value = DebugHudEntries.class) 5 | public abstract class MixinDebugHudEntries 6 | { 7 | // @Shadow @Final public static Map ENTRIES; 8 | // @Mutable @Shadow @Final public static Map> PROFILES; 9 | // 10 | // @Inject(method = "", at = @At("TAIL")) 11 | // private static void litematica_registerDebugLines(CallbackInfo ci) 12 | // { 13 | // if (LitematicaDebugHud.INSTANCE.getMode() == DebugHudMode.VANILLA) 14 | // { 15 | // Map defMap = PROFILES.get(DebugProfileType.DEFAULT); 16 | // Map perfMap = PROFILES.get(DebugProfileType.PERFORMANCE); 17 | // ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); 18 | // 19 | // builder.putAll(defMap); 20 | // builder.put(LitematicaDebugHud.LITEMATICA_DEBUG, DebugHudEntryVisibility.IN_F3); 21 | // ENTRIES.put(LitematicaDebugHud.LITEMATICA_DEBUG, LitematicaDebugHud.INSTANCE); 22 | // 23 | // PROFILES = ImmutableMap.of( 24 | // DebugProfileType.DEFAULT, builder.build(), 25 | // DebugProfileType.PERFORMANCE, perfMap 26 | // ); 27 | // } 28 | // } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/network/MixinClientCommonNetworkHandler.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.network; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 7 | import fi.dy.masa.litematica.Litematica; 8 | import fi.dy.masa.litematica.data.DataManager; 9 | import net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl; 10 | import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket; 11 | 12 | /** 13 | * They keep moving where the effective CustomPayload handling is... keeping them both 14 | */ 15 | @Mixin(ClientCommonPacketListenerImpl.class) 16 | public class MixinClientCommonNetworkHandler 17 | { 18 | @Inject(method = "handleCustomPayload(Lnet/minecraft/network/protocol/common/ClientboundCustomPayloadPacket;)V", at = @At("HEAD")) 19 | private void litematica_onCustomPayload(ClientboundCustomPayloadPacket packet, CallbackInfo ci) 20 | { 21 | if (packet.payload().type().id().equals(DataManager.CARPET_HELLO)) 22 | { 23 | Litematica.debugLog("ClientCommonNetworkHandler#litematica_onCustomPayload(): received carpet hello packet"); 24 | DataManager.setIsCarpetServer(true); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Automatically build the project and run any configured tests for every push 2 | # and submitted pull request. This can help catch issues that only occur on 3 | # certain platforms or Java versions, and provides a first line of defence 4 | # against bad commits. 5 | 6 | name: build 7 | on: [ pull_request, push ] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | matrix: 13 | # Use these Java versions 14 | java: [ 21 ] 15 | distro: [ temurin ] 16 | # and run on both Linux and Windows 17 | os: [ ubuntu-latest ] 18 | runs-on: ${{ matrix.os }} 19 | steps: 20 | - name: checkout repository 21 | uses: actions/checkout@v4 22 | - name: validate gradle wrapper 23 | uses: gradle/actions/wrapper-validation@v4 24 | - name: setup jdk ${{ matrix.java }} 25 | uses: actions/setup-java@v4 26 | with: 27 | distribution: ${{ matrix.distro }} 28 | java-version: ${{ matrix.java }} 29 | - name: make gradle wrapper executable 30 | if: ${{ runner.os != 'Windows' }} 31 | run: chmod +x ./gradlew 32 | - name: build 33 | run: ./gradlew build 34 | - name: capture build artifacts 35 | if: ${{ runner.os == 'Linux' }} 36 | uses: actions/upload-artifact@v4 37 | with: 38 | name: Artifacts 39 | path: build/libs/ 40 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/compat/jade/JadeCompat.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.compat.jade; 2 | 3 | import java.util.Objects; 4 | 5 | import fi.dy.masa.malilib.util.StringUtils; 6 | import fi.dy.masa.litematica.Litematica; 7 | 8 | /** 9 | * This is just a compat class to "move" the Info Overlay lower so the window doesn't clash as bad. 10 | */ 11 | public class JadeCompat 12 | { 13 | private static final String JADE_ID = "jade"; 14 | private static final int jadeShift = 35; 15 | private static boolean hasJade; 16 | 17 | public static void checkForJade() 18 | { 19 | String jadeVer = StringUtils.getModVersionString(JADE_ID); 20 | 21 | if (!Objects.equals(jadeVer, "?")) 22 | { 23 | Litematica.debugLog("Detected Jade version {}.", jadeVer); 24 | hasJade = true; 25 | } 26 | else 27 | { 28 | hasJade = false; 29 | } 30 | } 31 | 32 | public static boolean hasJade() 33 | { 34 | return hasJade; 35 | } 36 | 37 | public static int getJadeShift() 38 | { 39 | if (hasJade()) 40 | { 41 | return jadeShift; 42 | } 43 | 44 | return 0; 45 | } 46 | 47 | // todo: Disable snowdee.jade.addon.universal.ItemStorageProvider via reflection while Info Overlay is open? 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/materials/MaterialListAreaAnalyzer.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.materials; 2 | 3 | import fi.dy.masa.litematica.scheduler.TaskScheduler; 4 | import fi.dy.masa.litematica.scheduler.tasks.TaskCountBlocksArea; 5 | import fi.dy.masa.litematica.selection.AreaSelection; 6 | import fi.dy.masa.malilib.gui.Message.MessageType; 7 | import fi.dy.masa.malilib.util.InfoUtils; 8 | import fi.dy.masa.malilib.util.StringUtils; 9 | 10 | public class MaterialListAreaAnalyzer extends MaterialListBase 11 | { 12 | private final AreaSelection selection; 13 | 14 | public MaterialListAreaAnalyzer(AreaSelection selection) 15 | { 16 | super(); 17 | 18 | this.selection = selection; 19 | } 20 | 21 | @Override 22 | public String getName() 23 | { 24 | return this.selection.getName(); 25 | } 26 | 27 | @Override 28 | public String getTitle() 29 | { 30 | return StringUtils.translate("litematica.gui.title.material_list.area_analyzer", this.getName()); 31 | } 32 | 33 | @Override 34 | public void reCreateMaterialList() 35 | { 36 | TaskCountBlocksArea task = new TaskCountBlocksArea(this.selection, this); 37 | TaskScheduler.getInstanceClient().scheduleTask(task, 20); 38 | InfoUtils.showGuiOrInGameMessage(MessageType.INFO, "litematica.message.scheduled_task_added"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/gui/widgets/WidgetListTasks.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.gui.widgets; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | import javax.annotation.Nullable; 6 | import fi.dy.masa.litematica.scheduler.ITask; 7 | import fi.dy.masa.litematica.scheduler.TaskScheduler; 8 | import fi.dy.masa.malilib.gui.interfaces.ISelectionListener; 9 | import fi.dy.masa.malilib.gui.widgets.WidgetListBase; 10 | 11 | public class WidgetListTasks extends WidgetListBase 12 | { 13 | public WidgetListTasks(int x, int y, int width, int height, 14 | @Nullable ISelectionListener selectionListener) 15 | { 16 | super(x, y, width, height, selectionListener); 17 | 18 | this.browserEntryHeight = 22; 19 | } 20 | 21 | @Override 22 | protected Collection getAllEntries() 23 | { 24 | ArrayList list = new ArrayList<>(); 25 | list.addAll(TaskScheduler.getInstanceClient().getAllTasks()); 26 | list.addAll(TaskScheduler.getInstanceServer().getAllTasks()); 27 | return list; 28 | } 29 | 30 | @Override 31 | protected WidgetTaskEntry createListEntryWidget(int x, int y, int listIndex, boolean isOdd, ITask entry) 32 | { 33 | return new WidgetTaskEntry(x, y, this.browserEntryWidth, this.getBrowserEntryHeightFor(entry), 34 | isOdd, entry, listIndex, this); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/schematic/container/ILitematicaBlockStatePalette.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.schematic.container; 2 | 3 | import java.util.List; 4 | import javax.annotation.Nullable; 5 | import net.minecraft.nbt.ListTag; 6 | import net.minecraft.world.level.block.state.BlockState; 7 | import org.jetbrains.annotations.ApiStatus; 8 | 9 | import com.mojang.serialization.Codec; 10 | 11 | public interface ILitematicaBlockStatePalette 12 | { 13 | @ApiStatus.Experimental 14 | Codec codec(); 15 | 16 | void setResizer(ILitematicaBlockStatePaletteResizer resizer); 17 | 18 | /** 19 | * Gets the palette id for the given block state and adds 20 | * the state to the palette if it doesn't exist there yet. 21 | */ 22 | int idFor(BlockState state); 23 | 24 | /** 25 | * Gets the block state by the palette id. 26 | */ 27 | @Nullable 28 | BlockState getBlockState(int indexKey); 29 | 30 | int getPaletteSize(); 31 | 32 | void readFromNBT(ListTag tagList); 33 | 34 | ListTag writeToNBT(); 35 | 36 | /** 37 | * Sets the current mapping of the palette. 38 | * This is meant for reading the palette from file. 39 | * @param list () 40 | * @return true if the mapping was set successfully, false if it failed 41 | */ 42 | boolean setMapping(List list); 43 | 44 | List fromMapping(); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/scheduler/ITask.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.scheduler; 2 | 3 | import net.minecraft.util.profiling.ProfilerFiller; 4 | 5 | public interface ITask 6 | { 7 | /** 8 | * Get the display name for this task, used in the Task Manager GUI 9 | * @return () 10 | */ 11 | String getDisplayName(); 12 | 13 | /** 14 | * Initialize the task. Called when the task is added to the task list. 15 | */ 16 | void init(); 17 | 18 | /** 19 | * Return whether this task can be executed. 20 | * @return true if the task can be executed 21 | */ 22 | boolean canExecute(); 23 | 24 | /** 25 | * Execute the task. Return true to indicate that this task has finished. 26 | * @return true to indicate the task has finished and can be removed 27 | */ 28 | boolean execute(ProfilerFiller profiler); 29 | 30 | /** 31 | * Returns true if this task should be removed 32 | * @return () 33 | */ 34 | boolean shouldRemove(); 35 | 36 | /** 37 | * Stop the task. This is also called when the tasks are removed. 38 | */ 39 | void stop(); 40 | 41 | /** 42 | * Returns the task's timer 43 | * @return () 44 | */ 45 | TaskTimer getTimer(); 46 | 47 | /** 48 | * Creates a new timer for the task, with the given execution interval in game ticks 49 | * @param interval () 50 | */ 51 | void createTimer(int interval); 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/easyplace/MixinMinecraftClient_easyPlace.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.easyplace; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 7 | 8 | import fi.dy.masa.litematica.config.Configs; 9 | import fi.dy.masa.litematica.util.EasyPlaceUtils; 10 | import net.minecraft.client.Minecraft; 11 | 12 | /** 13 | * Post Re-Write code 14 | */ 15 | @Mixin(value = Minecraft.class) 16 | public abstract class MixinMinecraftClient_easyPlace 17 | { 18 | @Inject(method = "handleKeybinds", 19 | at = @At(value = "INVOKE", 20 | target = "Lnet/minecraft/client/Minecraft;startUseItem()V")) 21 | private void onUseKeyPre(CallbackInfo ci) 22 | { 23 | if (Configs.Generic.EASY_PLACE_MODE.getBooleanValue() && 24 | Configs.Generic.EASY_PLACE_POST_REWRITE.getBooleanValue()) 25 | { 26 | EasyPlaceUtils.setIsFirstClick(); 27 | } 28 | } 29 | 30 | @Inject(method = "startUseItem", at = @At("TAIL")) 31 | private void onUseKeyPost(CallbackInfo ci) 32 | { 33 | if (Configs.Generic.EASY_PLACE_MODE.getBooleanValue() && 34 | Configs.Generic.EASY_PLACE_POST_REWRITE.getBooleanValue()) 35 | { 36 | if (EasyPlaceUtils.shouldDoEasyPlaceActions()) 37 | { 38 | EasyPlaceUtils.onRightClickTail(); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/infohud/IInfoHudRenderer.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.infohud; 2 | 3 | import java.util.List; 4 | import net.minecraft.client.gui.GuiGraphics; 5 | import fi.dy.masa.malilib.config.HudAlignment; 6 | 7 | public interface IInfoHudRenderer 8 | { 9 | /** 10 | * Return true if this renderer should render its text in the indicated phase 11 | * @return () 12 | */ 13 | boolean getShouldRenderText(RenderPhase phase); 14 | 15 | /** 16 | * Return true if this renderer should render its custom content via render() 17 | * @return () 18 | */ 19 | default boolean getShouldRenderCustom() 20 | { 21 | return false; 22 | } 23 | 24 | /** 25 | * Whether or not this renderer should also be rendered when GUIs are open 26 | * @return () 27 | */ 28 | default boolean shouldRenderInGuis() 29 | { 30 | return false; 31 | } 32 | 33 | /** 34 | * Returns the text lines rendered by the InfoHud, if any 35 | * @return () 36 | */ 37 | List getText(RenderPhase phase); 38 | 39 | /** 40 | * Render any custom content on the HUD. 41 | * @param yOffset The starting y offset from the edge of the screen indicated by alignment 42 | * @param alignment the screen position to render at 43 | * @return the required y height used up for the rendered content 44 | */ 45 | default int render(GuiGraphics drawContext, int xOffset, int yOffset, HudAlignment alignment) 46 | { 47 | return 0; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/MixinBlockStateManagers.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import java.util.Map; 4 | import net.minecraft.client.resources.model.BlockStateDefinitions; 5 | import net.minecraft.resources.Identifier; 6 | import net.minecraft.world.level.block.Block; 7 | import net.minecraft.world.level.block.state.BlockState; 8 | import net.minecraft.world.level.block.state.StateDefinition; 9 | import com.google.common.collect.ImmutableMap; 10 | import org.spongepowered.asm.mixin.Final; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.Mutable; 13 | import org.spongepowered.asm.mixin.Shadow; 14 | import org.spongepowered.asm.mixin.injection.At; 15 | import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | 18 | import fi.dy.masa.litematica.render.schematic.blocks.FallbackBlocks; 19 | 20 | @Mixin(BlockStateDefinitions.class) 21 | public class MixinBlockStateManagers 22 | { 23 | @Mutable @Final @Shadow private static Map> STATIC_DEFINITIONS; 24 | 25 | @Inject(method = "", at = @At("RETURN")) 26 | private static void litematica$fillFallbackBlocks(CallbackInfo ci) 27 | { 28 | FallbackBlocks.register(); 29 | ImmutableMap.Builder> builder = new ImmutableMap.Builder<>(); 30 | 31 | builder.putAll(STATIC_DEFINITIONS); 32 | 33 | for (Identifier id : FallbackBlocks.ID_TO_STATE_MANAGER.keySet()) 34 | { 35 | builder.put(id, FallbackBlocks.ID_TO_STATE_MANAGER.get(id)); 36 | } 37 | 38 | STATIC_DEFINITIONS = builder.build(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/materials/MaterialListSchematic.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.materials; 2 | 3 | import java.util.Collection; 4 | import com.google.common.collect.ImmutableList; 5 | import fi.dy.masa.litematica.schematic.LitematicaSchematic; 6 | import fi.dy.masa.malilib.util.StringUtils; 7 | 8 | public class MaterialListSchematic extends MaterialListBase 9 | { 10 | private final LitematicaSchematic schematic; 11 | private final ImmutableList regions; 12 | 13 | public MaterialListSchematic(LitematicaSchematic schematic, boolean reCreate) 14 | { 15 | this(schematic, schematic.getAreas().keySet(), reCreate); 16 | } 17 | 18 | public MaterialListSchematic(LitematicaSchematic schematic, Collection subRegions, boolean reCreate) 19 | { 20 | super(); 21 | 22 | this.schematic = schematic; 23 | this.regions = ImmutableList.copyOf(subRegions); 24 | 25 | if (reCreate) 26 | { 27 | this.reCreateMaterialList(); 28 | } 29 | } 30 | 31 | @Override 32 | public void reCreateMaterialList() 33 | { 34 | this.materialListAll = ImmutableList.copyOf(MaterialListUtils.createMaterialListFor(this.schematic, this.regions)); 35 | this.refreshPreFilteredList(); 36 | this.updateCounts(); 37 | } 38 | 39 | @Override 40 | public String getName() 41 | { 42 | return this.schematic.getMetadata().getName(); 43 | } 44 | 45 | @Override 46 | public String getTitle() 47 | { 48 | return StringUtils.translate("litematica.gui.title.material_list.schematic", this.getName(), this.regions.size(), this.schematic.getAreas().size()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/materials/MaterialListSorter.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.materials; 2 | 3 | import java.util.Comparator; 4 | import fi.dy.masa.litematica.materials.MaterialListBase.SortCriteria; 5 | 6 | public class MaterialListSorter implements Comparator 7 | { 8 | private final MaterialListBase materialList; 9 | 10 | public MaterialListSorter(MaterialListBase materialList) 11 | { 12 | this.materialList = materialList; 13 | } 14 | 15 | @Override 16 | public int compare(MaterialListEntry entry1, MaterialListEntry entry2) 17 | { 18 | boolean reverse = this.materialList.getSortInReverse(); 19 | SortCriteria sortCriteria = this.materialList.getSortCriteria(); 20 | int nameCompare = entry1.getStack().getHoverName().getString().compareTo(entry2.getStack().getHoverName().getString()); 21 | 22 | if (sortCriteria == SortCriteria.COUNT_TOTAL) 23 | { 24 | return entry1.getCountTotal() == entry2.getCountTotal() ? nameCompare : ((entry1.getCountTotal() > entry2.getCountTotal()) != reverse ? -1 : 1); 25 | } 26 | else if (sortCriteria == SortCriteria.COUNT_MISSING) 27 | { 28 | return entry1.getCountMissing() == entry2.getCountMissing() ? nameCompare : ((entry1.getCountMissing() > entry2.getCountMissing()) != reverse ? -1 : 1); 29 | } 30 | else if (sortCriteria == SortCriteria.COUNT_AVAILABLE) 31 | { 32 | return entry1.getCountAvailable() == entry2.getCountAvailable() ? nameCompare : ((entry1.getCountAvailable() > entry2.getCountAvailable()) != reverse ? -1 : 1); 33 | } 34 | 35 | return reverse == false ? nameCompare * -1 : nameCompare; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/gui/GuiTaskManager.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.gui; 2 | 3 | import fi.dy.masa.litematica.gui.GuiMainMenu.ButtonListenerChangeMenu; 4 | import fi.dy.masa.litematica.gui.widgets.WidgetListTasks; 5 | import fi.dy.masa.litematica.gui.widgets.WidgetTaskEntry; 6 | import fi.dy.masa.litematica.scheduler.ITask; 7 | import fi.dy.masa.malilib.gui.GuiListBase; 8 | import fi.dy.masa.malilib.gui.button.ButtonGeneric; 9 | import fi.dy.masa.malilib.util.StringUtils; 10 | 11 | public class GuiTaskManager extends GuiListBase 12 | { 13 | public GuiTaskManager() 14 | { 15 | super(12, 30); 16 | 17 | this.title = StringUtils.translate("litematica.gui.title.task_manager"); 18 | } 19 | 20 | @Override 21 | protected int getBrowserWidth() 22 | { 23 | return this.getScreenWidth() - 20; 24 | } 25 | 26 | @Override 27 | protected int getBrowserHeight() 28 | { 29 | return this.getScreenHeight() - 68; 30 | } 31 | 32 | @Override 33 | public void initGui() 34 | { 35 | super.initGui(); 36 | 37 | int y = this.getScreenHeight() - 26; 38 | 39 | ButtonListenerChangeMenu.ButtonType type = ButtonListenerChangeMenu.ButtonType.MAIN_MENU; 40 | ButtonGeneric button = new ButtonGeneric(this.getScreenWidth() - 10, y, -1, true, StringUtils.translate(type.getLabelKey())); 41 | this.addButton(button, new ButtonListenerChangeMenu(type, this.getParent())); 42 | } 43 | 44 | @Override 45 | protected WidgetListTasks createListWidget(int listX, int listY) 46 | { 47 | return new WidgetListTasks(listX, listY, this.getBrowserWidth(), this.getBrowserHeight(), null); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/scheduler/ClientTickHandler.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.scheduler; 2 | 3 | import fi.dy.masa.malilib.interfaces.IClientTickHandler; 4 | import fi.dy.masa.malilib.util.EntityUtils; 5 | import net.minecraft.client.Minecraft; 6 | import fi.dy.masa.litematica.config.Configs; 7 | import fi.dy.masa.litematica.data.DataManager; 8 | import fi.dy.masa.litematica.selection.SelectionManager; 9 | import fi.dy.masa.litematica.util.EasyPlaceUtils; 10 | import fi.dy.masa.litematica.util.WorldUtils; 11 | 12 | public class ClientTickHandler implements IClientTickHandler 13 | { 14 | @Override 15 | public void onClientTick(Minecraft mc) 16 | { 17 | if (mc.level != null && mc.player != null) 18 | { 19 | SelectionManager sm = DataManager.getSelectionManager(); 20 | 21 | if (sm.hasGrabbedElement()) 22 | { 23 | sm.moveGrabbedElement(mc.player); 24 | } 25 | 26 | if (mc.screen == null) 27 | { 28 | if (Configs.Generic.EASY_PLACE_POST_REWRITE.getBooleanValue()) 29 | { 30 | EasyPlaceUtils.easyPlaceOnUseTick(); 31 | } 32 | else 33 | { 34 | WorldUtils.easyPlaceOnUseTick(mc); 35 | } 36 | } 37 | 38 | if (Configs.Generic.LAYER_MODE_DYNAMIC.getBooleanValue()) 39 | { 40 | DataManager.getRenderLayerRange().setSingleBoundaryToPosition(EntityUtils.getCameraEntity()); 41 | } 42 | 43 | DataManager.getSchematicPlacementManager().processQueuedChunks(); 44 | TaskScheduler.getInstanceClient().runTasks(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/red_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/red_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/red_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/red_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/red_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/red_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/red_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/red_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/red_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/red_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/screen/MixinHandledScreen.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.screen; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 7 | 8 | import fi.dy.masa.litematica.materials.MaterialListHudRenderer; 9 | import fi.dy.masa.malilib.render.GuiContext; 10 | import net.minecraft.client.gui.GuiGraphics; 11 | import net.minecraft.client.gui.screens.Screen; 12 | import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; 13 | import net.minecraft.network.chat.Component; 14 | 15 | @Mixin(AbstractContainerScreen.class) 16 | public abstract class MixinHandledScreen extends Screen 17 | { 18 | private MixinHandledScreen(Component title) 19 | { 20 | super(title); 21 | } 22 | 23 | @Inject(method = "renderContents", at = @At(value = "INVOKE", 24 | target = "Lnet/minecraft/client/gui/screens/Screen;render(Lnet/minecraft/client/gui/GuiGraphics;IIF)V")) 25 | private void litematica_renderSlotHighlightsPre(GuiGraphics drawContext, int mouseX, int mouseY, float delta, CallbackInfo ci) 26 | { 27 | MaterialListHudRenderer.renderLookedAtBlockInInventory(GuiContext.fromGuiGraphics(drawContext), (AbstractContainerScreen) (Object) this, this.minecraft); 28 | } 29 | 30 | @Inject(method = "render", at = @At("TAIL")) 31 | private void litematica_renderSlotHighlightsPost(GuiGraphics drawContext, int mouseX, int mouseY, float delta, CallbackInfo ci) 32 | { 33 | MaterialListHudRenderer.renderLookedAtBlockInInventory(GuiContext.fromGuiGraphics(drawContext), (AbstractContainerScreen) (Object) this, this.minecraft); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/blue_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/blue_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/blue_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/blue_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/blue_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/blue_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/blue_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/blue_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/blue_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/blue_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/cyan_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/cyan_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/cyan_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/cyan_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/cyan_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/cyan_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/cyan_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/cyan_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/cyan_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/cyan_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/gray_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/gray_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/gray_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/gray_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/gray_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/gray_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/gray_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/gray_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/gray_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/gray_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/lime_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/lime_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/lime_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/lime_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/lime_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/lime_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/lime_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/lime_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/lime_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/lime_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/pink_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/pink_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/pink_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/pink_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/pink_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/pink_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/pink_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/pink_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/pink_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/pink_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/black_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/black_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/black_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/black_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/black_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/black_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/black_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/black_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/black_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/black_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/brown_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/brown_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/brown_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/brown_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/brown_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/brown_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/brown_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/brown_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/brown_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/brown_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/green_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/green_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/green_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/green_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/green_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/green_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/green_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/green_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/green_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/green_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/white_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/white_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/white_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/white_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/white_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/white_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/white_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/white_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/white_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/white_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/MixinMinecraftClient.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 7 | 8 | import fi.dy.masa.litematica.config.Configs; 9 | import fi.dy.masa.litematica.data.DataManager; 10 | import fi.dy.masa.litematica.util.EasyPlaceUtils; 11 | import fi.dy.masa.litematica.util.WorldUtils; 12 | import net.minecraft.client.Minecraft; 13 | import net.minecraft.util.thread.ReentrantBlockableEventLoop; 14 | 15 | @Mixin(value = Minecraft.class) 16 | public abstract class MixinMinecraftClient extends ReentrantBlockableEventLoop 17 | { 18 | public MixinMinecraftClient(String string_1) 19 | { 20 | super(string_1); 21 | } 22 | 23 | @Inject(method = "startUseItem()V", at = @At(value = "INVOKE", 24 | target = "Lnet/minecraft/world/item/ItemStack;getCount()I", ordinal = 0), cancellable = true) 25 | private void handlePlacementRestriction(CallbackInfo ci) 26 | { 27 | if (Configs.Generic.PLACEMENT_RESTRICTION.getBooleanValue()) 28 | { 29 | if (Configs.Generic.EASY_PLACE_POST_REWRITE.getBooleanValue() 30 | && EasyPlaceUtils.handlePlacementRestriction()) 31 | { 32 | ci.cancel(); 33 | } 34 | else if (WorldUtils.handlePlacementRestriction((Minecraft)(Object) this)) 35 | { 36 | ci.cancel(); 37 | } 38 | } 39 | } 40 | 41 | @Inject(method = "tick()V", at = @At("HEAD")) 42 | private void onRunTickStart(CallbackInfo ci) 43 | { 44 | DataManager.onClientTickStart(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/orange_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/orange_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/orange_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/orange_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/orange_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/orange_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/orange_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/orange_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/orange_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/orange_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/purple_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/purple_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/purple_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/purple_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/purple_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/purple_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/purple_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/purple_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/purple_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/purple_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/yellow_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/yellow_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/yellow_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/yellow_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/yellow_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/yellow_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/yellow_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/yellow_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/yellow_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/yellow_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/lt_blue_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/lt_blue_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/lt_blue_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/lt_blue_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/lt_blue_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/lt_blue_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/lt_blue_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/lt_blue_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/lt_blue_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/lt_blue_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/lt_gray_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/lt_gray_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/lt_gray_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/lt_gray_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/lt_gray_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/lt_gray_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/lt_gray_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/lt_gray_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/lt_gray_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/lt_gray_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/resources/assets/litematica/blockstates/magenta_glass_pane_fallback.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { 4 | "apply": { 5 | "model": "litematica:block/magenta_glass_pane_fallback_post" 6 | } 7 | }, 8 | { 9 | "apply": { 10 | "model": "litematica:block/magenta_glass_pane_fallback_side" 11 | }, 12 | "when": { 13 | "north": "true" 14 | } 15 | }, 16 | { 17 | "apply": { 18 | "model": "litematica:block/magenta_glass_pane_fallback_side", 19 | "y": 90 20 | }, 21 | "when": { 22 | "east": "true" 23 | } 24 | }, 25 | { 26 | "apply": { 27 | "model": "litematica:block/magenta_glass_pane_fallback_side_alt" 28 | }, 29 | "when": { 30 | "south": "true" 31 | } 32 | }, 33 | { 34 | "apply": { 35 | "model": "litematica:block/magenta_glass_pane_fallback_side_alt", 36 | "y": 90 37 | }, 38 | "when": { 39 | "west": "true" 40 | } 41 | }, 42 | { 43 | "apply": { 44 | "model": "litematica:block/magenta_glass_pane_fallback_noside" 45 | }, 46 | "when": { 47 | "north": "false" 48 | } 49 | }, 50 | { 51 | "apply": { 52 | "model": "litematica:block/magenta_glass_pane_fallback_noside_alt" 53 | }, 54 | "when": { 55 | "east": "false" 56 | } 57 | }, 58 | { 59 | "apply": { 60 | "model": "litematica:block/magenta_glass_pane_fallback_noside_alt", 61 | "y": 90 62 | }, 63 | "when": { 64 | "south": "false" 65 | } 66 | }, 67 | { 68 | "apply": { 69 | "model": "litematica:block/magenta_glass_pane_fallback_noside", 70 | "y": 270 71 | }, 72 | "when": { 73 | "west": "false" 74 | } 75 | } 76 | ] 77 | } -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/selection/BoxSliced.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.selection; 2 | 3 | import net.minecraft.core.Direction; 4 | 5 | public class BoxSliced extends Box 6 | { 7 | private Direction sliceDirection = Direction.EAST; 8 | private int sliceStart = 0; 9 | private int sliceEnd = 1; 10 | private int sliceCount; 11 | 12 | public Direction getSliceDirection() 13 | { 14 | return sliceDirection; 15 | } 16 | 17 | /** 18 | * Returns the inclusive relative start offset from pos1 19 | * @return () 20 | */ 21 | public int getSliceStart() 22 | { 23 | return sliceStart; 24 | } 25 | 26 | /** 27 | * Returns the exclusive relative end offset from pos1 28 | * @return () 29 | */ 30 | public int getSliceEnd() 31 | { 32 | return sliceEnd; 33 | } 34 | 35 | public int getSliceCount() 36 | { 37 | return sliceCount; 38 | } 39 | 40 | public int getMaxSliceLength() 41 | { 42 | return switch (this.sliceDirection.getAxis()) 43 | { 44 | case X -> this.getSize().getX(); 45 | case Y -> this.getSize().getY(); 46 | case Z -> this.getSize().getZ(); 47 | default -> 1; 48 | }; 49 | } 50 | 51 | public void setSliceDirection(Direction sliceDirection) 52 | { 53 | this.sliceDirection = sliceDirection; 54 | } 55 | 56 | public void setSliceStart(int sliceStart) 57 | { 58 | this.sliceStart = Math.min(sliceStart, this.getMaxSliceLength() - 1); 59 | } 60 | 61 | public void setSliceEnd(int sliceEnd) 62 | { 63 | this.sliceEnd = Math.min(sliceEnd, this.getMaxSliceLength()); 64 | } 65 | 66 | public void setSliceCount(int sliceCount) 67 | { 68 | this.sliceCount = sliceCount; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/gui/GuiSchematicBrowserBase.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.gui; 2 | 3 | import java.nio.file.Path; 4 | import javax.annotation.Nullable; 5 | 6 | import fi.dy.masa.malilib.gui.GuiListBase; 7 | import fi.dy.masa.malilib.gui.interfaces.ISelectionListener; 8 | import fi.dy.masa.malilib.gui.widgets.WidgetDirectoryEntry; 9 | import fi.dy.masa.malilib.gui.widgets.WidgetFileBrowserBase.DirectoryEntry; 10 | import fi.dy.masa.litematica.gui.widgets.WidgetSchematicBrowser; 11 | 12 | public abstract class GuiSchematicBrowserBase extends GuiListBase 13 | { 14 | public GuiSchematicBrowserBase(int browserX, int browserY) 15 | { 16 | super(browserX, browserY); 17 | } 18 | 19 | @Override 20 | protected WidgetSchematicBrowser createListWidget(int listX, int listY) 21 | { 22 | // The width and height will be set to the actual values in initGui() 23 | return new WidgetSchematicBrowser(listX, listY, 100, 100, this, this.getSelectionListener()); 24 | } 25 | 26 | /** 27 | * This is the string the DataManager uses for saving/loading/storing the last used directory 28 | * for each browser GUI type/context. 29 | * @return () 30 | */ 31 | public abstract String getBrowserContext(); 32 | 33 | public abstract Path getDefaultDirectory(); 34 | 35 | @Override 36 | @Nullable 37 | protected ISelectionListener getSelectionListener() 38 | { 39 | return null; 40 | } 41 | 42 | @Override 43 | protected int getBrowserWidth() 44 | { 45 | return this.getScreenWidth() - 20; 46 | } 47 | 48 | @Override 49 | protected int getBrowserHeight() 50 | { 51 | return this.getScreenHeight() - 70; 52 | } 53 | 54 | public int getMaxInfoHeight() 55 | { 56 | return this.getBrowserHeight(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/materials/MaterialListPlacement.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.materials; 2 | 3 | import fi.dy.masa.litematica.config.Configs; 4 | import fi.dy.masa.litematica.scheduler.TaskScheduler; 5 | import fi.dy.masa.litematica.scheduler.tasks.TaskCountBlocksPlacement; 6 | import fi.dy.masa.litematica.schematic.placement.SchematicPlacement; 7 | import fi.dy.masa.malilib.gui.Message.MessageType; 8 | import fi.dy.masa.malilib.util.InfoUtils; 9 | import fi.dy.masa.malilib.util.StringUtils; 10 | 11 | public class MaterialListPlacement extends MaterialListBase 12 | { 13 | private final SchematicPlacement placement; 14 | 15 | public MaterialListPlacement(SchematicPlacement placement) 16 | { 17 | this(placement, false); 18 | } 19 | 20 | public MaterialListPlacement(SchematicPlacement placement, boolean reCreate) 21 | { 22 | super(); 23 | 24 | this.placement = placement; 25 | 26 | if (reCreate) 27 | { 28 | this.reCreateMaterialList(); 29 | } 30 | } 31 | 32 | @Override 33 | public boolean supportsRenderLayers() 34 | { 35 | return true; 36 | } 37 | 38 | @Override 39 | public String getName() 40 | { 41 | return this.placement.getName(); 42 | } 43 | 44 | @Override 45 | public String getTitle() 46 | { 47 | return StringUtils.translate("litematica.gui.title.material_list.placement", this.getName()); 48 | } 49 | 50 | @Override 51 | public void reCreateMaterialList() 52 | { 53 | boolean ignoreState = Configs.Generic.MATERIAL_LIST_IGNORE_STATE.getBooleanValue(); 54 | TaskCountBlocksPlacement task = new TaskCountBlocksPlacement(this.placement, this, ignoreState); 55 | TaskScheduler.getInstanceClient().scheduleTask(task, 20); 56 | InfoUtils.showGuiOrInGameMessage(MessageType.INFO, "litematica.message.scheduled_task_added"); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/util/IgnoreBlockRegistry.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Optional; 6 | import net.minecraft.tags.TagKey; 7 | import net.minecraft.world.level.block.Block; 8 | import fi.dy.masa.litematica.config.Configs; 9 | 10 | public class IgnoreBlockRegistry 11 | { 12 | private final List blocks; 13 | private final List> blockTags; 14 | 15 | public boolean hasBlock(Block block) 16 | { 17 | if (this.blocks.contains(block)) 18 | { 19 | return true; 20 | } 21 | else 22 | { 23 | for (TagKey tag : this.blockTags) 24 | { 25 | if (block.defaultBlockState().is(tag)) 26 | { 27 | return true; 28 | } 29 | } 30 | } 31 | return false; 32 | } 33 | 34 | public boolean isEmpty() 35 | { 36 | return this.blocks.isEmpty() && this.blockTags.isEmpty(); 37 | } 38 | 39 | public IgnoreBlockRegistry() 40 | { 41 | this.blocks = new ArrayList<>(); 42 | this.blockTags = new ArrayList<>(); 43 | 44 | if (Configs.Visuals.IGNORE_EXISTING_BLOCKS.getBooleanValue()) 45 | { 46 | for (String value : Configs.Visuals.IGNORABLE_EXISTING_BLOCKS.getStrings()) 47 | { 48 | String trimmed = value.trim(); 49 | if (trimmed.startsWith("#")) 50 | { 51 | Optional> tag = BlockUtils.getBlockTagFromString(trimmed); 52 | tag.ifPresent(this.blockTags::add); 53 | } 54 | else 55 | { 56 | Optional block = BlockUtils.getBlockFromString(trimmed); 57 | block.ifPresent(this.blocks::add); 58 | } 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/interfaces/ISchematicPlacementEventManager.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.interfaces; 2 | 3 | import java.util.List; 4 | import javax.annotation.Nonnull; 5 | import net.minecraft.core.BlockPos; 6 | import net.minecraft.world.level.block.Mirror; 7 | import net.minecraft.world.level.block.Rotation; 8 | import fi.dy.masa.litematica.schematic.placement.SchematicPlacement; 9 | import fi.dy.masa.litematica.schematic.placement.SchematicPlacementEventFlag; 10 | import fi.dy.masa.litematica.schematic.placement.SubRegionPlacement; 11 | 12 | public interface ISchematicPlacementEventManager 13 | { 14 | void registerSchematicPlacementEventListener(@Nonnull ISchematicPlacementEventListener listener, @Nonnull List flags); 15 | 16 | void invokePrePlacementChange(@Nonnull ISchematicPlacementEventListener listener, @Nonnull SchematicPlacement placement); 17 | 18 | void invokePostPlacementChange(@Nonnull ISchematicPlacementEventListener listener, @Nonnull SchematicPlacement placement); 19 | 20 | void invokePlacementModified(@Nonnull ISchematicPlacementEventListener listener, @Nonnull SchematicPlacement placement); 21 | 22 | void invokeSetSubRegionEnabled(@Nonnull ISchematicPlacementEventListener listener, @Nonnull SubRegionPlacement subRegion, boolean toggle); 23 | 24 | void invokeSetSubRegionOrigin(@Nonnull ISchematicPlacementEventListener listener, @Nonnull SubRegionPlacement subRegion, BlockPos pos); 25 | 26 | void invokeSetSubRegionMirror(@Nonnull ISchematicPlacementEventListener listener, @Nonnull SubRegionPlacement subRegion, Mirror mirror); 27 | 28 | void invokeSetSubRegionRotation(@Nonnull ISchematicPlacementEventListener listener, @Nonnull SubRegionPlacement subRegion, Rotation rot); 29 | 30 | void invokeSubRegionModified(@Nonnull ISchematicPlacementEventListener listener, @Nonnull SchematicPlacement placement, @Nonnull String subRegionName); 31 | 32 | void invokeResetSubRegion(@Nonnull ISchematicPlacementEventListener listener, @Nonnull SubRegionPlacement subRegion); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/mixins.litematica.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "fi.dy.masa.litematica.mixin", 4 | "compatibilityLevel": "JAVA_21", 5 | "minVersion": "0.8", 6 | "mixins": [ 7 | "IMixinProfilerSystem", 8 | "block.IMixinAbstractBlock", 9 | "block.IMixinFenceGateBlock", 10 | "block.IMixinRedstoneWireBlock", 11 | "block.IMixinStairsBlock", 12 | "block.IMixinVineBlock", 13 | "block.IMixinWallMountedBlock", 14 | "block.MixinBlock", 15 | "block.MixinBlockStateFlattening", 16 | "block.MixinChestBlock", 17 | "block.MixinRailBlocks", 18 | "block.MixinStairsBlock", 19 | "easyplace.MixinBlockItem_easyPlace", 20 | "easyplace.MixinServerPlayNetworkHandler_easyPlace", 21 | "entity.IMixinEntity", 22 | "entity.IMixinSignBlockEntity", 23 | "entity.MixinEntity", 24 | "network.IMixinChunkDeltaUpdateS2CPacket", 25 | "server.MixinMinecraftServer", 26 | "world.IMixinWorld", 27 | "world.IMixinWorldTickScheduler", 28 | "world.MixinWorld", 29 | "world.MixinWorldChunk" 30 | ], 31 | "client": [ 32 | "MixinMinecraftClient", 33 | "block.MixinBlockStateManagers", 34 | "easyplace.MixinClientPlayerInteractionManager_easyPlace", 35 | "easyplace.MixinMinecraftClient_easyPlace", 36 | "entity.MixinAbstractSignEditScreen", 37 | "hud.MixinDebugHud", 38 | "hud.MixinDebugHudProfile", 39 | "network.MixinClientCommonNetworkHandler", 40 | "network.MixinClientPlayNetworkHandler", 41 | "render.IMixinBlockRenderManager", 42 | "render.IMixinGameRenderer", 43 | "render.MixinBlockRenderManager", 44 | "render.MixinBufferBuilder", 45 | "render.MixinEntityRenderManager", 46 | "render.MixinGameRenderer", 47 | "render.MixinWorldRenderer", 48 | "screen.IMixinHandledScreen", 49 | "screen.MixinHandledScreen", 50 | "world.MixinClientWorld" 51 | ], 52 | "server": [], 53 | "injectors": { 54 | "defaultRequire": 1 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/world/MixinClientWorld.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.world; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 7 | 8 | import fi.dy.masa.litematica.config.Configs; 9 | import fi.dy.masa.litematica.schematic.verifier.SchematicVerifier; 10 | import fi.dy.masa.litematica.util.SchematicWorldRefresher; 11 | import net.minecraft.client.multiplayer.ClientLevel; 12 | import net.minecraft.core.BlockPos; 13 | import net.minecraft.core.Holder; 14 | import net.minecraft.core.RegistryAccess; 15 | import net.minecraft.resources.ResourceKey; 16 | import net.minecraft.world.level.Level; 17 | import net.minecraft.world.level.block.state.BlockState; 18 | import net.minecraft.world.level.dimension.DimensionType; 19 | import net.minecraft.world.level.storage.WritableLevelData; 20 | 21 | @Mixin(ClientLevel.class) 22 | public abstract class MixinClientWorld extends Level 23 | { 24 | private MixinClientWorld(WritableLevelData properties, 25 | ResourceKey registryRef, 26 | RegistryAccess manager, 27 | Holder dimension, 28 | boolean isClient, boolean debugWorld, long seed, int maxChainedNeighborUpdates) 29 | { 30 | super(properties, registryRef, manager, dimension, isClient, debugWorld, seed, maxChainedNeighborUpdates); 31 | } 32 | 33 | @Inject(method = "setServerVerifiedBlockState", at = @At("HEAD")) 34 | private void litematica_onHandleBlockUpdate(BlockPos pos, BlockState state, int flags, CallbackInfo ci) 35 | { 36 | SchematicVerifier.markVerifierBlockChanges(pos); 37 | 38 | if (Configs.Visuals.ENABLE_RENDERING.getBooleanValue() && 39 | Configs.Visuals.ENABLE_SCHEMATIC_RENDERING.getBooleanValue()) 40 | { 41 | SchematicWorldRefresher.INSTANCE.markSchematicChunkForRenderUpdate(pos); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/easyplace/MixinBlockItem_easyPlace.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.easyplace; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Shadow; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 8 | import fi.dy.masa.litematica.config.Configs; 9 | import fi.dy.masa.litematica.util.PlacementHandler; 10 | import fi.dy.masa.litematica.util.PlacementHandler.UseContext; 11 | import net.minecraft.world.item.BlockItem; 12 | import net.minecraft.world.item.Item; 13 | import net.minecraft.world.item.context.BlockPlaceContext; 14 | import net.minecraft.world.level.block.Block; 15 | import net.minecraft.world.level.block.state.BlockState; 16 | 17 | @Mixin(value = BlockItem.class, priority = 980) 18 | public abstract class MixinBlockItem_easyPlace extends Item 19 | { 20 | private MixinBlockItem_easyPlace(Item.Properties builder) 21 | { 22 | super(builder); 23 | } 24 | 25 | @Shadow protected abstract BlockState getPlacementState(BlockPlaceContext context); 26 | @Shadow protected abstract boolean canPlace(BlockPlaceContext context, BlockState state); 27 | @Shadow public abstract Block getBlock(); 28 | 29 | @Inject(method = "getPlacementState", at = @At("HEAD"), cancellable = true) 30 | private void litematica_modifyPlacementState(BlockPlaceContext ctx, CallbackInfoReturnable cir) 31 | { 32 | if (Configs.Generic.EASY_PLACE_MODE.getBooleanValue() && 33 | Configs.Generic.EASY_PLACE_SP_HANDLING.getBooleanValue()) 34 | { 35 | BlockState stateOrig = this.getBlock().getStateForPlacement(ctx); 36 | 37 | if (stateOrig != null) 38 | { 39 | if (!Configs.Generic.EASY_PLACE_SP_VALIDATION.getBooleanValue() || this.canPlace(ctx, stateOrig)) 40 | { 41 | UseContext context = UseContext.from(ctx, ctx.getHand()); 42 | cir.setReturnValue(PlacementHandler.applyPlacementProtocolToPlacementState(stateOrig, context)); 43 | } 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/render/schematic/OverlayRenderType.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.render.schematic; 2 | 3 | import com.mojang.blaze3d.pipeline.RenderPipeline; 4 | import com.mojang.blaze3d.vertex.VertexFormat; 5 | 6 | import fi.dy.masa.malilib.render.MaLiLibPipelines; 7 | 8 | public enum OverlayRenderType 9 | { 10 | OUTLINE (MaLiLibPipelines.DEBUG_LINES_MASA_SIMPLE_OFFSET_2, 11 | MaLiLibPipelines.DEBUG_LINES_MASA_SIMPLE_NO_DEPTH_NO_CULL, false 12 | ), 13 | QUAD (MaLiLibPipelines.POSITION_COLOR_TRANSLUCENT_LEQUAL_DEPTH_OFFSET_2, 14 | MaLiLibPipelines.POSITION_COLOR_TRANSLUCENT_NO_DEPTH_NO_CULL, true 15 | ), 16 | ; 17 | 18 | private final RenderPipeline pipeline; 19 | private final RenderPipeline renderThrough; 20 | private final boolean translucent; 21 | 22 | OverlayRenderType(RenderPipeline pipeline, RenderPipeline renderThrough, boolean translucent) 23 | { 24 | this.translucent = translucent; 25 | this.pipeline = pipeline; 26 | this.renderThrough = renderThrough; 27 | this.ensurePipelines(); 28 | } 29 | 30 | public VertexFormat.Mode getDrawMode() 31 | { 32 | return this.pipeline.getVertexFormatMode(); 33 | } 34 | 35 | public int getExpectedBufferSize() { return this.pipeline.getVertexFormat().getVertexSize() * 4; } 36 | 37 | public VertexFormat getVertexFormat() { return this.pipeline.getVertexFormat(); } 38 | 39 | public boolean isTranslucent() { return this.translucent; } 40 | 41 | public RenderPipeline getPipeline() { return this.pipeline; } 42 | 43 | public RenderPipeline getRenderThrough() { return this.renderThrough; } 44 | 45 | private void ensurePipelines() throws RuntimeException 46 | { 47 | if (this.renderThrough.getVertexFormatMode() != this.pipeline.getVertexFormatMode()) 48 | { 49 | throw new RuntimeException("DrawMode does not match between Pipelines!"); 50 | } 51 | 52 | if (this.renderThrough.getVertexFormat() != this.pipeline.getVertexFormat()) 53 | { 54 | throw new RuntimeException("VertexFormat does not match between Pipelines!"); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/gui/ButtonIcons.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.gui; 2 | 3 | import fi.dy.masa.litematica.Reference; 4 | import fi.dy.masa.malilib.gui.interfaces.IGuiIcon; 5 | import fi.dy.masa.malilib.render.GuiContext; 6 | import fi.dy.masa.malilib.render.RenderUtils; 7 | import net.minecraft.resources.Identifier; 8 | 9 | public enum ButtonIcons implements IGuiIcon 10 | { 11 | AREA_EDITOR (102, 70, 14, 14), 12 | AREA_SELECTION (102, 0, 14, 14), 13 | CONFIGURATION (102, 84, 14, 14), 14 | LOADED_SCHEMATICS (102, 14, 14, 14), 15 | SCHEMATIC_BROWSER (102, 28, 14, 14), 16 | SCHEMATIC_MANAGER (102, 56, 14, 14), 17 | SCHEMATIC_PLACEMENTS (102, 42, 14, 14), 18 | SCHEMATIC_PROJECTS (102, 98, 14, 14), 19 | TASK_MANAGER (102, 112, 14, 14),; 20 | 21 | public static final Identifier TEXTURE = Identifier.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/gui_widgets.png"); 22 | 23 | private final int u; 24 | private final int v; 25 | private final int w; 26 | private final int h; 27 | 28 | ButtonIcons(int u, int v, int w, int h) 29 | { 30 | this.u = u; 31 | this.v = v; 32 | this.w = w; 33 | this.h = h; 34 | } 35 | 36 | @Override 37 | public int getWidth() 38 | { 39 | return this.w; 40 | } 41 | 42 | @Override 43 | public int getHeight() 44 | { 45 | return this.h; 46 | } 47 | 48 | @Override 49 | public int getU() 50 | { 51 | return this.u; 52 | } 53 | 54 | @Override 55 | public int getV() 56 | { 57 | return this.v; 58 | } 59 | 60 | @Override 61 | public void renderAt(GuiContext ctx, int x, int y, float zLevel, boolean enabled, boolean selected) 62 | { 63 | int u = this.u; 64 | 65 | if (enabled) 66 | { 67 | u += this.w; 68 | } 69 | 70 | if (selected) 71 | { 72 | u += this.w; 73 | } 74 | 75 | RenderUtils.drawTexturedRect(ctx, this.getTexture(), x, y, u, this.v, this.w, this.h, zLevel); 76 | } 77 | 78 | @Override 79 | public Identifier getTexture() 80 | { 81 | return TEXTURE; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/util/DebugHudMode.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.util; 2 | 3 | import javax.annotation.Nonnull; 4 | import net.minecraft.util.StringRepresentable; 5 | import com.google.common.collect.ImmutableList; 6 | import fi.dy.masa.malilib.config.IConfigOptionListEntry; 7 | import fi.dy.masa.malilib.util.StringUtils; 8 | 9 | public enum DebugHudMode implements IConfigOptionListEntry, StringRepresentable 10 | { 11 | DEFAULT ("default", "litematica.gui.label.debug_info_mode.default"), 12 | VANILLA ("vanilla", "litematica.gui.label.debug_info_mode.vanilla"), 13 | NONE ("none", "litematica.gui.label.debug_info_mode.none"), 14 | ; 15 | 16 | public static final EnumCodec CODEC = StringRepresentable.fromEnum(DebugHudMode::values); 17 | public static final ImmutableList VALUES = ImmutableList.copyOf(values()); 18 | private final String configString; 19 | private final String translationKey; 20 | 21 | DebugHudMode(String configString, String translationKey) 22 | { 23 | this.configString = configString; 24 | this.translationKey = translationKey; 25 | } 26 | 27 | @Override 28 | public @Nonnull String getSerializedName() 29 | { 30 | return this.configString; 31 | } 32 | 33 | @Override 34 | public String getStringValue() 35 | { 36 | return this.configString; 37 | } 38 | 39 | @Override 40 | public String getDisplayName() 41 | { 42 | return StringUtils.translate(this.translationKey); 43 | } 44 | 45 | @Override 46 | public DebugHudMode cycle(boolean forward) 47 | { 48 | int id = this.ordinal(); 49 | 50 | if (forward) 51 | { 52 | if (++id >= values().length) 53 | { 54 | id = 0; 55 | } 56 | } 57 | else 58 | { 59 | if (--id < 0) 60 | { 61 | id = values().length - 1; 62 | } 63 | } 64 | 65 | return values()[id % values().length]; 66 | } 67 | 68 | @Override 69 | public DebugHudMode fromString(String name) 70 | { 71 | return fromStringStatic(name); 72 | } 73 | 74 | public static DebugHudMode fromStringStatic(String name) 75 | { 76 | for (DebugHudMode val : DebugHudMode.values()) 77 | { 78 | if (val.configString.equalsIgnoreCase(name)) 79 | { 80 | return val; 81 | } 82 | } 83 | 84 | return DebugHudMode.DEFAULT; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/block/MixinRailBlocks.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.block; 2 | 3 | import net.minecraft.world.level.block.*; 4 | import net.minecraft.world.level.block.state.BlockBehaviour; 5 | import net.minecraft.world.level.block.state.BlockState; 6 | import net.minecraft.world.level.block.state.properties.RailShape; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | import fi.dy.masa.litematica.config.Configs; 13 | 14 | @Mixin({ RailBlock.class, DetectorRailBlock.class, PoweredRailBlock.class}) 15 | public abstract class MixinRailBlocks extends BaseRailBlock 16 | { 17 | protected MixinRailBlocks(boolean disableCorners, BlockBehaviour.Properties builder) 18 | { 19 | super(disableCorners, builder); 20 | } 21 | 22 | @Inject(method = "rotate(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/Rotation;)Lnet/minecraft/world/level/block/state/BlockState;", at = @At("HEAD"), cancellable = true) 23 | private void litematica_fixRailRotation(BlockState state, Rotation rot, CallbackInfoReturnable cir) 24 | { 25 | if (Configs.Generic.FIX_RAIL_ROTATION.getBooleanValue() && rot == Rotation.CLOCKWISE_180) 26 | { 27 | RailShape shape = null; 28 | 29 | if (((Object) this) instanceof RailBlock) 30 | { 31 | shape = state.getValue(RailBlock.SHAPE); 32 | } 33 | else if (((Object) this) instanceof DetectorRailBlock) 34 | { 35 | shape = state.getValue(DetectorRailBlock.SHAPE); 36 | } 37 | else if (((Object) this) instanceof PoweredRailBlock) 38 | { 39 | shape = state.getValue(PoweredRailBlock.SHAPE); 40 | } 41 | 42 | // Fix the incomplete switch statement causing the ccw_90 rotation being used instead 43 | // for the 180 degree rotation of the straight rails. 44 | if (shape == RailShape.EAST_WEST || shape == RailShape.NORTH_SOUTH) 45 | { 46 | cir.setReturnValue(state); 47 | cir.cancel(); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/gui/widgets/WidgetListLoadedSchematics.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.gui.widgets; 2 | 3 | import java.util.Collection; 4 | import java.util.List; 5 | import javax.annotation.Nullable; 6 | import com.google.common.collect.ImmutableList; 7 | import fi.dy.masa.litematica.data.SchematicHolder; 8 | import fi.dy.masa.litematica.gui.Icons; 9 | import fi.dy.masa.litematica.schematic.LitematicaSchematic; 10 | import fi.dy.masa.malilib.gui.LeftRight; 11 | import fi.dy.masa.malilib.gui.interfaces.ISelectionListener; 12 | import fi.dy.masa.malilib.gui.widgets.WidgetListBase; 13 | import fi.dy.masa.malilib.gui.widgets.WidgetSearchBar; 14 | import fi.dy.masa.malilib.util.FileUtils; 15 | 16 | public class WidgetListLoadedSchematics extends WidgetListBase 17 | { 18 | public WidgetListLoadedSchematics(int x, int y, int width, int height, 19 | @Nullable ISelectionListener selectionListener) 20 | { 21 | super(x, y, width, height, selectionListener); 22 | 23 | this.browserEntryHeight = 22; 24 | this.widgetSearchBar = new WidgetSearchBar(x + 2, y + 4, width - 14, 14, 0, Icons.FILE_ICON_SEARCH, LeftRight.LEFT); 25 | this.browserEntriesOffsetY = this.widgetSearchBar.getHeight() + 3; 26 | } 27 | 28 | @Override 29 | protected Collection getAllEntries() 30 | { 31 | return SchematicHolder.getInstance().getAllSchematics(); 32 | } 33 | 34 | @Override 35 | protected List getEntryStringsForFilter(LitematicaSchematic entry) 36 | { 37 | String metaName = entry.getMetadata().getName().toLowerCase(); 38 | 39 | if (entry.getFile() != null) 40 | { 41 | String fileName = FileUtils.getNameWithoutExtension(entry.getFile().getFileName().toString().toLowerCase()); 42 | return ImmutableList.of(metaName, fileName); 43 | } 44 | else 45 | { 46 | return ImmutableList.of(metaName); 47 | } 48 | } 49 | 50 | @Override 51 | protected WidgetSchematicEntry createListEntryWidget(int x, int y, int listIndex, boolean isOdd, LitematicaSchematic entry) 52 | { 53 | return new WidgetSchematicEntry(x, y, this.browserEntryWidth, this.getBrowserEntryHeightFor(entry), 54 | isOdd, entry, listIndex, this); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/gui/widgets/WidgetListSelectionSubRegions.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.gui.widgets; 2 | 3 | import java.util.Collection; 4 | import java.util.Comparator; 5 | import java.util.List; 6 | import com.google.common.collect.ImmutableList; 7 | import fi.dy.masa.litematica.gui.GuiAreaSelectionEditorNormal; 8 | import fi.dy.masa.litematica.gui.Icons; 9 | import fi.dy.masa.litematica.selection.AreaSelection; 10 | import fi.dy.masa.malilib.gui.LeftRight; 11 | import fi.dy.masa.malilib.gui.widgets.WidgetListBase; 12 | import fi.dy.masa.malilib.gui.widgets.WidgetSearchBar; 13 | import fi.dy.masa.malilib.util.AlphaNumComparator.AlphaNumStringComparator; 14 | 15 | public class WidgetListSelectionSubRegions extends WidgetListBase 16 | { 17 | private final GuiAreaSelectionEditorNormal gui; 18 | private final AreaSelection selection; 19 | 20 | public WidgetListSelectionSubRegions(int x, int y, int width, int height, 21 | AreaSelection selection, GuiAreaSelectionEditorNormal gui) 22 | { 23 | super(x, y, width, height, gui); 24 | 25 | this.gui = gui; 26 | this.selection = selection; 27 | this.browserEntryHeight = 22; 28 | this.widgetSearchBar = new WidgetSearchBar(x + 2, y + 4, width - 14, 14, 0, Icons.FILE_ICON_SEARCH, LeftRight.LEFT); 29 | this.browserEntriesOffsetY = this.widgetSearchBar.getHeight() + 3; 30 | this.shouldSortList = true; 31 | } 32 | 33 | public GuiAreaSelectionEditorNormal getEditorGui() 34 | { 35 | return this.gui; 36 | } 37 | 38 | @Override 39 | protected Collection getAllEntries() 40 | { 41 | return this.selection.getAllSubRegionNames(); 42 | } 43 | 44 | @Override 45 | protected Comparator getComparator() 46 | { 47 | return new AlphaNumStringComparator(); 48 | } 49 | 50 | @Override 51 | protected List getEntryStringsForFilter(String entry) 52 | { 53 | return ImmutableList.of(entry.toLowerCase()); 54 | } 55 | 56 | @Override 57 | protected WidgetSelectionSubRegion createListEntryWidget(int x, int y, int listIndex, boolean isOdd, String entry) 58 | { 59 | return new WidgetSelectionSubRegion(x, y, this.browserEntryWidth, this.browserEntryHeight, 60 | isOdd, entry, listIndex, this.selection, this); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/gui/GuiAreaSelectionEditorSubRegion.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.gui; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | import fi.dy.masa.malilib.gui.GuiTextFieldGeneric; 6 | import fi.dy.masa.malilib.util.StringUtils; 7 | import fi.dy.masa.litematica.selection.AreaSelection; 8 | import fi.dy.masa.litematica.selection.Box; 9 | import fi.dy.masa.litematica.util.PositionUtils.Corner; 10 | 11 | public class GuiAreaSelectionEditorSubRegion extends GuiAreaSelectionEditorSimple 12 | { 13 | protected final Box box; 14 | 15 | public GuiAreaSelectionEditorSubRegion(AreaSelection selection, Box box) 16 | { 17 | super(selection); 18 | 19 | this.box = box; 20 | this.title = StringUtils.translate("litematica.gui.title.area_editor_sub_region"); 21 | } 22 | 23 | @Override 24 | protected void createSelectionEditFields() 25 | { 26 | // NO-OP 27 | } 28 | 29 | @Override 30 | protected int addSubRegionFields(int x, int y) 31 | { 32 | x = 12; 33 | y = 24; 34 | String label = StringUtils.translate("litematica.gui.label.area_editor.box_name"); 35 | this.addLabel(x, y, -1, 16, 0xFFFFFFFF, label); 36 | y += 13; 37 | 38 | int width = 202; 39 | this.textFieldBoxName = new GuiTextFieldGeneric(x, y + 2, width, 16, this.font); 40 | this.textFieldBoxName.setTextWrapper(this.getBox().getName()); 41 | this.addTextField(this.textFieldBoxName, new TextFieldListenerDummy()); 42 | this.createButton(x + width + 4, y, -1, ButtonListener.Type.SET_BOX_NAME); 43 | y += 20; 44 | 45 | x = 12; 46 | width = 68; 47 | 48 | this.createCoordinateInputs(x, y, width, Corner.CORNER_1); 49 | x += width + 42; 50 | this.createCoordinateInputs(x, y, width, Corner.CORNER_2); 51 | x += width + 42; 52 | 53 | return y; 54 | } 55 | 56 | @Override 57 | @Nullable 58 | protected Box getBox() 59 | { 60 | return this.box; 61 | } 62 | 63 | @Override 64 | protected void renameSubRegion() 65 | { 66 | String oldName = this.box.getName(); 67 | String newName = this.textFieldBoxName.getTextWrapper(); 68 | this.selection.renameSubRegionBox(oldName, newName); 69 | } 70 | 71 | @Override 72 | protected void createOrigin() 73 | { 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/mixin/hud/MixinDebugHud.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.mixin.hud; 2 | 3 | import java.util.Collection; 4 | import java.util.List; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.gui.components.DebugScreenOverlay; 7 | import net.minecraft.resources.Identifier; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.ModifyArg; 13 | import org.spongepowered.asm.mixin.injection.Redirect; 14 | 15 | import fi.dy.masa.litematica.render.LitematicaDebugHud; 16 | import fi.dy.masa.litematica.util.DebugHudMode; 17 | 18 | // Original method (Works) 19 | @Mixin(DebugScreenOverlay.class) 20 | public abstract class MixinDebugHud 21 | { 22 | @Shadow @Final private Minecraft minecraft; 23 | 24 | @Redirect(method = "render(Lnet/minecraft/client/gui/GuiGraphics;)V", 25 | at = @At(value = "INVOKE", 26 | target = "Ljava/util/Collection;isEmpty()Z", 27 | ordinal = 0)) 28 | private boolean litematica_fixF3WhenAllDisabled(Collection instance) 29 | { 30 | if (LitematicaDebugHud.INSTANCE.getMode() == DebugHudMode.DEFAULT) 31 | { 32 | return false; 33 | } 34 | 35 | return instance.isEmpty(); 36 | } 37 | 38 | @ModifyArg(method = "render(Lnet/minecraft/client/gui/GuiGraphics;)V", 39 | at = @At(value = "INVOKE", 40 | target = "Lnet/minecraft/client/gui/components/DebugScreenOverlay;renderLines(Lnet/minecraft/client/gui/GuiGraphics;Ljava/util/List;Z)V", 41 | ordinal = 0), 42 | index = 1) 43 | private List litematica_addDebugLines_Left(List text) 44 | // Left side 45 | { 46 | // Always display only when F3 is open, whenever Default mode is ON. 47 | if (this.minecraft.debugEntries.isOverlayVisible()) 48 | { 49 | if (LitematicaDebugHud.INSTANCE.getMode() == DebugHudMode.DEFAULT) 50 | { 51 | List list = LitematicaDebugHud.INSTANCE.getDebugLines(); 52 | 53 | if (!list.isEmpty()) 54 | { 55 | int size = text.size(); 56 | 57 | if (size > 3) 58 | { 59 | size -= 3; 60 | } 61 | else 62 | { 63 | size = 0; 64 | // Insert mode, but do not go beyond '0' 65 | } 66 | 67 | for (String entry : list) 68 | { 69 | text.add(size++, entry); 70 | } 71 | } 72 | } 73 | } 74 | 75 | return text; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/fi/dy/masa/litematica/gui/widgets/WidgetListSchematicPlacements.java: -------------------------------------------------------------------------------- 1 | package fi.dy.masa.litematica.gui.widgets; 2 | 3 | import java.util.Collection; 4 | import java.util.List; 5 | import com.google.common.collect.ImmutableList; 6 | import fi.dy.masa.litematica.data.DataManager; 7 | import fi.dy.masa.litematica.gui.GuiSchematicPlacementsList; 8 | import fi.dy.masa.litematica.gui.Icons; 9 | import fi.dy.masa.litematica.schematic.placement.SchematicPlacement; 10 | import fi.dy.masa.malilib.gui.LeftRight; 11 | import fi.dy.masa.malilib.gui.widgets.WidgetListBase; 12 | import fi.dy.masa.malilib.gui.widgets.WidgetSearchBar; 13 | import fi.dy.masa.malilib.util.FileUtils; 14 | 15 | public class WidgetListSchematicPlacements extends WidgetListBase 16 | { 17 | public final GuiSchematicPlacementsList parent; 18 | 19 | public WidgetListSchematicPlacements(int x, int y, int width, int height, GuiSchematicPlacementsList parent) 20 | { 21 | super(x, y, width, height, parent); 22 | 23 | this.parent = parent; 24 | this.browserEntryHeight = 22; 25 | this.widgetSearchBar = new WidgetSearchBar(x + 2, y + 4, width - 14, 14, 0, Icons.FILE_ICON_SEARCH, LeftRight.LEFT); 26 | this.browserEntriesOffsetY = this.widgetSearchBar.getHeight() + 3; 27 | } 28 | 29 | public GuiSchematicPlacementsList getParentGui() 30 | { 31 | return this.parent; 32 | } 33 | 34 | @Override 35 | protected Collection getAllEntries() 36 | { 37 | return DataManager.getSchematicPlacementManager().getAllSchematicsPlacements(); 38 | } 39 | 40 | @Override 41 | protected List getEntryStringsForFilter(SchematicPlacement entry) 42 | { 43 | if (entry.getSchematic().getFile() != null) 44 | { 45 | String fileName = FileUtils.getNameWithoutExtension(entry.getSchematic().getFile().getFileName().toString().toLowerCase()); 46 | return ImmutableList.of(entry.getName().toLowerCase(), fileName); 47 | } 48 | else 49 | { 50 | return ImmutableList.of(entry.getName().toLowerCase()); 51 | } 52 | } 53 | 54 | @Override 55 | protected WidgetSchematicPlacement createListEntryWidget(int x, int y, int listIndex, boolean isOdd, SchematicPlacement entry) 56 | { 57 | return new WidgetSchematicPlacement(x, y, this.browserEntryWidth, this.getBrowserEntryHeightFor(entry), 58 | isOdd, entry, listIndex, this); 59 | } 60 | } 61 | --------------------------------------------------------------------------------