Skip to content

Commit dd7b3c8

Browse files
authored
Merge branch 'Port-1.19.2' into 1.20.1
2 parents 8e6379c + 5ac9b38 commit dd7b3c8

File tree

67 files changed

+1320
-1210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1320
-1210
lines changed

Changelog.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- Fixed display bug, thanks to discord user @karolofgutovo for reporting
33
- Created ponder system with 1 ponder about printing (contraption ponder coming soon)
44
- (Technical) Created datagen
5-
-
5+
66
1.1.4:
77
- Fixed a bug with deployers placing at the wrong offsets
88
- Created bulk apply system to reduce pain of having to put a schematic on each individual deployer
@@ -22,4 +22,4 @@
2222

2323
1.1.8:
2424
- Made the schematicannon result in the proper item (previously would give Create's schematic no matter what)
25-
- Added an indicator when applying a non positioned schematic to a contraption deployer
25+
- Added an indicator when applying a non positioned schematic to a contraption deployer_

changelog.yaml

+8-5
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@
88
- Made the schematicannon result in the proper item (previously would give Create's schematic no matter what)
99
- Added an indicator when applying a non positioned schematic to a contraption deployer
1010
(This is a port, so this is the list of all changes from version 1.1.6->1.1.8)
11-
1.20.1-1.1.9: |
11+
12+
1.19.2-1.1.13: |
13+
- Updated to 1.1.13 from 1.20.1 branch
1214
- Reduced visual clutter on schematic clone highlights [Example of new system](https://media.discordapp.net/attachments/1267781614591676426/1272539875136114820/2024-08-12_13.56.54.png?ex=66bb589c&is=66ba071c&hm=7870a62f2b19ea94babd9fd1c250ee8eaecfb8827f0b1c4dfaa08f7d3080d299&=&format=webp&quality=lossless&width=1168&height=614)
1315
- This also should help to improve performance
14-
1.20.1-1.1.10: |
1516
- Fixed signal placement bug
16-
1.20.1-1.1.11: |
1717
- Changed creative mode tab ordering (Also should help for when latest create releases)
1818
- Changed to use correct gradle version
19-
1.20.1-1.1.12: |
2019
- Misc refactor
2120
- Mainly just to bump version to republish
22-
1.20.1-1.1.13: |
2321
- Added crafting using existing schematics instead of paper
22+
23+
1.19.2-1.1.15: |
24+
- Updated to 1.1.15 from 1.20.1
25+
- Update logo for 1.20.1
26+
- Added Spanish gameplay translations
2427
1.20.1-1.1.14: |
2528
- Update logo for 1.20.1
2629
1.20.1-1.1.15: |

common/src/generated/resources/.cache/a0215e79d0b720ef451ebefde67e867b1dd8939d common/src/generated/resources/.cache/d70dbc0fd4486830ea17f4c13c0b898ae5c564e3

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 1.20.1 2024-08-08T18:26:37.0204495 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)]
1+
// 1.19.2 2024-08-12T10:49:58.5148174 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)]
22
ef2d06ece9923cc75b5e3dc3070df2808f1cdb74 assets\create_pattern_schematics\models\item\pattern_schematic.json
33
8810e95491d447d2f23ff40d2a9dc511b4922ca8 assets\create_pattern_schematics\lang\en_us.json
44
1a219ed86763a03c3793a893757a3c253c4c620e assets\create_pattern_schematics\lang\en_ud.json
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
package com.cak.pattern_schematics;
22

3-
import com.cak.pattern_schematics.content.ponder.PatternSchematicsPonderTags;
43
import com.cak.pattern_schematics.content.ponder.PatternSchematicsPonderIndex;
4+
import com.cak.pattern_schematics.content.ponder.PatternSchematicsPonderTags;
55
import com.cak.pattern_schematics.foundation.mirror.PatternSchematicHandler;
66
import com.cak.pattern_schematics.registry.PlatformPackets;
77

88
public class PatternSchematicsClient {
9-
10-
/**Treat as final, the variable is initialised by platform*/
11-
public static PatternSchematicHandler PATTERN_SCHEMATIC_HANDLER;
12-
13-
public static void init() {
14-
PlatformPackets.getChannel().initClientListener();
15-
}
16-
17-
public static void setup() {
18-
PatternSchematicsPonderTags.register();
19-
PatternSchematicsPonderIndex.register();
20-
}
21-
9+
10+
/**
11+
* Treat as final, the variable is initialised by platform
12+
*/
13+
public static PatternSchematicHandler PATTERN_SCHEMATIC_HANDLER;
14+
15+
public static void init() {
16+
PlatformPackets.getChannel().initClientListener();
17+
}
18+
19+
public static void setup() {
20+
PatternSchematicsPonderTags.register();
21+
PatternSchematicsPonderIndex.register();
22+
}
23+
2224
}

common/src/main/java/com/cak/pattern_schematics/PatternSchematicsClientEvents.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package com.cak.pattern_schematics;
22

3-
import com.jozufozu.flywheel.event.RenderLayerEvent;
43
import com.mojang.blaze3d.systems.RenderSystem;
54
import com.mojang.blaze3d.vertex.PoseStack;
65
import com.simibubi.create.foundation.render.SuperRenderTypeBuffer;
7-
import com.simibubi.create.foundation.utility.AnimationTickHolder;
86
import net.minecraft.client.Minecraft;
97
import net.minecraft.world.phys.Vec3;
108

@@ -48,5 +46,5 @@ public static boolean onMouseInput(int button, boolean pressed) {
4846

4947
return PatternSchematicsClient.PATTERN_SCHEMATIC_HANDLER.onMouseInput(button, pressed);
5048
}
51-
49+
5250
}

common/src/main/java/com/cak/pattern_schematics/PlatformGetter.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public class PlatformGetter {
1414
* net.examplemod.fabric.ExampleExpectPlatformImpl#platformName() Actual Forge:
1515
* net.examplemod.forge.ExampleExpectPlatformImpl#platformName()
1616
* <p>
17-
* <a href="https://plugins.jetbrains.com/plugin/16210-architectury">You should also get the IntelliJ plugin to help
17+
* <a href="https://plugins.jetbrains.com/plugin/16210-architectury">You should also get the IntelliJ plugin to
18+
* help
1819
* with @ExpectPlatform.</a>
1920
*/
2021
@ExpectPlatform

common/src/main/java/com/cak/pattern_schematics/content/item/PatternSchematicItem.java

+19-21
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,32 @@
33
import com.cak.pattern_schematics.registry.PatternSchematicsRegistry;
44
import com.simibubi.create.content.schematics.SchematicItem;
55
import net.minecraft.core.BlockPos;
6-
import net.minecraft.core.HolderGetter;
76
import net.minecraft.nbt.CompoundTag;
87
import net.minecraft.nbt.NbtUtils;
98
import net.minecraft.world.item.ItemStack;
10-
import net.minecraft.world.level.block.Block;
119
import net.minecraft.world.level.block.Mirror;
1210
import net.minecraft.world.level.block.Rotation;
1311

1412
public class PatternSchematicItem extends SchematicItem {
15-
16-
public PatternSchematicItem(Properties properties) {
17-
super(properties);
18-
}
19-
20-
public static ItemStack create(HolderGetter<Block> lookup, String schematic, String owner) {
21-
ItemStack blueprint = PatternSchematicsRegistry.PATTERN_SCHEMATIC.asStack();
2213

23-
CompoundTag tag = new CompoundTag();
24-
tag.putBoolean("Deployed", false);
25-
tag.putString("Owner", owner);
26-
tag.putString("File", schematic);
27-
tag.put("Anchor", NbtUtils.writeBlockPos(BlockPos.ZERO));
28-
tag.putString("Rotation", Rotation.NONE.name());
29-
tag.putString("Mirror", Mirror.NONE.name());
30-
blueprint.setTag(tag);
14+
public PatternSchematicItem(Properties properties) {
15+
super(properties);
16+
}
17+
18+
public static ItemStack create(String schematic, String owner) {
19+
ItemStack blueprint = PatternSchematicsRegistry.PATTERN_SCHEMATIC.asStack();
20+
21+
CompoundTag tag = new CompoundTag();
22+
tag.putBoolean("Deployed", false);
23+
tag.putString("Owner", owner);
24+
tag.putString("File", schematic);
25+
tag.put("Anchor", NbtUtils.writeBlockPos(BlockPos.ZERO));
26+
tag.putString("Rotation", Rotation.NONE.name());
27+
tag.putString("Mirror", Mirror.NONE.name());
28+
blueprint.setTag(tag);
29+
30+
writeSize(blueprint);
31+
return blueprint;
32+
}
3133

32-
writeSize(lookup, blueprint);
33-
return blueprint;
34-
}
35-
3634
}

common/src/main/java/com/cak/pattern_schematics/content/ponder/PatternSchematicPonderScenes.java

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.cak.pattern_schematics.registry.PatternSchematicsRegistry;
44
import com.simibubi.create.AllItems;
5-
import com.simibubi.create.content.trains.entity.Train;
65
import com.simibubi.create.foundation.ponder.*;
76
import com.simibubi.create.foundation.ponder.element.EntityElement;
87
import com.simibubi.create.foundation.ponder.element.InputWindowElement;
@@ -14,8 +13,6 @@
1413
import net.minecraft.core.Vec3i;
1514
import net.minecraft.world.entity.Entity;
1615
import net.minecraft.world.item.ItemStack;
17-
import net.minecraft.world.level.block.Block;
18-
import net.minecraft.world.level.block.Blocks;
1916
import net.minecraft.world.phys.AABB;
2017
import net.minecraft.world.phys.Vec3;
2118

common/src/main/java/com/cak/pattern_schematics/foundation/CloneTool.java

+37-37
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,45 @@
1111
import net.minecraft.world.phys.Vec3;
1212

1313
public class CloneTool extends SchematicToolBase {
14-
15-
@Override
16-
public boolean handleRightClick() {
17-
return false;
18-
}
19-
20-
@Override
21-
public boolean handleMouseWheel(double delta) {
22-
if (!schematicSelected && !AllKeys.shiftDown())
23-
return true;
2414

25-
if (!(schematicHandler instanceof PatternSchematicHandler patternSchematicHandler))
26-
throw new RuntimeException("Clone tool bound in a normal SchematicHandler!");
15+
@Override
16+
public boolean handleRightClick() {
17+
return false;
18+
}
2719

28-
LocalPlayer player = Minecraft.getInstance().player;
29-
Direction face = (AllKeys.shiftDown() && player != null) ? facingOfPlayer(player) : selectedFace;
20+
@Override
21+
public boolean handleMouseWheel(double delta) {
22+
if (!schematicSelected && !AllKeys.shiftDown())
23+
return true;
24+
25+
if (!(schematicHandler instanceof PatternSchematicHandler patternSchematicHandler))
26+
throw new RuntimeException("Clone tool bound in a normal SchematicHandler!");
27+
28+
LocalPlayer player = Minecraft.getInstance().player;
29+
Direction face = (AllKeys.shiftDown() && player != null) ? facingOfPlayer(player) : selectedFace;
30+
31+
boolean isPositive = face.getAxisDirection() == Direction.AxisDirection.POSITIVE;
32+
33+
Vec3i cloneScale;
34+
if (isPositive)
35+
cloneScale = patternSchematicHandler.getCloneScaleMax();
36+
else
37+
cloneScale = patternSchematicHandler.getCloneScaleMin();
38+
39+
cloneScale = cloneScale.relative(face, Mth.sign(delta));
40+
41+
if (isPositive)
42+
patternSchematicHandler.setCloneScaleMax(cloneScale);
43+
else
44+
patternSchematicHandler.setCloneScaleMin(cloneScale);
45+
46+
schematicHandler.markDirty();
47+
return true;
48+
}
3049

31-
boolean isPositive = face.getAxisDirection() == Direction.AxisDirection.POSITIVE;
50+
private Direction facingOfPlayer(LocalPlayer player) {
51+
Vec3 lookAngle = player.getLookAngle();
52+
return Direction.getNearest(lookAngle.x, lookAngle.y, lookAngle.z);
53+
}
3254

33-
Vec3i cloneScale;
34-
if (isPositive)
35-
cloneScale = patternSchematicHandler.getCloneScaleMax();
36-
else
37-
cloneScale = patternSchematicHandler.getCloneScaleMin();
38-
39-
cloneScale = cloneScale.relative(face, Mth.sign(delta));
40-
41-
if (isPositive)
42-
patternSchematicHandler.setCloneScaleMax(cloneScale);
43-
else
44-
patternSchematicHandler.setCloneScaleMin(cloneScale);
45-
46-
schematicHandler.markDirty();
47-
return true;
48-
}
49-
50-
private Direction facingOfPlayer(LocalPlayer player) {
51-
Vec3 lookAngle = player.getLookAngle();
52-
return Direction.getNearest(lookAngle.x, lookAngle.y, lookAngle.z);
53-
}
54-
5555
}

common/src/main/java/com/cak/pattern_schematics/foundation/GenericNetworker.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.simibubi.create.foundation.networking.SimplePacketBase;
44

55
public interface GenericNetworker {
6-
6+
77
void initServerListener();
88
void initClientListener();
99
void sendToServer(SimplePacketBase packet);

common/src/main/java/com/cak/pattern_schematics/foundation/SchematicUploadItemSource.java

+52-53
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,63 @@
55
import com.simibubi.create.AllItems;
66
import com.simibubi.create.content.schematics.SchematicItem;
77
import com.tterrag.registrate.util.entry.ItemEntry;
8-
import net.minecraft.core.HolderGetter;
98
import net.minecraft.world.item.Item;
109
import net.minecraft.world.item.ItemStack;
11-
import net.minecraft.world.level.block.Block;
1210

1311
import java.util.Arrays;
1412
import java.util.List;
1513

1614
public enum SchematicUploadItemSource {
17-
18-
DEFAULT(SchematicItem::create, 0, List.of(
19-
AllItems.EMPTY_SCHEMATIC,
20-
AllItems.SCHEMATIC_AND_QUILL,
21-
AllItems.SCHEMATIC
22-
) ),
23-
PATTERN(PatternSchematicItem::create, 1, List.of(
24-
PatternSchematicsRegistry.EMPTY_PATTERN_SCHEMATIC,
25-
PatternSchematicsRegistry.PATTERN_SCHEMATIC
26-
))
27-
;
28-
29-
final SchematicItemFactory factory;
30-
final int nbtValue;
31-
final List<ItemEntry<? extends Item>> schematicSourceItem;
32-
33-
SchematicUploadItemSource(SchematicItemFactory factory, int nbtValue, List<ItemEntry<? extends Item>> schematicSourceItem) {
34-
this.factory = factory;
35-
this.nbtValue = nbtValue;
36-
this.schematicSourceItem = schematicSourceItem;
37-
}
38-
39-
public SchematicItemFactory getFactory() {
40-
return factory;
41-
}
42-
43-
public int getNbtValue() {
44-
return nbtValue;
45-
}
46-
47-
public List<ItemEntry<? extends Item>> getSchematicSourceItems() {
48-
return schematicSourceItem;
49-
}
50-
51-
public static SchematicUploadItemSource tryFromItemStack(ItemStack stack) {
52-
return Arrays.stream(values())
53-
.filter(source -> source.getSchematicSourceItems()
54-
.stream().anyMatch(sourceItem -> sourceItem.isIn(stack)))
55-
.findAny().orElse(null);
56-
}
57-
58-
public static SchematicUploadItemSource tryFromInt(int nbtValue) {
59-
return Arrays.stream(values())
60-
.filter(source -> source.getNbtValue() == nbtValue)
61-
.findAny().orElse(null);
62-
}
63-
64-
public static interface SchematicItemFactory {
65-
ItemStack create(HolderGetter<Block> lookup, String schematic, String owner);
66-
}
67-
15+
16+
DEFAULT(SchematicItem::create, 0, List.of(
17+
AllItems.EMPTY_SCHEMATIC,
18+
AllItems.SCHEMATIC_AND_QUILL,
19+
AllItems.SCHEMATIC
20+
)),
21+
PATTERN(PatternSchematicItem::create, 1, List.of(
22+
PatternSchematicsRegistry.EMPTY_PATTERN_SCHEMATIC,
23+
PatternSchematicsRegistry.PATTERN_SCHEMATIC
24+
));
25+
26+
final SchematicItemFactory factory;
27+
final int nbtValue;
28+
final List<ItemEntry<? extends Item>> schematicSourceItem;
29+
30+
SchematicUploadItemSource(SchematicItemFactory factory, int nbtValue, List<ItemEntry<? extends Item>> schematicSourceItem) {
31+
this.factory = factory;
32+
this.nbtValue = nbtValue;
33+
this.schematicSourceItem = schematicSourceItem;
34+
}
35+
36+
public SchematicItemFactory getFactory() {
37+
return factory;
38+
}
39+
40+
public int getNbtValue() {
41+
return nbtValue;
42+
}
43+
44+
public List<ItemEntry<? extends Item>> getSchematicSourceItems() {
45+
return schematicSourceItem;
46+
}
47+
48+
public static SchematicUploadItemSource tryFromItemStack(ItemStack stack) {
49+
return Arrays.stream(values())
50+
.filter(source -> source.getSchematicSourceItems()
51+
.stream().anyMatch(sourceItem -> sourceItem.isIn(stack)))
52+
.findAny().orElse(null);
53+
}
54+
55+
public static SchematicUploadItemSource tryFromInt(int nbtValue) {
56+
return Arrays.stream(values())
57+
.filter(source -> source.getNbtValue() == nbtValue)
58+
.findAny().orElse(null);
59+
}
60+
61+
public static interface SchematicItemFactory {
62+
63+
ItemStack create(String schematic, String owner);
64+
65+
}
66+
6867
}

0 commit comments

Comments
 (0)