-
Posts
727 -
Joined
-
Last visited
Everything posted by Drachenbauer
-
Since i made my SlingshotItem extend the BowItem, it does not load it´s extra item-models for it´s pulling-animation any more. What must i do to get this to work again? Edit: finally fixed this: I noticed, that the json for the item-model of the bow has an area "overrides", that leads to the pulling-states. This was removed in the matching file of my slingshot. it seams like i deleted it while modifying the file, and didnt notice that. Now i readded it and the pulling-animation works. Now i think, that my munitions don´t start flying, must be causef by the way, i registered them or by the renderer, i created for them. For the renderer, i created a renderer-class, that extends EntityRender, like LivingRenderer does, but at the place, there the LivingRenderer has "LivingEntity" in it´s class-header, i used just the basic Entity-class. Then i copyed all content of the Living-Renderer into my renderer and removed all about living (i think so). Then the renderers for the different birds extend this one. AngryBirdsMod Github Search here for "AbstractBirdShotRenderer" to find my renderer class. Can anyone pleas check it, if the error is located there?
-
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I tryad around very much on "getPickBlock" without success. with Return new ItemStack(...); i found no way to use " pos.down() " and " state.get(...) ". And with return getItem (...); and return super.getPickBlock(...); I can put in " pos.down() " and " state.get(...) ", but it does not have any effect. I get no item and in the console a warning appears: [Client thread/WARN] [ne.mi.co.ForgeHooks/]: Picking on: [BLOCK] angrybirdsmod:balloon_block_top gave null item I think, if anyone found a way to get this getPickBlock-thing to work, the best way is, to put the whoole method with it´s content here. -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I still found no way to get the block below te one with the pickBlock-action, i try to write, by using " pos.down() " and " state.get(...) " . I really need help for the exact setup of the code-line, that i have to place in the method. I found no tutorial, how to do this. -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
Now i found " getItem ", that includes all needed contents and fit´s behind "return". But it´s deprecated and does not give me the pos down block. What is the actual replacement for it? Now i have this: @Override public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, PlayerEntity player) { return super.getPickBlock(state, target, world, pos.down(), player); } But i don´t get the bottom block... I thaught, if i add down to the position, it will give the block below this one. But this doesn´t happen. Why not? -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I find no way to insert " state.get(...) " in this line. And i also think, here "state" is the BlockState from the block, that holds this codt, not from the other block, that should be copyed as an item. Sample: The code is in the top-block of the balloon, but i want a way to access the Blockstate of it´s already placed bottom block by using "pos.down()" to get a correct colored copy of it. for short: I need " pos.down() " and " state.get(...) ", but i find no way to assemble them to a line of code, that works here. -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
Actually i have this: @Override public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, PlayerEntity player) { return new ItemStack(AngryBirdsBlocks.balloon_block); } But i need something to replace the blockname, that i can navigate to the already placed main-block of the construct, using the pos-value, to get access to it´s specific blockstates. And i need a way to access theese blockstates (i don´t know, where to insert BlockState#get(IProperty)). Every time, i try something about blockstates inside the brachets behind "ItemStack", it changes the type of the whoole content to something (maybe BlockState), that does not fit there -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
i will store it in the blockstate. I dont know, where exactly in the method, i have to use BlockState#get(IProperty)... I cannot find any tutorials about the pickBlock-method. -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
My slingshot-block has invisible blocks at both sides, wich i use for both slingshot-models. So they should scheck wich of the two different slingshot-blocks is located next to them in the direction indicated by the rotation of the model. I know how to use theese directions in setBlockState, but i don´t know, how to use this in the pickBlock-method. -
Now someone told me to make it without a tileentity and with registering a blockcolor instead like this: Add blockcolor But If i try to use this with an own "public static IBlockColor blockColor;"-field and my blocks, i get a red underline there with the type-mismatch BlockColors/void. I had to remove the "BlockColors blockColors ="-part of the line to get rid of the red underline. Is this the right way to register it in 1.14? AngryBirdsMod on Github You find my color registation in the main-class "AngryBirds". Another question: How do i fill content into the "public static IBlockColor blockColor;"-field? And what must i do in my blockclasses to use it for theese blocks? My exact targets: I already have a recipe (for each block-type) to craft the white basic-versions of the blocks. -I want to have 15 recipes (for each block-type) to dye them in the other 15 dye-colors (white block + matching dye-color). -It should be able to get every possible color by command: /give @s angrybirdsmod:balloonblock{display:{color:0}} 1 until /give @s angrybirdsmod:balloonblock{display:{color:16.777.216}} 1 -If a block of theese types is not white, it should show "dyed" below it´s name in the inventory (just like leather-armour). -i hope, that i can manage this with just white textures for theese block-types and and just one block-type per model registered.
-
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
Ok, now i found this: @Override public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, PlayerEntity player) { return new ItemStack(AngryBirdsBlocks.balloon_block); } But how do i add the color of the placed block to the ItemStack, if i finished the blockcolors later? And for my other blocks, how do i check a specific position to return the block there as ItemStack? -
How do i control the collision box size of my entities?
Drachenbauer replied to Drachenbauer's topic in Modder Support
Now i found a way to add the size in the registration-lines, like at the munitions. But now i noticed, that my entities get hutr, if swimming in water. How to fix this? to see the size thing at my entities, look in my repository:AngryBirdsMod on Github in the main-class "AngryBirds" in the entity-registry-event. -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
another question about such multiblock-structures: If i play in creative-mode and click with the mousewheel on a block, i get a copy of this block as item. What happens, if i click on a side-block of my model with the mousewheel and how can i make that i always get the main-block of the model, if i click on one of it´s side-blocks this way? The best way is, that it checks the main-block-position and gives the block, it finds there That´s because i use the same side-blocks for both slingshot-types and it also should give the block in the color, that is placed, if i get the colours-thing to work any time later. -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I have all this in all theese blocks, and now i found the right command for placing it: worldIn.setBlockState(pos.up(), AngryBirdsBlocks.slingshot_birch_wood_base_block.getDefaultState().with(FACING, Direction.EAST)); The top-block, i place with this, holds the wooden part of the slingshot model. so i have only the parts, that can be colored in, in the model for the main-block. How do i check the Directions-property of the block (or what else indicates in wich direction i want to place the block) in the BlockItem? For this model, i want not only check the top for air, i also want to check the sides as well: If i want to place the model oriented to the north or souch, it should check the east and west sides of it. And if i want to place the model oriented to the east or west, it should check the north and south sides of it. Edid: i found the solution: @Override protected boolean placeBlock(BlockItemUseContext context, BlockState state) { if (context.getWorld().getBlockState(context.getPos().up()).getBlock() instanceof AirBlock) { Direction facing = state.get(FACING); switch(facing) { default: if (context.getWorld().getBlockState(context.getPos().east()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().west()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().east().up()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().west().up()).getBlock() instanceof AirBlock) { return super.placeBlock(context, state); } else { return false; } case EAST: if (context.getWorld().getBlockState(context.getPos().north()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().south()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().north().up()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().south().up()).getBlock() instanceof AirBlock) { return super.placeBlock(context, state); } else { return false; } case SOUTH: if (context.getWorld().getBlockState(context.getPos().east()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().west()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().east().up()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().west().up()).getBlock() instanceof AirBlock) { return super.placeBlock(context, state); } else { return false; } case WEST: if (context.getWorld().getBlockState(context.getPos().north()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().south()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().north().up()).getBlock() instanceof AirBlock&& context.getWorld().getBlockState(context.getPos().south().up()).getBlock() instanceof AirBlock) { return super.placeBlock(context, state); } else { return false; } } } else { return false; } } -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I just thaught, some one can tell me, how i place a block with specific rotation, this way. I don´t know how to use the debugger in Eclipse -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
Another question back to topic: I have another more complex model, where i want to add blocks this way, but with the rotation of the main-block (i splitted the model into two parts, because i want to color only some parts of it with the Iblockcolor-thing, i´m working on.). How do i apply a rotation on the bloch to place, with: worldIn.setBlockState(pos.up(), AngryBirdsBlocks.slingshot_birch_wood_base_block.rotate(state, worldIn, pos, rotation)); I tryed to fill a field Rotation rotation with the actual rotation of the block this way: @Override public BlockState rotate(BlockState state, Rotation rot) { rotation = rot; return state.with(FACING, rot.rotate(state.get(FACING))); } beause i thaught, this method, i already use to rotate a block, get´s the actual rotation in it´s "rot". But this makes the game crash with a "nullpointerexeption", if i try to place this block. I try all this, because i find no method-call, that fits in the first code-snippet abd sets directly the Direction of the block (what i use to rotate my blocks normally) How can i get the actual rotation of the main-block to rotate the other part-block the same direction? Now i found this: worldIn.setBlockState(pos.up(), AngryBirdsBlocks.slingshot_birch_wood_base_block.getDefaultState().with(arg0, arg1)); But i still don´t know how i can put the Direction into the "with"... Now i tryed this: worldIn.setBlockState(pos.up(), AngryBirdsBlocks.slingshot_birch_wood_base_block.getDefaultState().with(FACING, rotation.rotate(state.get(FACING)))); But it gives the crash with the "nullpointerexeption" too. Now im not sure: Is the method "rotate" (what i show you at the top of this post) really called before "onBlockPlacedBy"? -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
ok, now i have this added in my registry events: @SubscribeEvent public static void registerBlockColors(final ColorHandlerEvent.Block event) { event.getBlockColors().register(blockColor, AngryBirdsBlocks.balloon_block, AngryBirdsBlocks.slingshot_block, AngryBirdsBlocks.slingshot2_block); } How do i declare the content for the actual empty field "IBlockcolor blockColor", i created for this? And i had to delete the BlockColors blockColors = part in front of the event-line, because with it, i get a type-mismatch. -
[1.13.2] [SOLVED] How do I properly add an IBlockColor?
Drachenbauer replied to TheOnlyTrueEnte's topic in Modder Support
For me it says "Type mismatch: cannot convert from void to BlockColors" @SubscribeEvent public static void registerBlockColors(final ColorHandlerEvent.Block event) { BlockColors blockColors = event.getBlockColors().register(blockColor, AngryBirdsBlocks.balloon_block, AngryBirdsBlocks.slingshot_block, AngryBirdsBlocks.slingshot2_block); } Is there any change for using it in 1.14.3? I noticed, if i delete the part before the "=" i get no more red underlines. Is this the right way to make it work in 1.14.3 -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
But i don´t know hor to create, what they call: MY_BLOCK_COLOR -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
How do i use iblockcolor? I want recipes for the 16 basic-dye-colors and also be able to get all special colors i want with a "/give @p angrybirdsmod:balloon_block r g b" -command. -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
Is there any way to manage this without having a block registry entry for each color (otherwhise i have to copy a blockstate json for each color because of the different registry names)? -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
i want to manage it only with a white texture, it should calculate it with the dye-color-values. I don´t want a texture for each color. -
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I didn´t notice this info until you told it now. And the banner, that uses ditterent colors, extends containerblock. so i thaught, it´s the right one for using different colors. Does my color-idea still work, if i estend the normal block instead, with my color-block, that my color-changables stould extend?