Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Anubis

Members
  • Joined

  • Last visited

Everything posted by Anubis

  1. Ok, thanks a lot. I will try this and ask later, if there will come more questions
  2. Ok. My problem is, that I need to save the herd for the leader and the leader for the members of the herd as UUIDs so they don't mess up serverside. But in the renderer I don't have access to serverside to transform the UUID to the entity ID. How can I cross this border? Do I need 2 DataParameters, one with UUID and one with ID or should I only use the IDs?
  3. I try to create a mob that forms herds with one leader. For troubleshooting in future, I tried to visualize with lines which mobs the herd follows, so who is the leader. Problem is, that getting Entitys form Serverside to clientside is a bit difficult. I know, that i can use UUID to store data in DataParameters, but ClientSide uuids dont work and I am not sure, if simple Id work properly on Server too. So I used UUIDs and made some networking to get the entity from the UUID on the client, but this seems not to be the right way to me, especially because the updating via network is not possible from the Goal, that creates the Link between the mobs, because this is missing the player to send the datas to. I attached all files needet, I guess an a picture how it looks like at the moment. It is ok that way, but it isn't the right way, so maybe anyone can tell me what I am doing wrong or has an idea of how I can do it better. Thanks for any help and happy new year everyone Herd_Mob.java JoinHerdGoal.java HerdMobRenderer.java
  4. I just cancle the event, when the Player doesn't use the right tool. I just taught, if he wants to break the block, you can remove it manually. I could not see through the Link you send, so I found my own, maybe not so good way
  5. Other option ist to cancle the break block event, then the block wont be broken and you don't get drops. Then you can remove block with filling with air. But this isn't the most beautiful way
  6. I generate some structures in my world, but i couldn't figure out, how to fill the space underneath them(see picture below). Normal Minecraft structures(Village Houses, Nether Fortress) always extend to the ground, but I couldn't figure out, how I can implement that behavior to my structures. Anyone an Idea. I am modding for forge 1.15
  7. ok, nice hint. But it dont removes the problem. Some recipes I just remove by adding because of multicolour, like beds, but especially colours from flowers have not to easy names, so do I need to remove them on after another? Here are the left recipes
  8. I try to remove all vanilla recipes with overwriding them. So i made a ShapelessRecipeBuilder an iterate over all item names. This removes most of the recipes, but there are some special named missing. Mainly the multi-recipes for an item, for example blue_dye_from_cornflower. Any idea how I can get them all. Here is my code: Field[] fieldarray = Items.class.getDeclaredFields(); Items items = new Items(); for (Field field : fieldarray) { if(field.getAnnotatedType().getType().equals(Item.class)) { try { Item item = (Item) field.get(items); ResourceLocation nameString = item.getRegistryName(); if (nameString != null) { ShapelessRecipeBuilder shapelessRecipeBuilder = ShapelessRecipeBuilder.shapelessRecipe(Items.BEDROCK); shapelessRecipeBuilder.addIngredient(Blocks.BEDROCK,10); shapelessRecipeBuilder.setGroup("uncraftable"); shapelessRecipeBuilder.addCriterion("has_BEDROCK", this.hasItem(Blocks.BEDROCK)); shapelessRecipeBuilder.build(consumer, nameString); } } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } PS: I tried Air as output, but this always crashed of nullpointer Exception
  9. I don't know if anyone is interested, but I found my mistake. After long searching I found the problem, just a stupid one. Before the upgrading procedure I had a isRemote check, witch cases the unsync between client and server side. Thanks for help everyone
  10. Maybe thats an stupid question, but how do i synchronize that? That's my NetworkHooks for the tileentity: NetworkHooks.openGui((ServerPlayerEntity) playerEntity, village_Center_Tile_Entity, blockPos); What do I need to add, so it will synchronize?
  11. Sorry, couldn't the insert code last time. Now I changed it
  12. I have a little problem with my Inventory. I want to make it upgradeble so you can have more Slots in it. So I addet an Integer in the TileEntiy for the number of Slots and changed the size of the LazyOptional<ItemStackHandler> inventory and it seems to work, but the screen is a bit buggy. The bigger inventory occupies slots from the playerinventory and does not extend its own one, althouge I adjust the number of slots via the Integer in the tileEntity. Any idea what I am doing wrong? My Function to increase size in the TileEntity: public void setItemSlots(int itemSlots) { this.itemSlots = itemSlots; LazyOptional<ItemStackHandler> itemHandler = LazyOptional.of(() -> new ItemStackHandler(itemSlots)); inventory.ifPresent(consumer -> { for (int i = 0; i < consumer.getSlots(); i++) { int slot = i; itemHandler.ifPresent(consumer1 -> consumer1.setStackInSlot(slot, consumer.getStackInSlot(slot))); } }); inventory = itemHandler; } The init of the Container. Maybe I need to re-init it, but I dont know how @Override public void init() { tileEntity.getInventory().ifPresent(handler -> addSlots(handler, 0 , 8, 25, tileEntity.getItemSlots())); addPlayerInventory(8, 113); } The addSlots Functions: public int addHorizontalSlots(IItemHandler handler, int index, int x, int y, int amount) { for (int i = 0; i < amount; i++) { addSlot(new SlotItemHandler(handler, index, x, y)); x+=18; index++; } return index; } public int addSlots(IItemHandler handler, int index, int x, int y, int amount) { int verticalAmount = (int) Math.ceil(amount/9); for (int i = 0; i < verticalAmount; i++) { index = addHorizontalSlots(handler,index,x,y,9); y+=18; } index = addHorizontalSlots(handler, index, x, y, amount%9); return index; } My render in screen: @Override public void render(int mouseX, int mouseY, float partialTicks) { // TODO Auto-generated method stub renderBackground(); super.render(mouseX, mouseY, partialTicks); renderHoveredToolTip(mouseX, mouseY); getHoverdVillager(mouseX, mouseY); renderVillagerTooltip(mouseX,mouseY,this.font); }
  13. Thanks to everyone here. It seems, that I am not the only one, who learnt something new...
  14. At first, i want to say thanks for fast reply. For the Item- and BlockTags and the Recipes I could use a provider, so i thought that it would work her too. Especially because it implements the IDataProvider. Just want to mention that I mean the import BlockStateProvider from net.minecraftforge.client.model.generators.BlockStateProvider, not the other one. Here are my other Generators: public class Crushing_Projekt_RecipeProvider extends RecipeProvider{ public Crushing_Projekt_RecipeProvider( DataGenerator generatorIn) { super(generatorIn); // TODO Auto-generated constructor stub } protected InventoryChangeTrigger.Instance hasItem(IItemProvider itemIn) { return this.hasItem(ItemPredicate.Builder.create().item(itemIn).build()); } @Override protected void registerRecipes( Consumer<IFinishedRecipe> consumer) { ShapedRecipeBuilder.shapedRecipe(Items.DIAMOND, 5)// .patternLine("AAA")// .patternLine("ABA")// .patternLine("AAA")// .key('A', Blocks.DIRT)// .key('B', Crushing_Projekt_Items.Basic_Item)// .addCriterion("has_Dirt", hasItem(Blocks.DIRT))// .build(consumer, new ResourceLocation(Crushing_Projekt.MODID,"tutorial_diamonds")); ShapedRecipeBuilder.shapedRecipe(Crushing_Projekt_Items.Basic_Item, 1)// .patternLine("AAB")// .patternLine("ACD")// .patternLine("BDC")// .key('A', Items.AIR)// .key('B', Items.OBSERVER)// .key('C', Items.STICKY_PISTON) .key('D', Items.SLIME_BLOCK) .setGroup("tutorial_basic") .addCriterion("has_Piston", this.hasItem(Blocks.PISTON))// .build(consumer, new ResourceLocation(Crushing_Projekt.MODID,"tutorial_basic_1")); ShapelessRecipeBuilder.shapelessRecipe(Crushing_Projekt_Items.Basic_Item, 1) .addIngredient(Blocks.PISTON) .addIngredient(Items.DIAMOND,8) .setGroup("tutorial_basic") .addCriterion("has_Piston", this.hasItem(Blocks.PISTON)) .build(consumer, new ResourceLocation(Crushing_Projekt.MODID,"tutorial_basic_2")); //Smelts all with tag Tutorial CookingRecipeBuilder.smeltingRecipe(Ingredient.fromTag(Crushing_Projekt_Tags.Items.Tutorial), Blocks.ANDESITE, 1, 10) .addCriterion("has_Door", hasItem(Items.DIRT)) .build(consumer, new ResourceLocation(Crushing_Projekt.MODID,"tutorial_andesite")); //Smelts with forge Tag (Sotrage_Blocks, z.B. Iron Block) CookingRecipeBuilder.smeltingRecipe(getFakeIngredient(Tags.Items.STORAGE_BLOCKS), Blocks.ANDESITE, 1, 10) .addCriterion("has_storage", hasItem(Tags.Items.STORAGE_BLOCKS)) .build(consumer, new ResourceLocation(Crushing_Projekt.MODID,"tutorial_andesite_fremd")); /* CookingRecipeBuilder.smeltingRecipe(getFakeIngredient(Tags.Items.STORAGE_BLOCKS), Blocks.ANDESITE, 1, 10) .addCriterion("has_storage", hasItem(Tags.Items.STORAGE_BLOCKS)) .build(consumer, new ResourceLocation(Crushing_Projekt.MODID,"tutorial_andesite_fremd")); */ } private Ingredient getFakeIngredient(Tag<Item> tag) { return Ingredient.fromItemListStream(Stream.of(new TagList(tag){ @Override public Collection<ItemStack> getStacks(){ return Arrays.asList(new ItemStack(Items.ACACIA_LOG)); } })); } } public class Crushing_Projekt_ItemTagsProvider extends ItemTagsProvider{ public Crushing_Projekt_ItemTagsProvider(DataGenerator generator) { super(generator); } @Override protected void registerTags() { getBuilder(Crushing_Projekt_Tags.Items.Tutorial).add(Crushing_Projekt_Items.Basic_Item).add(Crushing_Projekt_Blocks.BASIC_BLOCK.asItem()); } } public class Crushing_Projekt_BlockTagsProvider extends BlockTagsProvider{ public Crushing_Projekt_BlockTagsProvider(DataGenerator generator) { super(generator); } @Override protected void registerTags() { getBuilder(Crushing_Projekt_Tags.Blocks.Tutorial) .add(Crushing_Projekt_Blocks.BASIC_BLOCK).add(Tags.Blocks.STORAGE_BLOCKS_DIAMOND); } } they all work and are much simpler to use then using a big code, like Animefan8888 did. But as i mentioned, i don't get it work. I found an Youtube Video, where someone used it, but i could figure out, how to adjust it.
  15. I try to use the BlockStateProvider Provider to create the JSON's Files(Model and Blockstates) for my blocks, but i couldn't figure out how it works and couldn't find a tutorial or stuff like this. I just want to create simple all side same block and model, but doing it for every block is exhausting, so i wanted to use the BlockStateProvider. I found the models().cubeAll(name, texture) command, but I don't know, how to fill in the right values. I tried models().cubeAll("basic_block", new ResourceLocation(Mod.MODID,"basic_block")); but only got errors. public class Crushing_Projekt_BlocksGenerator extends BlockStateProvider { public Crushing_Projekt_BlocksGenerator(DataGenerator gen, ExistingFileHelper exFileHelper) { super(gen, Crushing_Projekt.MODID, exFileHelper); // TODO Auto-generated constructor stub } @Override protected void registerStatesAndModels() { models().cubeAll("basic_block", new ResourceLocation(Crushing_Projekt.MODID,"basic_block")); } } Thanks for help PS: English isn't my mother tongue, but I hope you understand what I mean.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.