Jump to content

NovaViper

Forge Modder
  • Posts

    1061
  • Joined

  • Last visited

Posts posted by NovaViper

  1. FMLPreInitializationEvent#getModLog

    gives you a logger for your ModID. Or you can use

    LogManger.getLogger

    (from package

    org.apache.logging.log4j

    ) to obtain a logger with any name you like.

     

    Thanks for that tip but what I'm trying to do is have the parent mod call logging information when the child one uses one of the registry methods and print something like this:

    CryogenicLib::Tetracraft

    . Now within TetraCraft, it will use what you said

  2. I got another question.. do you use Github with IntelliJ? I am having some major issues with commiting. Also, I'm trying to make a reference of my log manager and I want to be able to interchange the name of the mod to display where it shows the log for so I don't have to write the name of the mod I want it to display whenever I send a message to the console

     

    So far I did something like this:

    package novaviper.cryolib.common.helper;
    
    import net.minecraftforge.fml.relauncher.FMLRelaunchLog;
    import novaviper.tetracraft.lib.ModReference;
    import org.apache.logging.log4j.*;
    
    /**
    * Created by NovaViper on 5/10/2016.
    * Class Purpose: Helper class for logs
    */
    
    public class LogHelper {
    
    public static FMLRelaunchLog instance = FMLRelaunchLog.log;
    private static String name;
    
    private static void log(String modName, Level level, String format, Object... data) {
    	FMLRelaunchLog.log(modName, level, format, data);
    }
    
    public static void registerName(String modName){name = modName;}
    
    public static void error(String format, Object... data) {
    	log(name, Level.ERROR, format, data);
    }
    
    public static void fatal(String format, Object... data) {
    	log(name, Level.FATAL, format, data);
    }
    
    public static void warn(String format, Object... data) {
    	log(name, Level.WARN, format, data);
    }
    
    public static void info(String format, Object... data) {
    	log(name, Level.INFO, format, data);
    }
    
    public static void debug(String format, Object... data) {
    	log(name, Level.DEBUG, format, data);
    }
    
    public static void trace(String format, Object... data) {
    	log(name, Level.TRACE, format, data);
    }
    
    public static void all(String format, Object... data) {
    	log(name, Level.ALL, format, data);
    }
    }
    

  3. I do plan on making more child mods off of this API in order to make loading in items and blocks (and many other stuff too) easier instead of copying the same methods about 7,000 times and then end up running into a problem where I have to edit everything or completely start over from scratch.

     

    The case goes with my previous mod, Zero Quest; I had created a few classes specifically for using adding registries and texture libraries. Once I given up on the mod (I hadn't worked on it in nearly a year so I decided to start over with a new one), I had to copy over those exact same methods over into the new one (And make changes on it for the different minecraft versions).

     

    I feel like making an API for my registry classes would make things alot easier for me for the mod I'm working on now and the ones I plan on making later over the years.

     

    And I didn't know that many people make APIs, I thought I was the only one who thought about it ._.

  4. Hey, I'm in the middle of making my mod and I finally decided that it was a good idea to make a parent mod over my main ones for listing all of the registries and loading libraries. Is it possible and/or a good idea to create a parent API mod from where I'm now? If so, should I develop that mod WITHIN the same IntelliJ project where I am developing the main mod?

     

     

    The Source for my mod is here

  5. Ok! I finally made some kind of progress on figuring out why the entity isn't jumping, I changed the class that the entity is extending into to

    EntityModTameable

    instead of

    EntityModRideableTameable

    and it begins swimming!! It has to be something inside

    EntityModRideableTameable

    that is messing around with the swimming AI.

  6. I did this

    	@Override
    public boolean handleWaterMovement()
    {
    	if (this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox().expand(0.0D, 0.4D, 0.0D).contract(0.001D), Material.WATER, this)) {
    		if (!this.inWater) {
    			float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F;
    
    			if (f > 1.0F) {
    				f = 1.0F;
    			}
    
    			this.playSound(this.getSplashSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
    			float f1 = (float) MathHelper.floor_double(this.getEntityBoundingBox().minY);
    			int i;
    			float f2;
    			float f3;
    
    			for (i = 0; (float)i < 1.0F + this.width * 20.0F; ++i) {
    				f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
    				f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
    				this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + (double)f2, (double)(f1 + 1.0F), this.posZ + (double)f3, this.motionX, this.motionY - (double)(this.rand.nextFloat() * 0.2F), this.motionZ);
    			}
    
    			for (i = 0; (float)i < 1.0F + this.width * 20.0F; ++i) {
    				f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
    				f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width;
    				this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, this.posX + (double)f2, (double)(f1 + 1.0F), this.posZ + (double)f3, this.motionX, this.motionY, this.motionZ);
    			}
    		}
    
    		this.fallDistance = 0.0F;
    		this.inWater = true;
    		this.extinguish();
    	}
    	else {
    		this.inWater = false;
    	}
    
    	return this.inWater;
    }

     

    But it still doesn't swim

  7. I have something like this:

     

    Loading class

    public class ModCreativeTabs {
    
    public static CreativeTabs tetraTab;
    
    public static void load(){
    
    	tetraTab = new TetraCreativeTab(CreativeTabs.getNextID());
    }
    }

     

    The Class

    public class TetraCreativeTab extends CreativeTabs {
    
    public TetraCreativeTab(int id) {
    	super("tetracraft");
    	//this.setBackgroundImageName("item_search.png");
    }
    
    @Override
    public Item getTabIconItem() {
    	return ModItems.triaxIngot;
    }
    
    /**
     * Determines if the search bar should be shown for this tab.
     *
     * @return True to show the bar
     */
    /*@Override
    public boolean hasSearchBar() {
    	return getTabIndex() == this.getTabIndex();
    }*/
    
    }
    

     

    Main Mod Class

    	@EventHandler
    public void preInit(FMLPreInitializationEvent event){
    	ModCreativeTabs.load();
    .....
    }

  8. Hey I just enabled that GPG signing with Github.. and now I can't commit anything through IntelliJ. I get an error like this

    gpg: cannot open tty `no tty': No such file or directory
    error: gpg failed to sign the data
    fatal: failed to write commit object

     

    I used this tutorial: https://github.com/pstadler/keybase-gpg-github

    Not sure where to contact about this issue also.. Github only responds to people who pays and the response time is really slow. (Is this the wrong place to post this also?)

  9. You need to add the

    srcCompat

    and

    targetCompat

    (not

    sourceCompatibility

    and

    targetCompatibility

    ) properties in the main body of build.gradle, after the

    buildscript

    and

    plugins

    blocks.

     

    You can see an example of this here.

     

    Thanks Choonster! The compiled mod is the file that doesn't say source right?

  10. Where do I put this line that? I placed in at the top of the file and I get this error from Gradle:

     

    07:32:44 PM: Executing external task 'build'...
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file 'C:\Users\NovaPC\Dropbox\MinecraftMods\TetraCraft\1.9\build.gradle' line: 1
    
    * What went wrong:
    A problem occurred evaluating root project '1.9'.
    > No such property: sourceCompatibility for class: org.gradle.api.internal.project.DefaultProject_Decorated
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 14.72 secs
    No such property: sourceCompatibility for class: org.gradle.api.internal.project.DefaultProject_Decorated
    07:33:00 PM: External task execution finished 'build'.
    

  11. Also I tried running

    build

    again and I get this now:

     

    03:50:56 PM: Executing external task 'build'...
    :deobfCompileDummyTask
    :deobfProvidedDummyTask
    :sourceApiJava UP-TO-DATE
    :compileApiJava UP-TO-DATE
    :processApiResources UP-TO-DATE
    :apiClasses UP-TO-DATE
    :sourceMainJava
    warning: [options] bootstrap class path not set in conjunction with -source 1.6
    C:\Users\NovaPC\Dropbox\MinecraftMods\TetraCraft\1.9\build\sources\main\java\novaviper\tetracraft\common\command\CommandTetraCraft.java:113: error: diamond operator is not supported in -source 1.6
    	private final Map<String, ICommand> orderedCommandMap = new LinkedHashMap<>();
    	                                                                          ^
      (use -source 7 or higher to enable diamond operator)
    C:\Users\NovaPC\Dropbox\MinecraftMods\TetraCraft\1.9\build\sources\main\java\novaviper\tetracraft\common\item\ItemModBow.java:122: error: method references are not supported in -source 1.6
    	boolean hasAmmo = findAmmoSlot(shooter, this::isArrow) != null;
    	                                              ^
      (use -source 8 or higher to enable method references)
    C:\Users\NovaPC\Dropbox\MinecraftMods\TetraCraft\1.9\build\sources\main\java\novaviper\tetracraft\common\item\ItemModBow.java:128: error: diamond operator is not supported in -source 1.6
    		return new ActionResult<>(EnumActionResult.FAIL, bow);
    		                        ^
      (use -source 7 or higher to enable diamond operator)
    C:\Users\NovaPC\Dropbox\MinecraftMods\TetraCraft\1.9\build\sources\main\java\novaviper\tetracraft\lib\Registers.java:55: error: diamond operator is not supported in -source 1.6
    public static final Set<Item> items = new HashSet<>();
                                                      ^
      (use -source 7 or higher to enable diamond operator)
    C:\Users\NovaPC\Dropbox\MinecraftMods\TetraCraft\1.9\build\sources\main\java\novaviper\tetracraft\lib\Registers.java:111: error: method references are not supported in -source 1.6
    	return addBlock(block, ItemBlock::new);
    	                                  ^
      (use -source 8 or higher to enable method references)
    5 errors
    1 warning
    :compileJava FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':compileJava'.
    > Compilation failed; see the compiler error output for details.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 17.85 secs
    Compilation failed; see the compiler error output for details.
    03:51:14 PM: External task execution finished 'build'.
    

     

    I already switched the source to 1.8 but it looks like its not saving. I'm using the latest version of IntelliJ

  12. It looks like the Gradle daemon is having problems, try running

    gradlew build

    with the daemon disabled, as described here.

     

    I tried running

    gradlew build

    and tried

    build --no-daemon

    but Gradle says that it that gradlew does not exist and that it does not know --no-daemon

×
×
  • Create New...

Important Information

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