Jump to content

chxr

Members
  • Posts

    53
  • Joined

  • Last visited

  • Days Won

    1

chxr last won the day on April 24

chxr had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

chxr's Achievements

Stone Miner

Stone Miner (3/8)

1

Reputation

  1. I'm developing a dimension, but it's kinda resource intensive so some times during player teleporting it lags behind making the player phase down into the void, so im trying to implement some kind of pregeneration to force the game loading a small set of chunks in the are the player will teleport to. Some of the things i've tried like using ServerLevel and ServerChunkCache methods like getChunk() dont actually trigger chunk generation if the chunk isn't already on persistent storage (already generated) or placing tickets, but that doesn't work either. Ideally i should be able to check when the task has ended too. I've peeked around some pregen engines, but they're too complex for my current understanding of the system of which I have just a basic understanding (how ServerLevel ,ServerChunkCache and ChunkMap work) of. Any tips or other classes I should be looking into to understand how to do this correctly?
  2. You need to create a class implementing the ITeleporter Interface, and override its placeEntity() method in which you'll have the logic to safely place the teleported entity in the inbound dimension. Whenever you need to use said class just create a new instance of it and call the changeDimension method of the entity you want to teleport with the ServerLevel instance of the target dimension and the teleporter class: MinecraftServer mcServer = level.getServer(); ServerLevel targetDimension = mcServer.getLevel(TARGETDIMENSIONLEVELKEY); if (targetDimension != null) { CustomITeleporter teleporter = new CustomITeleporter(. . .); entity.changeDimension(targetDimension, teleporter); } EDIT: As far as i can tell this works on 1.19+. You didn't specify your version so I defaulted to the most recent one(s)
  3. If you need translucency (semitransparent/semiopaque) you will also need to mark the renderypes of whichever blocks you need as translucent in the client via a FMLClientSetupEvent (It is like this in 1.20+ and im pretty sure it works as well on 1.19)
  4. Como ya he dicho, si. Puedes seguir las instrucciones que te han dejado arriba si lo quieres hacer en tu ordenador, pero seguramente tendrás que hacer cosas como abrir puertos, usar programas como Hamachi o algun tipo de servidor virtual. Además de que tendrás que encargarte TU de encender tu PC y cargar el servidor cada vez que alguien quiera entrar
  5. Pues para empezar, el querer tenerlo encendido todo el día en tu PC no es recomendable, tanto por los puertos que tendrías que abrir como por el consumo. Necesitarías un buen pC para tener un servidor, jugar y hacer otras cosas a la vez y tus amigos NO podrían encenderlo ellos a no ser que les des acceso remoto a tu ordenador (cosa no recomendable) por lo que en principio te recomendaría un servicio de hosting para el servidor, aunque lo más probable es que tendrías que pagar.
  6. We might be able to help you if you tell us where exactly you have problems
  7. Te puedo ayudar, pero necesito mas info. ¿Hosteado en tu PC? ¿En una web de hosting? ¿Que version? ¿Qué problemas tienes? ¿Qué capacidades quieres que tenga el servidor? (Encendido todo el dia/Solo cuando estes tu, cuantos mods quieres, para cuanta gente. . .)
  8. Ok it was literally WAAAY easier using blockstates. Thanks for reminding me they exist lmao
  9. I've ended up doing it the "dirty" way and had 8 different subblocks spawning from placing the "full block". All of them share the same class and share a small logic block to handle what happens when they're mined. Will check the blockstate thing though.
  10. You can theoretically do this by implementing your own ChunkGenerator, but im not sure how. I'm also tinkering with dimensions so if i come to a more specific answer i'll tell you
  11. What would be the best logic to manage a multiple block block? I already know how some use halves like doors, but mine is supposed to be a 2x2x2 block. Is just decor, doesn't do anything special, so what is the recommended way to go about it since bounding boxes have a limit of 1 block?
  12. So im full into world generation right now, carving shit for a dimension I'm doing. I understand what the CarvingMask is, if i understand correctly, an array of bits that, for each chunk, marks wether the block the bit represent is (1) or isn't (0) carved. But I'm not seeing what uses it can have. Under what circumstances is good to make and keep track of a carvingmask?
  13. Yes, it is possible. You should develop the API as a separate project. Wether you want your mod to have the API integrated or have a dependency on it is up to you. I'd say that for testing the API integration, you should have it separated and add it as a dependency to your mod (at least, thats how I've done it in the past). I recall there is also option to compile different parts of your project on different jars. Either way, thats more of a forgegradle question, if i understand it correctly
  14. Yeah I had a similar idea, at some point I also just got the numBlocksCorrupted++ out of the if block so it would just do a loop numBlocksCorrupted amount of times but it still caused some troubles. I've ended up using an extra feature to generate the blob around the ore and its working wonders so I won't be scratching my head much longer with it
  15. I think i've found a more "generation friendly way" of generating random blobs of mineral around the ore. This both does the trick and make the generation work flawlessly (albeit i need to make some adjustments). I just ended up thinking "MAYBE there is another Feature I can use to place the minerals instead of doing it manually" And, low and behold, SCATTERED_ORE is actually a thing. I don't really know how "orthodox" this solution is, but it works and rids me of all the problems I had witht my original "manual" implementation. If anybody has any insight on why my original class could've been causing lag to the point of freezes and chunk generation just refusing to keep loading new chunks, I'm also all ears: Here is the full if (placed) block for anyone with a smiliar issue: if (placed) { // Define the block to replace surrounding blocks with BlockState surroundingBlockState = BlockInit.ABERRANT_MINERALOID.get().defaultBlockState(); RuleTest stoneReplacement = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES); //Tag which indicates ores that can replace stone RuleTest deepslateReplacement = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); //Tag which indicates ores that can replace deepslate // Create a list of TargetBlockState for the Aberrant Mineraloids List<OreConfiguration.TargetBlockState> targets = new ArrayList<>(); targets.add(OreConfiguration.target(stoneReplacement, surroundingBlockState)); targets.add(OreConfiguration.target(deepslateReplacement, surroundingBlockState)); // Create a new OreConfiguration for the Aberrant Mineraloids OreConfiguration mineraloidConfig = new OreConfiguration(targets, 9); // vein size // Create a new context for the Aberrant Mineraloids FeaturePlaceContext<OreConfiguration> mineraloidCtx = new FeaturePlaceContext<>( Optional.empty(), world, ctx.chunkGenerator(), ctx.random(), offsetOrigin, mineraloidConfig ); // Generate the Aberrant Mineraloids using the SCATTERED_ORE configuration boolean mineraloidsPlaced = Feature.SCATTERED_ORE.place(mineraloidCtx); }
×
×
  • Create New...

Important Information

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