Skip to content

Commit

Permalink
Fix typo in path and add extra messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre601 committed Nov 28, 2022
1 parent 71515d9 commit d1275aa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ch.andre601</groupId>
<artifactId>IAxPresenceFootsteps</artifactId>
<version>1.2.1</version>
<version>1.3.0-BETA</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import ch.andre601.iaxpresencefootsteps.util.constants.Messages;
import ch.andre601.iaxpresencefootsteps.util.generator.JSONCreator;
import ch.andre601.iaxpresencefootsteps.util.generator.NewIAJSONCreator;
import ch.andre601.iaxpresencefootsteps.util.generator.OldIAJSONCreator;
import ch.andre601.iaxpresencefootsteps.util.generator.IAJSONCreator;
import ch.andre601.iaxpresencefootsteps.util.generator.LegacyIAJSONCreator;
import ch.andre601.iaxpresencefootsteps.util.message.MessageUtil;
import ch.andre601.iaxpresencefootsteps.util.message.PaperMessageUtil;
import ch.andre601.iaxpresencefootsteps.util.message.SpigotMessageUtils;
Expand Down Expand Up @@ -79,10 +79,12 @@ public void startPlugin(){

Path iaFolder = getDataFolder().getParentFile().toPath().resolve("ItemsAdder");
if(iaFolder.resolve("contents").toFile().exists() && iaFolder.resolve("contents").toFile().isDirectory()){
jsonCreator = new NewIAJSONCreator(this);
jsonCreator = new IAJSONCreator(this);
getMessageUtil().sendMessage("<grey>Found contents folder! Using new JSONCreator for ItemsAdder 3.3.0+...");
}else
if(iaFolder.resolve("data").toFile().exists() && iaFolder.resolve("data").toFile().isDirectory()){
jsonCreator = new OldIAJSONCreator(this);
jsonCreator = new LegacyIAJSONCreator(this);
getMessageUtil().sendMessage("<grey>Found data folder! Using old JSONCreator for ItemsAdder 3.2.5 and older...");
}else{
getMessageUtil().sendMessage("<red>Couldn't resolve ItemsAdder add-on folder structure!");
manager.disablePlugin(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

import java.io.File;

public class NewIAJSONCreator implements JSONCreator{
public class IAJSONCreator implements JSONCreator{

private final IAxPresenceFootsteps plugin;

private final File contents;
private final File blockmap;
private final File cachedBlocks;

public NewIAJSONCreator(IAxPresenceFootsteps plugin){
public IAJSONCreator(IAxPresenceFootsteps plugin){
this.plugin = plugin;

String pluginsDirectory = plugin.getDataFolder().getParent();

this.contents = new File(pluginsDirectory + "/ItemsAdder/contents/");
this.blockmap = new File(pluginsDirectory + "ItemsAdder/contents/presencefootsteps/resourcepack/presencefootsteps/config/blockmap.json");
this.blockmap = new File(pluginsDirectory + "/ItemsAdder/contents/presencefootsteps/resourcepack/presencefootsteps/config/blockmap.json");
this.cachedBlocks = new File(pluginsDirectory + "/ItemsAdder/storage/", "real_blocks_note_ids_cache.yml");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

import java.io.File;

public class OldIAJSONCreator implements JSONCreator{
public class LegacyIAJSONCreator implements JSONCreator{

private final IAxPresenceFootsteps plugin;

private final File itemsPacks;
private final File blockmap;
private final File cachedBlocks;

public OldIAJSONCreator(IAxPresenceFootsteps plugin){
public LegacyIAJSONCreator(IAxPresenceFootsteps plugin){
this.plugin = plugin;

String pluginsDirectory = plugin.getDataFolder().getParent();
Expand Down

0 comments on commit d1275aa

Please sign in to comment.