Skip to content

Commit 714a87f

Browse files
committed
Comments
1 parent 98a431e commit 714a87f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/datastorage/attachments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Usually, block entities and chunks need to be marked as dirty when they are modi
7676
```java
7777
chunk.setData(MANA, chunk.getData(MANA) + 10); // will call setUnsaved automatically
7878
```
79-
but if you modify some data that you obtained from `getData` then you must mark block entities and chunks as dirty explicitly:
79+
but if you modify some data that you obtained from `getData` (including a newly created default instance) then you must mark block entities and chunks as dirty explicitly:
8080
```java
8181
var mana = chunk.getData(MUTABLE_MANA);
8282
mana.set(10);

docs/datastorage/capabilities.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ NeoForge provides capabilities for the following three interfaces: `IItemHandler
3838
- `Capabilities.FluidHandler.BLOCK`: automation-accessible fluid inventory of a block.
3939
- `Capabilities.FluidHandler.ENTITY`: fluid inventory of an entity.
4040
- `Capabilities.FluidHandler.ITEM`: fluid inventory of an item stack.
41+
This capability is of the special `IFluidHandlerItem` type due to the way buckets hold fluids.
4142

4243
`IEnergyStorage` exposes an interface for handling energy containers. It is based on the RedstoneFlux API by TeamCoFH. The capabilities of type `IEnergyStorage` are:
4344
- `Capabilities.EnergyStorage.BLOCK`: energy contained inside a block.
@@ -123,8 +124,8 @@ if (object != null) {
123124
}
124125
```
125126

126-
Block capabilities are used a bit differently.
127-
The query is performed on a `level`, with the `pos`ition that we are looking for as an additional parameter:
127+
Block capabilities are used a bit differently because blocks without a block entity can have capabilities as well.
128+
The query is now performed on a `level`, with the `pos`ition that we are looking for as an additional parameter:
128129
```java
129130
var object = level.getCapability(CAP, pos, context);
130131
if (object != null) {

0 commit comments

Comments
 (0)