YAMDA - Yet Another Mining Dimension Attempt

YAMDA - Yet Another Mining Dimension Attempt

2M Downloads

Right Click not working 1.14.4

TheFalloutManiac opened this issue ยท 13 comments

commented

latest.log
Forge Version: 1.14.4-forge-28.0.41
Mod Version 4.0.1
I've tried on a clean install and still doesn't work when right clicking the block dimension.
Tried on a new world as well.
Don't have any mods that add ores.
Tried with just YAMDA installed, didn't work either.
List of mods installed:
-Clay conversion
-Durability101
-EnchantmentDescriptions
-FastLeafDecay
-HWYLA
-InventorySorter
-JEI
-Neat+
-NoFog
-practicaltools
-reap
-Xaeros_minimap
-YAMDA

commented

I managed to fix the bug. So, thanks for making the mod open source as this bug totally bugged me.
It was not the fault from Forge, but forge is quite delicate when it comes to dimensions or, generally, the registry.

You made two major mistakes:

  1. You should reuse as much resources and data as possible. Like having three ResourceLocations for the same thing. Two wrong and one right one. The right one is located in the YAMDAEventhandler:
    DimensionManager.registerDimension(new ResourceLocation(MODID, "mining_dim"), YAMDA.dimension, null, true);
    The wrong one is in YAMDA:
    public static final ResourceLocation MINING_DIM = new ResourceLocation("yamda:mining_dim");
    With yamda:mining_dim, you are doing an override which was one thing that bugged Forge. With this, Forge made minecraft:mining_dim.

As you later check the dimension by name, you have it registered as minecraft:mining_dim and as yamda:mining_dim. Which somehow has worked and not worked sometimes as it happened that nothing was registered for some reason.

So, what I did, I used only one ResourceLocation in the YAMDA-file:
public static final ResourceLocation YAMDA_DIM = new ResourceLocation(MODID,"yamda_dim");

Then I reused that one ResourceLocation for the registryName of the ModDimension:
public static ModDimension dimension = new ModDimension() { @Override public BiFunction<World, DimensionType, ? extends Dimension> getFactory() { return YAMDADimension::new; } }.setRegistryName(YAMDA_DIM);

In the EventHandler the registration of the dimension is:
DimensionManager.registerDimension(YAMDA.YAMDA_DIM, YAMDA.dimension, null, true);

Now the dimension is properly registered.

Then I found out that there was a second bug, which appeared when the mod was installed after the world was created. It didn't get a registration of the dimension beforehand, which happens when the client starts. So I have added a null-check and if it returns true, it registers the dimension before trying to access it.

if(DimensionType.byName(YAMDA.YAMDA_DIM) == null){ DimensionManager.registerDimension(YAMDA.YAMDA_DIM, YAMDA.dimension, null, true); } World otherWorld = worldIn.getServer().getWorld(DimensionType.byName(YAMDA.YAMDA_DIM));

I'll try to find out how to make a pull request on here.

commented

Please use https://paste.feed-the-beast.com and paste the log of the issue happing with only yamda

commented

It seems to sometimes work and sometimes not work.
When it doesn't work, the following error pops up in latest.log after right clicking:
https://paste.feed-the-beast.com/view/393402db

It occurs with mods or no mods, examples:

All kind of mods: Didn't work
Only Forge/Optifine and YAMDA: Didn't work
Only Forge/YAMDA: Works all of a sudden
Only Forge/Optifine and YAMDA: It works strangely
Adding all other mods: It works still
Loading existing map, doesn't work again

commented

i think its more of a forge issue then mod issue... there no useful information in the logs

commented

Strangely I can't get it to work now anymore.. lol
Tried forge version 28.0.45, 28.0.49 and 28.0.55
Even with no other mod (not even Optifine) it just gives me the "Dimension type must not be null" error on right clicking

I really wonder where that error comes from..

commented

I have the same problem, with no error log. However, the config has a notation for overworld dimension id, but none for mining world dimension id ("overworldId = 0"). Is it possible we need to assign a mining dimension id?

commented

same thing happening to me

commented

for me it works in singeplayer but not on server

commented

I'm getting the same problem but it doesn't crash, it just does nothing when I right click it.

Forge Version: 28.0.102

commented

Missing Dimension Name: 'mining_dimension:mining_world' Id: 3 Type: 'mining_dimension:mining_world

commented

Is that a solution? How would I wright that in the config?

commented

no i was telling the dev the msg it gives me in console on server