Everything posted by Skyriis
-
[1.19.2] Align Jigsaw structure to hill walls
oh well, the whole structure is at least 3 chunks long so i probably need to use a custom structure instead of a feature. correct?
-
[1.19.2] Align Jigsaw structure to hill walls
alright so i've changed my place method to this: @Override public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> pContext) { BlockPos origin = pContext.origin(); WorldGenLevel level = pContext.level(); StructureTemplateManager templateManager = level.getServer().getStructureManager(); BulkSectionAccess sectionAccess = new BulkSectionAccess(level); // Get structure parts StructureTemplate entranceTemplate = templateManager.getOrCreate(ENTRANCE); StructureTemplate understairTemplate = templateManager.getOrCreate(UNDERSTAIR); StructureTemplate roomTemplate = templateManager.getOrCreate(ROOMS[level.getRandom().nextIntBetweenInclusive(0, ROOMS.length - 1)]); Vec3i entranceSize = entranceTemplate.getSize(); // Ensure we can write in the entrance structure area for (int x = 0; x < entranceSize.getX(); x++) { for (int y = 0; y < entranceSize.getY(); y++) { for (int z = 0; z < entranceSize.getZ(); z++) { if (!level.ensureCanWrite(origin.offset(x, y, z))) return false; } } } // Check top and bottom (front) is covered for (int i = -1; i < entranceSize.getX(); i++) { if (safeBlockStateCheck(sectionAccess, origin.offset(i, -1, 0), BlockBehaviour.BlockStateBase::isAir, true)) return false; if (safeBlockStateCheck(sectionAccess, origin.offset(i, entranceSize.getY(), 0), BlockBehaviour.BlockStateBase::isAir, true)) return false; } // check left and right (front) is covered for (int i = -1; i < entranceSize.getY(); i++) { if (safeBlockStateCheck(sectionAccess, origin.offset(-1, i, 0), BlockBehaviour.BlockStateBase::isAir, true)) return false; if (safeBlockStateCheck(sectionAccess, origin.offset(entranceSize.getX(), i, 0), BlockBehaviour.BlockStateBase::isAir, true)) return false; } // Ensure air is in front of the cave entrance for (int x = 2; x < entranceSize.getX() - 2; x++) { for (int y = 2; y < entranceSize.getY() - 2; y++) { if (safeBlockStateCheck(sectionAccess, origin.offset(x, y, 0), blockState -> !blockState.isAir())) return false; } } boolean entrancePlaceSuccess = entranceTemplate.placeInWorld(level, origin, origin, new StructurePlaceSettings(), level.getRandom(), 2); return false; } private boolean safeBlockStateCheck(BulkSectionAccess sectionAccess, BlockPos pos, Predicate<BlockState> check) { return safeBlockStateCheck(sectionAccess, pos, check, false); } private boolean safeBlockStateCheck(BulkSectionAccess sectionAccess, BlockPos pos, Predicate<BlockState> check, boolean resultWhenInaccessible) { LevelChunkSection chunkSection = sectionAccess.getSection(pos); // Ensure chunk section exists if (chunkSection == null) return resultWhenInaccessible; // Get target block state BlockState targetState = chunkSection.getBlockState( SectionPos.sectionRelative(pos.getX()), SectionPos.sectionRelative(pos.getY()), SectionPos.sectionRelative(pos.getZ()) ); // Return test result return check.test(targetState); } and now i'm getting those errors in the first for loop (the ensure write thing): why is that?
-
[1.19.2] Align Jigsaw structure to hill walls
alright so... i got this as my feature: @Override public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> pContext) { BlockPos origin = pContext.origin(); ServerLevel level = pContext.level().getLevel(); StructureTemplateManager templateManager = level.getStructureManager(); // Get structure parts StructureTemplate entranceTemplate = templateManager.getOrCreate(ENTRANCE); StructureTemplate understairTemplate = templateManager.getOrCreate(UNDERSTAIR); StructureTemplate roomTemplate = templateManager.getOrCreate(ROOMS[level.getRandom().nextIntBetweenInclusive(0, ROOMS.length - 1)]); Vec3i entranceSize = entranceTemplate.getSize(); // Check top and bottom entrance for (int i = -1; i < entranceSize.getX(); i++) { BlockState bottomState = level.getBlockState(origin.offset(i, -1, 0)); BlockState topState = level.getBlockState(origin.offset(i, entranceSize.getY(), 0)); // Exit if air if (bottomState.isAir() || topState.isAir()) return false; } // check left and right entrance for (int i = -1; i < entranceSize.getY(); i++) { BlockState leftState = level.getBlockState(origin.offset(-1, i, 0)); BlockState rightState = level.getBlockState(origin.offset(entranceSize.getX(), i, 0)); //Exit if air if (leftState.isAir() || rightState.isAir()) return false; } // Ensure air is in front of the cave entrance for (int x = 1; x < entranceSize.getX() - 1; x++) { for (int y = 1; y < entranceSize.getY() - 1; y++) { if (!level.getBlockState(origin.offset(x, y, -1)).isAir()) return false; } } boolean entrancePlaceSuccess = entranceTemplate.placeInWorld(level, origin, origin, new StructurePlaceSettings(), level.getRandom(), 2); return false; } and the place method get's invoked (i checked that with a break point and the intellij debugger) problem is that the world gen get's stuck When i create a new world it get's stuck here: Any ideas what cause this?
-
[1.19.2] Align Jigsaw structure to hill walls
i already got the nbt files but how do i place them in a feature? I got no clue how to check and generate them in the Feature#place method
-
[1.19.2] Align Jigsaw structure to hill walls
how would i make a jigsaw structure a feature? or... how would i make a feature 1.19 anyway How would i generate the nbt files (like a jigsaw structure would do it) and then check the size and blocks around?
-
[1.19.2] Align Jigsaw structure to hill walls
a jigsaw structure
-
[1.19.2] Align Jigsaw structure to hill walls
i'm using the json stuff to generate my structure. i got no clue how i would access the level from that?
-
[1.19.2] Align Jigsaw structure to hill walls
How would i check that area?
-
[1.19.2] Align Jigsaw structure to hill walls
Hey Guys, i'm trying to generate my structure only on places which make sense. My Structure is basically a small cave which should only generate on the bottom of hills in the wall. How it looks right now: How it should look: https://prnt.sc/O7A7FfdhneAv How would i do that?
-
[1.18.2] Network error on login
Oh damn I would never have found the error without you thank you so much
-
[1.18.2] Network error on login
Hey Guys, it looks like i broke something in my mod but i got no idea what. This happends if i try to join the `runServer` Server with my `runClient` Client Full Error (Client Side): https://mclo.gs/AjEXFD1 GitHub: https://github.com/ManasMods/reincarnated_mod/tree/dev/smithing-bench Any ideas what could cause that?
-
[1.18.2] Need Help for Custom Crafting
Hey Guys, i'm working on a BlockEntity which processes Items into "Molten Material" and one or two Molten Material(s) into a (new) Item. Right now i'm working with custom json files in my data folder for the processing: Molten Material Class: ItemStack -> MoltenMaterial "Recipe" class: MoltenMaterial(s) -> ItemStack "Recipe" class: Screenshots: The thing is... i want to use JEI to display my Recipes but that's only possible if i make the melting and smelting classes to true recipes but i got no clue how to check the "MoltenMaterial" values from the BlockEntity within the Recipe class
-
[1.18.2] Grass Stairs Model
Hey Guys, i'm working on grass stairs and struggle a bit on the Model The bottom versions work without a problem but the upside-down version are a bit cursed: How would i fix that tinting issue? Model file: https://github.com/ManasMods/ManasCore/blob/master/src/main/resources/assets/manascore/models/block/overlay_stairs.json
-
[1.18.2] Custom Crafting
Well, good point. I'm gonna do that in an update. I'm happy if something works somehow ^^" Nice thank you
-
[1.18.2] Custom Crafting
https://github.com/ManasMods/vanilla_plus
-
[1.18.2] Custom Crafting
Hey Guys, i'm trying to add a new recipe type (fletching) to my mod and i'm currenty struggling on implementing the crafting system. The result item appears if one ingredient (of multiple) has been inserted and then removed. My Menu: Recipe Serializer: Recipe: test recipe json:
-
[1.16.5] NumberFormatException after copying the options.txt
Oh lol, you're right. Well, thank you
-
[1.16.5] NumberFormatException after copying the options.txt
Before: After:
-
[1.16.5] NumberFormatException after copying the options.txt
i've checkt the content of the options.txt before and after sync with the cloud and the only difference is the order of the lines. APIHelper class: Handler class:
-
[1.16.5] NumberFormatException after copying the options.txt
Hey Guys, I'm working on a mod which allows to store your settings (options.txt) in a cloud service but something seems to cause a weird problem. I'm getting this log message which doesn't really makes sense to me since i'm just copying the values from the options.txt when the Options#save has finished writing and load those values on startup before Options#load once. Has someone an idea what could cause that problem?
-
[1.18.2] Change value in BlockEntity using Button on MenuScreen
Okay i made a boolean and it started the disc but i can't stop it anymore. (i've updated the code above). EDIT nvm i forgot to update the boolean
-
[1.18.2] Change value in BlockEntity using Button on MenuScreen
how do i check if it's the first tick or not?
-
[1.18.2] Change value in BlockEntity using Button on MenuScreen
i should run level.levelEvent(PLAY_RECORD_EVENT, worldPosition, Item.getId(getRecord().getItem())); every tick? Wouldn't that cause the disc to go crasy?
-
[1.18.2] Change value in BlockEntity using Button on MenuScreen
Okay next problem. the blockentity doesn't play anything when i log out and log in again. I guess i have to run the level.levelEvent(PLAY_RECORD_EVENT, worldPosition, Item.getId(getRecord().getItem())); when the blockentity gets loaded but is there a method for that?
-
[1.18.2] Change value in BlockEntity using Button on MenuScreen
i guess that thing get's invoked when i open my container but why? container.addListener((handler, slot) -> { if (slot == 8) { stop(); } setChanged(); }); it should only get invoked if "onContentsChanged" get's called
IPS spam blocked by CleanTalk.