Jump to content

Troelsen

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by Troelsen

  1. Thanks a lot for your replies, guys. I think I've got it working, I'll get back to you when I've tested it!
  2. Hello there! Thank your for the quick response! So, what methods would I have to invoke on the ICommandSender to get the actual playerentity? I'm sorry if I'm coming off as a moron, I'm just quite new to Forge/Minecraft modding.
  3. I'm working on a scheduled shutdown mod in forge-1.10.2-12.18.3.2281. I want a command that allows for operators to /setdelay <minutes> on the schedule, however, I can't seem to figure out how to check if the ICommandSender is an operator on the server. Since most answers I can find are aimed towards earlier versions of minecraft/forge, these answers are deprecated, and the methods no longer exist. public boolean checkPermission(MinecraftServer server, ICommandSender sender) { } This is the method I'm talking about
  4. Yeah it is, I had somehow switching the run configurations, it works now. Also, the changing the modID to lowercase fixed my problem with mcmod.info You're my hero! Thanks for your help!
  5. Hmm, after switching back to my old workspace, when I testrun the game, my mod doesn't show up for some reason, any clue as to what that may be?
  6. I tried to follow bedrockminers tutorial. This is my original setup http://puu.sh/pUIxy/1a06078074.png All same files. The problem still occurs this way, though
  7. Here I am once again, as Kelly Clarkson would've put it. I really appreciate the amount of help you guys are giving, you have no idea. Anyhoo. I've been struggling with getting my mcmod.info working, and I've tried several examples on how to make them, where to put them, and what to put in them, since people have different opinions, apparently. So anyway, the location of my mcmod.info is currently here: http://puu.sh/pUH46/d8c5872c22.png Which was one of the places people suggested it. Here's a picture of my project setup: http://puu.sh/pUH5v/bf67d355d9.png Which I've made following bedrockminers tutorials for advanced setups. And heres what my mcmod.info looks like [ { "modid": "BuildingArea", "name": "Building Area", "description": "Used to set boarders for creative building", "version": "1.2", "mcversion": "1.7.10", "url": "", "updateUrl": "", "authorList": ["Troelsen"], "credits": "MinecraftForge", "logoFile": "", "screenshots": [], "dependencies": [] } ] But when I get ingame and look, here's what it looks like: http://puu.sh/pUHlf/5df449ae64.png Any ideas?
  8. Hello again. First of all, I'm sorry, I may come off as a dumbo. I just can't seem to figure this out. What I'm trying to do, is to allow a person to access coordinates through a config-file. These Coordinates should be used in the rectangle I'm making in the"EventHandlerCommon" class. I've been goofing around, but before I did so, I had the coordinates hardcoded in, and it worked without problems. So I guess what I'm asking is, how do I use the ints set in my config files, when creating my rectangle? And do I need another update to do so? Main class: EventHandler: ConfigurationThing: GuiFactory ConfigGui: And here's what the config looks like after running the code Again, I know some of the stuff I've tried in the given code above, is stupid. This is after I've tried, what I thought made sense, and then just mindlessly trying in hopes that something would work. I can't really figure out how this works, and that's what I'd like to have explained, not how bad my code is, or that what I've written is stupid. I hope you can understand what I'm trying to do, otherwise, let me know Thanks a ton!
  9. Hey guys. I've been trying to make a mod that allows for a player to be in creative mode within a given area. To do that, I need to set up "borders". This works perfectly fine when hardcoding in the area, but that's not very server-owner-friendly. So I wanted to make a config file they can access, and through that, set the given coordinates. However, I get this error when trying to load Minecraft with my current code. (classes posted below error) Error: Main class ConfigurationClass: GuiFactory GuiConfig I've been searching a bit around, and can't seem to find a fix. Any help would be greatly appreciated Thanks!
  10. Hai Choonster! I got working by making an IExtendedEntityProperties as you told me to. Thanks again for your help!
  11. Thank you for the quick response! I thought of checking for the last tick as well, and I also tried. However player.lastTickPosX/Z doesn't seem to work as I thought it would public class EventHandlerCommon { @SubscribeEvent public void tickEvent(PlayerTickEvent event) { Rectangle rec1 = new Rectangle(-10, -10, 20, 20); // constructor er (x, z, width, height) Rectangle rec2 = new Rectangle(-12, -12, 24, 24); Point playerPos = new Point((int)event.player.posX, (int)event.player.posZ); Point playerPose = new Point((int)event.player.lastTickPosX, (int)event.player.lastTickPosZ); // Hvis man er inden for den yderste rectangle, og uden for den inderste if (event.player.capabilities.isCreativeMode && rec2.contains(playerPos) && !rec1.contains(playerPos)) { event.player.setGameType(GameType.SURVIVAL); } else if (rec2.contains(playerPose) && !rec1.contains(playerPose)) { event.player.setGameType(GameType.SURVIVAL); } } } There's no errors in my code, it does however not change the gamemode once teleported
  12. I'm looking for a way to check if a player uses any sort of teleportation, since with this code, people can't "move" out of my borders, they can however, teleport. I was wondering if I can force survival on those who may try to teleport out of the borders. Here's the code: package com.troelsen.buildingarea; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.WorldSettings.GameType; import java.awt.*; public class EventHandlerCommon { @SubscribeEvent public void tickEvent(PlayerTickEvent event) { Rectangle rec1 = new Rectangle(-10, -10, 20, 20); // constructor er (x, z, width, height) Rectangle rec2 = new Rectangle(-15, -15, 30, 30); Point playerPos = new Point((int)event.player.posX, (int)event.player.posZ); // Hvis man er inden for den yderste rectangle, og uden for den inderste if (event.player.capabilities.isCreativeMode && rec2.contains(playerPos) && !rec1.contains(playerPos)) { event.player.setGameType(GameType.SURVIVAL); } } } Thanks in advance Troelsen
  13. I'm sorry if I come off as a complete fool, but how would I go about grabbing that in this method? @SubscribeEvent public void tickEvent(PlayerTickEvent event) { double xmax = 10; double xmin = -10; double zmax = 10; double zmin = -10; double bxmax = 15; double bxmin = -15; double bzmax = 15; double bzmin = -15; if((event.player.posX >= xmax || event.player.posZ >= zmax) && (event.player.posX <= bxmax || event.player.posZ <= bzmax)) { event.player.setGameType(GameType.SURVIVAL); } if((event.player.posX <= xmin || event.player.posZ <= zmin) && (event.player.posX >= bxmin || event.player.posZ >= bzmin)) { event.player.setGameType(GameType.SURVIVAL); } } EDIT: event.player.capabilities.isCreativeMode seemed to work just fine. Thanks for helping me out you two :3
  14. Thanks for pointing that out. I've now created an EventHandler class, which seems to have fixed the problem. My gamemode is changed whenever I leave the 20x20 square, it is however, spammed at every tick, which I guess makes sense. Is there a way to check if the player is already in survivalmode, using event.player from tickEvent? I can't seem to find anything linked with gametype except for setGameType Thanks a ton!
  15. Oh right. I'm trying to call it in my preInit, I can't seem to do so, though.
  16. Thanks for your response! I'm not quite sure I understand what you mean. What I'm trying to do is to set up a square, where you can move freely in creative mode, but when you leave, you'll go survival. However, I'm not really sure how the PlayerTickEvent works, and if that's even the right way to go. I need some sort of update, but I don't know which is the most serverfriendly one. Again, I'm sorry if I come off as blank, I'm new here.
  17. Hello guys! I'm new to forge-modding, and I'm having some trouble figuring out how to check if a player crosses a "border". So far I've tried this public void tickPlayer(PlayerTickEvent event) { double xmax = 10; double xmin = -10; double zmax = 10; double zmin = -10; double bxmax = 15; double bxmin = -15; double bzmax = 15; double bzmin = -15; if((event.player.posX >= xmax || event.player.posZ >= zmax) && (event.player.posX <= bxmax || event.player.posZ <= bzmax)) { event.player.setGameType(GameType.SURVIVAL); } if((event.player.posX <= xmin || event.player.posZ <= zmin) && (event.player.posX >= bxmin || event.player.posZ >= bzmin)) { event.player.setGameType(GameType.SURVIVAL); } } and this public boolean onPlayerExitArea(EntityPlayer player) { double xmax = 10; double xmin = -10; double zmax = 10; double zmin = -10; double bxmax = 15; double bxmin = -15; double bzmax = 15; double bzmin = -15; if((player.posX >= xmax || player.posZ >= zmax) && (player.posX <= bxmax || player.posZ <= bzmax)) { player.setGameType(GameType.SURVIVAL); } if((player.posX <= xmin || player.posZ <= zmin) && (player.posX >= bxmin || player.posZ >= bzmin)) { player.setGameType(GameType.SURVIVAL); } return false; } Neither of these seem to have any effect, but I've been searching around for about an hour now, and I can't find any reference to go by. Thanks in advance Troelsen
×
×
  • Create New...

Important Information

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