Jump to content

[1.8.9] How to register many clicks (CPS) when clicked?


lethinh

Recommended Posts

4 minutes ago, diesieben07 said:
  • Your onClientTick method executes twice every tick. You must check TickEvent::phase.
  • Why do you have that clickedThisTick thing anyways?
  • I don't see you removing anything from that list.
  • I don't see you displaying the list anywhere.

I don't really understand what you mean. And I'm not going to display this list, and where to remove click from the list (onClientTick)?

Edited by lethinh
Link to comment
Share on other sites

1 minute ago, diesieben07 said:

Then what are you going to do with it?

 

Before you use it in any way you have to cleanse it of old entries.

I mean I'm going to register many clicks when I clicked, not for displaying it. And onClientTick is where I have to remove the old entries?

Link to comment
Share on other sites

4 minutes ago, diesieben07 said:

Yes, but you must do something with this value, right? Otherwise why would you calculate it. Show this something.

 

No. Read again what I said.

Oh, but what do I have to do with the list? You said in the cps reply that just add System.currentTimeMillis() to the list. (May be I misunderstanded)

Edited by lethinh
Link to comment
Share on other sites

Just now, diesieben07 said:

Yes, you have to add it to the list. But if you then never do anything with the list, why collect the values?

Why do you want to know the CPS? You must want to do something with the cps value, right? Do you want to display it? Give something to the player based on it? Collect statistics?

Just kind of like that. But I thought I added 

  1. clicks.add(Long.valueOf(System.currentTimeMillis()));
in the code.
Link to comment
Share on other sites

Just now, diesieben07 said:

Dude, seriously?

Take this example: The game measures FPS. Why does it do that? So that it can display it in the debug screen.

Why do you want to measure CPS? Just to consume CPU and memory resources? 

Umm, but you said that is the way to increase CPS. So what is the way to get many clicks after I clicked?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • https://drive.google.com/file/d/1M0EG-c5yfRd08DSnE5HVQNCu2v0YtA7A/view?usp=sharing  
    • so im not sure if your still watching this TileEntity but once we loaded a FTB modpack we wanted to run on the server it no longer seems to run. The console opens like normal but we've been sitting here for like a little over an hour and the server screen has not yet opened. Should we just keep waiting at this point?
    • I have now easily fixed the duplication error present, I was just not looking.   I have been working for the past half hour to try and fix another error present, this time with the Creative Mode Tab.   I have changed some things around to get where I am currently. (ModFoods to ModDrinks*) and it cannot find the symbol ".get" at the end of the code. *The custom class you recommended pOutput.accept(ModDrinks.ORANGE_JUICE.get()); I think the point I am at currently is the closest I have to how it should be but because I am not as experienced with java I would not know.  I have also removed ORANGE_JUICE and LEMON_JUICE from the ModFoods class, to avoid confliction. I do hope all this can be fully resolved soon.  
    • [SOLVED]  public class RenderGUIHandler { @SubscribeEvent public void renderGUI(RenderGameOverlayEvent.Text event){ Client.hud.draw(); } } As I was playing around a little with the code, i found out about an option to change The RenderGameOverlayEvent.Post to RenderGameOverlayEvent.Text
    • public class HUD { public Minecraft mc = Minecraft.getMinecraft(); public static class ModuleComparator implements Comparator<Module>{ @Override public int compare(Module o1, Module o2) { if (Minecraft.getMinecraft().fontRendererObj.getStringWidth(o1.name) > Minecraft.getMinecraft().fontRendererObj.getStringWidth(o2.name)){ return -1; } if (Minecraft.getMinecraft().fontRendererObj.getStringWidth(o1.name) < Minecraft.getMinecraft().fontRendererObj.getStringWidth(o2.name)){ return 1; } return 0; } } public void draw(){ ScaledResolution sr = new ScaledResolution(mc); FontRenderer fr = mc.fontRendererObj; Collections.sort(Client.modules, new ModuleComparator()); GlStateManager.pushMatrix(); GlStateManager.translate(4,4,0); GlStateManager.scale(1.5,1.5,1); GlStateManager.translate(-4, -4, 0); fr.drawString("Skyline", 10, 10, -1); GlStateManager.popMatrix(); int count = 0; for (Module m : Client.modules){ if (!m.toggled || m.name.equals("TabGUI")) continue; int offset = count* (fr.FONT_HEIGHT + 6); GL11.glTranslated(0.0f, 0.0f, -1.0f); Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.name) - 10, offset, sr.getScaledWidth() - fr.getStringWidth(m.name) - 8, 6 + fr.FONT_HEIGHT + offset, -1); Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.name) - 8, offset, sr.getScaledWidth(), 6 + fr.FONT_HEIGHT + offset, 0x90000000); fr.drawString(m.name, sr.getScaledWidth() - fr.getStringWidth(m.name) - 4, offset + 4, -1); count++; } Client.onEvent(new EventRenderGUI()); } } I have just recently stumbled upon this Problem, where the HudRenderer renders the wrong section of the textures and therefore completely destroys the Minecraft Armour and Hunger Bar. I am currently thinking if it is an issue with the DrawRect changing something it shouldn't. But I couldn't find anything about it. (To keep things Clean, the function is Called from another file) public class RenderGUIHandler { @SubscribeEvent public void renderGUI(RenderGameOverlayEvent.Post event){ Client.hud.draw(); } } Any help would be greatly appreciated  
  • Topics

×
×
  • Create New...

Important Information

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