Everything posted by Abastro
-
MC 1.11.2 Custom chests
Ah, yes, you don't need that. Sorry for causing confusion. The block rendering should be updated when the neighbor is changed. EDIT: Sorry, I didn't know that you extended the vanilla chest.
-
[1.11.2] Client and Server are sent different Tile Entity NBT
Yes, there is a way. Override TileEntity::getUpdatePacket to write the sync packet, and override TileEntity::onDataPacket to read and apply the sync packet. You may want to override TileEntity::getUpdateTag and TileEntity::handleUpdateTag as well. Besides, TileEntity::readFromNBT won't be called by default.
-
Getting Distance between players
The hard part will be getting the enemy. How would you define the enemy? The target the player is attacking? The other part is easy: Entity::getDistanceToEntity(Entity). I don't know about official javadocs, but here's the official documentation for forge: http://mcforge.readthedocs.io/en/latest/
-
[solved][1.10.2] Server Events Help
ServerProxy is only applied on the dedicated server, like minecraftserver.exe. It's rarely needed. Just register server related stuff in your mod preinit/init/postinit.
-
MC 1.11.2 Custom chests
Yes, and everywhere else where update take in place.
-
MC 1.11.2 Custom chests
Where the tileentity rendering should be updated. Like updateContainingBlockInfo
-
MC 1.11.2 Custom chests
You need to update the rendering, call World::markAndNotifyBlock with flag 3.(the flag is explained on World::setBlock)
-
MC 1.11.2 Custom chests
Probably, override Block::onNeighborChanged? It has been several versions after I worked on tileentity, so my memory is not clear. But there should be similar method.
-
MC 1.11.2 Custom chests
Let the enum override IStringSerializable.
-
MC 1.11.2 Custom chests
Get it from the blockstate, it should be straightforward. About the rendering bug, do you detect whether the adjacent chest is removed?
-
MC 1.11.2 Custom chests
Yes. You don't need several blocks. About double chest:You need to detect adjacent chest placement on somewhere like Block#onNeighborChanged, and change field of both tileentities. About types: you can access blockstate on tileentity. Just put the chest type as blockstate. Also you need to configure the corresponding ItemBlock to apply the type on the block placement as well. EDIT: ninja'd
-
MC 1.11.2 Custom chests
One Tileentity is enough, as field in the TE can the color. Probably you can comfigure one chest TE to express the double one as well. (with isConnected or whatever) Do what you think is the best
-
[1.8.9]GL EROR & Dimension Chank Render Bug
Make sure that don't put 0 or smaller integer in GenLayer::nextInt method. weight/10 could be causing this. Rendering seems to be related with sky renderer, please post the code.
-
Custom Block (Oven)
@T.S.White, yes that works. That's what I mean by 'your own solution'. It means you need to design some system for that. EDIT: You need to be careful, as it could be easily messed up and many issues can arise.
-
Access keybind on mouse click event
Actually the name of the event is somewhat misleading. It is always called when attack key/mouse is pressed. Same for Item::onLeftClickEntity.
-
Custom Block (Oven)
It's impossible unless you check for every containers every tick. Also there are unloaded chests and tiles, mod-added bags, and such. You can't just rot those items continuously.
-
Access keybind on mouse click event
There's easier way for that: subscribe event: PlayerInteractEvent.LeftClickEmpty. Do what you want there. When you want to block hitting an entity, you can just override Item::onLeftClickEntity.
-
Access keybind on mouse click event
Yes. One drawback is that it can be detected continuously. I think you should take care of it manually.
-
Access keybind on mouse click event
keyBindAttack doesn't work because the left click is already processed as attack. The game resets the pressed flag to false after the process, so you can't detect it when it's bound to attack. So do you want to detect attacking? If what you need is checking whether left click button is clicked or not, you can use KeyBinding::isKeyDown().
-
MC 1.11.2 Custom chests
If your double chest is rendered on one of the two blocks, (i.e. the other is invisible,) Override TileEntity::getRenderBoundingBox to return appropriate size of the double chest.
-
Custom Block (Oven)
It's impossible to get the container the item is contained within the Item class. It should be implemented in the container. It'll be hard to implement rotting in other containers, as you'd better not access all of them every tick. Also there is an issue with items in unloaded TileEntity. So you need to invent your own solution with that.
-
[solved][1.10.2] Nested Array NBTData
What is your problem? Are you having hard time implementing it? You just need to nest NBTTagList, just like nested NBTTagCompound. Just use index instead of String key.
-
[1.11.2] onBlockActivated() Not Working
Now you are spawning the item on both side. You shouldn't do that, only spawn it on server thread, check if World::isRemote is false for that. (So basically invert World::isRemote check)
-
Breaking Doors and Avoiding water[1.10.2]
Please post what you've tried.
-
Update comparator signal when inventory changes
Yes, you have to pass the tileentity reference to the inventory capability. Usually item is inserted/extracted through the capability including hoppers and modded pipes, so it's the best place to check for inventory change and apply the comparator update. Besides, forget about doFill. It was about fluids.
IPS spam blocked by CleanTalk.