Everything posted by Animefan8888
-
ItemStackHandler not a direct replacement for IInventory?
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
No it shouldn't be can you post your project as a github repo.
-
[SOLVED][1.15.2] Loot table for block not recognized
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
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.
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.
-
How to add a delay when an event is fired
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.
-
Why blockitems disappear from creative menu, if i override a block?
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);
-
ItemStackHandler not a direct replacement for IInventory?
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?
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.
-
Custom Fuels in 1.15.2
Override getBurnTime in your Item class.
-
[Solved] Forge failing to load mods.toml (Setup wasn't correct)
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)
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)
You are missing these two lines. modLoader="javafml" loaderVersion="[31,)" And both are mandatory.
-
Un-needed thread
You can use a regex to find connected numbers.
-
[1.15.2] All recipes gone
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!
Post the whole latest.log file.
-
Un-needed thread
How about you explain exactly what you are trying to do?
-
Need help with an error that keeps occuring
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.
-
File is for an older version of Forge and cannot be loaded - n00b error
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.
-
[1.15.2] BlockColored class for changing wool color
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
Each Color seems to have it's own Block.
-
[1.15.2] [SOLVED!] Stop player tick event running as both server and client
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.
-
minecraft forge 1.14.4: finished with non-zero exit value 1
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.
-
registering client only commands
Commands are registered on both the IntegratedServer and DedicatedServer. The IntegratedServer is on the client so you can register it in FMLServerStartingEvent.
-
is there a way, that the vanilla RedStoneWireBlock get´s the coloring from a png in a custom resourcelocation?
I don't know what is causing that, but it could just be how it's handling lighting in the game.
IPS spam blocked by CleanTalk.