-
Posts
727 -
Joined
-
Last visited
Everything posted by Drachenbauer
-
This is thr block-registry now: public static void registerBlocks(final RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(FlatTilesBlocks.black_concrete_tile_block = new ConcreteTileBlock("black_concrete_tile_block", DyeColor.BLACK, Block.Properties.create(Material.ROCK, MaterialColor.BLACK).sound(SoundType.STONE). lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()), FlatTilesBlocks.blue_concrete_tile_block = new ConcreteTileBlock("blue_concrete_tile_block", DyeColor.BLUE, Block.Properties.create(Material.ROCK, MaterialColor.BLUE).sound(SoundType.STONE). lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()), FlatTilesBlocks.brown_concrete_tile_block = new ConcreteTileBlock("brown_concrete_tile_block", DyeColor.BROWN, Block.Properties.create(Material.ROCK, MaterialColor.BROWN).sound(SoundType.STONE). lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity())); } The item-registry: public static void registerItems(final RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(FlatTilesItems.black_concrete_tile_block = new BlockItem(FlatTilesBlocks.black_concrete_tile_block, new Item.Properties().defaultMaxDamage(0).group(FLAT_TILES).maxStackSize(64).rarity(Rarity.COMMON). setNoRepair()).setRegistryName(FlatTilesBlocks.black_concrete_tile_block.getRegistryName()), FlatTilesItems.blue_concrete_tile_block = new BlockItem(FlatTilesBlocks.blue_concrete_tile_block, new Item.Properties().defaultMaxDamage(0).group(FLAT_TILES).maxStackSize(64).rarity(Rarity.COMMON). setNoRepair()).setRegistryName(FlatTilesBlocks.blue_concrete_tile_block.getRegistryName()), FlatTilesItems.brown_concrete_tile_block = new BlockItem(FlatTilesBlocks.brown_concrete_tile_block, new Item.Properties().defaultMaxDamage(0).group(FLAT_TILES).maxStackSize(64).rarity(Rarity.COMMON). setNoRepair()).setRegistryName(FlatTilesBlocks.brown_concrete_tile_block.getRegistryName())); } In the official minecraft files i found no hint, that the carpet uses a special blockitem-class, so i use instances from the commen blockitem-class for the blockitems of the tiles. and this is the block java: package drachenbauer32.flattilesmod.blocks; import drachenbauer32.flattilesmod.util.Reference; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.item.DyeColor; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; public class ConcreteTileBlock extends Block { protected static final VoxelShape SHAPE = Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D); private final DyeColor color; public ConcreteTileBlock(String name, DyeColor p_i48290_1_, Block.Properties properties) { super(properties); setRegistryName(Reference.MOD_ID, name); this.color = p_i48290_1_; } public DyeColor getColor() { return this.color; } public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { return SHAPE; } /** * Update the provided state given the provided neighbor facing and neighbor state, returning a new state. * For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately * returns its solidified counterpart. * Note that this method should ideally consider only the specific face passed in. */ public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) { return !stateIn.isValidPosition(worldIn, currentPos) ? Blocks.AIR.getDefaultState() : super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos); } public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos) { return !worldIn.isAirBlock(pos.down()); } } I get no more error messages, but the items for the blocks don´t appear in the Creative inventory tab, that i made for them... In the official minecraft files What is not correct now?
-
Now i get other errors: But i don´t know, where it means "null-name" My blocks have names: black_concrete_tile_block, blue_concrete_tile_block, and so on. For the block java file, i use the setup from the carpet-block. Now i noticed, this setup gives o registra name. How do i add a registry name to this: public static void registerBlocks(final RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(FlatTilesBlocks.black_concrete_tile_block = new ConcreteTileBlock(DyeColor.BLACK, Block.Properties.create(Material.ROCK, MaterialColor.BLACK).sound(SoundType.STONE). lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()), FlatTilesBlocks.blue_concrete_tile_block = new ConcreteTileBlock(DyeColor.BLUE, Block.Properties.create(Material.ROCK, MaterialColor.BLUE).sound(SoundType.STONE). lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity()), FlatTilesBlocks.brown_concrete_tile_block = new ConcreteTileBlock(DyeColor.BROWN, Block.Properties.create(Material.ROCK, MaterialColor.BROWN).sound(SoundType.STONE). lightValue(0).hardnessAndResistance(1.8f, 9f).variableOpacity())); } theese are three blocks so far.
-
i used that gradle task.
-
that was, what i did. Now i noticed, that i missed some fines like mod.toml in the new one. i copyed them from the other one, and changed the date inside tham to match my new one, and now i test again.
-
Hello I have two mods open in my eclipse workspace. Now i noticed, no matter, what i try to setup a test run for my new flat-tiles-mod, it tries to run the old Angry-Birds-mod. How do i tell eclipse, that it should run the new mod now? Edit: Now it does not more load the old mod, but it also does not load the new mod into the test-client.
-
Are there vaules to change the dye-colors (for banner)
Drachenbauer replied to Drachenbauer's topic in Texture Packs
Today I tryed to install optifine into forge this way: https://www.youtube.com/watch?v=i01c8qqAhhw Now i found out, that i hat to put my color-values into the matching file inside a preview optifine package of the actual version. to do this, i had to unpack the jar-file. But how do i pack it into a jar file again? i tryed an online rar to jar tool, but with this file in the mods-folder of my minecraft forge version, it does not appear in the mods-list ingame and i see no color changes while playing. Edit: he original jar-file also is not shown there -
Hello If i try to shoot my slingshot, my angry birds munitions don´t appear... I´m pretty sure, the slingshot itself is ok, now. It must be the Way, how my munition-entity´s are registered, or something with the renderer (BirdShotRenderer), i created. I get no errors in the console, if i try to shoot Here is my mod: AngryBirdsMod on Github Can you find the problem and how to solve it?
-
Now i will try again with tile-entity, but i still donßt get the registration to work: @SubscribeEvent public static void registerTE(RegistryEvent.Register<TileEntityType<?>> event) { AngryBirdsTileEntities.BLOCK_COLORS = TileEntityType.Builder.create(BlockColorsTileEntity::new, AngryBirdsBlocks.balloon_block, AngryBirdsBlocks.slingshot_acacia_block, AngryBirdsBlocks.slingshot_acacia_2_block, AngryBirdsBlocks.slingshot_birch_block, AngryBirdsBlocks.slingshot_birch_2_block, AngryBirdsBlocks.slingshot_dark_oak_block, AngryBirdsBlocks.slingshot_dark_oak_2_block, AngryBirdsBlocks.slingshot_jungle_block, AngryBirdsBlocks.slingshot_jungle_2_block, AngryBirdsBlocks.slingshot_oak_block, AngryBirdsBlocks.slingshot_oak_2_block, AngryBirdsBlocks.slingshot_spruce_block, AngryBirdsBlocks.slingshot_spruce_2_block).build(null); AngryBirdsTileEntities.BLOCK_COLORS.setRegistryName(Reference.MOD_ID, "block_colors"); evt.getRegistry().register(AngryBirdsTileEntities.BLOCK_COLORS); } But i get an error at the "create"-Part. I don´t know, how i have to put my TileEntity-class in there, the right way... Ok, now i found, that the registration itself is ok, i just had to remove the statement from the constructor (head-line) of my TileEntity-class. Another question: At the end of this line there is "build(null)". must i replace the "null" with something? And how do i now add BlockColors to my TileEntity? Here you can find, what i have now: AngryBirdsMod in Github
-
Hello I try to set ithe EyeHeight for my eintties. And if i use F3+B to show the collision-boxes of my entities, it always shows the red square and the blue beam just a little bit below the top of the collision-box. It seams like, it is not, where my code places the EyeHeight of the entity. For sample: @Override public float getEyeHeight(Pose pose) { return this.getSize(pose).height * 0.5f; } I´m pretty sure, this will place the EyeHeight in the middle of the collision-box-hight (for most of my Angry Birds characters, this is where the eyes are located on the texture), But the red square is not located in this hight. Why this happens?
-
For one of my custom player models i want to change, how items look in it´s hands and helmets on head. Is there any where a tool, where i can load the java-file of my model and get a 3d-view of it, where i can show some common items and armour and adjust size and position to make it look good. And than it should be possible to generate the java-code, that controls this with instructions, how to use it in the mod. Is there anywhere such a software around in the web?
-
Hello I want to change the moving-style of my Angry Birds Entities to a hopping motion, because in the official Angry Birds Toons this is their common mofinh style. So i copied, hor the rabbit moves here and removed all stuff about carrots and rabbit-types.. AngryBirdsMod on Github Look into the entity-clas of Red But i spotted some issues: 1. if he goes into the water, he doesn´t stop hopping. 2. if he jumps out of the water towards a fence or wall, that is placed directly next to the edge of the water, he is trapped at this position and continues hopping there forever. How do i fix theese things? The other question: How do i change his jump-hight?
-
How do i make a block with a model, that it two blocks high?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I´m still waiting for a solution: For each block of a multible-block-model, i just created, the pickBlock-function should give a copy of the main-block (the one with the BlockItem) with it´s actual color-blockstate. Actually i can get a copy of the BlockItem (main-block) only by using the pickBlock-click on the main-block of the model, but not on the other part-blocks. I still naad a way to get a block by position and then get it´s property for the BlockItem -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I have a method "setup" with this event in the round brackets. I think, that should be the right one. Test on this method is successfull. So no more questions here. -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
there you have the comperator in the preInit-method of the main-class to make it usable in multiple different situations. But maybe in 1.14 there is no more preinit in the main-class. As i now placed the comperator directly into the fill-method of my creativetab-class, it works. So what is the right way to have the comperator in the main-class now? -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I made it like it looks in the last piece of tutorial. there is the same stuff in the main-class and in the item-tab-class, like i have. -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
This initializes the comperator in the main-class public static Comparator<ItemStack> itemSorter; This is in preInit: List<Item> items = Arrays.asList(AngryBirdsItems.red_egg, AngryBirdsItems.chuck_egg, AngryBirdsItems.blues_egg, AngryBirdsItems.bomb_egg, AngryBirdsItems.mathilda_egg, AngryBirdsItems.terence_egg, AngryBirdsItems.silver_egg, AngryBirdsItems.bubbles_egg, AngryBirdsItems.hal_egg, AngryBirdsItems.stella_egg, AngryBirdsItems.poppy_egg, AngryBirdsItems.willow_egg, AngryBirdsItems.dahlia_egg, AngryBirdsItems.luca_egg, AngryBirdsItems.ice_bird_egg, AngryBirdsItems.red_shot, AngryBirdsItems.chuck_shot, AngryBirdsItems.blues_shot, AngryBirdsItems.bomb_shot, AngryBirdsItems.mathilda_shot, AngryBirdsItems.terence_shot, AngryBirdsItems.silver_shot, AngryBirdsItems.bubbles_shot, AngryBirdsItems.hal_shot, AngryBirdsItems.stella_shot, AngryBirdsItems.poppy_shot, AngryBirdsItems.willow_shot, AngryBirdsItems.dahlia_shot, AngryBirdsItems.luca_shot, AngryBirdsItems.ice_bird_shot, AngryBirdsItems.slingshot, AngryBirdsItems.balloon_block, AngryBirdsItems.egg_block, AngryBirdsItems.nest_block, AngryBirdsItems.slingshot_acacia_block, AngryBirdsItems.slingshot_acacia_2_block, AngryBirdsItems.slingshot_birch_block, AngryBirdsItems.slingshot_birch_2_block, AngryBirdsItems.slingshot_dark_oak_block, AngryBirdsItems.slingshot_dark_oak_2_block, AngryBirdsItems.slingshot_jungle_block, AngryBirdsItems.slingshot_jungle_2_block, AngryBirdsItems.slingshot_oak_block, AngryBirdsItems.slingshot_oak_2_block, AngryBirdsItems.slingshot_spruce_block, AngryBirdsItems.slingshot_spruce_2_block, AngryBirdsItems.acacia_planks_frame_block, AngryBirdsItems.birch_planks_frame_block, AngryBirdsItems.dark_oak_planks_frame_block, AngryBirdsItems.jungle_planks_frame_block, AngryBirdsItems.oak_planks_frame_block, AngryBirdsItems.spruce_planks_frame_block, AngryBirdsItems.stone_frame_block, AngryBirdsItems.blue_ice_frame_block); itemSorter = Ordering.explicit(items).onResultOf(ItemStack::getItem); and this is in my creative-tab-class: public void fill(NonNullList<ItemStack> itemStacks) { super.fill(itemStacks); itemStacks.sort(AngryBirds.itemSorter); } In your tutorial you use "ItemStack" in the same locations in your code. -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
Now i placed your comperator in my mod again, like it looks in your tutorial, and now there are no more errors at ItemStack::getItem I noticed, that there are two imports for Ordering Now i used the "import com.google.common.collect.Ordering;"-one. maybe i used the other one at the first try. But it gives an error, if i try to open my creative tab in a test-run: Was ItemStack comparable earlyer and is not more now? -
How do i control the collision box size of my entities?
Drachenbauer replied to Drachenbauer's topic in Modder Support
most of my mobs are a half block high and have their eyes in the middle of their front. So i had to set the eyehight as a quater of a block-hight to fit with the eyes on the texture. (i thaught, the value for eyehight is calculated from 1 as block-hight). If i show collision-boxes, i see a red frame and a blue beam, wich, i think, show the eye-hight. but they are located just a little below the top of the collision-box. The hight of theese markers does not change, if i change the value of eyehight How is the eyeHight-value calculated actually? How do i find the right values to move this to the hight, where the eyes are located on the texture? And is there a way to change, how deep they sink into the water while swimming? Here are two pictures of an Angry Birds toons episode, where you can see the birds swimming in the sea while a beach-day: Angry Birds swimming scene 1 Angry Birds swimming scene 2 They float high on the water-surface, just like light wight beach-balls or balloons, filled with air. I wand to realize this effect with my Angry Birds-mobs, too. Actually they sink too deep into the water most of them sink about the half of their hight, the smallest ones sink compleetely below the surface (similar to ice, that floats in water). I want to reach, that only about 1/8 of their hight is actually below the water surface, while they swim (no matter, how big or small they are). -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
I wonder, why you say, i have to use lambda in the comperator. The comperator includes: ItemStack::getItem This is already lambda, but it does not work. So there must be any other reason, why the existing comperator does not work. -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
Because i found no way to get the comperator to work, i tryed around without it, directly in the method "fill" in my ItemGroup-class. So finally i got this: Override public void fill(NonNullList<ItemStack> itemStacks) { List<Item> items = Arrays.asList(AngryBirdsItems.red_egg, AngryBirdsItems.chuck_egg, AngryBirdsItems.blues_egg, AngryBirdsItems.bomb_egg, AngryBirdsItems.mathilda_egg, AngryBirdsItems.terence_egg, AngryBirdsItems.silver_egg, AngryBirdsItems.bubbles_egg, AngryBirdsItems.hal_egg, AngryBirdsItems.stella_egg, AngryBirdsItems.poppy_egg, AngryBirdsItems.willow_egg, AngryBirdsItems.dahlia_egg, AngryBirdsItems.luca_egg, AngryBirdsItems.ice_bird_egg, AngryBirdsItems.slingshot, AngryBirdsItems.red_shot, AngryBirdsItems.chuck_shot, AngryBirdsItems.blues_shot, AngryBirdsItems.bomb_shot, AngryBirdsItems.mathilda_shot, AngryBirdsItems.terence_shot, AngryBirdsItems.silver_shot, AngryBirdsItems.bubbles_shot, AngryBirdsItems.hal_shot, AngryBirdsItems.stella_shot, AngryBirdsItems.poppy_shot, AngryBirdsItems.willow_shot, AngryBirdsItems.dahlia_shot, AngryBirdsItems.luca_shot, AngryBirdsItems.ice_bird_shot, AngryBirdsItems.balloon_block, AngryBirdsItems.egg_block, AngryBirdsItems.nest_block, AngryBirdsItems.slingshot_acacia_block, AngryBirdsItems.slingshot_acacia_2_block, AngryBirdsItems.slingshot_birch_block, AngryBirdsItems.slingshot_birch_2_block, AngryBirdsItems.slingshot_dark_oak_block, AngryBirdsItems.slingshot_dark_oak_2_block, AngryBirdsItems.slingshot_jungle_block, AngryBirdsItems.slingshot_jungle_2_block, AngryBirdsItems.slingshot_oak_block, AngryBirdsItems.slingshot_oak_2_block, AngryBirdsItems.slingshot_spruce_block, AngryBirdsItems.slingshot_spruce_2_block, AngryBirdsItems.acacia_planks_frame_block, AngryBirdsItems.birch_planks_frame_block, AngryBirdsItems.dark_oak_planks_frame_block, AngryBirdsItems.jungle_planks_frame_block, AngryBirdsItems.oak_planks_frame_block, AngryBirdsItems.spruce_planks_frame_block, AngryBirdsItems.stone_frame_block, AngryBirdsItems.blue_ice_frame_block); itemStacks.clear(); for (Item item : items) { if(item.getCreativeTabs().contains(AngryBirds.RegistryEvents.ANGRY_BIRDS)) { itemStacks.add(new ItemStack(item)); } } } This makes the items appear in the order, i want to have them. -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
As i found no solution for the original setup of the comperator, i tried this now: List<ItemStack> order = null; for (Item item : items) { order.add(new ItemStack(item)); } itemSorter = Ordering.explicit(order); I thaught, maybe i can create a list of itemstacks and fill it with itemstacks of the items of the first list, and than just order by this seccond list, without using the .onResultOf(ItemStack::getItem); part of the comperator. but it gives this error: I thaught, the comperator has to sort itemstacks, so it needs a list of itemstacks to get the right order. So i thaught, i can create a list of itemstacks and use it directly for the comperator. It seams like it cannot compare ItemStacks directly. -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
Now i found some texts about lambda, but there i found no way to use lambda to call a non static method ("getItem") without creating an instance of it´s class ("ItemStack"). in some forums, i found on the web, thay say, this style is already lambda: ItemStack::getItem but ot makes the error: The type ItemStack does not define getItem(F) that is applicable here -
Why my entity-eggs are not in the order, i registered them?
Drachenbauer replied to Drachenbauer's topic in Modder Support
public static Comparator<? super ItemStack> tabSorter; tabSorter = Ordering.explicit(order).onResultOf(ItemStack::getItem); "getItem" cannot more be used this way there. How must i modify this comperator for sorting items to make it work in 1.14?