Jump to content

nyankatze

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by nyankatze

  1. Oh, thank you! Removing extra configurations works =)
  2. When I wrote some code and checked it in singleplayer, it works perfectly. Somebody installed my mod on server, and it didn't want to work. So, I wanted to run my mod on server in dev inveroment. Console output Server configurations It's obvious that minecraft missed method "main" in net.minecraft.server.MinecraftServer, but when I checked it, it was there. Am I missed something? Maybe I need to install server sources separatly?
  3. Umm... Try to delete .gradle folder in your user folder and try to run "gradlew setupDecompWorkspace eclipse" again. Yes, in cmd
  4. No, he means something different. Run gradlew eclipse!
  5. Oh, you! Try this: setBlockTextureName("extrastuff:blockMatter");
  6. Hi, guys! I can't get how to add pre-written book in creative tab. I made itemstack with nbt like in this topic. Help noob, please!
  7. I'm trying to replace vanilla axes.
  8. I am not advansed in java, my bad, sorry :-/
  9. Hi, guys! I have one question. How to replace vanilla item class with my new class? Does anybody know? I seen topic where were BlockReplaceHelper, but my attempts end in failure when I tried to rewrite to fit my needs. [spoiler=BlockReplaceHelper] import com.google.common.collect.BiMap; import cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry; import cpw.mods.fml.common.registry.GameData; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.util.ObjectIntIdentityMap; import net.minecraft.util.RegistryNamespaced; import java.lang.reflect.Field; import java.lang.reflect.Modifier; public class BlockReplaceHelper{ public static boolean replaceBlock(Block toReplace, Class<? extends Block> blockClass){ Field modifiersField=null; try{ modifiersField=Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); for(Field field:Blocks.class.getDeclaredFields()){ if (Block.class.isAssignableFrom(field.getType())){ Block block=(Block)field.get(null); if (block==toReplace){ String registryName=Block.blockRegistry.getNameForObject(block); int id=Block.getIdFromBlock(block); ItemBlock item=(ItemBlock) Item.getItemFromBlock(block); System.out.println("Replacing block - "+id+"/"+registryName); Block newBlock=blockClass.newInstance(); FMLControlledNamespacedRegistry<Block> registry= GameData.blockRegistry; registry.putObject(registryName,newBlock); Field map=RegistryNamespaced.class.getDeclaredFields()[0]; map.setAccessible(true); ((ObjectIntIdentityMap)map.get(registry)).func_148746_a(newBlock,id); map=FMLControlledNamespacedRegistry.class.getDeclaredField("namedIds"); map.setAccessible(true); ((BiMap)map.get(registry)).put(registryName,id); field.setAccessible(true); int modifiers=modifiersField.getInt(field); modifiers&=~Modifier.FINAL; modifiersField.setInt(field,modifiers); field.set(null,newBlock); Field itemblock=ItemBlock.class.getDeclaredFields()[0]; itemblock.setAccessible(true); modifiers=modifiersField.getInt(itemblock); modifiers&=~Modifier.FINAL; modifiersField.setInt(itemblock,modifiers); itemblock.set(item,newBlock); System.out.println("Check field: "+field.get(null).getClass()); System.out.println("Check registry: "+Block.blockRegistry.getObjectById(id).getClass()); System.out.println("Check item: "+((ItemBlock)Item.getItemFromBlock(newBlock)).field_150939_a.getClass()); } } } }catch(Exception e){ e.printStackTrace(); return false; } return true; } } P.S.:sorry for my bad english
  10. Can someone tell me how to register biomes in 1.7.2? Please!
  11. Oh, forgot. I also tried to substitute vanilla biome colors, but it doesn't want to work too.
  12. Please, help me, somebody
  13. I used decimal value of hex color #c1de00. Registered biome this way public static final BiomeGenBase Autumn = (new BiomeGen(18));
  14. I wanna port my 1.6.4 mod for 1.7.2 (1029), but setColor() doesn't work for biomes. Is that bug or this is my fault? //biome code public class BiomeGen extends BiomeGenBase { public BiomeGen(int par1) { super(par1); this.spawnableMonsterList.clear(); this.spawnableCreatureList.clear(); this.setColor(12705280); this.theBiomeDecorator.treesPerChunk = 3; this.waterColorMultiplier = 0x2167FF; this.setBiomeName("Autumn forest"); } } Interesting that waterColorMultiplier works clear.
×
×
  • Create New...

Important Information

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