Skip to content

Commit

Permalink
allow negative int as color, fixes crash
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMCLoveMan committed Jun 15, 2024
1 parent 4ea06f0 commit 9ff7946
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package net.themcbrothers.uselessmod.core;

import com.mojang.serialization.Codec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.NonNullList;
import net.minecraft.core.component.DataComponentType;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.util.ExtraCodecs;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.neoforged.neoforge.fluids.FluidStack;
Expand All @@ -22,8 +22,8 @@ static void register() {

public static final DeferredHolder<DataComponentType<?>, DataComponentType<Integer>> COLOR = Registration.DATA_COMPONENT_TYPES.register("color",
() -> DataComponentType.<Integer>builder()
.persistent(ExtraCodecs.NON_NEGATIVE_INT)
.networkSynchronized(ByteBufCodecs.VAR_INT)
.persistent(Codec.INT)
.networkSynchronized(ByteBufCodecs.INT)
.build());
public static final DeferredHolder<DataComponentType<?>, DataComponentType<List<BlockPos>>> LIGHTS = Registration.DATA_COMPONENT_TYPES.register("lights",
() -> DataComponentType.<List<BlockPos>>builder()
Expand Down

0 comments on commit 9ff7946

Please sign in to comment.