Everything posted by TmzOS
-
Boolean update/isDaytime() issue. (Any Version) [UNSOLVED]
> fixed the bold tag inside the first code -- There are any exception in the log? Did you adapted the code from the TE to the GUI (that means, "isdesert()" for example is local to the TE but not to the GUI)? Show me what you changed exactly and what is happening with the changes.
-
[1.8] Setting Localised name on items with metadata
diesieben07 explained what you need to do, tips: //this is what "load" the unlocalized name @Override public String getUnlocalizedName(ItemStack stack) { String s = "item." + this.unlocalizedName; [...] } stack.getMetadata();
-
Boolean update/isDaytime() issue. (Any Version) [UNSOLVED]
> genSeesSun() is running only server side, GUI is client-side. Just do this: if(worldObj.isDaytime() && ((!worldObj.isRaining() && !worldObj.isThundering()) || isDesert()) && !worldObj.provider.hasNoSky && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)); { this.drawTexturedModalRect(guiLeft + 117, guiTop + 63, 176, 50, 14, 14); } or insert the function in the GUI.. or make a class with some "generic" functions to use around your mod... or change getSeesSun() (probably it will fix too): public boolean genSeesSun() { return (worldObj.isDaytime() && ((!worldObj.isRaining() && !worldObj.isThundering()) || isDesert()) && !worldObj.provider.hasNoSky && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)); } Using "side filters" ("world.isremote()", etc) can make some problems depending what you change.
-
[1.8.9] Inventory desync + fov update issue
Aparently I fixed the problem... the checkreload() call needs to be called in server and client side (the function is triggered inside of "onPlayerStoppedUsing()"). But, anyone knows any way to refresh the render to avoid this strange "fov change render bug"?
-
Mod works in eclipse but not in Minecraft
Did you used the defined methods to generate the *.jar file? See this if not: http://www.minecraftforge.net/forum/index.php/topic,14048.0.html
-
[1.8.9] Inventory desync + fov update issue
Thanks MCenderdragon.. -- Anyone knows anything about the desync issue?
-
[1.8.9] Inventory desync + fov update issue
Hello guys! If I remember it's the first or second time I ask for help here. Well, I need some confirmations about two things that are annoying me in the MC 1.8.x: 1 - Totally random player inventory desync I've tested some details and interactions of my mod to reproduce this but it's really very random. Is this a Minecraft issue or some common actions can produce this (nbt manipulation, etc)? (I observed this since the first 1.8 versions, of course with Forge, but maybe in Minecraft Vanilla too). All the things of my mod are running very well, but this issue is annoying me. While I was recording a test video, I captured one of these random desyncs; after I reload the map all the things return to it's real state and no more desyncs occurred: These are the inventory interactions calls of the gun class in the video: public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { int load = stack.getTagCompound().getInteger("mag"); if(load > -1) { if (player.capabilities.isCreativeMode || load > 0) { this.setEmptyAnimation(false); player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); } else { this.setEmptyAnimation(true); if(player.inventory.hasItem(ammo)) player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); } } return stack; } private ItemStack checkLoad(EntityPlayer player, ItemStack stackIn, World world) { ItemStack stack = stackIn; if(!world.isRemote && player.inventory.hasItem(ammo)) { player.inventory.consumeInventoryItem(ammo); stack.getTagCompound().setInteger("mag", this.maxmag); player.worldObj.playSoundAtEntity(player, "tile.piston.in", 0.1F, 0.9F); } return stack; } Older versions of my mod and Minecraft 1.8.x also shows the same random issue, and It occurs with vanilla objects too. 2 - FoV update bug It's very simple and ever in vanilla I observed this. When you drastically change the FoV and not move the mouse things are showing not rendered (maybe caused by a native routine to reduce resource consuption). There is a method to force a render update (same thing when I move the mouse, but instant after I return to the normal FoV)? Here an example: // These two things are what prevents me to release my mod for open tests. Thanks for the attention.
-
[1.7.10] How would you Force Item Drop from Inventory?
Well.. you can consume the item and spawn the entityitem with a pickup delay. player.inventory.consumeInventoryItem(itemobject); [b]From spawnAsEntity(...) in Block.class (mc 1.[/b] EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, stack); entityitem.setDefaultPickupDelay(); worldIn.spawnEntityInWorld(entityitem);
-
[1.8] Force item update
If I remember when an item receive a "damage change" it normally autosync client and server (normally in mc methods who return an itemstack). But I can't imagine what you want without looking the item class or something more (GUI images, Container, ... ). "Probably" you are applying something much complicated without necessity. =/ // In my mod generally, when I start to make an idea of item or system, I look for something similar on Minecraft and try to make a "near concept" to after make the system like I planned.
-
Make Player Knockback
Here a code from old versions of my mod.. see if this works for you. Used on leftClickEntity of an item... public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { if(entity instanceof EntityLivingBase) ((EntityLivingBase) entity).knockBack(player, 30, player.posX - entity.posX, player.posZ - entity.posZ); return false; }
-
StackTagCompound not visible
1.8 examples: Creating new NBT on stack... stack.setTagCompound(new NBTTagCompound()); NBT Set stack.getTagCompound().setInteger("integername", 0); NBT Get stack.getTagCompound().getInteger("integername");
-
[1.8] extending players reach distance
Euclidean distance? net.minecraft.util.Vec3.class
-
How to make the player render upside-down
I never used this.. Normally I'm avoiding the use of some of these events because "conflict reasons".
-
How to make the player render upside-down
If you have an entity render class you can do it.. but applying to the player entity is a bit more.. complex.. without editing base classes.
-
How to make the player render upside-down
Put the rotation line before the "GlStateManager.popMatrix();" call, inside of your render class.
-
[1.8] Guis that work on servers
GUIs are only for client side... You need to make a GUI handler, the container, the proxy configs and the GUI. Well.. organize your text plz... and post your codes for analysis. // I don't have a good tutorial link at the moment sorry (anyone?).
-
[1.7.10] Render EntityItem on HUD
Where can I find this? All I've found is the github page which is still very much obfuscated, and there is no class under this name I can import. I probably should have said, this is for 1.7.10. net.minecraft.client.renderer.entity.RenderEntityItem.class probably is the same for 1.7... idk..
-
[1.8] Changing Model Texture At Runtime
I use something more light and less deep than this for multi textured items. Register the textures and make the relationship with an item (example from my mod): renderItem.register(ironGun, 0, new ModelResourceLocation(RedMagnet.MODID+":"+((RMGun) ironGun).getName(), "inventory")); renderItem.register(ironGun, 1, new ModelResourceLocation(RedMagnet.MODID+":"+((RMGun) ironGun).getName()+"_black", "inventory")); ModelBakery.addVariantName(ironGun, new String[] { RedMagnet.MODID +":"+ ((RMGun)ironGun).getName(), RedMagnet.MODID +":"+ ((RMGun)ironGun).getName()+"_black" }); And then, make a logic to change the textures (example from my mod, item gun class): @Override public int getMetadata(ItemStack stack) { if(stack.getTagCompound() != null) return stack.getTagCompound().getInteger("color"); else return 0; } You can see too the method getModel of Item.class (Minecraft): @Override @SideOnly(Side.CLIENT) public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining){} Here is a video from my mod; if you can see, the "rifle with mag" changes the texture after all shots (mag off).
-
[1.7.10] Bow Rendering in 3rd Person
@Override public boolean isFull3D() { return true; }
-
Help Need Tutorials For Making Machines
Off-Topic: This is why I don't like tekkit. ROFL .. @killzers - Learn how to setup your mod - Learn how to setup simple items - Learn how to setup simple blocks - Learn how to setup interactions with blocks and items - Learn how to setup NBT Tags - Learn how to setup Tile Entitys - Learn how to setup Containers - Learn how to setup GUIs - Learn how to setup Renders - Try to learn how to do anything that you see different. After this start to make new things with this mixed, if all run right (single player AND with dedicated server), start a concept of how to transform items in new items... with this start your machine. If you don't learn the things around machines a simple problem can destroy your work, because you don't understand what is happening. I really recomend a good base of Java to do this, because machines require some defined things like logic flags or methods with some different actions that can move a newbie to a big fail. Machine blocks are an advanced resource in a mod. You can make machines with or without GUIs, with or without containers, with or without some things, but you need to understand all these things first. Jabelar, Wuppy and some guys are good sources of tutorials... go, learn and fly! o/
-
[1.8] Eclipse: The binary patch set is missing. Either you are in a development
This happens after updating forge via gradlew.bat?
-
Vehicles
Try to make minecarts that don't require rails...
-
[1.8] Metadata block, item texture issue
Images and texture registry/json plz...
-
[1.8] [90% SOLVED] Cannot Interact With CustomFire E.G. Hit to Extinguish
Just setup the bounding box inside the block. Collision BB is when you literally touch the block and trigger contact functions... Selected is the BB that you see with a black border when point the crosshair to the block. See this part of BlockCactus: public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { float f = 0.0625F; return new AxisAlignedBB((double)((float)pos.getX() + f), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)((float)(pos.getY() + 1) - f), (double)((float)(pos.getZ() + 1) - f)); } @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) { float f = 0.0625F; return new AxisAlignedBB((double)((float)pos.getX() + f), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)(pos.getY() + 1), (double)((float)(pos.getZ() + 1) - f)); }
-
[1.7.10] Adding items randomly to existing chest
For 1.8: > public class TileEntityHeyYou extends TileEntity implements IUpdatePlayerListBox The onUpdate() will loop each tick.. --- For 1.7: i don't remember... but can be something like 1.6.4, probably (the last mod I make in 1.7 is for 1.7.2, one year ago).
IPS spam blocked by CleanTalk.