Jump to content

yusufgamer

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by yusufgamer

  1. @knoxiwhat was the fix
  2. Getting the item to recognise the texture so a mix of both
  3. I’m struggling to deal with the textureing of shields. I have the current code https://github.com/RealYusufIsmail-Mc-Mods/Armour-and-Tools-Mod/blob/main/src/main/kotlin/io/github/realyusufismail/armourandtoolsmod/core/init/ItemInit.kt#L235 but I don’t get how to make the texturing of the shield work. Like link with it the shield json
  4. I have the current code https://github.com/RealYusufIsmail-Mc-Mods/Armour-and-Tools-Mod/blob/main/src/main/kotlin/io/github/realyusufismail/armourandtoolsmod/core/init/ItemInit.kt#L235 but I don’t get how to make the texturing of the shield work. Like link with it the shield json.
  5. I have the current code when i try to generate it it says Model at :builtin/entity does not exist. How would i get ride of the : private fun shield(block: Block, item: Item) { val name = item.name getBuilder(name) // "builtin/entity" .parent( // need to remove minecraft: somehow ModelFile.ExistingModelFile( ResourceLocation("", "builtin/entity"), existingFileHelper)) .guiLight(BlockModel.GuiLight.FRONT) .texture("particle", "block/${block.bName}") .transforms() .transform(ItemDisplayContext.THIRD_PERSON_RIGHT_HAND) .rotation(0f, 90f, 0f) .translation(10f, 6f, -4f) .scale(1f, 1f, 1f) .end() .transform(ItemDisplayContext.THIRD_PERSON_LEFT_HAND) .rotation(0f, 90f, 0f) .translation(10f, 6f, 12f) .scale(1f, 1f, 1f) .end() .transform(ItemDisplayContext.FIRST_PERSON_RIGHT_HAND) .rotation(0f, 180f, 5f) .translation(-10F, 2F, -10F) .scale(1.25f, 1.25f, 1.25f) .end() .transform(ItemDisplayContext.FIRST_PERSON_LEFT_HAND) .rotation(0f, 180f, 5f) .translation(-10F, 0F, -10F) .scale(1.25f, 1.25f, 1.25f) .end() .transform(ItemDisplayContext.GUI) .rotation(15F, -25F, -5F) .translation(2F, 3F, 0F) .scale(0.65f, 0.65f, 0.65f) .end() .transform(ItemDisplayContext.FIXED) .rotation(0F, 180F, 0F) .translation(-4.5F, 4.5F, -5F) .scale(0.55F, 0.55F, 0.55F) .end() .transform(ItemDisplayContext.GROUND) .rotation(0F, 0F, 0F) .translation(2F, 4F, 2F) .scale(0.25F, 0.25F, 0.25F) .end() .end() .override() .predicate(mcLoc("blocking"), 1f) .model(getExistingFile(mcLoc("item/$name"))) .end() shieldBlock(block, item) } private fun shieldBlock(block: Block, item: Item) { val name = item.name + "_blocking" getBuilder(name) .parent(ModelFile.UncheckedModelFile(ResourceLocation("builtin/entity"))) .guiLight(BlockModel.GuiLight.FRONT) .texture("particle", "block/${block.bName}") .transforms() .transform(ItemDisplayContext.THIRD_PERSON_RIGHT_HAND) .rotation(45F, 135F, 0F) .translation(3.51F, 11F, -2F) .scale(1F, 1F, 1F) .end() .transform(ItemDisplayContext.THIRD_PERSON_LEFT_HAND) .rotation(45F, 135F, 0F) .translation(13.51F, 3F, 5F) .scale(1F, 1F, 1F) .end() .transform(ItemDisplayContext.FIRST_PERSON_RIGHT_HAND) .rotation(0F, 180F, -5F) .translation(-15F, 5F, -11F) .scale(1.25f, 1.25f, 1.25f) .end() .transform(ItemDisplayContext.FIRST_PERSON_LEFT_HAND) .rotation(0F, 180F, -5F) .translation(-15F, 5F, -11F) .scale(1.25f, 1.25f, 1.25f) .end() .transform(ItemDisplayContext.GUI) .rotation(15F, -25F, -5F) .translation(2F, 3F, 0F) .scale(0.65f, 0.65f, 0.65f) .end() .end() }
  6. I am having an issue where when I mine it an ore nothing is dropped and it takes a long time even though it should be mined quickly as it meant to be like a redstone ore. I have the bootable for it and I am using the right tool. My code : https://github.com/RealYusufIsmail-Mc-Mods/Armour-and-Tools-Mod/blob/armour/src/main/kotlin/io/github/realyusufismail/armourandtoolsmod/core/init/BlockInit.kt#L46
  7. Managed to do it.
  8. How would i add the redstone ore effect to any ore. so far I have val RUBY_ORE = registerSmeltAbleBlock( "ruby_ore", ItemInit.RUBY, BlockBehaviour.Properties.copy(Blocks.REDSTONE_ORE) .requiresCorrectToolForDrops() .randomTicks() .lightLevel(litBlockEmission(10))) but I don't get the redstone effect
  9. fixed. Caused by the koltin enum system. I had name for getName instead of oreName which gave you the enum name
  10. at this part ``` String s1 = String.format(java.util.Locale.ROOT, "%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, (usesInnerModel(slot) ? 2 : 1), type == null ? "" : String.format(java.util.Locale.ROOT, "_%s", type)); ``` The name of the armour piece is in caps for some reason
  11. I get this error when i try to put an armour set I created but I don't understand what the error means as the ruby textures are named correctly and doubled checked this. https://github.com/RealYusufIsmail-Mc-Mods/Armour-and-Tools-Mod/tree/armour/src/main/resources/assets/minecraft/textures/models/armor
  12. I keep getting this error and have no idea how to fix it. I have tired for about one day but managed to fix another issue which coincided with this one but no luck here. My error log : https://gist.github.com/RealYusufIsmail/b2278cdad3b09e74df638482cfe8ea05 My code : https://github.com/RealYusufIsmail-Mc-Mods/Armour-and-Tools-Mod/blob/recipe/src/main/kotlin/io/github/realyusufismail/armourandtoolsmod/core/blocks/armour/CustomArmourCraftingTableScreen.kt
  13. Thank you. Will see if i can do this.
  14. I tried creating my own RecipeBookType enum class RecipeBookTypeInit { ARMOUR_CRAFTING; /** Returns the recipe book type for this container. */ fun get(): RecipeBookType { return RecipeBookType.create(name.lowercase().replace("_", "")) } } But when i run the game click on my custom crafting table gui it crashes and i get an out of bond exception java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4 at java.util.EnumMap.get(EnumMap.java:244) ~[?:?] {} at net.minecraft.stats.RecipeBookSettings.isOpen(RecipeBookSettings.java:30) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading} at net.minecraft.stats.RecipeBook.isOpen(RecipeBook.java:69) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading} at net.minecraft.client.gui.screens.recipebook.RecipeBookComponent.isVisibleAccordingToBookData(RecipeBookComponent.java:162) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screens.recipebook.RecipeBookComponent.tick(RecipeBookComponent.java:240) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at io.github.realyusufismail.armourandtoolsmod.core.blocks.armour.CustomArmourCraftingTableScreen.containerTick(CustomArmourCraftingTableScreen.kt:79) ~[main/:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screens.inventory.AbstractContainerScreen.tick(AbstractContainerScreen.java:631) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.lambda$tick$39(Minecraft.java:1830) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screens.Screen.wrapScreenError(Screen.java:530) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.tick(Minecraft.java:1829) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runTick(Minecraft.java:1123) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:718) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.run(Main.java:212) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:51) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {} at net.minecraftforge.fml.loading.targets.ForgeClientUserdevLaunchHandler.lambda$launchService$0(ForgeClientUserdevLaunchHandler.java:25) ~[fmlloader-1.19.3-44.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] {} In there error it refers to CustomArmourCraftingTableScreen recipeBookComponent. Do i need to create my own? CustomArmourCraftingTableScreen full code : https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/blob/1.19.3-1.0.0.alpha.5/src/main/kotlin/io/github/realyusufismail/armourandtoolsmod/core/blocks/armour/CustomArmourCraftingTableScreen.kt
  15. When i looked at RecipeBookType public static RecipeBookType create(String name) { throw new IllegalStateException("Enum not extended!"); } It says it can not be extended.
  16. I am making a custom crafting table and saw that the method use was deprecated what should i use instead.
  17. I tried adding the varient but still get the same error My gh repo url : https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/tree/changed_to_java/src/main/java/io/github/realyusufismail/armourandtoolsmod public class ModBlockStateProvider extends BlockStateProvider { public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) { super(output, MOD_ID, exFileHelper); } @Override public @NotNull String getName() { return "Armour and Tools Mod Blockstates"; } @Override protected void registerStatesAndModels() { normalBlock(BlockInit.RUBY_ORE.get()); normalBlock(BlockInit.RAINBOW_ORE.get()); normalBlock(BlockInit.SAPPHIRE_ORE.get()); normalBlock(BlockInit.GRAPHITE_ORE.get()); normalBlock(BlockInit.AQUMARINE_ORE.get()); normalBlock(BlockInit.DEEPSLATE_RUBY_ORE.get()); normalBlock(BlockInit.DEEPSLATE_RAINBOW_ORE.get()); normalBlock(BlockInit.DEEPSLATE_SAPPHIRE_ORE.get()); normalBlock(BlockInit.DEEPSLATE_GRAPHITE_ORE.get()); normalBlock(BlockInit.DEEPSLATE_AQUMARINE_ORE.get()); normalBlock(BlockInit.RUBY_BLOCK.get()); normalBlock(BlockInit.RAINBOW_BLOCK.get()); normalBlock(BlockInit.SAPPHIRE_BLOCK.get()); normalBlock(BlockInit.GRAPHITE_BLOCK.get()); normalBlock(BlockInit.AQUMARINE_BLOCK.get()); } public void normalBlock(Block block) { ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block); if (name == null) { ArmourAndToolsMod.logger.error("Could not find block key for " + block.getName()); return; } String path = name.getPath(); BlockModelBuilder builder = models().cubeAll(path, modLoc("block/" + path)); getVariantBuilder(block) .forAllStates(state -> ConfiguredModel.builder().modelFile(builder).build()); } }
  18. I also get this issue where it says Missing metadata in pack mod:armourandtoolsmod But i have a mods.toml file : https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/tree/changed_to_java/src/main/resources/META-INF
  19. None of generated resource's work My main class @Mod(MOD_ID) public class ArmourAndToolsMod { public static final Logger logger = LoggerFactory.getLogger(ArmourAndToolsMod.class); public static final String MOD_ID = "armourandtoolsmod"; public ArmourAndToolsMod() { var bus = FMLJavaModLoadingContext.get().getModEventBus(); ItemInit.ITEMS.register(bus); BlockInit.BLOCKS.register(bus); // Register the item to a creative tab bus.addListener(ArmourAndToolsGroup::registerCreativeTab); // Register the data generators bus.addListener(DataGenerators::gatherData); // Register the mod to the event bus MinecraftForge.EVENT_BUS.register(this); logger.info("Hello from RealYusufismail's Armour and Tools Mod!"); } }
  20. I keep erros like this Exception loading blockstate definition: 'armourandtoolsmod:blockstates/ruby_ore.json' missing model for variant: 'armourandtoolsmod:ruby_ore#facing=north' I dont know the cause. Here is my block state data gen code public class ModBlockStateProvider extends BlockStateProvider { public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) { super(output, MOD_ID, exFileHelper); } @Override public @NotNull String getName() { return "Armour and Tools Mod Blockstates"; } @Override protected void registerStatesAndModels() { normalBlock(BlockInit.RUBY_ORE.get()); normalBlock(BlockInit.RAINBOW_ORE.get()); normalBlock(BlockInit.SAPPHIRE_ORE.get()); normalBlock(BlockInit.GRAPHITE_ORE.get()); normalBlock(BlockInit.AQUMARINE_ORE.get()); normalBlock(BlockInit.DEEPSLATE_RUBY_ORE.get()); normalBlock(BlockInit.DEEPSLATE_RAINBOW_ORE.get()); normalBlock(BlockInit.DEEPSLATE_SAPPHIRE_ORE.get()); normalBlock(BlockInit.DEEPSLATE_GRAPHITE_ORE.get()); normalBlock(BlockInit.DEEPSLATE_AQUMARINE_ORE.get()); normalBlock(BlockInit.RUBY_BLOCK.get()); normalBlock(BlockInit.RAINBOW_BLOCK.get()); normalBlock(BlockInit.SAPPHIRE_BLOCK.get()); normalBlock(BlockInit.GRAPHITE_BLOCK.get()); normalBlock(BlockInit.AQUMARINE_BLOCK.get()); } public void normalBlock(Block block) { ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block); if (name == null) { ArmourAndToolsMod.logger.error("Could not find block key for " + block.getName()); return; } BlockModelBuilder builder = this.models().withExistingParent(name.getPath(), "block/cube_all"); builder.texture("all", modLoc("block/" + name.getPath())); this.simpleBlockItem(block, builder); this.simpleBlock(block, builder); } }
  21. I have tried everything but cant seem to see the problem. My main class: https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/blob/main/src/main/java/io/github/realyusufismail/armourandtoolsmod/ArmourAndToolsMod.java My build.gradle: https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/blob/main/build.gradle#L18 My Main Data gen class: https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/blob/main/src/main/java/io/github/realyusufismail/armourandtoolsmod/datagen/DataGenerators.java
  22. I am trying to figure out hot to register my ore gen this is my code public class OreFeaturesInit { public static final ResourceKey<ConfiguredFeature<?, ?>> LEGENDARY_ORE = FeatureUtils.createKey("legendary_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> RUBY_ORE = FeatureUtils.createKey("ruby_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> BLACK_DIAMOND_ORE = FeatureUtils.createKey("black_diamond_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> IMPERIUM_ORE = FeatureUtils.createKey("imperium_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> SPEED_ORE = FeatureUtils.createKey("speed_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> OMNITRIX_ORE = FeatureUtils.createKey("omnitrix_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> FIRE_ORE = FeatureUtils.createKey("fire_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> INFINITUM_ORE = FeatureUtils.createKey("infinitum_ore"); public static void bootstrap(BootstapContext<ConfiguredFeature<?, ?>> context) { RuleTest ruleTest1 = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES); RuleTest ruleTest2 = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); RuleTest ruleTest3 = new BlockMatchTest(Blocks.NETHERRACK); RuleTest ruleTest4 = new TagMatchTest(BlockTags.BASE_STONE_NETHER); List<OreConfiguration.TargetBlockState> legendary = List.of( OreConfiguration.target(ruleTest1, BlockInit.LEGENDARY_ORE.get().defaultBlockState()), OreConfiguration.target(ruleTest2, BlockInit.LEGENDARY_ORE.get().defaultBlockState())); List<OreConfiguration.TargetBlockState> ruby = List.of( OreConfiguration.target(ruleTest1, BlockInit.RUBY_ORE.get().defaultBlockState()), OreConfiguration.target(ruleTest2, BlockInit.RUBY_ORE.get().defaultBlockState())); List<OreConfiguration.TargetBlockState> black_diamond = List.of( OreConfiguration.target(ruleTest1, BlockInit.BLACK_DIAMOND_ORE.get().defaultBlockState()), OreConfiguration.target(ruleTest2, BlockInit.BLACK_DIAMOND_ORE.get().defaultBlockState())); List<OreConfiguration.TargetBlockState> imperium = List.of( OreConfiguration.target(ruleTest1, BlockInit.IMPERIUM_ORE.get().defaultBlockState()), OreConfiguration.target(ruleTest2, BlockInit.IMPERIUM_ORE.get().defaultBlockState())); List<OreConfiguration.TargetBlockState> speed = List.of( OreConfiguration.target(ruleTest1, BlockInit.SPEED_ORE.get().defaultBlockState()), OreConfiguration.target(ruleTest2, BlockInit.SPEED_ORE.get().defaultBlockState())); List<OreConfiguration.TargetBlockState> omnitrix = List.of( OreConfiguration.target(ruleTest1, BlockInit.OMNITRIX_ORE.get().defaultBlockState()), OreConfiguration.target(ruleTest2, BlockInit.OMNITRIX_ORE.get().defaultBlockState())); registerOre(context, LEGENDARY_ORE, legendary, 7); registerOre(context, RUBY_ORE, ruby, 7); registerOre(context, BLACK_DIAMOND_ORE, black_diamond, 5); registerOre(context, IMPERIUM_ORE, imperium, 5); registerOre(context, SPEED_ORE, speed, 5); registerOre(context, OMNITRIX_ORE, omnitrix, 5); registerOre(context, FIRE_ORE, ruleTest3, BlockInit.FIRE_ORE.get().defaultBlockState(), 6); registerOre(context, INFINITUM_ORE, ruleTest4, BlockInit.INFINITUM_ORE.get().defaultBlockState(), 4); } private static void registerOre(BootstapContext<ConfiguredFeature<?, ?>> context, ResourceKey<ConfiguredFeature<?, ?>> ore, List<OreConfiguration.TargetBlockState> targetBlockStates, int size) { FeatureUtils.register(context, ore, Feature.ORE, new OreConfiguration(targetBlockStates, size)); } private static void registerOre(BootstapContext<ConfiguredFeature<?, ?>> context, ResourceKey<ConfiguredFeature<?, ?>> ore, RuleTest ruleTest, BlockState blockState, int size) { FeatureUtils.register(context, ore, Feature.ORE, new OreConfiguration(ruleTest, blockState, size)); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.