Jump to content

muddyfish

Members
  • Posts

    33
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    Hi

muddyfish's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. To place blocks in 1.8, I gather that you are meant to use world.setBlockState(pos, state) I already have a BlockPos. Given an ItemStack (that definitely is a block), how would I go about turning it into an IBlockState? I have looked on the recent forum posts as well as some recent tutorials but I am probably missing something here.
  2. I wish to generate a structure in the center of 1 in every x biomes. Would I do this by hooking into the biome generation or is it simpler than that? Also, I cannot find any tutorials for making stronghold/village like structures, any pointers?
  3. How would I go about creating a byte (or any piece of data) of storage per column on the y coordinate (like a biome)? I cannot simply add biomes of different types because say I need 3 bits of extra information, I would require 8 times the amount of biomes to add this. Given that minecraft already has 78ish biomes to start with, doing this is a bad idea. Could I replace bedrock with a custom block that stores this information (The storage gained from metadata would be enough for my purposes) or would this be the wrong approach? Or in general, how do I add more non-block data to the world per column?
  4. Ok, I feel stupid, your code worked but the spawned particles were too small for me to notice
  5. I've taken a look at it, my particle currently looks like @SideOnly(Side.CLIENT) public class ParticleTwilight extends EntityFX { public ParticleTwilight(World par1World, double par2, double par4, double par6, double par10, double par12) { this(par1World, par2, par4, par6, par10, 1.0F); } public ParticleTwilight(World world, double x, double y, double z, double motionY, float scale) { super(world, x, y, z, 0.0D, 0.0D, 0.0D); this.motionX = 0; this.motionZ = 0; this.motionY += motionY; this.setRBGColorF(0,0,0); this.setAlphaF(0.8F); this.setParticleTextureIndex(32); this.particleScale *= scale; this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); this.particleMaxAge = (int)((float)this.particleMaxAge * scale); this.noClip = true; } public void onUpdate() { this.rotationYaw += 0.1; if (this.particleAge++ >= this.particleMaxAge) this.setDead(); this.motionY += 0.05D; this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionY *= 0.95D; } } However when I spawn it, it doesn't render. Firstly, am I doing it all wrong? This is based of the bubble particle but my particle should just be a simple filled colour (maybe with alpha) texture. Do I actually need to bind a texture to OpenGL? Your code seems a little over the top for my purposes. My code just uses the vanilla draw function at the moment, how should I need to change it in order for it to blit a simple black square that can be rotated in 3d?
  6. I don't seem to be able to find a tutorial for how to add custom particles to my mod. Would I have to rewrite EffectRenderer and add my own effects as Forge doesn't seen to support custom textures for it? If I had to do so, how would I make the update loop be called every frame?
  7. If you are transporting a player use if (entity instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP) entity; player.mcServer.getConfigurationManager().transferPlayerToDimension(player, travelDimension, new Teleporter(minecraftServer.worldServerForDimension(player.dimension))); newEntity = player; } instead of the last code I posted and it works nicely. (Got of wuppy's tutorial for teleporters)
  8. When I am moving an entity using entity.posY += 2, the game kicks me with an Illegal Stance. I can not add to entity.motionY because it will always collide with a portal block the next tick and I am trying to push the entity away from it. (Changing entity.prevMotionY doesn't help) Is there any way around this?
  9. I had already done so. I have narrowed it down to this line in my travel function which never returns. If I disconnect from the game then reconnect, I have travelled properly. worldserver1.spawnEntityInWorld(newEntity); (Entire function based on Entity.java's travelToDimension) public void teleportEntityToDimension(World world, Entity entity, int travelDimension) { if (!world.isRemote && !entity.isDead) { world.theProfiler.startSection("changeDimension"); MinecraftServer minecraftserver = MinecraftServer.getServer(); int dimension = entity.dimension; WorldServer worldserver = minecraftserver.worldServerForDimension(dimension); WorldServer worldserver1 = minecraftserver.worldServerForDimension(travelDimension); entity.dimension = travelDimension; world.removeEntity(entity); entity.isDead = false; world.theProfiler.startSection("reposition"); minecraftserver.getConfigurationManager().transferEntityToWorld(entity, dimension, worldserver, worldserver1, new Teleporter(worldserver)); world.theProfiler.endStartSection("reloading"); Entity newEntity = EntityList.createEntityByName(EntityList.getEntityString(entity), worldserver1); if (newEntity != null) { newEntity.copyDataFrom(entity, true); worldserver1.spawnEntityInWorld(newEntity); } entity.isDead = true; world.theProfiler.endSection(); worldserver.resetUpdateEntityTick(); worldserver1.resetUpdateEntityTick(); world.theProfiler.endSection(); } }
  10. When I am teleporting entities to my dimension using "entity.travelToDimension([Dimension ID]);", it always creates a nether portal frame and never teleports to the correct position. Is there another method I can use to achieve the same affect of moving the entity from one dimension to another without the nether portal that takes XYZ coordinates and the dimension id? If not, can you point me in the right direction with coding my own method? UPDATE: I now have a custom teleporter class that extends Teleporter and call it when I am teleporting
  11. Hello, I am making a block that is identical in many ways to a crafting table but with extra recipes. Therefore I am using some of the crafting table parts to create my own custom one. However, when I use it, nothing appears, it just spits out my debug messages saying it has been clicked, it has opened and a GUI is being shown to the client and a container to the server. I expect it to open a crafting GUI and allow me to craft things and when you change any slot it outputs "Change!" but it just carries on. GuiHandler: public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if (id == 0) { log.info("Load Server"); return new ContainerCrafting(player.inventory, world, x, y, z); } return null; } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if (id == 0) { log.info("Load Client"); return new GuiCrafting(player.inventory, world, x, y, z); } return null; } } Main Class NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); GuiCrafting: public class GuiCrafting extends GuiCrafting{ public GuiCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { super(par1InventoryPlayer, par2World, par3, par4, par5); log.info("Loaded GUI!"); } } ContainerCrafting: public class ContainerCrafting extends ContainerWorkbench{ private World worldObj; public ContainerCrafting(InventoryPlayer inventory, World world, int x, int y, int z) { super(inventory, world, x, y, z); worldObj = world; log.info("Loaded Server Container!"); } @Override public void onCraftMatrixChanged(IInventory par1IInventory) { log.info("Change!"); this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } } Output (When block clicked) Load Server Change! Loaded Server Container! Load Client Loaded GUI!
  12. The code for spawning in lightning you gave me only created the fire but not the actual lightning. (Tried in rain and not) As for the explosions, I only want the particles and not effects of one
  13. I have a block that ticks randomly and would like it so it creates lightning and explosions. I have seen several variations of spawn lightning but none of them draw the lightning, only fire appears. Explosions on the other hand, don't happen at all (I only want cosmetic ones) public void updateTick(World world, int x, int y, int z, Random rand) { log.info("Update @ "+x+" "+y+" "+z); if (rand.nextBoolean()) { log.info("Lightning!"); EntityLightningBolt lightning = new EntityLightningBolt(world, x, y+1, z); world.addWeatherEffect(lightning); } else { log.info("Explosion!"); world.spawnParticle("largeexplode", x, y, z, 0.0D, 0.0D, 0.0D); } } The text is being displayed but nothing appears
×
×
  • Create New...

Important Information

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