Can someone else confirm as a bug?

6 posts / 0 new
Last post
Offline
Last seen: 2 years 5 months ago
Joined: 03/10/2015 - 07:30
Gems: 0
Can someone else confirm as a bug?

I cannot place a custom flowers/plants on a custom grass/dirt block. Works with the original grass/dirt block. I also made sure to set Material as 'Grass' for the grass block. Any idea?



Offline
Last seen: 2 years 5 months ago
Joined: 03/10/2015 - 07:30
Gems: 0
BUMP! :D

BUMP! :D

xXMCXx's picture
Offline
Last seen: 2 months 3 weeks ago
Joined: 12/27/2013 - 21:01
Gems: 378
RE:BUMP! :D

@Ultimate_ReconX It might be the type of plant you are using. If you use 'Desert" plants then they can only be placed on sand.

Moderator

Offline
Last seen: 1 year 12 months ago
Joined: 05/16/2014 - 13:42
Gems: 0
You need to add additional

You need to add additional grass types to each of your Plants because Plants have an additional method for Blocks they can be placed on.
I cant tell you the exact code because I am coding currently only for 1.8 but I am sure you could find the Code if you search it on google

No longer using MCreator

Offline
Last seen: 2 years 5 months ago
Joined: 03/10/2015 - 07:30
Gems: 0
RE:You need to add additional

I did my research and could not find anything on the subject. I do see what you mean tho. It's registering the original grass/dirt block as blocks it can be placed on and see's my block's as new un-categorized blocks. Here is the code:

package mod.mcreator;//based on master condiguration

import cpw.mods.fml.client.*;
import cpw.mods.fml.client.registry.*;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.asm.*;
import cpw.mods.fml.common.asm.transformers.*;
import cpw.mods.fml.common.discovery.*;
import cpw.mods.fml.common.discovery.asm.*;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.functions.*;
import cpw.mods.fml.common.network.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.common.toposort.*;
import cpw.mods.fml.common.versioning.*;
import cpw.mods.fml.relauncher.*;
import cpw.mods.fml.server.*;
import net.minecraft.block.*;
import net.minecraft.block.material.*;
import net.minecraft.client.*;
import net.minecraft.client.audio.*;
import net.minecraft.client.entity.*;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.achievement.*;
import net.minecraft.client.gui.inventory.*;
import net.minecraft.client.model.*;
import net.minecraft.client.multiplayer.*;
import net.minecraft.client.particle.*;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.culling.*;
import net.minecraft.client.renderer.entity.*;
import net.minecraft.client.renderer.tileentity.*;
import net.minecraft.client.settings.*;
import net.minecraft.command.*;
import net.minecraft.crash.*;
import net.minecraft.creativetab.*;
import net.minecraft.dispenser.*;
import net.minecraft.enchantment.*;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.boss.*;
import net.minecraft.entity.effect.*;
import net.minecraft.entity.item.*;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.player.*;
import net.minecraft.entity.projectile.*;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.*;
import net.minecraft.nbt.*;
import net.minecraft.network.*;
import net.minecraft.network.rcon.*;
import net.minecraft.pathfinding.*;
import net.minecraft.potion.*;
import net.minecraft.profiler.*;
import net.minecraft.server.*;
import net.minecraft.server.dedicated.*;
import net.minecraft.server.gui.*;
import net.minecraft.server.integrated.*;
import net.minecraft.server.management.*;
import net.minecraft.src.*;
import net.minecraft.stats.*;
import net.minecraft.tileentity.*;
import net.minecraft.util.*;
import net.minecraft.village.*;
import net.minecraft.world.*;
import net.minecraft.world.biome.*;
import net.minecraft.world.chunk.*;
import net.minecraft.world.chunk.storage.*;
import net.minecraft.world.demo.*;
import net.minecraft.world.gen.*;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.layer.*;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.storage.*;
import net.minecraftforge.classloading.*;
import net.minecraftforge.client.*;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.sound.*;
import net.minecraftforge.common.*;
import net.minecraftforge.event.*;
import net.minecraftforge.event.entity.*;
import net.minecraftforge.event.entity.item.*;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.minecart.*;
import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.terraingen.*;
import net.minecraftforge.event.world.*;
import net.minecraftforge.oredict.*;
import net.minecraftforge.transformers.*;
import net.minecraft.init.*;
import java.util.*;

import net.minecraftforge.common.util.*;
import net.minecraft.client.renderer.texture.*;
public class mcreator_gemBush {

public mcreator_gemBush(){}

public static Block block;

public Object instance;public void generateNether(World world, Random random, int chunkX, int chunkZ){}
public int addFuel(ItemStack fuel){return 0;}
public void serverLoad(FMLServerStartingEvent event){}
public void preInit(FMLPreInitializationEvent event){

GameRegistry.registerBlock(block, "GemBush");
}
public void registerRenderers(){}
public void load(){
}

static{

block = (Block)(new BlockCustomFlower()).setHardness(0.01F).setResistance(0.0F).setLightLevel(0.0F).setBlockTextureName("BPlant").setBlockName("GemBush").setStepSound(Block.soundTypeGrass);Block.blockRegistry.addObject(176, "GemBush", block);

}

public void generateSurface(World world, java.util.Random randomGenerator, int chunkX, int chunkZ){
for(int i = 0; i < 1; i++){
int l6 = chunkX + randomGenerator.nextInt(16) + 8;
int i11 = randomGenerator.nextInt(128);
int l14 = chunkZ + randomGenerator.nextInt(16) + 8;
(new WorldGenFlowers(mcreator_gemBush.block)).generate(world, randomGenerator, l6, i11, l14);
}
}

public static class BlockCustomFlower extends BlockFlower{
IIcon la;
public BlockCustomFlower(){super(0);}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int p_149691_1_, int p_149691_2_){return this.la;}
@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister reg){
la = reg.registerIcon("BPlant");}
@SideOnly(Side.CLIENT)
@SuppressWarnings("unchecked")
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_){
for (int i = 0; i < 1; ++i){p_149666_3_.add(new ItemStack(p_149666_1_, 1, i));}}

public int quantityDropped(Random par1Random){
return 1;
}

public Item getItemDropped(int par1, Random par2Random, int par3){
return mcreator_rubyGreen.block;
}
}}

If possible, could I get a little help? Or if you are only coding for 1.8, could you post an example from 1.8 so I can get on the right track? Thanks.

Offline
Last seen: 1 year 12 months ago
Joined: 05/16/2014 - 13:42
Gems: 0
Paste this code under: public

Paste this code under: public static class BlockCustomFlower extends BlockFlower{

exchange your block with the Blockclass.blockname (I am not sure but it should be right if I can remember that from MCreator ^^)
And if you don't want that your Bush/Flower can be placed on grass or dirt just remove that stuff

@Override
protected boolean canPlaceBlockOn(Block ground)
{
return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.farmland || ground == your block;
}

No longer using MCreator