Port new changes

This commit is contained in:
simibubi 2025-02-28 11:51:52 +01:00
parent 59985dc1e8
commit decb2e7e3a
3 changed files with 7 additions and 5 deletions

View file

@ -9,6 +9,7 @@ import com.simibubi.create.api.behaviour.spouting.StateChangingBehavior;
import com.simibubi.create.compat.Mods;
import com.simibubi.create.compat.tconstruct.SpoutCasting;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
@ -18,9 +19,9 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.Fluids;
import net.minecraftforge.registries.ForgeRegistries;
public class AllBlockSpoutingBehaviours {
static void registerDefaults() {
Predicate<Fluid> isWater = fluid -> fluid.isSame(Fluids.WATER);
BlockSpoutingBehaviour toMud = StateChangingBehavior.setTo(250, isWater, Blocks.MUD);
@ -38,8 +39,8 @@ public class AllBlockSpoutingBehaviours {
for (String name : List.of("table", "basin")) {
ResourceLocation id = Mods.TCONSTRUCT.rl(name);
if (ForgeRegistries.BLOCK_ENTITY_TYPES.containsKey(id)) {
BlockEntityType<?> table = ForgeRegistries.BLOCK_ENTITY_TYPES.getValue(id);
if (BuiltInRegistries.BLOCK_ENTITY_TYPE.containsKey(id)) {
BlockEntityType<?> table = BuiltInRegistries.BLOCK_ENTITY_TYPE.get(id);
BlockSpoutingBehaviour.BY_BLOCK_ENTITY.register(table, SpoutCasting.INSTANCE);
} else {
Create.LOGGER.warn("Block entity {} wasn't found. Outdated compat?", id);

View file

@ -30,6 +30,7 @@ import dev.engine_room.flywheel.lib.instance.InstanceTypes;
import dev.engine_room.flywheel.lib.instance.TransformedInstance;
import dev.engine_room.flywheel.lib.material.SimpleMaterial;
import dev.engine_room.flywheel.lib.model.ModelUtil;
import dev.engine_room.flywheel.lib.model.baked.BlockModelBuilder;
import dev.engine_room.flywheel.lib.task.ForEachPlan;
import dev.engine_room.flywheel.lib.task.NestedPlan;
import dev.engine_room.flywheel.lib.task.PlanMap;
@ -94,7 +95,7 @@ public class ContraptionVisual<E extends AbstractContraptionEntity> extends Abst
}
};
model = new MultiBlockModelBuilder(modelWorld, blocks.positions())
model = new BlockModelBuilder(modelWorld, blocks.positions())
.materialFunc((renderType, aBoolean) -> SimpleMaterial.builderOf(ModelUtil.getMaterial(renderType, aBoolean))
.cardinalLightingMode(CardinalLightingMode.CHUNK))
.build();

View file

@ -19,7 +19,7 @@ public class PotatoCannonPacket extends ShootGadgetPacket {
public static final StreamCodec<RegistryFriendlyByteBuf, PotatoCannonPacket> STREAM_CODEC = StreamCodec.composite(
CatnipStreamCodecs.VEC3, packet -> packet.location,
CatnipStreamCodecs.VEC3, packet -> packet.motion,
ItemStack.STREAM_CODEC, packet -> packet.item,
ItemStack.OPTIONAL_STREAM_CODEC, packet -> packet.item,
CatnipStreamCodecs.HAND, packet -> packet.hand,
ByteBufCodecs.FLOAT, packet -> packet.pitch,
ByteBufCodecs.BOOL, packet -> packet.self,