more DataGen
This commit is contained in:
		
							parent
							
								
									9b4a3e4b7a
								
							
						
					
					
						commit
						02130d4cc7
					
				@ -20,6 +20,7 @@ public class DataGenerators {
 | 
			
		||||
        ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
 | 
			
		||||
        CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();
 | 
			
		||||
 | 
			
		||||
        generator.addProvider(event.includeClient(), new ModBlockStateProvider(packOutput, existingFileHelper));
 | 
			
		||||
        generator.addProvider(event.includeClient(), new ModItemModelProvider(packOutput, existingFileHelper));
 | 
			
		||||
        ModBlockTagGenerator blockTagGenerator = generator.addProvider(event.includeServer(),
 | 
			
		||||
                new ModBlockTagGenerator(packOutput, lookupProvider, existingFileHelper));
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,43 @@
 | 
			
		||||
package com.jenny.compressedblocks.datagen;
 | 
			
		||||
 | 
			
		||||
import com.jenny.compressedblocks.CompressedBlocks;
 | 
			
		||||
import net.minecraft.data.PackOutput;
 | 
			
		||||
import net.minecraft.world.level.block.*;
 | 
			
		||||
import net.minecraftforge.client.model.generators.BlockStateProvider;
 | 
			
		||||
import net.minecraftforge.common.data.ExistingFileHelper;
 | 
			
		||||
import net.minecraftforge.registries.RegistryObject;
 | 
			
		||||
 | 
			
		||||
public class ModBlockStateProvider extends BlockStateProvider {
 | 
			
		||||
    public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
 | 
			
		||||
        super(output, CompressedBlocks.MODID, exFileHelper);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void registerStatesAndModels() {
 | 
			
		||||
        blockWithItem(CompressedBlocks.COBBLESTONE_1X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.COBBLESTONE_2X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.COBBLESTONE_3X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.COBBLESTONE_4X);
 | 
			
		||||
 | 
			
		||||
        blockWithItem(CompressedBlocks.ANDESITE_1X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.ANDESITE_2X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.ANDESITE_3X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.ANDESITE_4X);
 | 
			
		||||
 | 
			
		||||
        blockWithItem(CompressedBlocks.DIORITE_1X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.DIORITE_2X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.DIORITE_3X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.DIORITE_4X);
 | 
			
		||||
 | 
			
		||||
        blockWithItem(CompressedBlocks.GRANITE_1X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.GRANITE_2X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.GRANITE_3X);
 | 
			
		||||
        blockWithItem(CompressedBlocks.GRANITE_4X);
 | 
			
		||||
 | 
			
		||||
        blockWithItem(CompressedBlocks.CBLOCK_MINING);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void blockWithItem(RegistryObject<Block> blockRegistryObject) {
 | 
			
		||||
        simpleBlockWithItem(blockRegistryObject.get(), cubeAll(blockRegistryObject.get()));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -66,4 +66,9 @@ public class ModItemModelProvider extends ItemModelProvider {
 | 
			
		||||
                new ResourceLocation("item/generated")).texture("layer0",
 | 
			
		||||
                new ResourceLocation(CompressedBlocks.MODID,"item/" + item.getId().getPath()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void evenSimplerBlockItem(RegistryObject<Block> block) {
 | 
			
		||||
        this.withExistingParent(CompressedBlocks.MODID + ":" + ForgeRegistries.BLOCKS.getKey(block.get()).getPath(),
 | 
			
		||||
                modLoc("block/" + ForgeRegistries.BLOCKS.getKey(block.get()).getPath()));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/andesite_1x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/andesite_2x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/andesite_3x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/andesite_4x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/cblock_mining"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/cobblestone_1x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/cobblestone_2x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/cobblestone_3x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/cobblestone_4x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/diorite_1x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/diorite_2x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/diorite_3x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/diorite_4x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/granite_1x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/granite_2x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/granite_3x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "variants": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "model": "compressedblocks:block/granite_4x"}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/andesite_1x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/andesite_2x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/andesite_3x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/andesite_4x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/cblock_mining"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/cobblestone_1x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/cobblestone_2x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/cobblestone_3x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/cobblestone_4x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/diorite_1x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/diorite_2x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/diorite_3x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/diorite_4x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/granite_1x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/granite_2x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/granite_3x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "minecraft:block/cube_all",
 | 
			
		||||
  "textures": {
 | 
			
		||||
    "all": "compressedblocks:block/granite_4x"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/andesite_1x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/andesite_2x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/andesite_3x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/andesite_4x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/cblock_mining"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/cobblestone_1x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/cobblestone_2x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/cobblestone_3x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/cobblestone_4x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/diorite_1x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/diorite_2x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/diorite_3x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/diorite_4x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/granite_1x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/granite_2x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/granite_3x"
 | 
			
		||||
}
 | 
			
		||||
@ -1,3 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "parent": "compressedblocks:block/granite_4x"
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user