Jump to content

Palinator2

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Palinator2

  1. Sure if you can tell me how I can find this out because line 110 in the compiled class file don't refer to line 110 in the source file and debugging the code with a breakpoint at the method and/or class is not working (the world keeps loading but newer gets to 100% so I can't play a world but anyway the breakpoints are ignored if I disable them and enable them after I entered a world and use the item to place the spawner and modify it). Breakpoints in my own code work but not in the source class files.
  2. readFromNBT(null) has been removed (was never called anyway ^^) Line 110 of MobSpawnerBaseLogic is the original vanilla code (I haven't touched the spawner's logic in any way). Every other mob (even the XPOrb entity) is easily set up in the spawner except the HorseEntity.
  3. I have an Item which places a vanilla spawner and changes the spawner's "SpawnData" NBT to the prefered entity. This works great for all mobs expect the entity EntityHorse (horses). Am I missing some required NBT tags? Actual code: private final void changeSpawnerEntityID(final TileEntityMobSpawner paramTileEntityMobSpawner) { if(null != paramTileEntityMobSpawner) { final MobSpawnerBaseLogic mobSpawnerBaseLogic = paramTileEntityMobSpawner.func_145881_a(); if (mob.getEntityID().isEmpty()) { mobSpawnerBaseLogic.readFromNBT(null); } else { mobSpawnerBaseLogic.setEntityName(mob.getEntityID()); // "EntityHorse" if (mob.isSybType()) { final NBTTagCompound spawnerNbt = new NBTTagCompound(); paramTileEntityMobSpawner.writeToNBT(spawnerNbt); final NBTTagCompound entityNbt = spawnerNbt.getCompoundTag("SpawnData"); writeEntityToNbt(entityNbt); spawnerNbt.setTag("SpawnData", entityNbt); paramTileEntityMobSpawner.readFromNBT(spawnerNbt); } } } } private final void writeEntityToNbt(NBTTagCompound paramNBTTagCompound) { if (paramNBTTagCompound == null) { paramNBTTagCompound = new NBTTagCompound(); } final String[] data = mob.getSubTypeKeys(); // { "i:Type:0", "i:Variant:256", "b:SkeletonTrap:0" } for (final String d : data) { final String[] a = d.split(":");// { "i", "Type", "0" } ... if (a.length == 3) { final String key = a[1]; if ("i".equals(a[0])) { final Integer value = Integer.parseInt(a[2]); paramNBTTagCompound.setInteger(key, value); } else if ("b".equals(a[0])) { final Byte value = Byte.parseByte(a[2]); paramNBTTagCompound.setByte(key, value); } } } } throws:
  4. Okay thank you very much, it's now clear to me how ItemBlock works. But I need this for 1.7.10 so is there really no other way? Can I make a custom Block wich has the exact save behavior as the MobSpawner block? Can I just use something like CustomSpawner extends MobSpawner or so to make an exact copy as new block? In this case which Block have I use to?
  5. "R", "RR", 'R', means: R . R R and . R R R will work ("." = empty), can you confirm? PS: also works: GameRegistry.addRecipe(new ItemStack(ModItems.ljonesbadasspickaxe), "R", "RR", 'R', Blocks.cobblestone);
  6. I think this is simpler than I thought but I have no idea how I can achieve this? No one?
  7. Maybe the build number changes but since you don't modidy the structure and signature of the classes it shouldn't be a problem. One thing you can do: search on google for "contribute to minecraft forge" or something, maybe there is a tutorial where you can see how the source code itselfe is set up in an IDE so you can modify the source code and build it and after this use the build jar as library in your mod environment.
  8. Yes because the source code is imported in the mod environment as library. You need to open the source code itselfe as project, but I haven't looked into the project structure of the source code so maybe it's not that simple.
  9. Minecraft: Short answer: No Long answer: since the source code of Minecraft is not public (as I know), you need to decompile the minecraft.jar, do your stuff and recompile it back into an minecraft.jar Forge: Yes, just set up your environment and import the source code and do your stuff. Afterwards you need to use your modified source code to create your mods but I guess this is more complicated than it sounds?
  10. I made all types of spawners available as Items (placing the spawner with the rigth mob works YEAH!) in the creative tabs but the texture is still an ugly item texture so how can I make the Item an ItemBlock to render the item in the players inventory as vanilla spawner block? To make it more clear: For now all the different types of spawners are renderes as Item and also implemented as Item which are placing a vanilla Blocks.mob_spawner in the world and configuring it's held Entity and NBT data to spawn the wanted type of mob < working! But I want them to be rendered as Block in the players inventory and in the player's hand so I thougth I can simply change Item to ItemBlock and re-use the vanilla Spawner block so the ItemBlock looks exactly the same as the vanilla spawner. I have: public class MonsterSpawner extends ItemBlock { public MonsterSpawner() { super(Blocks.mob_spawner); setCreativeTab(CreativeTabs.tabMisc); } } which gives me: java.lang.IllegalStateException: Can't free registry slot 52 occupied by net.minecraft.item.ItemBlock@183e8023
  11. I wan't to place custom spawners including NBT tags for example: spawner set to skeleton and skeleton type is set to 1 for wither skeletons And is there a way to get the default NBTTagCompound of mobs? Like: NBTTagCompound nbt = new NBTTagCompound(); EntitySkeleton.writeToNbt(nbt); // nbt should now be filled with ALL default nbt tags from the Skeleton Entity INCLUDING the SkeletonType tag! Crafting/placing all types of spawners is working but I am stuck on how can I change specific NBT tags (skeleton type, zombie villager, etc.)
×
×
  • Create New...

Important Information

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