Everything posted by Izzy Axel
-
[1.7.10] Teleporting from Nether to Overworld
Ok I can't figure this out, there's a couple problems here, most related to the thread topic: the teleportation works, but it spawns me inside the Nether portal closest to the bed, it seems. Next, if the player has 2 of the items that trigger this whole event, it takes both of them out of your inventory, and if the player lags on the teleportation, it takes more; I got it to take up to 8 out of the player's inventory in testing. Inventory Watcher Packet IEEP
-
[1.7.10] Teleporting from Nether to Overworld
How do you teleport the player from the Nether to Overworld without forming a portal? Entity#travelToDimension and by association ServerConfigurationManager#transferEntityToWorld use Teleporter#placeinPortal, and I'm not sure how to get a valid reference to EntityPlayerMP for ServerConfigurationManager#transferPlayerToDimension.
-
[1.7.10] TESR/OpenGL Transparency Sorting Issues
Yeah, turning off the depthMask didn't really help, it seems to be an issue with newly placed models being viewed through models that were already placed. The last part sounds like something the MC rendering engine is doing, and I can't touch it without something like an AT? (and that sounds like a very bad idea)
-
[1.7.10] TESR/OpenGL Transparency Sorting Issues
How do you properly implement transparency within a TESR with OGL? When transparent things are viewed through the glass portion of my model without the liquid in it, it's just fine, but when the liquid is put in, viewing the liquid filled model through the glass of another copy of this model does this: https://dl.dropboxusercontent.com/u/10036065/2015-08-19_16.13.48.png[/img]https://dl.dropboxusercontent.com/u/10036065/2015-08-19_16.13.36.png[/img] It seems that relogging fixes this for an unknown reason, however viewing an empty model through a filled model then doesn't sort properly, it's very strange. L107'>TESR (The order of rendering is at the very bottom, in 'renderTileEntityAt')
-
[1.7.10] [SOLVED] Access right-click action of item
Sounds like you need to switch the return in Item#getItemUseAction based on the NBT too, though I'm not sure that'll work right... Edit: Wait, that's another thing, you can't have a class variable changing the item, you have to put that in NBT, as it is now, if one player switches their tool, everyone's will switch.
-
[1.8] [SOLVED] Spawning Particle Trail Along a Vector
That's what I was saying, while the spell is in use, get the player's lookvec, multiply it by a finely stepped number that's above 1, and you have near infinite control over how small the spacing between the particles is, that's how you extend a normalized vector's magnitude. The more decimal places, the smaller the individual step will be. Edit: didn't see the last bit, you would do something like: (pseudocode) Vec3 lookVec = player.getLookVec(); for(float i = blahblahblah) { world.spawnParticles(EnumParticleTypes.FLAME, player.posX + (lookVec.xCoord * i), player.posY + (lookVec.yCoord * i), player.posZ + (lookVec.zCoord * i), 0, 0, 0); }
-
[1.8] [SOLVED] Spawning Particle Trail Along a Vector
Sounds like you want to get the player's look vec, and multiply it by i to get various points along it? I did a similar fire jet effect with my mod's Blaze Staff, but I had it do a for loop that added (rand.nextInt(3) - 1) * rand.nextFloat() to each coordinate, which of course generated a new random number each loop through, making a more organic looking, less perfect stream of fire particles. I also threw in random rotations, just for good measure.
-
[1.7.10][SOLVED] Tick Handler Not Working in SSP
I created a tick handler to reset some reflection I do when the armor that performs it is removed. It all works fine in SMP as expected, but in SSP, it's never called. How would I make the server tick handler work properly in SSP? I also tried a client tick handler, but it did nothing. (wasn't really expecting it to) If the server tick event can never be called on SSP, how else would I go about doing this? Server Tick Handler Client Tick Handler
-
[1.7.10][SOLVED] Get Respawn Location (Bed)
I had to remove the verify section, with it in it was spawning me ~1000 blocks from the bed, but after I did that, everything worked great.
-
[1.7.10][SOLVED] Get Respawn Location (Bed)
I've been looking through the vanilla code, but I'm not finding how you get the respawn location. Or if it's easier, how would you use the vanilla respawn system to place the player upon re-entering the overworld from a custom dimension? (doing this inside my dimension's Teleporter class) I couldn't find where this is done on exiting the credits screen in the vanilla code.
-
[1.7.10] Packet onMessage Null Pointer Exception
Ok I got it working on server, but the effect is very jerky and you drop out of the AoE quickly, not at all what I wanted for the pushers, they're supposed to keep you on the same Y level the entire time by setting the player's motionY to 0 every tick, and of course all of them need to have smooth motion. Main Packet H Pusher Block H Pusher TE
-
[1.7.10] Packet onMessage Null Pointer Exception
Yep, and it's got the correct values. Edit: It also does affect animals, but EntityItems jump around, like the client is only syncing once every 5 seconds. It's only players that have the full sync issue.
-
[1.7.10] Packet onMessage Null Pointer Exception
Ok, well what's wrong with how I'm doing it now? Also wrapping the contents of onBlockActivated with !isRemote makes it not push anyone, but the particles show up and it turns on and off properly. Horizontal Pusher Block public class BlockGravityEngineHP extends BlockContainer { public BlockGravityEngineHP() { super(Material.piston); this.setBlockName("gravityEngineHP"); this.setStepSound(Block.soundTypePiston); this.setHardness(1.0F); this.setResistance(5.0F); this.setBlockTextureName(Reference.MODID + ":" + getUnlocalizedName().substring(5)); this.setHarvestLevel("pickaxe", 1); } @Override public TileEntity createNewTileEntity(World world, int id) { return new TEGravityEngineHP(); } @Override public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { world.setBlockToAir(x, y, z); world.removeTileEntity(x, y, z); onBlockDestroyedByExplosion(world, x, y, z, explosion); } @Override public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) { world.setBlockToAir(x, y, z); world.removeTileEntity(x, y, z); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if(!world.isRemote) { TEGravityEngineHP grav = (TEGravityEngineHP)world.getTileEntity(x, y, z); if(!player.isSneaking()) { grav.switchSides(side); return true; } else { switch(side) { case 2: grav.switchSides(3); break; case 3: grav.switchSides(2); break; case 4: grav.switchSides(5); break; case 5: grav.switchSides(4); break; default: break; } return true; } } return false; } } Horizontal Pusher TE public class TEGravityEngineHP extends TileEntity { int side = 0; boolean on = false; public TEGravityEngineHP() { super(); } public void setOn(int side) { switch(side) { case 0: switchSides(0); break; case 1: switchSides(1); break; } } public void switchSides(int sideHit) { switch(sideHit) { case 0: on = !on; if(worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockGravityEngineHP) { ((TEGravityEngineHP)worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord)).setOn(0); } break; case 1: on = !on; if(worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockGravityEngineHP) { ((TEGravityEngineHP)worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord)).setOn(1); } break; case 2: side = 2; break; case 3: side = 0; break; case 4: side = 1; break; case 5: side = 3; break; default: break; } } @Override public void updateEntity() { if(on) { byte xB = 0; byte zB = 0; switch(side) { case 0: zB = 1; break; case 1: xB = -1; break; case 2: zB = -1; break; case 3: xB = 1; break; default: break; } if(!worldObj.isRemote) { Random rand = this.worldObj.rand; double mult = 0.0305610; double timeX = xB * (mult * gravityEngineHRange); double timeZ = zB * (mult * gravityEngineHRange); double x = this.xCoord + 0.5 + (zB * (((rand.nextInt(3) - 1) * rand.nextFloat()) / 2)); double y = this.yCoord - 1.0 + (((rand.nextInt(3) - 1) * rand.nextFloat()) / 2); double z = this.zCoord + 0.5 + (xB * (((rand.nextInt(3) - 1) * rand.nextFloat()) / 2)); if(rand.nextInt(100) % 2 == 0) { ArcaneArtificing.snw.sendToAllAround(new MessageDoParticles(Reference.LightChargeFX, x, y, z, timeX, 0, timeZ, 5, 50), new NetworkRegistry.TargetPoint(this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 256)); } } float minX = xB == -1 ? gravityEngineHRange : 0; float minZ = zB == -1 ? gravityEngineHRange : 0; float maxX = xB == 1 ? gravityEngineHRange : 1; float maxZ = zB == 1 ? gravityEngineHRange : 1; List<Entity> entities = this.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(this.xCoord - minX, this.yCoord, this.zCoord - minZ, this.xCoord + maxX, this.yCoord + 1, this.zCoord + maxZ)); for(Entity ent : entities) { double motx = 0, moty = 0, motz = 0; if(xB != 0) motx = xB == -1 ? -0.4 : 0.4; if(zB != 0) motz = zB == -1 ? -0.4 : 0.4; ent.motionX = motx; ent.motionZ = motz; ent.motionY = moty; } } } @Override public boolean canUpdate() { return true; } @Override public void readFromNBT(NBTTagCompound tag) { super.readFromNBT(tag); side = tag.getInteger("Side"); on = tag.getBoolean("On"); } @Override public void writeToNBT(NBTTagCompound tag) { super.writeToNBT(tag); tag.setInteger("Side", side); tag.setBoolean("On", on); } @Override public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); tag.setInteger("Side", side); tag.setBoolean("On", on); this.writeToNBT(tag); return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), tag); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { this.readFromNBT(packet.func_148857_g()); } }
-
[1.7.10] Packet onMessage Null Pointer Exception
Ok I just realized something from further testing. How do you sync tile entities between the server and all clients? The same thing happens with all 3 tile entities, when the block is turned on by one player it works for them, but it needs to be interfaced with by the other players to affect them, for instance one of the blocks pushes players on a horizontal axis, you right click on a side to change the output to that side and right click on the top or bottom to turn it on/off, so when one player places it down and turns it on while a second player is inside the area of effect, it's turned on for player 1, and affects them, but off for player 2, and doesn't affect them, despite showing the "on" particles for both. If player 2 right clicks the top, it'll turn on the effect for them, but the particles will turn off for everybody. So it is client-server desync, but not the way I thought it was originally.
-
[1.7.10] Packet onMessage Null Pointer Exception
When I tried placing some of the blocks that push players in my test server, the other players were not getting pushed by them, but I was, they had to relog to have the block/TE affect them. I assumed this was due to client-server syncing issues, so I tried to have the tile entity send a packet to the server and move the player from there, which is where the NPE occurred.
-
[1.7.10] Packet onMessage Null Pointer Exception
How else would I tell it which players to move? The reason I'm trying to send this packet is because in SMP, only the person who placed the block is affected by it until the other players relog. The same thing happens with the TESR rendering and lighting updates from two of my other tile entities, I'm tackling this one first because it's the one I knew how to handle.
-
[1.7.10] Packet onMessage Null Pointer Exception
So, how would I get a valid ID? I just tried changing the list to EntityPlayer, moved getting the ID to outside the isRemote check, and iterating through all loaded entities and comparing the sent ID to each one, but it's always invalid.
-
[1.7.10]Where is the difference ?
As far as I know there's no reason to split the instantiation and assignment unless you're getting the value to be assigned to the variable from the constructor, but it's likely considered to just be different coding styles.
-
[1.7.10] Packet onMessage Null Pointer Exception
bump
-
[1.7.10] Packet onMessage Null Pointer Exception
So I have several tile entities that push players around and affect their motion in general, and through testing I found that they would not affect anyone but the person who placed the block on a server, so I made a new packet and had it perform the movement alteration in the onMessage. The problem is, when a player touches the AOE, it crashes on a NPE in the packet's onMessage, specifically on the first line of setting the entities' motion, and as far as I can see, this shouldn't happen, so I'm just confused here. [14:50:51] [server thread/ERROR] [FML]: There was a critical exception handling a packet on channel arcaneartificing java.lang.NullPointerException at izzyaxel.arcaneartificing.main.messages.MessageMovePlayers$MovePlayerHandler.onMessage(MessageMovePlayers.java:54) ~[MessageMovePlayers$MovePlayerHandler.class:?] at izzyaxel.arcaneartificing.main.messages.MessageMovePlayers$MovePlayerHandler.onMessage(MessageMovePlayers.java:47) ~[MessageMovePlayers$MovePlayerHandler.class:?] at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:37) ~[simpleChannelHandlerWrapper.class:?] at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:17) ~[simpleChannelHandlerWrapper.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?] at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?] Main Packet TE Pusher 1 TE Pusher 2 TE Float 1 TE Float 2 PS, how would I do packets to update clients for lighting changes, and to see rendering being done in a TESR?
-
[1.7.10][SOLVED] Black Particles
32x32 In that case I should probably make it render from the dummy tile entity so it doesn't disappear until it gets offscreen entirely. I'm using Forge's AdvancedModelLoader to load an OBJ; I haven't looked into it yet so I don't know if it's rendering it with vanilla methods or what. I do the particles inside the the TileEntity class, yes, but they don't disappear with the TE when you look up too far.
-
[1.7.10][SOLVED] Black Particles
No offset, never has been even with stationary particles. There is one more weird caveat with this setup, but its with the model, all models actually, when you look up and the model gets to a certain point off the bottom of the screen, it just vanishes altogether. Same thing that happens to the End Portal, I doubt there's an easy way to fix it.
-
[1.7.10][SOLVED] Black Particles
EntityFX Renderer Standard/white/colored particles alpha map: Black particles alpha map: (I want to knock the white out instead of the black, but doing this seems to "infect" the standard alpha maps (that are being rendered at the same time) with the blendfunc used to accomplish this inverted additive blending) It keeps switching between these as the particles spawn: Hole Puncher - Episode 1 Hole Puncher - Episode 2 Edit: ...wait I know what's happening, it's the local variable for whether the particle is black or not. I'll have to make a separate particle for the black ones. I always get so focused on a problem that the simplest things elude me.
-
[1.7.10][SOLVED] Black Particles
I assume you mean Tessellator#setBrightness, which makes the particles more transparent, and does nothing else for some reason.
-
[1.7.10][SOLVED] Black Particles
@draco Either coloring a white particle black or inverting the knockout GL performs with additive blending so it knocks out white instead of black, so I'm left with a black image instead of a white one. ZERO ZERO results in the black particles being solid black squares instead of knocking out the white properly, while the normal particles are colored squares with a hole knocked out in the middle, still.
IPS spam blocked by CleanTalk.