Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Minecraft Forge
  • General Discussion
  • Forge MP, Bukkit and Minecraft 1.3
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 3
Kinniken

Forge MP, Bukkit and Minecraft 1.3

By Kinniken, June 24, 2012 in General Discussion

  • Reply to this topic
  • Start new topic
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next
  • Page 3 of 5  

Recommended Posts

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 28, 2012

Never mind, I'll just make my mod_ class abstract and implement the MP and SP specific parts in sub-classes. As long as the class' name doesn't start with mod_ Forge won't try to load it right?

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 28, 2012

It can delegate to another class, and the other class can register the animations on the client and just be a dummy on the server.

 

I don't see how. The signature itself is different on client and server.

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

ScottKillen    17

ScottKillen

ScottKillen    17

  • Creeper Killer
  • ScottKillen
  • Forge Modder
  • 17
  • 144 posts
Posted June 28, 2012

It is a dummy on the server.

  • Quote

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 28, 2012

Yep, but with a different signature:

 

public void registerAnimation(Object game)

 

Anyway doesn't matter, the abstract mod class with two implementations works for me.

 

Otherwise, quick question: how do the world objects work on the server side? There's one per dimension I assume, how can I check which ones are available? On the client side, I assume that minecraft.theWorld is always the dimension the player is in, so that I do not have access to other dimensions even if they are loaded server-side?

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

ScottKillen    17

ScottKillen

ScottKillen    17

  • Creeper Killer
  • ScottKillen
  • Forge Modder
  • 17
  • 144 posts
Posted June 28, 2012

Glad it worked out. In my mods, there is no functionality whatsoever in in the mod_ classes.

 

As to the SMP Multiverse...will DimensionManager.getWorld(id) work for you?

  • Quote

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 28, 2012

Sounds like what I was looking for, thanks!

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted June 28, 2012

Ya, pretty much all the hold overs from ModLoader are the reasons why we are still incompatible with the BaseMod interface.

So, blaim Risu, not us.

 

However, @SidedDelegate would be the way to go as well as re-writing your animations to use the new ITextureFX interface, that makes your textures TexturePack change aware.

FMLTextureFX is a helper class, see how its used inside Minecraft Fire and Water animations.

 

If you are doing things properly, you only have to register your animations once at load.

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 28, 2012

Ya, pretty much all the hold overs from ModLoader are the reasons why we are still incompatible with the BaseMod interface.

So, blaim Risu, not us.

 

Blaming backward compatibility seems more appropriate ;)

 

However, @SidedDelegate would be the way to go as well as re-writing your animations to use the new ITextureFX interface, that makes your textures TexturePack change aware.

FMLTextureFX is a helper class, see how its used inside Minecraft Fire and Water animations.

 

If you are doing things properly, you only have to register your animations once at load.

 

That's the case already. I'll check those APIs but latter, my plate is more than full already. I'm getting close to getting the server code to compile, but haven't even started on the interaction code...

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted June 28, 2012

Well, there is no backwards compatibility in the minecraft world, so that's not a valid thing to blame, when it comes to ML.

He has an opportunity every MC version to cleanup his interface, because he knows that modders will have to recompile anyways :P

 

But ya, sounds good, getting closer to compiling, once you get things going we can help you make things more efficient/cleaner.

Just so you know, registerAnimations doesn't only get called at load. It gets called every mod pack change.

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 28, 2012

Sure, would certainly help. Though the biggest challenges I forsee are internal to Millénaire. I'm really not decided in particular on how much data I'll send to the client. On one side giving the client a copy of the village and quest objects will require a lot of back-and-forth synching, on the other not doing it will make displaying the information GUIs client-side a real pain. Tricky.

 

Also, there are some features where I'm not even sure how they'll work in multiplayer. Quest deadlines and hired villagers in particular - in MP time never stops, even when a player is disconnected.

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted June 28, 2012

Well, for quests that have deadlines, you could freeze the player's time when they login and out. Ae, in the quest you'd store a start time and a end time. If a player logs out before that end time arrives you'd store a remaining time (start-now) and when they login reset the end to (now+remaining).

 

As for the village objects, hum, depends on exactly what type of info that is and when it changes.

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 28, 2012

Yeah, I guess i'll do that. I'm definitely going to have to build some kind of player profile system to store data that was game-wide until now (like quests or reputation with cultures), I'll add time passed to it.

 

Otherwise, I assume all the multiplayer minimaps are fully client-based? I'm wondering how to manage my village map. The data it depends on should really be server-only (it includes all the pathing details), but sending the picture seems wasteful.

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted June 28, 2012

Well what all do you use to generate the minimap?

Lat time I played there was a sign in the town hall that showed the map of the town? Is that what you're referring to?

That would be fairly small info, just square here, square there.

 

But i'd have to see the particular details to see what would be the best solution.

If you're not sending them updates every tick, its fairly good to just send any of the data you need.

 

So ya, depends on exactly what you need to print.

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 29, 2012

The map also shows what ground is water, dangerous blocks, suitable for  building on etc. But I'mm sure I can condense the info needed and then it's not so big.

 

Otherwise, quick questions:

- does MinecraftForge.registerEntity() replace ModLoader.registerEntityID() or is in addition to it?

- in MinecraftForge.registerEntity(), I assume the range is in blocks?

- what would "standard" values be for the range and the update frequency?

- why would I need or not need the velocity info?

 

Presumably whatever settings are used for mobs would be fine for my villagers.

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted June 29, 2012

Yes, you can use the local world to show that map info, if a player is close enough to see the map, he should be close enough to have the chunks sent to him right?

Use the client side chunk data to determine simple terrain stuff like that.

 

No, registerEntity does not replace registerEntityID()

It register the entity for tracking, and that information, and makes it so that you can not care and just use a random number for the ID in registerEntityID.

The ID you give to MinecraftForge.registerEntity is a mod unique id instead of a globally unique ID. So you can use 1, 2, 3 etc..

But in registerEntityID you can use Random.nextInt(35565) for all MC cares.

 

As for your other questions, you can check EntityTracker on the server to see some example values for normal mobs.

As for the velocity info.. is your mob velocity sensitive? Like Minecarts, or boats? If not you prolly don't need that info.

 

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 29, 2012

Ok, got it to run in Multiplayer* :D The pure server-side aspect seems to be working fine, I found a village and the villagers are doing their work properly. The spooking part however is that they are completely invisible client-side. I'm seeing regular errors of this kind in the log file: "Could not find entity info for 0 : 106". I assume that's due to an error in how I registered my entities? Any idea?

 

And thanks for the explanation.

 

* without any kind of support for interaction, client-side data or GUI...

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 29, 2012

Also, I have multiple types of packets to send. Should I declare several channels or am I expected to put a packet id as the first value in the data?

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted June 29, 2012

yes, take a look at how Forge deals with it's packets. It sets the first to a packet type, and the rest is the data.

Think of it this way, the channel name is SHARED with all other mods, so why use more then you need to?

 

And ya that error in the log is cuz you messed up the registration, show me code.

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 30, 2012

Not much to see, just this in mod_Millenaire.load() on client and server side:

 

MinecraftForge.registerEntity(MillVillager.class, instance,VILLAGER_ENT_ID, 80, 3, true);

 

(after the ModLoader.registerEntityID)

 

Did I miss something?

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 30, 2012

Also, to send packets form the server to the clients I can use methods like this:

 

((MinecraftServer)ModLoader.getMinecraftServerInstance()).configManager.sendPacketToPlayersAroundPoint(p.x, p.y, p.z, range, 0, packet);

 

What should I use client-side to send packets to the server? Should it be MinecraftForge.sendPacket? If yes, what is the NetworkManager I'm expected to pass to it?

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted June 30, 2012

Is your mods extending NetworkMod now?

That issue is usually caused when it cant find your mod, or it's not assigned an id, which happens if its not a NetworkMod.

 

As for where you get teh NetworkHandler, you get it from the IConnectionHandler events.

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 30, 2012

Yes:

 

public abstract class BaseMillenaireMod extends NetworkMod implements IConnectionHandler, IPacketHandler {

 

So for that NetworkHandler, I just keep a reference to it from onConnect()? Why do I need to do this on the client and not on the server?

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted June 30, 2012

Because on the client, there is no way to get the network handler for the current connection.

And on the server there are many many users, so it makes sense that they have such things built in.

 

Interesting, then im not sure why your mod wouldn't be assigned an id.

Perhaps try debugging and sticking something in the ModList packet handler to see if it's sending your a ID.

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 30, 2012

The weird thing is that custom packets work fine. I'll try that debugging.

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites

Kinniken    2

Kinniken

Kinniken    2

  • Diamond Finder
  • Kinniken
  • Members
  • 2
  • 266 posts
Posted June 30, 2012

Just an idea, could it be because I extend NetworkMod indirectly?

  • Quote

width=500 height=100http://www.millenaire.org/img/dynamicsig.png[/img]

Share this post


Link to post
Share on other sites
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next
  • Page 3 of 5  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 3
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Zeher_Monkey
      [SOLVED] 1.16.3 How to get the World Name for saving files in the /saves folder

      By Zeher_Monkey · Posted 3 minutes ago

      Very true, but to be honest my code only needed a few lines updated. I want to move to something more native, but am struggling to find references to WorldSavedData. I am not worried about compact data, there is only 1 master file which contains each registered object, and each object is only ~3KB in size. It allows easy debugging, and on servers specifically, tweaks to the data that do not require things like NBTExplorer to use. It works for my purposes.
    • Differentiation
      Is it possible to change the color of Firework Spark particle?

      By Differentiation · Posted 10 minutes ago

      Hey,   Pretty simple question: is it possible to specify a color for the firework spark particle effect when spawning it?   Thanks
    • brok4d
      Modded 1.16 fluid has no physics

      By brok4d · Posted 18 minutes ago

      Well, you should have it, since that's why you get the error, the .png files and the .mcmeta files since the .mcmeta files are for animation if I'm not mistaken. This is what the .mcmeta have. { "animation": { "frametime": 4 } }
    • sc0rich
      how do I config mods in 1.16.4?

      By sc0rich · Posted 20 minutes ago

      Oh, okay.       wait, then how do I access the configurations? do you know where do I go? how I edit .cfg and .toml files? cause I just found it
    • diesieben07
      how do I config mods in 1.16.4?

      By diesieben07 · Posted 30 minutes ago

      They very much have a config. They just do not have a config GUI.
  • Topics

    • Zeher_Monkey
      8
      [SOLVED] 1.16.3 How to get the World Name for saving files in the /saves folder

      By Zeher_Monkey
      Started Wednesday at 12:20 AM

    • Differentiation
      0
      Is it possible to change the color of Firework Spark particle?

      By Differentiation
      Started 10 minutes ago

    • NullDev
      3
      Modded 1.16 fluid has no physics

      By NullDev
      Started 4 hours ago

    • sc0rich
      6
      how do I config mods in 1.16.4?

      By sc0rich
      Started Yesterday at 02:11 AM

    • TeaWithBebeLoca
      0
      How to download Forge on Linux Debian?

      By TeaWithBebeLoca
      Started 33 minutes ago

  • Who's Online (See full list)

    • Deadlocked47
    • CookieLukas
    • Kaiser Frederick
    • Seynox
    • Differentiation
    • Pickle_Face5
    • TeaWithBebeLoca
    • brok4d
    • Eksity
    • Seika85
    • Zeher_Monkey
    • FactionsFire
    • sc0rich
    • Hubmac
    • BruhZenith
  • All Activity
  • Home
  • Minecraft Forge
  • General Discussion
  • Forge MP, Bukkit and Minecraft 1.3
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community