MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Problème dimension /:

    Planifier Épinglé Verrouillé Déplacé Résolu 1.8.x
    1.8
    20 Messages 4 Publieurs 4.0k Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • FlowF Hors-ligne
      Flow
      dernière édition par

      SUITE CLASSE
      :::

      GenLayer Ancient

      package mod.common.world.generator;
      
      import net.minecraft.world.gen.layer.GenLayer;
      import net.minecraft.world.gen.layer.GenLayerVoronoiZoom;
      import net.minecraft.world.gen.layer.GenLayerZoom;
      
      public abstract class GenLayerAncient extends GenLayer 
      {
      
      public GenLayerAncient(long par1) 
      {
      super(par1);
      
      }
      
      public static GenLayer[] makeTheWorld(long l)
      {
      GenLayer biomes = new AncientGenLayerBiome(1L);
      
      biomes = new GenLayerZoom(1000L, biomes);
      biomes = new GenLayerZoom(1001L, biomes);
      biomes = new GenLayerZoom(1002L, biomes);
      biomes = new GenLayerZoom(1003L, biomes);
      biomes = new GenLayerZoom(1004L, biomes);
      biomes = new GenLayerZoom(1005L, biomes);
      
      GenLayer genlayervoronoizoom = new GenLayerVoronoiZoom(10L, biomes);
      biomes.initWorldGenSeed(l);
      genlayervoronoizoom.initWorldGenSeed(l);
      
      return new GenLayer[] {biomes, genlayervoronoizoom};
      }
      }
      
      {
      this.makePortal(entity);
      this.placeInExistingPortal(entity, rotationYaw);
      }
      }
      
      else
      {
      int i = MathHelper.floor_double(entity.posX);
      int j = MathHelper.floor_double(entity.posY) - 1;
      int k = MathHelper.floor_double(entity.posZ);
      byte b0 = 1;
      byte b1 = 0;
      for(int l = -2; l <= 2; ++l)
      {
      for(int i1 = -2; i1 <= 2; ++i1)
      {
      for(int j1 = -1; j1 < 3; ++j1)
      {
      int k1 = i + i1 * b0 + l * b1;
      int l1 = j + j1;
      int i2 = k + i1 * b1 - l * b0;
      boolean flag = j1 < 0;
      
      this.worldServerInstance.setBlockState(new BlockPos(k1, l1, i2), (flag ? BlockRegister.BlockAmbre.getDefaultState() : Blocks.air.getDefaultState()));
      }
      }
      }
      entity.setLocationAndAngles((double)i, (double)j, (double)k, entity.rotationYaw, 0.0F);
      entity.motionX = entity.motionY = entity.motionZ = 0.0D;
      }
          }
      
      public boolean placeInExistingPortal(Entity entity, float rotationYaw)
      {
         boolean flag = true;
              double d0 = -1.0D;
              int i = MathHelper.floor_double(entity.posX);
              int j = MathHelper.floor_double(entity.posZ);
              boolean flag1 = true;
              Object object = BlockPos.ORIGIN;
              long k = ChunkCoordIntPair.chunkXZ2Int(i, j);
      
              if (this.destinationCoordinateCache.containsItem(k))
              {
                  Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(k);
                  d0 = 0.0D;
                  object = portalposition;
                  portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
                  flag1 = false;
              }
              else
              {
                  BlockPos blockpos4 = new BlockPos(entity);
      
                  for (int l = -128; l <= 128; ++l)
                  {
                      BlockPos blockpos1;
      
                      for (int i1 = -128; i1 <= 128; ++i1)
                      {
                          for (BlockPos blockpos = blockpos4.add(l, this.worldServerInstance.getActualHeight() - 1 - blockpos4.getY(), i1); blockpos.getY() >= 0; blockpos = blockpos1)
                          {
                              blockpos1 = blockpos.down();
      
                              if (this.worldServerInstance.getBlockState(blockpos).getBlock() == Blocks.portal)
                              {
                                  while (this.worldServerInstance.getBlockState(blockpos1 = blockpos.down()).getBlock() == Blocks.portal)
                                  {
                                      blockpos = blockpos1;
                                  }
      
                                  double d1 = blockpos.distanceSq(blockpos4);
      
                                  if (d0 < 0.0D || d1 < d0)
                                  {
                                      d0 = d1;
                                      object = blockpos;
                                  }
                              }
                          }
                      }
                  }
              }
      
              if (d0 >= 0.0D)
              {
                  if (flag1)
                  {
                      this.destinationCoordinateCache.add(k, new Teleporter.PortalPosition((BlockPos)object, this.worldServerInstance.getTotalWorldTime()));
                      this.destinationCoordinateKeys.add(Long.valueOf(k));
                  }
      
                  double d4 = (double)((BlockPos)object).getX() + 0.5D;
                  double d5 = (double)((BlockPos)object).getY() + 0.5D;
                  double d6 = (double)((BlockPos)object).getZ() + 0.5D;
                  EnumFacing enumfacing = null;
      
                  if (this.worldServerInstance.getBlockState(((BlockPos)object).west()).getBlock() == BlockRegister.BlockPortail)
                  {
                      enumfacing = EnumFacing.NORTH;
                  }
      
                  if (this.worldServerInstance.getBlockState(((BlockPos)object).east()).getBlock() == Blocks.portal)
                  {
                      enumfacing = EnumFacing.SOUTH;
                  }
      
                  if (this.worldServerInstance.getBlockState(((BlockPos)object).north()).getBlock() == Blocks.portal)
                  {
                      enumfacing = EnumFacing.EAST;
                  }
      
                  if (this.worldServerInstance.getBlockState(((BlockPos)object).south()).getBlock() == Blocks.portal)
                  {
                      enumfacing = EnumFacing.WEST;
                  }
      
                  EnumFacing enumfacing1 = EnumFacing.getHorizontal(entity.getTeleportDirection());
      
                  if (enumfacing != null)
                  {
                      EnumFacing enumfacing2 = enumfacing.rotateYCCW();
                      BlockPos blockpos2 = ((BlockPos)object).offset(enumfacing);
                      boolean flag2 = this.func_180265_a(blockpos2);
                      boolean flag3 = this.func_180265_a(blockpos2.offset(enumfacing2));
      
                      if (flag3 && flag2)
                      {
                          object = ((BlockPos)object).offset(enumfacing2);
                          enumfacing = enumfacing.getOpposite();
                          enumfacing2 = enumfacing2.getOpposite();
                          BlockPos blockpos3 = ((BlockPos)object).offset(enumfacing);
                          flag2 = this.func_180265_a(blockpos3);
                          flag3 = this.func_180265_a(blockpos3.offset(enumfacing2));
                      }
      
                      float f6 = 0.5F;
                      float f1 = 0.5F;
      
                      if (!flag3 && flag2)
                      {
                          f6 = 1.0F;
                      }
                      else if (flag3 && !flag2)
                      {
                          f6 = 0.0F;
                      }
                      else if (flag3)
                      {
                          f1 = 0.0F;
                      }
      
                      d4 = (double)((BlockPos)object).getX() + 0.5D;
                      d5 = (double)((BlockPos)object).getY() + 0.5D;
                      d6 = (double)((BlockPos)object).getZ() + 0.5D;
                      d4 += (double)((float)enumfacing2.getFrontOffsetX() * f6 + (float)enumfacing.getFrontOffsetX() * f1);
                      d6 += (double)((float)enumfacing2.getFrontOffsetZ() * f6 + (float)enumfacing.getFrontOffsetZ() * f1);
                      float f2 = 0.0F;
                      float f3 = 0.0F;
                      float f4 = 0.0F;
                      float f5 = 0.0F;
      
                      if (enumfacing == enumfacing1)
                      {
                          f2 = 1.0F;
                          f3 = 1.0F;
                      }
                      else if (enumfacing == enumfacing1.getOpposite())
                      {
                          f2 = -1.0F;
                          f3 = -1.0F;
                      }
                      else if (enumfacing == enumfacing1.rotateY())
                      {
                          f4 = 1.0F;
                          f5 = -1.0F;
                      }
                      else
                      {
                          f4 = -1.0F;
                          f5 = 1.0F;
                      }
      
                      double d2 = entity.motionX;
                      double d3 = entity.motionZ;
                      entity.motionX = d2 * (double)f2 + d3 * (double)f5;
                      entity.motionZ = d2 * (double)f4 + d3 * (double)f3;
                      entity.rotationYaw = rotationYaw - (float)(enumfacing1.getHorizontalIndex() * 90) + (float)(enumfacing.getHorizontalIndex() * 90);
                  }
                  else
                  {
                      entity.motionX = entity.motionY = entity.motionZ = 0.0D;
                  }
      
                  entity.setLocationAndAngles(d4, d5, d6, entity.rotationYaw, entity.rotationPitch);
                  return true;
              }
              else
              {
                  return false;
              }
          }
      
        private boolean func_180265_a(BlockPos pos)
         {
             return !this.worldServerInstance.isAirBlock(pos) || !this.worldServerInstance.isAirBlock(pos.up());
         }
      
      public boolean makePortal(Entity entity)
          {
         byte b0 = 16;
              double d0 = -1.0D;
              int i = MathHelper.floor_double(entity.posX);
              int j = MathHelper.floor_double(entity.posY);
              int k = MathHelper.floor_double(entity.posZ);
              int l = i;
              int i1 = j;
              int j1 = k;
              int k1 = 0;
              int l1 = this.random.nextInt(4);
              int i2;
              double d1;
              int k2;
              double d2;
              int i3;
              int j3;
              int k3;
              int l3;
              int i4;
              int j4;
              int k4;
              int l4;
              int i5;
              double d3;
              double d4;
      
              for (i2 = i - b0; i2 <= i + b0; ++i2)
              {
                  d1 = (double)i2 + 0.5D - entity.posX;
      
                  for (k2 = k - b0; k2 <= k + b0; ++k2)
                  {
                      d2 = (double)k2 + 0.5D - entity.posZ;
                      label271:
      
                      for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; –i3)
                      {
                          if (this.worldServerInstance.isAirBlock(new BlockPos(i2, i3, k2)))
                          {
                              while (i3 > 0 && this.worldServerInstance.isAirBlock(new BlockPos(i2, i3 - 1, k2)))
                              {
                                  --i3;
                              }
      
                              for (j3 = l1; j3 < l1 + 4; ++j3)
                              {
                                  k3 = j3 % 2;
                                  l3 = 1 - k3;
      
                                  if (j3 % 4 >= 2)
                                  {
                                      k3 = -k3;
                                      l3 = -l3;
                                  }
      
                                  for (i4 = 0; i4 < 3; ++i4)
                                  {
                                      for (j4 = 0; j4 < 4; ++j4)
                                      {
                                          for (k4 = -1; k4 < 4; ++k4)
                                          {
                                              l4 = i2 + (j4 - 1) * k3 + i4 * l3;
                                              i5 = i3 + k4;
                                              int j5 = k2 + (j4 - 1) * l3 - i4 * k3;
      
                                              if (k4 < 0 && !this.worldServerInstance.getBlockState(new BlockPos(l4, i5, j5)).getBlock().getMaterial().isSolid() || k4 >= 0 && !this.worldServerInstance.isAirBlock(new BlockPos(l4, i5, j5)))
                                              {
                                                  continue label271;
                                              }
                                          }
                                      }
                                  }
      
                                  d3 = (double)i3 + 0.5D - entity.posY;
                                  d4 = d1 * d1 + d3 * d3 + d2 * d2;
      
                                  if (d0 < 0.0D || d4 < d0)
                                  {
                                      d0 = d4;
                                      l = i2;
                                      i1 = i3;
                                      j1 = k2;
                                      k1 = j3 % 4;
                                  }
                              }
                          }
                      }
                  }
              }
      
              if (d0 < 0.0D)
              {
                  for (i2 = i - b0; i2 <= i + b0; ++i2)
                  {
                      d1 = (double)i2 + 0.5D - entity.posX;
      
                      for (k2 = k - b0; k2 <= k + b0; ++k2)
                      {
                          d2 = (double)k2 + 0.5D - entity.posZ;
                          label219:
      
                          for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3)
                          {
                              if (this.worldServerInstance.isAirBlock(new BlockPos(i2, i3, k2)))
                              {
                                  while (i3 > 0 && this.worldServerInstance.isAirBlock(new BlockPos(i2, i3 - 1, k2)))
                                  {
                                      --i3;
                                  }
      
                                  for (j3 = l1; j3 < l1 + 2; ++j3)
                                  {
                                      k3 = j3 % 2;
                                      l3 = 1 - k3;
      
                                      for (i4 = 0; i4 < 4; ++i4)
                                      {
                                          for (j4 = -1; j4 < 4; ++j4)
                                          {
                                              k4 = i2 + (i4 - 1) * k3;
                                              l4 = i3 + j4;
                                              i5 = k2 + (i4 - 1) * l3;
      
                                              if (j4 < 0 && !this.worldServerInstance.getBlockState(new BlockPos(k4, l4, i5)).getBlock().getMaterial().isSolid() || j4 >= 0 && !this.worldServerInstance.isAirBlock(new BlockPos(k4, l4, i5)))
                                              {
                                                  continue label219;
                                              }
                                          }
                                      }
      
                                      d3 = (double)i3 + 0.5D - entity.posY;
                                      d4 = d1 * d1 + d3 * d3 + d2 * d2;
      
                                      if (d0 < 0.0D || d4 < d0)
                                      {
                                          d0 = d4;
                                          l = i2;
                                          i1 = i3;
                                          j1 = k2;
                                          k1 = j3 % 2;
                                      }
                                  }
                              }
                          }
                      }
                  }
              }
      
              int k5 = l;
              int j2 = i1;
              k2 = j1;
              int l5 = k1 % 2;
              int l2 = 1 - l5;
      
              if (k1 % 4 >= 2)
              {
                  l5 = -l5;
                  l2 = -l2;
              }
      
              if (d0 < 0.0D)
              {
                  i1 = MathHelper.clamp_int(i1, 70, this.worldServerInstance.getActualHeight() - 10);
                  j2 = i1;
      
                  for (i3 = -1; i3 <= 1; ++i3)
                  {
                      for (j3 = 1; j3 < 3; ++j3)
                      {
                          for (k3 = -1; k3 < 3; ++k3)
                          {
                              l3 = k5 + (j3 - 1) * l5 + i3 * l2;
                              i4 = j2 + k3;
                              j4 = k2 + (j3 - 1) * l2 - i3 * l5;
                              boolean flag = k3 < 0;
                              this.worldServerInstance.setBlockState(new BlockPos(l3, i4, j4), flag ? BlockRegister.BlockAmbre.getDefaultState() : Blocks.air.getDefaultState());
                          }
                      }
                  }
              }
      
              IBlockState iblockstate = BlockRegister.BlockPortail.getDefaultState().withProperty(BlockPortail.AXIS, l5 != 0 ? EnumFacing.Axis.X : EnumFacing.Axis.Z);
      
              for (j3 = 0; j3 < 4; ++j3)
              {
                  for (k3 = 0; k3 < 4; ++k3)
                  {
                      for (l3 = -1; l3 < 4; ++l3)
                      {
                          i4 = k5 + (k3 - 1) * l5;
                          j4 = j2 + l3;
                          k4 = k2 + (k3 - 1) * l2;
                          boolean flag1 = k3 == 0 || k3 == 3 || l3 == -1 || l3 == 3;
                          this.worldServerInstance.setBlockState(new BlockPos(i4, j4, k4), flag1 ? BlockRegister.BlockAmbre.getDefaultState() : iblockstate, 2);
                      }
                  }
      
                  for (k3 = 0; k3 < 4; ++k3)
                  {
                      for (l3 = -1; l3 < 4; ++l3)
                      {
                          i4 = k5 + (k3 - 1) * l5;
                          j4 = j2 + l3;
                          k4 = k2 + (k3 - 1) * l2;
                          this.worldServerInstance.notifyNeighborsOfStateChange(new BlockPos(i4, j4, k4), this.worldServerInstance.getBlockState(new BlockPos(i4, j4, k4)).getBlock());
                      }
                  }
              }
      
              return true;
          }
      
      class AncientPortalPosition extends ChunkCoordComparator
      {
      public long time;
      final AncientTeleporter teleporter;
      
      public AncientPortalPosition(AncientTeleporter teleporter, EntityPlayerMP player, long creationTime)
      {
      super(player);
      this.teleporter = teleporter;
      this.time = creationTime;
      }
      
      }
      }
      
      

      Dimension Register

      package mod.common.world.structure;
      
      import mod.common.world.biome.AncientBiome;
      import mod.common.world.biome.BiomeRegister;
      import mod.common.world.type.AncientWorldProvider;
      import net.minecraft.block.Block;
      import net.minecraft.block.material.Material;
      import net.minecraft.item.Item;
      import net.minecraft.world.biome.BiomeCache;
      import net.minecraft.world.biome.BiomeGenBase;
      import net.minecraftforge.common.BiomeManager;
      import net.minecraftforge.common.DimensionManager;
      
      public class DimensionRegister {
      
      public static int DimAncient = 2;
      
      public static void register() 
      {
      DimensionManager.registerProviderType(DimensionRegister.DimAncient, AncientWorldProvider.class, false);
      DimensionManager.registerDimension(DimensionRegister.DimAncient , DimensionRegister.DimAncient);
      
      }
      }
      
      

      AncientWorldChunkManager

      package mod.common.world.type;
      
      import static net.minecraft.world.biome.BiomeGenBase.forest;
      import static net.minecraft.world.biome.BiomeGenBase.forestHills;
      import static net.minecraft.world.biome.BiomeGenBase.jungle;
      import static net.minecraft.world.biome.BiomeGenBase.jungleHills;
      import static net.minecraft.world.biome.BiomeGenBase.plains;
      import static net.minecraft.world.biome.BiomeGenBase.taiga;
      import static net.minecraft.world.biome.BiomeGenBase.taigaHills;
      
      import java.util.ArrayList;
      import java.util.Arrays;
      import java.util.List;
      import java.util.Random;
      
      import com.google.common.collect.Lists;
      
      import mod.common.world.biome.BiomeRegister;
      import mod.common.world.generator.GenLayerAncient;
      import mod.common.world.structure.DimensionRegister;
      import net.minecraft.crash.CrashReport;
      import net.minecraft.crash.CrashReportCategory;
      import net.minecraft.util.BlockPos;
      import net.minecraft.util.ReportedException;
      import net.minecraft.world.World;
      import net.minecraft.world.WorldType;
      import net.minecraft.world.biome.BiomeCache;
      import net.minecraft.world.biome.BiomeGenBase;
      import net.minecraft.world.biome.WorldChunkManager;
      import net.minecraft.world.gen.layer.GenLayer;
      import net.minecraft.world.gen.layer.IntCache;
      import net.minecraftforge.common.MinecraftForge;
      import net.minecraftforge.event.terraingen.WorldTypeEvent;
      import net.minecraftforge.fml.relauncher.Side;
      import net.minecraftforge.fml.relauncher.SideOnly;
      
      public class AncientWorldChunkManager extends WorldChunkManager {
      
      private GenLayer GenBiomes;
      private GenLayer BiomeIndexLayer;
      private BiomeCache BiomeCache;
      private List <biomegenbase>BiomesToSpawnIn;
      
      public AncientWorldChunkManager()
      {
      this.BiomeCache = new BiomeCache(this);
      this.BiomesToSpawnIn = new ArrayList<biomegenbase>();
      this.BiomesToSpawnIn.add(BiomeGenBase.forest); 
      }
      
      public AncientWorldChunkManager(long seed, WorldType worldtype, long height)
      {
      this();
      GenLayer[] agenlayer = GenLayerAncient.makeTheWorld(seed);
      this.GenBiomes = agenlayer[0];
      this.BiomeIndexLayer = agenlayer[1];
      }
      
      public AncientWorldChunkManager(World world)
      {
            this(world.getSeed(), world.getWorldInfo().getTerrainType(), world.getActualHeight());
      }
      
      public List <biomegenbase>getBiomesToSpawnIn()
      {
      return this.BiomesToSpawnIn;
      }
      
      public BiomeGenBase getBiomeGenAt(int x, int z, BiomeGenBase biome)
      {
      
      this.BiomeCache.func_180284_a(x, z, biome);
      if(biome == null)
      {
      return BiomeGenBase.forest;
      }
      return biome;
      }
      
        public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length)
        {
             if(listToReuse == null || listToReuse.length < width * length)
             {
                 listToReuse = new float[width * length];
             }
      
             Arrays.fill(listToReuse, 0, width * length, 0.0F);
             return listToReuse;
        }
      
      @SideOnly(Side.CLIENT)
      public float getTemperatureAtHeight(float par1, int par2)
      {
      return par1;
      }
      
        public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
        {       
      IntCache.resetIntCache();
      
             if(par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
             {
                 par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
             }
      
             int[] aint = this.GenBiomes.getInts(par2, par3, par4, par5);
      
             for(int i = 0; i < par4 * par5; ++i)
             {
                 if(aint* >= 0)
                 {
                     par1ArrayOfBiomeGenBase* = BiomeGenBase.getBiome(aint*);
                 }
                 else
                 {
                     par1ArrayOfBiomeGenBase* = BiomeRegister.AncientBiome;
      }
             }
      
             return par1ArrayOfBiomeGenBase;
        }
      
        public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth)
        {
            return this.getBiomeGenAt(oldBiomeList, x, z, width, depth, true);
        }
      
        public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] listToReuse, int x, int z, int width, int length, boolean cacheFlag)
      {
      
      IntCache.resetIntCache();
      
            if (listToReuse == null || listToReuse.length < width * length)
            {
                listToReuse = new BiomeGenBase[width * length];
            }
      
            if (cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (z & 15) == 0)
            {
                BiomeGenBase[] abiomegenbase1 = this.BiomeCache.getCachedBiomes(x, z);
                System.arraycopy(abiomegenbase1, 0, listToReuse, 0, width * length);
                return listToReuse;
            }
            else
            {
                int[] aint = this.BiomeIndexLayer.getInts(x, z, width, length);
      
                 for(int i1 = 0; i1 < width * length; ++i1)
                 {
                     if(aint[i1] >= 0)
                     {
                         listToReuse[i1] = BiomeGenBase.getBiome(aint[i1]);
                     }
                     else
                     {
                         listToReuse[i1] = BiomeRegister.AncientBiome;
                     }
                 }
      
                 return listToReuse;
            }
      }
      public boolean areBiomesViable(int par1, int par2, int par3, List par4List)
        {
            IntCache.resetIntCache();
             int l = par1 - par3 >> 2;
             int i1 = par2 - par3 >> 2;
             int j1 = par1 + par3 >> 2;
             int k1 = par2 + par3 >> 2;
             int l1 = j1 - l + 1;
             int i2 = k1 - i1 + 1;
             int[] aint = this.GenBiomes.getInts(l, i1, l1, i2);
      
             for(int j2 = 0; j2 < l1 * i2; ++j2)
             {
                 BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[j2]);
      
                 if(!par4List.contains(biomegenbase))
                 {
                     return false;
                 }
             }
      
             return true;
        }
      public BlockPos findBiomePosition(int x, int z, int range, List list, Random random)
      {
            IntCache.resetIntCache();
             int l = x - range >> 2;
             int i1 = z - range >> 2;
             int j1 = x + range >> 2;
             int k1 = z + range >> 2;
             int l1 = j1 - l + 1;
             int i2 = k1 - i1 + 1;
             int[] aint = this.GenBiomes.getInts(l, i1, l1, i2);
             BlockPos blockpos = null;
             int j2 = 0;
      
             for(int k2 = 0; k2 < l1 * i2; ++k2)
             {
                 int l2 = l + k2 % l1 << 2;
                 int i3 = i1 + k2 / l1 << 2;
                 BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[k2]);
      
                 if(((List<biomegenbase>)BiomeCache).contains(biomegenbase) && (blockpos == null || random.nextInt(j2 + 1) == 0))
                 {
                     blockpos = new BlockPos(l2, 0, i3);
                     ++j2;
      
                 }
             }
      
             return blockpos;
      }
      
      public void cleanupCache()
      {
      this.BiomeCache.cleanupCache();
      }
      
      }
      
      

      AncientWorldProvider

      package mod.common.world.type;
      
      import mod.common.world.generator.ChunkProviderAncient;
      import mod.common.world.structure.DimensionRegister;
      import net.minecraft.entity.Entity;
      import net.minecraft.init.Blocks;
      import net.minecraft.util.BlockPos;
      import net.minecraft.util.Vec3;
      import net.minecraft.util.Vec3i;
      import net.minecraft.world.WorldProvider;
      import net.minecraft.world.WorldType;
      import net.minecraft.world.chunk.IChunkProvider;
      import net.minecraftforge.fml.relauncher.Side;
      import net.minecraftforge.fml.relauncher.SideOnly;
      
      public class AncientWorldProvider extends WorldProvider 
      {
          private WorldType terrainType;
          private String generatorSettings;
      public void registerWorldChunkManager() 
      {
      this.worldChunkMgr = new AncientWorldChunkManager(worldObj.getSeed(), terrainType, dimensionId);
      this.dimensionId = DimensionRegister.DimAncient;
      this.hasNoSky = false;
      this.isHellWorld = false;
      }
      
      public IChunkProvider createChunkGenerator()
      {
      return new ChunkProviderAncient(this.worldObj, this.worldObj.getSeed(), false, generatorSettings);
      }
      
      public String getDimensionName() {
      return "Ancient Dimension";
      }
      
          @Override
          public String getInternalNameSuffix()
          {
              // TODO Auto-generated method stub
              return "AD";
          }
      
      public String getSaveFolder() {
      return "AncientDimension";
      }
      
      public boolean canRespawnHere() {
      return true;
      }
      
      public boolean isSurfaceWorld() {
      return true;
      }
      
      public boolean getWorldHasVoidParticles() {
      return true;
      }
      
      public int getHeight() {
      return 256;
      }
      
      public boolean canCoordinateBeSpawn(BlockPos pos) 
      {
         int par1 = pos.getX();
         int par2 = pos.getZ();
      
      return this.worldObj.getTopSolidOrLiquidBlock(new BlockPos(par1, 0, par2)).equals(Blocks.grass);
      }
      
      protected void generateLightBrightnessTable() {
      float f = 0.2F;
      
      for (int i = 0; i <= 15; ++i) {
      float f1 = 1.0F - (float) i / 15.0F;
      this.lightBrightnessTable* = (1.0F - f1) / (f1 * 3.0F + 1.0F)
      * (1.0F - f) + f;
      }
      }
      
      public float calculateCelestialAngle(long par1, float par2) {
      int j = (int) (par1 % 24000L);
      float f1 = ((float) j + par2) / 24000.0F - 0.25F;
      
      if (f1 < 0.0F) {
      ++f1;
      }
      if (f1 > 1.0F) {
      –f1;
      }
      float f2 = f1;
      f1 = 1.0F - (float) ((Math.cos((double) f1 * Math.PI) + 1.0D) / 2.0D);
      f1 = f2 + (f1 - f2) / 3.0F;
      return f1;
      }
      
      public int getMoonPhase(long par1) {
      return (int) (par1 / 24000L % 8L + 8L) % 8;
      }
      
      public String getWelcomeMessage() {
      if (this instanceof AncientWorldProvider) {
      return "Entering the Ancient Dimension";
      }
      return null;
      }
      
      public String getDepartMessage() {
      if (this instanceof AncientWorldProvider) {
      return "Leaving the Ancient Dimension";
      }
      return null;
      }
      
      public double getMovementFactor() {
      if (this instanceof AncientWorldProvider) {
      return 10.0;
      }
      return 1.0;
      }
      
      @SideOnly(Side.CLIENT)
      public boolean isSkyColored() 
      {
      return true;
      }
      
      @Override
      public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) 
      {
      return Vec3(2.8, 1.1, 1.7);
      
      }
      
          private Vec3 Vec3(double d, double e, double f)
          {
              // TODO Auto-generated method stub
              return Vec3(d,e,f);
          }
      
      }
      
      

      :::

      Beaucoup de classe hein ? xD

      Voila j’ai vérifié une deuxième fois avec le tuto 1.7 et les classes de minecraft pour moi j’ia tout bien fait bon maintenant je suis pas parfait et la preuve puisque sa marche pas lol 😄

      Voila si quelqu’un sais :/</biomegenbase></biomegenbase></biomegenbase></biomegenbase>

      Oui ce gif est drôle.

      1 réponse Dernière réponse Répondre Citer 0
      • FlowF Hors-ligne
        Flow
        dernière édition par

        Désolé du triple post , mais j’essaye par moi même de résoudre le problème et la dimension est créer no soucis du coup juste , que quand on rentre en collision avec le portail on dirait que c’est buggé , que c’est pas détecté directement faut en placer plusieurs pour y rentrer , fin bizarre , toutes les classes sont au dessus si vous savez ^^ J’essaye encore de résoudre par moi même mais de l’aide n’est pas de refus 😛 Fin si je trouve je le dirais 🙂

        Oui ce gif est drôle.

        1 réponse Dernière réponse Répondre Citer 0
        • DiangleD Hors-ligne
          Diangle
          dernière édition par

          demain je regarderai. Pour se soir je pense pas 😄

          1 réponse Dernière réponse Répondre Citer 0
          • FlowF Hors-ligne
            Flow
            dernière édition par

            No soucy en tout cas j’ai déja régler la dimension elle fonctionne mais c’est le portail surtout 😕

            Oui ce gif est drôle.

            1 réponse Dernière réponse Répondre Citer 0
            • RedRelayR Hors-ligne
              RedRelay Moddeurs confirmés
              dernière édition par

              Ton post est indigeste. Fait le trie, fait du débuggage et post uniquement ce qui pose problème.

              –------------------------------------------------------------------------------------
              Si tu trouves mon intervention pertinente, n'hésite pas a m…

              1 réponse Dernière réponse Répondre Citer 0
              • FlowF Hors-ligne
                Flow
                dernière édition par

                @‘Blackout’:

                Ton post est indigeste. Fait le trie, fait du débuggage et post uniquement ce qui pose problème.

                Certes il est indigeste , mais j’avais mis toutes les classes CAR au départ j’avais carrément toute la dimension qui ne fonctionnait pas, j’ai réussi a régler et je n’ai plus que le soucis du portail qui ne détecte pas le player lorsqu’il rentre en collision et ce post s’adresse surtout a Diangle qui lui s’y connais beaucoup en dimension, de plus en général les classes s’utilise l’une dans l’autre  🙂

                Merci.

                Oui ce gif est drôle.

                1 réponse Dernière réponse Répondre Citer 0
                • DiangleD Hors-ligne
                  Diangle
                  dernière édition par

                  Donc, on va commencer simplement. Edit les post est supprime toute les classes autres que ton bloc et le la classes pour téléporter. Sinon Met toute les autres classes dans un onglet spoiler. Ensuite tu t’es servit de quoi pour faire ton portail et ton téléporter ? Regarde quel partit du code n’est pas appeler dans ton portail quand tu entres en collision avec. Comme ça on sera précisément d’où viens le soucis. Pour le fait que la bloc ne s’aligne pas avec la direction on verra ça plus tard.

                  edit: J’ai oublié. Legrandfifou, Blackout et un dev java très bon dans son domaine, donc c’est conseille sont à prendre et non pas à rejeter.

                  1 réponse Dernière réponse Répondre Citer 0
                  • RedRelayR Hors-ligne
                    RedRelay Moddeurs confirmés
                    dernière édition par

                    Je n’ai jamais fais de dimension, donc si c’est une mauvaise condition ou une variable qui n’est pas incrémentée ou tout autre truc du genre, je vais devoir chercher dans tout le code pour savoir où ça se trouve. Diangle s’y connait en dimension, donc lui il sait où peut se trouver l’erreur. En postant tout ton code, seul ceux qui s’y connaissent en dimension peuvent t’aider efficacement.
                    Et encore, le simple fait de supprimer les imports, tu gagnes 200 lignes, tu rends la lecture plus agréable et tu rends le moteur de recherche du forum plus performant 😉

                    –------------------------------------------------------------------------------------
                    Si tu trouves mon intervention pertinente, n'hésite pas a m…

                    1 réponse Dernière réponse Répondre Citer 0
                    • FlowF Hors-ligne
                      Flow
                      dernière édition par

                      @‘Diangle’:

                      Donc, on va commencer simplement. Edit les post est supprime toute les classes autres que ton bloc et le la classes pour téléporter. Sinon Met toute les autres classes dans un onglet spoiler. Ensuite tu t’es servit de quoi pour faire ton portail et ton téléporter ? Regarde quel partit du code n’est pas appeler dans ton portail quand tu entres en collision avec. Comme ça on sera précisément d’où viens le soucis. Pour le fait que la bloc ne s’aligne pas avec la direction on verra ça plus tard.

                      edit: J’ai oublié. Legrandfifou, Blackout et un dev java très bon dans son domaine, donc c’est conseille sont à prendre et non pas à rejeter.

                      Oké je vias faire ca , je ne rejette pas ce qu’a dit blackout mais je l’ai vraiment pris comme une attaque , il aurait tout simplement le dire plus cool genre Tu devrais modifier ton post et mettre tout ce qui ne va pas à part.

                      @‘Blackout’:

                      Je n’ai jamais fais de dimension, donc si c’est une mauvaise condition ou une variable qui n’est pas incrémentée ou tout autre truc du genre, je vais devoir chercher dans tout le code pour savoir où ça se trouve. Diangle s’y connait en dimension, donc lui il sait où peut se trouver l’erreur. En postant tout ton code, seul ceux qui s’y connaissent en dimension peuvent t’aider efficacement.
                      Et encore, le simple fait de supprimer les imports, tu gagnes 200 lignes, tu rends la lecture plus agréable et tu rends le moteur de recherche du forum plus performant 😉

                      Je dis ca car c’est le tuto Diangle qui ma permis de créer la dimension , donc c’est pour ca que je le dis car c’est " son code " maintenant je suis ouvert a toute propositions , sache juste que le

                      @Blackout:

                      Ton post est indigeste. Fait le trie, fait du débuggage et post uniquement ce qui pose problème.

                      je trouve ca mal formulé et personnellement je l’ai pris comme une " attaque /pic" , fin voila mon ressenti , soit je vais modifier mon premier post 😛

                      Oui ce gif est drôle.

                      1 réponse Dernière réponse Répondre Citer 0
                      • RedRelayR Hors-ligne
                        RedRelay Moddeurs confirmés
                        dernière édition par

                        Non il ne s’agit absolument pas une attaque, désolé pour ce malentendu 🙂

                        –------------------------------------------------------------------------------------
                        Si tu trouves mon intervention pertinente, n'hésite pas a m…

                        1 réponse Dernière réponse Répondre Citer 0
                        • FlowF Hors-ligne
                          Flow
                          dernière édition par

                          @‘Blackout’:

                          Non il ne s’agit absolument pas une attaque, désolé pour ce malentendu 🙂

                          Ah bah excuse alors de ma réponse ^^ Je modifierais surement mon post demain car je suis asser occupay 🙂

                          Oui ce gif est drôle.

                          1 réponse Dernière réponse Répondre Citer 0
                          • FlowF Hors-ligne
                            Flow
                            dernière édition par

                            Post modifié pour la compréhension de tous 🙂

                            Oui ce gif est drôle.

                            1 réponse Dernière réponse Répondre Citer 0
                            • DiangleD Hors-ligne
                              Diangle
                              dernière édition par

                              Tu as fait se que on t’a dit ? regarder précisément où étais le problème ?

                              1 réponse Dernière réponse Répondre Citer 0
                              • FlowF Hors-ligne
                                Flow
                                dernière édition par

                                Il semble que ce sois dans la fonction :

                                
                                @Override
                                public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity)
                                {
                                if((entity.ridingEntity == null) && (entity.riddenByEntity == null))
                                {
                                         System.out.println("ridingentitynull");
                                
                                if(entity.dimension != DimensionRegister.DimAncient)
                                {
                                          System.out.println("dimension");
                                
                                if(entity instanceof EntityPlayerMP)
                                {
                                             System.out.println("cesunjoueur");
                                
                                EntityPlayerMP player = (EntityPlayerMP)entity;
                                if(player.timeUntilPortal > 0)
                                {
                                            System.out.println("dansleportail");
                                
                                player.timeUntilPortal = 10;
                                }
                                else
                                {
                                            System.out.println("dansleportailELSE");
                                
                                player.timeUntilPortal = 10;
                                player.mcServer.getConfigurationManager().transferPlayerToDimension(player, DimensionRegister.DimAncient, new AncientTeleporter(player.mcServer.worldServerForDimension(DimensionRegister.DimAncient)));
                                }
                                }
                                }
                                else
                                {
                                if(entity instanceof EntityPlayerMP)
                                {
                                EntityPlayerMP player = (EntityPlayerMP)entity;
                                if(player.timeUntilPortal > 0)
                                {
                                player.timeUntilPortal = 10;
                                }
                                else
                                {
                                player.timeUntilPortal = 10;
                                player.mcServer.getConfigurationManager().transferPlayerToDimension(player, 0, new AncientTeleporter(player.mcServer.worldServerForDimension(0)));
                                }
                                }
                                }
                                       }
                                   }
                                
                                

                                Donc dans chaque IF , donc c’est cette fonction qui bug 🙂

                                Aucun des messages n’apparaît 😕

                                EDIT : Problème régler pour finir ::) Juste le portail qui change pas de sens 😕

                                Oui ce gif est drôle.

                                1 réponse Dernière réponse Répondre Citer 0
                                • FlowF Hors-ligne
                                  Flow
                                  dernière édition par

                                  up je pense que la les directions sont buger car la face du portail s’affiche mais pas les petits bords ( c.f portail end )

                                  Oui ce gif est drôle.

                                  1 réponse Dernière réponse Répondre Citer 0
                                  • FlowF Hors-ligne
                                    Flow
                                    dernière édition par

                                    Up , je viens de régler le probleme du spawn dans le sol et dans les airs donc maintenant je spawn dans mon portail mais j’aimerais que le portail qui se génère se tourne suivant la direction du portail la pour l’instant j’ai

                                    BlockRegister.BlockPortail.getDefaultState()
                                    

                                    et je suppose qu’il faut que je rajoute un ```java
                                    .withProperty(BlockPortail.AXIS , ET ICI J’AVAIS vu une fonctione du genre rotatefromAngle

                                    
                                    mais je ne pense pas que ca marchera :/

                                    Oui ce gif est drôle.

                                    1 réponse Dernière réponse Répondre Citer 0
                                    • FlowF Hors-ligne
                                      Flow
                                      dernière édition par

                                      @‘Legrandfifou’:

                                      Up , je viens de régler le probleme du spawn dans le sol et dans les airs donc maintenant je spawn dans mon portail mais j’aimerais que le portail qui se génère se tourne suivant la direction du portail la pour l’instant j’ai

                                      BlockRegister.BlockPortail.getDefaultState()
                                      

                                      et je suppose qu’il faut que je rajoute un ```java
                                      .withProperty(BlockPortail.AXIS , ET ICI J’AVAIS vu une fonctione du genre rotatefromAngle

                                      Oui ce gif est drôle.

                                      1 réponse Dernière réponse Répondre Citer 0
                                      • EmotionFoxE Hors-ligne
                                        EmotionFox
                                        dernière édition par

                                        Tu m’a aidé alors je te rend l’appareil. Déjà on créer une variable “axis” :

                                        EnumFacing.Axis axis = EnumFacing.Axis.X;
                                        

                                        Après on prend la position du bloque dans le monde par rapport au joueur et on-dit que si il y a un bloque de portail à “droite” ou à “gauche” ce sera l’axe X et inversement en “face” ou “derrière” l’axe Z :

                                        if(this.worldServerInstance.getBlockState(new BlockPos(entity.posX + 1, entity.posY, entity.posZ)).equals(EmotionBlocks.purpuraBlock.getDefaultState()) || this.worldServerInstance.getBlockState(new BlockPos(entity.posX - 1, entity.posY, entity.posZ)).equals(EmotionBlocks.purpuraBlock.getDefaultState()))
                                        {
                                           axis = EnumFacing.Axis.Z;
                                        }
                                        else if(this.worldServerInstance.getBlockState(new BlockPos(entity.posX, entity.posY, entity.posZ + 1)).equals(EmotionBlocks.purpuraBlock.getDefaultState()) || this.worldServerInstance.getBlockState(new BlockPos(entity.posX, entity.posY, entity.posZ -1)).equals(EmotionBlocks.purpuraBlock.getDefaultState()))
                                        {
                                           axis = EnumFacing.Axis.X;
                                        }
                                        

                                        Et enfin on applique à la création du bloque notre axis :

                                        EmotionBlocks.dreamPortal.getDefaultState().withProperty(DreamPortal.AXIS, axis)
                                        

                                        Voilà ça devrait fonctionner ,)

                                        P.S: Tu a 1 chance sur deux que ça fonctionne, dans le pire des cas il suffit d’inverser Z et X.

                                        1 réponse Dernière réponse Répondre Citer 0
                                        • FlowF Hors-ligne
                                          Flow
                                          dernière édition par

                                          Merci j’en prend note 🙂

                                          Oui ce gif est drôle.

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • 1 / 1
                                          • Premier message
                                            Dernier message
                                          Design by Woryk
                                          ContactMentions Légales

                                          MINECRAFT FORGE FRANCE © 2024

                                          Powered by NodeBB