You could always use MultiMC. It's a custom launcher that allows you to run multiple profiles, each with their own worlds, texture packs, mods, and server lists, so there would be no risk of accidentally, say, putting a 1.9 block in a 1.8 world.
- Ethcad
- Registered Member
-
Member for 9 years, 7 months, and 17 days
Last active Thu, Oct, 6 2016 05:48:14
- 0 Followers
- 44 Total Posts
- 3 Thanks
-
Jul 31, 2015Ethcad posted a message on 1.9 Snapshot (15w31a) is Live!Posted in: News
Ikr! That purple texture is so derpy... but the spectral arrows themselves are super useful.
-
Jul 26, 2015Ethcad posted a message on 1.9 Snapshot Date Revealed!Posted in: News
It works on Win10. I got it two weeks early after using the beta, and I'd be shocked if it changed given that that is the RTM build.
-
Jul 26, 2015Ethcad posted a message on 1.9 Snapshot Date Revealed!Posted in: News
Win10 IoT Core? Not sure if it is compatible with the same stuff tho.
-
Jul 26, 2015Ethcad posted a message on Console: Greek Mythology Mash-Up Pack!Posted in: NewsQuote from Vigilante626coW»
I think it's honestly just sad the difference between console and PC games. The fact that they are charging for a mod pack is absolutely disgusting and just plain greedy. Hopefully one day these companies will learn their lesson, but until then console users will be doomed to having this crap be commonplace.
IKR!!! I think it's a load of crap. And Microsoft, with the mc win10 stuff, shows no intention whatsoever of doing anything about it.
-
Jul 25, 2015Ethcad posted a message on Console: Greek Mythology Mash-Up Pack!Posted in: News
Cool idea, but the idea of selling resource packs never ceases to tick me off. I'm a hardcore PC fan, and I believe that user-created content and mods should be free on all platforms.
-
Jul 21, 2015Ethcad posted a message on 1.9 Snapshot Date Revealed!Posted in: News
It keeps pretty well everything on your pc, or at least it did when I installed the beta. But I would recommend clean installing it, as your pc could speed up a good bit, although it is a pain to reinstall everything.
-
Jul 21, 2015Ethcad posted a message on 1.9 Snapshot Date Revealed!Posted in: News
Dang. I don't believe that's a coincidence. It doesn't directly make a difference to me (I'm using early access Win10), but it does mean, and I don't think any of us want to hear this, but it means that Microsoft is meddling in Mojang's business. I have no problem with them buying the company, but what I do have a problem with is turning Mojang into yet another subsidiary of Microsoft with the purpose of indirectly advertising Windows and MS office, which this July 29 release date could be.
-
Jul 19, 2015Ethcad posted a message on Day 1: Minecon is LIVE! - Minecraft: Windows 10 Edition, Minecraft: Story Mode TrailerPosted in: News
I wouldn't say this is all bad but I'm... skeptical. As a mod dev, I hope they don't lock it down like Apple. That's the antithesis of what Minecraft is meant to be. They need to make everyone happy, not just the pe and console players. I'm all for them speeding it up and getting away from Java, but they better not screw up like they did with MS Flight. I don't think they will... After all they paid 2.5 billion for it... but somehow I have a fear they'll phase out the Java version and turning PC into a glorified PE.
- To post a comment, please login.
0
I have created and released the Ultimate Armory mod, and am now developing version 1.1. One of the things I added in the original version is a teleportation gun, which immediately teleports the player to wherever they right-click, at a long range. There are two main problems I am having with it: the code tells it to ray-trace 1000 blocks before teleporting, but it isn't actually going that far, more in the range of 200-300 blocks. Another issue is that when I attempt to run it on a server or LAN world, the player jumps forward a long way but then immediately returns to where it was. I wasn't expecting these issues, as I actually reused some of the code from vanilla Enderpearls. If anyone sees anything wrong, needs more code from different classes, or anything like that, please say so. Thanks!
My code for the teleportation gun class is here: http://pastebin.com/j8qmBNvq
0
I would like to announce that version 1.1 is in development! I can't offer much information on what is to come, but I will confirm several forgotten crafting recipes have been added, and the website link has been fixed. More to come.
0
Thank you! I wasn't sure how people would receive it.
0
Hello everyone, I'm Ethcad, and I'm here to announce my first mod, Ultimate Armory!
First, I would like to thank Wuppy29 for his excellent tutorials and book that taught me how to mod. Check them out here.
Second, I would like to thank everyone on this forum, Choonster in particular, for always being willing to help out with all my questions.
Now, back to the mod! It adds many, many types of new weapons and armor. Five new materials, namely obsidian, emerald, ruby, vibranium, and adamantium. You can make armor and weapons out of all of these, and some have special properties. Try to swim with adamantium boots on. Also, there is a Captain America shield and Wolverine Claws.
I have also added grenade launchers, two types of grenades (one of them is bouncy), a teleportation gun, baseball bats of all ten materials, a crossbow, self-propelled arrows, a lightning wand, and other things that can conveniently be used for creating large explosions or culling mobs by the hundreds. Not sure why you'd want to do that, but it's there.
Please, please send me crash reports and any other issues you have, as well as requests for new things! I'm happy to help, but as this is my first mod, I may not know how to add everything you ask for.
Thank you!
Downloads for the mod and its source code, as well as the documentation, can be found at https://www.dropbox.com/s/607tqxf5ddp62mj/UltimateArmory-1.0.jar?dl=0 and https://www.dropbox.com/s/reo0pji7xa3w28q/UltimateArmory-1.0 Source Code.zip?dl=0, respectively. I promise I don't use AdFly.
The mod uses Minecraft Forge, which can be downloaded here and is very easy to install, as well as supporting other mods.
0
Cool idea! Haven't tested, but if it works, much better than the vignette.png solution!
0
Thank you guys! It worked perfectly! After much messing with IntelliJ, I managed to get it to function without using Eclipse, which was always a pain in the rear anyway.
0
@Leviathan143
Appreciated, but I need to be able to compile new versions of the mod when they come out, so I need a functional workspace as well as a good jar, but thank you anyway.
0
Would you be willing to send me the entire environment in which you compiled my mod? And by the way, that workspace I send you was already decompiled, but I guess it worked anyway. Thank you!
0
Still crashed.
https://www.dropbox.com/s/41tz7g6iq5qzwov/Ultimate Armory Source.zip?dl=0
Ran "gradlew setupDecompWorkspace idea build". The only thing I did differently is typing "Gradlew" instead of "gradle", but gradle without the w was not recognized, do I have to install something else?
0
So I'm working on my Ultimate Armory mod, and I was about to release it, when I had to make a couple last-minute edits to my crossbow, and everything runs fine in Eclipse. When it comes time to test it on installed Minecraft, it crashes. It didn't do this before, and it sure doesn't in the IDE. But it crashes something about two copies of my mod being registered when I only installed one. I found a couple people with the same error, but they either accidentally installed two, or were doing something complicated with mod dependencies. I am doing no such thing, and the result is the same on two computers, one running MultiMC and one running the default launcher.
My crash report:
---- Minecraft Crash Report ----
// Don't do that.
Time: 7/14/15 8:12 PM
Description: Initializing game
java.lang.IllegalArgumentException: Multiple entries with same key: ultimatearmory=FMLMod:ultimatearmory{1.0} and ultimatearmory=FMLMod:ultimatearmory{1.0}
at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150)
at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104)
at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:70)
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254)
at com.google.common.collect.Maps.uniqueIndex(Maps.java:1166)
at com.google.common.collect.Maps.uniqueIndex(Maps.java:1140)
at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:360)
at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:483)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:213)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:412)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:325)
at net.minecraft.client.main.Main.main(SourceFile:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:310)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:394)
at org.multimc.EntryPoint.listen(EntryPoint.java:170)
at org.multimc.EntryPoint.main(EntryPoint.java:54)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150)
at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104)
at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:70)
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254)
at com.google.common.collect.Maps.uniqueIndex(Maps.java:1166)
at com.google.common.collect.Maps.uniqueIndex(Maps.java:1140)
at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:360)
at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:483)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:213)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:412)
-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:325)
at net.minecraft.client.main.Main.main(SourceFile:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:310)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:394)
at org.multimc.EntryPoint.listen(EntryPoint.java:170)
at org.multimc.EntryPoint.main(EntryPoint.java:54)
-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.8.0_45, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 487393344 bytes (464 MB) / 666894336 bytes (636 MB) up to 954728448 bytes (910 MB)
JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xms512m -Xmx1024m
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1450 5 mods loaded, 0 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
FML{8.0.99.99} [Forge Mod Loader] (forge-1.8-11.14.3.1450-universal.jar)
Forge{11.14.3.1450} [Minecraft Forge] (forge-1.8-11.14.3.1450-universal.jar)
ultimatearmory{1.0} [Ethcad's Ultimate Armory] (modid-1.0.jar)
ultimatearmory{1.0} [Ethcad's Ultimate Armory] (modid-1.0.jar)
Loaded coremods (and transformers):
GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13394 Compatibility Profile Context 15.200.1023.7' Renderer: 'AMD Radeon(TM) HD8970M'
Launched Version: MultiMC5
LWJGL: 2.9.1
OpenGL: AMD Radeon(TM) HD8970M GL version 4.5.13394 Compatibility Profile Context 15.200.1023.7, ATI Technologies Inc.
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.
Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)
And my entire mod's source code:
https://www.dropbox.com/s/fn4kw0ijtsr3h44/Ethcad's UA 1.0 for MC 1.8 Source Code.zip?dl=0
Sorry if I'm going overkill, but it could be something not obvious. You never know.
Anyone who wants to, feel free to recompile it and test it. Who knows, you might be doing something different. For reference, I'm using JDK and JRE 8u45, and Win10 beta, though I doubt it makes a difference, and the mod is being compiled for compatibility for Java 6 and 7. If there's any more info you need, I'm happy to provide it.
Just if you do recompile it, please don't redistribute it. I trust you guys. Thank you!
0
Thank you! I appreciate your willingness to answer my noob questions
0
Thanks! The crossbow works perfectly now! But when I tried to compile it, it crashed because Lambda expressions (->) are only supported in Source 1.8. How do I configure Gradle to accept this code?
0
Well, it at least renders in my hand and inventory properly now.
Sadly, it is not animating in my hand, which I had to go in third person
to find out because it jitters like crazy whenever I hold it. It goes
up and down like 20 times per second, which renders the animation
useless anyway. Also, the player holds it pointing down instead of
forward.
My main mod class:
package com.ethcad.ultimatearmory;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import com.ethcad.ultimatearmory.entities.EntityBomb;
import com.ethcad.ultimatearmory.entities.EntityInstaBomb;
import com.ethcad.ultimatearmory.proxies.CommonProxy;
@Mod(modid = Reference.MODID, version = Reference.VERSION)
public class UltimateArmory {
// Create the proxies
@SidedProxy(clientSide = "com.ethcad.ultimatearmory.proxies.ClientProxy", serverSide = "com.ethcad.ultimatearmory.proxies.CommonProxy")
public static CommonProxy proxy;
// Declare the event handler / ore spawner
ModEventHandler handler = new ModEventHandler();
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
// Initialize all items and blocks, and entities
ModItems.loadItems();
ModBlocks.loadBlocks();
ModEntities.loadEntities();
// Register ore generator and entities
GameRegistry.registerWorldGenerator(handler, 0);
EntityRegistry.registerModEntity(EntityBomb.class, Reference.MODID + "_" + EntityBomb.name, 1, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityInstaBomb.class, Reference.MODID + "_" + EntityInstaBomb.name, 2, this, 80, 1, true);
}
@EventHandler
public void init(FMLInitializationEvent event) {
// Add crafting recipes
CraftingRecipes.addRecipes();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
// Render items and blocks in the inventory
proxy.renderInventory();
proxy.registerRendering();
}
public static void registerItemModel(Item item) {
final ModelResourceLocation modelLocation = new ModelResourceLocation((ResourceLocation) Item.itemRegistry.getNameForObject(item), "inventory");
ModelLoader.setCustomMeshDefinition(item, stack -> modelLocation);
}
}
My item class:
package com.ethcad.ultimatearmory.items;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagLong;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;
import com.ethcad.ultimatearmory.Reference;
public class CrossBow extends Item {
public static final String name = "crossBow";
public CrossBow() {
setUnlocalizedName(Reference.MODID + "_" + name);
GameRegistry.registerItem(this, name);
setCreativeTab(CreativeTabs.tabCombat);
setMaxStackSize(1);
setMaxDamage(511);
}
public String getName() {
return name;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int parInt, boolean parBoolean) {
long ticks = this.getLastUseTime(itemStack) + 1;
this.setLastUseTime(itemStack, ticks);
}
@Override
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
long ticksSinceLastUse = this.getLastUseTime(stack);
if (ticksSinceLastUse >= 60) {
return new ModelResourceLocation(Reference.MODID + ":crossBow_pulling_2", "inventory");
} else if (ticksSinceLastUse >= 40) {
return new ModelResourceLocation(Reference.MODID + ":crossBow_pulling_1", "inventory");
} else if (ticksSinceLastUse >= 20) {
return new ModelResourceLocation(Reference.MODID + ":crossBow_pulling_0", "inventory");
} else {
return new ModelResourceLocation(Reference.MODID + ":crossBow_standby", "inventory");
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World worldIn, EntityPlayer entityPlayer) {
long ticksSinceLastUse = this.getLastUseTime(itemStack);
if (ticksSinceLastUse >= 60 && entityPlayer.inventory.hasItem(Items.arrow) || entityPlayer.capabilities.isCreativeMode) {
if (!entityPlayer.capabilities.isCreativeMode) {
entityPlayer.inventory.consumeInventoryItem(Items.arrow);
itemStack.damageItem(1, entityPlayer);
}
worldIn.playSoundAtEntity(entityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!worldIn.isRemote) {
worldIn.spawnEntityInWorld(new EntityArrow(worldIn, entityPlayer, 12));
}
}
return itemStack;
}
private void setLastUseTime(ItemStack stack, long time) {
stack.setTagInfo("LastUse", new NBTTagLong(time));
}
private long getLastUseTime(ItemStack stack) {
return stack.hasTagCompound() ? stack.getTagCompound().getLong("LastUse") : 0;
}
}
And my client proxy:
package com.ethcad.ultimatearmory.proxies;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import com.ethcad.ultimatearmory.ModBlocks;
import com.ethcad.ultimatearmory.ModItems;
import com.ethcad.ultimatearmory.Reference;
import com.ethcad.ultimatearmory.UltimateArmory;
import com.ethcad.ultimatearmory.blocks.AdamantiumMetalBlock;
import com.ethcad.ultimatearmory.blocks.AdamantiumOreBlock;
import com.ethcad.ultimatearmory.blocks.RubyGemBlock;
import com.ethcad.ultimatearmory.blocks.RubyOreBlock;
import com.ethcad.ultimatearmory.blocks.VibraniumMetalBlock;
import com.ethcad.ultimatearmory.blocks.VibraniumOreBlock;
import com.ethcad.ultimatearmory.entities.EntityBomb;
import com.ethcad.ultimatearmory.entities.EntityInstaBomb;
import com.ethcad.ultimatearmory.items.AutoArrow;
import com.ethcad.ultimatearmory.items.Bomb;
import com.ethcad.ultimatearmory.items.ChainMail;
import com.ethcad.ultimatearmory.items.DiamondBat;
import com.ethcad.ultimatearmory.items.GoldenBat;
import com.ethcad.ultimatearmory.items.GrenadeLauncher;
import com.ethcad.ultimatearmory.items.InstaBomb;
import com.ethcad.ultimatearmory.items.IronBat;
import com.ethcad.ultimatearmory.items.StoneBat;
import com.ethcad.ultimatearmory.items.TeleporterGun;
import com.ethcad.ultimatearmory.items.Wand;
import com.ethcad.ultimatearmory.items.WoodenBat;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumAxe;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumBat;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumClaws;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumHoe;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumIngot;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumPickaxe;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumSpade;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumSword;
import com.ethcad.ultimatearmory.items.emerald.EmeraldAxe;
import com.ethcad.ultimatearmory.items.emerald.EmeraldBat;
import com.ethcad.ultimatearmory.items.emerald.EmeraldHoe;
import com.ethcad.ultimatearmory.items.emerald.EmeraldPickaxe;
import com.ethcad.ultimatearmory.items.emerald.EmeraldSpade;
import com.ethcad.ultimatearmory.items.emerald.EmeraldSword;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianAxe;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianBat;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianHoe;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianPickaxe;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianSpade;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianSword;
import com.ethcad.ultimatearmory.items.ruby.RubyAxe;
import com.ethcad.ultimatearmory.items.ruby.RubyBat;
import com.ethcad.ultimatearmory.items.ruby.RubyGem;
import com.ethcad.ultimatearmory.items.ruby.RubyHoe;
import com.ethcad.ultimatearmory.items.ruby.RubyPickaxe;
import com.ethcad.ultimatearmory.items.ruby.RubySpade;
import com.ethcad.ultimatearmory.items.ruby.RubySword;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumAxe;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumBat;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumDust;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumHoe;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumIngot;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumPickaxe;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumShield;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumSpade;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumSword;
public class ClientProxy extends CommonProxy {
// Render all the blocks and items in the inventory
@Override
public void renderInventory() {
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
renderItem.getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.adamantiumOreBlock), 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumOreBlock) ModBlocks.adamantiumOreBlock).getName(), "inventory"));
renderItem.getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.adamantiumMetalBlock), 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumMetalBlock) ModBlocks.adamantiumMetalBlock).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumIngot, 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumIngot) ModItems.adamantiumIngot).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumClaws, 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumClaws) ModItems.adamantiumClaws).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumHelmet, 0, new ModelResourceLocation(Reference.MODID + ":adamantiumHelmet", "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumChestplate, 0, new ModelResourceLocation(Reference.MODID + ":adamantiumChestplate", "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumLeggings, 0, new ModelResourceLocation(Reference.MODID + ":adamantiumLeggings", "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumBoots, 0, new ModelResourceLocation(Reference.MODID + ":adamantiumBoots", "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumSword, 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumSword) ModItems.adamantiumSword).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumPickaxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumPickaxe) ModItems.adamantiumPickaxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumSpade, 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumSpade) ModItems.adamantiumSpade).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumAxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumAxe) ModItems.adamantiumAxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumHoe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumHoe) ModItems.adamantiumHoe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.chainMail, 0, new ModelResourceLocation(Reference.MODID + ":" + ((ChainMail) ModItems.chainMail).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.woodenBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((WoodenBat) ModItems.woodenBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.stoneBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((StoneBat) ModItems.stoneBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.ironBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((IronBat) ModItems.ironBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.goldenBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((GoldenBat) ModItems.goldenBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.diamondBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((DiamondBat) ModItems.diamondBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((EmeraldBat) ModItems.emeraldBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.adamantiumBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((AdamantiumBat) ModItems.adamantiumBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldPickaxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((EmeraldPickaxe) ModItems.emeraldPickaxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldSpade, 0, new ModelResourceLocation(Reference.MODID + ":" + ((EmeraldSpade) ModItems.emeraldSpade).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldAxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((EmeraldAxe) ModItems.emeraldAxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldHoe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((EmeraldHoe) ModItems.emeraldHoe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldSword, 0, new ModelResourceLocation(Reference.MODID + ":" + ((EmeraldSword) ModItems.emeraldSword).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldHelmet, 0, new ModelResourceLocation(Reference.MODID + ":emeraldHelmet", "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldChestplate, 0, new ModelResourceLocation(Reference.MODID + ":emeraldChestplate", "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldLeggings, 0, new ModelResourceLocation(Reference.MODID + ":emeraldLeggings", "inventory"));
renderItem.getItemModelMesher().register(ModItems.emeraldBoots, 0, new ModelResourceLocation(Reference.MODID + ":emeraldBoots", "inventory"));
renderItem.getItemModelMesher().register(ModItems.bomb, 0, new ModelResourceLocation(Reference.MODID + ":" + ((Bomb) ModItems.bomb).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.instaBomb, 0, new ModelResourceLocation(Reference.MODID + ":" + ((InstaBomb) ModItems.instaBomb).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.wand, 0, new ModelResourceLocation(Reference.MODID + ":" + ((Wand) ModItems.wand).getName(), "inventory"));
renderItem.getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.vibraniumOreBlock), 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumOreBlock) ModBlocks.vibraniumOreBlock).getName(), "inventory"));
renderItem.getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.vibraniumMetalBlock), 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumMetalBlock) ModBlocks.vibraniumMetalBlock).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumIngot, 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumIngot) ModItems.vibraniumIngot).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumShield, 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumShield) ModItems.vibraniumShield).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumHelmet, 0, new ModelResourceLocation(Reference.MODID + ":vibraniumHelmet", "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumChestplate, 0, new ModelResourceLocation(Reference.MODID + ":vibraniumChestplate", "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumLeggings, 0, new ModelResourceLocation(Reference.MODID + ":vibraniumLeggings", "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumBoots, 0, new ModelResourceLocation(Reference.MODID + ":vibraniumBoots", "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumSword, 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumSword) ModItems.vibraniumSword).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumPickaxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumPickaxe) ModItems.vibraniumPickaxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumSpade, 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumSpade) ModItems.vibraniumSpade).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumAxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumAxe) ModItems.vibraniumAxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumHoe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumHoe) ModItems.vibraniumHoe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumBat) ModItems.vibraniumBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.vibraniumDust, 0, new ModelResourceLocation(Reference.MODID + ":" + ((VibraniumDust) ModItems.vibraniumDust).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianPickaxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((ObsidianPickaxe) ModItems.obsidianPickaxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianSpade, 0, new ModelResourceLocation(Reference.MODID + ":" + ((ObsidianSpade) ModItems.obsidianSpade).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianAxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((ObsidianAxe) ModItems.obsidianAxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianHoe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((ObsidianHoe) ModItems.obsidianHoe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianSword, 0, new ModelResourceLocation(Reference.MODID + ":" + ((ObsidianSword) ModItems.obsidianSword).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianHelmet, 0, new ModelResourceLocation(Reference.MODID + ":obsidianHelmet", "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianChestplate, 0, new ModelResourceLocation(Reference.MODID + ":obsidianChestplate", "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianLeggings, 0, new ModelResourceLocation(Reference.MODID + ":obsidianLeggings", "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianBoots, 0, new ModelResourceLocation(Reference.MODID + ":obsidianBoots", "inventory"));
renderItem.getItemModelMesher().register(ModItems.obsidianBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((ObsidianBat) ModItems.obsidianBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.grenadeLauncher, 0, new ModelResourceLocation(Reference.MODID + ":" + ((GrenadeLauncher) ModItems.grenadeLauncher).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.autoArrow, 0, new ModelResourceLocation(Reference.MODID + ":" + ((AutoArrow) ModItems.autoArrow).getName(), "inventory"));
renderItem.getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.rubyOreBlock), 0, new ModelResourceLocation(Reference.MODID + ":" + ((RubyOreBlock) ModBlocks.rubyOreBlock).getName(), "inventory"));
renderItem.getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.rubyGemBlock), 0, new ModelResourceLocation(Reference.MODID + ":" + ((RubyGemBlock) ModBlocks.rubyGemBlock).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubyGem, 0, new ModelResourceLocation(Reference.MODID + ":" + ((RubyGem) ModItems.rubyGem).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubyHelmet, 0, new ModelResourceLocation(Reference.MODID + ":rubyHelmet", "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubyChestplate, 0, new ModelResourceLocation(Reference.MODID + ":rubyChestplate", "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubyLeggings, 0, new ModelResourceLocation(Reference.MODID + ":rubyLeggings", "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubyBoots, 0, new ModelResourceLocation(Reference.MODID + ":rubyBoots", "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubySword, 0, new ModelResourceLocation(Reference.MODID + ":" + ((RubySword) ModItems.rubySword).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubyPickaxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((RubyPickaxe) ModItems.rubyPickaxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubySpade, 0, new ModelResourceLocation(Reference.MODID + ":" + ((RubySpade) ModItems.rubySpade).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubyAxe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((RubyAxe) ModItems.rubyAxe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubyHoe, 0, new ModelResourceLocation(Reference.MODID + ":" + ((RubyHoe) ModItems.rubyHoe).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.rubyBat, 0, new ModelResourceLocation(Reference.MODID + ":" + ((RubyBat) ModItems.rubyBat).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.teleporterGun, 0, new ModelResourceLocation(Reference.MODID + ":" + ((TeleporterGun) ModItems.teleporterGun).getName(), "inventory"));
renderItem.getItemModelMesher().register(ModItems.crossBow, 0, new ModelResourceLocation(Reference.MODID + ":crossBow_standby", "inventory"));
ModelBakery.addVariantName(ModItems.crossBow, Reference.MODID + ":crossBow_standby");
for (int stage = 0; stage < 3; stage++) {
ModelBakery.addVariantName(ModItems.crossBow, Reference.MODID + ":crossBow_pulling_" + stage);
}
UltimateArmory.registerItemModel(ModItems.crossBow);
}
@Override
public void registerRendering() {
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
RenderingRegistry.registerEntityRenderingHandler(EntityBomb.class, new RenderSnowball(Minecraft.getMinecraft().getRenderManager(), ModItems.bomb, renderItem));
RenderingRegistry.registerEntityRenderingHandler(EntityInstaBomb.class, new RenderSnowball(Minecraft.getMinecraft().getRenderManager(), ModItems.instaBomb, renderItem));
}
}
Also my mod items class, if it is of any use.
package com.ethcad.ultimatearmory;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.relauncher.Side;
import com.ethcad.ultimatearmory.items.AutoArrow;
import com.ethcad.ultimatearmory.items.Bomb;
import com.ethcad.ultimatearmory.items.ChainMail;
import com.ethcad.ultimatearmory.items.CrossBow;
import com.ethcad.ultimatearmory.items.DiamondBat;
import com.ethcad.ultimatearmory.items.GoldenBat;
import com.ethcad.ultimatearmory.items.GrenadeLauncher;
import com.ethcad.ultimatearmory.items.InstaBomb;
import com.ethcad.ultimatearmory.items.IronBat;
import com.ethcad.ultimatearmory.items.StoneBat;
import com.ethcad.ultimatearmory.items.TeleporterGun;
import com.ethcad.ultimatearmory.items.Wand;
import com.ethcad.ultimatearmory.items.WoodenBat;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumArmor;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumAxe;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumBat;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumClaws;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumHoe;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumIngot;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumPickaxe;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumSpade;
import com.ethcad.ultimatearmory.items.adamantium.AdamantiumSword;
import com.ethcad.ultimatearmory.items.emerald.EmeraldArmor;
import com.ethcad.ultimatearmory.items.emerald.EmeraldAxe;
import com.ethcad.ultimatearmory.items.emerald.EmeraldBat;
import com.ethcad.ultimatearmory.items.emerald.EmeraldHoe;
import com.ethcad.ultimatearmory.items.emerald.EmeraldPickaxe;
import com.ethcad.ultimatearmory.items.emerald.EmeraldSpade;
import com.ethcad.ultimatearmory.items.emerald.EmeraldSword;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianArmor;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianAxe;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianBat;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianHoe;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianPickaxe;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianSpade;
import com.ethcad.ultimatearmory.items.obsidian.ObsidianSword;
import com.ethcad.ultimatearmory.items.ruby.RubyArmor;
import com.ethcad.ultimatearmory.items.ruby.RubyAxe;
import com.ethcad.ultimatearmory.items.ruby.RubyBat;
import com.ethcad.ultimatearmory.items.ruby.RubyGem;
import com.ethcad.ultimatearmory.items.ruby.RubyHoe;
import com.ethcad.ultimatearmory.items.ruby.RubyPickaxe;
import com.ethcad.ultimatearmory.items.ruby.RubySpade;
import com.ethcad.ultimatearmory.items.ruby.RubySword;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumArmor;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumAxe;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumBat;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumDust;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumHoe;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumIngot;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumPickaxe;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumShield;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumSpade;
import com.ethcad.ultimatearmory.items.vibranium.VibraniumSword;
public class ModItems {
// Create ToolMaterial and ArmorMaterials
public static ArmorMaterial armorEmerald = EnumHelper.addArmorMaterial("armorEmerald", "armorEmerald", 40, new int[] { 3, 5, 4, 3 }, 30);
public static ToolMaterial legitEmerald = EnumHelper.addToolMaterial("legitEmerald", 3, 4096, 12.0f, 3.0f, 40);
public static ToolMaterial adamantium = EnumHelper.addToolMaterial("adamantium", 2, 3072, 6f, 2f, 13);
public static ArmorMaterial adamantiumArmorMaterial = EnumHelper.addArmorMaterial("adamantiumArmorMaterial", "adamantiumArmorMaterial", 40, new int[] { 3, 5, 4, 3 }, 30);
public static ToolMaterial vibranium = EnumHelper.addToolMaterial("vibranium", 3, 2048, 8f, 4f, 10);
public static ArmorMaterial armorVibranium = EnumHelper.addArmorMaterial("armorVibranium", "armorVibranium", 30, new int[] { 6, 7, 6, 5 }, 10);
public static ToolMaterial obsidian = EnumHelper.addToolMaterial("obsidian", 4, 8192, 6f, 2f, 10);
public static ArmorMaterial armorObsidian = EnumHelper.addArmorMaterial("armorObsidian", "armorObsidian", 200, new int[] { 4, 4, 4, 4 }, 10);
public static ToolMaterial ruby = EnumHelper.addToolMaterial("ruby", 5, 10, 500f, 496f, 1);
public static ArmorMaterial armorRuby = EnumHelper.addArmorMaterial("armorRuby", "armorRuby", 10, new int[] { 10, 10, 10, 10 }, 1);
// Declare all the items
public static Item emeraldPickaxe;
public static Item emeraldHoe;
public static Item emeraldSpade;
public static Item emeraldAxe;
public static Item emeraldSword;
public static Item emeraldHelmet;
public static Item emeraldChestplate;
public static Item emeraldLeggings;
public static Item emeraldBoots;
public static Item obsidianPickaxe;
public static Item obsidianHoe;
public static Item obsidianSpade;
public static Item obsidianAxe;
public static Item obsidianSword;
public static Item obsidianHelmet;
public static Item obsidianChestplate;
public static Item obsidianLeggings;
public static Item obsidianBoots;
public static Item obsidianBat;
public static Item bomb;
public static Item instaBomb;
public static Item wand;
public static Item adamantiumIngot;
public static Item adamantiumClaws;
public static Item adamantiumSword;
public static Item adamantiumPickaxe;
public static Item adamantiumSpade;
public static Item adamantiumAxe;
public static Item adamantiumHoe;
public static Item adamantiumHelmet;
public static Item adamantiumChestplate;
public static Item adamantiumLeggings;
public static Item adamantiumBoots;
public static Item chainMail;
public static Item vibraniumDust;
public static Item woodenBat;
public static Item stoneBat;
public static Item ironBat;
public static Item goldenBat;
public static Item diamondBat;
public static Item adamantiumBat;
public static Item emeraldBat;
public static Item vibraniumIngot;
public static Item vibraniumShield;
public static Item vibraniumSword;
public static Item vibraniumPickaxe;
public static Item vibraniumSpade;
public static Item vibraniumAxe;
public static Item vibraniumHoe;
public static Item vibraniumHelmet;
public static Item vibraniumChestplate;
public static Item vibraniumLeggings;
public static Item vibraniumBoots;
public static Item vibraniumBat;
public static Item grenadeLauncher;
public static Item teleporterGun;
public static Item rubyGem;
public static Item rubySword;
public static Item rubyPickaxe;
public static Item rubySpade;
public static Item rubyAxe;
public static Item rubyHoe;
public static Item rubyHelmet;
public static Item rubyChestplate;
public static Item rubyLeggings;
public static Item rubyBoots;
public static Item rubyBat;
public static Item autoArrow;
public static Item crossBow;
// Initialize the items
public static void loadItems() {
adamantiumIngot = new AdamantiumIngot();
adamantiumSword = new AdamantiumSword(adamantium);
adamantiumPickaxe = new AdamantiumPickaxe(adamantium);
adamantiumSpade = new AdamantiumSpade(adamantium);
adamantiumAxe = new AdamantiumAxe(adamantium);
adamantiumHoe = new AdamantiumHoe(adamantium);
adamantiumClaws = new AdamantiumClaws(adamantium);
woodenBat = new WoodenBat(ToolMaterial.WOOD);
stoneBat = new StoneBat(ToolMaterial.STONE);
ironBat = new IronBat(ToolMaterial.IRON);
goldenBat = new GoldenBat(ToolMaterial.GOLD);
diamondBat = new DiamondBat(ToolMaterial.EMERALD);
adamantiumBat = new AdamantiumBat(adamantium);
emeraldBat = new EmeraldBat(legitEmerald);
chainMail = new ChainMail();
adamantiumHelmet = new AdamantiumArmor(adamantiumArmorMaterial, 1, 0, "adamantiumHelmet");
adamantiumChestplate = new AdamantiumArmor(adamantiumArmorMaterial, 1, 1, "adamantiumChestplate");
adamantiumLeggings = new AdamantiumArmor(adamantiumArmorMaterial, 2, 2, "adamantiumLeggings");
adamantiumBoots = new AdamantiumArmor(adamantiumArmorMaterial, 1, 3, "adamantiumBoots");
emeraldPickaxe = new EmeraldPickaxe(legitEmerald);
emeraldHoe = new EmeraldHoe(legitEmerald);
emeraldSpade = new EmeraldSpade(legitEmerald);
emeraldAxe = new EmeraldAxe(legitEmerald);
emeraldSword = new EmeraldSword(legitEmerald);
emeraldHelmet = new EmeraldArmor(armorEmerald, 1, 0, "emeraldHelmet");
emeraldChestplate = new EmeraldArmor(armorEmerald, 1, 1, "emeraldChestplate");
emeraldLeggings = new EmeraldArmor(armorEmerald, 2, 2, "emeraldLeggings");
emeraldBoots = new EmeraldArmor(armorEmerald, 1, 3, "emeraldBoots");
bomb = new Bomb();
instaBomb = new InstaBomb();
wand = new Wand();
vibraniumIngot = new VibraniumIngot();
vibraniumDust = new VibraniumDust();
vibraniumSword = new VibraniumSword(vibranium);
vibraniumPickaxe = new VibraniumPickaxe(vibranium);
vibraniumSpade = new VibraniumSpade(vibranium);
vibraniumAxe = new VibraniumAxe(vibranium);
vibraniumHoe = new VibraniumHoe(vibranium);
vibraniumShield = new VibraniumShield(vibranium);
vibraniumBat = new VibraniumBat(vibranium);
vibraniumHelmet = new VibraniumArmor(armorVibranium, 1, 0, "vibraniumHelmet");
vibraniumChestplate = new VibraniumArmor(armorVibranium, 1, 1, "vibraniumChestplate");
vibraniumLeggings = new VibraniumArmor(armorVibranium, 2, 2, "vibraniumLeggings");
vibraniumBoots = new VibraniumArmor(armorVibranium, 1, 3, "vibraniumBoots");
obsidianPickaxe = new ObsidianPickaxe(obsidian);
obsidianHoe = new ObsidianHoe(obsidian);
obsidianSpade = new ObsidianSpade(obsidian);
obsidianAxe = new ObsidianAxe(obsidian);
obsidianSword = new ObsidianSword(obsidian);
obsidianBat = new ObsidianBat(obsidian);
obsidianHelmet = new ObsidianArmor(armorObsidian, 1, 0, "obsidianHelmet");
obsidianChestplate = new ObsidianArmor(armorObsidian, 1, 1, "obsidianChestplate");
obsidianLeggings = new ObsidianArmor(armorObsidian, 2, 2, "obsidianLeggings");
obsidianBoots = new ObsidianArmor(armorObsidian, 1, 3, "obsidianBoots");
grenadeLauncher = new GrenadeLauncher();
autoArrow = new AutoArrow();
crossBow = new CrossBow();
rubyGem = new RubyGem();
rubySword = new RubySword(ruby);
rubyPickaxe = new RubyPickaxe(ruby);
rubySpade = new RubySpade(ruby);
rubyAxe = new RubyAxe(ruby);
rubyHoe = new RubyHoe(ruby);
rubyBat = new RubyBat(ruby);
rubyHelmet = new RubyArmor(armorRuby, 1, 0, "rubyHelmet");
rubyChestplate = new RubyArmor(armorRuby, 1, 1, "rubyChestplate");
rubyLeggings = new RubyArmor(armorRuby, 2, 2, "rubyLeggings");
rubyBoots = new RubyArmor(armorRuby, 1, 3, "rubyBoots");
teleporterGun = new TeleporterGun();
}
}
I actually have the same problem with my lightning wand. It jitters when its durability bar is recharging, which I use as a sort of charge bar. I think that might have to do with the item switching animation when you swap between items.
Thank you!
0
So I was trying to add a teleportation gun that ray traces from the player to a block and teleports them there. It worked exactly as planned on the client, but when I tried it out on the server, it did not.
At very short distances, it worked ok, but as soon as I went a long distance, it threw an error "Ethcad went too fast! (a bunch of long numbers here)" and teleports me back instantly. I understand why, as I learned while using /speed 10 on my server and flying around a while ago, but I want this mod to work on a server as well, and I am curious if anyone knows how ender pearls do this and my teleportation gun cannot.
Help would be much appreciated!
P.S. Here is my class.
package com.ethcad.ultimatearmory.items;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.monster.EntityEndermite;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;
import com.ethcad.ultimatearmory.Reference;
public class TeleporterGun extends Item {
MovingObjectPosition mop = null;
public static final String name = "teleporterGun";
public TeleporterGun() {
super();
GameRegistry.registerItem(this, name);
setUnlocalizedName(Reference.MODID + "_" + name);
setCreativeTab(CreativeTabs.tabTransport);
setMaxDamage(100);
setMaxStackSize(1);
}
public String getName() {
return name;
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
int x, y, z;
if (itemStack.getItemDamage() == 0) {
if (world.isRemote) {
// server raytrace doesn't return right value
mop = entityPlayer.rayTrace(1000.0d, 1.0f);
}
if (mop != null) {
Vec3 vec3 = mop.hitVec;
x = MathHelper.floor_double(vec3.xCoord);
y = MathHelper.floor_double(vec3.yCoord);
z = MathHelper.floor_double(vec3.zCoord);
itemStack.damageItem(99, entityPlayer);
entityPlayer.setPositionAndUpdate(x, y, z);
}
}
return itemStack;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int parInt, boolean parBoolean) {
itemStack.setItemDamage(itemStack.getItemDamage() - 1);
}
@Override
public boolean hasEffect(ItemStack par1ItemStack) {
return true;
}
}
0
Thank you! The inventory thing worked properly. But I still have a couple of problems. So I understand the Item.getModel() returning the proper resource location, but what do I do with that resource location? I did what you said and it gives me this error:
[09:22:56] [Client thread/ERROR] [FML]: Model definition for location ultimatearmory:crossBow#inventory not found
even though I specified the resource location to be either crossBow_standby or crossBow_pulling_# depending on the ticksSinceLastUse. I did the JSONs in the same manner Minecraft does it for bows, making an individual one for each animation frame. Am I supposed to also render it in my client proxy as well as specify the location? Here is my class, in case I did something wrong. I haven't done anything in the proxies yet.
package com.ethcad.ultimatearmory.items;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;
import com.ethcad.ultimatearmory.Reference;
public class CrossBow extends Item {
public static final String name = "crossBow";
public int ticksSinceLastUse = 60;
public CrossBow() {
setUnlocalizedName(Reference.MODID + "_" + name);
GameRegistry.registerItem(this, name);
setCreativeTab(CreativeTabs.tabCombat);
}
public String getName() {
return name;
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int parInt, boolean parBoolean) {
ticksSinceLastUse++;
}
@Override
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
if (ticksSinceLastUse >= 60) {
return new ModelResourceLocation(Reference.MODID + ":crossBow_pulling_2", "inventory");
} else if (ticksSinceLastUse >= 40) {
return new ModelResourceLocation(Reference.MODID + ":crossBow_pulling_1", "inventory");
} else if (ticksSinceLastUse >= 20) {
return new ModelResourceLocation(Reference.MODID + ":crossBow_pulling_0", "inventory");
} else {
return new ModelResourceLocation(Reference.MODID + ":crossBow_standby", "inventory");
}
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World worldIn, EntityPlayer entityPlayer) {
if (ticksSinceLastUse >= 60) {
if (!entityPlayer.capabilities.isCreativeMode) {
entityPlayer.inventory.consumeInventoryItem(Items.arrow);
}
worldIn.playSoundAtEntity(entityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!worldIn.isRemote) {
worldIn.spawnEntityInWorld(new EntityArrow(worldIn, entityPlayer, 12));
}
}
return itemStack;
}
}
Also, for some reason the arrow is appearing to fly off in an odd direction when I fire it, even though it kills mobs and sticks in blocks as if it flew straight, as well as not showing the sniper trail particles. I don't know if I can do anything about this, but any help would be much appreciated. Thank you!