Jump to content

[1.13.2] converting mod from 1.12.2 How to fix the errors?


Drachenbauer

Recommended Posts

I now setup a workspace for the newest version (1.13.2).

then i replaced the example-stuff in the src-folder there with the java files and resurces of my mod (i replaced the whole content of that folder).

But now it shows more than 1000 java-errors in the console.

Most of them are from the type "[name] cannot be resolved".

In my previous 1.12.2 workspace i had no errors and could run a minecraft-instance and use my mod in there.

 

Did i use a wrong way to get my stuff into a workspace for 1.13.2

Edited by Drachenbauer
Link to comment
Share on other sites

Delete all your imports and reimport them with your IDE.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

Send a screenshot.

 

Also specify "[name]".

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

the thing with the missing Javadoc

pops up, if i hover the mouse over my imports.

But it seems like the errors in my code don´t belong to this.

 

Theese are my errors:

Spoiler

Description    Resource    Path    Location    Type
blockState cannot be resolved or is not a field    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 33    Java Problem
blockState cannot be resolved or is not a field    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 29    Java Problem
BlockStateContainer cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 53    Java Problem
BlockStateContainer cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 55    Java Problem
CreativeTabs cannot be resolved to a variable    BlockBase.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 21    Java Problem
EntityRegistry cannot be resolved    EntityInit.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/init    line 27    Java Problem
FACING cannot be resolved or is not a field    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 21    Java Problem
IBlockAccess cannot be resolved to a type    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 49    Java Problem
IBlockAccess cannot be resolved to a type    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 55    Java Problem
IBlockAccess cannot be resolved to a type    EggBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 36    Java Problem
IBlockAccess cannot be resolved to a type    EggBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 42    Java Problem
IBlockAccess cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 42    Java Problem
IBlockAccess cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 48    Java Problem
Instance cannot be resolved or is not a field    EntityInit.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/init    line 27    Java Problem
IProperty cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 55    Java Problem
PropertyDirection cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 21    Java Problem
PropertyDirection cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 29    Java Problem
PropertyDirection cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 55    Java Problem
PropertyDirection cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 60    Java Problem
PropertyDirection cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 60    Java Problem
PropertyDirection cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 65    Java Problem
PropertyDirection cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 70    Java Problem
PropertyDirection cannot be resolved to a type    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 75    Java Problem
proxy cannot be resolved or is not a field    BlockBase.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 30    Java Problem
proxy cannot be resolved or is not a field    ItemBase.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/items    line 21    Java Problem
The constructor BlockStateContainer(BalloonBlock, IProperty[]) is undefined    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 74    Java Problem
The import net.minecraft.world.IBlockAccess cannot be resolved    EggBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 12    Java Problem
The method createBlockState() of type BalloonBlock must override or implement a supertype method    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 72    Java Problem
The method createBlockState() of type NestBlock must override or implement a supertype method    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 53    Java Problem
The method getHorizontal(int) is undefined for the type EnumFacing    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 89    Java Problem
The method getHorizontal(int) is undefined for the type EnumFacing    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 70    Java Problem
The method getValue(DirectionProperty) is undefined for the type IBlockState    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 79    Java Problem
The method getValue(DirectionProperty) is undefined for the type IBlockState    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 94    Java Problem
The method isOpaqueCube(IBlockState) of type EggBlock must override or implement a supertype method    EggBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 26    Java Problem
The method isOpaqueCube(IBlockState) of type NestBlock must override or implement a supertype method    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 32    Java Problem
The method setHardness(float) is undefined for the type BalloonBlock    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 31    Java Problem
The method setHardness(float) is undefined for the type EggBlock    EggBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 22    Java Problem
The method setHardness(float) is undefined for the type NestBlock    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 27    Java Problem
The method setResistance(float) is undefined for the type BalloonBlock    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 32    Java Problem
The method setResistance(float) is undefined for the type EggBlock    EggBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 23    Java Problem
The method setResistance(float) is undefined for the type NestBlock    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 28    Java Problem
The method setSoundType(SoundType) is undefined for the type BalloonBlock    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 30    Java Problem
The method setSoundType(SoundType) is undefined for the type EggBlock    EggBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 21    Java Problem
The method setSoundType(SoundType) is undefined for the type NestBlock    NestBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 26    Java Problem
The method setUnlocalizedName(String) is undefined for the type BlockBase    BlockBase.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 19    Java Problem
The method withProperty(DirectionProperty, EnumFacing) is undefined for the type IBlockState    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 79    Java Problem
The method withProperty(DirectionProperty, EnumFacing) is undefined for the type IBlockState    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 84    Java Problem
BlockStateContainer is a raw type. References to generic type BlockStateContainer<T> should be parameterized    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 72    Java Problem
BlockStateContainer is a raw type. References to generic type BlockStateContainer<T> should be parameterized    BalloonBlock.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 74    Java Problem
The method getItemFromBlock(Block) from the type Item is deprecated    BlockBase.java    /AngryBirdsMod/src/main/java/com/drachenbauer32/angrybirdsmod/blocks    line 30    Java Problem

 

 

And this are the Java-files, where the errors are in:

 

This is my Bockbase

Spoiler

package com.drachenbauer32.angrybirdsmod.blocks;

import com.drachenbauer32.angrybirdsmod.Main;
import com.drachenbauer32.angrybirdsmod.init.ModBlocks;
import com.drachenbauer32.angrybirdsmod.init.ModItems;
import com.drachenbauer32.angrybirdsmod.util.IHasModel;

import net.minecraft.block.Block;
import net.minecraft.block.Block.Properties;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;

public class BlockBase extends Block implements IHasModel
{
    public BlockBase(String name, Properties class1)
    {
        super(class1);
        setUnlocalizedName(name);
        setRegistryName(name);
        setCreativeTab(CreativeTabs.DECORATIONS);
        
        ModBlocks.BLOCKS.add(this);
        ModItems.ITEMS.add(new ItemBlock(this, null).setRegistryName(this.getRegistryName()));
    }

    @Override
    public void registerModels()
    {
        Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory");
    }
}

 

 

 

This is one of my blocks, the others are very similar, just other vaules in some of their propertys

Spoiler

package com.drachenbauer32.angrybirdsmod.blocks;

import javax.annotation.Nullable;

import net.minecraft.block.Block;
import net.minecraft.block.Block.Properties;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.model.multipart.PropertyValueCondition;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.IProperty;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.BlockStateContainer;

public class BalloonBlock extends BlockBase
{
	public static final AxisAlignedBB BALLOON_BLOCK_AABB = new AxisAlignedBB(0.125, 0, 0.125, 0.875, 2, 0.875);
	public static final DirectionProperty FACING = BlockHorizontal.HORIZONTAL_FACING;
	
	public BalloonBlock(String name, Properties class1) 
	{
		super(name, class1);
		setSoundType(SoundType.CLOTH);
		setHardness(0.1f);
		setResistance(0.5f);
		this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
	}
	@Override
	public boolean isSolid(IBlockState p_200124_1_)
	{
		return false;
	}
	@Override
	public boolean isFullCube(IBlockState state)
    {
        return false;
    }
	
	
	
	@Override
	public AxisAlignedBB getBoundingBox (IBlockState state, IBlockAccess source, BlockPos pos)
	{
		return BALLOON_BLOCK_AABB;
	}
	@Nullable
	@Override
	public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
	{
	    return BALLOON_BLOCK_AABB;
	}
	
	@Override
	protected BlockStateContainer createBlockState()
	{
		return new BlockStateContainer(this, new IProperty[] { FACING});
	}
	
    public IBlockState withRotation(IBlockState state, Rotation rot)
    {
        return state.withProperty(FACING, rot.rotate((EnumFacing) state.getValue(FACING)));
    }

    public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
    {
        return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
    }

    public IBlockState getStateFromMeta(int meta)
    {
        return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta));
    }

    public int getMetaFromState(IBlockState state)
    {
        return ((EnumFacing) state.getValue(FACING)).getHorizontalIndex();
    }
}

 

 

My EntityInit:

Spoiler

package com.drachenbauer32.angrybirdsmod.init;

import com.drachenbauer32.angrybirdsmod.Main;
import com.drachenbauer32.angrybirdsmod.entity.EntityBlues;
import com.drachenbauer32.angrybirdsmod.entity.EntityBomb;
import com.drachenbauer32.angrybirdsmod.entity.EntityChuck;
import com.drachenbauer32.angrybirdsmod.entity.EntityMathilda;
import com.drachenbauer32.angrybirdsmod.entity.EntityRed;
import com.drachenbauer32.angrybirdsmod.util.Reference;

import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

public class EntityInit 
{
	public static void registerEntities()
	{
		registerEntity("Red", EntityRed.class, Reference.ENTITY_RED, 50, 14614528, 14663583);
		registerEntity("Chuck", EntityChuck.class, Reference.ENTITY_CHUCK, 50, 16776960, 16777215);
		registerEntity("Blues", EntityBlues.class, Reference.ENTITY_BLUES, 50, 32767, 16711680);
		registerEntity("Bomb", EntityBomb.class, Reference.ENTITY_BOMB, 50, 4144959, 8355711);
		registerEntity("Mathilda", EntityMathilda.class, Reference.ENTITY_MATHILDA, 50, 16777215, 15969719);
	}
	
	private static void registerEntity(String name, Class<? extends Entity> entity, int id, int range, int color1, int color2)
	{
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID + ":" + name), entity, name, id, Main.Instance, range, 1, true, color1, color2);
	}
}

 

Here it doesn´t any more know "EntityRegistry".

How do i now register my entitys with theese propertys (name, eggcolors, id, ...)?

Spoiler

package com.drachenbauer32.angrybirdsmod.items;

import com.drachenbauer32.angrybirdsmod.Main;
import com.drachenbauer32.angrybirdsmod.init.ModItems;
import com.drachenbauer32.angrybirdsmod.util.IHasModel;

import net.minecraft.item.Item;

public class ItemBase extends Item implements IHasModel
{
	
	public ItemBase(Properties properties)
	{
		super(properties);
		// TODO Auto-generated constructor stub
	}
	
	@Override
	public void registerModels()
	{
		Main.RegistryEvents.registerItemRenderer(this, 0, "inventory");
	}
}

 

Here it doesn´t any more know "registerItemRenderer".

 

This is where i create my list of custom blocks:

Spoiler

package com.drachenbauer32.angrybirdsmod.init;

import java.util.ArrayList;
import java.util.List;

import com.drachenbauer32.angrybirdsmod.blocks.BalloonBlock;
import com.drachenbauer32.angrybirdsmod.blocks.BlockBase;
import com.drachenbauer32.angrybirdsmod.blocks.EggBlock;
import com.drachenbauer32.angrybirdsmod.blocks.NestBlock;

import net.minecraft.block.Block;

public class ModBlocks
{
	public static final List<Block> BLOCKS = new ArrayList<Block>();
	
	public static final Block BALLOON_BLOCK = new BalloonBlock("balloon_block", null);
	public static final Block EGG_BLOCK = new EggBlock("egg_block", null);
	public static final Block NEST_BLOCK = new NestBlock("nest_block", null);
	public static final Block SLINGSHOT_BLOCK = new BlockBase("slingshot_block", null);
	public static final Block SLINGSHOT2_BLOCK = new BlockBase("slingshot2_block", null);
}

It has no errors, but i don´t know, what i should use for the "null" at the end of the lines...

That just was the only way i found, that goes without conflicts with the blockbase-constructors.

 

Edited by Drachenbauer
Link to comment
Share on other sites

Don't expect your 1.12.2 code to work in 1.13 without issues, there have been major changes. For example let's look at your block class:

41 minutes ago, Drachenbauer said:

setSoundType(SoundType.CLOTH);

setHardness(0.1f);

setResistance(0.5f);

All of these are now set through the Block.Properties passed to the constructor. As they are now final their setters are gone.

 

41 minutes ago, Drachenbauer said:

@Override

public AxisAlignedBB getBoundingBox (IBlockState state, IBlockAccess source, BlockPos pos)

{

    return BALLOON_BLOCK_AABB;

}

 

@Nullable

@Override

public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)

{

    return BALLOON_BLOCK_AABB;

}

These are now controlled by the new VoxelShape class and thus the methods you need are Block#getShape and Block#getCollisionShape. To create custom simple VoxelShape instances use Block.makeCuboidShape.

 

41 minutes ago, Drachenbauer said:

@Override

protected BlockStateContainer createBlockState()

{

    return new BlockStateContainer(this, new IProperty[] { FACING});

}

BlockStateContainer isn't constructed manually anymore. Override Block#fillStateContainer and append your properties to the builder.

 

41 minutes ago, Drachenbauer said:

public IBlockState getStateFromMeta(int meta)

{

    return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta));

}

 

public int getMetaFromState(IBlockState state)

{

    return ((EnumFacing) state.getValue(FACING)).getHorizontalIndex();

}

Metadata doesn't exist in 1.13 thus these are completely pointless.

 

41 minutes ago, Drachenbauer said:

Here it doesn´t any more know "EntityRegistry".

 

EntityRegistry is thankfully finally gone and replaced by the registry events(to be fair it was replaced in 1.12 too). Construct and register EntityType instances in the appropriate registry events.

 

41 minutes ago, Drachenbauer said:

Here it doesn´t any more know "registerItemRenderer".

 

For now models for items are registered automatically so the stupid IHasModel can finally rest in pieces. You don't need to register your models manually anymore. As for the more complex models the api isn't done yet I suspect.

 

41 minutes ago, Drachenbauer said:

This is where i create my list of custom blocks:

 

Don't. Instantinate your stuff in the appropriate registry events, not in a static initializer. 

 

41 minutes ago, Drachenbauer said:

It has no errors, but i don´t know, what i should use for the "null" at the end of the lines...

 

These are block properties like hardness, sound, etc. See how vanilla constructs them in the Block class.

 

Give me a bit of time and I will post a detailed response to your error list.

Edited by V0idWa1k3r
Link to comment
Share on other sites

45 minutes ago, Drachenbauer said:

blockState cannot be resolved or is not a field

Block.blockState is now Block.stateContainer.

 

46 minutes ago, Drachenbauer said:

BlockStateContainer cannot be resolved to a type

As stated in my previous reply this is done through a builder now.

 

46 minutes ago, Drachenbauer said:

CreativeTabs cannot be resolved to a variable

CreativeTabs is now called ItemGroup.

 

47 minutes ago, Drachenbauer said:

EntityRegistry cannot be resolved

As stated in my previous reply EntityRegistry is gone.

 

47 minutes ago, Drachenbauer said:

FACING cannot be resolved or is not a field

I don't know where you were importing FACING from but you can get all vanilla blockstate properties from the BlockStateProperties class.

 

48 minutes ago, Drachenbauer said:

IBlockAccess cannot be resolved to a type

Instead of a single IBlockAccess there are now a lot of various interfaces that the world implements. I don't know which methods of yours needed the IBlockAccess so I can't tell for sure what it needs now but I suspect it needs a IBlockReader.

 

49 minutes ago, Drachenbauer said:

Instance cannot be resolved or is not a field

As far as I can tell from your code that points into your main mod class so you've removed that field yourself.

 

50 minutes ago, Drachenbauer said:

IProperty cannot be resolved to a type

As stated above this is done through a builder now. Also that syntax was never needed in the first place.

 

51 minutes ago, Drachenbauer said:

PropertyDirection cannot be resolved to a type

PropertyDirection is now DirectionProperty.

 

52 minutes ago, Drachenbauer said:

proxy cannot be resolved or is not a field

Again, that points towards your main mod class, you've removed the field yourself but left the reference.

 

52 minutes ago, Drachenbauer said:

The constructor BlockStateContainer(BalloonBlock, IProperty[]) is undefined

As stated above this is done through a builder now. 

 

53 minutes ago, Drachenbauer said:

The import net.minecraft.world.IBlockAccess cannot be resolved

Instead of a single IBlockAccess there are now a lot of various interfaces that the world implements. I don't know which methods of yours needed the IBlockAccess so I can't tell for sure what it needs now but I suspect it needs a IBlockReader.

 

53 minutes ago, Drachenbauer said:

The method createBlockState() of type BalloonBlock must override or implement a supertype method  

As stated in my previous reply this is now done through Block#fillStateContainer

 

54 minutes ago, Drachenbauer said:

The method getHorizontal(int) is undefined for the type EnumFacing

Since metadata is now gone those helper methods to convert to and from metadata are gone too.

 

54 minutes ago, Drachenbauer said:

The method getValue(DirectionProperty) is undefined for the type IBlockState

IBlockState#getValue is now IBlockState#get.

 

55 minutes ago, Drachenbauer said:

The method isOpaqueCube(IBlockState) of type EggBlock must override or implement a supertype method  

Block#isOpaqueCube is now controlled through it's VoxelShape returned by Block#getRenderShape and simply checks if the given shape is a full cube. It will also return false if Block#isSolid returns false.

 

57 minutes ago, Drachenbauer said:

The method setHardness(float) is undefined for the type BalloonBlock 

Since hardness is now final the setters are gone, use Block.Properties passed to the constructor to control it.

 

58 minutes ago, Drachenbauer said:

The method setResistance(float) is undefined for the type BalloonBlock

Same here.

 

58 minutes ago, Drachenbauer said:

The method setSoundType(SoundType) is undefined for the type BalloonBlock

And same here too.

 

58 minutes ago, Drachenbauer said:

The method setUnlocalizedName(String) is undefined for the type BlockBase 

Unlocalized names are now gone. Instead they are controlled by Block#getTranslationKey which uses the registry name (block.REGISTRY_NAME). This is done for you automatically, you don't need to set anything.

 

1 hour ago, Drachenbauer said:

The method withProperty(DirectionProperty, EnumFacing) is undefined for the type IBlockState 

IBlockState#withProperty is now IBlockState#with.

 

1 hour ago, Drachenbauer said:

The method getItemFromBlock(Block) from the type Item is deprecated

I don't know what you were using this for but be wary of an ongoing issue:

https://github.com/MinecraftForge/MinecraftForge/issues/5470

  • Like 1
Link to comment
Share on other sites

Can you write, what exactly the registration of entitys (with all theese propertys) now have to look like and where in the blocks exactly i have to use Block#getShape and Block#getCollisionShape?

 

It does not help me, jyut to say, what i have to use, if it´s not a directly replacement of another word.

 

I need working examples to see, where and how i have to use some of the stuff, you told me.

Edited by Drachenbauer
Link to comment
Share on other sites

33 minutes ago, Drachenbauer said:

where in the blocks exactly i have to use Block#getShape and Block#getCollisionShape?

These are methods, you override them just as you would with any other method.

 

33 minutes ago, Drachenbauer said:

what exactly the registration of entitys (with all theese propertys) now have to look like

//In your registry event
event.getRegistry().register(EntityType.Builder.create(YourEntityClass.class, YourEntityClass::new).tracker(range, frequency, sendvelocity).build("modid:name"));

 

Link to comment
Share on other sites

6 minutes ago, Drachenbauer said:

for register entitys i need more surrounding, that i see, where in the registry event i haveto place this

 

It's a registry event. You are already using these for your blocks and items, and there is one for entities too.

7 minutes ago, Drachenbauer said:

 do i need to add one for each entity, i want to register?

 

If you are talking about events then no, you don't.

 

7 minutes ago, Drachenbauer said:

 And where to place the egg-colors?

Since the flattening each egg is now it's own item. So you just register a new instance of ItemSpawnEgg in your item registry event. They do need the EntityType in their constructor though so I guess you'll have to instantinate them in the item registry event too, but register in their registry event. Just store them in a field(don't instantinate them in that field though). The other two parameters are the colours of the egg.

Link to comment
Share on other sites

i get errors, if i do this in my registry events:

@SubscribeEvent
		public static void registerEntities(final RegistryEvent.Register<Entity> event)
		{
			event.getRegistry().register(EntityType.Builder.create(YourEntityClass.class, YourEntityClass::new).tracker(range, frequency, sendvelocity).build("modid:name"));
			LOGGER.info("Entities registered.");
		}

i copyed the registerBlocks thing and changed everywhere "Block" into "Entity"

and than i pasted the line, you told me as the right event-line-look

it has a problem with the blue written word "Entity" (i imported it, but it does not help) and with some stuff in the line, you told me to take

Edited by Drachenbauer
Link to comment
Share on other sites

5 minutes ago, Drachenbauer said:

RegistryEvent.Register<Entity>

Entity is not a RegistryEntry thus it can't be used as a parameter for the registry event. use EntityType.

 

6 minutes ago, Drachenbauer said:

and than i pasted the line, you told me as the right event-line-look

 

Well obviously you don't just copy-paste my explanatory-example line. Replace the placeholder variable names with what you actually need.

Link to comment
Share on other sites

if i replace "Entity" with "EntityType" it still has problems with that

And i thaught, because i need only one of your line, there must be placeholders, that i can replace them with the specific parameters of each of my entitys later in another location.

 

can you just show me a whole registry-event area with block, item and entity - events correctly added

Edited by Drachenbauer
Link to comment
Share on other sites

Which of the substitutions don’t you know the value of?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

You could put that code in a method, or write it out for every entity

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Take the code, and put it in a method, substituting the variables for parameters. If you need more help, google “java method”

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Did you check the getRenderShape method of your block to ensure it's returning the correct enum value?
    • new to messing with modpacks. the server starts and the pack is playable on personal worlds, but every time i try to enter the server, i get "internal exception: io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: Payload may not be larger than 1048576 bytes" and it boots me. not sure what this means. the debug log is essentially gibberish to me and i'm not sure... about anything. is it saying that it's sending me too much data? if it helps at all, my mc username is "leucanella", and the disconnect reasons are near the very bottom (at least once was due to mismatched modlists, but i got that fixed i'm pretty sure). i just can't make sense of it myself. https://gist.github.com/idlebird/c5269e80434a501104f6b99ebc16be46
    • We somehow figured out the issue: Whenever we try to eat a food item from the mod "[Let's Do] Candlelight" that can be eaten multiple times using a feeding upgrade from "Sophisticated Backpacks", that's when we crash. Food items include: - Beef Wellington - Bolognese - Chicken Alfredo - Chicken with Vegetables - Cooked Beef - Fricasse with Hash Browns - Lasagna - Lettuce with Steak - Lettuce with Tomatoes, Potatoes and Carrots - Mushroom Soup - Pasta with Bolognese - Pasta with Tomato Sauce - Pork Ribs - Roastbeef with Carrots - Salmon with White Wine Sauce - Tomato Mozzarella Salad - Tomato Soup - Tropical Fish Supreme
    • Me and my sister are playing on a modded minecraft server, but recently she has been crashing at random intervals and no one I've talked with knows why. There's no crash report on my sister's side, but in the log of the server there appears a bunch of lines every time she crashes. They appear to be mostly similar with different mods changing each crash. Minecraft Version: 1.20.1 Forge version: forge-47.2.20 Server log: [07May2024 18:13:29.067] [Server thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: null     Index: 12     Listeners:         0: NORMAL         1: ASM: com.github.alexthe666.citadel.server.CitadelEvents@28c884eb onEntityUpdateDebug(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V         2: net.minecraftforge.eventbus.EventBus$$Lambda$4374/0x00007f0098c72da0@10f79ae2         3: ASM: com.github.alexthe666.alexsmobs.event.ServerEvents@6f4126f3 onLivingUpdateEvent(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V         4: ASM: class tallestegg.illagersweararmor.IWASpawnEvents tickEntity(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V         5: ASM: class io.github.lightman314.lightmanscurrency.common.EventHandler entityTick(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V         6: ASM: com.github.L_Ender.cataclysm.event.ServerEventHandler@1bbd60d8 onLivingUpdateEvent(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V         7: ASM: class io.github.edwinmindcraft.apoli.common.ApoliPowerEventHandler playerTick(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V         8: ASM: class io.github.edwinmindcraft.apoli.common.ApoliEventHandler livingTick(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V         9: net.minecraftforge.eventbus.EventBus$$Lambda$4374/0x00007f0098c72da0@1e30768c         10: ASM: class net.mcreator.borninchaosv.init.EntityAnimationFactory onEntityTick(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V         11: ASM: squeek.appleskin.network.SyncHandler@29e380f7 onLivingTickEvent(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V         12: ASM: top.theillusivec4.curios.common.event.CuriosEventHandler@55b4416c tick(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V java.lang.ArrayIndexOutOfBoundsException [07May2024 18:13:29.146] [Server thread/WARN] [net.minecraft.server.network.ServerConnectionListener/]: Failed to handle packet for /OMITTED IP net.minecraft.ReportedException: Ticking player     at net.minecraft.server.level.ServerPlayer.m_9240_(ServerPlayer.java:530) ~[server-1.20.1-20230612.114412-srg.jar%23461!/:?]     at net.minecraft.server.network.ServerGamePacketListenerImpl.m_9933_(ServerGamePacketListenerImpl.java:262) ~[server-1.20.1-20230612.114412-srg.jar%23461!/:?]     at net.minecraft.network.Connection.m_129483_(Connection.java:263) ~[server-1.20.1-20230612.114412-srg.jar%23461!/:?]     at net.minecraft.server.network.ServerConnectionListener.m_9721_(ServerConnectionListener.java:142) ~[server-1.20.1-20230612.114412-srg.jar%23461!/:?]     at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:907) ~[server-1.20.1-20230612.114412-srg.jar%23461!/:?]     at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:283) ~[server-1.20.1-20230612.114412-srg.jar%23461!/:?]     at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:814) ~[server-1.20.1-20230612.114412-srg.jar%23461!/:?]     at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23461!/:?]     at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23461!/:?]     at java.lang.Thread.run(Thread.java:833) ~[?:?] Caused by: java.lang.ArrayIndexOutOfBoundsException Mod List: SecurityCraft v1.9.9.jar additional_lights-1.20.1-2.1.7.jar advancements_tracker_1.20.1-6.1.0.jar AI-Improvements-1.20-0.5.2.jar alexsdelight-1.5.jar alexsmobs-1.22.8.jar AmbientSounds_FORGE_v5.3.9_mc1.20.1.jar amendments-1.20-1.1.26.jar appleskin-forge-mc1.20.1-2.5.1.jar Aquaculture-1.20.1-2.5.1.jar aquaculture_delight_1.0.0_forge_1.20.1.jar architectury-9.2.14-forge.jar Arda's Sculks 1.3.2 [FORGE] [1.20.1].jar artifacts-forge-9.5.3.jar async-locator-forge-1.20-1.3.0.jar athena-forge-1.20.1-3.1.2.jar AttributeFix-Forge-1.20.1-21.0.4.jar BadOptimizations-2.1.1.jar badpackets-forge-0.4.3.jar balm-forge-1.20.1-7.2.2.jar beautify-2.0.2.jar BetterAdvancements-1.20.1-0.3.2.162.jar bettercombat-forge-1.8.5+1.20.1.jar BetterF3-7.0.2-Forge-1.20.1.jar betterfarmerscombat-1.2-1.20.1.jar BetterThirdPerson-Forge-1.20-1.9.0.jar BiomesOPlenty-1.20.1-18.0.0.598.jar Bookshelf-Forge-1.20.1-20.1.10.jar born_in_chaos_[Forge]1.20.1_1.2.jar Bountiful-6.0.3+1.20.1-forge.jar caelus-forge-3.2.0+1.20.1.jar camera-forge-1.20.1-1.0.8.jar canary-mc1.20.1-0.3.3.jar chat_heads-0.10.32-forge-1.20.jar Chimes-v2.0.1-1.20.1.jar Chipped-forge-1.20.1-3.0.6.jar chunksending-1.20.1-2.8.jar Chunky-1.3.136.jar citadel-2.5.4-1.20.1.jar cloth-config-11.1.118-forge.jar Clumps-forge-1.20.1-12.0.0.3.jar cluttered-2.1-1.20.1.jar connectedglass-1.1.11-forge-mc1.20.1.jar Controlling-forge-1.20.1-12.0.2.jar corpse-forge-1.20.1-1.0.12.jar cosmeticarmorreworked-1.20.1-v1a.jar CreativeCore_FORGE_v2.11.27_mc1.20.1.jar creeperoverhaul-3.0.2-forge.jar Croptopia-1.20.1-FORGE-3.0.4.jar ctia-1.20.1-forge-2.0.9.jar cupboard-1.20.1-2.6.jar curios-forge-5.9.0+1.20.1.jar CustomPlayerModels-1.20-0.6.16c.jar darktimer-forge-1.20.1-1.0.9.jar dotbe-1.20.1-1.5.5.jar dummmmmmy-1.20-1.8.14.jar DungeonsArise-1.20.x-2.1.58-release.jar DungeonsAriseSevenSeas-1.20.x-1.0.2-forge.jar dye_depot-1.0.0-forge.jar dynamiclights-v1.7.1-mc1.17x-1.20x-mod.jar easy_mob_farm_1.20.1-7.1.0.jar elevatorid-1.20.1-lex-1.9.jar embeddium-0.3.17+mc1.20.1-all.jar embeddiumplus-1.20.1-v1.2.8.jar emotecraft-for-MC1.20.1-2.2.7-b.build.50-forge.jar EnchantmentDescriptions-Forge-1.20.1-17.0.14.jar EnderMail-1.20.1-1.2.9.jar endermanoverhaul-forge-1.20.1-1.0.4.jar endersdelight-1.20.1-1.0.3.jar entityculling-forge-1.6.2-mc1.20.1.jar EpheroLib-1.20.1-FORGE-1.2.0.jar fantasyfurniture-1.20.1-9.0.0.jar FarmersDelight-1.20.1-1.2.4.jar farmersutils-1.0.5-1.20.1.jar Fastload-Reforged-mc1.20.1-3.4.0.jar fastpaintings-1.20-1.2.5.jar ferritecore-6.0.1-forge.jar friendsandfoes-forge-mc1.20.1-2.0.10.jar ftb-essentials-forge-2001.2.2.jar ftb-library-forge-2001.2.1.jar fusion-1.1.1-forge-mc1.20.1.jar geckolib-forge-1.20.1-4.4.4.jar getittogetherdrops-forge-1.20-1.3.jar handcrafted-forge-1.20.1-3.0.6.jar IllagerInvasion-v8.0.5-1.20.1-Forge.jar illagersweararmor-1.20.1-1.3.4.jar ImmediatelyFast-Forge-1.2.13+1.20.4.jar immersive_melodies-0.1.0+1.20.1-forge.jar Incendium_1.20.4_v5.3.4.jar Item_Obliterator-FORGE-MC1.20.1-1.7.0.jar Jade-1.20.1-forge-11.8.0.jar jei-1.20.1-forge-15.3.0.4.jar journeymap-1.20.1-5.9.20-forge.jar Kambrik-6.1.1+1.20.1-forge.jar kotlinforforge-4.10.0-all.jar L_Enders_Cataclysm-1.99.2 -1.20.1.jar LeavesBeGone-v8.0.0-1.20.1-Forge.jar letmedespawn-forge-1.20.x-1.2.0.jar letsdo-addon-compat-forge-v1.4.1.jar letsdo-API-forge-1.2.9-forge.jar letsdo-bakery-forge-1.1.8.jar letsdo-beachparty-forge-1.1.4-1.jar letsdo-brewery-forge-1.1.6.jar letsdo-candlelight-forge-1.2.11.jar letsdo-herbalbrews-forge-1.0.6.jar letsdo-meadow-forge-1.3.8.jar letsdo-nethervinery-forge-1.2.10.jar letsdo-vinery-forge-1.4.15.jar lightmanscurrency-1.20.1-2.2.1.3b.jar lionfishapi-1.8.jar magicvibedecorations-HALLOWEEN 1.5.0 1.20.1 forge.jar make_bubbles_pop-0.2.0-forge-mc1.19.4+.jar memoryleakfix-forge-1.17+-1.1.5.jar MobLassos-v8.0.1-1.20.1-Forge.jar modelfix-1.15.jar moonlight-1.20-2.11.14-forge.jar morediscs-1.20.1-33-forge.jar MouseTweaks-forge-mc1.20-2.25.jar Necronomicon-Forge-1.4.2.jar nether-s-exoticism-1.20.1-1.2.7.jar nethersdelight-1.20.1-4.0.jar nomowanderer-1.20.1_1.6.4.jar oculus-mc1.20.1-1.7.0.jar origins-forge-1.20.1-1.10.0.7-all.jar origins-plus-plus-2.2-forge.jar Paraglider-forge-20.1.3.jar Patchouli-1.20.1-84-FORGE.jar Paxi-1.20-Forge-4.0.jar Pehkui-3.8.0+1.20.1-forge.jar player-animation-lib-forge-1.0.2-rc1+1.20.jar PlayerRevive_FORGE_v2.0.24_mc1.20.1.jar plushies-1.4.0-forge.jar polymorph-forge-0.49.3+1.20.1.jar projectvibrantjourneys-1.20.1-6.0.0.jar PuzzlesLib-v8.1.18-1.20.1-Forge.jar resourcefulconfig-forge-1.20.1-2.1.2.jar resourcefullib-forge-1.20.1-2.1.24.jar right-click-harvest-3.2.3+1.20.1-forge.jar rubidium-extra-0.5.4.3+mc1.20.1-build.121.jar Runelic-Forge-1.20.1-18.0.2.jar saturn-mc1.20.1-0.1.3.jar sawmill-1.20-1.3.13.jar scholar-1.20.1-1.0.0-forge.jar screenshot_viewer-1.2.1-forge-mc1.20.1.jar Searchables-forge-1.20.1-1.0.2.jar selfexpression-2.8 1.20.1.jar servercore-forge-1.5.1+1.20.1.jar ShulkerArmory_1.20.1_1.2.1_hotfix.jar simplehats-forge-1.20.1-0.2.4.jar simplevoicechat_broadcast-mc1.20.1-1.0.1.jar simplyswords-forge-1.55.0-1.20.1.jar smoothboot(reloaded)-mc1.20.1-0.0.4.jar Sniffer+-forge-1.20.1-0.3.0.jar sophisticatedbackpacks-1.20.1-3.20.5.1044.jar sophisticatedcore-1.20.1-0.6.21.609.jar sophisticatedstorage-1.20.1-0.10.21.793.jar spark-1.10.53-forge.jar stalwart-dungeons-1.20.1-1.2.8.jar starlight-1.1.2+forge.1cda73c.jar step-1.20.1-1.2.2.jar supermartijn642corelib-1.1.17-forge-mc1.20.1.jar supplementaries-1.20-2.8.10.jar temporalapi-1.5.0.jar TerraBlender-forge-1.20.1-3.0.1.4.jar Terralith_1.20.4_v2.4.11.jar toms_storage-1.20-1.6.6.jar torchmaster-20.1.6.jar trashslot-forge-1.20-15.1.0.jar treasuredistance-1.20-1.2.jar tru.e-ending-v1.1.0c.jar v_slab_compat-1.20-2.3.jar vintagedelight-0.0.12.jar vmp-fabric-mc1.20.1-0.2.0+beta.7.101-all.jar voicechat-forge-1.20.1-2.5.11.jar waystones-forge-1.20-14.1.3.jar WI-Zoom-1.5-MC1.20.1-Forge.jar worldedit-mod-7.2.15.jar wsopulence1.2.0_Forge_MC1.20.1-1.20.4.jar xlpackets-1.18.2-2.1.jar YungsApi-1.20-Forge-4.0.4.jar YungsBetterEndIsland-1.20-Forge-2.0.6.jar YungsBetterNetherFortresses-1.20-Forge-2.0.6.jar YungsBetterOceanMonuments-1.20-Forge-3.0.4.jar YungsBetterStrongholds-1.20-Forge-4.0.3.jar
    • Like the title i wanted to render a obj model into minecraft but i cant find any tutorials for this.
  • Topics

×
×
  • Create New...

Important Information

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