Jump to content

sorazodia

Members
  • Posts

    9
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed

sorazodia's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Could you show us the code of your Biome and Main class? It's hard troubleshooting your problem if we can't see what you are doing.
  2. I knew that PlayerEvents was not the best choice, at that time I didn't find/know of any better event so I went on to use it... PlayerTickEvent works, thanks
  3. I've been trying to write a event where the player will get potion effects after he/she reaches a certain level. At first it worked, I was granted the water breathing effect after reaching level 10 but when I attempt to re-log into the test world I get this crash log. ---- Minecraft Crash Report ---- // You should try our sister game, Minceraft! Time: 7/26/14 6:45 PM Description: Ticking memory connection java.lang.NullPointerException: Ticking memory connection at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:101) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:212) at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:165) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:659) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:547) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:111) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:101) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:212) -- Ticking connection -- Details: Connection: net.minecraft.network.NetworkManager@59d3789f Stacktrace: at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:165) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:659) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:547) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:111) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.7.0_60, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 723101208 bytes (689 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95 FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.18.1180} [Forge Mod Loader] (forgeBin-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.0.1180} [Minecraft Forge] (forgeBin-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available RPG Intergation{1.0} [RPG Intergation] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 0 / 8; [] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' I suspect that I had missed a step when using the addPotionEffect() method as I rechecked my code and found that the world won't crash if I remove the addPotionEffect() before launching Minecraft in debug mode and add it back in after the world loads, the event would fire smoothly with no crashes. Was there anything I missed when using addPotionEffect()? Main Class: public class RPG { public static final String MODID = "RPG Intergation"; public static final String VERSION = "1.0"; @EventHandler //I had tried FMLInitialization and FMLPostInitialization but to no luck, the world would still crash public void Preinit(FMLPreInitializationEvent forge) { FMLLog.info("[RPG] Loading Events"); MinecraftForge.EVENT_BUS.register(new PlayerEvents()); FMLLog.info("[RPG] Events Loaded"); } Event Class: public class PlayerEvents { int tierI = 10; int tierII = 30; int tierIII = 50; int tierIV = 100; @SubscribeEvent public void xpBonus(PlayerEvent event){ int playerXP = event.entityPlayer.experienceLevel; if(playerXP >= tierI){ event.entityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 10, 0)); } } }
  4. You posed in the wrong section and possibly the wrong forum (Try minecraftforum.net)... But anyways Unless the game's auto-save is disabled, which it should not have been, you don't need to run the /save-all commend. As for the spawn biome not being found... I'm not too sure what may have caused that to happen, you may have gotten unlucky and your world got corrupted, make a new world and check if the same problem reoccurs.
  5. I been trying to figure out how to change the default item swing of Minecraft (Where you just hack and slash) to where the item will follow the path of the mouse cursor (similar to how the Wii Sport's sword worked). Right now I've been trying to find the related class(s) to see how the vanilla animation works. So far, it seems that the EntityOtherPlayerMP and WorldClient class might be it. Am I looking in the wrong classes, and any advice on how I could create the new animation?
  6. I been having trouble getting the items not to duplicate. In my mod there's a liquid block (Hot Water) that has the property of cooking food when the food thrown into it. The cooking works but the liquid also creates extra unpickupable item that would disappear after a relog. Here's the code of my main class and the hot water block class. BlockHotWater Class public class BlockHotWater extends BlockFluidClassic{ protected IIcon stillWater; protected IIcon flowingWater; protected World world; protected Entity entity; FoodList list = new FoodList(); public BlockHotWater(Fluid fluid, Material material) { super(fluid, material); setCreativeTab(CreativeTabs.tabMisc); } public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { if(!(entity instanceof EntityItem)){ entity.attackEntityFrom(HotWater_Main.Boiled, 2.0F); WaterEffect(world, x, y, z, 1); } if(entity instanceof EntityItem){ CookingEffect(world, x, y , z, entity); } } public void CookingEffect(World world, int x, int y, int z, Entity entity){ if(((EntityItem)entity).getEntityItem().getItem() == Items.chicken) { WaterEffect(world, x, y, z, 2); entity.setDead(); entity.entityDropItem(new ItemStack(Items.cooked_chicken), 0F); } if(((EntityItem)entity).getEntityItem().getItem() == Items.porkchop){ WaterEffect(world, x, y, z, 2); entity.setDead(); entity.entityDropItem(new ItemStack(Items.cooked_porkchop), 0F); } if(((EntityItem)entity).getEntityItem().getItem() == Items.beef){ WaterEffect(world, x, y, z, 2); entity.setDead(); entity.entityDropItem(new ItemStack(Items.cooked_beef), 0F); } if(((EntityItem)entity).getEntityItem().getItem() == Items.potato || ((EntityItem)entity).getEntityItem().getItem() == Items.poisonous_potato){ WaterEffect(world, x, y, z, 2); entity.setDead(); entity.entityDropItem(new ItemStack(Items.baked_potato), 0F); } if(((EntityItem)entity).getEntityItem().getItem() == Items.fish){ if(((EntityItem)entity).getEntityItem().getItemDamage() == 0){ WaterEffect(world, x, y, z, 2); entity.setDead(); entity.entityDropItem(new ItemStack(Items.cooked_fished, 1), 0F); } if(((EntityItem)entity).getEntityItem().getItemDamage() == 1){ WaterEffect(world, x, y, z, 2); entity.setDead(); entity.entityDropItem(new ItemStack(Items.cooked_fished, 1, 1), 0F); } } } protected void WaterEffect(World world, int x, int y, int z, int type) { world.playSoundEffect((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F, "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); for(int l = 0; l < 8; l++) if(type == 1){ world.spawnParticle("largesmoke", (double)x + Math.random(), (double)y + 1.2D, (double)z + Math.random(), 0.0D, 0.0D, 0.0D); } if(type == 2){ world.spawnParticle("cloud", (double)x + Math.random(), (double)y + 1.2D, (double)z + Math.random(), 0.0D, 0.0D, 0.0D); } } @Override public IIcon getIcon (int side, int meta){ return (IIcon) ((side == 0 || side == 1) ? stillWater : flowingWater); } @Override public void registerBlockIcons(IIconRegister register) { stillWater = register.registerIcon("hot_water:hot_water_still"); flowingWater = register.registerIcon("hot_water:hot_water_flow"); } } Main Class @Mod(name = "Hot Water Mod", modid = HotWater_Main.MODID, version = HotWater_Main.VERSION) public class HotWater_Main { public static final String MODID = "hot_water"; public static final String VERSION = "1.0"; private static final String Water_Name = "hot_water"; private static final String SuperLava_Name = "super_lava"; private static final String SpringWater_Name = "hot_spring_water"; public Fluid hotWater = new Fluid(Water_Name).setDensity(999).setTemperature(373).setViscosity(682); public static Block BlockHotWater; public static Block BlockSpringWater; public static Item hot_water_bucket; public static DamageSource Boiled = new DamageSource("hot_water.boiled"); public Fluid superlava = new Fluid(SuperLava_Name).setDensity(999).setTemperature(6150).setViscosity(682); public static Block BlockSuperLava; public static Item superlava_bucket; public static DamageSource Melted = new DamageSource("hot_water.Melted").setFireDamage(); public static final Material Superlava = new MaterialLiquid(MapColor.tntColor); public static Fluid springWater = new Fluid(SpringWater_Name).setDensity(999).setTemperature(373).setViscosity(682); public static Item spring_water_bucket; public static BiomeGenBase BiomeHotSpring; @EventHandler public void PreInit(FMLPreInitializationEvent event){ Configuration config = new Configuration(event.getSuggestedConfigurationFile()); int BiomeID = config.get(Configuration.CATEGORY_GENERAL, "BiomeID", 35).getInt(); FMLLog.info("[Hot Water] Registering the Hot Water, Spring Water and Super Lava Fluid"); FluidRegistry.registerFluid(hotWater); FluidRegistry.registerFluid(superlava); FluidRegistry.registerFluid(springWater); FMLLog.info("[Hot Water] Hot Water, Spring Water and Super Lava fluid Registered"); BlockSpringWater = new BlockSpringWater(springWater, Material.water).setBlockName(SpringWater_Name).setHardness(100F); FMLLog.info("[Hot Water] Registering the Hot Water, Spring Water and Super Lava Block"); BlockHotWater = new BlockHotWater(hotWater, Material.water).setBlockName(Water_Name).setHardness(100F); BlockSuperLava = new BlockSuperLava(superlava, Material.lava).setBlockName(SuperLava_Name).setHardness(100F).setLightLevel(10.0F); GameRegistry.registerBlock(BlockSuperLava, SuperLava_Name); GameRegistry.registerBlock(BlockHotWater, Water_Name); GameRegistry.registerBlock(BlockSpringWater, SpringWater_Name); FMLLog.info("[Hot Water] Hot Water, Spring Water and Super Lava Block Registered"); FMLLog.info("[Hot Water] Registering Hot Water, Spring Water and Super Lava Bucket"); hot_water_bucket = new ItemBucket(BlockHotWater).setTextureName("hot_water:bucket_hot_water").setUnlocalizedName("bucket_hot_water"); GameRegistry.registerItem(hot_water_bucket, "bucket_hot_water", MODID); FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack(Water_Name, FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(hot_water_bucket), new ItemStack(Items.bucket)); superlava_bucket = new ItemBucket(BlockSuperLava).setTextureName("bucket_lava").setUnlocalizedName("bucket_superlava"); GameRegistry.registerItem(superlava_bucket, "bucket_superlava", MODID); FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack(SuperLava_Name, FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(superlava_bucket), new ItemStack(Items.bucket)); spring_water_bucket = new ItemBucket(BlockSpringWater).setTextureName("hot_water:bucket_hot_spring_water").setUnlocalizedName("bucket_spring_water"); GameRegistry.registerItem(spring_water_bucket, "bucket_spring_water", MODID); FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack(SpringWater_Name, FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(spring_water_bucket), new ItemStack(Items.bucket)); FMLLog.info("[Hot Water] Hot Water Bucket, Spring Water and Super Lava Registered"); FMLLog.info("[Hot Water] Registering Buildcraft's BucketFill Event"); BucketHandler.INSTANCE.buckets.put(BlockHotWater, hot_water_bucket); BucketHandler.INSTANCE.buckets.put(BlockSuperLava, superlava_bucket); BucketHandler.INSTANCE.buckets.put(BlockSpringWater, spring_water_bucket); MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); FMLLog.info("[Hot Water] Buildcraft's BucketFill Event Registered"); config.load(); FMLLog.info("[Hot Water] Adding new Spring Biome (BECUASE WORLDGEN IS HARD D:)"); BiomeHotSpring = new BiomeHotSpring(BiomeID).setEnableSnow().setBiomeName("Hot Springs").setHeight(new Height(0F, 0F)); BiomeDictionary.registerBiomeType(BiomeHotSpring, Type.FROZEN); FMLLog.info("[Hot Water] Spring Biome Added"); config.save(); FMLLog.info("[Hot Water] Registering Cooking Recipes and Fuel"); GameRegistry.addSmelting(Items.water_bucket, new ItemStack(hot_water_bucket), 0.3F); GameRegistry.addSmelting(Items.lava_bucket, new ItemStack(superlava_bucket), 0.5F); GameRegistry.registerFuelHandler(new FuelHandler()); FMLLog.info("[Hot Water] Cooking Recipes and Fuel Registered"); } } A video of it to help you see the problem [embed=425,349] [/embed]
  7. Try moving your register() method into your preInit().
  8. Didn't noticed that(learn something new everyday )...Here's my item code public class SheepFood extends ItemFood{ private String unlocalizedName; public SheepFood(int par1, int par2, boolean par3) { super(par1, par2, par3); } public SheepFood setUnlocalizedName(String par1Str) { this.unlocalizedName = par1Str; return this; } @Override public void func_94581_a(IconRegister par1IconRegister) { this.iconIndex = par1IconRegister.func_94245_a("Lampchop:"+unlocalizedName); } }
  9. I'm having trouble naming my two lampchop items as "Raw Lampchop" and "Cooked Lampchop", Forge seems to only be loading one name for them which is either having both of them named "Raw Lampchop" or both of them named "Cooked Lampchop". Here's the main source code body of my mod: https://sphotos-a.xx.fbcdn.net/hphotos-ash4/230029_507309085992456_2036892946_n.jpg[/img]https://sphotos-b.xx.fbcdn.net/hphotos-ash4/484331_507309095992455_1976291158_n.jpg[/img] Any advice of what I may be doing wrong?
×
×
  • Create New...

Important Information

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