
MCrafterzz
Members-
Posts
285 -
Joined
-
Last visited
Everything posted by MCrafterzz
-
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
And how can I check if they will teleport? -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
I don't Think I'm sending the packet twice so I don't know what to change -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Yes, my current code: @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { float x = worldIn.getSpawnPoint().getX(); float y = worldIn.getSpawnPoint().getY(); float z = worldIn.getSpawnPoint().getZ(); if (!worldIn.isRemote) { if (entityIn instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP) entityIn; BlockPos spawnPoint = player.getBedLocation(player.worldObj.provider.getDimension()); if (spawnPoint != null) { player.connection.setPlayerLocation(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ(), player.cameraYaw, player.cameraPitch); } else { player.connection.setPlayerLocation(x, y, z, player.cameraYaw, player.cameraPitch); } } else { entityIn.setPosition(x, y, z); } } entityIn.worldObj.playSound((EntityPlayer) null, x, y, z, SoundEvents.ENTITY_ENDERPEARL_THROW, SoundCategory.AMBIENT, 1, 1); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x, y, z, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x + 0.25f, y, z, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x - 0.25f, y, z, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x, y, z + 0.25f, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x, y, z - 0.25f, 0, 7, 0, 0); } -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
I think it's something with the client and the server sides not having the same info -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Yes -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
The spam teleport problem is that it teleports to the spawnpoint every tick. Like a tp command in a repeat commandblock -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
The fix didn't work Crash: http://pastebin.com/RutsX7Jq -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Now I only have the player spam teleport problem -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Fixed -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
public static void registerEnderium() { FluidRegistry.registerFluid(FluidEnderium.instance); GameRegistry.registerBlock(BlockEnderium.instance, "enderium"); ModelLoader.setCustomStateMapper(BlockEnderium.instance, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return new ModelResourceLocation("mm:enderium"); } }); } That is the registry code. I don't register a itemblock but maybe register fluid does? -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Witch problem? 1. Players spam teleport 2. How to prevent /give the fluid block -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Thank you it worked, now I only need to fix the player spam spawning. Also how do make it not possible to use /give to get the enderium block -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
@Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { float x = worldIn.getSpawnPoint().getX(); float y = worldIn.getSpawnPoint().getY(); float z = worldIn.getSpawnPoint().getZ(); if (entityIn instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP) entityIn; BlockPos spawnPoint = player.getBedLocation(player.worldObj.provider.getDimension()); if (spawnPoint != null) { player.connection.setPlayerLocation(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ(), 0, 0); } else { player.connection.setPlayerLocation(x, y, z, 0, 0); } } else { entityIn.setPosition(x, y, z); } } entityIn.worldObj.playSound((EntityPlayer) null, entityIn.posX, entityIn.posY, entityIn.posZ, SoundEvents.ENTITY_ENDERPEARL_THROW, SoundCategory.AMBIENT, 1, 1); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX() + 0.25f, entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ() + 0.25f, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX() - 0.25, entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ() - 0.25f, 0, 7, 0, 0); } Updated code, still have the particle problem. The player teleports but it like spam teleports 1 seconds so it looks like the screen shakes -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
And BlockPos spawnPoint = player.getBedLocation(player.worldObj.provider.getDimension()); is equal to null -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
ok, but I still don't know how to fix that particle problem -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Nothing happends when clicking on them, I'm using edge (the default browser) -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
How do i use spoilers. How do I use emojis, draging them just postes a link. I wil take a look at the code you pasted tomorrow on my computer -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
What do you mean? -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
The only problem is that the particles spawn at the old location even if the entity already have teleported. Don't know how to use the code thing ore emojis http://www.minecraftforge.net/forum/Smileys/default/sad.gif -
[1.10.2] Fluids don't always render correctly
MCrafterzz replied to MCrafterzz's topic in Support & Bug Reports
ok sorry -
You can see it here:
-
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
After (I think): @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { float x = worldIn.getSpawnPoint().getX(); float y = worldIn.getSpawnPoint().getY(); float z = worldIn.getSpawnPoint().getZ(); if (entityIn instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP) entityIn; BlockPos spawnPoint = player.getBedLocation(player.worldObj.provider.getDimension()); player.setPosition(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ()); } else { entityIn.setPosition(x, y, z); } } entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 1, 1); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX() + 0.25f, entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ() + 0.25f, 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX() - 0.25, entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ() - 0.25f, 0, 5, 0, 0); } -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Sorry deiseieben if I didn't understand but it works now. The only problem is that the particles spawn at the old location even if the entity already have teleported -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Thank you Animefan8888! -
[1.10.2][SOLVED] Teleport to the players spawn point
MCrafterzz replied to MCrafterzz's topic in Modder Support
Updated code (that works): @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { float x = worldIn.getSpawnPoint().getX() + 0.5f; float y = worldIn.getSpawnPoint().getY(); float z = worldIn.getSpawnPoint().getZ() + 0.5f; entityIn.setPosition(x, y, z); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 10, 0, 0); } } But the particles doesn't spawn :c