Skip to content

Commit

Permalink
Fix some problem of tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glyceryl6 committed Dec 2, 2023
1 parent 2845803 commit 27b4c66
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 11 deletions.
10 changes: 10 additions & 0 deletions src/generated/resources/data/minecraft/tags/fluids/lava.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"values": [
"theaurorian:molten_aurorian_steel_still",
"theaurorian:molten_aurorian_steel_flowing",
"theaurorian:molten_cerulean_still",
"theaurorian:molten_cerulean_flowing",
"theaurorian:molten_moonstone_still",
"theaurorian:molten_moonstone_flowing"
]
}
6 changes: 6 additions & 0 deletions src/generated/resources/data/minecraft/tags/fluids/water.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"theaurorian:moon_water_still",
"theaurorian:moon_water_flowing"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import cn.teampancake.theaurorian.data.provider.*;
import cn.teampancake.theaurorian.data.provider.lang.TALanguageProviderENUS;
import cn.teampancake.theaurorian.data.provider.lang.TALanguageProviderZHCN;
import cn.teampancake.theaurorian.data.provider.tag.TABlockTagsProvider;
import cn.teampancake.theaurorian.data.provider.tag.TAEntityTagsProvider;
import cn.teampancake.theaurorian.data.provider.tag.TAItemTagsProvider;
import cn.teampancake.theaurorian.data.provider.tag.TAPaintingVariantTagsProvider;
import cn.teampancake.theaurorian.data.provider.tag.*;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
Expand All @@ -33,6 +30,7 @@ public static void onGatherData(GatherDataEvent event) {
output, provider, blockTagsProvider.contentsGetter(), existingFileHelper));
generator.addProvider(event.includeServer(), new TAPaintingVariantTagsProvider(output, provider, existingFileHelper));
generator.addProvider(event.includeServer(), new TAEntityTagsProvider(output, provider, existingFileHelper));
generator.addProvider(event.includeServer(), new TAFluidTagsProvider(output, provider, existingFileHelper));
generator.addProvider(event.includeClient(), new TABlockStateProvider(output, existingFileHelper));
generator.addProvider(event.includeClient(), new TAItemModelProvider(output, existingFileHelper));
generator.addProvider(event.includeServer(), new TASoundProvider(output, existingFileHelper));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ private void registerLiquidStates() {
this.simpleBlock(TABlocks.MOLTEN_MOONSTONE.get(), this.models()
.getBuilder(TABlocks.MOLTEN_MOONSTONE.getId().getPath())
.texture("particle", this.modLoc("block/molten_moonstone")));
this.simpleBlock(TABlocks.MOON_WATER.get(), this.models()
.getBuilder(TABlocks.MOON_WATER.getId().getPath())
.texture("particle", this.modLoc("block/moon_water")));
}

private void registerScrapperState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
import net.minecraftforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.Nullable;

import javax.annotation.ParametersAreNonnullByDefault;
import java.util.concurrent.CompletableFuture;

@SuppressWarnings("deprecation")
@ParametersAreNonnullByDefault
public class TABlockTagsProvider extends BlockTagsProvider {

public TABlockTagsProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, @Nullable ExistingFileHelper existingFileHelper) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.minecraft.data.tags.EntityTypeTagsProvider;
import net.minecraftforge.common.Tags;
import net.minecraftforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.concurrent.CompletableFuture;
Expand All @@ -20,7 +19,7 @@ public TAEntityTagsProvider(PackOutput packOutput, CompletableFuture<HolderLooku
}

@Override
protected void addTags(HolderLookup.@NotNull Provider provider) {
protected void addTags(HolderLookup.Provider provider) {
this.tag(Tags.EntityTypes.BOSSES)
.add(TAEntityTypes.RUNESTONE_KEEPER.get())
.add(TAEntityTypes.SPIDER_MOTHER.get())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package cn.teampancake.theaurorian.data.provider.tag;

import cn.teampancake.theaurorian.AurorianMod;
import cn.teampancake.theaurorian.registry.TAFluids;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.FluidTagsProvider;
import net.minecraft.tags.FluidTags;
import net.minecraftforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.Nullable;

import java.util.concurrent.CompletableFuture;

public class TAFluidTagsProvider extends FluidTagsProvider {

public TAFluidTagsProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> provider, @Nullable ExistingFileHelper existingFileHelper) {
super(output, provider, AurorianMod.MOD_ID, existingFileHelper);
}

@Override
protected void addTags(HolderLookup.Provider provider) {
this.tag(FluidTags.LAVA).add(
TAFluids.MOLTEN_AURORIAN_STEEL_STILL.get(),
TAFluids.MOLTEN_AURORIAN_STEEL_FLOWING.get(),
TAFluids.MOLTEN_CERULEAN_STILL.get(),
TAFluids.MOLTEN_CERULEAN_FLOWING.get(),
TAFluids.MOLTEN_MOONSTONE_STILL.get(),
TAFluids.MOLTEN_MOONSTONE_FLOWING.get());
this.tag(FluidTags.WATER).add(
TAFluids.MOON_WATER_STILL.get(),
TAFluids.MOON_WATER_FLOWING.get());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.concurrent.CompletableFuture;

@ParametersAreNonnullByDefault
public class TAItemTagsProvider extends ItemTagsProvider {

public TAItemTagsProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, CompletableFuture<TagLookup<Block>> blockTags, @Nullable ExistingFileHelper existingFileHelper) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
import net.minecraftforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.Nullable;

import javax.annotation.ParametersAreNonnullByDefault;
import java.util.concurrent.CompletableFuture;

@ParametersAreNonnullByDefault
public class TAPaintingVariantTagsProvider extends PaintingVariantTagsProvider {

public TAPaintingVariantTagsProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> provider, @Nullable ExistingFileHelper existingFileHelper) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@FieldsAreNonnullByDefault
package cn.teampancake.theaurorian.data.provider.tag;

import net.minecraft.FieldsAreNonnullByDefault;
import net.minecraft.MethodsReturnNonnullByDefault;

import javax.annotation.ParametersAreNonnullByDefault;

0 comments on commit 27b4c66

Please sign in to comment.