Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SubscribeEvent
- public void onEntityJoinWorld(PlayerEvent.PlayerLoggedInEvent event) {
- String player = event.player.getDisplayName();
- File ficheJoueur = new File("Heimnor/Joueurs.dat");
- System.out.println("test");
- File fiche = new File("Heimnor/Fiches.dat");
- try {
- if (!ficheJoueur.exists()) {
- ficheJoueur.getParentFile().mkdirs();
- ficheJoueur.createNewFile();
- NBTTagCompound indextag = new NBTTagCompound();
- NBTTagCompound compound = new NBTTagCompound();
- indextag.setTag(player, compound);
- NbtCsFile.setNbtTagCompound(ficheJoueur, "index", indextag);
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- if (!fiche.exists()) {
- try {
- fiche.createNewFile();
- NbtCsFile.setNbtTagCompound(fiche, "index", new NBTTagCompound());
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement