generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
98 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/com/github/zly2006/reden/rvc/nbt/DiffProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.github.zly2006.reden.rvc.nbt; | ||
|
||
import net.minecraft.nbt.NbtCompound; | ||
|
||
public interface DiffProvider { | ||
NbtDiff get(NbtCompound before, NbtCompound after); | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/github/zly2006/reden/rvc/nbt/DirectDiff.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.github.zly2006.reden.rvc.nbt | ||
|
||
import net.minecraft.nbt.NbtCompound | ||
import java.util.function.Supplier | ||
|
||
class DirectDiff( | ||
private val after: NbtCompound | ||
): NbtDiff { | ||
override fun apply(nbt: Supplier<NbtCompound>): NbtCompound { | ||
return after.copy() | ||
} | ||
|
||
override fun combine(parent: NbtDiff) = this | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
package com.github.zly2006.reden.rvc.nbt | ||
|
||
import net.minecraft.nbt.NbtCompound | ||
import java.util.function.Supplier | ||
|
||
interface NbtDiff { | ||
fun apply(nbt: NbtCompound): NbtCompound | ||
fun combine(another: NbtDiff) | ||
fun apply(nbt: Supplier<NbtCompound>): NbtCompound | ||
fun combine(parent: NbtDiff): NbtDiff | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters