Skip to content

Commit

Permalink
rewrote JSONs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kandiyaki committed May 3, 2024
1 parent e306077 commit 03c50c1
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import dev.architectury.registry.registries.DeferredRegister;
import dev.architectury.registry.registries.RegistrySupplier;
import net.hex_circles.Hex_circles;
import net.hex_circles.item.ItemChalkStick;
import net.minecraft.item.Item;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.registry.Registry;
Expand All @@ -14,16 +16,21 @@
public class Hex_circlesItemRegistry {
// Register items through this
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(Hex_circles.MOD_ID, Registry.ITEM_KEY);

private static final Item.Settings CHALKCIRCLES_64STACK = new Item.Settings().maxCount(64);
private static final Item.Settings CHALKCIRCLES_16STACK = new Item.Settings().maxCount(16);
private static final Item.Settings CHALKCIRCLES_UNSTACKABLE = new Item.Settings().maxCount(1);

public static void init() {
ITEMS.register();
}

// A new creative tab. Notice how it is one of the few things that are not deferred
public static final ItemGroup DUMMY_GROUP = CreativeTabRegistry.create(id("dummy_group"), () -> new ItemStack(Hex_circlesItemRegistry.DUMMY_ITEM.get()));
public static final ItemGroup CIRCLES_GROUP = CreativeTabRegistry.create(id("circles_group"), () -> new ItemStack(Hex_circlesItemRegistry.DUMMY_ITEM.get()));

// During the loading phase, refrain from accessing suppliers' items (e.g. EXAMPLE_ITEM.get()), they will not be available
public static final RegistrySupplier<Item> DUMMY_ITEM = ITEMS.register("dummy_item", () -> new Item(new Item.Settings().group(DUMMY_GROUP)));
public static final RegistrySupplier<Item> DUMMY_ITEM = ITEMS.register("dummy_item", () -> new Item(new Item.Settings().group(CIRCLES_GROUP)));
public static final RegistrySupplier<Item> CHALKSTICK_ITEM = ITEMS.register("amethyst_chalk", () -> new ItemChalkStick(CHALKCIRCLES_16STACK.group(CIRCLES_GROUP)));
public static final RegistrySupplier<BlockItem> CHALKSQUARE_BLOCK_ITEM = ITEMS.register("chalk_square_block", () -> new BlockItem(Hex_circlesBlockRegistry.CHALK_RUNE.get(), CHALKCIRCLES_64STACK.group(CIRCLES_GROUP)));


}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package net.hex_circles.registry;

import static net.hex_circles.Hex_circles.id;

import java.util.ArrayList;
import java.util.List;

import at.petrak.hexcasting.api.PatternRegistry;
import at.petrak.hexcasting.api.spell.Action;
import at.petrak.hexcasting.api.spell.math.HexDir;
Expand All @@ -9,11 +14,6 @@
import net.hex_circles.casting.patterns.spells.OpCongrats;
import net.minecraft.util.Identifier;

import java.util.ArrayList;
import java.util.List;

import static net.hex_circles.Hex_circles.id;

public class Hex_circlesPatternRegistry {
public static List<Triple<HexPattern, Identifier, Action>> PATTERNS = new ArrayList<>();
public static List<Triple<HexPattern, Identifier, Action>> PER_WORLD_PATTERNS = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"variants": {
"face=ceiling": {
"model": "hex_chalkcircles:block/chalk_square_block",
"model": "hex_circles:block/chalk_square_block",
"uvlock": true,
"x": 180
},
"face=floor": {
"model": "hex_chalkcircles:block/chalk_square_block",
"model": "hex_circles:block/chalk_square_block",
"uvlock": true
},
"face=wall,facing=east": {
"model": "hex_chalkcircles:block/chalk_square_block",
"model": "hex_circles:block/chalk_square_block",
"uvlock": true,
"x": 90,
"y": 90
},
"face=wall,facing=north": {
"model": "hex_chalkcircles:block/chalk_square_block",
"model": "hex_circles:block/chalk_square_block",
"uvlock": true,
"x": 90
},
"face=wall,facing=south": {
"model": "hex_chalkcircles:block/chalk_square_block",
"model": "hex_circles:block/chalk_square_block",
"uvlock": true,
"x": 90,
"y": 180
},
"face=wall,facing=west": {
"model": "hex_chalkcircles:block/chalk_square_block",
"model": "hex_circles:block/chalk_square_block",
"uvlock": true,
"x": 90,
"y": 270
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "hex_chalkcircles:block/chalk_square_block",
"particle": "hex_chalkcircles:block/chalk_square_block"
"0": "hex_circles:block/chalk_square_block",
"particle": "hex_circles:block/chalk_square_block"
},
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "minecraft:item/handheld_rod",
"textures": {
"layer0": "hex_chalkcircles:item/amethyst_chalk"
"layer0": "hex_circles:item/amethyst_chalk"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hex_chalkcircles:item/chalk_square_block"
"layer0": "hex_circles:item/chalk_square_block"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"result": {
"item": "hex_chalkcircles:amethyst_chalk",
"item": "hex_circles:amethyst_chalk",
"count": 16
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values":[
"hex_circles:amethyst_chalk"
]
}

0 comments on commit 03c50c1

Please sign in to comment.