Jump to content

ModMCdl

Members
  • Posts

    188
  • Joined

  • Last visited

Everything posted by ModMCdl

  1. Okay, so I got this to work: player.changeDimension(world.dimension.getType() == DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE) ? DimensionType.OVERWORLD : DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE), new VoidTeleporter((ServerWorld) player.getEntityWorld())); However, it is still generating nether portals upon changing dimensions.
  2. Apologies, I meant that PlayerEntity#changeDimension was not accepting the custom teleporter. As for implementing instead of extending, would you mean something like this? (Basing it off of the Teleporter.java, but neglecting portal creation.) public class VoidTeleporter implements ITeleporter { protected final ServerWorld world; protected final Random random; public VoidTeleporter(ServerWorld worldIn) { this.world = worldIn; this.random = new Random(worldIn.getSeed()); } } If so, then how would I then pass this to my changeDimension method? Or do I need to trace back how PlayerEntity does it and recreate that for my custom teleporter. Looking into it, it seems like PlayerEntity#changeDimension has a parameter for setting the type of teleporter, but as I stated above, the method is not accepting mine.
  3. Do you have an example of this? I would think it would be something like this, but I can't quite get it to work. @Override public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, Hand hand) { if (!world.isRemote) { player.changeDimension(world.dimension.getType() == DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE) ? DimensionType.OVERWORLD : DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE)), new VoidTeleporter(ServerWorld); } return super.onItemRightClick(world, player, hand); } Trying to implement my custom teleporter VoidTeleporter is not working, and is erroring out. VoidTeleporter.class 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); } }
  4. UPDATE: I figured it out, but now it's spawning nether portals when teleporting, and I do not know why. I based this method off of the block collision in the EndPortalBlock, so I am not sure why or how this is happening. @Override public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, Hand hand) { if (!world.isRemote) { player.changeDimension(world.dimension.getType() == DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE) ? DimensionType.OVERWORLD : DimensionType.byName(VoidaicDepths.VOID_DIM_TYPE)); } return super.onItemRightClick(world, player, hand); }
  5. Hello. I have an item that I want onItemRightClick to check the player's dimension and then send the player to a specific dimension based on which dim is returned. The problem is that I can't figure out how to check which dimension the player is in. The method I would use in 1.12 used to be stored in the PlayerEntity, but it doesn't appear to be anymore. Can anyone point me in the right direction? Thanks.
  6. Hello! I have been having a strange issue with my structure generation. In few words, it's very "spotty." I have a simple 3x3 structure that I want to spawn in a custom dimension of my own, featuring its custom biomes. I have confirmed that the structure does spawn, however it seemed incredibly rare. So, I checked it out with the /locate command, and am realizing that the game registers that I have structures all over the place, but they are not being placed. I have also noticed that a lot of these "structure placements" are disproportionately in midair, but do not know why that is happening. I am very new to this new type of structure gen (that is, in 1.15 having only previously attempted it in 1.12), and have no idea what is causing this phenomenon. Thanks in advance for your help! Related files: VoidaicFeatures.java - where I register my structures VoidWellPieces.java - placement VoidWellStructure.java - placement VoidStructureGen.java - where i place my structure in the biome
  7. I don't have much experience with player effects, but there's most likely some way to isolate it to the client side of the player, rather than the whole server. I remember doing something vaguely like this in 1.12.2 with splash potions, but I don't really know if it's the same concept, and I don't even know if I could find the method in which I did that.
  8. So there is no way to hardcode dimensions anymore? It's been completely replaced with .json? And is this the same with biomes and other generation features? (The source you linked implied so).
  9. Thank you! I think this was exactly what I was looking for. I'm surprised your own forum post that you linked in the readme didn't turn up in my searches, it would have been quite helpful!
  10. So then, unfortunately, your method does not apply to my situation. ? I have used a structure block to save the files, and wish to have those be loaded in. I know this is possible, but do not know how to do it.
  11. First, sorry for being late to reply, a few things came up and got in the way. Second, while your way works for your case, I can't seem to derive how you are implementing the NBTs that a structure block outputs and generating them. Your second comment suggests that's not actually what you've done. To clarify, I already have all of the structures in NBT form from structure blocks, and I'm trying to load them in. Not looking for a "better way," looking for a way to work with what I already have, because I'm sure its possible. Thanks in advance!
  12. Hello, Back in 1.12.2, I used to implement structure gen via creating .nbt files from structure blocks. Upon researching how to do this in 1.15 and peeking into the code myself, a). Asking how to do this I get replies telling me that I shouldn't do that and just create my structure in "small, hard-coded fragments and string them together" or that "it hasn't been done yet, and figure it out yourself." ... I refuse to believe that these are the only solutions. b). Looking at the source, it does look mostly hard-coded and its also obfuscated to high heaven, even after updating my mappings to the latest stable snapshot. I don't like to come to this forum not knowing anything on a certain topic, but right now I'm kinda stuck. I've been working around this problem for weeks, getting everything else I needed to done before tackling this. And so I ask: Does anyone have any examples of implementing and generating NBT structures in 1.15?
  13. Your blockstate folder is not inside that test directory.
  14. Just because "it works fine" does not mean it is correct. We're pointing out what is causing the problem you are having now, and will continue to have. resources\assets\test\blockstates etc. is where everything needs to be for forge to find it correctly.
  15. Your folder should be set up as resources\assets\modid\blockstates etc. Not what you have there.
  16. A). Forge cannot find your blockstate file. It is either not named "plastic_block.json" or is not in the blockstates folder. Thus, it cannot find your model file either. B). This was incredibly hard to read. Again, please use codeblocks or https://pastebin.com to post large blocks of log output/code like this. No one can read through that easily, and we won't be able to effectively help you.
  17. Although this is incredibly hard to read, (in the future please make use of code blocks/spacing), your .json files look valid. Is everything named correctly and in the correct location? Also this:
  18. Considering it has it's texture in the inventory, most likely your item model is correct, and it is instead a problem with your blockstate.json file. Can you post your blockstate, block model, and item model .json?
  19. Sorry for the delayed response, it was 1 am for me and I was getting frustrated. I played around with it a little bit this morning, and got it working thanks to both of you. For future people looking at this thread, here was the solution: I created my own fillerBlockType class that called from OreFeatureConfig.FillerBlockType, and then adjust the constructor parameters to match what I needed. public static class customFillerBlockType { public static final OreFeatureConfig.FillerBlockType CUSTOM_FILLER = OreFeatureConfig.FillerBlockType.create("CustomFiller", "custom_filler", new BlockMatcher(ModBlocks.DFBLOCKNAME.get())); } And then I called my customFillerBlockType.CUSTOM_FILLER where you would call FillerBlockType.NATURAL_STONE or otherwise. Thanks again!
  20. Another update: setting it to the existing enum value doesn't work - the ore doesn't spawn in. ConfiguredPlacement orePlacement = Placement.COUNT_RANGE.configure(new CountRangeConfig(12, 5, 5, 64)); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig .FillerBlockType.create(OreFeatureConfig.FillerBlockType.NATURAL_STONE.getName(), "voidstone", new BlockMatcher(VoidaicBlocks.VOIDSTONE.get())), VoidaicBlocks.VOID_ORE.get().getDefaultState(), 10)).withPlacement(orePlacement));
  21. So should I just create a static string and definite it as my own value, or do I need to call it from FillerBlockType? Because the only two options there are NATURAL_STONE and NETHERRACK and those both throw back errors that they aren't the proper strings.
  22. UPDATE: A quick update of the mappings clears it up a bit, and its been deobfuscated. public static FillerBlockType create(String enumName, String nameIn, Predicate<BlockState> predicateIn) { throw new IllegalStateException("Enum not extended"); } I was right about the nameIn and learned that predicateIn just finds the block, feel kinda dumb not figuring that out before. Still stuck on the enumName however.
  23. Hey, I'm trying to generate my custom ore in my dimension which is completely composed of my custom block. I've tried following how vanilla does it, utilizing the OreFeatureConfig file, but with no luck. It looks like OreFeatureConfig has a method for doing this: FillerBlockType.create, however its parameters are obfuscated and I can't make sense of it. Anyone have any ideas or demonstration they could point me to for help? The method in question from OreFeatureConfig.java public static FillerBlockType create(String enumName, String p_i50618_3_, Predicate<BlockState> p_i50618_4_) { throw new IllegalStateException("Enum not extended"); } I've dissected that p_i50618_3_ is probably the name of the FillerBlockType (as the string is returned as "natural_stone" for FillerBlockType.NATURAL_STONE and "netherrack" for FillerBlockType.NETHERRACK), but beyond that, I can't figure it out. Thanks!
  24. I use paint.NET to create most of my textures. It's easy to use, and you can easily zoom in so that the 16x16 grid takes up your entire screen with no loss in visual quality if you want. I do not know exactly what you mean by "automatic generator for model JSON files," but if you're talking about programs that can export a model to JSON, try blockbench. It has a webapp you can use, or a downloadable app for more functionality.
×
×
  • Create New...

Important Information

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