• Custome recipe and custom smelting

    Résolu 1.10.x
    2
    0 Votes
    2 Messages
    807 Vues
    D
    Probleme résolu  Cordialement,
  • Erreur fixMcSources

    Résolu 1.10.x
    6
    0 Votes
    6 Messages
    1k Vues
    A
    C’est bon le problème est réglé, merci
  • Probleme Crash Report

    Résolu 1.10.x
    8
    0 Votes
    8 Messages
    993 Vues
    robin4002R
    Selon le rapport de crash, non, elle n’existe pas. Essaies de clean le projet pour qu’eclipse compile à nouveau tout.
  • Problème d'affichage de packets

    Résolu 1.10.x
    3
    0 Votes
    3 Messages
    832 Vues
    Z
    Merci beaucoup ça fonctionne 
  • RenderTntPrimed Affichage Du Nom Qui Affiche Un Â

    Résolu 1.9.4
    3
    0 Votes
    3 Messages
    863 Vues
    F
    @‘robin4002’: Salut, Pour forcer l’utf8 lors de la compilation (à mettre dans le fichier build.gradle, en dessous de archiveBaseName) : compileJava.options.encoding = ‘UTF-8’ A d’accord, je comprends mieux Merci de me l’avoir signalé !
  • Tnt A Plusieurs Nom

    Résolu 1.9.4
    16
    0 Votes
    16 Messages
    2k Vues
    robin4002R
    Tu peux utiliser ta méthode pour faire ça.
  • Affichage de capabilities

    Résolu 1.10.x
    29
    0 Votes
    29 Messages
    4k Vues
    Jerem_TechJ
    J’ai rien dit en redémarrant le jeu ça fonctionne Donc je peut enfin passer ce sujet en résolu ! Mille merci !
  • Erreur Gradlew

    Résolu 1.9.4
    6
    0 Votes
    6 Messages
    1k Vues
    F
    // For those who want the bleeding edge buildscript { repositories { jcenter() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' /* // for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ version = "1.0" group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "modid" minecraft { version = "1.9.4-12.17.0.2051" runDir = "run" // the mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD snapshot are built nightly. // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not allways work. // simply re-run your setup task after changing the mappings to update your workspace. mappings = "snapshot_20160518" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, // except that these dependencies get remapped to your current MCP mappings //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // for more info… // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } la commande gradlew task --refresh-dependencies ne change rien je ressaye demain .
  • Erreur package 1.9.4

    Résolu 1.9.4
    23
    0 Votes
    23 Messages
    4k Vues
    robin4002R
    Tu obtiens le jar du mod dans le dossier build/libs
  • Régler le taux de spawn des mobs

    Résolu 1.10.x
    4
    0 Votes
    4 Messages
    3k Vues
    robin4002R
    (penses à utiliser la balise java au lieu de la balise code pour du code java afin d’avoir les couleurs).
  • Plusieurs texture pour UNE entité.

    Résolu 1.10.x
    37
    0 Votes
    37 Messages
    5k Vues
    robin4002R
    C’est comme ça qu’on progresse ^^
  • Probleme: Equiper son mob d'une épée.

    Résolu 1.10.x
    6
    0 Votes
    6 Messages
    895 Vues
    DeletedD
    N’oublie pas de sélectionner la réponse qui t’as le + aidée !
  • Ce sujet a été supprimé !

    Résolu
    12
    0 Votes
    12 Messages
    289 Vues
  • Catégorie KeyBind

    Résolu 1.9.4
    11
    0 Votes
    11 Messages
    2k Vues
    Yanis_Y
    Génial n’oublie pas de sélectionné la meilleur réponse et de mettre le post en résolu !
  • Passer un mod de la 1.7.10 vers la 1.10.2

    Résolu
    2
    0 Votes
    2 Messages
    527 Vues
    DeletedD
    Salut, oui à condition de corriger les nouvelles erreurs et de s’adapter aux .json
  • Ce sujet a été supprimé !

    Résolu
    12
    0 Votes
    12 Messages
    363 Vues
  • J'ai besoin d'aide pour faire une probabilité de coffre

    Résolu 1.10.x
    6
    0 Votes
    6 Messages
    1k Vues
    F
    Bons j’ai fini par arriver a le faire j’ai pas vue la combinaison avec une division et un compteur public ActionResult <itemstack>onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { int compteur = 0; // if(!worldIn.isRemote) { for (int i = 0; i < worldIn.loadedTileEntityList.size(); i++) { TileEntity tile = worldIn.loadedTileEntityList.get(i); if ((tile instanceof TileEntityChest) || tile instanceof TileEntityEnderChest ) { if (worldIn.loadedTileEntityList.get(i).getPos().getX() < playerIn.getPosition().getX() + 36 && worldIn.loadedTileEntityList.get(i).getPos().getX() > playerIn.getPosition().getX() - 36 && worldIn.loadedTileEntityList.get(i).getPos().getY() < playerIn.getPosition().getY() + 36 && worldIn.loadedTileEntityList.get(i).getPos().getY() > playerIn.getPosition().getY() - 36 && worldIn.loadedTileEntityList.get(i).getPos().getZ() < playerIn.getPosition().getZ() + 36 && worldIn.loadedTileEntityList.get(i).getPos().getZ() > playerIn.getPosition().getZ() - 36) { compteur++; } } else if ((tile instanceof TileEntityEnderChest)) { if (worldIn.loadedTileEntityList.get(i).getPos().getX() < playerIn.getPosition().getX() + 36 && worldIn.loadedTileEntityList.get(i).getPos().getX() > playerIn.getPosition().getX() - 36 && worldIn.loadedTileEntityList.get(i).getPos().getY() < playerIn.getPosition().getY() + 36 && worldIn.loadedTileEntityList.get(i).getPos().getY() > playerIn.getPosition().getY() - 36 && worldIn.loadedTileEntityList.get(i).getPos().getZ() < playerIn.getPosition().getZ() + 36 && worldIn.loadedTileEntityList.get(i).getPos().getZ() > playerIn.getPosition().getZ() - 36) { compteur++; } } else if ((tile instanceof TileEntityRCF)) { if (worldIn.loadedTileEntityList.get(i).getPos().getX() < playerIn.getPosition().getX() + 36 && worldIn.loadedTileEntityList.get(i).getPos().getX() > playerIn.getPosition().getX() - 36 && worldIn.loadedTileEntityList.get(i).getPos().getY() < playerIn.getPosition().getY() + 36 && worldIn.loadedTileEntityList.get(i).getPos().getY() > playerIn.getPosition().getY() - 36 && worldIn.loadedTileEntityList.get(i).getPos().getZ() < playerIn.getPosition().getZ() + 36 && worldIn.loadedTileEntityList.get(i).getPos().getZ() > playerIn.getPosition().getZ() - 36) { // int valeur = ((TileEntityRCF) tile).getNumber(); tile = worldIn.getTileEntity(tile.getPos()); System.out.println("Valeur : " + ((TileEntityRCF) tile).getNumber()); compteur -= ((TileEntityRCF) tile).getNumber(); } } } // } // Minecraft.getMinecraft().renderEngine.bindTexture(new // ResourceLocation(Main.MODID,"textures/gui/chestbutin.png")); // Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect((int)playerIn.posX // + (-193), (int)playerIn.posY + (-115), 0, 0, 256, 256); if (compteur < 0) compteur = 0; Minecraft.getMinecraft().ingameGUI.displayTitle("Coffre : " + compteur+"%", "",-293, -215,256); return new ActionResult(EnumActionResult.SUCCESS, new ItemStack(this)); } } ```</itemstack>
  • Encore un problème de mise à jour de ma dimension

    Résolu 1.10.x
    6
    0 Votes
    6 Messages
    1k Vues
    AxaurusA
    Salut J’ai trouvé d’où vient le problème. Ce n’est pas la dimension (peut-être avant mais plus maintenant), c’est mon blockPortal. J’ai essayé de me transférer vers le nether en utilisant le teleporter de base, ça fait pareil. Du coup, voillà mon blockPortail : package thisishalloween.block; import java.util.Random; import javax.annotation.Nullable; import com.google.common.cache.LoadingCache; import net.minecraft.block.Block; import net.minecraft.block.BlockBreakable; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockWorldState; import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.pattern.BlockPattern; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemMonsterPlacer; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.Rotation; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.world.IBlockAccess; import net.minecraft.world.Teleporter; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.fml.common.ObfuscationReflectionHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import thisishalloween.CreateBlocks; import thisishalloween.ThisisHalloween; import thisishalloween.world.frightful.TeleporterFrightful; public class BlockPortalFrightful extends BlockBreakable { public static final PropertyEnum <enumfacing.axis>AXIS = PropertyEnum.<enumfacing.axis>create("axis", EnumFacing.Axis.class, new EnumFacing.Axis[] {EnumFacing.Axis.X, EnumFacing.Axis.Z});    protected static final AxisAlignedBB field_185683_b = new AxisAlignedBB(0.0D, 0.0D, 0.375D, 1.0D, 1.0D, 0.625D);    protected static final AxisAlignedBB field_185684_c = new AxisAlignedBB(0.375D, 0.0D, 0.0D, 0.625D, 1.0D, 1.0D);    protected static final AxisAlignedBB field_185685_d = new AxisAlignedBB(0.375D, 0.0D, 0.375D, 0.625D, 1.0D, 0.625D); public BlockPortalFrightful() { super(Material.PORTAL, false); this.setDefaultState(this.blockState.getBaseState().withProperty(AXIS, EnumFacing.Axis.X)); this.setTickRandomly(true); this.setSoundType(SoundType.GLASS); } //TODO    public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)    {        super.updateTick(worldIn, pos, state, rand);        if (worldIn.provider.isSurfaceWorld() && worldIn.getGameRules().getBoolean("doMobSpawning") && rand.nextInt(2000) < worldIn.getDifficulty().getDifficultyId())        {            int i = pos.getY();            BlockPos blockpos;            for (blockpos = pos; !worldIn.getBlockState(blockpos).isFullyOpaque() && blockpos.getY() > 0; blockpos = blockpos.down())            {                ;            }            if (i > 0 && !worldIn.getBlockState(blockpos.up()).isNormalCube())            {                Entity entity = ItemMonsterPlacer.spawnCreature(worldIn, EntityList.getEntityStringFromClass(EntityPigZombie.class), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 1.1D, (double)blockpos.getZ() + 0.5D);                if (entity != null)                {                    entity.timeUntilPortal = entity.getPortalCooldown();                }            }        }    }    @Nullable    public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos)    {        return NULL_AABB;    }    public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)    {        switch ((EnumFacing.Axis)state.getValue(AXIS))        {            case X:                return field_185683_b;            case Y:            default:                return field_185685_d;            case Z:                return field_185684_c;        }    } public static int getMetaForAxis(EnumFacing.Axis axis) { return axis == EnumFacing.Axis.X ? 1 : (axis == EnumFacing.Axis.Z ? 2 : 0); } public boolean isFullCube(IBlockState state) { return false; }    public boolean trySpawnPortal(World worldIn, BlockPos pos)    {        BlockPortalFrightful.Size blockportal$size = new BlockPortalFrightful.Size(worldIn, pos, EnumFacing.Axis.X);        if (blockportal$size.isValid() && blockportal$size.portalBlockCount == 0)        {            blockportal$size.placePortalBlocks();            return true;        }        else        {         BlockPortalFrightful.Size blockportal$size1 = new BlockPortalFrightful.Size(worldIn, pos, EnumFacing.Axis.Z);            if (blockportal$size1.isValid() && blockportal$size1.portalBlockCount == 0)            {                blockportal$size1.placePortalBlocks();                return true;            }            else            {                return false;            }        }    } public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) { EnumFacing.Axis axis = (EnumFacing.Axis)state.getValue(AXIS); if (axis == EnumFacing.Axis.X) { BlockPortalFrightful.Size size = new BlockPortalFrightful.Size(worldIn, pos, EnumFacing.Axis.X); if (!size.isValid() || size.portalBlockCount < size.width * size.height) { if(ThisisHalloween.portal) { worldIn.setBlockState(pos, Blocks.AIR.getDefaultState()); } } } else if (axis == EnumFacing.Axis.Z) { BlockPortalFrightful.Size size = new BlockPortalFrightful.Size(worldIn, pos, EnumFacing.Axis.Z); if (!size.isValid() || size.portalBlockCount < size.width * size.height) { if(ThisisHalloween.portal) { worldIn.setBlockState(pos, Blocks.AIR.getDefaultState()); } } } } @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { EnumFacing.Axis axis = null; pos = pos.offset(side); if (blockState.getBlock() == this) { axis = (EnumFacing.Axis)blockState.getValue(AXIS); if (axis == null) { return false; } if (axis == EnumFacing.Axis.Z && side != EnumFacing.EAST && side != EnumFacing.WEST) { return false; } if (axis == EnumFacing.Axis.X && side != EnumFacing.SOUTH && side != EnumFacing.NORTH) { return false; } } boolean flag = blockAccess.getBlockState(pos.west()).getBlock() == this && blockAccess.getBlockState(pos.west(2)).getBlock() != this; boolean flag1 = blockAccess.getBlockState(pos.east()).getBlock() == this && blockAccess.getBlockState(pos.east(2)).getBlock() != this; boolean flag2 = blockAccess.getBlockState(pos.north()).getBlock() == this && blockAccess.getBlockState(pos.north(2)).getBlock() != this; boolean flag3 = blockAccess.getBlockState(pos.south()).getBlock() == this && blockAccess.getBlockState(pos.south(2)).getBlock() != this; boolean flag4 = flag || flag1 || axis == EnumFacing.Axis.X; boolean flag5 = flag2 || flag3 || axis == EnumFacing.Axis.Z; return flag4 && side == EnumFacing.WEST ? true : (flag4 && side == EnumFacing.EAST ? true : (flag5 && side == EnumFacing.NORTH ? true : flag5 && side == EnumFacing.SOUTH)); } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random random) { return 0; } /** * Called When an Entity Collided with the Block */ @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (entityIn.getRidingEntity() == null && entityIn.getRidingEntity() == null && entityIn.timeUntilPortal <= 0 && !worldIn.isRemote) { int id = -1; if (entityIn.dimension == id) { id = 0; } if (entityIn instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP) entityIn; MinecraftServer mcServer = entityIn.getServer(); if (player.timeUntilPortal > 0) { player.timeUntilPortal = 100; } else if (player.dimension != id) { ThisisHalloween.portal = false; // mcServer.getPlayerList().transferPlayerToDimension(player, -1, new Teleporter(mcServer.worldServerForDimension(-1))); //entityIn.changeDimension(-1); travelToDimension(player, id); player.timeUntilPortal = 100; ThisisHalloween.portal = true; } else { // mcServer.getPlayerList().transferPlayerToDimension(player, 0, new TeleporterFrightful(mcServer.worldServerForDimension(0))); // entityIn.changeDimension(0); travelToDimension(player, 0); player.timeUntilPortal = 100; } // System.out.println("appel travel"); // player.timeUntilPortal = 100; } } } public Entity travelToDimension(Entity entity, int dimensionIn)    {        if (!entity.worldObj.isRemote && !entity.isDead)        {            if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(entity, dimensionIn)) return null;            entity.worldObj.theProfiler.startSection("changeDimension");            MinecraftServer minecraftserver = entity.getServer();            int i = entity.dimension;            WorldServer worldserver = minecraftserver.worldServerForDimension(i);            WorldServer worldserver1 = minecraftserver.worldServerForDimension(dimensionIn);            entity.dimension = dimensionIn;            if (i == 1 && dimensionIn == 1)            {                worldserver1 = minecraftserver.worldServerForDimension(0);                entity.dimension = 0;            }            entity.worldObj.removeEntity(entity);            entity.isDead = false;            entity.worldObj.theProfiler.startSection("reposition");            BlockPos blockpos;            if (dimensionIn == 1)            {                blockpos = worldserver1.getSpawnCoordinate();            }            else            {                double d0 = entity.posX;                double d1 = entity.posZ;                double d2 = 8.0D;                if (dimensionIn == -1)                {                    d0 = MathHelper.clamp_double(d0 / d2, worldserver1.getWorldBorder().minX() + 16.0D, worldserver1.getWorldBorder().maxX() - 16.0D);                    d1 = MathHelper.clamp_double(d1 / d2, worldserver1.getWorldBorder().minZ() + 16.0D, worldserver1.getWorldBorder().maxZ() - 16.0D);                }                else if (dimensionIn == 0)                {                    d0 = MathHelper.clamp_double(d0 * d2, worldserver1.getWorldBorder().minX() + 16.0D, worldserver1.getWorldBorder().maxX() - 16.0D);                    d1 = MathHelper.clamp_double(d1 * d2, worldserver1.getWorldBorder().minZ() + 16.0D, worldserver1.getWorldBorder().maxZ() - 16.0D);                }                d0 = (double)MathHelper.clamp_int((int)d0, -29999872, 29999872);                d1 = (double)MathHelper.clamp_int((int)d1, -29999872, 29999872);                float f = entity.rotationYaw;                entity.setLocationAndAngles(d0, entity.posY, d1, 90.0F, 0.0F);                Teleporter teleporter = new Teleporter(entity.getServer().worldServerForDimension(entity.dimension));                teleporter.placeInExistingPortal(entity, f);                blockpos = new BlockPos(entity);            }            worldserver.updateEntityWithOptionalForce(entity, false);            entity.worldObj.theProfiler.endStartSection("reloading");            Entity entity1 = EntityList.createEntityByName(EntityList.getEntityString(entity), worldserver1);            if (entity1 != null)            {          //      entity1.copyDataFromOld(entity1);             BlockPos lastPortalPos = new BlockPos(entity.posX, entity.posY, entity.posZ); Vec3d lastPortalVec = entity.getLastPortalVec(); EnumFacing teleportDirection = entity.getTeleportDirection(); entity.timeUntilPortal = entity1.timeUntilPortal; ObfuscationReflectionHelper.setPrivateValue(Entity.class, entity1, lastPortalPos, "lastPortalPos"); ObfuscationReflectionHelper.setPrivateValue(Entity.class, entity1, lastPortalVec, "lastPortalVec"); ObfuscationReflectionHelper.setPrivateValue(Entity.class, entity1, teleportDirection, "teleportDirection");                if (i == 1 && dimensionIn == 1)                {                    BlockPos blockpos1 = worldserver1.getTopSolidOrLiquidBlock(worldserver1.getSpawnPoint());                    entity1.moveToBlockPosAndAngles(blockpos1, entity1.rotationYaw, entity1.rotationPitch);                }                else                {                    entity1.moveToBlockPosAndAngles(blockpos, entity1.rotationYaw, entity1.rotationPitch);                }                boolean flag = entity1.forceSpawn;                entity1.forceSpawn = true;                worldserver1.spawnEntityInWorld(entity1);                entity1.forceSpawn = flag;                worldserver1.updateEntityWithOptionalForce(entity1, false);            }            entity.isDead = true;            entity.worldObj.theProfiler.endSection();            worldserver.resetUpdateEntityTick();            worldserver1.resetUpdateEntityTick();            entity.worldObj.theProfiler.endSection();            return entity1;        }        else        {            return null;        }    } /* public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) { transferEntityToWorld(entityIn, thisishalloween.ThisisHalloween.DIMENSIONID, DimensionManager.getWorld(0), DimensionManager.getWorld(thisishalloween.ThisisHalloween.DIMENSIONID)); }*/ /** * Convert the given metadata into a BlockState for this Block */ public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(AXIS, (meta & 3) == 2 ? EnumFacing.Axis.Z : EnumFacing.Axis.X); } @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.TRANSLUCENT; } @SideOnly(Side.CLIENT) public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand)    {        if (rand.nextInt(100) == 0)        {            world.playSound((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, SoundEvents.BLOCK_PORTAL_AMBIENT, SoundCategory.BLOCKS, 0.5F, rand.nextFloat() * 0.4F + 0.8F, false);        }        for (int i = 0; i < 4; ++i)        {            double d0 = (double)((float)pos.getX() + rand.nextFloat());            double d1 = (double)((float)pos.getY() + rand.nextFloat());            double d2 = (double)((float)pos.getZ() + rand.nextFloat());            double d3 = ((double)rand.nextFloat() - 0.5D) * 0.5D;            double d4 = ((double)rand.nextFloat() - 0.5D) * 0.5D;            double d5 = ((double)rand.nextFloat() - 0.5D) * 0.5D;            int j = rand.nextInt(2) * 2 - 1;            if (world.getBlockState(pos.west()).getBlock() != this && world.getBlockState(pos.east()).getBlock() != this)            {                d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j;                d3 = (double)(rand.nextFloat() * 2.0F * (float)j);            }            else            {                d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)j;                d5 = (double)(rand.nextFloat() * 2.0F * (float)j);            }            world.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5, new int[0]);        }    } /** * Convert the BlockState into the correct metadata value */ public int getMetaFromState(IBlockState state) { return getMetaForAxis((EnumFacing.Axis)state.getValue(AXIS)); } @SideOnly(Side.CLIENT) public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) { return null; }    protected BlockStateContainer createBlockState()    {        return new BlockStateContainer(this, new IProperty[] {AXIS});    }    public IBlockState withRotation(IBlockState state, Rotation rot)    {        switch (rot)        {            case COUNTERCLOCKWISE_90:            case CLOCKWISE_90:                switch ((EnumFacing.Axis)state.getValue(AXIS))                {                    case X:                        return state.withProperty(AXIS, EnumFacing.Axis.Z);                    case Z:                        return state.withProperty(AXIS, EnumFacing.Axis.X);                    default:                        return state;                }            default:                return state;        }    }    public BlockPattern.PatternHelper createPatternHelper(World worldIn, BlockPos p_181089_2_)    {        EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.Z;        BlockPortalFrightful.Size blockportal$size = new BlockPortalFrightful.Size(worldIn, p_181089_2_, EnumFacing.Axis.X);        LoadingCache <blockpos, blockworldstate="">loadingcache = BlockPattern.createLoadingCache(worldIn, true);        if (!blockportal$size.isValid())        {            enumfacing$axis = EnumFacing.Axis.X;            blockportal$size = new BlockPortalFrightful.Size(worldIn, p_181089_2_, EnumFacing.Axis.Z);        }        if (!blockportal$size.isValid())        {            return new BlockPattern.PatternHelper(p_181089_2_, EnumFacing.NORTH, EnumFacing.UP, loadingcache, 1, 1, 1);        }        else        {            int[] aint = new int[EnumFacing.AxisDirection.values().length];            EnumFacing enumfacing = blockportal$size.rightDir.rotateYCCW();            BlockPos blockpos = blockportal$size.bottomLeft.up(blockportal$size.getHeight() - 1);            for (EnumFacing.AxisDirection enumfacing$axisdirection : EnumFacing.AxisDirection.values())            {                BlockPattern.PatternHelper blockpattern$patternhelper = new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection ? blockpos : blockpos.offset(blockportal$size.rightDir, blockportal$size.getWidth() - 1), EnumFacing.getFacingFromAxis(enumfacing$axisdirection, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.getWidth(), blockportal$size.getHeight(), 1);                for (int i = 0; i < blockportal$size.getWidth(); ++i)                {                    for (int j = 0; j < blockportal$size.getHeight(); ++j)                    {                        BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, j, 1);                        if (blockworldstate.getBlockState() != null && blockworldstate.getBlockState().getMaterial() != Material.AIR)                        {                            ++aint[enumfacing$axisdirection.ordinal()];                        }                    }                }            }            EnumFacing.AxisDirection enumfacing$axisdirection1 = EnumFacing.AxisDirection.POSITIVE;            for (EnumFacing.AxisDirection enumfacing$axisdirection2 : EnumFacing.AxisDirection.values())            {                if (aint[enumfacing$axisdirection2.ordinal()] < aint[enumfacing$axisdirection1.ordinal()])                {                    enumfacing$axisdirection1 = enumfacing$axisdirection2;                }            }            return new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection1 ? blockpos : blockpos.offset(blockportal$size.rightDir, blockportal$size.getWidth() - 1), EnumFacing.getFacingFromAxis(enumfacing$axisdirection1, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.getWidth(), blockportal$size.getHeight(), 1);        }    }    public static class Size    {        private final World world;        private final EnumFacing.Axis axis;        private final EnumFacing rightDir;        private final EnumFacing leftDir;        private int portalBlockCount;        private BlockPos bottomLeft;        private int height;        private int width;        public Size(World worldIn, BlockPos p_i45694_2_, EnumFacing.Axis p_i45694_3_)        {            this.world = worldIn;            this.axis = p_i45694_3_;            if (p_i45694_3_ == EnumFacing.Axis.X)            {                this.leftDir = EnumFacing.EAST;                this.rightDir = EnumFacing.WEST;            }            else            {                this.leftDir = EnumFacing.NORTH;                this.rightDir = EnumFacing.SOUTH;            }            for (BlockPos blockpos = p_i45694_2_; p_i45694_2_.getY() > blockpos.getY() - 21 && p_i45694_2_.getY() > 0 && this.isEmptyBlock(worldIn.getBlockState(p_i45694_2_.down()).getBlock()); p_i45694_2_ = p_i45694_2_.down())            {                ;            }            int i = this.getDistanceUntilEdge(p_i45694_2_, this.leftDir) - 1;            if (i >= 0)            {                this.bottomLeft = p_i45694_2_.offset(this.leftDir, i);                this.width = this.getDistanceUntilEdge(this.bottomLeft, this.rightDir);                if (this.width < 2 || this.width > 21)                {                    this.bottomLeft = null;                    this.width = 0;                }            }            if (this.bottomLeft != null)            {                this.height = this.calculatePortalHeight();            }        }        protected int getDistanceUntilEdge(BlockPos p_180120_1_, EnumFacing p_180120_2_)        {            int i;            for (i = 0; i < 22; ++i)            {                BlockPos blockpos = p_180120_1_.offset(p_180120_2_, i);                if (!this.isEmptyBlock(this.world.getBlockState(blockpos).getBlock()) || this.world.getBlockState(blockpos.down()).getBlock() != Blocks.NETHER_BRICK)                {                    break;                }            }            Block block = this.world.getBlockState(p_180120_1_.offset(p_180120_2_, i)).getBlock();            return block == Blocks.NETHER_BRICK ? i : 0;        }        public int getHeight()        {            return this.height;        }        public int getWidth()        {            return this.width;        }        protected int calculatePortalHeight()        {            label24:            for (this.height = 0; this.height < 21; ++this.height)            {                for (int i = 0; i < this.width; ++i)                {                    BlockPos blockpos = this.bottomLeft.offset(this.rightDir, i).up(this.height);                    Block block = this.world.getBlockState(blockpos).getBlock();                    if (!this.isEmptyBlock(block))                    {                        break label24;                    }                    if (block == Blocks.PORTAL)                    {                        ++this.portalBlockCount;                    }                    if (i == 0)                    {                        block = this.world.getBlockState(blockpos.offset(this.leftDir)).getBlock();                        if (block != Blocks.NETHER_BRICK)                        {                            break label24;                        }                    }                    else if (i == this.width - 1)                    {                        block = this.world.getBlockState(blockpos.offset(this.rightDir)).getBlock();                        if (block != Blocks.NETHER_BRICK)                        {                            break label24;                        }                    }                }            }            for (int j = 0; j < this.width; ++j)            {                if (this.world.getBlockState(this.bottomLeft.offset(this.rightDir, j).up(this.height)).getBlock() != Blocks.NETHER_BRICK)                {                    this.height = 0;                    break;                }            }            if (this.height <= 21 && this.height >= 3)            {                return this.height;            }            else            {                this.bottomLeft = null;                this.width = 0;                this.height = 0;                return 0;            }        }        protected boolean isEmptyBlock(Block p_150857_1_)        {            return p_150857_1_.getMaterial(p_150857_1_.getDefaultState()) == Material.AIR || p_150857_1_ == CreateBlocks.portalFrightful;        }        public boolean isValid()        {            return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;        }        public void placePortalBlocks()        {            for (int i = 0; i < this.width; ++i)            {                BlockPos blockpos = this.bottomLeft.offset(this.rightDir, i);                for (int j = 0; j < this.height; ++j)                {                    this.world.setBlockState(blockpos.up(j), CreateBlocks.portalFrightful.getDefaultState().withProperty(BlockPortalFrightful.AXIS, this.axis), 2);                }            }        }    } } J’ai essayé plein de trucs, mais ça mène au même bug. Quelqu’un aurait une solution ? Merci d’avance EDIT : j’ai enfiiinnn résolu ce problème Dans le blockPortal, j’ai utilisé pour me téléporter mcServer.getPlayerList().transferPlayerToDimension(player, id, new TeleporterFrightful(mcServer.worldServerForDimension(id))); Vous auriez dû voir ma joie quand j’ai vu que ça marchait. Ca fait plusieurs mois que je cherche sans succès</blockpos,></enumfacing.axis></enumfacing.axis>
  • Structure

    Résolu 1.9.4
    24
    0 Votes
    24 Messages
    4k Vues
    DylemD
    @‘BrokenSwing’: Ou alors vous configurez eclipse pour que vos tab soit des espaces Je connaissais pas merci
  • Mon Mods ne Fonctione pas sur serveur

    Résolu 1.10.x
    13
    0 Votes
    13 Messages
    2k Vues
    F
    Merci ca fonctione.