-
Posts
6157 -
Joined
-
Last visited
-
Days Won
59
Everything posted by Animefan8888
-
ItemStackHandler not a direct replacement for IInventory?
Animefan8888 replied to TheGreyGhost's topic in Modder Support
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. -
[SOLVED][1.15.2] Loot table for block not recognized
Animefan8888 replied to tubi_carrillo's topic in Modder Support
No it shouldn't be can you post your project as a github repo. -
[SOLVED][1.15.2] Loot table for block not recognized
Animefan8888 replied to tubi_carrillo's topic in Modder Support
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. -
[SOLVED][1.15.2] Loot table for block not recognized
Animefan8888 replied to tubi_carrillo's topic in Modder Support
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. -
Problem registering recipe serializer 1.15.2.
Animefan8888 replied to AntonBespoiasov's topic in Modder Support
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. -
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.
-
ItemStackHandler not a direct replacement for IInventory?
Animefan8888 replied to TheGreyGhost's topic in Modder Support
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. -
[1.14.4] Is there a way to recycle Mod Renderers or Models?
Animefan8888 replied to Keheck's topic in Modder Support
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. -
Override getBurnTime in your Item class.
-
[Solved] Forge failing to load mods.toml (Setup wasn't correct)
Animefan8888 replied to _Cruelar_'s topic in Modder Support
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? -
[Solved] Forge failing to load mods.toml (Setup wasn't correct)
Animefan8888 replied to _Cruelar_'s topic in Modder Support
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. -
[Solved] Forge failing to load mods.toml (Setup wasn't correct)
Animefan8888 replied to _Cruelar_'s topic in Modder Support
You are missing these two lines. modLoader="javafml" loaderVersion="[31,)" And both are mandatory. -
You can use a regex to find connected numbers.
-
One of your recipes is incorrect somewhere. Check the console/log file to see which one(s) and fix them.
-
my minecraft won't start it keeps crashing, help!
Animefan8888 replied to Vixier03's topic in Support & Bug Reports
Post the whole latest.log file. -
How about you explain exactly what you are trying to do?
-
Need help with an error that keeps occuring
Animefan8888 replied to Babelincoln1809's topic in Modder Support
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. -
[1.15.2] BlockColored class for changing wool color
Animefan8888 replied to rhin123's topic in Modder Support
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. -
[1.15.2] BlockColored class for changing wool color
Animefan8888 replied to rhin123's topic in Modder Support
Each Color seems to have it's own Block. -
minecraft forge 1.14.4: finished with non-zero exit value 1
Animefan8888 replied to gwar's topic in Modder Support
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. -
Commands are registered on both the IntegratedServer and DedicatedServer. The IntegratedServer is on the client so you can register it in FMLServerStartingEvent.