SimCraft for Minecraft

!!

Welcome Guest

Dear visitor, welcome to MC Port Central. If this is your first visit here,  you should consider registering to show your support.   By registering you will give us an idea and clear indication of how in demand our work really are and will motivate our porting team to continue there work. We port vanilla mods to Bukkit and you will also find a lot of other related Minecraft material on our Forum.

Author Topic: [Need Help] Errors while Porting my mod  (Read 403 times)

Karzire

  • Newbie
  • *
  • Posts: 3
[Need Help] Errors while Porting my mod
« on: July 17, 2012, 05:43:13 AM »
I need help figuring out why I'm getting so may errors when I try to compile my mod. Here is the Huge Error log (Thank god for the Echo.>>Log.txt 2>&1 command in my compile.bat lol)
Spoiler
BlockWastelandPortal.java:6: error: cannot find symbol
public class BlockWastelandPortal extends BlockPortalBase
                                          ^
  symbol: class BlockPortalBase
BlockWastelandPortal.java:13: error: cannot find symbol
    public WorldProviderBase getDimension()
           ^
  symbol:   class WorldProviderBase
  location: class BlockWastelandPortal
WorldProviderWasteland.java:3: error: cannot find symbol
public class WorldProviderWasteland extends WorldProviderBase
                                            ^
  symbol: class WorldProviderBase
BiomeBase.java:238: error: cannot find symbol
        return var1 == EnumCreatureType.monster ? this.J : (var1 == EnumCreatureType.creature ? this.K : (var1 == EnumCreatureType.waterCreature ? this.L : null));
                                       ^
  symbol:   variable monster
  location: class EnumCreatureType
BiomeBase.java:238: error: cannot find symbol
        return var1 == EnumCreatureType.monster ? this.J : (var1 == EnumCreatureType.creature ? this.K : (var1 == EnumCreatureType.waterCreature ? this.L : null));
                                                                                    ^
  symbol:   variable creature
  location: class EnumCreatureType
BiomeBase.java:238: error: cannot find symbol
        return var1 == EnumCreatureType.monster ? this.J : (var1 == EnumCreatureType.creature ? this.K : (var1 == EnumCreatureType.waterCreature ? this.L : null));
                                                                                                                                  ^
  symbol:   variable waterCreature
  location: class EnumCreatureType
mod_Wasteland.java:8: error: method a in class BlockWastelandPortal cannot be applied to given types;
    public static final BlockWastelandPortal WastelandPortal = (BlockWastelandPortal)(new BlockWastelandPortal(253)).a(Block.e).c(0.0F).b(1.0F).a("Wasteland Portal");
                                                                                                                    ^
  required: no arguments
  found: StepSound
  reason: actual and formal argument lists differ in length
BlockWastelandPortal.java:40: error: cannot find symbol
        if (var1.getTypeId(var2 - 1, var3, var4) != this.id && var1.getTypeId(var2 + 1, var3, var4) != this.id)
                                                        ^
  symbol: variable id
BlockWastelandPortal.java:40: error: cannot find symbol
        if (var1.getTypeId(var2 - 1, var3, var4) != this.id && var1.getTypeId(var2 + 1, var3, var4) != this.id)
                                                                                                           ^
  symbol: variable id
BlockWastelandPortal.java:44: error: method a in class BlockWastelandPortal cannot be applied to given types;
            this.a(0.5F - var5, 0.0F, 0.5F - var6, 0.5F + var5, 1.0F, 0.5F + var6);
                ^
  required: no arguments
  found: float,float,float,float,float,float
  reason: actual and formal argument lists differ in length
BlockWastelandPortal.java:50: error: method a in class BlockWastelandPortal cannot be applied to given types;
            this.a(0.5F - var5, 0.0F, 0.5F - var6, 0.5F + var5, 1.0F, 0.5F + var6);
                ^
  required: no arguments
  found: float,float,float,float,float,float
  reason: actual and formal argument lists differ in length
BlockWastelandPortal.java:141: error: cannot find symbol
                    var1.setTypeId(var2 + var5 * var7, var3 + var8, var4 + var6 * var7, mod_Wasteland.WastelandPortal.id);
                                                                                                                     ^
  symbol:   variable id
  location: variable WastelandPortal of type BlockWastelandPortal
BlockWastelandPortal.java:159: error: cannot find symbol
        if (var1.getTypeId(var2 - 1, var3, var4) == this.id || var1.getTypeId(var2 + 1, var3, var4) == this.id)
                                                        ^
  symbol: variable id
BlockWastelandPortal.java:159: error: cannot find symbol
        if (var1.getTypeId(var2 - 1, var3, var4) == this.id || var1.getTypeId(var2 + 1, var3, var4) == this.id)
                                                                                                           ^
  symbol: variable id
BlockWastelandPortal.java:167: error: cannot find symbol
        for (var8 = var3; var1.getTypeId(var2, var8 - 1, var4) == this.id; --var8)
                                                                      ^
  symbol: variable id
BlockWastelandPortal.java:180: error: cannot find symbol
            for (var9 = 1; var9 < 4 && var1.getTypeId(var2, var8 + var9, var4) == this.id; ++var9)
                                                                                      ^
  symbol: variable id
BlockWastelandPortal.java:187: error: cannot find symbol
                boolean var10 = var1.getTypeId(var2 - 1, var3, var4) == this.id || var1.getTypeId(var2 + 1, var3, var4) == this.id;
                                                                            ^
  symbol: variable id
BlockWastelandPortal.java:187: error: cannot find symbol
                boolean var10 = var1.getTypeId(var2 - 1, var3, var4) == this.id || var1.getTypeId(var2 + 1, var3, var4) == this.id;
                                                                                                                               ^
  symbol: variable id
BlockWastelandPortal.java:188: error: cannot find symbol
                boolean var11 = var1.getTypeId(var2, var3, var4 - 1) == this.id || var1.getTypeId(var2, var3, var4 + 1) == this.id;
                                                                            ^
  symbol: variable id
BlockWastelandPortal.java:188: error: cannot find symbol
                boolean var11 = var1.getTypeId(var2, var3, var4 - 1) == this.id || var1.getTypeId(var2, var3, var4 + 1) == this.id;
                                                                                                                               ^
  symbol: variable id
BlockWastelandPortal.java:194: error: cannot find symbol
                else if ((var1.getTypeId(var2 + var6, var3, var4 + var7) != mod_GlowingCobblestone.GlowingCobblestoneB.id || var1.getTypeId(var2 - var6, var3, var4 - var7) != this.id) && (var1.getTypeId(var2 - var6, var3, var4 - var7) != mod_GlowingCobblestone.GlowingCobblestoneB.id || var1.getTypeId(var2 + var6, var3, var4 + var7) != this.id))
                                                                                                                                                                                   ^
  symbol: variable id
BlockWastelandPortal.java:194: error: cannot find symbol
                else if ((var1.getTypeId(var2 + var6, var3, var4 + var7) != mod_GlowingCobblestone.GlowingCobblestoneB.id || var1.getTypeId(var2 - var6, var3, var4 - var7) != this.id) && (var1.getTypeId(var2 - var6, var3, var4 - var7) != mod_GlowingCobblestone.GlowingCobblestoneB.id || var1.getTypeId(var2 + var6, var3, var4 + var7) != this.id))
                                                                                                                                                                                                                                                                                                                                                     ^
  symbol: variable id
BlockWastelandPortal.java:208: error: cannot find symbol
        if (var1.getTypeId(var2, var3, var4) == this.id)
                                                    ^
  symbol: variable id
BlockWastelandPortal.java:214: error: cannot find symbol
            boolean var6 = var1.getTypeId(var2 - 1, var3, var4) == this.id && var1.getTypeId(var2 - 2, var3, var4) != this.id;
                                                                       ^
  symbol: variable id
BlockWastelandPortal.java:214: error: cannot find symbol
            boolean var6 = var1.getTypeId(var2 - 1, var3, var4) == this.id && var1.getTypeId(var2 - 2, var3, var4) != this.id;
                                                                                                                          ^
  symbol: variable id
BlockWastelandPortal.java:215: error: cannot find symbol
            boolean var7 = var1.getTypeId(var2 + 1, var3, var4) == this.id && var1.getTypeId(var2 + 2, var3, var4) != this.id;
                                                                       ^
  symbol: variable id
BlockWastelandPortal.java:215: error: cannot find symbol
            boolean var7 = var1.getTypeId(var2 + 1, var3, var4) == this.id && var1.getTypeId(var2 + 2, var3, var4) != this.id;
                                                                                                                          ^
  symbol: variable id
BlockWastelandPortal.java:216: error: cannot find symbol
            boolean var8 = var1.getTypeId(var2, var3, var4 - 1) == this.id && var1.getTypeId(var2, var3, var4 - 2) != this.id;
                                                                       ^
  symbol: variable id
BlockWastelandPortal.java:216: error: cannot find symbol
            boolean var8 = var1.getTypeId(var2, var3, var4 - 1) == this.id && var1.getTypeId(var2, var3, var4 - 2) != this.id;
                                                                                                                          ^
  symbol: variable id
BlockWastelandPortal.java:217: error: cannot find symbol
            boolean var9 = var1.getTypeId(var2, var3, var4 + 1) == this.id && var1.getTypeId(var2, var3, var4 + 2) != this.id;
                                                                       ^
  symbol: variable id
BlockWastelandPortal.java:217: error: cannot find symbol
            boolean var9 = var1.getTypeId(var2, var3, var4 + 1) == this.id && var1.getTypeId(var2, var3, var4 + 2) != this.id;
                                                                                                                          ^
  symbol: variable id
BlockWastelandPortal.java:231: error: cannot find symbol
        return this.textureId;
                   ^
  symbol: variable textureId
ChunkProviderWasteland.java:48: error: no suitable method found for a(int,int)
        BiomeBase var6 = this.worldObj.getWorldChunkManager().a(var4 + 16, var5 + 16);
                                                             ^
    method WorldChunkManager.a(int,int,int,List,Random) is not applicable
      (actual and formal argument lists differ in length)
    method WorldChunkManager.a(int,int,int,List) is not applicable
      (actual and formal argument lists differ in length)
    method WorldChunkManager.a(BiomeBase[],int,int,int,int,boolean) is not applicable
      (actual and formal argument lists differ in length)
    method WorldChunkManager.a() is not applicable
      (actual and formal argument lists differ in length)
mod_Wasteland.java:31: error: cannot find symbol
        DimensionAPI.registerDimension(new WorldProviderWasteland());
        ^
  symbol:   variable DimensionAPI
  location: class mod_Wasteland
mod_Wasteland.java:38: error: no suitable method found for registerBlock(BlockWastelandPortal)
        ModLoader.registerBlock(WastelandPortal);
                 ^
    method ModLoader.registerBlock(Block,Class<? extends ItemBlock>) is not applicable
      (actual and formal argument lists differ in length)
    method ModLoader.registerBlock(Block) is not applicable
      (actual argument BlockWastelandPortal cannot be converted to Block by method invocation conversion)
mod_Wasteland.java:56: error: no suitable method found for a(int,int)
        BiomeBase var5 = var1.getWorldChunkManager().a(var3, var4);
                                                    ^
    method WorldChunkManager.a(int,int,int,List,Random) is not applicable
      (actual and formal argument lists differ in length)
    method WorldChunkManager.a(int,int,int,List) is not applicable
      (actual and formal argument lists differ in length)
    method WorldChunkManager.a(BiomeBase[],int,int,int,int,boolean) is not applicable
      (actual and formal argument lists differ in length)
    method WorldChunkManager.a() is not applicable
      (actual and formal argument lists differ in length)
mod_Wasteland.java:70: error: constructor WorldGenNether in class WorldGenNether cannot be applied to given types;
                (new WorldGenNether(Block.SNOW_BLOCK.id, 5)).a(var1, var2, var8, var9, var10);
                 ^
  required: no arguments
  found: int,int
  reason: actual and formal argument lists differ in length
WastelandPortal.java:121: error: cannot find symbol
                    var1.setTypeId(var2 + var5 * var7, var3 + var8, var4 + var6 * var7, mod_Wasteland.WastelandPortal.id);
                                                                                                                     ^
  symbol:   variable id
  location: variable WastelandPortal of type BlockWastelandPortal
WastelandTeleporter.java:45: error: cannot find symbol
                    if (var1.getTypeId(var11, var17, var14) == mod_Wasteland.WastelandPortal.id)
                                                                                            ^
  symbol:   variable id
  location: variable WastelandPortal of type BlockWastelandPortal
WastelandTeleporter.java:47: error: cannot find symbol
                        while (var1.getTypeId(var11, var17 - 1, var14) == mod_Wasteland.WastelandPortal.id)
                                                                                                       ^
  symbol:   variable id
  location: variable WastelandPortal of type BlockWastelandPortal
WastelandTeleporter.java:73: error: cannot find symbol
            if (var1.getTypeId(var6 - 1, var7, var8) == mod_Wasteland.WastelandPortal.id)
                                                                                     ^
  symbol:   variable id
  location: variable WastelandPortal of type BlockWastelandPortal
WastelandTeleporter.java:78: error: cannot find symbol
            if (var1.getTypeId(var6 + 1, var7, var8) == mod_Wasteland.WastelandPortal.id)
                                                                                     ^
  symbol:   variable id
  location: variable WastelandPortal of type BlockWastelandPortal
WastelandTeleporter.java:83: error: cannot find symbol
            if (var1.getTypeId(var6, var7, var8 - 1) == mod_Wasteland.WastelandPortal.id)
                                                                                     ^
  symbol:   variable id
  location: variable WastelandPortal of type BlockWastelandPortal
WastelandTeleporter.java:88: error: cannot find symbol
            if (var1.getTypeId(var6, var7, var8 + 1) == mod_Wasteland.WastelandPortal.id)
                                                                                     ^
  symbol:   variable id
  location: variable WastelandPortal of type BlockWastelandPortal
WastelandTeleporter.java:312: error: cannot find symbol
                    var1.setTypeId(var23, var24, var25, var33 ? mod_GlowingCobblestone.GlowingCobblestoneB.id : mod_Wasteland.WastelandPortal.id);
                                                                                                                                             ^
  symbol:   variable id
  location: variable WastelandPortal of type BlockWastelandPortal
WorldGenHugeIceTrees.java:94: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                            this.setTypeAndData(var1, var14, var16 - 3 + var13 / 2, var15, mod_Wasteland.RottenWood.id, this.woodMetadata);
                                ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:104: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                            this.setTypeAndData(var1, var3, var4 + var16, var5, mod_Wasteland.RottenWood.id, this.woodMetadata);
                                ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:110: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3 - 1, var4 + var16, var5, Block.VINE.id, 8);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:115: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3, var4 + var16, var5 - 1, Block.VINE.id, 1);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:126: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                this.setTypeAndData(var1, var3 + 1, var4 + var16, var5, mod_Wasteland.RottenWood.id, this.woodMetadata);
                                    ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:132: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                        this.setTypeAndData(var1, var3 + 2, var4 + var16, var5, Block.VINE.id, 2);
                                            ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:137: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                        this.setTypeAndData(var1, var3 + 1, var4 + var16, var5 - 1, Block.VINE.id, 1);
                                            ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:146: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                this.setTypeAndData(var1, var3 + 1, var4 + var16, var5 + 1, mod_Wasteland.RottenWood.id, this.woodMetadata);
                                    ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:152: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                        this.setTypeAndData(var1, var3 + 2, var4 + var16, var5 + 1, Block.VINE.id, 2);
                                            ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:157: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                        this.setTypeAndData(var1, var3 + 1, var4 + var16, var5 + 2, Block.VINE.id, 4);
                                            ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:166: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                this.setTypeAndData(var1, var3, var4 + var16, var5 + 1, mod_Wasteland.RottenWood.id, this.woodMetadata);
                                    ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:172: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                        this.setTypeAndData(var1, var3 - 1, var4 + var16, var5 + 1, Block.VINE.id, 8);
                                            ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:177: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                        this.setTypeAndData(var1, var3, var4 + var16, var5 + 2, Block.VINE.id, 4);
                                            ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:217: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                        this.setTypeAndData(var1, var11, var8, var13, Block.LEAVES.id, this.leavesMetadata);
                            ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree.java:83: error: method setType in class WorldGenerator cannot be applied to given types;
                    this.setType(var1, var3, var4 - 1, var5, Block.SNOW.id);
                        ^
  required: BlockChangeDelegate,int,int,int,int
  found: World,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree.java:105: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var14, var11, var16, Block.LEAVES.id, this.metaLeaves);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree.java:117: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                            this.setTypeAndData(var1, var3, var4 + var11, var5, Block.LOG.id, this.metaWood);
                                ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree.java:123: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3 - 1, var4 + var11, var5, Block.VINE.id, 8);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree.java:128: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3 + 1, var4 + var11, var5, Block.VINE.id, 2);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree.java:133: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3, var4 + var11, var5 - 1, Block.VINE.id, 1);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree.java:138: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3, var4 + var11, var5 + 1, Block.VINE.id, 4);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree.java:198: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
        this.setTypeAndData(var1, var2, var3, var4, Block.VINE.id, var5);
            ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree.java:210: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
            this.setTypeAndData(var1, var2, var3, var4, Block.VINE.id, var5);
                ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree1.java:83: error: method setType in class WorldGenerator cannot be applied to given types;
                    this.setType(var1, var3, var4 - 1, var5, Block.SNOW_BLOCK.id);
                        ^
  required: BlockChangeDelegate,int,int,int,int
  found: World,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree1.java:105: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var14, var11, var16, Block.LEAVES.id, this.metaLeaves);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree1.java:117: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                            this.setTypeAndData(var1, var3, var4 + var11, var5, Block.LOG.id, this.metaWood);
                                ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree1.java:123: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3 - 1, var4 + var11, var5, Block.VINE.id, 8);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree1.java:128: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3 + 1, var4 + var11, var5, Block.VINE.id, 2);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree1.java:133: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3, var4 + var11, var5 - 1, Block.VINE.id, 1);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree1.java:138: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                                    this.setTypeAndData(var1, var3, var4 + var11, var5 + 1, Block.VINE.id, 4);
                                        ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree1.java:198: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
        this.setTypeAndData(var1, var2, var3, var4, Block.VINE.id, var5);
            ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenIceTree1.java:210: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
            this.setTypeAndData(var1, var2, var3, var4, Block.VINE.id, var5);
                ^
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldProviderWasteland.java:60: error: cannot find symbol
        this.c = new WorldChunkManagerHell(BiomeBase.Wasteland, 1.0F, 0.0F);
            ^
  symbol: variable c
WorldProviderWasteland.java:68: error: cannot find symbol
        return new ChunkProviderWasteland1(this.a, this.a.getSeed(), true);
                                               ^
  symbol: variable a
WorldProviderWasteland.java:68: error: cannot find symbol
        return new ChunkProviderWasteland1(this.a, this.a.getSeed(), true);
                                                       ^
  symbol: variable a
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
80 errors

If you need to see the source just tell me and I'll be glad to post it.
Thanks
« Last Edit: July 17, 2012, 05:46:40 AM by Karzire »

mushroomhostage

  • Sr. Member
  • ****
  • Posts: 483
    • Experimental Hardcore Post-Apocalyptic Server
Re: [Need Help] Errors while Porting my mod
« Reply #1 on: July 17, 2012, 06:25:34 AM »
Wow that's a lot of errors  :P

Getting some errors while recompiling is normal. I recognize some. I'd say first focus on fixing the "cannot find symbol" errors:

Code: [Select]
BlockWastelandPortal.java:6: error: cannot find symbol
public class BlockWastelandPortal extends BlockPortalBase

which suggest part of your mod is missing..

But these have to be manually fixed and are normal:

Code: [Select]
BiomeBase.java:238: error: cannot find symbol
        return var1 == EnumCreatureType.monster ? this.J : (var1 == EnumCreatureType.creature ? this.K : (var1 == EnumCreatureType.waterCreature ? this.L : null));
                                       ^
  symbol:   variable monster

The decompilation-based porting process doesn't convert the enums so you have to translate them yourself by comparing the MCP and CraftBukkit source. For EnumCreatureType check https://github.com/MinecraftPortCentral/CraftBukkit/blob/mcportcentral/src/main/java/net/minecraft/server/EnumCreatureType.java . EnumCreatureType.monster should be changed to EnumCreatureType.MONSTER, etc.

Code: [Select]
  required: BlockChangeDelegate,int,int,int,int,int
  found: World,int,int,int,int,int
  reason: actual argument World cannot be converted to BlockChangeDelegate by method invocation conversion
WorldGenHugeIceTrees.java:104: error: method setTypeAndData in class WorldGenerator cannot be applied to given types;
                            this.setTypeAndData(var1, var3, var4 + var16, var5, mod_Wasteland.RottenWood.id, this.woodMetadata);

Simply cast the first argument of this.setTypeAndData to (org.bukkit.BlockChangeDelegate). For an example of the changes needed see: https://github.com/mushroomhostage/Bunyan/commit/056061c9655a6f8a5a76496ea4e38a1ed90db5f8

Code: [Select]
  required: no arguments
  found: float,float,float,float,float,float
  reason: actual and formal argument lists differ in length
BlockWastelandPortal.java:50: error: method a in class BlockWastelandPortal cannot be applied to given types;
            this.a(0.5F - var5, 0.0F, 0.5F - var6, 0.5F + var5, 1.0F, 0.5F + var6);
Check the arguments in CraftBukkit MCPC source. Sometimes the CraftBukkit methods have different arguments than the vanilla server. I can't tell what class has changed from this error message, but in the past I've had to update the call for method signature change in EntityFallingBlock: https://github.com/MinecraftPortCentral/CraftBukkit/blob/mcportcentral/src/main/java/net/minecraft/server/EntityFallingBlock.java#L13     
Code: [Select]
// CraftBukkit - changed method signature
    public EntityFallingBlock(World world, double d0, double d1, double d2, int i, int data) {

CraftBukkit added an extra "int data" parameter to set the metadata. These method signature changes are rare, but the port has to be updated to adopt them.

Code: [Select]
symbol: variable id
BlockWastelandPortal.java:231: error: cannot find symbol
        return this.textureId;

symbol: variable a
WorldProviderWasteland.java:68: error: cannot find symbol
        return new ChunkProviderWasteland1(this.a, this.a.getSeed(), true);
                                                       ^
 symbol: variable textureId
ChunkProviderWasteland.java:48: error: no suitable method found for a(int,int)
        BiomeBase var6 = this.worldObj.getWorldChunkManager().a(var4 + 16, var5 + 16);                 

These look like mapping errors, you'll have to check your source and MCPC source to see what they should be.. one I recognize off hand is the getWorldChunkManager().a call. WorldChunkManager() doesn't have any CraftBukkit changes so it is not in the CraftBukkit repository, but you can find it in mc-dev here: https://github.com/MinecraftPortCentral/mc-dev/blob/master/net/minecraft/server/WorldChunkManager.java and see this most likely should be getWorldChunkManager().getBiome instead.

Hope this helps... as you can see, porting can vary in difficulty :). Looks like this mod will be somewhat of a challenge to port.. but it should be possible.

Karzire

  • Newbie
  • *
  • Posts: 3
Re: [Need Help] Errors while Porting my mod
« Reply #2 on: July 18, 2012, 05:56:54 AM »
Alright thanks man. I managed to go from 80 errors to 7 (Thats actually pretty good for me lol.) But this is what Im getting now
Spoiler
ServerConfigurationManager.java:96: error: cannot find symbol
        Iterator iterator = DimensionAPI.getAllWorlds().iterator();
                            ^
  symbol:   variable DimensionAPI
  location: class ServerConfigurationManager
ServerConfigurationManager.java:100: error: cannot find symbol
        for (; iterator.hasNext(); ((WorldServer)world).playerManager.removePlayer(entityplayer))
                                                       ^
  symbol:   variable playerManager
  location: class WorldServer
ServerConfigurationManager.java:122: error: package DimensionAPI does not exist
        if (DimensionAPI.worldMap.containsKey(Integer.valueOf(par1)))
                        ^
ServerConfigurationManager.java:124: error: package DimensionAPI does not exist
            worldserver = (WorldServer)DimensionAPI.worldMap.get(Integer.valueOf(par1));
                                                   ^
ServerConfigurationManager.java:131: error: cannot find symbol
        return worldserver != null ? worldserver.playerManager : null;
                                                ^
  symbol:   variable playerManager
  location: variable worldserver of type WorldServer
ServerConfigurationManager.java:357: error: cannot find symbol
        Iterator iterator = DimensionAPI.getAllWorlds().iterator();
                            ^
  symbol:   variable DimensionAPI
  location: class ServerConfigurationManager
ServerConfigurationManager.java:361: error: cannot find symbol
        for (; iterator.hasNext(); ((WorldServer)world).playerManager.flush())
                                                       ^
  symbol:   variable playerManager
  location: class WorldServer
Note: ServerConfigurationManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors

And here's the file that's having the errors
ServerConfigurationManager
Spoiler
package net.minecraft.server;

import forge.DimensionManager;
import java.io.*;
import java.util.*;
import java.util.logging.Logger;
import net.minecraft.server.MinecraftServer;

public class ServerConfigurationManager
{
    /** Reference to the logger. */
    public static Logger a = Logger.getLogger("Minecraft");

    /** A list of player entities that exist on this server. */
    public List players;

    /** Reference to the MinecraftServer object. */
    private MinecraftServer server;

    /** the maximum amount of players that can be connected */
    private int maxPlayers;

    /** the set of all banned players names */
    private Set banByName;

    /** A set containing the banned IPs. */
    private Set banByIP;

    /** A set containing the OPs. */
    private Set operators;

    /** the set of all white listed IP addresses */
    private Set whitelist;

    /** The file that contains the banned players. */
    private File j;

    /** the file which contains the list of banned IPs */
    private File k;

    /** the file which contains the list of ops */
    private File l;

    /** File containing list of whitelisted players */
    private File m;

    /** Reference to the PlayerNBTManager object. */
    private PlayerFileData playerFileData;

    /**
     * Server setting to only allow OP's and whitelisted players to join the server
     */
    private boolean hasWhitelist;
    private int field_35482_p;

    public ServerConfigurationManager(MinecraftServer par1MinecraftServer)
    {
        players = new ArrayList();
        banByName = new HashSet();
        banByIP = new HashSet();
        operators = new HashSet();
        whitelist = new HashSet();
        field_35482_p = 0;
        server = par1MinecraftServer;
        j = par1MinecraftServer.a("banned-players.txt");
        k = par1MinecraftServer.a("banned-ips.txt");
        l = par1MinecraftServer.a("ops.txt");
        m = par1MinecraftServer.a("white-list.txt");
        int i = par1MinecraftServer.propertyManager.getInt("view-distance", 10);
        maxPlayers = par1MinecraftServer.propertyManager.getInt("max-players", 20);
        hasWhitelist = par1MinecraftServer.propertyManager.getBoolean("white-list", false);
        l();
        n();
        p();
        r();
        m();
        o();
        q();
        s();
    }

    /**
     * Sets the NBT manager to the one for the worldserver given
     */
    public void setPlayerFileData(WorldServer par1ArrayOfWorldServer[])
    {
        playerFileData = par1ArrayOfWorldServer[0].getDataManager().getPlayerFileData();
    }

    /**
     * called when a player is teleported to a new dimension in order to clean up old dim refs, send them new dim
     * chunks, and make sure their new location chunk is loaded and initialized
     */
    public void a(EntityPlayer entityplayer)
    {
        Iterator iterator = DimensionAPI.getAllWorlds().iterator();
        Object obj = null;
        World world;

        for (; iterator.hasNext(); ((WorldServer)world).playerManager.removePlayer(entityplayer))
        {
            world = (World)iterator.next();
        }

        getPlayerManager(entityplayer.dimension).addPlayer(entityplayer);
        WorldServer worldserver = server.getWorldServer(entityplayer.dimension);
        worldserver.chunkProviderServer.getChunkAt((int)entityplayer.locX >> 4, (int)entityplayer.locZ >> 4);
    }

    public int a()
    {
        return getPlayerManager(0).getFurthestViewableBlock();
    }

    /**
     * returns the player manager object for the specified dimension
     */
    private PlayerManager getPlayerManager(int par1)
    {
        WorldServer worldserver = null;

        if (DimensionAPI.worldMap.containsKey(Integer.valueOf(par1)))
        {
            worldserver = (WorldServer)DimensionAPI.worldMap.get(Integer.valueOf(par1));
        }
        else
        {
            worldserver = (WorldServer)DimensionManager.getWorld(par1);
        }

        return worldserver != null ? worldserver.playerManager : null;
    }

    /**
     * called during player login. reads the player information from disk.
     */
    public void b(EntityPlayer entityplayer)
    {
        playerFileData.load(entityplayer);
    }

    /**
     * Called when a player successfully logs in. Reads player data from disk and inserts the player into the world.
     */
    public void c(EntityPlayer entityplayer)
    {
        sendAll(new Packet201PlayerInfo(entityplayer.name, true, 1000));
        players.add(entityplayer);
        WorldServer worldserver = server.getWorldServer(entityplayer.dimension);
        worldserver.chunkProviderServer.getChunkAt((int)entityplayer.locX >> 4, (int)entityplayer.locZ >> 4);

        for (; worldserver.getCubes(entityplayer, entityplayer.boundingBox).size() != 0; entityplayer.setPosition(entityplayer.locX, entityplayer.locY + 1.0D, entityplayer.locZ)) { }

        worldserver.addEntity(entityplayer);
        getPlayerManager(entityplayer.dimension).addPlayer(entityplayer);
        func_52018_u();

        for (int i = 0; i < players.size(); i++)
        {
            EntityPlayer entityplayer1 = (EntityPlayer)players.get(i);
            entityplayer.netServerHandler.sendPacket(new Packet201PlayerInfo(entityplayer1.name, true, entityplayer1.ping));
        }
    }

    /**
     * using player's dimension, update their movement when in a vehicle (e.g. cart, boat)
     */
    public void d(EntityPlayer entityplayer)
    {
        getPlayerManager(entityplayer.dimension).movePlayer(entityplayer);
    }

    /**
     * Called when a player disconnects from the game. Writes player data to disk and removes them from the world.
     */
    public void disconnect(EntityPlayer entityplayer)
    {
        playerFileData.save(entityplayer);
        server.getWorldServer(entityplayer.dimension).kill(entityplayer);
        players.remove(entityplayer);
        getPlayerManager(entityplayer.dimension).removePlayer(entityplayer);
        sendAll(new Packet201PlayerInfo(entityplayer.name, false, 9999));
    }

    /**
     * Called when a player tries to login. Checks whether they are banned/server is full etc.
     */
    public EntityPlayer attemptLogin(NetLoginHandler netloginhandler, String s)
    {
        if (banByName.contains(s.trim().toLowerCase()))
        {
            netloginhandler.disconnect("You are banned from this server!");
            return null;
        }

        if (!isWhitelisted(s))
        {
            netloginhandler.disconnect("You are not white-listed on this server!");
            return null;
        }

        String s1 = netloginhandler.networkManager.getSocketAddress().toString();
        s1 = s1.substring(s1.indexOf("/") + 1);
        s1 = s1.substring(0, s1.indexOf(":"));

        if (banByIP.contains(s1))
        {
            netloginhandler.disconnect("Your IP address is banned from this server!");
            return null;
        }

        if (players.size() >= maxPlayers)
        {
            netloginhandler.disconnect("The server is full!");
            return null;
        }

        for (int i = 0; i < players.size(); i++)
        {
            EntityPlayer entityplayer = (EntityPlayer)players.get(i);

            if (entityplayer.name.equalsIgnoreCase(s))
            {
                entityplayer.netServerHandler.disconnect("You logged in from another location");
            }
        }

        return new EntityPlayer(server, server.getWorldServer(0), s, new ItemInWorldManager(server.getWorldServer(0)));
    }

    /**
     * Called on respawn
     */
    public EntityPlayer moveToWorld(EntityPlayer entityplayer, int i, boolean flag)
    {
        server.getTracker(entityplayer.dimension).untrackPlayer(entityplayer);
        server.getTracker(entityplayer.dimension).untrackEntity(entityplayer);
        getPlayerManager(entityplayer.dimension).removePlayer(entityplayer);
        players.remove(entityplayer);
        server.getWorldServer(entityplayer.dimension).removeEntity(entityplayer);
        ChunkCoordinates chunkcoordinates = entityplayer.getBed();
        entityplayer.dimension = i;
        EntityPlayer entityplayer1 = new EntityPlayer(server, server.getWorldServer(entityplayer.dimension), entityplayer.name, new ItemInWorldManager(server.getWorldServer(entityplayer.dimension)));

        if (flag)
        {
            entityplayer1.copyTo(entityplayer);
        }

        entityplayer1.id = entityplayer.id;
        entityplayer1.netServerHandler = entityplayer.netServerHandler;
        WorldServer worldserver = server.getWorldServer(entityplayer.dimension);
        entityplayer1.itemInWorldManager.setGameMode(entityplayer.itemInWorldManager.getGameMode());
        entityplayer1.itemInWorldManager.b(worldserver.getWorldData().getGameType());

        if (chunkcoordinates != null)
        {
            ChunkCoordinates chunkcoordinates1 = EntityHuman.getBed(server.getWorldServer(entityplayer.dimension), chunkcoordinates);

            if (chunkcoordinates1 != null)
            {
                entityplayer1.setPositionRotation((float)chunkcoordinates1.x + 0.5F, (float)chunkcoordinates1.y + 0.1F, (float)chunkcoordinates1.z + 0.5F, 0.0F, 0.0F);
                entityplayer1.setRespawnPosition(chunkcoordinates);
            }
            else
            {
                entityplayer1.netServerHandler.sendPacket(new Packet70Bed(0, 0));
            }
        }

        worldserver.chunkProviderServer.getChunkAt((int)entityplayer1.locX >> 4, (int)entityplayer1.locZ >> 4);

        for (; worldserver.getCubes(entityplayer1, entityplayer1.boundingBox).size() != 0; entityplayer1.setPosition(entityplayer1.locX, entityplayer1.locY + 1.0D, entityplayer1.locZ)) { }

        entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(entityplayer1.dimension, (byte)entityplayer1.world.difficulty, entityplayer1.world.getWorldData().getType(), entityplayer1.world.getHeight(), entityplayer1.itemInWorldManager.getGameMode()));
        entityplayer1.netServerHandler.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
        a(entityplayer1, worldserver);
        getPlayerManager(entityplayer1.dimension).addPlayer(entityplayer1);
        worldserver.addEntity(entityplayer1);
        players.add(entityplayer1);
        entityplayer1.k();
        entityplayer1.S();
        return entityplayer1;
    }

    /**
     * moves provided player from overworld to nether or vice versa
     */
    public void changeDimension(EntityPlayer entityplayer, int i)
    {
        sendPlayerToOtherDimension(entityplayer, i, new PortalTravelAgent());
    }

    public void sendPlayerToOtherDimension(EntityPlayer entityplayer, int i, PortalTravelAgent portaltravelagent)
    {
        int j = entityplayer.dimension;
        WorldServer worldserver = server.getWorldServer(entityplayer.dimension);
        entityplayer.dimension = i;
        WorldServer worldserver1 = server.getWorldServer(entityplayer.dimension);
        entityplayer.netServerHandler.sendPacket(new Packet9Respawn(entityplayer.dimension, (byte)entityplayer.world.difficulty, worldserver1.getWorldData().getType(), worldserver1.getHeight(), entityplayer.itemInWorldManager.getGameMode()));
        worldserver.removeEntity(entityplayer);
        entityplayer.dead = false;
        WorldProvider worldprovider = DimensionManager.getProvider(j);
        WorldProvider worldprovider1 = DimensionManager.getProvider(i);
        double d = worldprovider.getMovementFactor() / worldprovider1.getMovementFactor();
        double d1 = entityplayer.locX * d;
        double d2 = entityplayer.locZ * d;

        if (entityplayer.dimension == 1)
        {
            ChunkCoordinates chunkcoordinates = worldserver1.getDimensionSpawn();
            d1 = chunkcoordinates.x;
            entityplayer.locY = chunkcoordinates.y;
            d2 = chunkcoordinates.z;
            entityplayer.setPositionRotation(d1, entityplayer.locY, d2, 90F, 0.0F);

            if (entityplayer.isAlive())
            {
                worldserver.entityJoinedWorld(entityplayer, false);
            }
        }

        if (j != 1 && entityplayer.isAlive())
        {
            worldserver1.addEntity(entityplayer);
            entityplayer.setPositionRotation(d1, entityplayer.locY, d2, entityplayer.yaw, entityplayer.pitch);
            worldserver1.entityJoinedWorld(entityplayer, false);
            worldserver1.chunkProviderServer.forceChunkLoad = true;
            portaltravelagent.a(worldserver1, entityplayer);
            worldserver1.chunkProviderServer.forceChunkLoad = false;
        }

        a(entityplayer);
        entityplayer.netServerHandler.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
        entityplayer.spawnIn(worldserver1);
        entityplayer.itemInWorldManager.a(worldserver1);
        a(entityplayer, worldserver1);
        func_30008_g(entityplayer);
    }

    /**
     * self explanitory
     */
    public void tick()
    {
        if (++field_35482_p > 200)
        {
            field_35482_p = 0;
        }

        if (field_35482_p < players.size())
        {
            EntityPlayer entityplayer = (EntityPlayer)players.get(field_35482_p);
            sendAll(new Packet201PlayerInfo(entityplayer.name, true, entityplayer.ping));
        }

        Iterator iterator = DimensionAPI.getAllWorlds().iterator();
        Object obj = null;
        World world;

        for (; iterator.hasNext(); ((WorldServer)world).playerManager.flush())
        {
            world = (World)iterator.next();
        }
    }

    public void flagDirty(int par1, int par2, int par3, int par4)
    {
        getPlayerManager(par4).flagDirty(par1, par2, par3);
    }

    /**
     * sends a packet to all players
     */
    public void sendAll(Packet par1Packet)
    {
        for (int i = 0; i < players.size(); i++)
        {
            EntityPlayer entityplayer = (EntityPlayer)players.get(i);
            entityplayer.netServerHandler.sendPacket(par1Packet);
        }
    }

    /**
     * Sends a packet to all players in the specified Dimension
     */
    public void a(Packet par1Packet, int par2)
    {
        for (int i = 0; i < players.size(); i++)
        {
            EntityPlayer entityplayer = (EntityPlayer)players.get(i);

            if (entityplayer.dimension == par2)
            {
                entityplayer.netServerHandler.sendPacket(par1Packet);
            }
        }
    }

    /**
     * returns a string containing a comma-seperated list of player names
     */
    public String c()
    {
        String s = "";

        for (int i = 0; i < players.size(); i++)
        {
            if (i > 0)
            {
                s = (new StringBuilder()).append(s).append(", ").toString();
            }

            s = (new StringBuilder()).append(s).append(((EntityPlayer)players.get(i)).name).toString();
        }

        return s;
    }

    /**
     * Returns a list of usernames of all connected players
     */
    public String[] d()
    {
        String as[] = new String[players.size()];

        for (int i = 0; i < players.size(); i++)
        {
            as = ((EntityPlayer)players.get(i)).name;
        }

        return as;
    }

    /**
     * add this player to the banned player list and save the ban list
     */
    public void addUserBan(String par1Str)
    {
        banByName.add(par1Str.toLowerCase());
        m();
    }

    /**
     * remove this player from the banned player list and save the ban list
     */
    public void removeUserBan(String par1Str)
    {
        banByName.remove(par1Str.toLowerCase());
        m();
    }

    /**
     * Reads the banned players file from disk.
     */
    private void l()
    {
        try
        {
            banByName.clear();
            BufferedReader bufferedreader = new BufferedReader(new FileReader(j));

            for (String s = ""; (s = bufferedreader.readLine()) != null;)
            {
                banByName.add(s.trim().toLowerCase());
            }

            bufferedreader.close();
        }
        catch (Exception exception)
        {
            a.warning((new StringBuilder()).append("Failed to load ban list: ").append(exception).toString());
        }
    }

    /**
     * Writes the banned players file to disk.
     */
    private void m()
    {
        try
        {
            PrintWriter printwriter = new PrintWriter(new FileWriter(j, false));
            String s;

            for (Iterator iterator = banByName.iterator(); iterator.hasNext(); printwriter.println(s))
            {
                s = (String)iterator.next();
            }

            printwriter.close();
        }
        catch (Exception exception)
        {
            a.warning((new StringBuilder()).append("Failed to save ban list: ").append(exception).toString());
        }
    }

    /**
     * Returns a list of banned player names
     */
    public Set getBannedPlayers()
    {
        return banByName;
    }

    /**
     * Returns the list of banned IP addresses
     */
    public Set getBannedAddresses()
    {
        return banByIP;
    }

    /**
     * add the ip to the banned ip list and save ban list
     */
    public void addIpBan(String par1Str)
    {
        banByIP.add(par1Str.toLowerCase());
        o();
    }

    /**
     * removes the ip from the banned ip list and save ban list
     */
    public void removeIpBan(String par1Str)
    {
        banByIP.remove(par1Str.toLowerCase());
        o();
    }

    /**
     * loads the list of banned players
     */
    private void n()
    {
        try
        {
            banByIP.clear();
            BufferedReader bufferedreader = new BufferedReader(new FileReader(k));

            for (String s = ""; (s = bufferedreader.readLine()) != null;)
            {
                banByIP.add(s.trim().toLowerCase());
            }

            bufferedreader.close();
        }
        catch (Exception exception)
        {
            a.warning((new StringBuilder()).append("Failed to load ip ban list: ").append(exception).toString());
        }
    }

    /**
     * saves the list of banned players
     */
    private void o()
    {
        try
        {
            PrintWriter printwriter = new PrintWriter(new FileWriter(k, false));
            String s;

            for (Iterator iterator = banByIP.iterator(); iterator.hasNext(); printwriter.println(s))
            {
                s = (String)iterator.next();
            }

            printwriter.close();
        }
        catch (Exception exception)
        {
            a.warning((new StringBuilder()).append("Failed to save ip ban list: ").append(exception).toString());
        }
    }

    /**
     * This adds a username to the ops list, then saves the op list
     */
    public void addOp(String par1Str)
    {
        operators.add(par1Str.toLowerCase());
        q();
    }

    /**
     * This removes a username from the ops list, then saves the op list
     */
    public void removeOp(String par1Str)
    {
        operators.remove(par1Str.toLowerCase());
        q();
    }

    /**
     * loads the ops from the ops file
     */
    private void p()
    {
        try
        {
            operators.clear();
            BufferedReader bufferedreader = new BufferedReader(new FileReader(l));

            for (String s = ""; (s = bufferedreader.readLine()) != null;)
            {
                operators.add(s.trim().toLowerCase());
            }

            bufferedreader.close();
        }
        catch (Exception exception)
        {
            a.warning((new StringBuilder()).append("Failed to load operators list: ").append(exception).toString());
        }
    }

    /**
     * saves the ops to the ops file
     */
    private void q()
    {
        try
        {
            PrintWriter printwriter = new PrintWriter(new FileWriter(l, false));
            String s;

            for (Iterator iterator = operators.iterator(); iterator.hasNext(); printwriter.println(s))
            {
                s = (String)iterator.next();
            }

            printwriter.close();
        }
        catch (Exception exception)
        {
            a.warning((new StringBuilder()).append("Failed to save operators list: ").append(exception).toString());
        }
    }

    /**
     * Loads the white list file
     */
    private void r()
    {
        try
        {
            whitelist.clear();
            BufferedReader bufferedreader = new BufferedReader(new FileReader(m));

            for (String s = ""; (s = bufferedreader.readLine()) != null;)
            {
                whitelist.add(s.trim().toLowerCase());
            }

            bufferedreader.close();
        }
        catch (Exception exception)
        {
            a.warning((new StringBuilder()).append("Failed to load white-list: ").append(exception).toString());
        }
    }

    /**
     * Saves the white list file
     */
    private void s()
    {
        try
        {
            PrintWriter printwriter = new PrintWriter(new FileWriter(m, false));
            String s;

            for (Iterator iterator = whitelist.iterator(); iterator.hasNext(); printwriter.println(s))
            {
                s = (String)iterator.next();
            }

            printwriter.close();
        }
        catch (Exception exception)
        {
            a.warning((new StringBuilder()).append("Failed to save white-list: ").append(exception).toString());
        }
    }

    /**
     * Determine if the player is allowed to connect based on current server settings
     */
    public boolean isWhitelisted(String par1Str)
    {
        par1Str = par1Str.trim().toLowerCase();
        return !hasWhitelist || operators.contains(par1Str) || whitelist.contains(par1Str);
    }

    /**
     * Returns true if the player is an OP, false otherwise.
     */
    public boolean isOp(String par1Str)
    {
        return operators.contains(par1Str.trim().toLowerCase());
    }

    /**
     * gets the player entity for the player with the name specified
     */
    public EntityPlayer i(String s)
    {
        for (int i = 0; i < players.size(); i++)
        {
            EntityPlayer entityplayer = (EntityPlayer)players.get(i);

            if (entityplayer.name.equalsIgnoreCase(s))
            {
                return entityplayer;
            }
        }

        return null;
    }

    /**
     * sends a chat message to the player with the name specified (not necessarily a whisper)
     */
    public void a(String par1Str, String par2Str)
    {
        EntityPlayer entityplayer = i(par1Str);

        if (entityplayer != null)
        {
            entityplayer.netServerHandler.sendPacket(new Packet3Chat(par2Str));
        }
    }

    /**
     * sends a packet to players within d3 of point (x,y,z)
     */
    public void sendPacketNearby(double par1, double par3, double par5, double par7, int par9, Packet par10Packet)
    {
        func_28171_a((EntityHuman)null, par1, par3, par5, par7, par9, par10Packet);
    }

    public void func_28171_a(EntityHuman entityhuman, double d, double d1, double d2, double d3, int i, Packet packet)
    {
        for (int j = 0; j < players.size(); j++)
        {
            EntityPlayer entityplayer = (EntityPlayer)players.get(j);

            if (entityplayer == entityhuman || entityplayer.dimension != i)
            {
                continue;
            }

            double d4 = d - entityplayer.locX;
            double d5 = d1 - entityplayer.locY;
            double d6 = d2 - entityplayer.locZ;

            if (d4 * d4 + d5 * d5 + d6 * d6 < d3 * d3)
            {
                entityplayer.netServerHandler.sendPacket(packet);
            }
        }
    }

    /**
     * sends a chat message to all ops currently connected
     */
    public void j(String par1Str)
    {
        Packet3Chat packet3chat = new Packet3Chat(par1Str);

        for (int i = 0; i < players.size(); i++)
        {
            EntityPlayer entityplayer = (EntityPlayer)players.get(i);

            if (isOp(entityplayer.name))
            {
                entityplayer.netServerHandler.sendPacket(packet3chat);
            }
        }
    }

    /**
     * sends a packet to the player with the name specified
     */
    public boolean a(String par1Str, Packet par2Packet)
    {
        EntityPlayer entityplayer = i(par1Str);

        if (entityplayer != null)
        {
            entityplayer.netServerHandler.sendPacket(par2Packet);
            return true;
        }
        else
        {
            return false;
        }
    }

    /**
     * Saves all of the player's states
     */
    public void savePlayers()
    {
        for (int i = 0; i < players.size(); i++)
        {
            playerFileData.save((EntityHuman)players.get(i));
        }
    }

    /**
     * sends a tilentity to the player name specified
     */
    public void a(int i, int j, int k, TileEntity tileentity)
    {
    }

    /**
     * add the specified player to the white list
     */
    public void addWhitelist(String par1Str)
    {
        whitelist.add(par1Str);
        s();
    }

    /**
     * remove the specified player from the whitelist
     */
    public void removeWhitelist(String par1Str)
    {
        whitelist.remove(par1Str);
        s();
    }

    /**
     * returns the set of whitelisted ip addresses
     */
    public Set getWhitelisted()
    {
        return whitelist;
    }

    /**
     * reloads the whitelist
     */
    public void reloadWhitelist()
    {
        r();
    }

    /**
     * Updates the time and weather for the given player to those of the given world
     */
    public void a(EntityPlayer entityplayer, WorldServer worldserver)
    {
        entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(worldserver.getTime()));

        if (worldserver.x())
        {
            entityplayer.netServerHandler.sendPacket(new Packet70Bed(1, 0));
        }
    }

    public void func_30008_g(EntityPlayer entityplayer)
    {
        entityplayer.updateInventory(entityplayer.defaultContainer);
        entityplayer.D_();
    }

    /**
     * Returns the number of players on the server
     */
    public int getPlayerCount()
    {
        return players.size();
    }

    /**
     * Returns maximum amount of players that can join the server
     */
    public int getMaxPlayers()
    {
        return maxPlayers;
    }

    public String[] func_52019_t()
    {
        return DimensionManager.getWorld(0).getDataManager().getPlayerFileData().getSeenPlayers();
    }

    private void func_52018_u()
    {
        MojangStatisticsGenerator mojangstatisticsgenerator = new MojangStatisticsGenerator("server");
        mojangstatisticsgenerator.a("version", server.getVersion());
        mojangstatisticsgenerator.a("os_name", System.getProperty("os.name"));
        mojangstatisticsgenerator.a("os_version", System.getProperty("os.version"));
        mojangstatisticsgenerator.a("os_architecture", System.getProperty("os.arch"));
        mojangstatisticsgenerator.a("memory_total", Long.valueOf(Runtime.getRuntime().totalMemory()));
        mojangstatisticsgenerator.a("memory_max", Long.valueOf(Runtime.getRuntime().maxMemory()));
        mojangstatisticsgenerator.a("memory_free", Long.valueOf(Runtime.getRuntime().freeMemory()));
        mojangstatisticsgenerator.a("java_version", System.getProperty("java.version"));
        mojangstatisticsgenerator.a("cpu_cores", Integer.valueOf(Runtime.getRuntime().availableProcessors()));
        mojangstatisticsgenerator.a("players_current", Integer.valueOf(getPlayerCount()));
        mojangstatisticsgenerator.a("players_max", Integer.valueOf(getMaxPlayers()));
        mojangstatisticsgenerator.a("players_seen", Integer.valueOf(func_52019_t().length));
        mojangstatisticsgenerator.a("uses_auth", Boolean.valueOf(server.onlineMode));
        mojangstatisticsgenerator.a("server_brand", server.getServerModName());
        mojangstatisticsgenerator.a();
    }
}

Also Thanks again for the quick response and helping me. I Really appreciate it.
« Last Edit: July 18, 2012, 06:04:13 AM by Karzire »

Karzire

  • Newbie
  • *
  • Posts: 3
Re: [Need Help] Errors while Porting my mod
« Reply #3 on: July 19, 2012, 01:10:29 AM »
bump