Jump to content

matt1999rd

Members
  • Posts

    133
  • Joined

  • Last visited

Everything posted by matt1999rd

  1. Ok this function looks interesting but in fact I don't know how to implement the event and what I really want to avoid is using method IEntityReader#getClosestPlayer because it is searching amongst all player and this is done in each tick which will lower the speed of minecraft
  2. Hello everyone, in my mod I need to do some action when selected by entity using ISelectionContext and EntitySelectionContext I try to do it with getShape but it is not called when the player is selecting the block and when the voxels appear. Is there a another way to do this as i just wanted the block to detect the player when it is in front of the block?
  3. Why do you use a cube all json in your model files : tobacco_plant.json you needn't it as your blockstate only use the other model block. For th blockstate you need to put "age=7" instead of "age-7" see in wheat.json for example. Don't know if it will work...
  4. thank you it works very well
  5. thank you for your response but I don't understand what I should write in en_us.json or others language file...
  6. Hello everyone, I have got an item in my mod that change its name when one of its attribute is defined. I use Item#getDisplayName but the function doesn't recognize the translated name I put in the en_us.json file. I would like to see Card instead of item.gates.card_key in the second picture here is my function : https://github.com/matt1999rd/GatesMod/blob/master/src/main/java/fr/mattmouss/gates/items/CardKeyItem.java in line 65 to 73.
  7. because this is what I used for tollkey and it work perfectly well but I want people to use same id with different toll gate... as a beginning definition I choose a random Id which can be modified on TechScreen at least I can do a 16-bit id instead of 32 because it allows almost 2^16 possible id which is sufficiently huge
  8. thank you all for your information. I have finally found a way to display one of my int using Container#trackInt. The others value (id) is strangely defined multiple time : [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 4 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 410085969 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 4 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 623911458 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 4 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 810621267 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 4 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 193589273 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 4 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 1432532023 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 1 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 2099975825 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 1 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 1626932760 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 1 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 1150482662 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 1 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 1437467173 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:81]: ------------price written : 1 [15:47:25] [Server thread/INFO] [STDOUT/]: [fr.mattmouss.gates.tollfuckingcapability.TollStorage:serializeNBT:82]: ------------id written : 2110306105 here is the updated code : https://github.com/matt1999rd/GatesMod/tree/master/src/main/java/fr/mattmouss/gates see information in TollStorage and in TollGate because I fix the id there. The idea of this is to defining id corresponding to each TE. It use Random#nextInt function I don't understand how to use listener I find IContainerListener but this gives three function with no explanation of how to use this...
  9. thank you fr your answer but it still not working because I cannot return value in Packet I can only transfer value and I cannot access TE on client side. I don't understand what you mean by changing gui because the problem I face only take care of changing the TE. the gui associated has only function of displaying. By the way is it possible for multiple player to access the same gui in Vanilla at the same moment ? it doesn't make sense on one hand I cannot change value that are client side with server side and on the other hand the Server must control everything how can this work properly ?
  10. ok if anyone has an idea on how to display server value into client gui please answer this topic because I am stuck in this now
  11. I want to do something like MapItemID but with ID controlled by random and unique generation . In fact I did use this in my mod see on git hub : https://github.com/matt1999rd/GatesMod/blob/master/src/main/java/fr/mattmouss/gates/energystorage/IdStorage.java https://github.com/matt1999rd/GatesMod/blob/master/src/main/java/fr/mattmouss/gates/network/ControlIdData.java This idStorage is an EnergyCapability used in this TE : https://github.com/matt1999rd/GatesMod/blob/master/src/main/java/fr/mattmouss/gates/tileentity/TollGateTileEntity.java (see setId ChangeId getId)
  12. yes that 's right the player I will always choose is the one who open the gui and try to question the value stored
  13. Hello, I am facing a sides problem. I have register an id in ServerWorld Data and I want to display it in a gui which is ClientSide. I know how to send Packet to Server but here I want to send a packet from the server to the client so why can I do that ? Or is there anyway to have global value register as capability and which are accesible from both side ?
  14. I used NBT storage and it works perfectly well thanks you !
  15. no what is a uuid ? I am defining fields in the item like in this KeyItem : public abstract class KeyItem extends Item implements INBTSerializable<CompoundNBT> { protected BlockPos registeredPos; public KeyItem() { super(new Item.Properties().group(ModSetup.itemGroup).maxStackSize(1)); } public void setRegisteredPos(BlockPos registeredPos) { this.registeredPos = registeredPos; } public BlockPos getRegisteredPos(){ return this.registeredPos; } the problem is that this registeredPos is the same for all item and disappear when closing game. I think I may use compound but I don't how now..
  16. Hello everyone, in my mod I try to create item with specific id for use on specific block. But I don't know how to register attributes in item like I did with block using something that is like capability for item and with compound to keep the id when cloing the game ?
  17. this is done issue is completed thank you for all your replies for that I have just copied the code from 10th mcjty tutorial 1.14 when he sent packet for spawning entities thank you for this correction. For me it may improve the sped of packet sending
  18. Ok I have change a little bit my work I update it on Git Hub it does not use isRemote for test. I add some staff in the TechGui to change pric on client side after sending packet you can check for it on git hub :here
  19. https://github.com/matt1999rd/GatesMod/commit/b9a62d4267ab9cdc71adc2cabe6dda830798e0a2 I have update the code on git hub the function updatePrice is not the best solution I think I solve the problem : I need to update the price on Client Side by using lowerPrice directly in the gui
  20. thank you for your answer I have used packet to make the function and it works for Server Side as for client side it does not work but I think I can correct it by updating value in tick function am I right ? I have a new problem the price is not displayed on the Techgui. I need to close and open the gui again to display the correct price
  21. I think you are misunderstanding what I ask precisely because what I wanted to know is whether the usergui which use ContainerScreen is correctly done ? For the rest I am actually correcting the problem. For the second Draco18s do you thinks it is possible to have two container in one block with different registry name and without making the huge bugs ?
  22. yes I was sensing that the problem was from there : I made many change to fix the problem and before that there were no test for remote world. Is containerScreen treated correctly ? because I used the code from the tutorial of mcjty for making it... I need two gui for my mod and it seems to me that NetworkHook.openGui can open only one containerGui. For the techGui I will need a container gui (looking at an old topic about that) with two button and the display of the price. Is it possible to make a gui container without slot ?
  23. I am creating a toll gate in my mod. The objectives of this block is to allow a user coming in one side to pay and pass the toll gate when giving a certain amount of emerald. I want this amount to be equal to 1 by default and can be changed by a technician worker. I had problems with saving the price with capability when closing world. Of what I see I notice that my gui was on Render Thread and the INBTSerialisable function on Server Thread. I am wandering what I could do to make sure the Capability work and gui also ? Here is the code of my mod : https://github.com/matt1999rd/GatesMod/tree/master/src/main/java/fr/mattmouss/gates All important code are in TollGateTileEntity, PriceStorage and all Class in gui repository and TollGate onBlockActivated
  24. thank you for your answer but it finally work and I don't know why...
  25. Hello everyone, Does someone know how to work on mod without internet connexion because each time I try to start minecraft without internet it crashes with this error : Unknown host 'files.minecraftforge.net'. You may need to adjust the proxy settings in Gradle. does this means that I can configure gradle to launch minecraft ?
×
×
  • Create New...

Important Information

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