-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
00c93b6
commit 98cf2a1
Showing
12 changed files
with
161 additions
and
15 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
4 changes: 0 additions & 4 deletions
4
src/main/java/io/github/nickid2018/genwiki/autovalue/GameRuleDataExtractor.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
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
23 changes: 23 additions & 0 deletions
23
src/main/java/io/github/nickid2018/genwiki/autovalue/wikidata/CodecWikiData.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,23 @@ | ||
package io.github.nickid2018.genwiki.autovalue.wikidata; | ||
|
||
import com.google.gson.JsonElement; | ||
import com.google.gson.JsonObject; | ||
|
||
import java.util.Map; | ||
import java.util.TreeMap; | ||
|
||
public class CodecWikiData extends JsonWikiData { | ||
|
||
private final Map<String, JsonElement> json = new TreeMap<>(); | ||
|
||
public void add(String name, JsonElement data) { | ||
json.put(name, data); | ||
} | ||
|
||
@Override | ||
public JsonElement asJsonData() { | ||
JsonObject obj = new JsonObject(); | ||
json.forEach(obj::add); | ||
return obj; | ||
} | ||
} |
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
wrapped-mc/src/main/java/net/minecraft/core/HolderLookup.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 |
---|---|---|
@@ -1,8 +1,15 @@ | ||
package net.minecraft.core; | ||
|
||
import com.mojang.serialization.DynamicOps; | ||
import io.github.nickid2018.util.SneakyUtil; | ||
import net.minecraft.resources.RegistryOps; | ||
|
||
public interface HolderLookup { | ||
|
||
interface Provider { | ||
|
||
default <V> RegistryOps<V> createSerializationContext(DynamicOps<V> dynamicOps) { | ||
return SneakyUtil.sneakyNotNull(); | ||
} | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
wrapped-mc/src/main/java/net/minecraft/core/component/DataComponentMap.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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package net.minecraft.core.component; | ||
|
||
public interface DataComponentMap { | ||
import java.util.Set; | ||
|
||
public interface DataComponentMap | ||
extends Iterable<TypedDataComponent<?>>{ | ||
|
||
<T> T get(DataComponentType<? extends T> var1); | ||
} |
4 changes: 4 additions & 0 deletions
4
wrapped-mc/src/main/java/net/minecraft/core/component/DataComponentType.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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
package net.minecraft.core.component; | ||
|
||
import com.mojang.serialization.Codec; | ||
|
||
public interface DataComponentType<T> { | ||
|
||
Codec<T> codec(); | ||
} |
4 changes: 4 additions & 0 deletions
4
wrapped-mc/src/main/java/net/minecraft/core/component/TypedDataComponent.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,4 @@ | ||
package net.minecraft.core.component; | ||
|
||
public record TypedDataComponent<T>(DataComponentType<T> type, T value) { | ||
} |
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
74 changes: 74 additions & 0 deletions
74
wrapped-mc/src/main/java/net/minecraft/resources/RegistryOps.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,74 @@ | ||
package net.minecraft.resources; | ||
|
||
import com.mojang.datafixers.util.Pair; | ||
import com.mojang.serialization.DataResult; | ||
import com.mojang.serialization.DynamicOps; | ||
|
||
import java.util.stream.Stream; | ||
|
||
public class RegistryOps<T> implements DynamicOps<T> { | ||
@Override | ||
public T empty() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public <U> U convertTo(DynamicOps<U> outOps, T input) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public DataResult<Number> getNumberValue(T input) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public T createNumeric(Number i) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public DataResult<String> getStringValue(T input) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public T createString(String value) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public DataResult<T> mergeToList(T list, T value) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public DataResult<T> mergeToMap(T map, T key, T value) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public DataResult<Stream<Pair<T, T>>> getMapValues(T input) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public T createMap(Stream<Pair<T, T>> map) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public DataResult<Stream<T>> getStream(T input) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public T createList(Stream<T> input) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public T remove(T input, String key) { | ||
return null; | ||
} | ||
} |
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