Jump to content

winnetrie

Members
  • Posts

    408
  • Joined

  • Last visited

Posts posted by winnetrie

  1. 10 minutes ago, V0idWa1k3r said:

    Before the registry events fire, so in pre-init.

    Thank you! Good the know.

    I apologize for my ignorance, but sometimes a documentation is more difficult to understand without a real person explaining it in greater detail. Especially if English is not your main language.

    I'm very greatfull people like you take the time to do this.

  2. 10 minutes ago, V0idWa1k3r said:

    That is correct, but your event handler methods don't have to be static. Again, read the docs I have linked.

    Aha if i understand it right, i can register my eventhandler class with non static methods like this:

    MinecraftForge.EVENT_BUS.register(new ModRegistry());

    I guess this goes in the main class, but where exactly?

  3. 8 minutes ago, V0idWa1k3r said:

     

    This is also a false statement. Read the docs on events.

    That's very strange…..I was Always told you can't acces non-static methods without instantiating that class. Even java doc says this.

    I tried, just for fun, to remove the static keyword from the methods and exactly that happend what i expected…..nothing was registered.

     

    12 minutes ago, V0idWa1k3r said:

    static initializers != static fields. Initializer means you are instantinating something. If you just use a static field to store data between methods then it's not a static initializer.

    Oh yes ofcourse

  4. 4 minutes ago, diesieben07 said:

    You can use fields without static intializers...

    But the Eclipse shows me en error and suggest to make it static:

     

    Cannot make a static reference to the non-static field white_terracotta_bricks_halfslab

     

    Since i can't make my registry methods non-static (because you then need to create an instance of that class in order to acces those methods), i have to use static fields.

    Or do i miss something?

     

  5. 8 hours ago, diesieben07 said:

    Use local variables if you need to re-use a Block instance later in the method.

    But then i have to use static initializers again. I can't use local variables in another method, and i need some references to the blocks who are inside the blockregistry method and use them in the itemregistry method to register the itemBlock

     

    Or are in this case static initializers ok to use?

  6. As i'm using the proper methods to register blocks and items, i have a hard time to figure out how to register slabs now.

    Because i have nothing to point to (no fields) and ForgeRegistries.BLOCKS.getValue() returns an AIR block sometimes.

    There is alot of stuff that goes wrong. i'll attach my latest log. I have also lots of model loading errors. Saying the file is not found, but it is and i spelled it right.

    This is my registering class:

    Spoiler
    
    @EventBusSubscriber
    public class ModRegistry {
    	
    	
    	@SubscribeEvent
    	public static void onItemRegister(RegistryEvent.Register<Item> event) {
    		
    		System.out.println("Registering all items from the ITEMS registrylist");
    		
    		//REGISTERING ALL ITEMBLOCKS
    		for (Block block : ForgeRegistries.BLOCKS.getValuesCollection()) {
    			if (block.getRegistryName().getResourceDomain().equals(References.MOD_ID) ) {
    
    			    event.getRegistry().register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
    			}
    		}
    		
    		
    		//REGISTERING ALL ITEMS
    		event.getRegistry().registerAll(
    				
    		//adding stained clayballs
    		new ItemClayBall("white_stained_clayball"),
    		new ItemClayBall("orange_stained_clayball"),
    		new ItemClayBall("magenta_stained_clayball"),
    		new ItemClayBall("light_blue_stained_clayball"),
    		new ItemClayBall("yellow_stained_clayball"),
    		new ItemClayBall("lime_stained_clayball"),
    		new ItemClayBall("pink_stained_clayball"),
    		new ItemClayBall("gray_stained_clayball"),
    		new ItemClayBall("silver_stained_clayball"),
    		new ItemClayBall("cyan_stained_clayball"),
    		new ItemClayBall("purple_stained_clayball"),
    		new ItemClayBall("blue_stained_clayball"),
    		new ItemClayBall("brown_stained_clayball"),
    		new ItemClayBall("green_stained_clayball"),
    		new ItemClayBall("red_stained_clayball"),
    		new ItemClayBall("black_stained_clayball"),
    	
    		//adding colored terracotta brick
    		new ItemBrick("white_terracotta_brick"),
    		new ItemBrick("orange_terracotta_brick"),
    		new ItemBrick("magenta_terracotta_brick"),
    		new ItemBrick("light_blue_terracotta_brick"),
    		new ItemBrick("yellow_terracotta_brick"),
    		new ItemBrick("lime_terracotta_brick"),
    		new ItemBrick("pink_terracotta_brick"),
    		new ItemBrick("gray_terracotta_brick"),
    		new ItemBrick("silver_terracotta_brick"),
    		new ItemBrick("cyan_terracotta_brick"),
    		new ItemBrick("purple_terracotta_brick"),
    		new ItemBrick("blue_terracotta_brick"),
    		new ItemBrick("brown_terracotta_brick"),
    		new ItemBrick("green_terracotta_brick"),
    		new ItemBrick("red_terracotta_brick"),
    		new ItemBrick("black_terracotta_brick")
    		
    		);
    		
    		Block blockhalf = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(References.MOD_ID, "white_terracotta_bricks_halfslab"));
    		Block blockdouble = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(References.MOD_ID, "white_terracotta_bricks_doubleslab"));
    		
    		System.out.println("EERSTE BLOCK IS : " + blockhalf);
    		System.out.println("TWEEDE BLOCK IS : " + blockdouble);
    		
    		ItemBlock item = new ItemSlab(blockhalf, (BlockSlab)blockhalf, (BlockSlab)blockdouble);
    		item.setRegistryName(blockhalf.getRegistryName());
    		event.getRegistry().register(item);
    		System.out.println("ITEM WORD GEREGISTREERD MET NAAM: " + item.getRegistryName());
    	}
    	
    	@SubscribeEvent
    	public static void onBlockRegister(RegistryEvent.Register<Block> event) {
    		
    		System.out.println("Registering all blocks from the BLOCKS registrylist");
    		
    		//REGISTERING ALL BLOCKS
    		event.getRegistry().registerAll(
    		
    		//Creating terracotta bricks
    		new BlockTerracotta(Material.ROCK, MapColor.WHITE_STAINED_HARDENED_CLAY, "white_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.ORANGE_STAINED_HARDENED_CLAY, "orange_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.MAGENTA_STAINED_HARDENED_CLAY, "magenta_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.LIGHT_BLUE_STAINED_HARDENED_CLAY, "light_blue_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.YELLOW_STAINED_HARDENED_CLAY, "yellow_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.LIME_STAINED_HARDENED_CLAY, "lime_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.PINK_STAINED_HARDENED_CLAY, "pink_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.GRAY_STAINED_HARDENED_CLAY, "gray_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.SILVER_STAINED_HARDENED_CLAY, "silver_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.CYAN_STAINED_HARDENED_CLAY, "cyan_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.PURPLE_STAINED_HARDENED_CLAY, "purple_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.BLUE_STAINED_HARDENED_CLAY, "blue_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.BROWN_STAINED_HARDENED_CLAY, "brown_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.GREEN_STAINED_HARDENED_CLAY, "green_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.RED_STAINED_HARDENED_CLAY, "red_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.BLACK_STAINED_HARDENED_CLAY, "black_terracotta_bricks"),
    	    
    	    
    	    //Creating stained clay blocks
    	    new BlockStainedClay("white_stained_clayball", Material.CLAY, MapColor.WHITE_STAINED_HARDENED_CLAY, "white_stained_clay"),
    	    new BlockStainedClay("orange_stained_clayball", Material.CLAY, MapColor.ORANGE_STAINED_HARDENED_CLAY, "orange_stained_clay"),
    	    new BlockStainedClay("magenta_stained_clayball", Material.CLAY, MapColor.MAGENTA_STAINED_HARDENED_CLAY, "magenta_stained_clay"),
    	    new BlockStainedClay("light_blue_stained_clayball", Material.CLAY, MapColor.LIGHT_BLUE_STAINED_HARDENED_CLAY, "light_blue_stained_clay"),
    	    new BlockStainedClay("yellow_stained_clayball", Material.CLAY, MapColor.YELLOW_STAINED_HARDENED_CLAY, "yellow_stained_clay"),
    	    new BlockStainedClay("lime_stained_clayball", Material.CLAY, MapColor.LIME_STAINED_HARDENED_CLAY, "lime_stained_clay"),
    	    new BlockStainedClay("pink_stained_clayball", Material.CLAY, MapColor.PINK_STAINED_HARDENED_CLAY, "pink_stained_clay"),
    	    new BlockStainedClay("gray_stained_clayball", Material.CLAY, MapColor.GRAY_STAINED_HARDENED_CLAY, "gray_stained_clay"),
    	    new BlockStainedClay("silver_stained_clayball", Material.CLAY, MapColor.SILVER_STAINED_HARDENED_CLAY, "silver_stained_clay"),
    	    new BlockStainedClay("cyan_stained_clayball", Material.CLAY, MapColor.CYAN_STAINED_HARDENED_CLAY, "cyan_stained_clay"),
    	    new BlockStainedClay("purple_stained_clayball", Material.CLAY, MapColor.PURPLE_STAINED_HARDENED_CLAY, "purple_stained_clay"),
    	    new BlockStainedClay("blue_stained_clayball", Material.CLAY, MapColor.BLUE_STAINED_HARDENED_CLAY, "blue_stained_clay"),
    	    new BlockStainedClay("brown_stained_clayball", Material.CLAY, MapColor.BROWN_STAINED_HARDENED_CLAY, "brown_stained_clay"),
    	    new BlockStainedClay("green_stained_clayball", Material.CLAY, MapColor.GREEN_STAINED_HARDENED_CLAY, "green_stained_clay"),
    	    new BlockStainedClay("red_stained_clayball", Material.CLAY, MapColor.RED_STAINED_HARDENED_CLAY, "red_stained_clay"),
    	    new BlockStainedClay("black_stained_clayball", Material.CLAY, MapColor.BLACK_STAINED_HARDENED_CLAY, "black_stained_clay"),
    	    
    	    new BlockWinnetrieHalfSlab(new ResourceLocation(References.PREFIX + "white_terracotta_bricks"), References.PREFIX, "white_terracotta_bricks_halfslab"),
    	    new BlockWinnetrieDoubleSlab(new ResourceLocation(References.PREFIX + "white_terracotta_bricks"), References.PREFIX, "white_terracotta_bricks_doubleslab" )
    	    
    	    );	
    	}	
    }

     

    Here my slab class:

    Spoiler
    
    public abstract class BlockWinnetrieSlab extends BlockSlab{
    	
    	private Block parentBlock;
    	private static Material material = Material.CLOTH;
    	private static String registryName;
    	
    
    	public BlockWinnetrieSlab(ResourceLocation parentreference, String modprefix, String registryname) {
    		super(material);
    		parentBlock = ForgeRegistries.BLOCKS.getValue(parentreference);
    		registryName = modprefix + registryname;
    		setUnlocalizedName(parentBlock.getLocalizedName());
    		setRegistryName(modprefix + registryname);
    		
    		
    		//setSoundType(blockSound);
    		IBlockState state = this.blockState.getBaseState();
    
    		if (!this.isDouble()) {
    
    			state = state.withProperty(HALF, EnumBlockHalf.BOTTOM);
    
    		}
    
    		setDefaultState(state);
    		this.useNeighborBrightness = !this.isDouble();
    		
    		setCreativeTab(Utilities.WINNETRIETERRACOTTAEXPANSION);
    		// TODO Auto-generated constructor stub
    	}
    	
    	@Override
    	public SoundType getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity){
    		
            return parentBlock.getSoundType(state, world, pos, entity);
        }
    	
    	
    	@Override
        public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos)
        {
            return parentBlock.getBlockState().getBaseState().getBlockHardness(worldIn, pos);
        }
    	
    	@Override
        public Material getMaterial(IBlockState state)
        {
            return parentBlock.getBlockState().getBaseState().getMaterial();
        }
    
    	@Override
        public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos)
        {
            return parentBlock.getBlockState().getBaseState().getMapColor(worldIn, pos);
        }
    
    	@Override
    	public String getUnlocalizedName(int meta) {
    		
    		return this.getUnlocalizedName();
    	}
    
    
    	@Override
    	public IProperty<?> getVariantProperty() {
    
    		return HALF;
    	}
    
    	@Override
    	public Comparable<?> getTypeForItem(ItemStack stack) {
    		return EnumBlockHalf.BOTTOM;
    	}
    	
    	@Override
    	public int damageDropped(IBlockState state) {
    		
    		return 0;
    		
    	}
    	
    	
    	
        
        @Override
        protected BlockStateContainer createBlockState() {
    
    		return new BlockStateContainer(this, new IProperty[]{HALF}) ;
    
    	}
        
    	@Override
    	public int getMetaFromState(final IBlockState state) {
    
    		if (!this.isDouble()) {
    
    			return 0;
    
    		} 
    		return ((EnumBlockHalf)state.getValue(HALF)).ordinal() + 1;
    	}
    
    	@Override
    	public IBlockState getStateFromMeta(int meta) {
    
    		if (!this.isDouble()) {
    			
    			return this.getDefaultState().withProperty(HALF, EnumBlockHalf.values()[meta % EnumBlockHalf.values().length]);
    
    		}
    
    		return this.getDefaultState();
    
    	}
    	@Override
    	public Item getItemDropped(IBlockState state, Random rand, int fortune) {
    		
    		return Item.getItemFromBlock(ForgeRegistries.BLOCKS.getValue(new ResourceLocation(References.PREFIX + registryName)));///VERANDEREN HIER
    		
    	}
    	
    
    	public abstract Item getHalfSlabReference();
    	
    
    }

     

     

    latest.log

  7. Can we replace registered blocks/items with your own?

    For example if i want to replace minecraft:stone with my modded stone, wich would in fact delete the  original block.

    That brings also the next question. Can we delete a registered block from the registry?

    I assume that could bring a lot of issues, especially if other classes depends on the original block.

    I guess mods that use static fields to instantiate their stuff won't be compatible.

     

    In the past days i have come up with alot of neat ideas, but that would require to replace some blocks and items from vanilla and maybe other mods too.

    Are we even allowed to do this?

  8. 1 minute ago, diesieben07 said:

    Is blockSound a field here?

    yes a private field.

    1 minute ago, diesieben07 said:

    You do not "set" the sound. The sound is determined by whatever is returned from getSoundType. If you return your parent block's getSoundType result you effectively copy it's behavior.

    Oh..? Really? I didn't knew that. I Always thought i need to get it and then set it also.

    Does this rule also apply for getblockhardness?

    Wait i post the class:

    public abstract class BlockTerracottaSlab extends BlockSlab{
    	
    	private Block parentBlock;
    	private SoundType blockSound;
    
    	public BlockTerracottaSlab(Material material, MapColor mapcolor, String modprefix, String registryname) {
    		super(material, mapcolor);
    		
    		parentBlock = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(modprefix + registryname));
    		//setSoundType(blockSound);
    		setRegistryName(modprefix + registryname);
    		setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
    		// TODO Auto-generated constructor stub
    	}
    	
    	@Override
    	public SoundType getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity){
    		
    		blockSound = parentBlock.getSoundType(state, world, pos, entity);
            return blockSound;
        }
    	
    	
    	@Override
        public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos)
        {
            return parentBlock.getBlockState().getBaseState().getBlockHardness(worldIn, pos);
        }
    
    	@Override
    	public String getUnlocalizedName(int meta) {
    		// TODO Auto-generated method stub
    		return parentBlock.getUnlocalizedName();
    	}
    
    	@Override
    	public boolean isDouble() {
    		// TODO Auto-generated method stub
    		return false;
    	}
    
    	@Override
    	public IProperty<?> getVariantProperty() {
    		// TODO Auto-generated method stub
    		return BlockSlab.HALF;
    	}
    
    	@Override
    	public Comparable<?> getTypeForItem(ItemStack stack) {
    		// TODO Auto-generated method stub
    		return EnumBlockHalf.BOTTOM;
    	}
    	
    	@SideOnly(Side.CLIENT)
        protected static boolean isHalfSlab(IBlockState state)
        {
            Block block = state.getBlock();
            return block instanceof BlockSlab;
        }
    	
    	public static class Double extends BlockTerracottaSlab {
    
    		public Double(Material material, MapColor mapcolor, String modprefix, String registryname) {
    			super(material, mapcolor, modprefix, registryname);
    			// TODO Auto-generated constructor stub
    		}
    
    		@Override
    		public boolean isDouble() {
    			return true;
    
    		}
    	}
    
    	public static class Half extends BlockTerracottaSlab {
    
    		public Half(Material material, MapColor mapcolor, String modprefix, String registryname) {
    			super(material, mapcolor, modprefix, registryname);
    			// TODO Auto-generated constructor stub
    		}
    
    		@Override
    		public boolean isDouble() {
    			return false;
    
    		}
    	}
    
    }

    please tell me if something isn't right.

  9. 23 minutes ago, diesieben07 said:

    Override the respective methods in your slab class and delegate to their versions in the original block.

    Like this? :

    @Override
    	public SoundType getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity){
    		
    		blockSound = parentBlock.getSoundType(state, world, pos, entity);
    		
            return blockSound;
        }

    How would i set the slabs soundtype to this sound now?

  10. How would i get the soundType from a block.

     

    Right now i have this:

    parentBlock = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(modprefix + registryname));
    setSoundType(parentBlock.getSoundType());

    but getSoundType()  is deprecated.

    There is also this:

    getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity)

    But i do not understand to use this. Why do i need World, BlockPos and Entity here ?

    World, BlockPos and Entity are not relevant.

    I need the soundtype from the parentblock, but not parentblock that is already somewhere in the world.

    EDIT: Same thing for getBlockHardness btw

  11. 14 minutes ago, diesieben07 said:

    A minor thing: In your Utilities class you can use the ResourceLocation constructor that takes 2 String instead of constructing it with concatenation. 

     

    And start using json recipes.

    Oh, alright. I'll change it later. Going to sleep now.

     

    I am using .json recipes for crafting btw. Can we also do that with smelting recipes? 

    EDIT: Sorry, but i can't find anything about json smelting recipes for 1.12.2.

    Even in the minecraft recipe folder, there is none to find.

  12. Alright i'm done rewriting the code. Result looks like this:

    ModRegistry class:

    Spoiler
    
    @EventBusSubscriber
    public class ModRegistry {
    	
    	
    	@SubscribeEvent
    	public static void onItemRegister(RegistryEvent.Register<Item> event) {
    		
    		System.out.println("Registering all items from the ITEMS registrylist");
    		
    		//REGISTERING ALL ITEMBLOCKS
    		for (Block block : ForgeRegistries.BLOCKS.getValuesCollection()) {
    			if (block.getRegistryName().getResourceDomain().equals(References.MOD_ID)) {
    
    			    event.getRegistry().register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
    			}
    		}
    		
    		
    		//REGISTERING ALL ITEMS
    		event.getRegistry().registerAll(
    				
    		//adding stained clayballs
    		new ItemClayBall("white_stained_clayball"),
    		new ItemClayBall("orange_stained_clayball"),
    		new ItemClayBall("magenta_stained_clayball"),
    		new ItemClayBall("light_blue_stained_clayball"),
    		new ItemClayBall("yellow_stained_clayball"),
    		new ItemClayBall("lime_stained_clayball"),
    		new ItemClayBall("pink_stained_clayball"),
    		new ItemClayBall("gray_stained_clayball"),
    		new ItemClayBall("silver_stained_clayball"),
    		new ItemClayBall("cyan_stained_clayball"),
    		new ItemClayBall("purple_stained_clayball"),
    		new ItemClayBall("blue_stained_clayball"),
    		new ItemClayBall("brown_stained_clayball"),
    		new ItemClayBall("green_stained_clayball"),
    		new ItemClayBall("red_stained_clayball"),
    		new ItemClayBall("black_stained_clayball"),
    	
    		//adding colored terracotta brick
    		new ItemBrick("white_terracotta_brick"),
    		new ItemBrick("orange_terracotta_brick"),
    		new ItemBrick("magenta_terracotta_brick"),
    		new ItemBrick("light_blue_terracotta_brick"),
    		new ItemBrick("yellow_terracotta_brick"),
    		new ItemBrick("lime_terracotta_brick"),
    		new ItemBrick("pink_terracotta_brick"),
    		new ItemBrick("gray_terracotta_brick"),
    		new ItemBrick("silver_terracotta_brick"),
    		new ItemBrick("cyan_terracotta_brick"),
    		new ItemBrick("purple_terracotta_brick"),
    		new ItemBrick("blue_terracotta_brick"),
    		new ItemBrick("brown_terracotta_brick"),
    		new ItemBrick("green_terracotta_brick"),
    		new ItemBrick("red_terracotta_brick"),
    		new ItemBrick("black_terracotta_brick")
    		);
    	}
    	
    	@SubscribeEvent
    	public static void onBlockRegister(RegistryEvent.Register<Block> event) {
    		
    		System.out.println("Registering all blocks from the BLOCKS registrylist");
    		
    		//REGISTERING ALL BLOCKS
    		event.getRegistry().registerAll(
    		
    		//Creating terracotta bricks
    		new BlockTerracotta(Material.ROCK, MapColor.WHITE_STAINED_HARDENED_CLAY, "white_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.ORANGE_STAINED_HARDENED_CLAY, "orange_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.MAGENTA_STAINED_HARDENED_CLAY, "magenta_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.LIGHT_BLUE_STAINED_HARDENED_CLAY, "light_blue_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.YELLOW_STAINED_HARDENED_CLAY, "yellow_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.LIME_STAINED_HARDENED_CLAY, "lime_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.PINK_STAINED_HARDENED_CLAY, "pink_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.GRAY_STAINED_HARDENED_CLAY, "gray_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.SILVER_STAINED_HARDENED_CLAY, "silver_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.CYAN_STAINED_HARDENED_CLAY, "cyan_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.PURPLE_STAINED_HARDENED_CLAY, "purple_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.BLUE_STAINED_HARDENED_CLAY, "blue_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.BROWN_STAINED_HARDENED_CLAY, "brown_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.GREEN_STAINED_HARDENED_CLAY, "green_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.RED_STAINED_HARDENED_CLAY, "red_terracotta_bricks"),
    	    new BlockTerracotta(Material.ROCK, MapColor.BLACK_STAINED_HARDENED_CLAY, "black_terracotta_bricks"),
    	    
    	    
    	    //Creating stained clay blocks
    	    new BlockStainedClay("white_stained_clayball", Material.CLAY, MapColor.WHITE_STAINED_HARDENED_CLAY, "white_stained_clay"),
    	    new BlockStainedClay("orange_stained_clayball", Material.CLAY, MapColor.ORANGE_STAINED_HARDENED_CLAY, "orange_stained_clay"),
    	    new BlockStainedClay("magenta_stained_clayball", Material.CLAY, MapColor.MAGENTA_STAINED_HARDENED_CLAY, "magenta_stained_clay"),
    	    new BlockStainedClay("light_blue_stained_clayball", Material.CLAY, MapColor.LIGHT_BLUE_STAINED_HARDENED_CLAY, "light_blue_stained_clay"),
    	    new BlockStainedClay("yellow_stained_clayball", Material.CLAY, MapColor.YELLOW_STAINED_HARDENED_CLAY, "yellow_stained_clay"),
    	    new BlockStainedClay("lime_stained_clayball", Material.CLAY, MapColor.LIME_STAINED_HARDENED_CLAY, "lime_stained_clay"),
    	    new BlockStainedClay("pink_stained_clayball", Material.CLAY, MapColor.PINK_STAINED_HARDENED_CLAY, "pink_stained_clay"),
    	    new BlockStainedClay("gray_stained_clayball", Material.CLAY, MapColor.GRAY_STAINED_HARDENED_CLAY, "gray_stained_clay"),
    	    new BlockStainedClay("silver_stained_clayball", Material.CLAY, MapColor.SILVER_STAINED_HARDENED_CLAY, "silver_stained_clay"),
    	    new BlockStainedClay("cyan_stained_clayball", Material.CLAY, MapColor.CYAN_STAINED_HARDENED_CLAY, "cyan_stained_clay"),
    	    new BlockStainedClay("purple_stained_clayball", Material.CLAY, MapColor.PURPLE_STAINED_HARDENED_CLAY, "purple_stained_clay"),
    	    new BlockStainedClay("blue_stained_clayball", Material.CLAY, MapColor.BLUE_STAINED_HARDENED_CLAY, "blue_stained_clay"),
    	    new BlockStainedClay("brown_stained_clayball", Material.CLAY, MapColor.BROWN_STAINED_HARDENED_CLAY, "brown_stained_clay"),
    	    new BlockStainedClay("green_stained_clayball", Material.CLAY, MapColor.GREEN_STAINED_HARDENED_CLAY, "green_stained_clay"),
    	    new BlockStainedClay("red_stained_clayball", Material.CLAY, MapColor.RED_STAINED_HARDENED_CLAY, "red_stained_clay"),
    	    new BlockStainedClay("black_stained_clayball", Material.CLAY, MapColor.BLACK_STAINED_HARDENED_CLAY, "black_stained_clay")
    	    
    	    );
    		
    		
    	}
    	
    	
    }

     

    ClientProxy class:

    Spoiler
    
    @EventBusSubscriber
    public class ClientProxy implements IProxy{
    	
    	private static final String DEFAULT_VARIANT = "inventory";
    
    	@SubscribeEvent
    	public static void onModelRegister(ModelRegistryEvent event) {
    		
    		for (Item item : ForgeRegistries.ITEMS.getValuesCollection()) {
    			if (item.getRegistryName().getResourceDomain().equals(References.MOD_ID)) {
    				registerItemModel(item);
    			}
    		}
    		
    		for (Block block : ForgeRegistries.BLOCKS.getValuesCollection()) {
    			if (block.getRegistryName().getResourceDomain().equals(References.MOD_ID)) {
    				registerBlockModel(block);
    			}
    		}
    		
    	}
    	
    	@Override
    	public void PreInit(FMLPreInitializationEvent event) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public void Init(FMLInitializationEvent event) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public void PostInit(FMLPostInitializationEvent event) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public void ServerStarting(FMLServerStartingEvent event) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	public static void registerItemModel(Item item) {
    		
    		ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), DEFAULT_VARIANT));
    		
    	}
        public static void registerBlockModel(Block block) {
    		
    		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), DEFAULT_VARIANT));
    		
    	}
    
    }

     

     

    BlockStainedClay class:

    Spoiler
    
    public class BlockStainedClay extends Block{
    	
    	public String itemdrop;
    
    	public BlockStainedClay(String string, Material blockMaterialIn, MapColor blockMapColorIn, String name) {
    		super(blockMaterialIn, blockMapColorIn);
    		
    		itemdrop = string;
    		setHardness(0.1F);
    		setSoundType(SoundType.GROUND);
    		setUnlocalizedName(name);
    		setRegistryName(References.PREFIX + name);
    		setCreativeTab(CreativeTabs.BUILDING_BLOCKS);	
    		
    	}
    	@Override
    	public Item getItemDropped(IBlockState state, Random rand, int fortune)
        {
    		
            return ForgeRegistries.ITEMS.getValue(new ResourceLocation(References.PREFIX + itemdrop));
        }
    
        @Override
        public int quantityDropped(Random random)
        {
            return 4;
        }
    
    }

     

    ModRecipes class: 

    Spoiler
    
    public class ModRecipes {
    	
    	public static void init() {
    		
    		GameRegistry.addSmelting(Utilities.getItem("white_stained_clayball"), new ItemStack(Utilities.getItem("white_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("orange_stained_clayball"), new ItemStack(Utilities.getItem("orange_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("magenta_stained_clayball"), new ItemStack(Utilities.getItem("magenta_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("light_blue_stained_clayball"), new ItemStack(Utilities.getItem("light_blue_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("yellow_stained_clayball"), new ItemStack(Utilities.getItem("yellow_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("lime_stained_clayball"), new ItemStack(Utilities.getItem("lime_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("pink_stained_clayball"), new ItemStack(Utilities.getItem("pink_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("gray_stained_clayball"), new ItemStack(Utilities.getItem("gray_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("silver_stained_clayball"), new ItemStack(Utilities.getItem("silver_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("cyan_stained_clayball"), new ItemStack(Utilities.getItem("cyan_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("purple_stained_clayball"), new ItemStack(Utilities.getItem("_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("blue_stained_clayball"), new ItemStack(Utilities.getItem("_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("brown_stained_clayball"), new ItemStack(Utilities.getItem("_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("green_stained_clayball"), new ItemStack(Utilities.getItem("_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("red_stained_clayball"), new ItemStack(Utilities.getItem("_terracotta_brick"), 1), 0.3F);
    		GameRegistry.addSmelting(Utilities.getItem("black_stained_clayball"), new ItemStack(Utilities.getItem("_terracotta_brick"), 1), 0.3F);
    		
    		
    		GameRegistry.addSmelting(Utilities.getBlock("white_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 0), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("orange_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 1), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("magenta_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 2), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("light_blue_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 3), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("yellow_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 4), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("lime_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 5), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("pink_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 6), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("gray_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 7), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("silver_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 8), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("cyan_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 9), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("purple_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 10), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("blue_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 11), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("brown_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 12), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("green_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 13), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("red_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 14), 0.35F);
    		GameRegistry.addSmelting(Utilities.getBlock("black_stained_clay"), new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 15), 0.35F);
    		
    	}
    
    }

     

    And also a Utilities class:

    Spoiler
    
    public class Utilities {
    	
    public static Block getBlock(String string) {
    		
    		ResourceLocation resourcelocation = new ResourceLocation(References.MOD_ID + ":" + string);
    		return ForgeRegistries.BLOCKS.getValue(resourcelocation);
    		
    	}
        public static Item getItem(String string) {
        	
        	ResourceLocation resourcelocation = new ResourceLocation(References.MOD_ID + ":" + string);
        	return ForgeRegistries.ITEMS.getValue(resourcelocation);
    	}
    
    }

     

    Can i improve this more or is this a good starting template?

  13. 1 minute ago, diesieben07 said:

    Oh, if only there was a data structure that kept track of registered things... You know, some kind of, i don't know, Registry, maybe?

    Yes ….haha i know, that's why i said this: 

     

    34 minutes ago, winnetrie said:

    Meh….That sounds stupid when i read it again ?

     

    Ow yes i could loop trough the registry and look for blocks with my modid, then register the itemblock for it...ofcourse.

    Thank you

  14. Yes i know i can do this as simple as your example.

    Main reason was to have clean code, but it takes as much as space like the simple way.

    On the other hand, having all blocks and items stored in a list can be usefull some day.

    Meh….That sounds stupid when i read it again ?

    I guess i just wanted to make it fancy, but you are so right about this.

     

    EDIT: It does takes less space to register blocks and itemblocks. both are  done in 1 method, So registering block and it's itemblock takes only 1 line instead of 2 lines each time.

    Or can this be done otherwise?

  15. Alright this is absolutely not working, because the subscribe event triggers before the ModBlocks.init();

    So i changed my class to this:

    @EventBusSubscriber
    public class ModBlocks {
    	
    	public static final List<Block> BLOCKS = new ArrayList<Block>();
    	public static final List<ItemBlock> ITEMBLOCKS = new ArrayList<ItemBlock>();
    	
    	
    	public static void addBlockToRegistryList(Block block) {
    		
    		BLOCKS.add(block);
    		ITEMBLOCKS.add((ItemBlock) new ItemBlock(block).setRegistryName(block.getRegistryName()));
    		
    		System.out.println(block.getRegistryName() + "has been registered");
    		
    	}
    	
    	@SubscribeEvent
    	public static void onBlockRegister(RegistryEvent.Register<Block> event) {
    		
    		addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.WHITE_STAINED_HARDENED_CLAY, "white_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.ORANGE_STAINED_HARDENED_CLAY, "orange_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.MAGENTA_STAINED_HARDENED_CLAY, "magenta_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.LIGHT_BLUE_STAINED_HARDENED_CLAY, "light_blue_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.YELLOW_STAINED_HARDENED_CLAY, "yellow_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.LIME_STAINED_HARDENED_CLAY, "lime_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.PINK_STAINED_HARDENED_CLAY, "pink_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.GRAY_STAINED_HARDENED_CLAY, "gray_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.SILVER_STAINED_HARDENED_CLAY, "silver_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.CYAN_STAINED_HARDENED_CLAY, "cyan_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.PURPLE_STAINED_HARDENED_CLAY, "purple_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.BLUE_STAINED_HARDENED_CLAY, "blue_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.BROWN_STAINED_HARDENED_CLAY, "brown_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.GREEN_STAINED_HARDENED_CLAY, "green_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.RED_STAINED_HARDENED_CLAY, "red_terracotta_bricks"));
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.BLACK_STAINED_HARDENED_CLAY, "black_terracotta_bricks"));
    		
    		
    		event.getRegistry().registerAll(ModBlocks.BLOCKS.toArray(new Block[0]));
    		
    	}
    	
    	@SubscribeEvent
    	public static void registerItemBlocks(RegistryEvent.Register<Item> event) {
    
    		event.getRegistry().registerAll(ModBlocks.ITEMBLOCKS.toArray(new ItemBlock[0]));
    		
    	}
    
    }

    This is working fine, but i'm not sure putting the addBlockToRegistryList inside the onBlockRegister is the correct place.

    It had to be within a subscribe event or it won't work.

    So i was wondering if there is a subscribevent where i can put it?

     

  16. Because i have been told not to use static initializers, i have come up with an other approach to register my stuff.

    I'm wondering if this is a good 1?

     

    So i have a ModBlocks class that has 2 methods: 1 for adding my blocks to a list and the other to iniatilize that

    It looks like this:

    public class ModBlocks {
    	
    	public static final List<Block> BLOCKS = new ArrayList<Block>();
    	public static final List<ItemBlock> ITEMBLOCKS = new ArrayList<ItemBlock>();
    	
    	
    	
    	public static void addBlockToRegistryList(Block block) {
    		
    		BLOCKS.add(block);
    		ITEMBLOCKS.add((ItemBlock) new ItemBlock(block).setRegistryName(block.getRegistryName()));
    		
    	}
    	public static void init() {
    	    addBlockToRegistryList(new BlockTerracotta(Material.ROCK, MapColor.WHITE_STAINED_HARDENED_CLAY, "white_terracotta_bricks"));
    	    
    }

    Then i have a RegistryHandler class:

    @EventBusSubscriber
    public class RegistryHandler {
    	
    	@SubscribeEvent
    	public static void onItemRegister(RegistryEvent.Register<Item> event) {
    		
    		event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
    	}
    	
    	@SubscribeEvent
    	public static void onBlockRegister(RegistryEvent.Register<Block> event) {
    		
    		event.getRegistry().registerAll(ModBlocks.BLOCKS.toArray(new Block[0]));
    	}
    	
    	@SubscribeEvent
    
    	public static void registerItemBlocks(RegistryEvent.Register<Item> event) {
    
    		event.getRegistry().registerAll(ModBlocks.ITEMBLOCKS.toArray(new ItemBlock[0]));
    
    	}
    
    }

    And my ClientProxy:

    @EventBusSubscriber
    public class ClientProxy implements IProxy{
    	
    	private static final String DEFAULT_VARIANT = "inventory";
    
    	
    
    	@SubscribeEvent
    	public static void onModelRegister(ModelRegistryEvent event) {
    		
    		for (Item item : ModItems.ITEMS) {
    			
    			registerItemModel(item);
    		}
    		
    		for (Block block : ModBlocks.BLOCKS) {
    			
    			registerBlockModel(block);
    		}
    		
    		
    	}
    	
    	@Override
    	public void PreInit(FMLPreInitializationEvent event) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public void Init(FMLInitializationEvent event) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public void PostInit(FMLPostInitializationEvent event) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public void ServerStarting(FMLServerStartingEvent event) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	public static void registerItemModel(Item item) {
    		
    		ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), DEFAULT_VARIANT));
    		
    	}
        public static void registerBlockModel(Block block) {
    		
    		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), DEFAULT_VARIANT));
    		
    	}
    
    }

    and my main class:

    @Mod(modid = References.MOD_ID, name = References.NAME, version = References.VERSION)
    public class Wtemod {
    	
    	@Instance
    	public static Wtemod instance;
    	
    	@SidedProxy(clientSide = References.CLIENT_PROXY_CLASS, serverSide = References.SERVER_PROXY_CLASS)
    	public static IProxy proxy;
    	
    	@EventHandler
    	public void PreInit(FMLPreInitializationEvent event)
    	{
    		//entities & networking
    	}
    	
    	@EventHandler
    	public void Init(FMLInitializationEvent event)
    	{
    		//registry events
    		ModBlocks.init();
    		ModRecipes.init();
    	}
    	
    	@EventHandler
    	public void PostInit(FMLPostInitializationEvent event)
    	{
    		//inter-mod stuff
    	}
    	@EventHandler
        public void serverStarting(FMLServerStartingEvent event)
        {
    		//server commands registering
        }
    
    	
    }

     

  17. 11 hours ago, Draco18s said:

    Inside the registry event.

    So does that mean i do not need to create fields for my blocks. because we just use the registry to get the blocks/items?

     

    I do add my blocks to a list inside their class like this:

    ModBlocks.BLOCKS.add(this);

    The list is in another class called ModBlocks and looks like this:

    public static final List<Block> BLOCKS = new ArrayList<Block>();

    So i guess i can't use that anymore.

    Perhaps it was a bad concept anyway.

  18. 7 hours ago, DavidM said:

    He meant that if you extends BlockBase, you cannot extends other actually useful classes like BlockStairs or something.

    Composition over inheritance; do not use inheritance for writing less code at the cost of potentially messing up the entire structure of your code.

    Oh i see, but i usually create a BlockBaseStair in that case and then use that to extends all my stairs..

    Well, but then again you are right about it. It only has a few extra lines of code.

    I removed that class now.

  19. Well if i shouldn't use static initializers, how do i do it right then?

    My BlockBase class extends on Block, so there shouldn't be an issue for instanceof Block, because it is.

    If i can't make my own class that extends on Block, then i have no clue how i would add and override stuff....

     

     

    I'll try with a resourcelocation in the constructor.

     

    Sorry no github, i have an account there but don't know how to use it

  20. 3 minutes ago, V0idWa1k3r said:

    What material are you passing to the block and what are you mining the block with? Consider that if the block is not mined by the correct tool and the tool is required to mine it then it will take a while to break it.

    I'm passing Material.CLAY and i'm mining it with the shovel. It should behave like the minecraft clayblock.

    The minecraft clayblock has it's hardness set to 0.6, i have to set it to 0.1 to get the same result.

     

    Can you explaine more about "BlockBase is an antipattern"?

     

    How would i pass the correct item to this method?

    public Item getItemDropped(IBlockState state, Random rand, int fortune)
        {
            return itemdrop;
        }

    I can't directly say what item it has to be, because i use the same class to create 16 different blocks and they all need a different itemdrop.

    Yes i use static initializers. My class looks like this:

    public class ModBlocks {
    	
    	public static final List<Block> BLOCKS = new ArrayList<Block>();
    	public static final List<ItemBlock> ITEMBLOCKS = new ArrayList<ItemBlock>();
    	
    	//Creating terracotta bricks
    	public static final Block WHITE_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.WHITE_STAINED_HARDENED_CLAY, "white_terracotta_bricks");
    	public static final Block ORANGE_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.ORANGE_STAINED_HARDENED_CLAY, "orange_terracotta_bricks");
    	public static final Block MAGENTA_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.MAGENTA_STAINED_HARDENED_CLAY, "magenta_terracotta_bricks");
    	public static final Block LIGHT_BLUE_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.LIGHT_BLUE_STAINED_HARDENED_CLAY, "light_blue_terracotta_bricks");
    	public static final Block YELLOW_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.YELLOW_STAINED_HARDENED_CLAY, "yellow_terracotta_bricks");
    	public static final Block LIME_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.LIME_STAINED_HARDENED_CLAY, "lime_terracotta_bricks");
    	public static final Block PINK_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.PINK_STAINED_HARDENED_CLAY, "pink_terracotta_bricks");
    	public static final Block GRAY_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.GRAY_STAINED_HARDENED_CLAY, "gray_terracotta_bricks");
    	public static final Block SILVER_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.SILVER_STAINED_HARDENED_CLAY, "silver_terracotta_bricks");
    	public static final Block CYAN_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.CYAN_STAINED_HARDENED_CLAY, "cyan_terracotta_bricks");
    	public static final Block PURPLE_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.PURPLE_STAINED_HARDENED_CLAY, "purple_terracotta_bricks");
    	public static final Block BLUE_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.BLUE_STAINED_HARDENED_CLAY, "blue_terracotta_bricks");
    	public static final Block BROWN_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.BROWN_STAINED_HARDENED_CLAY, "brown_terracotta_bricks");
    	public static final Block GREEN_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.GREEN_STAINED_HARDENED_CLAY, "green_terracotta_bricks");
    	public static final Block RED_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.RED_STAINED_HARDENED_CLAY, "red_terracotta_bricks");
    	public static final Block BLACK_TERRACOTTA_BRICKS = new BlockTerracotta(Material.ROCK, MapColor.BLACK_STAINED_HARDENED_CLAY, "black_terracotta_bricks");
    	
    	
    	
    	//Creating stained clay blocks
    	public static final Block WHITE_STAINED_CLAY = new BlockStainedClay(ModItems.WHITE_STAINED_CLAYBALL, Material.CLAY, MapColor.WHITE_STAINED_HARDENED_CLAY, "white_stained_clay");
    	public static final Block ORANGE_STAINED_CLAY = new BlockStainedClay(ModItems.ORANGE_STAINED_CLAYBALL, Material.CLAY, MapColor.ORANGE_STAINED_HARDENED_CLAY, "orange_stained_clay");
    	public static final Block MAGENTA_STAINED_CLAY = new BlockStainedClay(ModItems.MAGENTA_STAINED_CLAYBALL, Material.CLAY, MapColor.MAGENTA_STAINED_HARDENED_CLAY, "magenta_stained_clay");
    	public static final Block LIGHT_BLUE_STAINED_CLAY = new BlockStainedClay(ModItems.LIGHT_BLUE_STAINED_CLAYBALL, Material.CLAY, MapColor.LIGHT_BLUE_STAINED_HARDENED_CLAY, "light_blue_stained_clay");
    	public static final Block YELLOW_STAINED_CLAY = new BlockStainedClay(ModItems.YELLOW_STAINED_CLAYBALL, Material.CLAY, MapColor.YELLOW_STAINED_HARDENED_CLAY, "yellow_stained_clay");
    	public static final Block LIME_STAINED_CLAY = new BlockStainedClay(ModItems.LIME_STAINED_CLAYBALL, Material.CLAY, MapColor.LIME_STAINED_HARDENED_CLAY, "lime_stained_clay");
    	public static final Block PINK_STAINED_CLAY = new BlockStainedClay(ModItems.PINK_STAINED_CLAYBALL, Material.CLAY, MapColor.PINK_STAINED_HARDENED_CLAY, "pink_stained_clay");
    	public static final Block GRAY_STAINED_CLAY = new BlockStainedClay(ModItems.GRAY_STAINED_CLAYBALL, Material.CLAY, MapColor.GRAY_STAINED_HARDENED_CLAY, "gray_stained_clay");
    	public static final Block SILVER_STAINED_CLAY = new BlockStainedClay(ModItems.SILVER_STAINED_CLAYBALL, Material.CLAY, MapColor.SILVER_STAINED_HARDENED_CLAY, "silver_stained_clay");
    	public static final Block CYAN_STAINED_CLAY = new BlockStainedClay(ModItems.CYAN_STAINED_CLAYBALL, Material.CLAY, MapColor.CYAN_STAINED_HARDENED_CLAY, "cyan_stained_clay");
    	public static final Block PURPLE_STAINED_CLAY = new BlockStainedClay(ModItems.PURPLE_STAINED_CLAYBALL, Material.CLAY, MapColor.PURPLE_STAINED_HARDENED_CLAY, "purple_stained_clay");
    	public static final Block BLUE_STAINED_CLAY = new BlockStainedClay(ModItems.BLUE_STAINED_CLAYBALL, Material.CLAY, MapColor.BLUE_STAINED_HARDENED_CLAY, "blue_stained_clay");
    	public static final Block BROWN_STAINED_CLAY = new BlockStainedClay(ModItems.BROWN_STAINED_CLAYBALL, Material.CLAY, MapColor.BROWN_STAINED_HARDENED_CLAY, "brown_stained_clay");
    	public static final Block GREEN_STAINED_CLAY = new BlockStainedClay(ModItems.GREEN_STAINED_CLAYBALL, Material.CLAY, MapColor.GREEN_STAINED_HARDENED_CLAY, "green_stained_clay");
    	public static final Block RED_STAINED_CLAY = new BlockStainedClay(ModItems.RED_STAINED_CLAYBALL, Material.CLAY, MapColor.RED_STAINED_HARDENED_CLAY, "red_stained_clay");
    	public static final Block BLACK_STAINED_CLAY = new BlockStainedClay(ModItems.BLACK_STAINED_CLAYBALL, Material.CLAY, MapColor.BLACK_STAINED_HARDENED_CLAY, "black_stained_clay");
    }

    So that's not how it supposed to be? I'm a bit confused now.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.