Register Loot Function
This commit is contained in:
parent
debafe02fb
commit
56d88ebcb2
@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
**1.0.16**
|
||||||
|
* Register Loot Function
|
||||||
|
|
||||||
**1.0.15**
|
**1.0.15**
|
||||||
* Fix Ender Pearl Bug
|
* Fix Ender Pearl Bug
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
|||||||
fabric_loader_version = 0.7.10+build.191
|
fabric_loader_version = 0.7.10+build.191
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.0.15
|
mod_version = 1.0.16
|
||||||
maven_group = com.thebrokenrail
|
maven_group = com.thebrokenrail
|
||||||
archives_base_name = reliccraft
|
archives_base_name = reliccraft
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.loot.BinomialLootTableRange;
|
import net.minecraft.loot.BinomialLootTableRange;
|
||||||
import net.minecraft.loot.LootTables;
|
import net.minecraft.loot.LootTables;
|
||||||
import net.minecraft.loot.entry.ItemEntry;
|
import net.minecraft.loot.entry.ItemEntry;
|
||||||
|
import net.minecraft.loot.function.LootFunctions;
|
||||||
import net.minecraft.recipe.SpecialRecipeSerializer;
|
import net.minecraft.recipe.SpecialRecipeSerializer;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.sound.SoundEvent;
|
import net.minecraft.sound.SoundEvent;
|
||||||
@ -144,6 +145,7 @@ public class RelicCraft implements ModInitializer {
|
|||||||
supplier.withPool(poolBuilder);
|
supplier.withPool(poolBuilder);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
LootFunctions.register(new RelicLootTableFunction.Factory());
|
||||||
|
|
||||||
REVEAL_RELIC_RECIPE = Registry.register(Registry.RECIPE_SERIALIZER, new Identifier(NAMESPACE, "reveal_relic"), new SpecialRecipeSerializer<>(RevealRelicRecipe::new));
|
REVEAL_RELIC_RECIPE = Registry.register(Registry.RECIPE_SERIALIZER, new Identifier(NAMESPACE, "reveal_relic"), new SpecialRecipeSerializer<>(RevealRelicRecipe::new));
|
||||||
TIME_DILATER_RECIPE = Registry.register(Registry.RECIPE_SERIALIZER, new Identifier(NAMESPACE, "time_dilater"), new SpecialRecipeSerializer<>(TimeDilaterRecipe::new));
|
TIME_DILATER_RECIPE = Registry.register(Registry.RECIPE_SERIALIZER, new Identifier(NAMESPACE, "time_dilater"), new SpecialRecipeSerializer<>(TimeDilaterRecipe::new));
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
package com.thebrokenrail.reliccraft.loot;
|
package com.thebrokenrail.reliccraft.loot;
|
||||||
|
|
||||||
|
import com.google.gson.JsonDeserializationContext;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
import com.squareup.moshi.JsonAdapter;
|
import com.squareup.moshi.JsonAdapter;
|
||||||
import com.squareup.moshi.Moshi;
|
import com.squareup.moshi.Moshi;
|
||||||
|
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||||
import com.thebrokenrail.reliccraft.data.RelicData;
|
import com.thebrokenrail.reliccraft.data.RelicData;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.loot.condition.LootCondition;
|
import net.minecraft.loot.condition.LootCondition;
|
||||||
@ -9,6 +12,7 @@ import net.minecraft.loot.context.LootContext;
|
|||||||
import net.minecraft.loot.function.ConditionalLootFunction;
|
import net.minecraft.loot.function.ConditionalLootFunction;
|
||||||
import net.minecraft.loot.function.LootFunction;
|
import net.minecraft.loot.function.LootFunction;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
public class RelicLootTableFunction extends ConditionalLootFunction {
|
public class RelicLootTableFunction extends ConditionalLootFunction {
|
||||||
private RelicLootTableFunction(LootCondition[] conditions) {
|
private RelicLootTableFunction(LootCondition[] conditions) {
|
||||||
@ -28,6 +32,17 @@ public class RelicLootTableFunction extends ConditionalLootFunction {
|
|||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class Factory extends ConditionalLootFunction.Factory<RelicLootTableFunction> {
|
||||||
|
public Factory() {
|
||||||
|
super(new Identifier(RelicCraft.NAMESPACE, "randomize_relic"), RelicLootTableFunction.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RelicLootTableFunction fromJson(JsonObject json, JsonDeserializationContext context, LootCondition[] conditions) {
|
||||||
|
return (RelicLootTableFunction) new Builder().build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class Builder extends ConditionalLootFunction.Builder<RelicLootTableFunction.Builder> {
|
public static class Builder extends ConditionalLootFunction.Builder<RelicLootTableFunction.Builder> {
|
||||||
@Override
|
@Override
|
||||||
protected RelicLootTableFunction.Builder getThisBuilder() {
|
protected RelicLootTableFunction.Builder getThisBuilder() {
|
||||||
@ -38,5 +53,4 @@ public class RelicLootTableFunction extends ConditionalLootFunction {
|
|||||||
return new RelicLootTableFunction(getConditions());
|
return new RelicLootTableFunction(getConditions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user