Jump to content

CrashCZ

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by CrashCZ

  1. Hello. I'v been curious what is the new ModLauncher thing. I see it everywhere but I can't find what it is. Examples:
  2. Hello. I have created a custom fluid that flow like water (7 blocks from source) but I need it to flow like lava (3 blocks from source). Is there any method to achieve this ? Because I wasn't able to find anything
  3. You mean this ? @Override public boolean shouldRefresh((World world, BlockPos pos, IBlockState oldState, IBlockState newSate) { if(oldState == newState) return true; else return false; }
  4. So what should I put in that method ?
  5. No it doesn't work until I restart the game
  6. Hello. I created a cutom furnace but there is a problem that when I pull items from output slot it stops smelting forever. Here is link to project on GitHub: https://github.com/nickname-crash/minerals I figured out that the method which get the output item after taking it out of the furnace starts to return air. This doesn't make any sense to me because it gets output items from final Table which is part of static final instance and there is no method that clears that Table. I would appriciate any help. There are also some other errors in the code but I will fix them later.
  7. When I place items and fuel in it, it takes them, changes the flame texture in gui but that's all. When I do it again it works how it should but only once and no more.
  8. OK I chnged it and now it does some weired stuff...
  9. Hello my custom furnace with two inputs does not smelt Here is link to GitHub: https://github.com/nickname-crash/minerals Please Help
  10. Yes, now it's working Thanks for help package com.crashcz.minerals.world; import java.util.Random; import com.crashcz.minerals.init.ModBlocks; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.IChunkGenerator; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class ModWorldGen implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { if(world.provider.getDimension() == 0) { generateOverworld(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); } } private void generateOverworld(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { generateOre(ModBlocks.RUBY_ORE.getDefaultState(), world, random, chunkX * 16, chunkZ *16, 5, 12, random.nextInt(6) + 1, 4); generateOre(Blocks.IRON_ORE.getDefaultState(), world, random, chunkX * 16, chunkZ * 16, 5, 12, random.nextInt(6) + 1, 4); } private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) { int deltaY = maxY - minY; for(int i = 0; i < chances; i++) { BlockPos pos = new BlockPos(x + random.nextInt(16), minY + random.nextInt(deltaY), z + random.nextInt(16)); WorldGenMinable generator = new WorldGenMinable(ore, size); generator.generate(world, random, pos); } } } package com.crashcz.minerals.util.handlers; import com.crashcz.minerals.init.ModBlocks; import com.crashcz.minerals.init.ModItems; import com.crashcz.minerals.util.IHasModel; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.eventhandler.Event.Result; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @EventBusSubscriber public class RegistryHandler { @SubscribeEvent public static void onItemRegister(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0])); } @SubscribeEvent public static void onBlockRegister(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(ModBlocks.BLOCKS.toArray(new Block[0])); } @SubscribeEvent public static void onModelRegister(ModelRegistryEvent event) { for(Item item : ModItems.ITEMS) { if(item instanceof IHasModel) { ((IHasModel)item).registerModels(); } } for(Block block : ModBlocks.BLOCKS) { if(block instanceof IHasModel) { ((IHasModel)block).registerModels(); } } } @SubscribeEvent public static void GenerateMinable(OreGenEvent event) { event.setResult(Result.DENY); } } @EventHandler public static void Init(FMLInitializationEvent event) { ModRecipes.init(); Blocks.IRON_ORE.setHarvestLevel("pickaxe", 3); MinecraftForge.ORE_GEN_BUS.register(RegistryHandler.class); GameRegistry.registerWorldGenerator(new ModWorldGen(), 3); }
  11. So like this ? @EventHandler public static void Init(FMLInitializationEvent event) { MinecraftForge.ORE_GEN_BUS.register(new RegistryHandler()); }
  12. ok so id idid this: @SubscribeEvent public static void GenerateMinable(OreGenEvent event) { event.setResult(Result.DENY); } and package com.crashcz.minerals.world; import java.util.Random; import com.crashcz.minerals.init.ModBlocks; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.IChunkGenerator; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class ModWorldGen implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { if(world.provider.getDimension() == 0) { generateOverworld(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); } } private void generateOverworld(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { generateOre(Blocks.IRON_ORE.getDefaultState(), world, random, chunkX * 16, chunkZ * 16, 5, 12, random.nextInt(6) + 1, 4); } private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) { int deltaY = maxY - minY; for(int i = 0; i < chances; i++) { BlockPos pos = new BlockPos(x + random.nextInt(16), minY + random.nextInt(deltaY), z + random.nextInt(16)); WorldGenMinable generator = new WorldGenMinable(ore, size); generator.generate(world, random, pos); } } } and @EventHandler public static void PreInit(FMLPreInitializationEvent event) { GameRegistry.registerWorldGenerator(new ModWorldGen(), 3); } but nothing changed, did I do something wrong ?
  13. Hello. I need to make some vanilla ores to spawn less in overworld. Any ideas how to do it ?
  14. Cuberia is something between classic survival minecraft and Roleplay game. You start as a porr miner in a small village. By mining, completing quests, fighting dungeons... you can get to a higher a level. How high? You can become a leader of a huge Empire. But that's not all. Cuberia offers few different worlds where you can fight bloodthirsty monsters and find rare treassures. But if you are not person who likes adventures you can get rich by creating your own shops and make money by selling items. We are currently recruiting some staff so if you are interested write a request to: [email protected] or visit our web: http://cuberia.4fan.cz/ for more information To join Cuberia use this IP: 94.130.65.83:27332 Everything else you need to know about Cuberia, you can find on: http://cuberia.4fan.cz
  15. I solved it. I had to put the register method into a ModArmor class and call it in Main Class.
  16. 1.12.2 I also tried the json way with same result
  17. Hello I am trying to make a crafting recipe for my armor but it simplay doesn't work in game. I use this method to register the recipes: public static void registerArmor() { GameRegistry.addShapedRecipe(new ResourceLocation("dimensions:ruby_helmet"), new ResourceLocation("ModArmor"), new ItemStack(ModArmor.ruby_helmet), new Object[] {"RRR", "R R", " ", 'R', ModItems.ruby}); GameRegistry.addShapedRecipe(new ResourceLocation("dimensions:ruby_helmet"), new ResourceLocation("ModArmor"), new ItemStack(ModArmor.ruby_helmet), new Object[] {" ", "RRR", "R R", 'R', ModItems.ruby}); GameRegistry.addShapedRecipe(new ResourceLocation("dimensions:ruby_chestplate"), new ResourceLocation("ModArmor"), new ItemStack(ModArmor.ruby_chestplate), new Object[] {"R R", "RRR", "RRR", 'R', ModItems.ruby}); GameRegistry.addShapedRecipe(new ResourceLocation("dimensions:ruby_leggings"), new ResourceLocation("ModArmor"), new ItemStack(ModArmor.ruby_leggings), new Object[] {"RRR", "R R", "R R", 'R', ModItems.ruby}); GameRegistry.addShapedRecipe(new ResourceLocation("dimensions:ruby_boots"), new ResourceLocation("ModArmor"), new ItemStack(ModArmor.ruby_boots), new Object[] {" RR", "R R", " ", 'R', ModItems.ruby}); GameRegistry.addShapedRecipe(new ResourceLocation("dimensions:ruby_boots"), new ResourceLocation("ModArmor"), new ItemStack(ModArmor.ruby_boots), new Object[] {" ", "R R", "R R", 'R', ModItems.ruby}); } And call this method in my MainClass: ModCrafting.registerArmor(); Same thing i do with other recipes and they work so i don't know where is the problem. Theese are my other recipes: public static void register() { GameRegistry.addShapedRecipe(new ResourceLocation("dimensions:rubyblock"), new ResourceLocation("ModBlocks"), new ItemStack(ModBlocks.rubyblock), new Object[] {"RRR", "RRR", "RRR", 'R', ModItems.ruby}); GameRegistry.addShapelessRecipe(new ResourceLocation("dimensions:ruby"), new ResourceLocation("ModItems"), new ItemStack(ModItems.ruby, 9), new Ingredient[] {Ingredient.fromItem(Item.getItemFromBlock(ModBlocks.rubyore))}); GameRegistry.addSmelting(new ItemStack(ModBlocks.rubyblock), new ItemStack(ModItems.ruby), 0.5F); } And I also register them in Main Class: ModCrafting.register(); I also tried to put all recipes into one method but no result. Please help.
×
×
  • Create New...

Important Information

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