Jump to content

bltpyro

Members
  • Posts

    9
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

bltpyro's Achievements

Tree Puncher

Tree Puncher (2/8)

4

Reputation

  1. I'm assuming it would be the same thing you would do to get mobs naturally spawning in the day, putting this code in the EntityMobname: @Override protected boolean isValidLightLevel() { return true; //don't care about the light level to spawn } If it is not your own mob, I'm not sure.
  2. I have some code in a tick handler that checks player.getSleepTimer(); to run some code at a certain point when a player is about to fall asleap. This code needs to be run on the server, but I just realized when trying to port my mod to a real server it doesn't work since the method getSleepTimer() is client side only. It gives access to the private variable sleepTimer. Is there a way I can get past one of these restrictions to have access to the sleepTimer?
  3. Wow I feel stupid now. Guess I shouldn't believe everything I read on the internet. Not sure why I saw that in so many tutorials for particles then. Thanks
  4. I am trying to get my mod working on a server, and seems to be crashing because of my particles. Single player works fine. I get these errors: cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: bltpyro/mod/truesurvival/particles/EntityMagicStealFX and further on Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/particle/EntityFX which from what I understand has to do with the server trying to use client code. This seems to make sense since net.minecraft.client.particle.EntityFX has @SideOnly(Side.CLIENT), but then I'm trying to register it using EntityRegistry.registerModEntity(EntityMagicStealFX.class, "MagicStealParticleFX", 30, this, 50, 5, true); in my main mod file. Is the registering causing a problem on the server because of the @SideOnly(Side.CLIENT)? Is there something I'm doing wrong in how I register the particle? I can't seem to get past this issue. Thanks
  5. This site has some pretty useful information http://schwarzeszeux.tumblr.com/post/13854104445/minecraft-modeling-tutorial-part-1-of-x and this one too http://pixelmon.wikia.com/wiki/Modelling a tutorial, although some stuff may be dated http://www.minecraftforum.net/topic/931956-125advancedmodloaderhow-to-create-a-custom-mob7322012/
  6. I'm having a hard time getting things right with my mobs and the update frequency of EntityRegistry.registerModEntity seems to be making the largest differences. This is what I have noticed in order. With update frequency of 5, my mob would just move around very jerky. [embed=425,349] [/embed] I changed the update frequency to 1, and they started moving smoothly, but wouldn't turn completely while moving so ended up moving diagonally. After they stopped moving, the body would turn back in place. [embed=425,349] [/embed] I thought changing the update frequency to 3 fixed things since now they moved smoothly and straight, but they have an issue while they are leaping. They seem fine on the way up, but as they are falling down they seem to jerk up and down. I hope it isn't too hard to see. [embed=425,349] [/embed] Changing the update frequency to 2 they still jerk up and down while falling a little, and they don't turn completely. [embed=425,349] [/embed] Higher than 5 just made everything even more jerky. I guess I should also mention the rest of my registry values. EntityRegistry.registerModEntity(EntityNightWraith.class, "NightWraith",0, this, 128, 3, false); So as far as questions go: 1. What exactly is the update frequency and how do I know what I should set it to? 2. Is there something else that I could change that may fix some of these problems? Thanks
  7. OK I got it figured out. I never used the tickHandlers before, but thankfully got it working. First I needed to register the handler in my CommonProxy since I need my code serverside public void registerServerTickHandler() { TickRegistry.registerTickHandler(new ServerTickHandler(), Side.SERVER); } Then I had to set up the handler. I make sure that the tick types I want are the Player ticks for the server, which have the player as the object. Using the player I could access the sleepTimer and do stuff when I wanted to based on the timer. public class ServerTickHandler implements ITickHandler { @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { if (type.equals(EnumSet.of(TickType.PLAYER))) { onPlayerTick((EntityPlayer)tickData[0]); } } private void onPlayerTick(EntityPlayer player) { int sleepTicks = player.getSleepTimer(); if(sleepTicks == 99) { System.out.println("about to fall asleep"); //dostuff } } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { // TODO Auto-generated method stub } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.PLAYER, TickType.SERVER); } @Override public String getLabel() { // TODO Auto-generated method stub return null; } }
  8. I want to run some code while the player is sleeping. I had tried using the PlayerSleepInBedEvent, but that seems to only be useful for before a player goes to sleep. Searching around I noticed the onUpdate() increments the sleep timer and at the beginning of the function there is this: FMLCommonHandler.instance().onPlayerPreTick(this); I have looked through the FMLCommonHandler and tried serching online to figure out how use this but can't seem to figure it out. Does anyone know how to use these? Thanks
  9. Is there a way to change the day/night cycle without changing base classes? I would like to make the days shorter and the nights longer, but it doesn't seem like there is a nice way to do it without editing base classes.
×
×
  • Create New...

Important Information

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