Jump to content

Lordmau5

Members
  • Posts

    19
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Lordmau5's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. I have made a custom liquid, but: - When I place the flowing one down, the game crashes - When I place the still one down, it doesn't flow, but when i change the block underneath it, the game crashes Error log: http://pastebin.com/g3aFB9KW BlockStill: package TreviModdingCrew.LiquidEnergy.block; import TreviModdingCrew.LiquidEnergy.Main; import net.minecraft.block.BlockStationary; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.Icon; import net.minecraftforge.liquids.ILiquid; public class BlockEnergyLiquid_Still extends BlockStationary implements ILiquid { private String name; public BlockEnergyLiquid_Still(int par1, String name) { super(par1, Material.water); this.setHardness(100F); this.setLightOpacity(3); this.setCreativeTab(Main.liqEne_Tab); this.name = name; this.setUnlocalizedName(name); this.setTickRandomly(true); } @Override public int getRenderType() { return 4; } @Override public int stillLiquidId() { return this.blockID; } @Override public boolean isMetaSensitive() { return false; } @Override public int stillLiquidMeta() { return 0; } @Override public void registerIcons(IconRegister iconReg) { System.out.println(Main.modid + ":" + this.getUnlocalizedName()); this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)), iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)) }; } } BlockFlowing: package TreviModdingCrew.LiquidEnergy.block; import net.minecraft.block.BlockFlowing; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.Icon; import net.minecraftforge.liquids.ILiquid; import TreviModdingCrew.LiquidEnergy.Main; public class BlockEnergyLiquid_Flowing extends BlockFlowing implements ILiquid { private String name; public BlockEnergyLiquid_Flowing(int par1, String name) { super(par1, Material.water); this.setHardness(100F); this.setLightOpacity(3); this.setCreativeTab(Main.liqEne_Tab); this.name = name; this.setUnlocalizedName(name); this.setTickRandomly(true); } @Override public int getRenderType() { return 4; } @Override public int stillLiquidId() { return Main.energyLiquid_Still.blockID; } @Override public boolean isMetaSensitive() { return false; } @Override public int stillLiquidMeta() { return 0; } @Override public void registerIcons(IconRegister iconReg) { System.out.println(Main.modid + ":" + this.getUnlocalizedName()); this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)), iconReg.registerIcon(Main.modid + ":" + this.name) }; } }
  2. As test, I want to write an boolean variable and check it later. What I actually want to do is, that if my inventory contains a special item (e.g. an egg) it should save my inventory and load it again on spawn, independent of how the gamerule keepInventory is.
  3. Still telling me on spawn, that the key doesn't exist... Changed code: @ForgeSubscribe public void onEntitySpawn(EntityJoinWorldEvent event) { if(event.world.isRemote) { return; } if(event.entity instanceof EntityPlayer) { EntityPlayer thePlayer = (EntityPlayer) event.entity; NBTTagCompound wholeTag = thePlayer.getEntityData(); NBTTagCompound nbtTag = wholeTag.getCompoundTag(thePlayer.PERSISTED_NBT_TAG); System.out.println("Getting entity data..."); System.out.println("Has Key DI? : " + nbtTag.hasKey("DeathImprover")); if(nbtTag.hasKey("DeathImprover")) { NBTTagCompound DI = nbtTag.getCompoundTag("DeathImprover"); System.out.println("Has DI Compound"); nbtTag.removeTag("DeathImprover"); } } } @ForgeSubscribe public void onEntityDeath(LivingDeathEvent event) { if(event.entity.worldObj.isRemote) { return; } if(event.entity instanceof EntityPlayer) { EntityPlayer thePlayer = (EntityPlayer) event.entity; System.out.println("Player Died!"); NBTTagList tempTag = new NBTTagList(); thePlayer.inventory.writeToNBT(tempTag); NBTTagCompound entityTempTag = thePlayer.getEntityData(); thePlayer.writeToNBT(entityTempTag); NBTTagCompound persistTag = entityTempTag.getCompoundTag(thePlayer.PERSISTED_NBT_TAG); persistTag.setTag("DeathImprover", tempTag); System.out.println("Saved the Vars!"); event.setCanceled(true); } }
  4. I use some event system, to add some functions to the player death and player spawn. If the player dies, it writes something to it's nbt. Also, after checking it with .getKey, it IS there. At spawn, I check again, if it's there. But it isn't?! Code: @ForgeSubscribe public void onEntitySpawn(EntityJoinWorldEvent event) { if(event.world.isRemote) { return; } if(event.entity instanceof EntityPlayer) { EntityPlayer thePlayer = (EntityPlayer) event.entity; NBTTagCompound nbtTag = new NBTTagCompound(); thePlayer.writeToNBT(nbtTag); System.out.println("Getting entity data..."); System.out.println("Has Key DI? : " + nbtTag.hasKey("DeathImprover")); if(nbtTag.hasKey("DeathImprover")) { NBTTagCompound DI = nbtTag.getCompoundTag("DeathImprover"); System.out.println("Has DI Compound"); nbtTag.removeTag("DeathImprover"); } } } @ForgeSubscribe public void onEntityDeath(LivingDeathEvent event) { if(event.entity.worldObj.isRemote) { return; } if(event.entity instanceof EntityPlayer) { EntityPlayer thePlayer = (EntityPlayer) event.entity; System.out.println("Player Died!"); NBTTagCompound entityTempTag = new NBTTagCompound(); thePlayer.writeToNBT(entityTempTag); entityTempTag.setBoolean("DeathImprover", true); System.out.println("Saved the Vars!"); System.out.println("has DI: " + entityTempTag.hasKey("DeathImprover")); event.setCanceled(true); } }
  5. I'm currently updating my mod EggStaff (http://www.minecraftforum.net/topic/1656783-) and giving it an API so modders, that have entities (like custom zombies, ...) in their mods can add a Annotation to their classes and their mobs are compatible with my mob-capture-mod. Feel free to write below this if you want to help me at testing it! Greetings, Lordmau5. PS: If this is in the wrong forums, please move it.
  6. Well, I place the first Tile Entity like this: https://dl.dropbox.com/u/36429108/bukkit/2013-02-28_20.30.07.png[/img] Looks good, ofcourse the texture is working fine there. But when I place a second Tile Entity, the texture of the first placed is being changed... https://dl.dropbox.com/u/36429108/bukkit/2013-02-28_20.30.09.png[/img] Why is that? BlockMulti: package TreviModdingCrew.PowerPlusPlus.blocks; import java.util.List; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import TreviModdingCrew.PowerPlusPlus.BaseMetaTileEntity; import TreviModdingCrew.PowerPlusPlus.PowerPlusPlus; import TreviModdingCrew.PowerPlusPlus.ProxyClient; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.src.ModLoader; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockMulti extends BlockContainer { public static TEMulti lastPlacedTileEntity; public BlockMulti(int id) { super(id, 0, Material.rock); this.setCreativeTab(PowerPlusPlus.PowerPPTab); setTextureFile(ProxyClient.TextureFile); } @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving player) { lastPlacedTileEntity = (TEMulti)world.getBlockTileEntity(x, y, z); } @Override public TileEntity createNewTileEntity(World world) { return new TEMulti(); } public boolean canHarvestBlock(EntityPlayer player, int meta) { // Item drop occurs in onBlockRemoval System.out.printf("BlockMulti.canHarvestBlock: by %s\n", player); return false; } @Override public int tickRate() { return 1; } /*@Override public void updateTick(World par1World, int x, int y, int z, Random par5Random) { TileEntity theTile = par1World.getBlockTileEntity(x, y, z); if(theTile == null) return; System.out.printf("Metadata: %d\n", theTile.blockMetadata); }*/ @Override public void onBlockHarvested(World world, int x, int y, int z, int data, EntityPlayer player) { if (!((EntityPlayerMP)player).theItemInWorldManager.isCreative()) { TileEntity te = world.getBlockTileEntity(x, y, z); NBTTagCompound tag = new NBTTagCompound("tag"); tag.setInteger("x", 0); tag.setInteger("y", 0); tag.setInteger("z", 0); ItemStack stack = new ItemStack(this, 1, te.getBlockMetadata()); dropBlockAsItem_do(world, x, y, z, stack); } } @Override public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { int tMeta = par1IBlockAccess.getBlockMetadata(par2, par3, par4); TileEntity theTile = par1IBlockAccess.getBlockTileEntity(par2, par3, par4); if (theTile == null) return 0; if (theTile instanceof TEMulti) { //System.out.printf("Metadata: %d\n", ((TEMulti) theTile).getTexture(par5)); return theTile.getBlockMetadata(); } return 0; } @Override //Only for the item in hand public int getBlockTextureFromSideAndMetadata(int side, int meta) { return meta; } @SideOnly(Side.CLIENT) public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { for (int var4 = 0; var4 < 26; ++var4) { par3List.add(new ItemStack(par1, 1, var4)); } } } TEMulti: package TreviModdingCrew.PowerPlusPlus.blocks; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import cpw.mods.fml.common.network.PacketDispatcher; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraft.tileentity.TileEntity; import TreviModdingCrew.PowerPlusPlus.PacketHandler; public class TEMulti extends TileEntity { public int baseBlockID; public int baseMetadata; public TEMulti() { super(); } public TEMulti(int s, int b, int d) { super(); baseBlockID = b; baseMetadata = d; } Block getBaseBlock() { return Block.blocksList[baseBlockID]; } public void readFromNBT(NBTTagCompound tc) { super.readFromNBT(tc); baseBlockID = tc.getInteger("BaseID"); baseMetadata = tc.getInteger("BaseData"); } public void writeToNBT(NBTTagCompound tc) { super.writeToNBT(tc); tc.setInteger("BaseID", baseBlockID); tc.setInteger("BaseData", baseMetadata); } @Override public Packet getDescriptionPacket() { NBTTagCompound tagCompound = new NBTTagCompound(); this.writeToNBT(tagCompound); return PacketHandler.packetFromTileEntity(this); } public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { //NBTTagCompound tag = packet.customParam1; //blockMetadata = tag.getInteger("BaseData"); this.readFromNBT(packet.customParam1); } }
  7. That's what i'm actually doing automaticly with this code: for (var7 = 0; var7 < 2; ++var7) { for (var8 = 0; var8 < 3; ++var8) { par1World.setBlockWithNotify(par2 + var5 * var7, par3 + var8, par4 + var6 * var7, Major.ObsidiPortal.blockID); } }
  8. Well... I made a custom dimension staff item, that should fill the whole portal with my portal block... It just adds one single portal block above the portal "case", not filling the whole portal Here my code: ItemDimensionStaff: BlockObsidiPortal
  9. Where is the EntityPlayer in itemInteractionForEntity? That's my problem...
  10. Well, I know there's some function called "hitEntity" which has 3 parameters: ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving. 1st one is the ItemStack that is being leftclicked, 2nd one is the entity that gets hit and the 3rd one is the entity that does all this. Now my question is: is there some function that has the same parameters but is being used for rightclicking? Greetings.
  11. Fixxed it by using this inside the class: this.setLightOpacity(0);
  12. Well, first I had the problem with the stairs, which i fixxed now... Another problem NOW is, that I want to create a custom slab. Works fine, except that if I place a slab on another one, they won't get to a full slab... First problem fixxed, Now... well... when I place a slab or a stair next to a block (e.g. grass or dirt), they have "no" lightning, or brightness (whatever)...
  13. I fixxed the problem now, by looking over all assigned block id's again, and mentioned... that forge doesn't show up an error in eclipse if 2 blocks have the same id?
  14. Directly out of eclipse: 2012-09-28 11:23:03 [iNFO] [ForgeModLoader] Forge Mod Loader version 3.0.165.344 for Minecraft client:1.3.2, server:1.3.2 loading 2012-09-28 11:23:04 [iNFO] [sTDOUT] 27 achievements 2012-09-28 11:23:04 [iNFO] [sTDOUT] 195 recipes 2012-09-28 11:23:04 [iNFO] [sTDOUT] Setting user: Player509, - 2012-09-28 11:23:04 [iNFO] [sTDERR] Client asked for parameter: server 2012-09-28 11:23:04 [iNFO] [sTDOUT] LWJGL Version: 2.4.2 2012-09-28 11:23:05 [iNFO] [ForgeModLoader] Attempting early MinecraftForge initialization 2012-09-28 11:23:05 [iNFO] [ForgeModLoader] Completed early MinecraftForge initialization 2012-09-28 11:23:05 [iNFO] [ForgeModLoader] Searching C:\Users\Du5tin\Desktop\AVD\6\MCP\1.3.2\jars\mods for mods 2012-09-28 11:23:05 [iNFO] [ForgeModLoader] No mcmod.info file found in directory bin 2012-09-28 11:23:05 [iNFO] [ForgeModLoader] The mod container minecraft.jar appears to be missing an mcmod.info file 2012-09-28 11:23:06 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 3 mods to load
  15. Well... doesn't matter if i'm trying to extend or copying it, I always getting kicked to the com.google.common.eventbus.EventBus class in eclipse, means my minecraft doesn't even start correctly ...
×
×
  • Create New...

Important Information

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