-
[1.12.2] bukkit like scheduler for forge?
That does seem more efficient than my code. Hope my next bit of code goes this smoothly. Thank you.
-
[1.12.2] bukkit like scheduler for forge?
How about this? If daTimer is set to -1 do nothing, if daTimer gets below -1 then set it to -1 so it does nothing, if daTimer is set higher than -1 then count down to 0 to run code.
-
[1.12.2] bukkit like scheduler for forge?
What if I start the timer with daTimer being 200, and count down to 0, then until I set it to 200 again, it does nothing? Do you think that would be more efficient? I could also add checks so that when daTimer gets higher than 200, or lower than 0, the counter stops adding/subtracting until it is called.
-
JoelGodOfWar changed their profile photo
-
[1.12.2] bukkit like scheduler for forge?
Which player doesn't matter for my reasons, a player is in bed, the variable is set in another function to start the look for the 200 tick delay. daTimer2 is set to daTimer by the same function as playerisinbed. Should I reset daTimer every now and then? I just need to know when 200 ticks(10 seconds) have elapsed. And since the servertickevent runs every tick, either I need to reset daTimer constantly, or just let it count up. I've been looking at bukkit's source to try to see if there was a way to make my own scheduler. I'm surprised forge has never added a scheduler, to run code at a certain delay. I'm trying to port my SinglePlayerSleep plugin over to forge, it will run serverside only, adding nothing if used on clientside.
-
[1.12.2] bukkit like scheduler for forge?
So I may have found a way to work around this. Is there anything I should change? Several variables are set in the event that would schedule the runnable in bukkit, daTimer2, playerisinbed, etc.
-
[1.12.2] bukkit like scheduler for forge?
Is there a scheduler for the server to run a runnable after a delay? Like the one in bukkit/spigot? I'm trying to port my plugin to a Forge Serverside Mod. The mod will only do anything on a server. Any help will be greatly appreciated. For bukkit/spigot I use the following code. I've been out of Forge Modding for nearly 3 years, and decided to try to bring a plugin from bukkit, into forge.
-
[1.9] locate nether portal
Where is the code minecraft uses to find portals to send a player to? Is it in net.minecraft.world.Teleporter? If so is it the "placeInExistingPortal", or "makePortal"?
-
[1.8.9] [UNSOLVED] Local Weather
Check out EntityRenderer, addRainParticles.
-
[1.9] PlaySound gui.button.press [SOLVED]
Got it, thank you
-
[1.9] PlaySound gui.button.press [SOLVED]
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); PositionedSoundRecord no longer has a "create" function
-
[1.9] Updating Mod issues [partially solved]
This is now String durationString = Potion.getPotionDurationString(potionEffect, 1);
-
[1.9] Updating Mod issues [partially solved]
Would now be. Tessellator tessellator = Tessellator.getInstance(); VertexBuffer worldrenderer = tessellator.getBuffer(); VertexBuffer in net.minecraft.client.renderer.VertexBuffer not net.minecraft.client.renderer.vertexbuffer.VertexBuffer Thank you, that makes sense with one of the possible fixes eclipse suggested.
-
[1.9] Updating Mod issues [partially solved]
I've nearly completely updated my mod to the 1.9 release (1.9-12.16.0.1767-1.9). But i'm having serious trouble finding resolutions for these errors. nightVision cannot be resolved or is not a field potionTypes cannot be resolved or is not a field The import net.minecraft.client.renderer.WorldRenderer cannot be resolved The method getPotionDurationString(PotionEffect, float) in the type Potion is not applicable for the arguments (PotionEffect) The method getPotionID() is undefined for the type PotionEffect The method getWorldRenderer() is undefined for the type Tessellator WorldRenderer cannot be resolved to a type mc.thePlayer.removePotionEffect(Potion.nightVision.id); Potion.nightVision.id - seems to have vanished from net.minecraft.potion.Potion. While i can make a class to pass the ID of nightVision to removePotionEffect, since i share the code on github i'd rather use the propert method. String durationString = Potion.getPotionDurationString(potionEffect); Potion.getPotionDurationString(potionEffect) - Now requires a float PotionEffect potionEffect = (PotionEffect)it.next(); Potion potion = Potion.potionTypes[potionEffect.getPotionID()]; Potion.potionTypes[potionEffect.getPotionID()] - potionTypes is missing, and getPotionID is missing. Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); import net.minecraft.client.renderer.WorldRenderer; - is missing Any help you can give is much appreciated, as until i can build it i can't test it for bugs.
-
SubscribeEvent EntityJoinWorldEvent [Solved]
Is EntityJoinWorldEvent, a server side event, or will the client fire this event upon joining a multiplayer server?
-
[1.8.9] Detect when client connects to server [solved]
The solution i was able to come up with was to use ClientChatReceivedEvent. Look for the "<player> joined the game" message that the spigot server sends when you connect to the SMP servers. Then it gets the player name, and checks if it is our client's player name. If they match then it sends the packet to the Server. If the companion plugin is enabled on the server, the plugin will respond with permissions set by an OP. @SubscribeEvent public void onChatRecieved(ClientChatReceivedEvent event) { String StandOut = " ***************************************************"; if(event.message.getUnformattedText().contains("joined the game")){ if(event.message.getUnformattedText().contains(mc.thePlayer.getDisplayNameString())){ ForgeMod.network.sendToServer(new MyMessage("12345678901234567890123456789012345678901234567890")); } //System.out.println("Chat contains JSCM" + StandOut); }else{ //System.out.println("" + event.message.getUnformattedText() + StandOut); } } Minecraft mc = Minecraft.getMinecraft(); }
IPS spam blocked by CleanTalk.