Jump to content

Geometrically

Forge Modder
  • Posts

    42
  • Joined

  • Last visited

Everything posted by Geometrically

  1. I'm trying to use all of them. The method called prints out messages to the whole world
  2. printMessages(null); } public void printMessages(EntityPlayer player){ That little snippit of code. Look at the first post.
  3. If you can craft it that's fine. That problem may persist of a bug or the item isn't being registered when it was crafted in game.
  4. I want to call a method that has a parameter, EntityPlayer player to a TickEvent. I did this with null, and I get a NullPointerExeption. How do I get the entity player there and put it there? My code is attached. The line is printMessages(null); package com.geometrically.SolarApoc.util; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent; public class WorldTickHandler { public static int ticker; @SubscribeEvent public void onWorldTick(WorldTickEvent handler){ ticker++; //Tick Checkers if (ticker > SAConfiguration.dayoneStart){ SAMethods.beginDayOne(); System.out.println("Day One has started"); } if (ticker > SAConfiguration.daytwoStart){ SAMethods.beginDayTwo(); } if (ticker > SAConfiguration.daythreeStart){ SAMethods.beginDayThree(); } if (ticker > SAConfiguration.dayfourStart){ SAMethods.beginDayFour(); } if (ticker > SAConfiguration.dayfiveStart){ SAMethods.beginDayFive(); } printMessages(null); } public void printMessages(EntityPlayer player){ //Message Printers if (ticker == SAConfiguration.dayoneStart){ SAMethods.beginDayOne(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse has started. Day One will now upbring its wrath.")); System.out.println("!!!!!!!!!!!!!!!!!!!!Day One has started"); } if (ticker == SAConfiguration.daytwoStart){ SAMethods.beginDayTwo(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse's second wave has arrived. Day Two will now upbring its wrath.")); } if (ticker == SAConfiguration.daythreeStart){ SAMethods.beginDayThree(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse's third wave has arrived. Day Three will now upbring its wrath.")); } if (ticker == SAConfiguration.dayfourStart){ SAMethods.beginDayFour(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse's fourth wave has arrived. Day Four will now upbring its wrath.")); } if (ticker == SAConfiguration.dayfiveStart){ SAMethods.beginDayFive(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse's fifth and final wave has arrived. Let's see how long you can survive. ")); player.addChatComponentMessage(new TextComponentString(TextFormatting.GOLD + "Escape if you can.")); } } }
  5. I want to call a method that has a parameter, EntityPlayer player to a TickEvent. I did this with null, and I get a NullPointerExeption. How do I get the entity player there and put it there? My code is attached. package com.geometrically.SolarApoc.util; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent; public class WorldTickHandler { public static int ticker; @SubscribeEvent public void onWorldTick(WorldTickEvent handler){ ticker++; //Tick Checkers if (ticker > SAConfiguration.dayoneStart){ SAMethods.beginDayOne(); System.out.println("Day One has started"); } if (ticker > SAConfiguration.daytwoStart){ SAMethods.beginDayTwo(); } if (ticker > SAConfiguration.daythreeStart){ SAMethods.beginDayThree(); } if (ticker > SAConfiguration.dayfourStart){ SAMethods.beginDayFour(); } if (ticker > SAConfiguration.dayfiveStart){ SAMethods.beginDayFive(); } printMessages(null); } public void printMessages(EntityPlayer player){ //Message Printers if (ticker == SAConfiguration.dayoneStart){ SAMethods.beginDayOne(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse has started. Day One will now upbring its wrath.")); System.out.println("!!!!!!!!!!!!!!!!!!!!Day One has started"); } if (ticker == SAConfiguration.daytwoStart){ SAMethods.beginDayTwo(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse's second wave has arrived. Day Two will now upbring its wrath.")); } if (ticker == SAConfiguration.daythreeStart){ SAMethods.beginDayThree(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse's third wave has arrived. Day Three will now upbring its wrath.")); } if (ticker == SAConfiguration.dayfourStart){ SAMethods.beginDayFour(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse's fourth wave has arrived. Day Four will now upbring its wrath.")); } if (ticker == SAConfiguration.dayfiveStart){ SAMethods.beginDayFive(); player.addChatComponentMessage(new TextComponentString(TextFormatting.RED + "The Solar Apocalypse's fifth and final wave has arrived. Let's see how long you can survive. ")); player.addChatComponentMessage(new TextComponentString(TextFormatting.GOLD + "Escape if you can.")); } } }
  6. You have never defined the character X, if you want to not make it an item you would do this: GameRegistry.addShapedRecipe(new ItemStack(modItems.itemStaff), " R ", " S ", " S ", 'R'.asInstanceOf[Character], Items.REDSTONE, 'S'.asInstanceOf[Character], Items.STICK)
  7. I did that and it doesn't print out anything. Here is my code: @SubscribeEvent public void onWorldTick(WorldTickEvent handler){ if (this.ticker < 100){ ticker++; System.out.println("Ticks executed:" + ticker); } else { //do the method System.out.println("Executed and Done!"); } }
  8. Hello Everyone. i want to create a timer/tick clock that will countdown, until it ends. When it ends, a planned event will happen (I have the code for this). the problem is I don'tknow how to do this.Can anyone help me?
  9. I mean like the function minecraft uses when a new world is created to generate the terrain. What I want to do is override the function when a world is being generated and make the world a skyblock world. Sort of like SkyFactory
  10. I am creating a mod someone, for a lets play series, and they want something like skyfactory. I want to create a default world that when an SP or a MP world is created, it will just override the world gen functions and replace it with this world. I have been searching for a couple hours now through MC's source code and haven't found a thing. Can anyone help me?
  11. I honestly think it's worth it. Although, I have seen with several poplular mods is that people want to play with all thier favorite mods together. A lot of popular mods are not to 1.9, and most are still on 1.7.10-1.8. It's honestly up to you. Although, it may take some time to sort out the .json files.
  12. It still won't work. It doesn't seem to find my mcmod.info file.
  13. Okay. In eclipse, I put my mcmod.info file in the resources folder. Is that the wrong place? The text in my mcmod.info file is this.
  14. My main mod class's code is this:
  15. I used gradlew build to get my mod's jar file which I used to put in the mods folder.
  16. I have coded my mod in eclipse and when I run it it is perfectly fine. When I put it into the mods folder and run Minecraft Forge, it comes up with this:
×
×
  • Create New...

Important Information

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