Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
Painting roller and Painted glowstone blocks now available in generat…
Browse files Browse the repository at this point in the history
…ed chests
  • Loading branch information
florian-berger committed Nov 20, 2022
1 parent 4760ff4 commit d52fcc8
Show file tree
Hide file tree
Showing 17 changed files with 435 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"entries": [
"paintedglowstone:additions_nether_bridge",
"paintedglowstone:additions_bastion_other",
"paintedglowstone:additions_bastion_treasure",
"paintedglowstone:additions_abandoned_mineshaft",
"paintedglowstone:additions_bastion_hoglin_stable",
"paintedglowstone:additions_bastion_bridge",
"paintedglowstone:additions_simple_dungeon",
"paintedglowstone:additions_ruined_portal"
],
"replace": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "paintedglowstone:addition",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/abandoned_mineshaft"
}
],
"loot_table": "paintedglowstone:chests/additions_abandoned_mineshaft"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "paintedglowstone:addition",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/bastion_bridge"
}
],
"loot_table": "paintedglowstone:chests/additions_nether"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "paintedglowstone:addition",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/bastion_hoglin_stable"
}
],
"loot_table": "paintedglowstone:chests/additions_nether"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "paintedglowstone:addition",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/bastion_other"
}
],
"loot_table": "paintedglowstone:chests/additions_nether"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "paintedglowstone:addition",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/bastion_treasure"
}
],
"loot_table": "paintedglowstone:chests/additions_nether"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "paintedglowstone:addition",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/nether_bridge"
}
],
"loot_table": "paintedglowstone:chests/additions_nether"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "paintedglowstone:addition",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/ruined_portal"
}
],
"loot_table": "paintedglowstone:chests/additions_ruined_portal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "paintedglowstone:addition",
"conditions": [
{
"condition": "forge:loot_table_id",
"loot_table_id": "minecraft:chests/simple_dungeon"
}
],
"loot_table": "paintedglowstone:chests/additions_abandoned_mineshaft"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"type": "minecraft:chest",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "libx:all",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"chance": 0.3,
"condition": "minecraft:random_chance"
}
],
"name": "paintedglowstone:painting_roll"
},
{
"type": "minecraft:item",
"conditions": [
{
"chance": 0.03,
"condition": "minecraft:random_chance"
}
],
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 3.0,
"min": 1.0
},
"function": "minecraft:set_count"
}
],
"name": "paintedglowstone:painted_glowstone"
}
]
}
],
"name": "main",
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"type": "minecraft:chest",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "libx:all",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"chance": 0.5,
"condition": "minecraft:random_chance"
}
],
"name": "paintedglowstone:painting_roll"
},
{
"type": "minecraft:item",
"conditions": [
{
"chance": 0.6,
"condition": "minecraft:random_chance"
}
],
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 8.0,
"min": 1.0
},
"function": "minecraft:set_count"
}
],
"name": "paintedglowstone:painted_glowstone"
}
]
}
],
"name": "main",
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"type": "minecraft:chest",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "libx:all",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"chance": 0.3,
"condition": "minecraft:random_chance"
}
],
"name": "paintedglowstone:painting_roll"
},
{
"type": "minecraft:item",
"conditions": [
{
"chance": 0.03,
"condition": "minecraft:random_chance"
}
],
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 3.0,
"min": 1.0
},
"function": "minecraft:set_count"
}
],
"name": "paintedglowstone:painted_glowstone"
}
]
}
],
"name": "main",
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package biz.berger_media.paintedglowstone.data;

import biz.berger_media.paintedglowstone.loot.AdditionalLootModifier;
import net.minecraft.data.DataGenerator;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.common.data.GlobalLootModifierProvider;
import net.minecraftforge.common.loot.LootTableIdCondition;
import org.moddingx.libx.annotation.data.Datagen;
import org.moddingx.libx.mod.ModX;

@Datagen
public class LootModifierProvider extends GlobalLootModifierProvider {
private final ModX mod;

public LootModifierProvider(ModX mod, DataGenerator generator) {
super(generator, mod.modid);
this.mod = mod;
}

@Override
protected void start() {
this.add("additions_abandoned_mineshaft", new AdditionalLootModifier(
this.mod.resource("chests/additions_abandoned_mineshaft"),
new LootTableIdCondition.Builder(new ResourceLocation("minecraft", "chests/abandoned_mineshaft")).build()
));

this.add("additions_simple_dungeon", new AdditionalLootModifier(
this.mod.resource("chests/additions_abandoned_mineshaft"),
new LootTableIdCondition.Builder(new ResourceLocation("minecraft", "chests/simple_dungeon")).build()
));

this.add("additions_bastion_bridge", new AdditionalLootModifier(
this.mod.resource("chests/additions_nether"),
new LootTableIdCondition.Builder(new ResourceLocation("minecraft", "chests/bastion_bridge")).build()
));

this.add("additions_bastion_hoglin_stable", new AdditionalLootModifier(
this.mod.resource("chests/additions_nether"),
new LootTableIdCondition.Builder(new ResourceLocation("minecraft", "chests/bastion_hoglin_stable")).build()
));

this.add("additions_bastion_other", new AdditionalLootModifier(
this.mod.resource("chests/additions_nether"),
new LootTableIdCondition.Builder(new ResourceLocation("minecraft", "chests/bastion_other")).build()
));

this.add("additions_bastion_treasure", new AdditionalLootModifier(
this.mod.resource("chests/additions_nether"),
new LootTableIdCondition.Builder(new ResourceLocation("minecraft", "chests/bastion_treasure")).build()
));

this.add("additions_nether_bridge", new AdditionalLootModifier(
this.mod.resource("chests/additions_nether"),
new LootTableIdCondition.Builder(new ResourceLocation("minecraft", "chests/nether_bridge")).build()
));

this.add("additions_ruined_portal", new AdditionalLootModifier(
this.mod.resource("chests/additions_ruined_portal"),
new LootTableIdCondition.Builder(new ResourceLocation("minecraft", "chests/ruined_portal")).build()
));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package biz.berger_media.paintedglowstone.data;

import biz.berger_media.paintedglowstone.ModBlocks;
import biz.berger_media.paintedglowstone.ModItems;
import net.minecraft.data.DataGenerator;
import org.moddingx.libx.annotation.data.Datagen;
import org.moddingx.libx.datagen.provider.loot.ChestLootProviderBase;
import org.moddingx.libx.mod.ModX;

@Datagen
public class LootTableProvider extends ChestLootProviderBase {
public LootTableProvider(ModX mod, DataGenerator generator) {
super(mod, generator);
}

@Override
@SuppressWarnings("unchecked")
protected void setup() {
this.drops("additions_abandoned_mineshaft",
this.stack(ModItems.paintingRoll).with(this.random(0.3F)),
this.stack(ModBlocks.paintedGlowstone).with(this.random(0.03F)).with(this.count(1, 3))
);

this.drops("additions_nether",
this.stack(ModItems.paintingRoll).with(this.random(0.5F)),
this.stack(ModBlocks.paintedGlowstone).with(this.random(0.6F)).with(this.count(1, 8))
);

this.drops("additions_ruined_portal",
this.stack(ModItems.paintingRoll).with(this.random(0.3F)),
this.stack(ModBlocks.paintedGlowstone).with(this.random(0.03F)).with(this.count(1, 3))
);
}
}
Loading

0 comments on commit d52fcc8

Please sign in to comment.