Jump to content

Two things I need help with


Willatendo

Recommended Posts

One: I, even after asking for help, cannot figure out how to make it so when, with a custom item, you travel to my custom dimension. I tried with OnRightClickEvent and with OnItemUse but still couldn't get it to work.

 

Here's my current code with it (with a null just so I don't have useless code on in my mod)

public class PermianEraTimeBook extends Item
{
	public PermianEraTimeBook(Properties properties) 
	{
		super(properties);
	}
	
	@Override
	public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) 
	{
		return null;
	}
	
	@Override
	public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) 
	{
		if(KeyboardUtil.isHoldingLeftShift())
		{
			tooltip.add(new StringTextComponent("\u00A73" + "An old book full of strange symbols (WIP)" + "\u00A74"));
		} else
		{
			tooltip.add(new StringTextComponent("Hold " + "\u00A76" + "Shift" + "\u00A76" + "\u00A7f" + " For More Information"));
		}
	}
}

 

Two: I want said custom dimension to have multiple biomes, but no matter what I still only find one biome

 

Here's the biome provider:

public class PermianBiomeProvider extends BiomeProvider
{
	@SuppressWarnings("unused")
	private Random rand;
	private static final Set<Biome> biomeList = ImmutableSet.of(BiomeInit.PERMIAN_DESERT.get(), BiomeInit.PERMAIN_MOUNTAINS.get(), BiomeInit.PERMIAN_CONIFER_FOREST.get(), BiomeInit.PERMIAN_FLOOD_BASALT_WASTES.get(), BiomeInit.PERMIAN_VOLCANO.get());

	double biomeSize = 32.0d;
	
	public PermianBiomeProvider() 
	{
		super(biomeList);
		rand = new Random();
	}
	
	@Override
	public Biome getNoiseBiome(int x, int y, int z) 
	{
		return BiomeInit.PERMIAN_DESERT.get();
	}
	
	public Biome getBiome(List<Biome> biomeList, double noiseVal) 
	{
		for (int i = biomeList.size(); i >= 0; i--) 
		{
			if (noiseVal > (2.0f / biomeList.size()) * i - 1)
				return biomeList.get(i);
		}
		return biomeList.get(biomeList.size() - 1);
	}
}

 

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



×
×
  • Create New...

Important Information

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