Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.69 KB | None | 0 0
  1. package de.cryptodecoder.cryptomod.utils;
  2.  
  3. import net.minecraft.client.Minecraft;
  4. import net.minecraft.init.Blocks;
  5. import net.minecraft.init.Items;
  6. import net.minecraft.item.ItemStack;
  7. import net.minecraft.nbt.NBTTagCompound;
  8. import net.minecraft.nbt.NBTTagDouble;
  9. import net.minecraft.nbt.NBTTagList;
  10. import net.minecraft.network.play.client.C10PacketCreativeInventoryAction;
  11.  
  12. public class FloMod_Item_Utils {
  13.  
  14. private static int maxvalue = Integer.MAX_VALUE;
  15.  
  16. public static ItemStack cmdblock(String befehl)
  17. {
  18. ItemStack itm = new ItemStack(Blocks.mob_spawner);
  19. NBTTagCompound base = new NBTTagCompound();
  20. NBTTagCompound blockEntityTag = new NBTTagCompound();
  21. blockEntityTag.setString("EntityId", "FallingSand");
  22. blockEntityTag.setInteger("SpawnCount", 1);
  23. blockEntityTag.setInteger("SpawnRange", 5);
  24. blockEntityTag.setInteger("RequiredPlayerRange", 100);
  25. blockEntityTag.setInteger("MinSpawnDelay", 20);
  26. blockEntityTag.setInteger("MaxSpawnDelay", 20);
  27. blockEntityTag.setInteger("MaxNearbyEntities", 1);
  28. NBTTagCompound spawnData = new NBTTagCompound();
  29. spawnData.setString("Tile", "minecraft:command_block");
  30. spawnData.setString("Block", "minecraft:command_block");
  31. spawnData.setInteger("Time", 1);
  32. NBTTagCompound tag = new NBTTagCompound();
  33. tag.setString("Command", befehl);
  34. spawnData.setTag("TileEntityData", tag);
  35. blockEntityTag.setTag("SpawnData", spawnData);
  36. base.setTag("BlockEntityTag", blockEntityTag);
  37. itm.setTagCompound(base);
  38. return itm;
  39. }
  40.  
  41. public static void generatedefaulthologram(String text) {
  42. double x = Minecraft.getMinecraft().thePlayer.posX;
  43. double y = Minecraft.getMinecraft().thePlayer.posY;
  44. double z = Minecraft.getMinecraft().thePlayer.posZ;
  45.  
  46. ItemStack itm = new ItemStack(Items.armor_stand);
  47. NBTTagCompound base = new NBTTagCompound();
  48. NBTTagCompound entityTag = new NBTTagCompound();
  49. NBTTagList list = new NBTTagList();
  50.  
  51.  
  52. NBTTagList pos = new NBTTagList();
  53. pos.appendTag(new NBTTagDouble(x));
  54. pos.appendTag(new NBTTagDouble(y));
  55. pos.appendTag(new NBTTagDouble(z));
  56.  
  57.  
  58. itm.setTagCompound(base);
  59. entityTag.setString("CustomName", text);
  60. entityTag.setInteger("CustomNameVisible", 1);
  61. entityTag.setInteger("Invisible", 1);
  62. entityTag.setInteger("NoGravity", 1);
  63. entityTag.setTag("Pos", pos);
  64. base.setTag("EntityTag", entityTag);
  65.  
  66. Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C10PacketCreativeInventoryAction(5, itm));
  67. itm.setTagCompound(null);
  68. }
  69.  
  70.  
  71.  
  72. public static void generatordefaultbypassblockhologram(String text) {
  73. double x = Minecraft.getMinecraft().thePlayer.posX;
  74. double y = Minecraft.getMinecraft().thePlayer.posY;
  75. double z = Minecraft.getMinecraft().thePlayer.posZ;
  76.  
  77. ItemStack itm = new ItemStack(Items.armor_stand);
  78. NBTTagCompound base = new NBTTagCompound();
  79. NBTTagCompound entityTag = new NBTTagCompound();
  80. NBTTagList list = new NBTTagList();
  81. NBTTagList pos = new NBTTagList();
  82. pos.appendTag(new NBTTagDouble(x));
  83. pos.appendTag(new NBTTagDouble(y));
  84. pos.appendTag(new NBTTagDouble(z));
  85. itm.setTagCompound(base);
  86. entityTag.setString("CustomName", text);
  87. entityTag.setInteger("CustomNameVisible", 1);
  88. entityTag.setInteger("Invisible", 1);
  89. entityTag.setInteger("NoGravity", 1);
  90. entityTag.setTag("Pos", pos);
  91. base.setTag("EntityTag", entityTag);
  92.  
  93.  
  94. }
  95.  
  96. public static void generatecustomposblock(double x, double y, double z, String text) {
  97. ItemStack itm = new ItemStack(Items.armor_stand);
  98. NBTTagCompound base = new NBTTagCompound();
  99. NBTTagCompound entityTag = new NBTTagCompound();
  100. NBTTagList list = new NBTTagList();
  101. NBTTagList pos = new NBTTagList();
  102. pos.appendTag(new NBTTagDouble(x));
  103. pos.appendTag(new NBTTagDouble(y));
  104. pos.appendTag(new NBTTagDouble(z));
  105. itm.setTagCompound(base);
  106. entityTag.setString("CustomName", text);
  107. entityTag.setInteger("CustomNameVisible", 1);
  108. entityTag.setInteger("Invisible", 1);
  109. entityTag.setInteger("NoGravity", 1);
  110. entityTag.setTag("Pos", pos);
  111. base.setTag("EntityTag", entityTag);
  112. Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C10PacketCreativeInventoryAction(36, itm));
  113. }
  114.  
  115. public static ItemStack Titel(String titel)
  116. {
  117. ItemStack itm = new ItemStack(Blocks.mob_spawner);
  118. NBTTagCompound base = new NBTTagCompound();
  119. NBTTagCompound blockEntityTag = new NBTTagCompound();
  120. blockEntityTag.setString("EntityId", "WitherBoss");
  121. blockEntityTag.setInteger("SpawnCount", 0);
  122. blockEntityTag.setInteger("SpawnRange", 1);
  123. blockEntityTag.setInteger("RequiredPlayerRange", maxvalue);
  124. blockEntityTag.setInteger("MinSpawnDelay", 5000);
  125. blockEntityTag.setInteger("MaxSpawnDelay", 5000);
  126. blockEntityTag.setInteger("MaxNearbyEntities", maxvalue);
  127. NBTTagCompound spawnData = new NBTTagCompound();
  128. spawnData.setString("CustomName", titel);
  129. spawnData.setInteger("CustomNameVisible", 1);
  130. NBTTagCompound cowCompound = new NBTTagCompound();
  131. cowCompound.setString("id", "Bat");
  132. NBTTagCompound effect = new NBTTagCompound();
  133. effect.setInteger("id", 14);
  134. effect.setInteger("Amplifier", 0);
  135. effect.setInteger("Duration", 2000000);
  136. effect.setByte("ShowParticles", (byte)0);
  137. NBTTagList activeEffects = new NBTTagList();
  138. activeEffects.appendTag(effect);
  139. cowCompound.setTag("ActiveEffects", activeEffects);
  140. spawnData.setTag("Riding", cowCompound);
  141. blockEntityTag.setTag("SpawnData", spawnData);
  142. base.setTag("BlockEntityTag", blockEntityTag);
  143. itm.setTagCompound(base);
  144. return itm;
  145. }
  146.  
  147. public static ItemStack customspawner(String customspawner)
  148. {
  149. String title = customspawner.replace("&", "ยง");
  150. ItemStack itm = new ItemStack(Blocks.mob_spawner);
  151. NBTTagCompound base = new NBTTagCompound();
  152. NBTTagCompound blockEntityTag = new NBTTagCompound();
  153. blockEntityTag.setString("EntityId", title);
  154. blockEntityTag.setInteger("SpawnCount", 0);
  155. blockEntityTag.setInteger("SpawnRange", 1);
  156. blockEntityTag.setInteger("RequiredPlayerRange", maxvalue);
  157. blockEntityTag.setInteger("MinSpawnDelay", 5000);
  158. blockEntityTag.setInteger("MaxSpawnDelay", 5000);
  159. blockEntityTag.setInteger("MaxNearbyEntities", maxvalue);
  160. NBTTagCompound spawnData = new NBTTagCompound();
  161. NBTTagCompound cowCompound = new NBTTagCompound();
  162. cowCompound.setString("id", "Bat");
  163. NBTTagCompound effect = new NBTTagCompound();
  164. effect.setInteger("id", 14);
  165. effect.setInteger("Amplifier", 0);
  166. effect.setInteger("Duration", 2000000);
  167. effect.setByte("ShowParticles", (byte)0);
  168. NBTTagList activeEffects = new NBTTagList();
  169. activeEffects.appendTag(effect);
  170. cowCompound.setTag("ActiveEffects", activeEffects);
  171. spawnData.setTag("Riding", cowCompound);
  172. blockEntityTag.setTag("SpawnData", spawnData);
  173. base.setTag("BlockEntityTag", blockEntityTag);
  174. itm.setTagCompound(base);
  175. return itm;
  176. }
  177.  
  178. public static ItemStack addSpawnertooffen(ItemStack itm)
  179. {
  180. ItemStack furnace = new ItemStack(Blocks.furnace);
  181. NBTTagCompound base = new NBTTagCompound();
  182. NBTTagCompound blockEntityTag = new NBTTagCompound();
  183. blockEntityTag.setShort("BurnTime", (short)0);
  184. blockEntityTag.setShort("CookTime", (short)0);
  185. blockEntityTag.setShort("CookTimeTotal", (short)200);
  186. blockEntityTag.setString("id", "Furnace");
  187. blockEntityTag.setString("Lock", "");
  188. NBTTagList items = new NBTTagList();
  189. NBTTagCompound item = new NBTTagCompound();
  190. item.setByte("Count", (byte)1);
  191. item.setShort("Damage", (short)itm.getItemDamage());
  192. item.setString("id", "minecraft:mob_spawner");
  193. item.setShort("Slot", (short)0);
  194. item.setTag("tag", itm.getTagCompound());
  195. items.appendTag(item);
  196. blockEntityTag.setTag("Items", items);
  197. base.setTag("BlockEntityTag", blockEntityTag);
  198. furnace.setTagCompound(base);
  199. return furnace;
  200. }
  201.  
  202. public static ItemStack addSpawnertooffen(ItemStack itm, String inhalt)
  203. {
  204. ItemStack furnace = new ItemStack(Blocks.furnace);
  205. NBTTagCompound base = new NBTTagCompound();
  206. NBTTagCompound blockEntityTag = new NBTTagCompound();
  207. blockEntityTag.setShort("BurnTime", (short)0);
  208. blockEntityTag.setShort("CookTime", (short)0);
  209. blockEntityTag.setShort("CookTimeTotal", (short)200);
  210. blockEntityTag.setString("id", "Furnace");
  211. blockEntityTag.setString("Lock", "");
  212. NBTTagList items = new NBTTagList();
  213. NBTTagCompound item = new NBTTagCompound();
  214. item.setByte("Count", (byte)1);
  215. item.setShort("Damage", (short)itm.getItemDamage());
  216. item.setString("id", "minecraft:"+inhalt);
  217. item.setShort("Slot", (short)0);
  218. item.setTag("tag", itm.getTagCompound());
  219. items.appendTag(item);
  220. blockEntityTag.setTag("Items", items);
  221. base.setTag("BlockEntityTag", blockEntityTag);
  222. furnace.setTagCompound(base);
  223. return furnace;
  224. }
  225.  
  226. public static ItemStack addSpawnertoChest(ItemStack itm)
  227. {
  228. ItemStack furnace = new ItemStack(Blocks.chest);
  229. NBTTagCompound base = new NBTTagCompound();
  230. NBTTagCompound blockEntityTag = new NBTTagCompound();
  231. blockEntityTag.setString("id", "Chest");
  232. blockEntityTag.setString("Lock", "");
  233. NBTTagList items = new NBTTagList();
  234. NBTTagCompound item = new NBTTagCompound();
  235. item.setByte("Count", (byte)1);
  236. item.setShort("Damage", (short)itm.getItemDamage());
  237. item.setString("id", "minecraft:mob_spawner");
  238. item.setShort("Slot", (short)0);
  239. item.setTag("tag", itm.getTagCompound());
  240. items.appendTag(item);
  241. blockEntityTag.setTag("Items", items);
  242. base.setTag("BlockEntityTag", blockEntityTag);
  243. furnace.setTagCompound(base);
  244. return furnace;
  245. }
  246.  
  247. public static ItemStack addSpawnertoHopper(ItemStack itm)
  248. {
  249. ItemStack furnace = new ItemStack(Blocks.hopper);
  250. NBTTagCompound base = new NBTTagCompound();
  251. NBTTagCompound blockEntityTag = new NBTTagCompound();
  252. blockEntityTag.setString("id", "Hopper");
  253. blockEntityTag.setString("Lock", "");
  254. NBTTagList items = new NBTTagList();
  255. NBTTagCompound item = new NBTTagCompound();
  256. item.setByte("Count", (byte)1);
  257. item.setShort("Damage", (short)itm.getItemDamage());
  258. item.setString("id", "minecraft:mob_spawner");
  259. item.setShort("Slot", (short)0);
  260. item.setTag("tag", itm.getTagCompound());
  261. items.appendTag(item);
  262. blockEntityTag.setTag("Items", items);
  263. base.setTag("BlockEntityTag", blockEntityTag);
  264. furnace.setTagCompound(base);
  265. return furnace;
  266. }
  267.  
  268. //hologram bypass
  269. public static ItemStack addSpawnertooffenHologram(ItemStack itm)
  270. {
  271. ItemStack furnace = new ItemStack(Blocks.furnace);
  272. NBTTagCompound base = new NBTTagCompound();
  273. NBTTagCompound blockEntityTag = new NBTTagCompound();
  274. blockEntityTag.setShort("BurnTime", (short)0);
  275. blockEntityTag.setShort("CookTime", (short)0);
  276. blockEntityTag.setShort("CookTimeTotal", (short)200);
  277. blockEntityTag.setString("id", "Furnace");
  278. blockEntityTag.setString("Lock", "");
  279. NBTTagList items = new NBTTagList();
  280. NBTTagCompound item = new NBTTagCompound();
  281. item.setByte("Count", (byte)1);
  282. item.setShort("Damage", (short)itm.getItemDamage());
  283. item.setString("id", "minecraft:armor_stand");
  284. item.setShort("Slot", (short)0);
  285. item.setTag("tag", itm.getTagCompound());
  286. items.appendTag(item);
  287. blockEntityTag.setTag("Items", items);
  288. base.setTag("BlockEntityTag", blockEntityTag);
  289. furnace.setTagCompound(base);
  290. return furnace;
  291. }
  292. public static ItemStack addSpawnertoChestHologram(ItemStack itm)
  293. {
  294. ItemStack furnace = new ItemStack(Blocks.chest);
  295. NBTTagCompound base = new NBTTagCompound();
  296. NBTTagCompound blockEntityTag = new NBTTagCompound();
  297. blockEntityTag.setString("id", "Chest");
  298. blockEntityTag.setString("Lock", "");
  299. NBTTagList items = new NBTTagList();
  300. NBTTagCompound item = new NBTTagCompound();
  301. item.setByte("Count", (byte)1);
  302. item.setShort("Damage", (short)itm.getItemDamage());
  303. item.setString("id", "minecraft:armor_stand");
  304. item.setShort("Slot", (short)0);
  305. item.setTag("tag", itm.getTagCompound());
  306. items.appendTag(item);
  307. blockEntityTag.setTag("Items", items);
  308. base.setTag("BlockEntityTag", blockEntityTag);
  309. furnace.setTagCompound(base);
  310. return furnace;
  311. }
  312.  
  313. public static ItemStack addSpawnertoHopperHologram(ItemStack itm)
  314. {
  315. ItemStack furnace = new ItemStack(Blocks.hopper);
  316. NBTTagCompound base = new NBTTagCompound();
  317. NBTTagCompound blockEntityTag = new NBTTagCompound();
  318. blockEntityTag.setString("id", "Hopper");
  319. blockEntityTag.setString("Lock", "");
  320. NBTTagList items = new NBTTagList();
  321. NBTTagCompound item = new NBTTagCompound();
  322. item.setByte("Count", (byte)1);
  323. item.setShort("Damage", (short)itm.getItemDamage());
  324. item.setString("id", "minecraft:armor_stand");
  325. item.setShort("Slot", (short)0);
  326. item.setTag("tag", itm.getTagCompound());
  327. items.appendTag(item);
  328. blockEntityTag.setTag("Items", items);
  329. base.setTag("BlockEntityTag", blockEntityTag);
  330. furnace.setTagCompound(base);
  331. return furnace;
  332. }
  333.  
  334. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement