Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. What are you talking about. This is all about how you setup your containers. The client does have the TileEntities in the world so you can just get it from the world. If you create your ContainerType like this you have access to your TileEntity. IForgeContainerType.create((id, playerInven, buffer) -> new MyContainer(id, inventory.player.world.getTileEntity(buffer.readBlockPos()), inventory)).setRegistryName("modid:my_container"); It is called whenever an ItemStack inside the ItemStackHandler is changed from one to another or insert/extract has been called. However if you instead do something like ItemStackHandler::getStackInSlot().setTag(someNBTTag); It will not be called in this case make sure to call it yourself.
  2. No it shouldn't be can you post your project as a github repo.
  3. That's meant for other things. like entities and chests. not blocks. It doesn't say that it's required for blocks under the blocks section. If it is something about the file itself there will likely be an error in the console when you load up Minecraft.
  4. I don't know where you got the information that you have to use that method, but you don't it is automatic now. And it uses your registry name as the file name. It's not supposed to be assets/ it's data/modid/loot_tables/blocks/mod_block.json.
  5. First off don't use this method use the forge Registry stuff like the events or the DeferredRegistry. What does your recipe(json file) look like.
  6. Here's how I would do it. I don't see any reason for a capability here. It's not like the information needs to be persistent/a lot of data. Create a class that has one event in it. The WorldTickEvent, you already know how to subscribe to events. Then in that class make a two static fields one which is an int that will just count ticks, and another that will map an int to an ItemEntity. Then in your EntityJoinWorldEvent add the entity to the list if it is a Sapling. Use the key of the map(the int) to determine when your even will run. Then in order to place the Block that code would look something like this. World world = event.getWorld(); ItemEntity entity; BlockItem item = (BlockItem) entity.getItem().getItem(); Block block = item.getBlock(); BlockPos pos = entity.getPosition(); world.setBlockState(pos, block.getDefaultState()); However that will just put the sapling where ever it is located at in the world. I would use World::getBlockState to check the block underneath it(is it on dirt, grass, etc) is there already a block here? Maybe some other things.
  7. Technically you don't have to register an Item at all. You just need to update the Item.BLOCK_TO_ITEM mapping. Like so Item.BLOCK_TO_ITEM.put(myOverridenBlock, Items.ITEM_I_WANT);
  8. If you haven't given your container a reference to the TileEntity I have only one question for you. Why? Also why would it be an Optional? Your container can't exist without the TileEntity right? At least in most cases. You may have a few that are reused. You don't need to do that. Just override ItemStackHandler::onContentsChanged to call TileEntity::markDirty(). Then just use SlotItemHandler for all your slot needs that are not limited.
  9. I think you are worrying over nothing to be honest. Adding extra classes is little to no RAM really. Also you wouldn't want to be querying a database every frame, so you would have to cache parts of the database. Also you wouldn't want to send a request to a server during a render call, so the database file would need to be stored locally, now you would also not want to query the database during a render call either. Therefore the database would already be loaded up into memory anyway defeating the purpose of having it. Because now we have an Entity, Model, and "Model Data" instead of Entity, Model, and Renderer.
  10. Override getBurnTime in your Item class.
  11. I'm not sure what you are asking. Is the file located in the built jar file? And could you post your code as a github repo so I can test it locally?
  12. I agree with Ugdhar. Would make this a little easier. However, try building your mod and checking if the built jar contains the mods.toml file. If it doesn't there was likely a problem with setting up your workspace and you will need to do it again.
  13. You are missing these two lines. modLoader="javafml" loaderVersion="[31,)" And both are mandatory.
  14. You can use a regex to find connected numbers.
  15. One of your recipes is incorrect somewhere. Check the console/log file to see which one(s) and fix them.
  16. Post the whole latest.log file.
  17. How about you explain exactly what you are trying to do?
  18. I've seen this crash once before on here, however I'm not sure what the fix was for it. Actually here is a link to the post where a "solution" was found.
  19. Go to files.minecraftforge.net and download the latest mdk for 1.15.2 and you can follow this tutorial I have to setup a workspace. Assuming you are using eclipse.
  20. First off DyeColor is an enum you can just use ==. Secondly you can make a map which maps the DyeColor to the Block. Like the SheepEntity does. Or just make a static method that uses a switch method.
  21. Each Color seems to have it's own Block.
  22. You check for logical sides by using World::isRemote. if it is false the world is on the logical server if it is true you are on the logical client.
  23. Show your code. Also it looks like you are launching your own program aka you have your own main function. That is not what you are supposed to do.
  24. Commands are registered on both the IntegratedServer and DedicatedServer. The IntegratedServer is on the client so you can register it in FMLServerStartingEvent.
  25. I don't know what is causing that, but it could just be how it's handling lighting in the game.
×
×
  • Create New...

Important Information

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