/** * Deliveres the registered Turbines. * * @return */ public List<TileDamPart> getTurbines() { List<TileDamPart> turbines = new ArrayList<TileDamPart>(); for (TileDamPart part : this.registeredDamParts) { if (part.isTurbine()) { turbines.add(part); } } return turbines; }
@Override public void writeToNBT(NBTTagCompound compound) { compound.setInteger("orientation", this.orientation.ordinal()); compound.setInteger("parts_size", this.registeredDamParts.size()); // TODO registeredDamParts super.writeToNBT(compound); }
/** * Register a part to a Dam and delivieres if it was successfull * * @return */ public boolean registerPart(TileDamPart part) { if (part.isValve()) { // We want only one Valve for each Dam, Noob! return false; } return this.registeredDamParts.add(part); }
@Override public void readFromNBT(NBTTagCompound compound) { orientation = ForgeDirection.getOrientation(compound.getInteger("orientation")); // TODO registeredDamParts int amount = compound.getInteger("parts_size"); for (int i = 0; i < amount; i++) {} super.readFromNBT(compound); }
@Override public void updateEntity() { super.updateEntity(); }