Skip to content

Commit

Permalink
Version 1.1.3
Browse files Browse the repository at this point in the history
1.1.3:
    - Fixed display bug, thanks to discord user @KarolOfGutovo for reporting
    - Created ponder system with 1 ponder about printing (contraption ponder coming soon)
    - (Technical) Created datagen
  • Loading branch information
cakeGit committed Aug 2, 2024
1 parent 4e25f8b commit f2171a7
Show file tree
Hide file tree
Showing 35 changed files with 358 additions and 72 deletions.
4 changes: 4 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1.1.3:
- Fixed display bug, thanks to discord user @karolofgutovo for reporting
- Created ponder system with 1 ponder about printing (contraption ponder coming soon)
- (Technical) Created datagen
9 changes: 9 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ publishing {
// Add repositories to publish to here.
}
}


sourceSets.main {
resources { // include generated resources in resources
srcDir("src/generated/resources")
exclude(".cache/**")
exclude("assets/create/**")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// 1.20.1 2024-08-02T17:54:09.165329 Create: Pattern Schematics/Registrate Provider for create_pattern_schematics [Recipes, Advancements, Loot Tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)]
ef2d06ece9923cc75b5e3dc3070df2808f1cdb74 assets\create_pattern_schematics\models\item\pattern_schematic.json
6d3646ec7fe803669476e65e7d373706b2016bee assets\create_pattern_schematics\lang\en_us.json
79f1b8656342eb1076dad4c796a19efab36b5c8d assets\create_pattern_schematics\lang\en_ud.json
19e25b53bb643c63106b1f83e2f1fe5a6ac63f13 assets\create_pattern_schematics\models\item\empty_pattern_schematic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"create_pattern_schematics.ponder.schematic_printing.header": "sɔıʇɐɯǝɥɔs uɹǝʇʇɐd ɥʇıʍ suɹǝʇʇɐd buıʇuıɹԀ",
"create_pattern_schematics.ponder.schematic_printing.text_1": "ǝɔɹnos ɐ sɐ ǝsn oʇ ɔıʇɐɯǝɥɔs ɐ ǝʌɐs ʇsɹıɟ ʇsnɯ noʎ 'sɔıʇɐɯǝɥɔs uɹǝʇʇɐd ǝsn o⟘",
"create_pattern_schematics.ponder.schematic_printing.text_2": "ɔıʇɐɯǝɥɔs ǝɥʇ ʎןddɐ oʇ ǝןqɐʇ ɔıʇɐɯǝɥɔs ɐ ǝsn 'uǝɥ⟘",
"create_pattern_schematics.ponder.schematic_printing.text_3": "ɔıʇɐɯǝɥɔs ǝɥʇ pɐoןdn puɐ ǝןqɐʇ ǝɥʇ ǝs∩",
"create_pattern_schematics.ponder.schematic_printing.text_4": "pǝʇɐǝdǝɹ ǝq uɐɔ ǝɹnʇɔnɹʇs ǝɥʇ 'ʇuǝɯǝɔɐןd uı ןooʇ ǝuoןɔ ǝɥʇ buısn 'uǝɥ⟘",
"create_pattern_schematics.ponder.schematic_printing.text_5": "ʇɐǝdǝɹ oʇ ןooʇ ǝuoןɔ ǝɥʇ ǝsn 'uıbıɹo ǝɥʇ ɯoɹɟ buıʇɹɐʇS",
"create_pattern_schematics.ponder.schematic_printing.text_6": "pǝʇɐʇoɹ ǝq uɐɔ ɔıʇɐɯǝɥɔs ǝɥʇ 'ʎןןɐuoıʇıppⱯ",
"create_pattern_schematics.ponder.schematic_printing.text_7": "sǝuoןɔ ןןɐ oʇ ʎןddɐ uǝɥʇ ןןıʍ sıɥ⟘",
"create_pattern_schematics.ponder.tag.pattern_schematics": "sɔıʇɐɯǝɥɔS uɹǝʇʇɐԀ",
"create_pattern_schematics.ponder.tag.pattern_schematics.description": "sɔıʇɐɯǝɥɔs uɹǝʇʇɐd ɥʇıʍ buıʇuıɹԀ",
"create_pattern_schematics.schematic.tool.clone": "ǝuoןƆ",
"create_pattern_schematics.schematic.tool.clone.description.0": "ɔıʇɐɯǝɥɔs pǝʇɔǝןǝs ǝɥʇ sʇɐǝdǝᴚ",
"create_pattern_schematics.schematic.tool.clone.description.1": "˙ʇı ʇɐǝdǝɹ oʇ ןןoɹɔS-]Ꞁᴚ⟘Ɔ[ puɐ ɔıʇɐɯǝɥɔS ǝɥʇ ʇɐ ʇuıoԀ",
"create_pattern_schematics.schematic.tool.clone.description.2": "",
"create_pattern_schematics.schematic.tool.clone.description.3": "",
"item.create_pattern_schematics.empty_pattern_schematic": "ɔıʇɐɯǝɥɔS uɹǝʇʇɐԀ ʎʇdɯƎ",
"item.create_pattern_schematics.pattern_schematic": "ɔıʇɐɯǝɥɔS uɹǝʇʇɐԀ"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"create_pattern_schematics.ponder.schematic_printing.header": "Printing patterns with pattern schematics",
"create_pattern_schematics.ponder.schematic_printing.text_1": "To use pattern schematics, you must first save a schematic to use as a source",
"create_pattern_schematics.ponder.schematic_printing.text_2": "Then, use a schematic table to apply the schematic",
"create_pattern_schematics.ponder.schematic_printing.text_3": "Use the table and upload the schematic",
"create_pattern_schematics.ponder.schematic_printing.text_4": "Then, using the clone tool in placement, the structure can be repeated",
"create_pattern_schematics.ponder.schematic_printing.text_5": "Starting from the origin, use the clone tool to repeat",
"create_pattern_schematics.ponder.schematic_printing.text_6": "Additionally, the schematic can be rotated",
"create_pattern_schematics.ponder.schematic_printing.text_7": "This will then apply to all clones",
"create_pattern_schematics.ponder.tag.pattern_schematics": "Pattern Schematics",
"create_pattern_schematics.ponder.tag.pattern_schematics.description": "Printing with pattern schematics",
"create_pattern_schematics.schematic.tool.clone": "Clone",
"create_pattern_schematics.schematic.tool.clone.description.0": "Repeats the selected schematic",
"create_pattern_schematics.schematic.tool.clone.description.1": "Point at the Schematic and [CTRL]-Scroll to repeat it.",
"create_pattern_schematics.schematic.tool.clone.description.2": "",
"create_pattern_schematics.schematic.tool.clone.description.3": "",
"item.create_pattern_schematics.empty_pattern_schematic": "Empty Pattern Schematic",
"item.create_pattern_schematics.pattern_schematic": "Pattern Schematic"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.cak.pattern_schematics;

import com.cak.pattern_schematics.registry.PatternSchematicsItems;
import com.cak.pattern_schematics.registry.PatternSchematicsLang;
import com.cak.pattern_schematics.content.ponder.PatternSchematicsPonderIndex;
import com.cak.pattern_schematics.registry.PatternSchematicsRegistry;
import com.cak.pattern_schematics.content.ponder.PatternSchematicsPonderTags;
import com.cak.pattern_schematics.registry.PlatformPackets;
import com.mojang.logging.LogUtils;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -15,10 +16,11 @@ public class PatternSchematics {
private static final Logger LOGGER = LogUtils.getLogger();

public static void init() {
PatternSchematicsItems.register();
PatternSchematicsRegistry.register();
PlatformPackets.registerPackets();
PatternSchematicsLang.register();
PlatformPackets.getChannel().initServerListener();
PatternSchematicsPonderTags.register();
PatternSchematicsPonderIndex.register();
}

public static ResourceLocation asResource(String loc) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.cak.pattern_schematics.content;
package com.cak.pattern_schematics.content.item;

import com.cak.pattern_schematics.registry.PatternSchematicsItems;
import com.cak.pattern_schematics.registry.PatternSchematicsRegistry;
import com.simibubi.create.content.schematics.SchematicItem;
import net.minecraft.core.BlockPos;
import net.minecraft.core.HolderGetter;
Expand All @@ -18,7 +18,7 @@ public PatternSchematicItem(Properties properties) {
}

public static ItemStack create(HolderGetter<Block> lookup, String schematic, String owner) {
ItemStack blueprint = PatternSchematicsItems.PATTERN_SCHEMATIC.asStack();
ItemStack blueprint = PatternSchematicsRegistry.PATTERN_SCHEMATIC.asStack();

CompoundTag tag = new CompoundTag();
tag.putBoolean("Deployed", false);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
package com.cak.pattern_schematics.content.ponder;

import com.cak.pattern_schematics.registry.PatternSchematicsRegistry;
import com.simibubi.create.AllItems;
import com.simibubi.create.foundation.ponder.*;
import com.simibubi.create.foundation.ponder.element.EntityElement;
import com.simibubi.create.foundation.ponder.element.InputWindowElement;
import com.simibubi.create.foundation.utility.Pointing;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Vec3i;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;

public class PatternSchematicPonderScenes {

public static void schematicPrinting(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("schematic_printing", "Printing patterns with pattern schematics");
scene.scaleSceneView(0.75f);
scene.configureBasePlate(0, 0, 14);
scene.world.showSection(util.select.layer(0), Direction.UP);
scene.idle(20);

//Obtaining schematic for printing
BlockPos schematicSavingFrom = new BlockPos(5, 1, 4);
BlockPos schematicSavingTo = new BlockPos(7, 3, 5);

Selection schematicSavingSelection = util.select.fromTo(
schematicSavingFrom, schematicSavingTo);

scene.world.showSection(schematicSavingSelection, Direction.DOWN);

scene.overlay.showText(80)
.placeNearTarget()
.pointAt(new Vec3(6, 3, 5))
.text("To use pattern schematics, you must first save a schematic to use as a source");

scene.idle(50);

ItemStack schematicAndQuillStack = AllItems.SCHEMATIC_AND_QUILL.asStack();

scene.overlay.chaseBoundingBoxOutline(PonderPalette.BLUE, "schematic_saving",
new AABB(schematicSavingFrom, schematicSavingTo.offset(1, 1, 1)), 100);

scene.overlay.showControls(
new InputWindowElement(Vec3.atCenterOf(schematicSavingFrom), Pointing.DOWN)
.rightClick().withItem(schematicAndQuillStack), 50
);
scene.idle(30);
scene.overlay.showControls(
new InputWindowElement(Vec3.atCenterOf(schematicSavingTo), Pointing.DOWN)
.rightClick().withItem(schematicAndQuillStack), 30
);
scene.idle(50);

//Creating the pattern schematic item

scene.addKeyframe();

scene.world.showSection(util.select.position(2, 1, 2), Direction.DOWN);

scene.overlay.showText(70)
.placeNearTarget()
.pointAt(new Vec3(2.5, 1, 2.5))
.text("Then, use a schematic table with an empty pattern schematic");
scene.idle(40);

ItemStack emptyPatternSchematicItem = PatternSchematicsRegistry.EMPTY_PATTERN_SCHEMATIC.asStack();
ItemStack patternSchematicItem = PatternSchematicsRegistry.PATTERN_SCHEMATIC.asStack();
ElementLink<EntityElement> currentItem;
currentItem = scene.world.createItemEntity(
new Vec3(2.5, 4, 2.5),
new Vec3(0, 0, 0),
emptyPatternSchematicItem
);
scene.idle(40);

scene.overlay.showText(60)
.placeNearTarget()
.pointAt(new Vec3(2.5, 1, 2.5))
.text("Use the table to upload the schematic");

scene.idle(40);
scene.world.modifyEntity(currentItem, Entity::kill);
currentItem = scene.world.createItemEntity(
new Vec3(2.5, 2, 2.5),
new Vec3(0, 0.25, 0),
patternSchematicItem
);
scene.idle(50);

//Usage

scene.addKeyframe();

scene.overlay.showText(70)
.placeNearTarget()
.pointAt(new Vec3(2.5, 2, 2.5))
.text("Then, using the clone tool in placement, the structure can be repeated");
scene.idle(60);

Vec3i sectionOffset = new Vec3i(3, 0, 0);
BlockPos sectionMin = new BlockPos(1, 1, 11);
BlockPos sectionMax = new BlockPos(3, 3, 12);

scene.overlay.showText(60)
.placeNearTarget()
.pointAt(new Vec3(2.5, 2, 12))
.text("Starting from the origin, use the clone tool to repeat");

for (int i = 0; i < 4; i++) {
scene.world.showSection(util.select.fromTo(
sectionMin.offset(sectionOffset.multiply(i)),
sectionMax.offset(sectionOffset.multiply(i))
), Direction.DOWN);

scene.idle(2);
}
scene.idle(62);

//Usage 2

scene.addKeyframe();

scene.overlay.showText(80)
.placeNearTarget()
.pointAt(new Vec3(2.5, 2, 2.5))
.text("Additionally, the schematic can be rotated");
scene.idle(60);

Vec3i sectionOffset2 = new Vec3i(0, 0, 3);
BlockPos sectionMin2 = new BlockPos(11, 1, 1);
BlockPos sectionMax2 = new BlockPos(12, 3, 3);

scene.overlay.showText(80)
.placeNearTarget()
.pointAt(new Vec3(12, 2, 2.5))
.text("This rotation will then apply to all clones");

for (int i = 0; i < 3; i++) {
scene.world.showSection(util.select.fromTo(
sectionMin2.offset(sectionOffset2.multiply(i)),
sectionMax2.offset(sectionOffset2.multiply(i))
), Direction.DOWN);

scene.idle(2);
}
scene.idle(50);

scene.markAsFinished();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.cak.pattern_schematics.content.ponder;

import com.cak.pattern_schematics.PatternSchematics;
import com.cak.pattern_schematics.registry.PatternSchematicsRegistry;
import com.simibubi.create.foundation.ponder.PonderRegistrationHelper;

public class PatternSchematicsPonderIndex {

static final PonderRegistrationHelper HELPER = new PonderRegistrationHelper(PatternSchematics.MODID);

public static void register() {

HELPER.forComponents(PatternSchematicsRegistry.EMPTY_PATTERN_SCHEMATIC, PatternSchematicsRegistry.PATTERN_SCHEMATIC)
.addStoryBoard("pattern_schematic/schematic_printing", PatternSchematicPonderScenes::schematicPrinting, PatternSchematicsPonderTags.PATTERN_SCHEMATIC);

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.cak.pattern_schematics.content.ponder;

import com.cak.pattern_schematics.PatternSchematics;
import com.cak.pattern_schematics.registry.PatternSchematicsRegistry;
import com.simibubi.create.foundation.ponder.PonderRegistry;
import com.simibubi.create.foundation.ponder.PonderTag;

public class PatternSchematicsPonderTags {

public static final PonderTag
PATTERN_SCHEMATIC = create("pattern_schematics").item(PatternSchematicsRegistry.PATTERN_SCHEMATIC.get())
.defaultLang("Pattern Schematics", "Printing with pattern schematics")
.addToIndex();

private static PonderTag create(String id) {
return new PonderTag(PatternSchematics.asResource(id));
}

public static void register() {
// Add items to tags here

PonderRegistry.TAGS.forTag(PATTERN_SCHEMATIC)
.add(PatternSchematicsRegistry.EMPTY_PATTERN_SCHEMATIC)
.add(PatternSchematicsRegistry.PATTERN_SCHEMATIC);

}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.cak.pattern_schematics.foundation;

import com.cak.pattern_schematics.content.PatternSchematicItem;
import com.cak.pattern_schematics.registry.PatternSchematicsItems;
import com.cak.pattern_schematics.content.item.PatternSchematicItem;
import com.cak.pattern_schematics.registry.PatternSchematicsRegistry;
import com.simibubi.create.AllItems;
import com.simibubi.create.content.schematics.SchematicItem;
import com.tterrag.registrate.util.entry.ItemEntry;
Expand All @@ -21,8 +21,8 @@ public enum SchematicUploadItemSource {
AllItems.SCHEMATIC
) ),
PATTERN(PatternSchematicItem::create, 1, List.of(
PatternSchematicsItems.EMPTY_PATTERN_SCHEMATIC,
PatternSchematicsItems.PATTERN_SCHEMATIC
PatternSchematicsRegistry.EMPTY_PATTERN_SCHEMATIC,
PatternSchematicsRegistry.PATTERN_SCHEMATIC
))
;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.cak.pattern_schematics.foundation.mirror;

import com.cak.pattern_schematics.foundation.util.Vec3iUtils;
import com.cak.pattern_schematics.registry.PatternSchematicsItems;
import com.cak.pattern_schematics.registry.PatternSchematicsRegistry;
import com.cak.pattern_schematics.registry.PlatformPackets;
import com.google.common.collect.ImmutableList;
import com.mojang.blaze3d.vertex.PoseStack;
Expand All @@ -12,7 +12,6 @@
import com.simibubi.create.content.schematics.SchematicItem;
import com.simibubi.create.content.schematics.SchematicWorld;
import com.simibubi.create.content.schematics.client.SchematicHandler;
import com.simibubi.create.content.schematics.client.SchematicHotbarSlotOverlay;
import com.simibubi.create.content.schematics.client.SchematicRenderer;
import com.simibubi.create.content.schematics.client.SchematicTransformation;
import com.simibubi.create.foundation.outliner.AABBOutline;
Expand Down Expand Up @@ -319,7 +318,7 @@ public boolean mouseScrolled(double delta) {

private ItemStack findBlueprintInHand(Player player) {
ItemStack stack = player.getMainHandItem();
if (!PatternSchematicsItems.PATTERN_SCHEMATIC.isIn(stack))
if (!PatternSchematicsRegistry.PATTERN_SCHEMATIC.isIn(stack))
return null;
if (!stack.hasTag())
return null;
Expand All @@ -331,8 +330,7 @@ private ItemStack findBlueprintInHand(Player player) {

private boolean itemLost(Player player) {
for (int i = 0; i < Inventory.getSelectionSize(); i++) {
if (!ItemStack.matches(player.getInventory()
.getItem(i), activeSchematicItem))
if (!player.getInventory().getItem(i).equals(activeSchematicItem))
continue;
return false;
}
Expand Down
Loading

0 comments on commit f2171a7

Please sign in to comment.