Advertisement
Guest User

Module

a guest
Nov 28th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. package amplified.module;
  2.  
  3. import amplified.client.Wrapper;
  4. import amplified.utils.FileManager;
  5. import net.minecraft.client.gui.GuiScreen;
  6. import net.minecraft.entity.Entity;
  7. import net.minecraft.entity.player.EntityPlayer;
  8. import net.minecraft.network.play.server.S02PacketChat;
  9.  
  10. public class Module extends Wrapper{
  11.  
  12. private String name;
  13. private String desc;
  14. private int keybind;
  15. private int color;
  16. private Category category;
  17. private boolean isvisible;
  18. private boolean state;
  19. private boolean save = true;
  20. public boolean isToggled;
  21.  
  22. public Module(String name, int key, Category category, boolean isvisible){
  23. this.setName(name);
  24. this.setKeyBind(key);
  25. this.setCategory(category);
  26. this.setVisible(isvisible);
  27. getBasicUtils().printToConsole(name + " Initialized.");
  28. }
  29.  
  30. public final void setName(String name){
  31. this.name = name;
  32. }
  33.  
  34. public final void setKeyBind(int i){
  35. this.keybind = i;
  36. }
  37.  
  38. public final void setCategory(Category category){
  39. this.category = category;
  40. }
  41.  
  42. public final void setVisible(boolean b){
  43. this.isvisible = b;
  44. }
  45.  
  46. public final void setState(boolean b){
  47. this.state = b;
  48. if(getState()) {
  49. onEnable();
  50. } else {
  51. onDisable();
  52. }
  53. try {
  54. FileManager.getInstance().saveMods();
  55. } catch (Exception e) {
  56. e.printStackTrace();
  57. }
  58. }
  59.  
  60. public final void setSavable(boolean b){
  61. this.save = b;
  62. }
  63.  
  64. public final boolean isName(String s){
  65. if(s.equals(name))return true;
  66. return false;
  67. }
  68.  
  69. public final boolean isKeyBind(int s){
  70. if(s == (keybind))return true;
  71. return false;
  72. }
  73.  
  74. public final boolean isColor(int s){
  75. if(s == color)return true;
  76. return false;
  77. }
  78.  
  79. public final boolean isCategory(Category s){
  80. if(s == category)return true;
  81. return false;
  82. }
  83.  
  84. public final boolean isVisible(boolean s){
  85. if(s == isvisible)return true;
  86. return false;
  87. }
  88.  
  89. public final boolean isState(boolean s){
  90. if(s == state)return true;
  91. return false;
  92. }
  93.  
  94. public final boolean isSavable(boolean s){
  95. if(s == save)return true;
  96. return false;
  97. }
  98.  
  99. public final String getName(){
  100. return name;
  101. }
  102.  
  103. public final String getDescription(){
  104. return desc;
  105. }
  106.  
  107. public final int getKeyBind(){
  108. return keybind;
  109. }
  110.  
  111. public final int getColor(){
  112. return color;
  113. }
  114.  
  115. public final Category getCategory(){
  116. return category;
  117. }
  118.  
  119. public final boolean getVisible(){
  120. return isvisible;
  121. }
  122.  
  123. public final boolean getState(){
  124. return state;
  125. }
  126.  
  127. public final boolean getSavable(){
  128. return save;
  129. }
  130.  
  131. public void isToggled(){
  132.  
  133. }
  134.  
  135. public void setToggled(boolean shouldToggle) {
  136. if(shouldToggle) {
  137. onEnable();
  138. isToggled = true;
  139. } else {
  140. onDisable();
  141. isToggled = false;
  142. }
  143. }
  144.  
  145. public void onToggle(){
  146. setToggled(!getToggled());
  147. }
  148.  
  149. public boolean getToggled(){
  150. return isToggled;
  151. }
  152.  
  153. public void onEnable() {
  154. }
  155.  
  156. public void onDisable(){
  157. }
  158.  
  159. public void onGameTick(){
  160. }
  161.  
  162. public void preMotionUpdate(){
  163. }
  164.  
  165. public void onMotionUpdate(){
  166. }
  167.  
  168. public void postMotionUpdate(){
  169. }
  170.  
  171. public void preAttackEntity(EntityPlayer par1EntityPlayer, Entity par2Entity){
  172. }
  173.  
  174. public void onAttackEntity(EntityPlayer par1EntityPlayer, Entity par2Entity){
  175. }
  176.  
  177. public void postAttackEntity(EntityPlayer par1EntityPlayer, Entity par2Entity){
  178. }
  179.  
  180. public void onRender(){
  181. }
  182.  
  183. public void onClickBlock(int i, int j, int k, int l){
  184. }
  185.  
  186. public void onPlayerDeath(){
  187. }
  188.  
  189. public void onPlayerRespawn(){
  190. }
  191.  
  192. public void onMiddleClick(){
  193. }
  194.  
  195. public GuiScreen onGuiScreen(GuiScreen guiscreen){
  196. return guiscreen;
  197. }
  198.  
  199. public boolean onSendChatMessage(String s){
  200. return true;
  201. }
  202.  
  203. public boolean onReceiveChatMessage(S02PacketChat packet){
  204. return true;
  205. }
  206.  
  207. public final void toggleModule(){
  208. setState(!state);
  209. onToggle();
  210. //if(getSavable())ConfigurationManager.getInstance().getConfig(ConfigModules.class).saveConfiguration();
  211. }
  212. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement