forked from Slimefun/Slimefun4
-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
5 changed files
with
73 additions
and
73 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/Interfaces/NotPlaceable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.Interfaces; | ||
|
||
public interface NotPlaceable { | ||
|
||
} | ||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.Interfaces; | ||
|
||
public interface NotPlaceable { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 32 additions & 32 deletions
64
src/me/mrCookieSlime/Slimefun/api/machine/MachineConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
package me.mrCookieSlime.Slimefun.api.machine; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; | ||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; | ||
|
||
public class MachineConfig extends Config { | ||
|
||
MachineSettings global; | ||
Map<String, MachineSettings> children; | ||
|
||
public MachineConfig(String id) { | ||
super("plugins/Slimefun/machines/" + id + ".yml"); | ||
|
||
this.global = new MachineSettings(this); | ||
this.children = new HashMap<String, MachineSettings>(); | ||
} | ||
|
||
public MachineSettings getGlobalSettings() { | ||
return this.global; | ||
} | ||
|
||
public MachineSettings getSettings(AContainer item) { | ||
if (!this.children.containsKey(item.getID())) { | ||
this.children.put(item.getID(), new MachineSettings(this, item)); | ||
} | ||
|
||
return this.children.get(item.getID()); | ||
} | ||
} | ||
package me.mrCookieSlime.Slimefun.api.machine; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; | ||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; | ||
|
||
public class MachineConfig extends Config { | ||
|
||
MachineSettings global; | ||
Map<String, MachineSettings> children; | ||
|
||
public MachineConfig(String id) { | ||
super("plugins/Slimefun/machines/" + id + ".yml"); | ||
|
||
this.global = new MachineSettings(this); | ||
this.children = new HashMap<String, MachineSettings>(); | ||
} | ||
|
||
public MachineSettings getGlobalSettings() { | ||
return this.global; | ||
} | ||
|
||
public MachineSettings getSettings(AContainer item) { | ||
if (!this.children.containsKey(item.getID())) { | ||
this.children.put(item.getID(), new MachineSettings(this, item)); | ||
} | ||
|
||
return this.children.get(item.getID()); | ||
} | ||
} |
66 changes: 33 additions & 33 deletions
66
src/me/mrCookieSlime/Slimefun/api/machine/MachineSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
package me.mrCookieSlime.Slimefun.api.machine; | ||
|
||
import java.util.List; | ||
|
||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; | ||
|
||
public class MachineSettings { | ||
|
||
MachineConfig cfg; | ||
String prefix = "global"; | ||
|
||
public MachineSettings(MachineConfig cfg) { | ||
this.cfg = cfg; | ||
} | ||
|
||
public MachineSettings(MachineConfig cfg, AContainer machine) { | ||
this.cfg = cfg; | ||
this.prefix = machine.getID(); | ||
} | ||
|
||
public String getString(String path) { | ||
return this.cfg.getString(prefix + "." + path); | ||
} | ||
|
||
public int getInt(String path) { | ||
return this.cfg.getInt(prefix + "." + path); | ||
} | ||
|
||
public List<String> getStringList(String path) { | ||
return this.cfg.getStringList(prefix + "." + path); | ||
} | ||
|
||
} | ||
package me.mrCookieSlime.Slimefun.api.machine; | ||
|
||
import java.util.List; | ||
|
||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; | ||
|
||
public class MachineSettings { | ||
|
||
MachineConfig cfg; | ||
String prefix = "global"; | ||
|
||
public MachineSettings(MachineConfig cfg) { | ||
this.cfg = cfg; | ||
} | ||
|
||
public MachineSettings(MachineConfig cfg, AContainer machine) { | ||
this.cfg = cfg; | ||
this.prefix = machine.getID(); | ||
} | ||
|
||
public String getString(String path) { | ||
return this.cfg.getString(prefix + "." + path); | ||
} | ||
|
||
public int getInt(String path) { | ||
return this.cfg.getInt(prefix + "." + path); | ||
} | ||
|
||
public List<String> getStringList(String path) { | ||
return this.cfg.getStringList(prefix + "." + path); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters