Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.cryptodecoder.cryptomod.utils;
- import net.minecraft.client.Minecraft;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.Items;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagDouble;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.network.play.client.C10PacketCreativeInventoryAction;
- public class FloMod_Item_Utils {
- private static int maxvalue = Integer.MAX_VALUE;
- public static ItemStack cmdblock(String befehl)
- {
- ItemStack itm = new ItemStack(Blocks.mob_spawner);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setString("EntityId", "FallingSand");
- blockEntityTag.setInteger("SpawnCount", 1);
- blockEntityTag.setInteger("SpawnRange", 5);
- blockEntityTag.setInteger("RequiredPlayerRange", 100);
- blockEntityTag.setInteger("MinSpawnDelay", 20);
- blockEntityTag.setInteger("MaxSpawnDelay", 20);
- blockEntityTag.setInteger("MaxNearbyEntities", 1);
- NBTTagCompound spawnData = new NBTTagCompound();
- spawnData.setString("Tile", "minecraft:command_block");
- spawnData.setString("Block", "minecraft:command_block");
- spawnData.setInteger("Time", 1);
- NBTTagCompound tag = new NBTTagCompound();
- tag.setString("Command", befehl);
- spawnData.setTag("TileEntityData", tag);
- blockEntityTag.setTag("SpawnData", spawnData);
- base.setTag("BlockEntityTag", blockEntityTag);
- itm.setTagCompound(base);
- return itm;
- }
- public static void generatedefaulthologram(String text) {
- double x = Minecraft.getMinecraft().thePlayer.posX;
- double y = Minecraft.getMinecraft().thePlayer.posY;
- double z = Minecraft.getMinecraft().thePlayer.posZ;
- ItemStack itm = new ItemStack(Items.armor_stand);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound entityTag = new NBTTagCompound();
- NBTTagList list = new NBTTagList();
- NBTTagList pos = new NBTTagList();
- pos.appendTag(new NBTTagDouble(x));
- pos.appendTag(new NBTTagDouble(y));
- pos.appendTag(new NBTTagDouble(z));
- itm.setTagCompound(base);
- entityTag.setString("CustomName", text);
- entityTag.setInteger("CustomNameVisible", 1);
- entityTag.setInteger("Invisible", 1);
- entityTag.setInteger("NoGravity", 1);
- entityTag.setTag("Pos", pos);
- base.setTag("EntityTag", entityTag);
- Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C10PacketCreativeInventoryAction(5, itm));
- itm.setTagCompound(null);
- }
- public static void generatordefaultbypassblockhologram(String text) {
- double x = Minecraft.getMinecraft().thePlayer.posX;
- double y = Minecraft.getMinecraft().thePlayer.posY;
- double z = Minecraft.getMinecraft().thePlayer.posZ;
- ItemStack itm = new ItemStack(Items.armor_stand);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound entityTag = new NBTTagCompound();
- NBTTagList list = new NBTTagList();
- NBTTagList pos = new NBTTagList();
- pos.appendTag(new NBTTagDouble(x));
- pos.appendTag(new NBTTagDouble(y));
- pos.appendTag(new NBTTagDouble(z));
- itm.setTagCompound(base);
- entityTag.setString("CustomName", text);
- entityTag.setInteger("CustomNameVisible", 1);
- entityTag.setInteger("Invisible", 1);
- entityTag.setInteger("NoGravity", 1);
- entityTag.setTag("Pos", pos);
- base.setTag("EntityTag", entityTag);
- }
- public static void generatecustomposblock(double x, double y, double z, String text) {
- ItemStack itm = new ItemStack(Items.armor_stand);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound entityTag = new NBTTagCompound();
- NBTTagList list = new NBTTagList();
- NBTTagList pos = new NBTTagList();
- pos.appendTag(new NBTTagDouble(x));
- pos.appendTag(new NBTTagDouble(y));
- pos.appendTag(new NBTTagDouble(z));
- itm.setTagCompound(base);
- entityTag.setString("CustomName", text);
- entityTag.setInteger("CustomNameVisible", 1);
- entityTag.setInteger("Invisible", 1);
- entityTag.setInteger("NoGravity", 1);
- entityTag.setTag("Pos", pos);
- base.setTag("EntityTag", entityTag);
- Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C10PacketCreativeInventoryAction(36, itm));
- }
- public static ItemStack Titel(String titel)
- {
- ItemStack itm = new ItemStack(Blocks.mob_spawner);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setString("EntityId", "WitherBoss");
- blockEntityTag.setInteger("SpawnCount", 0);
- blockEntityTag.setInteger("SpawnRange", 1);
- blockEntityTag.setInteger("RequiredPlayerRange", maxvalue);
- blockEntityTag.setInteger("MinSpawnDelay", 5000);
- blockEntityTag.setInteger("MaxSpawnDelay", 5000);
- blockEntityTag.setInteger("MaxNearbyEntities", maxvalue);
- NBTTagCompound spawnData = new NBTTagCompound();
- spawnData.setString("CustomName", titel);
- spawnData.setInteger("CustomNameVisible", 1);
- NBTTagCompound cowCompound = new NBTTagCompound();
- cowCompound.setString("id", "Bat");
- NBTTagCompound effect = new NBTTagCompound();
- effect.setInteger("id", 14);
- effect.setInteger("Amplifier", 0);
- effect.setInteger("Duration", 2000000);
- effect.setByte("ShowParticles", (byte)0);
- NBTTagList activeEffects = new NBTTagList();
- activeEffects.appendTag(effect);
- cowCompound.setTag("ActiveEffects", activeEffects);
- spawnData.setTag("Riding", cowCompound);
- blockEntityTag.setTag("SpawnData", spawnData);
- base.setTag("BlockEntityTag", blockEntityTag);
- itm.setTagCompound(base);
- return itm;
- }
- public static ItemStack customspawner(String customspawner)
- {
- String title = customspawner.replace("&", "ยง");
- ItemStack itm = new ItemStack(Blocks.mob_spawner);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setString("EntityId", title);
- blockEntityTag.setInteger("SpawnCount", 0);
- blockEntityTag.setInteger("SpawnRange", 1);
- blockEntityTag.setInteger("RequiredPlayerRange", maxvalue);
- blockEntityTag.setInteger("MinSpawnDelay", 5000);
- blockEntityTag.setInteger("MaxSpawnDelay", 5000);
- blockEntityTag.setInteger("MaxNearbyEntities", maxvalue);
- NBTTagCompound spawnData = new NBTTagCompound();
- NBTTagCompound cowCompound = new NBTTagCompound();
- cowCompound.setString("id", "Bat");
- NBTTagCompound effect = new NBTTagCompound();
- effect.setInteger("id", 14);
- effect.setInteger("Amplifier", 0);
- effect.setInteger("Duration", 2000000);
- effect.setByte("ShowParticles", (byte)0);
- NBTTagList activeEffects = new NBTTagList();
- activeEffects.appendTag(effect);
- cowCompound.setTag("ActiveEffects", activeEffects);
- spawnData.setTag("Riding", cowCompound);
- blockEntityTag.setTag("SpawnData", spawnData);
- base.setTag("BlockEntityTag", blockEntityTag);
- itm.setTagCompound(base);
- return itm;
- }
- public static ItemStack addSpawnertooffen(ItemStack itm)
- {
- ItemStack furnace = new ItemStack(Blocks.furnace);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setShort("BurnTime", (short)0);
- blockEntityTag.setShort("CookTime", (short)0);
- blockEntityTag.setShort("CookTimeTotal", (short)200);
- blockEntityTag.setString("id", "Furnace");
- blockEntityTag.setString("Lock", "");
- NBTTagList items = new NBTTagList();
- NBTTagCompound item = new NBTTagCompound();
- item.setByte("Count", (byte)1);
- item.setShort("Damage", (short)itm.getItemDamage());
- item.setString("id", "minecraft:mob_spawner");
- item.setShort("Slot", (short)0);
- item.setTag("tag", itm.getTagCompound());
- items.appendTag(item);
- blockEntityTag.setTag("Items", items);
- base.setTag("BlockEntityTag", blockEntityTag);
- furnace.setTagCompound(base);
- return furnace;
- }
- public static ItemStack addSpawnertooffen(ItemStack itm, String inhalt)
- {
- ItemStack furnace = new ItemStack(Blocks.furnace);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setShort("BurnTime", (short)0);
- blockEntityTag.setShort("CookTime", (short)0);
- blockEntityTag.setShort("CookTimeTotal", (short)200);
- blockEntityTag.setString("id", "Furnace");
- blockEntityTag.setString("Lock", "");
- NBTTagList items = new NBTTagList();
- NBTTagCompound item = new NBTTagCompound();
- item.setByte("Count", (byte)1);
- item.setShort("Damage", (short)itm.getItemDamage());
- item.setString("id", "minecraft:"+inhalt);
- item.setShort("Slot", (short)0);
- item.setTag("tag", itm.getTagCompound());
- items.appendTag(item);
- blockEntityTag.setTag("Items", items);
- base.setTag("BlockEntityTag", blockEntityTag);
- furnace.setTagCompound(base);
- return furnace;
- }
- public static ItemStack addSpawnertoChest(ItemStack itm)
- {
- ItemStack furnace = new ItemStack(Blocks.chest);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setString("id", "Chest");
- blockEntityTag.setString("Lock", "");
- NBTTagList items = new NBTTagList();
- NBTTagCompound item = new NBTTagCompound();
- item.setByte("Count", (byte)1);
- item.setShort("Damage", (short)itm.getItemDamage());
- item.setString("id", "minecraft:mob_spawner");
- item.setShort("Slot", (short)0);
- item.setTag("tag", itm.getTagCompound());
- items.appendTag(item);
- blockEntityTag.setTag("Items", items);
- base.setTag("BlockEntityTag", blockEntityTag);
- furnace.setTagCompound(base);
- return furnace;
- }
- public static ItemStack addSpawnertoHopper(ItemStack itm)
- {
- ItemStack furnace = new ItemStack(Blocks.hopper);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setString("id", "Hopper");
- blockEntityTag.setString("Lock", "");
- NBTTagList items = new NBTTagList();
- NBTTagCompound item = new NBTTagCompound();
- item.setByte("Count", (byte)1);
- item.setShort("Damage", (short)itm.getItemDamage());
- item.setString("id", "minecraft:mob_spawner");
- item.setShort("Slot", (short)0);
- item.setTag("tag", itm.getTagCompound());
- items.appendTag(item);
- blockEntityTag.setTag("Items", items);
- base.setTag("BlockEntityTag", blockEntityTag);
- furnace.setTagCompound(base);
- return furnace;
- }
- //hologram bypass
- public static ItemStack addSpawnertooffenHologram(ItemStack itm)
- {
- ItemStack furnace = new ItemStack(Blocks.furnace);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setShort("BurnTime", (short)0);
- blockEntityTag.setShort("CookTime", (short)0);
- blockEntityTag.setShort("CookTimeTotal", (short)200);
- blockEntityTag.setString("id", "Furnace");
- blockEntityTag.setString("Lock", "");
- NBTTagList items = new NBTTagList();
- NBTTagCompound item = new NBTTagCompound();
- item.setByte("Count", (byte)1);
- item.setShort("Damage", (short)itm.getItemDamage());
- item.setString("id", "minecraft:armor_stand");
- item.setShort("Slot", (short)0);
- item.setTag("tag", itm.getTagCompound());
- items.appendTag(item);
- blockEntityTag.setTag("Items", items);
- base.setTag("BlockEntityTag", blockEntityTag);
- furnace.setTagCompound(base);
- return furnace;
- }
- public static ItemStack addSpawnertoChestHologram(ItemStack itm)
- {
- ItemStack furnace = new ItemStack(Blocks.chest);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setString("id", "Chest");
- blockEntityTag.setString("Lock", "");
- NBTTagList items = new NBTTagList();
- NBTTagCompound item = new NBTTagCompound();
- item.setByte("Count", (byte)1);
- item.setShort("Damage", (short)itm.getItemDamage());
- item.setString("id", "minecraft:armor_stand");
- item.setShort("Slot", (short)0);
- item.setTag("tag", itm.getTagCompound());
- items.appendTag(item);
- blockEntityTag.setTag("Items", items);
- base.setTag("BlockEntityTag", blockEntityTag);
- furnace.setTagCompound(base);
- return furnace;
- }
- public static ItemStack addSpawnertoHopperHologram(ItemStack itm)
- {
- ItemStack furnace = new ItemStack(Blocks.hopper);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setString("id", "Hopper");
- blockEntityTag.setString("Lock", "");
- NBTTagList items = new NBTTagList();
- NBTTagCompound item = new NBTTagCompound();
- item.setByte("Count", (byte)1);
- item.setShort("Damage", (short)itm.getItemDamage());
- item.setString("id", "minecraft:armor_stand");
- item.setShort("Slot", (short)0);
- item.setTag("tag", itm.getTagCompound());
- items.appendTag(item);
- blockEntityTag.setTag("Items", items);
- base.setTag("BlockEntityTag", blockEntityTag);
- furnace.setTagCompound(base);
- return furnace;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement