Jump to content

ModMCdl

Members
  • Posts

    188
  • Joined

  • Last visited

Everything posted by ModMCdl

  1. I believe you could do this by simply detecting whatever key is being pressed when it goes to access the container. It used to be called a KeyInputEvent, but I'm unsure if it changed for 1.15. I'd imagine it would also benefit you to do this with a Forge event, and then just have the item call your GUI whenever either keybind is activated and the item is in hand.
  2. If it is a simply a new type of wood, you can just extend it off of LogBlock instead of the default Block.
  3. 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)
  4. Hello. Really basic question here: I've been digging around, trying to replicate the obsidian spawn platform from the End, but I can't find where it is called and/or created. Does anyone know where I could find this im 1.15.2's source? Thanks!
  5. 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.
  6. 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.
  7. 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.
  8. Well, it's the reason his item wasn't being accepted, was it not? The line required an instance of an item, not the item itself which with a DeferredRegister is handled with .get()?
  9. If you're registering your objects using a deferred register, you'll need to use RegistryHandler.EXOTIC_SPICE.get()
  10. 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.
  11. 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.
  12. 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
  13. 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.)
  14. I don't create a portal though, as I specified in my OP. I use a special item to teleport players in between dimensions.
  15. 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.
  16. 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.
  17. Alright, thank you! It has been implemented and it works like a charm!
  18. You are not going to get any support for 1.12.2 here.
  19. You did not import PlayerShrink, assuming that is the correct name of the class where you defined your MOD_ID.
  20. If you are using IntelliJ, hovering over the errored/missing classes should give you an option to import those classes. I'd recommend learning how to use your IDE first before continuing.
  21. Are there not parameters in the json modelling of the item to accommodate this? Most tools do something vaguely similar to this, and I feel like it should be simple to expand off of that.
  22. 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.
  23. 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.