Jump to content

perromercenary00

Members
  • Posts

    849
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by perromercenary00

  1. i quite advance here i successfully made the function to read the blocks sort them into a map and use that map to create the nbt tags and find the method to convert that to a fisical text file ################################ this works it creates the file in file:///home/usuario/workspace/block/forge-1.19.2-43.2.1-mdk/run/mercblk/structures/xxxxxxxxxx.nbt but i want it to drop the file into mi mod structure folder file:///home/usuario/workspace/block/forge-1.19.2-43.2.1-mdk/src/main/resources/data/mercblk/structures/ or at least drop it into the same folder the minecrafts vainilla structure_block saves it files that would be the saves folder for the current world file:///home/usuario/workspace/block/forge-1.19.2-43.2.1-mdk/run/saves/New_World/generated/minecraft/structures/ this thing here File file = new File( rl.getNamespace() + "/structures/" + structureName + ".nbt" ); // how do i made to get the route to mi mod data folder ? or to the current world saves folder the full NbtStructure class the testing item some blocks i set floating in the air to capture this methods reads everything around the starting point ignoring air so it will also reads water and crops also you must separate the extructure from the soil ol youll get 4096 blocks of dirt and stone whit the structure
  2. yap kinda like jigsaw but never find a compressive guide just the one spawning the tower also i have an obsession for levering the terrain and set random structure's based in the resulting highs of the levered terrain and at the end i want those random structure's to surrounding whit a fence or a wall and also sewers an there is this thing where house variants can have or not attics and basements i do that just by swapping random assigned parts up an down still a good guide of jiwsaw would come in handly
  3. this one i want to remake structure's of mi mod but its complex to explain and don't speak naively English using code someones lend me for minecraft 1.16.5 i made a class that read the nbt files this class read those nbt files and recreate the structures contained, also apply rotation based on the facing of the player and that works fine now i need to make the class to detect structures read those blocks an covert it to nbt data and save it to a text file i don't have access to the nbt rules so im guessing my way through and there is some knowledge holes soo in need of help all the way here for why i interpetrate every block i wanna store must be represented as an nbt tag i call this blockdata and that block data must contain a tag named pos containing a list of int values for [x,y,z] ########################################################################## anyway i see the block states are stored and returned by something called pallete ArrayList<BlockState> palette = getBuildingPalette(nbt);//¿some class to convert nbt data to blockstates i suppose it respect order ################### i need to make the opposite having a list of blockstates convert then to a nbt pallete and add that to the nbt data ################### also and later whit an nbt data i need to save it to a fisical txt.nbt file this code uses CompoundTag nbt = getBuildingNbt(structureName); to read the fisical txt file so some where must be an equivalent function setBuildingNbt(structureName, CompoundTag nbt); do you can point me this things or best a link to working code saving nbt to fisical files ??
  4. thanks again add(map, Blocks.COAL_BLOCK, 16000); add(map, Items.BLAZE_ROD, 2400); add(map, Items.COAL, 1600); add(map, Items.CHARCOAL, 1600); i gonna make mi ingot to last as much as long as the coal block
  5. Ohh thanks its working i need something extra the default value for the coal / charcoal item ?? i set the mine to 10 but look like burn just like half second
  6. the explosive barrel or the door create a method to check if the companion is present is this is half.top check below block if half.bottom check the block above create a method to set the companion block and create a method to delete the block and its companion and doo the relevant code in // ########## ########## ########## ########## @Override @Nullable public BlockState getStateForPlacement(BlockPlaceContext context) { // ########## ########## ########## ########## @Override public void neighborChanged(BlockState blkstate, Level warudo, BlockPos pos, Block blk, BlockPos pos_of_changed, boolean p_55566_) { System.out.println("neighborChanged" + ", " + pos + ", " + pos_of_changed); } // ########## ########## ########## ########## @Override public void destroy(LevelAccessor accesor, BlockPos pos, BlockState blkstate) { // ########## ########## ########## ########## @Override public void onBlockExploded(BlockState blkstate, Level warudo, BlockPos pos, Explosion explosion) // ########## ########## ########## ########## @Override public void wasExploded(Level warudo, BlockPos pos, Explosion explosion) { // ########## ########## ########## ########## i dont think you need to manually drop the block as an item the normal block mechanics must be enough
  7. i have this item the carbon ingot i want it to be usable a fuel for the furnace i suspect somewhere is a json file whit a list of the items and block that can be used as fuel for the furnace where is this json file locate ??
  8. i found something public static final KeyMapping DRINKING_KEY = new KeyMapping( "DrinkingWater", KeyConflictContext.IN_GAME, KeyModifier.SHIFT, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_LEFT_CONTROL, KEY_CATEGORY_TUTORIAL ); KeyModifier.SHIFT, KeyModifier.CONTROL,KeyModifier.ALT is weird coze you cannot combine whatever you want only this 3 options but its good enough for me soo it leit as solved
  9. o nonono mi english is not soo good when you define a keybind you do an public static final KeyMapping DRINKING_KEY = new KeyMapping( KEY_DRINK_WATER, KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_O, <------- KEY_CATEGORY_TUTORIAL ); this lines define the keybind and set the initial/default value to "O" the user can change it later to whatever hi want in the menu i want in this case the initial/default value to be control + shift and the player can change it later if it want it public static final KeyMapping DRINKING_KEY = new KeyMapping( KEY_DRINK_WATER, KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, keys=[GLFW.GLFW_KEY_LEFT_SHIFT + GLFW.GLFW_KEY_LEFT_CONTROL], <------- this part of here KEY_CATEGORY_TUTORIAL );
  10. holl good days im doing something with keybindings and i want this actions set to activated some traps and i want set this action to combination of keys but the player must have the possibility to change this keys so basically i need to establish mi keybind to leftshift + x leftshift + c leftshift + v leftshift + left control but the key bind tutorial im folowing only allows one key per action in this case the default gonna be the leter "O" [GLFW.GLFW_KEY_O] // public class KeyBinding { public static final String KEY_CATEGORY_TUTORIAL = "Merctool"; public static final String KEY_DRINK_WATER = "Drink_WATA"; public static final KeyMapping DRINKING_KEY = new KeyMapping( KEY_DRINK_WATER, KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_O, KEY_CATEGORY_TUTORIAL ); //<------- ?? } ## how i do to set this KeyMapping to use two keys ¿¿ GLFW.GLFW_KEY_LEFT_SHIFT + GLFW.GLFW_KEY_LEFT_CONTROL ?????? sooo by default looks like this
  11. this part i also need this for another idea i have in this point is need to do some math is need to convert the rotation of the player to x/y/z values probably a math.sen math.cos of the player y rot and multiply it for the streng of the push coso.push(x * str, y * str, z * str);
  12. some math you need // #########################################################################3 // devuelve el punto en el espacio a la distancia especificada en la direccion // hacia donde esta // mirando el player public Vec3 calcular_vo() { return calcular_vo(this.vi, this.subject, this.distancia, this.precision); } public Vec3 calcular_vo(Vec3 vi, Entity player, int distancia, float precision) { // int distancia, float // precision // System.out.println( "calcularVectores(Vec3 " + vi + ", Entity player, int " + // distancia + ", float " + precision + ")" ); // vi = player.getEyePosition(0.0F); // rotacion Vertical en grados float gpitch = player.getViewXRot(0.0F); // rotacion Horizontal en grados float gyaw = player.getViewYRot(0.0F); // precision = 0.0F => perfect aim // precision = 1.0f => 45º ramdom error any direction precision = (precision > 1.0F) ? 1.0F : ((precision < 0.0F) ? 0.0F : precision); float factor = (90F * precision); gpitch = (float) ((gpitch - (factor / 2)) + (factor * Math.random())); gpitch = fixGrad(gpitch); gyaw = (float) ((gyaw - (factor / 2)) + (factor * Math.random())); gyaw = fixGrad(gyaw); // util.gradosAradianes(float x) // util.radianesAgrados(float x) // rotacion Horizontal en radianes double ryaw = gradosAradianes(gyaw); // rotacion Vertical en radianes double rpitch = gradosAradianes(gpitch); // correcccion de -90 grados double tmpryaw = ryaw - 1.5707964D; Vec3 vo = new Vec3(vi.x - ((Math.cos(tmpryaw)) * (Math.cos(rpitch) * distancia)), vi.y - (Math.sin(rpitch) * distancia), vi.z - ((Math.sin(tmpryaw)) * (Math.cos(rpitch) * distancia))); return vo; } // #########################################################################3 public static float gradosAradianes(float x) { return (float) ((x * Math.PI) / 180F); } // #########################################################################3 public float radianesAgrados(float x) { return (float) ((x * 180F) / Math.PI); } // #########################################################################3 public static float fixGrad(float D) { D %= 360.0F; if (D < -179F) { D += 360F; } if (D > 180F) { D -= 360F; } return D; }
  13. yeah but it will a little complex create an item and in the // ########## ########## ########## ########## @Override public void inventoryTick(ItemStack helditem, Level warudo, Entity entity, int slot, boolean p_41408_) { System.out.println("inventoryTick [" + slot + "], " + ((warudo.isClientSide)? "Local World":"Server World") ); check if its in player hand check surrounding area for zombie for any zombie finded check distance to player any zombie closer than 5 blocks knockback in the oposite direction of the player }
  14. Good nights i fond the json whit the list of blocks enderman picksup and add one of the mines /data/minecraft/tags/blocks/enderman_holdable.json { "replace": false, "values": [ "mercblk:manhole_panel" ] } and its works but two things i need they hold the manhole cover whit the same rotations as a block of dirt is posible to set a custome rotation more adequate to this block like in the display section of the json model like "thirdperson_enderman": { "rotation": [0, 90, 0], "translation": [3.25, -1.75, -3.5], "scale": [0.5, 0.5, 0.5] }, "display": { "thirdperson_righthand": { "rotation": [0, 90, 0], "translation": [3.25, -1.75, -3.5], "scale": [0.5, 0.5, 0.5] }, "thirdperson_lefthand": { "rotation": [0, 90, 0], "translation": [3.5, -2, -3.5], "scale": [0.5, 0.5, 0.5] }, "firstperson_righthand": { "rotation": [0, 90, 0], "translation": [1.5, 2, 0], "scale": [0.5, 0.5, 0.5] }, "firstperson_lefthand": { "rotation": [0, 90, 0], "translation": [1.5, 2, 0], "scale": [0.5, 0.5, 0.5] }, "ground": { "translation": [0, 1.25, 5.5], "scale": [0.75, 0.75, 0.75] }, "gui": { "rotation": [0, 11.25, -45], "translation": [1, 0, 0], "scale": [0.75, 0.75, 0.75] }, "head": { "translation": [0, 0.25, -1] }, "fixed": { "rotation": [0, 0, 45], "translation": [0, 0, 5.5] } ######################### and the main thing is i made this custome manhole block the cover can be detached from the block and if you break the block it will drops the cover first i want the ender to stole only the cover and let the gravel slab behind soo it i have two posibilities if the block has some onEndermansPick(Level level, BlockPos pos, Entity ender){} function or an onEndermanPicksBlock event any if those is good thanks fro your time
  15. declare the blocks with the no occlusion thing public static final RegistryObject<Block> DIRT_PATH_SLAB = register_slab("dirt_path_slab", () -> new slab(Block.Properties.copy(Blocks.DIRT).noOcclusion() ) ); also in the json model for the block adds the render type to cutout { "parent": "block/block", "ambientocclusion": "true", "render_type": "cutout", "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 7, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top", "cullface": "up", "tintindex": 0 }, "north": { "uv": [ 0, 1, 16, 8 ], "texture": "#side", "cullface": "north" }, "south": { "uv": [ 0, 1, 16, 8 ], "texture": "#side", "cullface": "south" }, "west": { "uv": [ 0, 1, 16, 8 ], "texture": "#side", "cullface": "west" }, "east": { "uv": [ 0, 1, 16, 8 ], "texture": "#side", "cullface": "east" } } }, { "from": [ 0, 0, 0 ], "to": [ 16, 7, 16 ], "faces": { "north": { "uv": [ 0, 1, 16, 8 ], "texture": "#overlay", "tintindex": 0, "cullface": "north" }, "south": { "uv": [ 0, 1, 16, 8 ], "texture": "#overlay", "tintindex": 0, "cullface": "south" }, "west": { "uv": [ 0, 1, 16, 8 ], "texture": "#overlay", "tintindex": 0, "cullface": "west" }, "east": { "uv": [ 0, 1, 16, 8 ], "texture": "#overlay", "tintindex": 0, "cullface": "east" } } } ] }
  16. using your code i fix mi issue in your code i dont see the problem but the way is structured is way different from the mine Main.class private void commonSetup(final FMLCommonSetupEvent event) { ModMessage.register(); } ModMessage.class onmouseup_middle.class i send the event whit ModMessage.sendToServer(new onmouseup_middle(3,7)); mi code actually does nothing just send two numbers on middle click [07:50:01] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Drinking WATA Package recived val0=3 val1=7 [07:50:01] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Drinking WATA Package recived val0=3 val1=7 [07:50:01] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Drinking WATA Package recived val0=3 val1=7 [07:50:01] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Drinking WATA Package recived val0=3 val1=7 [07:50:06] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game...
  17. this little thing of here @SubscribeEvent public void registerBlockColors(RegisterColorHandlersEvent.Block event) { //final BlockColor INSTANCE = new ModBlockColor(); event.getBlockColors().register( new ModBlockColor() , BlockInit.GRASS_SLAB.get()); System.out.println("\n#RegisterColorHandlersEvent#\n"); } where it goes ?
  18. your links to the code dont works
  19. hthanks its works buts also brings a new issue player.setForcedPose(Pose.SWIMMING); causes the player to crawl but gets stuck crawling and the only way is close reopen the map i would perfect to has some kind of int time = 20; player.setForcedPose(Pose.SWIMMING, time); and before time expires check the conditions to crawl another 20 ticks still usable know i have to find a way to store a list of entities inside the toilet entity and a way to pass that list from server side to client side
  20. adding someting more i manage to find an example i found where they regiter the color index for egg package net.minecraftforge.common; @Mod.EventBusSubscriber(value = Dist.CLIENT, modid = "forge", bus = Mod.EventBusSubscriber.Bus.MOD) private static class ColorRegisterHandler { @SubscribeEvent(priority = EventPriority.HIGHEST) public static void registerSpawnEggColors(RegisterColorHandlersEvent.Item event) { MOD_EGGS.forEach(egg -> event.getItemColors().register((stack, layer) -> egg.getColor(layer), egg) ); } } and begin testin thigs this dont works also the Systemout is anywhere to be seen in the console when the games fires package mercblk.event; import mercblk.blocks.BlockInit; import mercblk.blocks.ModBlockColor; import net.minecraft.client.color.block.BlockColor; import net.minecraftforge.client.event.RegisterColorHandlersEvent; import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.api.distmarker.Dist; //@Mod.EventBusSubscriber(Dist.CLIENT) //@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) //@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) @Mod.EventBusSubscriber(value = Dist.CLIENT, modid = "forge", bus = Mod.EventBusSubscriber.Bus.MOD) public class RegisterColors { @SubscribeEvent(priority = EventPriority.HIGHEST) public void registerBlockColors(RegisterColorHandlersEvent.Block event) { final BlockColor INSTANCE = new ModBlockColor(); event.getBlockColors().register(INSTANCE, BlockInit.GRASS_SLAB.get()); System.out.println("\n#RegisterColorHandlersEvent#\n"); } } im coping code from here is the closest to 1.19.2 i been find in this post says the problem was the render type in the lient setup the main looks like this @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event){ ItemBlockRenderTypes.setRenderLayer(BlockInit.GRASS_SLAB.get(), RenderType.cutout()); } the json model looks like this { "parent": "block/block", "ambientocclusion": "true", "render_type": "cutout", "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 8, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top", "cullface": "up", "tintindex": 0 }, "north": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "east" } } }, { "from": [ 0, 0, 0 ], "to": [ 16, 8, 16 ], "faces": { "north": { "uv": [ 0, 0, 16, 8 ], "texture": "#overlay", "tintindex": 0, "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 8 ], "texture": "#overlay", "tintindex": 0, "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#overlay", "tintindex": 0, "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#overlay", "tintindex": 0, "cullface": "east" } } } ] } an the slab looks like this this has two slabs gray color and a vainilla grass block in the middle just for reference propourses Can you help me to pinpoint the reason why it tintindex dint works ?
  21. hi i made this some time ago i want the terrain around mi villages and dungeons leveled whit slabs the trouble here is the grass slab ! ist gray not green and breaks the look of the terrain i know is something to do whit tintindex but idont have idea of how to get the tinindex from the grass for the bioma to later apply it to the slab json model i found very old post but that code is not compatible anymore #################################### * actually i need the link to documentation where explains how to do this * how to get the current biome color for grass an pass it to my custome slab model i got this theory of mine i think i dont find relevant information on google becoze this is not called "color blocks" or "biome colors" but exist under some other especific obscure term that also is not "color provider" Thank you for your help .
  22. wait a moment just explode this.level.explode((Entity)null, target.getX() + 0.5D, target.getY() + 0.5D, target.getZ() + 0.5D, 2.0F, Explosion.BlockInteraction.NONE); explode but break blocks this.level.explode((Entity)null, target.getX() + 0.5D, target.getY() + 0.5D, target.getZ() + 0.5D, 2.0F, Explosion.BlockInteraction.DESTROY); real explosion this.level.explode((Entity)null, target.getX() + 0.5D, target.getY() + 0.5D, target.getZ() + 0.5D, 2.0F, true,Explosion.BlockInteraction.DESTROY);
  23. then remove/rename the full mod folder and try also you can not put jarmods in the eclipse run/mods folder dont works idont know why but dont works
  24. on e of that mods has an error or conflict whit another keeps taken half of the mods to another folder until minecraft works again then add the mods again one by one until minecrafts break and you will know whos the problematic one
×
×
  • Create New...

Important Information

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