Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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);
	}
}

 

First point, you should look at Entity::changeDimension (the one with the ITeleporter instance, server side only).

Second point, I mean it doesn't help when your noise biome is only one biome. Take a look at OverworldBiomeProvider. That should answer your question.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.