Jump to content

Samalot

Members
  • Posts

    23
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Samalot's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Sorry for the bump, but I was away on holiday for the last week. To answer your question, the area in the image where the 25 slots and search bar are. One of the balances of the image is off, but I can't figure out why or how to fix it.
  2. I'm going to have to bump this Still have not found an answer.
  3. I would have thought this would have been quite a simple problem to find the answer to online, but after a couple hours of searching... I can't find a single thing. Image: Upon drawing multiple textures, the shading of the later does not match the source file. Code: I am presuming I just need to refresh something in the frontrenderer? or GL11? But I can't find (or figure out) what. Any idea? Thanks in advance.
  4. I feel like I am being a moron... is the location that each Slot is drawn in a custom GUI determined from the custom container? I have dug through the source code and the only mention of coordinates I can find about drawing the slots is from the container class. With that being said: What exactly are the coordinates measured in? I presume pixels, but where from - the origin? In the GUI class, it is possible to reference width and height, so that you can draw each box relative to the screen size... however, if you aren't drawing the slots relative to this, there isn't much point Is there a way to draw slots onto a gui respective to the size of the clients screen? Essentially, I have multiple GUI components that have different widths/heights and would like them all (and their corresponding slot spaces) to be in the centre of the clients screen. This is easy for the GUI components (width / height), but I cant figure out how to achieve it with slots. Thanks in advance. From CustomContainer (extends Container.class) From Container.class: From Slot.class:
  5. Somehow it is now working: current code: I can see Zero difference between that and what I had before
  6. I am having trouble loading in images to a JSON model, the files are there, but they are not loading. I get the following error: error Here is the JSON file: Here is a screenshot of the current situation (I know it is called 'bd1.png' when it should be 'bd' this is not the problem, I have since switched it back - it was from a debug attempt.) As you can see in the screenshot in exhibit (A) - 'un.png' does not load BUT 'bn.png' does. As you can see in exhibit (B) - both the code for 'un' and 'bn' are exactly the same (except for the file name) - the path to the image area is the same As you can see in the screenshot in exhibit © - All the files are there, so they should not be 'missing' If you replace all of the rendering images with 'bn' the shapes do load - so it is not like the elements are incorrect, just the loading of the textures I have no idea what to do, any help would be greatly appreciated! Thanks, Sam EDIT #1: When I delete all the images from the directory I get the following error: Is there a reason why the images would be split into two blocks like that? they correspond with the textures that fail to load..
  7. Would I be incorrect in saying that MrCrayFish's program restricts you to 16x16x16? I'll have an other look at it, thanks!
  8. I am creating a vending machine, which I would like to have a model that extends two blocks high. I am fairly sure I understand how the JSON block model works - here is my potential code: I would like to map this image onto the model: But - I get this rendering error: From what I understand, this is likely due to 'UV' extending 0-16, but I need my textures to have more detail than 16x16 pixels and would ideally like to avoid having to split the model up into 100 different cubes. Is there a way to achieve what I desire? Have I (like usual) completely missed the obvious? Thanks for your time, Sam
  9. I removed the restriction and received an error, seems I interpreted it wrong! Thanks for the help. The reason I cannot just use the onUpdate method is that the item has to also work from inside a 'token pouch'. (I could always just write a bunch of if statements inside of the pouch code, but I thought this approach might be cleaner.) EDIT: Error = "java.lang.NoClassDefFoundError: net/minecraft/client/multiplayer/WorldClient"
  10. That certainly would make things a lot easier! I came to this conclusion since the server was throwing errors when I tried to remove it. Ill do some digging...
  11. So, this is more of a brainstorm - I have some general idea about how I could accomplish some implementation of this. However, I am always keen to hear what people think and if they have any better/more sophisticated methods! Item: A token which applies the swiftness potion buff when in close proximity (4 blocks) from a Mob. player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 50, 1)); Issues: The event I was going to use onPlayerUpdate(PlayerTickEvent event) is @SideOnly(Side.CLIENT) My initial thought would be to just do the logic client-side and send a flag to the server (via a packet?) to apply the potion effect? Or, maybe have an event which runs server-side? I can't seem to find a 'tick event' from the forge bus, but some research shows there may be one on the FML Bus (however most of this info is from around 2012, so it could be out-dated). So my real question is - Do you think this is the right approach? Is sending a packet potentially tens of times every tick an issue? Or is there some other way I have completely missed? Thanks in advance! Edit: Upon reflection, I realise that the title is pretty poor - my apologies.
  12. Thanks for all of that! (and for being patient, I get the impression there must be 10 people like my asking similar questions each day) I'll have a read through the recourses you linked! As, for why I don't just check the players inventory each time - ill start doing that now! The issues was that these tokens are not just stored in the players inventory, but in other inventories too - such as a token pouch! (however, the more I think about it, the more I realise it is a non-issue)
  13. From what I understand, certain blocks of code (in my case - onEntityGetHurt event) should be run on the server only and vise versa. You essentially have the code for the server/client in one and control access with @Side or Remote world. But how does the client interact with the server? - I am aware of packets, but have been avoiding them somewhat. Is a packet sent over the web? from the client's pc to the server? I chose to share information between Client/Server sections of code using NBT data stored on the player. Here is my problem I have a mod: Adds a suite of tokens to the game. Tokens provide a passive effect to the player, you just need to have them on your inventory to get the effect. The effects are not necessarily potion effects, for example - prevent block damage from explosions (tapping into the event bus). The game (client and server) has to know which tokens the player currently has - I opted to do this by adding a new NBT Tag to the player for each token: EntityPlayer player = (EntityPlayer) event.entityLiving; /*Get player*/ tags = player.getEntityData(); /*Get tag cloud*/ tags.setBoolean("amplifyingToken", false); /*Create a new tag*/ ... player.writeToNBT(tags); /*Save the tag cloud*/ Every tick (on player update event), the players NBT tags are updated to match the inventory - this is done CLIENT SIDE only. Scan code (for those interested) However, if the server then tries to read the players NBT Data - it does not show the updated version. Is NBT data suitable for sharing information client-to-server? Am I correctly writing and saving the NBT data? - player.writeToNBT(tags); Sorry if this is trivial. If you need more info, please let me know - I am painfully aware how how vague some of this may seem. Thanks in advance!
  14. Thanks! I knew it was going to be something stupid, I do feel small now. I do check code (spent the whole of yesterday digging through Entity just to find that the parameters I needed use are private and hardcoded...). I try to only post on here as a last resort. I was so convinced it was something to do with Server/Client in my event handler. It didn't even cross my mind that there would be two methods for playing sound..
  15. Unless I misunderstood you, I think they must have broke it out. This is what is inside of TickEvent: public static class WorldTickEvent extends TickEvent { public final World world; public WorldTickEvent(Side side, Phase phase, World world) { super(Type.WORLD, side, phase); this.world = world; } } Either way, I tried TickEvent.WorldTickEvent and no dice. I'm paranoid that I am missing something simple. Playing sounds server side is definitely a thing right?...
×
×
  • Create New...

Important Information

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