
SSslimer
Members-
Posts
152 -
Joined
-
Last visited
Everything posted by SSslimer
-
I heard about Packet Handling, but I am not sure is it what I need. If not, how I should send packets?
-
Thanks.Need I packet handling to send packets?
-
My village code is the same. I am not sure is the code working, but it should, because it's the same as vanilla. I want to make more usefull villages and I don't want to edit base files. Why should I send Packets if I my mod is for single player?
-
I use bottom code with findNearestVillage() to search village and get from it informations.When I use normall village the code works and in my GUI disply e.g. number of villagers.My code for village is the same, because I need to be sure that village creates. If the code is the same with necesary changes ,the code for loading and saving data is incorrect.
-
Stil doesn't work. BetterVillageCollection vlgc = BetterWorldHandler.get(worldServer);
-
It's terrible.I only need to load and set data from world. Now my code looks like: public static BetterVillageCollection get(World world) { BetterVillageCollection data = (BetterVillageCollection)world.loadItemData(BetterVillageCollection.class, IDENTIFIER); if (data == null) { data = new BetterVillageCollection(world); world.setItemData(IDENTIFIER, data); } else { data.func_82566_a(world); } return data; } [code] BetterWorldHandler handler = new BetterWorldHandler(); BetterVillageCollection vlgc = handler.get(worldServer); BetterVillage closestVillage = vlgc.findNearestVillage( MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), 50); [/code]
-
Stil doesn't work. Handler class: public static BetterVillageCollection villageCollectionObj; @SubscribeEvent public void someEventMethod(WorldEvent event) { BetterVillageCollection villagecollection = (BetterVillageCollection)event.world.mapStorage.loadData(BetterVillageCollection.class, "bettervillages"); if (villagecollection == null) { this.villageCollectionObj = new BetterVillageCollection(event.world); event.world.mapStorage.setData("bettervillages", this.villageCollectionObj); } else { this.villageCollectionObj = villagecollection; this.villageCollectionObj.func_82566_a(event.world); } } And code for my mod. BetterWorldHandler handler = new BetterWorldHandler(); BetterVillageCollection vlgc = handler.villageCollectionObj; BetterVillage closestVillage = vlgc.findNearestVillage( MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), 50); [/cpde]
-
So what I need to do to make my villageCollectionObj in world server??? EntityPlayer player = mc.thePlayer; WorldServer worldServer = DimensionManager.getWorld(player.dimension); if(worldServer == null){ return null; } BetterVillageCollection vlgc = worldServer.villageCollectionObj; BetterVillage closestVillage = vlgc.findNearestVillage( MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), 50);
-
I didn't notice that World in WorldEvent. Can I add public static BetterVillageCollection villageCollectionObj; into world.class by my handler.
-
Error is the same while World world; world.mapstorage
-
I changed the error. Is it full now?
-
I am absolutely new with events too. Something I have wrong. In my load method MinecraftForge.EVENT_BUS.register(new BetterWorldHandler()); And method in my handler @SubscribeEvent public void someEventMethod(WorldEvent event) { BetterVillageCollection villagecollection = (BetterVillageCollection)this.mapStorage.loadData(BetterVillageCollection.class, "bettervillages"); if (villagecollection == null) { this.villageCollectionObj = new BetterVillageCollection(world); this.mapStorage.setData("bettervillages", this.villageCollectionObj); } else { this.villageCollectionObj = villagecollection; this.villageCollectionObj.func_82566_a(world); } } And error from Console [13:13:52] [server thread/ERROR]: Encountered an unexpected exception net.minecraft.util.ReportedException: Exception getting block type in world at net.minecraft.world.World.<init>(World.java:316) ~[World.class:?] at net.minecraft.world.WorldServer.<init>(WorldServer.java:103) ~[WorldServer.class:?] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:63) ~[integratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:96) ~[integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:442) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:742) [MinecraftServer$2.class:?] Caused by: java.lang.NullPointerException at BetterWorld.BetterWorldHandler.someEventMethod(BetterWorldHandler.java:18) ~[betterWorldHandler.class:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler_4_BetterWorldHandler_someEventMethod_WorldEvent.invoke(.dynamic) ~[?:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) ~[ASMEventHandler.class:?] at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) ~[EventBus.class:?] at net.minecraft.world.chunk.Chunk.onChunkLoad(Chunk.java:1014) ~[Chunk.class:?] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:149) ~[ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:163) ~[ChunkProviderServer.class:?] at net.minecraft.world.World.getChunkFromChunkCoords(World.java:487) ~[World.class:?] at net.minecraft.world.World.getBlock(World.java:392) ~[World.class:?] at net.minecraft.world.World.isAirBlock(World.java:415) ~[World.class:?] at net.minecraft.world.World.getTopBlock(World.java:376) ~[World.class:?] at net.minecraft.world.WorldProvider.canCoordinateBeSpawn(WorldProvider.java:97) ~[WorldProvider.class:?] at net.minecraft.world.WorldServer.createSpawnPosition(WorldServer.java:806) ~[WorldServer.class:?] at net.minecraft.world.WorldServer.initialize(WorldServer.java:770) ~[WorldServer.class:?] at net.minecraft.world.World.<init>(World.java:301) ~[World.class:?]
-
Village can be material (structures) and nomaterial(village centred in some point calculated from doors).My village will apear after generating my own building on world. When it will generate, door will create village and to make that village I need to add that method and villagecollection class. Sorry for problems with explaining, but english isn't my native language.
-
To brighten the problem: I don't want buildings. Code writen higher is needed to make my village setting and anihilating, by checking the door number. Without that code my village can't appear. Maybe there is some way to make village collection without editing world.class or using asm, but so far it's only way known to me.
-
I don't want to add own building yet.But create own village. Here is what i need to add to World.class public VillageCollection villageCollectionObj; in finishSetup(): VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); if (villagecollection == null) { this.villageCollectionObj = new VillageCollection(this); this.mapStorage.setData("villages", this.villageCollectionObj); } else { this.villageCollectionObj = villagecollection; this.villageCollectionObj.func_82566_a(this); } and in world(ISaveHandler p_i45369_1_, String p_i45369_2_, WorldSettings p_i45369_3_, WorldProvider p_i45369_4_, Profiler p_i45369_5_): VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.loadData(VillageCollection.class, "villages"); if (villagecollection == null) { this.villageCollectionObj = new VillageCollection(this); this.perWorldStorage.setData("villages", this.villageCollectionObj); } else { this.villageCollectionObj = villagecollection; this.villageCollectionObj.func_82566_a(this); } of course all the needed names will be changed
-
I know that I need to use ASD, but it's my forst contact with coremods and ASM. To my project I must made own village that will be a bit similar to vanilla, but my own villagecolection need to be add in finishSetup() method and world(...)
-
I need to add some code to method in World.class
-
I am working on my project, but I need to use coremode instead of mod.I can't find any tutorials for 1.7.2 Can somebody help me with setup Eclipse and basics of core mods?
-
I know how to find AI and set it, I was looking to other Entityclasses too, but even I have the same AI and entity settings ,it doesn't work. It's ok, I have noticed that ALL mobs in Eclipse move in the same way. Topic can be closed.
-
After updating my mod for 1.7.2 I have problem with my mob. Sometimes when perform tasks(goto Zombie and atack), it stops while going to target and wait for a while. Second case:sometimes it don't go in straight line to the target Here is my AIList, rest of AI was removed to repair problem. public EntityWarior(World par1World, int par2) { super(par1World); this.setSize(0.6F, 1.8F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityZombie.class, 1.0D, true)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityZombie.class, 0, false, true, IMob.mobSelector)); }