Jump to content

ModMCdl

Members
  • Posts

    188
  • Joined

  • Last visited

Posts posted by ModMCdl

  1. On 3/28/2021 at 1:31 PM, ChonkoTheGreat said:

    I added a new type of wood in my mod, so how exactly do I make them rotatable? I have already created changed the blockstate .json to how it is used in Minecraft, what else do I have to do to make them work?

     

    If it is a simply a new type of wood, you can just extend it off of LogBlock instead of the default Block.

  2. Hello. I'm having a very strange issue in regards to feature placement in my custom world gen: specifically mobs and structures. (Decorators work fine). In my custom chunk generator in my dimension, the generation is nonexistent. Structures don't spawn (the /locate command finds them, but nothing is there, and often the locations is not even in the correct biome). My mobs very rarely spawn at all. I have found them, but only once or twice and not nearly as high as they are weighted to spawn. The weird part is, if I create a buffet world with just the biome, everything spawns and generates fine

    Because of this, I thought that it might be related to my custom chunk generator just not being compatible with Minecraft's placement routines. My chunk gen is an adaptation of the end islands generation, just with more verticality to the islands. So I tested the generation in a buffet world with default end generation, and the spawning/placement again worked fine.

    Could anyone possibly take a look at maybe see something that I missed in regards to the generation, or an explanation as to why this might be happening? Thanks.

    Structure class at GitHub

    Creature Spawns class at GitHub

    Entire repo (if you need/want it)

  3. 1 minute ago, SubliminallySublime said:

    I have looked for any such tutorial, but as you are telling me they exist, I am checking again. I will edit this comment and my post if I find something that solved this problem.

    My question is however, if the user has tweaked their overworld settings, can data-driven dimensions hijack and exactly replicate those settings to a different dimension for 1:1 block sameness?

    This is one such example I was referring to: https://minecraft.gamepedia.com/Custom_dimension

     

    As for 1:1 block sameness, I'm not 100% sure, as data-driven dimensions are resultants of seeds.

     

    Also, if a vanilla generator does not fall into the parameters of your project, you can still create custom generators for dimensions with forge if you need to. You'll just call said custom generator in the .json.

  4. 24 minutes ago, SubliminallySublime said:

    I was wondering if he needs advanced dimensions like I do. Data driven dimensions work, but are they capable of producing and exact clone of the current overworld, settings and all? If so, I have a recent question here that I would love help with as this was possible in 1.12-1.15 but no longer seems possible in 1.16.

     

    Edit: I reviewed OPs code. I'm pretty sure data driven dimens will work for his situation. 

    Oh that definitely should work. As a matter of fact, I believe that the MC Wiki or even Mojang have examples for clones of the overworld, nether, and end.

  5. 7 minutes ago, SubliminallySublime said:

    Did you ever come across a solution? Do the data driven dimensions work for you? 

    Data driven dimensions work fine, given other examples I have found. However work and real life forced me to stop working on mods for a while, so I have personally not gotten them implemented myself. I can't speak for the OP however.

  6. 37 minutes ago, Moomallowz said:

    If you were asking for my issue...

    REQUIRED TYPE: IItemProvider
    PROVIDED: RegistryObject <net.minecraft.item.item>

    If you were asking what my issue was, everything I touch breaks. It's hereditary, I think.

    If you're registering your objects using a deferred register, you'll need to use

    RegistryHandler.EXOTIC_SPICE.get()

     

    • Like 1
  7. 2 hours ago, diesieben07 said:

    All you need to do is change the entity's position in placeEntity of your teleporter. That is literally the method is used for.

    Been picking this problem apart for a few hours now.

     

    This is what I'm working on, which from what I've gathered should get the spawn points for each world and place them in a BlockPos, but I'm not sure what I should be doing afterwards to return the new position to the Player. Looking through the javadocs, it appears that repositionEntity is reserved for portal placement specifically, so I don't think I want to return that as true. Right now my script does nothing, as I don't call these new dimensions anywhere.

        @Override
        public Entity placeEntity(Entity entity, ServerWorld currentWorld, ServerWorld destWorld, float yaw, Function<Boolean, Entity> repositionEntity)
        {
            BlockPos pos;
    
            if(destWorld.dimension.getType() == DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE))
            {
                pos = destWorld.getSpawnCoordinate();
            }
            else if(destWorld.dimension.getType() == DimensionType.OVERWORLD)
            {
                pos = destWorld.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, destWorld.getSpawnPoint());
            }
            return repositionEntity.apply(false);
        }

     

    I don't really know what ask here without sounding stupid, and I know everyone hates it when people ask stupid questions here. You've given me a lot of good information on how to go about doing this, but do you have an example to point me to or an implementation? As I said before, I don't understand how it is working in the vanilla Teleporter class. I tried updating my forge mappings to try and clear up the methods in the Teleporter class, but that didn't seem to change much.

  8. 5 minutes ago, diesieben07 said:

    Please describe what you want to achieve from a gameplay perspective, not how you have attempted to program it.

    I have an item that on right click, teleports the player to another dimension. I do not want it to spawn a portal. I simply want to teleport the player to their relative coordinates in either dimension, but move them to the nearest "safe" surface. (In the overworld, this would be the surface, in my "void" dimension, this would be the nearest island). Originally, this seemed like the best option. However, after going through the code, I think a better alternative and easier solution would simply be to teleport to each world's spawnpoint. I've been told that each method follows the same idea of relocating the entity, but spawnpoints have an existing implementation, and I can kind of see how it's done with the if statement in player#changeDimension relating to the end.

     

    My problem is while I have a general idea of how to do this, I do not know where to place this method so that it will successfully be called when the player teleports. I have considering putting it into my custom teleporter, but I'm not sure how to go about doing that without creating an entirely new changeDimension function. I'm lost in terms of I know the theory behind doing it, but have no idea how to actually implement it. Usually I can find an example in the vanilla code, (which is how I learn most of how I do modding, as seeing examples for me is the best sort of jumping-off point) but I can't seem to find a specific example that actually does what I want, and when I do, the specific use case does not allow me to implement it successfully.

  9. Just now, diesieben07 said:

    That's exactly what a custom teleporter does, right? what do you mean by "conditions"?

    I'm using changeDimension accepts a DimensionType and then ITeleporter, at least as far as I can tell, and so right now I'm using 

                   player.changeDimension(world.dimension.getType() == DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE) ? DimensionType.OVERWORLD : DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE), new VoidTeleporter((ServerWorld) player.getEntityWorld()));

     

    Passing in my custom dimension and then my custom teleporter.

     

    My custom teleporter only overrides placeEntity from ITeleporter so that it does not place a portal. Forgive me, but I can't find how I would add additional methods to check, and as @vemerionhad mentioned, the place portal method that might be doing that is quite "unreadable," or at the very least hard to dissect.

     

    Custom Teleporter: https://github.com/ModMCdl/Voidaic-Depths/blob/master/src/main/java/com/modmcdl/voidaicdepths/util/VoidTeleporter.java

  10. 8 hours ago, diesieben07 said:

    You can use World#getHeight to get the surface y position at a given x and z coordinate. You can then use that to place the player on the surface.

    Thank you, I had tried doing that with the players spawnpoints, and World#getHeight is definitely a good thing to hear about. I also think I might have been phrasing my question wrong this entire time. I don't know how to implement additional, conditions shall we say, into the changeDimension method. Or even if I can. Do I need to write a custom teleport method to do this? Same thing with sending each player to the spawn point. (Sorry, I just really have no idea what I'm doing in this instance.)

  11. Just now, MrInfinity said:

    https://minecraft.gamepedia.com/Nether_portal#Portal_search - Under Portal Creation

     

    Here it says that a nether portal first looks for any valid locations in a 4x4 chunk radius around the center of where it would spawn. If it finds none, then it will spawn somewhere between y 90 and 10 blocks below the world limit. So if you create a nether-portal like portal, it would follow those rules, meaning that if it spawned in empty space, the floating portal would be created

    I don't create a portal though, as I specified in my OP. I use a special item to teleport players in between dimensions. 

  12. 11 minutes ago, MrInfinity said:

    Well In the nether, if you spawn above lava, you spawn inside of a portal with 1 block out on both sides. You might want to use this solution. Or you could have it automatically place a block under the player when they spawn in

    But the portal still tries to locate the nearest solid ground to place a portal on, does it not? I tried reverse engineering that code but I was either looking at the wrong methods or just don't know how it's doing that.

     

    And whilst I could just spawn a block under the player, that doesn't seem like a survival-friendly solution. 

  13. Hello. I wrote a custom teleporter (a basic implementation of ITeleporter) to bring the player in-between my custom dimension and others negating portal spawn. However, the generation in my dimension is made up of floating islands, similar to the End. Right now my custom teleporter brings players to the exact coordinates in each dimension, which results in them high up in the air, falling into the void, or spawning inside a block. What I would like to do is either of the following, for two separate instances:

     

    a). Teleport the player to the nearest safe surface in each world. (Nearest island in my dimension, and up to the surface in the overworld).

    b). Teleport the player to their own spawn point in the overworld, and the origin of my dimension.

     

    I've poked around in the vanilla classes a bit, but can't seem to find any instances of this type of teleportation. Are there any examples of this that you can point me in the direction of and/or does anyone know how to achieve this?

     

    Thanks.

  14. On 11/10/2020 at 3:34 AM, vemerion said:

    Teleporter is the vanilla Minecraft class, while ITeleporter is the forge alternative. There is no reason the extends Teleporter, since everything you get from it is a bunch of portal spawning logic. Your VoidTeleporter should work as desired if you implement ITeleporter, but keep the placeEntity override, since as the documentation in ITeleporter says, a portal will not spawn if you supply the Function with false.

    Alright, thank you! It has been implemented and it works like a charm!

  15. 6 hours ago, Licoricethecat said:

    Hello! I'm new to modding, and I can't figure out this one single problem. I seem to be doing it right, but when I typed in the mod_id for registering items, my mod_id turns red and it says, "cannot resolve symbol PlayerShrink". If anyone could tell me what the problem is or if there's anything I'm doing wrong, that would be great! Here's the line of code:

    Screen Shot 2020-11-12 at 8.28.38 AM.png

    You did not import PlayerShrink, assuming that is the correct name of the class where you defined your MOD_ID.

  16. 2 hours ago, trashraccoon42 said:

    You willing to share what the problem was/how you fixed it?

    Not to necro a dead thread, but the easiest way to do this if you're simply just making a slab that does nothing but be a slab would just register it as such.

        public static final RegistryObject<Block> CUSTOM_SLAB = CUSTOM_BLOCKS.register("custom_slab", () -> new SlabBlock(properties));

    where CUSTOM_BLOCKS is your DeferredRegister for your blocks and properties are whatever properties (hardness/material/etc.) you want your slab to integrate.

  17. UPDATE:

    Okay, so I finally got this to work. I used the method as I had pasted in my previous post:

                   player.changeDimension(world.dimension.getType() == DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE) ? DimensionType.OVERWORLD : DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE), new VoidTeleporter((ServerWorld) player.getEntityWorld()));

     

    in combination with this VoidTeleporter.java that I was told wouldn't work/I shouldn't use:

     

    public class VoidTeleporter extends Teleporter
    {
        public VoidTeleporter(ServerWorld world)
        {
            super(world);
        }
    
        @Override
        public Entity placeEntity(Entity entity, ServerWorld currentWorld, ServerWorld destWorld, float yaw, Function<Boolean, Entity> repositionEntity)
        {
            return repositionEntity.apply(false);
        }
    }

     

    It works - I teleport between the desired dimensions without generating nether portals. I'm hesitant to call this solved though, as I would like to know why I should not be extending Teleporter.

×
×
  • Create New...

Important Information

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