-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
179 additions
and
38 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/client/java/com/nuclearcrackhead/serverboss/SVBCRClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.nuclearcrackhead.serverboss; | ||
|
||
import com.nuclearcrackhead.serverboss.registry.ModItemGroups; | ||
import net.fabricmc.api.ClientModInitializer; | ||
|
||
public class SVBCRClient implements ClientModInitializer { | ||
|
||
@Override | ||
public void onInitializeClient() { | ||
ModItemGroups.init(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
src/client/java/com/nuclearcrackhead/serverboss/ServerbossCrossReferenceClient.java
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
src/client/java/com/nuclearcrackhead/serverboss/registry/ModItemGroups.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.nuclearcrackhead.serverboss.registry; | ||
|
||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.minecraft.item.ItemGroups; | ||
|
||
public class ModItemGroups { | ||
|
||
public static void init() { | ||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(entries -> { | ||
entries.add(ModBlocks.EXAMPLE_BLOCK); | ||
}); | ||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(entries -> { | ||
entries.add(ModItems.EXAMPLE_ITEM); | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.nuclearcrackhead.serverboss; | ||
|
||
import com.nuclearcrackhead.serverboss.registry.ModBlocks; | ||
import com.nuclearcrackhead.serverboss.registry.ModItems; | ||
import net.fabricmc.api.ModInitializer; | ||
|
||
import net.minecraft.util.Identifier; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class SVBCR implements ModInitializer { | ||
|
||
public static final String MOD_ID = "svbcr"; | ||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); | ||
|
||
public static Identifier of(String path) { | ||
return Identifier.of(MOD_ID, path); | ||
} | ||
|
||
@Override | ||
public void onInitialize() { | ||
ModItems.init(); | ||
ModBlocks.init(); | ||
} | ||
} |
24 changes: 0 additions & 24 deletions
24
src/main/java/com/nuclearcrackhead/serverboss/ServerbossCrossReference.java
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
src/main/java/com/nuclearcrackhead/serverboss/content/block/ExampleBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.nuclearcrackhead.serverboss.content.block; | ||
|
||
import net.minecraft.block.Block; | ||
|
||
public class ExampleBlock extends Block { | ||
|
||
public ExampleBlock(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/nuclearcrackhead/serverboss/content/item/ExampleItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.nuclearcrackhead.serverboss.content.item; | ||
|
||
import net.minecraft.item.Item; | ||
|
||
public class ExampleItem extends Item { | ||
|
||
public ExampleItem(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/com/nuclearcrackhead/serverboss/registry/ModBlocks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.nuclearcrackhead.serverboss.registry; | ||
|
||
import com.nuclearcrackhead.serverboss.SVBCR; | ||
import com.nuclearcrackhead.serverboss.content.block.ExampleBlock; | ||
import net.minecraft.block.AbstractBlock; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.BlockItem; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.registry.RegistryKey; | ||
import net.minecraft.registry.RegistryKeys; | ||
import net.minecraft.util.Identifier; | ||
|
||
import java.util.function.Function; | ||
|
||
public class ModBlocks { | ||
|
||
public static void init() {} | ||
|
||
|
||
public static final Block EXAMPLE_BLOCK = register("example_block", ExampleBlock::new, | ||
AbstractBlock.Settings.create() | ||
); | ||
|
||
|
||
public static Block register(String path, Function<AbstractBlock.Settings, Block> function, AbstractBlock.Settings settings) { | ||
Identifier id = SVBCR.of(path); | ||
RegistryKey<Block> blockKey = RegistryKey.of(RegistryKeys.BLOCK, id); | ||
settings.registryKey(blockKey); | ||
Block block = Registry.register(Registries.BLOCK, blockKey, function.apply(settings)); | ||
|
||
RegistryKey<Item> itemKey = RegistryKey.of(RegistryKeys.ITEM, id); | ||
Item.Settings itemSettings = new Item.Settings() | ||
.useBlockPrefixedTranslationKey() | ||
.registryKey(itemKey); | ||
Registry.register(Registries.ITEM, itemKey, new BlockItem(block, itemSettings)); | ||
return block; | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/nuclearcrackhead/serverboss/registry/ModItems.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.nuclearcrackhead.serverboss.registry; | ||
|
||
import com.nuclearcrackhead.serverboss.SVBCR; | ||
import com.nuclearcrackhead.serverboss.content.item.ExampleItem; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.registry.RegistryKey; | ||
import net.minecraft.registry.RegistryKeys; | ||
import net.minecraft.util.Identifier; | ||
|
||
import java.util.function.Function; | ||
|
||
public class ModItems { | ||
|
||
public static void init() {} | ||
|
||
|
||
public static final Item EXAMPLE_ITEM = register("example_item", ExampleItem::new, | ||
new Item.Settings() | ||
); | ||
|
||
|
||
public static Item register(String path, Function<Item.Settings, Item> function, Item.Settings settings) { | ||
Identifier id = SVBCR.of(path); | ||
RegistryKey<Item> key = RegistryKey.of(RegistryKeys.ITEM, id); | ||
settings = settings.registryKey(key); | ||
return Registry.register(Registries.ITEM, key, function.apply(settings)); | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/svbcr/blockstates/example_block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"variants": { | ||
"": { | ||
"model": "svbcr:block/example_block" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"block.svbcr.example_block": "Example Block", | ||
"item.svbcr.example_item": "Example Item" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/svbcr/models/block/example_block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:block/cube_all", | ||
"textures": { | ||
"all": "svbcr:block/example_block" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/svbcr/models/item/example_block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "svbcr:block/example_block" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/svbcr/models/item/example_item.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "svbcr:item/example_item" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters