Jump to content

SecondAmendment

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by SecondAmendment

  1. How can I adapt the objectMouseOver() method's logic to use server side data. in order to get the entityHit that a player looks at and use it server side.
  2. Well, it works doesnt it? I always say "If it aint broke dont fix it" unless there is a more efficient way of doing it. Code can sometimes be tedious but every time you think you are having a rough time, think of the people who had to map out google maps. That took ages.
  3. The end position returns coords that are way off. and not the position of the entity the player is looking at based on the block position. In fact it doesnt detect the EntityHit at all.
  4. Is there a way I can get a severside raytrace of a player's line of sight to another entityHit? I know that objectMouseOver() is clientside only so, I dont know what to substitute for that. here's a solution I tried using the following that I found on another forum, however it doesnt work. Vec3d look = player.getLookVec();[/p] float f = 200.0F; // distance factor[/p] Vec3d start = new Vec3(player.posX, player.posY + player.getEyeHeight(), player.posZ); Entity entityhit = player.worldObj.rayTraceBlocks(startpos, endpos, false, true, true).entityHit;
  5. can it work on entities? not just blocks?
  6. is there a World#rayTraceEntity?
  7. So what Forge method could I use to obtain the block a player is looking at for serverside use I know for client side i can use objectMouseOver() and get the raytrace.
  8. Yes but the server still has to obtain the block the player is looking at from the client, doesnt it?
  9. I was wondering if there was a way that I could ovvsride a server mod that I made with an optional client side mod that I made to interact with it. In other words I made a serverside only version of my mod as well as a common (server and client) sidd version for my client. I want to make it so that any player can join despite not having the mod installed which I was able to do with @Mod but now my problem is I was people with the client and only with the client to be able to oveeride soms of the serverside suff. For example: Client types /dirt on a block he looks at using a forge mod. Server then turns the block into dirt. However other people without the mod could still see the resulting change due to the fact that a dirt block is part of minecraft and requires no sidemods for that change to be observer. I hope what I am trying to do makes sense.
  10. lol, yeah i guess i should start there.
  11. Yeah, I was thinking on switching but. I need to learn its interface. Do you know any good places to learn how to use intelliJ and navigate through its interface.
  12. Could be it. What do you use? IntelliJ? and what would you recommend if I want to switch.
  13. weird, cant think of why that is. Is it because my mod relies on a dependency and there is a red exclamation mark on my project folder? Because the mod it relies on or expands upon, is in there and the client does load it up. I see it in the debug.
  14. I got it to work. For some reason after i exported the build into my actual minecraft it works. But doesnt work in the eclipse client launch.
  15. But I dont have the EGit plugin installed on eclipse (which is what I am using as my IDE)
  16. Could I just send you the code directly? theres not much in it anyway.
  17. There is no result. Nothing gets printed. Just the typical "Unknown command. Try /help for a list of commands"
  18. package com.vivabenfica4ps3.gmail.commands; import net.minecraft.client.Minecraft; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentString; public class PMCommands extends CommandBase{ @Override public int getRequiredPermissionLevel() { return 0; } @Override public boolean checkPermission(MinecraftServer server, ICommandSender sender) { return sender.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); } @Override public String getCommandName() { return "pkgive"; } @Override public String getCommandUsage(ICommandSender sender) { return "commands.pkgive.usage"; } @Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { System.out.println("True"); Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentString("true")); Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentString(args.toString())); if (args[0].equalsIgnoreCase(("pkgive"))) { ItemStack item = new ItemStack(Item.getByNameOrId("pixelmon:" + args[1])); Minecraft.getMinecraft().thePlayer.inventory.addItemStackToInventory(item); } } } Exactly what im typing in (even if what is written in execute has an issue. It would still printout true to the player and the console.): http://prntscr.com/eodu1n
  19. So what could be causing it to still not work? could it be the permissions? Is the name of my command supposed to be written somewhere else other than in the command's class itself? Im typing in /<Command Name> <Argument>
  20. If I want the command to have 2 arguments, what would i make the command name be? just the first? If so i tried "pkgive" and it still didnt work.
  21. but why would that make it work? testing it right now, but just curious.
  22. The command is meant to be clientside only
  23. package com.vivabenfica4ps3.gmail.commands; import net.minecraft.client.Minecraft; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentString; public class PMCommands extends CommandBase{ @Override public int getRequiredPermissionLevel() { return 0; } @Override public boolean checkPermission(MinecraftServer server, ICommandSender sender) { return sender.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); } @Override public String getCommandName() { return null; } @Override public String getCommandUsage(ICommandSender sender) { return null; } @Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { System.out.println("True"); Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentString("true")); Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentString(args.toString())); } }
  24. Ive searched and searched, but I just cant figure out why my clientside command isnt getting registered. I have my main class and my command class. My command class extends CommandBase and implements all methods of the abstract class. Those methods being getRequiredPermissionLevel(), checkPermission(), getCommandName(), getCommandUsage(), and of course the main on I care about execute(). However my command isnt getting registered at all and I know this because i just added a simple output to the log saying "True" if a command gets executed by the player, however nothing shows up. This is my Main class (well at least the part that counts): @EventHandler public void preInit(FMLPreInitializationEvent event) { FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); ClientCommandHandler.instance.registerCommand(new PMCommands()); } @EventHandler public void init(FMLInitializationEvent event) { } @EventHandler public void postInit(FMLPostInitializationEvent event) { } My question is am I registering the command correctly through the ClientCommandHandler?
×
×
  • Create New...

Important Information

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