Jump to content

angellus

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by angellus

  1. I have been searching around and Googling, is there a way to do the ForgeGradle task 'runClient' with the username, accesstoken and/or password parameters? Preferably a way that does not require me to stick them in my build.gradle.
  2. What you said made me think of something I should have checked earlier. It looks like it is because Minecraft/Forge determines if the player is sprinting AFTER the Forge hook for LivingUpdate. So regardless of what you set player.setSprinting too, it will be redetermined once the Minecraft code runs to determine it. This worked as override: KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindSprint.getKeyCode(), false);
  3. Since 1.7 added the ability to bind sprint to a specific key, I cannot seem to find out how to stop players from sprinting. This is how I am doing it: public void handleLivingEntityUpdate(LivingEvent.LivingUpdateEvent event) { if (event.entityLiving instanceof EntityPlayer) { event.entityLiving.setSprinting(false); } } But this only appears to work if the player uses double-tap forward to sprint, not if they use the key bind to sprint.
  4. Subject really says it all. I need to find a way to intercept a block break before it goes to Bukkit. We have blocks that change states when they are mined (like regenerating ores) and would like to bypass Bukkit permissions so players can still "mine" the block, but not break it. I tried doing a BlockEvent.BreakEvent and tweaking the priority, but that does not seem to work. Is there anything I can hook into that fires before the block is actually broken that I can use?
  5. I just determined it is not. Forge is not loading it. Nashorn is a Java Extension and it is not loading it.
  6. In that case, is it possible to get Forge to load a jar from a Maven repo if it cannot find it? i.e. Can I upload and host a copy of rhino.jar that it needs to use Rhino and make it so Forge will download and use it if it is on Java 8+?
  7. It looks like it might be modloader that is causing the issue. The following code works in Java 7 in both IntelliJ AND Minecraft, whereas in Java 8, it only works in IntelliJ import javax.script.*; new ScriptEngineManager().getEngineByName("JavaScript"); However, if I tell ScriptEngineManager to use the Forge Mod Loader, it only works in Java 7 and no longer in Java 8 at all. import cpw.mods.fml.common.Loader; import javax.script.*; new ScriptEngineManager(Loader.instance().getModClassLoader()).getEngineByName("JavaScript"); In Java 7, rhino.jar is located inside of JRE\lib, in Java 8, nashorn.jar is located in JRE\lib\ext. It looks like Forge is not loading the Java extension Jars.
  8. For IntelliJ? No. It is just there. It should just be there.
  9. Yeah, nashorn is definitely there. I am pretty sure the Minecraft launcher it just not loading it. I know you can do classpath injection, but I do not really know how. Can I force Java to load it somehow?
  10. It looks like it is a classpath issue. It was not set up right. I finally got it working now though. Thanks guys!
  11. This is not an issue that is directly related to Forge, but it is something someone here might be able to help me with. When we updated our mod to 1.7.10, we noticed some people started having issues with running our content scripts which we use for mob drops and some other things. Well, now, it is happening to everything. I am pretty sure now that everyone is on Java 8, it does not work for anyone. It does not even work in our dev environment anymore for intelliJ. This is the code that is messing up and it seems that it is a pretty standard way of doing things. "getEngineByName" is returning null which is only support to happen if that Engine does not exist. Except JavaScript should exist. import javax.script.*; new ScriptEngineManager().getEngineByName("JavaScript"); UPDATE: After a lot more research, it looks like in Java 8 that nashorn.jar, which contains the JavaScript engine, is a Java Extension and it is not being loaded by the Minecraft Launcher. Does anyone know how to force load this extension using either Gradle or the code or something else? The mod is being built with JDK8 targeting JRE 8. If I load it inside of IntelliJ it all works fine, it is simply because the extension is not being loaded by the launcher.
  12. Nevermind. I figured it out. You can do try/catches in Gradle apparently. dependencies { try { compile project(':CoreMod') } catch (UnknownProjectException ex) { compile 'com.mod:CoreMod:latest.integration' } }
  13. Is it possible to set a dependency to compile another project if it exist OR pull from a Maven repo if it does not? That way you can set CoreMod+Mod set where Mod depends on CoreMod to compile but you can also just set up Mod to pull CoreMod from Maven repo. For example, something like this: dependencies { // if project(':CoreMod').exists() compile project(':CoreMod') //else compile 'com.mod:CoreMod:latest.integration' }
  14. And you have no problems with in SMP? I will try it out and let you know if I have any issues with it.
  15. That is what I thought too. Here is how I am trying to trigger it: When a player logs in, we create an instance of a wrapper class around entityPlayer to tracker a bunch of stuff. That instance is store in a data structure for tracking players we can retrieve at a latter point and time. An instance of this class is also created locally too. We use the proxy too access the wrapper. The player presses a KeyBind (client side obviously) and it toggles a flag that will override the player stepHeight in LivingEntityUpdate event. That all happens client side and it was not working, so I added a packet to send server side to override it server side in that LivingEntityUpdate event also.
  16. If it is client side, thePlayer comes from Minecraft.getMinecraft().thePlayer. If it is server side, it comes from the PlayerEvent.PlayerLoggedInEvent event. This class is basically a wrapper class for EntityPlayer.
  17. It just returns an instance of EntityPlayer. I have already verified that .stepHeight value is being changed using debugging. public EntityPlayer getThePlayer() { return thePlayer; }
  18. I had this working in 1.6, but for the life of me, I cannot get it working in 1.7. This is what I have tried: In SSP: Case 1: Client Thread: player.stepHeight = 1.0F Server Thread: player.stepHeight = 0.5F Outcome: Works Case 2: Client Thread: player.stepHeight = 0.5F Server Thread: player.stepHeight = 1.0F Outcome: Does not work Case 1: Client Thread: player.stepHeight = 1.0F Server Thread: player.stepHeight = 1.0F Outcome: Does not work In SMP: Case 1: Client: player.stepHeight = 1.0F Server: player.stepHeight = 0.5F Outcome: Does not work Case 2: Client: player.stepHeight = 0.5F Server: player.stepHeight = 1.0F Outcome: Does not work Case 1: Client: player.stepHeight = 1.0F Server: player.stepHeight = 1.0F Outcome: Does not work How do I get the step height modified in both SSP and SMP? This is the code I am running inside of a LivingEntityUpdate event handler. And I have verified through debugging the values are what I expect them to be. if (this.getExtraData().getInteger("agility_toggle") == 1) { this.getThePlayer().stepHeight = Math.min(2.0F, 0.5F + (this.getSkillList().agility.getEffectiveLevel() - 20) * 0.05F); } else { this.getThePlayer().stepHeight = 0.5F; }
  19. this.player and this.side are exactly what you might think. They are initialized when this class is (when the player logs in). This class is for a player's "skill" (RPG-ish mod). So, this.player is the owning player of the skill (EntityPlayer). It is generated upon login for a player. Likewise, this.side is returned from "FMLCommonHandler.instance().getEffectiveSide()" and initialized when the class is; so this should only ever be running on the server. Also, it does only run in the main Minecraft thread (it did not use to, removing it from its own thread greatly decreased the crash amount, but did not stop it). EDIT: That crash log is a server crash log. The clients get read time out errors.
  20. First, I know have searched around a lot for this error and usually it is because the mod is poorly writen or the entity is being spawned on the wrong thread. As far as I know, either of those are happening here. I am creating and spawning the firework entity on the server side, not client side. The ConcurrentModification is seemly random, but only occurs when there is no block above the player (firework spawned at player's location). Here is the crash log. It is for the server. The clients get read time outs for the server crashing. And here is the relevant code. Along with the "helper" function to create the firework. I got the code to create the ItemStack for the firework from net.minecraft.ItemFirework (I think, it was a while ago, cannot remember). It generates a Firework with identical NBT tags as one Minecraft generates (tested with NBT explorer). I am not sure if this is a Forge bug or me doing something wrong. Either way, some help would be great. Thanks. EDIT: One last thing, I know at about 150% certainty that THIS code is causing THAT exception. We have actually having this error for almost a Week now and we have tried everything we know to fix it. This is the most possible simplified version of the code that still causes the crash.
  21. It works. Thanks. Do you know how to negate fall damage? Using LivingHurtEvent, I can set the ammount to 0, but I stil get the hurt anitmation and knockback stuff. How can I cancel the event completely?
  22. In the mod some friend and I are implementing, we are doing skills and leveling (RPG system). I can figure out how to modify jump height, fall damaged and health, but I am lost on how to modify a player's movement and sprint speed. Any help?
  23. I am working on a mod with some buddies of mine and I want to make it so whenever Jenkins builds our mod, it appends the build number to the version number (so "0.0.1" because "0.0.1.103"). This would make it so we do not have to manually increment it everytime we commit. From my understanding of Java (I am a C++/Python guy myself), everything has to be in a class. It cannot run unless it is in a class. Also, the entry point for the mod is the base mod file. It is the first thing that runs. So nothing in out mod can run before it. Also, the version number has to be a constant (final). Therefore, as far as I know, there is no way to programmically set the version number with out a fancy bash script that did a find and replace. I was wondering if anyone knows how to append the build number automatically to the version number or knows how to write the bashscript to do it automatically off the top of their head (I hate writing bash scripts). EDIT: I figured it out. Use you can use an "mcmod.info" file and do a sed to replace a placeholder text with the build number.
×
×
  • Create New...

Important Information

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