Skip to content

Commit

Permalink
config for cart contraption placement
Browse files Browse the repository at this point in the history
  • Loading branch information
TropheusJ committed Aug 5, 2023
1 parent 372a01c commit d4da77d
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2023-07-17T00:09:04.3228525 Create/Create's Standard Recipes
// 1.20.1 2023-08-05T05:44:34.4869285 Create/Create's Standard Recipes
40d8bca20f7dcd8c4751161a7248bc72546d6936 data\create\advancements\recipes\misc\crafting\kinetics\mechanical_drill.json
8c72f6440c1c6911b063d67a079e7940db192dc9 data\create\advancements\recipes\misc\smelting\uranium_ingot_compat_modern_industrialization.json
4defe740963f64be169996722794bc8b26c3d456 data\create\advancements\recipes\misc\crafting\materials\experience_nugget_from_block.json
Expand Down Expand Up @@ -64,8 +64,8 @@ d88c5c8b6751f389d9eea30acbd566c120e77705 data\create\advancements\recipes\misc\b
25649f2e6100e79af99cc0f565ae894a1853ad11 data\create\recipes\crafting\kinetics\controller_rail.json
67c1143c7aac88a9cc91b98dbca60770cb1422a5 data\create\recipes\smelting\glass_pane_from_vertical_framed_glass_pane.json
8eca7b132f53c805ef71bbe148a4b6eb482d5d0d data\create\advancements\recipes\misc\crafting\kinetics\vertical_gearboxfrom_conversion.json
1b50ed47c37e48d1112c76059574eed71ecea4e5 data\create\advancements\recipes\misc\crafting\logistics\redstone_link.json
8384b63525d3412a00dbc8f4cd61b4f585d67c1d data\create\recipes\crafting\kinetics\nozzle.json
1b50ed47c37e48d1112c76059574eed71ecea4e5 data\create\advancements\recipes\misc\crafting\logistics\redstone_link.json
28d1dabd689b855964151100a80247b2ea150bd4 data\create\recipes\crafting\appliances\clipboard_clear.json
580183a6695e0b62c17d15b3be13f254b854cabc data\create\recipes\smelting\osmium_ingot_compat_mythicmetals.json
409b5d70ee1ef9164c327d79472e6d66ce55dec6 data\create\recipes\crafting\appliances\filter_clear.json
Expand Down Expand Up @@ -307,8 +307,8 @@ b5a2ad992b86d7c9a34876a3dd4ce3a2aa7d8d10 data\create\recipes\crafting\kinetics\c
46c7b78356837785af8a5fa18c9eba0758ac0c33 data\create\recipes\crafting\kinetics\wrench.json
5a702087cb9657d72b7ebf448394df71a078c6cd data\create\advancements\recipes\misc\blasting\lead_ingot_compat_techreborn.json
1e22edba76fc82d3d06d72e3325fa015259561cb data\create\advancements\recipes\misc\smelting\zinc_ingot_from_crushed.json
7b2eee412370c5d4d8dd7cc41c94399476f8f263 data\create\recipes\crafting\kinetics\mechanical_saw.json
87b2748fc56826ec62b0200e943feb30002c4b12 data\create\advancements\recipes\misc\crafting\kinetics\mechanical_saw.json
7b2eee412370c5d4d8dd7cc41c94399476f8f263 data\create\recipes\crafting\kinetics\mechanical_saw.json
32086aec6acc2e236ccd1bdcad8077355cfbc801 data\create\advancements\recipes\misc\crafting\kinetics\track_observer.json
6418408e9fe53c03eae1e2b17b2229a548abc226 data\create\advancements\recipes\misc\blasting\copper_ingot_from_crushed.json
76bcdecacf540457a752952eb29dcca3db8836a1 data\create\recipes\crafting\kinetics\minecart_from_contraption_cart.json
Expand Down Expand Up @@ -357,8 +357,8 @@ f0c804438124b6f8c382e6b6b4a06564b3c7d268 data\create\recipes\blasting\platinum_i
7b77758972dc4739493b65a11d882ce7e26bc00d data\create\advancements\recipes\misc\smelting\glass_from_vertical_framed_glass.json
471da96bdc50929e50a4255998c365f6dd74f66b data\create\advancements\recipes\misc\smelting\ingot_osmium_compat_mekanism.json
d05bf9eb0708fd08727414a05432119547683c82 data\create\advancements\recipes\misc\crafting\kinetics\track_station.json
795a165b040e3476d45ddd8afda8ab97a515c0f2 data\create\advancements\recipes\misc\crafting\kinetics\mechanical_plough.json
7cbb3fa60dabefa29b6cd916e03c249241fc99fc data\create\advancements\recipes\misc\crafting\kinetics\mechanical_harvester.json
795a165b040e3476d45ddd8afda8ab97a515c0f2 data\create\advancements\recipes\misc\crafting\kinetics\mechanical_plough.json
49c5868d82135e3a4db04dfbe86dc235dccb3a02 data\create\recipes\crafting\materials\zinc_ingot_from_compacting.json
96b4998626e624fb79c79fb754c28b21ddc27254 data\create\advancements\recipes\misc\crafting\logistics\redstone_contact.json
1ac5571d7ab216bba9c6e0bdcfeb69349cf74926 data\create\recipes\smelting\uranium_ingot_compat_modern_industrialization.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2023-07-17T00:09:04.3213514 Create/Create's Sequenced Assembly Recipes
// 1.20.1 2023-08-05T05:44:34.4854272 Create/Create's Sequenced Assembly Recipes
2d287e023d41b94bf9b2c446c01cd541132f1b60 data\create\recipes\sequenced_assembly\precision_mechanism.json
6aff58e266ccffe76e3af529c5d27ca80452e5a3 data\create\recipes\sequenced_assembly\sturdy_sheet.json
34028457bfd675066d61f029698dfe32360e7b10 data\create\recipes\sequenced_assembly\track.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2023-07-17T00:09:04.2978315 Create/Registrate Provider for create [Recipes, Advancements, Loot Tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)]
// 1.20.1 2023-08-05T05:44:34.4624076 Create/Registrate Provider for create [Recipes, Advancements, Loot Tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)]
cac9914c729c0ecf5e9e1b4fe6498005e7c532f3 data\create\advancements\recipes\building_blocks\small_granite_brick_wall_from_stone_types_granite_stonecutting.json
adc188e4e48bea80607c6e0c7076c9bdd7236cb0 assets\create\models\item\waxed_copper_shingle_slab.json
039686cb1a0f9b3eea44ff39431ebe9c57081fc3 assets\create\blockstates\mechanical_piston_head.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 1.20.1 2023-07-17T00:09:04.3213514 Create/Create's Damage Type Data
// 1.20.1 2023-08-05T05:44:34.4854272 Create/Create's Damage Type Data
d2a4fdb64f4ba817e13a7b20c73fd1ca34b825fc data\create\damage_type\fan_fire.json
d6f22959336e7dd19fc8593c5bad134462f51616 data\create\damage_type\fan_lava.json
43cfce97a9326a1a7ce95f91a052586610b9686c data\create\damage_type\mechanical_saw.json
afdc8574e8e915dac5693f368e9c1260714ad111 data\create\damage_type\mechanical_roller.json
030ede1044384c4117ac1e491bf5c78bbd2842f5 data\create\damage_type\crush.json
4dae2c0fc9fe6749649ef06dd3b7baaa9bd5e807 data\create\damage_type\run_over.json
92b0416950ffeb3ba68811e587177c2f8811c2c5 data\create\damage_type\cuckoo_surprise.json
58ab7a8eed0841f05b4b1373ba159e3e6503b7c3 data\create\damage_type\potato_cannon.json
4dae2c0fc9fe6749649ef06dd3b7baaa9bd5e807 data\create\damage_type\run_over.json
c884779ba4426b688795c97b01299db17b481fdc data\create\damage_type\mechanical_drill.json
58ab7a8eed0841f05b4b1373ba159e3e6503b7c3 data\create\damage_type\potato_cannon.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-07-17T00:09:04.2963313 Create/Create's Custom Sounds
// 1.20.1 2023-08-05T05:44:34.4609061 Create/Create's Custom Sounds
043955db25ffe58e7debb9a4f11e41a9571376e6 assets\create\sounds.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// 1.20.1 2023-07-17T00:09:04.3218517 Create/Create's lang merger
// 1.20.1 2023-08-05T05:44:34.4859277 Create/Create's lang merger
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2023-07-17T00:09:04.3248547 Create/Create's Worldgen Data
// 1.20.1 2023-08-05T05:44:34.48893 Create/Create's Worldgen Data
451e7dab2b989b4c481c1d7c38ab9daab70474f5 data\create\worldgen\placed_feature\striated_ores_overworld.json
b3f6cb5cfd9fd10d4841480632474800b34055ad data\create\worldgen\placed_feature\zinc_ore.json
fbf6999fb922a0770cfbea3a8bddc11ba8b1552b data\create\worldgen\configured_feature\zinc_ore.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2023-07-17T00:09:04.2973306 Create/Create's Mechanical Crafting Recipes
// 1.20.1 2023-08-05T05:44:34.4619068 Create/Create's Mechanical Crafting Recipes
3b2837b08607c1ca466fa3eb418209b2e55da6ba data\create\recipes\mechanical_crafting\potato_cannon.json
75ed217b219788ede2145726272f0ab2bb747edc data\create\recipes\mechanical_crafting\crushing_wheel.json
d588edebb9150f6c857c0415a2099404db8fa383 data\create\recipes\mechanical_crafting\extendo_grip.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2023-07-17T00:09:04.3188494 Create/Create's Processing Recipes
// 1.20.1 2023-08-05T05:44:34.4829251 Create/Create's Processing Recipes
5066b4461aff3a480eebfa7627cdd0e4256662db data\create\recipes\cutting\compat\botania\livingwood_log.json
97beb27a8fb05f799c215a4cb5691d4e03a6820e data\create\recipes\crushing\tuff.json
a883796342143a5f2b5bc68d230b725964abdb8f data\create\recipes\splashing\white_concrete_powder.json
Expand Down Expand Up @@ -119,8 +119,8 @@ f0d1abc7ad682269e14378497a73829ec46cb3e6 data\create\recipes\cutting\compat\byg\
b90e5b0a18d6d2e7eae62d0caf41fb3dd597c1e9 data\create\recipes\cutting\stripped_crimson_hyphae.json
eacdbdea1b8f75e49b9d4f3abdaf02d47fde41ed data\create\recipes\cutting\compat\byg\redwood_wood.json
78e12ee50b74d7d909c09b6fe649c2a9df77f652 data\create\recipes\cutting\compat\ecologics\stripped_coconut_wood.json
8908b452e6bc1290ebb8cfefc2c066460de93bff data\create\recipes\splashing\green_concrete_powder.json
3ce6bc6cfbdeb52c2514f5620db9f0b95ee18d3a data\create\recipes\splashing\brown_concrete_powder.json
8908b452e6bc1290ebb8cfefc2c066460de93bff data\create\recipes\splashing\green_concrete_powder.json
8d787ccbb817d773616405afc255e298803c9573 data\create\recipes\splashing\magma_block.json
9922535a4b41d6af68df94168276abf308ea432c data\create\recipes\crushing\deepslate_gold_ore.json
196870f2fa2d5b3d2d450949006b8c8fc4a58e73 data\create\recipes\cutting\compat\biomesoplenty\stripped_mahogany_wood.json
Expand All @@ -144,10 +144,10 @@ daf5c0c9e3f13d2004d53c54f4c1c36ae098d1ae data\create\recipes\pressing\path.json
c9a47b29ba75ba29c8cb630fe32c4bf2f1f1d1ae data\create\recipes\crushing\iron_ore.json
774d56f10c684cec58333a46d4519895bf714dcf data\create\recipes\cutting\compat\byg\baobab_wood.json
c26b9f1ea42b0fab2d4f6389034fc940f350087d data\create\recipes\cutting\compat\biomesoplenty\jacaranda_wood.json
29b1755e48b902c1123eafa75a8fa00325bd3b8b data\create\recipes\crushing\raw_zinc.json
2833601a45709b33c60d49e5647831df542db7f3 data\create\recipes\milling\dripstone_block.json
c43034dd47f9b7a07e267003e6b0ae240573cb39 data\create\recipes\cutting\compat\byg\stripped_cherry_log.json
afeeb81e6f5fb9372f2137bf08ebf6693d3b9f22 data\create\recipes\cutting\compat\quark\blossom_log.json
c43034dd47f9b7a07e267003e6b0ae240573cb39 data\create\recipes\cutting\compat\byg\stripped_cherry_log.json
2833601a45709b33c60d49e5647831df542db7f3 data\create\recipes\milling\dripstone_block.json
29b1755e48b902c1123eafa75a8fa00325bd3b8b data\create\recipes\crushing\raw_zinc.json
35e615209129746a6b5a92b63653ff7c6935b310 data\create\recipes\filling\honeyed_apple.json
1230f449873262e79585752d3430e5f7f383bcb2 data\create\recipes\deploying\large_cogwheel.json
0130258652f73a3cad7ec1b1c55aa34a4e2ad062 data\create\recipes\milling\cornflower.json
Expand Down Expand Up @@ -423,9 +423,9 @@ a4bf7012091fefc0d71faf469fe71c4c96abb327 data\create\recipes\cutting\compat\byg\
9d30d68a77d532d10f2e5c26f38d0b5acaa8396f data\create\recipes\item_application\copper_casing_from_wood.json
7d1962d65899ebb5e9794820d408b36e459b196b data\create\recipes\cutting\compat\biomesoplenty\fir_log.json
52533dc96e6cf37d3566a34952d1b222218599e2 data\create\recipes\cutting\compat\byg\cika_wood.json
ebf6a615a4b8397c04239ee50b17f69b64f63da9 data\create\recipes\cutting\compat\integrateddynamics\menril_wood_stripped.json
e9181e434b163e4f693767c72588542424515463 data\create\recipes\cutting\compat\byg\stripped_baobab_wood.json
851801ee490682a26c9a3b756f2493693c130070 data\create\recipes\cutting\compat\byg\palm_wood.json
e9181e434b163e4f693767c72588542424515463 data\create\recipes\cutting\compat\byg\stripped_baobab_wood.json
ebf6a615a4b8397c04239ee50b17f69b64f63da9 data\create\recipes\cutting\compat\integrateddynamics\menril_wood_stripped.json
399a61d9ed416a5c5ce310f8e2575a05f91af35f data\create\recipes\cutting\compat\tconstruct\greenheart_wood.json
cbfe10af00c5da0158de3ad675691c089cda8980 data\create\recipes\cutting\compat\biomesoplenty\dead_wood.json
cc939ba59b95db1c7a034df6f9e656772074a5fd data\create\recipes\crushing\gravel.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2023-07-17T00:09:04.3223525 Create/Create's Advancements
// 1.20.1 2023-08-05T05:44:34.4859277 Create/Create's Advancements
84b24845a97c04edf20cad8562c2d0de4c634ab2 data\create\advancements\crushing_wheel.json
691a69a0ff6ead80307f406e4be10952dafb4e6d data\create\advancements\long_travel.json
2954be6b07ad0204ddb68d73899d2be42d90d506 data\create\advancements\arm_many_targets.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2023-07-17T00:09:04.3183487 Create/Tags for minecraft:damage_type
// 1.20.1 2023-08-05T05:44:34.482425 Create/Tags for minecraft:damage_type
d17cbaf115b5714550eb14a9155b5b34f32471f3 data\minecraft\tags\damage_type\is_explosion.json
1fca74344d62cbfad090fa56a9c12484de899ff8 data\minecraft\tags\damage_type\bypasses_armor.json
1c4fc206e6726b009e1db6c1d3405872e027b87f data\minecraft\tags\damage_type\bypasses_armor.json
26ff06a2186b8ea8773c6e958e11ce9aafa45792 data\minecraft\tags\damage_type\is_fire.json
1 change: 1 addition & 0 deletions src/generated/resources/assets/create/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,7 @@

"create.contraption.minecart_contraption_too_big": "This Cart Contraption seems too big to pick up",
"create.contraption.minecart_contraption_illegal_pickup": "A mystical force is binding this Cart Contraption to the world",
"create.contraption.minecart_contraption_illegal_placement": "Placement of minecart contraptions is currently disabled.",

"enchantment.create.capacity.desc": "Increases Backtank air capacity.",
"enchantment.create.potato_recovery.desc": "Potato Cannon projectiles have a chance to be reused.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
"replace": false,
"values": [
{
"id": "create:mechanical_drill",
"id": "create:mechanical_saw",
"required": false
},
{
"id": "create:crush",
"id": "create:fan_fire",
"required": false
},
{
"id": "create:fan_fire",
"id": "create:fan_lava",
"required": false
},
{
"id": "create:fan_lava",
"id": "create:crush",
"required": false
},
{
"id": "create:mechanical_saw",
"id": "create:mechanical_drill",
"required": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import net.minecraft.core.dispenser.DefaultDispenseItemBehavior;
import net.minecraft.core.dispenser.DispenseItemBehavior;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.InteractionHand;
Expand Down Expand Up @@ -83,6 +84,9 @@ private MinecartContraptionItem(Type minecartTypeIn, Properties builder) {

@Override
public ItemStack execute(BlockSource source, ItemStack stack) {
if (!canPlace())
return behaviourDefaultDispenseItem.dispense(source, stack);

Direction direction = source.getBlockState()
.getValue(DispenserBlock.FACING);
Level world = source.getLevel();
Expand Down Expand Up @@ -146,6 +150,13 @@ public InteractionResult useOn(UseOnContext context) {
BlockState blockstate = world.getBlockState(blockpos);
if (!blockstate.is(BlockTags.RAILS)) {
return InteractionResult.FAIL;
} else if (!canPlace()) {
Player player = context.getPlayer();
if (player != null) {
Component message = Lang.translateDirect("contraption.minecart_contraption_illegal_placement").withStyle(ChatFormatting.RED);
player.displayClientMessage(message, true);
}
return InteractionResult.FAIL;
} else {
ItemStack itemstack = context.getItemInHand();
if (!world.isClientSide) {
Expand Down Expand Up @@ -173,6 +184,11 @@ public InteractionResult useOn(UseOnContext context) {
}
}

// fabric: temp fix for command smuggling for Blanketcon
private static boolean canPlace() {
return AllConfigs.server().kinetics.contraptionPlacing.get();
}

public static void addContraptionToMinecart(Level world, ItemStack itemstack, AbstractMinecart cart,
@Nullable Direction newFacing) {
CompoundTag tag = itemstack.getOrCreateTag();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class CKinetics extends ConfigBase {
public final ConfigInt maxCartCouplingLength = i(32, 1, "maxCartCouplingLength", Comments.maxCartCouplingLength);
public final ConfigInt rollerFillDepth = i(12, 1, "rollerFillDepth", Comments.rollerFillDepth);
public final ConfigBool survivalContraptionPickup = b(true, "survivalContraptionPickup", Comments.survivalContraptionPickup);
public final ConfigBool contraptionPlacing = b(true, "contraptionPlacing", Comments.contraptionPlacing);
public final ConfigEnum<ContraptionMovementSetting> spawnerMovement =
e(ContraptionMovementSetting.NO_PICKUP, "movableSpawners", Comments.spawnerMovement);
public final ConfigEnum<ContraptionMovementSetting> amethystMovement =
Expand Down Expand Up @@ -114,6 +115,7 @@ private static class Comments {
static String ejectorScanInterval =
"Time in ticks until the next item launched by an ejector scans blocks for potential collisions";
static String survivalContraptionPickup = "Whether minecart contraptions can be picked up in survival mode.";
static String contraptionPlacing = "Whether minecart contraptions can be placed from items.";
static String spawnerMovement = "Configure how Spawner blocks can be moved by contraptions.";
static String amethystMovement = "Configure how Budding Amethyst can be moved by contraptions.";
static String obsidianMovement = "Configure how Obsidian blocks can be moved by contraptions.";
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/create/lang/default/interface.json
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,8 @@
"create.contraption.minecart_contraption_too_big": "This Cart Contraption seems too big to pick up",
"create.contraption.minecart_contraption_illegal_pickup": "A mystical force is binding this Cart Contraption to the world",

"create.contraption.minecart_contraption_illegal_placement": "Placement of minecart contraptions is currently disabled.",

"enchantment.create.capacity.desc": "Increases Backtank air capacity.",
"enchantment.create.potato_recovery.desc": "Potato Cannon projectiles have a chance to be reused.",

Expand Down

0 comments on commit d4da77d

Please sign in to comment.