Everything posted by Jwosty
-
[WIP] [1.7.10] Space Distortion Mod - Stargates and TARDIS's
0.3.0 Alpha is released, which adds a very simple Goa'uld base worldgen (a stargate, some transporter rings, appropriate loot, lots of gold), as well as a couple of minor tweaks.
-
Modder status/subforum requests
Even thought there's only a slow trickle of subforum requests, it's still a trickle. IMO, this thread still belongs.
-
How to make the OnRightClick Method point to the crosshair?
If you intend to do something whenever a player right-clicks a block, use PlayerInteractEvent.
-
Malformed JSON in mcmod.info
Also try using a simple working mcmod.info file from some other mod (i.e. one that doesn't have dependencies). If it still crashes... well, we'll cross that bridge if we come to it.
-
How would I check for a type of block at a specific location?
I might use world.getTileEntity(x,y,z) instanceof TileEntityChest
-
tileEntity does not save data and not Refresh render..
That updates the block, not any entities.
-
Is it possible to use my minecraft account in dev workspace? [1.7.10]
The server doesn't need login parameters, so only add it to client configurations. You can also get that same menu by clicking the drop-down arrow to the right of the debug/run icons and selecting "* configurations".
-
tileEntity does not save data and not Refresh render..
If I understand your problem correctly, I've had this exact problem before, too. My issue was that the entity's tracking range (specified in EntityRegistry.registerModEntity) wasn't big enough; changing it to a large value like 80 fixed it -- this means that players 80 blocks away will receive updates. In SP, it will just pause updating if the player leaves that range.
-
how to detect if a class implements an interface
What happens when you print the TE's class? e.g. ...println(world.getTileEntity(...).getClass())
-
Detect all nearby entities to player and then shoot lightning at them
Do you mean like just vanilla lightning raining down from the sky, or zaps coming from the player to mobs? If the latter, you'll have to create your own entity.
-
how to detect if a class implements an interface
Have you set up your tile entity properly? Try putting a print statement in all of its constructors.
-
[WIP] [1.7.10] Space Distortion Mod - Stargates and TARDIS's
Just released 0.2.0_alpha, which adds transporter rings, naquadah items, controller crystals, and crafting recipes for everything. Also, the MP no longer crashes but still doesn't work quite right.
-
Run command from Java
Yeah, but don't forget to register the instance with MinecraftForge.EVENT_BUS.register. It should then work.
-
Modder status/subforum requests
There are some great tutorials out there to get you started (e.g. Havvy's tutorials), as well as this board in general, and Google is your friend. The IRC channel #minecraftforge is always pretty active and friendly, so try there too! Have fun modding
-
Run command from Java
Read up on events; you're going about it in the totally wrong manner. To use an event, you don't subclass Event, you just have to write an instance method to take an event as a paremeter (e.g. EntityJoinWorldEvent or MinecartCollisionEvent), add the EventHandler annotation to it, and register an instance of said class with MinecraftForge.EVENT_BUS.register. For example, this logs every time a player goes to bed: // Just a normal Object subclass public class MyAwesomeClass { @SubscribeEvent public sleepyTime(PlayerSleepInBedEvent sleepEvent) { System.out.println("Goodnight!"); } } // Main mod class @Mod( ... ) public class AwesomeMod { // ... @SubscribeEvent public void init(FMLInitializationEvent) { FMLCommonHandler.instance().bus().register(new MyAwesomeClass()); } } That should be enough to get you started.
-
How to make an update checker
The basic idea is to have a plain text file served from some stable URL. Since I use Github for my project's source code hosting, I would have a file in the top level directory, calling it, for example, version or something. So if my mod's repo were at github.com/jwosty/MyAwesomeMod , the plaintext version file would probably be at raw.githubusercontent.com/jwosty/MyAwesomeMod/master/version . Here's a mix of pseudocode and actual Java code (you'll have to look up how to do the pseudocode things): public class VersionChecker implements Runnable { public void run() { string latestVersion = magicMethodToDownloadURI("http://raw.githubusercontent.com/jwosty/MyAwesomeMod/master/version"); if (!lastestVersion.equals(CommonProxy.Version) { magicMethodToAddClientChatMessages(CommonProxy.Modid + " is currently out of date; the latest version is " + latestVersion + ", and the currently installed version is " + CommonProxy.Version + ". Please download and install the latest version."); } } public VersionChecker() {} } It's important that it's implemented in a Runnable, because that will create its very own fancy thread when used like this: @EventHandler public void postInit(FMLPostInitializationEvent event) { Thread versionCheckThread = new Thread(new VersionChecker()); versionCheckThread.start(); } Haven't verified this code for compilability yet but it should probably work alright.
-
true portals mod
Ok, this is pretty freaking awesome. I like it. A lot.
-
[Solved] [1.7.10] alpha transperency not working
canRenderInPass(pass) should _not_ always return true -- you only want it to be able to render in pass 1 (not pass 0). Use this: @Override public boolean canRenderInPass(int pass) { return pass == 1; }
-
java coding problem, changable variable doesn't save?
mode = (mode + 1) % max has the same effect, but is much shorter and more readable IMO. It's just a modulo (remainder) operation, which wraps around.
-
Removing that Pesky Foliage Color
You might have to write your own block renderer. Could be wrong though.
-
Syncing Tile Entity with GUI
Use world.markBlockForUpdate on the server to, well, re-send the block and it's tile entity to every client.
-
Git setup
Well, there _is_ the GitHub GUI for Mac/Windows/Linux, but it's pretty limited. Personally, I prefer the command line :P
-
Gui Buttons
Look at the Minecraft source. Take a good hard look. You'll find out how to do it.
-
Git setup
Initializing a Git repo and setting up a remote branch from the command line is pretty simple: $ git init $ git add . $ git commit -am "first commit" $ git remote add origin https://github.com/user/repo $ git push -u origin master Now, if you're talking about a Forge project specifically, it's a bit more involved, but not too bad either. You could have a look at my repo for an example.
-
[WIP] [1.7.10] Space Distortion Mod - Stargates and TARDIS's
Very early and buggy download added. Use with caution!
IPS spam blocked by CleanTalk.