Skip to content

Commit

Permalink
Re-Enabled Dev Items
Browse files Browse the repository at this point in the history
  • Loading branch information
frankbauer committed Aug 3, 2024
1 parent 8036071 commit edf7184
Showing 1 changed file with 105 additions and 93 deletions.
198 changes: 105 additions & 93 deletions src/main/java/org/betterx/betterend/util/DebugHelpers.java
Original file line number Diff line number Diff line change
@@ -1,104 +1,116 @@
package org.betterx.betterend.util;

import org.betterx.bclib.items.DebugDataItem;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.registry.EndItems;
import org.betterx.betterend.world.structures.village.VillagePools;

import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Blocks;

public class DebugHelpers {
private static boolean didCreateDebugItems = false;

public static void generateDebugItems() {
if (didCreateDebugItems) return;
didCreateDebugItems = true;
BetterEnd.LOGGER.warn("Generating Debug Helpers");

// EndItems.registerEndItem(
// "debug/village_loot",
// DebugDataItem.forLootTable(LootTableUtil.VILLAGE_LOOT, Items.IRON_INGOT)
// );
//
// EndItems.registerEndItem(
// "debug/village_bonus",
// DebugDataItem.forLootTable(LootTableUtil.VILLAGE_BONUS_LOOT, Items.DIAMOND)
// );
//
// EndItems.registerEndItem(
// "debug/village_template",
// DebugDataItem.forLootTable(LootTableUtil.VILLAGE_TEMPLATE_LOOT, Items.GOLD_INGOT)
// );
//
// EndItems.registerEndItem(
// "debug/biome_loot",
// DebugDataItem.forLootTable(LootTableUtil.BIOME_CHEST, Items.OAK_LEAVES)
// );
//
// EndItems.registerEndItem(
// "debug/jigsaw_entrance",
// DebugDataItem.forHouseEntranceJigSaw(BetterEnd.MOD_ID, null, Items.OAK_DOOR)
// );
//
// EndItems.registerEndItem(
// "debug/jigsaw_street_entrance",
// DebugDataItem.forHouseEntranceJigSaw(BetterEnd.MOD_ID, VillagePools.HOUSES_KEY.key, Items.IRON_DOOR)
// );
//
// EndItems.registerEndItem(
// "debug/jigsaw_street",
// DebugDataItem.forSteetJigSaw(
// BetterEnd.MOD_ID,
// VillagePools.STREET_KEY.key,
// Items.ENDER_PEARL
// )
// );
//
// EndItems.registerEndItem(
// "debug/jigsaw_street_deco",
// DebugDataItem.forStreetDecorationJigSaw(
// BetterEnd.MOD_ID,
// VillagePools.STREET_DECO_KEY.key,
// Items.ENDER_EYE
// )
// );
// EndItems.registerEndItem(
// "debug/jigsaw_street_big_deco",
// DebugDataItem.forDecorationJigSaw(
// BetterEnd.MOD_ID,
// VillagePools.DECORATIONS_KEY.key,
// Items.SLIME_BALL
// )
// );
//
// EndItems.registerEndItem(
// "debug/jigsaw_big_deco",
// DebugDataItem.forDecorationJigSaw(
// BetterEnd.MOD_ID,
// null,
// Items.TURTLE_HELMET
// )
// );
//
// EndItems.registerEndItem(
// "debug/jigsaw_deco",
// DebugDataItem.forStreetDecorationJigSaw(
// BetterEnd.MOD_ID,
// null,
// Items.LANTERN
// )
// );
//
// EndItems.registerEndItem(
// "debug/fill_base_void",
// new DebugDataItem((player, entity, useOnContext) -> DebugDataItem.fillStructureEntityBounds(
// useOnContext, entity,
// state -> state.is(Blocks.END_STONE),
// Blocks.STRUCTURE_VOID.defaultBlockState(),
// false
// ), false, BuiltInRegistries.ITEM.getKey(Items.WATER_BUCKET))
// );
//
// Item item = EndItems.registerEndItem(
// "debug/fill_air",
// new DebugDataItem((player, entity, useOnContext) -> DebugDataItem.fillStructureEntityBounds(
// useOnContext, entity,
// state -> state.isAir() || state.is(Blocks.STRUCTURE_VOID),
// Blocks.STRUCTURE_VOID.defaultBlockState(),
// true
// ), false, BuiltInRegistries.ITEM.getKey(Items.BUCKET))
// );
EndItems.registerEndItem(
"debug/village_loot",
DebugDataItem.forLootTable(LootTableUtil.VILLAGE_LOOT, Items.IRON_INGOT)
);

EndItems.registerEndItem(
"debug/village_bonus",
DebugDataItem.forLootTable(LootTableUtil.VILLAGE_BONUS_LOOT, Items.DIAMOND)
);

EndItems.registerEndItem(
"debug/village_template",
DebugDataItem.forLootTable(LootTableUtil.VILLAGE_TEMPLATE_LOOT, Items.GOLD_INGOT)
);

EndItems.registerEndItem(
"debug/biome_loot",
DebugDataItem.forLootTable(LootTableUtil.BIOME_CHEST, Items.OAK_LEAVES)
);

EndItems.registerEndItem(
"debug/jigsaw_entrance",
DebugDataItem.forHouseEntranceJigSaw(BetterEnd.MOD_ID, null, Items.OAK_DOOR)
);

EndItems.registerEndItem(
"debug/jigsaw_street_entrance",
DebugDataItem.forHouseEntranceJigSaw(BetterEnd.MOD_ID, VillagePools.HOUSES_KEY.key, Items.IRON_DOOR)
);

EndItems.registerEndItem(
"debug/jigsaw_street",
DebugDataItem.forSteetJigSaw(
BetterEnd.MOD_ID,
VillagePools.STREET_KEY.key,
Items.ENDER_PEARL
)
);

EndItems.registerEndItem(
"debug/jigsaw_street_deco",
DebugDataItem.forStreetDecorationJigSaw(
BetterEnd.MOD_ID,
VillagePools.STREET_DECO_KEY.key,
Items.ENDER_EYE
)
);
EndItems.registerEndItem(
"debug/jigsaw_street_big_deco",
DebugDataItem.forDecorationJigSaw(
BetterEnd.MOD_ID,
VillagePools.DECORATIONS_KEY.key,
Items.SLIME_BALL
)
);

EndItems.registerEndItem(
"debug/jigsaw_big_deco",
DebugDataItem.forDecorationJigSaw(
BetterEnd.MOD_ID,
null,
Items.TURTLE_HELMET
)
);

EndItems.registerEndItem(
"debug/jigsaw_deco",
DebugDataItem.forStreetDecorationJigSaw(
BetterEnd.MOD_ID,
null,
Items.LANTERN
)
);

EndItems.registerEndItem(
"debug/fill_base_void",
new DebugDataItem((player, entity, useOnContext) -> DebugDataItem.fillStructureEntityBounds(
useOnContext, entity,
state -> state.is(Blocks.END_STONE),
Blocks.STRUCTURE_VOID.defaultBlockState(),
false
), false, BuiltInRegistries.ITEM.getKey(Items.WATER_BUCKET))
);

Item item = EndItems.registerEndItem(
"debug/fill_air",
new DebugDataItem((player, entity, useOnContext) -> DebugDataItem.fillStructureEntityBounds(
useOnContext, entity,
state -> state.isAir() || state.is(Blocks.STRUCTURE_VOID),
Blocks.STRUCTURE_VOID.defaultBlockState(),
true
), false, BuiltInRegistries.ITEM.getKey(Items.BUCKET))
);
}

}

0 comments on commit edf7184

Please sign in to comment.