CoopResidentComponent.java
package com.hypixel.hytale.builtin.adventure.farming.component;
import com.hypixel.hytale.builtin.adventure.farming.FarmingPlugin;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.component.Component;
import com.hypixel.hytale.component.ComponentType;
import com.hypixel.hytale.math.vector.Vector3i;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import javax.annotation.Nullable;
public class CoopResidentComponent implements Component<EntityStore> {
public static final BuilderCodec<CoopResidentComponent> CODEC;
private Vector3i coopLocation = new Vector3i();
private boolean markedForDespawn;
public CoopResidentComponent() {
}
public static ComponentType<EntityStore, CoopResidentComponent> getComponentType() {
return FarmingPlugin.get().getCoopResidentComponentType();
}
public void setCoopLocation {
.coopLocation = coopLocation;
}
Vector3i {
.coopLocation;
}
{
.markedForDespawn = markedForDespawn;
}
{
.markedForDespawn;
}
Component<EntityStore> {
();
component.coopLocation.assign(.coopLocation);
component.markedForDespawn = .markedForDespawn;
component;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(CoopResidentComponent.class, CoopResidentComponent::).append( (, Vector3i.CODEC), (comp, ref) -> comp.coopLocation = ref, (comp) -> comp.coopLocation).add()).append( (, BuilderCodec.BOOLEAN), (comp, markedForDespawn) -> comp.markedForDespawn = markedForDespawn, (comp) -> comp.markedForDespawn).add()).build();
}
}