• 0

    posted a message on Nether Structure Generation Height

    *bump*

    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on Forges UniversalBucket as a crafting recipe output

    Hey i try to make a recipe with forges UniversalBucket with my fluid as a recipe output. I created a _factories.json and set the path to a class file but I do not know what I have to write in there.


    Does anyone have experience with it? :)

    Posted in: Modification Development
  • 0

    posted a message on getDrops - Problem with TileEntity

    Okay i solved the problem!

    Posted in: Modification Development
  • 0

    posted a message on getDrops - Problem with TileEntity

    Hey, it try to make the block drops a list of some items based on the type of my tile entity, but it didnt work... i think its a problem of getting the tile entity.


    Does anyone know whats to do?



    Block class:


    	@Override
    	public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { 
            ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
    			TileEntity te = world.getTileEntity(pos);
    			if(te != null && te instanceof TileEntityRuneStone) {
    				TileEntityRuneStone runestone = (TileEntityRuneStone) 
    
    			drops.add(new ItemStack(this));
    				
    			if(runestone.getType() != "0") {
    				drops.add(new ItemStack(Item.getByNameOrId(Reference.MODID + ":rune_" + runestone.getType())));
    			}
    		}
    			
    		System.out.println(drops);
    		return drops;
    	}


    Posted in: Modification Development
  • 0

    posted a message on Nether Structure Generation Height

    Thats my code now


    //Nether Generator
    if(world.provider.getDimension() == -1) {
    int count1 = 0;
    int count2 = 0;
    int minY = 100;
    Chunk chunk = world.getChunkFromBlockCoords(pos);
    IBlockState block1 = chunk.getBlockState(x & 15, y, z & 15);
    IBlockState block2 = chunk.getBlockState(x & 15, y - 1, z & 15);
    
    while (true) {
    if (block1 == Blocks.AIR.getBlockState() && block2 == Blocks.NETHERRACK.getBlockState()) break;
    --y;
    if (y < minY) break;
    block1 = block2;
    block2 = chunk.getBlockState(x & 15, y - 1, z & 15);
    }
    
    if (y >= minY) {
    if (y < 64) {
    ++count1;
    } else {
    ++count2;
    }
    
    if (count1 >= 2 && count2 >= 2) return y;
    }
    }
    
    return y;
    }


    The structures still spawning on the bottom of a netherrack overhang



    .

    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on Nether Structure Generation Height

    Hey, i tried to get the right height for a place to generate a structure but the structure generates always on the bottom of a netherrack overhang like this:



    Here is my code:

    public static int getGroundFromAbove(World world, int x, int z) {
    int y = world.getActualHeight();

    if(world.provider.getDimension() == -1) { //Nether Generator
    boolean foundNetherrack = false;
    boolean foundAir = false;

    while (!foundNetherrack && !foundAir && y-- > 0) {
    Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
    if (block == Blocks.AIR) {
    foundAir = true;

    if (block == Blocks.NETHERRACK) {
    foundNetherrack = true;
    }
    }
    }
    }

    return y;
    }


    I can´t find the issue... can anyone help me? :)

    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on GetGroundFromAbove

    Thaaaanks :D

    Posted in: Modification Development
  • 0

    posted a message on GetGroundFromAbove

    The strange thing is that all works fine if i only test for one block type. Like: foundGround = block != Blocks.AIR ;

    Posted in: Modification Development
  • 0

    posted a message on GetGroundFromAbove

    But this includes trees

    Posted in: Modification Development
  • 0

    posted a message on GetGroundFromAbove

    The structures spawn always at Y = 255

    Posted in: Modification Development
  • 0

    posted a message on GetGroundFromAbove

    Hey guys, i try to generate things on the ground and need the ground block from above. This is what i have now, but i can´t find out how to get the Y coordinate from the latest block. I´m too dumb to find the solution..xd




    	public static int getGroundFromAbove(World world, int x, int z) {
    		int y = 255;
    		boolean foundGround = false;
    		while (!foundGround && y-- > 0) {
    			Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
    			
    			foundGround = block != Blocks.AIR || block != Blocks.TALLGRASS || block != Blocks.SNOW_LAYER || block != Blocks.LEAVES || block != Blocks.LEAVES2 || 
    					block != Blocks.LOG || block != Blocks.LOG2 || block != Blocks.RED_FLOWER || block != Blocks.YELLOW_FLOWER || block != Blocks.CACTUS || block != Blocks.WATERLILY;
    		}
    //??
    
    		return y;
    	}


    Posted in: Modification Development
  • 0

    posted a message on Bug with enchanting book levels

    Hey guys, i have a problem with enchanting books, when i craft it with as example Fortune VII, it shows the right level on the item. But if i use it now on a tool, it enchants the item with Fortune III...


    Is this a bug or has anyone a idea?



    recipe.json file:


    {
      "type": "minecraft:crafting_shapeless",
      "ingredients": [
      
        {
          "item": "toolupgrades:modifier_advanced_lapis"
        },
        {
          "item": "minecraft:book"
        }
      ],
      
      "result": {
        "item": "minecraft:enchanted_book",
        "nbt": {
            "StoredEnchantments": [
                  {
                    "id": 16,
                    "lvl": 7
                  } 
                 ]
               }
      }
    }


    Posted in: Modification Development
  • 0

    posted a message on 1.12 - Custom Recipes

    its possible, i do it in my mod with these code, or is forge the reason?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on 1.12 - Custom Recipes

    "result": {
    "item": "minecraft:spawn_egg",
    "nbt": {
    "EntityTag": {
    "id": "Pig"
    }
    }
    }

    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.