added powders
This commit is contained in:
		| @@ -10,5 +10,6 @@ import net.minecraft.util.Identifier; | ||||
|  */ | ||||
| public class ModIdentifiers { | ||||
| 	public static final Identifier ITEM_STUB = Identifier.of(Quickiemod.MOD_ID, "stub"); | ||||
|  | ||||
| 	public static final Identifier ITEM_SPEEDPOWDER = Identifier.of(Quickiemod.MOD_ID, "speedpowder"); | ||||
| 	public static final Identifier ITEM_QUICKIEPOWDER = Identifier.of(Quickiemod.MOD_ID, "quickiepowder"); | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,20 @@ | ||||
| package de.jottyfan.quickiemod.item; | ||||
|  | ||||
| import net.minecraft.item.Item; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.util.Identifier; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * @author jotty | ||||
|  * | ||||
|  */ | ||||
| public abstract class AbstractIdentifiedItem extends Item { | ||||
|  | ||||
| 	public AbstractIdentifiedItem(Identifier identifier, Integer maxCount) { | ||||
| 		super(new Item.Settings().maxCount(maxCount).useItemPrefixedTranslationKey() | ||||
| 				.registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier))); | ||||
| 	} | ||||
|  | ||||
| } | ||||
							
								
								
									
										16
									
								
								src/main/java/de/jottyfan/quickiemod/item/Item64Stack.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/main/java/de/jottyfan/quickiemod/item/Item64Stack.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| package de.jottyfan.quickiemod.item; | ||||
|  | ||||
| import net.minecraft.util.Identifier; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * @author jotty | ||||
|  * | ||||
|  */ | ||||
| public class Item64Stack extends AbstractIdentifiedItem { | ||||
|  | ||||
| 	public Item64Stack(Identifier identifier) { | ||||
| 		super(identifier, 64); | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -2,13 +2,14 @@ package de.jottyfan.quickiemod.item; | ||||
|  | ||||
| import de.jottyfan.quickiemod.Quickiemod; | ||||
| import de.jottyfan.quickiemod.identifier.ModIdentifiers; | ||||
| import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||||
| import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; | ||||
| import net.minecraft.item.Item; | ||||
| import net.minecraft.item.ItemGroups; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.registry.Registries; | ||||
| import net.minecraft.registry.Registry; | ||||
| import net.minecraft.registry.RegistryKey; | ||||
| import net.minecraft.registry.RegistryKeys; | ||||
| import net.minecraft.text.Text; | ||||
| import net.minecraft.util.Identifier; | ||||
|  | ||||
| /** | ||||
| @@ -17,9 +18,9 @@ import net.minecraft.util.Identifier; | ||||
|  * | ||||
|  */ | ||||
| public class ModItems { | ||||
| 	public static final Item ITEM_STUB = registerItem(ModIdentifiers.ITEM_STUB, | ||||
| 			new Item(new Item.Settings().maxCount(64).useItemPrefixedTranslationKey() | ||||
| 					.registryKey(RegistryKey.of(RegistryKeys.ITEM, ModIdentifiers.ITEM_STUB)))); | ||||
| 	public static final Item ITEM_STUB = registerItem(ModIdentifiers.ITEM_STUB, new Item64Stack(ModIdentifiers.ITEM_STUB)); | ||||
| 	public static final Item ITEM_SPEEDPOWDER = registerItem(ModIdentifiers.ITEM_SPEEDPOWDER, new Item64Stack(ModIdentifiers.ITEM_SPEEDPOWDER)); | ||||
| 	public static final Item ITEM_QUICKIEPOWDER = registerItem(ModIdentifiers.ITEM_QUICKIEPOWDER, new Item64Stack(ModIdentifiers.ITEM_QUICKIEPOWDER)); | ||||
|  | ||||
| 	private static final Item registerItem(Identifier identifier, Item item) { | ||||
| 		return Registry.register(Registries.ITEM, identifier, item); | ||||
| @@ -28,8 +29,13 @@ public class ModItems { | ||||
| 	public static final void registerModItems() { | ||||
| 		Quickiemod.LOGGER.info(String.format("registering items for %s", Quickiemod.MOD_ID)); | ||||
|  | ||||
| 		ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(entries -> { | ||||
| 			entries.add(ITEM_STUB); | ||||
| 		}); | ||||
| 		Registry.register(Registries.ITEM_GROUP, | ||||
| 				RegistryKey.of(RegistryKeys.ITEM_GROUP, Identifier.of(Quickiemod.MOD_ID, "itemgroup")), | ||||
| 				FabricItemGroup.builder().icon(() -> new ItemStack(ITEM_SPEEDPOWDER)) | ||||
| 						.displayName(Text.literal(Quickiemod.MOD_ID)).entries((enabledFeatures, stacks) -> { | ||||
| 							stacks.add(new ItemStack(ITEM_STUB)); | ||||
| 							stacks.add(new ItemStack(ITEM_SPEEDPOWDER)); | ||||
| 							stacks.add(new ItemStack(ITEM_QUICKIEPOWDER)); | ||||
| 						}).build()); | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,7 @@ | ||||
| { | ||||
| 	"variants": { | ||||
| 		"": { | ||||
| 			"model": "quickiemod:block/blockquickiepowder" | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,7 @@ | ||||
| { | ||||
| 	"variants": { | ||||
| 		"": { | ||||
| 			"model": "quickiemod:block/blockspeedpowder" | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,6 @@ | ||||
| { | ||||
| 		"parent": "block/cube_all", | ||||
| 		"textures": { | ||||
| 				"all": "quickiemod:block/blockquickiepowder" | ||||
| 		} | ||||
| } | ||||
| @@ -0,0 +1,6 @@ | ||||
| { | ||||
| 		"parent": "block/cube_all", | ||||
| 		"textures": { | ||||
| 				"all": "quickiemod:block/blockspeedpowder" | ||||
| 		} | ||||
| } | ||||
| @@ -0,0 +1,10 @@ | ||||
| { | ||||
| 		"parent": "quickiemod:block/blockquickiepowder", | ||||
| 		"display": { | ||||
| 				"thirdperson": { | ||||
| 						"rotation": [ 10, -45, 170 ], | ||||
| 						"translation": [ 0, 1.5, -2.75 ], | ||||
| 						"scale": [ 0.375, 0.375, 0.375 ] | ||||
| 				} | ||||
| 		} | ||||
| } | ||||
| @@ -0,0 +1,10 @@ | ||||
| { | ||||
| 		"parent": "quickiemod:block/blockspeedpowder", | ||||
| 		"display": { | ||||
| 				"thirdperson": { | ||||
| 						"rotation": [ 10, -45, 170 ], | ||||
| 						"translation": [ 0, 1.5, -2.75 ], | ||||
| 						"scale": [ 0.375, 0.375, 0.375 ] | ||||
| 				} | ||||
| 		} | ||||
| } | ||||
| @@ -0,0 +1,6 @@ | ||||
| { | ||||
|     "parent": "item/coal", | ||||
|     "textures": { | ||||
|         "layer0": "quickiemod:item/quickiepowder" | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,6 @@ | ||||
| { | ||||
|     "parent": "item/coal", | ||||
|     "textures": { | ||||
|         "layer0": "quickiemod:item/speedpowder" | ||||
|     } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 4.9 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 4.8 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 4.5 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 439 B | 
| @@ -0,0 +1,11 @@ | ||||
| { | ||||
| 	"type": "minecraft:crafting_shapeless", | ||||
| 	"ingredients": [ | ||||
| 		"minecraft:slime_block", | ||||
| 		"quickiemod:blockspeedpowder" | ||||
| 	], | ||||
| 	"result": { | ||||
| 		"id": "quickiemod:blockquickiepowder", | ||||
| 		"count": 2 | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,12 @@ | ||||
| { | ||||
|   "type": "minecraft:crafting_shapeless", | ||||
|   "ingredients": [ | ||||
|     "quickiemod:blocksalpeter", | ||||
|     "quickiemod:blocksulphor", | ||||
|     "minecraft:coal_block" | ||||
|   ], | ||||
| 	"result": { | ||||
| 		"id": "quickiemod:blockspeedpowder", | ||||
| 		"count": 1 | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,10 @@ | ||||
| { | ||||
| 	"type": "minecraft:crafting_shapeless", | ||||
| 	"ingredients": [ | ||||
| 		"quickiemod:blockquickiepowder" | ||||
| 	], | ||||
| 	"result": { | ||||
| 		"id": "quickiemod:quickiepowder", | ||||
| 		"count": 9 | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,11 @@ | ||||
| { | ||||
| 	"type": "minecraft:crafting_shapeless", | ||||
| 	"ingredients": [ | ||||
| 		"quickiemod:speedpowder", | ||||
| 		"quickiemod:oxidizedcopperpowder" | ||||
| 	], | ||||
| 	"result": { | ||||
| 		"id": "quickiemod:quickiepowder", | ||||
| 		"count": 1 | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,11 @@ | ||||
| { | ||||
| 	"type": "minecraft:crafting_shapeless", | ||||
| 	"ingredients": [ | ||||
| 		"quickiemod:speedpowder", | ||||
| 		"minecraft:slime_ball" | ||||
| 	], | ||||
| 	"result": { | ||||
| 		"id": "quickiemod:quickiepowder", | ||||
| 		"count": 1 | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,11 @@ | ||||
| { | ||||
| 	"type": "minecraft:crafting_shapeless", | ||||
| 	"ingredients": [ | ||||
| 		"minecraft:gunpowder", | ||||
| 		"minecraft:redstone" | ||||
| 	], | ||||
| 	"result": { | ||||
| 		"id": "quickiemod:speedpowder", | ||||
| 		"count": 1 | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,10 @@ | ||||
| { | ||||
| 	"type": "minecraft:crafting_shapeless", | ||||
| 	"ingredients": [ | ||||
| 		"quickiemod:blockspeedpowder" | ||||
| 	], | ||||
| 	"result": { | ||||
| 		"id": "quickiemod:speedpowder", | ||||
| 		"count": 9 | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user