-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closed #11 Ready do realease the first alpha version I guess?
- Loading branch information
1 parent
f1a3481
commit 61cdd18
Showing
8 changed files
with
329 additions
and
1 deletion.
There are no files selected for viewing
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
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,20 +1,34 @@ | ||
package de.scribble.lp.tasmod; | ||
|
||
import de.scribble.lp.tasmod.tutorial.TutorialHandler; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.common.config.Configuration; | ||
import net.minecraftforge.fml.common.event.FMLInitializationEvent; | ||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; | ||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; | ||
|
||
public class ClientProxy extends CommonProxy{ | ||
|
||
public static Configuration config; | ||
|
||
static TutorialHandler playbackTutorial; | ||
|
||
public void preInit(FMLPreInitializationEvent ev) { | ||
config = new Configuration(ev.getSuggestedConfigurationFile()); | ||
Config.reloadClientConfig(config); | ||
super.preInit(ev); | ||
} | ||
public void init(FMLInitializationEvent ev) { | ||
playbackTutorial=new TutorialHandler((short)1); | ||
MinecraftForge.EVENT_BUS.register(new InfoGui()); | ||
MinecraftForge.EVENT_BUS.register(playbackTutorial); | ||
|
||
super.init(ev); | ||
} | ||
public void postInit(FMLPostInitializationEvent ev) { | ||
super.postInit(ev); | ||
} | ||
public static TutorialHandler getPlaybackTutorial() { | ||
return playbackTutorial; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package de.scribble.lp.tasmod; | ||
|
||
import de.scribble.lp.tasmod.tutorial.TutorialHandler; | ||
import net.minecraftforge.common.config.Configuration; | ||
|
||
public class Config { | ||
public static void reloadServerConfig(Configuration serverconfig) { | ||
|
||
} | ||
public static void reloadClientConfig(Configuration clientconfig) { | ||
clientconfig.load(); | ||
TutorialHandler.istutorial=clientconfig.get("Tutorial","Enabled",true,"If the tutorial is enabled").getBoolean(); | ||
clientconfig.save(); | ||
} | ||
} |
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
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
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
38 changes: 38 additions & 0 deletions
38
src/main/java/de/scribble/lp/tasmod/tutorial/CommandPlaybacktutorial.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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package de.scribble.lp.tasmod.tutorial; | ||
|
||
import de.scribble.lp.tasmod.ClientProxy; | ||
import net.minecraft.command.CommandBase; | ||
import net.minecraft.command.CommandException; | ||
import net.minecraft.command.ICommandSender; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.server.MinecraftServer; | ||
|
||
public class CommandPlaybacktutorial extends CommandBase{ | ||
|
||
@Override | ||
public String getName() { | ||
return "playbacktutorial"; | ||
} | ||
|
||
@Override | ||
public String getUsage(ICommandSender sender) { | ||
return "/playbacktutorial"; | ||
} | ||
|
||
@Override | ||
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { | ||
if(sender instanceof EntityPlayer) { | ||
if(!server.isDedicatedServer()) { | ||
TutorialHandler handler=ClientProxy.getPlaybackTutorial(); | ||
if(handler.istutorial) { | ||
handler.istutorial=false; | ||
ClientProxy.config.get("Tutorial","Enabled",true,"If the tutorial is enabled").set(false); | ||
ClientProxy.config.save(); | ||
}else { | ||
handler.setState((short)1); | ||
handler.istutorial=true; | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.