Jump to content

Recommended Posts

Posted

Hi everybody!

I'm trying to make a new mod for 1.7.10, but I have a problem:

For my mod, I want to create a maze in a dimension, and at the end of the maze a block teleport you into the next floor of the maze. Actually I want to make one floor per dimension(similar to mystery dungeon series). I think I will create two dimension, and when the player leave the first one, he gets teleported into the second and the first dimension regenerate. If he leave the second one, he will teleport to the first and the second will regenerate until he found the exit.

 

I've alredy created my dimension, the maze, the dimension regenerate but here is my problem: it seems like if the dimension is loaded, it cannot be deleted(logical), but i don't know how to force this unloading. I've try DimensionManager.setWorld(id,null); but it doesn't work... I also notice that sometimes the unloading is very long to operate ( I assume that the unloading is ongoing if the message "Unloading dimension x" is on the console).

 

Please help me!

Posted

Why force unload it? If you're on a server, and the dimension is unloaded when one person leaves and one is still in it; the player still in it would die. ALL dimensions are loaded when the game/server is started and unloaded when the server is stopped. There is really no need to unload the dimension just, send them to the new one.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

Actually, I want the dimension to be recreated, and so i have to delete it and to unload it. Is there any way to call a function to unload a dimension? Moreover, I won't delete a dimension if a player is inside, but for now i will make this mod work for one player.

 

I were thinking of adding a third dimension, so the first dimension will be deleted when the player leave the second to go to the third.

 

I also know that dimension can be deleted because sometimes when i came back into the first one, it have been regenerated.

Posted

I don't have exact answer, but two hints/ideas.

You could look into multiverse or multiworld repo for help.

You could track down vanilla unloading code.

If I were you I would start from world unload event.

  Quote

1.7.10 is no longer supported by forge, you are on your own.

Posted

Considering you want to delete and regenerate the dimension. I believe the actually world data would have to be deleted and re-created. Unloading a dimension saves it to it's current state I believe.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

Yes but the world can't be deleted if it is loaded.

Also, I have a problem on the world unload event, it seems that i can't make it work properly.

package com.MysteryDungeon.Main;

import java.io.File;

import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.util.FakePlayerFactory;
import net.minecraftforge.event.world.WorldEvent;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;

public class DungeonEventHandler {

    @SubscribeEvent(priority = EventPriority.HIGHEST)
    public void onDimensionUnload(WorldEvent.Unload event)
    {
    	System.out.println("Top");
        //Rest of the code
    }
}

And when a dimension unload, or when i stop the game (all dimension should unload when i close the game), the "Top" doesn't appear on console.

Did I miss something or did I do something wrong?

Posted

Ok my mad, I have register the wrong type of event, I used

FMLCommonHandler.instance().bus().register(new DungeonEventHandler());

instead of

MinecraftForge.EVENT_BUS.register(new DungeonEventHandler());

 

Now the dimension is deleted when minecraft unload it, but I still can't do it by myself. Anyone here have a solution?

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Yes that’s the full log, I managed to get it working last night, the anvil fix mod is what was causing it to crash
    • Hey guys, i'm currently developping a mod with forge 1.12.2 2860 and i'm using optifine and gradle 4.9. The thing is i'm trying to figure out how to show the player's body in first person. So far everything's going well since i've try to use a shader. The player's body started to blink dark when using a shader. I've try a lot of shader like chocapic, zeus etc etc but still the same issue. So my question is : How should i apply the current shader to the body ? At the same time i'm also drawing a HUD so maybe it could be the problem?   Here is the issue :    And here is the code where i'm trying to display the body :    private static void renderFirstPersonBody(EntityPlayerSP player, float partialTicks) { Minecraft mc = Minecraft.getMinecraft(); GlStateManager.pushMatrix(); GlStateManager.pushAttrib(); try { // Préparation OpenGL GlStateManager.enableDepth(); GlStateManager.depthMask(true); GlStateManager.enableAlpha(); GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // Éclairage correct pour shaders GlStateManager.enableLighting(); RenderHelper.enableStandardItemLighting(); GlStateManager.enableRescaleNormal(); // Active la lightmap pour les shaders mc.entityRenderer.enableLightmap(); // Position de rendu interpolée double px = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks; double py = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; double pz = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; GlStateManager.translate( px - mc.getRenderManager().viewerPosX, py - mc.getRenderManager().viewerPosY, pz - mc.getRenderManager().viewerPosZ ); // Rendu du joueur sans la tête Render<?> render = mc.getRenderManager().getEntityRenderObject(player); if (render instanceof RenderPlayer) { RenderPlayer renderPlayer = (RenderPlayer) render; boolean oldHeadHidden = renderPlayer.getMainModel().bipedHead.isHidden; boolean oldHeadwearHidden = renderPlayer.getMainModel().bipedHeadwear.isHidden; renderPlayer.getMainModel().bipedHead.isHidden = true; renderPlayer.getMainModel().bipedHeadwear.isHidden = true; setArmorHeadVisibility(renderPlayer, false); renderPlayer.doRender(player, 0, 0, 0, player.rotationYaw, partialTicks); renderPlayer.getMainModel().bipedHead.isHidden = oldHeadHidden; renderPlayer.getMainModel().bipedHeadwear.isHidden = oldHeadwearHidden; setArmorHeadVisibility(renderPlayer, !oldHeadwearHidden); } // Nettoyage post rendu mc.entityRenderer.disableLightmap(); GlStateManager.disableRescaleNormal(); } catch (Exception e) { // silent fail } finally { GlStateManager.popAttrib(); GlStateManager.popMatrix(); } }   Ty for your help. 
    • Item successfully registered, but there was a problem with the texture of the item, it did not insert and has just the wrong texture.     
    • Keep on using the original Launcher Run Vanilla 1.12.2 once and close the game Download Optifine and run optifine as installer (click on the optifine jar) Start the launcher and make sure the Optifine profile is selected - then test it again  
    • Hi everyone, I’m hoping to revisit an old version of Minecraft — specifically around Beta 1.7.3 — for nostalgia’s sake. I’ve heard you can do this through the official Minecraft Launcher, but I’m unsure how to do it safely without affecting my current installation or save files. Are there any compatibility issues I should watch out for when switching between versions? Would really appreciate any tips or advice from anyone who’s done this before! – Adam
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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