Package de.kumpelblase2.remoteentities.api

Examples of de.kumpelblase2.remoteentities.api.RemoteEntityHandle


  @Override
  public void removeSpeedModifier()
  {
    if(this.m_entity != null)
      this.m_entity.getAttributeInstance(GenericAttributes.d).b(new RemoteSpeedModifier(0, false));
  }
View Full Code Here


  }

  @Override
  public void addSpeedModifier(double inAmount, boolean inAdditive)
  {
    RemoteSpeedModifier modifier = new RemoteSpeedModifier(inAmount, inAdditive);
    if(this.m_entity == null)
      this.m_speedModifier = modifier;
    else
    {
      AttributeInstance instance = this.m_entity.getAttributeInstance(GenericAttributes.d);
View Full Code Here

  public RemoteTradingFeature(String inName, List<TradeOffer> inOfferings)
  {
    super("TRADING");
    this.m_offerings = inOfferings;
    this.m_tradingPlayers = new ArrayList<Player>();
    this.m_merchant = new VirtualMerchant(this);
    this.m_name = inName;
  }
View Full Code Here

  public RemoteTradingFeature(RemoteEntity inEntity, String inName, List<TradeOffer> inOfferings)
  {
    super("TRADING", inEntity);
    this.m_offerings = inOfferings;
    this.m_tradingPlayers = new ArrayList<Player>();
    this.m_merchant = new VirtualMerchant(this);
    this.m_name = inName;
  }
View Full Code Here

  @Override
  public boolean save()
  {
    if(this.getManager().getSerializer() instanceof ISingleEntitySerializer)
    {
      ISingleEntitySerializer serializer = (ISingleEntitySerializer)this.getManager().getSerializer();
      serializer.save(serializer.prepare(this));
      return true;
    }

    return false;
  }
View Full Code Here

          {
            SerializeAs sas = (SerializeAs)an;
            try
            {
              Object value = field.get(inClass);
              parameters.add(new ParameterData(Math.max(0, sas.pos() - 1), field.getType().getName(), value, sas.special()));
              break;
            }
            catch(Exception e)
            {
              RemoteEntities.getInstance().getLogger().warning("Unable to add desire parameter. " + e.getMessage());
View Full Code Here

public class ParameterDataDeserializer implements JsonDeserializer<ParameterData>
{
  @Override
  public ParameterData deserialize(JsonElement inJsonElement, Type inType, JsonDeserializationContext inJsonDeserializationContext) throws JsonParseException
  {
    ParameterData data = new ParameterData();
    JsonObject object = inJsonElement.getAsJsonObject();
    data.pos = object.get("pos").getAsInt();
    data.type = object.get("type").getAsString();
    data.special = (object.has("special") ? object.get("special").getAsString() : "");
    data.value = object.get("value").getAsString();
View Full Code Here

        membersLooked.add(field.getName());
        for(Annotation an : field.getAnnotations())
        {
          if(an instanceof SerializeAs)
          {
            SerializeAs sas = (SerializeAs)an;
            try
            {
              Object value = field.get(inClass);
              parameters.add(new ParameterData(Math.max(0, sas.pos() - 1), field.getType().getName(), value, sas.special()));
              break;
            }
            catch(Exception e)
            {
              RemoteEntities.getInstance().getLogger().warning("Unable to add desire parameter. " + e.getMessage());
View Full Code Here

  public JSONSerializer(Plugin inPlugin, Class<? extends EntityData[]> inDataClass)
  {
    super(inPlugin);
    this.m_dataClass = inDataClass;
    this.m_gson = new GsonBuilder().setPrettyPrinting().registerTypeAdapter(ParameterData.class, new ParameterDataSerializer()).registerTypeAdapter(ParameterData.class, new ParameterDataDeserializer()).create();
  }
View Full Code Here

  public JSONSerializer(Plugin inPlugin, Class<? extends EntityData[]> inDataClass)
  {
    super(inPlugin);
    this.m_dataClass = inDataClass;
    this.m_gson = new GsonBuilder().setPrettyPrinting().registerTypeAdapter(ParameterData.class, new ParameterDataSerializer()).registerTypeAdapter(ParameterData.class, new ParameterDataDeserializer()).create();
  }
View Full Code Here

TOP

Related Classes of de.kumpelblase2.remoteentities.api.RemoteEntityHandle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.