Skip to content

Commit 161bcd2

Browse files
Merge remote-tracking branch 'origin/mui2-refactor' into tar/mui-central-monitor
# Conflicts: # src/main/java/com/gregtechceu/gtceu/common/cover/ComputerMonitorCover.java # src/main/java/com/gregtechceu/gtceu/common/machine/electric/BatteryBufferMachine.java # src/main/java/com/gregtechceu/gtceu/common/machine/electric/HullMachine.java # src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/CentralMonitorMachine.java # src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/DataAccessHatchMachine.java # src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/monitor/AdvancedMonitorPartMachine.java # src/main/java/com/gregtechceu/gtceu/common/network/GTNetwork.java # src/main/java/com/gregtechceu/gtceu/utils/GTStringUtils.java # src/main/java/com/gregtechceu/gtceu/utils/serialization/network/ByteBufAdapters.java
2 parents b001b28 + 786ece6 commit 161bcd2

File tree

452 files changed

+16455
-10635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

452 files changed

+16455
-10635
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ name: Publish docs via GitHub Pages
22
on:
33
workflow_dispatch:
44
push:
5-
branches: [1.20.1]
5+
branches: ["1.20.1", "1.21"]
66
paths: ['docs/**']
77

88
permissions:
9-
contents: read
10-
pages: write
11-
id-token: write
9+
contents: write
1210

1311
concurrency:
1412
group: 'pages'
@@ -24,33 +22,17 @@ jobs:
2422
steps:
2523
- uses: actions/checkout@v4
2624
with:
27-
ref: '1.20.1'
28-
sparse-checkout: './docs'
25+
ref: '${{ github.ref_name }}'
26+
fetch-depth: 0
2927
- uses: actions/setup-python@v4
3028
with:
3129
python-version: '3.11'
3230
cache: 'pip'
33-
- run: pip install -r ./requirements.txt
34-
- uses: actions/cache@v4
35-
with:
36-
key: 'mkdocs-cache'
37-
path: './docs/.cache'
38-
- name: Build static files
39-
id: mkdocs
40-
run: mkdocs build
41-
- name: Upload pages as artifact
42-
id: artifact
43-
uses: actions/upload-pages-artifact@v3
44-
with:
45-
path: './docs/site/'
46-
47-
deploy:
48-
runs-on: ubuntu-latest
49-
needs: build
50-
environment:
51-
name: github-pages
52-
url: ${{ steps.deployment.outputs.page_url }}
53-
steps:
54-
- name: Deploy Pages
55-
id: deployment
56-
uses: actions/deploy-pages@v4
31+
- name: Install packages
32+
run: pip install -r ./requirements.txt
33+
- name: Set git username and password
34+
run: git config user.name 'github-actions[bot]'; git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
35+
- name: Deploy pages to gh-pages branch
36+
run: mike deploy "${{ github.ref_name }}" --push
37+
- name: Ensure 1.20.1 is the default version
38+
run: mike set-default 1.20.1 --push

CHANGELOG.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,104 @@
11
# ChangeLog
22

3+
## Version [v7.4.0](https://github.com/GregTechCEu/GregTech-Modern/compare/v7.3.0-1.20.1...v7.4.0-1.20.1)
4+
### Added
5+
6+
- Add Bucket/Tank items interaction with coke oven by @Spicierspace153 in [#4190](https://github.com/GregTechCEu/GregTech-Modern/pull/4190)
7+
- NBT Predicate Ingredient by @jurrejelle in [#4175](https://github.com/GregTechCEu/GregTech-Modern/pull/4175)
8+
- Add a SpeedBoost When Walking on Concrete by @YoungOnionMC in [#3985](https://github.com/GregTechCEu/GregTech-Modern/pull/3985)
9+
10+
### Fixed
11+
12+
- Change paused steel boiler texture to be consistent with other boilers by @GirixK in [#4196](https://github.com/GregTechCEu/GregTech-Modern/pull/4196)
13+
- Fix server disconnections and other network errors from causing a crash by @gustovafing in [#4169](https://github.com/GregTechCEu/GregTech-Modern/pull/4169)
14+
- Implement creating Chanced and Ranged NBTPredicateIngredients by @DilithiumThoride in [#4202](https://github.com/GregTechCEu/GregTech-Modern/pull/4202)
15+
- Fix machines set to disable after current cycle not disabling on powerstall by @DilithiumThoride in [#4215](https://github.com/GregTechCEu/GregTech-Modern/pull/4215)
16+
- Balance chemical titanium recipe by @jurrejelle in [#4228](https://github.com/GregTechCEu/GregTech-Modern/pull/4228)
17+
- Fix Jade showing all singleblock generators as producing at LV by @DilithiumThoride in [#4193](https://github.com/GregTechCEu/GregTech-Modern/pull/4193)
18+
- Use manual tag checking instead of IsSameItemSameTags by @YoungOnionMC in [#4210](https://github.com/GregTechCEu/GregTech-Modern/pull/4210)
19+
20+
### Changed
21+
22+
- Update zh_cn.json 1.20 by @iouter in [#4226](https://github.com/GregTechCEu/GregTech-Modern/pull/4226)
23+
- Refactor OR and XOR chance logic rolls to multiply outputs for Guaranteed Rolls rather than adding by @DilithiumThoride in [#4211](https://github.com/GregTechCEu/GregTech-Modern/pull/4211)
24+
25+
26+
## Version [v7.3.0](https://github.com/GregTechCEu/GregTech-Modern/compare/v7.2.1-1.20.1...v7.3.0-1.20.1)
27+
### Added
28+
29+
- Re-enable using Screwdriver to toggle Drum auto output, if Allow Input From Output Side is disabled by @DilithiumThoride in [#4163](https://github.com/GregTechCEu/GregTech-Modern/pull/4163)
30+
- Implement voiding mode by @nutant233 in [#3924](https://github.com/GregTechCEu/GregTech-Modern/pull/3924)
31+
- Turbine Energy Voiding by @YoungOnionMC in [#4177](https://github.com/GregTechCEu/GregTech-Modern/pull/4177)
32+
- Max Parallel Setting on place by @YoungOnionMC in [#4186](https://github.com/GregTechCEu/GregTech-Modern/pull/4186)
33+
- Miner block replacement by @YoungOnionMC in [#4021](https://github.com/GregTechCEu/GregTech-Modern/pull/4021)
34+
- Change some formulas to make them more accurate by @TarLaboratories in [#4017](https://github.com/GregTechCEu/GregTech-Modern/pull/4017)
35+
36+
### Fixed
37+
38+
- Fix CC integration with the monitor cover by @TarLaboratories in [#4143](https://github.com/GregTechCEu/GregTech-Modern/pull/4143)
39+
- Add material existing checks before making pipe recipes by @jurrejelle in [#4146](https://github.com/GregTechCEu/GregTech-Modern/pull/4146)
40+
- Fix toggling Advanced Energy Detector Cover between EU and % modes causing values to decrement by @DilithiumThoride in [#4159](https://github.com/GregTechCEu/GregTech-Modern/pull/4159)
41+
- Fix Stone Pressure Plate / Button recipe conflict by @DilithiumThoride in [#4131](https://github.com/GregTechCEu/GregTech-Modern/pull/4131)
42+
- Re-enable using Screwdriver to toggle Drum auto output, if Allow Input From Output Side is disabled by @DilithiumThoride in [#4163](https://github.com/GregTechCEu/GregTech-Modern/pull/4163)
43+
- Validate KubeJS recipes to ensure no invalid/missing ingredients by @mikerooni in [#4170](https://github.com/GregTechCEu/GregTech-Modern/pull/4170)
44+
- fix (steam) multiblocks not resetting progress on powerfail by @DilithiumThoride in [#4181](https://github.com/GregTechCEu/GregTech-Modern/pull/4181)
45+
- Add missing tooltips for auto-output buttons in machine UIs by @mikerooni in [#4180](https://github.com/GregTechCEu/GregTech-Modern/pull/4180)
46+
- Fix XEI display for recipes with IO and TickIO of the same ingredient type by @DilithiumThoride in [#4137](https://github.com/GregTechCEu/GregTech-Modern/pull/4137)
47+
- Fix Jade provider displaying no energy for addon steam machines consuming 1mB/t by @DilithiumThoride in [#4127](https://github.com/GregTechCEu/GregTech-Modern/pull/4127)
48+
- Fix ore veins with only one layer causing crashes by @screret in [#4183](https://github.com/GregTechCEu/GregTech-Modern/pull/4183)
49+
- Fix Ranged Fluid Ingredients deserializing incorrectly in SMP by @DilithiumThoride in [#4150](https://github.com/GregTechCEu/GregTech-Modern/pull/4150)
50+
- Swap Diluted HCl to return HCl on Circuit 1 by @DilithiumThoride in [#4125](https://github.com/GregTechCEu/GregTech-Modern/pull/4125)
51+
- Fix Tool Matching using every Item tag by @YoungOnionMC in [#3945](https://github.com/GregTechCEu/GregTech-Modern/pull/3945)
52+
- Ore Maceration Changes by @YoungOnionMC in [#4020](https://github.com/GregTechCEu/GregTech-Modern/pull/4020)
53+
54+
### Changed
55+
56+
- update ja_jp by @code-onigiri in [#4099](https://github.com/GregTechCEu/GregTech-Modern/pull/4099)
57+
- Deprecate ChanceLogic.FIRST by @DilithiumThoride in [#4109](https://github.com/GregTechCEu/GregTech-Modern/pull/4109)
58+
- Holistic Rebalance to the Large and Small Boiler by @Ghostipedia in [#4075](https://github.com/GregTechCEu/GregTech-Modern/pull/4075)
59+
- Ore Maceration Changes by @YoungOnionMC in [#4020](https://github.com/GregTechCEu/GregTech-Modern/pull/4020)
60+
61+
62+
## Version [v7.2.1](https://github.com/GregTechCEu/GregTech-Modern/compare/v.7.2.0-1.20.1...v7.2.1-1.20.1)
63+
### Added
64+
65+
- Add flag to disable create compat by @jurrejelle in [#3956](https://github.com/GregTechCEu/GregTech-Modern/pull/3956)
66+
- Make new flag DISABLE_MATERIAL_RECIPES to replace NO_UNIFICATION. by @Phoenixvine32908 in [#3999](https://github.com/GregTechCEu/GregTech-Modern/pull/3999)
67+
- Alter Jade/TOP provider to display machine voltage tier by machine tier rather than by recipe/overclock tier by @DilithiumThoride in [#4002](https://github.com/GregTechCEu/GregTech-Modern/pull/4002)
68+
- Buff facade recipe by @htmlcsjs in [#4007](https://github.com/GregTechCEu/GregTech-Modern/pull/4007)
69+
- Format Numbers by @remakefactory in [#4111](https://github.com/GregTechCEu/GregTech-Modern/pull/4111)
70+
71+
### Fixed
72+
73+
- Make energy placeholder work with substations by @TarLaboratories in [#3964](https://github.com/GregTechCEu/GregTech-Modern/pull/3964)
74+
- Fix Advanced Energy Detector Cover not working in % mode by @DilithiumThoride in [#3950](https://github.com/GregTechCEu/GregTech-Modern/pull/3950)
75+
- Fix recipe search for Ranged Fluid Ingredients on 0 roll by @DilithiumThoride in [#3968](https://github.com/GregTechCEu/GregTech-Modern/pull/3968)
76+
- Rename AdjacentFluid overload by @jurrejelle in [#3960](https://github.com/GregTechCEu/GregTech-Modern/pull/3960)
77+
- Slightly increase Large Turbine energy output and fuel burn by @DilithiumThoride in [#3988](https://github.com/GregTechCEu/GregTech-Modern/pull/3988)
78+
- Fix crates voiding the inventories of their stack after being placed down by @purebluez in [#4012](https://github.com/GregTechCEu/GregTech-Modern/pull/4012)
79+
- Read and Display Subtick Overclock Parallels separately from Hatch-based Parallels by @DilithiumThoride in [#3961](https://github.com/GregTechCEu/GregTech-Modern/pull/3961)
80+
- Fix central monitor crash by @TarLaboratories in [#4010](https://github.com/GregTechCEu/GregTech-Modern/pull/4010)
81+
- Fix Machine explosions by @YoungOnionMC in [#3983](https://github.com/GregTechCEu/GregTech-Modern/pull/3983)
82+
- Fix color spray not working with blockstate by @bnjmn21 in [#3982](https://github.com/GregTechCEu/GregTech-Modern/pull/3982)
83+
- Fix and align textures of (passthrough) hatch/buses, pipeline endpoints and pump hatch by @arsdragonfly in [#3944](https://github.com/GregTechCEu/GregTech-Modern/pull/3944)
84+
- Add slice-by-slice recipe consumption by @jurrejelle in [#4006](https://github.com/GregTechCEu/GregTech-Modern/pull/4006)
85+
- Fix representative recipes not generating by @YoungOnionMC in [#4019](https://github.com/GregTechCEu/GregTech-Modern/pull/4019)
86+
- Downscale manual IO disabled button by @JuiceyBeans in [#4051](https://github.com/GregTechCEu/GregTech-Modern/pull/4051)
87+
- fix registry removal by @NegaNote in [#4108](https://github.com/GregTechCEu/GregTech-Modern/pull/4108)
88+
- Fix material decomp not working with KJS recipes by @YoungOnionMC in [#4116](https://github.com/GregTechCEu/GregTech-Modern/pull/4116)
89+
- Fix Polished Stone Crafting Recipe by @YoungOnionMC in [#4071](https://github.com/GregTechCEu/GregTech-Modern/pull/4071)
90+
- Fix laser and Optical pipe ignoring connections by @nutant233 in [#3939](https://github.com/GregTechCEu/GregTech-Modern/pull/3939)
91+
- Fix turbines crashing when interacting with active rotor holders by @Taskeren in [#4047](https://github.com/GregTechCEu/GregTech-Modern/pull/4047)
92+
93+
### Changed
94+
95+
- Force modifier re-apply when recipe starts after being suspended by @jurrejelle in [#3971](https://github.com/GregTechCEu/GregTech-Modern/pull/3971)
96+
- recipe manager handling refactor by @TechLord22 in [#3975](https://github.com/GregTechCEu/GregTech-Modern/pull/3975)
97+
- Rename AdjacentFluid overload by @jurrejelle in [#3960](https://github.com/GregTechCEu/GregTech-Modern/pull/3960)
98+
- Read and Display Subtick Overclock Parallels separately from Hatch-based Parallels by @DilithiumThoride in [#3961](https://github.com/GregTechCEu/GregTech-Modern/pull/3961)
99+
- Translated using Weblate (Russian) for 1.20.1 by @marisathewitch in [#4078](https://github.com/GregTechCEu/GregTech-Modern/pull/4078)
100+
101+
3102
## Version [v.7.2.0](https://github.com/GregTechCEu/GregTech-Modern/compare/v7.1.4-1.20.1...v.7.2.0-1.20.1)
4103
### Added
5104

docs/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,8 @@ mkdocs serve
7979
The following plugins for MkDocs are being used:
8080
- https://squidfunk.github.io/mkdocs-material/
8181
- https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin
82+
83+
## Deployment
84+
The hosted documentation is found on the `gh-pages` branch of the repository. [Mike](https://github.com/jimporter/mike) is used to deploy both the 1.20.1 and 1.21.1 documentation on the same site through Github Actions.
85+
86+
When working on the docs locally, the plain `mkdocs` commands should be used to view the changes made to the version of the docs you are currently working on, like the previously mentioned `mkdocs serve`.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: "Annotations"
3+
---
4+
5+
# Annotations
6+
The following annotations define the sync/save behaviour for an `ISyncManaged` object.
7+
8+
### `@SaveField`
9+
10+
The `@SaveField` annotation defines a field that should be saved to the server. `nbtKey` is optional, the key will default to the field name.
11+
```java
12+
@SaveField(nbtKey="nbtKeyToSaveTo")
13+
public int mySaveInt = 10;
14+
```
15+
16+
### `@SyncToClient`
17+
18+
The `@SyncToClient` annotation defines a field with a value that should be synced to clients.
19+
20+
!!! warning
21+
Client sync fields **do not** automatically detect changes. When changing a client sync field, call `ISyncManaged.getSyncDataHolder().markClientSyncFieldDirty(FIELD_NAME)`
22+
```java
23+
@SaveField(nbtKey="nbtKeyToSaveTo")
24+
@SyncToClient
25+
public int mySaveAndSyncInt = 10;
26+
27+
@SyncToClient
28+
@RerenderOnChanged
29+
public long mySyncRerenderLong = 10000L;
30+
31+
public void serverTick() {
32+
int newIntValue = getNewIntValue();
33+
long newLongValue = getNewLongValue();
34+
if (mySaveAndSyncInt != newIntValue) {
35+
mySaveAndSyncInt = newIntValue;
36+
getSyncDataHolder().markClientSyncFieldDirty("mySaveAndSyncInt");
37+
}
38+
if (mySyncRerenderLong != newLongValue) {
39+
mySyncRerenderLong = newLongValue;
40+
getSyncDataHolder().markClientSyncFieldDirty("mySyncRerenderLong");
41+
}
42+
}
43+
```
44+
45+
### `@ClientFieldChangeListener` and `@RerenderOnChanged`
46+
47+
The `@ClientFieldChangeListener` annotation defines a method to be called on the client when a client sync field has changed value;
48+
49+
Annotating a `@SyncToClient` field with `@RerenderOnChanged` will cause clients to rerender the block entity when this field changes.
50+
51+
```java
52+
@SyncToClient
53+
@SaveField
54+
@RerenderOnChanged
55+
public boolean isWorkingEnabled = true;
56+
57+
@ClientFieldChangeListener(fieldName="isWorkingEnabled")
58+
public void isWorkingChanged() {
59+
setRenderState(getRenderState().setValue(GTMachineModelProperties.IS_WORKING_ENABLED, isWorkingEnabled));
60+
}
61+
```
62+
63+
### `@FieldDataModifier` and `@CustomDataField`
64+
65+
66+
67+
The `@FieldDataModifier`annotation defines custom processing to be performed on the NBT for a field, e.g. for compatibility reasons.
68+
69+
The `@CustomDataField`annotation defines a field with a type too complex to be serialised using the normal system. Custom data fields must have exactly one load modifier and one data modifier.
70+
71+
Field data modifiers on non-custom fields will be applied *after* standard serialisation/deserialisation, and will be called with an argument containing the current tag.
72+
73+
```java
74+
@CustomDataField
75+
@SaveField
76+
public VeryComplexType myVeryComplexValue = new VeryComplexType();
77+
78+
@FieldDataModifier(fieldName="myVeryComplexValue", target=FieldDataModifier.MODIFY_TARGET.LOAD_NBT)
79+
public void loadVeryComplexValue(CompoundTag tag) {
80+
// Process tag here.
81+
myVeryComplexValue = new VeryComplexType();
82+
}
83+
84+
@FieldDataModifier(fieldName="myVeryComplexValue", target=FieldDataModifier.MODIFY_TARGET.SAVE_NBT)
85+
public CompoundTag saveVeryComplexValue(CompoundTag tag, boolean isSendingToClient) {
86+
// Save data here.
87+
return tag;
88+
}
89+
```
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "Migrating from LDLib SyncData"
3+
---
4+
# Migrating from LDLib SyncData
5+
6+
### General migration guidelines
7+
8+
- Remove all `ManagedFieldHolder` fields.
9+
- Replace `FieldManagedStorage` fields with `SyncDataHolder` fields.
10+
- Replace `IEnhancedManaged` objects with `ISyncManaged`.
11+
- Replace `IAsyncAutoSyncBlockEntity`, `IAutoPersistBlockEntity`, `IAutoSyncBlockEntity` and `IManagedBlockEntity` by extending `ManagedSyncBlockEntity`.
12+
13+
### Annotations
14+
15+
!!! warning
16+
Client sync fields **do not** automatically detect changes. When changing a client sync field, call `ISyncManaged.syncDataHolder.markClientSyncFieldDirty(FIELD_NAME)`
17+
18+
- `@DescSynced` -> `@SyncToClient`
19+
- `@RequireRerender` -> `@RerenderOnChanged`
20+
- `@Persisted` -> `@SaveField`
21+
- `@UpdateListener` -> `@ClientFieldChangeListener` on listener method.
22+
- `@DropSaved` - Removed, make machines implement `IDropSaveMachine` instead
23+
- `@ReadOnlyManaged` and `@LazyManaged` See usage docs for instructions on complex sync objects
24+
25+
### Other changes
26+
27+
- `saveCustomPersistedData` & `loadCustomPersistedData` methods: Use `@CustomDataModifier` & `@FieldDataModifier`
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: "Usage"
3+
---
4+
5+
## Usage
6+
7+
### Registering classes with the sync system
8+
9+
At the core of the system is the interface `ISyncManaged`, which represents a class that to be synchronised with the client or saved.
10+
All block entities which should be synchronised or saved must extend the abstract class `ManagedSyncBlockEntity`.
11+
12+
!!! warning
13+
Block entities that inherit `ManagedSyncBlockEntity` must call `ManagedSyncBlockEntity::updateTick`***every tick*** within their ticker, or they will not be saved.
14+
15+
```java
16+
class MySyncObject implements ISyncManaged {
17+
// Any class that directly implements ISyncManaged must have the following:
18+
@Getter
19+
protected final SyncDataHolder syncDataHolder = new SyncDataHolder(this);
20+
21+
22+
/**
23+
* Function called when the SyncDataHolder requests a rerender
24+
*/
25+
void scheduleRenderUpdate();
26+
27+
/**
28+
* Function called to notify the server that this object has been updated and must be synced to clients
29+
*/
30+
void markAsChanged();
31+
}
32+
```
33+
34+
### Registering fields to be managed by the system
35+
See [Annotations](Annotations.md)
36+
37+
### Type compatibility
38+
The following field types are supported by default:
39+
- Any class implementing `ISyncManaged`
40+
- Any class implementing `INBTSerializable<Tag>`
41+
- All primitive types
42+
- If `T`, `K` are supported types:
43+
- `T[]`
44+
- `Set<T>`
45+
- `List<T>`,
46+
- `Map<T, K>`
47+
- `String`
48+
- `ItemStack`
49+
- `FluidStack`
50+
- `UUID`
51+
- `BlockPos`
52+
- `CompoundTag`
53+
- `GTRecipe`
54+
- `GTRecipeType`
55+
- `MachineRenderState`
56+
- `Material`
57+
- `Component`
58+
59+
### Adding support for additional types
60+
61+
To add support for an additional type, call `ValueTransformers.registerClassTransformer(Class<?> cls, IValueTransformer<?> transformer)` or `ValueTransformers.registerInterfaceTransformer(Class<?> cls, IValueTransformer<?> transformer)`
62+
63+
The `IValueTransformer<T>` interface defines how a value of type `T` should be serialised.
64+
65+
```java
66+
public interface IValueTransformer<T> {
67+
68+
// If this type cannot be instanced purely from a serialised tag.
69+
// All complex type typically have mustProvideObject true
70+
default boolean mustProvideObject() {
71+
return false;
72+
}
73+
74+
// A method for serialising a value into a tag
75+
// Called when serialising a value to be sent to the client
76+
default Tag serializeClientSyncNBT(@Nullable T value, ISyncManaged holder) {
77+
return serializeNBT(value, holder);
78+
}
79+
80+
// A method for deserialising a value from a tag
81+
// Called when deserialising a value on the client.
82+
// If mustProvideObject == true, currentVal is the currently saved value.
83+
default T deserializeClientNBT(Tag tag, ISyncManaged holder, @Nullable T currentVal) {
84+
return deserializeNBT(tag, holder, currentVal);
85+
}
86+
87+
88+
// A method for serialising a value into a tag.
89+
// The holder param is the object this sync value is attached to
90+
Tag serializeNBT(T value, ISyncManaged holder);
91+
92+
// A method for deserialising a value from a tag
93+
// If mustProvideObject == true, currentVal is the currently saved value.
94+
T deserializeNBT(Tag tag, ISyncManaged holder, @Nullable T currentVal);
95+
}
96+
```
97+
98+
Some types may be too complex to be processed using this system. For more complex NBT interactions, use the `@FieldDataModifier` and `@CustomDataField` annotations.

0 commit comments

Comments
 (0)