TmzOS
-
Joined
-
Last visited
Posts posted by TmzOS
-
-
-
> 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.
-
-
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
-
-
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.
-
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);
-
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.
-
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; } -
-
-
-
-
-
-
Take a look at RenderEntityItem.
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..
-
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).
-
-
Off-Topic: This is why I don't like tekkit.It would be like the macerator from tekkit so it will need slots
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/
-
-
-
-
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)); } -
Boolean update/isDaytime() issue. (Any Version) [UNSOLVED]
in Modder Support
> 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.