mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-09 08:50:29 +00:00
Register CC's modems as brittle
This tells Create that modems will pop-off if their neighbour is moved, and so changes the order that the block is moved in. We possibly should use BlockMovementChecks.AttachedCheck instead, to properly handle the direction modems are facing in. However, this doesn't appear to be part of the public API, so probably best avoided. Fixes #948
This commit is contained in:
parent
0c1ab780bb
commit
c8eadf4011
@ -6,6 +6,7 @@ package dan200.computercraft.data;
|
||||
|
||||
import dan200.computercraft.api.ComputerCraftTags;
|
||||
import dan200.computercraft.shared.ModRegistry;
|
||||
import dan200.computercraft.shared.integration.ExternalModTags;
|
||||
import dan200.computercraft.shared.platform.RegistryWrappers;
|
||||
import net.minecraft.data.tags.ItemTagsProvider;
|
||||
import net.minecraft.data.tags.TagsProvider;
|
||||
@ -81,6 +82,12 @@ class TagProvider {
|
||||
);
|
||||
|
||||
tags.tag(BlockTags.WITHER_IMMUNE).add(ModRegistry.Blocks.COMPUTER_COMMAND.get());
|
||||
|
||||
tags.tag(ExternalModTags.Blocks.CREATE_BRITTLE).add(
|
||||
ModRegistry.Blocks.CABLE.get(),
|
||||
ModRegistry.Blocks.WIRELESS_MODEM_ADVANCED.get(),
|
||||
ModRegistry.Blocks.WIRELESS_MODEM_ADVANCED.get()
|
||||
);
|
||||
}
|
||||
|
||||
public static void itemTags(ItemTagConsumer tags) {
|
||||
|
@ -0,0 +1,37 @@
|
||||
// SPDX-FileCopyrightText: 2024 The CC: Tweaked Developers
|
||||
//
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package dan200.computercraft.shared.integration;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
/**
|
||||
* Tags defined by external mods.
|
||||
*/
|
||||
public final class ExternalModTags {
|
||||
private ExternalModTags() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Block tags defined by external mods.
|
||||
*/
|
||||
public static final class Blocks {
|
||||
private Blocks() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create's "brittle" tag, used to determine if this block needs to be moved before its neighbours.
|
||||
*
|
||||
* @see <a href="https://github.com/Creators-of-Create/Create/blob/mc1.20.1/dev/src/main/java/com/simibubi/create/content/contraptions/BlockMovementChecks.java">{@code BlockMovementChecks}</a>
|
||||
*/
|
||||
public static final TagKey<Block> CREATE_BRITTLE = make("create", "brittle");
|
||||
|
||||
private static TagKey<Block> make(String mod, String name) {
|
||||
return TagKey.create(Registries.BLOCK, new ResourceLocation(mod, name));
|
||||
}
|
||||
}
|
||||
}
|
4
projects/fabric/src/generated/resources/data/create/tags/blocks/brittle.json
generated
Normal file
4
projects/fabric/src/generated/resources/data/create/tags/blocks/brittle.json
generated
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": ["computercraft:cable", "computercraft:wireless_modem_advanced", "computercraft:wireless_modem_advanced"]
|
||||
}
|
3
projects/forge/src/generated/resources/data/create/tags/blocks/brittle.json
generated
Normal file
3
projects/forge/src/generated/resources/data/create/tags/blocks/brittle.json
generated
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"values": ["computercraft:cable", "computercraft:wireless_modem_advanced", "computercraft:wireless_modem_advanced"]
|
||||
}
|
Loading…
Reference in New Issue
Block a user