Class GlobalLootModifiersTest.SilkTouchTestModifier.Serializer
java.lang.Object
net.minecraftforge.common.loot.GlobalLootModifierSerializer<GlobalLootModifiersTest.SilkTouchTestModifier>
net.minecraftforge.debug.gameplay.loot.GlobalLootModifiersTest.SilkTouchTestModifier.Serializer
- All Implemented Interfaces:
IForgeRegistryEntry<GlobalLootModifierSerializer<?>>
- Enclosing class:
- GlobalLootModifiersTest.SilkTouchTestModifier
private static class GlobalLootModifiersTest.SilkTouchTestModifier.Serializer
extends GlobalLootModifierSerializer<GlobalLootModifiersTest.SilkTouchTestModifier>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionread
(ResourceLocation name, com.google.gson.JsonObject json, LootItemCondition[] conditionsIn) Most mods will likely not need more than
return new MyModifier(conditionsIn)
but any additional properties that are needed will need to be deserialized here.com.google.gson.JsonObject
Write the serializer to json.Methods inherited from class net.minecraftforge.common.loot.GlobalLootModifierSerializer
getRegistryName, getRegistryType, makeConditions, setRegistryName, setRegistryName, setRegistryName
-
Constructor Details
-
Serializer
private Serializer()
-
-
Method Details
-
read
public GlobalLootModifiersTest.SilkTouchTestModifier read(ResourceLocation name, com.google.gson.JsonObject json, LootItemCondition[] conditionsIn) Description copied from class:GlobalLootModifierSerializer
Most mods will likely not need more than
return new MyModifier(conditionsIn)
but any additional properties that are needed will need to be deserialized here.- Specified by:
read
in classGlobalLootModifierSerializer<GlobalLootModifiersTest.SilkTouchTestModifier>
- Parameters:
name
- The resource location (if needed)json
- The full json object (including ILootConditions)conditionsIn
- An already deserialized list of ILootConditions
-
write
Description copied from class:GlobalLootModifierSerializer
Write the serializer to json. Most serializers won't have to do anything else thanGlobalLootModifierSerializer.makeConditions(net.minecraft.world.level.storage.loot.predicates.LootItemCondition[])
Which simply creates the JsonObject from an array of ILootConditions.- Specified by:
write
in classGlobalLootModifierSerializer<GlobalLootModifiersTest.SilkTouchTestModifier>
-