Jump to content

TmzOS

Members
  • Posts

    34
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://blog.tmzos.com.br
  • Location
    Brazil
  • Personal Text
    Killing creepers with Pylons..

TmzOS's Achievements

Tree Puncher

Tree Puncher (2/8)

4

Reputation

  1. > 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.
  2. 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();
  3. > 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.
  4. 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"?
  5. 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
  6. Thanks MCenderdragon.. -- Anyone knows anything about the desync issue?
  7. 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.
  8. 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);
  9. 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.
  10. 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; }
  11. 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");
  12. Euclidean distance? net.minecraft.util.Vec3.class
  13. I never used this.. Normally I'm avoiding the use of some of these events because "conflict reasons".
  14. 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.
  15. Put the rotation line before the "GlStateManager.popMatrix();" call, inside of your render class.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.