Posted December 11, 201510 yr How could I make it so that I spawn in my own dimension instead of the overworld. Or at least change the overworld to be completely my biomes.
December 11, 201510 yr Those are two very different questions. If you want to completely replace the overworld with your own biomes, the only way I can think to do that is to have your generator clear out the entire chunk with air, then re-generate your custom terrain as needed (and register it with a high weight so it comes after other generators). If you want players to just spawn in your custom dimension, but still have a way back to the overworld, you can just check the public Entity.dimension value on all EntityPlayer entities, and if it's not your custom dimension ID, call Entity.travelToDimension(int dimension_id) on them to move them there. You may also want to keep a map of everyone you've done that to, so you don't force them into your dimension every time they try to leave it. Whatever Minecraft needs, it is most likely not yet another tool tier.
December 11, 201510 yr Author so, what would you say is the best way to change the entityplayers dimension id and store it?
December 11, 201510 yr Use a custom IExtendedEntityProperties if you need a per player dim id Also use PlayerEvent.PlayerRespawnEvent To send them. should work pretty cleanly I think its my java of the variables.
December 12, 201510 yr Author I added the extended properties that stores the dimension stuff, but every time I try to use the .travelToDimension, I get a NullPointerException. Could you explain where I need to put this. I have an Event Handler class, but what event should it go into? Sorry, I'm pretty new to modding, but even more of a noob at EventHandlers.
December 12, 201510 yr You need to post the code for your EntityConstructingEvent handler, your PlayerRespawnEvent handler, and your IEEP class I think its my java of the variables.
December 12, 201510 yr Author So, I'm not getting an error anymore, but I still can't get it to work. This is my player respawn event @SubscribeEvent public void onPlayerRespawn(PlayerRespawnEvent event) { if(event.player.dimension==0) { event.player.travelToDimension(; } } and this is how im creating the handler MinecraftForge.EVENT_BUS.register(new MyEventHandler()); and yet I still can't get the onPlayerRespawn event to actually run. This is my entity constructing class @SubscribeEvent public void onEntityConstructing(EntityConstructing event) { if(event.entity instanceof EntityPlayer && ExtendedPlayer.get((EntityPlayer) event.entity)==null) { ExtendedPlayer.register((EntityPlayer) event.entity); } if(event.entity instanceof EntityPlayer && event.entity.getExtendedProperties(ExtendedPlayer.DIM)==null) { event.entity.registerExtendedProperties(ExtendedPlayer.DIM, new ExtendedPlayer((EntityPlayer) event.entity)); } } and this is my IEEP class public class ExtendedPlayer implements IExtendedEntityProperties{ public final static String DIM = "dimension"; private final EntityPlayer player; private int currDim; public ExtendedPlayer(EntityPlayer player) { this.player=player; currDim = player.dimension; } public static final void register(EntityPlayer player) { player.registerExtendedProperties(ExtendedPlayer.DIM, new ExtendedPlayer(player)); } public static final ExtendedPlayer get(EntityPlayer player) { return (ExtendedPlayer) player.getExtendedProperties(DIM); } @Override public void saveNBTData(NBTTagCompound compound) { NBTTagCompound properties = new NBTTagCompound(); properties.setInteger("Current Dimension", currDim); compound.setTag(DIM, properties); } @Override public void loadNBTData(NBTTagCompound compound) { NBTTagCompound properties = (NBTTagCompound) compound.getTag(DIM); this.currDim = properties.getInteger("Current Dimension"); } @Override public void init(Entity entity, World world) { } }
December 12, 201510 yr PlayerRespawnEvent is on the FML event bus, not the MinecraftForge event bus: FMLCommonHandler.instance().bus().register(new YourFmlEventHandler()); I believe they are merging all of the event buses into one for Forge 1.8.8, so eventually you won't have to worry about that anymore. EDIT: Pretty standard day - ninja'd by diesieben. http://i.imgur.com/NdrFdld.png[/img]
December 12, 201510 yr Author While I'm here, could someone tell me how I could load obj into my mod. I've googled stuff, but I can't figure out how to apply the obj to my item. It is probably simple, but I'm a noob.
December 12, 201510 yr Author The player respawn works, but only if i kill myself not on joining the world, and it loads my dimension, but I spawn in the nether, then in the console it says my dimension unloaded. EDIT: Also what chunk manager should I use? EDIT #2: My createChunkGenereator was misspelled.... oops, but now I get teleported into void world and I can't move. It is like the terrain is there, I just can't see it or interact with it....
December 14, 201510 yr Author Can someone help me, I don't know why this is happening. Here is my World Provider Class public void registerWorldChunkManager() { this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.desert, 0.1f); this.dimensionId = MyMod.dimensioId; } @Override public IChunkProvider createChunkGenerator() { return new ChunkProviderMyMod(worldObj, worldObj.getSeed(), true, null); } @Override public String getDimensionName() { return "MyDimension"; } @Override public String getInternalNameSuffix() { return null; } @Override public boolean canRespawnHere() { return true; }
December 14, 201510 yr Author I got it to let me be in my dimension, but when I changed it to generate my biome instead of a desert, I get teleported to the Nether again.
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.