Jump to content

AndrewM16921

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by AndrewM16921

  1. Essentially, I wanted to make my own world gen from the ground up. I was going to try to create a sort of "realistic" world gen, of sorts.
  2. Anyone have any info on this...?
  3. Hey, I've found plenty of information on adding a world generator, but how do I go about completely replacing the normal world gen?
  4. Making a group/permission mod. Doesn't seem to register my command. Not sure why. Think I'm missing something. Any info? Code: http://paste.minecraftforge.net/view/baef85bd Edit: Ok, it registers it when I run the server. But not if I'm just playing single player. How do I register it for everything instead of just server-side? Not that I really need it for the /rank command ... but for future commands.
  5. Alright, thanks. But say I need to determine if they're op for a non-command related thing, this is what I came up with... I think it'll work? public class Util { public static boolean isOp(ICommandSender sender) { return MinecraftServer.getServer().getConfigurationManager().getOps().contains(sender.getCommandSenderName()); } public static EntityPlayerMP getPlayerExact(String username) { return username == null ? null : MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(username); } public static EntityPlayerMP getPlayerBestMatch(String username) { String bestMatch = null; for(String name : MinecraftServer.getServer().getAllUsernames()) { if(name.equalsIgnoreCase(username)) { bestMatch = name; break; } else { if(name.toLowerCase().startsWith(username.toLowerCase())) { bestMatch = name; } } } return getPlayerExact(bestMatch); } public static void broadcastMessage(String message) { for(String name : MinecraftServer.getServer().getAllUsernames()) { getPlayerExact(name).sendChatToPlayer(message); } } public static void sendInfo(ICommandSender sender, String message) { sender.sendChatToPlayer(ChatFormat.YELLOW + message); } public static void sendError(ICommandSender sender, String message) { sender.sendChatToPlayer(ChatFormat.RED + message); } } Gonna test it out in a bit. But, yeah.
  6. How do I broadcast a message to everyone on the server? If there isn't already functionality for that (though I imagine there is... somewhere), how would I get a list of all online players? And, how do you determine if a player is opped? I saw something in CommandBase about command permission level. Not sure if that's involved in this, but I have no idea where to find that information. x.x Also, as I am learning the api, I seem to have a lot of questions that seem trivial. I search through the code and checked the javadocs and still can't find answers a lot of the time. I hate resorting to ask a question as simple as this on the forum... what are other resources? kthx.
  7. What's that? I'll have to investigate. Still learning the apis by the way Looks precisely like what I need. What do I use to register it? Nvm, found it.
  8. I don't see any event classes to use to determine when a player joins or leaves the server. The closest thing I see is EntityJoinWorldEvent, but I doubt that's quite what I'm looking for... any info?
  9. So, I hacked together a quick "fix." It still has the same problem, but it fixes itself so quick that it doesn't matter that much now. I just changed the onUpdate() method in my custom EntityArrow class to force a fix if ticksInAir < 4. public void onUpdate() { super.onUpdate(); if((!this.inGround && this.ticksInAir < 4) || (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)) { float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / Math.PI); } ... If anyone knows a proper fix though, please let me know.
  10. In ItemBow, there's a bit that says: ArrowLooseEvent event = new ArrowLooseEvent(player, bow, var6); MinecraftForge.EVENT_BUS.post(event); I'm trying to find the handler that handles this event. I tried looking through the call hierarchy, did a search within eclipse, even ran my mod in debug mode, but I could not find it. Does anyone know where it is or what it's called? Essentially, I'm trying to make a custom arrow start out straight. For some reason, even with the same code as the normal bow/arrow, its angle is weird at first but then fixes itself in a couple seconds (if it makes it that far). Also, shooting a normal arrow with my modified bow works just fine, so I'm guessing it's something in the arrow entity class. So, I wrote this method to fix it and call it right after it's fired, but it doesn't seem to make any changes whatsoever. public void setAngles(Vec3 v) { double x = v.xCoord; double y = v.yCoord; double z = v.zCoord; float a = MathHelper.sqrt_double(x * x + z * z); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)a) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch; this.prevRotationYaw = this.rotationYaw; this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); }
  11. [solved] So, I think it has something to do with me needing to include @SideOnly annotations in certain places... don't really know where though. Ima try to put em in where it makes sense, but if anyone has any info, please let me know.
  12. [solved] So I'm testing out my first mod, and it works fine if I run it from my client. But, as soon as I put it on a server it crashes. Seems to be looking for a class "bdx." This is the report: http://paste.minecraftforge.net/view/cba04192 wut do?
  13. Basically, I'm trying to make the block render upsidedown if the block above it is solid. I don't know very much about OpenGL, so I just kind of winged it. And, for the most part, it works... except for the fact that it does not render the faces nearest the viewer, and I have no idea why. It only happens when it's flipped; not when it renders normally. Code: http://paste.minecraftforge.net/view/2917e6cf
  14. Nope, I didn't, but I guess I should =P Sorry, this is my first time modding with anything other than Bukkit <_< soooo, yeah. I'll look at it.
  15. Was trying to find a quick tutorial on the basics of custom toolclasses, but I didn't find one so I just kind of winged it. Currently, I have a set of "Crystal" blocks that should only be harvestable with a "Chisel." I am having a few problems. Even though I assigned the custom toolclass to the items (the chisels), and for the blocks, the block can still be harvested by anything (including nothing), and takes the same amount of time to break regardless of item used or its type. Relevant snippets: http://paste.minecraftforge.net/view/0753d391
  16. K... I'm smacking myself into the face right now. I was in the FML directory, not the MCP one. FML...
  17. Right so... Earlier today I downloaded the files to start modding some stuff, and I was following a tutorial. All was well, and still is - in that workspace. But that's my tutorial/"mess around with crap" space, so I decided to make another. This time, when I ran install.bat, everything went smoothly as before. But, when I opened the workspace in eclipse... well, the src and lib folders were all empty. No idea why... anyone have any idea? Here's a screenshot: http://nubcraft.org/stuff/empty.png
×
×
  • Create New...

Important Information

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