Everything posted by shadowfacts
-
[1.7.10]RF Production
Oh lord, /me facedesks so hard @Override public boolean canConnectEnergy(ForgeDirection from) { if(from == ForgeDirection.DOWN){ return true; }if(from == ForgeDirection.EAST){ return true; }if(from == ForgeDirection.NORTH){ return true; }if(from == ForgeDirection.SOUTH){ return true; }if(from == ForgeDirection.UP){ return false; }if(from == ForgeDirection.WEST){ return true; } else{ return true; } } This mess can be simplified to one line: return from != ForgeDirection.UP; Also in your updateEntity method, you should call this.storage.receiveEnergy(2, false); instead of this.storage.setEnergyStored(2); . The former adds 2 RF to the storage whereas the latter sets the storage to contain 2 RF.
-
It renders my item in a block format
In your model file, set the parent to item/generated for 1.9.
-
[1.9] Mod compile error (switch string)
You need to compile for Java 7 or higher. Add this to your build.gradle (tells Gradle to compile for Java 7): sourceCompatibility = 1.7 targetCompatibility = 1.7
-
Using Apache Commons Math in my mod
You need to include commons math as a Maven dependency and tell Shadow to include it in your jar, otherwise the relocate bit doesn't do anything.
-
Using Apache Commons Math in my mod
No, you would install the latest version of Gradle from the Gradle site and run gradle wrapper .
-
Using Apache Commons Math in my mod
Make sure you're using the latest version of Gradle and the latest version of Shadow.
-
Using Apache Commons Math in my mod
Yes, what i usually do is: relocate "org.apache.commons.math3", "your.mod.package.repack.org.apache.commons.math3" The whole point of having the relocate function is that it both moves the files and updates all the references in your code and in the other library.
-
[1.8.9][SOLVED] Tile Entity's Tank not updating (wrongly) client-side
Of course it doesn't think there's any fluid present on the client side, your code that updates the lava tank is only run on the server side because of the !isRemote check. The game doesn't automatically sync your TileEntities to the client side, you need to do that yourself.
-
Using Apache Commons Math in my mod
Same way as how I told you in your previous thread about shading. Use the Shadow plugin, tell it to include you're version of Commons Math and tell it to relocate it to a package inside your mod package. You can see an example of this here.
-
[1.9] Porting ISBRH
No. Use the model system, it is far more efficient in terms of rendering performance. If you need complex dynamic stuff or complicated animations, you can use a TESR, but for normal block rendering you should use the model system.
-
[Any] [SOLVED] Minecraft Modding with Java 8?
Streams are helpful and can be used in the exact same ways in MC as in other Java code. Streams are definitely slower however as long as you don't use large streams in code that is called very often (e.g. rendering) there shouldn't be any problems. One thing to keep an eye out for is when use lambdas for functional interfaces in vanilla code (e.g. ItemMeshDefinition ). SpecialSource doesn't properly handle lambdas, so if you pass in a lambda or method reference to ModelLoader.setCustomMeshDefinition it won't get obfuscated and will case an AbstractMethodError at runtime. To get around this use a custom wrapper interface like this so the default method is obfuscated and can call the unobfuscated method provided by the lambda.
-
Using External Libraries in my mod
Axlen, that's not what OP asked. OP: Kind of. All those things combined are the maven identifier, using the pattern "GROUP:NAME:VERSION" . e.g. for sphinx4-core it would be "edu.cmu.sphinx:sphinx4-core:5prealpha-SNAPSHOT" . The one for sphinx4-data is assembled in the same pattern. You will need of the include(dependency("...")) because you have two separate dependencies.
-
Take screenshot and absolute path
cough My PR also adds an event to hook into ScreenShotHelper which you could use if ever it's merged.
-
Using External Libraries in my mod
Heh, that's my build.gradle , Ernio. I'll break the important bits down for you: plugins { id "com.matthewprenger.cursegradle" version "1.0.6" id "com.github.johnrengelman.shadow" version "1.2.2" } Includes the plugins in Gradle, the only one you need is the second one ( "com.github.johnrengelman.shadow" ). shadowJar { classifier = "" relocate "com.mashape.unirest", "net.shadowfacts.discordchat.repack.com.mashape.unirest" relocate "com.neovisionaries.ws.client", "net.shadowfacts.discordchat.repack.com.neovisionaries.ws.client" relocate "com.sun.jna", "net.shadowfacts.discordchat.repack.com.sun.jna" relocate "javax.sound", "net.shadowfacts.discordchat.repack.javax.sound" relocate "javazoom", "net.shadowfacts.discordchat.repack.javazoom" relocate "net.dv8tion.jda", "net.shadowfacts.discordchat.repack.net.dv8tion.jda" relocate "net.sourceforge.jaad", "net.shadowfacts.discordchat.repack.net.sourceforge.jaad" relocate "org.apache.commons.codec", "net.shadowfacts.discordchat.repack.org.apache.commons.codec" relocate "org.apache.commons.lang3", "net.shadowfacts.discordchat.repack.org.apache.commons.lang3" relocate "org.json", "net.shadowfacts.discordchat.repack.org.json" relocate "org.kc7bfi.jflac", "net.shadowfacts.discordchat.repack.orgkc7bfi.jflac" relocate "org.tritonus", "net.shadowfacts.discordchat.repack.org.tritonus" relocate "tomp2p.opuswrapper", "net.shadowfacts.discordchat.repack.tomp2p.opuswrapper" relocate "org.apache.http", "net.shadowfacts.discordchat.repack.org.apache.http" relocate "org.apache.commons.logging", "net.shadowfacts.discordchat.repack.org.apache.commons.logging" dependencies { include(dependency("net.dv8tion:JDA:1.2.2_167:withDependencies")) } } This is the most important bit. The classifier line sets the classifier to nothing, so it is named the same as the default jar. All the relocate lines tell the Shadow plugin to move everything in those packages to different packages. This shouldn't be necessary unless: You're repackaging something that's already required by MC/Forge (e.g. a new version of some library) You're repackaging a library that's likely to be repackaged by other mods (to prevent conflicts) [*]The dependencies block tells Shadow specifically which dependency you want to include. You should replace "net.dv8tion:JDA:1.2.2_167:withDependencies" with the Maven identifier of the library you're shading. reobf { shadowJar { mappingType = "SEARGE" } } tasks.reobfShadowJar.mustRunAfter shadowJar This bit tells ForgeGradle to reobfuscate the the jar that contains all the shaded libraries, otherwise your mod would crash instantly in a normal environment. afterEvaluate { tasks.curseforge240995.dependsOn reobfShadowJar } This bit is only necessary if you're using CurseGradle with Shadow. It tells CurseGradle not to upload the shadowJar until it has been reobfuscated. You'd need to replace curseforge240995 with curseforge + the ID number of your CurseForge project.
-
RR3 crash after adding some new mods:
Did you even read the beginning of the crash report? Reika.DragonAPI.Exception.IDConflictException: RotaryCraft was not installed correctly: CONFLICT: Potion IDs: com.emoniph.witchery.brewing.potions.PotionSprouting@16fbcb6 @ 35 (PotionSprouting & FreezePotion) Check your IDs and change them if possible. This is NOT a mod bug. Do not post it or ask for support or you will look lazy or extremely foolish..
-
[1.9] Custom GUI doesn't open [Solved]
You need to call openGui on both the client and the server.
-
java.lang.NoSuchMethodError on Minecraft launch
I have a project that uses the shadow plugin, and I had to do it a bit of messing around but I got it to work. My build.gradle file is here but the key point is these two lines: reobf { shadowJar { mappingType = "SEARGE" } } tasks.reobfShadowJar.mustRunAfter shadowJar This tells ForgeGradle to add a reobfShadowJar task that reobfuscates the shadowJar and has it automatically run after the shadowJar task. Depending on your configuration, you may need to run reobfShadowJar manually (e.g. run gradlew shadowJar reobfShadowJar ). If you use CurseGradle you'll need to add something like this (but with 000000 replaced with your project id): afterEvaluate { tasks.curseforge240995.dependsOn reobfShadowJar }
-
[1.7.10] Prevent player from joining server when a certain mod is installed?
You should be able to do this via a custom network check handler (see the NetworkCheckHandler annotation). In your handler, you can access the Map<String, String> which is a map of mod id to version from the connecting side and check if contains the Cheating Essentials mod ID.
-
Minecraft Crashing
Chisel 2 by Cricket is broken, tell the author what happens and give him the crash report.
-
FML Confirm Problem
As the message at the end of the log says, you can type /fml confirm in the server console or run the server with -Dfml.queryResult=confirm.
-
[SOLVED]Block Coordinates
Look at the parameters for the method you're overriding. The first three int parameters of onBlockActivated (i, j, and k) are the X, Y, and Z coordinates of the block, use those instead of posx, posy, and posz (all of which are 0).
-
Destroying grown crops after x time
http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.8.9.html
-
ForgeGradle
You have to specify the MCP mappings you want to use in your build.gradle like so: minecraft { mappings = "snapshot_20160130" }
-
[1.7.10] Access transformer issue
Reflection in Java is actually not that expensive, this is the official Oracle tutorial on Reflection, and is a good place to start. Unless you are accessing the field every single frame, or every single tick, you don't need to use an access transformer and reflection will work fine.
-
Change camera position (help: I'm desperate :C)
Your camera entity shouldn't extend EntityLiving, it should just extend Entity.
IPS spam blocked by CleanTalk.