Jump to content

MyOwnHarem

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by MyOwnHarem

  1. The whole class is a custom property, and the register method is the only new initialization of it. So I thought thats what you meant by static properties, and ive never heard anyone call variables properties. But now that this is solved I shall lock it cause it's just spam now.
  2. Well I do appreciate your help. I dont ask for code, but I honestly thought you were talking about the register and get methods being static, never even noticed the variables were static. And because you helped point it out, I noticed and that wws the solution. Thank you for all your help! =o)
  3. I do know java, quite well actually and I do know what static means and why youd say that. The issue wasnt that I didnt know, the issue was the rude reply, true better than none, but could have been done nicer without sarcasm. Btw, from what I do know of java, static is only 1 instance or things like variables and methods can be used without instantiating. And thank you for replying again even though I myself was a little rude as well.
  4. Obviously sarcasm, and obviously a solution/alternative way of doing this. Care to inform or "Support" instead of that sarcasm that doesn't really help anyone. I'm trying to learn, Don't bring me up to your level.
  5. My NBTTagCompound isn't working with SMP. It will edit everyone's properties. Also the player chat message only sends to the last person to log in. Attatching my mod project files to use for reference. It's a lot of code to post on here and would be better understood if ran on server and opened with eclipse. ^ Not letting me upload [ Can't access upload files ], any other place to upload? If not here is the extended property file: package com.MyOwnHarem.mod.mmoworld.properties.stats; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.IExtendedEntityProperties; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; public class MiningStatProperty implements IExtendedEntityProperties { public static final String EXT_PROP_NAME = "MiningStat"; private static EntityPlayer player; private static int miningXP; public MiningStatProperty(EntityPlayer player) { this.player = player; this.miningXP = 0; } public static final void register(EntityPlayer player) { player.registerExtendedProperties(EXT_PROP_NAME, new MiningStatProperty(player)); } public void addMiningXP(int amount) { this.miningXP += amount; player.addChatMessage(EnumChatFormatting.GREEN + "You have gained " + amount + " of XP for Mining!"); player.addChatMessage(EnumChatFormatting.DARK_GREEN + "You now have " + this.miningXP + " of XP in Mining"); this.sync(); } public static final MiningStatProperty get(EntityPlayer player) { return (MiningStatProperty) player.getExtendedProperties(EXT_PROP_NAME); } @Override public void saveNBTData(NBTTagCompound compound) { NBTTagCompound properties = new NBTTagCompound(); properties.setInteger("MiningXP", this.miningXP); compound.setTag(EXT_PROP_NAME, properties); } @Override public void loadNBTData(NBTTagCompound compound) { NBTTagCompound properties = (NBTTagCompound) compound.getTag(EXT_PROP_NAME); this.miningXP = properties.getInteger("MiningXP"); } @Override public void init(Entity entity, World world) { } public void sync() { ByteArrayOutputStream bos = new ByteArrayOutputStream(; DataOutputStream outputStream = new DataOutputStream(bos); try { outputStream.writeInt(this.miningXP); } catch (Exception e) { e.printStackTrace(); return; } Packet250CustomPayload packet = new Packet250CustomPayload("mmoworld", bos.toByteArray()); if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { // EntityPlayerMP playerMP = (EntityPlayerMP) player; // PacketDispatcher.sendPacketToPlayer(packet, (Player) player1); // [ Gives ClassCastException: net.minecraft.client.entity.EntityClientPlayerMP cannot be cast to net.minecraft.entity.player.EntityPlayerMP ] PacketDispatcher.sendPacketToPlayer(packet, (Player) player); } } }
  6. It works fine on the y axis, it seems it's just the x axis
  7. I am having problems with set bounds. I've modeled a block, about 2x2 in size, and set it's bounds to this: // x axis bounds // -1.0f - 0.0f Left // 0.0f - 1.0f Right // y axis bounds // 0.0f - 1.0f Bottom // 1.0f - 2.0f Top // z axis bounds // 0.5f Front // 0.6f Back this.setBlockBounds(-1.0f, 0.0f, 0.5f, 1.0f, 2.0f, 0.6f); when I look at the bottom left part (-1.0f) on the bounds, it shows the bounds and encompasses the whole block, however, if I look at any other position on the other 3 sections of the model, then the bounds disappear/don't show up, as well as the right 2 blocks have no collision but the left 2 blocks do have collision. But the top left one like all the right blocks don't render the bounds when looked at. How do I get the bounds to display on all portions, and make all portions solid? *Working on uploading screenshots*
  8. Ok, thanks =o)
  9. Have infinite sprite indexes been removed? Or can anyone show me how to use it? I haven't modded since 1.3 and nothing I read seems to have them for 1.6.
×
×
  • Create New...

Important Information

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