Skip to content

Commit

Permalink
refactor: Move Broken to API
Browse files Browse the repository at this point in the history
  • Loading branch information
sylv256 committed Nov 15, 2024
1 parent fd59c5a commit a11f5bf
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package gay.sylv.legacy_landscape.data_components;
package gay.sylv.legacy_landscape.api.definitions.data_components;

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import io.netty.buffer.ByteBuf;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import org.jetbrains.annotations.ApiStatus;

/**
* A component that stores how many times an item has broken.
* @param level the amount of times that something has broken.
*/
@ApiStatus.Experimental
public record Broken(int level) {
public static final Codec<Broken> CODEC = RecordCodecBuilder.create(
instance -> instance.group(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package gay.sylv.legacy_landscape.data_components;

import gay.sylv.legacy_landscape.api.definitions.data_components.Broken;
import net.minecraft.core.component.DataComponentType;
import net.minecraft.core.registries.Registries;
import net.neoforged.neoforge.registries.DeferredHolder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import gay.sylv.legacy_landscape.api.definitions.effect.MobEffects;
import gay.sylv.legacy_landscape.block.LegacyBlocks;
import gay.sylv.legacy_landscape.data_attachment.LegacyAttachments;
import gay.sylv.legacy_landscape.data_components.Broken;
import gay.sylv.legacy_landscape.api.definitions.data_components.Broken;
import gay.sylv.legacy_landscape.data_components.LegacyComponents;
import gay.sylv.legacy_landscape.effect.LegacyEffects;
import gay.sylv.legacy_landscape.item.LegacyItems;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gay.sylv.legacy_landscape.item;

import gay.sylv.legacy_landscape.data_components.Broken;
import gay.sylv.legacy_landscape.api.definitions.data_components.Broken;
import net.minecraft.world.item.TooltipFlag;
import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import gay.sylv.legacy_landscape.CommonConfig;
import gay.sylv.legacy_landscape.data_attachment.LegacyAttachments;
import gay.sylv.legacy_landscape.data_attachment.LegacyChunkType;
import gay.sylv.legacy_landscape.data_components.Broken;
import gay.sylv.legacy_landscape.api.definitions.data_components.Broken;
import gay.sylv.legacy_landscape.data_components.LegacyComponents;
import gay.sylv.legacy_landscape.networking.client_bound.LegacyChunkPayload;
import gay.sylv.legacy_landscape.util.Constants;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gay.sylv.legacy_landscape.item;

import gay.sylv.legacy_landscape.data_components.Broken;
import gay.sylv.legacy_landscape.api.definitions.data_components.Broken;
import gay.sylv.legacy_landscape.fluid.LegacyFluids;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gay.sylv.legacy_landscape.item;

import gay.sylv.legacy_landscape.data_components.Broken;
import gay.sylv.legacy_landscape.api.definitions.data_components.Broken;
import net.minecraft.ChatFormatting;
import net.minecraft.core.component.DataComponentType;
import net.minecraft.network.chat.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gay.sylv.legacy_landscape.mixin;

import gay.sylv.legacy_landscape.data_components.Broken;
import gay.sylv.legacy_landscape.api.definitions.data_components.Broken;
import gay.sylv.legacy_landscape.item.ConditionalText;
import gay.sylv.legacy_landscape.item.TooltipCondition;
import net.minecraft.network.chat.MutableComponent;
Expand Down

0 comments on commit a11f5bf

Please sign in to comment.