Challenge - Pièce fermée
-
Tu n’es pas obliger de tous les charger en même temps.
Lorsque tu as check tout les chunk adjacent du chunk A, tu peux décharger le chunk A.
Il faudrait vraiment un nombre gigantesque de chunk pour que la RAM sature. -
@‘Blackout’:
Tu n’es pas obliger de tous les charger en même temps.
Lorsque tu as check tout les chunk adjacent du chunk A, tu peux décharger le chunk A.
Il faudrait vraiment un nombre gigantesque de chunk pour que la RAM sature.As-tu déjà essayé de générer des chunks ? Si oui, tu devrais savoir que ça prend une quantité de RAM folle, de plus, il faudra désynchroniser le code dans un tick handler ou ça fera crasher ton serveur.
Ensuite, moi je pense qu’une pièce de 310^(9) par 256 par 310^(9) est une pièce ouverte.
-
Si les chunks n’ont toujours pas été généré, c’est considéré comme du vide, donc pièce ouverte

Tu peux faire le traitement avec seulement 5 chunks chargé a la fois, il suffit de décharger ceux qui ne servent plus pour le calcul.
Aucunement besoin de créer un tick handler, il suffit de lancer le traitement dans un nouveau thread et de protéger les accès concurrentiel le mieux possible.Mais bon dans la grande majeure partie des cas, les salles ne seront jamais aussi grande.
Le but est de faire un système qui n’est pas limité par la taille, mais par les performance de la machine et avec un algorithme optimisé. -
@‘Blackout’:
Si les chunks n’ont toujours pas été généré, c’est considéré comme du vide, donc pièce ouverte

Tu peux faire le traitement avec seulement 5 chunks chargé a la fois, il suffit de décharger ceux qui ne servent plus pour le calcul.
Aucunement besoin de créer un tick handler, il suffit de lancer le traitement dans un nouveau thread et de protéger les accès concurrentiel le mieux possible.Mais bon dans la grande majeure partie des cas, les salles ne seront jamais aussi grande.
Le but est de faire un système qui n’est pas limité par la taille, mais par les performance de la machine et avec un algorithme optimisé.J’ai fait quelques essais et il s’avère que lorsque l’on appelle la méthode getBlockState (je code en 1.8) dans la classe World cette méthode va automatiquement charger/générer les chunks donc j’aimerais savoir quoi faire lorsque le chunk n’est pas chargé, soit charger le chunk et continuer l’algorithme ou considérer la pièce comme ouverte ?
A part ce dernier problème, tout avance comme il faut pour l’instant
. -
bonjour j’annonce que je vais moi aussi rentrer dans la compétition et petit précision s’il vous plait : le block sera t’il au sol , dans le sol ou à n’importe quel endroit de la piece. sinon juste une question cet algorythme est pour le mod settlements non ?
le code avance bien mais j’ai un petit problème : étant donne qu’il faut testé les block un seule fois j’ai recourd à un tableau , probleme , si j’ai recours à un tableau il faut qu’il soit individuelle a chaque block car sinon si je met deux block dans la meme piece il n’y en aura qu’un qui fonctionnera . donc précise : le code appartiendra a un block à part entiere ou ce code fera partis d’un autre block qui testera tout les block pour connaitre les piece .
-
Bah comment qu’il fonctionne l’Airlock de Galacticraft?

-
j’en sais rien mais moi j’ai fini la chose en partant du principe qu’une piece de 320 par je ne sais combien par 320 était un piece ouverte du coup pas besoin de charger les chunk
-
j’en sais rien mais moi j’ai fini contacter moi par mp

-
bon apres environ 1 mois d’attente je poste le code
:::
classe principlalepackage com.mathiasetampes.algorythme.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraftforge.common.MinecraftForge; import com.mathiasetampes.algorythme.proxy.CommonProxy; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "algorythme",name="Algorytme",version="1.0.0") public class algorythme { @Instance("algorythme") public static algorythme instance; public static final String MODID = "villagePNJ"; @SidedProxy(clientSide = "com.mathiasetampes.algorythme.proxy.ClientProxy", serverSide = "com.mathiasetampes.algorythme.proxy.CommonProxy") public static CommonProxy proxy; public static Block algo; @EventHandler public void preInit(FMLPreInitializationEvent event) { algo = new Algo(Material.rock).setBlockName("Algo").setBlockTextureName("modtutoriel:block_tutoriel"); GameRegistry.registerBlock(algo, "block_tutoriel"); GameRegistry.registerTileEntity(TileEntityAire.class, "algorythme:TileEntityAire"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); FMLCommonHandler.instance().bus().register(new AllEvent()); MinecraftForge.EVENT_BUS.register(new AllEvent()); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }classe du block
package com.mathiasetampes.algorythme.common; import java.util.Random; import com.mojang.realmsclient.dto.PlayerInfo; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; public class Algo extends Block { public static int Intermediaire = 0; public String marqueur[][][] = new String[320][256][320]; public int xDepart,zDepart = 0 ; public boolean Interieur,Erreur = false; public EntityPlayer playerV; protected Algo(Material material) { super(material); this.setCreativeTab(CreativeTabs.tabBlock); this.setTickRandomly(true); for(int i = 0; i< 320; i++) { for(int j = 0; j< 256; j++) { for(int k = 0; k< 320; k++) { marqueur*[j][k] = ""; } } } } public void updateTick(World world, int x, int y, int z, Random random ) // { world.scheduleBlockUpdate(x, y, z, algorythme.algo, 120); if((Intermediaire==15 || Intermediaire==25)&& Erreur==true) { AlgorythmeVide(world ,x , y , z,x , y , z); Erreur = false; } else if(Interieur == true && marqueur[xDepart-playerV.getPlayerCoordinates().posX+160][playerV.getPlayerCoordinates().posY][zDepart-playerV.getPlayerCoordinates().posZ+160].contains(Ids(world,x,y,z))==false &&(Intermediaire!=15 && Intermediaire!=25))//Ids(world,x,y,z) { Interieur = false ; System.out.println(playerV.getPlayerCoordinates().posX); playerV.addChatMessage(new ChatComponentTranslation("tile.chat.1")); AlgorythmeVide(world , x , y , z ,x,y,z); } } @Override public TileEntity createTileEntity(World world, int metadata) { return new TileEntityAire(); } @Override public boolean hasTileEntity(int metadata) { return true; } public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if(!world.isRemote) { xDepart = x; zDepart = z; Intermediaire = Algorythme(world ,x ,y ,z,x , y , z); playerV = player; if(Intermediaire==5){player.addChatMessage(new ChatComponentTranslation("tile.chat.2"));} else if(Intermediaire==25){player.addChatMessage(new ChatComponentTranslation("tile.chat.3"));} else if(Intermediaire==35){player.addChatMessage(new ChatComponentTranslation("tile.chat.4"));} else if(Intermediaire==15){player.addChatMessage(new ChatComponentTranslation("tile.chat.5"));} return true; } return false; } public int Algorythme(World world ,int x , int y , int z,int xSrc,int ySrc,int zSrc) { if(xDepart-x+160<320 && xDepart-x+160 > 0 && zDepart-z+160<320 && zDepart-z+160 > 0) { if((world.getBlock(x, y, z) == Blocks.air || world.getBlock(x, y, z) == algorythme.algo)&& marqueur[xDepart-x+160][y][zDepart-z+160].contains(Ids(world,xSrc,ySrc,zSrc))== false) { for(int i = y; i < 256 ; i++) { if(world.getBlock(x, i, z) != Blocks.air && world.getBlock(x, i, z) != algorythme.algo) { break; } if(i == 254) { Erreur = true ; System.out.println("extérieur"); return 25; } } marqueur[xDepart-x+160][y][zDepart-z+160]=marqueur[xDepart-x+160][y][zDepart-z+160]+Ids(world ,xSrc, ySrc , zSrc); System.out.println("x="+x+" y="+y+" z="+z ); if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x , y+1 , z,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x+1 , y , z,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x-1 , y , z,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x , y , z+1,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x , y , z-1,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} Interieur = true ; return 5; } Erreur = true ; return 35; } return 15; } public void AlgorythmeVide(World world ,int x , int y , int z,int xSrc,int ySrc,int zSrc) { if((world.getBlock(x, y, z) == Blocks.air || world.getBlock(x, y, z) == algorythme.algo)&& marqueur[xDepart-x+160][y][zDepart-z+160].contains(Ids(world,xSrc,ySrc,zSrc))== true) { marqueur[xDepart-x+160][y][zDepart-z+160] = marqueur[xDepart-x+160][y][zDepart-z+160].replace(Ids(world ,xSrc, ySrc , zSrc) ,""); //peut etre un bug à cause de Ids qui est un string et non un cahr sequence AlgorythmeVide(world , x , y-1 , z,xSrc , ySrc , zSrc); AlgorythmeVide(world , x , y+1 , z,xSrc , ySrc , zSrc); AlgorythmeVide(world , x+1 , y , z,xSrc , ySrc , zSrc); AlgorythmeVide(world , x-1 , y , z,xSrc , ySrc , zSrc); AlgorythmeVide(world , x , y , z+1,xSrc , ySrc , zSrc); AlgorythmeVide(world , x , y , z-1,xSrc , ySrc , zSrc); return; } return; } public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); world.scheduleBlockUpdate(x, y, z, algorythme.algo, 15); } public String Ids(World world , int x ,int y ,int z) { TileEntity te = world.getTileEntity(x, y, z); // Obtient le tile entité du bloc if(te instanceof TileEntityAire) { TileEntityAire tileTuto = (TileEntityAire)te; return ","+tileTuto.getIdsString(); } return ""; } }classe de la tileEntity
package com.mathiasetampes.algorythme.common; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; public class TileEntityAire extends TileEntity { public int ids; public String str = ""; @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); this.ids = compound.getInteger("Ids"); } @Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setInteger("Ids", this.ids); } public void UpIds(int i) { this.ids=i; return; } public int getIds() { return this.ids; } public String getIdsString() { str=""; str=str+ids; return this.str; } }classe des events
package com.mathiasetampes.algorythme.common; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.BlockEvent.PlaceEvent; public class AllEvent { int TabIds[] = new int[50]; @SubscribeEvent public void PlaceEvent(PlaceEvent event) { TileEntity te = event.world.getTileEntity(event.x, event.y, event.z); // Obtient le tile entité du bloc if(te instanceof TileEntityAire) { for(int i = 0;i<50;i++) { TileEntityAire tileTuto = (TileEntityAire)te; if(TabIds*!=1) { tileTuto.UpIds(i); TabIds* = 1; break; } } } } public void BreakEvent(BlockEvent.BreakEvent event) { TileEntity te = event.world.getTileEntity(event.x, event.y, event.z); // Obtient le tile entité du bloc if(te instanceof TileEntityAire) { TileEntityAire tileTuto = (TileEntityAire)te; TabIds[tileTuto.getIds()] = 0; } } }:::
-
@‘Asmath’:
bon apres environ 1 mois d’attente je poste le code
:::
classe principlalepackage com.mathiasetampes.algorythme.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraftforge.common.MinecraftForge; import com.mathiasetampes.algorythme.proxy.CommonProxy; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "algorythme",name="Algorytme",version="1.0.0") public class algorythme { @Instance("algorythme") public static algorythme instance; public static final String MODID = "villagePNJ"; @SidedProxy(clientSide = "com.mathiasetampes.algorythme.proxy.ClientProxy", serverSide = "com.mathiasetampes.algorythme.proxy.CommonProxy") public static CommonProxy proxy; public static Block algo; @EventHandler public void preInit(FMLPreInitializationEvent event) { algo = new Algo(Material.rock).setBlockName("Algo").setBlockTextureName("modtutoriel:block_tutoriel"); GameRegistry.registerBlock(algo, "block_tutoriel"); GameRegistry.registerTileEntity(TileEntityAire.class, "algorythme:TileEntityAire"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); FMLCommonHandler.instance().bus().register(new AllEvent()); MinecraftForge.EVENT_BUS.register(new AllEvent()); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }classe du block
package com.mathiasetampes.algorythme.common; import java.util.Random; import com.mojang.realmsclient.dto.PlayerInfo; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; public class Algo extends Block { public static int Intermediaire = 0; public String marqueur[][][] = new String[320][256][320]; public int xDepart,zDepart = 0 ; public boolean Interieur,Erreur = false; public EntityPlayer playerV; protected Algo(Material material) { super(material); this.setCreativeTab(CreativeTabs.tabBlock); this.setTickRandomly(true); for(int i = 0; i< 320; i++) { for(int j = 0; j< 256; j++) { for(int k = 0; k< 320; k++) { marqueur*[j][k] = ""; } } } } public void updateTick(World world, int x, int y, int z, Random random ) // { world.scheduleBlockUpdate(x, y, z, algorythme.algo, 120); if((Intermediaire==15 || Intermediaire==25)&& Erreur==true) { AlgorythmeVide(world ,x , y , z,x , y , z); Erreur = false; } else if(Interieur == true && marqueur[xDepart-playerV.getPlayerCoordinates().posX+160][playerV.getPlayerCoordinates().posY][zDepart-playerV.getPlayerCoordinates().posZ+160].contains(Ids(world,x,y,z))==false &&(Intermediaire!=15 && Intermediaire!=25))//Ids(world,x,y,z) { Interieur = false ; System.out.println(playerV.getPlayerCoordinates().posX); playerV.addChatMessage(new ChatComponentTranslation("tile.chat.1")); AlgorythmeVide(world , x , y , z ,x,y,z); } } @Override public TileEntity createTileEntity(World world, int metadata) { return new TileEntityAire(); } @Override public boolean hasTileEntity(int metadata) { return true; } public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if(!world.isRemote) { xDepart = x; zDepart = z; Intermediaire = Algorythme(world ,x ,y ,z,x , y , z); playerV = player; if(Intermediaire==5){player.addChatMessage(new ChatComponentTranslation("tile.chat.2"));} else if(Intermediaire==25){player.addChatMessage(new ChatComponentTranslation("tile.chat.3"));} else if(Intermediaire==35){player.addChatMessage(new ChatComponentTranslation("tile.chat.4"));} else if(Intermediaire==15){player.addChatMessage(new ChatComponentTranslation("tile.chat.5"));} return true; } return false; } public int Algorythme(World world ,int x , int y , int z,int xSrc,int ySrc,int zSrc) { if(xDepart-x+160<320 && xDepart-x+160 > 0 && zDepart-z+160<320 && zDepart-z+160 > 0) { if((world.getBlock(x, y, z) == Blocks.air || world.getBlock(x, y, z) == algorythme.algo)&& marqueur[xDepart-x+160][y][zDepart-z+160].contains(Ids(world,xSrc,ySrc,zSrc))== false) { for(int i = y; i < 256 ; i++) { if(world.getBlock(x, i, z) != Blocks.air && world.getBlock(x, i, z) != algorythme.algo) { break; } if(i == 254) { Erreur = true ; System.out.println("extérieur"); return 25; } } marqueur[xDepart-x+160][y][zDepart-z+160]=marqueur[xDepart-x+160][y][zDepart-z+160]+Ids(world ,xSrc, ySrc , zSrc); System.out.println("x="+x+" y="+y+" z="+z ); if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x , y+1 , z,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x+1 , y , z,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x-1 , y , z,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x , y , z+1,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} if(Algorythme(world , x , y , z-1,xSrc , ySrc , zSrc)==25){return 25;} else if(Algorythme(world , x , y-1 , z,xSrc , ySrc , zSrc )==15){return 15;} Interieur = true ; return 5; } Erreur = true ; return 35; } return 15; } public void AlgorythmeVide(World world ,int x , int y , int z,int xSrc,int ySrc,int zSrc) { if((world.getBlock(x, y, z) == Blocks.air || world.getBlock(x, y, z) == algorythme.algo)&& marqueur[xDepart-x+160][y][zDepart-z+160].contains(Ids(world,xSrc,ySrc,zSrc))== true) { marqueur[xDepart-x+160][y][zDepart-z+160] = marqueur[xDepart-x+160][y][zDepart-z+160].replace(Ids(world ,xSrc, ySrc , zSrc) ,""); //peut etre un bug à cause de Ids qui est un string et non un cahr sequence AlgorythmeVide(world , x , y-1 , z,xSrc , ySrc , zSrc); AlgorythmeVide(world , x , y+1 , z,xSrc , ySrc , zSrc); AlgorythmeVide(world , x+1 , y , z,xSrc , ySrc , zSrc); AlgorythmeVide(world , x-1 , y , z,xSrc , ySrc , zSrc); AlgorythmeVide(world , x , y , z+1,xSrc , ySrc , zSrc); AlgorythmeVide(world , x , y , z-1,xSrc , ySrc , zSrc); return; } return; } public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); world.scheduleBlockUpdate(x, y, z, algorythme.algo, 15); } public String Ids(World world , int x ,int y ,int z) { TileEntity te = world.getTileEntity(x, y, z); // Obtient le tile entité du bloc if(te instanceof TileEntityAire) { TileEntityAire tileTuto = (TileEntityAire)te; return ","+tileTuto.getIdsString(); } return ""; } }classe de la tileEntity
package com.mathiasetampes.algorythme.common; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; public class TileEntityAire extends TileEntity { public int ids; public String str = ""; @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); this.ids = compound.getInteger("Ids"); } @Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setInteger("Ids", this.ids); } public void UpIds(int i) { this.ids=i; return; } public int getIds() { return this.ids; } public String getIdsString() { str=""; str=str+ids; return this.str; } }classe des events
package com.mathiasetampes.algorythme.common; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.BlockEvent.PlaceEvent; public class AllEvent { int TabIds[] = new int[50]; @SubscribeEvent public void PlaceEvent(PlaceEvent event) { TileEntity te = event.world.getTileEntity(event.x, event.y, event.z); // Obtient le tile entité du bloc if(te instanceof TileEntityAire) { for(int i = 0;i<50;i++) { TileEntityAire tileTuto = (TileEntityAire)te; if(TabIds*!=1) { tileTuto.UpIds(i); TabIds* = 1; break; } } } } public void BreakEvent(BlockEvent.BreakEvent event) { TileEntity te = event.world.getTileEntity(event.x, event.y, event.z); // Obtient le tile entité du bloc if(te instanceof TileEntityAire) { TileEntityAire tileTuto = (TileEntityAire)te; TabIds[tileTuto.getIds()] = 0; } } }:::
Désolé de dire çà mais c’est l’un des codes les moins propres que j’ai jamais vu ! (“on recherche la propreté du code”)
De plus je suis pas sûr que on code respecte les consignes : “Non aucune taille limite” or si j’ai bien compris ton code (ce qui n’est pas sûr), ton code est limité par ton array de string (new String[320][256][320]). -
oui la taille est limiter par l’array de mon string mais franchement une maison de 320 sur 320 c’est pas une maison apres on peut augmenter mais tu lagueras et pour la propreté je travaille dessus mais c’est pas ma spécialité la propreté :s
-
@‘Asmath’:
oui la taille est limiter par l’array de mon string mais franchement une maison de 320 sur 320 c’est pas une maison apres on peut augmenter mais tu lagueras et pour la propreté je travaille dessus mais c’est pas ma spécialité la propreté :s
D’après ce que j’ai vu, le plus gros problème étant que tu ne respectes pas la convention java, le second étant que if (boolean == true) est la même chose que if(boolean) et if (boolean == false) est égal à if (!boolean)
-
meric de cette aide precieuse
-
@‘Asmath’:
meric de cette aide precieuse
pour la convention java :
-les variables commencent par une minuscule;
-les fonctions commencent par une minuscule;
-les classe par une majuscule.
mais chez toi, des fois les variables commencent par une minuscule, des fois par une majuscule, même chose pour les méthodes.<<dois-je mettre=“” une=“” majuscule=“” ?<br=“”>-Random.nextBoolean()
-ah ok>></dois-je> -
sinon si tu veux le block pour un mod tu peut aller ici https://www.youtube.com/watch?v=23rTg1eRoYM
-
Dsl de cette réponse tardive, j’ai très peu de temps en ce moment

Comme l’a dit Scarex, il ne doit pas y avoir de limite. Ensuite rien qu’a première vu, ton code a quelques soucis.
Un bloc ne doit pas avoir d’attribut xDepart, vu qu’il n’y a qu’une seule instance de la classe Block chargé en mémoire.Concernant le bloc de départ, il peut se trouver n’importe ou.
Pour le mod settlement, c’était prévu a long long terme d’y incorporer un algo de la sorte. -
d’accord avec un amis qui programme je suis en train de faire un seconde version du mod plus propre et plus efficace pour les limites je suis encore en train de reflechir mais il me faut une confirmtion : droit ou non d’utiliser un fichier texte pour stoker l’information
-
Oui tu as le droit d’utiliser le disque dur, mais le fichier texte, a mon avis ce n’est pas le plus efficace.
-
oui effectivement mon ami vient de me parler des hashtable et c’est bien plus pratique
-
Voilà une V2 vient d’etre terminer la seule chose qui manque , si elle manque , est la sauvegarde des donnés faut-il en faire une ou non ?