Jump to content

SGStino

Members
  • Posts

    6
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

SGStino's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Well, i can sync TileEntity data between server and clients now with "markBlockForUpdate(x,y,z)" through NBT data, but for some reason i can't seem to find out how the slots are actually synchronized. If a slot changes on the server, the client almost instantly gets to see this change, yet writeToNBT or readFromNBT never get called and the only thing i find in slot is that it uses the IInventory interface of the TileEntity instance on the client. So how does this change propagate to the server, and from there to other clients that are looking at the inventory? It sets the chunk as modified in onInventoryChanged(); and calls func_96440_m, i assume this one notifies neighbors like comparators etc. You probably mean the ICrafting interface then? in detectAndSendChanges? we sync the start and end events of our "crafting" process, so we an update or block renderers with animations accordingly, so doing this in the container isn't an option.
  2. in the @EventHandler public void load(FMLInitializationEvent event) { with these methods: GameRegistry.registerBlock(block, uniqueId); MinecraftForge.setBlockHarvestLevel(block, "pickaxe", 1); LanguageRegistry.addName(block, displayName); ModLoader.registerTileEntity(tileEntityClass, uniqueId);
  3. But, the tutorials say different. They modify the ItemStacks without regard to world.isRemote. so, let say i don't do anything on the client's itemStacks, then for some reason if i, inside the GuiContainer want to show those items, i get to see them? So i suppose the Slots get the data via packets or something? And the server fills those packets in via the IInventory interface? So if i want the tanks on the client to show up correctly, i look into the Slot code, find how they handle the packets and try to mimick this for fluids? Or is there a FluidSlot i'm missing?
  4. I've looked at tnt, pumpkins, furnaces. All i can find with regards to the textures is this: @SideOnly(Side.CLIENT) @Override public Icon getIcon(int side, int meta) { if(side == ForgeDirection.UP.ordinal()) return topIcon; else if(side == ForgeDirection.DOWN.ordinal()) return bottomIcon; else return sideIcon; } and ofc, the icons are registered in: public void registerIcons(IconRegister par1IconRegister) ; Now, what happens is, that in the player inventory etc, the block icons are correctly displayed with the these textures, but not in the world, in the world they are rendered with the black/purple checkerboard. Am i forgetting something?
  5. The TileFluidHandler is a very basic implementation of IFluidHandler, nothing in there is related with packets, unless NBT is used for packets? But then, why doesn't it work to sync, since the same NBT is used for saving to disk. And that does work correctly, yet syncing clients and server doesn't seem to work.
  6. I'm not entirely sure how minecraft/forge works. I have an inventory made out of ItemStack instances, and if i modify it on a client/server, it'll eventually get synced to all other clients. I mean, if i put an item in the inventory with player A, while player B is logged out, and player B logs in to look at the inventory, he will find the item. However, when i do the same with FluidTanks, when let player A put something in the tank while player B is offline, player B won't see this addition when he logs back in and looks at the tank. What is it that syncs up the ItemStacks in my TileEntity? And why isn't it doing it for the FluidTanks? On a side note: i love the new fluid system if it does what i expect from it by looking at the interfaces! isGasious() etc.., yay!
×
×
  • Create New...

Important Information

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