Jump to content

hoodwink_dude

Members
  • Posts

    95
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by hoodwink_dude

  1. 8 minutes ago, diesieben07 said:

    This. However, you need to be careful, since even though Block#setUnlocalizedName and Item#setUnlocalizedName have the same signature at dev time, they will have separate SRG names in the actual game, so you will not be able to have them implement a common interface. You'll need to write your own methods, still.

    This is what I was afraid of.

     

    12 minutes ago, V0idWa1k3r said:

    Let me stop you right there. Don't create BasicX. There is already a BasicX, it's called X.(BasicBlock -> Block, etc.) This is an antipattern and should be avoided.

    I guess I got too stuck into this 1.12.2 tutorial series that I didn't stop to think if it was really needed. It's a good thing this has been caught relatively early. Thanks

  2. On 11/21/2018 at 5:19 AM, V0idWa1k3r said:

    Not necessairly, programming is not all about learning, it's also about inventing - taking the puzzle pieces that you have(aka your existing code knowledge) and putting them together to make something new. 

    1

    As someone who has been in a Programming Apprenticeship for nearly a year now, I agree with this statement but it is missing one important piece of information: clear aspirations, concrete goals and knowing what you need to learn (understanding of the domain you are about to dabble in).

     

    There have been many instances where I have tried to learn something on my own but I have not had a solid goal in mind. However, in this entire (nearly) year, I have learned 200% the amount of stuff I learned in the ~3 years prior. And no, that isn't entirely an exaggeration. I am just as shocked as you all will be at the sheer volume of stuff I have learned. But that is the effect that having concrete goals and sources of Domain Knowledge can (and will) have on your learning. Clear Aspirations just help you along in order to keep focused rather than fall into a Rabbit Hole (genuine technical term) and not make much progress.

     

    In terms of resources, you have these forums (for Domain Knowledge regarding Minecraft Forge), r/learnjava (for Domain Knowledge regarding Java) and you have so many sources of goals. Go ahead and try re-creating existing mods. If you spend an entire day struggling to figure out how to implement a specific piece of functionality for a mod, that's an indicator that you should leave it until you have more experience.

     

    All in all, if you have the determination to learn, there are plenty of resources out there on the internet. You only need to fire up Google and search for those resources.

    • Like 3
  3. When creating 'BasicItem', 'BasicBlock', 'Basic[ToolName]' etc Classes, I have found that they all have some identical constructor sections. I have created a generic util method but I feel absolutely filthy for doing it this sloppy way. However, Generics don't allow you to call methods on the 'actual' type because that would break encapsulation. That was the only other way I saw this working. Is there anything I'm forgetting or missing out on? I just really feel like a heathen for doing it this way

    public static <T extends IForgeRegistryEntry.Impl<T>> void initItem(T item, String unlocalisedName, String registryName) {
        if (item instanceof Block) {
            ((Block) item).setUnlocalizedName(NameUtils.formatUnlocalisedName(unlocalisedName));
            ((Block) item).setRegistryName(registryName);
            ((Block) item).setCreativeTab(ExampleMod.EXAMPLE_TAB);
        } else {
            ((Item) item).setUnlocalizedName(NameUtils.formatUnlocalisedName(unlocalisedName));
            ((Item) item).setRegistryName(registryName);
            ((Item) item).setCreativeTab(ExampleMod.EXAMPLE_TAB);
        }
    }

     

  4. I am trying to make 'Healing Swords' but the method that I thought would work (taking a negative number from the HP would be the same as adding it to the HP) doesn't seem to work. In fact, negative damage doesn't even do anything which leads me to believe that there is some sort of validation on the attack damage handlers. Any idea what could be the cause of this? And also, is there a way around this or is there a different route I could take?

  5. On 8/5/2018 at 10:02 PM, Draco18s said:

    Are you modding for 1.13 with Forge?

    Yes?

    Where'd you get it?

    forge.png

    I never said that I was modding with 1.13. I simply said that I got confused for a second by diesieben mentioning about unification

  6. Both the Mod annotation and the mcmod.info file hold a lot of the same data.

     

    What is the point of the redundancy? Especially seeing as though it would be fairly easy to forget to update the info in one after doing it for the other (when there are multiple values being updated). I want to avoid this situation as much as possible (DRY programming practice) so I kinda want to figure out a way to use the buildfile to inject values into both the java and mcmod.info so that I can centralise the changes.

     

    However, that isn't the point of this post.

     

    The point of this post is to rage at the authors of MC Forge for this blasphemy just a way for me to vent my frustration because I am sure there is a reason behind this design. I also want to get some sort of confirmation that there is a reason behind it just to ease my mind a bit too.

  7. 1 minute ago, diesieben07 said:

    No! Do not do this! This breaks shit.

    Registry entries must be created during the proper events (or at least preInit). Not "at some random point when my class gets loaded".

    So it's gonna be a bunch of string literals then. Unless I do some form of Dependency Injection (or would that break shit too? If I call the method for loading it all in the preinit then I shouldn't run into issues?)

  8. 2 minutes ago, Cadiboo said:

    Personally, I think the first way is great because it allows you to instantiate the same class multiple times with different names. Isn't this the ultimate reduction of code?

     

    for example over half my items are instantiated in this way
    public static final ItemBase TITANIUM_NUGGET = new ItemBase("titanium_nugget").setNugget().setBeaconPayment();

    Or even this way

    public static final ItemTool COPPER_SHOVEL = new ItemTool("copper_shovel", ItemTool.COPPER, ItemTool.SPADE_EFFECTIVE_ON, ToolTypes.SHOVEL);

    Good point. Thanks dude :)

  9. 4 minutes ago, Cadiboo said:

    yeah it is an odd way to do it, but it places all your registration logic in one file.

     

    Whats wrong with putting

    
    public Blah() {
    	super();
    	this.setRegistryName(new ResourceLocation(Reference.ID, "blah"));
    	this.setUnlocalizedName("blah");
    }

    in every class?

    I guess it's just a case of me going a bit overboard with the whole "reduce code duplication" idea...

  10. 3 minutes ago, Cadiboo said:

    I don't know if this is what you were looking for but this is how I instantiate my items

    
    public class ModItems {
    	
    	public static final ItemFlamethrower			FLAMETHROWER			= new ItemFlamethrower("flamethrower");
    	public static final ItemHammer					HAMMER					= new ItemHammer("hammer");
    	public static final ItemRailgun					RAILGUN					= new ItemRailgun("railgun");
    	public static final ItemCoilgun					COILGUN					= new ItemCoilgun("coilgun");
    	public static final ItemPlasmagun				PLASMA_GUN				= new ItemPlasmagun("plasmagun");
    	
    	public static final Item[] ITEMS = {
    
    		FLAMETHROWER,
    		HAMMER,
    		RAILGUN,
    		COILGUN,
    		PLASMA_GUN
    
    	};
    	
    }

     

    That approach is what I have seen multiple times online. However, I personally think that the logical place to define the names of items is within the respective item classes. I guess that is just a result of me working in Industry for the past 3 months as a Software Engineer Apprentice...

  11. On 28/04/2018 at 9:02 PM, Bendythe1nkdemon said:

    MC version is 1.12.2 forge version is 14.23.3.2655-mdk

    What is the folder contents of Gemology? It could be that you're missing the 'gradle' folder

  12. I want to reduce literals usage so that I have the flexibility to change the registry name in the future but I also don't want to create global constants. Considering the fact that getRegistryName is marked with the Final access modifier, the result should be constant for each class.

    5ae57d1443bd9_Screenshot(254).png.03a2ac3450f293b440ce7c4c2d6ba5d9.png

    Am I just being stupid or is there any way for me to achieve this without a Constants class?

  13. Forge Fernflower Repo

     

    Console log pastebin

     

    Alternatively, spoiler containing the console log here:

     

     

    C:\Users\james_000\Downloads\FernFlower-master>gradlew build

    :compileJava

    warning: [options] bootstrap class path not set in conjunction with -source 1.6

    Note: C:\Users\james_000\Downloads\FernFlower-master\src\org\jetbrains\java\deco

    mpiler\modules\decompiler\LabelHelper.java uses unchecked or unsafe operations.

    Note: Recompile with -Xlint:unchecked for details.

    1 warning

    :processResources UP-TO-DATE

    :classes

    :jar

    :assemble

    :compileTestJava

    warning: [options] bootstrap class path not set in conjunction with -source 1.6

    1 warning

    :processTestResources UP-TO-DATE

    :testClasses

    :test

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\junit\junit\4.12\2973d150c0dc1fefe998f834810d68f2

    78ea58ec\junit-4.12.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.hamcrest\hamcrest-core\1.3\42a25dc3219429f0e5

    d060061f71acb49bf010a0\hamcrest-core-1.3.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.hamcrest\hamcrest-library\1.3\4785a3c21320980

    282f9f33d0d1264a69040538f\hamcrest-library-1.3.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\oshi-project\oshi-core\1.1\9ddf7b048a8d701be231c0

    f4f95fd986198fd2d8\oshi-core-1.1.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\net.java.dev.jna\jna\3.4.0\803ff252fedbd395baffd4

    3b37341dc4a150a554\jna-3.4.0.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\net.java.dev.jna\platform\3.4.0\e3f70017be8100d3d

    6923f50b3d2ee17714e9c13\platform-3.4.0.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.ibm.icu\icu4j-core-mojang\51.2\63d216a9311cca

    6be337c1e458e587f99d382b84\icu4j-core-mojang-51.2.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\net.sf.jopt-simple\jopt-simple\4.6\306816fb57cf94

    f108a43c95731b08934dcae15c\jopt-simple-4.6.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.paulscode\codecjorbis\20101023\c73b5636faf089

    d9f00e8732a829577de25237ee\codecjorbis-20101023.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.paulscode\codecwav\20101023\12f031cfe88fef5c1

    dd36c563c0a3a69bd7261da\codecwav-20101023.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.paulscode\libraryjavasound\20101123\5c5e30436

    6f75f9eaa2e8cca546a1fb6109348b3\libraryjavasound-20101123.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.paulscode\librarylwjglopenal\20100824\73e80d0

    794c39665aec3f62eee88ca91676674ef\librarylwjglopenal-20100824.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.paulscode\soundsystem\20120107\419c05fe9be71f

    792b2d76cfc9b67f1ed0fec7f6\soundsystem-20120107.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\io.netty\netty-all\4.0.23.Final\294104aaf1781d6a5

    6a07d561e792c5d0c95f45\netty-all-4.0.23.Final.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.google.guava\guava\17.0\9c6ef172e8de35fd8d4d8

    783e4821e57cdef7445\guava-17.0.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.3.2\90a3822c38

    ec8c996e84c16a3477ef632cbc87a3\commons-lang3-3.3.2.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\commons-io\commons-io\2.4\b1b6ea3b7e4aa4f492509a4

    952029cd8e48019ad\commons-io-2.4.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\commons-codec\commons-codec\1.9\9ce04e34240f674bc

    72680f8b843b1457383161a\commons-codec-1.9.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\net.java.jinput\jinput\2.0.5\39c7796b469a600f7238

    0316f6b1f11db6c2c7c4\jinput-2.0.5.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\net.java.jutils\jutils\1.0.0\e12fe1fda814bd348c15

    79329c86943d2cd3c6a6\jutils-1.0.0.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.google.code.gson\gson\2.2.4\a60a5e993c98c8640

    10053cb901b7eab25306568\gson-2.2.4.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.mojang\authlib\1.5.21\aefba0d5b53fbcb70860bc8

    046ab95d5854c07a5\authlib-1.5.21.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.mojang\realms\1.7.39\c282954ce2a3bc62812e0d41

    c05f179b3b5839d7\realms-1.7.39.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.apache.commons\commons-compress\1.8.1\a698750

    c16740fd5b3871425f4cb3bbaa87f529d\commons-compress-1.8.1.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpclient\4.3.3\18f424

    7ff4572a074444572cee34647c43e7c9c7\httpclient-4.3.3.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\commons-logging\commons-logging\1.1.3\f6f66e966c7

    0a83ffbdb6f17a0919eaf7c8aca7f\commons-logging-1.1.3.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore\4.3.2\31fbbff1

    ddbf98f3aa7377c94d33b0447c646b6e\httpcore-4.3.2.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.0-beta9\1dd6

    6e68cccd907880229f9e2de1314bd13ff785\log4j-api-2.0-beta9.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-core\2.0-beta9\678

    861ba1b2e1fccb594bb0ca03114bb05da9695\log4j-core-2.0-beta9.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.lwjgl.lwjgl\lwjgl\2.9.4-nightly-20150209\6975

    17568c68e78ae0b4544145af031c81082dfe\lwjgl-2.9.4-nightly-20150209.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.lwjgl.lwjgl\lwjgl_util\2.9.4-nightly-20150209

    \d51a7c040a721d13efdfbd34f8b257b2df882ad0\lwjgl_util-2.9.4-nightly-20150209.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\tv.twitch\twitch\6.5\320a2dfd18513a5f41b4e75729df

    684488cbd925\twitch-6.5.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\net.java.jinput\jinput-platform\2.0.5\7ff832a6eb9

    ab6a767f1ade2b548092d0fa64795\jinput-platform-2.0.5-natives-linux.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\net.java.jinput\jinput-platform\2.0.5\385ee093e01

    f587f30ee1c8a2ee7d408fd732e16\jinput-platform-2.0.5-natives-windows.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\net.java.jinput\jinput-platform\2.0.5\53f9c919f34

    d2ca9de8c51fc4e1e8282029a9232\jinput-platform-2.0.5-natives-osx.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\com.google.code.findbugs\jsr305\2.0.1\516c03b21d5

    0a644d538de0f0369c620989cd8f0\jsr305-2.0.1.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\tv.twitch\twitch-platform\6.5\206c4ccaecdbcfd2a16

    31150c69a97bbc9c20c11\twitch-platform-6.5-natives-windows-32.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\tv.twitch\twitch-platform\6.5\9fdd0fd5aed0817063d

    cf95b69349a171f447ebd\twitch-platform-6.5-natives-windows-64.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\tv.twitch\twitch-platform\6.5\5f9d1ee26257b3a33f0

    ca06fed335ef462af659f\twitch-platform-6.5-natives-osx.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\tv.twitch\twitch-external-platform\4.5\18215140f0

    10c05b9f86ef6f0f8871954d2ccebf\twitch-external-platform-4.5-natives-windows-32.j

    ar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\tv.twitch\twitch-external-platform\4.5\c3cde57891

    b935d41b6680a9c5e1502eeab76d86\twitch-external-platform-4.5-natives-windows-64.j

    ar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.lwjgl.lwjgl\lwjgl-platform\2.9.4-nightly-2015

    0209\b84d5102b9dbfabfeb5e43c7e2828d98a7fc80e0\lwjgl-platform-2.9.4-nightly-20150

    209-natives-windows.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.lwjgl.lwjgl\lwjgl-platform\2.9.4-nightly-2015

    0209\931074f46c795d2f7b30ed6395df5715cfd7675b\lwjgl-platform-2.9.4-nightly-20150

    209-natives-linux.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Users\james_000\.gra

    dle\caches\modules-2\files-2.1\org.lwjgl.lwjgl\lwjgl-platform\2.9.4-nightly-2015

    0209\bcab850f8f487c3f4c4dbabde778bb82bd1a40ed\lwjgl-platform-2.9.4-nightly-20150

    209-natives-osx.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Program Files\Java\j

    dk1.8.0_91\jre\lib\resources.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Program Files\Java\j

    dk1.8.0_91\jre\lib\rt.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Program Files\Java\j

    dk1.8.0_91\jre\lib\jsse.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Program Files\Java\j

    dk1.8.0_91\jre\lib\jce.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Program Files\Java\j

    dk1.8.0_91\jre\lib\charsets.jar

     

    TESTOUTPUT:INFO:  Adding File to context from classpath: C:\Program Files\Java\j

    dk1.8.0_91\jre\lib\jfr.jar

     

     

    org.jetbrains.java.decompiler.LVTTest > testMCContainerPlayer FAILED

        java.lang.AssertionError at LVTTest.java:62

     

    org.jetbrains.java.decompiler.MinecraftDecompilationTest > testJar FAILED

        java.lang.RuntimeException at MinecraftDecompilationTest.java:52

    TESTOUTPUT:WARN:  Nested class pkg/TestInnerClassConstructor$1 has no constructo

    r!

     

    TESTOUTPUT:WARN:  Unreferenced anonymous class pkg/TestInnerClassConstructor$1!

     

    TESTOUTPUT:WARN:  Invalid signature: SourceFile

     

     

    37 tests completed, 2 failed

    :test FAILED

     

    FAILURE: Build failed with an exception.

     

    * What went wrong:

    Execution failed for task ':test'.

    > There were failing tests. See the report at: file:///C:/Users/james_000/Downlo

    ads/FernFlower-master/build/reports/tests/index.html

     

    * 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: 1 mins 6.068 secs

     

    C:\Users\james_000\Downloads\FernFlower-master>

     

     

    I need FernFlower to decompile (does it deob as well? if not, thats ok, it saves me having to delete the already deobbed jar anyways) a mod that I am going to start making an addon for. Any ideas what's going wrong? I really need to know what is wrong.

  14. You could create a store of the current keybindings when the game starts up and then every 10 frames or so, check to see if the current keybindings are different to when the game started up. If they are, you could do whatever you need to do with that information and then update the store of keybindings so that the check isn't triggered unintentionally.

×
×
  • Create New...

Important Information

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