Jump to content

MSpace-Dev

Members
  • Posts

    180
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MSpace-Dev

  1. By any chance, did you install the 32bit version of Java? If so, get the 64bit, as that one supports the allocation of more RAM. That process mostly fails if you don't have enough RAM allocated. (32bit supports max of about +-1G of RAM only)
  2. Hey everyone, So, all I need to do is add a potion effect to a player. I've managed to get the player object already, so I have access to that. I'm just not quite sure how to use addPotionEffect correctly. I've been trying many variations to get it to atleast accept it. But yeah, here is a very small part of my code. I've seen around the internet that they go Potion.getPotionByID(), or was it PotionEffect.getPotionByID()? Either way, it doesn't seem to be supported here. for (EntityPlayer player : list) { player.addPotionEffect(); // Add effect here } Thanks!
  3. Yeah, I was thinking about using Ore Dict. still not sure if I want to or not. Thanks.
  4. Hey everyone, Basically, all I want to do is check that he block that I am looking at is any type of log. Right now, only he normal Oak Log and Acacia Log works, which makes sense... of course. I just have no idea how I can compare this block to the rest of the other logs. (Birch, spruce, jungle, etc...) if(worldIn.getBlockState(pos) == Blocks.LOG.getDefaultState() || worldIn.getBlockState(pos) == Blocks.LOG2.getDefaultState()) Thanks!
  5. Ah, awesome! Registered now. Thanks for letting me know about this 'resource'
  6. Never knew that was possible! Where did you type that and how do I get access to the bot? I tried to join the channels, but I just get sent a link that goes to an 'Untitled' page that does nothing irc://irc.esper.net/mcpbot
  7. Looking through your crash log, I really don't see anything wrong with it. It may be the launcher that you're using. The only error there was to do with your resource pack, but I suspected removing it would not solve the issue. Try use another launcher.
  8. It may be your resource pack that you have installed. Try removing it, and see what happens.
  9. Hey everyone, So, I need to make my custom particles be 'transparent' to get around the weird rendering that that happens when they cross over eachother. BEFORE I upgraded to mcp_stable_32, there was a method in Particle, called isTransparent() which solved his problem when you returned true. I've looked through the Particle code, and cannot find any equivalent. So, the question is... does anyone else know the new way of setting isTransparent()? Thanks!
  10. Yeah, I know that already. Hang on... An idea just popped into my head. Let me see if it'll work out.
  11. It seemed like a new topic that should have a question for it. I view it as more of a resource for when people search problems on Google. I really don't mind sticking to one thread if need be. I thought it'd be more useful to ask questions like this on new threads. What do you think?
  12. Hey everyone, All I want to do is get the size of the texture-atlas that Minecraft creates at runtime, after everything has been stitched together. I'm sure the value can be accessed somewhere as when the game loads, you get a message similar to this: [04:45:18] [Client thread/INFO]: Created: 1024x1024 textures-atlas Thanks!
  13. Well, if I set the Max, min UV to 0 and 1, the particle turns into the entire MC atlas, right. So, using the minU, and minV values, and using the full size of Minecraft's texture atlas, I will be able to set the appropriate UV percentage values for my particle.
  14. @diesieben07 Anyway I can get the size of the entire Minecraft atlas that is created at runtime? I need this value to work out the UV coords of my texture.
  15. Oh, is that what you mean. Alright, thanks. Gonna get cracking on then.
  16. I have found buffer.tex(double u, double v), except when I call that method in renderParticle, nothing changes. I have looked through the Minecraft Particle classes to see if they've set UVs anywhere, couldn't find anything similar, heck, some of them don't even have a renderParticle method in them. So I'm guessing their UV is set somewhere else all together. Can't find anything close to buffer.tex(u, v). @Override public void renderParticle(VertexBuffer buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { buffer.tex(8, 8); super.renderParticle(buffer, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); }
  17. I have created a custom particle using textures from a 128x128 PNG file. Basically, exactly like Vanilla MC does. The reason I want to do this is because I don't want to register new particle textures for each particle I want to add. So, all I want to do is set the UV that the particle uses for its texture. public class ModParticle extends Particle { public ModParticle(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) { super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); this.particleRed = 1; this.particleGreen = 1; this.particleBlue = 1; this.particleMaxAge = 100; this.setParticleTexture(RegistryEventHandler.textureAtlasSprite); } @Override public int getFXLayer() { return 1; } } Thanks!
  18. Oh, Hmm, I saw another thread where a guy extended one of the particle classes. Anways, it seems to be working perfectly now. Haha, was so close =p One more question, how do I select what UV the particle uses as the texture? I have a 128x128 image, like MC does, and I want to select the top most 8x8 pixels as this particle's texture. Couldn't find a 'setUV()' type method in Particle.
  19. Hey everyone, So, for the passed hour or so, I've been trying to make a custom particle. I feel like I am on the absolute brink of getting it to work, after 100s upon 100s of crashes later! And boy... I have no clue where to go from here. So, let me right a numbered list of what's happening, and what is calling what. "Chain of events": ModBlock calls genMagicParticle() method in Common Proxy Class Client Proxy Class overrides Common Proxy Class' - genMagicParticle() method genMagicParticle() method creates a new instance of a ParticleMagic object, which extends ParticleCloud Also adds this new ParticleMagic instance to the effectRenderer --- Minecraft.getMinecraft().effectRenderer.addEffect() ParticleMagic sets particle colours through particleRed, particleGreen, particleBlue and sets particleMaxAge TextureStitchEvent.Pre gets a texture map and registers a new sprite pointing to my mod's particle PNG sheet ParticleMagic returns 1 in getFXLayer() ParticleMagic sets the particle texture (setParticleTexture()) to the registered sprite using the TextureStitchEvent.Pre. And that's about everything. Here is the relevant code from each class: InfusedLog ("ModBlock"): public class BlockInfusedLog extends BlockWoodBase implements ITileEntityProvider { @SideOnly(Side.CLIENT) @Override public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { MonsterTotems.proxy.genMagicParticle(this, pos); super.randomDisplayTick(stateIn, worldIn, pos, rand); } } Common Proxy: public class CommonProxy { public void genMagicParticle(Block block, BlockPos pos) { } } Client Proxy: public class ClientProxy extends CommonProxy { @Override public void genMagicParticle(Block block, BlockPos pos) { World world = Minecraft.getMinecraft().world; double rand = world.rand.nextDouble(); double d1 = pos.getX() + rand; double d2 = pos.getY() + 1; double d3 = pos.getZ() + rand; ParticleMagic particleMagic = new ParticleMagic(world, d1, d2, d3, rand * 0.4D, 0.7D, rand * 0.4D); Minecraft.getMinecraft().effectRenderer.addEffect(particleMagic); } } RegistryEventHandler: @Mod.EventBusSubscriber public class RegistryEventHandler { public static TextureAtlasSprite textureAtlasSprite; @SubscribeEvent public static void registerParticleMap(TextureStitchEvent.Pre event) { TextureMap map = event.getMap(); textureAtlasSprite = map.registerSprite(new ResourceLocation(Reference.MODID, "particle/particles")); // Points to 'monstertotems:textures/particle/particles.png' } } ParticleMagic: public class ParticleMagic extends ParticleCloud { public ParticleMagic(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) { super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); this.particleRed = 1; this.particleGreen = 0; this.particleBlue = 1; this.particleMaxAge = 1000000; this.setParticleTexture(RegistryEventHandler.textureAtlasSprite); } @Override public int getFXLayer() { return 1; } } Phew... that should be everything. Oh, one more thing, here is the crash report. Crash Report: Thanks!
  20. Oh, I was wondering where the position got set. Makes sense now.
  21. Hey everyone, I have a class that extends MovingSound, which allows it to be a loopable sound. (Minecarts use it) So, in my class, I have got the sound working, playing, and stopping when I want it to. Only problem is... I HAVE TO set the volume over 100.0f to actually hear it. Of course, the problem with this is that you can hear the sound pretty much everywhere when this extreme volume value is set. I want to be able to set my sound volume to a value like 0.5f, or even 1.0f, which should be the absolute default. Really not sure why this is happening... MovingSound class: public class MovingSoundInfusedLog extends MovingSound{ private TileEntityInfusedLog infused_log; public MovingSoundInfusedLog(TileEntityInfusedLog infusedLogIn) { super(RegistryEventHandler.infused_log_ambient, SoundCategory.BLOCKS); this.infused_log = infusedLogIn; this.repeat = true; this.repeatDelay = 0; this.volume = 100.0F; // HAS TO BE 100.0F+ // Anything under is unhearable. } @Override public void update() { if(infused_log.getWorld().getTileEntity(infused_log.getPos()) != infused_log) { this.donePlaying = true; } } }
  22. Alright, now I've got a really weird problem. I can only hear the sound when the VOLUME is 100.0f+! Anything under 100 does not play.
  23. Oh, got it working. Never realized this. Just had to set the VOLUME. It was actually playing all along. public class MovingSoundInfusedLog extends MovingSound{ private TileEntityInfusedLog infused_log; public MovingSoundInfusedLog(TileEntityInfusedLog infusedLogIn) { super(RegistryEventHandler.infused_log_ambient, SoundCategory.BLOCKS); this.infused_log = infusedLogIn; this.repeat = true; this.repeatDelay = 0; this.volume = 1000.0F; Utils.getLogger().info("Infused Log In: " + infusedLogIn); } @Override public void update() { if(infused_log.isInvalid()) { this.donePlaying = true; } } }
  24. I looked at the code in WorldClient. I tried to replicate it, which is how I got to where I am. if (entityIn instanceof EntityMinecart) { this.mc.getSoundHandler().playSound(new MovingSoundMinecart((EntityMinecart)entityIn)); }
  25. I have a Tile Entity that calls the playSound method in my class, MovingSoundInfusedLog, which extends 'MovingSound'. My sound works fine when just playing it normally, using world.playSound. MovingSoundInfusedLog (extends MovingSound) public class MovingSoundInfusedLog extends MovingSound{ TileEntityInfusedLog infused_log; public MovingSoundInfusedLog(TileEntityInfusedLog infusedLogIn) { super(RegistryEventHandler.infused_log_ambient, SoundCategory.BLOCKS); this.infused_log = infusedLogIn; this.repeat = true; this.repeatDelay = 0; } @Override public void update() { } } Tile Entity Infused Log: public class TileEntityInfusedLog extends TileEntity { private int carveAmount = 0; public TileEntityInfusedLog() { Minecraft.getMinecraft().getSoundHandler().playSound(new MovingSoundInfusedLog(this)); } } I get the output: [14:15:55] [Client thread/INFO]: Infused Log In: io.github.mspacedev.tiles.TileEntityInfusedLog@586c85e8 [14:15:55] [Server thread/INFO]: Infused Log In: io.github.mspacedev.tiles.TileEntityInfusedLog@74326d4b Meaning, the MovingSoundInfusedLog code is running. So yeah, I get the output, but no sound playing when I "place down" the Tile Entity.
×
×
  • Create New...

Important Information

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