Jump to content

[1.7.2] Help needed for Watch dogs mod


Gaktan

Recommended Posts

Hello,

 

I recently started making a Watch dogs mod for minecraft. You can have more info on that here :

 

But right now, I am facing major modding problems. Mostly client/server synchronisation, NBTdata not saving and loading. That sort of stuff.

The reason why I can't get anything to work is because every single tutorial is outdated and I can't find anything that still works. Also, I find network stuff very confusing and I just don't understand what I'm supposed to do.

 

So, if anyone could help me with this or even with the mod if you want, that would be very nice. Maybe via PM or skype ?

 

Thank you for your time

 

Edit: I'm also having huges troubles with gradles, so I'm unable to update minecraft and forge because of a Compile error in the recompi task

Link to comment
Share on other sites

It's nothing related to the code really.

It's just that I don't know how to handle client/server. Right now, it's only client side. Like I said, I tried reading tutorials and such but I just don't understand. Even by following tutorials, I don't get the basic idea of how it works.

 

And also, I have an IExtendedEntityProperties with both save and load nbtdata. But these fonctions are never called. THe class itself is registered and works perfectly. But at no point the save and load functions are called. (PS: I followed step by step this (http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and)

Link to comment
Share on other sites

And also, I have an IExtendedEntityProperties with both save and load nbtdata. But these fonctions are never called. THe class itself is registered and works perfectly. But at no point the save and load functions are called. (PS: I followed step by step this (http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and)

 

Did you make the EntityConstructing event handler and register it correctly? Save and load nbt are automatically called when saving and loading world (are you sure those methods are overrides?)

 

Also, for the network stuff I recommend using SimpleNetworkWrapper and IMessage, its tutorial is in those forums

http://www.minecraftforge.net/forum/index.php/topic,20138.0.html

http://www.minecraftforge.net/forum/index.php/topic,20135.0.html

Link to comment
Share on other sites

diesieben07> I made a github repo for you : https://github.com/Gaktan/watchdogsmod/tree/master/com/gak/watchdogsmod

 

imadnsn> Yes, as I said. The class is working perfectly, the register works fine and the get too. These methods are for sure overriden because the class implements IExtendedEntityProperties.

 

I have seen the links you have sent. But I just don't know how to use the network. When do I send packets ? When do I retrieve them ? I'm very confused

Link to comment
Share on other sites

I thought @sideonly was a good thing. Is it not ?

(I removed the @sideonly and now nbt saving works ! thanks :) )

 

Now, the problem is that the data is out of sync. Do I have to send packets to client as soon as they join ?

 

Also, are the nbt data automatically transmitted ? Or do I have to do it manually ?

(Because in the code I posted on github, the network registering crashes the game...)

Link to comment
Share on other sites

What data? Define "out of sync". Where do you modify the data?

 

When a villager spawns, the IExtendedEntityProperties constructor is called to generate a random name, surname and info. This constructor is called by both server and client (which I don't want). Because the data is chosen randomly, the server and client have different names.

 

You need to sync IExtendedEntityProperties manually using packets.

 

This is one of my main problem, I don't know how to do that.

Link to comment
Share on other sites

Oh, I'm sorry. I didn't pay attention to that

 

But the thing is that gradle doesn't want to update. The compilation fails at the recompile

 

I change the build.gradle file and change the version to "1.7.10-10.13.0.1180"

I run the command "gradlew.bat setupDecompWorkspace --stacktrace --info" and it fails.

 

Here is the log

http://pastebin.com/M1kcvs7K

Link to comment
Share on other sites

Nevermind, I updated JDK 6 to JDK 7, that was the issue.

Now everything is up to date.

 

But, the mod doesn't want to compile at all.

 

 

[01:17:38] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[01:17:38] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[01:17:38] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

[01:17:38] [main/INFO] [FML]: Forge Mod Loader version 7.10.18.1180 for Minecraft 1.7.10 loading

[01:17:38] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.7.0_65, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7

[01:17:38] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[01:17:38] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[01:17:38] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

[01:17:38] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[01:17:38] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[01:17:38] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[01:17:38] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[01:17:40] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Gaktan/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1180/forgeSrc-1.7.10-10.13.0.1180.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!

[01:17:40] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!

[01:17:40] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Gaktan/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1180/forgeSrc-1.7.10-10.13.0.1180.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it

[01:17:40] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[01:17:40] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[01:17:40] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

[01:17:41] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[01:17:42] [main/ERROR] [LaunchWrapper]: Unable to launch

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_65]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_65]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_65]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_65]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

Caused by: joptsimple.MissingRequiredOptionException: Missing required option(s) ['userProperties']

at joptsimple.OptionParser.ensureRequiredOptions(OptionParser.java:447) ~[OptionParser.class:?]

at joptsimple.OptionParser.parse(OptionParser.java:437) ~[OptionParser.class:?]

at net.minecraft.client.main.Main.main(Main.java:89) ~[Main.class:?]

... 6 more

 

 

 

 

 

Link to comment
Share on other sites

THank you very much, it worked.

 

Now, the tough part : sending infos from the server to the client. I did as you said

 

	
public void onPlayerStartTracking(PlayerEvent.StartTracking event){
	Entity e = event.target;
	EntityPlayerMP player = (EntityPlayerMP) event.entityPlayer;
	if (e instanceof EntityVillager && EntityAdvancedVillager.get((EntityVillager) e) == null){

		EntityVillager villager = (EntityVillager) e;

		EntityAdvancedVillager eav = EntityAdvancedVillager.get(villager);
	}
}

 

I believe this is happening server side, right ?

But I'm not sure how to send the EntityAvancedVillager (which is the IEEP) to the client. And also how are they supposed to receive this data and know where it belongs ?

 

Because all I have right now is this :

 

	@Override
public void fromBytes(ByteBuf buf) {
	text = ByteBufUtils.readUTF8String(buf);
}

@Override
public void toBytes(ByteBuf buf) {
	ByteBufUtils.writeUTF8String(buf, text);
}

Link to comment
Share on other sites

diesieben07> Thank you very much for your help. I tried to do that, but the event StartTracking is called before the event EntityConstruction, so what I try to send always returns null. I tried to set priorities but nope, doesn't work.

 

lolgamerbob> Thanks, the rendering part works very well for now, you can have an idea of what it looks like on the first comment

Link to comment
Share on other sites

Mh, maybe. How do I make sure that only the client OR the server can do certain tasks ?

 

Also, I tried to send packets to all and it doesn't work : WatchDogsMod.network.sendToAll(new WatchPackets("hi :)"));

Nothing is recieved. But I still can send packets to the server

Link to comment
Share on other sites

Ok, I wasn't sure which one was the good one. But still, I can't send packets to player. Or at least, they never receive them. THis is the handler class :

 

@Override
	public IMessage onMessage(WatchPackets message, MessageContext ctx) {

		EntityPlayerMP player = ctx.getServerHandler().playerEntity;
		System.out.println(String.format("Received %s from %s", message.text, ctx.getServerHandler().playerEntity.getDisplayName()));
	}

 

But now I'm thinking about it, it looks more like a function to send messages TO the server not from it. Since it's the only function available, how do I send retrieve packets FROM the client ?

Link to comment
Share on other sites

Yes, that's what I said from the beginning  :D

 

But I'm still confused. The onMessage is called by the side receiving the packet, right ?

I made a basic "I received a message", in the function.

 

I made this little block of code in the onEntityConstructing :

if(!e.worldObj.isRemote){

			if (e instanceof EntityVillager){

				EntityVillager villager = (EntityVillager) e;

				EntityAdvancedVillager.register(villager);

				WatchDogsMod.network.sendToAll(new WatchPackets("hi "));
				WatchDogsMod.network.sendToServer(new WatchPackets("Hello "));
			}
		}

 

Only the sendToServer is showing in the console. And the sender indicated the player. But you can see in the code that I used "! is remote". I am very confused

Link to comment
Share on other sites

Thank you very much, I can now send and receive messages yay !

But not everything is working, this is what happens when the client receives the message :

 

public static class ClientHandler implements IMessageHandler<WatchPackets, IMessage> {

	@Override
	public IMessage onMessage(WatchPackets message, MessageContext ctx) {

		StringTokenizer st = new StringTokenizer(message.text, "\n");
		int id = Integer.parseInt(st.nextToken());

		EntityVillager villager = (EntityVillager) MinecraftServer.getServer().getEntityWorld().getEntityByID(id);
		EntityAdvancedVillager.register(villager);
		EntityAdvancedVillager eav = EntityAdvancedVillager.get(villager);

		eav.name = st.nextToken();
		eav.surname = st.nextToken();

		eav.info = st.nextToken();
		eav.age = Integer.parseInt(st.nextToken());
		eav.occupation = st.nextToken();

		return null;
	}
}

 

Suprisingly, (with a bunch of sysos again) it turns out the client already has these infos... (it even says that the ri

But when I check again in an other class :

 

public void onVillagerRender(RenderLivingEvent.Post event){
	if(event.entity.worldObj.isRemote){
		if (event.entity instanceof EntityVillager) {

			EntityVillager villager = (EntityVillager) event.entity;

			EntityAdvancedVillager adv = EntityAdvancedVillager.get(villager);
			if(adv == null)
				return;
			if(adv.isRenderingInfos()){
				EntityAdvancedVillager.renderLabel(villager, adv.toStringList(), villager.posX, villager.posY, villager.posZ, 5);
			}
		}
	}
}

 

EntityAdvancedVillager adv = EntityAdvancedVillager.get(villager)

Always returns null... What the actual f**k

Link to comment
Share on other sites

1. Yes, but how to I get the world then ? So I can get the villager by its ID ?

2. That makes sense

3. So I should remove isRemote ? (because the client IEEP is registered when the packet is received, as shown in the code above)

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

    • Dalam dunia perjudian online yang berkembang pesat, mencari platform yang dapat memberikan kemenangan maksimal dan hasil terbaik adalah impian setiap penjudi. OLXTOTO, dengan bangga, mempersembahkan dirinya sebagai jawaban atas pencarian itu. Sebagai platform terbesar untuk kemenangan maksimal dan hasil optimal, OLXTOTO telah menciptakan gelombang besar di komunitas perjudian online. Satu dari banyak keunggulan yang dimiliki OLXTOTO adalah koleksi permainan yang luas dan beragam. Dari togel hingga slot online, dari live casino hingga permainan kartu klasik, OLXTOTO memiliki sesuatu untuk setiap pemain. Dibangun dengan teknologi terkini dan dikembangkan oleh para ahli industri, setiap permainan di platform ini dirancang untuk memberikan pengalaman yang tak tertandingi bagi para penjudi. Namun, keunggulan OLXTOTO tidak hanya terletak pada variasi permainan yang mereka tawarkan. Mereka juga menonjol karena komitmen mereka terhadap keamanan dan keadilan. Dengan sistem keamanan tingkat tinggi dan proses audit yang ketat, OLXTOTO memastikan bahwa setiap putaran permainan berjalan dengan adil dan transparan. Para pemain dapat merasa aman dan yakin bahwa pengalaman berjudi mereka di OLXTOTO tidak akan terganggu oleh masalah keamanan atau keadilan. Tak hanya itu, OLXTOTO juga terkenal karena layanan pelanggan yang luar biasa. Tim dukungan mereka selalu siap sedia untuk membantu para pemain dengan segala pertanyaan atau masalah yang mereka hadapi. Dengan respon cepat dan solusi yang efisien, OLXTOTO memastikan bahwa pengalaman berjudi para pemain tetap mulus dan menyenangkan. Dengan semua fitur dan keunggulan yang ditawarkannya, tidak mengherankan bahwa OLXTOTO telah menjadi pilihan utama bagi jutaan penjudi online di seluruh dunia. Jika Anda mencari platform yang dapat memberikan kemenangan maksimal dan hasil optimal, tidak perlu mencari lebih jauh dari OLXTOTO. Bergabunglah dengan OLXTOTO hari ini dan mulailah petualangan Anda menuju kemenangan besar dan hasil terbaik!
    • Selamat datang di OLXTOTO, situs slot gacor terpanas yang sedang booming di industri perjudian online. Jika Anda mencari pengalaman bermain yang luar biasa, maka OLXTOTO adalah tempat yang tepat untuk Anda. Dapatkan sensasi tidak biasa dengan variasi slot online terlengkap dan peluang memenangkan jackpot slot maxwin yang sering. Di sini, Anda akan merasakan keseruan yang luar biasa dalam bermain judi slot. DAFTAR OLXTOTO DISINI LOGIN OLXTOTO DISINI AKUN PRO OLXTOTO DISINI   Jackpot Slot Maxwin Sering Untuk Peluang Besar Di OLXTOTO, kami tidak hanya memberikan hadiah slot biasa, tapi juga memberikan kesempatan kepada pemain untuk memenangkan jackpot slot maxwin yang sering. Dengan demikian, Anda dapat meraih keberuntungan besar dan memenangkan ribuan rupiah sebagai hadiah jackpot slot maxwin kami. Jackpot slot maxwin merupakan peluang besar bagi para pemain judi slot untuk meraih keuntungan yang lebih besar. Dalam permainan kami, Anda tidak harus terpaku pada kemenangan biasa saja. Kami hadir dengan jackpot slot maxwin yang sering, sehingga Anda memiliki peluang yang lebih besar untuk meraih kemenangan besar dengan hadiah yang menggiurkan. Dalam permainan judi slot, pengalaman bermain bukan hanya tentang keseruan dan hiburan semata. Kami memahami bahwa para pemain juga menginginkan kesempatan untuk meraih keberuntungan besar. Oleh karena itu, OLXTOTO hadir dengan jackpot slot maxwin yang sering untuk memberikan peluang besar kepada para pemain kami. Peluang Besar Menang Jackpot Slot Maxwin Peluang menang jackpot slot maxwin di OLXTOTO sangatlah besar. Anda tidak perlu khawatir tentang batasan atau pembatasan dalam meraih jackpot tersebut. Kami ingin memberikan kesempatan kepada semua pemain kami untuk merasakan sensasi menang dalam jumlah yang luar biasa. Jackpot slot maxwin kami dibuka untuk semua pemain judi slot di OLXTOTO. Anda memiliki peluang yang sama dengan pemain lainnya untuk memenangkan hadiah jackpot yang besar. Kami percaya bahwa semua orang memiliki kesempatan untuk meraih keberuntungan besar, dan itulah mengapa kami menyediakan jackpot slot maxwin yang sering untuk memenuhi harapan dan keinginan Anda.   Kesimpulan OLXTOTO adalah situs slot gacor terbaik yang memberikan pengalaman bermain judi slot online yang tak terlupakan. Dengan variasi slot online terlengkap dan peluang memenangkan jackpot slot maxwin yang sering, OLXTOTO menjadi pilihan terbaik bagi para pemain yang mencari kesenangan dan kemenangan besar dalam perjudian online. Di samping itu, OLXTOTO juga menawarkan layanan pelanggan yang ramah dan responsif, siap membantu setiap pemain dalam mengatasi masalah teknis atau pertanyaan seputar perjudian online. Kami menjaga integritas game dan memberikan lingkungan bermain yang adil serta menjalankan kebijakan perlindungan pelanggan yang cermat. Bergabunglah dengan OLXTOTO sekarang dan nikmati pengalaman bermain slot online yang luar biasa. Jadilah bagian dari komunitas perjudian yang mengagumkan ini dan raih kesempatan untuk meraih kemenangan besar. Dapatkan akses mudah dan praktis ke situs OLXTOTO dan rasakan sensasi bermain judi slot yang tak terlupakan.  
    • OLXTOTO: Platform Maxwin dan Gacor Terbesar Sepanjang Masa Di dunia perjudian online yang begitu kompetitif, mencari platform yang dapat memberikan kemenangan maksimal (Maxwin) dan hasil terbaik (Gacor) adalah prioritas bagi para penjudi yang cerdas. Dalam upaya ini, OLXTOTO telah muncul sebagai pemain kunci yang mengubah lanskap perjudian online dengan menawarkan pengalaman tanpa tandingan.     Sejak diluncurkan, OLXTOTO telah menjadi sorotan industri perjudian online. Dikenal sebagai "Platform Maxwin dan Gacor Terbesar Sepanjang Masa", OLXTOTO telah menarik perhatian pemain dari seluruh dunia dengan reputasinya yang solid dan kinerja yang luar biasa. Salah satu fitur utama yang membedakan OLXTOTO dari pesaingnya adalah komitmen mereka untuk memberikan pengalaman berjudi yang unik dan memuaskan. Dengan koleksi game yang luas dan beragam, termasuk togel, slot online, live casino, dan banyak lagi, OLXTOTO menawarkan sesuatu untuk semua orang. Dibangun dengan teknologi terkini dan didukung oleh tim ahli yang berdedikasi, platform ini memastikan bahwa setiap pengalaman berjudi di OLXTOTO tidak hanya menghibur, tetapi juga menguntungkan. Namun, keunggulan OLXTOTO tidak hanya terletak pada permainan yang mereka tawarkan. Mereka juga terkenal karena keamanan dan keadilan yang mereka berikan kepada para pemain mereka. Dengan sistem keamanan tingkat tinggi dan audit rutin yang dilakukan oleh otoritas regulasi independen, para pemain dapat yakin bahwa setiap putaran permainan di OLXTOTO adalah adil dan transparan. Tidak hanya itu, OLXTOTO juga dikenal karena layanan pelanggan yang luar biasa. Dengan tim dukungan yang ramah dan responsif, para pemain dapat yakin bahwa setiap pertanyaan atau masalah mereka akan ditangani dengan cepat dan efisien. Dengan semua fitur dan keunggulan yang ditawarkannya, tidak mengherankan bahwa OLXTOTO telah menjadi platform pilihan bagi para penjudi online yang mencari kemenangan maksimal dan hasil terbaik. Jadi, jika Anda ingin bergabung dengan jutaan pemain yang telah merasakan keajaiban OLXTOTO, jangan ragu untuk mendaftar dan mulai bermain hari ini!  
    • OLXTOTO adalah bandar slot yang terkenal dan terpercaya di Indonesia. Mereka menawarkan berbagai jenis permainan slot yang menarik dan menghibur. Dengan tampilan yang menarik dan grafis yang berkualitas tinggi, pemain akan merasa seperti berada di kasino sungguhan. OLXTOTO juga menyediakan layanan pelanggan yang ramah dan responsif, siap membantu pemain dengan segala pertanyaan atau masalah yang mereka hadapi. Daftar =  https://surkale.me/Olxtotodotcom1
    • DAFTAR & LOGIN BIGO4D   Bigo4D adalah situs slot online yang populer dan menarik perhatian banyak pemain slot di Indonesia. Dengan berbagai game slot yang unik dan menarik, Bigo4D menjadi tempat yang ideal untuk pemula dan pahlawan slot yang berpengalaman. Dalam artikel ini, kami akan membahas tentang Bigo4D sebagai situs slot terbesar dan menarik yang saat ini banyak dijajaki oleh pemain slot online.
  • Topics

×
×
  • Create New...

Important Information

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