Everything posted by GotoLink
-
[1.6.2] [Unsolved] Custom Boat Entity don't load the texture
Don't use obfuscated names, and try searching a bit, there are other threads.
-
Bug with my Block
Set opaqueCubeLookup[id]=true; and use Material.glass ? Not sure about this one.
-
Bug with my Block
Override this method in your block: @SideOnly(Side.CLIENT) /** * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given * coordinates. Args: blockAccess, x, y, z, side */ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
-
Problem using Java Filereader/FileWriter
FileWriter has a constructor with a boolean to disable overwriting the entire file.
-
Jetpack allows flying when it shouldn't
if (player.inventory.armorItemInSlot(2) != null) { ItemStack itemstack = player.inventory.armorItemInSlot(2); if (itemstack.itemID == FuturologyCore.grapheneSuitChest.itemID) { player.capabilities.allowFlying = true; player.sendPlayerAbilities(); }else if(itemstack.itemID != FuturologyCore.grapheneSuitChest.itemID){ player.capabilities.allowFlying = false; player.capabilities.isFlying = false; } } else { //case where player doesn't have any armor }
-
How to use KeyBoard class in server
Well, you can save whole object into bits and reconstruct it by reading them. This is a lot of information and packets are limited in size. You should consider what is the minimum data you need in each case. I am quite sure you don't need whole objects.
-
[1.6.2]Separating the code on client and server sides?
It doesn't really matter if clients don't see exactly the same entity animation at the same time. Just look at the vanilla "flying" player animation to see how senseless animations are. What matters is collision and positions, which are handled by the server. As for the question at hand, it is not needed to separate client and server sides in most cases. Of course, client-side only methods (rendering, animation...) should only be called client-side. And if there is any chance of desync between client and server (say, you add a bit of random in the logic), stay on server side. This is what i would say in general.
-
Extend attack range of item
The model doesn't affect it. You can catch a player swing and run vectors math to get the entity hit, then call the damage method.
-
3D Armor Models
What is wrong with using @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { return null; } ? It worked last time I checked.
-
How can I milk cows with a custom bucket?
Use EntityInteractEvent. It contains the player instance and the entity targetted. Do a check for a cow entity, and the bucket stack in the player's hand. Decrease the stack size, and give the player a filled bucket.
-
Is it possible to add information or description to an item?
Why ? You never see blocks in the inventory. They are all ItemBlock by default, which is already made automatically for all blocks that don't have a subclass of ItemBlock.
-
Crash at handleMobSpawn - Packet24MobSpawn
EntityRegistry.registerModEntity(args) doesn't register any Entity id. The given modID is internal to Forge, and has nothing to do with the id in EntityList. You can start your modID at 0, it doesn't matter. The error you are having can be due to left-over from old code. Try in a new world. Also check that all your entities have a default (World) constructor.
-
Is it possible to add information or description to an item?
It is called by getToolTip(EntityPlayer, boolean) in ItemStack. You can simply add any info as String to the given List argument, and you can format the String to put colors and such.
-
Crash at handleMobSpawn - Packet24MobSpawn
If the Entity failed at construction step (not having a constructor with the World argument), you should get another exception stack trace before this one. On the other case, a "Skipping Entity with id " log message.
-
Entity only has shadow
It is not needed, and is wrong anyway. Your entity is EntityCustom, not Entity. Also, move RenderingRegistry.registerEntityRenderingHandler( EntityCustom.class, new RenderCustom(new ModelCustom(), 0.3f)); after the entity registration, and run it only on client side.
-
Hooking chat commands client-side on multiplayer
Use IChatListener or ServerChatEvent or a GUI.
-
Burst fire gun / creating delay between shots
Use a TickHandler to trigger the next two shots.
-
Entity only has shadow
Remove: EntityRegistry.registerGlobalEntityID( Entity.class, "custom", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
-
Problem with harvesting ice with custom tool
Yes, this code will spawn an EntityItem. The only data useful for the ice block is its id, Block.ice.blockID. Make it so the ItemStack in EntityItem has this blockID.
-
Problem with harvesting ice with custom tool
Harvest setting will only affect damage done to the item. To drop the item, spawn an EntityItem with the block data.
-
Adding a potion effect
The method setPotionEffect(String) in the type Item is not applicable for the arguments (Potion, int, int, float) Translation: You are using wrong arguments in setPotionEffect(arguments). You can only use a String with this method.
-
Mob Entity Like to do....
I think you'll want to spawn it into the water at first... Then... public void onUpdate() { if(this.isInWater()) { this.moveSpeed = 0.95F; } else { //search for water blocks and set it as a path target } super.onUpdate(); }
-
[SOLVED] Adding new Player-variable
Map usage for newbie: Map<Key,Value> map = new HashMap();//Initialization with an HashMap and generics, where Key and Value are any Object you want map.put(key,value);//adds a key->value couple, or replace the value linked by the key Value val = map.get(key);//gets a value from a key
-
[Solved][Noob mistake]Eclipse saving NBT Tags between debug sessions
You should load the info at some point. ClickId = par1ItemStack.stackTagCompound.getInteger("ClickCount");
-
[1.6.2]Problem with Custom Crop
This piece of code does exactly what you are saying, it skips one of the images. Now, learn some programming. Copying someone else code will take you nowhere.
IPS spam blocked by CleanTalk.