Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Drachenbauer

  1. Now i can place the wing stand in my little test-world and it looks alright. But a rightclick opens the common brewing-stand-window and not my modifyed one...
  2. I mean, i don´t know, wich numbers instde theese blits are the position for displaying the graphics. Is the blaze input the little horizontal bar below the bubbles? If yes, i moved it together with the bubbles. And i wonder, why there is a longer spiral-wire at the right side of the graphic, where the overlays are?
  3. In the BrewingStandBloch i find "BlockStateProperties.HAS_BOTTLE_0" and the same with 1 and 2. It seems like BlockStateProperties is a vanilla-class How do i add one more for the fourth bottle? And for the TileEntity: I extend LockableTileEntity, because if i extend BrewingStandTileEntity, i cannot pass my TileEntityType to the constructor. So i copied the whoole code of BrewingStandTileEntity into my one. But i´m not sure, where i have to do some changes to add one more inventory-slot Edit I had to change the position of the bubbles and the arrow on the brewingstand-window a bit to fit four slots. Wich values on my screen-class (copy of the brewingstand´s screen-class) must i change to change the positions for the white overlays?
  4. But i don´t know any lambda expressions, that i can place at the initialization of an array Sometimes i get errors, even, if i try to access the id of one of theese registry-objects instead of the registry name of the block.... edit: now i noticed, this now happens only at trying to access the RegistryObjects of the full pots, wich are registered in a seccond, nested for-loop.
  5. I don´t know, where else i should place the for-loops in this case. I cannot place them directly inside the class-body. and if i create a method for them, i don´t know where to call this method. Is there any way to put them directly into the initialisation of the array or list?
  6. I´m not sure, if they are even registered if in lists or arrays. Edit: i noticed, Object not present errors appear, if i try to access the blocks inside a static { } in the class with the item-registries, but not inside public static final class-fields there. For a test I added this static thing to the item registry-class of a working mod and tried to access a block inside there by using it´s registryname as a console-output. This made an Object not present error. Edit: if i keep,the items as separate class-fields, but the blocks in an array or list, i get a NullPointerException at the method, that registers the full pots and plants to the empty pots. And if i comment out this methode for a test, i get this error:
  7. My repository again: https://github.com/Drachenbauer/ColoredFlowerPotsMod I noticed, if i register each block in it´s own public static final class-field of RegistryObject<FlowerpotBlock>, i can access their block-instances in the class with the item-registry at registering the BlockItems in similar fields of of RegistryObject<BlockItem> (look at commeted out parts of the code). But if i pack all block-registries for the enpty flowerpots into an array RegistryObject<FlowerpotBlock> or an ArrayList<RegistryObject<FlowerpotBlock>>, i get a NullPointerException, if i ty to access them at item-registry (the exeption points to the line, where i register the item). It also happens, if i write a getter for the RegistryObject in the blockregistry class. It seems like, if i use lists or arrays, the blocks are not registered as fast as in separate public static final class-fields I´m not sure, if they are even registered if in lists or arrays.
  8. Here is now my repository: https://github.com/Drachenbauer/ColoredFlowerPotsMod The mod works, if i use the commented out parts of code in all classes, instead of the stuff with the for-loops. If i get the for-loops to work, i delete the other stuff. How do i add a crashlog? Edit: This Page needs very long time to load stuff from facebook...
  9. I know, how to put a project on github, but not how to add an errorlog...
  10. i know, where it is, but i don´t know, what´s wrong with that line... I´m sure, it should get the id of the RegistryObject(that´s similar to the RegistryName of the block.) But i don´t know, why it finds no registryname to use...
  11. Code: public static final DeferredRegister<Item> ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, Reference.MOD_ID); @SuppressWarnings("unchecked") public static final RegistryObject<BlockItem>[] EMPTY_FLOWER_POTS = new RegistryObject[ColoredFlowerPotsBlocks.COLORS.size() + 1]; private static int i; static { i = 0; for (RegistryObject<FlowerPotBlock> empty_pot_register : ColoredFlowerPotsBlocks.EMPTY_FLOWER_POTS) { String empty_pot = empty_pot_register.getId().getPath(); EMPTY_FLOWER_POTS[i] = ITEMS.register(empty_pot, () -> new BlockItem(empty_pot_register.get(), new Item.Properties().defaultMaxDamage(0).group(ColoredFlowerPots.COLORED_FLOWERPOTS).maxStackSize(64).rarity(Rarity.COMMON).setNoRepair())); i++; } } I tried to use Arrays instead of ArrayLists now. console: i don´t know, how to display the "30 more" lines at the end, if they include helpful infos
  12. If i try to use getId from the block-RegistryObject to generate the registryname for the blockitem-registry, i get a NullPointerException...
  13. But how do i fill the supplyer-thing for the full pots where the need to know their emptx pots? Edit: I noticed, i can put the RegistryObject of the empty pot there.
  14. as i registered my Blocks this way: public static final RegistryObject<FlowerPotBlock> BLACK_FLOWER_POT = BLOCKS.register("black_flower_pot", () -> new FlowerPotBlock( null, AIR_SUPPLIER,Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid())); i was able to register the blockitem this way: public static final RegistryObject<Item> BLACK_FLOWER_POT = ITEMS.register("black_flower_pot", () -> new BlockItem(ColoredFlowerPotsBlocks.BLACK_FLOWER_POT.get(), new Item.Properties().defaultMaxDamage(0).group(ColoredFlowerPots.COLORED_FLOWERPOTS).maxStackSize(64).rarity(Rarity.COMMON).setNoRepair())); Do you mean, that i try to access the block for generating the item-registryname at using the variant with list and for-loop? But once i also had the error, where i called the method addPlant of the FlowerPotBlock, and tried to access the blocks there-
  15. with the arraylist, i got this error too, as i tried to access the blocks at registering the blockitems.
  16. Now i have this: public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, Reference.MOD_ID); private static final Supplier<Block> AIR_SUPPLIER = () -> Blocks.AIR; public static final ArrayList<Supplier<Block>> PLANT_SUPPLIERS = new ArrayList<Supplier<Block>>(Arrays.asList(() -> Blocks.ACACIA_SAPLING, () -> Blocks.ALLIUM, () -> Blocks.AZURE_BLUET, () -> Blocks.BAMBOO, () -> Blocks.BIRCH_SAPLING, () -> Blocks.BLUE_ORCHID, () -> Blocks.BROWN_MUSHROOM, () -> Blocks.CACTUS, () -> Blocks.CORNFLOWER, () -> Blocks.DANDELION, () -> Blocks.DARK_OAK_SAPLING, () -> Blocks.DEAD_BUSH, () -> Blocks.FERN, () -> Blocks.JUNGLE_SAPLING, () -> Blocks.LILY_OF_THE_VALLEY, () -> Blocks.OAK_SAPLING, () -> Blocks.ORANGE_TULIP, () -> Blocks.OXEYE_DAISY, () -> Blocks.PINK_TULIP, () -> Blocks.POPPY, () -> Blocks.RED_MUSHROOM, () -> Blocks.RED_TULIP, () -> Blocks.SPRUCE_SAPLING, () -> Blocks.WHITE_TULIP, () -> Blocks.WITHER_ROSE)); public static final ArrayList<String> COLORS = new ArrayList<String>(Arrays.asList("black", "blue", "brown", "cyan", "gray", "green", "light_blue", "light_gray", "lime", "magenta", "orange", "pink", "purple", "red", "white", "yellow")); public static final ArrayList<RegistryObject<FlowerPotBlock>> EMPTY_FLOWER_POT_REGISTRIES = new ArrayList<RegistryObject<FlowerPotBlock>>(); public static final ArrayList<Supplier<FlowerPotBlock>> EMPTY_FLOWER_POT_SUPPLIERS = new ArrayList<Supplier<FlowerPotBlock>>(); public static final ArrayList<FlowerPotBlock> EMPTY_FLOWER_POTS = new ArrayList<FlowerPotBlock>(); public static final ArrayList<RegistryObject<FlowerPotBlock>> FULL_FLOWER_POT_REGISTRIES = new ArrayList<RegistryObject<FlowerPotBlock>>(); public static final ArrayList<Supplier<FlowerPotBlock>> FULL_FLOWER_POT_SUPPLIERS = new ArrayList<Supplier<FlowerPotBlock>>(); public static final ArrayList<FlowerPotBlock> FULL_FLOWER_POTS = new ArrayList<FlowerPotBlock>(); private static int i; private static int j; static { i = 0; for(String color : COLORS) { EMPTY_FLOWER_POT_REGISTRIES.add(BLOCKS.register(color + "_flower_pot", () -> new FlowerPotBlock(null, AIR_SUPPLIER, Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid()))); EMPTY_FLOWER_POT_SUPPLIERS.add(() -> EMPTY_FLOWER_POT_REGISTRIES.get(i).get()); j = 0; for(Supplier<Block> plant_supplier : PLANT_SUPPLIERS) { String plant = plant_supplier.get().getRegistryName().getPath(); FULL_FLOWER_POT_REGISTRIES.add(BLOCKS.register(color + "_potted_" + plant, () -> new FlowerPotBlock(EMPTY_FLOWER_POT_SUPPLIERS.get(i), plant_supplier, Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid()))); FULL_FLOWER_POT_SUPPLIERS.add(() -> FULL_FLOWER_POT_REGISTRIES.get(j).get()); j++; } i++; } } Why this makes a "RegistryObject not present" error, if i want to access the blocks anywhere in the code? Only the lines, wich fill the Supplier-Lists, don´t make the error. Why i cannot access theese blocks, or does the registry process not work at list-contents?
  17. I find nothing about the ItemGroup in that log-text-file... It really looks like there is any limit, that it can create only two pages on the creative-inventory and display only 5 modded tabs, basic inventory and search-function on the seccond page.
  18. i noticed, that i had a mistake in the registryname of the block in the class with the block registrys so it didn´t match the correct name in the json´s
  19. Now i made it possible, to run the test-client and enter the world, but the tulip in the pot appears as a black and purple bug-block... seems like using stuff from the two coremods as parent in the json files foes not work now...
  20. where do i find the log, if i run it in the actual game? In the test-client it works fine.
  21. The itemgroup-class: package drachenbauer32.coloredflowerpotsmod.util; import drachenbauer32.coloredflowerpotsmod.ColoredFlowerPots; import drachenbauer32.coloredflowerpotsmod.init.ColoredFlowerPotsItems; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; public class ColoredFlowerPotsItemGroup extends ItemGroup { public ColoredFlowerPotsItemGroup() { super("ColoredFlowerPots"); } @Override public ItemStack createIcon() { return new ItemStack(ColoredFlowerPotsItems.YELLOW_FLOWER_POT.get()); } @Override public void fill(NonNullList<ItemStack> itemStacks) { super.fill(itemStacks); itemStacks.sort(ColoredFlowerPots.itemSorter); } } I have no log. My other mods use an almodt identical ItemGroup-class. The only differences are the class-name, the name-string in the constructor and the item for the icon. The itemgroups of the other mods appear in the test-client and in the actual game.
  • Create New...

Important Information

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