Jump to content

[1.8]Issue while modding a Slab


JbJoe

Recommended Posts

Hi guys !

 

this is my very first post here and i have some diffilcuties to create slab, especially with this :

 

package mod.jbjoe.dcojoe.init;

import mod.jbjoe.dcojoe.block.BlockTuile;
import mod.jbjoe.dcojoe.block.BlockTuileSlab;
import mod.jbjoe.dcojoe.block.BlockTuileStairs;
import mod.jbjoe.dcojoe.reference.Names;
import mod.jbjoe.dcojoe.reference.Reference;
import mod.jbjoe.dcojoe.reference.Settings;
import net.minecraftforge.fml.common.registry.GameRegistry;

@GameRegistry.ObjectHolder(Reference.MOD_ID)
public class ModBlocks
{
    public static final BlockTuile block_tuile = new BlockTuile();
    public static final BlockTuileSlab block_tuile_slab = new BlockTuileSlab();
    public static final BlockTuileStairs block_tuile_stairs = new BlockTuileStairs();

    public static void init()
    {
        if (Settings.General.enableModBlocks)
        {
            GameRegistry.registerBlock(block_tuile, Names.Blocks.TUILE);
            GameRegistry.registerBlock(block_tuile_slab, Names.Blocks.TUILE_SLAB);
            GameRegistry.registerBlock(block_tuile_stairs, Names.Blocks.TUILE_STAIRS);
        }
    }
}

 

I got the error at new BlockTuileSlab

 

public static final BlockTuileSlab block_tuile_slab = new BlockTuileSlab();

 

eclispe says "Cannot instantiate the type BlockTuileSlab"

 

here is the code of the class of the slab :

 

package mod.jbjoe.dcojoe.block;

import java.util.List;
import java.util.Random;

import mod.jbjoe.dcojoe.reference.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IStringSerializable;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public abstract class BlockSlabEM extends BlockSlab
{
    public static final PropertyEnum HALF_PROP = PropertyEnum.create("half", BlockSlab.EnumBlockHalf.class);
    private static final String __OBFID = "CL_00000253";
    
        public BlockSlabEM(Material material)
        {
            super(material);
        }
        
        public BlockSlabEM()
        {
            this(Material.rock);
        }
        @Override
        public String getUnlocalizedName()
        {
            return String.format("tile.%s%s", Reference.MOD_ID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
        }

        protected String getUnwrappedUnlocalizedName(String unlocalizedName)
        {
            return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1);
        }
        
}

 

Here is BlockSlabEM (the extends of the BlockTuileSlab)

 

package mod.jbjoe.dcojoe.block;

import java.util.List;
import java.util.Random;

import mod.jbjoe.dcojoe.reference.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IStringSerializable;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public abstract class BlockSlabEM extends BlockSlab
{
    public static final PropertyEnum HALF_PROP = PropertyEnum.create("half", BlockSlab.EnumBlockHalf.class);
    private static final String __OBFID = "CL_00000253";
    
        public BlockSlabEM(Material material)
        {
            super(material);
        }
        
        public BlockSlabEM()
        {
            this(Material.rock);
        }
        @Override
        public String getUnlocalizedName()
        {
            return String.format("tile.%s%s", Reference.MOD_ID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
        }

        protected String getUnwrappedUnlocalizedName(String unlocalizedName)
        {
            return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1);
        }
        
}

 

EDIT : and there is BlockTuileSlab.java

 

package mod.jbjoe.dcojoe.block;

import mod.jbjoe.dcojoe.creativetab.CreativeTabEM;
import mod.jbjoe.dcojoe.reference.Names;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;

public abstract class BlockTuileSlab extends BlockSlabEM
{
    public BlockTuileSlab()
    {
        super(Material.rock);
        this.setUnlocalizedName(Names.Blocks.TUILE_SLAB);
        this.setCreativeTab(CreativeTabEM.EM_TAB);
        this.setHardness(4.0F);
        this.setResistance(3.0F);
        this.setStepSound(soundTypePiston);
        this.setHarvestLevel("pickaxe", 0);
    }
}

 

i don't know where is the miss,

so all your help will be appreciated ! :)

 

(and if you feel to help more, i would like to have some details about adding a stairs )

 

thanks you for all the help ! :D

Link to comment
Share on other sites

Please include BlockTuileSlab.java

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Add the full crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here
    • [10:43:34] [Datafixer Bootstrap/INFO]: 237 Datafixer optimizations took 430 milliseconds [10:43:38] [Render thread/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] [10:43:38] [Render thread/INFO]: Setting user: InfexionX [10:43:38] [Render thread/INFO]: Backend library: LWJGL version 3.3.3+5 [10:43:39] [Render thread/INFO]: Reloading ResourceManager: vanilla [10:43:39] [Worker-Main-7/INFO]: Found unifont_all_no_pua-15.1.05.hex, loading [10:43:39] [Worker-Main-3/INFO]: Found unifont_jp_patch-15.1.05.hex, loading [10:43:40] [Render thread/WARN]: Missing sound for event: minecraft:block.spawner.fall [10:43:40] [Render thread/INFO]: OpenAL initialized on device OpenAL Soft on Headphones (High Definition Audio Device) [10:43:40] [Render thread/INFO]: Sound engine started [10:43:40] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/blocks.png-atlas [10:43:40] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/signs.png-atlas [10:43:40] [Render thread/INFO]: Created: 512x512x4 minecraft:textures/atlas/banner_patterns.png-atlas [10:43:40] [Render thread/INFO]: Created: 512x512x4 minecraft:textures/atlas/shield_patterns.png-atlas [10:43:40] [Render thread/INFO]: Created: 1024x1024x4 minecraft:textures/atlas/armor_trims.png-atlas [10:43:40] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas [10:43:40] [Render thread/INFO]: Created: 128x64x4 minecraft:textures/atlas/decorated_pot.png-atlas [10:43:40] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas [10:43:40] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas [10:43:40] [Render thread/INFO]: Created: 64x64x0 minecraft:textures/atlas/map_decorations.png-atlas [10:43:40] [Render thread/INFO]: Created: 512x256x0 minecraft:textures/atlas/particles.png-atlas [10:43:40] [Render thread/INFO]: Created: 512x256x0 minecraft:textures/atlas/paintings.png-atlas [10:43:40] [Render thread/INFO]: Created: 256x128x0 minecraft:textures/atlas/mob_effects.png-atlas [10:43:40] [Render thread/INFO]: Created: 1024x512x0 minecraft:textures/atlas/gui.png-atlas [10:44:16] [Render thread/INFO]: Stopping!
    • ive added theoneprobe, crashed. i removed ascended quark and it works. make it make sense.    thank you, TileEntity and please know i only had the courage to post here for help because i kept seeing how useful you are to everyone else so i am super glad you were the one to help me. thanks a lot!
    • Yes - looks like arsmagicalegacy requires this mod Or it is an issue with ascended_quark
  • Topics

×
×
  • Create New...

Important Information

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