Jump to content

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


Recommended Posts

Posted (edited)

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
Posted

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.

 

 

Posted

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.

 

 

Posted (edited)

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
Posted (edited)

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
Posted
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
Posted (edited)

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
Posted
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"));

 

Posted
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.

Posted (edited)

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
Posted
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.

Posted (edited)

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
Posted

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)

Posted

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)

Posted

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)

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

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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