Jump to content

Recommended Posts

Posted

Hello, I have a custom slab class, these custom slabs function normally. Aside from two things;

 

One:

The slabs do not stack, when I place them on each-other there's a big empty space.

 

Two:

When I click in with the scroll wheel of my mouse, it gives me a stone slab instead. It's the same thing with any custom block that extends a vanilla block, is there a method to fix this?

 

Picture of my problem:

http://postimg.org/image/g97zuc2fp/

 

I have also tried to register the "ItemSlab" in postInit from the following tutorial (Changing the syntax to 1.7.10 myself), but it was of no use, my blocks simply wouldn't stack.

 

 

Here's my registry and slab class.

 

Registering:

 

orangeHalfSlab = new OrangeSlab(false, CreativeTabs.tabBlock, "orangehalfslab");
orangeDoubleSlab = new OrangeSlab(true, null, "orangefullslab");

 

 

Slab Class (Cut out import statements):

 

public class OrangeSlab extends BlockSlab {

public OrangeSlab(boolean isFullBlock, CreativeTabs tab, String  blockName) {
	super(isFullBlock, Material.wood);

	if(tab != null){
		setCreativeTab(tab);
	}

	setBlockName(Constants.MODID + "_" + blockName);
	setHardness(1.5F);
	GameRegistry.registerBlock(this, blockName);
}

@Override
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon(Constants.MODID + ":" + "orangeplank");
}

@Override
public String func_150002_b(int p_150002_1_) {
	return getUnlocalizedName();
}



}

 

 

To reiterate, the issue is not with texturing, but the fact the slabs do not change to doubleslabs when placed together, thank you for your time.

Posted

For double slabs, you need to register a custom ItemBlock with the block. Have a look at ItemSlab in vanilla.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

Posted

Okay, so, I implemented a class that extends ItemSlab. The issue is that I'm getting an ID overlap. (Two of the same Id, I think) So it crashes Minecraft upon startup.

 

ItemSlab class:

 

public class OrangeItemSlab extends ItemSlab{

String name = "orangeitemslab";

public OrangeItemSlab(Block block){
	super(block, (BlockSlab)ModBlocks.orangeHalfSlab, (BlockSlab)ModBlocks.orangeDoubleSlab, false);
	setUnlocalizedName(Constants.MODID + "_" + name);
	this.setMaxDamage(0);
    this.setHasSubtypes(true);
    GameRegistry.registerItem(this, name);
}

}

 

 

The use of the class:

 

OrangeItemSlab orangeSlab = new OrangeItemSlab(ModBlocks.orangePlank);

 

 

Error Log (Some of it):

 

 

[00:12:36] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----

// My bad.

 

Time: 10/1/14 12:12 AM

Description: Initializing game

 

java.lang.IllegalStateException: Can't free registry slot 167 occupied by net.minecraft.item.ItemBlock@6f1762d0

at cpw.mods.fml.common.registry.GameData.freeSlot(GameData.java:926)

at cpw.mods.fml.common.registry.GameData.registerItem(GameData.java:832)

at cpw.mods.fml.common.registry.GameData.registerItem(GameData.java:802)

at cpw.mods.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:143)

at cpw.mods.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:131)

at com.zacharysturtz.OrangeItemSlab.<init>(OrangeItemSlab.java:17)

at com.zacharysturtz.ModItems.init(ModItems.java:17)

at com.zacharysturtz.Main.preInit(Main.java:23)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)

at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:239)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)

at net.minecraft.client.Minecraft.run(Minecraft.java:931)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at GradleStart.bounce(GradleStart.java:107)

at GradleStart.startClient(GradleStart.java:100)

at GradleStart.main(GradleStart.java:55)

 

        Et Cetera...

 

 

 

(Edit) For additional reference, here is the source GameData.class method where the error points to:

 

private void freeSlot(int id, Object obj)
    {
        FMLControlledNamespacedRegistry<?> registry = (obj instanceof Block) ? iBlockRegistry : iItemRegistry;
        Object thing = registry.getRaw(id);

        if (thing != null && thing != obj)
        {
            throw new IllegalStateException(String.format("Can't free registry slot %d occupied by %s", id, thing)); //----This is thrown
        }

        availabilityMap.clear(id);
    }

 

Posted

When you are registering your block, you need to specify the ItemBlock too.

GameRegistry.registerBlock(block,CustomItemBlock.class,name);

 

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Solved, took me awhile because I am slightly retarded.

 

Finished slab class:

 


import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.IIcon;

public class OrangeSlab extends BlockSlab {

String name;

public OrangeSlab(boolean isFullBlock, CreativeTabs tab, String  blockName) {
	super(isFullBlock, Material.wood);

	if(tab != null){
		setCreativeTab(tab);
	}

	name = blockName;

	setBlockName(Constants.MODID + "_" + blockName);

	setHardness(1.5F);

}

@Override
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon(Constants.MODID + ":" + "orangeplank");
}

@Override
public String func_150002_b(int p_150002_1_) {
	// TODO Auto-generated method stub
	return getUnlocalizedName();
}



}

 

 

Finished ItemSlab class:

 

package com.zacharysturtz;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.item.ItemSlab;
import net.minecraft.item.ItemStack;

public class OrangeItemSlab extends ItemSlab{

public OrangeItemSlab(Block block){
	super(block, (BlockSlab)ModBlocks.orangeHalfSlab, (BlockSlab)ModBlocks.orangeDoubleSlab, false);
	this.setMaxDamage(0);
    this.setHasSubtypes(true);
    setUnlocalizedName(Constants.MODID + "_orangeitemslab");
}

}

 

 

Finished slab creation:

 

        Block orangeHalfSlab = new OrangeSlab(false, CreativeTabs.tabBlock, "orangehalfslab");
Block orangeDoubleSlab = new OrangeSlab(true, null, "orangefullslab");

 

 

Finished Registery (Inside of preinit):

 

        GameRegistry.registerBlock(ModBlocks.orangeHalfSlab, OrangeItemSlab.class, "orangehalfslab");
GameRegistry.registerBlock(ModBlocks.orangeDoubleSlab, OrangeItemSlab.class, "orangefullslab");

 

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Thank you for the suggestion if figure that it should be able to support around 40 based on my previous experiences hosting but no one really seems to have a concrete way of figuring it out. You have been alot more helpful than most people and i will probably set up Linux tomorrow.
    • https://mclo.gs/e8nuqSA My friend and I are having the same issue with this pack. We're trying to play on BMC4 with a bunch of extra mods. The game loads up to 'mod gathering' and then crashes. Mod list changes beyond the modpack: Added mods: alexscaves-2.0.2.jar alexsmobsinteraction-5.4-all.jar Apotheosis-1.20.1-7.4.8.jar ApothicAttributes-1.20.1-1.3.7.jar ApothicCombat-1.20.1-1.1.0.jar ApothicCurios-1.20.1-1.0.3e.jar ArmorPoser-forge-1.20.1-2.2.2.jar ars_nouveau-1.20.1-4.12.7-all.jar attributizer-2.1.jar bendy-lib-forge-4.0.0.jar betterarcheology-1.2.1-1.20.1.jar bettercombat-forge-1.8.6+1.20.1.jar BetterThirdPerson-Forge-1.20-1.9.0.jar born_in_chaos_[Forge]1.20.1_1.7.jar cataclysm_ut_lite-AT - 1.20.1.jar celestisynth-1.20.1-1.3.1.jar cobweb-forge-1.20.1-1.0.1.jar common-networking-forge-1.0.5-1.20.1.jar Critters n' Crawlers-2.2.2-mc1.20.1.jar crittersandcompanions-forge-2.2.2.jar domesticationinnovation-1.7.1-1.20.1.jar dummmmmmy-1.20-2.0.6.jar emotecraft-for-MC1.20.1-2.2.7-b.build.50-forge.jar EmoteTweaks-4.0.2.27-forge.jar exposure-1.20.1-1.7.14-forge.jar faunify-forge-1.20.1-1.1.2.jar hallucinatory_plants-2.3.0-1.20.1-forge.jar Icarus-Forge-2.12.0.jar integrated_api-1.5.1+1.20.1-forge.jar irons_spellbooks-1.20.1-3.4.0.9.jar iwannaskate-1.2.0.jar l2library-2.5.1.jar letsdo-API-forge-1.2.15-forge.jar letsdo-bakery-forge-2.0.5.jar letsdo-brewery-forge-2.0.3.jar letsdo-brewery-forge-2.0.5.jar letsdo-candlelight-forge-2.0.2.jar letsdo-farm_and_charm-forge-1.0.4.jar letsdo-herbalbrews-forge-1.0.12.jar letsdo-nethervinery-forge-1.2.17.jar letsdo-vinery-forge-1.4.39.jar modulargolems-2.5.19.jar mutil-1.20.1-6.2.0.jar Pehkui-3.8.2+1.20.1-forge.jar Placebo-1.20.1-8.6.3.jar player-animation-lib-forge-1.0.2-rc1+1.20.jar Powah-5.0.10.jar productivebees-1.20.1-12.6.0.jar Rats-1.20.1-8.1.3.jar refinedstorage-1.12.4.jar refinedstorageaddons-0.10.0.jar RSInfinityBooster-1.20.1-1.0+41.jar rsjukeboxes-1.20.1-1.0.1.0.jar ScorchedGuns-0.4.1-1.20.1.jar simplyswords-forge-1.56.0-1.20.1.jar sophisticatedbackpacks-1.20.1-3.23.23.1281.jar sophisticatedcore-1.20.1-1.2.75.1033.jar soul-fire-d-forge-1.20.1-4.0.11.jar supermartijn642configlib-1.1.8-forge-mc1.20.jar the_bumblezone-7.7.1+1.20.1-forge.jar the_dirty_stuff-2.1-forge-1.20.1.jar traveloptics-4.4.0-1.20.1.jar unusualprehistory-1.5.0.3.jar voicechat-forge-1.20.1-2.5.30.jar wits-1.1.0+1.20.1-forge.jar xercapaint-1.20.1-1.0.1.jar Updated mods: azurelib (3.0.8 > 3.0.9) lithostitched-forge-1.20.1-1.4.10.jar > lithostitched-forge-1.20.1-1.4.11.jar  
    • Graphics are irrelevant for a server. According to google, it should support 20-40. I literally asked it "how many players on a lightly modded minecraft server will a ryzen 5 2600 with 32GB ram support?" Maybe someone with some real world experience has further input. I can say without a doubt that if you run Linux as opposed to windows for the server operating system, you will get better performance and have more resources available to your server.
    • Could someone help me to figure out what's the problem?  I get this crash when I try to enter to a world in forge 1.12.2:  The game crashed: exception in server tick loop Error: java.lang.NullPointerException: Exception in server tick loop Error code: -1 here is the crash report crash-2025-07-15_20.44.02-server333.txt
  • Topics

×
×
  • Create New...

Important Information

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